Generation method and device of DDS source code and electronic equipment

By automatically adjusting the DDS code template to include XML processing functions, the problem of DDS source code manually changing to load XML files is solved, and the efficiency of DDS source code generation is improved.

CN119127138APending Publication Date: 2024-12-13BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310700585.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-13
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing DDS source code generation method needs to be manually modified to support loading XML files, which affects the development and deployment efficiency of DDS.

Method used

By obtaining the DDS code template and including the specified parameter values ​​of the XML parameters in the parameter information, the code template is automatically adjusted to generate DDS source code with the ability to load XML files.

Benefits of technology

The source code with the function of loading XML files can be automatically generated without manually modifying the DDS source code, which improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127138A_ABST
    Figure CN119127138A_ABST
Patent Text Reader

Abstract

The invention provides a DDS source code generation method and device and electronic device.The method comprises the steps that after a DDS code template is obtained according to a DDS source code generation request, the DDS code template is automatically adjusted under the condition that it is determined that parameter information in the generation request comprises an XML parameter and the parameter value of the XML parameter is a specified parameter value, and the DDS code template is generated according to the parameter information; and generating a DDS source code with a function of loading the XML file. Therefore, the DDS source code with the function of loading the XML file can be automatically generated without manually modifying the DDS source code, and the development efficiency of generating the DDS source code with the function of loading the XML file is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device and electronic device for generating a DDS source code. Background Art

[0002] "Software-defined cars" is the direction of future cars. With the deepening of automobile intelligence and networking, the complexity of functions such as automatic driving, in-car entertainment, remote diagnosis and upgrade will become increasingly higher. If the traditional signal-based architecture is still used to achieve this, the entire system will become extremely complex and lack flexibility and scalability. The service-oriented architecture can support complex application systems, provide maximum flexibility and scalability in processing distribution and computing resource allocation, and better support the distributed deployment and update iteration of software, which can provide a good solution for future vehicle software services.

[0003] The implementation of service-oriented architecture needs to be based on service communication middleware. Data Distribution Service (DDS) is a new generation of distributed real-time communication middleware released by the Object Management Group (OMG). It adopts a publish / subscribe architecture, emphasizes data-centricity, and provides a rich service quality strategy to ensure real-time, efficient, and flexible data distribution, which can meet the needs of various distributed real-time communication applications.

[0004] In the related art, an Interface Definition Language (IDL) tool is usually used to generate DDS source code. In order to facilitate users to configure certain dynamically adjustable parameters in combination with specific application scenarios, it is usually necessary to manually modify the DDS source code so that the DDS source code has the ability to load Extensible Markup Language (XML) files with dynamically adjusted parameters. However, if the source code is expected to have the function of loading XML files, the source code needs to be manually modified, which undoubtedly affects the development and deployment efficiency of DDS. Summary of the invention

[0005] To this end, the present disclosure proposes a method, device and electronic device for generating DDS source code to solve the technical problem that the DDS source code generated by the IDL tool in the related art does not have the function of loading XML files, and the DDS source code needs to be manually modified, which affects the development and deployment efficiency of DDS.

[0006] According to an aspect of the present disclosure, an embodiment provides a method for generating a data distribution service DDS source code, the method comprising: obtaining a DDS code template in response to a DDS source code generation request, wherein the generation request comprises parameter information; and when the parameter information comprises an extensible markup language XML parameter and the parameter value of the XML parameter is a specified parameter value, adjusting the DDS code template to generate a DDS source code having a function of loading an XML file.

[0007] In another aspect, an embodiment of the present disclosure proposes a device for generating a data distribution service DDS source code, the device comprising: a first acquisition module, for acquiring a DDS code template in response to a DDS source code generation request, wherein the generation request comprises parameter information; an adjustment module, for adjusting the DDS code template when the parameter information comprises an extensible markup language XML parameter and the parameter value of the XML parameter is a specified parameter value, so as to generate a DDS source code having a function of loading an XML file.

[0008] Another aspect of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for generating DDS source code disclosed in the embodiment of the present disclosure is implemented.

