CN110650097A - Data broadcasting method and device and computer readable storage medium - Google Patents

Data broadcasting method and device and computer readable storage medium Download PDF

Info

Publication number
CN110650097A
CN110650097A CN201910890515.6A CN201910890515A CN110650097A CN 110650097 A CN110650097 A CN 110650097A CN 201910890515 A CN201910890515 A CN 201910890515A CN 110650097 A CN110650097 A CN 110650097A
Authority
CN
China
Prior art keywords
node
hash value
data
uplink
node device
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
CN201910890515.6A
Other languages
Chinese (zh)
Other versions
CN110650097B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910890515.6A priority Critical patent/CN110650097B/en
Publication of CN110650097A publication Critical patent/CN110650097A/en
Application granted granted Critical
Publication of CN110650097B publication Critical patent/CN110650097B/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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/15Flow control; Congestion control in relation to multipoint traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • H04L47/806Broadcast or multicast traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks

Abstract

The application discloses a data broadcasting method, a data broadcasting device and a computer readable storage medium, wherein the method can be applied to a block chain network, and comprises the following steps: the method comprises the steps that first node equipment receives first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data; if the source object is a second node device, storing the association relationship between the node information of the second node device and the first hash value into a first source list; generating a first broadcast node set of data to be uplink according to the first source list; the broadcast node set comprises node equipment in the block chain network except the node equipment pointed by the node information in the first source list; and broadcasting the first to-be-uplink data and the first hash value to node equipment in the broadcasting node set. By adopting the method and the device, the broadcasting behavior aiming at the data redundancy to be linked is reduced, so that the occupation of the network bandwidth of the block chain is reduced.

Description

