Self-discovery communication method, system, device and readable storage medium between network participant containers based on DDS communication middleware

By encapsulating publisher and subscriber applications in containers based on DDS communication middleware, and using Weave Net to create a virtual large layer 2 network, self-discovery and seamless communication between publishers and subscribers in containers under different host environments is achieved, problems such as network isolation corruption and port conflict are solved, and a highly available and high-performance containerized distributed real-time system is built.

CN119172203BActive Publication Date: 2025-03-21HENAN SONGSHAN LAB IND RES INST CO LTD LUOYANG BRANCH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411623269.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-21
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

In the intersecting fields of the Internet of Things, containerization and network virtualization, it is difficult for the existing technology to realize self-discovery and seamless communication between publishers and subscribers within containers, especially in different host environments, where network isolation corruption, port conflicts and network failures are present.

Method used

The network participant's self-discovery communication method is adopted based on the DDS communication middleware. By encapsulating the publisher and subscriber applications in the container separately, and using Weave Net to create a virtual large layer 2 network, the network bottom layer is built using VXLAN tunnels, so that the container is on the same virtual LAN on different hosts. The publisher container and the subscriber container indicate their existence through multicast method and conducts peer-to-peer unicast communication when the topic matches.

Benefits of technology

It realizes automatic self-discovery and seamless communication between publishers and subscribers in containers under different host environments, ensures network isolation between containers and hosts, and at the same time expands the physical network boundary of DDS containers, improves the system's network interconnection capabilities, and builds a highly available and high-performance containerized distributed real-time system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172203B_ABST
    Figure CN119172203B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer data processing technology, and in particular to a self-discovery communication method, system, device and readable storage medium between network participant containers based on DDS communication middleware. Based on DDS communication middleware, network participant applications are independently encapsulated in containers, and Weave Net is used to create a virtual large layer 2 network. The virtual large layer 2 network uses VXLAN tunnels to build a network bottom layer so that containers deployed on different hosts can communicate in the same virtual local area network; publisher containers and subscriber containers broadcast discovery information through multicast communication to indicate their existence, and both parties obtain each other's IP and port information, and perform point-to-point unicast communication when the topic matches. While ensuring network isolation, the present invention greatly expands the physical network boundary of the DDS container, improves the network interconnection capability of the container in the system, and can build a highly available and high-performance containerized distributed real-time system that can meet the needs of multi-host and multi-node communication applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer data processing, and in particular to a self-discovery communication method, system, device and readable storage medium between network participant containers based on DDS communication middleware. Background Art

[0002] DDS is a service that focuses on reliable data distribution and reception in real-time systems. It adopts a publish-subscribe model, allowing different components or applications to exchange data in real time. Publishers publish data through the DDS communication middleware, which is responsible for real-time and reliable data distribution and transmission. Subscribers obtain data updates by subscribing to relevant data topics. DDS supports a wide range of QoS (Quality of Service) strategies, including reliability, persistence, transmission priority, etc., which can be configured according to needs. DDS is designed as a distributed architecture that supports communication and data exchange between multiple hosts and multiple network nodes. It is particularly suitable for data exchange and collaborative work between distributed components in complex systems, especially for scenarios with high requirements for real-time and reliability, such as military systems, autonomous driving systems, industrial automation systems, etc. The self-discovery mechanism of the DDS communication middleware allows participants in the network (including publishers and subscribers) to automatically identify each other and establish communication connections without human intervention. DDS uses multicast communication to broadcast discovery information. When a new participant joins the network, it sends a discovery message containing metadata about its own information (such as IP address, port number, published or subscribed topics, etc.) to a specific multicast address. Other participants in the network listen to the multicast address. Once they receive a new discovery message, they will update their internal participant list and establish a direct communication connection as needed. The DDS participant discovery phase is implemented using multicast, while the endpoint discovery phase, based on the communication established in the participant discovery phase, shares the information of data writers and data readers with each other to ensure that data between endpoints can be sent and received correctly.

