Message broadcasting method, related equipment and storage medium

By adjusting the fan-out and transmission rate of messages in a peer-to-peer network, combined with encryption and priority queuing mechanisms, the problem of untimely message broadcasting is solved, enabling efficient broadcasting to the entire network within the deadline and reducing network latency and the risk of malicious tampering.

CN121645150APending Publication Date: 2026-03-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-31
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies in peer-to-peer networks suffer from problems such as partial view broadcasting protocols failing to meet the needs of network-wide broadcasting and global view protocols incurring high overhead, resulting in messages not being broadcast to the entire network within the deadline.

Method used

By adjusting the fan-out and transmission rate of messages through feedback between nodes, and combining encryption and priority queuing mechanisms, the transmission of messages in the network is optimized, avoiding network latency attacks and malicious tampering.

Benefits of technology

It enables efficient broadcasting of messages to every node in the peer-to-peer network within the deadline, reducing network latency and the risk of malicious tampering, and improving the reliability and efficiency of message transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121645150A_ABST
    Figure CN121645150A_ABST
Patent Text Reader

Abstract

The invention provides a message broadcasting method, related equipment and a storage medium, which are applied to the technical field of network communication, and are used for adjusting the transmission rate of a message in a network according to a feedback propagation message sent by a node, so that the message is broadcasted to the whole network as far as possible within a deadline. The method comprises the following steps: a first node determines the residual deadline of a message, wherein the residual deadline is used for representing the residual effective duration of broadcasting the message; according to the remaining deadline of the message and the fan-out of the message, the first node broadcasts the message to F second nodes, the fan-out represents the transmission rate of the message in the network, and the second nodes are neighbor nodes of the first node; according to a feedback propagation message received by the first node, the first node updates the fan-out to obtain an updated fan-out, the feedback propagation message is a feedback message sent by a node in the network based on the received message, the updated fan-out is used for indicating the first node to broadcast the message to M second nodes, and M is greater than or less than F.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network communication, and in particular to a message broadcasting method and device and a storage medium. BACKGROUND

[0002] A peer-to-peer network is a decentralized network model, in which each node is in a peer-to-peer relationship, each node can provide and request services, and each node can directly communicate with other nodes without relying on a traditional client-server architecture.

[0003] The core idea of message broadcasting in a peer-to-peer network is to broadcast messages between nodes in a randomized manner to achieve the effect of network-wide broadcasting. In a peer-to-peer network, each node communicates with a certain number of other nodes and exchanges information regularly. When a node receives a new message, it broadcasts the message to a certain number of neighbor nodes. The neighbor nodes will continue to broadcast to other neighbor nodes after receiving the message, and eventually broadcast the message to the entire peer-to-peer network. Currently, message broadcasting in a peer-to-peer network mainly includes broadcasting protocols based on a local view and a global view.

[0004] However, the broadcasting protocol based on a local view can only determine the message propagation rate according to the network conditions within the local view, which may cause the message to be unable to be broadcast to the entire network within the deadline due to network congestion outside the local view. The broadcasting protocol based on a global view is not suitable for message broadcasting in a large-scale peer-to-peer network, and maintaining the state information of all nodes in the network brings a huge overhead. SUMMARY

[0005] The present application provides a message broadcasting method, related device and storage medium, applied to the technical field of network communication, for adjusting the transmission rate of a message in a network according to a feedback propagation message sent by a node, so as to broadcast the message to the entire network within a deadline as much as possible.

[0006] The first aspect of the present application provides a message broadcasting method, in which a first node is any node in a point-to-point network, and the first node and a second node can directly communicate with each other. The first node can determine a remaining deadline of a message, the remaining deadline being used to represent a remaining valid time length of broadcasting the message; then, according to the remaining deadline of the message and a fan-out of the message, the first node can broadcast the message to F second nodes in a local view of the first node, wherein the fan-out of the message represents a transmission rate of the message in the network, and the second nodes are neighbor nodes of the first node; according to a feedback propagation message received by the first node, the first node can update the fan-out of the message to obtain an updated fan-out. The feedback propagation message is a feedback message sent by a node in the network based on a received message, and the updated fan-out is used to instruct the first node to broadcast the message to M second nodes, M being greater than or less than F, and M and F being positive integers.

[0007] In the embodiments of the present application, in the process of broadcasting the message, after receiving the message, the node in the point-to-point network can send a feedback propagation message to other nodes in the network, so that the node can update the fan-out of the message according to the remaining deadline of the message in the feedback propagation message, that is, adjust the transmission rate of the message in the network, and try to broadcast the message to each node in the point-to-point network within the deadline of the message.

[0008] In a possible implementation, the first node determining the remaining deadline of the message can include: if the message is sent by a client to the first node, the first node sets the remaining deadline of the message; if the message is sent by a third node in the network to the first node, the first node updates the remaining deadline of the message according to a network delay of the message, the network delay of the message being obtained based on a round-trip communication delay between the first node and the third node.

[0009] In the embodiments of the present application, the remaining deadline of the message can be updated according to the round-trip communication delay between the nodes, wherein the time length of the round-trip communication delay is greater than the time length of the transmission delay between the nodes, and thus the delay of broadcasting the message can be reduced as much as possible.

[0010] In a possible implementation, before the first node broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message, the method can further include: the first node encrypts the message to obtain an encrypted message.

[0011] In the embodiments of the present application, the message can be encrypted, so that the remaining deadline of the message can be prevented from being tampered with at will by malicious nodes during the broadcasting process.