[0009] Another aspect of the present disclosure is a non-transitory computer-readable storage medium storing computer instructions, which, when executed by a processor, executes the method for generating a data distribution service DDS source code disclosed in the embodiment of the present disclosure.

[0010] Another aspect of the present disclosure provides a computer program product, including computer instructions, which, when executed by a processor, implement the method for generating a data distribution service DDS source code disclosed in the embodiment of the present disclosure.

[0011] The technical solution provided by the embodiments of the present disclosure has the following beneficial effects:

[0012] After obtaining a DDS code template according to a DDS source code generation request, and determining that the parameter information in the generation request includes an XML parameter, and the parameter value of the XML parameter is a specified parameter value, the DDS code template is automatically adjusted to generate a DDS source code with a function of loading an XML file. Thus, the DDS source code with a function of loading an XML file can be automatically generated without manually modifying the DDS source code, thereby improving the development efficiency of generating a DDS source code with a function of loading an XML file.

[0013] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0015] Figure 1 A flowchart of a method for generating a data distribution service DDS source code provided by an embodiment of the present disclosure;

[0016] Figure 2 A flowchart of another method for generating a data distribution service DDS source code provided by an embodiment of the present disclosure;

[0017] Figure 3 A flowchart of another method for generating a data distribution service DDS source code provided by an embodiment of the present disclosure;

[0018] Figure 4 A schematic diagram of the structure of a device for generating a data distribution service DDS source code provided by an embodiment of the present disclosure;

[0019] Figure 5 A structural block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0021] The following describes a method, apparatus, and electronic device for generating a DDS source code according to an embodiment of the present disclosure with reference to the accompanying drawings.

[0022] Figure 1 A flow chart of a method for generating a data distribution service DDS source code provided in an embodiment of the present disclosure. It should be noted that the execution subject of the method for generating a data distribution service DDS source code in this example is a device for generating a data distribution service DDS source code, which can be implemented by hardware and / or software, and can be an IDL tool, or can be configured in an IDL tool, and the IDL tool can be configured in an electronic device, and the electronic device can include but is not limited to a terminal device, a server, etc., and this embodiment does not specifically limit the electronic device.

[0023] like Figure 1 As shown, the method comprises the following steps:

[0024] Step 101 : In response to a DDS source code generation request, a DDS code template is obtained, wherein the generation request includes parameter information.

[0025] It should be noted that the parameter information in this example may come from various files and channels, but should all be integrated in the generation request.

[0026] Step 102: When the parameter information includes an extensible markup language XML parameter and the parameter value of the XML parameter is a specified parameter value, the DDS code template is adjusted to generate a DDS source code with a function of loading an XML file.

[0027] The DDS code template is a pre-written code template that can provide DDS services.

[0028] In some exemplary embodiments, before adjusting the DDS code template to generate a DDS source code with the function of loading an XML file, it is also possible to obtain an IDL file pre-written for the DDS code template, and use the target parameter value of the first parameter in the IDL file to update the parameter value of the second parameter corresponding to the first parameter in the DDS code template, and adjust the updated DDS code template to generate a DDS source code with the function of loading an XML file.

[0029] In some examples, the first parameter and the second parameter may have the same parameter name. In other examples, the parameter name of the second parameter may be an abbreviation or initials of the parameter name of the first parameter, or the parameter name of the second parameter may be converted from the parameter name of the first parameter according to a preset conversion method. In other examples, the parameter name of the first parameter and the parameter name of the second parameter have a corresponding relationship, wherein the corresponding relationship is stored in a parameter corresponding relationship table.

[0030] The specified parameter value is a parameter value pre-set for the XML parameter in the data distribution service DDS source code generation device, for example, the specified parameter value may be ON. The parameter value of the XML parameter is the specified parameter value, indicating that the DDS source code to be generated needs to have the function of loading XML files.

[0031] It can be understood that when the parameter value of the XML parameter is not a specified parameter value, it means that the DDS source code to be generated does not need to have the function of loading the XML file.

[0032] In some exemplary embodiments, when the parameter information includes an extensible markup language XML parameter and the parameter value of the XML parameter is a specified parameter value, the source code required for the function of loading the XML file can be added to the DDS code template, thereby generating a DDS source code with the function of loading the XML file.