[0003] Container is a lightweight and portable software packaging technology that packages applications and all their dependencies (including library files, environment variables and configuration files) in an independent execution environment, making them have good isolation and portability. Whether in the development environment, test environment or production environment, containers can ensure the consistency of software running behavior and running results in any environment. In the context of the rapid development of information technology today, DDS communication middleware has become the core of the distributed system communication field with its excellent real-time performance, flexibility and cross-platform capabilities. Container technology is widely used in virtualization and cloud native platforms due to its lightweight, good isolation and portability. Container network virtualization solutions (such as Weave Net) achieve communication between cross-host containers by building a virtual large Layer 2 network, breaking the physical network boundary of the container. However, in the frontier field where the three major fields of IoT, containerization and network virtualization collide, how to cleverly integrate DDS, containers and virtual networks to build a highly available and high-performance containerized distributed real-time system has not been explored and studied in depth by academia and industry, and there are few related patent applications and papers published. The difficulty lies in how publishers and subscribers can discover and communicate with each other after the publisher and subscriber applications are containerized. The simplest way is to use the container host network mode to put the container and the host in the same network, so that the publisher container and the subscriber container can directly discover and communicate with each other. However, this method has obvious disadvantages, such as destroying the network isolation between the host and the container, the possible port conflict between the host and the container, and the network failure of the container may directly affect the network status of the host. Summary of the invention

[0004] To this end, the present invention provides a self-discovery communication method, system, device and readable storage medium between containers of network participants based on DDS communication middleware, which can enable publishers and subscribers in containers in different host environments to automatically discover each other and communicate seamlessly, facilitate the construction of a highly available, high-performance containerized distributed real-time system, and improve the real-time and reliability of data interaction and collaborative work between network nodes.

[0005] According to the design scheme provided by the present invention, on the one hand, a self-discovery communication method between network participant containers based on DDS communication middleware is provided, comprising:

[0006] Based on the DDS communication middleware, network participant applications are independently encapsulated in containers, and WeaveNet is used to create a virtual large Layer 2 network. The virtual large Layer 2 network uses VXLAN tunnels to build the network bottom layer so that containers deployed on different hosts can communicate in the same virtual LAN. The network participants include publishers and subscribers.

[0007] The publisher container and the subscriber container are based on a virtual large Layer 2 network and use multicast to indicate their existence and discover each other, and perform point-to-point unicast communication when the topic matches.

[0008] As a self-discovery communication method between network participant containers based on DDS communication middleware of the present invention, further, network participant applications are independently encapsulated in containers based on DDS communication middleware, including:

[0009] Configuring a network host DDS communication middleware environment plug-in to build a publisher application and a subscriber application on the network host, wherein the environment plug-in includes a container engine and a Weave Net network plug-in;

[0010] The publisher image is generated using the publisher container image instruction file, and the subscriber image is generated using the subscriber container image instruction file, so that when the Weave network is started on the network host, the publisher image and the subscriber image are used to run the corresponding containers and add the containers to the Weave network.

[0011] As the network participant container self-discovery communication method based on DDS communication middleware of the present invention, further, the network host DDS communication middleware environment plug-in is configured, including:

[0012] Configure and compile the DDS communication middleware source code on the network host and generate the DDS library file;

[0013] The DDS data type is set by using the interface definition file, and the compilation and linking rules are set to build the publisher application and the subscriber application by using the DDS data type and the compilation and linking rules and by writing the publisher application code and the subscriber application code.

[0014] As a self-discovery communication method between network participant containers based on DDS communication middleware of the present invention, further, using the publisher container image instruction file to generate a publisher image, it includes:

[0015] Package and compress the publisher's application code project directory and files, and specify the publisher's container parameters in the publisher's container image instruction file, where the publisher's container parameters include the publisher's base image, the software package to be installed, environment variables, DDS library files, program execution entry points, and the publisher's application;

[0016] Builds a publisher image on a network host based on the packaged compressed data and publisher container parameters.

[0017] As a self-discovery communication method between network participant containers based on DDS communication middleware of the present invention, further, using the subscriber container image instruction file to generate a subscriber image, it includes:

[0018] Copying the publisher container image instruction file and the packaged compressed data on the network host to another network host, wherein the network host and the other network host are used to achieve self-discovery and communication between the publisher container and the subscriber container on different network hosts by establishing a data link;

