CN111431802A - Block chain node communication optimization system and method - Google Patents

Block chain node communication optimization system and method Download PDF

Info

Publication number
CN111431802A
CN111431802A CN202010216419.6A CN202010216419A CN111431802A CN 111431802 A CN111431802 A CN 111431802A CN 202010216419 A CN202010216419 A CN 202010216419A CN 111431802 A CN111431802 A CN 111431802A
Authority
CN
China
Prior art keywords
node
verification
pairing
verification node
nodes
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.)
Granted
Application number
CN202010216419.6A
Other languages
Chinese (zh)
Other versions
CN111431802B (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202010216419.6A priority Critical patent/CN111431802B/en
Publication of CN111431802A publication Critical patent/CN111431802A/en
Application granted granted Critical
Publication of CN111431802B publication Critical patent/CN111431802B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/123Evaluation of link metrics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Abstract

A system and method for block-link point communication optimization, the system comprising: the system comprises an identity authentication node, a plurality of verification nodes and a plurality of non-verification nodes; the identity authentication node is used for monitoring the topological structure state of the blockchain network, and when the blockchain network structure has a preset rule change, the communication path between the verification node and the non-verification node is calculated through a genetic algorithm according to the communication time counted by the non-verification node, so that an optimal pairing table is obtained; obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node; the non-verification node is used for counting the communication time length between the verification nodes connected with the non-verification node and forwarding the received transaction request to the corresponding verification node according to the pairing result; the verification node is used for executing transaction consensus according to the received transaction request and feeding back a corresponding non-verification node execution result.

Description

Block chain node communication optimization system and method
Technical Field
The invention relates to the technical field of block chains, in particular to a block chain link point communication optimization system and method based on a genetic algorithm.
Background
A blockchain network for a production environment or a test environment is generally made up of a plurality of verification nodes (vp) and non-verification nodes (nvp). The non-verifying node undertakes a portion of the workload stripped from the verifying node, such as processing API requests and processing events, and forwarding transaction requests from the non-verifying node to the verifying node is randomly selected. Block chain performance is largely dependent on consensus algorithms, and the time cost incurred by inter-node communications is often ignored. For the case that a plurality of non-verification nodes and verification nodes are arranged in the network and the physical deployment is far away, for example, one node deploys Beijing, one node deploys New York, one node deploys London, and the communication time cost cannot be ignored. In a blockchain network consisting of multiple verification nodes and non-verification nodes, how to make the non-verification nodes more efficiently search for target verification nodes is one of the methods for improving the performance of the whole blockchain.
Disclosure of Invention
The invention aims to provide a block link point communication optimization system and a block link point communication optimization method.
To achieve the above object, the present invention provides a block link point communication optimization system, which comprises: the system comprises an identity authentication node, a plurality of verification nodes and a plurality of non-verification nodes; the identity authentication node is respectively connected with the verification node and the non-verification node, and the non-verification node is connected with the verification node; the identity authentication node is used for monitoring the topological structure state of the blockchain network, and when the blockchain network structure has a preset rule change, the communication path between the verification node and the non-verification node is calculated through a genetic algorithm according to the communication time counted by the non-verification node, so that an optimal pairing table is obtained; obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node; the non-verification node is used for counting the communication time length between the verification nodes connected with the non-verification node and forwarding the received transaction request to the corresponding verification node according to the pairing result; the verification node is used for executing transaction consensus according to the received transaction request and feeding back a corresponding non-verification node execution result.
In the above communication optimization system for block chain nodes, preferably, the non-verification node includes a message transceiver, a main control unit, an optimal matching table storage device, and a timing device; the message receiving and sending device is used for receiving and sending transaction data through the identity authentication node and the verification node; the main control unit device is used for distributing the transaction data to an optimal matching table storage device or a timing device; the optimal pairing table storage device is used for storing the pairing result sent by the identity authentication node and forwarding the received transaction request to the corresponding verification node according to the pairing result; the timing device is used for counting the communication time length between the verification nodes connected with the timing device and sending the communication time length to the identity authentication node.
In the above block link node communication optimization system, preferably, the verification node includes a message transceiver, a main control unit, a message processor, and a transaction consensus device; the message receiving and sending device is used for receiving and sending transaction data through the connected non-verification node and other verification nodes in the block chain network; the main control unit device is used for distributing the transaction data to a message processing device or a transaction consensus device; the message processing device is used for feeding back a corresponding response message according to a predetermined rule according to the message type feedback of the received transaction data; the transaction consensus device is used for executing transaction consensus according to the received transaction request.
In the above communication optimization system of block chain nodes, preferably, the identity authentication node includes a message transceiver, a main control unit, an optimal pairing table device, and a communication time statistic device; the message receiving and sending device is used for receiving and sending transaction data through the non-verification node; the main control unit device is used for distributing the transaction data to an optimal matching table device or a communication time counting device; the optimal pairing table device is used for monitoring the topological structure state of the block chain network, and when the block chain network is rebuilt, a newly added node is added, and an existing node is withdrawn; calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to a two-dimensional matrix table to obtain an optimal pairing table; obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node; the communication time counting device is used for obtaining the communication time counted by the non-verification nodes and generating a two-dimensional matrix table according to the communication time.
In the above block chain node communication optimization system, preferably, the optimal pairing table device includes a triggering device, a calculating device and an analyzing device; the trigger device is used for monitoring the topological structure state of the block chain network, and starting the computing device when the block chain network is rebuilt, a newly added node is added and an existing node is withdrawn; the computing device is used for computing a communication path between the verification node and the non-verification node through a genetic algorithm according to a two-dimensional matrix table, so that the sum of communication time of the non-verification node and the verification node in the block chain network is smaller than a preset threshold value, and an optimal pairing table in a genetic coding form is obtained; the analyzing device is used for analyzing the optimal matching table according to a preset rule to obtain a routing configuration table, and sending the routing configuration table to the non-verification node.
The invention also provides a block link point communication optimization method, which comprises the following steps: monitoring the topological structure state of the block chain network; when the block chain network structure has a preset rule change, counting the communication time between verification nodes connected with the non-verification nodes through the non-verification nodes, and acquiring the communication time between each non-verification node and the corresponding verification node in the block chain network; calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to the communication duration to obtain an optimal pairing table; obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node; and the non-verification node forwards the received transaction request to the corresponding verification node according to the pairing result.
In the above method for optimizing communication of a blockchain node, preferably, the obtaining an optimal pairing table includes calculating a communication path between the verification node and the non-verification node by a genetic algorithm according to the communication duration: monitoring the topological structure state of the block chain network, and when the block chain network is rebuilt, a newly added node is added or the existing node is withdrawn; generating a two-dimensional matrix table according to the communication duration, and calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to the two-dimensional matrix table; and enabling the sum of the communication time of the non-verification nodes and the verification nodes in the block chain network to be smaller than a preset threshold value, and obtaining an optimal pairing table in a genetic coding form.
In the above method for optimizing communication of a blockchain node, preferably, calculating a communication path between the verification node and the non-verification node according to a two-dimensional matrix table includes: constructing an initial group containing individual code sets of the non-verification nodes and the verification nodes under different pairing relations through the number of the non-verification nodes and the verification nodes in the block chain network; respectively calculating fitness values of the non-verification nodes and the verification nodes in different pairing relations in the initial population; and obtaining the pairing relationship between the non-verification nodes and the verification nodes according to the sorting and screening of the fitness value, and obtaining the communication path between the verification nodes and the non-verification nodes according to the pairing relationship.
In the above method for optimizing communication of blockchain nodes, preferably, the obtaining of the pairing relationship between the non-verification node and the verification node by sorting and screening according to the fitness value further includes: and obtaining the pairing relation between the non-verification nodes and the verification nodes through one or more of cross operation, mutation operation and selection operation according to the fitness value sorting.
The invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method when executing the computer program.
The present invention also provides a computer-readable storage medium storing a computer program for executing the above method.
The invention has the beneficial technical effects that: by utilizing the group evolution capability of the genetic algorithm, the communication capability between the non-verification nodes and the verification nodes on the block chain network is optimized, so that the sum of the communication time reaches or approaches to the minimum, the communication time for the non-verification nodes to forward the transaction request to the verification nodes is reduced, and the overall performance of the block chain is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention. In the drawings:
fig. 1 is a schematic structural diagram of a block link point communication optimization system according to an embodiment of the present invention;
fig. 2A and fig. 2B are schematic structural diagrams of an identity authentication node according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a non-verification node according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a verification node according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an optimal matching table calculation apparatus according to an embodiment of the present invention;
fig. 6 is a flowchart illustrating a block link point communication optimization method according to an embodiment of the present invention;
fig. 7 is a schematic diagram illustrating a statistical flow of communication time between a non-verification node and a verification node according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a transaction flow for computing a best-fit table according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following detailed description of the embodiments of the present invention will be provided with reference to the drawings and examples, so that how to apply the technical means to solve the technical problems and achieve the technical effects can be fully understood and implemented. It should be noted that, unless otherwise specified, the embodiments and features of the embodiments of the present invention may be combined with each other, and the technical solutions formed are within the scope of the present invention.
Additionally, the steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions and, although a logical order is illustrated in the flow charts, in some cases, the steps illustrated or described may be performed in an order different than here.
Referring to fig. 1, the block link node communication optimization system provided by the present invention includes: the system comprises an identity authentication node CA, a plurality of verification nodes VP and a plurality of non-verification nodes NVP; the identity authentication node CA is respectively connected with the verification node VP and the non-verification node NVP, and the non-verification node NVP is connected with the verification node VP; the identity authentication node CA is used for monitoring the state of a topological structure of the blockchain network, and when the blockchain network structure has a preset rule change, the communication path between the verification node VP and the non-verification node NVP is calculated through a genetic algorithm according to the communication time counted by the non-verification node NVP, so that an optimal pairing table is obtained; obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node NVP; the non-verification node NVP is used for counting the communication time length between verification nodes VP connected with the non-verification node NVP and forwarding the received transaction request to the corresponding verification node VP according to the pairing result; the verification node VP is used for executing transaction consensus according to the received transaction request and feeding back a corresponding non-verification node NVP execution result. Therefore, through the system, when a blockchain network is established or a network topology structure changes, the NVP and the VP can be paired again, namely, the pairing of the NVP and the VP is calculated again, so that the communication time between the whole blockchain link point server is optimal; the calculation process of the NVP and VP pairing table is initiated by the CA node, the CA node firstly initiates an instruction for counting the communication time between the nodes, and the NVP nodes feed back the communication time with the VP nodes to the CA node.
For convenience of description, identity authentication nodes are abbreviated as CA nodes, verification nodes are abbreviated as VP nodes, and non-verification nodes are abbreviated as NVP nodes in the following unification; referring again to fig. 1, in practice, the block-node communication optimization system may include a CA node 1, a NVP node 2, a VP node 3, and a private network 4; the CA node 1 is connected with the NVP node 2 through the proprietary network 4, is connected with the VP node 3 through the proprietary network 4, and the NVP node 2 is connected with the VP node 3 through the proprietary network 4. In the following, 1 CA node, 3 NVP nodes, and 4 VP nodes are exemplified.
The CA node 1 is used for monitoring the state of a block chain network topological structure, when the block chain network structure changes, the optimal pairing table recalculation is initiated, the pairing result is sent to the NVP node servers, and interaction with the NVP node servers and the VP node servers is achieved through a proprietary network.
And the NVP node 2 counts the communication time with each VP node, stores the optimal pairing table calculated by the CA node, forwards the transaction request to the corresponding VP node according to the pairing table rule, and interacts with the CA node server and the VP node server through a private network.
And the VP node 3 is used for receiving the transaction request of the NVP, performing transaction consensus, responding the transaction request of the NVP node, and interacting with the CA node server and the NVP node server through a proprietary network.
The private network 4 is a private network within the system.
Referring to fig. 2A, in an embodiment of the present invention, the identity authentication node CA includes a messaging device 11, a main control unit device 12, an optimal pairing table device 40, and a communication time counting device 16; the message receiving and sending device 11 is used for receiving and sending transaction data through the non-verification node; the master control unit device 12 is used for distributing the transaction data to the optimal pairing table device 40 or the communication time counting device 16; the optimal pairing table device 40 is used for monitoring the topological structure state of the block chain network, and when the block chain network is rebuilt, a newly added node is added, and an existing node is withdrawn; calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to a two-dimensional matrix table to obtain an optimal pairing table; obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node; the communication time counting device 16 is configured to obtain the communication time counted by the non-verification node, and generate a two-dimensional matrix table according to the communication time. Further, the optimal pairing table device 40 may include the triggering device 13, the computing device 14, and the analyzing device 15; the trigger device 13 is used for monitoring the topological structure state of the blockchain network, and starting the computing device when the blockchain network is rebuilt, a newly added node is added, and an existing node is withdrawn; the computing device 14 is configured to compute a communication path between the verification node and the non-verification node through a genetic algorithm according to a two-dimensional matrix table, so that a sum of communication time of the non-verification node and the verification node in the block chain network is smaller than a preset threshold value, and an optimal pairing table in a genetic coding form is obtained; the analyzing device 15 is configured to analyze the optimal matching table according to a preset rule to obtain a routing configuration table, and send the routing configuration table to the non-verification node.
Referring to fig. 2B again, in actual operation, the message transceiver 11 is a device for transmitting and receiving transaction data from all NVP nodes. The master control unit device 12 is a master control unit of the CA node, and the transaction data is distributed to the optimal matching table calculation triggering device 13, the optimal matching table calculation device 14, the optimal matching table analysis device 15, and the communication time counting device 16 through the master control unit. The optimal matching table calculation triggering device 13 is responsible for monitoring the network structure state of the block chain, and when the network is reestablished or nodes are added and quit, the optimal matching table calculation device 14 is started. The optimal pairing table calculation device 14 is responsible for calculating optimal pairing of each NVP node server and the VP node server, so that the sum of communication time of the NVP nodes and the VP nodes in the whole blockchain network is minimized. The optimal matching table parsing means 15 is responsible for parsing the optimal matching table in the form of genetic code calculated by the optimal matching table calculation means 14 into a routable configuration table, and sending the routable configuration table to the NVP node through the messaging means 11. The communication time counting device 16 is responsible for collecting communication time from each NVP node to the VP node, and generating a two-dimensional matrix table, each element of the matrix table represents communication time between each NVP node and the VP node, and the optimal pairing table calculating device 14 calculates fitness of each generation of genetic individuals according to the matrix table.
Referring to fig. 3, in an embodiment of the present invention, the non-verification node 2 includes a messaging device 21, a master control unit device 22, an optimal matching table storage device 23, and a timing device 24; the message receiving and sending device 21 is used for receiving and sending transaction data through the identity authentication node and the verification node; the master control unit device 22 is used for distributing the transaction data to an optimal matching table storage device or a timing device; the optimal pairing table storage device 23 is configured to store the pairing result sent by the identity authentication node, and forward the received transaction request to the corresponding verification node according to the pairing result; the timing device 24 is configured to count communication time durations between verification nodes connected to the timing device, and send the communication time durations to the identity authentication node. Specifically, in actual operation, the message sending and receiving device 21 is a device for sending and receiving transaction data from the NVP node server, where the transaction data originates from the CA node and all VP nodes. The master control unit device 22 is a master control unit of the NVP node, and transaction data is distributed to the optimal matching table storage device 23 and the timer device 24 through the master control unit. The optimal pairing table storage device 23 is responsible for storing the optimal pairing table calculated by the CA node, each NVP node corresponds to a VP node one by one, a transaction request received by the NVP is forwarded to the corresponding VP node according to the pairing table for processing, and the sum of communication time between the NVP node and the VP node of the entire network is to be the minimum or close to the minimum. The timer device 24 is responsible for starting the communication time statistic at the CA node 1, recording the time length from the message sending to the message receiving and sending device 21 receiving the VP node response message, that is, the communication time length from the NVP node to the VP node, and sending the data to the communication time statistic device 16 of the CA node 1.
Referring to fig. 4, in an embodiment of the present invention, the verification node 3 includes a message transceiver 31, a main control unit 32, a message processing unit 33, and a transaction recognition unit 34; the message receiving and sending device 31 is configured to receive and send transaction data through the connected non-verification node and other verification nodes in the blockchain network; the master control unit device 32 is used for distributing the transaction data to a message processing device or a transaction consensus device; the message processing device 33 is configured to feed back a corresponding response message according to a predetermined rule according to the message type feedback of the received transaction data; the transaction consensus device 34 is configured to perform a transaction consensus on the received transaction request. In practice, the message transceiver 31 is a transceiver for transmitting and receiving transaction data from the VP node, and the transaction data is originated from other VP nodes and NVP nodes. The master control unit 32 is a master control unit of the VP node, and the transaction data is distributed to the message processing apparatus 33 and the transaction recognition apparatus 34 through the master control unit. The message processing device 33 is a unit for processing messages of the NVP node and other VP nodes, and makes corresponding responses according to message types. The transaction consensus device 34 is a block chain transaction validity detection, consensus processing and contract data updating module, and is used for executing the intelligent contract and verifying the contract rule. The smart contract may be a process running independently in the operating system or may be a piece of code or instructions embedded in the authentication node 1. After receiving the consensus application, the VP node 3 analyzes the transaction details according to the intelligent contract, and votes for consensus according to a byzantine fault-tolerant (PBFT) algorithm.
Referring to fig. 5 again, in an embodiment of the present invention, the optimal pairing table calculation device 14 of the identity authentication node CA may further include an individual encoding device 141, an initial population generating device 142, a crossing operation device 143, a mutation operation device 144, a fitness calculation device 145, a selection operation device 146, and a genetic operation master device 147. The individual coding means 141 are responsible for the de-coding of the problem space into chromosomes of the genetic space which are composed of genes in a certain structure. The initial population generating means 142 is responsible for invoking the individual encoding means 141 to randomly generate a certain number of chromosomes. The cross operation device 143 is responsible for pairing the parent individuals, replacing and recombining partial structures of the two individuals to generate a new individual. The mutation computing device 144 is responsible for determining whether mutation is performed for all individuals in the group according to a predetermined probability, and randomly selecting a mutation site for the individuals performing mutation to perform gene value variation. The fitness calculating device 145 is responsible for measuring the adaptability of all individuals in the group as a judgment basis for the individuals to be reserved in the group. The selection operation device 146 is responsible for sorting all the individuals in the population from high fitness to low fitness, selecting according to a certain rule, and reserving the high-quality individuals with higher probability to participate in the next generation of evolution operation. The genetic operation master control device 147 is responsible for controlling the flow of genetic operations.
Referring to fig. 6, the present invention further provides a method for optimizing block-link point communication, the method comprising:
step S101, monitoring the topological structure state of a block chain network;
step S102, when the block chain network structure has a preset rule change, counting the communication time between verification nodes connected with the non-verification nodes through the non-verification nodes, and acquiring the communication time between each non-verification node and the corresponding verification node in the block chain network;
step S103, calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to the communication time length to obtain an optimal pairing table;
step S104, obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node;
step S105, the non-verification node forwards the received transaction request to the corresponding verification node according to the pairing result.
In the above embodiment, in step S103, calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to the communication duration, and obtaining the optimal matching table may further include: monitoring the topological structure state of the block chain network, and when the block chain network is rebuilt, a newly added node is added or the existing node is withdrawn; generating a two-dimensional matrix table according to the communication duration, and calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to the two-dimensional matrix table; and enabling the sum of the communication time of the non-verification nodes and the verification nodes in the block chain network to be smaller than a preset threshold value, and obtaining an optimal pairing table in a genetic coding form. Further, calculating a communication path between the verification node and the non-verification node according to the two-dimensional matrix table comprises: constructing an initial group containing individual code sets of the non-verification nodes and the verification nodes under different pairing relations through the number of the non-verification nodes and the verification nodes in the block chain network; respectively calculating fitness values of the non-verification nodes and the verification nodes in different pairing relations in the initial population; and obtaining the pairing relationship between the non-verification nodes and the verification nodes according to the sorting and screening of the fitness value, and obtaining the communication path between the verification nodes and the non-verification nodes according to the pairing relationship.
In the above embodiment, the obtaining the pairing relationship between the non-verification node and the verification node according to the fitness value sorting screening further includes: and obtaining the pairing relation between the non-verification nodes and the verification nodes through one or more of cross operation, mutation operation and selection operation according to the fitness value sorting. The specific screening method will be illustrated in its entirety in the following examples, and will not be described in detail here.
To facilitate a clearer understanding of the block-link point communication optimization system and method provided by the present invention, the following provides a general description of the above embodiments, and with reference to the foregoing fig. 1 to 5, 7 and 8, the block-link point communication optimization system provided by the present invention mainly includes two transactions: and (4) calculating communication time statistics of the NVP node and the VP node and calculating a VP node pairing table.
When the blockchain network is created or the topological structure of the blockchain network changes, the communication time of each NVP node and the VP node needs to be recalculated for subsequent recalculation of the optimal pairing for forwarding the transaction request to the VP node by each NVP node, and the following describes technical implementation details of the communication time statistical transaction between the NVP node and the VP node with reference to fig. 7.
Step S601: the VP node pairing table calculation triggering device 13 listens to the block chain network state, sets the VP node pairing table to an initial state when the topology structure changes, and sends a time counting request to the communication time counting device 16.
Step S602: the communication time counting device 16 starts a time counting process, and forwards a time counting request to the main control unit device 22 of each NVP node 2.
Step S603: the master unit means 22 invokes the message transmitting means 21 to send a time count message to the message transmitting means 31 of each VP node 3 and invokes the timer means 24 to start timing.
Step S604: after receiving the time statistic message, the message transceiver 31 forwards the message to the main control unit 32.
Step S605: the master unit means 32 forwards the time statistics message to the message processing means 33.
Step S606: the message processing device 33 performs response processing on the time statistic message, and feeds back the message processing result to the message transmitting/receiving device 21 of the NVP node 2.
Step S607: the message transceiver means 21 receives the response from the message processing means 33 and forwards the result to the master control unit means 22.
Step S608: the master control unit device 22 calls the timer device 24 to finish timing, and the timer device 24 sends the communication time to the communication time counting device 16 of the CA node 1. In order to make the communication time statistics more accurate, the communication time statistics means 16 may initiate statistics a plurality of times and average the communication times.
Step S609: the communication time counting device 16 sends the communication time of each NVP node and VP node to the optimal pairing table computing device 14 for subsequent computation of the optimal pairing of the NVP node and VP node.
When a blockchain network is created or a topological structure of the blockchain network changes, it is necessary to recalculate the optimal pairing for each NVP node to forward a transaction request to the VP node, and details of the technical implementation of calculating the VP node pairing table will be described below with reference to fig. 8.
Step S701: the communication time counting means 16 transmits the communication time between each NVP node and the VP node to the optimal matching table calculating means 14. It is assumed that the blockchain network includes 6 NVP nodes and 6 VP nodes, and communication time (unit: ms) between each NVP node and the VP node is as shown in table 1 below:
TABLE 1
VP0 VP1 VP2 VP3 VP4 VP5
NVP0 35 28 71 33 116 66
NVP1 153 195 199 106 74 79
NVP2 188 133 134 36 90 199
NVP3 67 64 124 130 149 23
NVP4 64 84 106 199 166 56
NVP5 22 198 96 128 167 170
Step S702: the genetic calculation master control device 147 calls the individual encoding device 141 to encode the pairing relationship between each NVP node and the VP node into a chromosome. The encoding rule of the individual is a 6-bit string, each number ranges from 0 to 5, the position of the number represents the NVP node, the numerical value represents the VP node, such as the individual code 341052, which means that NVP0 is paired with VP3, NVP1 is paired with VP4, NVP2 is paired with VP1, and so on.
Step S703: the genetic operation master device 147 calls the initial population generation device 142 to generate the initial population in a random manner, that is, randomly generates a set of arbitrarily arranged character strings. For example, an initial population of 6 individuals, 341052, 104532, 053241, 541230, 104253, 045231, was randomly generated.
Step S704: the genetic operation master control device 147 calls the fitness calculation device 145 to calculate the fitness value of each individual, and the fitness function is designed as follows:
Q=1/T
wherein Q is the fitness value of the individual, and T is the sum of communication time from the NVP node to the VP node corresponding to the individual code, i.e.
Figure BDA0002424604660000111
Wherein t isiIs the communication time of the NVP (i) node and the paired VP node. For example, if the individual code is 104235, T1 indicates the communication time of NVP0 and VP1 node is 28ms, and the sum T of the time of each NVP node and the paired VP node is 764ms, the fitness value Q is 0.001309. It can be seen from the designed formula that the pairing result with small sum of communication time has a larger corresponding adaptability value and a larger possibility of retention.
Step S705: the genetic operation master control device 147 calls the selection operation device 146 to select good individuals from the current population, so that the good individuals have a better chance to participate in next generation propagation as parents. The probability proportional to fitness may be used herein to determine the number of copies of each individual into the next generation population. The specific operation process is as follows:
1. the sum S of the fitness of all individuals in the population is calculated,
Figure BDA0002424604660000112
2. secondly, calculating the relative fitness Q of each individuali(i is 0-5), and carrying out data standardization, namely the probability of each individual being inherited to the next generation group
3. Each probability value constitutes a region, the sum of all probability values being 1
4. Finally, a random number between 0 and 1 is generated, and the number of times each individual is selected is determined according to which probability region the random number appears in, as shown in table 2.
TABLE 2
Figure BDA0002424604660000113
Step S706: the genetic operation master control device 147 calls the cross operation device 143 to randomly select 2 individuals from the 6 individuals generated by the initial population generating device 142 for cross operation, and performs cross transposition on certain parts of the individuals; the cross operation method comprises the following steps:
1. randomly selecting a section of substring for crossing in the second string;
2. the substrings for crossing in the second string are first placed in the same position as the first string, the numbers in the first string that appear in the substring are then removed, and the remaining numbers are sequentially filled into blank positions. For example, if the parent a is 341052, B is 053241, and the cross-substring is 324, the result after the cross-operation is 103245 and B is 321054.
Step S707: the genetic operation master control device 147 calls the mutation operation device 144 to perform mutation operation on each individual of the offspring, sets a mutation probability P, selects a certain individual M and generates a random number D, and if D is greater than or equal to P, performs mutation on the individual M. Randomly selecting a position from the selected string during variation, varying the number N of the position into other numbers N ' (the value range of N ' is 0-5), and replacing the number N ' of the position with N. For example, if the character string is 104532, the mutation position is 4 th bit, and the randomly generated number N' is 2, the result after mutation is 104235.
Step S708: the genetic operation main control device 147 judges the number of iterations of the current genetic operation, terminates the genetic operation when the number of iterations reaches a set value K, and transmits the individual code with the maximum fitness value in the current population to the optimal pairing table analysis device 15. Setting the variation probability P to be 0.8, setting the iteration number K to be 50, setting the final populations of 231450, 054123, 143520, 342150, 143052 and 231405 after 50 rounds of genetic evolution, and setting the corresponding fitness values to be 0.001862, 0.001992, 0.003460, 0.002611, 0.002801 and 0.001443 respectively, so that the individual code with the maximum fitness is 143520.
Step S709: the optimal matching table analyzing device 15 analyzes the optimal individual code 143520 into a matching table of each NVP node and VP node, and sends the matching table to the optimal matching table storage device 23 of each NVP node 2 as shown in table 3, as shown in the following table.
TABLE 3
Figure BDA0002424604660000121
Figure BDA0002424604660000131
As can be seen from Table 3 above, after the population has evolved for 50 generations, the maximum value and the average value of the fitness are obviously improved.
The invention has the beneficial technical effects that: by utilizing the group evolution capability of the genetic algorithm, the communication capability between the non-verification nodes and the verification nodes on the block chain network is optimized, so that the sum of the communication time reaches or approaches to the minimum, the communication time for the non-verification nodes to forward the transaction request to the verification nodes is reduced, and the overall performance of the block chain is improved.
The invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method when executing the computer program.
The present invention also provides a computer-readable storage medium storing a computer program for executing the above method.
As shown in fig. 9, the electronic device 900 may further include: a communication module 910, an input unit 920, an audio processing unit 930, a display 960, a power supply 970. It is noted that the electronic device 900 does not necessarily include all of the components shown in FIG. 9; furthermore, the electronic device 900 may also comprise components not shown in fig. 9, reference being made to the prior art.
As shown in fig. 9, the central processor 800, sometimes referred to as a controller or operational control, may comprise a microprocessor or other processor device and/or logic device, the central processor 800 receiving input and controlling the operation of the various components of the electronic device 900.
The memory 940 may be one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable devices, for example. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 800 may execute the program stored in the memory 940 to realize information storage or processing, etc.
The input unit 920 provides an input to the cpu 800, the input unit 920 is, for example, a key or a touch input device, the power source 970 is used to supply power to the electronic apparatus 900, the display 960 is used to display a display object such as an image and a text, the display may be, for example, an L CD display, but is not limited thereto.
The memory 940 may be a solid state memory such as a Read Only Memory (ROM), a Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 940 may also be some other type of device. Memory 940 includes a buffer memory 941 (sometimes referred to as a buffer). The memory 940 may include an application/function storage 942 for storing application programs and function programs or a flow for executing operations of the electronic device 900 by the central processing unit 800.
The memory 940 may also include a data store 943, the data store 943 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver store 944 of the memory 940 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 910 is a transmitter/receiver 910 that transmits and receives signals via an antenna 911. The communication module (transmitter/receiver) 910 is coupled to the central processor 800 to provide an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 910, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be disposed in the same electronic device. The communication module (transmitter/receiver) 910 is also coupled to a speaker 931 and a microphone 932 via an audio processor 930 to provide audio output via the speaker 931 and to receive audio input from the microphone 932 for general telecommunications functions. Audio processor 930 may include any suitable buffers, decoders, amplifiers and so forth. In addition, an audio processor 930 is also coupled to the central processor 800, enabling recording locally via a microphone 932, and enabling locally stored sound to be played via a speaker 931.
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.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (11)