[0033] In other exemplary embodiments, when the parameter information includes an extensible markup language XML parameter and the parameter value of the XML parameter is a specified parameter value, an XML processing function that can process the XML file can be added to the DDS code template to generate a DDS source code with the function of loading XML files.

[0034] Among them, it can be understood that the DDS scenario needs to involve basic elements such as DDS domain participants, publishers, data writers and subscribers. Usually in actual applications, at least one of the above-mentioned multiple elements has some configuration parameters that can be dynamically set according to actual business needs. In order to enable the DDS source code to process the configuration parameters corresponding to the corresponding components, therefore, in some exemplary embodiments, the XML processing function in this example includes at least one of the following: an XML processing function that can process the configuration parameters corresponding to the DDS domain participants; an XML processing function that can process the configuration parameters corresponding to the publisher; an XML processing function that can process the configuration parameters corresponding to the subscriber; an XML processing function that can process the configuration parameters corresponding to the data writer; an XML processing function that can process the configuration parameters corresponding to the data reader; an XML processing function that can process the configuration parameters corresponding to the subject.

[0035] In some exemplary embodiments, in order to meet the requirement of dynamically adjusting the configuration parameters corresponding to each component element, the XML processing function in this example may include: an XML processing function that can process the configuration parameters corresponding to each component element, that is, in some examples, the XML processing function may include: an XML processing function that can process the configuration parameters corresponding to the DDS domain participants; an XML processing function that can process the configuration parameters corresponding to the publisher; an XML processing function that can process the configuration parameters corresponding to the subscriber; an XML processing function that can process the configuration parameters corresponding to the data writer; an XML processing function that can process the configuration parameters corresponding to the data reader; and an XML processing function that can process the configuration parameters corresponding to the topic.

[0036] The method for generating the data distribution service DDS source code of the disclosed embodiment, after obtaining the DDS code template according to the DDS source code generation request, and when it is determined that the parameter information in the generation request includes an XML parameter and the parameter value of the XML parameter is a specified parameter value, automatically adjusts the DDS code template to generate a DDS source code with a function of loading an XML file. Thus, the DDS source code with a function of loading an XML file can be automatically generated without manually modifying the DDS source code, thereby improving the development efficiency of generating the DDS source code with a function of loading an XML file.

[0037] Figure 2 A flowchart of another method for generating a data distribution service DDS source code provided by an embodiment of the present disclosure is provided. This embodiment is a further refinement of the above embodiment.

[0038] like Figure 2 As shown, the method may include:

[0039] Step 201 : Responding to a request for generating a DDS source code, obtaining a DDS code template, wherein the generating request includes parameter information.

[0040] It should be noted that, for the specific implementation of step 201, reference may be made to the relevant description of the embodiment of the present disclosure, which will not be repeated here.

[0041] Step 202: When the parameter information includes an extensible markup language XML parameter and the parameter value of the XML parameter is a specified parameter value, obtain the XML file name information corresponding to the XML parameter.

[0042] Step 203: Acquire the XML file corresponding to the XML file name information.

[0043] Step 204: if there is content in the XML file, parse the XML file to obtain configuration parameters of the target component, wherein the target component is at least one of the multiple components of the DDS.

[0044] Among them, the multiple components of DDS may include domain participants, publishers, subscribers, topics, data writers, data readers, etc. of DDS.

[0045] For example, when the target component is a publisher, the configuration parameters may include parameters related to the publisher's quality of service, such as data packet size, network throughput, and the like.

[0046] Step 205 , adding a function that can process the configuration parameters of the target component in the DDS code template and load the parsed content into the corresponding XML processing function to generate a DDS source code with the function of loading an XML file.

[0047] In some examples, according to the target component, the adding position of the XML processing function that can process the configuration parameters of the target component is determined; according to the adding position, the XML processing function that can process the configuration parameters of the target component is added to the DDS code template to generate a DDS source code with the function of loading an XML file. Thus, the XML processing function that can process the configuration parameters of the target component is added to the corresponding position in the DDS code template.