[0019] On another network host, modify the CMD startup program in the publisher container image instruction file to the subscriber application, and generate a subscriber container image instruction file;

[0020] The subscriber container parameters are specified in the subscriber container image instruction file to build the subscriber image. The subscriber container parameters include the subscriber base image, the software package to be installed, the environment variables, the DDS library file, the program execution entry point and the subscriber application.

[0021] As a self-discovery communication method between network participant containers based on DDS communication middleware of the present invention, further, containers deployed on different hosts communicate in the same virtual local area network, including:

[0022] The publisher container and the subscriber container are connected to the Weave virtual switch through a virtual Ethernet pair, and the Weave virtual switch is connected to the kernel datapath virtual switch through a virtual Ethernet pair to enable communication between cross-host containers through the datapath virtual switch.

[0023] As a self-discovery communication method between network participant containers based on DDS communication middleware of the present invention, further, the publisher container and the subscriber container indicate their existence and discover each other through multicast based on the virtual large layer 2 network, and perform point-to-point unicast communication when the topic matches, including:

[0024] The publisher container and the subscriber container broadcast discovery information through multicast communication, and the discovery information carries the container's own IP port, the message to be published, and the message subject corresponding to the message to be published;

[0025] After obtaining the other party's IP port, the publisher container and the subscriber container match the message subject, and when the message subject matches successfully, the publisher container and the subscriber container perform point-to-point unicast communication.

[0026] In another aspect, the present invention further provides a network participant container self-discovery communication system based on DDS communication middleware, comprising: a network configuration module and a multicast communication module, wherein:

[0027] A network configuration module is used to encapsulate network participant applications in containers based on the DDS communication middleware, and use Weave Net to create a virtual large Layer 2 network. The virtual large Layer 2 network uses VXLAN tunnels to build the network bottom layer so that containers deployed on different hosts can communicate in the same virtual LAN. The network participants include publishers and subscribers.

[0028] The multicast communication module is used for publisher containers and subscriber containers to indicate their existence and discover each other through multicast based on a virtual large Layer 2 network, and to perform point-to-point unicast communication when the topics match.

[0029] In another aspect, the present invention further provides an electronic device, comprising:

[0030] at least one processor, and a memory coupled to the at least one processor;

[0031] The memory stores a computer program, and the computer program can be executed by the at least one processor to implement the method as described above.

[0032] In yet another aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the method described above can be implemented.

[0033] Beneficial effects of the present invention:

[0034] The present invention encapsulates the DDS publisher application and the subscriber application in independent containers respectively, uses Weave Net to create a virtual large Layer 2 network, and uses VXLAN tunnel technology at the bottom of the network, so that the containers deployed on different hosts are like being in the same local area network; the publisher container and the subscriber container broadcast discovery information through multicast communication to indicate their existence, and after both parties obtain each other's IP and port information, they conduct point-to-point unicast communication under the condition of subject matching. Finally, the self-discovery and communication between the publisher container and the subscriber container are realized, while ensuring the network isolation between the container and the host machine, and the self-discovery and communication between the publisher and subscriber containers of the DDS communication middleware on different hosts can be realized; under the condition of ensuring network isolation, the physical network boundary of the DDS container is greatly expanded, the network interconnection capability of the container in the system is improved, and a high-availability and high-performance containerized distributed real-time system can be constructed, which has good application prospects in the field of multi-host and multi-network node communication in autonomous driving systems and industrial automation systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a schematic diagram of the self-discovery communication process between network participant containers based on DDS communication middleware in the embodiment;

[0036] Figure 2 This is a schematic diagram of the self-discovery communication deployment process between publisher and subscriber containers in the embodiment;

[0037] Figure 3 It is a schematic diagram of generating a DDS library file in the embodiment;

[0038] Figure 4 This is a schematic diagram of the application environment configuration in the embodiment;

[0039] Figure 5 This is a schematic diagram of the application building process in the embodiment;

[0040] Figure 6 This is a schematic diagram of the application program construction product in the embodiment;

[0041] Figure 7 This is a schematic diagram of the entry point script content in the embodiment;

[0042] Figure 8 This is a schematic diagram of the publisher mirror instruction file in the embodiment;

