Search

CN-117290421-B - DDS dynamic publishing and dynamic subscribing method, device, equipment, medium and vehicle

CN117290421BCN 117290421 BCN117290421 BCN 117290421BCN-117290421-B

Abstract

The invention relates to a method, a device, equipment, a medium and a vehicle for dynamic publishing and dynamic subscription of a DDS (direct digital service), which are characterized by comprising the steps of establishing resources required by the DDS entity, generating a unified interface dynamic library of the DDS entity according to the resources required by the DDS entity, calling the unified interface dynamic library of the DDS entity by acquiring a theme name required by the recording service when recording service is carried out, realizing dynamic subscription, and/or calling the unified interface dynamic library of the DDS entity by acquiring the theme name required by the playback service when playback service is carried out, and realizing dynamic publishing. The method and the system solve the defects of dynamic publishing/dynamic subscribing by providing the unified interface dynamic library under the condition that a user does not feel, and can realize the same function by using the same configuration file as the dynamic publishing/dynamic subscribing.

Inventors

  • WANG BO
  • WANG BINBO

Assignees

  • 国科础石(重庆)软件有限公司

Dates

Publication Date
20260505
Application Date
20230919

Claims (9)

  1. 1. A method for dynamically publishing and dynamically subscribing a DDS, comprising: creating resources required by the DDS entity, and generating a unified interface dynamic library of the DDS entity according to the resources required by the DDS entity, wherein the unified interface dynamic library comprises names for generating the unified interface dynamic library according to theme names; When recording service is carried out, the unified interface dynamic library of the DDS entity is called by obtaining the theme name required by the recording service, so as to realize dynamic subscription and/or When the playback service is carried out, the unified interface dynamic library of the DDS entity is called by obtaining the theme name required by the playback service, so that dynamic release is realized; the calling process of the recording service and the playback service specifically comprises the following steps: Acquiring all topic names to be recorded from the configuration file; dynamically loading according to the name of the unified interface dynamic library; Calling a unified interface dynamic library, acquiring a data structure of the creation information of the characterization description theme, and creating the DDS theme; Continuing to complete the creation of the DDS entity; setting and acquiring all topics writer corresponding state values at the subscription end, and publishing data according to the state values at the subscription end.
  2. 2. The method according to claim 1, wherein the resources required for creating the DDS entity, in particular, comprise: and acquiring an import path of the IDL file, and acquiring QoS setting of the DDS entity corresponding to the theme.
  3. 3. The DDS dynamic publishing and dynamic subscribing method of claim 1, wherein the creating process of the unified interface dynamic library specifically comprises: importing a user-defined IDL; Importing a unified interface to generate a script file; idlc generating a corresponding header file and a source file; And compiling the dynamic library by the unified interface generation script to generate the unified interface dynamic library.
  4. 4. The DDS dynamic publishing and dynamic subscribing method of claim 1, wherein the unified interface dynamic library modifies source code based on importing user-defined IDL, and compiles to generate the unified interface dynamic library.
  5. 5. The DDS dynamic publishing and dynamic subscribing method of claim 3, wherein the compiling of the dynamic library is completed by a unified interface generating script, and the generating of the unified interface dynamic library specifically comprises: Acquiring all topic names to be recorded from the configuration file; and generating the names of the unified interface dynamic library according to the theme names.
  6. 6. A DDS dynamic publishing and dynamic subscribing device, comprising: the dynamic library module creates resources required by the DDS entity, generates a unified interface dynamic library of the DDS entity according to the resources required by the DDS entity, and comprises the step of generating names of the unified interface dynamic library according to the theme names The dynamic subscription module is used for calling the unified interface dynamic library of the DDS entity by acquiring the theme name required by the record service when the record service is carried out, so as to realize dynamic subscription; the dynamic publishing module is used for calling the unified interface dynamic library of the DDS entity by acquiring the theme name required by the playback service when the playback service is performed, so as to realize dynamic publishing, and the calling process of the recording service and the playback service specifically comprises the following steps: Acquiring all topic names to be recorded from the configuration file; dynamically loading according to the name of the unified interface dynamic library; Calling a unified interface dynamic library, acquiring a data structure of the creation information of the characterization description theme, and creating the DDS theme; Continuing to complete the creation of the DDS entity; setting and acquiring all topics writer corresponding state values at the subscription end, and publishing data according to the state values at the subscription end.
  7. 7. An electronic device, comprising: A processor; A memory for storing the processor-executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the DDS dynamic publishing and dynamic subscribing method according to any one of claims 1 to 5.
  8. 8. A computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, perform the steps of the DDS dynamic publishing and dynamic subscribing method as claimed in any one of claims 1 to 5.
  9. 9. A vehicle is characterized in that, A set of instructions stored for execution by the vehicle to implement the DDS dynamic publishing and dynamic subscribing method of any one of claims 1-5.

