WO2017214817A1 - Distributed network message processing method and node - Google Patents

Distributed network message processing method and node Download PDF

Info

Publication number
WO2017214817A1
WO2017214817A1 PCT/CN2016/085582 CN2016085582W WO2017214817A1 WO 2017214817 A1 WO2017214817 A1 WO 2017214817A1 CN 2016085582 W CN2016085582 W CN 2016085582W WO 2017214817 A1 WO2017214817 A1 WO 2017214817A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
partition
node
subscription
neighbor
Prior art date
Application number
PCT/CN2016/085582
Other languages
French (fr)
Chinese (zh)
Inventor
任智
王斌
Original Assignee
深圳天珑无线科技有限公司
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 深圳天珑无线科技有限公司 filed Critical 深圳天珑无线科技有限公司
Priority to PCT/CN2016/085582 priority Critical patent/WO2017214817A1/en
Publication of WO2017214817A1 publication Critical patent/WO2017214817A1/en

Links

Images

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a message processing method and a node for a distributed network.
  • the mobile Ad Hoc network is a common distributed network. It uses a partitioned structure. The network is divided into multiple mountain sections (English: hill). Each partition includes a hilltop (English: hilltop) node and common node. In the network, after the node generates the content message, the node saves the content message locally and the top node of the partition. When the other partitioned node needs the content message, it generates a corresponding subscription message and sends it to other partition nodes to request the content message. The subscription message must be sent to the source node of the content message or the hilltop node of the source partition to obtain the content message.
  • the node does not know the node where the content message is located in the process of publishing the subscription message. It can only publish the subscription message to different nodes without the target. Therefore, the subscription message may be transmitted to more nodes but still fails to reach the source node or source. The top node of the partition, and thus the content message is not obtained, resulting in a large transmission data overhead.
  • the technical problem to be solved by the present invention is to provide a message processing method and a node of a distributed network, which can reduce data transmission overhead.
  • a technical solution adopted by the present invention is to provide a message processing method for a distributed network, the method comprising: receiving a summary message of a non-local content message sent by a neighboring partition; and subscribing the message with And the summary message is matched; if the summary message matches, the summary message is sent along a communication path of the subscription message, or the subscription message is sent along a communication path of the summary message.
  • the summary message includes a summary of the content message and a partition identifier of the source partition of the content message.
  • the method further includes: receiving the subscription message; determining whether to match the subscription message with a local content message; if matching with the local content message, Then, the matched content message is returned; otherwise, the step of matching the subscription message with the summary message is performed.
  • the step of transmitting the summary message along a communication path of the subscription message or the sending the subscription message along a communication path of the summary message further includes: determining the summary if the summary message is matched Whether the partition on the incoming path of the message is included in the neighbor partition of the source partition of the subscribed message; if included in the neighbor partition of the source partition of the subscribed message, the sending path along the incoming message of the subscribed message
  • the summary message is sent; otherwise, the subscription message is sent along the communication path of the summary message.
  • the step of returning the matched content message includes: determining whether the source partition of the subscription message is included in the neighbor partition; if yes, sending the content message directly to the source partition; otherwise, The incoming message of the subscription message returns the content message.
  • the step of determining whether the source partition of the subscription message is included in the neighbor partition further includes: extracting a partition identifier of the neighbor partition from a broadcast message of the neighbor node, and performing local storage; and determining the neighbor partition
  • the step of including the source partition of the subscription message includes: matching the partition identifier of the target partition with the locally stored partition identifier; if the matching is successful, determining that the target partition is included in the neighbor partition.
  • the method further includes: generating a summary message of the local content message; selecting a neighboring node that can reach the neighboring partition from the neighboring node, and sending the notification message to the neighboring node that can reach the neighboring partition .
  • the method further includes: determining whether the broadcast message of the neighboring node includes the partition identifier of the neighboring partition or is capable of A path identifier that partitions the neighbor; if so, the neighbor node is marked as a neighbor node that is capable of accessing the neighbor partition.
  • a distributed network node including: a receiving module, configured to receive a summary message of a non-local content message sent by a neighboring partition; a matching module, The matching message is matched with the summary message; the sending module is configured to send the summary message along a communication path of the subscription message when the subscription message matches the summary message, or the communication along the summary message The path sends a subscription message.
  • another technical solution adopted by the present invention is to provide a distributed network node, including a transmitter, a receiver, a processor, and a memory, and the processor uses the instruction stored in the memory to use Obtaining: a summary message of the non-local content message sent by the neighbor partition received by the receiver; matching the subscription message with the summary message; if matching with the summary message, following the subscription by the sender The message path of the message is sent by the profile message, or the message is sent by the sender along the message path of the profile message.
  • the node after generating the content message, the node sends the summary message of the content message to the neighboring partition, and the node of the neighboring partition further matches the subscription message with the summary message, and directly follows the communication path of the subscription message when matching Sending the summary message, or sending the subscription message along a communication path of the summary message, implementing effective transmission of the subscription message without sending a subscription message without a target, thereby improving the efficiency of searching for the content message and reducing data transmission Overhead.
  • FIG. 1 is a schematic structural diagram of an embodiment of a distributed network system according to the present invention.
  • FIG. 2 is a flowchart of an embodiment of a message processing method of a distributed network according to the present invention
  • FIG. 3 is a partial flow chart of another embodiment of a distributed network message processing method according to the present invention.
  • FIG. 4 is a schematic structural diagram of an embodiment of a distributed network node according to the present invention.
  • FIG. 5 is a schematic structural diagram of another embodiment of a distributed network node according to the present invention.
  • FIG. 1 is a schematic structural diagram of an embodiment of a distributed network system according to the present invention.
  • the distributed network system 100 includes a plurality of nodes 111. Based on the actual network physical topology, the plurality of nodes 111 are virtualized into at least one mountainous partition (hereinafter also referred to as partition) 110, and the node 111 in the mountainous partition 110 is further divided into at least one mountain node. 111a and the normal node 111b.
  • partition mountainous partition
  • the mountain node 111a serves as a collection point of the partition 110 message for managing the partition.
  • the node message and the node message processing the other partitions; the normal node 111b is used to forward the message to the hilltop node 111a in the partition 110 by means of a greedy policy or the like.
  • the hilltop node 111a is the node with the highest connectivity among the partitions 110
  • the common node 111b is the node whose connectivity is lower than the hilltop node 111.
  • the hilltop node 111a may also be a node whose connectivity is higher than a set value. That is, the partition may contain multiple hilltop nodes.
  • System 100 is a publish/subscribe system whose nodes can issue subscription messages to the network and obtain corresponding content messages from other nodes.
  • the subscription message is used to request a response, and the content message is used to perform the above response.
  • the content message is a message containing service data, which is equivalent to a data packet;
  • the subscription message is a control message requesting to obtain a content message, which is equivalent to a request packet in the control packet, and may include a source node address and a message. Fields such as identification, content message summary, and more.
  • system 100 logically includes three phases in a sequence:
  • each node 111 After the network starts running, each node 111 periodically broadcasts a heartbeat message within a 1-hop range and receives heartbeat messages from surrounding nodes. Alternatively, node 111 in the network may also perform heartbeat and receive heartbeat messages as described in the sixteenth embodiment below.
  • the heartbeat message is a control message that carries at least a node identifier and an identifier of a partition where the node is located. For example, the heartbeat message carries a node ID, a number of neighbors, a node height value, an ID of a partition where the node is located, and the like. This transceiving operation continues to be performed throughout the network. After waiting for a preset time T (the default value of T can be set to 60s or other values), the node 111 calculates its own node height value parameter according to the following formula:
  • H p represents the height value of the node p
  • N(l, p) represents the set of 1-hop neighbor nodes of the node p (including p itself)
  • represents the 1-hop neighbor node of the node q. Number (including q itself).
  • the node determines whether it is a mountain node in the following way: if its own height value is higher than the height value of all neighbor nodes, it determines that it is a mountain node, otherwise it is not; the ordinary node regards the neighbor node with the highest height value as a mountain node or The next hop to the top node. In this way, several single-hop or multi-hop mountainous regions adjacent to each other are formed in the network, and the top nodes of each partition can be determined.
  • the normal node 111b If the normal node 111b generates a content message, it sends the content message to the local hilltop node 111a (the mountaintop node in the partition). After receiving the content message, the local hilltop node 111a stores it and matches the previously cached subscription message. If the matching is successful, the content message is sent along the communication path of the subscription message to the source node of the subscription message; if the matching is unsuccessful, no processing is performed. The content message generated by the hilltop node 111a itself also performs the above-described storage and matching processing.
  • the node 111 If the content message is required, the node 111 generates a corresponding subscription message and sends it to the local hilltop node 111a. After receiving the subscription message, the local hilltop node 111a first matches the stored content message. If the matching is successful, the matching content message is sent to the source node of the subscription message along the communication path of the subscription message; if the matching is unsuccessful, the subscription message is stored, and a communication path different from the subscription message is selected. The subscription message is forwarded through the selected path.
  • the normal node 111b If the normal node 111b receives the subscription message sent by other partitions, the normal node 111b forwards the subscription message to the local mountain node. If the subscription message sent by the local hilltop node is received, the subscription message is forwarded to the neighbor partition.
  • the subscription message is transmitted back to the local hilltop node 111a along the incoming path; if a hilltop node of a stub partition (ie, a partition with only one neighbor partition) does not find the content message requested by the subscription message in the partition, The subscription message is then transmitted back along the incoming path to the hilltop node 111a of the neighboring partition.
  • a hilltop node of a stub partition ie, a partition with only one neighbor partition
  • Both the hilltop node 111a and the normal node 111b in the network operate in the above manner until a matching content message is found, the number of times the subscription message is transmitted by the hilltop node reaches a threshold and is no longer forwarded, or the subscription message is returned.
  • each node in the system has the same physical property and has a routing function. Moreover, each node can act as both a publisher of content messages and a subscriber to content messages.
  • FIG. 1 only exemplarily shows the topology of the distributed network of the present invention, but is not limited to the distributed network structure of the present invention.
  • the distributed network may be Including more partitions, each partition can have a common node, and the number of mountain nodes in each partition can be multiple.
  • the distributed network system can be a distributed wired network system or a distributed wireless network system.
  • the distributed wireless network system may specifically but not limited to a mobile Ad Hoc network system, and the node may be any mobile terminal that can implement communication, such as a mobile phone, a computer, or the like.
  • the hilltop node 111a and the common node 111b in the system may perform the method in at least one of the following embodiments, or correspond to the nodes in the following embodiments. For details, refer to the following description of the embodiments.
  • the neighbor node is a node located in the transmission range of the current node, and the embodiment can be understood as a node reachable by one hop.
  • a neighbor partition is another partition that includes its neighbor nodes.
  • This embodiment provides an embodiment of a routing method of a distributed network.
  • the routing method may be performed by the hilltop node or the common node shown in FIG. 1, and specifically includes the following steps:
  • S201 Select a neighbor node that can lead to the neighbor partition from neighbor nodes adjacent to the current node.
  • the current node pre-stores a list of neighbor nodes that can lead to the neighbor partition, and the list includes the neighbor node identifier and the neighbor partition identifier that can be accessed.
  • the current node determines that the subscription message needs to be forwarded to the neighboring partition, select a non-subscribed message from the list of pre-stored neighbor nodes (ie, the node on the incoming path different from the subscribed message) or passable A neighbor node to a neighbor partition that has not received the subscription message. If there are neighbor nodes that satisfy the above conditions, a random algorithm may be used to select one of them. If the neighboring node has received the subscription message, it may be considered that the subscription message does not need to be forwarded, and the subscription message is returned according to the incoming path.
  • the current node may perform the steps of the third or fifteenth embodiment described below prior to S201 to obtain neighbor nodes that may be directed to the neighbor partition.
  • S202 Send a subscription message to be forwarded to the neighbor node that can lead to the neighbor partition.
  • each node can perform the above method when forwarding a subscription message. For example, after receiving the subscription message, the neighboring node performs the operations of S201 and S202 to forward the subscription message to its next hop neighbor node to implement sending the subscription message to its neighboring partition.
  • the node directly selects a neighboring node that can reach the neighboring partition to forward the subscription message, thereby avoiding forwarding the subscription message to the node that cannot reach the neighboring partition, and then returning to the local peak.
  • the node reroutes until it is correctly forwarded to the node that can reach the neighbor partition, thus avoiding unnecessary round-trip transmission of the subscription message and generating forwarding redundancy, reducing the subscription overhead, transmitting data overhead, and time consuming to find content messages. Improve data transfer efficiency.
  • This embodiment provides an embodiment of a neighbor processing method of a distributed network.
  • the neighbor processing method can be performed by the hilltop node or the normal node shown in FIG. 1.
  • the method is used to obtain a neighbor node that can lead to a neighbor partition, and specifically includes:
  • the neighbor node that can lead to the neighbor partition may include a neighbor node located in the current partition or a neighbor node located in the neighbor partition.
  • each node of the network periodically broadcasts a first heartbeat message after the partition is formed, and the ordinary node receives the first heartbeat message of the neighbor node and determines the first heartbeat. If the identifier of the partition carried in the message is the identifier of the other partition (that is, the neighbor partition identifier), the neighbor node may record the neighbor partition corresponding to the carried identifier, and broadcast a second path with the path identifier that can lead to the neighbor partition. A heartbeat message, wherein the second heartbeat message is different from the first heartbeat message in that it includes the way leg identifier.
  • the normal node receives the second heartbeat message, it also records that the neighbor node can reach the neighbor partition corresponding to the carried identifier, and broadcasts a second heartbeat message including the way identifier that can lead to the neighbor partition. Therefore, the local common node sends the second heartbeat message to the different neighboring partitions to the local mountaintop node, and the mountaintop node receives the second heartbeat message of the neighboring node, and records that the neighboring node can reach the neighbor corresponding to the carried identifier. Partition. Through the routing mechanism, nodes in the network can continuously perceive the presence or absence of neighbor nodes and neighbor partitions to the neighbor partition according to the received heartbeat message.
  • the S301 step may be specifically: the node receives the heartbeat message of each of the neighboring nodes; and determines whether the heartbeat message (also referred to as a broadcast message) of the neighboring node includes the partition identifier of the neighboring partition (for the first heartbeat) Message) or a way path to the neighbor partition (which is a second heartbeat message).
  • the heartbeat message also referred to as a broadcast message
  • the neighboring node may be connected to the neighboring partition, and determine, according to the partition identifier of the neighboring partition carried in the heartbeat message, To the neighbor partition; further, if the current node is a normal node, the path identifier is also marked in the heartbeat message of the current node, and further Broadcasting a heartbeat message of the current node.
  • the path identifier may be represented by the attribute or the content of the message.
  • the path identifier is a message type field, that is, the value of the second heartbeat message is different from the value of the message type field of the first heartbeat message. It may also be represented by a different message length, a message format, or the like than the first heartbeat message, or the way identifier is a message extension field for carrying the partition identifier of the neighbor partition.
  • the local neighbor node information records the partition identifier of the neighbor partition that the neighbor node can reach.
  • the node in the distributed network can determine the neighbor nodes that can reach the neighboring partition, so that the node can directly pass the neighboring node that can lead to the neighboring partition. Forward the subscription message to the neighbor partition.
  • This embodiment provides an embodiment of a distributed network routing method.
  • the routing method may be performed by the hilltop node shown in FIG. 1, and the method may be performed before the foregoing S201, so that when the current node in the embodiment receives the subscription message and determines that there is no content message that matches the subscription message, The step of S201 is performed again.
  • the method includes:
  • S401 Receive a subscription message.
  • S402 Match the subscription message to the content message of the common node of the current partition to the top node; if the matching is successful, execute S403; if the matching is unsuccessful, execute S404, or execute S201, or execute
  • the method steps described in the eighth embodiment, or the method steps described in the following tenth embodiment are performed, or the steps S112-S113 (shown in FIG. 3) described in the eleventh embodiment are performed, or executed.
  • the current node may return a content message that matches the subscription message along the communication path of the subscription message, or perform the method steps described in the ninth embodiment.
  • the normal node of the current partition cancels the content after generating the content message.
  • the information is saved with the local mountain node.
  • the hilltop node matches the saved content message according to the content message summary in the subscription message. If the matching is successful, the matching content message is sent back along the communication path of the subscription message. After that, the subscription message is invalid, and the network will not forward the subscription message. If the match is unsuccessful, it is determined that there is no content matching the subscription message in the current partition, and is processed according to the following two situations:
  • the method may be performed by directly performing the foregoing S201 and S202, or performing the method steps described in the following eighth embodiment, or performing the following method steps in the tenth embodiment. Or performing the steps S112-S113 described in the eleventh embodiment, or performing the steps S132-S133 described in the thirteenth embodiment, or performing the step S172 described in the seventeenth embodiment;
  • the above S404 is performed to subscribe to the message.
  • the reduced backhaul wherein the above S404 can specifically perform message reduction backhaul as described in the fifth embodiment.
  • This embodiment provides an embodiment of a message backhauling method of a distributed network.
  • the message backhauling method may be performed by a hilltop node or a common node as shown in FIG.
  • S501 Reduce the subscription message into a backhaul message.
  • the backhaul message can be used to identify the subscription message.
  • the step may include: extracting, by the subscription message, the subscription message identifier and a source address identifier (an address identifier of the source node, such as an ID of the source node, an IP address, a Mac address, etc.); according to the subscription message The identifier and the source address identifier generate the backhaul message.
  • the step includes: extracting the feature information from the subscription message; and generating a backhaul message carrying the feature information.
  • the feature information may include the subscription message identifier and a source address identifier, and the like.
  • the subscription message includes a subscription message identifier, a source address identifier, and a content summary, which may be a matching content message digest and/or a subscription message digest.
  • the extracting the subscription message identifier and the source address identifier from the subscription message further includes: discarding the content summary in the subscription message to obtain the subscription message identifier remaining in the subscription message to And source address identifier.
  • S502 The backhaul message is returned along a communication path of the subscription message, where the message volume of the backhaul message is smaller than the message amount of the subscription message.
  • the node identifier in the present invention may be information such as the node ID, the node IP address, or the node Mac address, which can uniquely identify the node, and the partition identifier may be information that uniquely identifies the partition identifier for the partition ID or the like.
  • the node on the incoming path of the subscription message caches the subscription message and its previous hop node and the next hop node after forwarding the subscription message until the subscription message is invalid (for example, if the number of times the hill node forwards exceeds the threshold, the search is found.
  • the cached subscription message is deleted only if the content message matches, or the cache timeout, etc.). Therefore, after receiving the backhaul message, the ordinary node on the incoming path of the subscription message compares the backhaul message with the locally cached subscription message, thereby obtaining the last hop of the locally cached corresponding subscription message. And sending, by the node, a backhaul message to the previous hop node, to implement transmitting the backhaul message along the received communication path of the subscribed message.
  • the hilltop node on the incoming path of the subscription message finds the corresponding cached complete subscription message according to the backhaul message, and determines whether the neighboring partition has forwarded the subscription message. If yes, the subscription message is forwarded to the neighbor node that can reach the neighboring partition that has not forwarded the subscription message according to the foregoing steps S201 and S202; if yes, the backhaul message is continued to be returned according to the above S401 and S402 until the The return message reaches the local hill node of its source node or its source node.
  • the normal node on the incoming path of the subscription message may perform the same steps as the hilltop node. It can be understood that the above-mentioned communication path along the subscription message is transmitted in the opposite direction of the subscription message.
  • the above-mentioned streamlined backhaul method not only realizes the effect of subscribing message backhaul, but also shortens the data amount of the returned subscription message and reduces the transmission data overhead.
  • the embodiment provides an embodiment of a routing method of a distributed network, where the current node is a common node, and the method includes:
  • S602 Match the subscription message with the local content message; if the matching is successful, execute S603; if the matching is unsuccessful, execute S604, or execute S112-S113 according to the eleventh embodiment. Steps, or performing the steps S132-S133 described in the thirteenth embodiment.
  • S603 Reply to the content message that matches the subscription message along the communication path of the subscription message.
  • the current common node has the function of directly replying to the content message, and does not need to be forwarded to the local mountain node for reply, which reduces the number of forwarding of the subscription message and the content message, reduces the subscription overhead and data forwarding overhead, and improves the data transmission efficiency.
  • the current common node saves the content message locally after generating the content message.
  • the current normal node matches the saved content message according to the content message summary in the subscription message. If the matching is successful, the matching content message is sent back along the communication path of the subscription message. After that, the subscription message is invalid, and the network will not forward the subscription message. If the matching is unsuccessful, it is determined that the current node does not have content matching the subscription message, and the following may be determined by the subscription message, and the subscription message is forwarded according to the corresponding situation:
  • the foregoing S201, S202 may be performed, or the method steps described in the following tenth embodiment may be performed, Forwarding the subscription message to the neighbor partition, or performing the step S172 described in the seventeenth embodiment;
  • the subscription message may be transmitted along the path leading to the top node of the current partition.
  • the current node may determine the above two situations according to the previous hop node of the subscription message. For example, the current node pre-stores a neighboring node that can lead to the local mountaintop node, and determines whether the previous hop node of the subscription message is the neighboring node that can reach the local mountaintop node, and if so, determines that the situation A belongs to the foregoing, Otherwise it is determined to belong to case B.
  • the matching is unsuccessful, and the current node does not satisfy the backhaul condition, such as unable to continue forwarding the subscription message or continuing to forward the subscription message (the embodiment shown in FIG. 1 has this condition)
  • the above S404 is performed to perform the subscription message reduction backhaul.
  • determining that the subscription message belongs to the foregoing situation Case A or B if the above situation B is met, the above S602 is performed, and when the matching is unsuccessful, the subscription message is transmitted along the path leading to the top node of the current partition; if the above situation A is met, the above is directly performed. S201, S202, to forward the subscription message to the neighbor partition.
  • This embodiment provides a flowchart of an embodiment of a message replying method of a distributed network.
  • the message replying method may be performed by the common node shown in FIG. 1 to reduce the data transmission overhead and the reply time of the content message, and specifically includes the following steps. :
  • S701 Determine whether the neighbor node includes the target node of the content message to be returned, if yes, execute S702, if not, execute S703.
  • the target node of the content message is the source node of the subscription message that matches the content message.
  • the current node further extracts the node identifier of the neighbor node from the broadcast message of the neighbor node, and performs local storage.
  • the S701 includes: matching the node identifier of the target node with the locally stored node identifier; if the matching is successful, determining that the neighbor node includes the target node.
  • S702 Send the content message directly to the target node.
  • the current node determines that the content message does not need to be replied according to the communication path of the subscription message, and is directly sent to the target node via the content message.
  • S703 Return the content message along a communication path of the subscription message corresponding to the content message.
  • the embodiment provides an embodiment of a message transmission method of a distributed network.
  • the message transmission method can be executed by the hilltop node shown in FIG. 1 to shorten the message transmission path and reduce data transmission overhead, including the following steps:
  • S801 Determine whether the neighbor partition of the local partition is included in the neighbor partition of the source partition of the subscription message to be forwarded. If yes, execute S802. If not, execute S803.
  • the source partition of the subscription message is the partition of the source node that generates the subscription message.
  • the current node may first acquire the partition identifier of the neighbor partition and the partition identifier of the subscription message source partition to perform matching.
  • the step of S801 is specifically to compare the partition identifier of the neighbor partition of the local partition with the partition identifier of the neighbor partition of the source partition. If the match is successful, the neighbor partition identifying the local partition is included in the neighbor partition of the source partition of the subscription message to be forwarded.
  • the subscription message may be streamlined back along the incoming path as described in the fifth embodiment.
  • This embodiment provides an embodiment of a message replying method for a distributed network.
  • the message replying method can be executed by the hilltop node shown in FIG. 1 for shortening the transmission path of the content message and reducing the data transmission overhead, including the following steps:
  • S901 Determine whether the target partition of the content message to be returned is included in the neighbor partition, if yes, execute S902; if not, execute S903.
  • the target partition of the content message is the source partition of the subscription message that matches the content message.
  • the S901 includes: matching a partition identifier of the target partition with a partition identifier of a locally stored neighbor partition; if the matching is successful, determining that the target partition is included in the neighbor partition.
  • the current node determines that the content message does not need to be replied according to the communication path of the subscription message, and is directly sent to the target partition via the content message.
  • the current node may send a notification message corresponding to the content message according to the communication path, to notify each node on the communication path that the target partition has received the content message, where The message amount of the notification message is smaller than the message amount of the content message.
  • the notification message may include at least an identifier of the target node and an identifier of the subscription message.
  • S903 Return the content message along a communication path of the subscription message corresponding to the content message.
  • the current node may return the content message by referring to the seventh embodiment.
  • This embodiment provides an embodiment of a routing method of a distributed network, which may be performed by a common node or a hilltop node as shown in FIG. 1 for routing optimal selection and reducing data transmission overhead. Includes the following steps:
  • S101 Select, from the neighbor nodes, a neighbor node that can lead to the neighbor partition and has the few hops to the neighbor partition as the target neighbor node.
  • the heartbeat message broadcasted by the neighboring node to the neighboring partition includes at least a partition identifier of the neighboring partition that can be accessed and a hop count identifier for indicating the hop count of the neighboring partition corresponding to the partition identifier.
  • the current node receives the heartbeat message of the neighboring node as described in the third embodiment, and determines whether the neighboring node can reach the neighboring partition according to the heartbeat message. When it is determined that the neighboring partition can be reached, the hop count identifier is extracted from the heartbeat message, and the neighbor node that can lead to the neighbor partition and its corresponding hop count identifier are locally recorded.
  • the path identifier may be recorded in the heartbeat message of the current node, and the hop ID in the heartbeat message of the current node is set to be at the neighbor node.
  • the preset step value is added based on the hop number identifier, and the heartbeat message of the current node is further broadcasted.
  • the preset step value can be set according to actual needs, such as set to 1.
  • the current node when it is determined that the neighboring node is located in the neighboring partition, the current node locally records the hop count identifier corresponding to the neighboring node as an initial value, such as 0, and increases the hop count identifier of the heartbeat message to 1.
  • the step may specifically include: the current node selects, as the target neighbor node, the neighbor node with the smallest hop ID of the neighbor node from the locally recorded neighbor node information.
  • S102 Send a subscription message to be forwarded to the target neighbor node.
  • FIG. 2 is a flowchart of an embodiment of a message processing method for a distributed network according to the present invention.
  • the message processing method may be performed by a common node or a mountaintop node shown in FIG. 1, and includes the following steps:
  • S111 Receive a summary message of a non-local content message sent by the neighboring partition.
  • the local content message in the present specification is a content message stored locally.
  • the local content message is a content message generated by the current partition
  • the current node is a common node, Node
  • the local content message is the content message generated by the current node.
  • the non-local content message described in this specification is a content message that is not stored locally, such as a content message of another partition that has been received by the current hilltop node, or a content message of other nodes that the current ordinary node has received.
  • the summary message is used to indicate the main information included in the corresponding content message, and may specifically include a summary part in the content message.
  • the summary message includes a summary of the content message and a partition identifier of the source partition of the content message. .
  • the current node receives a summary message of the content message generated by node 1 in neighbor partition A and saves it locally.
  • the subscription message is received, the subscription message is matched with the summary of the corresponding content message included in the summary message. If yes, S113 is performed; otherwise, the process may be ended.
  • S113 Send the summary message along a communication path of the subscription message, or send the subscription message along a communication path of the summary message.
  • the current node determines whether the partition on the incoming path of the summary message is included in the neighbor partition of the source partition of the subscription message; if included in the neighbor partition of the source partition of the subscription message, along the subscription message
  • the summary path sends the summary message; otherwise, the subscription message is sent along the communication path of the summary message.
  • the message processing method may further generate a summary message of the local content message after obtaining the local content message, and send the summary message to a neighbor node that can reach the neighboring partition, so that the summary message is sent to the neighbor. Partition. Specifically, the manner in which the summary message is sent to the neighbor node that can reach the neighboring partition can be referred to the second embodiment above.
  • the node after generating the content message, the node sends the summary message of the content message to the neighboring partition, and the node of the neighboring partition further matches the subscription message with the summary message, and directly matches the subscription message when matching. And sending, by the text path, the summary message, so that the subscription message source node obtains the summary message, or sends the subscription message along a communication path of the summary message, so that the content message source node receives the subscription message and then replies to the content message. Therefore, the effective transmission of the subscription message is realized, and the destination message is not required to be sent, thereby improving the efficiency of searching for the content message and reducing the data transmission overhead.
  • FIG. 3 is a partial flowchart of another embodiment of a message processing method of a distributed network.
  • FIG. 3 only shows the foregoing S112.
  • the embodiment further includes the foregoing S111 and S113, where the current node may be The above S131 is executed at any time of the method shown in FIG. S113 is executed after executing S112.
  • This embodiment provides an embodiment of a message processing method of a distributed network, and the message processing method It can be executed by the common node or the top node shown in FIG. 1 to reduce the transmission data overhead and transmission time of the content message, and improve the transmission efficiency, including the following steps:
  • S122 Extract, from the subscription message, a node identifier of each history node on a communication path of the subscription message.
  • the subscription message includes the node identifier of each history node that has forwarded the subscription message, and the current node extracts the node identifier of each history node of the subscription message from the subscription message, and stores it locally.
  • the subscription message is matched with the local content message. If the matching is unsuccessful, the node identifier of the current node is added to the subscription message, and the fourth or sixth embodiment is executed. Corresponding steps when the matching is unsuccessful, to forward the subscription message, or to return the subscription message, etc.; if the matching is successful, determine, according to the node identifier, whether the neighbor node has a history node other than the previous hop of the subscription message Contains other history nodes. The current node may determine a communication path of the subscription message according to the node identifier in the locally stored subscription message.
  • S125 The content message is sent back to the last hop history node to return the content message along the communication path of the matched subscription message.
  • This embodiment provides an embodiment of a message processing method of a distributed network, which may be performed by a common node or a hilltop node shown in FIG. 1 for targeted transmission of a subscription message to a source node of a matched content message.
  • Reduce the transmission data overhead including the following steps:
  • S131 Acquire a summary of the content message sent by the neighbor node and a transmission path of the content message.
  • the summary in the content message is extracted, and the historical transmission path of the content message is obtained and saved locally.
  • S132 When the subscription message needs to be forwarded, determine whether the subscription message matches the summary, If it matches, then S133 is performed; otherwise, the subscription message is forwarded to the neighbor node that can reach the neighbor partition as shown in the second embodiment.
  • the current node performs the foregoing fourth or sixth embodiment.
  • it is determined that the subscription message does not match the local content message it is determined that the subscription message needs to be forwarded, and it is determined whether the subscription message matches the summary.
  • S133 Forward the subscription message along a transmission path of the content message.
  • the transmission path of the content message may be the last hop history node information of the content message.
  • This embodiment provides an embodiment of a message processing method of a distributed network.
  • the message processing method may be executed by a hilltop node or a common node shown in FIG. 1 for storing content messages of other partitions and performing subscription matching, thereby improving network content messages. Find probabilities and efficiencies, including the following steps:
  • S142 Determine whether the subscription message matches the first content message generated by the other partitions. If yes, execute S143, otherwise execute S144.
  • the current node is a hilltop node
  • the current node is locally stored by two types of content messages: the first content message is generated for other partitions, and the second content message is generated for the current partition.
  • the current node determines whether the subscription message matches the local second content message, and if yes, performs the corresponding step of the matching succeeding in the fourth or sixth embodiment, if the matching is unsuccessful, Then, the above S142 is executed.
  • the method further includes: receiving a first content message sent by another partition; determining whether the first content message satisfies a setting condition; if yes, saving the first content message, and S142 is performed upon receiving the subscription message; otherwise the first content message is forwarded.
  • the current node forwarding the first content message may refer to the second embodiment to send the first content message to a neighbor node that can reach the neighbor partition.
  • the setting condition may be configured according to an actual situation, for example, the source partition of the first content message is not a neighbor partition and the local storage space is greater than a set capacity, or is a current partition identifier and the first content message.
  • the carried target partition identifiers are consistent, or the number of times the first content message is forwarded matches the set number of times.
  • S144 Send the subscription message to a neighbor node that can reach the neighbor partition.
  • the backhaul of the first content message in the foregoing S143 may refer to the backhaul step of the content message, for example, refer to S403 in the fourth embodiment, or S601 in the sixth embodiment.
  • the above S144 can refer to the description of the second embodiment.
  • This embodiment provides an embodiment of a message processing method of a distributed network.
  • the message processing method may be performed by a hilltop node or a common node shown in FIG. 1 for obtaining a neighbor node that can lead to a neighboring partition, including the following steps:
  • the current node may only judge the neighbor node, for example, the current node determines the neighbor node in the current partition that has forwarded the subscription message as a neighbor node that can reach the neighbor partition.
  • the current node may perform the relevant step of the fourth or sixth embodiment after receiving the subscription message.
  • This embodiment provides an embodiment of a heartbeat method of a distributed network.
  • the heartbeat method may be performed by a mountain node or a common node as shown in FIG. 1 for performing heartbeat detection by a network part node, including the following steps:
  • S161 The current node determines whether the set heartbeat condition is met. If yes, execute S162, otherwise execute S163.
  • some nodes in the network perform heartbeat, and the other node does not perform heartbeat.
  • the node periodically detects whether a heartbeat needs to be performed.
  • the setting heartbeat condition may be set according to actual requirements, for example, may include predicting that the current network topology changes are greater than a set change value, the current time is a set time, the current channel is in an idle state, and the current location is a set network topology position, At least one of the heartbeat message of the neighbor node, the heartbeat message not sent within the previously set period, and the result of the random operation are not received within the preset time.
  • the method further includes: receiving a neighbor node identifier sent by another node a notification message; determining a node corresponding to the neighbor node identifier in the notification message as a neighbor node.
  • the current node performs the foregoing step S161 every first time interval, and performs the step of transmitting the notification message every second time interval; wherein the first time interval is smaller than the first Two time intervals.
  • the embodiment provides an embodiment of the message processing method of the distributed network.
  • the message processing method can be performed by the hilltop node or the common node shown in FIG. 1 for intelligently controlling the validity of the subscription message, including the following steps:
  • the setting condition may be set according to an actual situation, for example, the current node does not forward the subscription message, the source node of the subscription message is a setting node, and the importance degree value of the subscription message is higher than a set value. At least one.
  • the current node determines whether the number of times the subscription message is forwarded exceeds the number of valid forwardings. If yes, the number of valid forwardings of the subscription message is increased by a set number of times to extend the validity. Or the current node determines whether the total forwarding time of the subscription message exceeds a valid forwarding time. If yes, the effective forwarding time of the subscription message is increased by a set time value to extend the validity.
  • the present invention can also provide an embodiment of the combination of the above-mentioned second to seventeenth embodiments, that is, the method embodiment includes at least two steps described in the above embodiments, and the execution sequence of the step can be referred to the above embodiment. In the description.
  • FIG. 4 is a schematic structural diagram of an embodiment of a distributed network node according to the present invention.
  • the node may be a common node as shown in FIG. 1.
  • the node 40 includes a receiving module 41, a matching module 42, and a transmitting module 43.
  • the receiving module 41 is configured to receive a summary message of a non-local content message sent by the neighboring partition.
  • the matching module 42 is configured to match the subscription message with the summary message.
  • the sending module 43 is configured to: when the subscription message matches the summary message, Transmitting the summary message along a communication path of the subscription message or sending the subscription message along a communication path of the summary message.
  • the summary message includes a summary of the content message and a partition identifier of a source partition of the content message.
  • the matching module 42 is further configured to: receive the subscription message, determine whether to match the subscription message with a local content message, and if the local content message matches, return the matched content message; Otherwise, the step of matching the subscription message with the summary message is performed.
  • the sending module 43 is further configured to: determine whether a partition on the source path of the summary message is included in a neighbor partition of a source partition of the subscription message; if a neighbor included in a source partition of the subscription message In the partition, the summary message is sent along the communication path of the subscription message; otherwise, the subscription message is sent along the communication path of the summary message.
  • the step of the matching module 42 performing the backhauling the matched content message comprises: determining whether a source partition of the subscription message is included in the neighbor partition; if yes, sending the content message directly to the source Partitioning; otherwise, the content message is returned along the incoming path of the subscription message.
  • the node 40 further includes a storage module, configured to extract a partition identifier of the neighbor partition from a broadcast message of the neighbor node, and perform local storage; and the matching module 42 performs the determining whether the neighbor partition includes the subscription message.
  • the step of the source partition includes: matching the partition identifier of the target partition with the locally stored partition identifier; if the matching is successful, determining that the neighbor partition includes the target partition.
  • the node 40 further includes a generating module, configured to generate a summary message of the local content message, select a neighboring node that can pass to the neighboring partition, and provide the neighboring node to the neighboring partition The neighbor node sends the notification message.
  • a generating module configured to generate a summary message of the local content message, select a neighboring node that can pass to the neighboring partition, and provide the neighboring node to the neighboring partition The neighbor node sends the notification message.
  • the generating module is further configured to determine whether the broadcast message of the neighboring node includes a partition identifier of the neighbor partition or a path identifier that can be connected to the neighbor partition; if yes, mark the neighbor node A neighbor node that is capable of accessing the neighbor partition.
  • the modules in the above-mentioned nodes can respectively perform the corresponding steps in the foregoing method embodiments, and therefore, the modules are not described herein. For details, refer to the description of the corresponding steps.
  • the foregoing node 40 can also be used to perform the foregoing method embodiments or a combination thereof. Description of method embodiments.
  • FIG. 5 is a schematic structural diagram of another embodiment of a distributed network node according to the present invention.
  • the node is a hilltop node or a common node as shown in FIG. 1, and the node can perform the steps in the above method.
  • the node can perform the steps in the above method.
  • the node 50 includes a transmitter 51, a receiver 52, one or more processors 53, a memory 54, and a bus 55.
  • Transmitter 51 is used to send messages, such as subscription messages or content messages, to other nodes in the distributed network.
  • the receiver 52 is configured to receive messages sent by other nodes in the distributed network, such as subscription messages or content messages.
  • the memory 54 includes a read only memory and a random access memory. A portion of memory 54 may also include non-volatile random access memory (NVRAM).
  • the processor 53 may also be referred to as a CPU (Central Processing Unit).
  • the bus 55 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus.
  • various buses are labeled as bus 55 in the figure.
  • node 50 further includes a plurality of applications and one or more programs, said plurality of applications and one or more programs being stored in memory 54 and configured to be executed by said processor 53.
  • the one or more programs include instructions.
  • the processor 53 performs the following operations by calling an instruction in the one or more programs stored in the memory 54: acquiring a summary message of the non-local content message sent by the neighbor partition received by the receiver 52; The summary message is matched; if it matches the summary message, the summary message is sent along the communication path of the subscription message by the sender 51, or sent along the communication path of the summary message by the sender 51.
  • the subscription message is performed by calling an instruction in the one or more programs stored in the memory 54: acquiring a summary message of the non-local content message sent by the neighbor partition received by the receiver 52; The summary message is matched; if it matches the summary message, the summary message is sent along the communication path of the subscription message by the sender 51, or sent along the communication path of the summary message by the sender 51.
  • the subscription message
  • the foregoing processor 53 is specifically configured to perform the foregoing method embodiments or a combination thereof. For details, refer to the description of the foregoing method embodiments.

