DDS communication method and device, equipment, storage medium and program product
By configuring the GUID identifier field in the full PDP packet, the multicast mode can be determined and switched, which solves the problem of excessive network load in traditional DDS communication and improves communication efficiency and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZEBRED NETWORK TECH CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-28
AI Technical Summary
In traditional DDS communication, the increase in the number of participants leads to a significant increase in network bandwidth consumption, exacerbating communication latency and reducing efficiency. Especially in the scenario of cooperative perception of autonomous vehicles, the PDP data packet size is too large, occupying network resources and causing packet loss or communication blockage.
Configure an identifier field in the full PDP packet to indicate the GUID that the participant has received. By parsing this field, determine whether to switch the multicast mode from periodic multicast to immediate multicast, thereby reducing the number of redundant multicasts and lowering network bandwidth usage and computing resource consumption.
It significantly improves DDS communication efficiency, reduces network bandwidth usage and computing resource consumption, and solves the problem of excessive network load in traditional DDS communication.
Smart Images

Figure CN121940474A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a DDS communication method, apparatus, device, storage medium, and program product. Background Technology
[0002] Data Distribution Service (DDS) is a data-centric middleware protocol widely used in distributed systems, such as industrial automation, connected vehicles, smart manufacturing, collaborative medical devices, and drone swarm control. In these scenarios, participants in the distributed system need to identify and communicate with each other through a Participant Discovery Protocol (PDP). PDP is one of the core protocols of DDS, responsible for multicasting basic participant information, such as ID, quality of service parameters, and supported communication capabilities, within the distributed system to establish initial connections and maintain the topology.
[0003] However, with the widespread adoption of the Internet of Things (IoT) and edge computing, the number of participants in distributed systems is growing exponentially. Traditional PDP protocols require the transmission of a large amount of redundant information via data packets during initial connections, leading to a significant increase in network bandwidth consumption, exacerbated communication latency, and low communication efficiency. For example, in collaborative perception scenarios for autonomous vehicles, each vehicle's onboard system needs to communicate in real-time with hundreds of surrounding vehicles or roadside units. If PDP data packets are too large, they will directly consume valuable network resources and may even cause packet loss or communication congestion.
[0004] Therefore, there is an urgent need for a DDS communication scheme that improves communication efficiency. Summary of the Invention
[0005] This application provides a DDS communication method, apparatus, device, storage medium, and program product to improve DDS communication efficiency.
[0006] In a first aspect, embodiments of this application provide a method applicable to communication among multiple participants, including multiple our participants and multiple other participants. For any one of our first participants, the current DDS communication phase of our first participant is the initiation phase of periodic multicast full PDP packets. The multicast mode of our first participant's full PDP packets includes periodic multicast and immediate multicast. When our first participant receives a full PDP packet multicast from any participant for the first time, it switches the multicast mode of the full PDP packets from periodic multicast to immediate multicast. The method includes:
[0007] The received first PDP packet is parsed to obtain the parsing result, which includes the first identifier field corresponding to the first PDP packet and the GUID field corresponding to the second participant; wherein, the received first PDP packet is a PDP packet multicast by the second participant, and the first identifier field is used to indicate the participant GUID corresponding to all PDP packets received by the second participant;
[0008] Determine whether the parsing result contains an identifier field that indicates that the PDP packet is a trimmed packet; if the parsing result does not contain an identifier field that indicates that the PDP packet is a trimmed packet, then determine that the first PDP packet is a full PDP packet.
[0009] Based on the GUID field corresponding to the second participant and the participant GUID corresponding to the full PDP packets already received by our first participant, determine whether our first participant has received the first PDP packet for the first time.
[0010] If the GUID of the second participant is not present in the participant GUID corresponding to the full PDP packet already received by our first participant, then it is determined that our first participant has received the full PDP packet multicast by the second participant for the first time.
[0011] Determine if the first identifier field contains the participant GUID corresponding to our first participant; if the participant GUID corresponding to our first participant is not found in the full PDP packets received by the second participant, then switch the multicast mode of our first participant's full PDP packets from periodic multicast to immediate multicast.
[0012] Based on the participant GUID corresponding to the full PDP packets received by our first participant and the participant GUID corresponding to the second participant, the second identifier field is determined; the second identifier field is used to indicate the participant GUID corresponding to the full PDP packets received by our first participant.
[0013] The second identifier field is configured in the second PDP packet corresponding to our first participant; the second PDP packet corresponding to our first participant is multicast so that multiple our participants and multiple other participants can receive the second PDP packet; wherein, the second PDP packet is the full PDP packet corresponding to our first participant.
[0014] Secondly, embodiments of this application provide a DDS communication device, comprising: an application for communication between multiple participants, including our participants and other participants; for any one of our first participants, the current DDS communication phase of our first participant is the initiation phase of periodic multicast full PDP packets; the multicast mode of our first participant's full PDP packets includes periodic multicast and immediate multicast; when our first participant first receives a full PDP packet multicast from any participant, it switches the multicast mode of the full PDP packets from periodic multicast to immediate multicast, including:
[0015] The parsing module is used to parse the received first PDP packet to obtain the parsing result. The parsing result includes the first identifier field corresponding to the first PDP packet and the GUID field corresponding to the second participant. The received first PDP packet is a PDP packet multicast by the second participant, and the first identifier field is used to indicate the participant GUID corresponding to all PDP packets received by the second participant.
[0016] The judgment module is used to determine whether the parsing result contains an identifier field that indicates that the PDP packet has been trimmed; if the parsing result does not contain an identifier field that indicates that the PDP packet has been trimmed, then the first PDP packet is determined to be a full PDP packet.
[0017] The judgment module is also used to determine whether our first participant has received the first PDP packet for the first time, based on the GUID field corresponding to the second participant and the participant GUID corresponding to the full PDP packets already received by our first participant.
[0018] The processing module is used to determine that the first participant has received the full PDP packet of the second participant for the first time if the participant GUID corresponding to the full PDP packet already received by the first participant does not contain the GUID corresponding to the second participant.
[0019] The processing module is also used to determine whether the participant GUID corresponding to our first participant exists in the first identifier field; if the participant GUID corresponding to our first participant does not exist in the participant GUID of the full PDP packets received by the second participant; then the multicast mode of our first participant's full PDP packets is switched from periodic multicast to immediate multicast.
[0020] The multicast module is used to determine the second identifier field based on the participant GUID corresponding to the full PDP packets received by our first participant and the participant GUID corresponding to the second participant; the second identifier field is used to indicate the participant GUID corresponding to the full PDP packets received by our first participant.
[0021] The multicast module is also used to configure the second identifier field in the second PDP packet corresponding to our first participant; to multicast the second PDP packet corresponding to our first participant so that multiple our participants and multiple other participants can receive the second PDP packet; wherein the second PDP packet is the full PDP packet corresponding to our first participant.
[0022] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0023] The memory stores the instructions that the computer executes;
[0024] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0025] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0026] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0027] The DDS communication method, apparatus, device, storage medium, and program product provided in this application, by configuring a first identifier field in the full PDP packet to indicate the participant GUID corresponding to the full PDP packet received by the second participant corresponding to the full PDP packet, solves the problem of excessive network load caused by redundant multicast in traditional DDS communication by enabling the first participant receiving the full PDP packet to decide whether to switch the multicast mode of the full PDP packet based on the first identifier field during the startup phase. Specifically, when the switching condition is met, that is, the first participant's GUID does not exist in the first identifier field and the full PDP packet of the second participant is received for the first time, the multicast mode is switched to immediate multicast to immediately multicast the full PDP packet of the first participant. When the switching condition is not met, the full PDP packet of the first participant continues to be multicast periodically to reduce the number of PDP packet multicasts, significantly reduce network bandwidth occupation and computing resource consumption, and improve DDS communication efficiency. Attached Figure Description
[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0029] Figure 1A flowchart illustrating a DDS communication method provided in this application. Figure 1 ;
[0030] Figure 2 A flowchart illustrating a DDS communication method provided in this application. Figure 2 ;
[0031] Figure 3 This application provides a schematic diagram of state switching during a DDS communication phase.
[0032] Figure 4 This application provides a schematic diagram of the structure of a DDS communication device.
[0033] Figure 5 This is a schematic diagram of the structure of an electronic device provided in this application.
[0034] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0035] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0036] First, let me explain the terms used in this application:
[0037] Data Distribution Service (DDS) is a data-centric middleware protocol.
[0038] Participant Discovery Protocol (PDP) is one of the core sub-protocols of DDS, used to enable participants in the DDS network to "get to know" each other.
[0039] Globally Unique Identifier (GUID): Used to indicate the identity information of a participant, consisting of vendor ID, device ID, instance ID, etc.
[0040] Data distribution service (DDS) is a data-centric middleware protocol widely used in distributed systems, such as industrial automation, connected vehicles, smart manufacturing, collaborative medical devices, and drone swarm control. In these scenarios, participants in the distributed system need to identify and communicate with each other through the Participant Discovery Protocol (PDP). PDP is one of the core protocols of DDS, responsible for multicasting basic participant information, such as ID, quality of service parameters, and supported communication capabilities, within the distributed system to establish initial connections and maintain the topology.
[0041] However, with the widespread adoption of the Internet of Things (IoT) and edge computing, the number of participants in distributed systems is growing exponentially. Traditional PDP protocols require the transmission of a large amount of redundant information via data packets during initial connections, leading to a significant increase in network bandwidth consumption, exacerbated communication latency, and low communication efficiency. For example, in collaborative perception scenarios for autonomous vehicles, each vehicle's onboard system needs to communicate in real-time with hundreds of surrounding vehicles or roadside units. If PDP data packets are too large, they will directly consume valuable network resources and may even cause packet loss or communication congestion.
[0042] Therefore, there is an urgent need for a DDS communication scheme that improves communication efficiency.
[0043] The DDS communication method, apparatus, device, storage medium, and program product provided in this application solve the problem of excessive network load caused by redundant multicast in traditional DDS communication by configuring a first identifier field in the full PDP packet to indicate the participant GUID corresponding to the full PDP packet received by the second participant. This first identifier field allows the first participant receiving the full PDP packet to decide whether to switch the multicast mode of the full PDP packet based on the first identifier field. Specifically, the multicast mode is switched to immediate multicast only when the switching condition is met, i.e., the first participant's GUID does not exist in the first identifier field and the full PDP packet of the second participant is received for the first time. Otherwise, the full PDP packet of the first participant continues to be multicast periodically to reduce the number of PDP packet multicasts, significantly reduce network bandwidth occupation and computing resource consumption, and improve DDS communication efficiency.
[0044] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0045] Figure 1A flowchart illustrating a DDS communication method provided in this application. Figure 1 ,like Figure 1 As shown, this method is applied between multiple participants, including multiple our participants and multiple other participants. For any one of our first participants, the current DDS communication phase of our first participant is the initiation phase of periodic multicast full PDP packets. The multicast mode of our first participant's full PDP packets includes periodic multicast and immediate multicast. When our first participant receives a full PDP packet multicast from any participant for the first time, it switches the multicast mode of the full PDP packets from periodic multicast to immediate multicast. The DDS communication method provided in this application includes:
[0046] S101. The received first PDP packet is parsed to obtain the parsing result. The parsing result includes the first identifier field corresponding to the first PDP packet and the GUID field corresponding to the second participant. The received first PDP packet is a PDP packet multicast by the second participant. The first identifier field is used to indicate the participant GUID corresponding to all PDP packets received by the second participant.
[0047] In an in-vehicle system, the DDS network comprises multiple network nodes, each corresponding to a network group. All participants in the network group send their own PDP packets via multicast. A PDP packet sent by any participant in the network group can only be received by other participants within the group. For example, for network group 1 corresponding to network node 1, network group 1 includes participant 1, participant 2, and participant 3. A PDP packet sent by participant 1 can only be received by participants 2 and 3 within the group. The number of network nodes included in the DDS network is not limited in this application; this application uses a network group corresponding to a single network node in the DDS network as an example to illustrate a DDS communication method provided by this application.
[0048] For example, network group a includes multiple friendly participants and other participants; among them, other participants refer to those who cannot parse the trimmed PDP packets multicast by friendly participants. For any friendly participant "participant a", the current DDS communication phase of participant a is the start phase of periodic multicast; for example, participant a multicasts the corresponding full PDP packets in network group a every 100 milliseconds.
[0049] When participant a multicasts its own PDP packets, it also receives PDP packets multicast by other participants in network group a. For example, participant a receives a PDP packet (e.g., PDP packet b1) multicast by any participant in network group a (e.g., participant b). First, PDP packet b1 is parsed to obtain the first identifier field corresponding to the PDP packet and the GUID field corresponding to participant b. The first identifier field includes the participant GUIDs corresponding to all PDP packets received by participant b. For example, if participant b receives all PDP packets c, d, and e multicast by participant c, d, and e in network group a, then the first identifier field includes the GUIDs corresponding to participant c, d, and e.
[0050] S102. Determine whether the parsing result contains an identifier field that indicates that the PDP packet is a trimmed packet; if the parsing result does not contain an identifier field that indicates that the PDP packet is a trimmed packet, then determine that the first PDP packet is a full PDP packet.
[0051] If a PDP packet contains a trimmed identifier field, it indicates that the PDP packet was obtained by trimming and simplifying the full PDP packet to reduce its size. The full PDP contains complete information about the participants, such as the participant's GUID, user data, protocol basic information, network address information, and quality of service parameters. The trimmed PDP packet may only contain the participant's GUID and user data.
[0052] Based on the foregoing, if parsing PDP packet b1 does not yield an identifier field indicating that the PDP packet is cropped, then it can be determined that PDP packet b1 is a full PDP packet multicast by participant b.
[0053] S103. Based on the GUID field corresponding to the second participant and the participant GUID corresponding to the full PDP packets already received by our first participant, determine whether our first participant has received the first PDP packet for the first time.
[0054] S104. If the GUID of the second participant is not present in the participant GUID corresponding to the full PDP packet received by our first participant, then it is determined that our first participant has received the full PDP packet of the second participant multicast for the first time.
[0055] Similarly, for example, the participant GUIDs corresponding to the full PDP packets received by our first participant "partner a" are: "GUIDs corresponding to participant c, participant d, and participant e". By comparison, we can see that the GUIDs corresponding to participant b are not among the participant GUIDs of the full PDP packets received by participant a. Therefore, it can be confirmed that participant a has not received the full PDP packets corresponding to participant b; the currently received PDP packet b1 is the first time the full PDP packets corresponding to participant b have been received.
[0056] S105. Determine whether the participant GUID corresponding to our first participant exists in the first identifier field; if the participant GUID corresponding to our first participant does not exist in the full PDP packets received by the second participant; then switch the multicast mode of our first participant's full PDP packets from periodic multicast to immediate multicast.
[0057] Based on the foregoing, the participant GUIDs corresponding to the full PDP packets received by participant b are: "the GUID corresponding to participant c, the GUID corresponding to participant d, and the GUID corresponding to participant e". By comparison, it can be seen that the GUID corresponding to participant a does not exist among the participant GUIDs corresponding to the full PDP packets received by participant b. Therefore, it can be determined that participant b has not received the full PDP packets corresponding to participant a.
[0058] Therefore, if the condition "Participant a receives the full PDP packet corresponding to participant b for the first time, and the participant GUID corresponding to the full PDP packet received by participant b does not contain the participant GUID corresponding to our first participant, i.e., participant b has not received the full PDP packet corresponding to participant a" is met, participant a will be switched from the multicast mode of "multicasting the full PDP packet once every 100 milliseconds" to immediately multicasting the full PDP packet; so that participant b can receive the full PDP packet corresponding to participant a earlier.
[0059] S106. Based on the participant GUID corresponding to the full PDP packets received by our first participant and the participant GUID corresponding to the second participant, determine the second identifier field; the second identifier field is used to indicate the participant GUID corresponding to the full PDP packets received by our first participant.
[0060] Specifically, when participant a multicasts the corresponding full PDP packet "such as PDP packet a1", it determines the second identification field based on the participant GUID corresponding to the full PDP packet already received by our first participant and the participant GUID corresponding to the second participant; that is, the second identification field "the GUID corresponding to participant b, the GUID corresponding to participant c, the GUID corresponding to participant d, and the GUID corresponding to participant e".
[0061] S107, and configure the second identifier field in the second PDP packet corresponding to our first participant; multicast the second PDP packet corresponding to our first participant so that multiple our participants and multiple other participants can receive the second PDP packet; wherein, the second PDP packet is the full PDP packet corresponding to our first participant.
[0062] Configure the second identifier field in PDP packet a1, and then immediately multicast PDP packet a1 in network group a so that multiple our participants and multiple other participants can receive the second PDP packet.
[0063] To address the issue that existing PDP packet multicast methods, especially when there are many participants or poor network conditions, can lead to network congestion and processing delays due to frequent multicasts, impacting data exchange efficiency and real-time performance, this application adds a participant GUID (e.g., a "participants_found" field) to the PDP packet to indicate the participant's received full set of PDP packets. This "participants_found" field is dynamically updated based on the participant's received full set of PDP packets. When a participant is in the initiation phase of periodic multicast, upon receiving a PDP packet multicast by another participant in network group 'a', it first parses the PDP packet to obtain the parsing result. Based on this parsing result and the participant GUID corresponding to the participant's received full set of PDP packets, it determines whether to switch multicast modes. This prevents a participant from immediately responding with multicast upon receiving any PDP packet, thus avoiding wasted computational resources.
[0064] This application provides a DDS communication method that configures a first identifier field in the full PDP packet to indicate the participant GUID corresponding to the full PDP packet received by the second participant. During the startup phase, this allows the first participant receiving the full PDP packet to decide whether to switch the multicast mode of the full PDP packet based on the first identifier field, upgrading the traditional "discovery-is-multicast" mode to a "discovery-is-multicast-free" mode. This solves the problem of excessive network load caused by redundant multicast in traditional DDS communication. Specifically, when the switching condition is met—that is, the first participant's GUID does not exist in the first identifier field, and the full PDP packet multicast by the second participant is received for the first time—the multicast mode is switched to immediate multicast to immediately multicast the full PDP packet of the first participant. When the switching condition is not met, the full PDP packet of the first participant continues to be multicast periodically to reduce the number of PDP packet multicasts, significantly reducing network bandwidth usage and computing resource consumption, and improving DDS communication efficiency.
[0065] In one possible implementation, the method further includes:
[0066] If the GUID of the second participant is present in the participant GUID corresponding to the full PDP packet received by our first participant, then it is determined that our first participant has not received the full PDP packet multicast by the second participant for the first time.
[0067] Then, according to the first multicast cycle, multicast the full PDP packets corresponding to our first participant; until the number of full PDP packets corresponding to our first participant reaches the preset number of multicasts, then switch the DDS communication phase of our first participant from the start phase of periodic multicast full PDP packets to the keep-alive phase.
[0068] or;
[0069] If our first participant receives the full PDP packet multicast by the second participant for the first time, the participant GUID corresponding to our first participant will be present in the participant GUID of the full PDP packet already received by the second participant.
[0070] Then, according to the first multicast cycle, multicast the full PDP packets corresponding to our first participant; until the number of full PDP packets corresponding to our first participant reaches the preset number of multicasts, then switch the DDS communication phase of our first participant from the start phase of periodic multicast full PDP packets to the keep-alive phase.
[0071] Understandably, when the following two conditions are met, participant a's DDS communication phase will be switched from the startup phase to the keep-alive phase.
[0072] Specifically, under the first condition, for example, if the participant GUIDs corresponding to the full PDP packets received by participant a are: "GUIDs corresponding to participant b, participant c, participant d, and participant e", then by comparison, we can find that the GUID corresponding to participant b is present among the participant GUIDs corresponding to the full PDP packets received by participant a. Therefore, it can be determined that participant a received the full PDP packets corresponding to participant b before receiving PDP packet b1. Then, participant a continues to multicast the full PDP packets according to the first multicast cycle of "multicasting the full PDP packets once every 100 milliseconds," thereby reducing the number of multicasts of the full PDP packets, reducing network bandwidth usage and computing resource consumption, and improving DDS communication efficiency.
[0073] The preset number of multicasts can be set according to needs, for example, 20 times; when participant a periodically multicasts the full PDP packet 20 times, the DDS communication phase will be switched from the startup phase to the keep-alive phase.
[0074] The second condition is that if the currently received PDP packet b1 is the first full PDP packet received from participant b, and participant b has already received the full PDP packet corresponding to participant a, then participant a continues to multicast the full PDP packet according to the first multicast cycle of "multicasting the full PDP packet once every 100 milliseconds" until the preset number of multicasts "20 times" is reached. Then, the DDS communication phase is switched from the startup phase to the keep-alive phase.
[0075] In one possible implementation, according to the first multicast cycle, the full PDP packets corresponding to our first participant are multicast, including:
[0076] If the parsing result contains an identifier field indicating that the PDP packet is a trimmed PDP packet, then the first PDP packet is determined to be a trimmed PDP packet.
[0077] Based on the GUID field corresponding to the second participant and the participant GUID corresponding to the full PDP packet received by our first participant, determine whether our first participant has received the full PDP packet corresponding to the second participant.
[0078] If the participant GUID corresponding to the full PDP packet received by our first participant does not exist in the GUID field corresponding to the second participant, then it is determined that our first participant has not received the full PDP packet corresponding to the second participant.
[0079] According to the first multicast cycle, the second PDP packet corresponding to our first participant is multicast so that multiple our participants and multiple other participants can receive the second PDP packet; wherein, the second PDP packet is configured with a third identification field, which is used to indicate that our first participant has not received the full PDP packet multicast by the second participant or any participant, and to indicate that all participants in the DDS communication network are switched to the startup phase.
[0080] Participant a receives periodically corresponding full PDP packets, including two types of full PDP packets. The first type, "Full PDP Packet 11," is configured with a third identifier field to indicate that participant a has not received a full PDP packet multicast by participant b. If the third identifier field is "1," it means that participant a has not received a full PDP packet from participant b or any other participant in network group a.
[0081] The second type, "Full PDP Packet 12", has its third identifier field set to zero, indicating that participant a has received the full PDP packet corresponding to the full participants in network group a.
[0082] Understandably, in conjunction with the foregoing, when "Participant a receives a trimmed PDP packet b1 from participant b multicast, and has not received the full PDP packet corresponding to participant b before receiving PDP packet b1," then "full PDP packet 11" will be multicast according to the first multicast cycle. Similarly, when "Participant a receives a full PDP packet b1 from participant b multicast, and participant b has already received the full PDP packet corresponding to participant a"; or when "Participant a receives a trimmed PDP packet b1 from participant b multicast, but participant a has already received the full PDP packet multicast by participant b," then "full PDP packet 12" will be multicast according to the first multicast cycle.
[0083] During the startup phase, it is determined whether the received PDP packet multicast by the participant is a full PDP packet or a trimmed PDP packet. If a trimmed PDP packet is received and no full PDP packet has been received before, a full PDP packet with the third identifier field set is sent so that the participant can multicast the full PDP packet again.
[0084] In one possible implementation, Figure 2 A flowchart illustrating a DDS communication method provided in this application. Figure 2 ,like Figure 2 As shown, the keep-alive phase includes multicast full PDP packets and multicast trimmed PDP packets, switching the DDS communication phase of our first participant from the periodic multicast full PDP packet startup phase to the keep-alive phase, including:
[0085] S201. Obtain the GUID field corresponding to all participants in the DDS communication network; based on the vendor field corresponding to all participants, determine whether there are other participants in the DDS communication network; wherein, the GUID field corresponding to each participant includes the vendor field corresponding to each participant;
[0086] For example, in a DDS communication network, the total number of participants in network group 'a' are "Participant a, Participant b, Participant c, Participant d, Participant e, Participant f"; where the vendor field for each participant is: "Participant a - Vendor ID: 0x0101", "Participant b - Vendor ID: 0x0101", "Participant c - Vendor ID: 0x0101", "Participant d - Vendor ID: 0x0101", "Participant e - Vendor ID: 0x0101", and "Participant f - Vendor ID: 0x000F". Here, Vendor ID refers to a unique identifier for the vendor.
[0087] In one possible implementation, the presence of third-party participants in the DDS communication network is determined based on the vendor field corresponding to all participants, including:
[0088] Match the vendor field corresponding to each participant in the vendor field of all participants with the vendor field determined by our first participant;
[0089] If the vendor field of any participant in the vendor field of all participants is inconsistent with the vendor field determined by our first participant, then it is determined that there is a third-party participant in the DDS communication network.
[0090] If the vendor field corresponding to each participant in the full range of participants is consistent with the vendor field determined by our first participant, then it is determined that there are no other participants in the DDS communication network.
[0091] Among them, the vendor field corresponding to our first participant "Participant a" is: Vendor ID: 0x0101; by comparing the vendor fields corresponding to participants "Participant b, Participant c, Participant d, Participant e, and Participant f" in network group a with the vendor field corresponding to participant a, it can be found that the vendor fields corresponding to "Participant b, Participant c, Participant d, and Participant e" are consistent with the vendor field corresponding to participant a, while the vendor field corresponding to participant f is inconsistent with the vendor field corresponding to participant a. This indicates that there are other participants in network group a.
[0092] Similarly, if the vendor field corresponding to each participant in network group a is consistent with the vendor field corresponding to participant a, that is, "Vendor ID: 0x0101", then it means that there are no other participants in network group a.
[0093] This step ensures the accuracy of the judgment by determining whether there are other participants in the network group based on the uniqueness of the vendor field.
[0094] S202. If there are no other participants in the DDS communication network, the DDS communication phase of our first participant will be switched from the start phase of periodic multicast full PDP packets to the keep-alive phase of multicast trimmed PDP packets.
[0095] In summary, if there are no other participants in network group a, the DDS communication phase of participant a will be switched from the start-up phase of periodic full PDP packets to the keep-alive phase of multicast trimmed PDP packets. At the same time, all participants in network group a can multicast trimmed PDP packets to avoid repeatedly multicasting existing participant information, reduce network bandwidth usage, shorten communication latency, and maintain the integrity of the participant discovery function.
[0096] In one possible implementation, the method further includes:
[0097] When our first participant's DDS communication phase is in the keep-alive phase of multicast trimmed PDP packets, the received first PDP packet is parsed to obtain the parsing result.
[0098] Determine whether the parsing result contains an identifier field that indicates that the PDP packet is a trimmed PDP packet; if the parsing result contains an identifier field that indicates that the PDP packet is a trimmed PDP packet, then determine that the first PDP packet is a trimmed PDP packet;
[0099] According to the second multicast cycle, the third PDP packet corresponding to our first participant is multicast so that multiple our participants can receive the third PDP packet; wherein, the third PDP packet is obtained by trimming the full PDP packet corresponding to our first participant, and the third PDP packet is configured with a fourth identifier field, which is used to indicate that the third PDP packet has been trimmed.
[0100] In existing DDS implementations, PDP packets typically contain complete participant metadata, including critical fields (such as unique identifiers) and non-critical fields (such as participant name, version information, vendor ID, QoS policy, etc.). These non-critical fields are used to initialize communication parameters during the initial connection, but they are repeatedly transmitted in subsequent periodic multicasts, resulting in redundant packet size. To address the data redundancy issue in existing PDP packet multicasts, this application adds an identification field, such as a "partial_data boolean field," to the structure of the PDP packet.
[0101] Specifically, the PDP packet format was first analyzed to identify key fields for participants: the GUID field and the user_data field. The full PDP packet was then trimmed, retaining only these key fields to obtain a trimmed PDP packet. A "partial_data" boolean field was added to the trimmed PDP packet to indicate that it was trimmed. By simplifying non-critical fields, the size of the data packets was reduced, improving network communication efficiency.
[0102] The second multicast period is the period during which participants multicast trimmed PDP packets. It can be set according to needs, for example, "multicast trimmed PDP packets every 10 seconds".
[0103] Specifically, when participant a is in the keep-alive phase of multicast trimmed PDP packets; for example, participant a receives PDP packet c1 multicast from participant c; parses PDP packet c1 to obtain the parsing result; if the parsing result contains an identifier field indicating that the PDP packet is trimmed, then the PDP packet c1 received by participant a is a trimmed PDP packet. Then, according to the multicast cycle of "multicasting trimmed PDP packets every 10 seconds," the trimmed PDP packet corresponding to participant a is multicast; the trimmed PDP packet corresponding to participant a also includes an identifier field indicating that the third PDP packet is trimmed, i.e., the fourth identifier field.
[0104] In one possible implementation, the method further includes:
[0105] If the parsing result does not contain an identifier field indicating that the PDP packet is a trimmed packet, then the first PDP packet is determined to be a full PDP packet.
[0106] Determine whether the parsing result contains the fifth identifier field. The fifth identifier field is used to indicate that the second participant has not received the full PDP packet multicast by our first participant or any participant, and is used to indicate that all participants in the DDS communication network should be switched to the startup phase.
[0107] If the first PDP packet is configured with a fifth identifier field, then the DDS communication phase of our first participant will be switched from the keep-alive phase of multicast trimmed PDP packets to the startup phase.
[0108] Similarly, when participant a is in the keep-alive phase of multicast trimmed PDP packets, if the received PDP packet d1 from participant d does not contain an identifier field indicating that the PDP packet has been trimmed, and PDP packet d1 includes an identifier field indicating that all participants are in the startup phase, then participant a's DDS communication phase will be switched from the keep-alive phase to the startup phase.
[0109] In addition, participant a is switched to the immediate multicast startup phase. After participant a responds to the switch request and first multicasts the full PDP packets, it enters the periodic multicast startup phase.
[0110] S203. If there are other participants in the DDS communication network, the DDS communication phase of our first participant will be switched from the start phase of periodic multicast full PDP packets to the keep-alive phase of multicast full PDP packets.
[0111] In conjunction with the foregoing, when there are other participants in network group a, the DDS communication phase of participant a will be switched from the start phase of periodic multicast full PDP packets to the keep-alive phase of multicast full PDP packets; this is to prevent other participants from being unable to parse the trimmed PDP packets and thus not receiving information from our participants.
[0112] In one possible implementation, the method further includes:
[0113] When our first participant's DDS communication phase is in the keep-alive phase of multicast full PDP packets;
[0114] The first received PDP packet is parsed to obtain the parsing result; based on the parsing result, the reception status of the first participant on our side of the first PDP packet is determined.
[0115] If the reception status indicates that our first participant has received the full PDP packet of the multicast from the second participant for the first time, and the participant GUID corresponding to our first participant does not exist in the first identifier field, then the DDS communication phase of our first participant will be switched from the keep-alive phase of the multicast full PDP packet to the startup phase.
[0116] If the reception status indicates that our participant received a trimmed PDP packet from the second participant's multicast before receiving the full PDP packet from the second participant, then our first participant's DDS communication phase will be switched from the keep-alive phase of the full PDP packet multicast to the startup phase.
[0117] or;
[0118] If our first participant receives the full PDP packet multicast by the second participant for the first time, the participant GUID corresponding to our first participant will be present in the participant GUID of the full PDP packet already received by the second participant.
[0119] Then we maintain the DDS communication phase of our first participant.
[0120] Similarly, when participant a's DDS communication phase is in the keep-alive phase of the multicast PDP packet: If the first received PDP packet is participant e's multicast PDP packet e1; parse PDP packet e1 to obtain the parsing result; based on the parsing result, determine participant a's reception status of PDP packet e1.
[0121] If the reception status indicates that "PDP packet e1 is the first time participant a has received the full PDP packet multicast by participant e, and participant e has not received the full PDP packet of participant a", then switch the DDS communication phase of participant a to the start phase, so as to immediately multicast the full PDP packet corresponding to participant a.
[0122] If the reception status indicates that "PDP packet e1 is a trimmed PDP packet of participant e, and participant a has never received a full PDP packet of participant e", then participant a's DDS communication phase is also switched to the start phase.
[0123] Furthermore, if the reception status indicates that "PDP packet e1 is the first time participant a has received the full PDP packet multicast by participant e, and participant e has received the full PDP packet from participant a," then participant a's DDS communication mode will not be switched. Participants will continue to multicast the full PDP packet during the keep-alive phase according to the corresponding multicast cycle.
[0124] In one possible implementation, the method further includes:
[0125] If no PDP packet is received from any participant multicast within the preset time, then obtain the GUIDs of all participants in the DDS communication network.
[0126] Based on the GUID of all participants, determine whether there are other participants in the DDS communication network; if there are no other participants in the DDS communication network, switch the DDS communication phase of our first participant from the keep-alive phase of multicast full PDP packets to the keep-alive phase of multicast trimmed PDP packets.
[0127] or;
[0128] If a multicast exit PDP packet is received from any participant, the exit PDP packet is used to instruct the participant to exit the DDS communication network.
[0129] Then obtain the GUIDs of all participants in the DDS communication network;
[0130] Based on the GUID of all participants, determine whether there are other participants in the DDS communication network; if there are no other participants in the DDS communication network, switch the DDS communication phase of our first participant from the keep-alive phase of multicast full PDP packets to the keep-alive phase of multicast trimmed PDP packets.
[0131] Understandably, new participants will join and some will leave network group A; when a new participant joins, the system will switch to the immediate multicast startup phase. However, upon receiving a participant's exit PDP packet, the system will determine whether there are other participants in network group A, and then decide whether to switch to multicast mode.
[0132] In conjunction with the foregoing, for example, when network group a is currently in the keep-alive phase of multicast full PDP packets; and a participant f exits a PDP packet; then the GUIDs of all participants in network group a, "participant a, participant b, participant c, participant d, participant e", are obtained. Based on the vendor field in each participant's GUID, it is determined whether there are any other participants in the current network group a. If there are no other participants in the network, then the DDS communication phase of participant a is switched to the keep-alive phase of multicast trimmed packets; if there are other participants in the network, then the keep-alive phase of multicast full PDP packets is maintained.
[0133] Figure 3 This application provides a schematic diagram of state switching during a DDS communication phase, as shown below. Figure 3 As shown, when participant a is in the start-up phase of periodic multicast, if condition 2 is met, the multicast mode is switched from periodic multicast to immediate multicast. Condition 2 includes two scenarios: the first is condition 2.1, "the full PDP packet corresponding to participant b is received for the first time, and participant b has not received the PDP packet corresponding to participant a"; the second is condition 2.2, "if the full PDP packet corresponding to participant b is not received, the received PDP packet is a trimmed PDP packet corresponding to participant b". If condition 3 is met, "the number of times periodic multicast full PDP packets reaches the preset multicast count, and there are other participants in the current DDS communication network", the DDS communication phase is switched from the start-up phase to the keep-alive phase of multicasting full PDP packets. If condition 4 is met, "the number of times periodic multicast full PDP packets reaches the preset multicast count, and there are no other participants in the current DDS communication network", the DDS communication phase is switched from the start-up phase to the keep-alive phase of multicasting trimmed PDP packets. Condition 1 is unrestricted and can be any condition. For example, if condition 1 is "full PDP packets have been multicast", then the multicast mode can be switched from immediate multicast to periodic multicast.
[0134] When participant a is in the keep-alive phase of multicast full PDP packets, if condition 5 is met, participant a's DDS communication phase is switched to the immediate multicast startup phase. Condition 5 includes two scenarios: first, condition 5.1, "the first full PDP packet corresponding to participant b is received, and participant b has not received the PDP packet corresponding to participant a"; second, condition 5.2, "if the full PDP packet corresponding to participant b is not received, the received PDP packet is a trimmed PDP packet corresponding to participant b." If condition 7, "after any participant leaves, there are no other participants in the network group," participant a's multicast mode is switched to the keep-alive phase of multicast trimmed PDP packets.
[0135] When participant a is in the keep-alive phase of multicast trimmed PDP packets, if condition 6 is met, participant a's DDS communication phase will be switched to the start phase of immediate multicast. Condition 6 includes three cases: First case, condition 6.1 "The full PDP packet corresponding to participant b is received for the first time, and participant b has not received the PDP packet corresponding to participant a"; Second case, condition 6.2 "If the full PDP packet corresponding to participant b is not received, the received PDP packet is the trimmed PDP packet corresponding to participant b"; Third case, condition 6.3 "The full PDP packet corresponding to participant b is received, and the full PDP packet contains an identification field used to instruct all participants in the DDS communication network to enter the start phase".
[0136] Figure 4 This application provides a schematic diagram of the structure of a DDS communication device, as shown below. Figure 4 As shown, this method is applied between multiple participants, including our participants and other participants. For any one of our first participants, the current DDS communication phase of our first participant is the initiation phase of periodic multicast full PDP packets. The multicast mode of our first participant's full PDP packets includes periodic multicast and immediate multicast. When our first participant receives a full PDP packet multicast from any participant for the first time, it switches the multicast mode of the full PDP packets from periodic multicast to immediate multicast. The DDS communication device 400 provided in this embodiment includes:
[0137] The parsing module 401 is used to parse the received first PDP packet to obtain the parsing result. The parsing result includes a first identifier field corresponding to the first PDP packet and a GUID field corresponding to the second participant. The received first PDP packet is a PDP packet multicast by the second participant, and the first identifier field is used to indicate the participant GUID corresponding to all PDP packets received by the second participant.
[0138] The judgment module 402 is used to determine whether the parsing result contains an identifier field that indicates that the PDP packet is a trimmed packet; if the parsing result does not contain an identifier field that indicates that the PDP packet is a trimmed packet, then the first PDP packet is determined to be a full PDP packet.
[0139] The judgment module 402 is also used to determine whether our first participant has received the first PDP packet for the first time, based on the GUID field corresponding to the second participant and the participant GUID corresponding to the full PDP packets already received by our first participant.
[0140] The processing module 403 is used to determine that the first participant has received the full PDP packet of the second participant for the first time if the participant GUID corresponding to the full PDP packet already received by the first participant does not contain the GUID corresponding to the second participant.
[0141] The processing module 403 is also used to determine whether there is a participant GUID corresponding to our first participant in the first identifier field; if there is no participant GUID corresponding to our first participant in the participant GUID of the full PDP packets received by the second participant; then the multicast mode of our first participant's full PDP packets is switched from periodic multicast to immediate multicast.
[0142] Multicast module 404 is used to determine a second identifier field based on the participant GUID corresponding to the full PDP packets received by our first participant and the participant GUID corresponding to the second participant; the second identifier field is used to indicate the participant GUID corresponding to the full PDP packets received by our first participant.
[0143] The multicast module 404 is also used to configure the second identifier field in the second PDP packet corresponding to our first participant; to multicast the second PDP packet corresponding to our first participant so that multiple our participants and multiple other participants can receive the second PDP packet; wherein the second PDP packet is the full PDP packet corresponding to our first participant.
[0144] In one possible implementation, the processing module 403 is further configured to:
[0145] If the GUID of the second participant is present in the participant GUID corresponding to the full PDP packet received by our first participant, then it is determined that our first participant has not received the full PDP packet multicast by the second participant for the first time.
[0146] Then, according to the first multicast cycle, multicast the full PDP packets corresponding to our first participant; until the number of full PDP packets corresponding to our first participant reaches the preset number of multicasts, then switch the DDS communication phase of our first participant from the start phase of periodic multicast full PDP packets to the keep-alive phase.
[0147] or;
[0148] If our first participant receives the full PDP packet multicast by the second participant for the first time, the participant GUID corresponding to our first participant will be present in the participant GUID of the full PDP packet already received by the second participant.
[0149] Then, according to the first multicast cycle, multicast the full PDP packets corresponding to our first participant; until the number of full PDP packets corresponding to our first participant reaches the preset number of multicasts, then switch the DDS communication phase of our first participant from the start phase of periodic multicast full PDP packets to the keep-alive phase.
[0150] In one possible implementation, the multicast module 404 is further configured to:
[0151] If the parsing result contains an identifier field indicating that the PDP packet is a trimmed PDP packet, then the first PDP packet is determined to be a trimmed PDP packet.
[0152] Based on the GUID field corresponding to the second participant and the participant GUID corresponding to the full PDP packet received by our first participant, determine whether our first participant has received the full PDP packet corresponding to the second participant.
[0153] If the participant GUID corresponding to the full PDP packet received by our first participant does not exist in the GUID field corresponding to the second participant, then it is determined that our first participant has not received the full PDP packet corresponding to the second participant.
[0154] According to the first multicast cycle, the second PDP packet corresponding to our first participant is multicast so that multiple our participants and multiple other participants can receive the second PDP packet; wherein, the second PDP packet is configured with a third identification field, which is used to indicate that our first participant has not received the full PDP packet multicast by the second participant or any participant, and to indicate that all participants in the DDS communication network are switched to the startup phase.
[0155] In one possible implementation, the processing module 403 is further configured to:
[0156] Obtain the GUID field corresponding to all participants in the DDS communication network; based on the vendor field corresponding to all participants, determine whether there are other participants in the DDS communication network; wherein, the GUID field corresponding to each participant includes the vendor field corresponding to each participant;
[0157] If there are no other participants in the DDS communication network, the DDS communication phase of our first participant will be switched from the start phase of periodic multicast full PDP packets to the keep-alive phase of multicast trimmed PDP packets.
[0158] If there are other participants in the DDS communication network, the DDS communication phase of our first participant will be switched from the start phase of periodic multicast full PDP packets to the keep-alive phase of multicast full PDP packets.
[0159] In one possible implementation, the processing module 403 is further configured to:
[0160] Match the vendor field corresponding to each participant in the vendor field of all participants with the vendor field determined by our first participant;
[0161] If the vendor field of any participant in the vendor field of all participants is inconsistent with the vendor field determined by our first participant, then it is determined that there is a third-party participant in the DDS communication network.
[0162] If the vendor field corresponding to each participant in the full range of participants is consistent with the vendor field determined by our first participant, then it is determined that there are no other participants in the DDS communication network.
[0163] In one possible implementation, the multicast module 404 is further configured to:
[0164] When our first participant's DDS communication phase is in the keep-alive phase of multicast trimmed PDP packets, the received first PDP packet is parsed to obtain the parsing result.
[0165] Determine whether the parsing result contains an identifier field that indicates that the PDP packet is a trimmed PDP packet; if the parsing result contains an identifier field that indicates that the PDP packet is a trimmed PDP packet, then determine that the first PDP packet is a trimmed PDP packet;
[0166] According to the second multicast cycle, the third PDP packet corresponding to our first participant is multicast so that multiple our participants can receive the third PDP packet; wherein, the third PDP packet is obtained by trimming the full PDP packet corresponding to our first participant, and the third PDP packet is configured with a fourth identifier field, which is used to indicate that the third PDP packet has been trimmed.
[0167] In one possible implementation, the processing module 403 is further configured to:
[0168] If the parsing result does not contain an identifier field indicating that the PDP packet is a trimmed packet, then the first PDP packet is determined to be a full PDP packet.
[0169] Determine whether the parsing result contains the fifth identifier field. The fifth identifier field is used to indicate that the second participant has not received the full PDP packet multicast by our first participant or any participant, and to indicate that all participants in the DDS communication network should be switched to the startup phase.
[0170] If the first PDP packet is configured with a fifth identifier field, then the DDS communication phase of our first participant will be switched from the keep-alive phase of multicast trimmed PDP packets to the startup phase.
[0171] In one possible implementation, the processing module 403 is further configured to:
[0172] When our first participant's DDS communication phase is in the keep-alive phase of multicast full PDP packets;
[0173] The first received PDP packet is parsed to obtain the parsing result; based on the parsing result, the reception status of the first participant on our side of the first PDP packet is determined.
[0174] If the reception status indicates that our first participant has received the full PDP packet of the multicast from the second participant for the first time, and the participant GUID corresponding to our first participant does not exist in the first identifier field, then the DDS communication phase of our first participant will be switched from the keep-alive phase of the multicast full PDP packet to the startup phase.
[0175] If the reception status indicates that our participant received a trimmed PDP packet from the second participant's multicast before receiving the full PDP packet from the second participant, then our first participant's DDS communication phase will be switched from the keep-alive phase of the full PDP packet multicast to the startup phase.
[0176] or;
[0177] If our first participant receives the full PDP packet multicast by the second participant for the first time, the participant GUID corresponding to our first participant will be present in the participant GUID of the full PDP packet already received by the second participant.
[0178] Then we maintain the DDS communication phase of our first participant.
[0179] In one possible implementation, the processing module 403 is further configured to:
[0180] If no PDP packet is received from any participant multicast within the preset time, then obtain the GUIDs of all participants in the DDS communication network.
[0181] Based on the GUID of all participants, determine whether there are other participants in the DDS communication network; if there are no other participants in the DDS communication network, switch the DDS communication phase of our first participant from the keep-alive phase of multicast full PDP packets to the keep-alive phase of multicast trimmed PDP packets.
[0182] or;
[0183] If a multicast exit PDP packet is received from any participant, the exit PDP packet is used to instruct the participant to exit the DDS communication network.
[0184] Then obtain the GUIDs of all participants in the DDS communication network;
[0185] Based on the GUID of all participants, determine whether there are other participants in the DDS communication network; if there are no other participants in the DDS communication network, switch the DDS communication phase of our first participant from the keep-alive phase of multicast full PDP packets to the keep-alive phase of multicast trimmed PDP packets.
[0186] The DDS communication device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0187] Figure 5 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.
[0188] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.
[0189] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0190] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0191] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0192] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0193] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0194] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0195] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0196] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0197] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0198] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0199] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0200] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0201] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0202] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A DDS communication method applied between multiple participants, wherein the multiple participants include multiple self-participants and multiple other-participants, characterized in that, For any of our first participants, the current DDS communication phase of our first participant is the startup phase of periodic multicast full PDP packets. The multicast mode of our first participant's full PDP packets includes periodic multicast and immediate multicast. When our first participant receives a full PDP packet multicast from any participant for the first time, it switches the multicast mode of the full PDP packets from periodic multicast to immediate multicast. The method includes: The received first PDP packet is parsed to obtain a parsing result, which includes a first identifier field corresponding to the first PDP packet and a GUID field corresponding to the second participant; wherein, the received first PDP packet is a PDP packet multicast by the second participant, and the first identifier field is used to indicate the participant GUID corresponding to all PDP packets received by the second participant. Determine whether the parsing result contains an identifier field indicating that the PDP packet is a trimmed packet; if the parsing result does not contain an identifier field indicating that the PDP packet is a trimmed packet, then determine that the first PDP packet is a full PDP packet. Based on the GUID field corresponding to the second participant and the participant GUID corresponding to the full PDP packet already received by our first participant, determine whether our first participant is receiving the first PDP packet for the first time. If the GUID of the second participant is not present in the participant GUID corresponding to the full PDP packet already received by our first participant, then it is determined that our first participant has received the full PDP packet multicast by the second participant for the first time. Determine whether the participant GUID corresponding to our first participant exists in the first identifier field; if the participant GUID corresponding to our first participant does not exist in the participant GUID of the full PDP packets received by the second participant; then switch the multicast mode of our first participant's full PDP packets from periodic multicast to immediate multicast. Based on the participant GUID corresponding to the full PDP packets received by our first participant and the participant GUID corresponding to the second participant, a second identifier field is determined; the second identifier field is used to indicate the participant GUID corresponding to the full PDP packets received by our first participant. The second identifier field is configured in the second PDP packet corresponding to our first participant; the second PDP packet corresponding to our first participant is multicast so that the multiple participants and the multiple other participants receive the second PDP packet; wherein, the second PDP packet is the full PDP packet corresponding to our first participant.
2. The method according to claim 1, characterized in that, The method further includes: If the GUID of the second participant exists in the participant GUID corresponding to the full PDP packet received by our first participant, then it is determined that our first participant has not received the full PDP packet multicast by the second participant for the first time. Then, according to the first multicast cycle, multicast the full PDP packets corresponding to our first participant; until the number of full PDP packets corresponding to our first participant reaches the preset number of multicasts, then switch the DDS communication phase of our first participant from the start phase of periodic multicast full PDP packets to the keep-alive phase. or; If our first participant receives the full PDP packet multicast by the second participant for the first time, the participant GUID corresponding to our first participant will be present in the participant GUID of the full PDP packet already received by the second participant; Then, according to the first multicast cycle, multicast the full PDP packets corresponding to our first participant; until the number of full PDP packets corresponding to our first participant reaches the preset number of multicasts, then switch the DDS communication phase of our first participant from the start phase of periodic multicast full PDP packets to the keep-alive phase.
3. The method according to claim 1, characterized in that, The multicasting of the full PDP packets corresponding to our first participant according to the first multicast cycle includes: If the parsing result contains an identifier field indicating that the PDP packet is a trimmed PDP packet, then the first PDP packet is determined to be a trimmed PDP packet. Based on the GUID field corresponding to the second participant and the participant GUID corresponding to the full PDP packet received by our first participant, determine whether our first participant has received the full PDP packet corresponding to the second participant. If the participant GUID corresponding to the full PDP packet received by our first participant does not exist in the GUID field corresponding to the second participant, then it is determined that our first participant has not received the full PDP packet corresponding to the second participant. According to the first multicast cycle, the second PDP packet corresponding to our first participant is multicast so that the multiple our participants and the multiple other participants receive the second PDP packet; wherein, the second PDP packet is configured with a third identification field, the third identification field is used to indicate that our first participant has not received the full PDP packet multicast by the second participant or any participant, and is used to indicate that all participants in the DDS communication network are switched to the startup phase.
4. The method according to claim 2, characterized in that, The keep-alive phase includes multicast full PDP packets and multicast trimmed PDP packets. Switching the DDS communication phase of our first participant from the periodic multicast full PDP packet startup phase to the keep-alive phase includes: Obtain the GUID field corresponding to all participants in the DDS communication network; based on the vendor field corresponding to all participants, determine whether there are other participants in the DDS communication network; wherein, the GUID field corresponding to each participant includes the vendor field corresponding to each participant; If there are no other participants in the DDS communication network, the DDS communication phase of our first participant will be switched from the start-up phase of periodic multicast full PDP packets to the keep-alive phase of multicast trimmed PDP packets. If there are other participants in the DDS communication network, the DDS communication phase of our first participant will be switched from the start phase of periodic multicast full PDP packets to the keep-alive phase of multicast full PDP packets.
5. The method according to claim 4, characterized in that, The step of determining whether there are third-party participants in the DDS communication network based on the vendor fields corresponding to all participants includes: Match the vendor field corresponding to each participant in the vendor field of all participants with the vendor field determined by our first participant; If the vendor field of any participant in the vendor field corresponding to all participants is inconsistent with the vendor field determined by our first participant, then it is determined that there is a third-party participant in the DDS communication network. If the vendor field corresponding to each participant in the vendor field of the full participants is consistent with the vendor field determined by our first participant, then it is determined that there are no other participants in the DDS communication network.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: When our first participant's DDS communication phase is in the keep-alive phase of multicast trimmed PDP packets, the received first PDP packet is parsed to obtain the parsing result. Determine whether the parsing result contains an identifier field indicating that the PDP packet is a trimmed PDP packet; if the parsing result contains an identifier field indicating that the PDP packet is a trimmed PDP packet, then determine that the first PDP packet is a trimmed PDP packet; According to the second multicast cycle, the third PDP packet corresponding to our first participant is multicast so that multiple our participants can receive the third PDP packet; wherein, the third PDP packet is obtained by trimming the full PDP packet corresponding to our first participant, and the third PDP packet is configured with a fourth identification field, which is used to indicate that the third PDP packet has been trimmed.
7. The method according to claim 6, characterized in that, The method further includes: If the parsing result does not contain an identifier field indicating that the PDP packet is a trimmed packet, then the first PDP packet is determined to be a full PDP packet. Determine whether the parsing result contains a fifth identifier field. The fifth identifier field is used to indicate that the second participant has not received the full PDP packet multicast by the first participant or any participant, and to indicate that all participants in the DDS communication network are switched to the startup phase. If the first PDP packet is configured with a fifth identifier field, then the DDS communication phase of our first participant will be switched from the keep-alive phase of multicast trimmed PDP packets to the startup phase.
8. The method according to any one of claims 1-5, characterized in that, The method further includes: When our first participant's DDS communication phase is in the keep-alive phase of multicast full PDP packets; The first received PDP packet is parsed to obtain the parsing result; based on the parsing result, the reception status of the first participant on our side of the first PDP packet is determined. If the reception status indicates that our first participant has received the full PDP packet of the multicast from the second participant for the first time, and the participant GUID corresponding to our first participant does not exist in the first identifier field, then the DDS communication phase of our first participant will be switched from the keep-alive phase of the multicast full PDP packet to the startup phase. If the reception status indicates that our participant received a trimmed PDP packet from the second participant's multicast before receiving the full PDP packet from the second participant, then our first participant's DDS communication phase will be switched from the keep-alive phase of the full PDP packet multicast to the startup phase. or; If our first participant receives the full PDP packet multicast by the second participant for the first time, the participant GUID corresponding to our first participant will be present in the participant GUID of the full PDP packet already received by the second participant. Then we maintain the DDS communication phase of our first participant.
9. The method according to claim 8, characterized in that, The method further includes: If no PDP packet is received from any participant multicast within a preset time, then obtain the GUIDs of all participants in the DDS communication network. Based on the full participant GUID, determine whether there are other participants in the DDS communication network; if there are no other participants in the DDS communication network, switch the DDS communication phase of our first participant from the keep-alive phase of multicast full PDP packets to the keep-alive phase of multicast trimmed PDP packets. or; If a multicast exit PDP packet is received from any participant, the exit PDP packet is used to instruct the participant to exit the DDS communication network; Then obtain the GUIDs of all participants in the DDS communication network; Based on the full participant GUID, determine whether there are other participants in the DDS communication network; if there are no other participants in the DDS communication network, switch the DDS communication phase of our first participant from the keep-alive phase of multicast full PDP packets to the keep-alive phase of multicast trimmed PDP packets.
10. A DDS communication device, applied between multiple participants, said multiple participants including our participant and other participants, characterized in that, For any of our first participants, the current DDS communication phase of our first participant is the initiation phase of periodic multicast full PDP packets. The multicast mode of our first participant's full PDP packets includes periodic multicast and immediate multicast. When our first participant receives a full PDP packet multicast from any participant for the first time, it switches the multicast mode of the full PDP packets from periodic multicast to immediate multicast, including: The parsing module is used to parse the received first PDP packet to obtain a parsing result. The parsing result includes a first identifier field corresponding to the first PDP packet and a GUID field corresponding to the second participant. The received first PDP packet is a PDP packet multicast by the second participant, and the first identifier field is used to indicate the participant GUID corresponding to all PDP packets received by the second participant. The judgment module is used to determine whether the parsing result contains an identifier field that indicates that the PDP packet is a trimmed packet; if the parsing result does not contain an identifier field that indicates that the PDP packet is a trimmed packet, then the first PDP packet is determined to be a full PDP packet. The judgment module is also used to determine whether the first participant has received the first PDP packet for the first time, based on the GUID field corresponding to the second participant and the participant GUID corresponding to the full PDP packet received by the first participant. The processing module is configured to determine that the first participant has received the full PDP packet multicast by the second participant for the first time if the GUID corresponding to the participant in the full PDP packet already received by the first participant does not contain the GUID corresponding to the second participant. The processing module is further configured to determine whether there is a participant GUID corresponding to our first participant in the first identifier field; if there is no participant GUID corresponding to our first participant in the participant GUID corresponding to the full PDP packet received by the second participant; then switch the multicast mode of our first participant's full PDP packet from periodic multicast to immediate multicast. The multicast module is used to determine a second identifier field based on the participant GUID corresponding to the full PDP packets received by our first participant and the participant GUID corresponding to the second participant; the second identifier field is used to indicate the participant GUID corresponding to the full PDP packets received by our first participant. The multicast module is further configured to configure the second identifier field in the second PDP packet corresponding to our first participant; and to multicast the second PDP packet corresponding to our first participant so that the plurality of our participants and the plurality of other participants receive the second PDP packet; wherein the second PDP packet is the full PDP packet corresponding to our first participant.
11. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-9.
13. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-9.