CN112422302A - Message broadcasting method, device, network node and computer storage medium - Google Patents

Message broadcasting method, device, network node and computer storage medium Download PDF

Info

Publication number
CN112422302A
CN112422302A CN202110094117.0A CN202110094117A CN112422302A CN 112422302 A CN112422302 A CN 112422302A CN 202110094117 A CN202110094117 A CN 202110094117A CN 112422302 A CN112422302 A CN 112422302A
Authority
CN
China
Prior art keywords
network node
distribution range
network
identification value
hierarchy
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
CN202110094117.0A
Other languages
Chinese (zh)
Other versions
CN112422302B (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.)
Hundsun Technologies Inc
Original Assignee
Hundsun Technologies Inc
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 Hundsun Technologies Inc filed Critical Hundsun Technologies Inc
Priority to CN202110094117.0A priority Critical patent/CN112422302B/en
Publication of CN112422302A publication Critical patent/CN112422302A/en
Application granted granted Critical
Publication of CN112422302B publication Critical patent/CN112422302B/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
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application provides a message broadcasting method, a device, a network node and a computer storage medium, wherein the message broadcasting method comprises the following steps: firstly, determining a distribution range of a first network node; then, K second network nodes are selected from a distribution range corresponding to the first network node; the identification value of each second network node is in the distribution range corresponding to the first network node; k is a positive integer; and finally, aiming at each second network node of which the identification value is not in the filter currently, sending the message to be sent and the distribution range corresponding to the first network node to the second network node, and adding the identification value of the first network node and the identification value of each second network node into the filter. Thus, the redundancy of the message in the broadcasting process is reduced, and therefore, the message can be quickly broadcasted to each node in the distributed network.

Description