1. A block-node point-to-point communication optimization system, the system comprising: the system comprises an identity authentication node, a plurality of verification nodes and a plurality of non-verification nodes;
the identity authentication node is respectively connected with the verification node and the non-verification node, and the non-verification node is connected with the verification node;
the identity authentication node is used for monitoring the topological structure state of the blockchain network, and when the blockchain network structure has a preset rule change, the communication path between the verification node and the non-verification node is calculated through a genetic algorithm according to the communication time counted by the non-verification node, so that an optimal pairing table is obtained; obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node;
the non-verification node is used for counting the communication time length between the verification nodes connected with the non-verification node and forwarding the received transaction request to the corresponding verification node according to the pairing result;
the verification node is used for executing transaction consensus according to the received transaction request and feeding back a corresponding non-verification node execution result.
2. The system of claim 1, wherein the non-verification nodes comprise a messaging device, a master control unit device, an optimal matching table storage device, and a timing device;
the message receiving and sending device is used for receiving and sending transaction data through the identity authentication node and the verification node;
the main control unit device is used for distributing the transaction data to an optimal matching table storage device or a timing device;
the optimal pairing table storage device is used for storing the pairing result sent by the identity authentication node and forwarding the received transaction request to the corresponding verification node according to the pairing result;
the timing device is used for counting the communication time length between the verification nodes connected with the timing device and sending the communication time length to the identity authentication node.
3. The system of claim 1, wherein the verification node comprises a messaging device, a master unit device, a message processing device, and a transaction consensus device;
the message receiving and sending device is used for receiving and sending transaction data through the connected non-verification node and other verification nodes in the block chain network;
the main control unit device is used for distributing the transaction data to a message processing device or a transaction consensus device;
the message processing device is used for feeding back a corresponding response message according to a predetermined rule according to the message type feedback of the received transaction data;
the transaction consensus device is used for executing transaction consensus according to the received transaction request.
4. The system according to claim 1, wherein the identity authentication node comprises a messaging device, a master control unit device, an optimal pairing table device and a communication time statistic device;
the message receiving and sending device is used for receiving and sending transaction data through the non-verification node;
the main control unit device is used for distributing the transaction data to an optimal matching table device or a communication time counting device;
the optimal pairing table device is used for monitoring the topological structure state of the block chain network, and when the block chain network is rebuilt, a newly added node is added, and an existing node is withdrawn; calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to a two-dimensional matrix table to obtain an optimal pairing table; obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node;
the communication time counting device is used for obtaining the communication time counted by the non-verification nodes and generating a two-dimensional matrix table according to the communication time.
5. The system of claim 4, wherein the optimal pairing table means comprises triggering means, computing means, and parsing means;
the trigger device is used for monitoring the topological structure state of the block chain network, and starting the computing device when the block chain network is rebuilt, a newly added node is added and an existing node is withdrawn;
the computing device is used for computing a communication path between the verification node and the non-verification node through a genetic algorithm according to a two-dimensional matrix table, so that the sum of communication time of the non-verification node and the verification node in the block chain network is smaller than a preset threshold value, and an optimal pairing table in a genetic coding form is obtained;
the analyzing device is used for analyzing the optimal matching table according to a preset rule to obtain a routing configuration table, and sending the routing configuration table to the non-verification node.
6. A method for optimizing block-link point communication, the method comprising:
monitoring the topological structure state of the block chain network;
when the block chain network structure has a preset rule change, counting the communication time between verification nodes connected with the non-verification nodes through the non-verification nodes, and acquiring the communication time between each non-verification node and the corresponding verification node in the block chain network;
calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to the communication duration to obtain an optimal pairing table;
obtaining a pairing result according to the optimal pairing table and sending the pairing result to the non-verification node;
and the non-verification node forwards the received transaction request to the corresponding verification node according to the pairing result.
7. The method according to claim 6, wherein the calculating a communication path between the verification node and the non-verification node by a genetic algorithm according to the communication duration to obtain an optimal pairing table comprises:
monitoring the topological structure state of the block chain network, and when the block chain network is rebuilt, a newly added node is added or the existing node is withdrawn;
generating a two-dimensional matrix table according to the communication duration, and calculating a communication path between the verification node and the non-verification node through a genetic algorithm according to the two-dimensional matrix table;
and enabling the sum of the communication time of the non-verification nodes and the verification nodes in the block chain network to be smaller than a preset threshold value, and obtaining an optimal pairing table in a genetic coding form.
8. The method of claim 7, wherein computing the communication path between the verification node and the non-verification node according to a two-dimensional matrix table comprises:
constructing an initial group containing individual code sets of the non-verification nodes and the verification nodes under different pairing relations through the number of the non-verification nodes and the verification nodes in the block chain network;
respectively calculating fitness values of the non-verification nodes and the verification nodes in different pairing relations in the initial population;
and obtaining the pairing relationship between the non-verification nodes and the verification nodes according to the sorting and screening of the fitness value, and obtaining the communication path between the verification nodes and the non-verification nodes according to the pairing relationship.
9. The method of claim 7, wherein obtaining the pairing relationship between the non-verification node and the verification node according to the fitness value sorting screening further comprises:
and obtaining the pairing relation between the non-verification nodes and the verification nodes through one or more of cross operation, mutation operation and selection operation according to the fitness value sorting.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 6 to 9 when executing the computer program.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 6 to 9.
CN202010216419.6A 2020-03-25 2020-03-25 Block chain node communication optimization system and method Active CN111431802B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010216419.6A CN111431802B (en) 2020-03-25 2020-03-25 Block chain node communication optimization system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010216419.6A CN111431802B (en) 2020-03-25 2020-03-25 Block chain node communication optimization system and method