[0012] In a possible implementation, the aforementioned broadcasting, by the first node, the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message can include: broadcasting, by the first node, the encrypted message to the F second nodes according to the remaining deadline of the message and the fan-out.

[0013] In a possible implementation, before the aforementioned broadcasting, by the first node, the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message, the method can further include: when a round-trip communication delay between the first node and the second node is less than or equal to a preset value, the first node takes the second node as a node in a local view of the first node, and the local view includes the F second nodes.

[0014] In the embodiments of the present application, whether a node is subjected to a network delay attack can be determined through a round-trip communication delay between the nodes, and a node whose round-trip communication delay is less than or equal to a preset value can be taken as a node in a local view, so as to avoid that a node subjected to a delay attack broadcasts a message, and further to avoid delay of message broadcasting.

[0015] In a possible implementation, the aforementioned broadcasting, by the first node, the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message can include: sending, by the first node, the message to a priority queue, and queue messages in the priority queue are sorted according to the remaining deadline of the queue messages; and broadcasting, by the first node, the message to the F second nodes according to the sorting of the message in the priority queue and the fan-out.

[0016] In the embodiments of the present application, a message to be broadcasted can be added to a priority queue for queuing, and the message can be broadcasted according to the remaining deadline of the message in the priority queue, so that the message can be broadcasted according to its urgency.

[0017] In a possible implementation, before the aforementioned broadcasting, by the first node, the message to the F second nodes according to the sorting of the message in the priority queue and the fan-out, the method further includes: updating, by the first node, the remaining deadline of the message according to a queuing duration of the message in the priority queue.

[0018] In a possible implementation, the aforementioned updating, by the first node, the fan-out according to the feedback propagation message received by the first node to obtain an updated fan-out can include: when the remaining deadline of the message in the feedback propagation message exceeds a first preset threshold, decreasing, by the first node, the fan-out to obtain the updated fan-out; and when the remaining deadline of the message in the feedback propagation message is less than a second preset threshold, increasing, by the first node, the fan-out to obtain the updated fan-out.

[0019] In the embodiments of the present application, the fan-out (transmission rate) of the message can be updated according to the remaining deadline of the message carried in the feedback propagation message sent by the node, so as to ensure that the message is broadcast to the entire network within the deadline as much as possible.

[0020] In a possible implementation, the foregoing broadcasting, by the first node, of the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message can include: broadcasting, by the first node, the message to the F second nodes according to the remaining deadline of the message and the fan-out, using a preset transmission scheme, where the preset transmission scheme is used to indicate that the nodes in the network broadcast data packets of the same size based on the same time interval and a fixed fan-out.

[0021] In the embodiments of the present application, the nodes in the point-to-point network can broadcast the message in the same transmission manner, so that the network attacker can be prevented from distinguishing the propagation of the message according to the transmission mode of the message and performing a network delay attack.

[0022] In a possible implementation, after the foregoing broadcasting, by the first node, of the message to the F second nodes according to the remaining deadline of the message and the fan-out, the method can further include: adjusting, by the first node, the transmission times of the message according to the feedback propagation message received by the first node; and broadcasting, by the first node, the message to the F second nodes according to the transmission times of the message.

[0023] In the embodiments of the present application, when the nodes broadcast the message using the same fan-out, the transmission rate of the message can be adjusted by adjusting the transmission times of the message. For an urgent message, the message can be added to the priority queue multiple times, so that the message can be transmitted to the neighbor nodes multiple times, thereby achieving fast propagation.

[0024] In a second aspect, the present application provides a message broadcasting apparatus, including: a determination module configured to determine, by a first node, a remaining deadline of a message, where the remaining deadline is used to represent a remaining valid time length of the message for broadcasting; a broadcasting module configured to broadcast, by the first node, the message to F second nodes according to the remaining deadline of the message and a fan-out of the message, where the fan-out is used to represent a transmission rate of the message in the network, and the second nodes are neighbor nodes of the first node; and a first updating module configured to update, by the first node, the fan-out according to a feedback propagation message received by the first node, to obtain an updated fan-out, where the feedback propagation message is a feedback message sent by a node in the network based on a received message, and the updated fan-out is used to indicate that the first node broadcasts the message to M second nodes, where M is greater than or less than F.

[0025] In a possible implementation, the determining module is specifically configured to: if the message is sent by the client to the first node, the first node sets the remaining deadline for the message; and if the message is sent by a third node in the network to the first node, the first node updates the remaining deadline for the message according to a network delay of the message, the network delay of the message being obtained based on a round-trip communication delay between the first node and the third node.

[0026] In a possible implementation, before the broadcasting module broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message, the apparatus can further include an encryption module configured to encrypt the message by the first node to obtain an encrypted message.

[0027] In a possible implementation, the broadcasting module is specifically configured to: broadcast the encrypted message by the first node to the F second nodes according to the remaining deadline of the message and the fan-out of the message.

[0028] In a possible implementation, before the broadcasting module broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message, the apparatus can further include a processing module configured to: when a round-trip communication delay between the first node and the second node is less than or equal to a preset value, the first node takes the second node as a node in a local view of the first node, and the local view includes the F second nodes.

[0029] In a possible implementation, the broadcasting module is specifically configured to: send the message to a priority queue by the first node, and queue messages in the priority queue are sorted according to the remaining deadline of the queue messages; and broadcast the message by the first node to the F second nodes according to the sorting of the message in the priority queue and the fan-out of the message.

