CN108347350B - Communication method and device - Google Patents

Communication method and device Download PDF

Info

Publication number
CN108347350B
CN108347350B CN201810072794.0A CN201810072794A CN108347350B CN 108347350 B CN108347350 B CN 108347350B CN 201810072794 A CN201810072794 A CN 201810072794A CN 108347350 B CN108347350 B CN 108347350B
Authority
CN
China
Prior art keywords
node
network connection
connection state
neighbor node
neighbor
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
CN201810072794.0A
Other languages
Chinese (zh)
Other versions
CN108347350A (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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201810072794.0A priority Critical patent/CN108347350B/en
Publication of CN108347350A publication Critical patent/CN108347350A/en
Application granted granted Critical
Publication of CN108347350B publication Critical patent/CN108347350B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • 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/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a communication method and a communication device, which are applied to a block chain system comprising a plurality of nodes, wherein the method comprises the following steps: at least one of the plurality of nodes comprises a neighbor node; the neighbor node is a node directly communicating with the node; the method comprises the following steps: aiming at least one neighbor node, the node determines a network connection state value between the node and the neighbor node through a connection message; and if the network connection state value is determined to exceed the first threshold value, stopping data transmission with the neighbor node through the connectionless message.

Description

Communication method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a communication method and apparatus.
Background
In modern life, the existence of certain data (things) is often required to be proved, namely the existence of the data, such as written articles, historical operating instructions, signed contracts and the like, and at the moment, the data needs to be authenticated by a third-party authentication mechanism, and the authentication mode has extremely high requirement on the credit degree of the authentication mechanism, and has the disadvantages of complex operation, high cost and poor timeliness. In order to solve the above-mentioned various problems in data storage by the third-party certification authority, many proposals for data storage by a block chain have been made, and the above-mentioned problems are preferably solved by using a non-centralized structure and a non-modifiable characteristic of the block chain. The current popular blockchain technology is based on a global distributed network, is limited by external operators and propagation distance, and lacks effective control.
With the development of services, the transaction amount of a transaction system gradually increases, a transaction peak occurs in a certain period of time, and when a large amount of transaction data is flushed into a blockchain network, bottlenecks occur in the broadcasting capacity of the blockchain network and the capacity of a billing node for processing the transaction data, so that the services cannot normally operate, and even broadcast storms occur.
In addition, the message is sent in a whole network broadcasting mode, because data transmission on the internet exists network problems such as inevitable delay, the existing distributed network does not have an error correction mechanism at present, and packet loss and packet error are difficult to make up after the occurrence of packet loss and packet error. Therefore, how to improve the distributed data transmission performance and improve the reliability and credibility of data storage is a problem that needs to be solved urgently at present.
Disclosure of Invention
The embodiment of the application provides a communication method and a communication device, which are used for distributed data transmission performance and improving the processing efficiency of a distributed network.
The embodiment of the application provides a communication method, which is applied to a block chain system comprising a plurality of nodes, wherein at least one node in the plurality of nodes comprises a neighbor node; the neighbor node is a node directly communicating with the node; the method comprises the following steps:
aiming at least one neighbor node, the node determines a network connection state value between the node and the neighbor node through a connection message; and if the network connection state value is determined to exceed the first threshold value, stopping data transmission with the neighbor node through the connectionless message.
A possible implementation manner is that, the node determines a network connection state value between the node and the neighboring node through a connection packet, including:
if the network connection state with the neighbor node is determined to be a normal state, determining that the network connection state value is unchanged;
and if the network connection state of the neighbor node is determined to be an abnormal state, increasing the network connection state value.
A possible implementation manner, after stopping data transmission with the neighbor node, further includes:
and if the network connection state with the neighbor node is determined to be recovered to be normal, attenuating the network connection state value along with time according to a preset rule.
In one possible implementation, the method further includes:
and if the network connection state value is determined to be smaller than or equal to a second threshold value, carrying out data transmission between the neighbor node and the node again through a connectionless message.
A possible implementation manner is that, the node determines a network connection state value between the node and the neighboring node through a connection packet, including:
the node sends a heartbeat packet to the neighbor node;
and the node determines whether the network connection state with the neighbor node is a normal state or not according to whether the heartbeat response returned by the neighbor node is received or not in preset time.
The embodiment of the application provides a communication device, which is applied to a block chain system comprising a plurality of nodes, wherein at least one node in the plurality of nodes comprises a neighbor node; the neighbor node is a node directly communicating with the node; the device comprises:
an obtaining unit, configured to determine, for at least one neighbor node, a network connection state value between the node and the neighbor node through a connection packet;
and the processing unit is used for stopping data transmission with the neighbor node through the connectionless message if the network connection state value is determined to exceed the first threshold value.
In one possible implementation manner, the obtaining apparatus is specifically configured to: if the network connection state with the neighbor node is determined to be a normal state, determining that the network connection state value is unchanged; and if the network connection state of the neighbor node is determined to be an abnormal state, increasing the network connection state value.
In one possible implementation, the processing unit is further configured to:
and if the network connection state with the neighbor node is determined to be recovered to be normal, attenuating the network connection state value along with time according to a preset rule.
In one possible implementation, the processing unit is further configured to:
and if the network connection state value is determined to be smaller than or equal to a second threshold value, carrying out data transmission between the neighbor node and the node again through a connectionless message.
In one possible implementation manner, the obtaining unit is further configured to: the node sends a heartbeat packet to the neighbor node; and the node determines whether the network connection state with the neighbor node is a normal state or not according to whether the heartbeat response returned by the neighbor node is received or not in preset time.
To sum up, the present embodiment provides a communication method and apparatus, which are applied to a block chain system including a plurality of nodes, where at least one of the plurality of nodes includes a neighbor node; the neighbor node is a node directly communicating with the node; the method comprises the following steps: aiming at least one neighbor node, the node determines a network connection state value between the node and the neighbor node through a connection message; and if the network connection state value is determined to exceed the first threshold value, stopping data transmission with the neighbor node. In the embodiment of the application, the monitoring of the network state of the neighbor node can be realized through the connectionless message in the block chain system; further determining a network connection state value between the node and the neighbor node; when the network connection state value exceeds the first threshold value, the data transmission between the network connection state value and the first threshold value is stopped, so that the neighbor nodes with poor network states are restrained, the occupation of invalid data transmission on network resources is effectively eliminated, and the utilization rate of the network resources is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a block chain system architecture according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a communication device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The blockchain is a brand new technology, namely a bitcoin technology which appears in 2008 for tire removal, and provides a decentralized credit establishment paradigm without trust accumulation. In this paradigm, anyone who is not knowledgeable about each other can achieve a consensus of credit by adding a publicly transparent database, through point-to-point accounting, data transfer, authentication, or contracts, without the need for any intermediary. The public transparent database comprises all transaction records, historical data and other related information in the past, all the information is stored in a distributed mode and can be checked transparently, and the information can be guaranteed not to be tampered illegally in a cryptographic protocol mode.
The block chain technology is a technical scheme for maintaining a reliable database collectively in a decentralized and trust-removing mode, and more generally speaking, the block chain technology is a mode for people to participate in accounting.
In the block chain network, a certain accounting node in the block chain network receives the transaction data sent by the server, the accounting node broadcasts the received transaction data to other accounting nodes, each accounting node performs accounting after receiving a certain amount of transaction data, and the accounting node which succeeds in accounting generates a block of the transaction data so as to allow other nodes in the block chain network to download the block, thereby achieving the mode of citizen participating in accounting. The broadcasting mode of the block chain is mainly used for the same switch or adjacent switches, and has low delay and relatively high reliability. In consideration of the billing interval, the existing block chain information can be transferred for data sharing in a multicast mode, that is, the user equipment with the same type of data serves as a group of broadcasted nodes for sharing the same type of data, and the load of the server can be saved.
In order to better understand the overall architecture of the system in the present embodiment, the following description is made on the overall architecture of the system, and the architecture of the system is shown in fig. 1 as follows:
fig. 1 illustrates an example of a blockchain system provided by an embodiment of the present application, which includes a plurality of nodes. Wherein, the nodes are dynamically networked through a Peer-to-Peer network (P2P) to form a decentralized system. Fig. 1 is a schematic diagram of a feasible blockchain system architecture provided by an embodiment of the present invention, as shown in fig. 1, the blockchain system includes a node 0, a node 1, a node 2, a node 3, and a node 4, and these five nodes are peer-to-peer nodes with each other, and a decentralized system is formed by P2P dynamic networking. The straight lines in fig. 1 represent the data transmission relationship between nodes, and the neighbor node of each node is a node directly communicating with the node. Taking node 2 as an example, the neighbor nodes of node 2 are node 0, node 1 and node 3; node 2 broadcasts a message to the neighbor nodes of node 2, and the broadcast message of node 2 may be received by node 0, node 1, and node 3.
When the block chain system provided by the embodiment of the application is used for writing data, any node in a plurality of nodes of the system can be used as a receiving node to receive the data to be written; the receiving node sends a data writing request to the other nodes according to the data to be written; the data writing request comprises the data to be written; the data writing request is used for indicating any one of other nodes to store the data to be written into the respective data set to be written, namely for any one of the other nodes, after receiving the data writing request, acquiring the data to be written therein and storing the data into the respective data set to be written.
Taking the example of the blockchain system shown in fig. 1 as an example, the node 2 serves as a receiving node to receive data to be written; the node 2 stores the data to be written into a local data set to be written into, and sends data writing requests to the node 0, the node 1 and the node 3; the data writing request comprises data to be written; the node 0, the node 1 and the node 3 store data to be written in the data writing request into respective data sets to be written, and the node 1 or the node 3 continuously forwards the data writing request to the node 4; the node 4 receives the data writing request which arrives at the node 1 and the node 3 firstly, and stores the data to be written in the data writing request into the data set to be written in the node 4.
It should be understood that the technical solution of the embodiment of the present application can be applied to various distributed systems, such as a bitcoin system. In the embodiment of the application, the data sent by the plurality of servers may be sent immediately after the servers determine that the data needs to be uploaded, may be sent periodically, or may be obtained periodically from each server. The stored data can be an object, such as transfer, and the object can comprise information such as time, account numbers of both transfer parties, transfer amount and the like; if the text record is a text record, the object comprises the information content and the identification of the information sender; the type of storage may be file storage, cache, relational data storage, non-relational data storage, etc. for guaranteeing availability of data, and the type of storage includes, but is not limited to, these types, and may also be other types.
The block chain technology is based on a global distributed network, the technology generally uses broadcast or multicast to transmit data, and is limited by an external operator and a propagation distance, along with the development of services, the transaction amount of a transaction system gradually increases, a transaction peak occurs in a certain period of time, and when a large amount of transaction data flows into the block chain network, the broadcast capacity of the block chain network and the capacity of a bookkeeping node for processing the transaction data become bottlenecks, so that the services cannot normally operate, and even broadcast storms are generated. If the broadcast flooding is not effectively controlled, the data transmission may be blocked in serious cases.
The prior art can ensure the processing capacity of the transaction in the network by giving up recording part of the data through the custom rule, which may cause the loss of part of the transaction data.
When data transmission is carried out on the Internet, delay of more than 1ms is added every 10 kilometers, so that the problem of packet loss and packet error is caused. Compared with a unicast protocol, the distributed network has no error correction mechanism, and packet loss and packet error are difficult to make up. Thus, the distributed data is at risk of being lost and the data cannot be retrieved.
Fig. 2 is a schematic flowchart illustrating a communication method provided by an embodiment of the present application, which is applied to a blockchain system including a plurality of nodes, where at least one of the plurality of nodes includes a neighboring node; the neighbor node is a node directly communicating with the node; as shown in fig. 2, the method comprises the following steps:
step 201: aiming at least one neighbor node, the node determines a network connection state value between the node and the neighbor node through a connection message;
step 202: and if the network connection state value is determined to exceed the first threshold value, stopping data transmission with the neighbor node through the connectionless message.
The connected message is a message in which the sender must establish a reliable connection with the receiver before data is formally received and sent, and the receiver is determined to be capable of correctly receiving the data sent by the sender. Such as Transmission Control Protocol (TCP) messages. The connectionless message is a response message of receiving data returned by the receiver, which is not needed to be established by the sender and the receiver, so as to determine whether the receiver correctly receives the data. Such as User Datagram Protocol (UDP) messages.
Prior to step 201, at least one neighbor node of the node may be determined by:
step one, the node sends a TCP registration request message to a neighbor node;
step two, after receiving the TCP registration request message, the neighbor node sends a response message of the TCP registration request to the node;
step three, if the node receives a response message of a TCP registration request sent by the neighbor node within a preset time, determining the neighbor node as the neighbor node of the node; the node sends a null packet request to the at least one neighboring node.
And step four, the at least one neighbor node sends a null packet request to the node, and the short connection session is ended.
In the first step, the node may determine a neighboring node according to a neighboring node in a preset neighboring node list, or determine a neighboring node of the node according to a node that has performed data transmission with the node last time, which is not limited herein.
In the third step, whether the neighbor node is online at present is determined by determining whether the neighbor node returns a response message of the TCP registration request, so as to determine the neighbor node of the node currently performing data transmission.
For example, referring to fig. 1, the node 2 sends TCP registration request packets to the node 0, the node 1, and the node 3, and if the node 2 receives response packets of the TCP registration requests of the node 0 and the node 1 within a predetermined time and does not receive response packets of the TCP registration request of the node 3, it may be determined that the neighbor nodes of the current node 2 are the node 0 and the node 1.
In the above, the TCP is taken as an example of a short connection session, and in a specific implementation process, a long connection state may also be maintained for the neighboring node after registration is completed by the node, so as to monitor a connection state between the node and the neighboring node in real time.
In order to avoid the problem of time delay (the time required for a packet to travel from one node to another node) caused by TCP transmission, User Datagram Protocol (UDP) may be used instead of transmitting the data required for transmitting a block once using TCP.
Since UDP is a connectionless transport protocol type, a transmitting end cannot determine whether a receiving end correctly receives data transmitted by the transmitting end, and therefore, when a network state of the receiving end is poor, the transmitting end still continuously transmits data packets to the receiving end, which results in occupation of a large amount of network resources.
In the embodiment of the present application, in step 201, the following steps may be included:
step one, the node sends a heartbeat packet to the neighbor node;
and step two, the node determines whether the network connection state of the neighbor node is a normal state according to whether the node receives the heartbeat response returned by the neighbor node in preset time.
In the first step, the heartbeat packet may be sent periodically or in other forms, which is not limited herein.
In the specific implementation process, the method can comprise the following steps:
and if the node determines that the heartbeat response returned by the neighbor node is received in the preset time, determining that the network connection state of the neighbor node is a normal state.
And if the node determines that the heartbeat response returned by the at least one neighbor node is received within the first preset time and the second preset time, determining that the network connection state of the neighbor node is an abnormal state, wherein the abnormal state is network delay.
And if the node determines that the heartbeat response returned by the neighbor node is received after the second preset time, determining that the network connection state of the neighbor node is an abnormal state, and the abnormal state is a non-connection state.
After determining the neighbor node of the node, the node may initialize the network connection state value of the neighbor node, for example, the network connection state value of the neighbor node may be set to 0.
In step 202, the method comprises:
in a possible implementation manner, if the network connection state with the neighbor node is determined to be a normal state, the network connection state value is determined to be unchanged;
in one possible implementation, if the network connection state with the neighbor node is determined to be an abnormal state, the network connection state value is increased.
In the specific implementation process, the value may be a fixed value or a value that changes with time, and is not limited herein.
For example, if the node 2 determines that the connection status of the node 1 at a monitoring time after initialization is abnormal, the network connection status value of the node 1 may be increased to 100. The monitoring time may be a time at which the node determines the network state of the at least one neighbor node to the at least one neighbor node. At the next monitoring time, if the node 2 determines that the connection state of the node 1 at that time is still an abnormal state, the network connection state value of the node 1 may be increased to 200.
If the first threshold is 180, it is determined that the network connection status value of node 1 exceeds the first threshold, and therefore, node 2 will stop data transmission to node 1.
One possible implementation includes:
step one, the node stops sending data to the neighbor node;
step two, the node stops receiving the data sent by the neighbor node to the node;
by stopping sending data to the neighboring nodes, unnecessary overhead of network resources is saved. And for the data sent by the neighbor node to the node, because the network state is poor, the reliability of the data obtained from the neighbor node is low, so that the data is discarded, the processing of the node on unnecessary data is reduced, the resource of the node is saved, the broadcasting capability of a block chain network and the capability of an accounting node on processing transaction data are increased, and the processing efficiency of each node in a block chain is improved.
One possible implementation includes: if the network connection state of the neighbor node and the node is determined to be network delay, a network state alarm can be sent to the neighbor node to inform the neighbor node to stop sending data to the node.
By sending the alarm, the utilization rate of network resources of the block chain can be further improved, and the broadcasting capacity of the block chain network and the capacity of the accounting node for processing transaction data are increased.
By recovering the normal neighbor node after the network state is abnormal, the method can be realized by the following modes in order to reduce the waiting time for the neighbor node to recover the data transmission:
a possible implementation manner, after stopping data transmission with the neighbor node, further includes:
and if the network connection state of the node and the neighbor node is determined to be recovered to be normal, attenuating the network connection state value along with time according to a preset rule.
In a specific implementation process, the preset rule may be in the form of exponential decay, or may be in other forms, which is not limited herein.
In one possible implementation, the method further includes:
and if the network connection state value of the neighbor node stopping data transmission with the node is determined to be less than or equal to a second threshold value, carrying out data transmission between the neighbor node and the node through UDP again.
In order to avoid frequently determining whether the neighbor node performs data transmission or not, and influence the normal operation of the block chain, the second threshold is smaller than the first threshold.
A possible implementation manner may be to set a third threshold of the network connection state value in order to avoid data transmission of a neighboring node that cannot recover the normal network connection state for a long time, and when the network state value reaches the third threshold, the network state value of the neighboring node is not increased any more. The third threshold is greater than the first threshold.
For example, at time t1, if the node 2 determines that the network status of the node 1 is abnormal, the network status value of the node 1 is increased to 100; at the time t2, if the node 2 determines that the network state of the node 1 is abnormal, the network state value of the node 1 is increased to 200; at the time t3, if the node 2 determines that the network state of the node 1 is abnormal, the network state value of the node 1 is increased to 300; at this time, if the network state value of the node 1 exceeds the first threshold (230), the data transmission between the node 1 and the node 2 through the UDP packet is stopped. At the time t4, if the node 2 determines that the network state of the node 1 is recovered to normal, the network state value of the node 1 is attenuated according to a preset rule; at time t5, node 2 determines that the network status value of node 1 is less than the second threshold (180), and data transmission will be resumed between node 1 and node 2 via UDP packets.
A possible implementation manner, before stopping data transmission with the neighbor node, further includes:
and if the network connection state of the node and the neighbor node is determined to be recovered to be normal, attenuating the network connection state value along with time according to a preset rule.
For example, if the node 2 determines that the connection status of the node 1 at a monitoring time after initialization is abnormal, the network connection status value of the node 1 may be increased to 100. The monitoring time may be a time at which the node determines the network state of the at least one neighbor node to the at least one neighbor node. At the next monitoring time, if the node 2 determines that the connection state of the node 1 at that time is a normal state, the network connection state value of the node 1 may be attenuated according to a preset rule, for example, at the next monitoring time, the network connection state value of the node 1 is attenuated to 80.
For example, referring to fig. 1, as shown in fig. 3, at time t1, node 2 determines that the network status of node 1 is abnormal, and increases the network status value of node 1 to 100; if the network state of the node 1 is determined to be recovered to be normal between the time t1 and the time t2, attenuating the network state value of the node 1 according to a preset rule; at the time t2, the network state value of the node 1 attenuates to 80, and if the node 2 determines that the network state of the node 1 is abnormal, the network state value of the node 1 is increased to 180; if the network state of the node 1 is determined to be recovered to be normal between the time t2 and the time t3, attenuating the network state value of the node 1 according to a preset rule; at the time t3, the network state value of the node 1 attenuates to 150, and if the node 2 determines that the network state of the node 1 is abnormal, the network state value of the node 1 is increased to 250; at this time, if the network state value of the node 1 exceeds the first threshold (230), the data transmission between the node 1 and the node 2 through the UDP packet is stopped. At the time t4, if the node 2 determines that the network state of the node 1 is recovered to normal, the network state value of the node 1 is attenuated according to a preset rule; at time t5, the network status value of node 1 decays to 130, and node 2 determines that the network status value of node 1 is smaller than the second threshold (180), and data transmission will be performed again between node 1 and node 2 through the UDP packet.
The embodiment of the application provides a flow diagram of a communication method, which is applied to a block chain system comprising a plurality of nodes, wherein at least one node in the plurality of nodes comprises a neighbor node; the neighbor node is a node directly communicating with the node; the method comprises the following steps:
step one, the node sends a TCP registration request message to a neighbor node;
step two, after receiving the TCP registration request message, the preset neighbor node sends a response message of the TCP registration request to the node;
and step three, if the node receives a response message of the TCP registration request sent by the neighbor node within the preset time, determining the neighbor node as the neighbor node of the node.
Step four, the node sends a heartbeat packet to at least one neighbor node of the node;
and step five, the node determines whether the network connection state of the at least one neighbor node is a normal state according to whether the heartbeat response returned by the at least one neighbor node is received in preset time.
Step six, aiming at least one neighbor node, the node determines a network connection state value between the node and the neighbor node through the determined network connection state of the at least one neighbor node;
wherein, include:
if the network connection state of the neighbor node is determined to be a normal state, determining that the network connection state value of the neighbor node is unchanged;
if the network connection state of the neighbor node is determined to be an abnormal state, increasing the network connection state value of the neighbor node;
and step seven, if the network connection state value is determined to exceed the first threshold value, stopping data transmission with the neighbor node.
Step eight, if the network connection state of the node and the neighbor node is determined to be recovered to be normal, attenuating the network connection state value of the neighbor node along with time according to a preset rule.
And step nine, if the network connection state value of the neighbor node is determined to be less than or equal to a second threshold value, carrying out data transmission between the neighbor node and the node again through the UPD message.
The embodiment of the application provides a communication device, which is applied to a block chain system comprising a plurality of nodes, wherein at least one node in the plurality of nodes comprises a neighbor node; the neighbor node is a node directly communicating with the node; as shown in fig. 4, the apparatus includes:
an obtaining unit 401, configured to determine, for at least one neighbor node, a network connection state value between the node and the neighbor node through a connection packet;
a processing unit 402, configured to stop performing data transmission with the neighboring node through a connectionless packet if it is determined that the network connection status value exceeds a first threshold.
In a possible implementation manner, the obtaining apparatus 401 is specifically configured to: if the network connection state with the neighbor node is determined to be a normal state, determining that the network connection state value is unchanged; and if the network connection state of the neighbor node is determined to be an abnormal state, increasing the network connection state value.
In one possible implementation, the processing unit 402 is further configured to:
and if the network connection state with the neighbor node is determined to be recovered to be normal, attenuating the network connection state value along with time according to a preset rule.
In one possible implementation, the processing unit 402 is further configured to:
and if the network connection state value is determined to be smaller than or equal to a second threshold value, carrying out data transmission between the neighbor node and the node again through a connectionless message.
In a possible implementation manner, the obtaining unit 401 is further configured to: the node sends a heartbeat packet to the neighbor node; and the node determines whether the network connection state with the neighbor node is a normal state or not according to whether the heartbeat response returned by the neighbor node is received or not in preset time.
To sum up, the present embodiment provides a communication method and apparatus, which are applied to a block chain system including a plurality of nodes, where at least one of the plurality of nodes includes a neighbor node; the neighbor node is a node directly communicating with the node; the method comprises the following steps: aiming at least one neighbor node, the node determines a network connection state value between the node and the neighbor node through a connection message; and if the network connection state value is determined to exceed the first threshold value, stopping data transmission with the neighbor node. In the embodiment of the application, the occupation of the network resources by the transmission of invalid data is effectively eliminated by inhibiting the neighbor nodes with poor network states, so that the transaction data is ensured not to be lost, the repeated transmission of the transaction data is avoided, the efficiency of processing the transaction data by the network can be improved, and the utilization rate of the network resources is improved.
Based on the same technical concept, the embodiment of the present application further provides a computing device, which may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a Personal Digital Assistant (PDA), and the like. In an exemplary embodiment of the present disclosure, a computing device may include a Central Processing Unit (CPU), a memory, an input device, an output device, and the like, where the input device may include a keyboard, a mouse, a touch screen, and the like, and the output device may include a Display device, such as a Liquid Crystal Display (LCD), a Cathode Ray Tube (CRT), and the like.
The memory may include Read Only Memory (ROM) and Random Access Memory (RAM), and provides the processor with program instructions and data stored in the memory. In this embodiment of the present application, the memory may be configured to store a program of the blockchain generation method provided in this embodiment of the present application, and the processor executes any one of the blockchain generation methods described above according to the obtained program instruction by calling the program instruction stored in the memory.
Based on the same technical concept, embodiments of the present application further provide a computer-readable storage medium for storing computer program instructions for the above-mentioned computing device, which includes a program for executing the blockchain generation method described in any one of the above.
The computer storage media may be any available media or data storage device that can be accessed by a computer, including, but not limited to, magnetic memory (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical memory (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor memory (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs)), etc.
Based on the same technical concept, the embodiment of the present application further provides a computing device, which may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a Personal Digital Assistant (PDA), and the like. In an exemplary embodiment of the present disclosure, a computing device may include a Central Processing Unit (CPU), a memory, an input device, an output device, and the like, where the input device may include a keyboard, a mouse, a touch screen, and the like, and the output device may include a Display device, such as a Liquid Crystal Display (LCD), a Cathode Ray Tube (CRT), and the like.
The memory may include Read Only Memory (ROM) and Random Access Memory (RAM), and provides the processor with program instructions and data stored in the memory. In this embodiment of the present application, the memory may be configured to store a program of the data verification method provided in this embodiment of the present application, and the processor executes the data verification method according to any one of the above-mentioned items by calling the program instruction stored in the memory and according to the obtained program instruction.
Based on the same technical concept, embodiments of the present application further provide a computer-readable storage medium for storing computer program instructions for the above-mentioned computing device, which includes a program for executing the data verification method described in any one of the above-mentioned items.
The computer storage media may be any available media or data storage device that can be accessed by a computer, including, but not limited to, magnetic memory (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical memory (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor memory (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs)), etc.
While the preferred embodiments of the present application 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 alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (6)

1. A communication method is applied to a block chain system comprising a plurality of nodes, and is characterized in that at least one node in the plurality of nodes comprises a neighbor node; the neighbor node is a node directly communicating with the node; the method comprises the following steps:
aiming at least one neighbor node, the node determines a network connection state value between the node and the neighbor node through a Transmission Control Protocol (TCP) message; if the network connection state value is determined to exceed the first threshold value, stopping data transmission with the neighbor node through a User Data Protocol (UDP) message;
if the network connection state with the neighbor node is determined to be recovered to be normal, attenuating the network connection state value along with time according to a preset rule; the preset rule is in the form of exponential decay;
and if the network connection state value is determined to be smaller than or equal to a second threshold value, carrying out data transmission between the neighbor node and the node through the UDP message again.
2. The method of claim 1, wherein the node determining the network connection status value between the node and the neighboring node via a TCP packet comprises:
if the network connection state with the neighbor node is determined to be a normal state, determining that the network connection state value is unchanged;
and if the network connection state of the neighbor node is determined to be an abnormal state, increasing the network connection state value.
3. The method according to any of claims 1-2, wherein the node determining the network connection status value between the node and the neighboring node via a TCP packet comprises:
the node sends a heartbeat packet to the neighbor node;
and the node determines whether the network connection state with the neighbor node is a normal state or not according to whether the heartbeat response returned by the neighbor node is received or not in preset time.
4. A communication apparatus, applied to a blockchain system comprising a plurality of nodes, wherein at least one of the plurality of nodes comprises a neighboring node; the neighbor node is a node directly communicating with the node; the device comprises:
an obtaining unit, configured to determine, by using a TCP packet, a network connection state value between a node and a neighbor node for at least one neighbor node;
the processing unit is used for stopping data transmission with the neighbor node through a UDP message if the network connection state value is determined to exceed a first threshold value;
and is also used for:
if the network connection state with the neighbor node is determined to be recovered to be normal, attenuating the network connection state value along with time according to a preset rule; the preset rule is in the form of exponential decay;
the processing unit is further to:
and if the network connection state value is determined to be smaller than or equal to a second threshold value, carrying out data transmission between the neighbor node and the node through the UDP message again.
5. The apparatus of claim 4, wherein the obtaining unit is specifically configured to: if the network connection state with the neighbor node is determined to be a normal state, determining that the network connection state value is unchanged; and if the network connection state of the neighbor node is determined to be an abnormal state, increasing the network connection state value.
6. The apparatus of any of claims 4-5, wherein the obtaining unit is further to: the node sends a heartbeat packet to the neighbor node; and the node determines whether the network connection state with the neighbor node is a normal state or not according to whether the heartbeat response returned by the neighbor node is received or not in preset time.
CN201810072794.0A 2018-01-25 2018-01-25 Communication method and device Active CN108347350B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810072794.0A CN108347350B (en) 2018-01-25 2018-01-25 Communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810072794.0A CN108347350B (en) 2018-01-25 2018-01-25 Communication method and device

Publications (2)

Publication Number Publication Date
CN108347350A CN108347350A (en) 2018-07-31
CN108347350B true CN108347350B (en) 2022-04-15

Family

ID=62960931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810072794.0A Active CN108347350B (en) 2018-01-25 2018-01-25 Communication method and device

Country Status (1)

Country Link
CN (1) CN108347350B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020037578A1 (en) * 2018-08-22 2020-02-27 区链通网络有限公司 Method, device, and storage medium for controlling use of blockchain resource
CN109444802B (en) * 2018-10-26 2020-12-11 山东德源电力科技股份有限公司 Intelligent electric meter detection method and device, equipment and medium
CN110189161B (en) * 2019-04-26 2022-06-17 华中科技大学 Block chain consensus method and system for realizing marketing label sharing
CN113254306B (en) * 2021-05-10 2022-03-25 支付宝(杭州)信息技术有限公司 Running state monitoring method, device, equipment and storage medium
CN114172828A (en) * 2021-12-08 2022-03-11 河南健创电气科技有限公司 Method for monitoring operation state of communication module of communication terminal

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102215123A (en) * 2011-06-07 2011-10-12 南京邮电大学 Multi-ring-network-topology-structure-based large-scale trunking system
CN106789095A (en) * 2017-03-30 2017-05-31 腾讯科技(深圳)有限公司 Distributed system and message treatment method
CN106789920A (en) * 2016-11-25 2017-05-31 深圳前海微众银行股份有限公司 The joint connecting method and device of block chain
CN107204875A (en) * 2017-05-11 2017-09-26 腾讯科技(深圳)有限公司 Data reporting links monitoring method, device, electronic equipment and storage medium
CN107295080A (en) * 2017-06-19 2017-10-24 北京百度网讯科技有限公司 Date storage method and server applied to distributed server cluster
EP3256998A1 (en) * 2015-02-11 2017-12-20 British Telecommunications Public Limited Company Validating computer resource usage

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102215123A (en) * 2011-06-07 2011-10-12 南京邮电大学 Multi-ring-network-topology-structure-based large-scale trunking system
EP3256998A1 (en) * 2015-02-11 2017-12-20 British Telecommunications Public Limited Company Validating computer resource usage
CN106789920A (en) * 2016-11-25 2017-05-31 深圳前海微众银行股份有限公司 The joint connecting method and device of block chain
CN106789095A (en) * 2017-03-30 2017-05-31 腾讯科技(深圳)有限公司 Distributed system and message treatment method
CN107204875A (en) * 2017-05-11 2017-09-26 腾讯科技(深圳)有限公司 Data reporting links monitoring method, device, electronic equipment and storage medium
CN107295080A (en) * 2017-06-19 2017-10-24 北京百度网讯科技有限公司 Date storage method and server applied to distributed server cluster

Also Published As

Publication number Publication date
CN108347350A (en) 2018-07-31

Similar Documents

Publication Publication Date Title
CN108347350B (en) Communication method and device
CN109636427B (en) Business processing method, device, medium and electronic equipment based on block chain system
WO2021249490A1 (en) Communication method and service data transmission method in blockchain network
JP7432686B2 (en) Probabilistic relay for efficient propagation in blockchain networks
KR102566892B1 (en) Blockchain consensus method, device and system
KR102167613B1 (en) Message push method and device
CN110741573B (en) Method and system for selectively propagating transactions using network coding in a blockchain network
CN101622587B (en) Centralized service for awakening a computing device
US20220158836A1 (en) Fork Processing Method And Blockchain Node
CN112788632B (en) Anti-interference method and device for network access avoidance
CN109600302A (en) A kind of method, apparatus orderly communicated, storage medium and electronic equipment
US11914579B2 (en) Blockchain-based data processing method and apparatus, device, and readable storage medium
CN107819754B (en) Anti-hijacking method, monitoring server, terminal and system
CN114095499A (en) Neutrality verification method and device for block chain relay communication network
CN116684468B (en) Data processing method, device, equipment and storage medium
Alshareef et al. Robust cloud management of MANET checkpoint sessions
CN115033904A (en) Data processing method, apparatus, system, medium, and product
CN108449252B (en) Dump method and device for access log
CN111901366A (en) Data pushing method, device, equipment and storage medium
CN109587241A (en) A kind of data sharing method and its equipment
CN114338479B (en) Communication method, device and system
CN108650267B (en) Block chain data transmission method, device, equipment and storage medium
CN103501272B (en) A kind of flux of multicast retransmission method and equipment
CN115914417B (en) Method, device, equipment and medium for acquiring hidden network threat information
US12010140B1 (en) Metering interactive electronic activities

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