[0048] In this example, when the parameter information includes an extensible markup language XML parameter, and the parameter value of the XML parameter is a specified parameter value and exists in the XML file name information corresponding to the XML parameter, the XML file corresponding to the XML file name is obtained, and an XML processing function that can process the XML file is added to the DDS code template; when there is content in the XML file, the XML file is parsed to obtain the configuration parameters of the target component; the parsed content is loaded into the corresponding XML processing function to generate a DDS source code with the function of loading the XML file. Therefore, there is no need to manually modify the DDS source code, and the preset content in the corresponding XML file can be loaded into the DDS source code, which satisfies the requirement of loading the XML file into the DDS source code.

[0049] Based on any of the above embodiments, in order to facilitate developers to set the parameter value of the XML parameter, correspondingly, before obtaining the DDS code template in response to the DDS source code generation request, the method may also include: displaying the optional configuration parameter value corresponding to the XML parameter; according to the selection operation for the optional configuration parameter value, obtaining the target configuration parameter value of the optional configuration parameter value, and using the target configuration parameter value as the parameter value corresponding to the XML parameter. In this way, it is convenient for developers to configure the parameter value corresponding to the XML parameter.

[0050] For example, the command line option "-XML" corresponding to the XML parameter can be displayed in the command line options of the IDL tool, and the configurable parameter value of the option can be displayed as ON and OFF. Correspondingly, when the developer needs to use the IDL tool to generate a DDS source code with a function that can load an XML file, the developer can select ON, and the IDL tool can determine that the parameter value corresponding to the option is ON. Correspondingly, the IDL tool can determine that the parameter value corresponding to the XML parameter is ON. Among them, the default parameter value corresponding to the option is ON.

[0051] In order to clearly understand the present disclosure, Figure 3 The method of this embodiment is described exemplarily. It should be noted that in this example, the method for generating DDS source code is described exemplarily by using an IDL tool as an example.

[0052] like Figure 3 As shown, the method may include the following steps:

[0053] Step 301: The IDL tool parses the command line parameters.

[0054] Step 302: The IDL tool determines that there are XML parameters in the command line parameters according to the parsing result, and writes the XML parameters into the parameter set of the DDS code template.

[0055] Step 303 , the IDL tool determines whether the parameter value of the XML parameter is ON, if not, execute step 304 , otherwise execute step 305 .

[0056] It should be noted that the parameter value of the XML parameter is ON, which means that a DDS source code with a function of loading an XML file needs to be generated.

[0057] Step 304: The IDL tool generates a DDS source code without a function of loading an XML file according to the parameter set and the DDS code template.

[0058] Among them, when the parameter value of the XML parameter is not ON, that is, when the parameter value of the XML parameter is OFF, it means that there is no need to generate the DDS source code with the function of loading the XML file. At this time, the IDL tool can generate the DDS source code through the original processing flow.

[0059] It is understandable that the DDS source code generated based on the original processing flow does not have the function of loading XML files.

[0060] Step 305: The IDL tool obtains XML file name information corresponding to the XML parameter.

[0061] Step 306: The IDL tool obtains an XML file corresponding to the XML file name information.

[0062] Step 307: If there is content in the XML file, parse the XML file to obtain configuration parameters of the target component, wherein the target component is at least one of the multiple components of the DDS.

[0063] Step 308: Add in the DDS code template a function that can process the configuration parameters of the target component and load the parsed content into the corresponding XML processing function to generate a DDS source code with the function of loading an XML file.

[0064] In some examples, the target components include publishers and subscribers, and in the DDS code template, an XML processing function that can process dynamic parameters corresponding to publishers, an XML processing function that can process dynamic parameters corresponding to subscribers, an XML processing function that can process dynamic parameters corresponding to data writers, an XML processing function that can process dynamic parameters corresponding to data readers, and an XML processing function that can process dynamic parameters corresponding to topics can be added. By adding the above-mentioned XML processing functions, the generated DDS source code can have the function of loading XML files.

[0065] In this example, the IDL tool generates DDS source code with the ability to dynamically load XML files, which reduces the trouble of manually modifying the DDS source code, improves the efficiency of generating DDS source code with the ability to dynamically load XML files, and improves code development efficiency.