[0030] In a possible implementation, before the broadcasting module broadcasts the message to the F second nodes according to the sorting of the message in the priority queue and the fan-out of the message, the apparatus can further include a second updating module configured to: update the remaining deadline of the message by the first node according to a queuing duration of the message in the priority queue.

[0031] In a possible implementation, the first updating module is specifically configured to: when the remaining deadline of the message in the feedback propagation message exceeds a first preset threshold, decrease the fan-out by the first node to obtain an updated fan-out; and when the remaining deadline of the message in the feedback propagation message is less than a second preset threshold, increase the fan-out by the first node to obtain the updated fan-out.

[0032] In a possible implementation, the broadcast module is specifically configured to broadcast, according to the remaining deadline and the fan-out of the message, the message from the first node to the F second nodes by using a preset transmission scheme, and the preset transmission scheme is used to indicate that the nodes in the network broadcast the same size of data packets based on the same time interval and the fixed fan-out.

[0033] In a possible implementation, after the broadcast module broadcasts the message from the first node to the F second nodes according to the remaining deadline and the fan-out of the message, the apparatus further includes an adjustment module configured to adjust, according to the feedback propagation message received by the first node, the transmission times of the message, and the broadcast module is further configured to broadcast, according to the transmission times of the message, the message from the first node to the F second nodes.

[0034] The third aspect provides a network device, including:

[0035] The processor is configured to execute the program, so that the network device performs the method in the first aspect and any possible implementation manner thereof.

[0036] Optionally, the network device further includes a memory, and the processor is coupled with the memory; and the memory is configured to store the program.

[0037] The fourth aspect provides a computer readable storage medium including instructions, when the instructions are executed on a computer, the computer executes the method in the first aspect or any possible implementation manner of the first aspect.

[0038] The fifth aspect provides a computer program product including instructions, when the instructions are executed on a computer, the computer executes the method in the first aspect or any possible implementation manner of the first aspect.

[0039] The technical effects brought by the second aspect to the fifth aspect or any possible implementation manner thereof can refer to the technical effects brought by the first aspect or the related possible implementation manner of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 A network architecture diagram is provided for the embodiments of the present application.

[0041] Figure 2 A flowchart of a message broadcast method is provided for the embodiments of the present application.

[0042] Figure 3 A schematic diagram of broadcasting a message in a point-to-point network is provided.

[0043] Figure 4A schematic diagram of a network delay attack on a message in the process of propagation;

[0044] Figure 5 A flowchart of another message broadcasting method provided by an embodiment of the present application;

[0045] Figure 6 A schematic diagram of a malicious node tampering with the remaining deadline of a message;

[0046] Figure 7 A flowchart of another message broadcasting method provided by an embodiment of the present application;

[0047] Figure 8 A structural schematic diagram of a message broadcasting device provided by an embodiment of the present application;

[0048] Figure 9 A structural schematic diagram of a network device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0050] In order to facilitate understanding, some concepts related to the present application are first introduced.

[0051] 1. Peer-to-Peer Network (P2P Network)

[0052] Peer-to-peer network, also known as peer-to-peer network, is a decentralized network model. Each participant (called "peer" or "node") in the peer-to-peer network has the same rights and obligations, and can directly communicate and share resources with other participants without the need for a central server or intermediary. This network model emphasizes decentralization and decentralization, so that each node in the network can exist as a server and client. One of the design goals of peer-to-peer network is to improve the scalability and robustness of the system, as it can better cope with dynamic changes in network topology and the addition and exit of nodes.

[0053] Peer-to-peer network has the characteristics of decentralization, decentralization, scalability, fault tolerance and resource sharing, and can be applied to file sharing, instant messaging, distributed computing and blockchain technology.

[0054] 2. Partial View

[0055] The local view is a subset of all nodes in the point-to-point network.

[0056] 3. Global View

[0057] The global view is all nodes in the point-to-point network.

[0058] 4. Neighbor Nodes

[0059] Each node in the point-to-point network establishes a network connection with several random nodes and communicates with them. These random nodes are called the neighbor nodes of the current node.

[0060] 5. Fanout

[0061] Fanout is an important parameter of the message broadcast protocol in the point-to-point network, which determines the transmission rate of the message in the network. The larger the fanout, the more nodes the message will be broadcast to each time, and the faster the message will be propagated to all nodes in the network.

[0062] 6. Round-Trip Time (RTT)

[0063] In the field of communication and computer networks, the round-trip time RTT refers to the total time required for a data packet to be sent from the sender to the receiver and then returned to the sender. This process includes the propagation delay of the sender's signal to the receiver and the time for the receiver to process the signal and return the message to the sender. Usually, people can test the round-trip time in the network through the ping command.

[0064] The method provided by the embodiments of the present application can be applied to point-to-point network-based application scenarios, such as streaming media transmission (users sharing their own bandwidth resources), content delivery network (CDN), blockchain, Internet of Things, and other point-to-point network application scenarios.

[0065] Some possible system architectures provided by the present application will be introduced below.

[0066] Referring to Figure 1 , a system architecture 100 provided by the present application is provided.

[0067] Referring to Figure 1 , the P2P network architecture on which the message broadcast method in the embodiments of the present application is based will be briefly described below:

[0068] The point-to-point network architecture can include a plurality of nodes. In the network architecture, each node can provide and request services, and each node can directly communicate with each other, and each node can act as a sender or a receiver in the process of broadcasting a message. Node 101 broadcasts a message to neighbor nodes based on its local view, and node 102, node 103, node 104, and node 105 are neighbor nodes of node 101. The neighbor nodes such as node 105 can continue to broadcast the message to other nodes until the message is broadcast to each node in the point-to-point network. It can be understood that, Figure 1 The network architecture shown is only an example, and the point-to-point network can also be other network structures, which are not limited here.

[0069] The node described above can be a network device with data forwarding function, such as a switch, a router, or the like. It can also be a component or device applied to a network device (such as a processor, a chip, or a chip system, etc.), or a logic module or software capable of realizing all or part of the network device function.

[0070] The method flow provided by the present application will be introduced below in combination with the system architecture described above.

[0071] Referring to Figure 2 The present application provides a flowchart of a message broadcasting method, and the specific method flow is as follows:

[0072] Step 201, the first node determines the remaining deadline of the message;

[0073] The point-to-point network can include a plurality of nodes, and the first node can be any node in the point-to-point network. Before determining the remaining deadline of the message, the first node can receive a message sent by a client, or can receive a message sent by another node (or referred to as a third node) in the point-to-point network. Since the message broadcast in the network usually needs to meet the transmission time requirement, in order to meet the transmission time requirement of the message, the deadline of the message can be set, and the remaining deadline of the message can represent the remaining effective time length of the message broadcast in the network. The message needs to be broadcast to the whole network within the remaining deadline.

[0074] Optionally, when the message is sent to the first node by the client, the first node can set an initial remaining deadline for the message. When the message is sent to the first node by the third node, the first node can update the remaining deadline of the message according to the network delay of the message. The network delay of the message can be obtained according to the round-trip communication delay between the first node and the third node.

[0075] Specifically, after receiving the message sent by the third node, the first node can update the remaining deadline of the message according to the network delay of the message. Wherein, since the network delay from the third node to the first node is unpredictable, in the embodiments of the present application, the round-trip communication delay between the nodes can be regarded as the one-way transmission delay between the nodes, and since the time length of the round-trip communication delay is greater than the time length of the one-way transmission delay, the round-trip communication delay between the third node and the first node is regarded as the network delay from the third node to the first node, and the remaining deadline of the message is updated according to the network delay, so that the message can meet the transmission time requirement as much as possible.

[0076] Wherein, the calculation of the round-trip communication delay between the first node and the third node can be achieved by sending a ping message from the first node to the third node, and the third node will feed back a pong message to the first node after receiving the ping message. The first node records the time stamp of sending the ping message and the time stamp of receiving the pong message, and calculates the time interval between the two time stamps, so that the first node can calculate the round-trip communication time between the first node and the third node.

[0077] For example, when the remaining deadline of the message broadcast to the third node is D1, and the round-trip communication time between the third node and the first node is R1, then when the message is broadcast to the first node, the first node can take R1 as the network delay from the third node to the first node, and calculate the remaining deadline D2 of the message at the first node, wherein D2=D1-R1.

[0078] Step 202, according to the remaining deadline of the message, the first node broadcasts the message to F second nodes;

[0079] After determining the remaining deadline of the message, the first node can broadcast the message to F second nodes selected randomly from the local view according to the remaining deadline of the message. The second node is also called the neighbor node of the first node.

[0080] Optionally, the first node can send the received message to a priority queue, and the priority queue includes the queue messages to be broadcast in the network. The queue messages in the priority queue are sorted from short to long according to the remaining deadline of the queue messages, and the queue messages with shorter remaining deadline in the priority queue will obtain higher priority. When the message received by the first node reaches the first position of the priority queue, the first node can broadcast the message to F second nodes selected randomly from the local view of the first node according to the fan-out in the network.

[0081] Optionally, the queue messages in the priority queue can also be sorted according to the remaining deadline time of the queue messages from long to short, if sorted from long to short, the messages are successively removed from the tail of the priority queue, and the queue messages with shorter remaining deadline time in the priority queue still have higher priority.

[0082] Wherein, before inserting a new message into the priority queue, the first node updates the remaining deadline time of each queue message in the priority queue, that is, the remaining deadline time after the last update is subtracted by the time interval from the last update. When the new message is inserted into the priority queue, all messages in the priority queue are re-sequenced, so that subsequent broadcasting of messages in the priority queue is performed according to the new sequence.

[0083] Optionally, before the first node broadcasts the message to the F second nodes, the first node can also update the remaining deadline time of the message according to the queuing time of the message in the priority queue. For example, the remaining deadline time of the message when the message is broadcast to the first node is D2, the queuing time of the message after the message is added to the priority queue is P, at this time, the remaining deadline time of the message can be updated to D3, D3=D2-P.

[0084] In addition, in order to avoid messages without deadline being infinitely queued by urgent messages, and thus messages without deadline can never be propagated, a default maximum deadline time can be set for messages without deadline, for example, the maximum deadline time can be 5 minutes, which is much longer than the normal message deadline time, usually several tens of seconds. Therefore, by setting the maximum deadline time for such messages, not only can the situation of being infinitely queued by urgent messages be avoided, but also the broadcast of urgent messages can be as little blocked as possible.

[0085] Step 203, the first node updates the fan-out according to the feedback propagation message received by the first node, to obtain an updated fan-out.

[0086] After receiving the message sent by other nodes, the node in the point-to-point network can send a feedback propagation message to other nodes in the network, wherein the feedback propagation message includes the remaining deadline time of the message broadcast to the current node, and the feedback propagation message is used to instruct the node in the point-to-point network to adjust the fan-out of the message.