Message broadcasting method, device, network node and computer storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for broadcasting a message, a network node, and a computer storage medium.
Background
In the existing distributed network, since there are a large number of unreliable nodes or malicious nodes, a broadcast mechanism is generally adopted to ensure that a message is transmitted to each node in the distributed network.
However, in the current broadcast mechanism, a node may randomly select a peripheral node to send a message at regular intervals, and a node receiving the message may repeat the above steps, so that there is an unavoidable case where the message is repeatedly sent to the same node, and the message redundancy phenomenon is very serious.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, a network node and a computer storage medium for broadcasting a message, which reduce redundancy of the message in a broadcasting process, so that the message can be quickly broadcasted to each node in a distributed network.
A first aspect of the present application provides a method for broadcasting a message, which is applied to a first network node, and includes:
determining a distribution range of the first network node;
selecting K second network nodes from the distribution range corresponding to the first network node; wherein the identification value of each second network node is within the distribution range corresponding to the first network node; k is a positive integer;
and aiming at each second network node of which the identification value is not in the filter currently, sending a message to be sent and a distribution range corresponding to the first network node to the second network node, and adding the identification value of the first network node and the identification value of each second network node into the filter.
Optionally, the determining the distribution range of the first network node includes:
if the first network node is a message source node, determining the full range of the distributed network as the distribution range of the first network node;
and if the first network node is a message transfer node, determining a distribution range of the first network node from a distribution range corresponding to the hierarchy to which the first network node belongs according to the position of the network node of the hierarchy to which the first network node belongs.
Optionally, the determining, according to the position of the first network node in the network node of the hierarchy to which the first network node belongs, a distribution range of the first network node from a distribution range corresponding to the hierarchy to which the first network node belongs includes:
if the first network node is located at the head of the network node included in the hierarchy to which the first network node belongs, taking a range from the initial value in the distribution range corresponding to the hierarchy to which the first network node belongs to the identification value of the first network node as the distribution range of the first network node;
if the first network node is located in the middle of the network nodes included in the hierarchy to which the first network node belongs, taking the identification value from the previous network node of the first network node to the identification value of the first network node as the distribution range of the first network node;
and if the first network node is positioned at the tail of the network node included in the hierarchy to which the first network node belongs, taking the range from the identification value of the first network node to the tail value in the distribution range corresponding to the hierarchy to which the first network node belongs as the distribution range of the first network node.
Optionally, if the first network node is located at the head of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor;
and if the first network node is located in the middle position of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor.
Optionally, before selecting K second network nodes from the distribution range corresponding to the first network node, the method further includes:
judging whether the number of the identification values of the network nodes in the distribution range corresponding to the first network node is less than K or not;
if the number of the identification values of the network nodes in the distribution range corresponding to the first network node is judged to be not less than K, selecting K second network nodes from the distribution range corresponding to the first network node;
and if the number of the identification values of the network nodes in the distribution range corresponding to the first network node is smaller than K, selecting each network identification with the identification value in the distribution range corresponding to the first network node as the second network node.
A second aspect of the present application provides a message broadcasting apparatus, applied to a first network node, including:
a determining unit configured to determine a distribution range of the first network node;
a selecting unit, configured to select K second network nodes from a distribution range corresponding to the first network node; wherein the identification value of each second network node is within the distribution range corresponding to the first network node; k is a positive integer;
a sending unit, configured to send, to each second network node whose identification value is not currently in the filter, a message to be sent and a distribution range of the first network node to the second network node, and add the identification value of the first network node and the identification value of each second network node into the filter.
Optionally, the determining unit includes:
a determining subunit, configured to determine, if the first network node is a message source node, a full range of a distributed network as a distribution range of the first network node;
the determining subunit is further configured to determine, if the first network node is a message relay node, a distribution range of the first network node from a distribution range corresponding to a hierarchy to which the first network node belongs according to a position of the network node of the hierarchy to which the first network node belongs.
Optionally, when the determining subunit determines the distribution range of the first network node from the distribution range corresponding to the hierarchy to which the first network node belongs according to the position of the first network node in the network node of the hierarchy to which the first network node belongs, the determining subunit is configured to:
if the first network node is located at the head of the network node included in the hierarchy to which the first network node belongs, taking a range from the initial value in the distribution range corresponding to the hierarchy to which the first network node belongs to the identification value of the first network node as the distribution range of the first network node;
if the first network node is located in the middle of the network nodes included in the hierarchy to which the first network node belongs, taking the identification value from the previous network node of the first network node to the identification value of the first network node as the distribution range of the first network node;
and if the first network node is positioned at the tail of the network node included in the hierarchy to which the first network node belongs, taking the range from the identification value of the first network node to the tail value in the distribution range corresponding to the hierarchy to which the first network node belongs as the distribution range of the first network node.
Optionally, if the first network node is located at the head of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor; and if the first network node is located in the middle position of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor.
Optionally, the apparatus for broadcasting a message further includes:
a determining unit, configured to determine whether the number of identifier values of network nodes included in a distribution range corresponding to the first network node is less than K;
a calling unit, configured to call the selecting unit to execute selection of K second network nodes from the distribution range corresponding to the first network node if the number of the identification values of the network nodes included in the distribution range corresponding to the first network node is not less than K, which is determined by the determining unit;
the selecting unit is further configured to select each network identifier whose identifier value is within the distribution range corresponding to the first network node as the second network node if the determining unit determines that the number of the identifier values of the network nodes included in the distribution range corresponding to the first network node is smaller than K.
A third aspect of the present application provides a network node, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of the first aspects.
A fourth aspect of the present application provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of the first aspect.
As can be seen from the above solutions, in a message broadcasting method, an apparatus, a network node, and a computer storage medium provided by the present application, the message broadcasting method includes: firstly, determining the distribution range of the first network node; then, K second network nodes are selected from the distribution range corresponding to the first network node; wherein the identification value of each second network node is within the distribution range corresponding to the first network node; k is a positive integer; and finally, aiming at each second network node of which the identification value is not in the filter currently, sending the message to be sent and the distribution range corresponding to the first network node to the second network node, and adding the identification value of the first network node and the identification value of each second network node into the filter. Thus, the redundancy of the message in the broadcasting process is reduced, and therefore, the message can be quickly broadcasted to each node in the distributed network.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a timing diagram of a method for broadcasting a message according to an embodiment of the present application;
fig. 2 is a schematic diagram of a method for broadcasting a message according to another embodiment of the present application;
fig. 3 is a flowchart illustrating a method for broadcasting a message according to another embodiment of the present application;
fig. 4 is a schematic structural diagram of a message broadcasting apparatus according to another embodiment of the present application;
fig. 5 is a schematic diagram of a network node implementing a message broadcasting method according to another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of 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.
It should be noted that the terms "first", "second", and the like, referred to in this application, are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence of functions performed by these devices, modules or units, but the terms "include", or any other variation thereof are intended to cover a non-exclusive inclusion, so that a process, method, article, or apparatus that includes a series of elements includes not only those elements but also other elements that are not explicitly listed, or includes elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In a distributed network, comprising a plurality of network nodes, the plurality of network nodes can communicate messages with each other. The network node can generate a globally unique identification value, namely ID, after the network node is added into the distributed network, the ID is synchronized to the neighbor node through heartbeat, and the broadcast message of the subsequent network participates in the selection and the propagation of the node route through the identification value.
When a network node in the distributed network needs to send a broadcast message, the network node is used as an information source node (referred to as a first network node in this embodiment), the information source node sends a message to be sent to a neighboring node (referred to as a second network node in this embodiment) first, then the neighboring node sends the message to be sent to another node (referred to as a third network node in this embodiment), and so on until a distribution range converges (that is, the neighboring node cannot be found in the distribution range).
The following is introduced in a manner of broadcasting information from a first network node, a second network node and a third network node, a scheme of broadcasting messages in sequence from an information source node, as shown in fig. 1, the scheme including:
s101, an information source node determines the full range of a distributed network as the distribution range of a first network node;
in a distributed network, each network node is configured with a unique identification value. In general, a network node may be set as a positive integer, and maxtin for calculating the distribution range is an upper limit of the positive integer.
Now, an example of the embodiment of the present application is described, as shown in fig. 2, a message to be sent is sent to each network node in a distributed network through a network node with an identifier value of 9 in the distributed network. The network node with the identification value of 9 is called an information source node or a first network node, and the level to which the network node belongs is called a first level. Moreover, the range of the network nodes in the distributed network is assumed to be 0-maxtin, that is, the distribution range corresponding to the network node with the identification value of 9 is 0-maxtin.
S102, selecting K second network nodes from the full range of the distributed network by the information source node; k is a positive integer.
And randomly selecting K second network nodes in the full range of the distributed network nodes, wherein the identification value of each second network node is in the full range of the distributed network.
Continuing with the above example, referring to fig. 2, K network nodes are selected from 0 to maxtint, assuming that K is 3, i.e., the identifiers of 3 network nodes are selected from 0 to maxtint, assuming that the 3 network nodes with identifier values of 19, 217, and 1919 are selected.
S103, the information source node sends the message to be sent and the distribution range corresponding to the first network node to each second network node of which the identification value is not in the filter currently.
Continuing with the above example, the information source node sends the message to be sent and the distribution range 0 to maxnt corresponding to the network node with the identification value of 9 to the 3 network nodes with the identification values of 19, 217, and 1919.
S104, the information source node adds the identification value of the first network node and the identification value of each second network node into the filter.
Since the information source node is the first network node that sends the message, the K selected second network nodes will certainly also be the messages to be sent that are sent by the first information source node, and therefore the identification values of the second network nodes in this embodiment will not appear in the filter. The step is to send the message to be sent and the distribution range corresponding to the first network node to each selected second network node.
In order to avoid sending the message to the node that has already been broadcasted, the information source node and the identification value of the second network node that received the information source node message are all added to the filter, and the filter will continue to propagate in the network as part of the message as long as the network nodes that pass through all add to the filter.
Continuing with the above example, the information source node adds the identification value 9, 19, 217, 1919 to the filter.
And S105, the second network node determines the distribution range of the second network node from the distribution range corresponding to the level to which the information source node belongs according to the position of the network node of the level to which the second network node belongs.
It should be noted that the first network node may select multiple network nodes in its own distribution range to send the message, and each second network node that receives the message is only one of the second network nodes selected by the first network node. It can be understood that the first network node selects a plurality of network nodes in its own distribution range, and forms a new hierarchy. Therefore, the second network node needs to determine its own distribution range from the distribution range corresponding to the hierarchy to which the first network node belongs according to the position of the network node in the hierarchy to which the second network node belongs.
Optionally, another embodiment of the present application provides an implementation manner of step S105, as follows:
and if the second network node is positioned at the head of the network node included in the hierarchy to which the second network node belongs, taking the range from the initial value in the distribution range corresponding to the hierarchy to which the second network node belongs to the identification value of the second network node as the distribution range of the second network node.
And if the second network node is located in the middle of the network nodes included in the hierarchy to which the second network node belongs, taking the identification value from the previous network node of the second network node to the identification value of the first network node as the distribution range of the second network node.
And if the second network node is positioned at the tail of the network node included in the hierarchy to which the second network node belongs, taking the range from the identification value of the second network node to the tail value in the distribution range corresponding to the hierarchy to which the second network node belongs as the distribution range of the second network node.
It should be further noted that, a redundancy factor may also be assigned to the identification value of each network node to solve the problem that the unreliable node in the decentralized network blocks normal propagation of the message, and after each identification value is assigned with the redundancy factor, the message may be repeatedly transmitted to the same node with probability in the process of propagation of the message. The redundancy factor is selected according to the network scale and the communication quality of the network, the communication quality is good generally, the redundancy factor can be smaller properly, otherwise, the redundancy factor should be increased to ensure the reliability of the broadcast message. For example, the packet loss rate is 10%, the redundancy can be set to 0.2, i.e., the network packet loss of 10% can be eliminated by using the 20% redundant message propagation.
Specifically, if the first network node is located at the head of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor; and if the first network node is located in the middle position of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor. Wherein, the redundancy factor correction can be understood as: a redundancy factor is superimposed on the basis of the original value.
It will be appreciated that the redundancy factor may also be 0, in which case the message propagation efficiency is 1, i.e. each network node will receive the message only once. The selection of the redundancy factor may be adjusted according to an actual application scenario and determined according to a final verification effect, which is not limited herein.
Continuing with the above example, referring to fig. 2, the hierarchy to which the 3 network nodes with identification values of 19, 217, 1919 belong may be understood as the second hierarchy. After receiving the message to be sent and the distribution range of 0-maxtin corresponding to the network node with the identification value of 9 at the 3 network nodes with the identification values of 19, 217 and 1919, determining the distribution range of each second network node according to the distribution range of 0-maxtin corresponding to the network node with the received identification value of 9 and the position of the network node in the second hierarchy.
Specifically, the network node with the identifier value of 19 is located at the first position in the second hierarchy, and then the distribution range of the network node with the identifier value of 19 is determined to be 0-19 +
Figure 418005DEST_PATH_IMAGE001
(ii) a The position of the network node with the identification value of 217 in the second hierarchy is a middle bit, and then the distribution range of the network node with the identification value of 217 is determined to be 19-217 +
Figure 216197DEST_PATH_IMAGE002
(ii) a The network node with the identification value 1919 ends at the second level, and the distribution range of the network node with the identification value 1919 is 217-MaxInt.
Figure 556042DEST_PATH_IMAGE003
Refers to the redundancy factor.
S106, the second network node selects K third network nodes from the distribution range corresponding to the second network node.
The identification value of each third network node is in the distribution range corresponding to the second network node; k is a positive integer.
Continuing with the above example, referring to fig. 2, taking the second network node with the identification value 217 as an example, in the distribution range of the network node with the identification value 217: 19 to 217+
Figure 959342DEST_PATH_IMAGE004
K network nodes are selected, and it is assumed that K is equal to 3, it should be noted that the value of K selected in the second level may be the same as or different from the value of K selected in the first level, and this is only an exemplary description.
S107, the second network node sends the message to be sent and the distribution range corresponding to the second network node to a third network node aiming at each second network node of which the identification value is not in the filter currently.
S108, the second network node adds the identification value of the second network node and the identification value of each third network node into the filter.
Continuing with the above example, referring to fig. 2, if the selected identification values of the network nodes are 21, 197 and 210, and the above contents are used to respectively determine whether the identification values of the 3 network nodes are in the filter, and if the identification values of the 3 network nodes are not in the filter, the distribution range corresponding to the network node which sends the message to be sent and the network node whose identification value is 217 is 19-217 + to the 3 network nodes whose identification values are 21, 197 and 210
Figure 93651DEST_PATH_IMAGE005
And adds the identification values 21, 197, 210, 217 to the filter.
As can be seen from the foregoing embodiments, a scheme for playing information in a distributed network provided in the present application is described by taking a network node as a sender (referred to as a first network node in this embodiment) and a network node as a receiver (referred to as a second network node in this embodiment), as shown in fig. 3, the scheme may be summarized as follows:
s301, determining the distribution range of the first network node.
The first network node is any one node in the distributed network. The distribution range of the first network node is: the first network node allows sending messages to the range of network nodes when sending messages to the network node of the next hierarchy.
It should be noted that each network node in the distributed network is not actually divided into multiple hierarchies, but for convenience of the description of the present application, a hierarchy to which a network node that sends a message to a first network node belongs is an upper hierarchy of the first node, and a hierarchy to which a network node to which the first network node sends a message belongs is a lower hierarchy of the first node.
S302, K second network nodes are selected from the distribution range corresponding to the first network node.
The identification value of each second network node is in the distribution range corresponding to the first network node; k is a positive integer.
It should be noted that the value of K may be a randomly selected value or a preset value, and is not limited herein.
Of course, there may be a case where the number of network nodes in the distribution range corresponding to the first network node is less than K, and therefore, before performing step S102, the following steps may also be optionally performed:
and judging whether the number of the identification values of the network nodes in the distribution range corresponding to the first network node is less than K.
Specifically, if it is determined that the number of the identification values of the network nodes included in the distribution range corresponding to the first network node is not less than K, step S302 is executed; and if the number of the identification values of the network nodes in the distribution range corresponding to the first network node is judged to be less than K, executing to select each network identification with the identification value in the distribution range corresponding to the first network node as a second network node.
S303, aiming at each second network node of which the identification value is not in the filter currently, sending the message to be sent and the distribution range corresponding to the first network node to the second network node, and adding the identification value of the first network node and the identification value of each second network node into the filter.
Wherein the filter is adapted to determine whether information to be transmitted has been previously transmitted to the second network node.
It should be noted that the filter may be, but is not limited to, a bloom filter, and is not limited herein.
Specifically, whether the information to be transmitted has been transmitted to the second network node before is determined by determining whether the identification value of the second network node is in the filter. And aiming at each second network node of which the identification value is not in the filter currently, sending the message to be sent and the distribution range corresponding to the first network node to the second network node, and adding the identification value of the first network node and the identification value of each second network node into the filter.
As can be seen from the above solutions, in the message broadcasting method provided in the present application: firstly, determining a distribution range of a first network node; then, K second network nodes are selected from a distribution range corresponding to the first network node; the identification value of each second network node is in the distribution range corresponding to the first network node; k is a positive integer; and finally, aiming at each second network node of which the identification value is not in the filter currently, sending the message to be sent and the distribution range corresponding to the second network node, and adding the identification value of the first network node and the identification value of each second network node into the filter. When the node can not select the neighbor node, the message stops being spread, the redundancy of the message in the broadcasting process is solved through range limitation and sent node filtering every time, and the message is efficiently broadcasted to each node in the distributed network.
Another embodiment of the present application provides a message broadcasting apparatus, applied to a first network node, as shown in fig. 4, including:
a determining unit 401 is configured to determine a distribution range of the first network node.
Optionally, in another embodiment of the present application, an implementation manner of the determining unit 401 specifically includes:
and the determining subunit is configured to determine, if the first network node is a message source node, a full range of the distributed network as a distribution range of the first network node.
The determining subunit is further configured to determine, if the first network node is a message relay node, a distribution range of the first network node from a distribution range corresponding to a hierarchy to which the first network node belongs according to a position of the network node of the hierarchy to which the first network node belongs.
For a specific working process of the unit disclosed in the above embodiment of the present application, reference may be made to the content of the corresponding method embodiment, as shown in fig. 2, which is not described herein again.
Optionally, in another embodiment of the present application, when the determining subunit determines, according to the position of the network node of the hierarchy to which the first network node belongs, the distribution range of the first network node from the distribution range corresponding to the hierarchy to which the first network node belongs, the determining subunit is configured to:
and if the first network node is positioned at the head of the network node included in the hierarchy to which the first network node belongs, taking the range from the initial value in the distribution range corresponding to the hierarchy to which the first network node belongs to the identification value of the first network node as the distribution range of the first network node.
And if the first network node is located in the middle of the network nodes included in the hierarchy to which the first network node belongs, taking the identification value from the previous network node of the first network node to the identification value of the first network node as the distribution range of the first network node.
And if the first network node is positioned at the tail of the network node included in the hierarchy to which the first network node belongs, taking the range from the identification value of the first network node to the tail value in the distribution range corresponding to the hierarchy to which the first network node belongs as the distribution range of the first network node.
For specific working processes of the units disclosed in the above embodiments of the present application, reference may be made to the contents of the corresponding method embodiments, which are not described herein again.
Optionally, in another embodiment of the present application, if the first network node is located at the head of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor; and if the first network node is located in the middle position of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor.
For specific working processes of the units disclosed in the above embodiments of the present application, reference may be made to the contents of the corresponding method embodiments, which are not described herein again.
A selecting unit 402, configured to select K second network nodes from the distribution range corresponding to the first network node.
The identification value of each second network node is in the distribution range corresponding to the first network node; k is a positive integer.
A sending unit 403, configured to send, to each second network node whose identification value is not currently in the filter, the message to be sent and the distribution range of the first network node to the second network node, and add the identification value of the first network node and the identification value of each second network node into the filter.
For a specific working process of the unit disclosed in the above embodiment of the present application, reference may be made to the content of the corresponding method embodiment, as shown in fig. 1, which is not described herein again.
Optionally, in another embodiment of the present application, an implementation manner of the apparatus for broadcasting a message further includes:
and the judging unit is used for judging whether the number of the identification values of the network nodes in the distribution range corresponding to the first network node is less than K or not.
A calling unit, configured to, if the determining unit determines that the number of the identifier values of the network nodes included in the distribution range corresponding to the first network node is not less than K, call the selecting unit 402 to execute selecting K second network nodes from the distribution range corresponding to the first network node.
The selecting unit 402 is further configured to select, as the second network node, each network identifier whose identifier is in the distribution range corresponding to the first network node if the determining unit determines that the number of the identifier values of the network nodes included in the distribution range corresponding to the first network node is less than K.
For specific working processes of the units disclosed in the above embodiments of the present application, reference may be made to the contents of the corresponding method embodiments, which are not described herein again.
As can be seen from the above solutions, the present application provides a message broadcasting apparatus, wherein: first, the determining unit 401 determines the distribution range of the first network node; then, the selecting unit 402 selects K second network nodes from the distribution range corresponding to the first network node; the identification value of each second network node is in the distribution range corresponding to the first network node; k is a positive integer; finally, the sending unit 403 sends the message to be sent and the distribution range corresponding to the second network node for each second network node whose identification value is not currently in the filter, and adds the identification value of the first network node and the identification value of each second network node into the filter. Thus, the redundancy of the message in the broadcasting process is reduced, and therefore, the message can be quickly broadcasted to each node in the distributed network.
Another embodiment of the present application provides a network node, as shown in fig. 5, including:
one or more processors 501.
A storage device 502 on which one or more programs are stored.
The one or more programs, when executed by the one or more processors 501, cause the one or more processors 501 to implement the method as in any of the above embodiments.
Another embodiment of the present application provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method as described in any of the above embodiments.
In the above embodiments disclosed in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present disclosure may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part. The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a live broadcast device, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those skilled in the art can make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (11)