[0043] Fig. 9 This is a schematic diagram of the publisher image building process in the embodiment;

[0044] Fig.10 This is a schematic diagram of a subscriber mirror instruction file in the embodiment;

[0045] Fig.11 This is a schematic diagram of the subscriber image building process in the embodiment;

[0046] Fig.12 This is a schematic diagram of a publisher container in the embodiment;

[0047] Fig.13 This is a schematic diagram of a subscriber container in the embodiment;

[0048] Fig.14 The diagram is a schematic diagram of the network communication principle between the publisher container and the subscriber container in the embodiment. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solutions and advantages of the present invention clearer and more understandable, the present invention is further described in detail below in conjunction with the accompanying drawings and technical solutions.

[0050] After the existing publisher application and subscriber application are containerized, the publisher and subscriber inside the container cannot discover and communicate with each other; even if the container host network mode is adopted to make the container and the host machine in the same network, the publisher and subscriber inside the container can discover and communicate with each other, but this method has its obvious disadvantages and seriously destroys the network isolation between the host machine and the container. Figure 1As shown, a self-discovery communication method between network participant containers based on DDS communication middleware is provided, comprising:

[0051] S101. Based on the DDS communication middleware, the network participant applications are independently encapsulated in containers, and Weave Net is used to create a virtual large Layer 2 network. The virtual large Layer 2 network uses VXLAN tunnels to build the network bottom layer so that containers deployed on different hosts can communicate in the same virtual LAN. The network participants include publishers and subscribers.

[0052] Weave Net is a network plug-in designed for containers, aiming to solve the network problems of containerized applications when communicating across hosts. It provides a large virtual Layer 2 network, allowing containers deployed on different hosts to communicate directly as if they were in the same LAN. In this network, each container is assigned a virtual Ethernet address, and this address is unique in the entire Weave network. Weave Net uses VXLAN network virtualization technology at the bottom layer, and transmits Layer 2 Ethernet frames across the Layer 3 network through UDP encapsulation, allowing the creation of large Layer 2 virtual networks that span physical network boundaries.

[0053] Specifically, based on the DDS communication middleware, the network participant applications are independently encapsulated in containers, which can be set to include the following contents:

[0054] Configuring a network host DDS communication middleware environment plug-in to build a publisher application and a subscriber application on the network host, wherein the environment plug-in includes a container engine and a Weave Net network plug-in;

[0055] The publisher image is generated using the publisher container image instruction file, and the subscriber image is generated using the subscriber container image instruction file, so that when the Weave network is started on the network host, the publisher image and the subscriber image are used to run the corresponding containers and add the containers to the Weave network.

[0056] Among them, the network host DDS communication middleware environment plug-in is configured and can be set to include:

[0057] Configure and compile the DDS communication middleware source code on the network host and generate the DDS library file;

[0058] The DDS data type is set by using the interface definition file, and the compilation and linking rules are set to build the publisher application and the subscriber application by using the DDS data type and the compilation and linking rules and by writing the publisher application code and the subscriber application code.

[0059] Among them, using the publisher container image instruction file to generate the publisher image may include:

[0060] Package and compress the publisher's application code project directory and files, and specify the publisher's container parameters in the publisher's container image instruction file, where the publisher's container parameters include the publisher's base image, the software package to be installed, environment variables, DDS library files, program execution entry points, and the publisher's application;

[0061] Builds a publisher image on a network host based on the packaged compressed data and publisher container parameters.

[0062] Among them, the subscriber image is generated using the subscriber container image instruction file, which can be set to include:

[0063] Copying the publisher container image instruction file and the packaged compressed data on the network host to another network host, wherein the network host and the other network host are used to achieve self-discovery and communication between the publisher container and the subscriber container on different network hosts by establishing a data link;

[0064] On another network host, modify the CMD startup program in the publisher container image instruction file to the subscriber application, and generate a subscriber container image instruction file;

[0065] The subscriber container parameters are specified in the subscriber container image instruction file to build the subscriber image. The subscriber container parameters include the subscriber base image, the software package to be installed, the environment variables, the DDS library file, the program execution entry point and the subscriber application.