Abstract

Disclosed are a distributed network message processing method and node. The method comprises: receiving a summary message of a non-local content message sent by a neighbouring area; matching a subscription message with the summary message; if matched, sending the summary message along a path of the subscription message, or sending the subscription message along a path of the summary message. The present invention reduces data transmission overheads.

Description

分布式网络的消息处理方法及节点Message processing method and node of distributed network 【技术领域】[Technical Field]
本发明涉及通信技术领域,特别是涉及分布式网络的消息处理方法及节点。The present invention relates to the field of communications technologies, and in particular, to a message processing method and a node for a distributed network.
【背景技术】【Background technique】
移动Ad Hoc网络为目前常见的分布式网络,其较多采用分区式结构,该网络被划分为多个山状分区(英文:hill),每个分区中包括山顶(英文:hilltop)节点和普通节点。在该网络中,节点在生成内容消息后,将内容消息保存在本地以及本分区的山顶节点。其他分区的节点在需要该内容消息时,生成对应的订阅消息,并发送给其他分区节点以请求获得该内容消息。且必须将该订阅消息发送到该内容消息的源节点或源分区的山顶节点,才能获得该内容消息。The mobile Ad Hoc network is a common distributed network. It uses a partitioned structure. The network is divided into multiple mountain sections (English: hill). Each partition includes a hilltop (English: hilltop) node and common node. In the network, after the node generates the content message, the node saves the content message locally and the top node of the partition. When the other partitioned node needs the content message, it generates a corresponding subscription message and sends it to other partition nodes to request the content message. The subscription message must be sent to the source node of the content message or the hilltop node of the source partition to obtain the content message.
然而,节点在发布订阅消息查找过程中并不清楚内容消息的所在节点,只能无目标向不同节点发布订阅消息,故可能会将订阅消息传输至较多节点却仍未能到达源节点或源分区的山顶节点,进而未能获得该内容消息,导致传输数据开销较大。However, the node does not know the node where the content message is located in the process of publishing the subscription message. It can only publish the subscription message to different nodes without the target. Therefore, the subscription message may be transmitted to more nodes but still fails to reach the source node or source. The top node of the partition, and thus the content message is not obtained, resulting in a large transmission data overhead.
【发明内容】[Summary of the Invention]
本发明主要解决的技术问题是提供分布式网络的消息处理方法及节点,能够减少数据传输开销。The technical problem to be solved by the present invention is to provide a message processing method and a node of a distributed network, which can reduce data transmission overhead.
为解决上述技术问题,本发明采用的一个技术方案是:提供一种分布式网络的消息处理方法,所述方法包括:接收邻居分区所发送的非本地的内容消息的概要消息;将订阅消息与所述概要消息进行匹配;若与所述概要消息匹配,则沿所述订阅消息的来文路径发送所述概要消息,或者沿所述概要消息的来文路径发送所述订阅消息。To solve the above technical problem, a technical solution adopted by the present invention is to provide a message processing method for a distributed network, the method comprising: receiving a summary message of a non-local content message sent by a neighboring partition; and subscribing the message with And the summary message is matched; if the summary message matches, the summary message is sent along a communication path of the subscription message, or the subscription message is sent along a communication path of the summary message.
其中,概要消息包括内容消息的概要以及内容消息的源分区的分区标识。 The summary message includes a summary of the content message and a partition identifier of the source partition of the content message.
其中,所述将订阅消息与所述概要消息进行匹配的步骤之前,还包括:接收所述订阅消息;判断是否将所述订阅消息与本地的内容消息进行匹配;若与本地的内容消息匹配,则回传所述匹配的内容消息;否则,则执行所述将订阅消息与所述概要消息进行匹配的步骤。Before the step of matching the subscription message with the summary message, the method further includes: receiving the subscription message; determining whether to match the subscription message with a local content message; if matching with the local content message, Then, the matched content message is returned; otherwise, the step of matching the subscription message with the summary message is performed.
其中,若与所述概要消息匹配,则沿所述订阅消息的来文路径发送所述概要消息,或者沿所述概要消息的来文路径发送所述订阅消息的步骤进一步包括:判断所述概要消息的来文路径上的分区是否包含在所述订阅消息的源分区的邻居分区中;若包含在所述订阅消息的源分区的邻居分区中,则沿所述订阅消息的来文路径发送所述概要消息;否则,则沿所述概要消息的来文路径发送所述订阅消息。The step of transmitting the summary message along a communication path of the subscription message or the sending the subscription message along a communication path of the summary message further includes: determining the summary if the summary message is matched Whether the partition on the incoming path of the message is included in the neighbor partition of the source partition of the subscribed message; if included in the neighbor partition of the source partition of the subscribed message, the sending path along the incoming message of the subscribed message The summary message is sent; otherwise, the subscription message is sent along the communication path of the summary message.
其中,所述回传所述匹配的内容消息的步骤包括:判断邻居分区中是否包含所述订阅消息的源分区;若是,则将所述内容消息直接发送至所述源分区;否则,沿所述订阅消息的来文路径回传所述内容消息。The step of returning the matched content message includes: determining whether the source partition of the subscription message is included in the neighbor partition; if yes, sending the content message directly to the source partition; otherwise, The incoming message of the subscription message returns the content message.
其中,所述判断邻居分区中是否包含所述订阅消息的源分区的步骤之前进一步包括:从邻居节点的广播消息中提取所述邻居分区的分区标识,并进行本地存储;所述判断邻居分区中是否包含所述订阅消息的源分区的步骤包括:将所述目标分区的分区标识与本地存储的分区标识进行匹配;若匹配成功,则判断邻居分区中包含目标分区。The step of determining whether the source partition of the subscription message is included in the neighbor partition further includes: extracting a partition identifier of the neighbor partition from a broadcast message of the neighbor node, and performing local storage; and determining the neighbor partition The step of including the source partition of the subscription message includes: matching the partition identifier of the target partition with the locally stored partition identifier; if the matching is successful, determining that the target partition is included in the neighbor partition.
其中,进一步包括:生成本地内容消息的概要消息;从所述邻居节点中选择能够通向所述邻居分区的邻居节点,并向所述能够通向所述邻居分区的邻居节点发送所述通知消息。The method further includes: generating a summary message of the local content message; selecting a neighboring node that can reach the neighboring partition from the neighboring node, and sending the notification message to the neighboring node that can reach the neighboring partition .
其中,在所述从所述邻居节点中选择能够通向所述邻居分区的邻居节点的步骤之前,还包括:判断所述邻居节点的广播消息中是否包含所述邻居分区的分区标识或者能够通向所述邻居分区的有路标识;若包含,则将所述邻居节点标记为能够通向所述邻居分区的邻居节点。Before the step of selecting the neighboring node that can be connected to the neighboring partition, the method further includes: determining whether the broadcast message of the neighboring node includes the partition identifier of the neighboring partition or is capable of A path identifier that partitions the neighbor; if so, the neighbor node is marked as a neighbor node that is capable of accessing the neighbor partition.
为解决上述技术问题,本发明采用的另一技术方案是,提供一种分布式网络节点,包括:接收模块,用于接收邻居分区所发送的非本地的内容消息的概要消息;匹配模块,用于将订阅消息与所述概要消息进行匹配;发送模块,用于在所述订阅消息与所述概要消息匹配时,沿订阅消息的来文路径发送所述概要消息,或者沿概要消息的来文路径发送订阅消息。 In order to solve the above technical problem, another technical solution adopted by the present invention is to provide a distributed network node, including: a receiving module, configured to receive a summary message of a non-local content message sent by a neighboring partition; a matching module, The matching message is matched with the summary message; the sending module is configured to send the summary message along a communication path of the subscription message when the subscription message matches the summary message, or the communication along the summary message The path sends a subscription message.
为解决上述技术问题,本发明采用的再一技术方案是,提供一种分布式网络节点,包括发送器、接收器、处理器和存储器,所述处理器通过执行所述存储器存储的指令,用于:获取所述接收器接收的邻居分区所发送的非本地的内容消息的概要消息;将订阅消息与所述概要消息进行匹配;若与所述概要消息匹配,则通过发送器沿所述订阅消息的来文路径发送所述概要消息,或者通过发送器沿概要消息的来文路径发送所述订阅消息。In order to solve the above technical problem, another technical solution adopted by the present invention is to provide a distributed network node, including a transmitter, a receiver, a processor, and a memory, and the processor uses the instruction stored in the memory to use Obtaining: a summary message of the non-local content message sent by the neighbor partition received by the receiver; matching the subscription message with the summary message; if matching with the summary message, following the subscription by the sender The message path of the message is sent by the profile message, or the message is sent by the sender along the message path of the profile message.
以上方案,节点在生成内容消息后将该内容消息的概要消息发送至邻居分区,邻居分区的节点进而将订阅消息与该概要消息进行匹配,在匹配时可直接沿所述订阅消息的来文路径发送所述概要消息,或者沿所述概要消息的来文路径发送所述订阅消息,实现了订阅消息的有效传输,而无需无目标发送订阅消息,进而提高了内容消息的查找效率,减少数据传输开销。In the above solution, after generating the content message, the node sends the summary message of the content message to the neighboring partition, and the node of the neighboring partition further matches the subscription message with the summary message, and directly follows the communication path of the subscription message when matching Sending the summary message, or sending the subscription message along a communication path of the summary message, implementing effective transmission of the subscription message without sending a subscription message without a target, thereby improving the efficiency of searching for the content message and reducing data transmission Overhead.
【附图说明】[Description of the Drawings]
图1是本发明分布式网络系统一实施例的结构示意图;1 is a schematic structural diagram of an embodiment of a distributed network system according to the present invention;
图2是本发明分布式网络的消息处理方法一实施例的流程图;2 is a flowchart of an embodiment of a message processing method of a distributed network according to the present invention;
图3是本发明分布式网络消息处理方法另一实施例的部分流程图;3 is a partial flow chart of another embodiment of a distributed network message processing method according to the present invention;
图4是本发明分布式网络节点一实施例的结构示意图;4 is a schematic structural diagram of an embodiment of a distributed network node according to the present invention;
图5是本发明分布式网络节点另一实施例的结构示意图。FIG. 5 is a schematic structural diagram of another embodiment of a distributed network node according to the present invention.
【具体实施方式】【detailed description】
下面结合附图和实施方式对本发明进行详细说明。The invention will now be described in detail in conjunction with the drawings and embodiments.
第一实施例:First embodiment:
请参阅图1,图1是本发明分布式网络系统一实施例的结构示意图。本实施例中,分布式网络系统100包括多个节点111。以实际的网络物理拓扑为基础,该多个节点111虚拟拓扑成至少一山状分区(下述中也简称为分区)110,所述山状分区110内的节点111进一步划分为至少一山顶节点111a和普通节点111b。Please refer to FIG. 1. FIG. 1 is a schematic structural diagram of an embodiment of a distributed network system according to the present invention. In this embodiment, the distributed network system 100 includes a plurality of nodes 111. Based on the actual network physical topology, the plurality of nodes 111 are virtualized into at least one mountainous partition (hereinafter also referred to as partition) 110, and the node 111 in the mountainous partition 110 is further divided into at least one mountain node. 111a and the normal node 111b.
其中,山顶节点111a作为该分区110消息的汇集点,用于管理该分区 的节点消息以及处理其他分区的节点消息;普通节点111b用于利用贪婪策略等方式转发消息至本分区110内的山顶节点111a。本实施例中,山顶节点111a为该分区110中连通度最高的节点,普通节点111b则为连通度低于所述山顶节点111的节点。当然,在其他实施例中,该山顶节点111a也可为连通度高于设定值的节点。即,分区可能包含多个山顶节点。Wherein, the mountain node 111a serves as a collection point of the partition 110 message for managing the partition. The node message and the node message processing the other partitions; the normal node 111b is used to forward the message to the hilltop node 111a in the partition 110 by means of a greedy policy or the like. In this embodiment, the hilltop node 111a is the node with the highest connectivity among the partitions 110, and the common node 111b is the node whose connectivity is lower than the hilltop node 111. Of course, in other embodiments, the hilltop node 111a may also be a node whose connectivity is higher than a set value. That is, the partition may contain multiple hilltop nodes.
系统100为一发布/订阅系统,其节点可向网络发出订阅消息,并从其他节点处得到对应的内容消息。其中,该订阅消息用于请求获得回应,内容消息用于进行上述回应。在一具体应用中,该内容消息为包含业务数据的消息,相当于数据分组;订阅消息为请求获得内容消息的控制消息,相当于控制分组中的一种请求分组,可包含源节点地址、消息标识、内容消息摘要等字段。 System 100 is a publish/subscribe system whose nodes can issue subscription messages to the network and obtain corresponding content messages from other nodes. The subscription message is used to request a response, and the content message is used to perform the above response. In a specific application, the content message is a message containing service data, which is equivalent to a data packet; the subscription message is a control message requesting to obtain a content message, which is equivalent to a request packet in the control packet, and may include a source node address and a message. Fields such as identification, content message summary, and more.
在一实施例中,该系统100在逻辑上包含前后顺序的三个阶段:In an embodiment, the system 100 logically includes three phases in a sequence:
1)分区形成阶段1) Partition formation stage
网络开始运行后,每个节点111在1跳范围内周期性广播心跳(heartbeat)消息,并且接收周围节点的心跳消息。或者,网络中的节点111也可如下述第十六实施例所述进行心跳和接收心跳消息。该心跳消息为一种至少携带节点标识及节点所在分区的标识的控制消息,例如,该心跳消息携带有节点ID、邻居数、节点高度值、节点所在分区的ID等。此项收发操作在整个网络运行期间持续执行。节点111等待一段预设时间T(T的缺省值可以设为60s或其它值)后,根据下面的公式计算出自己的节点高度值参数:After the network starts running, each node 111 periodically broadcasts a heartbeat message within a 1-hop range and receives heartbeat messages from surrounding nodes. Alternatively, node 111 in the network may also perform heartbeat and receive heartbeat messages as described in the sixteenth embodiment below. The heartbeat message is a control message that carries at least a node identifier and an identifier of a partition where the node is located. For example, the heartbeat message carries a node ID, a number of neighbors, a node height value, an ID of a partition where the node is located, and the like. This transceiving operation continues to be performed throughout the network. After waiting for a preset time T (the default value of T can be set to 60s or other values), the node 111 calculates its own node height value parameter according to the following formula:
Figure PCTCN2016085582-appb-000001
Figure PCTCN2016085582-appb-000001
上式中,Hp表示节点p的高度值,N(l,p)表示节点p的l跳邻居节点集合(包括p自身),|N(l,q)|表示节点q的l跳邻居节点数(包括q自身)。In the above formula, H p represents the height value of the node p, N(l, p) represents the set of 1-hop neighbor nodes of the node p (including p itself), and |N(l, q)| represents the 1-hop neighbor node of the node q. Number (including q itself).
节点按以下方式确定自己是否是山顶节点:如果自身高度值高于所有邻居节点的高度值,则确定自身为山顶节点,否则不是;普通节点则将高度值最大的邻居节点视为山顶节点或通往山顶节点的下一跳。这样,在网络中便会形成相互毗邻的若干个单跳或多跳的山状分区,而且,每个分区的山顶节点都能确定。 The node determines whether it is a mountain node in the following way: if its own height value is higher than the height value of all neighbor nodes, it determines that it is a mountain node, otherwise it is not; the ordinary node regards the neighbor node with the highest height value as a mountain node or The next hop to the top node. In this way, several single-hop or multi-hop mountainous regions adjacent to each other are formed in the network, and the top nodes of each partition can be determined.
可以理解的是,当该自组织网路的物理拓扑发生变化时,其分区也将发生变化,分区中的山顶节点也可能发生变化。It can be understood that when the physical topology of the ad hoc network changes, its partition will also change, and the summit nodes in the partition may also change.
2)内容消息的本地处理2) Local processing of content messages
普通节点111b若产生内容消息,则将该内容消息发往本地山顶节点111a(所在分区内的山顶节点)。本地山顶节点111a收到该内容消息后,将其存储,并与之前缓存的订阅消息进行匹配。如果匹配成功,则将该内容消息沿着订阅消息的来文路径发往订阅消息的源节点;如果匹配不成功,则不作处理。山顶节点111a自身产生的内容消息也做上述的存储和匹配处理。If the normal node 111b generates a content message, it sends the content message to the local hilltop node 111a (the mountaintop node in the partition). After receiving the content message, the local hilltop node 111a stores it and matches the previously cached subscription message. If the matching is successful, the content message is sent along the communication path of the subscription message to the source node of the subscription message; if the matching is unsuccessful, no processing is performed. The content message generated by the hilltop node 111a itself also performs the above-described storage and matching processing.
3)内容消息获取3) Content message acquisition
节点111若需要内容消息,则生成相应订阅消息,并发往本地山顶节点111a;本地山顶节点111a收到订阅消息后,先与存储的内容消息进行匹配。如果匹配成功,则将匹配的内容消息沿着该订阅消息的来文路径发往订阅消息的源节点;如果匹配不成功,则存储该订阅消息,并选择一条不同于订阅消息的来文路径,通过该选择的路径将该订阅消息转发出去。If the content message is required, the node 111 generates a corresponding subscription message and sends it to the local hilltop node 111a. After receiving the subscription message, the local hilltop node 111a first matches the stored content message. If the matching is successful, the matching content message is sent to the source node of the subscription message along the communication path of the subscription message; if the matching is unsuccessful, the subscription message is stored, and a communication path different from the subscription message is selected. The subscription message is forwarded through the selected path.
普通节点111b若接收其他分区发送过来的订阅消息,则将该订阅消息转发至本地山顶节点。若接收到本地山顶节点发送过来的订阅消息,则将该订阅消息继续转发至邻居分区。若无法继续转发订阅消息(如该节点已是所在分区的边缘节点且没有通往其它分区的路由),或者无需继续转发该订阅消息(如位于相邻分区的相邻节点均已转发过该订阅消息),则将该订阅消息沿来文路径回传给本地山顶节点111a;如果一个末梢分区(即只有一个邻居分区的分区)的山顶节点在本分区中未找到订阅消息所请求的内容消息,则将该订阅消息沿来文路径回传给邻居分区的山顶节点111a。网络中的山顶节点111a和普通节点111b都按上述方式进行操作,直至找到匹配的内容消息、订阅消息被山顶节点传送的次数达到阈值而不再被转发、或订阅消息被回传。If the normal node 111b receives the subscription message sent by other partitions, the normal node 111b forwards the subscription message to the local mountain node. If the subscription message sent by the local hilltop node is received, the subscription message is forwarded to the neighbor partition. If the subscription message cannot be forwarded (for example, the node is already an edge node of the partition and there is no route to other partitions), or the subscription message does not need to be forwarded (for example, the neighbors located in the adjacent partition have forwarded the subscription) Message), the subscription message is transmitted back to the local hilltop node 111a along the incoming path; if a hilltop node of a stub partition (ie, a partition with only one neighbor partition) does not find the content message requested by the subscription message in the partition, The subscription message is then transmitted back along the incoming path to the hilltop node 111a of the neighboring partition. Both the hilltop node 111a and the normal node 111b in the network operate in the above manner until a matching content message is found, the number of times the subscription message is transmitted by the hilltop node reaches a threshold and is no longer forwarded, or the subscription message is returned.
本实施例中,该系统中的每个节点的物理性质相同,且均具有路由功能。而且,每个节点既可作内容消息的发布者,也可作内容消息的订阅者。In this embodiment, each node in the system has the same physical property and has a routing function. Moreover, each node can act as both a publisher of content messages and a subscriber to content messages.
可以理解的是,图1仅示范性示出本发明分布式网络的拓扑结构,但不作为本发明分布式网络结构的限定,在其他实施例中,该分布式网络可 包括更多分区,每个分区可存在共同节点,每个分区中的山顶节点数数量可为多个。It can be understood that FIG. 1 only exemplarily shows the topology of the distributed network of the present invention, but is not limited to the distributed network structure of the present invention. In other embodiments, the distributed network may be Including more partitions, each partition can have a common node, and the number of mountain nodes in each partition can be multiple.
该分布式网络系统可为分布式有线网络系统,或者分布式无线网络系统。在一具体应用中,该分布式无线网络系统具体可但不限为移动Ad Hoc网络系统,该节点可以为可实现通信的任意移动终端,如手机、电脑等。The distributed network system can be a distributed wired network system or a distributed wireless network system. In a specific application, the distributed wireless network system may specifically but not limited to a mobile Ad Hoc network system, and the node may be any mobile terminal that can implement communication, such as a mobile phone, a computer, or the like.
该系统中的山顶节点111a和普通节点111b可执行以下至少一个实施例中的方法,或对应为以下实施例中的节点,具体请参阅以下实施例描述。The hilltop node 111a and the common node 111b in the system may perform the method in at least one of the following embodiments, or correspond to the nodes in the following embodiments. For details, refer to the following description of the embodiments.
在此,先对下面实施例出现的词语进行定义:邻居节点为位于当前节点传输范围内的节点,本实施例可理解为一跳可到达的节点。邻居分区为包括其邻居节点的其他分区。Here, the words appearing in the following embodiments are defined: the neighbor node is a node located in the transmission range of the current node, and the embodiment can be understood as a node reachable by one hop. A neighbor partition is another partition that includes its neighbor nodes.
第二实施例:Second embodiment:
本实施例提供分布式网络的路由方法的实施例。该路由方法可由图1所示的山顶节点或普通节点执行,具体包括以下步骤:This embodiment provides an embodiment of a routing method of a distributed network. The routing method may be performed by the hilltop node or the common node shown in FIG. 1, and specifically includes the following steps:
S201:从当前节点相邻的邻居节点中选择可通向邻居分区的邻居节点。S201: Select a neighbor node that can lead to the neighbor partition from neighbor nodes adjacent to the current node.
例如,当前节点预存有可通向邻居分区的邻居节点列表,该列表中包括邻居节点标识和可通往的邻居分区标识。当前节点确定需要将该订阅消息转发至邻居分区时,从该预存邻居节点列表中选择一未接收到过订阅消息(即该邻居节点不同于该订阅消息的来文路径上的节点)或可通往未接收过该订阅消息的邻居分区的邻居节点。若存在满足上述条件的邻居节点,则可采用随机算法选择其中一个。若该邻居节点均已接收过该订阅消息,则可认为该订阅消息不必要继续转发,并按照来文路径回传该订阅消息。For example, the current node pre-stores a list of neighbor nodes that can lead to the neighbor partition, and the list includes the neighbor node identifier and the neighbor partition identifier that can be accessed. When the current node determines that the subscription message needs to be forwarded to the neighboring partition, select a non-subscribed message from the list of pre-stored neighbor nodes (ie, the node on the incoming path different from the subscribed message) or passable A neighbor node to a neighbor partition that has not received the subscription message. If there are neighbor nodes that satisfy the above conditions, a random algorithm may be used to select one of them. If the neighboring node has received the subscription message, it may be considered that the subscription message does not need to be forwarded, and the subscription message is returned according to the incoming path.
当前节点可在S201之前执行下述第三或十五实施例的步骤,以获得可通往邻居分区的邻居节点。The current node may perform the steps of the third or fifteenth embodiment described below prior to S201 to obtain neighbor nodes that may be directed to the neighbor partition.
S202:将待转发的订阅消息发送至所述可通向邻居分区的邻居节点。S202: Send a subscription message to be forwarded to the neighbor node that can lead to the neighbor partition.
在该分布式网络中,每个节点在需转发订阅消息时,均可执行上述方法进行。例如,该邻居节点接收到该订阅消息后,同样执行上述S201、S202的操作将订阅消息转发至其下一跳邻居节点,以实现将该订阅消息发送至其邻居分区。In the distributed network, each node can perform the above method when forwarding a subscription message. For example, after receiving the subscription message, the neighboring node performs the operations of S201 and S202 to forward the subscription message to its next hop neighbor node to implement sending the subscription message to its neighboring partition.
本实施例中节点直接选择可通往邻居分区的邻居节点转发订阅消息,避免了订阅消息转发至不可通往邻居分区的节点,进而原路返回本地山顶 节点重新路由直至正确转发至可通往邻居分区的节点的情况,故避免了订阅消息的不必要的来回传输而产生转发冗余,减少了订阅开销、传输数据开销和寻找内容消息的耗时,提高了数据传输效率。In this embodiment, the node directly selects a neighboring node that can reach the neighboring partition to forward the subscription message, thereby avoiding forwarding the subscription message to the node that cannot reach the neighboring partition, and then returning to the local peak. The node reroutes until it is correctly forwarded to the node that can reach the neighbor partition, thus avoiding unnecessary round-trip transmission of the subscription message and generating forwarding redundancy, reducing the subscription overhead, transmitting data overhead, and time consuming to find content messages. Improve data transfer efficiency.
第三实施例:Third embodiment:
本实施例提供分布式网络的邻居处理方法的实施例。该邻居处理方法可由图1所示的山顶节点或普通节点执行。该方法用于获得可通往邻居分区的邻居节点,具体包括:This embodiment provides an embodiment of a neighbor processing method of a distributed network. The neighbor processing method can be performed by the hilltop node or the normal node shown in FIG. 1. The method is used to obtain a neighbor node that can lead to a neighbor partition, and specifically includes:
S301:判断邻居节点是否可通向邻居分区。若该邻居节点可通往邻居分区,则执行S302,否则,不作处理。其中,该可通往邻居分区的邻居节点可包括位于当前分区的邻居节点,或者为位于该邻居分区的邻居节点。S301: Determine whether the neighbor node can lead to the neighbor partition. If the neighbor node can reach the neighbor partition, execute S302; otherwise, no processing is performed. The neighbor node that can lead to the neighbor partition may include a neighbor node located in the current partition or a neighbor node located in the neighbor partition.
在一采用基于消息侦听的邻居分区通路感知机制的应用中,网络每个节点在分区形成后周期性广播第一心跳消息,普通节点接收到邻居节点的第一心跳消息,并判断第一心跳消息中携带的分区标识为其他分区的标识(即邻居分区标识),则记录该邻居节点可通往携带的标识对应的邻居分区,并广播包含可通向该邻居分区的有路标识的第二心跳消息,其中,该第二心跳消息与第一心跳消息不同点在于其包含该有路标识。普通节点若接收到该第二心跳消息,则同样记录该邻居节点可通往携带的标识对应的邻居分区,并广播包含可通向该邻居分区的有路标识的第二心跳消息。由此,本地普通节点将通往不同邻居分区的第二心跳消息均发送至本地山顶节点,山顶节点接收到邻居节点的第二心跳消息,则记录该邻居节点可通往携带的标识对应的邻居分区。通过该有路广播机制,网络中的节点可持续地根据接收到的心跳消息感知有无通往邻居分区的邻居节点以及邻居分区的数量。In an application of a neighboring path sensing mechanism based on message sensing, each node of the network periodically broadcasts a first heartbeat message after the partition is formed, and the ordinary node receives the first heartbeat message of the neighbor node and determines the first heartbeat. If the identifier of the partition carried in the message is the identifier of the other partition (that is, the neighbor partition identifier), the neighbor node may record the neighbor partition corresponding to the carried identifier, and broadcast a second path with the path identifier that can lead to the neighbor partition. A heartbeat message, wherein the second heartbeat message is different from the first heartbeat message in that it includes the way leg identifier. If the normal node receives the second heartbeat message, it also records that the neighbor node can reach the neighbor partition corresponding to the carried identifier, and broadcasts a second heartbeat message including the way identifier that can lead to the neighbor partition. Therefore, the local common node sends the second heartbeat message to the different neighboring partitions to the local mountaintop node, and the mountaintop node receives the second heartbeat message of the neighboring node, and records that the neighboring node can reach the neighbor corresponding to the carried identifier. Partition. Through the routing mechanism, nodes in the network can continuously perceive the presence or absence of neighbor nodes and neighbor partitions to the neighbor partition according to the received heartbeat message.
故,该S301步骤具体可为:节点接收各所述邻居节点的心跳消息;判断所述邻居节点的心跳消息(也称:广播消息)中是否包含所述邻居分区的分区标识(为第一心跳消息)或者可通向所述邻居分区的有路标识(为第二心跳消息)。若所述邻居节点的心跳消息中包含所述分区标识或所述有路标识,则表示所述邻居节点可通向邻居分区,并根据该心跳消息中携带的邻居分区的分区标识确定其可通往的邻居分区;进一步地,当前节点若为普通节点,则还在当前节点的心跳消息中标记所述有路标识,并进一步 广播所述当前节点的心跳消息。Therefore, the S301 step may be specifically: the node receives the heartbeat message of each of the neighboring nodes; and determines whether the heartbeat message (also referred to as a broadcast message) of the neighboring node includes the partition identifier of the neighboring partition (for the first heartbeat) Message) or a way path to the neighbor partition (which is a second heartbeat message). If the heartbeat message of the neighboring node includes the partition identifier or the directional identifier, the neighboring node may be connected to the neighboring partition, and determine, according to the partition identifier of the neighboring partition carried in the heartbeat message, To the neighbor partition; further, if the current node is a normal node, the path identifier is also marked in the heartbeat message of the current node, and further Broadcasting a heartbeat message of the current node.
其中,上述有路标识可以由该消息的属性或者内容体现,例如,该有路标识为消息类型字段,即第二心跳消息与第一心跳消息的消息类型字段的值不同,当然该有路标识还可由与第一心跳消息不同的消息长度、消息格式等其他属性体现,或者该有路标识为消息扩展字段以用于携带邻居分区的分区标识。The path identifier may be represented by the attribute or the content of the message. For example, the path identifier is a message type field, that is, the value of the second heartbeat message is different from the value of the message type field of the first heartbeat message. It may also be represented by a different message length, a message format, or the like than the first heartbeat message, or the way identifier is a message extension field for carrying the partition identifier of the neighbor partition.
S302:将所述邻居节点标记为可通向所述邻居分区。S302: Mark the neighbor node as being accessible to the neighbor partition.
例如,当前节点在判断该邻居节点可通向邻居分区时,在本地的邻居节点信息中记录该邻居节点可通往的邻居分区的分区标识。For example, when the current node determines that the neighbor node can lead to the neighbor partition, the local neighbor node information records the partition identifier of the neighbor partition that the neighbor node can reach.
通过上述基于消息侦听的邻居分区通路感知机制,可实现分布式网络中节点对可通往邻居分区的邻居节点的确定,进而实现节点可直接有目标地通过该可通往邻居分区的邻居节点转发订阅消息至邻居分区。Through the above-mentioned neighboring path sensing mechanism based on message sensing, the node in the distributed network can determine the neighbor nodes that can reach the neighboring partition, so that the node can directly pass the neighboring node that can lead to the neighboring partition. Forward the subscription message to the neighbor partition.
第四实施例:Fourth embodiment:
本实施例提供一分布式网络路由方法的实施例。该路由方法可由图1所示的山顶节点执行,该方法可在上述S201之前执行,以当本实施例中的当前节点接收到订阅消息并判断自身并无与该订阅消息匹配的内容消息时,再执行该S201的步骤。该方法包括:This embodiment provides an embodiment of a distributed network routing method. The routing method may be performed by the hilltop node shown in FIG. 1, and the method may be performed before the foregoing S201, so that when the current node in the embodiment receives the subscription message and determines that there is no content message that matches the subscription message, The step of S201 is performed again. The method includes:
S401:接收订阅消息。S401: Receive a subscription message.
S402:将所述订阅消息与当前分区的普通节点汇聚到所述山顶节点的内容消息进行匹配;若匹配成功,则执行S403;若匹配不成功,则执行S404,或者执行S201,又或者执行下述第八实施例所述方法步骤,又或执行下述第十实施例所述方法步骤,又或执行第十一实施例所述的S112-S113步骤(如图3所示),又或执行第十三实施例所述的S132-S133步骤,又或执行第十七实施例所述的S172步骤。S402: Match the subscription message to the content message of the common node of the current partition to the top node; if the matching is successful, execute S403; if the matching is unsuccessful, execute S404, or execute S201, or execute The method steps described in the eighth embodiment, or the method steps described in the following tenth embodiment are performed, or the steps S112-S113 (shown in FIG. 3) described in the eleventh embodiment are performed, or executed. The steps S132-S133 described in the thirteenth embodiment, or the step S172 described in the seventeenth embodiment.
S403:回传与所订阅消息述匹配的内容消息。S403: Return a content message that matches the subscribed message description.
具体,当前节点在订阅消息与本地内容消息匹配成功时,可沿所述订阅消息的来文路径回传与所述订阅消息匹配的内容消息,或者执行下述第九实施例所述方法步骤。Specifically, when the subscription message is successfully matched with the local content message, the current node may return a content message that matches the subscription message along the communication path of the subscription message, or perform the method steps described in the ninth embodiment.
S404:将该订阅消息精简回传。S404: The subscription message is streamlined and returned.
在一实施例中,当前分区的普通节点在生成内容消息后,将该内容消 息发与本地山顶节点进行保存。该山顶节点在接收到订阅消息后,根据该订阅消息中的内容消息概要与保存的内容消息进行匹配。若匹配成功,则将匹配的内容消息沿该订阅消息的来文路径进行回传,此后,该订阅消息失效,网络将不再转发该订阅消息。若匹配不成功,则确定当前分区不存在与该订阅消息匹配的内容,并根据下述两种情况进行处理:In an embodiment, the normal node of the current partition cancels the content after generating the content message. The information is saved with the local mountain node. After receiving the subscription message, the hilltop node matches the saved content message according to the content message summary in the subscription message. If the matching is successful, the matching content message is sent back along the communication path of the subscription message. After that, the subscription message is invalid, and the network will not forward the subscription message. If the match is unsuccessful, it is determined that there is no content matching the subscription message in the current partition, and is processed according to the following two situations:
a)若不满足回传条件,即若该当前分区不是末梢分区(可根据其邻居分区的数量为一个确定为末梢分区)且存在邻居分区未转发过该订阅消息(如存在邻居分区的所有节点均未转发过该订阅消息),则可直接执行上述S201、S202对该订阅消息进行转发,或者执行下述第八实施例所述方法步骤,或者执行下述第十实施例所述方法步骤,又或执行第十一实施例所述的S112-S113步骤,又或执行第十三实施例所述的S132-S133步骤,又或执行第十七实施例所述的S172步骤;a) If the backhaul condition is not met, that is, if the current partition is not a stub partition (it may be determined as a stub partition according to the number of neighbor partitions thereof) and the neighbor partition does not forward the subscription message (if all nodes of the neighbor partition exist) If the subscription message is not forwarded, the method may be performed by directly performing the foregoing S201 and S202, or performing the method steps described in the following eighth embodiment, or performing the following method steps in the tenth embodiment. Or performing the steps S112-S113 described in the eleventh embodiment, or performing the steps S132-S133 described in the thirteenth embodiment, or performing the step S172 described in the seventeenth embodiment;
b)若满足回传条件,即若当前分区为末梢分区或其邻居分区均已转发过该订阅消息(如每个邻居分区的至少一个节点转发过该订阅消息),则执行上述S404进行订阅消息精简回传,其中上述S404具体可如下第五实施例所述进行消息精简回传。b) If the return condition is satisfied, that is, if the current partition is the last partition or its neighbor partition has forwarded the subscription message (if at least one node of each neighbor partition forwards the subscription message), then the above S404 is performed to subscribe to the message. The reduced backhaul, wherein the above S404 can specifically perform message reduction backhaul as described in the fifth embodiment.
第五实施例:Fifth embodiment:
本实施例提供分布式网络的消息回传方法的实施例,该消息回传方法可由图1所示的山顶节点或普通节点执行,具体包括:This embodiment provides an embodiment of a message backhauling method of a distributed network. The message backhauling method may be performed by a hilltop node or a common node as shown in FIG.
S501:将订阅消息精简成回传消息。S501: Reduce the subscription message into a backhaul message.
其中,该回传消息可用于识别该订阅消息。具体地,该步骤可包括:从所述订阅消息提取所述订阅消息标识以及源地址标识(源节点的地址标识,如该源节点的ID、IP地址、Mac地址等);根据所述订阅消息的标识以及源地址标识生成所述回传消息。或者,该步骤包括:从所述订阅消息提取所述特征信息;生成携带所述特征信息的回传消息。该特征信息可包括所述订阅消息标识以及源地址标识等。The backhaul message can be used to identify the subscription message. Specifically, the step may include: extracting, by the subscription message, the subscription message identifier and a source address identifier (an address identifier of the source node, such as an ID of the source node, an IP address, a Mac address, etc.); according to the subscription message The identifier and the source address identifier generate the backhaul message. Alternatively, the step includes: extracting the feature information from the subscription message; and generating a backhaul message carrying the feature information. The feature information may include the subscription message identifier and a source address identifier, and the like.
在一具体应用中,订阅消息包括订阅消息标识、源地址标识以及内容摘要,该内容摘要可为匹配的内容消息摘要和/或订阅消息摘要。上述从所述订阅消息提取所述订阅消息标识以及源地址标识进一步包括:舍弃所述订阅消息中的内容摘要,以得到该订阅消息中剩余的所述订阅消息标识以 及源地址标识。In a specific application, the subscription message includes a subscription message identifier, a source address identifier, and a content summary, which may be a matching content message digest and/or a subscription message digest. The extracting the subscription message identifier and the source address identifier from the subscription message further includes: discarding the content summary in the subscription message to obtain the subscription message identifier remaining in the subscription message to And source address identifier.
S502:沿所述订阅消息的来文路径回传所述回传消息,其中所述回传消息的消息量小于所述订阅消息的消息量。S502: The backhaul message is returned along a communication path of the subscription message, where the message volume of the backhaul message is smaller than the message amount of the subscription message.
本发明中的节点标识可为该节点ID、节点IP地址或节点Mac地址等可唯一识别该节点的信息,该分区标识可为该分区ID等唯一识别该分区标识的信息。The node identifier in the present invention may be information such as the node ID, the node IP address, or the node Mac address, which can uniquely identify the node, and the partition identifier may be information that uniquely identifies the partition identifier for the partition ID or the like.
该订阅消息的来文路径上的节点在转发该订阅消息后会缓存该订阅消息以及其上一跳节点和下一跳节点,直至该订阅消息失效(如被山顶节点转发次数超过阈值、查找到匹配的内容消息、或缓存超时等),才将缓存的订阅消息删除。因此,该订阅消息的来文路径上的普通节点接收到该回传消息后,将该回传消息与本地缓存的订阅消息进行对比,从而获得本地缓存的对应订阅消息来文时的上一跳节点,将回传消息发送至该上一跳节点,以实现沿所述查找到的所述订阅消息的来文路径传输所述回传消息。该订阅消息的来文路径上的山顶节点接收到该回传消息后,根据该回传消息,查找到对应的缓存的完整的订阅消息,并判断其邻居分区是否均已转发过该订阅消息,若否,则将该订阅消息按照上述步骤S201、S202转发至可通往未转发过该订阅消息的邻居分区的邻居节点;若是,则按照上述S401、S402继续回传该回传消息,直至该回传消息达到其源节点或其源节点的本地山顶节点。The node on the incoming path of the subscription message caches the subscription message and its previous hop node and the next hop node after forwarding the subscription message until the subscription message is invalid (for example, if the number of times the hill node forwards exceeds the threshold, the search is found. The cached subscription message is deleted only if the content message matches, or the cache timeout, etc.). Therefore, after receiving the backhaul message, the ordinary node on the incoming path of the subscription message compares the backhaul message with the locally cached subscription message, thereby obtaining the last hop of the locally cached corresponding subscription message. And sending, by the node, a backhaul message to the previous hop node, to implement transmitting the backhaul message along the received communication path of the subscribed message. After receiving the backhaul message, the hilltop node on the incoming path of the subscription message finds the corresponding cached complete subscription message according to the backhaul message, and determines whether the neighboring partition has forwarded the subscription message. If yes, the subscription message is forwarded to the neighbor node that can reach the neighboring partition that has not forwarded the subscription message according to the foregoing steps S201 and S202; if yes, the backhaul message is continued to be returned according to the above S401 and S402 until the The return message reaches the local hill node of its source node or its source node.
在其他实施例中,该订阅消息的来文路径上的普通节点可执行与山顶节点相同的步骤。可以理解的是,上述沿订阅消息的来文路径回传,即为沿订阅消息来文路径的相反方向进行传输。In other embodiments, the normal node on the incoming path of the subscription message may perform the same steps as the hilltop node. It can be understood that the above-mentioned communication path along the subscription message is transmitted in the opposite direction of the subscription message.
上述精简回传方式,既实现了订阅消息回传效果,而且能够缩短回传的订阅消息的数据量,降低传输数据开销。The above-mentioned streamlined backhaul method not only realizes the effect of subscribing message backhaul, but also shortens the data amount of the returned subscription message and reduces the transmission data overhead.
第六实施例:Sixth embodiment:
本实施例提供分布式网络的路由方法的实施例,所述当前节点为普通节点,所述方法包括:The embodiment provides an embodiment of a routing method of a distributed network, where the current node is a common node, and the method includes:
S601:接收订阅消息;S601: Receive a subscription message;
S602:将所述订阅消息与本地内容消息进行匹配;若匹配成功,则执行S603;若匹配不成功,则执行S604,或执行第十一实施例所述的S112-S113 步骤,或执行第十三实施例所述的S132-S133步骤。S602: Match the subscription message with the local content message; if the matching is successful, execute S603; if the matching is unsuccessful, execute S604, or execute S112-S113 according to the eleventh embodiment. Steps, or performing the steps S132-S133 described in the thirteenth embodiment.
S603:沿所述订阅消息的来文路径回复与所述订阅消息匹配的内容消息。S603: Reply to the content message that matches the subscription message along the communication path of the subscription message.
当前普通节点具有直接回复内容消息的功能,无需必须转发至本地山顶节点进行回复,减少了订阅消息和内容消息的转发次数,降低订阅开销和数据转发开销,提高了数据传输效率。The current common node has the function of directly replying to the content message, and does not need to be forwarded to the local mountain node for reply, which reduces the number of forwarding of the subscription message and the content message, reduces the subscription overhead and data forwarding overhead, and improves the data transmission efficiency.
S604:转发所述订阅消息。S604: Forward the subscription message.
本实施例中,当前普通节点在生成内容消息后,将该内容消息保存于本地。该当前普通节点在接收到订阅消息后,根据该订阅消息中的内容消息概要与保存的内容消息进行匹配。若匹配成功,则将匹配的内容消息沿该订阅消息的来文路径进行回传,此后,该订阅消息失效,网络将不再转发该订阅消息。若匹配不成功,则确定当前节点不存在与该订阅消息匹配的内容,并可先判断该订阅消息属于下述哪种情况,并根据相应情况转发订阅消息:In this embodiment, the current common node saves the content message locally after generating the content message. After receiving the subscription message, the current normal node matches the saved content message according to the content message summary in the subscription message. If the matching is successful, the matching content message is sent back along the communication path of the subscription message. After that, the subscription message is invalid, and the network will not forward the subscription message. If the matching is unsuccessful, it is determined that the current node does not have content matching the subscription message, and the following may be determined by the subscription message, and the subscription message is forwarded according to the corresponding situation:
A)若判断该订阅消息是从山顶节点传输过来的,即判断该订阅消息需输至邻居分区的顶点节点,则可执行上述S201、S202,或者执行下述第十实施例所述方法步骤,以将该订阅消息转发至邻居分区,又或执行第十七实施例所述的S172步骤;A) if it is determined that the subscription message is transmitted from the top node, that is, the subscription message needs to be input to the vertex node of the neighboring partition, the foregoing S201, S202 may be performed, or the method steps described in the following tenth embodiment may be performed, Forwarding the subscription message to the neighbor partition, or performing the step S172 described in the seventeenth embodiment;
B)若判断该订阅消息是从邻居分区传输过来的,即判断该订阅消息需输至当前分区的顶点节点,则可将所述订阅消息沿通向当前分区的山顶节点的路径进行传输。B) If it is determined that the subscription message is transmitted from the neighbor partition, that is, the subscription message needs to be input to the vertex node of the current partition, the subscription message may be transmitted along the path leading to the top node of the current partition.
其中,当前节点可根据订阅消息的上一跳节点确定以上两种情况。例如,当前节点预先存储有可通向本地山顶节点的相邻节点,判断该订阅消息的上一跳节点是否为该可通向本地山顶节点的相邻节点,若是,则确定属于上述情况A,否则确定属于情况B。The current node may determine the above two situations according to the previous hop node of the subscription message. For example, the current node pre-stores a neighboring node that can lead to the local mountaintop node, and determines whether the previous hop node of the subscription message is the neighboring node that can reach the local mountaintop node, and if so, determines that the situation A belongs to the foregoing, Otherwise it is determined to belong to case B.
进一步地,若该普通节点存在回传功能,则匹配不成功,且当前节点不满足回传条件,如无法继续转发订阅消息或无需继续转发该订阅消息(图1所示实施例有对此条件进行说明)时,执行上述S404进行订阅消息精简回传。Further, if the common node has a backhaul function, the matching is unsuccessful, and the current node does not satisfy the backhaul condition, such as unable to continue forwarding the subscription message or continuing to forward the subscription message (the embodiment shown in FIG. 1 has this condition) When the description is made, the above S404 is performed to perform the subscription message reduction backhaul.
在另一实施例中,在执行上述S602之前,判断该订阅消息属于上述情 况A或B,若符合上述情况B时执行上述S602,并在匹配不成功时,将所述订阅消息沿通向当前分区的山顶节点的路径进行传输;若符合上述情况A,则直接执行上述S201、S202,以将该订阅消息转发至邻居分区。In another embodiment, before performing the foregoing S602, determining that the subscription message belongs to the foregoing situation Case A or B, if the above situation B is met, the above S602 is performed, and when the matching is unsuccessful, the subscription message is transmitted along the path leading to the top node of the current partition; if the above situation A is met, the above is directly performed. S201, S202, to forward the subscription message to the neighbor partition.
第七实施例:Seventh embodiment:
本实施例提供分布式网络的消息回复方法的实施例的流程图,该消息回复方法可由图1所示的普通节点执行,用于减少了数据传输开销和内容消息的回复时间,具体包括以下步骤:This embodiment provides a flowchart of an embodiment of a message replying method of a distributed network. The message replying method may be performed by the common node shown in FIG. 1 to reduce the data transmission overhead and the reply time of the content message, and specifically includes the following steps. :
S701:判断邻居节点中是否包含待回传的内容消息的目标节点,若包含,则执行S702,若不包含,则执行S703。S701: Determine whether the neighbor node includes the target node of the content message to be returned, if yes, execute S702, if not, execute S703.
其中,该内容消息的目标节点即为与该内容消息匹配的订阅消息的源节点。The target node of the content message is the source node of the subscription message that matches the content message.
可选地,在该S701之前,当前节点还从所述邻居节点的广播消息中提取该邻居节点的节点标识,并进行本地存储。该S701包括:将所述目标节点的节点标识与本地存储的节点标识进行匹配;若匹配成功,则判断邻居节点中包含目标节点。Optionally, before the S701, the current node further extracts the node identifier of the neighbor node from the broadcast message of the neighbor node, and performs local storage. The S701 includes: matching the node identifier of the target node with the locally stored node identifier; if the matching is successful, determining that the neighbor node includes the target node.
S702:将所述内容消息直接发送至所述目标节点。S702: Send the content message directly to the target node.
若该内容消息的目标节点为邻居节点,则当前节点确定无需按照订阅消息的来文路径回复该内容消息,而经该内容消息直接发送至目标节点。If the target node of the content message is a neighbor node, the current node determines that the content message does not need to be replied according to the communication path of the subscription message, and is directly sent to the target node via the content message.
S703:沿所述内容消息所对应的订阅消息的来文路径回传所述内容消息。S703: Return the content message along a communication path of the subscription message corresponding to the content message.
第八实施例:Eighth embodiment:
本实施例提供分布式网络的消息传输方法的实施例,该消息传输方法可图1所示的山顶节点执行,用于缩短消息传输路径,减少数据传输开销,包括以下步骤:The embodiment provides an embodiment of a message transmission method of a distributed network. The message transmission method can be executed by the hilltop node shown in FIG. 1 to shorten the message transmission path and reduce data transmission overhead, including the following steps:
S801:判断本地分区的邻居分区是否包含在待转发的订阅消息的源分区的邻居分区中,若包含,则执行S802,若不包含,则执行S803。S801: Determine whether the neighbor partition of the local partition is included in the neighbor partition of the source partition of the subscription message to be forwarded. If yes, execute S802. If not, execute S803.
其中,该订阅消息的源分区即为生成该订阅消息的源节点所在分区。The source partition of the subscription message is the partition of the source node that generates the subscription message.
在执行S801之前,当前节点可先获取邻居分区的分区标识和订阅消息源分区的分区标识以进行匹配。对应地,该S801的步骤具体为将所述本地分区的邻居分区的分区标识与所述源分区的邻居分区的分区标识进行匹 配,若匹配成功,则标识本地分区的邻居分区包含在待转发的订阅消息的源分区的邻居分区中。Before executing S801, the current node may first acquire the partition identifier of the neighbor partition and the partition identifier of the subscription message source partition to perform matching. Correspondingly, the step of S801 is specifically to compare the partition identifier of the neighbor partition of the local partition with the partition identifier of the neighbor partition of the source partition. If the match is successful, the neighbor partition identifying the local partition is included in the neighbor partition of the source partition of the subscription message to be forwarded.
S802:沿所述订阅消息的来文路径回传所述订阅消息。S802: Return the subscription message along a communication path of the subscription message.
具体可如第五实施例所述将该订阅消息沿来文路径进行精简回传。Specifically, the subscription message may be streamlined back along the incoming path as described in the fifth embodiment.
S803:向所述本地分区的邻居分区转发所述订阅消息。S803: Forward the subscription message to a neighbor partition of the local partition.
具体可参阅第二实施例实现将该订阅消息转发至可通往该本地分区的邻居分区的邻居节点。For details, refer to the second embodiment to implement forwarding the subscription message to a neighbor node that can reach a neighbor partition of the local partition.
第九实施例:Ninth embodiment:
本实施例提供分布式网络的消息回复方法的实施例,该消息回复输方法可图1所示的山顶节点执行,用于缩短内容消息的传输路径,减少数据传输开销,包括以下步骤:This embodiment provides an embodiment of a message replying method for a distributed network. The message replying method can be executed by the hilltop node shown in FIG. 1 for shortening the transmission path of the content message and reducing the data transmission overhead, including the following steps:
S901:判断邻居分区中是否包含待回传的内容消息的目标分区,若包含,则执行S902;若不包含,则执行S903。S901: Determine whether the target partition of the content message to be returned is included in the neighbor partition, if yes, execute S902; if not, execute S903.
其中,该内容消息的目标分区即为与该内容消息匹配的订阅消息的源分区。The target partition of the content message is the source partition of the subscription message that matches the content message.
可选地,该S901包括:将所述目标分区的分区标识与本地存储的邻居分区的分区标识进行匹配;若匹配成功,则判断邻居分区中包含目标分区。Optionally, the S901 includes: matching a partition identifier of the target partition with a partition identifier of a locally stored neighbor partition; if the matching is successful, determining that the target partition is included in the neighbor partition.
S902:将所述内容消息直接发送至所述目标分区。S902: Send the content message directly to the target partition.
若该内容消息的目标分区为邻居分区,则当前节点确定无需按照订阅消息的来文路径回复该内容消息,而经该内容消息直接发送至目标分区。If the target partition of the content message is a neighbor partition, the current node determines that the content message does not need to be replied according to the communication path of the subscription message, and is directly sent to the target partition via the content message.
可选地,当前节点可按照所述来文路径回传与所述内容消息对应的通知消息,以通知所述来文路径上的各节点所述目标分区已接收到所述内容消息,其中所述通知消息的消息量小于所述内容消息的消息量。进一步地,所述通知消息可至少包括所述目标节点的标识以及所述订阅消息的标识。Optionally, the current node may send a notification message corresponding to the content message according to the communication path, to notify each node on the communication path that the target partition has received the content message, where The message amount of the notification message is smaller than the message amount of the content message. Further, the notification message may include at least an identifier of the target node and an identifier of the subscription message.
S903:沿所述内容消息所对应的订阅消息的来文路径回传所述内容消息。S903: Return the content message along a communication path of the subscription message corresponding to the content message.
具体,当前节点可参照第七实施例回传该内容消息。Specifically, the current node may return the content message by referring to the seventh embodiment.
第十实施例:Tenth embodiment:
本实施例提供分布式网络的路由方法的实施例,该路由方法可由图1所示的普通节点或山顶节点执行,用于路由最优选择,减少数据传输开销, 包括以下步骤:This embodiment provides an embodiment of a routing method of a distributed network, which may be performed by a common node or a hilltop node as shown in FIG. 1 for routing optimal selection and reducing data transmission overhead. Includes the following steps:
S101:从邻居节点中选择可通向邻居分区且通往所述邻居分区所经跳数最少的邻居节点作为目标邻居节点。S101: Select, from the neighbor nodes, a neighbor node that can lead to the neighbor partition and has the few hops to the neighbor partition as the target neighbor node.
本实施例中,可通往邻居分区的邻居节点广播的心跳消息至少包括可通往的邻居分区的分区标识和用于表示通往该分区标识对应的邻居分区的所经跳数的跳数标识。在S101之前,当前节点如第三实施例所述接收邻居节点的心跳消息,并根据心跳消息确定该邻居节点是否可通往邻居分区。在确定可通往邻居分区时,从心跳消息中提取跳数标识,并在本地记录该可通往邻居分区的邻居节点及其对应的跳数标识。In this embodiment, the heartbeat message broadcasted by the neighboring node to the neighboring partition includes at least a partition identifier of the neighboring partition that can be accessed and a hop count identifier for indicating the hop count of the neighboring partition corresponding to the partition identifier. . Before S101, the current node receives the heartbeat message of the neighboring node as described in the third embodiment, and determines whether the neighboring node can reach the neighboring partition according to the heartbeat message. When it is determined that the neighboring partition can be reached, the hop count identifier is extracted from the heartbeat message, and the neighbor node that can lead to the neighbor partition and its corresponding hop count identifier are locally recorded.
进一步地,在确定该邻居节点可通往邻居分区时,还可在当前节点的心跳消息中记录所述有路标识并将当前节点的心跳消息中的跳数标识设置为在所述邻居节点的跳数标识的基础上增加预设步进值,并进一步广播所述当前节点的心跳消息。该预设步进值可根据实际需求进行设置,如设为1。进一步地,当判断邻居节点位于邻居分区时,当前节点本地记录该邻居节点对应的跳数标识为初始值,如为0,并将自身心跳消息的跳数标识对应增加为1。Further, when it is determined that the neighbor node can reach the neighboring partition, the path identifier may be recorded in the heartbeat message of the current node, and the hop ID in the heartbeat message of the current node is set to be at the neighbor node. The preset step value is added based on the hop number identifier, and the heartbeat message of the current node is further broadcasted. The preset step value can be set according to actual needs, such as set to 1. Further, when it is determined that the neighboring node is located in the neighboring partition, the current node locally records the hop count identifier corresponding to the neighboring node as an initial value, such as 0, and increases the hop count identifier of the heartbeat message to 1.
本步骤具体可包括:当前节点从本地记录的邻居节点信息中选择所述邻居节点的跳数标识最小的邻居节点作为所述目标邻居节点。The step may specifically include: the current node selects, as the target neighbor node, the neighbor node with the smallest hop ID of the neighbor node from the locally recorded neighbor node information.
S102:将待转发的订阅消息发送至所述目标邻居节点。S102: Send a subscription message to be forwarded to the target neighbor node.
第十一实施例:Eleventh embodiment:
请参阅图2,图2是本发明分布式网络的消息处理方法一实施例的流程图,该消息处理方法可由图1所示的普通节点或山顶节点执行,包括以下步骤:Referring to FIG. 2, FIG. 2 is a flowchart of an embodiment of a message processing method for a distributed network according to the present invention. The message processing method may be performed by a common node or a mountaintop node shown in FIG. 1, and includes the following steps:
S111:接收邻居分区所发送的非本地的内容消息的概要消息。S111: Receive a summary message of a non-local content message sent by the neighboring partition.
其中,本说明书中所述本地的内容消息,为保存于本地的内容消息,具体如,若当前节点为山顶节点,则其本地的内容消息为当前分区所产生的内容消息,若当前节点为普通节点,则本地的内容消息为当前节点所产生的内容消息。本说明书中所述非本地的内容消息为没有保存于本地的内容消息,例如当前山顶节点接收过的其他分区的内容消息,或当前普通节点接收过的其他节点的内容消息。 The local content message in the present specification is a content message stored locally. For example, if the current node is a mountain node, the local content message is a content message generated by the current partition, and if the current node is a common node, Node, the local content message is the content message generated by the current node. The non-local content message described in this specification is a content message that is not stored locally, such as a content message of another partition that has been received by the current hilltop node, or a content message of other nodes that the current ordinary node has received.
该概要消息用于表示对应内容消息所包含的主要信息,具体可包括内容消息中的概要部分,在一具体应用中,该概要消息包括该内容消息的概要以及该内容消息的源分区的分区标识。例如,当前节点接收到邻居分区A中的节点1产生的内容消息的概要消息,并将其保存本地。The summary message is used to indicate the main information included in the corresponding content message, and may specifically include a summary part in the content message. In a specific application, the summary message includes a summary of the content message and a partition identifier of the source partition of the content message. . For example, the current node receives a summary message of the content message generated by node 1 in neighbor partition A and saves it locally.
S112:将订阅消息与所述概要消息进行匹配。S112: Match the subscription message with the summary message.
例如,当接收到订阅消息时,将订阅消息与概要消息中包含的对应内容消息的概要进行匹配,若匹配,则执行S113,否则,可结束流程。For example, when the subscription message is received, the subscription message is matched with the summary of the corresponding content message included in the summary message. If yes, S113 is performed; otherwise, the process may be ended.
S113:沿所述订阅消息的来文路径发送所述概要消息,或者沿所述概要消息的来文路径发送所述订阅消息。S113: Send the summary message along a communication path of the subscription message, or send the subscription message along a communication path of the summary message.
例如,当前节点判断概要消息的来文路径上的分区是否包含在所述订阅消息的源分区的邻居分区中;若包含在所述订阅消息的源分区的邻居分区中,则沿所述订阅消息的来文路径发送所述概要消息;否则,沿所述概要消息的来文路径发送所述订阅消息。For example, the current node determines whether the partition on the incoming path of the summary message is included in the neighbor partition of the source partition of the subscription message; if included in the neighbor partition of the source partition of the subscription message, along the subscription message The summary path sends the summary message; otherwise, the subscription message is sent along the communication path of the summary message.
可选地,该消息处理方法还可在获得本地内容消息后,生成该本地内容消息的概要消息,并将该概要消息发送至可通往邻居分区的邻居节点,以使该概要消息发送至邻居分区。具体,将该概要消息发送至可通往邻居分区的邻居节点的方式可参考上述第二实施例。Optionally, the message processing method may further generate a summary message of the local content message after obtaining the local content message, and send the summary message to a neighbor node that can reach the neighboring partition, so that the summary message is sent to the neighbor. Partition. Specifically, the manner in which the summary message is sent to the neighbor node that can reach the neighboring partition can be referred to the second embodiment above.
本实施例中,节点在生成内容消息后将该内容消息的概要消息发送至邻居分区,邻居分区的节点进而将订阅消息与该概要消息进行匹配,在匹配时可直接沿所述订阅消息的来文路径发送所述概要消息,以使订阅消息源节点获得该概要消息,或者沿所述概要消息的来文路径发送所述订阅消息,以使内容消息源节点接收到该订阅消息进而回复内容消息,故实现了订阅消息的有效传输,而无需无目标发送订阅消息,进而提高了内容消息的查找效率,减少数据传输开销。In this embodiment, after generating the content message, the node sends the summary message of the content message to the neighboring partition, and the node of the neighboring partition further matches the subscription message with the summary message, and directly matches the subscription message when matching. And sending, by the text path, the summary message, so that the subscription message source node obtains the summary message, or sends the subscription message along a communication path of the summary message, so that the content message source node receives the subscription message and then replies to the content message. Therefore, the effective transmission of the subscription message is realized, and the destination message is not required to be sent, thereby improving the efficiency of searching for the content message and reducing the data transmission overhead.
图3提供了分布式网络的消息处理方法另一实施例的部分流程图,该实施例中,图3仅示出上述S112,实际上该实施例还包括上述S111和S113,其中,当前节点可在图3所示方法的任一时刻执行上述S131。在执行S112之后执行S113。FIG. 3 is a partial flowchart of another embodiment of a message processing method of a distributed network. In this embodiment, FIG. 3 only shows the foregoing S112. In fact, the embodiment further includes the foregoing S111 and S113, where the current node may be The above S131 is executed at any time of the method shown in FIG. S113 is executed after executing S112.
第十二实施例:Twelfth embodiment:
本实施例提供分布式网络的消息处理方法的实施例,该消息处理方法 可由图1所示的普通节点或山顶节点执行,用于减少内容消息的传输数据开销和传输时间,提高传输效率,包括以下步骤:This embodiment provides an embodiment of a message processing method of a distributed network, and the message processing method It can be executed by the common node or the top node shown in FIG. 1 to reduce the transmission data overhead and transmission time of the content message, and improve the transmission efficiency, including the following steps:
S121:接收订阅消息。S121: Receive a subscription message.
S122:从所述订阅消息中提取所述订阅消息的来文路径上的各历史节点的节点标识。S122: Extract, from the subscription message, a node identifier of each history node on a communication path of the subscription message.
本实施例中,订阅消息中包含转发过该订阅消息的各历史节点的节点标识,当前节点从该订阅消息中提取该订阅消息的各历史节点的节点标识,并本地存储。In this embodiment, the subscription message includes the node identifier of each history node that has forwarded the subscription message, and the current node extracts the node identifier of each history node of the subscription message from the subscription message, and stores it locally.
S123:在回传与该订阅消息匹配的内容消息时,根据所述节点标识判断邻居节点中除所述订阅消息的上一跳历史节点外是否还包含其他历史节点,若包含,则执行S124,否则执行S125。S123: When returning the content message that matches the subscription message, determining, according to the node identifier, whether the history node other than the previous hop history node of the subscription message includes other history nodes, if yes, executing S124, Otherwise, execute S125.
例如,在接收到上述订阅消息时,将订阅消息与本地内容消息进行匹配,若匹配不成功,则将当前节点的节点标识添加至所述订阅消息中,并执行第四或第六实施例对应匹配不成功时的相应步骤,以转发该订阅消息、或回传该订阅消息等;若匹配成功,则根据所述节点标识判断邻居节点中除所述订阅消息的上一跳历史节点外是否还包含其他历史节点。其中,当前节点可根据本地存储的该订阅消息中的节点标识确定该订阅消息的来文路径。For example, when the subscription message is received, the subscription message is matched with the local content message. If the matching is unsuccessful, the node identifier of the current node is added to the subscription message, and the fourth or sixth embodiment is executed. Corresponding steps when the matching is unsuccessful, to forward the subscription message, or to return the subscription message, etc.; if the matching is successful, determine, according to the node identifier, whether the neighbor node has a history node other than the previous hop of the subscription message Contains other history nodes. The current node may determine a communication path of the subscription message according to the node identifier in the locally stored subscription message.
S124:将所述内容消息直接回传至所述其他历史节点。S124: The content message is directly transmitted back to the other history node.
S125:将该内容消息回传至上一跳历史节点,以沿匹配的订阅消息的来文路径回传该内容消息。S125: The content message is sent back to the last hop history node to return the content message along the communication path of the matched subscription message.
第十三实施例:Thirteenth embodiment:
本实施例提供分布式网络的消息处理方法的实施例,该消息处理方法可由图1所示的普通节点或山顶节点执行,用于有目标的将订阅消息往匹配的内容消息的源节点传输,减少传输数据开销,包括以下步骤:This embodiment provides an embodiment of a message processing method of a distributed network, which may be performed by a common node or a hilltop node shown in FIG. 1 for targeted transmission of a subscription message to a source node of a matched content message. Reduce the transmission data overhead, including the following steps:
S131:获取邻居节点发送的内容消息的概要和所述内容消息的传输路径。S131: Acquire a summary of the content message sent by the neighbor node and a transmission path of the content message.
例如,当接收到回传的内容消息时,提取该内容消息中的概要,以及获取该内容消息的历史传输路径,并本地保存。For example, when the returned content message is received, the summary in the content message is extracted, and the historical transmission path of the content message is obtained and saved locally.
S132:在需转发订阅消息时,判断所述订阅消息与所述概要是否匹配, 若匹配,则执行S133;否则,执行如上第二实施例所示将订阅消息转发至可通往邻居分区的邻居节点。S132: When the subscription message needs to be forwarded, determine whether the subscription message matches the summary, If it matches, then S133 is performed; otherwise, the subscription message is forwarded to the neighbor node that can reach the neighbor partition as shown in the second embodiment.
例如,当前节点执行上述第四或第六实施例,在判断订阅消息与本地内容消息不匹配时,则确定为需转发订阅消息,并判断所述订阅消息与所述概要是否匹配。For example, the current node performs the foregoing fourth or sixth embodiment. When it is determined that the subscription message does not match the local content message, it is determined that the subscription message needs to be forwarded, and it is determined whether the subscription message matches the summary.
S133:沿所述内容消息的传输路径转发所述订阅消息。S133: Forward the subscription message along a transmission path of the content message.
其中,该内容消息的传输路径可为内容消息的上一跳历史节点信息。The transmission path of the content message may be the last hop history node information of the content message.
第十四实施例:Fourteenth embodiment:
本实施例提供分布式网络的消息处理方法的实施例,该消息处理方法可由图1所示的山顶节点或普通节点执行,用于存储其他分区的内容消息并进行订阅匹配,进而提高网络内容消息的查找概率和效率,包括以下步骤:This embodiment provides an embodiment of a message processing method of a distributed network. The message processing method may be executed by a hilltop node or a common node shown in FIG. 1 for storing content messages of other partitions and performing subscription matching, thereby improving network content messages. Find probabilities and efficiencies, including the following steps:
S141:接收订阅消息。S141: Receive a subscription message.
S142:判断所述订阅消息是否与其他分区生成的第一内容消息匹配,若匹配,则执行S143,否则执行S144。S142: Determine whether the subscription message matches the first content message generated by the other partitions. If yes, execute S143, otherwise execute S144.
例如,当前节点为山顶节点,当前节点本地存储由两种类型的内容消息:第一内容消息为其他分区生成的,第二内容消息为当前分区生成的。For example, the current node is a hilltop node, and the current node is locally stored by two types of content messages: the first content message is generated for other partitions, and the second content message is generated for the current partition.
可选地,当前节点在接收到订阅消息后,判断订阅消息是否与本地第二内容消息匹配,若匹配,则执行第四或第六实施例所述匹配成功的相应步骤,若匹配不成功,则执行上述S142。Optionally, after receiving the subscription message, the current node determines whether the subscription message matches the local second content message, and if yes, performs the corresponding step of the matching succeeding in the fourth or sixth embodiment, if the matching is unsuccessful, Then, the above S142 is executed.
进一步地,在上述S142之前,所述方法还包括:接收其他分区发送的第一内容消息;判断所述第一内容消息是否满足设定条件;若满足,则保存所述第一内容消息,并在接收到订阅消息时执行S142;否则转发所述第一内容消息。具体,当前节点转发所述第一内容消息可参阅第二实施例,以向能够通向邻居分区的邻居节点发送所述第一内容消息。Further, before the foregoing S142, the method further includes: receiving a first content message sent by another partition; determining whether the first content message satisfies a setting condition; if yes, saving the first content message, and S142 is performed upon receiving the subscription message; otherwise the first content message is forwarded. Specifically, the current node forwarding the first content message may refer to the second embodiment to send the first content message to a neighbor node that can reach the neighbor partition.
其中,所述设定条件可根据实际情况进行配置,例如为所述第一内容消息的源分区不为邻居分区且本地存储空间大于设定容量,或者为当前分区标识与所述第一内容消息携带的目标分区标识一致,或者为所述第一内容消息的转发次数符合设定次数等。The setting condition may be configured according to an actual situation, for example, the source partition of the first content message is not a neighbor partition and the local storage space is greater than a set capacity, or is a current partition identifier and the first content message. The carried target partition identifiers are consistent, or the number of times the first content message is forwarded matches the set number of times.
S143:回传所述匹配的第一内容消息。 S143: Return the matched first content message.
S144:向能够通向邻居分区的邻居节点发送所述订阅消息。S144: Send the subscription message to a neighbor node that can reach the neighbor partition.
其中,上述S143中的所述第一内容消息的回传可参考上述内容消息的回传步骤,例如参考第四实施例中的S403、或第六实施例中的S601描述。上述S144可参考第二实施例的说明。The backhaul of the first content message in the foregoing S143 may refer to the backhaul step of the content message, for example, refer to S403 in the fourth embodiment, or S601 in the sixth embodiment. The above S144 can refer to the description of the second embodiment.
第十五实施例:Fifteenth embodiment:
本实施例提供分布式网络的消息处理方法的实施例,该消息处理方法可由图1所示的山顶节点或普通节点执行,用于获得可通往邻居分区的邻居节点,包括以下步骤:This embodiment provides an embodiment of a message processing method of a distributed network. The message processing method may be performed by a hilltop node or a common node shown in FIG. 1 for obtaining a neighbor node that can lead to a neighboring partition, including the following steps:
S151:接收订阅消息。S151: Receive a subscription message.
S152:在判断所述订阅消息来自其他分区时,将当前分区中转发过所述订阅消息的节点确定为可通往邻居分区的节点。S152: When it is determined that the subscription message is from another partition, determine, by the node in the current partition that the subscription message is forwarded, a node that can reach the neighbor partition.
当前节点可仅对邻居节点进行判断,例如,当前节点将当前分区中转发过所述订阅消息的邻居节点确定为可通往邻居分区的邻居节点。The current node may only judge the neighbor node, for example, the current node determines the neighbor node in the current partition that has forwarded the subscription message as a neighbor node that can reach the neighbor partition.
可选地,当前节点在接收到订阅消息后,可执行第四或第六实施例在接收订阅消息后的相关步骤。Optionally, after receiving the subscription message, the current node may perform the relevant step of the fourth or sixth embodiment after receiving the subscription message.
第十六实施例:Sixteenth embodiment:
本实施例提供分布式网络的心跳方法的实施例,该心跳方法可由图1所示的山顶节点或普通节点执行,用于通过网络部分节点进行心跳即可实现邻居侦测,包括以下步骤:This embodiment provides an embodiment of a heartbeat method of a distributed network. The heartbeat method may be performed by a mountain node or a common node as shown in FIG. 1 for performing heartbeat detection by a network part node, including the following steps:
S161:当前节点判断是否满足设定心跳条件,若满足,则执行S162,否则执行S163。S161: The current node determines whether the set heartbeat condition is met. If yes, execute S162, otherwise execute S163.
本实施例中,网络中的部分节点进行心跳,另一部分节点则不进行心跳。具体,节点定时检测是否需要进行心跳。所述设定心跳条件可根据实际需求进行设置,例如可包括预测当前网络拓扑的变动大于设定变化值、当前时间为设定时间、当前信道处于空闲状态、当前位置为设定网络拓扑位置、在之前预设时间内未接收到邻居节点的心跳消息、在之前设定个周期内未发送心跳消息、随机运算结果中的至少一种。In this embodiment, some nodes in the network perform heartbeat, and the other node does not perform heartbeat. Specifically, the node periodically detects whether a heartbeat needs to be performed. The setting heartbeat condition may be set according to actual requirements, for example, may include predicting that the current network topology changes are greater than a set change value, the current time is a set time, the current channel is in an idle state, and the current location is a set network topology position, At least one of the heartbeat message of the neighbor node, the heartbeat message not sent within the previously set period, and the result of the random operation are not received within the preset time.
S162:发送心跳消息。S162: Send a heartbeat message.
S163:不发送心跳消息。S163: Do not send a heartbeat message.
可选地,所述方法还包括:接收其他节点发送的携带有邻居节点标识 的通知消息;将所述通知消息中的邻居节点标识对应的节点确定为邻居节点。Optionally, the method further includes: receiving a neighbor node identifier sent by another node a notification message; determining a node corresponding to the neighbor node identifier in the notification message as a neighbor node.
进一步地,为了减少数据传输开销,当前节点每隔第一时间间隔执行上述S161步骤,并每隔第二时间间隔执行发送所述通知消息的步骤;其中,所述第一时间间隔小于所述第二时间间隔。Further, in order to reduce the data transmission overhead, the current node performs the foregoing step S161 every first time interval, and performs the step of transmitting the notification message every second time interval; wherein the first time interval is smaller than the first Two time intervals.
第十七实施例:Seventeenth embodiment:
本实施例提供分布式网络的消息处理方法的实施例,该消息处理方法可由图1所示的山顶节点或普通节点执行,用于智能控制订阅消息的有效性,包括以下步骤:The embodiment provides an embodiment of the message processing method of the distributed network. The message processing method can be performed by the hilltop node or the common node shown in FIG. 1 for intelligently controlling the validity of the subscription message, including the following steps:
S171:接收订阅消息。S171: Receive a subscription message.
S172:若判断所述订阅消息的转发失效或即将失效,且所述当前节点或所述订阅消息满足设定条件,则延长所述订阅消息的有效性。S172: If it is determined that the forwarding of the subscription message is invalid or is about to expire, and the current node or the subscription message satisfies the set condition, the validity of the subscription message is extended.
该即将失效为下一次转发则失效的状态。若判断订阅消息未转发失效或未即将失效,则转发该订阅消息。所述设定条件可根据实际情况设置,例如为当前节点未转发过所述订阅消息、所述订阅消息的源节点为设定节点、所述订阅消息的重要程度值高于设定值中的至少一种。This is about to expire as the state in which the next forwarding is invalid. If it is determined that the subscription message has not been forwarded or is not about to expire, the subscription message is forwarded. The setting condition may be set according to an actual situation, for example, the current node does not forward the subscription message, the source node of the subscription message is a setting node, and the importance degree value of the subscription message is higher than a set value. At least one.
具体如,当前节点判断所述订阅消息的转发次数是否超过有效转发次数,若超过,则将所述订阅消息的有效转发次数增加设定次数,以延长有效性。或者,当前节点判断所述订阅消息的转发总时间是否超过有效转发时间,若超过,则将所述订阅消息的有效转发时间增加设定时间值,以延长有效性。For example, the current node determines whether the number of times the subscription message is forwarded exceeds the number of valid forwardings. If yes, the number of valid forwardings of the subscription message is increased by a set number of times to extend the validity. Or the current node determines whether the total forwarding time of the subscription message exceeds a valid forwarding time. If yes, the effective forwarding time of the subscription message is increased by a set time value to extend the validity.
本发明还可提供由上述第二至第十七实施例的组合而成的实施例,即该方法实施例包括至少两个上述实施例所述步骤,具体该步骤的执行顺序可参考上述实施例中的说明。The present invention can also provide an embodiment of the combination of the above-mentioned second to seventeenth embodiments, that is, the method embodiment includes at least two steps described in the above embodiments, and the execution sequence of the step can be referred to the above embodiment. In the description.
第十八实施例:Eighteenth embodiment:
请参阅图4,图4是本发明分布式网络节点一实施例的结构示意图。本实施例中,该节点可以为图1所示的普通节点。该节点40包括接收模块41、匹配模块42和发送模块43。其中,接收模块41用于接收邻居分区所发送的非本地的内容消息的概要消息。匹配模块42用于将订阅消息与所述概要消息进行匹配。发送模块43用于在所述订阅消息与所述概要消息匹配时, 沿所述订阅消息的来文路径发送所述概要消息,或者沿所述概要消息的来文路径发送所述订阅消息。Please refer to FIG. 4. FIG. 4 is a schematic structural diagram of an embodiment of a distributed network node according to the present invention. In this embodiment, the node may be a common node as shown in FIG. 1. The node 40 includes a receiving module 41, a matching module 42, and a transmitting module 43. The receiving module 41 is configured to receive a summary message of a non-local content message sent by the neighboring partition. The matching module 42 is configured to match the subscription message with the summary message. The sending module 43 is configured to: when the subscription message matches the summary message, Transmitting the summary message along a communication path of the subscription message or sending the subscription message along a communication path of the summary message.
可选地,所述概要消息包括所述内容消息的概要以及所述内容消息的源分区的分区标识。Optionally, the summary message includes a summary of the content message and a partition identifier of a source partition of the content message.
可选地,匹配模块42还用于:接收所述订阅消息;判断是否将所述订阅消息与本地的内容消息进行匹配;若与本地的内容消息匹配,则回传所述匹配的内容消息;否则,则执行所述将订阅消息与所述概要消息进行匹配的步骤。Optionally, the matching module 42 is further configured to: receive the subscription message, determine whether to match the subscription message with a local content message, and if the local content message matches, return the matched content message; Otherwise, the step of matching the subscription message with the summary message is performed.
可选地,发送模块43进一步用于:判断所述概要消息的来文路径上的分区是否包含在所述订阅消息的源分区的邻居分区中;若包含在所述订阅消息的源分区的邻居分区中,则沿所述订阅消息的来文路径发送所述概要消息;否则,则沿所述概要消息的来文路径发送所述订阅消息。Optionally, the sending module 43 is further configured to: determine whether a partition on the source path of the summary message is included in a neighbor partition of a source partition of the subscription message; if a neighbor included in a source partition of the subscription message In the partition, the summary message is sent along the communication path of the subscription message; otherwise, the subscription message is sent along the communication path of the summary message.
可选地,匹配模块42执行所述回传所述匹配的内容消息的步骤包括:判断邻居分区中是否包含所述订阅消息的源分区;若是,则将所述内容消息直接发送至所述源分区;否则,沿所述订阅消息的来文路径回传所述内容消息。Optionally, the step of the matching module 42 performing the backhauling the matched content message comprises: determining whether a source partition of the subscription message is included in the neighbor partition; if yes, sending the content message directly to the source Partitioning; otherwise, the content message is returned along the incoming path of the subscription message.
可选地,节点40还包括存储模块,用于从邻居节点的广播消息中提取所述邻居分区的分区标识,并进行本地存储;匹配模块42执行所述判断邻居分区中是否包含所述订阅消息的源分区的步骤包括:将所述目标分区的分区标识与本地存储的分区标识进行匹配;若匹配成功,则判断邻居分区中包含目标分区。Optionally, the node 40 further includes a storage module, configured to extract a partition identifier of the neighbor partition from a broadcast message of the neighbor node, and perform local storage; and the matching module 42 performs the determining whether the neighbor partition includes the subscription message. The step of the source partition includes: matching the partition identifier of the target partition with the locally stored partition identifier; if the matching is successful, determining that the neighbor partition includes the target partition.
可选地,节点40还包括生成模块,用于生成本地内容消息的概要消息;从所述邻居节点中选择能够通向所述邻居分区的邻居节点,并向所述能够通向所述邻居分区的邻居节点发送所述通知消息。Optionally, the node 40 further includes a generating module, configured to generate a summary message of the local content message, select a neighboring node that can pass to the neighboring partition, and provide the neighboring node to the neighboring partition The neighbor node sends the notification message.
可选地,生成模块进一步用于判断所述邻居节点的广播消息中是否包含所述邻居分区的分区标识或者能够通向所述邻居分区的有路标识;若包含,则将所述邻居节点标记为能够通向所述邻居分区的邻居节点。Optionally, the generating module is further configured to determine whether the broadcast message of the neighboring node includes a partition identifier of the neighbor partition or a path identifier that can be connected to the neighbor partition; if yes, mark the neighbor node A neighbor node that is capable of accessing the neighbor partition.
上述节点的各个模块可分别执行上述方法实施例中对应步骤,故在此不对各模块进行赘述,详细请参阅以上对应步骤的说明。The modules in the above-mentioned nodes can respectively perform the corresponding steps in the foregoing method embodiments, and therefore, the modules are not described herein. For details, refer to the description of the corresponding steps.
上述节点40还可用于执行上述方法实施例或其组合,具体请参考上述 方法实施例的描述。The foregoing node 40 can also be used to perform the foregoing method embodiments or a combination thereof. Description of method embodiments.
第十九实施例:Nineteenth embodiment:
请参阅图5,图5是本发明分布式网络节点另一实施例的结构示意图。该节点为图1所示的山顶节点或普通节点,该节点可以执行上述方法中步骤。相关内容请参见上述方法中的详细说明,在此不再赘叙。Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of another embodiment of a distributed network node according to the present invention. The node is a hilltop node or a common node as shown in FIG. 1, and the node can perform the steps in the above method. For related content, please refer to the detailed description in the above method, which will not be described here.
本实施例中,该节点50包括:发送器51、接收器52、一个或多个处理器53、存储器54和总线55。In this embodiment, the node 50 includes a transmitter 51, a receiver 52, one or more processors 53, a memory 54, and a bus 55.
发送器51用于向分布式网络中的其他节点发送消息,如订阅消息或内容消息。接收器52用于接收分布式网络中的其他节点发送的消息,如订阅消息或内容消息。存储器54包括只读存储器和随机存取存储器。存储器54的一部分还可以包括非易失性随机存取存储器(NVRAM)。 Transmitter 51 is used to send messages, such as subscription messages or content messages, to other nodes in the distributed network. The receiver 52 is configured to receive messages sent by other nodes in the distributed network, such as subscription messages or content messages. The memory 54 includes a read only memory and a random access memory. A portion of memory 54 may also include non-volatile random access memory (NVRAM).
处理器53还可以称为CPU(Central Processing Unit,中央处理单元)。具体的应用中,节点的各个组件通过总线55耦合在一起,其中总线55除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线55。The processor 53 may also be referred to as a CPU (Central Processing Unit). In a specific application, the various components of the node are coupled together by a bus 55. The bus 55 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as bus 55 in the figure.
本发明实施例中,节点50还包括多个应用程序以及一个或多个程序,所述多个应用程序以及一个或多个程序存储在存储器54中,并且配置为被所述处理器53执行。所述一个或多个程序包括指令。处理器53通过调用存储器54存储的所述一个或多个程序中的指令,来执行下述操作:获取接收器52接收的邻居分区所发送的非本地的内容消息的概要消息;将订阅消息与所述概要消息进行匹配;若与所述概要消息匹配,则通过发送器51沿所述订阅消息的来文路径发送所述概要消息,或者通过发送器51沿所述概要消息的来文路径发送所述订阅消息。In an embodiment of the invention, node 50 further includes a plurality of applications and one or more programs, said plurality of applications and one or more programs being stored in memory 54 and configured to be executed by said processor 53. The one or more programs include instructions. The processor 53 performs the following operations by calling an instruction in the one or more programs stored in the memory 54: acquiring a summary message of the non-local content message sent by the neighbor partition received by the receiver 52; The summary message is matched; if it matches the summary message, the summary message is sent along the communication path of the subscription message by the sender 51, or sent along the communication path of the summary message by the sender 51. The subscription message.
上述处理器53具体可用于执行上述方法实施例或其组合,具体请参考上述方法实施例的描述。The foregoing processor 53 is specifically configured to perform the foregoing method embodiments or a combination thereof. For details, refer to the description of the foregoing method embodiments.
以上所述仅为本发明的实施方式,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。 The above is only the embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the invention and the drawings are directly or indirectly applied to other related technologies. The fields are all included in the scope of patent protection of the present invention.