Data broadcasting method and device and computer readable storage medium
Technical Field
The present application relates to the field of data transmission technologies, and in particular, to a data transmission method, an apparatus, and a computer-readable storage medium.
Background
The blockchain network may have a plurality of node devices, which may be referred to as servers, and the transaction data received by each node device is divided into two types, one type is transaction data directly sent from a client, and the other type is transaction data broadcasted by other node devices.
In the prior art, whether each node device receives transaction data directly sent by a client or transaction data broadcasted by other node devices, the received transaction data is broadcasted to all other node devices except the node device in the same block chain network, so that it can be known that one node device often broadcasts the same transaction data by a plurality of different node devices for a plurality of times, which results in a plurality of unnecessary broadcast behaviors, thereby occupying network bandwidth resources.
Content of application
The application provides a data broadcasting method, a data broadcasting device and a computer readable storage medium, which can reduce redundant broadcasting behaviors, thereby reducing occupation of network bandwidth resources.
One aspect of the present application provides a data propagation method, which is applied to a blockchain network, where a plurality of node devices in the blockchain network include a first node device and a second node device, and the data propagation method includes:
the method comprises the steps that first node equipment receives first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data;
if the source object is the second node device, storing the association relationship between the node information of the second node device and the first hash value in a first source list;
generating a broadcast node set of the first to-be-uplink data according to the first source list; the broadcast node set comprises node devices in the block chain network except the node devices pointed by the node information in the first source list;
and broadcasting the first to-be-uplink data and the first hash value to node equipment in the broadcasting node set.
The method for receiving, by the first node device, first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data includes:
the first node equipment receives a data packet to be uplink transmitted by the source object, extracts the first data to be uplink and the first hash value from the data packet to be uplink, and determines the source object corresponding to the data packet to be uplink according to a protocol field in the data packet to be uplink.
Wherein, still include:
if the source object is a client, storing the first hash value, creating the first source list corresponding to the first hash value, and broadcasting the first to-be-uplink data and the first hash value to node equipment in the block chain network except the first node equipment.
Wherein, the block chain network further comprises a third node device; further comprising:
the first node equipment receives second data to be uplink sent by the third node equipment and a second hash value corresponding to the second data to be uplink;
and when the first hash value and the second hash value are detected to be the same, storing the association relationship between the node information of the third node equipment and the first hash value into the first source list, and deleting the second to-be-uplink data.
Wherein, the block chain network further comprises a third node device; further comprising:
the first node equipment receives second data to be uplink sent by the third node equipment and a second hash value corresponding to the second data to be uplink;
and when the first hash value is detected to be different from the second hash value, storing the association relationship between the third node equipment and the second hash value into a second source list, and storing the second to-be-uplink data.
The block chain network further comprises a relay node device and a plurality of common node devices; further comprising:
if the first node equipment is the relay node equipment, the first node equipment broadcasts all received data to be uplink to the plurality of common node equipment respectively; the all data to be uplink comprises the first data to be uplink; the plurality of common node equipments do not broadcast all uplink data to be transmitted to each other.
Wherein, still include:
when the first node equipment detects that the first to-be-uplink data passes legal verification based on a common identification mechanism, generating a block according to the first to-be-uplink data, and adding the block into a block chain.
One aspect of the present application provides a data propagation apparatus, which is applied to a blockchain network, where a plurality of node devices in the blockchain network include a first node device and a second node device, and the data propagation apparatus includes:
a first receiving module, configured to receive, based on the first node device, first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data;
a storage module, configured to store, if the source object is the second node device, an association relationship between the node information of the second node device and the first hash value in a first source list;
a generating module, configured to generate a broadcast node set of the first to-be-uplink data according to the first source list; the broadcast node set comprises node devices in the block chain network except the node devices pointed by the node information in the first source list;
a broadcasting module, configured to broadcast the first to-be-uplink data and the first hash value to node devices in the broadcasting node set.
Wherein the first receiving module is further configured to:
receiving a data packet to be uplink transmitted by the source object, extracting the first data to be uplink and the first hash value from the data packet to be uplink, and determining the source object corresponding to the data packet to be uplink according to a protocol field in the data packet to be uplink.
Wherein the data dissemination apparatus is further configured to:
if the source object is a client, storing the first hash value, creating the first source list corresponding to the first hash value, and broadcasting the first to-be-uplink data and the first hash value to node equipment in the block chain network except the first node equipment.
Wherein, the block chain network further comprises a third node device; the data dissemination device further comprises:
a second receiving module, configured to receive second to-be-uplink data sent by the third node device and a second hash value corresponding to the second to-be-uplink data;
a first detecting module, configured to store, when it is detected that the first hash value is the same as the second hash value, an association relationship between the node information of the third node device and the first hash value in the first source list, and delete the second to-be-uplink data.
Wherein, the block chain network further comprises a third node device; the data dissemination device further comprises:
a third receiving module, configured to receive second to-be-uplink data sent by the third node device and a second hash value corresponding to the second to-be-uplink data;
and the second detection module is configured to, when it is detected that the first hash value is different from the second hash value, store the association relationship between the third node device and the second hash value in a second source list, and store the second to-be-uplink data.
The block chain network further comprises a relay node device and a plurality of common node devices; the data dissemination apparatus is further configured to:
if the first node equipment is the relay node equipment, the first node equipment broadcasts all received data to be uplink to the plurality of common node equipment respectively; the all data to be uplink comprises the first data to be uplink; the plurality of common node equipments do not broadcast all uplink data to be transmitted to each other.
Wherein the data dissemination apparatus is further configured to:
when the first node equipment detects that the first to-be-uplink data passes legal verification based on a common identification mechanism, generating a block according to the first to-be-uplink data, and adding the block into a block chain.
An aspect of the application provides a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform a method as in an aspect of the application.
An aspect of the application provides a computer-readable storage medium having stored thereon a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of the above-mentioned aspect.
Receiving first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data through first node equipment; if the source object is the second node device, storing the association relationship between the node information of the second node device and the first hash value in a first source list; generating a broadcast node set of the first to-be-uplink data according to the first source list; the broadcast node set comprises node devices in the block chain network except the node devices pointed by the node information in the first source list; and broadcasting the first to-be-uplink data and the first hash value to node equipment in the broadcasting node set. Therefore, the method provided by the application can store the node information of all the node devices (including the second node device) having an association relation with the first hash value through the first source list, and when the first node device broadcasts the received first to-be-uplink data and the first hash value to the node devices in the blockchain network, the first node device does not need to broadcast the node devices corresponding to the node information stored in the first source list, so that redundant broadcasting behaviors are reduced, and occupation of network bandwidth resources is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described 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 creative efforts.
FIG. 1 is a schematic diagram of a data dissemination scenario provided herein;
fig. 2 is a schematic flow chart of a data transmission method provided in the present application;
FIG. 3a is a schematic diagram of a data processing scenario provided herein;
FIG. 3b is a schematic diagram of a network architecture provided herein;
FIG. 4 is a schematic mapping diagram of a node identifier provided in the present application;
fig. 5 is a schematic structural diagram of a data transmission device provided in the present application;
fig. 6 is a schematic structural diagram of a computer device provided in the present application.
Detailed Description
The technical solutions in the present application will be described clearly and completely with reference to the accompanying drawings in the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the 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.
Please refer to fig. 1, which is a schematic view of a data dissemination scenario provided by the present application. As shown in fig. 1, node device 101a, node device 102a, node device 103a, and node device 104a are all node devices in a blockchain network, and node device 101a, node device 102a, node device 103a, and node device 104a may respectively correspond to one or more servers. The node apparatus 101a may broadcast a service data packet 102b to the node apparatus 102a, where the service data packet 102b includes the data to be uplink 100b and the hash value 101b corresponding to the data to be uplink 100 b. Since hash value 101b was sent by node device 101a to node device 102a, node device 102a may store the mapping between hash value 101b and node device 101a in origin list 104 a. The node apparatus 102a may store the acquired to-be-uplink data 100b, and at the same time, the node apparatus 102a may broadcast the service data packet 102b to other node apparatuses. It is assumed that only the node device 101a, the node device 102a, the node device 103a, and the node device 104a are in the blockchain network where the node device 102a is located, and then the node device 102a may broadcast the service data packet 102b to all other nodes except for itself in the blockchain network, that is, may broadcast the service data packet to each node in the node set 105 b. However, since the mapping relationship between the hash value 101b and the node apparatus 101a is already stored in the source list 104b, indicating that the node apparatus 101a has already received the service data packet 102b, the node apparatus 102a does not need to broadcast the service data packet 102b back to the node apparatus 101 a. Thus, the node set of the node device 102a broadcasting the service data packet 102b may be the node set 106b, and the node devices in the node set 106b may be a set obtained by removing the node devices in the source list 104b from the node devices in the node set 105 b. That is, node device 102a may broadcast the service data packet 102b to node device 103a and node device 104 a.
By the method, reverse broadcasting of data is not needed when the node equipment broadcasts data, for example, when the node equipment A broadcasts the data C to the node equipment B, the node equipment B does not need to broadcast the data C to the node equipment A, and therefore redundant broadcasting behaviors are reduced, occupation of the bandwidth of the block chain network is reduced, and stability of the block chain network is improved.
Please refer to fig. 2, which is a schematic flow chart of a data transmission method provided in the present application, and as shown in fig. 2, the method may include:
step S101, a first node device receives first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data;
specifically, the first node device may be any node device in the blockchain network. The source object may be other node devices in the same blockchain network as the first node device, and the source object may also be not a node device in the blockchain network but a client, that is, the source object of the first to-be-uplink data and the first hash value may be a client or a node device. The first node equipment may receive first to-be-uplink data sent by a source object and a first hash value corresponding to the to-be-uplink data. The first hash value is obtained by performing hash operation on the first to-be-uplink data through a hash algorithm, and the first to-be-uplink data can be any transaction data. Hash operations refer to the transformation of an input of arbitrary length (also called a pre-mapped pre-image) into a fixed-length output, i.e., a hash value, by a hash algorithm, i.e., a function that compresses a message of arbitrary length into a message digest of a fixed length. Moreover, the hash algorithm is a compression algorithm, and the data obtained by the hash operation is often smaller than the data size of the original data, so the data size of the first to-be-uplink data is usually smaller than the corresponding first hash value.
The source object may send a to-be-uplink data packet to the first node device, and the first node device may extract the first to-be-uplink data and a first hash value corresponding to the first to-be-uplink data from the to-be-uplink data packet. And, the pending uplink data packet is obtained by the source object encapsulating the first pending uplink data and the first hash value in the transport layer protocol, therefore, when the first node equipment receives the data packet to be uplink transmitted by the source object, the protocol field in the data packet to be uplink is also acquired correspondingly, the protocol field includes a transport layer protocol used by the source object to transmit the pending uplink packet to the first node device, the protocol field may further include an equipment identifier (which may be a network address or an equipment name of the equipment) of the data originator (i.e., the source object) and the data recipient (i.e., the first node equipment), and the first node equipment may determine, through the equipment identifier in the protocol field, the source object corresponding to the data packet to be uplinked, that is, the device identifier in the protocol field is used to know who the data originator of the data packet to be uplinked is.
Step S102, if the source object is the second node device, storing an association relationship between the node information of the second node device and the first hash value in a first source list;
specifically, the first node device may determine, through the device identifier in the protocol field, who a source object of the to-be-uplink data packet is, and if it is known that the source object is another node device in the blockchain network (at this time, the source object may be referred to as a second node device), the first node device may create a source list corresponding to the first hash value, and the source list may be referred to as a first source list, where the source list is used to store node identifiers of all node devices that broadcast the first hash value to the first node device. The first node device may store an association relationship between node information (which may be any node identification information used to uniquely represent a node, such as a name of the node device or a network address of the node device) of the second node device and the first hash value to the first source list, that is, the first hash value and the node information of the second node device may be stored in the first source list in an association manner, and the first node device may learn, through the association relationship between the first hash value stored in the first source list and the second node device, that the second node device has broadcasted the first hash value and the first to-be-uplink data corresponding to the first hash value to itself.
If the first node device knows that the source object is not other node devices in the blockchain network but a client, the first node device may store data to be uplink and a first hash value sent by the client, and also create the first source list, where the first source list is used to store an association relationship between node information of a node device that broadcasts the first hash value to itself subsequently and the first hash value. Thereafter, the first node device may broadcast the first to-be-uplink data and the first hash value to all other node devices in the blockchain network.
Whether the source object is a node device in the blockchain network or a client, when the first node device subsequently detects that the to-be-uplink data sent to the first node device by other node devices in the blockchain network is the first to-be-uplink data and the hash value is the first hash value, the first node device may store the association relationship between the node device and the first hash value in the first source list, and discard the first to-be-uplink data received at this time (since the first node device has already received the first to-be-uplink data before, only the first to-be-uplink data received for the first time is saved, so that a verification receiving process for the first to-be-uplink data received repeatedly is omitted).
For example, the first node device receives second to-be-uplink data sent by the third node device and a second hash value corresponding to the second to-be-uplink data; when detecting that the first hash value is the same as the second hash value, storing the association relationship between the node information of the third node device and the first hash value in the first source list, and deleting the second to-be-uplink data:
if the first node device receives second to-be-uplink data sent by the third node device and a hash value (referred to as a second hash value) corresponding to the second to-be-uplink data, the first node device may detect whether the second hash value obtained at this time is the same as the stored first hash value, and if so, it proves that the second to-be-uplink data is also the same as the stored first to-be-uplink data, the first node device may store the association relationship between the node information of the third node device and the first hash value in a first source list, that is, store the third node information and the first hash value in association with a first source object. Meanwhile, the first node equipment can delete the second data to be uplink received at the moment, and the second data to be uplink is the same as the stored first data to be uplink, so that the first node equipment can directly discard the second data to be uplink, and the verification and receiving process of the second data to be uplink is reduced.
More, the first node device receives second to-be-uplink data sent by the third node device and a second hash value corresponding to the second to-be-uplink data; when detecting that the first hash value is different from the second hash value, storing the association relationship between the third node device and the second hash value in a second source list, and storing the second to-be-uplink data:
when the first node device receives second to-be-uplink data sent by the third node device and a second hash value corresponding to the second to-be-uplink data, and detects that the second hash value received at this time is different from the first hash value stored before, it indicates that the second to-be-uplink data received at this time is also different from the first to-be-uplink data, and the first node device may create a second source list corresponding to the second hash value. The first node device may store the association between the third node device and the second hash value to the second source list, where the second source list is further used to store the association between the node information of the node device that subsequently sends the second hash value to the first node device and the second hash value. Meanwhile, the first node equipment may store the received second to-be-uplink data. When the first node device subsequently receives the second to-be-uplink data and the second hash value sent by the other node device, the association relationship between the node information of the node device and the second hash value may be stored in the created second source list, and the second to-be-uplink data received at this time is directly discarded, and only the first received second to-be-uplink data (i.e., the second to-be-uplink data sent by the third node device) is reserved.
Step S103, generating a broadcast node set of the first to-be-uplink data according to the first source list; the broadcast node set comprises node devices in the block chain network except the node devices pointed by the node information in the first source list;
specifically, the first node device may generate a broadcast node set for the first to-be-uplink data through the first source list. First, the first node device may broadcast the first to-be-uplink data and the first hash value to all other blockchain node devices except the first node device in the belonging blockchain network. However, since the first node device already stores the first source list for the first hash value and the node information of the second node device is already stored in the first source list, the first node device may know that the second node device has received the first hash value and the first to-be-uplink data and has broadcasted the first hash value to itself, and therefore, the first node device may no longer broadcast the first to-be-uplink data and the first hash value corresponding to the first to-be-uplink data to the second node device. That is, the first node device may broadcast the first to-be-uplink data and the first hash value to other node devices in the blockchain network except for the first node device and the node device (here, the second node device) pointed to by the node information stored in the first source object. Therefore, the first set of broadcasting nodes of the to-be-uplink data generated by the first node device may include node information of other node devices except for the first node device and the second node device in the block chain network to which the first node device belongs.
Step S104, broadcasting the first to-be-uplink data and the first hash value to node equipment in the broadcast node set;
specifically, after obtaining the broadcast node set corresponding to the first to-be-uplink data, the first node device may broadcast the first to-be-uplink data and the first hash value to each node device in the broadcast node set. Each node device in the same blockchain network may store node identifiers of other node devices in the blockchain network, so as to broadcast data (for example, the first to-be-uplink data and the first hash value) to be broadcast to the other node devices subsequently according to the node identifiers of the other node devices. Please refer to fig. 4, which is a schematic mapping diagram of a node identifier provided in the present application. Each node device may maintain a node identifier list as shown in fig. 4, and the node device name and the node identifier may be stored in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol) address and any other information that can be used to identify the node device, and fig. 4 only illustrates the IP address as an example. Here, node id 117.114.151.174 corresponds to node device 1, node id 117.116.189.145, … … corresponds to node device 2, and node id 119.123.789.258 corresponds to node device N. Therefore, the first node device may also broadcast the first to-be-uplink data and the first hash value to each node device in the broadcast node set respectively through the node identifier of each node device in the broadcast node set. For example, when the first node device receives the first to-be-uplink data and the first hash value sent by the second node device, the first to-be-uplink data and the first hash value are already broadcasted, and when the first to-be-uplink data and the first hash value sent by other node devices are subsequently received, the first to-be-uplink data and the first hash value may not be broadcasted to the node devices in the block chain any more.
For example, please refer to fig. 3a, which is a schematic view of a data processing scenario provided in the present application. As shown in fig. 3a, node device d1 can send data 1 to be uplink and hash value 1 to node device d2, and at the same time, node device d2 creates a source list d3 for hash value 1. The source list d3 stores an association relationship between the node information of the node device 1 (here, the name of the node device) and the hash value 1, an association relationship between the node information of the node device 2 and the hash value 1, and an association relationship between the node information of the node device 3 and the hash value 1, which indicate that the node device 1, the node device 2, and the node device 3 have broadcast the hash value 1 and the data to be uplink 1 corresponding to the hash value 1 to the node device d 2. Therefore, the node device d2 can discard the pending uplink data 1 sent by the node device d1 received at this time, and it is not necessary to perform transaction verification on the pending uplink data 1 sent by the node device d 1. In addition, the node device d2 may store the association relationship between the node information of the node device d1 and the hash value 1 in the source list d3, to obtain a source list d 4. Subsequently, when the node device d2 broadcasts the to-be-uplink data 1 and the hash value 1 to other node devices, it may not broadcast the to-be-uplink data 1 and the hash value 1 to the node devices pointed by the node information stored in the source list d4, that is, it may not broadcast the to-be-uplink data 1 and the hash value 1 to the node devices 1, 2, 3 and 1.
When the first node equipment detects that the first to-be-uplink data passes legal verification based on a common identification mechanism, generating a block according to the first to-be-uplink data, and adding the block into a block chain: the block chain network has consensus node equipment, and the number of the consensus node equipment is determined according to the actual application scene, and is not limited. The common identification node device may verify the received first to-be-uplink data, where the common identification mechanism indicates that the first to-be-uplink data is legal when the common identification node device reaching a certain number (the number may be set according to an actual application scenario) among all the common identification node devices verifies that the first to-be-uplink data is legal. When the first to-be-uplink data is verified to be legal by the common identity mechanism, the first node equipment may generate a block according to the first to-be-uplink data, and add the generated block to the block chain network, that is, uplink the first to-be-uplink data. For example, when there are 10 common node equipments in the blockchain network, if there are 7 common node equipments verifying that the first to-be-uplink data is valid, it indicates that the first to-be-uplink data is valid. That is, when at least 7 common node devices in the 10 common node devices verify that the to-be-uplink data is legal, indicating that the first to-be-uplink data is legal, the first node device may generate a block according to the first to-be-uplink data, and perform uplink on the block, i.e., add the block to the block chain. Wherein each tile in the chain of tiles will include a tile head and a tile body. If the block generated by the first node device is the first block in the block chain, the block header included in the block stores the characteristic value (i.e. random number), version number, timestamp and difficulty value of the input information, and the block body stores the input information (which may be the first to-be-uplink data). If the block generated by the first node device is not the first block in the block chain, the block header included in the block stores the input information characteristic value of the current block (i.e., the generated block), the block header characteristic value, the version number, the timestamp and the difficulty value of the parent block (i.e., the last block of the current block, i.e., the block added latest on the block chain before the produced block is added to the block chain), and so on, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, thereby ensuring the security of the input information in the block.
The first node device may receive the transaction data (e.g., the first to-be-uplink data and the first hash value) from the two sources, one is directly sent by the ue, and the other is broadcasted by other node devices in the blockchain network. Since the blockchain network to which the first node device belongs may be constructed based on the p2p network, the transaction data broadcast between the nodes in the blockchain network is from the p2p network, that is, the transaction data broadcast from the other node devices to the first node device may also be referred to as the transaction data from the p2p network. The p2p network refers to a Peer-to-Peer network, i.e., a Peer-to-Peer computer network, is a distributed application architecture for distributing tasks and workloads among peers (peers), and is a networking or network form formed by Peer-to-Peer computing models in an application layer.
More specifically, a plurality of common node devices and relay node devices may exist in the blockchain network, where the node devices in the blockchain network are divided into common node devices, relay node devices, and common node devices (i.e., node devices in the blockchain network that are not common node devices and relay node devices). The relay node equipment is connected with the consensus node equipment, the consensus node equipment only receives the transaction data broadcast by the relay node equipment, but does not receive the transaction data broadcast by other common node equipment in the block chain network, and the received transaction data are not broadcast mutually among the consensus nodes, so that the broadcasting frequency of the transaction data is reduced. The relay node device may receive transaction data broadcast to the client or other common node devices in the blockchain network, and the first node device may be a relay node or other common node devices in the blockchain network. When the first node device is not a relay node device, the first node device does not broadcast the received first to-be-uplink data and the first hash value to the common node, and the first node device may broadcast the first to-be-uplink data and the first hash value to other common node devices and the relay node device in the blockchain network.
If the first node device is the relay node device, the first node device broadcasts all the received data to be uplink respectively to the plurality of common node devices: if the first node device is a relay node device, the first node device broadcasts all received data to be uplink (i.e., transaction data, such as the first data to be uplink and the first hash value) to each co-identified node device in the blockchain network, and when each co-identified node device receives the data to be uplink broadcasted by the relay node device, each co-identified node device does not broadcast the received data to be uplink to other co-identified node devices, and certainly does not broadcast the received data to be uplink to other common node devices in the blockchain network. It can be understood that, when the relay node device receives the first to-be-uplink data and the first hash value, the relay node device broadcasts the received first to-be-uplink data and the first hash value to the common node device, and also broadcasts the first to-be-uplink data and the first hash value to other node devices in the blockchain network.
For example, please refer to fig. 3b, which is a schematic diagram of a network architecture provided in the present application. As shown in fig. 3b, if the source object is the client c1, the client c1 may send the first to-be-uplink data and the first hash value to the first node device c2 (actually, the client c1 may send transaction data to any node device (including a normal node device and a relay node device) in the blockchain network except for the common node device). Node device c2, node device c3, and node device c4 are common node devices in the blockchain network, node device c5 is a relay node device, and node device c6 and node device c7 are consensus node devices. Node device c2 may broadcast the received first to-be-uplink data and the first hash value to node device c3, node device c4, and node device c 5. The node device c2, the node device c3, the node device c4 and the node device c5 may broadcast transaction data (e.g., the first hash value and the first to-be-uplink data) to each other. When node c5 receives the first to-be-uplink data and the first hash value broadcasted by node c2 and has not received the first to-be-uplink data and the first hash value broadcasted by node c4 and node c3, node c5 does not broadcast the received first to-be-uplink data and the first hash value to node c2 any more, but broadcasts the first to-be-uplink data and the first hash value to node c4 and node c3, and at the same time, node c5 also broadcasts the first to-be-uplink data and the first hash value to node c6 and node c 7. When node c5 receives the first to-be-uplink data and the first hash value broadcasted by node c2 and receives the first to-be-uplink data and the first hash value broadcasted by node c4, node c5 will not broadcast the received first to-be-uplink data and the first hash value to node c2 and node c4, but will broadcast the first to-be-uplink data and the first hash value to node c3, and at the same time, node c5 will also broadcast the first to-be-uplink data and the first hash value to node c6 and node c 7. The node device c6 and the node device c7 do not broadcast the received first to-be-uplink data and the first hash value to each other. It is understood that when the node device c3 receives the first to-be-uplink data broadcast by the node device c2 and the first hash value, the node device c3 also creates a source list corresponding to the first hash value, and the node device c3 may store the association relationship between the node information of the node device c2 and the first hash value to the created source list, which is also used for storing the association relationship between the node information of the node device which subsequently broadcasts the first to-be-uplink data and the first hash value to the node device c3 and the first hash value. When the node device c3 broadcasts the first to-be-uplink data and the first hash value to other normal node devices and relay node devices in the blockchain network, it will not broadcast the first to-be-uplink data and the first hash value to the node devices pointed by the node information stored in the created source list. The ue c1 may also send the first to-be-uplink data and the first hash value to the node c3, the node c4, or the node c 5.
The relay node device may also be a seed node device, where the seed node device has the same function and authority of broadcasting transaction data as the relay node device, the relay node device is equivalent to a node executing relay in the blockchain network, and the seed node device is a white list node device in the blockchain network. The relay node and the seed node may also exist at the same time, the relay node device and the seed node device may both broadcast the transaction data to the common node device and the consensus node device in the blockchain network, and both the seed node and the relay node may also receive the transaction data broadcast to them by the common node in the blockchain network.
Receiving first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data through first node equipment; if the source object is the second node device, storing the association relationship between the node information of the second node device and the first hash value in a first source list; generating a broadcast node set of the first to-be-uplink data according to the first source list; the broadcast node set comprises node devices in the block chain network except the node devices pointed by the node information in the first source list; and broadcasting the first to-be-uplink data and the first hash value to node equipment in the broadcasting node set. Therefore, the method provided by the application can store the node information of all the node devices (including the second node device) having an association relation with the first hash value through the first source list, and when the first node device broadcasts the received first to-be-uplink data and the first hash value to the node devices in the blockchain network, the first node device does not need to broadcast the node devices corresponding to the node information stored in the first source list, so that redundant broadcasting behaviors are reduced, and occupation of network bandwidth resources is reduced.
Please refer to fig. 5, which is a schematic structural diagram of a data transmission device provided in the present application. As shown in fig. 5, the data dissemination device 1 may include: a first receiving module 11, a storage module 12, a generating module 13 and a broadcasting module 14;
a first receiving module 11, configured to receive, based on the first node device, first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data;
a storage module 12, configured to store, if the source object is the second node device, an association relationship between the node information of the second node device and the first hash value in a first source list;
a generating module 13, configured to generate a broadcast node set of the first to-be-uplink data according to the first source list; the broadcast node set comprises node devices in the block chain network except the node devices pointed by the node information in the first source list;
a broadcasting module 14, configured to broadcast the first to-be-uplink data and the first hash value to node devices in the broadcasting node set.
For specific implementation of functions of the first receiving module 11, the storage module 12, the generating module 13, and the broadcasting module 14, please refer to steps S101 to S104 in the embodiment corresponding to fig. 2, which is not described herein again.
Wherein, the first receiving module 11 is further configured to:
receiving a data packet to be uplink transmitted by the source object, extracting the first data to be uplink and the first hash value from the data packet to be uplink, and determining the source object corresponding to the data packet to be uplink according to a protocol field in the data packet to be uplink.
Wherein the data dissemination device 1 is further configured to:
if the source object is a client, storing the first hash value, creating the first source list corresponding to the first hash value, and broadcasting the first to-be-uplink data and the first hash value to node equipment in the block chain network except the first node equipment.
Wherein, the block chain network further comprises a third node device; the data dissemination device 1 further comprises a second receiving module 15 and a first detecting module 16:
a second receiving module 15, configured to receive second to-be-uplink data sent by the third node device and a second hash value corresponding to the second to-be-uplink data;
a first detecting module 16, configured to store the association relationship between the node information of the third node device and the first hash value in the first source list when it is detected that the first hash value is the same as the second hash value, and delete the second to-be-uplink data.
For a specific implementation manner of the functions of the second receiving module 15 and the first detecting module 16, please refer to step S102 in the corresponding embodiment of fig. 2, which is not described herein again.
Wherein, the block chain network further comprises a third node device; the data dissemination device 1 further comprises a third receiving module 17 and a second detecting module 18:
a third receiving module 17, configured to receive second to-be-uplink data sent by the third node device and a second hash value corresponding to the second to-be-uplink data;
a second detecting module 18, configured to store the association relationship between the third node device and the second hash value in a second source list and store the second to-be-uplink data when it is detected that the first hash value is different from the second hash value.
For a specific implementation manner of the functions of the third receiving module 17 and the second detecting module 18, please refer to step S102 in the corresponding embodiment of fig. 2, which is not described herein again.
The block chain network further comprises a relay node device and a plurality of common node devices; the data dissemination device 1 is further configured to:
if the first node equipment is the relay node equipment, the first node equipment broadcasts all received data to be uplink to the plurality of common node equipment respectively; the all data to be uplink comprises the first data to be uplink; the plurality of common node equipments do not broadcast all uplink data to be transmitted to each other.
Wherein the data dissemination device 1 is further configured to:
when the first node equipment detects that the first to-be-uplink data passes legal verification based on a common identification mechanism, generating a block according to the first to-be-uplink data, and adding the block into a block chain.
Receiving first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data through first node equipment; if the source object is the second node device, storing the association relationship between the node information of the second node device and the first hash value in a first source list; generating a broadcast node set of the first to-be-uplink data according to the first source list; the broadcast node set comprises node devices in the block chain network except the node devices pointed by the node information in the first source list; and broadcasting the first to-be-uplink data and the first hash value to node equipment in the broadcasting node set. Therefore, the method provided by the application can store the node information of all the node devices (including the second node device) having an association relation with the first hash value through the first source list, and when the first node device broadcasts the received first to-be-uplink data and the first hash value to the node devices in the blockchain network, the first node device does not need to broadcast the node devices corresponding to the node information stored in the first source list, so that redundant broadcasting behaviors are reduced, and occupation of network bandwidth resources is reduced.
Please refer to fig. 6, which is a schematic structural diagram of a computer device provided in the present application. As shown in fig. 6, the computer apparatus 1000 may include: the processor 1001, the network interface 1004, and the memory 1005, and the data dissemination device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 6, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the computer device 1000 shown in fig. 6, the network interface 1004 may provide a network communication function; the user interface 1003 is an interface for providing a user with input; the processor 1001 may be configured to call the device control application stored in the memory 1005 to implement the data propagation method described in the embodiment corresponding to fig. 2.
It should be understood that the computer device 1000 described in this application may perform the description of the data dissemination method in the embodiment corresponding to fig. 2, and may also perform the description of the data dissemination device 1 in the embodiment corresponding to fig. 5, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: the present application further provides a computer-readable storage medium, and the computer-readable storage medium stores the aforementioned computer program executed by the data dissemination device 1, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the data dissemination method in the embodiment corresponding to fig. 2 can be executed, and therefore, details will not be repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer storage medium referred to in the present application, reference is made to the description of the embodiments of the method of the present application.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto but rather by the claims appended hereto.