[0066] For container communication between host A and host B, such as Figure 2 As shown, install the Docker engine and Weave Net network plug-in on host A and host B. Configure and compile the DDS source code on host A to generate the DDS library file, as shown in Figure 3 As shown. Use IDL files to define DDS data types, write publisher application and subscriber application codes, and use CMakeLists.txt to define compilation and linking rules. The IDL files, application source code, and CMakeLists.txt in the project are as follows: Figure 4 The process of building the publisher application function program and the subscriber application program is as follows Figure 5 As shown, the constructed product is Figure 6 As shown. You can write the image instruction file Dockerfile ENTRYPOINT entry point script program entrypoint.sh, the script content is as follows Figure 7 shown.

[0067] Will Figure 7As shown, compress the publisher application code project directory RTSB directory and its files into RTSB.tar.gz. In the publisher Dockerfile file, specify the base image, software to be installed, environment variables, DDS library files and configuration files, ENTRYPOINT entry point script, and publisher application. The publisher image Dockerfile is as follows: Figure 8 As shown. Build the publisher image on host A. The construction process is as follows Fig. 9 As shown. Copy the Dockerfile and RTSB.tar.gz on host A to host B, and modify the CMD startup program in the Dockerfile to the subscriber application. In the subscriber Dockerfile, specify the base image, software to be installed, environment variables, DDS library files and configuration files, ENTRYPOINT entry point script, and subscriber application. The subscriber image Dockerfile is as follows: Fig.10 Build the subscriber image on host B. The construction process is as follows Fig.11 shown.

[0068] The IP of host A is 192.168.135.137 / 24. Create and start the weave network 10.20.0.0 / 16 on host A. Fig.12 As shown, start the publisher image on host A, run the publisher container, and attach the publisher container to the weave network. The publisher container IP is 10.20.0.1 / 16. The IP of host B is 192.168.135.138 / 24. Start and join the weave network where host A is located on host B, as shown in Fig.13 As shown, start the subscriber image on host B, run the subscriber container, and attach the subscriber container to the weave network. The subscriber container IP is 10.20.192.0 / 16.

[0069] Among them, containers deployed on different hosts communicate in the same virtual LAN, including:

[0070] The publisher container and the subscriber container are connected to the Weave virtual switch through a virtual Ethernet pair, and the Weave virtual switch is connected to the kernel datapath virtual switch through a virtual Ethernet pair to enable communication between cross-host containers through the datapath virtual switch.

[0071] The publisher container and the subscriber container both belong to the virtual large Layer 2 network created by weave. They are in the same logical LAN in the virtual network. The underlying weave network uses VXLAN tunnel technology to enable the publisher application in the publisher container on host A and the subscriber application in the subscriber container on host B to automatically discover each other and establish a data link. Through the established data link, the publisher application in the publisher container on host A sends data, and the subscriber application in the subscriber container on host B receives the data, thus realizing self-discovery and communication between the DDS publisher container and the DDS subscriber container.

[0072] S102: The publisher container and the subscriber container indicate their existence and discover each other through multicast based on the virtual large layer 2 network, and perform point-to-point unicast communication when the topics match.

[0073] Specifically, the publisher container and the subscriber container broadcast discovery information through multicast communication, and the discovery information carries the container's own IP port, the message to be published, and the message subject corresponding to the message to be published; the publisher container and the subscriber container match the message subject after obtaining the other party's IP port, and when the message subject matches successfully, the publisher container and the subscriber container perform point-to-point unicast communication.

[0074] like Fig.14 As shown in the figure, the network communication principle between the publisher container and the subscriber container, all containers are connected to the weave virtual switch through veth pair, the weave virtual switch is connected to the kernel's datapath virtual switch through veth pair, cross-host containers communicate through datapath vxlan, and physical communication is through ens33 network interface. The publisher container and the subscriber container broadcast discovery information through multicast communication to indicate their existence. After both parties obtain each other's IP and port information, they can conduct point-to-point unicast communication if the topic matches. Among them, the network interface and data flow can be summarized as follows:

[0075] Network Interface:

[0076] 1)ethwe and vethwepl2298@if13 are veth pairs, which connect the container to the weave virtual switch.

