A LVC-DE distributed synthetic environment service discovery method based on DDS and multicast communication
By adopting a service discovery method based on DDS and multicast communication in the LVC-DE distributed synthesis environment, the problem that service discovery in the existing technology is easily affected by network status is solved, achieving higher reliability and real-time performance, and reducing network load and false alarm rate.
Patent Information
- Application Number
- CN202210907433.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-07-29
AI Technical Summary
The existing service discovery method in the LVC-DE distributed synthesis environment is easily affected by network status, leading to online service misjudgment and communication congestion problems, and affecting the real-time nature of information transmission.
Adopt a service discovery method based on DDS and multicast communication, select the service discovery mechanism in the local configuration file, and select the DDS topic mode or multicast mode according to the system scale and reliability requirements to achieve service discovery. Specific steps include reading configuration files, creating UDP multicast sockets or DDS domain participant factories, registering and subscribing to topics, and processing online/offline notification messages.
It effectively avoids the discovery of service anomalies caused by network status, reduces the false alarm rate of abnormal network status, reduces the network load by about 20%, and reduces the false alarm rate by about 30%.
Smart Images

Figure CN115473931B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of LVC-DE distributed synthetic environment services, and in particular to a LVC-DE distributed synthetic environment service discovery method based on DDS and multicast communication. Background Art
[0002] The LVC-DE distributed synthesis environment is used to interconnect various real SL, virtual SV or constructed SC test resources distributed in different areas and belonging to different units. It supports information sharing, resource sharing and reuse, as well as interconnection and interoperability between systems. It can also combine various resources according to the requirements of the test tasks to quickly build a large-scale distributed test system.
[0003] In the LVC-DE distributed synthetic environment, various types of experimental resources provide information sharing capabilities in the form of services. Therefore, service discovery is the basis for large-scale distributed experimental systems to complete experimental tasks. Existing distributed experimental systems mostly use a unicast heartbeat mechanism to implement service discovery, that is, service queries are implemented by broadcasting heartbeat detection packets between experimental resources at certain time intervals. The implementation principle of this method is simple, but when the network loses packets or is congested, online service misjudgments are prone to occur. In addition, this method requires the regular sending of detection packets. When the large-scale distributed experimental system involves a large number of experimental resources, the amount of detection packets sent is likely to cause communication congestion, affecting the real-time transmission of information in the entire LVC-DE distributed synthetic environment.
[0004] Data Distribution Service (DDS) is a software design specification for distributed real-time systems based on publish / subscribe mechanisms and high real-time communication developed by the Object Management Group (OMG). It standardizes the interfaces and behaviors of the data distribution process. DDS uses a global data space and is independent of the central server. The interactions between entities in the system are data-centric, which improves communication efficiency. DDS provides comprehensive support for more than 20 configurable QoS policies. Applications can use QoS policies to prioritize different data topics and information flows, control the number of middleware history caches, ensure reliable information delivery, the rate at which data is sent, the time that subscribers of information wait for data and resources, and adapt to low-bandwidth or high-latency links.
[0005] Multicast, also known as multi-target broadcast or multicast, is a method of communication between a sender and multiple receivers. It allows the message to be sent to a selected subset of all possible destinations, that is, to send information to multiple addresses that are clearly specified. Therefore, we make improvements on this and propose a LVC-DE distributed synthetic environment service discovery method based on DDS and multicast communication. Summary of the invention
[0006] The purpose of the present invention is to solve the problems in the existing background technology. In order to achieve the above invention purpose, the present invention provides the following technical solutions: a LVC-DE distributed synthetic environment service discovery method based on DDS and multicast communication, comprising the following steps:
[0007] S1 Service discovery mode selection. In the LVC-DE distributed synthetic environment, an independent local configuration file configure.xml is provided for each experimental resource. When the experimental resource is started, the local configuration file is read to determine whether the service discovery mechanism is based on the multicast mode or the DDS built-in topic mode.
[0008] S2 is a service discovery process based on DDS topics. The service discovery mechanism based on DDS topics is applied to scenarios with small system scale and high reliability requirements.
[0009] S3 is a service discovery process based on multicast communication. The service discovery mechanism based on multicast communication is applied to scenarios with large system scale and low reliability requirements.
[0010] As a preferred technical solution of the present invention, S1 service discovery method selection includes the following steps:
[0011] After the S1-1 test resource is started, the local configuration file configure.xml is read and the local configuration information is parsed according to each keyword;
[0012] S1-2 determines the value of the global notification mode configuration item IsRTPSDiscoverType. If the value is true, execute step S1-3-1. If the value is false, execute step S1-3-2.
[0013] S1-3-1 If the value of IsRTPSDiscoverType is true, set the global notification flag to multicast mode and go to step S1-4;
[0014] S1-3-2 If the value of IsRTPSDiscoverType is false, set the global notification flag to DDS topic mode and go to step S1-5;
[0015] S1-4 creates a UDP multicast network socket, binds the local network IP address and port, and joins the multicast group for service discovery, and then goes to step S1-8.
[0016] As a preferred technical solution of the present invention, S1 service discovery mode selection further includes: S1-5 creating a DDS domain participant factory, and creating a domain participant for service discovery based on the DDS domain participant factory;
[0017] S1-6 creates publishers and subscribers for service discovery based on domain participants, registers topic types for service discovery, and creates corresponding service discovery topics;
[0018] S1-7 creates a data writer for the service discovery topic based on the publisher, and creates a data reader for the service discovery topic based on the subscriber;
[0019] S1-8 waits for receiving service discovery notification messages from other experimental resources.
[0020] As a preferred technical solution of the present invention, S2 is a service discovery process based on DDS topics, including the following steps:
[0021] S2-1 determines whether data of the service discovery topic is received based on the service discovery topic created in step S1-6;
[0022] S2-2-1 If no data from the service discovery topic is received, go to step S2-5;
[0023] S2-2-2 If the data of the service discovery topic is received, the data reader based on the service discovery topic created in step S1-7 obtains the online / offline notification of the test resource;
[0024] S2-3 determines the notification type of the test resource. If it is a test resource offline notification, go to step S2-10;
[0025] S2-4 adds the experimental resource to the online service list and updates its last online time;
[0026] S2-5 determines whether the activity of the service discovery topic has changed. If the activity of the service discovery topic has not decreased, go to step S2-7
[0027] S2-6 adds the experimental resources with reduced activity to the offline list to be confirmed;
[0028] S2-7 determines whether the timing period TS is reached. The value can be set according to the system scale. The default value is 20 milliseconds. If the timing period T is not reached, go to step S2-1.
[0029] As a preferred technical solution of the present invention, S2 is a service discovery process based on a DDS topic, further comprising: S2-8 sending a test resource online notification based on the data writer of the service discovery topic created in step S1-7;
[0030] S2-9 checks the last online time of the test resource in the offline list to be confirmed. If the last online time of the test resource does not exceed 2T, go to step S2-11;
[0031] S2-10 Remove the experimental resources from the online service list;
[0032] S2-11 determines whether the test resource has closed service discovery. If so, go to step S2-1;
[0033] S2-12 sends a test resource offline notification based on the data writer of the service discovery topic created in step S1-7.
[0034] As a preferred technical solution of the present invention, S3 is a service discovery process based on multicast communication, comprising the following steps:
[0035] S3-1 determines whether a test resource online / offline notification is received based on the UDP multicast network socket created in step S1-4;
[0036] S3-2 determines the notification type of the test resource. If it is an offline notification of the test resource, go to step S3-7;
[0037] S3-3 adds the experimental resource to the online service list and updates its last online time;
[0038] S3-4 determines whether the timing cycle T has been reached. If the timing cycle T has not been reached, go to step S3-1;
[0039] S3-5 sends a test resource online notification based on the UDP multicast network socket created in step S1-4.
[0040] As a preferred technical solution of the present invention, S3 is a service discovery process based on multicast communication, and further includes: S3-6 checks the last online time of the test resource in the offline list to be confirmed, and if the last online time of the test resource does not exceed 2T, goes to step S3-8;
[0041] S3-7 removes the experimental resources from the online service list;
[0042] S3-8 determines whether the test resource has closed service discovery. If so, go to step S3-1.
[0043] S3-9 sends a test resource offline notification based on the UDP multicast network socket created in step S1-4.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] In the scheme of the present invention:
[0046] 1. The service discovery method based on DDS and multicast communication proposed in the present invention can solve the problem that the current LVC-DE distributed synthesis environment is easily affected by the network status and easily causes network communication congestion when realizing service discovery, effectively avoids the abnormal service discovery triggered by the network's own status, and reduces the false alarm rate of abnormal network status;
[0047] 2. The LVC-DE distributed synthetic environment service discovery method based on DDS and multicast communication proposed in the present invention has been successfully applied to the electromagnetic environment comprehensive test verification system, reducing the network load generated by service discovery by about 20%, and reducing the false alarm rate of abnormal network status by about 30%. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A flow chart for selecting a service discovery method provided by the present invention;
[0049] Figure 2 The basic flow chart of service discovery based on DDS topic provided by the present invention;
[0050] Figure 3 A basic flow chart of service discovery based on multicast communication provided by the present invention;
[0051] Figure 4 A content graph of a DDS topic for service discovery provided by the present invention;
[0052] Figure 5 The multicast communication content for service discovery provided by the present invention. DETAILED DESCRIPTION
[0053] To make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be described clearly and completely in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them.
[0054] Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the invention claimed for protection, but merely represents some embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the invention product is usually placed when in use, or the orientation or positional relationship commonly understood by those skilled in the art. Such terms are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0056] like Figure 1-Figure 5 ,This implementation method proposes a service discovery method for a LVC-DE distributed ,composite environment based on DDS and multicast communication.,S1.,Service discovery mode selection.,In the LVC-DE distributed synthetic environment, an independent ,local configuration file configure.xml is provided for each experimental resource.,When the experimental resource is started, the local configuration file is read to ,determine whether the service discovery mechanism adopted is based on the ,multicast mode or based on the DDS built-in topic mode;
[0057] S1 service discovery method selection includes the following steps:
[0058] After the S1-1 test resource is started, the local configuration file configure.xml is read and the local configuration information is parsed according to each keyword;
[0059] S1-2 determines the value of the global notification mode configuration item IsRTPSDiscoverType. If the value is true, execute step S1-3-1. If the value is false, execute step S1-3-2.
[0060] S1-3-1 If the value of IsRTPSDiscoverType is true, set the global notification flag to multicast mode and go to step S1-4;
[0061] S1-3-2 If the value of IsRTPSDiscoverType is false, set the global notification flag to DDS topic mode and go to step S1-5;
[0062] S1-4 creates a UDP multicast network socket, binds the local network IP address and port, and joins the multicast group for service discovery, and then goes to step S1-8.
[0063] S1 service discovery method selection, further comprising: S1-5 creating a DDS domain participant factory, and creating a domain participant for service discovery based on the DDS domain participant factory;
[0064] S1-6 creates publishers and subscribers for service discovery based on domain participants, registers topic types for service discovery, and creates corresponding service discovery topics;
[0065] S1-7 creates a data writer for the service discovery topic based on the publisher, and creates a data reader for the service discovery topic based on the subscriber;
[0066] S1-8 waits for receiving service discovery notification messages from other experimental resources.
[0067] The service discovery process of S2 based on DDS topics includes the following steps:
[0068] S2-1 determines whether data of the service discovery topic is received based on the service discovery topic created in step S1-6;
[0069] S2-2-1 If no data from the service discovery topic is received, go to step S2-5;
[0070] S2-2-2 If the data of the service discovery topic is received, the data reader based on the service discovery topic created in step S1-7 obtains the online / offline notification of the test resource;
[0071] S2-3 determines the notification type of the test resource. If it is a test resource offline notification, go to step S2-10;
[0072] S2-4 adds the experimental resource to the online service list and updates its last online time;
[0073] S2-5 determines whether the activity of the service discovery topic has changed. If the activity of the service discovery topic has not decreased, go to step S2-7
[0074] S2-6 adds the experimental resources with reduced activity to the offline list to be confirmed;
[0075] S2-7 determines whether the timing period TS is reached. The value can be set according to the system scale. The default value is 20 milliseconds. If the timing period T is not reached, go to step S2-1.
[0076] S2 is a service discovery process based on the DDS topic, further comprising: S2-8 sending a test resource online notification based on the data writer of the service discovery topic created in step S1-7;
[0077] S2-9 checks the last online time of the test resource in the offline list to be confirmed. If the last online time of the test resource does not exceed 2T, go to step S2-11;
[0078] S2-10 Remove the experimental resources from the online service list;
[0079] S2-11 determines whether the test resource has closed service discovery. If so, go to step S2-1;
[0080] S2-12 sends a test resource offline notification based on the data writer of the service discovery topic created in step S1-7.
[0081] The S3 service discovery process based on multicast communication includes the following steps:
[0082] S3-1 determines whether a test resource online / offline notification is received based on the UDP multicast network socket created in step S1-4;
[0083] S3-2 determines the notification type of the test resource. If it is an offline notification of the test resource, go to step S3-7;
[0084] S3-3 adds the experimental resource to the online service list and updates its last online time;
[0085] S3-4 determines whether the timing cycle T has been reached. If the timing cycle T has not been reached, go to step S3-1;
[0086] S3-5 sends a test resource online notification based on the UDP multicast network socket created in step S1-4.
[0087] S3 is a service discovery process based on multicast communication, and further includes: S3-6 checking the last online time of the test resource in the offline list to be confirmed, and if the last online time of the test resource does not exceed 2T, going to step S3-8;
[0088] S3-7 removes the experimental resources from the online service list;
[0089] S3-8 determines whether the test resource has closed service discovery. If so, go to step S3-1.
[0090] S3-9 sends a test resource offline notification based on the UDP multicast network socket created in step S1-4.
[0091] Working principle: During the use of the present invention, S1 service discovery method selection, in the LVC-DE distributed synthesis environment, an independent local configuration file configure.xml is provided for each test resource. When the test resource is started, the local configuration file is read to determine whether the service discovery mechanism adopted is based on multicast mode or DDS built-in topic mode; S2 service discovery process based on DDS topic, the service discovery mechanism based on DDS topic is applied to scenarios with small system scale and high reliability requirements; S3 service discovery process based on multicast communication, the service discovery mechanism based on multicast communication is applied to scenarios with large system scale and low reliability requirements. S1 service discovery method selection, including the following steps: S1-1 After the test resource is started, read the local configuration file configure.xml, and parse the local configuration information according to each keyword; S1-2 judge the value of the global notification mode configuration item IsRTPSDiscoverType, if the value is true, execute step S1-3-1, if the value is false, execute step S1-3-2; S1-3-1 If the value of IsRTPSDiscoverType is true, set the global notification flag to multicast mode, and go to step S1-4; S1-3-2 If the value of IsRTPSDiscoverType is false, set the global notification flag to DDS topic mode, and go to step S1-5; S1-4 Create a UDP multicast network socket, bind the local network IP address and port, and join the multicast group for service discovery, and go to step S1-8. S1 service discovery method selection also includes: S1-5 creating a DDS domain participant factory, and creating domain participants for service discovery based on the DDS domain participant factory; S1-6 creating publishers and subscribers for service discovery based on domain participants, registering topic types for service discovery, and creating corresponding service discovery topics; S1-7 creating a data writer for the service discovery topic based on the publisher, and creating a data reader for the service discovery topic based on the subscriber; S1-8 waiting to receive service discovery notification messages from other experimental resources.S2 is a service discovery process based on DDS topics, including the following steps: S2-1 determines whether the data of the service discovery topic is received based on the service discovery topic created in step S1-6; S2-2-1 if the data of the service discovery topic is not received, go to step S2-5; S2-2-2 if the data of the service discovery topic is received, then the data reader of the service discovery topic created in step S1-7 obtains the online / offline notification of the experimental resource; S2-3 determines the notification type of the experimental resource. If it is an offline notification of the experimental resource, go to step S2-10; S2-4 adds the experimental resource to the online service list and updates its last online time; S2-5 determines whether the activity of the service discovery topic has changed. If the activity of the service discovery topic has not decreased, go to step S2-7 S2-6 adds the experimental resources with reduced activity to the offline list to be confirmed; S2-7 determines whether the timing period TS is reached. The value can be set according to the system scale. The default value is 20 milliseconds. If the timing period T is not reached, go to step S2-1. S2 is a service discovery process based on the DDS topic, and also includes: S2-8, based on the data writer of the service discovery topic created in step S1-7, sends an online notification of the experimental resource; S2-9 checks the last online time of the experimental resource in the offline list to be confirmed. If the last online time of the experimental resource does not exceed 2T, go to step S2-11; S2-10 deletes the experimental resource from the online service list; S2-11 determines whether the service discovery of the experimental resource is closed. If it is closed, go to step S2-1; S2-12, based on the data writer of the service discovery topic created in step S1-7, sends an offline notification of the experimental resource. S3 is a service discovery process based on multicast communication, and includes the following steps: S3-1 creates a UDP multicast network socket based on step S1-4, and determines whether an online / offline notification of the test resource is received; S3-2 determines the notification type of the test resource, and if it is an offline notification of the test resource, goes to step S3-7; S3-3 adds the test resource to the online service list and updates its last online time; S3-4 determines whether the timing period T has been reached, and if the timing period T has not been reached, goes to step S3-1; S3-5 creates a UDP multicast network socket based on step S1-4, and sends an online notification of the test resource. S3 is a service discovery process based on multicast communication, and also includes: S3-6 checks the last online time of the test resource in the offline list to be confirmed. If the last online time of the test resource does not exceed 2T, go to step S3-8; S3-7 deletes the test resource from the online service list; S3-8 determines whether the test resource has closed service discovery. If so, go to step S3-1; S3-9 creates a UDP multicast network socket based on step S1-4 and sends a test resource offline notification.
[0092] The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described in the present invention. Although the present invention has been described in detail with reference to the above embodiments, the present invention is not limited to the above specific implementation methods. Therefore, any modification or equivalent replacement of the present invention; and all technical solutions and improvements thereof that do not depart from the spirit and scope of the invention are included in the scope of the claims of the present invention.
Claims
1. A LVC-DE distributed synthetic environment service discovery method based on DDS and multicast communication, It includes, characterized in that it includes the following steps: S1 Service discovery mode selection. In the LVC-DE distributed synthetic environment, an independent local configuration file configure.xml is provided for each experimental resource. When the experimental resource is started, the local configuration file is read to determine whether the service discovery mechanism used is based on the multicast mode or the DDS built-in topic mode. S1 service discovery method selection includes the following steps: After the S1-1 test resource is started, the local configuration file configure.xml is read and the local configuration information is parsed according to each keyword; S1-2 determines the value of the global notification mode configuration item IsRTPSDiscoverType. If the value is true, execute step S1-3-1. If the value is false, execute step S1-3-2. S1-3-1 If the value of IsRTPSDiscoverType is true, set the global notification flag to multicast mode and go to step S1-4; S1-3-2 If the value of IsRTPSDiscoverType is false, set the global notification flag to DDS topic mode and go to step S1-5; S1-4 creates a UDP multicast network socket, binds the local network IP address and port, and joins the multicast group for service discovery, and goes to step S1-8; S1 service discovery method selection also includes: S1-5 creates a DDS domain participant factory, and creates a domain participant for service discovery based on the DDS domain participant factory; S1-6 creates publishers and subscribers for service discovery based on domain participants, registers topic types for service discovery, and creates corresponding service discovery topics; S1-7 creates a data writer for the service discovery topic based on the publisher, and creates a data reader for the service discovery topic based on the subscriber; S1-8 waits for receiving service discovery notification messages from other experimental resources; S2 is a service discovery process based on DDS topics. The service discovery mechanism based on DDS topics is applied to scenarios with small system scale and high reliability requirements. The service discovery process of S2 based on DDS topics includes the following steps: S2-1 determines whether data of the service discovery topic is received based on the service discovery topic created in step S1-6; S2-2-1 If no data from the service discovery topic is received, go to step S2-5; S2-2-2 If the data of the service discovery topic is received, the data reader based on the service discovery topic created in step S1-7 obtains the online / offline notification of the test resource; S2-3 determines the notification type of the test resource. If it is a test resource offline notification, go to step S2-10; S2-4 adds the experimental resource to the online service list and updates its last online time; S2-5: determining whether the activity of the service discovery topic has changed. If the activity of the service discovery topic has not decreased, proceed to step S2-7; S2-6 adds the experimental resources with reduced activity to the offline list to be confirmed; S2-7 determines whether the timing period TS is reached. The value can be set according to the system scale. The default value is 20 milliseconds. If the timing period T is not reached, go to step S2-1; S2 is a service discovery process based on the DDS topic, further comprising: S2-8 sending a test resource online notification based on the data writer of the service discovery topic created in step S1-7; S2-9 checks the last online time of the test resource in the offline list to be confirmed. If the last online time of the test resource does not exceed 2T, go to step S2-11; S2-10 Remove the experimental resources from the online service list; S2-11 determines whether the test resource has closed service discovery. If so, go to step S2-1; S2-12 sends a test resource offline notification to the data writer of the service discovery topic created in step S1-7; S3 is a service discovery process based on multicast communication. The service discovery mechanism based on multicast communication is applied to scenarios where the system scale is large and the reliability requirement is not high; The S3 service discovery process based on multicast communication includes the following steps: S3-1 determines whether a test resource online / offline notification is received based on the UDP multicast network socket created in step S1-4; S3-2 determines the notification type of the test resource. If it is an offline notification of the test resource, go to step S3-7; S3-3 adds the experimental resource to the online service list and updates its last online time; S3-4 determines whether the timing cycle T has been reached. If the timing cycle T has not been reached, go to step S3-1; S3-5 sends a test resource online notification based on the UDP multicast network socket created in step S1-4; S3 is a service discovery process based on multicast communication, and further includes: S3-6 checking the last online time of the test resource in the offline list to be confirmed, and if the last online time of the test resource does not exceed 2T, going to step S3-8; S3-7 removes the experimental resources from the online service list; S3-8 determines whether the test resource has closed service discovery. If so, go to step S3-1. S3-9 sends a test resource offline notification based on the UDP multicast network socket created in step S1-4.