[0087] For example, after the second node receives the message sent by the first node, the second node can send a feedback propagation message to other nodes in the point-to-point network, and the feedback propagation message includes the remaining deadline time of the message broadcast to the second node. If the Nth node receives the message, the Nth node can send a feedback propagation message to other nodes in the point-to-point network, and the feedback propagation message includes the remaining deadline time of the message broadcast to the Nth node.

[0088] Optionally, after receiving the message sent by the first node, the second node can calculate a hash value of the message by using a hash algorithm, different messages can be calculated to obtain different hash values by using the hash algorithm, and the hash value can be carried in the feedback propagation message, so that other nodes in the point-to-point network can update the fan-out of the same message according to the hash value in the feedback propagation message.

[0089] Optionally, the first node can update the fan-out of the message according to the feedback propagation message received by the first node to obtain an updated fan-out, and the updated fan-out is used to indicate that the first node broadcasts the message to M second nodes, where M is greater than or less than F.

[0090] The feedback propagation message received by the first node can be sent by the second node or other nodes in the point-to-point network, and the specific implementation is not limited here.

[0091] Specifically, the first node can adjust the fan-out of the message according to the remaining propagation time of the message in the feedback propagation message, so as to adjust the propagation rate of the message. When the remaining deadline of the message in the feedback propagation message exceeds a first preset threshold, the first node can reduce the fan-out of the message in the point-to-point network to obtain an updated fan-out, and according to the updated fan-out, the first node can broadcast the message to M second nodes, where M is less than F. When the remaining deadline of the message in the feedback propagation message is less than a second preset threshold, the first node can increase the fan-out of the message in the point-to-point network to obtain an updated fan-out, and according to the updated fan-out, the first node can broadcast the message to M second nodes, where M is greater than F.

[0092] Figure 3 A schematic diagram for broadcasting a message in a point-to-point network is shown in FIG. 1. Figure 3 As shown in FIG. 1, the message can be broadcast from an initial node N1 to the nodes in the network, and other nodes in the network can send feedback propagation messages after receiving the message, where the feedback propagation message includes the remaining deadline of the message, so that the nodes in the network can adjust the transmission rate (i.e., fan-out) of the message according to the remaining deadline of the message, so that the message can be broadcast to every node in the point-to-point network within the deadline.

[0093] In the embodiments of the present application, during the process of broadcasting the message in the point-to-point network, the node can send a feedback propagation message to other nodes in the network after receiving the message, so that the node can update the fan-out of the message according to the remaining deadline of the message in the feedback propagation message, that is, adjust the transmission rate of the message in the network, and try to broadcast the message to every node in the point-to-point network within the deadline of the message.

[0094] In the process of message broadcasting in a point-to-point network, the broadcasting of the message can be attacked by other network delay attacks. Among them, the network delay attacks include target delay attacks and random delay attacks. The random delay attacks will randomly delay the propagation of messages in the network, and the target delay attacks will attack some messages purposefully, such as Figure 4 As shown in Figure 4 Therefore, in order to avoid the process of broadcasting messages from being attacked by network delay attacks, another message broadcasting method is provided in the present application.

[0095] Referring to Figure 5 The present application provides a flowchart of another message broadcasting method, and the specific method flow is as follows:

[0096] Step 501, according to the remaining deadline of the message and the fan-out of the message, the first node broadcasts the message to F second nodes by using a preset transmission scheme;

[0097] Since the nodes in the point-to-point network can be attacked by random network delay attacks in the process of message broadcasting, the first node can perform network delay detection on the nodes in the local view before broadcasting the message to the F second nodes in the local view. Among them, the F second nodes are a plurality of nodes in the local view.

[0098] Optionally, the first node can send a ping message to the nodes in the local view at a certain time interval, and obtain the round-trip communication delay between the first node and the nodes in the local view by calculating the time interval between the sending of the ping message by the first node and the receiving of the pong message returned by the nodes in the local view. And whether the nodes in the local view are attacked by network delay attacks can be judged according to the round-trip communication delay between the nodes.

[0099] Specifically, when the round-trip communication delay between the first node and the second node is less than or equal to a preset value, the first node can regard the second node as a node in the local view of the first node; if the round-trip communication delay between the first node and the second node increases (or exceeds the preset value), it can be judged that the second node is attacked by network delay attacks, and the second node can be excluded from the local view of the first node. After a long enough time, the second node can be re-added to the local view of the first node. Among them, the long enough time can be 10 minutes or other preset time length.

[0100] In addition to randomly attacking the nodes in the network, the network attacker can also delay the message by judging the transmission mode of the message. To avoid the network attacker distinguishing the message by the transmission mode of the message, the first node can broadcast the message to the F second nodes by using a preset transmission scheme. The preset transmission scheme is used to indicate that the nodes in the network broadcast the same size of data packet based on the same time interval and fixed fan-out.

[0101] For example, every fixed time interval (for example, 5 milliseconds), the node can take a message from the head of the priority queue, determine whether the message is larger than the size of the default data packet (for example, 200 bits), if the message is larger than the size of the default data packet, the message can be split into multiple sub-packets for broadcasting; if the message is smaller than the size of the default data packet, the message can be filled with random data to meet the size of the default data packet. After the splitting or filling is completed, the node sends a fixed number of data packets (for example, one) to the neighbor nodes of the fixed fan-out (for example, one).