[0066] In addition, it is understandable that the DDS source code has the ability to load XML files, which allows users to modify XML files according to application scenarios to achieve the purpose of changing usage scenarios and shorten the development and deployment cycle.

[0067] In order to implement the above embodiment, the present disclosure also proposes a device for generating a data distribution service DDS source code.

[0068] Figure 4 A schematic diagram of the structure of a device for generating a data distribution service DDS source code provided in an embodiment of the present disclosure. It should be noted that, in this example, the device for generating the data distribution service DDS source code can be implemented in hardware and / or software, and the device for generating the data distribution service DDS source code can be an IDL tool, or can be configured in an IDL tool, and the IDL tool can be configured in an electronic device, and the electronic device can include but is not limited to a terminal device, a server, etc., and this embodiment does not specifically limit the electronic device.

[0069] like Figure 4 As shown, the data distribution service DDS source code generation device 400 may include a first acquisition module 401 and an adjustment module 402, wherein:

[0070] The first acquisition module 401 is used to acquire a DDS code template in response to a DDS source code generation request, wherein the generation request includes parameter information.

[0071] The adjustment module 402 is used to adjust the DDS code template to generate a DDS source code with the function of loading an XML file when the parameter information includes an extensible markup language XML parameter and the parameter value of the XML parameter is a specified parameter value.

[0072] In one embodiment of the present disclosure, the adjustment module 402 is specifically used to add an XML processing function capable of processing an XML file in a DDS code template, and generate a DDS source code with a function capable of loading an XML file.

[0073] In one embodiment of the present disclosure, the device may further include:

[0074] The second acquisition module is used to acquire the XML file name information corresponding to the XML parameter;

[0075] A third acquisition module is used to acquire the XML file corresponding to the XML file name information;

[0076] The adjustment module 402 is specifically used to: when there is content in the XML file, parse the XML file to obtain the configuration parameters of the target component, wherein the target component is at least one of the multiple components; add an XML processing function that can process the configuration parameters of the target component to the DDS code template, and generate a DDS source code with the function of loading XML files.

[0077] In one embodiment of the present disclosure, the adjustment module 402 is specifically used to: determine the addition position of the XML processing function that can process the configuration parameters of the target component according to the target component; according to the addition position, add the XML processing function that can process the configuration parameters of the target component in the DDS code template to generate a DDS source code with the function of loading XML files.

[0078] In one embodiment of the present disclosure, the device may also include: a preprocessing module, used to obtain an interface definition language IDL file pre-written for the DDS code template; using the target parameter value of the first parameter in the IDL file, updating the parameter value of the second parameter corresponding to the first parameter in the DDS code template.

[0079] In one embodiment of the present disclosure, the device further includes:

[0080] A display module, used to display the optional configuration parameter values ​​corresponding to the XML parameters;

[0081] The determination module is used to obtain a target configuration parameter value of the optional configuration parameter value according to a selection operation on the optional configuration parameter value, and use the target configuration parameter value as a parameter value corresponding to the XML parameter.

[0082] It should be noted that the above explanation of the embodiment of the method for generating the data distribution service DDS source code is also applicable to the device for generating the data distribution service DDS source code of this embodiment, and will not be repeated here.

[0083] The device for generating the data distribution service DDS source code of the disclosed embodiment, after obtaining the DDS code template according to the DDS source code generation request, and when it is determined that the parameter information in the generation request includes an XML parameter and the parameter value of the XML parameter is a specified parameter value, automatically adjusts the DDS code template to generate a DDS source code with the function of loading an XML file. Thus, the DDS source code with the function of loading an XML file can be automatically generated without manually modifying the DDS source code, thereby improving the development efficiency of generating the DDS source code with the function of loading an XML file.

[0084] In order to implement the above embodiments, the present disclosure also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method of the above method embodiment is implemented.

[0085] In order to implement the above embodiments, the present disclosure further proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method of the above method embodiment is implemented.

[0086] In order to implement the above embodiments, the present disclosure further proposes a computer program product, on which a computer program is stored. When the computer program is executed by a processor, the method of the above method embodiment is implemented.