[0077] 2) Weave and datapath are two virtual switches. Weave is responsible for connecting all containers to the weave network, and datapath is responsible for sending and receiving data in the VXLAN tunnel between hosts.

[0078] 3)vethwe-bridge@vethwe-datapath and vethwe-datapath@vethwe-bridge are vethpairs, responsible for connecting the two virtual switches, weave and datapath.

[0079] 4) vxlan-6784 is the vxlan network interface, and weave hosts communicate through VXLAN tunnels.

[0080] 5) ens33 is a physical network card, responsible for sending container VXLAN data packets to the specified peer physical network card.

[0081] Data flow from the rtsb_pub_1 publisher container on HostA to the rtsb_sub_1 subscriber container on HostB:

[0082] 1) The rtsb_pub_1 publisher container on HostA (IP is 10.20.0.1 / 16) is connected to the weave virtual switch through ethwe.

[0083] 2) The weave virtual switch is connected to the datapath virtual switch through vethwe-bridge@vethwe-datapath and vethwe-datapath@vethwe-bridge.

[0084] 3) Through these two virtual switches, the traffic from the rtsb_pub_1 publisher container is forwarded to the vxlan-6784 network interface.

[0085] 4) On vxlan-6784, the rtsb_pub_1 publisher container Ethernet frame is used as the payload, and the VXLAN frame header, outer UDP header, outer IP header, and outer Ethernet frame header are added to construct a VXLAN Ethernet frame with the original Ethernet frame as the payload.

[0086] 5) The VXLAN Ethernet frame after secondary encapsulation is sent through HostA's ens33 physical network interface (IP is 192.168.135.137 / 24).

[0087] 6) HostB’s ens33 physical network interface (IP is 192.168.135.138 / 24) receives the VXLAN Ethernet frame.

[0088] 7) vxlan-6784 on HostB decapsulates the VXLAN Ethernet frame and extracts the original Ethernet frame inside.

[0089] 8) Forward the original Ethernet frame to the subscriber container rtsb_sub_1 (IP is 10.20.192.0 / 16) through the datapath and weave virtual switch.

[0090] Further, based on the above method, an embodiment of the present invention also provides a network participant container self-discovery communication system based on DDS communication middleware, comprising: a network configuration module and a multicast communication module, wherein:

[0091] A network configuration module is used to encapsulate network participant applications in containers based on the DDS communication middleware, and use Weave Net to create a virtual large Layer 2 network. The virtual large Layer 2 network uses VXLAN tunnels to build the network bottom layer so that containers deployed on different hosts can communicate in the same virtual LAN. The network participants include publishers and subscribers.

[0092] The multicast communication module is used for publisher containers and subscriber containers to indicate their existence and discover each other through multicast based on a virtual large Layer 2 network, and to perform point-to-point unicast communication when the topics match.

[0093] In the embodiment of this case, the publisher and subscriber applications of the DDS communication middleware are encapsulated into containers, and the communication between cross-host containers is realized by relying on the high-performance virtualized large layer 2 network built by Weave Net. Combined with the self-discovery mechanism of the DDS communication middleware, the self-discovery and communication between the DDS publisher application and the subscriber application inside the container are innovatively solved under the premise of ensuring the isolation of the host and container networks. At the same time, the deep integration of the three advanced technologies of DDS communication middleware, containers and network virtualization can build a distributed containerized real-time data distribution system with real-time data distribution, high flexibility and scalability, and plug-and-play network intercommunication to meet the network communication of multiple hosts and multiple nodes.

[0094] Furthermore, an embodiment of the present invention further provides an electronic device, including:

[0095] at least one processor, and a memory coupled to the at least one processor;

[0096] The memory stores a computer program, and the computer program can be executed by the at least one processor to implement the method as described above.

[0097] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the method described above can be implemented.

[0098] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0099] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0100] The units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation is not considered to be beyond the scope of the present invention.

[0101] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits, and accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of software function modules. The present invention is not limited to any specific form of combination of hardware and software.

