A lightweight topic-centric discovery mechanism in DDS
By using a topic-centric discovery mechanism in the DDS middleware, the entity matching process in the DDS discovery flow is reduced, the complexity and computational resource consumption of the discovery phase are optimized, and the protocol is made lightweight and flexible.
Patent Information
- Application Number
- CN202511150152.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-08-18
AI Technical Summary
The existing DDS middleware discovery process suffers from data redundancy and wasted computing resources, especially in the matching, data integration and information storage processes among multiple entities, which leads to high complexity and excessive resource consumption in the discovery phase.
The lightweight DDS adopts a topic-centric discovery mechanism, which establishes topic and QoS management relationships by multicasting SPDP messages by local participants and unicasting responses by remote participants, thereby reducing the entity matching process and using topic and QoS policies for data interaction.
It reduces the data integration and information storage process, lowers computing resource consumption, eliminates redundant data, optimizes the duration and complexity of the discovery phase, and achieves a lightweight and flexible protocol.
Smart Images

Figure CN120639852B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a DDS middleware discovery process, in particular to a lightweight DDS topic-centered discovery mechanism. BACKGROUND
[0002] The DDS (Data Distribution Service) middleware completes the establishment of the connection between the service publisher and the service subscriber and the interaction of data through the publication and subscription of services. The publisher advertises the services supported by itself in the network, and the subscriber obtains the publisher corresponding to the required service from the network and requests and uses the service to the publisher. Before the data interaction between the publisher and the subscriber, the discovery process between them needs to be completed, the registration of each other in the opposite end is completed, the communication channel is established, and the data interaction is realized.
[0003] The current discovery stage implementation includes the participation of multiple entities, specifically, the participant entity is taken as a carrier, the data writer entity and the data reader entity are taken as operation bodies to realize the real discovery process, complete the interaction between the final data writer and the data reader, not only including the discovery between the participants, but also including the matching, data integration, information saving and other work between each remote data reader and each local data writer, and also including the matching, data integration, information saving and other work between each remote data writer and each local data reader, and the establishment of the connection relationship of these entities depends on the matching of the topic and the QoS (Quality of Service), in other words, in the discovery process, multiple entities with the same topic and QoS rule will appear multiple repeated data integration, information saving and other work according to the number complexity of the local and remote entities, not only causing the redundancy of data, but also greatly wasting the computing resources and space resources. SUMMARY
[0004] In order to solve the problems in the prior art, the purpose of the present application is to provide a lightweight DDS topic-centered discovery mechanism.
[0005] In order to achieve the purpose of the present application, the technical scheme adopted by the present application is:
[0006] A lightweight DDS topic-centered discovery mechanism, comprising the steps of:
[0007] (1) The local participant sends a SPDP message to the network periodically, and the remote participant sends a unicast SPDP message in reply to the SPDP message of the local participant;
[0008] (2) The local participant notifies the local data writer and the local data reader to the remote participant, and the remote participant notifies the remote data writer and the remote data reader to the local participant;
[0009] When the local writer is created, the subject and the QoS management relationship are created, and the local writer is managed according to the subject and the QoS policy; when the local reader is created, the subject and the QoS management relationship are created, and the local reader is managed according to the subject and the QoS policy;
[0010] (3) After the local participant receives the data writer and the data reader notified by the remote participant, the matching between the local data reader and the remote data writer and the matching between the local data writer and the remote data reader are started;
[0011] (4) After the matching between the local writer and the remote reader and the matching between the local reader and the remote writer are completed, the discovery stage is completed, and the data interaction is performed between the two parties.
[0012] Further, in step (1), the built-in data writer in the local participant entity sends a SPDP message to the multicast domain; after receiving the SPDP message, the remote participant replies to the SPDP message through its built-in data reader.
[0013] Further, in step (2), it specifically includes:
[0014] The data writer of the built-in publisher and the data writer of the built-in subscriber in the local participant entity send a heartbeat message to the specified remote participant to notify the creation of the local data writer and the local data reader;
[0015] The data reader of the built-in publisher and the data reader of the built-in subscriber in the remote participant entity receive the heartbeat message and reply to the confirmation message to request the local participant to synchronize the information of the data writer and the data reader;
[0016] The data writer of the built-in publisher and the data writer of the built-in subscriber in the participant entity send a data message containing the data writer information and a data message containing the data reader information to the specified remote participant, and send the heartbeat message again.
[0017] Further, in step (3), the data reader of the built-in publisher and the data reader of the built-in subscriber in the remote participant entity receive the message, match the local data reader and the data writer, and reply to the confirmation message to notify the information receiving status of the data writer and the data reader.
[0018] Further, the data matching process includes:
[0019] When the local writer matches the remote reader, the corresponding topic and QoS policy combination is searched according to the topic and QoS policy of the remote reader; if the local has the combination, the corresponding remote reader is managed under the combination; if the local does not have the combination, the corresponding combination is created to manage the remote reader.
[0020] When the local reader matches the remote writer, the corresponding topic and QoS policy combination is searched according to the topic and QoS policy of the remote writer; if the local has the combination, the corresponding remote writer is managed under the combination; if the local does not have the combination, the corresponding combination is created to manage the remote writer.
[0021] Further, in step (4), the data interaction process includes:
[0022] In the process of sending data from the local writer to the remote reader, the local writer is positioned to the corresponding topic and QoS policy combination according to the topic and QoS policy; the matched remote reader is found from the management structure of the topic and QoS policy combination; and the data is sent to the remote reader by traversing the found remote reader.
[0023] In the process of sending data from the remote writer to the local reader, the local reader data space of the remote writer is searched according to the identification information of the remote writer; the local reader data space of the remote writer is searched according to the topic and QoS policy; the matched local reader is found from the management structure of the topic and QoS policy combination; and the data of the remote writer is written into the historical data cache area of the local reader by traversing the local reader.
[0024] Further, after the user data organization is completed, the data sending function of the data writer is called through the DCPS user interface; the remote data reader matched with the data writer is found through the associated topic and QoS policy of the data writer; the address information of the remote data reader is added in the data message; and the data is sent to the remote data reader through the transmission layer.
[0025] After the data reaches the destination host, the local remote data writer is found according to the source address information in the message; the remote data writer finds the local data reader matched therewith through the associated topic and QoS strategy; the local data reader writes the data into the cache; the user can acquire the data received by the data reader in real time through the registered data available callback or the data reader receiving data callback, or read the data in the data reader cache through the timing reading operation.
[0026] A DDS middleware entity comprises a local participant and a remote participant; the local participant comprises a publisher and a subscriber, and a plurality of different topics are created in the local participant, and a writer and / or a reader are associated under each topic according to a QoS strategy; the remote participant comprises a reader and a writer; a remote writer and / or a remote reader are associated under a local topic according to a QoS strategy;
[0027] A corresponding matching relationship is established between the local writer and the remote reader matched therewith through the associated topic and QoS strategy; a corresponding matching relationship is established between the local reader and the remote writer matched therewith through the associated topic and QoS strategy.
[0028] The DDS discovery mechanism with topic as the center according to the application has the advantages that: the discovery process is completed through the topic and the QoS, the matching process between the reader and the writer is omitted; the matching process between entities of different topics is cancelled, and the discovery time is shortened; the local reader and the writer are isolated from the remote writer and the reader, and the existence of the opposite end does not need to be concerned in the matching process; in the disconnection process, the corresponding local and remote entities do not need to be perceived, and only the operation in the topic and the QoS combination is needed; the data of the remote entity is more stored in the self space, and does not need to be redundantly stored and managed.
[0029] The DDS discovery mechanism with topic as the center according to the application has the advantages that: the discovery process is completed through the topic and the QoS, the matching process between the reader and the writer is omitted; the matching process between entities of different topics is cancelled, and the discovery time is shortened; the local reader and the writer are isolated from the remote writer and the reader, and the existence of the opposite end does not need to be concerned in the matching process; in the disconnection process, the corresponding local and remote entities do not need to be perceived, and only the operation in the topic and the QoS combination is needed; the data of the remote entity is more stored in the self space, and does not need to be redundantly stored and managed.
[0030] The topic-centered discovery mechanism of the lightweight DDS is used for decoupling the local data writer and the data reader from the remote data reader and the data writer, managing the local and remote entities in a topic-centered manner, reducing the discovery process of the DDS, reducing the entity matching process in the discovery process of the DDS, improving the efficiency of the discovery process, reducing the occupation of the computing capacity of the device, and making the implementation of the protocol lightweight and simple. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is a schematic diagram of the entity relationship of the DDS middleware;
[0032] Figure 2 is a schematic diagram of the discovery process of the DDS middleware;
[0033] Figure 3 is a schematic diagram of the data interaction process;
[0034] Figure 4 is a schematic diagram of the data matching specific embodiment. DETAILED DESCRIPTION
[0035] The technical solutions of the present application will be further described below in combination with the drawings and embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the protection scope of the present application.
[0036] As shown in Figure 1 , the entity relationship of the DDS middleware of the present application includes a local participant and a remote participant; the local participant includes a publisher and a subscriber, and multiple different topics can be created in the local participant, and a writer and / or a reader are associated under each topic according to a QoS policy; the remote participant includes a reader and a writer; a remote writer and / or a remote reader are associated under the local topic according to a QoS policy; a corresponding matching relationship is established between the local writer and the matching remote reader through the associated topic and QoS policy; a corresponding matching relationship is established between the local reader and the matching remote writer through the associated topic and QoS policy.
[0037] The topic-centered discovery mechanism of the lightweight DDS includes the following steps:
[0038] (1) The local participant periodically multicasts an SPDP message in the network, and the remote participant replies to the unicast SPDP message after receiving the SPDP message of the local participant;
[0039] Specifically, the built-in broadcast entity (built-in data writer) in the local participant entity sends the SPDP message into the multicast domain; the remote participant receives the SPDP message and replies to it through its own built-in broadcast entity, thus completing the mutual discovery between the two participants.
[0040] (2) The local participant notifies the remote participant of the local data writer and the local data reader; the remote participant notifies the local participant of the remote data writer and the remote data reader.
[0041] As shown in FIG. 1, the discovery process of the DDS middleware includes: Figure 2
[0042] The publisher broadcast entity (built-in data writer of the publisher) and the subscriber broadcast entity (built-in data writer of the subscriber) in the local participant entity send the Heartbeat message to the specified remote participant, notifying the creation of the local data writer and the local data reader.
[0043] The publisher detection entity (built-in data reader of the publisher) and the subscriber detection entity (built-in data reader of the subscriber) in the remote participant entity receive the Heartbeat message and reply with the Acknack message, requesting the local participant to synchronize the information of the data writer and the data reader.
[0044] The publisher broadcast entity (built-in data writer of the publisher), the subscriber broadcast entity (built-in data writer of the subscriber) and the participant message broadcast entity (built-in data writer of the message) in the participant entity send the data message (data(w)) containing the data writer information and the data message (data(r)) containing the data reader information to the specified remote participant, and send the Heartbeat message of the three entities again.
[0045] (3) After receiving the data writer and the data reader notified by the remote participant, the local participant starts matching between the local data reader and the remote data writer, and between the local data writer and the remote data reader.
[0046] The publisher detection entity (built-in data reader of the publisher) and the subscriber detection entity (built-in data reader of the subscriber) in the remote participant entity receive the message, match it with the local data reader and the data writer, and reply with the Acknack message, notifying the information receiving situation of the data writer and the data reader.
[0047] The data matching process includes:
[0048] The local writer creates a topic and a QoS management relationship when created, and manages the local writer according to the topic and the QoS policy; the local reader creates a topic and a QoS management relationship when created, and manages the local reader according to the topic and the QoS policy;
[0049] When the local writer matches the remote reader, the corresponding topic and QoS policy combination is found in the local according to the topic and QoS policy of the remote reader; if the local has the combination, the corresponding remote reader is managed under the combination; if the local does not have the combination, the corresponding combination is created, and the remote reader is managed.
[0050] When the local reader matches the remote writer, the corresponding topic and QoS policy combination is found in the local according to the topic and QoS policy of the remote writer; if the local has the combination, the corresponding remote writer is managed under the combination; if the local does not have the combination, the corresponding combination is created, and the remote writer is managed.
[0051] (4) After the local writer matches the remote reader and the local reader matches the remote writer, the discovery stage is completed, and the two parties can interact data.
[0052] As shown in Figure 3 , the data interaction process includes:
[0053] In the process of the local writer sending data to the remote reader; the local writer is positioned to the corresponding topic and QoS policy combination according to its topic and QoS policy; the matched remote reader is found from the management structure of the topic and QoS policy combination; the found remote reader is traversed, and data is sent to the remote reader;
[0054] In the process of the remote writer sending data to the local reader; the local remote writer data space of the remote writer is found according to the identification information of the remote writer; in the local remote writer data space, the corresponding topic and QoS policy combination is positioned according to its topic and QoS policy; the matched local reader is found from the management structure of the topic and QoS policy combination; the local reader is traversed, and the data of the remote writer is written into the historical data cache area of the local reader.
[0055] Specifically, the data interaction process of DDS includes:
[0056] After the user data organization is completed, the data sending function of the data writer is called through the DCPS user interface; the data writer finds the matched remote data reader through its associated topic and QoS policy; the address information of the remote data reader is added in the data message; the data is sent to the remote data reader through the transport layer;
[0057] After the data arrives at the destination host, the local remote data writer is located based on the source address information in the message. The remote data writer finds a matching local data reader through its associated topic and QoS policy. The local data reader writes the data into its cache. Users can obtain the data received by the data reader in real time by registering a data availability callback or by having the data reader receive a data callback. Users can also read the data in the data reader's cache through a timed read operation.
[0058] like Figure 4 As shown in the specific embodiment of the present invention, the data matching process includes:
[0059] The local system receives information from the remote data reader and creates the remote data reader's information space locally; the remote reader and the local writer are matched based on the topic.
[0060] Remote data reader-1 searches for relevant topic data based on its own topic information; after finding the relevant topic data, it searches for existing QoS policies in its topic data; it compares the QoS policies, and if the QoS policy matches its own QoS policy, it establishes a connection between its own data and the matching QoS policy; otherwise, it creates its own QoS policy under the topic.
[0061] The matching process between remote data reader-2 and remote data reader-3 and the local writer is the same as above;
[0062] The local system receives information from the remote data writer and creates the remote data writer's information space locally; the remote writer and the local reader are matched based on the topic.
[0063] Remote data writer-1 searches for the corresponding topic data based on its own topic information; after finding the corresponding topic data, it searches for the existing QoS policy in its topic data; it compares the QoS policies, and if the QoS policy matches its own QoS policy, it establishes a connection between its own data and the matching QoS policy; otherwise, it creates its own QoS policy under the topic.
[0064] The matching process between remote data writer-2 and remote data writer-3 and local readers is the same as above.
[0065] The beneficial effects of this invention are that, compared with the prior art, the topic-centered discovery mechanism in the lightweight DDS of this invention reduces the processing work such as data integration and information storage by orchestrating the discovery process and managing discovery information through topic orchestration, and reduces the occupation of computing resources. At the same time, it completely eliminates redundant data, which not only reduces space waste, but also reduces the management work such as information synchronization between redundant data, and greatly optimizes the duration and complexity of the discovery phase.
[0066] The topic-centered discovery mechanism in the lightweight DDS has the advantages that: the discovery process is completed with the theme as the center and with the assistance of QoS, and the matching process between the readers and the writers is omitted; the matching process of entities between different themes is cancelled, and the discovery time is shortened; the local readers and writers are isolated from the remote writers and readers, and the existence of the opposite end does not need to be concerned in the matching process; in the disconnection process, the corresponding local and remote entities do not need to be perceived, and only the operation in the theme and QoS combination can be performed; the data of the remote entity is more stored in the self space, and does not need to be redundantly stored and managed.
[0067] The topic-centered discovery mechanism in the lightweight DDS of the application, by utilizing the association relationship between the theme and the local data writer, the data reader and the remote data reader and the remote data writer, the local data writer and the data reader are unbundled from the remote data reader and the data writer, the management of the local and remote entities is carried out with the theme as the center, the discovery process of the DDS is reduced, the entity matching process in the discovery process of the DDS is reduced, the occupation of the device computing capacity is reduced while the efficiency of the discovery process is improved, the implementation of the protocol is more lightweight and simple, and the decoupling of the relationship between the local and remote entities makes the implementation of the protocol more flexible.
[0068] The applicant of the application has made a detailed description and explanation of the embodiment of the application in combination with the drawings of the specification, but those skilled in the art should understand that the above embodiment is only a preferred embodiment of the application, and the detailed description is only to help the reader better understand the spirit of the application, and is not a limitation on the protection scope of the application, on the contrary, any improvement or modification based on the spirit of the application should fall within the protection scope of the application.
Claims
1. A lightweight DDS topic-centric discovery method, characterized in that, The method comprises the steps of: (1) the local participant sends SPDP messages to the network periodically, and the remote participant replies unicast SPDP messages after receiving the SPDP messages of the local participant; (2) the local participant notifies the local data writer and the local data reader to the remote participant, and the remote participant notifies the remote data writer and the remote data reader to the local participant; the local writer creates a topic and a QoS management relationship, and manages the local writer according to the topic and the QoS strategy; the local reader is created, and a topic and a QoS management relationship are created simultaneously, and the local reader is managed according to the topic and the QoS strategy; (3) the local participant matches the local data reader with the remote data writer and the local data writer with the remote data reader after receiving the data writer and the data reader notified by the remote participant; the data matching process comprises: when the local writer is matched with the remote reader, the corresponding topic and QoS strategy combination is searched in the local according to the topic and the QoS strategy of the remote reader; if the local has the combination, the corresponding remote reader is managed under the combination; if the local does not have the combination, the corresponding combination is created, and the remote reader is managed; when the local reader is matched with the remote writer, the corresponding topic and QoS strategy combination is searched in the local according to the topic and the QoS strategy of the remote writer; if the local has the combination, the corresponding remote writer is managed under the combination; if the local does not have the combination, the corresponding combination is created, and the remote writer is managed; (4) after the matching of the local writer with the remote reader and the local reader with the remote writer is completed, the discovery stage is completed, and the data interaction is performed between the two parties. 2.The method of claim 1, wherein, In step (1), the built-in data writer in the local participant entity sends an SPDP message to the multicast domain; after receiving the SPDP message, the built-in data reader of the remote participant replies the SPDP message. 3.The method of claim 1, wherein, In step (2), the built-in publisher data writer and the built-in subscriber data writer in the local participant entity send a heartbeat message to the specified remote participant to notify the creation of the local data writer and the local data reader; the built-in publisher data reader and the built-in subscriber data reader in the remote participant entity receive the heartbeat message and reply an acknowledgement message to request the local participant to synchronize the information of the data writer and the data reader; the built-in publisher data writer, the built-in subscriber data writer and the built-in message data writer in the participant entity send a data message containing the data writer information and a data message containing the data reader information to the specified remote participant, and send a heartbeat message again. In step (3), the built-in publisher data reader and the built-in subscriber data reader in the remote participant entity match the local data reader and the data writer after receiving the message, and reply an acknowledgement message to notify the information receiving condition of the data writer and the data reader. 4.The method of claim 1, wherein, 5. The lightweight DDS topic-centric discovery method of claim 1, wherein, In step (4), the data interaction process includes: In the process of sending data by the local writer to the remote reader, the local writer locates the corresponding topic and QoS policy combination according to the topic and QoS policy thereof, finds the matched remote reader from the management structure of the topic and QoS policy combination, and sends data to the remote reader by traversing the found remote reader; In the process of sending data by the remote writer to the local reader, the remote writer is found in the local remote writer data space according to the identification information of the remote writer, the corresponding topic and QoS policy combination is located according to the topic and QoS policy of the remote writer in the local remote writer data space, the matched local reader is found from the management structure of the topic and QoS policy combination, and the data of the remote writer is written into the historical data cache area of the local reader by traversing the local reader.
6. The lightweight DDS topic-centric discovery method of claim 5, wherein, After the user data organization is completed, the data sending function of the data writer is called through the DCPS user interface, the remote data reader matched with the data writer is found through the topic and QoS policy associated with the data writer, and the address information of the remote data reader is added in the data message; The data is sent to the remote data reader through the transmission layer; After the data reaches the destination host, the local remote data writer is found according to the source address information in the message, the local data reader matched with the remote data writer is found through the topic and QoS policy associated with the remote data writer, and the data is written into the cache by the local data reader. The data is written into the cache by the local data reader. The user can obtain the data received by the data reader in real time through the registered data available callback or the data reader receiving data callback, or read the data in the cache of the data reader through the timing reading operation.
7. A DDS middleware entity for implementing the lightweight DDS topic-based discovery method according to any of claims 1 to 6, characterized in that, The local participant includes a publisher and a subscriber, and a plurality of different topics are created in the local participant. A writer and / or a reader are associated with each topic according to a QoS policy. The remote participant includes a reader and a writer. A remote writer and / or a remote reader are associated with each topic according to a QoS policy in the local topic. A corresponding matching relationship is established between the local writer and the matched remote reader through the topic and QoS policy associated therewith, and a corresponding matching relationship is established between the local reader and the matched remote writer through the topic and QoS policy associated therewith. The data matching process includes: When the local writer is matched with the remote reader, the corresponding topic and QoS policy combination is found in the local according to the topic and QoS policy of the remote reader. If the local has the combination, the corresponding remote reader is managed under the combination. If the local does not have the combination, the corresponding combination is created, and the remote reader is managed. When the local reader is matched with the remote writer, the corresponding topic and QoS policy combination is found in the local according to the topic and QoS policy of the remote writer. If the local has the combination, the corresponding remote writer is managed under the combination. If the local does not have the combination, the corresponding combination is created, and the remote writer is managed.
Citation Information
Patent Citations
PCIE (Peripheral Component Interface Express) bus-based data-centered publishing and subscribing middleware and method
CN117596294A
DDS protocol-based participant matching method and related device
CN119484086A