Claims (10)

  1. 一种分布式网络的消息处理方法,其特征在于,所述方法包括:A message processing method for a distributed network, the method comprising:
    接收邻居分区所发送的非本地的内容消息的概要消息;Receiving a summary message of a non-local content message sent by the neighbor partition;
    将订阅消息与所述概要消息进行匹配;Matching the subscription message with the summary message;
    若与所述概要消息匹配,则沿所述订阅消息的来文路径发送所述概要消息,或者沿所述概要消息的来文路径发送所述订阅消息。And if the summary message matches, sending the summary message along a communication path of the subscription message, or sending the subscription message along a communication path of the summary message.
  2. 根据权利要求1所述的方法,其特征在于,所述概要消息包括所述内容消息的概要以及所述内容消息的源分区的分区标识。The method of claim 1 wherein the summary message comprises an overview of the content message and a partition identification of a source partition of the content message.
  3. 根据权利要求1所述的方法,其特征在于,所述将订阅消息与所述概要消息进行匹配的步骤之前,还包括:The method according to claim 1, wherein before the step of matching the subscription message with the summary message, the method further comprises:
    接收所述订阅消息;Receiving the subscription message;
    判断是否将所述订阅消息与本地的内容消息进行匹配;Determining whether to match the subscription message with a local content message;
    若与本地的内容消息匹配,则回传所述匹配的内容消息;Returning the matched content message if it matches the local content message;
    否则,则执行所述将订阅消息与所述概要消息进行匹配的步骤。Otherwise, the step of matching the subscription message with the summary message is performed.
  4. 根据权利要求3所述的方法,其特征在于,若与所述概要消息匹配,则沿所述订阅消息的来文路径发送所述概要消息,或者沿所述概要消息的来文路径发送所述订阅消息的步骤进一步包括:The method according to claim 3, wherein if the summary message matches, the summary message is sent along a communication path of the subscription message, or the message is sent along a communication path of the summary message The steps of subscribing to the message further include:
    判断所述概要消息的来文路径上的分区是否包含在所述订阅消息的源分区的邻居分区中;Determining whether a partition on a communication path of the summary message is included in a neighbor partition of a source partition of the subscription message;
    若包含在所述订阅消息的源分区的邻居分区中,则沿所述订阅消息的来文路径发送所述概要消息;And if included in a neighbor partition of the source partition of the subscription message, sending the summary message along a communication path of the subscription message;
    否则,则沿所述概要消息的来文路径发送所述订阅消息。Otherwise, the subscription message is sent along the communication path of the summary message.
  5. 根据权利要求3所述的方法,其特征在于,所述回传所述匹配的内容消息的步骤包括:The method of claim 3, wherein the step of returning the matched content message comprises:
    判断邻居分区中是否包含所述订阅消息的源分区;Determining whether the source partition of the subscription message is included in the neighbor partition;
    若是,则将所述内容消息直接发送至所述源分区;If yes, sending the content message directly to the source partition;
    否则,沿所述订阅消息的来文路径回传所述内容消息。Otherwise, the content message is returned along the incoming path of the subscription message.
  6. 根据权利要求1所述的方法,其特征在于,所述判断邻居分区中是否包含所述订阅消息的源分区的步骤之前进一步包括:The method according to claim 1, wherein the step of determining whether the source partition of the subscription message is included in the neighbor partition further comprises:
    从邻居节点的广播消息中提取所述邻居分区的分区标识,并进行本地 存储;Extracting the partition identifier of the neighbor partition from the broadcast message of the neighbor node, and performing local storage;
    所述判断邻居分区中是否包含所述订阅消息的源分区的步骤包括:The step of determining whether the source partition of the subscription message is included in the neighbor partition includes:
    将所述目标分区的分区标识与本地存储的分区标识进行匹配;Matching the partition identifier of the target partition with the locally stored partition identifier;
    若匹配成功,则判断邻居分区中包含目标分区。If the match is successful, it is determined that the target partition is included in the neighbor partition.
  7. 根据权利要求1所述的方法,其特征在于,进一步包括:The method of claim 1 further comprising:
    生成本地内容消息的概要消息;Generating a summary message of the local content message;
    从所述邻居节点中选择能够通向所述邻居分区的邻居节点,并向所述能够通向所述邻居分区的邻居节点发送所述通知消息。Selecting a neighbor node that can lead to the neighbor partition from the neighbor nodes, and sending the notification message to the neighbor node that can reach the neighbor partition.
  8. 根据权利要求7所述的方法,其特征在于,在所述从所述邻居节点中选择能够通向所述邻居分区的邻居节点的步骤之前,还包括:The method according to claim 7, wherein before the step of selecting a neighbor node that can be passed to the neighboring partition from the neighboring nodes, the method further includes:
    判断所述邻居节点的广播消息中是否包含所述邻居分区的分区标识或者能够通向所述邻居分区的有路标识;Determining, by the broadcast message of the neighboring node, a partition identifier of the neighbor partition or a road identifier that can be connected to the neighbor partition;
    若包含,则将所述邻居节点标记为能够通向所述邻居分区的邻居节点。If included, the neighbor node is marked as a neighbor node that is capable of accessing the neighbor partition.
  9. 一种分布式网络节点,其特征在于,包括:A distributed network node, comprising:
    接收模块,用于接收邻居分区所发送的非本地的内容消息的概要消息;a receiving module, configured to receive a summary message of a non-local content message sent by the neighboring partition;
    匹配模块,用于将订阅消息与所述概要消息进行匹配;a matching module, configured to match the subscription message with the summary message;
    发送模块,用于在所述订阅消息与所述概要消息匹配时,沿所述订阅消息的来文路径发送所述概要消息,或者沿所述概要消息的来文路径发送所述订阅消息。And a sending module, configured to send the summary message along a communication path of the subscription message when the subscription message matches the summary message, or send the subscription message along a communication path of the summary message.
  10. 一种分布式网络节点,其特征在于,包括发送器、接收器、处理器和存储器,所述处理器通过执行所述存储器存储的指令,用于:A distributed network node, comprising: a transmitter, a receiver, a processor, and a memory, the processor executing the instructions stored in the memory for:
    获取所述接收器接收的邻居分区所发送的非本地的内容消息的概要消息;Obtaining a summary message of the non-local content message sent by the neighbor partition received by the receiver;
    将订阅消息与所述概要消息进行匹配;Matching the subscription message with the summary message;
    若与所述概要消息匹配,则通过所述发送器沿所述订阅消息的来文路径发送所述概要消息,或者通过所述发送器沿所述概要消息的来文路径发送所述订阅消息。 And if the summary message matches, sending, by the sender, the summary message along a communication path of the subscription message, or sending, by the sender, the subscription message along a communication path of the summary message.