1. A method for broadcasting a message, the method being applied to a first network node, wherein the method for broadcasting a message comprises:
determining a distribution range of the first network node;
selecting K second network nodes from the distribution range corresponding to the first network node; wherein the identification value of each second network node is within the distribution range corresponding to the first network node; k is a positive integer;
and aiming at each second network node of which the identification value is not in the filter currently, sending a message to be sent and a distribution range corresponding to the first network node to the second network node, and adding the identification value of the first network node and the identification value of each second network node into the filter.
2. The method of claim 1, wherein the determining the distribution range of the first network node comprises:
if the first network node is a message source node, determining the full range of the distributed network as the distribution range of the first network node;
and if the first network node is a message transfer node, determining a distribution range of the first network node from a distribution range corresponding to the hierarchy to which the first network node belongs according to the position of the network node of the hierarchy to which the first network node belongs.
3. The method according to claim 2, wherein the determining the distribution range of the first network node from the distribution range corresponding to the hierarchy to which the first network node belongs according to the position of the first network node in the network node of the hierarchy to which the first network node belongs comprises:
if the first network node is located at the head of the network node included in the hierarchy to which the first network node belongs, taking a range from the initial value in the distribution range corresponding to the hierarchy to which the first network node belongs to the identification value of the first network node as the distribution range of the first network node;
if the first network node is located in the middle of the network nodes included in the hierarchy to which the first network node belongs, taking the identification value from the previous network node of the first network node to the identification value of the first network node as the distribution range of the first network node;
and if the first network node is positioned at the tail of the network node included in the hierarchy to which the first network node belongs, taking the range from the identification value of the first network node to the tail value in the distribution range corresponding to the hierarchy to which the first network node belongs as the distribution range of the first network node.
4. A method of broadcasting a message according to claim 3,
if the first network node is located at the head of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor;
and if the first network node is located in the middle position of the network node included in the hierarchy to which the first network node belongs, the identification value of the first network node is the identification value of the first network node corrected by the redundancy factor.
5. The method according to claim 1, wherein before selecting K second network nodes from the distribution range corresponding to the first network node, the method further comprises:
judging whether the number of the identification values of the network nodes in the distribution range corresponding to the first network node is less than K or not;
if the number of the identification values of the network nodes in the distribution range corresponding to the first network node is judged to be not less than K, selecting K second network nodes from the distribution range corresponding to the first network node;
and if the number of the identification values of the network nodes in the distribution range corresponding to the first network node is smaller than K, selecting each network identification with the identification value in the distribution range corresponding to the first network node as the second network node.
6. An apparatus for broadcasting a message, applied to a first network node, comprising:
a determining unit configured to determine a distribution range of the first network node;
a selecting unit, configured to select K second network nodes from a distribution range corresponding to the first network node; wherein the identification value of each second network node is within the distribution range corresponding to the first network node; k is a positive integer;
a sending unit, configured to send, to each second network node whose identification value is not currently in the filter, a message to be sent and a distribution range of the first network node to the second network node, and add the identification value of the first network node and the identification value of each second network node into the filter.
7. The apparatus for broadcasting message according to claim 6, wherein the determining unit comprises:
a determining subunit, configured to determine, if the first network node is a message source node, a full range of a distributed network as a distribution range of the first network node;
the determining subunit is further configured to determine, if the first network node is a message relay node, a distribution range of the first network node from a distribution range corresponding to a hierarchy to which the first network node belongs according to a position of the network node of the hierarchy to which the first network node belongs.
8. The apparatus for broadcasting a message according to claim 7, wherein the determining subunit, when determining the distribution range of the first network node from the distribution range corresponding to the hierarchy to which the first network node belongs according to the location of the network node of the hierarchy to which the first network node belongs, is configured to:
if the first network node is located at the head of the network node included in the hierarchy to which the first network node belongs, taking a range from the initial value in the distribution range corresponding to the hierarchy to which the first network node belongs to the identification value of the first network node as the distribution range of the first network node;
if the first network node is located in the middle of the network nodes included in the hierarchy to which the first network node belongs, taking the identification value from the previous network node of the first network node to the identification value of the first network node as the distribution range of the first network node;
and if the first network node is positioned at the tail of the network node included in the hierarchy to which the first network node belongs, taking the range from the identification value of the first network node to the tail value in the distribution range corresponding to the hierarchy to which the first network node belongs as the distribution range of the first network node.
9. The apparatus for broadcasting message according to claim 6, further comprising:
a determining unit, configured to determine whether the number of identifier values of network nodes included in a distribution range corresponding to the first network node is less than K;
a calling unit, configured to call the selecting unit to execute selection of K second network nodes from the distribution range corresponding to the first network node if the number of the identification values of the network nodes included in the distribution range corresponding to the first network node is not less than K, which is determined by the determining unit;
the selecting unit is further configured to select each network identifier whose identifier value is within the distribution range corresponding to the first network node as the second network node if the determining unit determines that the number of the identifier values of the network nodes included in the distribution range corresponding to the first network node is smaller than K.
10. A network node, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of broadcasting a message as claimed in any one of claims 1 to 5.
11. A computer storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a method of broadcasting a message as claimed in any one of claims 1 to 5.
CN202110094117.0A 2021-01-25 2021-01-25 Message broadcasting method, device, network node and computer storage medium Active CN112422302B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110094117.0A CN112422302B (en) 2021-01-25 2021-01-25 Message broadcasting method, device, network node and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110094117.0A CN112422302B (en) 2021-01-25 2021-01-25 Message broadcasting method, device, network node and computer storage medium