Claims (10)

1. A data broadcasting method is applied to a blockchain network, and a plurality of node devices in the blockchain network comprise a first node device and a second node device, and the method comprises the following steps:
the method comprises the steps that first node equipment receives first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data;
if the source object is the second node device, storing the association relationship between the node information of the second node device and the first hash value in a first source list;
generating a broadcast node set of the first to-be-uplink data according to the first source list; the broadcast node set comprises node devices in the block chain network except the node devices pointed by the node information in the first source list;
and broadcasting the first to-be-uplink data and the first hash value to node equipment in the broadcasting node set.
2. The method of claim 1, wherein the receiving, by the first node device, the first to-be-uplink data sent by a source object and the first hash value corresponding to the first to-be-uplink data comprises:
the first node equipment receives a data packet to be uplink transmitted by the source object, extracts the first data to be uplink and the first hash value from the data packet to be uplink, and determines the source object corresponding to the data packet to be uplink according to a protocol field in the data packet to be uplink.
3. The method of claim 1, further comprising:
if the source object is a client, storing the first hash value, creating the first source list corresponding to the first hash value, and broadcasting the first to-be-uplink data and the first hash value to node equipment in the block chain network except the first node equipment.
4. The method of claim 1, further comprising a third node device in the blockchain network; further comprising:
the first node equipment receives second data to be uplink sent by the third node equipment and a second hash value corresponding to the second data to be uplink;
and when the first hash value and the second hash value are detected to be the same, storing the association relationship between the node information of the third node equipment and the first hash value into the first source list, and deleting the second to-be-uplink data.
5. The method of claim 1, further comprising a third node device in the blockchain network; further comprising:
the first node equipment receives second data to be uplink sent by the third node equipment and a second hash value corresponding to the second data to be uplink;
and when the first hash value is detected to be different from the second hash value, storing the association relationship between the third node equipment and the second hash value into a second source list, and storing the second to-be-uplink data.
6. The method of claim 1, wherein the blockchain network further comprises a relay node device and a plurality of consensus node devices; further comprising:
if the first node equipment is the relay node equipment, the first node equipment broadcasts all received data to be uplink to the plurality of common node equipment respectively; the all data to be uplink comprises the first data to be uplink; the plurality of common node equipments do not broadcast all uplink data to be transmitted to each other.
7. The method of claim 1, further comprising:
when the first node equipment detects that the first to-be-uplink data passes legal verification based on a common identification mechanism, generating a block according to the first to-be-uplink data, and adding the block into a block chain.
8. A data broadcasting device is applied to a blockchain network, and a plurality of node devices in the blockchain network include a first node device and a second node device, and the data broadcasting device is characterized by comprising:
a first receiving module, configured to receive, based on the first node device, first to-be-uplink data sent by a source object and a first hash value corresponding to the first to-be-uplink data;
a storage module, configured to store, if the source object is the second node device, an association relationship between the node information of the second node device and the first hash value in a first source list;
a generating module, configured to generate a broadcast node set of the first to-be-uplink data according to the first source list; the broadcast node set comprises node devices in the block chain network except the node devices pointed by the node information in the first source list;
a broadcasting module, configured to broadcast the first to-be-uplink data and the first hash value to node devices in the broadcasting node set.
9. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method according to any one of claims 1-7.
CN201910890515.6A 2019-09-20 2019-09-20 Data broadcasting method and device and computer readable storage medium Active CN110650097B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910890515.6A CN110650097B (en) 2019-09-20 2019-09-20 Data broadcasting method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910890515.6A CN110650097B (en) 2019-09-20 2019-09-20 Data broadcasting method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110650097A true CN110650097A (en) 2020-01-03
CN110650097B CN110650097B (en) 2022-05-31