Description

DDS dynamic publishing and dynamic subscribing method, device, equipment, medium and vehicle Technical Field The disclosure relates to the technical field of DDS recording and playback, in particular to a method, a device, equipment, a medium and a vehicle for dynamically publishing and subscribing DDS. Background In existing DDS recording and playback systems, dynamic publish/subscribe is used to create DDS ENTITIES. The mode can be realized by fully utilizing an interface provided by the DDS, but has the defects that: as the number of topics recorded and played back increases, the time taken for dynamic publish/subscribe increases linearly; if the publishing or subscribing end corresponding to the topic used for recording and playback is not online, then the dynamic publish/subscribe will attempt multiple times until timeout, in the order of seconds, which is unacceptable to some users; the QoS acquired by dynamic publishing/dynamic subscribing is uncertain, and a plurality of topic names under participant are often required to be acquired to acquire the required topic, which is also uncertain and time-consuming. Disclosure of Invention In order to overcome the problems in the related art, the present disclosure provides a method, an apparatus, a device, a medium and a vehicle for dynamically publishing and subscribing DDSs. According to a first aspect of an embodiment of the present disclosure, there is provided a method for dynamically publishing and dynamically subscribing to a DDS, including: Creating resources required by the DDS entity, and generating a unified interface dynamic library of the DDS entity according to the resources required by the DDS entity; When recording service is carried out, the unified interface dynamic library of the DDS entity is called by obtaining the theme name required by the recording service, so as to realize dynamic subscription and/or When the playback service is carried out, the unified interface dynamic library of the DDS entity is called by obtaining the theme name required by the playback service, so that dynamic release is realized. According to a second aspect of an embodiment of the present disclosure, there is provided an apparatus for dynamically publishing and dynamically subscribing to a DDS, including: The dynamic library module is used for creating resources required by the DDS entity and generating a unified interface dynamic library of the DDS entity according to the resources required by the DDS entity; The dynamic subscription module is used for calling the unified interface dynamic library of the DDS entity by acquiring the theme name required by the record service when the record service is carried out, so as to realize dynamic subscription; and the dynamic release module is used for calling the unified interface dynamic library of the DDS entity by acquiring the theme name required by the playback service when the playback service is performed, so as to realize dynamic release. According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, including a processor, a memory for storing executable instructions of the processor, and the processor is configured to read the executable instructions from the memory and execute the instructions to implement the DDS dynamic publishing and dynamic subscribing method provided in the first aspect of the present disclosure. According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the method for dynamic publishing and dynamic subscribing of DDS provided by the first aspect of the present disclosure. According to a fifth aspect of embodiments of the present disclosure, there is provided a vehicle storing a set of instruction sets, the instruction sets being executed by the vehicle to implement the DDS dynamic publishing and dynamic subscribing method provided in the first aspect of the present disclosure. The technical scheme provided by the embodiment of the disclosure can thoroughly solve the defect of creating DDS ENTITIES by dynamic publishing/dynamic subscription, generate resources required by creating DDS ENTITIES by changing compiling configuration of a user, realize consistency with an interface of a record playback system by using a unified interface layer, realize one-time compiling with the record playback system by using a dynamic loading technology, support multiple-touch according to configuration in a configuration file, and provide the interface through a dynamic library in a record service and a playback service, and realize analysis of sample data because of a data structure defined in IDL in the dynamic library. The disadvantage of dynamic publishing/dynamic subscription is solved without perception of the user. The same configuration file is used for dynamic publishing/dy