Publications (2)

Publication Number Publication Date
CN111431802A true CN111431802A (en) 2020-07-17
CN111431802B CN111431802B (en) 2022-09-16

Family

ID=71555455

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010216419.6A Active CN111431802B (en) 2020-03-25 2020-03-25 Block chain node communication optimization system and method

Country Status (1)

Country Link
CN (1) CN111431802B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112235418A (en) * 2020-11-30 2021-01-15 江西云本数字科技有限公司 Cross-block-chain stable access authentication system and method
CN112738262A (en) * 2020-12-30 2021-04-30 普华云创科技(北京)有限公司 Calculation method and system for selecting optimal node
CN114024848A (en) * 2020-11-23 2022-02-08 北京八分量信息科技有限公司 Method for improving system robustness by optimizing node communication
CN116016543A (en) * 2022-12-15 2023-04-25 浪潮云信息技术股份公司 Block chain network deployment method and system based on ant colony algorithm

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107330786A (en) * 2017-05-19 2017-11-07 杭州云象网络技术有限公司 A kind of block chain network node communication method based on weight
WO2018152519A1 (en) * 2017-02-20 2018-08-23 AlphaPoint Performance of distributed system functions using a trusted execution environment
CN108833515A (en) * 2018-06-05 2018-11-16 上海和数软件有限公司 Block chain node optimization method, device and computer readable storage medium
US20190173666A1 (en) * 2017-12-01 2019-06-06 International Business Machines Corporation Hierarchical blockchain consensus optimazation scheme
CN110377570A (en) * 2017-10-12 2019-10-25 腾讯科技(深圳)有限公司 Node switching method, device, computer equipment and storage medium
CN110417883A (en) * 2019-07-23 2019-11-05 杭州云象网络技术有限公司 A kind of design method of the point to point network structure applied to block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018152519A1 (en) * 2017-02-20 2018-08-23 AlphaPoint Performance of distributed system functions using a trusted execution environment
CN107330786A (en) * 2017-05-19 2017-11-07 杭州云象网络技术有限公司 A kind of block chain network node communication method based on weight
CN110377570A (en) * 2017-10-12 2019-10-25 腾讯科技(深圳)有限公司 Node switching method, device, computer equipment and storage medium
US20190173666A1 (en) * 2017-12-01 2019-06-06 International Business Machines Corporation Hierarchical blockchain consensus optimazation scheme
CN108833515A (en) * 2018-06-05 2018-11-16 上海和数软件有限公司 Block chain node optimization method, device and computer readable storage medium
CN110417883A (en) * 2019-07-23 2019-11-05 杭州云象网络技术有限公司 A kind of design method of the point to point network structure applied to block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李皎: ""考虑信任度和权值的区块链数据通信性能优化研究"", 《中国优秀博硕士学位论文全文数据库(博士) 经济与管理科学辑 2019年第01期》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114024848A (en) * 2020-11-23 2022-02-08 北京八分量信息科技有限公司 Method for improving system robustness by optimizing node communication
CN112235418A (en) * 2020-11-30 2021-01-15 江西云本数字科技有限公司 Cross-block-chain stable access authentication system and method
CN112738262A (en) * 2020-12-30 2021-04-30 普华云创科技(北京)有限公司 Calculation method and system for selecting optimal node
CN116016543A (en) * 2022-12-15 2023-04-25 浪潮云信息技术股份公司 Block chain network deployment method and system based on ant colony algorithm