[0102] Step 502, according to the feedback propagation message received by the first node, the first node broadcasts the message to the F second nodes according to the adjusted transmission number of the message.

[0103] After the first node broadcasts the message to the F second nodes by using the preset transmission scheme, since the fan-out in the preset transmission scheme is fixed, the fan-out (or transmission rate) of the message can be changed by adjusting the transmission number of the message.

[0104] Optionally, the transmission number of the message can be adjusted according to the feedback propagation message received by the first node. When the remaining deadline of the message in the feedback propagation message is less than a preset threshold (for example, less than 0), that is, the fan-out (or transmission rate) of the message needs to be increased, the message can be added to the priority queue multiple times to increase the transmission number of the message instead of increasing the number of nodes to which the message is broadcast.

[0105] In addition, since there can be a malicious node in the peer-to-peer network, the malicious node can tamper with the remaining deadline of the message, thereby causing the message to be delayed, as shown in Figure 6 Figure 6 A schematic diagram of a malicious node tampering with the remaining deadline of a message. To avoid the malicious node tampering with the remaining deadline of the message at will, the present application provides another message broadcasting method.

[0106] Referring to Figure 7 , the present application provides a flowchart of another message broadcasting method, and the specific method flow is as follows:

[0107] Step 701, the first node encrypts the message to obtain an encrypted message;

[0108] ​In the point-to-point network, if there is a malicious node, the malicious node can arbitrarily tamper with the remaining deadline of the message to be broadcast, causing other nodes to incorrectly estimate the urgency of the message, which can cause the message to be delayed.

[0109] Optionally, to solve the problem of tampering with the remaining deadline of the message, the first node can encrypt the message, and when the encrypted message cannot be correctly decrypted, the first node will consider that the message has been damaged and will no longer propagate the message, avoiding the incorrect remaining deadline of the message affecting the broadcast of other messages.

[0110] Optionally, the nodes in the point-to-point network can also be caused to update or modify the remaining deadline of the message only in a trusted execution environment, so as to avoid the remaining deadline of the message being maliciously tampered with.

[0111] Step 702: According to the remaining deadline of the message and the fan-out of the message, the first node broadcasts an encrypted message to F second nodes.

[0112] After encrypting the message, the first node can broadcast the encrypted message to the F second nodes according to the manner in step 202 of the foregoing Figure 2 , and can adjust the fan-out of the encrypted message according to the feedback propagation message. In addition, the preset transmission scheme in step 501 of the foregoing Figure 5 may also be used to broadcast the encrypted message to the F second nodes, and the transmission rate of the message can be adjusted by changing the number of transmissions of the message, which will not be described here again.

[0113] The foregoing describes the method flow provided by the present application. Based on the foregoing method flow, the device provided by the present application is described below.

[0114] Referring to Figure 8 , a structural schematic diagram of a message broadcast device provided by the present application is described as follows.

[0115] The determining module 801 is configured to determine, by a first node, a remaining deadline of a message, the remaining deadline being used to indicate a remaining valid time length of the message for broadcast;

[0116] The broadcasting module 802 is configured to broadcast, by the first node, the message to F second nodes according to the remaining deadline of the message and a fan-out of the message, the fan-out being used to indicate a transmission rate of the message in the network, and the second nodes being neighbor nodes of the first node.

[0117] The first updating module 803 is configured to update, by the first node, the fan-out according to a feedback propagation message received by the first node, to obtain an updated fan-out, the feedback propagation message being a feedback message sent by a node in the network based on a received message, and the updated fan-out being used to instruct the first node to broadcast the message to M second nodes, M being greater than or less than F.

[0118] In a possible implementation, the determining module 801 is specifically configured to: if the message is sent by a client to the first node, the first node sets a remaining deadline for the message; and if the message is sent by a third node in the network to the first node, the first node updates the remaining deadline of the message according to a network delay of the message, the network delay of the message being obtained based on a round-trip communication delay between the first node and the third node.

[0119] In a possible implementation, before the broadcasting module broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message, the apparatus can further include an encryption module 804 configured to encrypt the message by the first node to obtain an encrypted message.

[0120] In a possible implementation, the broadcasting module is specifically configured to broadcast the encrypted message to the F second nodes according to the remaining deadline of the message and the fan-out of the message.

[0121] In a possible implementation, before the broadcasting module broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message, the apparatus can further include a processing module 805 configured to: when a round-trip communication delay between the first node and the second node is less than or equal to a preset value, the first node takes the second node as a node in a local view of the first node, and the local view includes the F second nodes.

[0122] In a possible implementation, the broadcasting module 802 is specifically configured to: the first node sends the message to a priority queue, and queue messages in the priority queue are sorted according to the remaining deadline of the queue messages; and the first node broadcasts the message to the F second nodes according to the sorting of the message in the priority queue and the fan-out of the message.

[0123] In a possible implementation, before the broadcasting module broadcasts the message to the F second nodes according to the sorting of the message in the priority queue and the fan-out of the message, the apparatus can further include a second updating module 806 configured to update the remaining deadline of the message by the first node according to a queuing duration of the message in the priority queue.

[0124] In a possible implementation, the first updating module 803 is specifically configured to: when the remaining deadline of the message in the feedback propagation message exceeds a first preset threshold, the first node decreases the fan-out to obtain an updated fan-out; and when the remaining deadline of the message in the feedback propagation message is less than a second preset threshold, the first node increases the fan-out to obtain an updated fan-out.

