Method for establishing publishing and subscribing relationship based on reliable unicast protocol
By adopting a reliable unicast protocol method in the WAN environment to establish a star network topology, the problem of difficulty in establishing an anonymous public subscription network topology in the existing technology is solved, and the efficient operation of a distributed interactive system is achieved in the WAN.
Patent Information
- Application Number
- CN202411647477.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-14
AI Technical Summary
It is difficult for the prior art to establish a point-to-point anonymous public subscription network topology relationship in a wide area network environment, which affects certain system applications and promotions based on public subscription relationships.
Using a reliable unicast protocol method, by starting the node management component, node management backup component and node communication component, establishing a star network topology, completing registration operations and information sharing, establishing a publishing and subscription relationship, canceling interest publishing, exiting the network topology, closing components and stop listening.
In TCP and IP network environments, especially in network environments where routers are uncontrolled, network topology for anonymous publishing and subscription relationships can be established based on unicast reliable protocols such as TCP, supports the efficient operation of distributed interactive systems, and extends the application scope of distributed interactive systems.
Smart Images

Figure CN119629235A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer simulation, and more specifically, to a method for establishing a publish-subscribe relationship based on a reliable unicast protocol. Background Art
[0002] In recent years, with the rapid development of computer technology and the comprehensive coverage of the network, the message distribution system has entered the era of large-scale distributed computing. Many application scenarios in real life involve the distribution of messages, including sending and receiving. For example, in securities trading, users subscribe to stock quotes and view stock prices in real time. The system has put forward higher requirements for the security, integrity, timeliness and efficiency of information. In the publish-subscribe technology, subscribers express their interests in the form of subscriptions, and publishers send data content to the system, which can greatly facilitate the information interaction between the two parties and meet the needs of both parties. Different from the traditional point-to-point message sending method, in the publish-subscribe method, a message published by a publisher can be received by multiple subscribers at the same time, and a subscriber can also receive subscribed messages published by multiple publishers.
[0003] The message distribution system is the underlying system of many distributed interactive systems. The method of establishing anonymous publish-subscribe relationships is the core method of the message distribution system. Its method constraints and performance efficiency directly affect the message distribution system and the distributed interactive system. Through the anonymous publish-subscribe relationship establishment method, the message distribution system builds a one-to-one, one-to-many, many-to-one or many-to-many publish-subscribe network topology relationship in the network environment, supporting the distributed interactive system to complete information interaction.
[0004] The existing anonymous publish-subscribe relationship establishment method generally relies on multicast protocols or multicast environments, which requires the system administrator to deploy the current network environment so that all routing nodes in the current network support and enable multicast protocols. In a wide area network environment, it is difficult to ensure the above situation. Therefore, in a wide area network environment, it is difficult to establish a point-to-point anonymous publish-subscribe network topology relationship, which seriously affects the application and promotion of some systems based on publish-subscribe relationships. Summary of the invention
[0005] The object of the present invention is to provide a method for establishing a publish-subscribe relationship based on a reliable unicast protocol, so as to solve at least one of the problems existing in the prior art.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] The first aspect of the present invention provides a method for establishing a publish-subscribe relationship based on a reliable unicast protocol, comprising:
[0008] Start the node management component, node management backup component and each node communication component, and complete the corresponding memory and network monitoring;
[0009] Using the node communication components and the node management component or the node management backup component to establish a star network topology structure, and completing the registration operation of the node communication components and the information sharing between the node management component and the node management backup component;
[0010] Establishing a publish-subscribe relationship when the publisher in each node communication component runs first;
[0011] Establishing a publish-subscribe relationship when the subscriber in each node communication component is running first;
[0012] Using the publisher in each node communication component to cancel the interest publication;
[0013] Using subscribers in each node communication component to cancel interest publishing;
[0014] Using each of the description node communication components to exit the star network topology;
[0015] The node management component, the node management backup component and the node communication component are closed, and the corresponding memory and network monitoring are stopped.
[0016] Optionally, the starting of the node management component, the node management backup component and each node communication component, and completing the corresponding memory and network monitoring includes
[0017] Run the node management component and build a network channel and start network monitoring;
[0018] Run the node management backup component and build a network channel and start network monitoring;
[0019] Establishing a network link between the node management component and the node management backup component, and backing up and sharing the data of the node management component in the node management backup component;
[0020] Run the communication components of each node, build a network channel, and start network monitoring.
[0021] Optionally, the use of each node communication component and the node management component or the node management backup component to establish a star network topology structure, and completing the registration operation of each node communication component and the information sharing between the node management component and the node management backup component includes:
[0022] Establishing a network link between each node communication component and the node management component;
[0023] Using each of the node communication components to send a corresponding registration message to the node management component;
[0024] After the node management component receives the corresponding registration message, the node management component is used to add each node communication component to the current communication relationship group;
[0025] Backing up the corresponding registration message and the node management backup component using the node management component;
[0026] The node management component is used to send corresponding registration operation receipts to each node communication component.
[0027] Optionally, the establishing of a publish-subscribe relationship when the publisher in each node communication component is running preferentially includes:
[0028] adding the declared interest to a publication list of the first node communication component as a publisher;
[0029] Using the first node communication component to send a release declaration message to the node management component;
[0030] Receiving the release declaration message using the node management component;
[0031] Using the node management component to forward the release declaration message to the remaining node communication components according to the current communication relationship group;
[0032] Receiving the release announcement message using the remaining node communication components;
[0033] When the publish declaration message is not found in the subscription list of the remaining node communication components, there is no publish-subscribe relationship between the remaining node communication components and the first node communication component;
[0034] When the publish declaration message is found in the subscription list of the remaining node communication component, the remaining node communication component has a publish-subscribe relationship with the first node communication component, and the remaining node communication component is used to send a subscription declaration message with a specified purpose identifier to the node management component;
[0035] Utilizing the node management component to receive the subscription declaration message, and directionally forwarding the subscription declaration message according to the destination identifier;
[0036] Receiving the subscription declaration message using the first node communication component;
[0037] When the first node communication component finds the subscription declaration message in the publication list, establishing a network link between the first node communication component and the remaining node communication components, and adding the network link to the interest link list of the first node communication component;
[0038] The first node communication component is used to send content messages of different interests to the remaining node communication components according to the interest link list.
[0039] Optionally, the establishing of a publish-subscribe relationship when the subscriber in each node communication component is running with priority includes:
[0040] adding the declared interest to a subscription list of the second node communication component as a subscriber;
[0041] Using the second node communication component to send a subscription declaration message with an unspecified purpose to the node management component;
[0042] Receiving the subscription declaration message using the node management component;
[0043] Using the node management component to forward the subscription declaration message to the remaining node communication components according to the current communication relationship group;
[0044] Receiving the subscription declaration message using the remaining node communication components;
[0045] When the subscription declaration message is not found in the publication list of the remaining node communication components, there is no publish-subscribe relationship between the second node communication component and the remaining node communication components;
[0046] When the subscription declaration message is found in the publication list of the remaining node communication components, a network link is established between the second node communication component and the remaining node communication components, and the network link is added to the interest link list of the remaining node communication components;
[0047] The remaining node communication components are used to send content messages of different interests to the second node communication component according to the interest link list.
[0048] Optionally, the canceling of interest publishing by using the publisher in each node communication component includes:
[0049] Using the first node communication component to send a cancel publishing message to the remaining node communication components according to the interest link list;
[0050] removing the interest link list and disconnecting the interest links with the remaining node communication components using the first node communication component;
[0051] The publication list is removed using the first node communication component.
[0052] Optionally, the cancelling interest publication by using the subscribers in each node communication component comprises using the second node communication component to send a subscription cancellation message to the node management component;
[0053] forwarding the unsubscribe message to the remaining node communication components according to the current communication relationship group using the node management component;
[0054] Receiving the unsubscribe message using the remaining node communication components;
[0055] When no corresponding interest is found in the publication list of the remaining node communication components, no subsequent operation is performed;
[0056] When the corresponding interest is found in the publication list of the remaining node communication components, the corresponding link is found in the interest link list of the remaining node communication components and the link is removed;
[0057] The interest is removed from the subscription list using the second node communication component.
[0058] Optionally, the using each description node communication component to exit the star network topology structure includes:
[0059] Using each of the node communication components to send an exit message to the node management component;
[0060] Utilizing the node management component to receive the exit message, and removing each node communication component from the current communication relationship group;
[0061] Disconnect the network link between each node communication component and the node management component.
[0062] Optionally, shutting down the node management component, the node management backup component and the node communication component, and stopping the corresponding memory and network monitoring includes:
[0063] Turn off the network monitoring of each node communication component and stop running;
[0064] Disconnect the link between the node management component and the node management backup component, close the network monitoring of the node management component and stop running;
[0065] Close the network monitoring of the node management backup component and stop running.
[0066] Optionally, each of the node communication components includes at least two node communication components.
[0067] The beneficial effects of the present invention are as follows:
[0068] The technical solution described in the present invention is not subject to multicast conditions and can operate normally in TCP and IP network environments. In particular, in a network environment where routers are not controlled, it can establish a network topology with anonymous publish-subscribe relationships based on unicast reliable protocols such as TCP, lay the network communication foundation for the message distribution system, support the efficient operation of distributed interactive systems such as distributed joint simulation, solve the problem that the anonymous publish-subscribe relationship establishment method is difficult to apply in a wide area network, effectively expand the application scope of distributed interactive systems, and promote the application and promotion of distributed interactive systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] The specific implementation modes of the present invention are further described in detail below in conjunction with the accompanying drawings.
[0070] Figure 1 A schematic diagram of a star network topology structure in a method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided in an embodiment of the present invention is shown.
[0071] Figure 2 A schematic diagram of a decentralized mesh network topology structure in a method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided in an embodiment of the present invention is shown.
[0072] Figure 3 A schematic diagram of the interaction process in the initialization phase of the method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided by an embodiment of the present invention is shown.
[0073] Figure 4 A schematic diagram of the interaction process in the registration phase of the method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided by an embodiment of the present invention is shown.
[0074] Figure 5 A schematic diagram of the interaction process of the declaration publishing and message interaction phases in the method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided by an embodiment of the present invention is shown.
[0075] Figure 6 A schematic diagram of the interaction process of the declaration subscription and message interaction phases in the method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided by an embodiment of the present invention is shown.
[0076] Figure 7 A schematic diagram of the interaction process in the cancel publication phase in the method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided by an embodiment of the present invention is shown.
[0077] Figure 8 A schematic diagram of the interaction process in the unsubscribe phase of the method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided by an embodiment of the present invention is shown.
[0078] Fig. 9A schematic diagram of the interaction process in the exit phase of the method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided by an embodiment of the present invention is shown.
[0079] Fig.10 A schematic diagram of the interaction process in the decomposition phase of the method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided by an embodiment of the present invention is shown.
[0080] Fig.11 A schematic flow chart of a method for establishing a publish-subscribe relationship based on a reliable unicast protocol provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0081] In order to explain the present invention more clearly, the present invention is further described below in conjunction with embodiments and drawings. Similar components in the drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and the protection scope of the present invention should not be limited thereto.
[0082] The existing anonymous publish-subscribe relationship establishment method generally relies on multicast protocols or multicast environments, which requires the system administrator to deploy the current network environment so that all routing nodes in the current network support and enable multicast protocols. In a wide area network environment, it is difficult to ensure the above situation. Therefore, in a wide area network environment, it is difficult to establish a point-to-point anonymous publish-subscribe network topology relationship, which seriously affects the application and promotion of some systems based on publish-subscribe relationships.
[0083] In view of this, if Fig.11 As shown, an embodiment of the present invention provides a method for establishing a publish-subscribe relationship based on a reliable unicast protocol, including: starting a node management component, a node management backup component and each node communication component, and completing corresponding memory and network monitoring; using the each node communication component to establish a star network topology with the node management component or the node management backup component, and completing the registration operation of each node communication component and the information sharing between the node management component and the node management backup component; establishing a publish-subscribe relationship when the publisher in each node communication component runs first; establishing a publish-subscribe relationship when the subscriber in each node communication component runs first; using the publisher in each node communication component to cancel interest publishing; using the subscriber in each node communication component to cancel interest publishing; using the each description node communication component to exit the star network topology; closing the node management component, the node management backup component and the node communication component, and stopping the corresponding memory and network monitoring.
[0084] In a specific example, the method includes three types of components, namely, node management component A, node management backup component B, and node communication component C. When the method is effective, at least one node management component A and two or more node communication components C are required, and node management backup component B is a non-essential component.
[0085] In a specific example, the method includes 8 stages, wherein Figure 3 The initialization phase is shown; Figure 4 The registration phase is shown; Figure 5 The following are the stages of statement release and message interaction; Figure 6 The following is the phase of declaring subscription and message interaction; Figure 7 The unpublishing phase is shown; Figure 8 The unsubscribe phase is shown; Fig. 9 The exit stage is shown; Fig.10 Shown is the destruction phase.
[0086] Furthermore, the eight stages are generally carried out according to the above process, but the declaration release and message interaction stage and the declaration subscription and message interaction stage can be interchanged in order or repeated multiple times; the unsubscription stage and the exit stage can be interchanged in order or repeated multiple times; the declaration release and message interaction stage corresponds to the unpublishing stage, and the number of times matches; the declaration subscription and message interaction stage corresponds to the unsubscription stage, and the number of times matches.
[0087] In a specific example, the method involves seven messages, namely, a registration message (REGISTER); a publish declaration message (PUBLISH DECLARATION); a subscription declaration message (SUBSCRIBE DECLARATION); a content message (MESSAGE); a publish cancellation message (PUBLISH CANCEL); a subscription cancellation message (SUBSCRIBE CANCEL); and a quit message (RESIGN).
[0088] In a specific example, the node management component has the following functions: the node management component serves as a central node of a star network topology, such as Figure 1 As shown, it forms an interconnection structure with other node communication components; receiving the registration message of the node communication component, such as Figure 4 As shown, the node communication component is added to the current communication relationship group; the exit message of the node communication component is received, such as Fig.10 As shown, the node communication component is removed from the current communication relationship group; the release declaration message of the node communication component is received, such as Figure 5 As shown, and can be forwarded to other node communication components of the current communication relationship group; receiving the subscription declaration message of the node communication component, such as Figure 5-Figure 6As shown, and can be forwarded to other node communication components of the current communication relationship group according to the identification indication; receiving the unsubscribe message of the node communication component, such as Fig. 9 As shown, it can be forwarded to other node communication components of the current communication relationship group; share information with the node management backup component, and back up the managed node communication component information with the node management backup component.
[0089] In a specific example, the node management backup component has the following functions: sharing information with the node management component and backing up the node communication component information managed by the node management component; when the node management component fails, the node management backup component acts as the central node of the star network topology and together with other node communication components forms an interconnection structure; when the node management component fails, it receives the registration message of the node communication component and adds the node communication component to the current communication relationship group; when the node management component fails, it receives the exit message of the node communication component and removes the node communication component from the current communication relationship group; when the node management component fails, it receives the release declaration message of the node communication component and is able to forward it to other node communication components in the current communication relationship group; when the node management component fails, it receives the subscription declaration message of the node communication component and is able to forward it to other node communication components in the current communication relationship group according to the identification indication; when the node management component fails, it receives the unsubscribe message of the node communication component and is able to forward it to other node communication components in the current communication relationship group.
[0090] In a specific example, the node communication component has the following functions: the node communication component acts as a leaf node of a star network topology, such as Figure 2 As shown, it forms an interconnection structure together with other node management components and node communication components; sending registration messages, such as Figure 4 As shown, the node communication component is added to the current communication relationship group managed by the node management component; an exit message is sent, such as Fig.10 As shown, the node communication component is removed from the current communication relationship group managed by the node management component; a release declaration message is sent, such as Figure 5 As shown, and add the interest to the release list; process the release announcement message, such as Figure 5 As shown, it is possible to determine the interest matching situation according to the information content, and when the interest matches, it is possible to send a targeted subscription declaration message; sending a subscription declaration message, such as Figure 5-Figure 6 As shown, and add the interest to the subscription list; process the subscription declaration message, such as Figure 5-Figure 6 As shown, it is possible to determine the interest matching situation based on the information content, and when the interest matches, it is possible to subscribe to the declaration message, such as Figure 5-Figure 6As shown, the related node communication components establish point-to-point links, and the links are added to the interest link list; according to the interest link list, a decentralized mesh network topology is established between the node communication components, such as Figure 2 As shown; send targeted content messages based on the interest link list, such as Figure 5-Figure 6 As shown; receiving content messages, such as Figure 5-Figure 6 Send an unsubscribe message, such as Fig. 9 As shown, disconnect the link and remove the interest from the subscription list; process the unsubscribe message, such as Fig. 9 As shown, the relevant link is removed from the interest link list; a cancel release message is sent, such as Figure 7 As shown, the related link is removed from the interest link list, the link is disconnected, and the interest is removed from the release list.
[0091] In a specific example, Figure 4 As shown, the registration message is used to describe the behavior of the node communication component logging in and joining the current communication relationship group. The registration message includes at least the following elements: message type; source node identifier.
[0092] In a specific example, Figure 5 As shown, the release declaration message is used to describe the interest publishing behavior of the node communication component, indicating that the node communication component will send this type of content message. The release declaration message includes at least the following elements: message type; source node identifier; interest type identifier.
[0093] In a specific example, Figure 5-Figure 6 As shown, the subscription declaration message is used to describe the subscription interest behavior of the node communication component, indicating that the node communication component will receive content messages of this type. The subscription declaration message includes at least the following elements: message type; source node identifier; destination node identifier; source address information; interest type identifier.
[0094] In a specific example, Figure 5-Figure 6 As shown, the content message is used to describe the service content message of the interest type between node communication components, and includes at least the following elements: message type; source node identifier; service content.
[0095] In a specific example, Figure 7 As shown, the unpublish message is used to describe the subscription interest behavior of the node communication component, indicating that the node communication component no longer sends content messages of this type. The unpublish message includes at least the following elements: message type; source node identifier; interest type identifier.
[0096] In a specific example, Fig. 9As shown, the unsubscribe message is used to describe the subscription interest behavior of the node communication component, indicating that the node communication component no longer receives content messages of this type. The unsubscribe message includes at least the following elements: message type; source node identifier; interest type identifier.
[0097] In a specific example, Fig.10 As shown, the exit message is used to describe the logout of the node communication component and the removal of the current communication relationship group behavior. The exit message includes at least the following elements: message type; source node identifier.
[0098] This embodiment is not subject to multicast conditions and can operate normally in TCP and IP network environments. In particular, in a network environment where routers are not controlled, it can establish a network topology with anonymous publish-subscribe relationships based on unicast reliable protocols such as TCP, lay the network communication foundation for the message distribution system, and support the efficient operation of distributed interactive systems such as distributed joint simulation. It solves the problem that the anonymous publish-subscribe relationship establishment method is difficult to apply in a wide area network, effectively expands the application scope of distributed interactive systems, and promotes the application and promotion of distributed interactive systems.
[0099] In a possible implementation, starting the node management component, the node management backup component and each node communication component, and completing the corresponding memory and network monitoring includes: running the node management component and building a network channel and starting network monitoring; running the node management backup component and building a network channel and starting network monitoring; establishing a network link between the node management component and the node management backup component, and backing up and sharing the data of the node management component in the node management backup component; running the each node communication component and building a network channel and starting network monitoring.
[0100] In a specific example, Figure 3 As shown, the initial stage is used to start the node management component A, the node management backup component B, and the node communication component C. The node communication component C includes the node communication component C1, the node communication component C2, and the node communication component C3, and completes the initialization work of related memory, network monitoring, etc. This stage generally includes the following steps: the node management component A starts running, builds a network channel, and starts network monitoring; the node management backup component B starts running, builds a network channel, and starts network monitoring; the node management component A establishes a network connection with the node management backup component B, and starts the node management component A data backup service, preparing to backup and share the data of the node management component A in the node management backup component B; the node communication component C starts running, builds a network channel, and starts network monitoring.
[0101] In a possible implementation, the use of the various node communication components and the node management component or the node management backup component to establish a star network topology structure and complete the registration operation of the various node communication components and the information sharing between the node management component and the node management backup component includes: establishing a network link between the various node communication components and the node management component; using the various node communication components to send corresponding registration messages to the node management component; after the node management component receives the corresponding registration message, using the node management component to add the various node communication components to the current communication relationship group; using the node management component to back up the corresponding registration message and the node management backup component; using the node management component to send corresponding registration operation receipts to the various node communication components.
[0102] In a specific example, Figure 4 As shown, the registration phase is used for each node communication component C to establish a node management component A or node management backup component B. Figure 1 The star network topology shown in the figure is formed, and the registration operation of each node communication component C is completed, and the information sharing between the node management component A and the node management backup component B is completed. This stage generally includes the following steps: the node communication component C establishes a link with the predetermined node management component A; after the link is successfully established, the node communication component C sends a registration message to the node management component A; the node management component A receives the registration message and adds the node communication component C to the current communication relationship group; the node management component A backs up the relevant content with the node management backup component B; the node management component A sends a registration operation receipt to the node communication component C, indicating whether the registration is successful.
[0103] In one possible implementation, the establishment of a publish-subscribe relationship when the publisher in each node communication component is prioritized for operation includes: adding the declared interest to the publication list of the first node communication component as the publisher; using the first node communication component to send a publish declaration message to the node management component; using the node management component to receive the publish declaration message; using the node management component to forward the publish declaration message to the remaining node communication components according to the current communication relationship group; using the remaining node communication components to receive the publish declaration message; when the publish declaration message is not found in the subscription list of the remaining node communication components, there is no publish-subscribe relationship between the remaining node communication components and the first node communication component; when the publish declaration message is found in the subscription list of the remaining node communication components When a message is received, a publish-subscribe relationship exists between the remaining node communication components and the first node communication component, and the remaining node communication components are used to send a subscription declaration message with a specified purpose identifier to the node management component; the node management component is used to receive the subscription declaration message, and the subscription declaration message is directionally forwarded according to the purpose identifier; the first node communication component is used to receive the subscription declaration message; when the first node communication component finds the subscription declaration message in the publication list, a network link is established between the first node communication component and the remaining node communication components, and the network link is added to the interest link list of the first node communication component; the first node communication component is used to send content messages of different interests to the remaining node communication components according to the interest link list.
[0104] In a specific example, Figure 5As shown, the declaration release and message interaction phase is used to describe the process of establishing a publish-subscribe relationship when the publisher runs first. This phase generally includes the following steps: adding the declared interest to the local node communication component C publishing list; the local node communication component C sends a publish declaration message to the node management component A; the node management component A receives the publish declaration message; the node management component A forwards the publish declaration message to all other node communication components C according to the current communication relationship group; other node communication components receive the publish declaration message; if other node communication components C do not find the interest specified by the publish declaration message in their local subscription list, it is determined that there is no publish-subscribe relationship between the two node communication components C, and no subsequent operations are performed; if other node communication components C find the interest specified by the publish declaration message in their local subscription list, it is determined that the two node communication components C have no publish-subscribe relationship, and no subsequent operations are performed; if other node communication components C find the interest specified by the publish declaration message in their local subscription list, it is determined that the two node communication components C have no publish-subscribe relationship, and no subsequent operations are performed. There is a publish-subscribe relationship between the node communication components C, and a subscription declaration message with a specified destination identifier is sent to the node management component A; the node management component A receives the subscription declaration message and forwards the subscription declaration message according to the destination identifier; the local node communication component C receives the subscription declaration message; the local node communication component C finds the interest specified by the subscription declaration message in its local publication list, then initiates a point-to-point network link between the two node communication components C according to the source address of the node communication component C specified in the subscription declaration message, and adds the network link to the local interest link list; the local node communication component C sends content messages in content messages of different interests to the corresponding node communication components according to the local interest link list.
[0105] In a possible implementation, the establishment of a publish-subscribe relationship when the subscriber in each node communication component is prioritized for operation includes: adding the declared interest to the subscription list of the second node communication component as the subscriber; using the second node communication component to send a subscription declaration message with an unspecified purpose to the node management component; using the node management component to receive the subscription declaration message; using the node management component to forward the subscription declaration message to the remaining node communication components according to the current communication relationship group; using the remaining node communication components to receive the subscription declaration message; when the subscription declaration message is not found in the publication list of the remaining node communication components, there is no publish-subscribe relationship between the second node communication component and the remaining node communication components; when the subscription declaration message is found in the publication list of the remaining node communication components, a network link is established between the second node communication component and the remaining node communication components, and the network link is added to the interest link list of the remaining node communication components; using the remaining node communication components to send content messages of different interests to the second node communication component according to the interest link list.
[0106] In a specific example, Figure 6As shown, the declaration subscription and message interaction phase is used to describe the process of establishing a publish-subscribe relationship when the subscriber runs first. This phase generally includes the following steps: adding the declared interest to the local node communication component C subscription list; the local node communication component C sends a subscription declaration message with an unspecified purpose to the node management component A; the node management component A receives the subscription declaration message with an unspecified purpose; the node management component A forwards the subscription declaration message to all other node communication components C according to the current communication relationship group; other node communication components C receive the subscription declaration message; if other node communication components C do not find the interest specified in the subscription declaration message in their local publication list, it is determined that there is no publish-subscribe relationship between the two node communication components C, and no subsequent operation; if other node communication components C find the interest specified in the subscription declaration message in their local publication list, a point-to-point network link between the two node communication components C is initiated according to the node communication component C source address specified in the subscription declaration message, and the network link is added to the local interest link list; the local node communication component C can receive the content message of the relevant interest sent by the publisher.
[0107] In one possible implementation, the use of publishers in each of the node communication components to cancel interest publication includes: using the first node communication component to send a cancel publication message to the remaining node communication components according to the interest link list; using the first node communication component to remove the interest link list and disconnect the interest link with the remaining node communication components; and using the first node communication component to remove the publication list.
[0108] In a specific example, Figure 7 As shown, the cancel publishing phase is used to describe the process of the publisher canceling the interest publishing. This phase generally includes the following steps: the node communication component C sends a cancel publishing message according to the interest link list; the node communication component C removes the interest link and disconnects the interest link; the node communication component C removes the interest from the publishing list.
[0109] In one possible implementation, the use of subscribers in each node communication component to cancel interest publication includes: using the second node communication component to send a cancellation message to the node management component; using the node management component to forward the cancellation message to the remaining node communication components according to the current communication relationship group; using the remaining node communication components to receive the cancellation message; when the corresponding interest is not found in the publication list of the remaining node communication components, no subsequent operation; when the corresponding interest is found in the publication list of the remaining node communication components, the corresponding link is found in the interest link list of the remaining node communication components and the link is removed; using the second node communication component to remove the interest from the subscription list.
[0110] In a specific example, Figure 8 As shown, the unsubscribe phase is used to describe the process of the subscriber cancelling the interest publication. This phase generally includes the following steps: the node communication component C sends an unsubscribe message to the node management component A; the node management component A forwards the unsubscribe message to all other node communication components C according to the current communication relationship group; other node communication components C receive the unsubscribe message; if other node communication components C do not find relevant interests in their local publication lists, there is no subsequent operation; if other node communication components C find relevant interests in their local publication lists, they find the associated links in the interest link table, remove and disconnect the links; the node communication component C removes the interest from the subscription list.
[0111] In one possible implementation, the use of the various node communication components to exit the star network topology structure includes: using the various node communication components to send an exit message to the node management component; using the node management component to receive the exit message and remove the various node communication components from the current communication relationship group; and disconnecting the network link between the various node communication components and the node management component.
[0112] In a specific example, Fig. 9 As shown, the exit phase is used to describe the process in which the node communication component C exits the node management component A or the node management backup component B to establish a star network topology structure, such as Figure 2 This stage generally includes the following steps: the node communication component C sends a withdrawal message to the node management component A; the node management component C receives the withdrawal message and removes the node communication component C from the current communication relationship group; the node communication component C disconnects the link with the node management component A.
[0113] In one possible implementation, shutting down the node management component, the node management backup component and the node communication component, and stopping the corresponding memory and network monitoring includes: shutting down the network monitoring of each node communication component and stopping operation; disconnecting the link between the node management component and the node management backup component, shutting down the network monitoring of the node management component and stopping operation; shutting down the network monitoring of the node management backup component and stopping operation.
[0114] In a specific example, Fig.10As shown, the destruction phase is the final phase of the process described by this method, which is used to terminate the node management component A, the node management backup component B, and the node communication component C, and complete the destruction and stop work of related memory, network monitoring, etc. This phase generally includes the following steps: the node communication component C shuts down the network monitoring and stops running; the node management component A disconnects from the node management backup component B, shuts down the network monitoring, and stops running; the node management backup component B shuts down the network monitoring and stops running.
[0115] In the description of the present invention, it should be noted that the terms "upper", "lower", etc. indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific position, be constructed and operated in a specific position, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0116] It should also be noted that, in the description of the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0117] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the embodiments here. All obvious changes or modifications derived from the technical solution of the present invention are still within the protection scope of the present invention.
Claims
1. A method for establishing a publish-subscribe relationship based on a reliable unicast protocol, characterized in that: Including starting the node management component, node management backup component and each node communication component, and completing the corresponding memory and network monitoring; Using each node communication component and the node management component or the node management backup component to establish a star network topology structure, and completing the registration operation of each node communication component and the information sharing between the node management component and the node management backup component; Establishing a publish-subscribe relationship when the publisher in each node communication component runs first; Establishing a publish-subscribe relationship when the subscriber in each node communication component is running first; Using the publisher in each node communication component to cancel the interest publication; Using subscribers in each node communication component to cancel interest publishing; Using each of the description node communication components to exit the star network topology; The node management component, the node management backup component and the node communication component are closed, and the corresponding memory and network monitoring are stopped.
2. The method for establishing a publish-subscribe relationship based on a reliable unicast protocol according to claim 1, characterized in that: The node management component, node management backup component and each node communication component are started, and the corresponding memory and network monitoring are completed. Run the node management component and build a network channel and start network monitoring; Run the node management backup component and build a network channel and start network monitoring; Establishing a network link between the node management component and the node management backup component, and backing up and sharing the data of the node management component in the node management backup component; Run the communication components of each node, build a network channel, and start network monitoring.
3. The method for establishing a publish-subscribe relationship based on a reliable unicast protocol according to claim 2, characterized in that: The use of each node communication component and the node management component or the node management backup component to establish a star network topology structure, and completing the registration operation of each node communication component and the information sharing between the node management component and the node management backup component includes: Establishing a network link between each node communication component and the node management component; Using each of the node communication components to send a corresponding registration message to the node management component; After the node management component receives the corresponding registration message, the node management component is used to add each node communication component to the current communication relationship group; Backing up the corresponding registration message and the node management backup component using the node management component; The node management component is used to send corresponding registration operation receipts to each node communication component.
4. The method for establishing a publish-subscribe relationship based on a reliable unicast protocol according to claim 3, characterized in that: The establishing of the publish-subscribe relationship when the publisher in each node communication component is running preferentially includes: adding the declared interest to a publication list of the first node communication component as a publisher; Using the first node communication component to send a release declaration message to the node management component; Receiving the release declaration message using the node management component; Using the node management component to forward the release declaration message to the remaining node communication components according to the current communication relationship group; Receiving the release announcement message using the remaining node communication components; When the publish declaration message is not found in the subscription list of the remaining node communication components, there is no publish-subscribe relationship between the remaining node communication components and the first node communication component; When the publish declaration message is found in the subscription list of the remaining node communication component, the remaining node communication component has a publish-subscribe relationship with the first node communication component, and the remaining node communication component is used to send a subscription declaration message with a specified purpose identifier to the node management component; Utilizing the node management component to receive the subscription declaration message, and directionally forwarding the subscription declaration message according to the destination identifier; Receiving the subscription declaration message using the first node communication component; When the first node communication component finds the subscription declaration message in the publication list, establishing a network link between the first node communication component and the remaining node communication components, and adding the network link to the interest link list of the first node communication component; The first node communication component is used to send content messages of different interests to the remaining node communication components according to the interest link list.
5. The method for establishing a publish-subscribe relationship based on a reliable unicast protocol according to claim 4, characterized in that: The establishing of the publish-subscribe relationship when the subscriber in each node communication component is running preferentially includes: adding the declared interest to a subscription list of the second node communication component as a subscriber; Using the second node communication component to send a subscription declaration message with an unspecified purpose to the node management component; Receiving the subscription declaration message using the node management component; Using the node management component to forward the subscription declaration message to the remaining node communication components according to the current communication relationship group; Receiving the subscription declaration message using the remaining node communication components; When the subscription declaration message is not found in the publication list of the remaining node communication components, there is no publish-subscribe relationship between the second node communication component and the remaining node communication components; When the subscription declaration message is found in the publication list of the remaining node communication components, a network link is established between the second node communication component and the remaining node communication components, and the network link is added to the interest link list of the remaining node communication components; The remaining node communication components are used to send content messages of different interests to the second node communication component according to the interest link list.
6. The method for establishing a publish-subscribe relationship based on a reliable unicast protocol according to claim 5, characterized in that: The canceling of interest publishing by using publishers in each node communication component includes: Using the first node communication component to send a cancel publishing message to the remaining node communication components according to the interest link list; removing the interest link list and disconnecting the interest links with the remaining node communication components using the first node communication component; The publication list is removed using the first node communication component.
7. The method for establishing a publish-subscribe relationship based on a reliable unicast protocol according to claim 6, characterized in that: The canceling of interest publication by using subscribers in each node communication component includes: Using the second node communication component to send a subscription cancellation message to the node management component; forwarding the unsubscribe message to the remaining node communication components according to the current communication relationship group using the node management component; Receiving the unsubscribe message using the remaining node communication components; When no corresponding interest is found in the publication list of the remaining node communication components, no subsequent operation is performed; When the corresponding interest is found in the publication list of the remaining node communication components, the corresponding link is found in the interest link list of the remaining node communication components and the link is removed; The interest is removed from the subscription list using the second node communication component.
8. The method for establishing a publish-subscribe relationship based on a reliable unicast protocol according to claim 7, characterized in that: The step of using each of the description node communication components to exit the star network topology structure includes: Using each of the node communication components to send an exit message to the node management component; Utilizing the node management component to receive the exit message, and removing each node communication component from the current communication relationship group; Disconnect the network link between each node communication component and the node management component.
9. The method for establishing a publish-subscribe relationship based on a reliable unicast protocol according to claim 8, characterized in that: The shutting down of the node management component, the node management backup component and the node communication component, and stopping the corresponding memory and network monitoring includes Close the network monitoring of each node communication component and stop running; Disconnect the link between the node management component and the node management backup component, close the network monitoring of the node management component and stop running; Close the network monitoring of the node management backup component and stop running.
10. The method for establishing a publish-subscribe relationship based on a reliable unicast protocol according to claim 1, characterized in that: Each of the node communication components includes at least two node communication components.