Also Published As

Publication number Publication date
CN111431802B (en) 2022-09-16

Similar Documents

Publication Publication Date Title
CN111431802B (en) Block chain node communication optimization system and method
CN107171810B (en) Verification method and device of block chain
US20200167366A1 (en) Data processing method and device
CN107276765B (en) Processing method and device for consensus in block chain
CN107079059B (en) Block chain storage method and device and node equipment
US20190074966A1 (en) Revocation of cryptographic keys in the absence of a trusted central authority
US10341431B2 (en) System and method for announcing cryptographic keys on a blockchain
CN110399424B (en) Block generation method, block generation device, block chain node and storage medium
US11911702B2 (en) AI parameter configuration method and apparatus for racing AI model, AI parameter configuration device, and storage medium
CN111539726A (en) Block chain consensus system and method
WO2020115496A2 (en) A node testing method and apparatus for a blockchain system
CN111769948A (en) Block chain-based inter-chain interaction method, system, device and computer equipment
CN110945831B (en) Generation of anti-Sybil attack identities
CN110852882B (en) Packet consensus method, apparatus, device, and medium for blockchain networks
CN102449616A (en) Swarm-based synchronization over a network of object stores
CN108509615B (en) Consensus establishing method and device based on drawing mechanism and readable storage medium
CN111522874A (en) Block chain consensus method, block chain consensus device, computer equipment and storage medium
CN112184219A (en) Secure multiparty computing method, electronic device and storage medium
CN112184220A (en) Secure multiparty computing method, electronic device and storage medium
CN111008249A (en) Parallel chain block synchronization method, device and storage medium
CN112818061A (en) Unstructured data storage method and block chain system
CN111309809A (en) Block header storage method and equipment thereof
WO2020062227A1 (en) Method and device for recognizing apparatus and computer readable storage medium and program
CN107180048B (en) Method and device for identifying idempotent states in database
CN110489231B (en) Transaction information recording method, apparatus and computer readable storage medium

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