[0125] In a possible implementation, the broadcast module 802 is configured to broadcast, by the first node, the message to the F second nodes according to the remaining deadline of the message and the fan-out, and the preset transmission scheme is used to indicate that the nodes in the network broadcast the same size of data packet based on the same time interval and the fixed fan-out.

[0126] In a possible implementation, after the broadcast module 802 broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out, the apparatus further includes an adjustment module 807 configured to adjust, by the first node, the transmission times of the message according to the feedback propagation message received by the first node, and the broadcast module 802 is further configured to broadcast, by the first node, the message to the F second nodes according to the transmission times of the message.

[0127] Referring to Figure 9 The network device provided in the present application is implemented by a general bus architecture.

[0128] The network device includes at least one processor 901, a communication bus 902, a memory 903, and at least one communication interface 904.

[0129] Optionally, the processor 901 is a general CPU, NP, microprocessor, or one or more integrated circuits for implementing the scheme of the present application, such as an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD is a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0130] The communication bus 902 is used to transmit information between the above components. The communication bus 902 is divided into an address bus, a data bus, a control bus, and the like. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0131] Optionally, memory 903 is read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions. Alternatively, memory 903 is random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions. Alternatively, memory 903 is electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but not limited to these. Optionally, memory 903 exists independently and is connected to processor 901 via communication bus 902. Optionally, memory 903 and processor 901 are integrated together.

[0132] Communication interface 904 uses any transceiver-like device for communicating with other devices or communication networks. Communication interface 904 includes a wired communication interface. Optionally, communication interface 904 also includes a wireless communication interface. The wired communication interface is, for example, an Ethernet interface. The Ethernet interface is an optical interface, an electrical interface, or a combination thereof. The wireless communication interface is a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof, etc.

[0133] In a specific implementation, as one example, the processor 901 includes one or more CPUs, such as... Figure 9 CPU0 and CPU1 are shown in the diagram.

[0134] In a specific implementation, as one example, the network device includes multiple processors, such as... Figure 9 The processors 901 and 905 shown are illustrated. Each of these processors is either a single-core processor (CPU) or a multi-core processor (CPU). Here, a processor refers to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0135] In some embodiments, the memory 903 is configured to store program codes 906 for executing the methods of the present application, and the processor 901 is configured to execute the program codes 906 stored in the memory 903. That is, the network device implements the above-described method embodiments by means of the processor 901 and the program codes 906 in the memory 903.

[0136] The computer readable storage medium in the embodiments of the present application stores a program, and when the program runs on the computer, the computer executes the steps of the methods described in the above embodiments. Figure 2 、 Figure 5 and Figure 7 The computer readable storage medium in the embodiments of the present application stores a program, and when the program runs on the computer, the computer executes the steps of the methods described in the above embodiments.

[0137] The computer readable storage medium in the embodiments of the present application stores a program, and when the program runs on the computer, the computer executes the steps of the methods described in the above embodiments. Figure 2 、 Figure 5 and Figure 7 The computer readable storage medium in the embodiments of the present application stores a program, and when the program runs on the computer, the computer executes the steps of the methods described in the above embodiments.

[0138] In addition, it should be noted that the above-described device embodiments are only schematic, and the units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application. In addition, in the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines.

[0139] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0140] In the several embodiments provided by the present application, it should be understood that the disclosed system, device and method can be implemented by other ways. For example, the above-described device embodiments are only schematic, and the division of the units is only a logical function division, and there can be another division way in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0141] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0142] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0143] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, read-only memory), a random access memory (RAM, random access memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0144] The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.

[0145] Finally, it should be noted that: the above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered within the protection scope of the present application.

Claims

1. A message broadcasting method, characterized by, The method comprises the following steps: The first node determines a remaining deadline of a message, wherein the remaining deadline is used to represent a remaining valid time length for the message to be broadcasted; The first node broadcasts the message to F second nodes according to the remaining deadline of the message and a fan-out of the message, wherein the fan-out represents a transmission rate of the message in a network, and the second nodes are neighbor nodes of the first node; The first node updates the fan-out according to a feedback propagation message received by the first node, to obtain an updated fan-out, wherein the feedback propagation message is a feedback message sent by a node in the network based on the received message, and the updated fan-out is used to instruct the first node to broadcast the message to M second nodes, wherein M is greater than or less than F.

2. The method of claim 1, wherein, The first node determines a remaining deadline of a message, comprising: If the message is sent by a client to the first node, the first node sets the remaining deadline for the message; If the message is sent by a third node in the network to the first node, the first node updates the remaining deadline of the message according to a network delay of the message, wherein the network delay of the message is obtained based on a round-trip communication delay between the first node and the third node.

3. The method according to claim 1 or 2, characterized in that, Before the first node broadcasts the message to F second nodes according to the remaining deadline of the message and a fan-out of the message, the method further comprises: The first node encrypts the message to obtain an encrypted message.

4. The method of claim 3, wherein, The first node broadcasts the message to F second nodes according to the remaining deadline of the message and a fan-out of the message, comprising: The first node broadcasts the encrypted message to the F second nodes according to the remaining deadline of the message and the fan-out.

5. The method according to any one of claims 1 to 4, characterized in that, Before the first node broadcasts the message to F second nodes according to the remaining deadline of the message and a fan-out of the message, the method further comprises: When a round-trip communication delay between the first node and the second node is less than or equal to a preset value, the first node regards the second node as a node in a local view of the first node, wherein the local view comprises the F second nodes.