[0102] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A self-discovery communication method between network participant containers based on DDS communication middleware, characterized in that: Include: Based on the DDS communication middleware, network participant applications are independently encapsulated in containers, and a virtual large Layer 2 network is created using Weave Net. The virtual large Layer 2 network uses VXLAN tunnels to build a network bottom layer so that containers deployed on different hosts can communicate in the same virtual local area network. The network participants include publishers and subscribers. Wherein, based on the DDS communication middleware, network participant applications are independently encapsulated in containers, including: configuring the network host DDS communication middleware environment plug-in to build publisher applications and subscriber applications on the network host, and the environment plug-in includes a container engine and a Weave Net network plug-in; using the publisher container image instruction file to generate a publisher image, and using the subscriber container image instruction file to generate a subscriber image, so that when the Weave network is started on the network host, the publisher image and the subscriber image are used to run the corresponding container, and the container is added to the Weave network; containers deployed on different hosts communicate in the same virtual local area network, including: the publisher container and the subscriber container are connected to the Weave virtual switch through a virtual Ethernet pair, and the Weave virtual switch is connected to the kernel data path virtual switch through a virtual Ethernet pair, so that cross-host containers communicate through the data path virtual switch; The publisher container and the subscriber container broadcast discovery information through multicast communication, and the discovery information carries the container's own IP port, the message to be published, and the message subject corresponding to the message to be published; the publisher container and the subscriber container match the message subject after obtaining the other party's IP port, and when the message subject matches successfully, the publisher container and the subscriber container perform point-to-point unicast communication, so that the publisher and subscriber in the container in different host environments can automatically discover each other and communicate seamlessly.

2. The method for self-discovery communication between network participant containers based on DDS communication middleware according to claim 1, characterized in that: Configure the network host DDS communication middleware environment plug-in, including: Configure and compile the DDS communication middleware source code on the network host and generate the DDS library file; The DDS data type is set by using the interface definition file, and the compilation and linking rules are set to build the publisher application and the subscriber application by using the DDS data type and the compilation and linking rules and by writing the publisher application code and the subscriber application code.

3. The method for self-discovery communication between network participant containers based on DDS communication middleware according to claim 1, characterized in that: Generate a publisher image using the publisher container image instruction file, including: Package and compress the publisher's application code project directory and files, and specify the publisher's container parameters in the publisher's container image instruction file, where the publisher's container parameters include the publisher's base image, the software package to be installed, environment variables, DDS library files, program execution entry points, and the publisher's application; Builds a publisher image on a network host based on the packaged compressed data and publisher container parameters.

4. The method for self-discovery communication between network participant containers based on DDS communication middleware according to claim 3, characterized in that: Generate a subscriber image using the subscriber container image instruction file, including: Copying the publisher container image instruction file and the packaged compressed data on the network host to another network host, wherein the network host and the other network host are used to achieve self-discovery and communication between the publisher container and the subscriber container on different network hosts by establishing a data link; On another network host, modify the CMD startup program in the publisher container image instruction file to the subscriber application, and generate a subscriber container image instruction file; The subscriber container parameters are specified in the subscriber container image instruction file to build the subscriber image. The subscriber container parameters include the subscriber base image, the software package to be installed, the environment variables, the DDS library file, the program execution entry point and the subscriber application.

5. A self-discovery communication system between network participant containers based on DDS communication middleware, characterized in that: The method according to claim 1 is implemented, comprising: a network configuration module and a multicast communication module, wherein: A network configuration module is used to encapsulate network participant applications in containers based on the DDS communication middleware, and use Weave Net to create a virtual large Layer 2 network. The virtual large Layer 2 network uses VXLAN tunnels to build the network bottom layer so that containers deployed on different hosts can communicate in the same virtual LAN. The network participants include publishers and subscribers. The multicast communication module is used for publisher containers and subscriber containers to indicate their existence and discover each other through multicast based on a virtual large Layer 2 network, and to perform point-to-point unicast communication when the topics match.

6. An electronic device, characterized in that: include: at least one processor, and a memory coupled to the at least one processor; The memory stores a computer program, and the computer program can be executed by the at least one processor to implement the method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 4 can be implemented.

Citation Information

Patent Citations

  • DDS distributed application simulation method and system

    CN115378822A

  • Network configuration method and apparatus, electronic device, and storage medium

    WO2024065182A1