PCT/CN2016/085582 2016-06-13 2016-06-13 Distributed network message processing method and node WO2017214817A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/085582 WO2017214817A1 (en) 2016-06-13 2016-06-13 Distributed network message processing method and node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/085582 WO2017214817A1 (en) 2016-06-13 2016-06-13 Distributed network message processing method and node

Publications (1)

Publication Number Publication Date
WO2017214817A1 true WO2017214817A1 (en) 2017-12-21

Family

ID=60662987

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/085582 WO2017214817A1 (en) 2016-06-13 2016-06-13 Distributed network message processing method and node

Country Status (1)

Country Link
WO (1) WO2017214817A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070277205A1 (en) * 2006-05-26 2007-11-29 Sbc Knowledge Ventures L.P. System and method for distributing video data
CN101848236A (en) * 2010-05-06 2010-09-29 北京邮电大学 Real-time data distribution system with distributed network architecture and working method thereof
CN102640137A (en) * 2009-10-30 2012-08-15 弗里塞恩公司 Hierarchical publish and subscribe system
WO2014000558A1 (en) * 2012-06-25 2014-01-03 中兴通讯股份有限公司 Method and system for implementing cdn routing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070277205A1 (en) * 2006-05-26 2007-11-29 Sbc Knowledge Ventures L.P. System and method for distributing video data
CN102640137A (en) * 2009-10-30 2012-08-15 弗里塞恩公司 Hierarchical publish and subscribe system
CN101848236A (en) * 2010-05-06 2010-09-29 北京邮电大学 Real-time data distribution system with distributed network architecture and working method thereof
WO2014000558A1 (en) * 2012-06-25 2014-01-03 中兴通讯股份有限公司 Method and system for implementing cdn routing