Family

ID=69010871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910890515.6A Active CN110650097B (en) 2019-09-20 2019-09-20 Data broadcasting method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110650097B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112769583A (en) * 2021-02-07 2021-05-07 杭州复杂美科技有限公司 Block chain broadcasting method, computer device and storage medium
CN112988414A (en) * 2021-02-07 2021-06-18 杭州复杂美科技有限公司 Block chain transaction batch broadcasting method, computer equipment and storage medium
CN113438092A (en) * 2021-06-29 2021-09-24 上海万向区块链股份公司 Transaction broadcasting method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102016221700A1 (en) * 2016-11-04 2018-05-09 Bundesdruckerei Gmbh A method for offline authentication of a virtual document
CN108805570A (en) * 2018-06-01 2018-11-13 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN109495249A (en) * 2018-11-23 2019-03-19 全链通有限公司 A kind of date storage method of block catenary system, node and block catenary system
CN109491996A (en) * 2018-09-27 2019-03-19 上海点融信息科技有限责任公司 For the block generation method of block chain network, block data access method, calculate equipment, storage medium
CN109561160A (en) * 2019-01-28 2019-04-02 众安信息技术服务有限公司 Network-initiating node bootstrap technique and equipment based on distributed hash list
CN109767220A (en) * 2019-01-15 2019-05-17 中国联合网络通信集团有限公司 Method of commerce based on block chain and the transaction system based on block chain
WO2019140555A1 (en) * 2018-01-16 2019-07-25 华为技术有限公司 Blockchain construction method and blockchain node

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102016221700A1 (en) * 2016-11-04 2018-05-09 Bundesdruckerei Gmbh A method for offline authentication of a virtual document
WO2019140555A1 (en) * 2018-01-16 2019-07-25 华为技术有限公司 Blockchain construction method and blockchain node
CN108805570A (en) * 2018-06-01 2018-11-13 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN109491996A (en) * 2018-09-27 2019-03-19 上海点融信息科技有限责任公司 For the block generation method of block chain network, block data access method, calculate equipment, storage medium
CN109495249A (en) * 2018-11-23 2019-03-19 全链通有限公司 A kind of date storage method of block catenary system, node and block catenary system
CN109767220A (en) * 2019-01-15 2019-05-17 中国联合网络通信集团有限公司 Method of commerce based on block chain and the transaction system based on block chain
CN109561160A (en) * 2019-01-28 2019-04-02 众安信息技术服务有限公司 Network-initiating node bootstrap technique and equipment based on distributed hash list

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
(美)阿南萨拉姆.斯瓦米等: "Ad-Hoc传感器网络中面向应用的最短路径路由", 《无线传感器网络:信号处理与通信》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112769583A (en) * 2021-02-07 2021-05-07 杭州复杂美科技有限公司 Block chain broadcasting method, computer device and storage medium
CN112988414A (en) * 2021-02-07 2021-06-18 杭州复杂美科技有限公司 Block chain transaction batch broadcasting method, computer equipment and storage medium
CN113438092A (en) * 2021-06-29 2021-09-24 上海万向区块链股份公司 Transaction broadcasting method and system