Publications (2)

Publication Number Publication Date
CN112422302A true CN112422302A (en) 2021-02-26
CN112422302B CN112422302B (en) 2021-04-06

Family

ID=74782522

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110094117.0A Active CN112422302B (en) 2021-01-25 2021-01-25 Message broadcasting method, device, network node and computer storage medium

Country Status (1)

Country Link
CN (1) CN112422302B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254839A (en) * 2021-06-18 2021-08-13 每日互动股份有限公司 Layer-by-layer message distribution method, electronic client and medium
CN114024786A (en) * 2022-01-04 2022-02-08 杭州趣链科技有限公司 Message broadcasting method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756235A (en) * 2004-02-13 2006-04-05 三星电子株式会社 The communication equipment of the broadcasting method in the wireless network and this broadcasting method of use
CN101558676A (en) * 2006-10-23 2009-10-14 泰克迪亚科技公司 Method and communication device for routing unicast and multicast messages in an ad-hoc wireless network
CN102055655A (en) * 2009-11-06 2011-05-11 中兴通讯股份有限公司 System and method for broadcasting message in structural peer-to-peer network
CN109218037A (en) * 2018-07-10 2019-01-15 矩阵元技术(深圳)有限公司 Message broadcasting method and device in P2P network
US10701670B2 (en) * 2018-01-03 2020-06-30 Wirepas Oy System for co-operative repetition of broadcast messages

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756235A (en) * 2004-02-13 2006-04-05 三星电子株式会社 The communication equipment of the broadcasting method in the wireless network and this broadcasting method of use
CN101558676A (en) * 2006-10-23 2009-10-14 泰克迪亚科技公司 Method and communication device for routing unicast and multicast messages in an ad-hoc wireless network
CN102055655A (en) * 2009-11-06 2011-05-11 中兴通讯股份有限公司 System and method for broadcasting message in structural peer-to-peer network
US10701670B2 (en) * 2018-01-03 2020-06-30 Wirepas Oy System for co-operative repetition of broadcast messages
CN109218037A (en) * 2018-07-10 2019-01-15 矩阵元技术(深圳)有限公司 Message broadcasting method and device in P2P network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
伍志刚: ""移动P2P网络中的数据分发技术研究"", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254839A (en) * 2021-06-18 2021-08-13 每日互动股份有限公司 Layer-by-layer message distribution method, electronic client and medium
CN114024786A (en) * 2022-01-04 2022-02-08 杭州趣链科技有限公司 Message broadcasting method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112422302B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN112422302B (en) Message broadcasting method, device, network node and computer storage medium
CN108809836B (en) Multicast data message forwarding method and device
CN112235379B (en) Block chain bottom layer shared storage method
CN110474846B (en) Method and device for block propagation in block chain
US10135740B2 (en) Method and apparatus for limiting rate by means of token bucket, and computer storage medium
JP2022092016A (en) Specific hopping patterns for telegram splitting
CN111464358B (en) Message reporting method and device
US9999001B2 (en) Power control method and device
WO2017097091A1 (en) Data transmission method, apparatus, and system based on non-orthogonal multi-access mode
CN109617702B (en) Message signing method, block chain node and device with storage function
US10594598B2 (en) Path setup in a mesh network
Bonomi et al. Practical Byzantine reliable broadcast on partially connected networks
CN112968969A (en) Block chain system, message transmission method and device
EP3319377B1 (en) Anchor master node management method and node
CN113438161B (en) Method and network device for generating segment identification SID
US20220166842A1 (en) Data distribution method and electronic device
CN111526165A (en) Consensus method and system in alliance chain
CN110662258A (en) Message forwarding method, device and medium
CN112075102A (en) Low-power Bluetooth networking method, electronic equipment, network and storage medium
CN109120527A (en) A kind of method and system of transmission services flow
CN113949622A (en) Network communication method, system, device and computer readable storage medium
CN114157404B (en) Data transmission method, device electronic equipment and storage medium
CN111682978A (en) Network communication enhancement method and system
US20150146534A1 (en) Node of an improved multihop ad-hoc radio network and associated method
Samak et al. Multi-destination rendezvous in cognitive radio networks

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