[0087] Figure 5 A structural block diagram of an electronic device provided in an embodiment of the present disclosure. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0088] like Figure 5As shown, the electronic device 10 includes a processor 11, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 12 or a program loaded from a memory 16 to a random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 are also stored in the RAM 13. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0089] The following components are connected to the I / O interface 15: a memory 16 including a hard disk, etc.; and a communication part 17 including a network interface card such as a LAN (Local Area Network) card, a modem, etc., and the communication part 17 performs communication processing via a network such as the Internet; a drive 18 is also connected to the I / O interface 15 as needed.

[0090] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 17. When the computer program is executed by the processor 11, the above-mentioned functions defined in the method of the present disclosure are executed.

[0091] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory 16 including instructions, and the instructions can be executed by the processor 11 of the electronic device 10 to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0092] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0093] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0094] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present disclosure belong.

[0095] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0096] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0097] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0098] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0099] The storage medium mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present disclosure. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present disclosure.

Claims

1. A method for generating a data distribution service DDS source code, characterized in that: The method comprises: In response to a DDS source code generation request, obtaining a DDS code template, wherein the generation request includes parameter information; When the parameter information includes an extensible markup language XML parameter and the parameter value of the XML parameter is a specified parameter value, the DDS code template is adjusted to generate a DDS source code with a function of loading an XML file.

2. The method according to claim 1, characterized in that The DDS code template is adjusted to generate a DDS source code having a function of loading an XML file, including: An XML processing function capable of processing an XML file is added to the DDS code template to generate a DDS source code capable of loading an XML file.

3. The method according to claim 2, characterized in that The DDS includes a plurality of components. Before adding an XML processing function capable of processing an XML file to the DDS code template and generating a DDS source code with a function capable of loading an XML file, the method further includes: Obtaining the XML file name information corresponding to the XML parameter; Obtaining an XML file corresponding to the XML file name information; The step of adding an XML processing function capable of processing an XML file to the DDS code template to generate a DDS source code capable of loading an XML file includes: If there is content in the XML file, the XML file is parsed to obtain configuration parameters of a target component, wherein the target component is at least one of the multiple components; An XML processing function capable of processing the configuration parameters of the target component is added to the DDS code template to generate a DDS source code capable of loading an XML file.

4. The method according to claim 3, characterized in that The step of adding an XML processing function capable of processing the configuration parameters of the target component to the DDS code template to generate a DDS source code capable of loading an XML file includes: According to the target component, determine the adding position of the XML processing function that can process the configuration parameters of the target component; According to the adding position, an XML processing function capable of processing the configuration parameters of the target component is added to the DDS code template, so as to generate a DDS source code capable of loading an XML file.

5. The method according to claim 1, characterized in that Before adjusting the DDS code template to generate a DDS source code with a function of loading an XML file, the method further includes: Obtaining an interface definition language IDL file pre-written for the DDS code template; The parameter value of the second parameter corresponding to the first parameter in the DDS code template is updated using the target parameter value of the first parameter in the IDL file.

6. The method according to any one of claims 1 to 5, characterized in that Before obtaining the DDS code template in response to the DDS source code generation request, the method further includes: Display the optional configuration parameter value corresponding to the XML parameter; According to the selection operation on the optional configuration parameter value, a target configuration parameter value of the optional configuration parameter value is acquired, and the target configuration parameter value is used as a parameter value corresponding to the XML parameter.

7. A device for generating a data distribution service DDS source code, characterized in that: The device comprises: A first acquisition module, configured to acquire a DDS code template in response to a DDS source code generation request, wherein the generation request includes parameter information; The adjustment module is used to adjust the DDS code template to generate a DDS source code with the function of loading XML files when the parameter information includes an extensible markup language XML parameter and the parameter value of the XML parameter is a specified parameter value.

8. The device according to claim 7, characterized in that The adjustment module is specifically used for: An XML processing function capable of processing an XML file is added to the DDS code template to generate a DDS source code capable of loading an XML file.

9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 6 is implemented.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the method of any one of claims 1 to 6 is performed.