6. The method according to any one of claims 1 to 5, characterized in that, The first node broadcasts the message to F second nodes according to the remaining deadline of the message and a fan-out of the message, comprising: The first node sends the message to a priority queue, wherein queue messages in the priority queue are sorted according to remaining deadlines of the queue messages; The first node broadcasts the message to the F second nodes according to the sorting of the message in the priority queue and the fan-out.

7. The method of claim 6, wherein, Before the first node broadcasts the message to the F second nodes according to the sorting of the message in the priority queue and the fan-out, the method further comprises: The first node updates the remaining deadline of the message according to a queuing time length of the message in the priority queue.

8. The method according to any one of claims 1 to 7, characterized in that, The first node updates the fan-out according to a feedback propagation message received by the first node, to obtain an updated fan-out, comprising: when the remaining deadline of the message in the feedback propagation message exceeds a first preset threshold, the first node decreases the fan-out to obtain the updated fan-out; when the remaining deadline of the message in the feedback propagation message is less than a second preset threshold, the first node increases the fan-out to obtain the updated fan-out.

9. The method according to any one of claims 1 to 5, characterized in that, the first node broadcasts the message to F second nodes according to the remaining deadline of the message and the fan-out of the message, including: the first node broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out by using a preset transmission scheme, the preset transmission scheme being used to instruct nodes in the network to broadcast data packets of the same size based on the same time interval and the fixed fan-out.

10. The method of claim 9, wherein, after the first node broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out by using the preset transmission scheme, the method further includes: the first node adjusts the number of times of transmission of the message according to the feedback propagation message received by the first node; the first node broadcasts the message to the F second nodes according to the number of times of transmission of the message.

11. A message broadcasting apparatus characterized by comprising: including: a determination module, configured to determine, by a first node, a remaining deadline of a message, the remaining deadline being used to represent a remaining valid time length during which the message is broadcasted; a broadcast module, configured to broadcast, by the first node, the message to F second nodes according to the remaining deadline of the message and a fan-out of the message, the fan-out representing a transmission rate of the message in a network, the second nodes being neighbor nodes of the first node; a first updating module, configured to update, by the first node, the fan-out according to a feedback propagation message received by the first node, the feedback propagation message being a feedback message sent by a node in the network based on the received message, the updated fan-out being used to instruct the first node to broadcast the message to M second nodes, the M being greater than or less than the F.

12. The apparatus of claim 11, wherein, the determination module is specifically configured to: if the message is sent by a client to the first node, the first node sets the remaining deadline for the message; if the message is sent by a third node in the network to the first node, the first node updates the remaining deadline of the message according to a network delay of the message, the network delay of the message being obtained based on a round-trip communication delay between the first node and the third node.

13. The apparatus of claim 11 or 12, wherein, before the first node broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message, the apparatus further includes: an encryption module, configured to encrypt, by the first node, the message to obtain an encrypted message.

14. The apparatus of claim 13, wherein, the broadcast module is specifically configured to: broadcast, by the first node, the encrypted message to the F second nodes according to the remaining deadline of the message and the fan-out.

15. The apparatus of any one of claims 11 to 14, wherein, before the first node broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out of the message, the apparatus further includes: a processing module, configured to: when a round-trip communication delay between the first node and the second node is less than or equal to a preset value, the first node taking the second node as a node in a local view of the first node, the local view including the F second nodes.

16. The apparatus of any one of claims 11 to 15, wherein, The broadcast module is specifically configured to: The first node sends the message to a priority queue, and queue messages in the priority queue are sorted according to remaining deadlines of the queue messages. According to the sorting of the message in the priority queue and the fan-out, the first node broadcasts the message to the F second nodes.

17. The apparatus of claim 16, wherein, Before the first node broadcasts the message to the F second nodes according to the sorting of the message in the priority queue and the fan-out, the apparatus further includes: A second updating module, configured to: the first node updating the remaining deadline of the message according to a queuing duration of the message in the priority queue.

18. The apparatus of any one of claims 11-17, wherein, The first updating module is specifically configured to: When the remaining deadline of the message in the feedback propagation message exceeds a first preset threshold, the first node decreases the fan-out to obtain the updated fan-out. When the remaining deadline of the message in the feedback propagation message is less than a second preset threshold, the first node increases the fan-out to obtain the updated fan-out.

19. The apparatus of any one of claims 11-15, wherein, The broadcast module is specifically configured to: According to the remaining deadline of the message and the fan-out, the first node broadcasts the message to the F second nodes by using a preset transmission scheme, the preset transmission scheme being used to instruct nodes in the network to broadcast data packets of the same size based on the same time interval and a fixed fan-out.

20. The apparatus of claim 19, wherein, After the first node broadcasts the message to the F second nodes according to the remaining deadline of the message and the fan-out, the apparatus further includes: An adjusting module, configured to: according to a feedback propagation message received by the first node, the first node adjusting a transmission number of the message. The broadcast module is further configured to: according to the transmission number of the message, the first node broadcasting the message to the F second nodes.

21. A network device, comprising: comprising: a processor, configured to execute a program, so that the network device performs the method in any one of claims 1 to 10.

22. A computer-readable storage medium, including instructions, which, when executed on a computer, cause the computer to perform the method in any one of claims 1 to 10.

23. A computer program product including instructions, which, when executed on a computer, cause the computer to perform the method in any one of claims 1 to 10.