Similar Documents

Publication Publication Date Title
EP2566137B1 (en) Methods and systems for peer-to-peer network discovery using multi-user diversity
US7787429B2 (en) Method and apparatus for establishing path in wireless network
Aboud et al. Efficient forwarding strategy in a NDN-based internet of things
US20030123419A1 (en) Routing protocol selection for an ad hoc network
US8782172B2 (en) Method of controlling mobile terminal, home hub, and visited hub in virtual group for content sharing
JP4911402B2 (en) Mobile radio communication system and communication control method thereof, mobile terminal, and program
EP2894812B1 (en) Method and apparatus for establishing a virtual interface for a set of mutual-listener devices
Cao et al. A geographic multicopy routing scheme for DTNs with heterogeneous mobility
WO2017214810A1 (en) Distributed network routing method and node
Aboud et al. Geographic interest forwarding in NDN-based wireless sensor networks
US20120155322A1 (en) Method And Apparatus For Network Node Discovery
US20140198770A1 (en) Node device, communication method, and storage medium
WO2018098745A1 (en) Communication method in distributed network, node, and system
US9980088B2 (en) Distributed geospatial communications system
Sakthipriya et al. A reliable communication scheme for VANET communication environments
JP4299343B2 (en) Information transmission method using path in communication system
WO2017214806A1 (en) Distributed network message returning method and node
KR101243244B1 (en) Routing apparatus and method for minimizing the energy consumption in ad-hoc network
KR101288101B1 (en) Method and mobile node for routing in mobile wireless network system
WO2017214817A1 (en) Distributed network message processing method and node
US9762680B2 (en) Node apparatus operating as proxy server
WO2017214802A1 (en) Distributed network message processing method and node
WO2017214803A1 (en) Distributed network message returning method and node
US20120163289A1 (en) Node apparatus, node management apparatus and method, and communication system based on continuous network connectivity-lacking network
WO2017214812A1 (en) Distributed network message transmission method and node

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16904936

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16904936

Country of ref document: EP

Kind code of ref document: A1