Also Published As

Publication number Publication date
CN110650097B (en) 2022-05-31

Similar Documents

Publication Publication Date Title
CN107819828B (en) Data transmission method and device, computer equipment and storage medium
CN110650097B (en) Data broadcasting method and device and computer readable storage medium
US10834031B2 (en) Information exchange method, client, and apparatus
CN106330414B (en) Message transmission method and device
US8892768B2 (en) Load balancing apparatus and load balancing method
US9300733B2 (en) System and/or method for client-driven server load distribution
US11743328B2 (en) Computer-implemented system and method for propagation and communication of data in a network such as a blockchain network
US20170054640A1 (en) Device and method for establishing connection in load-balancing system
CN107508822B (en) Access control method and device
EP2472943A1 (en) Method and system for monitoring and tracing multimedia resource transmission
CN107395559B (en) Data processing method and device based on redis
CN110995513A (en) Data sending and receiving method in Internet of things system, Internet of things equipment and platform
CN105991412A (en) Method and device for pushing message
US8650313B2 (en) Endpoint discriminator in network transport protocol startup packets
KR20190042348A (en) Method for replicating database in unidirectional communication environment and apparatus using the same
US8250140B2 (en) Enabling connections for use with a network
US10834179B2 (en) Load balancing
CN104734939A (en) Session keep-alive method and device
CN111064813A (en) Method and device for synchronizing processing messages during block chain consensus processing
CN113259490B (en) Multi-level node network data transmission method based on UDP transmission protocol
CN115361455A (en) Data transmission and storage method and device and computer equipment
CN107645357B (en) Recovery method and device for incomplete transmitted file
EP3408989B1 (en) Detecting malware on spdy connections
CN109792444B (en) Play-out buffering in a live content distribution system
CN112243160A (en) Data transmission method, device, terminal equipment and 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