Data Conversion Method, Apparatus, Device, and Storage Medium
Through the combination of extraction tools, message extraction model and AUTOSAR configuration tools, ROS message files are automatically converted into AUTOSAR format files, solving the problems of low data conversion efficiency and error-proneness of ROS platform to AUTOSAR platform, and achieving efficient and accurate data conversion.
Patent Information
- Application Number
- CN202210940029.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-05
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-08-05
AI Technical Summary
In the prior art, the data conversion from the ROS platform to the AUTOSAR platform is inefficient and error-prone, and ROS message data needs to be entered manually, resulting in low efficiency and accuracy.
Through the combination of extraction tools, message extraction model and AUTOSAR configuration tools, the ROS message file is automatically converted into the format file corresponding to AUTOSAR, including converting the ROS message file into ROS software package, compiling, extracting ROS message data, importing data dictionary files and converting it into arxml format file.
It significantly improves the efficiency of data conversion, reduces manual processing steps, improves data accuracy and reliability, and avoids errors during the conversion process.
Smart Images

Figure CN115292399B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of data processing, and in particular, to a data conversion method, apparatus, device, and storage medium. Background Art
[0002] With the emergence of diverse transportation demands, autonomous driving technology has gradually been more widely applied. When developing an autonomous driving vehicle system, the Robot Operating System (ROS) platform is usually used for functional testing and verification. However, the autonomous driving vehicle system developed on the ROS platform cannot meet the standard requirements of automotive safety. Therefore, it is necessary to convert the relevant data of the autonomous driving vehicle system developed on the ROS platform into data in the Automotive Open System Architecture (AUTOSAR) platform that can meet the automotive safety standard requirements.
[0003] In the prior art, in the data conversion from the ROS platform to the AUTOSAR platform, for the ROS message record data ROS message generated in the ROS platform, it is necessary to manually input the ROS message into the AUTOSAR platform, which is inefficient and error-prone. Summary of the Invention
[0004] The embodiments of the present application provide a data conversion method, apparatus, device, and storage medium to improve the data conversion efficiency of ROS message.
[0005] In a first aspect, the embodiments of the present application provide a data conversion method, and the data conversion method includes:
[0006] Convert the ROS message file to be converted into a ROS software package and compile the ROS software package;
[0007] Extract the ROS message data from the compiled ROS software package through an extraction tool;
[0008] Import the ROS message data into a data dictionary file based on a set message extraction model;
[0009] Based on a pre-configured AUTOSAR configuration tool, convert the data dictionary file into a format file corresponding to AUTOSAR.
[0010] It can be seen that through the combination of the extraction tool, the message extraction model, and the AUTOSAR configuration tool, a large number of ROS message files can be automatically converted into format files corresponding to AUTOSAR at one time, significantly improving the data conversion efficiency, and no manual processing is required in the middle, thereby effectively improving the accuracy and reliability of the converted data.
[0011] Optionally, convert the ROS message file to be converted into a ROS software package and compile the ROS software package, including: establishing a ROS software package based on the development environment where the ROS message file to be converted is located and the instructions pre-configured in the development environment; modifying the configuration file in the ROS software package based on the development environment; adding the ROS message file to the ROS software package; and compiling the ROS software package based on the ROS software package containing the ROS message file and the configuration file in the ROS software package.
[0012] It can be seen that by establishing a ROS software package and adding the ROS message file to the ROS software package, the ROS message file to be converted is in a compilable format and environment, facilitating the extraction tool to directly extract the data in the ROS message file to be converted from the ROS software package and ensuring the successful progress of data processing.
[0013] Optionally, extract the ROS message data from the compiled ROS software package through an extraction tool, including: adding the compiled ROS software package to the directory corresponding to the extraction tool; extracting the ROS message data from the compiled ROS software package through the extraction tool based on the pre-configured extraction command.
[0014] It can be seen that through the pre-configured extraction command, the corresponding ROS message data in the ROS message file can be directly obtained from the ROS software package to facilitate further conversion processing.
[0015] Optionally, extract the ROS message data from the compiled ROS software package based on the pre-configured extraction command, including: identifying the compiled ROS software package based on the extraction command pre-configured in the extraction tool; determining that the ROS software package passes the detection based on the ROS standard specification pre-configured in the extraction tool; and extracting the ROS message data in the ROS software package that passes the detection.
[0016] It can be seen that when extracting ROS message data, the ROS file package is detected to ensure that the ROS file package meets the ROS standard specification, thereby ensuring the smooth progress of the data extraction process, avoiding abnormal data extraction, and at the same time, through early detection, notifying the management personnel for further processing when the ROS file package does not meet the standard specification, effectively improving the processing success rate and further enhancing the processing efficiency.
[0017] Optionally, import the ROS message data into a data dictionary file based on the set message extraction model, including: converting the ROS message data into bus data based on the set message extraction model included in the extraction tool; creating a blank data dictionary file in the extraction tool; and importing the bus data into the blank data dictionary file.
[0018] It can be seen that by converting ROS message data into bus data to obtain the specific information transmitted and received via the bus in the ROS message data, and by importing the bus data into a data dictionary file, the bus data in the ROS message data can be saved in the format of a data dictionary, which is convenient for the AUTOSAR configuration file to read and convert it into a corresponding format file.
[0019] Optionally, the format file corresponding to AUTOSAR is an arxml format file.
[0020] It can be seen that by converting the bus data into an arxml format file, it is convenient to further read and process in the AUTOSAR platform.
[0021] In a second aspect, an embodiment of the present application provides a data conversion device, which includes:
[0022] A compilation module, configured to convert a ROS message file to be converted into a ROS package and compile the ROS package;
[0023] An extraction module, configured to extract ROS message data from the compiled ROS package through an extraction tool;
[0024] An import module, configured to import the ROS message data into a data dictionary file based on a set message extraction model;
[0025] A conversion module, configured to convert the data dictionary file into a format file corresponding to AUTOSAR based on a pre-configured AUTOSAR configuration tool.
[0026] Optionally, the compilation module is specifically configured to establish a ROS package based on the development environment where the ROS message file to be converted is located and the instructions pre-configured in the development environment; modify the configuration file in the ROS package based on the development environment; add the ROS message file to the ROS package; and compile the ROS package based on the ROS package containing the ROS message file and the configuration file in the ROS package.
[0027] Optionally, the extraction module is specifically configured to add the compiled ROS package to the directory corresponding to the extraction tool; and extract ROS message data from the compiled ROS package through the extraction tool based on a pre-configured extraction command.
[0028] Optionally, the extraction module is specifically configured to identify the compiled ROS package based on the extraction command pre-configured in the extraction tool; determine that the ROS package passes the detection based on the ROS standard specification pre-configured in the extraction tool; and extract the ROS message data in the ROS package that passes the detection.
[0029] Optionally, the import module is specifically configured to convert ROS message data into bus data based on a set message extraction model included in the extraction tool; create a blank data dictionary file in the extraction tool; and import the bus data into the blank data dictionary file.
[0030] Optionally, the extraction module includes that the extraction tool is Matlab, the message extraction model is the interconnected blank message module and bus selector module in Simulink, Simulink is a built-in tool in Matlab, the blank message module is used to save the extracted ROS message data, and the bus selector module is used to extract bus data from the ROS message data.
[0031] Optionally, the conversion module includes that the format file corresponding to AUTOSAR is an arxml format file.
[0032] In a third aspect, an embodiment of the present application further provides a control device, which includes:
[0033] At least one processor;
[0034] And a memory communicatively connected to the at least one processor;
[0035] Wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the control device to execute the data conversion method corresponding to any one of the embodiments in the first aspect of the embodiments of the present application.
[0036] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement any data conversion method in the first aspect of the embodiments of the present application.
[0037] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the data conversion method corresponding to any one of the embodiments in the first aspect of the embodiments of the present application. Description of the Drawings
[0038] Figure 1 It is an application scenario diagram of the data conversion method provided by the embodiment of the present application;
[0039] Figure 2 It is a flowchart of the data conversion method provided by an embodiment of the present application;
[0040] Figure 3aFlowchart of the data conversion method provided by another embodiment of the present application;
[0041] Figure 3b Flowchart of the ROS message data extraction by the extraction tool provided by another embodiment of the present application;
[0042] Figure 4 Structural schematic diagram of the data conversion device provided by another embodiment of the present application;
[0043] Figure 5 Structural schematic diagram of the control device provided by another embodiment of the present application. Detailed implementation manners
[0044] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the embodiments of the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0045] The following uses specific embodiments to detail the technical solutions of the embodiments of the present application and how the technical solutions of the embodiments of the present application solve the above technical problems. The following several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will describe the embodiments of the embodiments of the present application with reference to the drawings.
[0046] The following are the explanations of the nouns related to the present application:
[0047] ROS: The full name is Robot Operating System, a robot operating system, a platform for developing robot-related systems, including corresponding standards, components, codes, and standard application interfaces.
[0048] ROS message data: The programming and interaction data generated when developing software or applications based on the ROS platform. Among them, the file for storing ROS message data is the ROS message file.
[0049] AUTOSAR: The full name is AUTomotive Open System Architecture, an automotive open system architecture, a system platform for commercial autonomous driving vehicles with a wide range of applications, including corresponding standards, components, codes, and standard application interfaces, and has high stability.
[0050] In the development of autonomous driving systems and functions, since the development of autonomous driving for vehicles has high similarity with that of autonomous robots, the ROS platform is usually used to trial - produce autonomous driving systems or functions and verify them on verification devices. Then, after passing the verification, a corresponding commercial version is established on the AUTOSAR platform based on the system built on the ROS platform. Since the systems and functions of autonomous driving vehicles usually need to be continuously iterated, to improve processing efficiency, the ROS message data of the updated part of the system or function on the ROS platform is usually directly input into the compilation software, and the corresponding files that meet the requirements of the AUTOSAR platform are obtained through the compilation software.
[0051] When the amount of updates is large, there is a large amount of ROS message data that needs to be input into the compilation software, which takes a long time, has low processing efficiency, and because it is manually input, there are likely to be input errors, resulting in poor accuracy.
[0052] To solve the above problems, the embodiment of this application provides a data conversion method. By combining extraction tools, message extraction models, etc., it realizes the automated processing of all ROS message data, adapts to different data processing volumes, and ensures the efficiency and reliability of data conversion.
[0053] Figure 1 This is an application scenario diagram of the data conversion method provided by the embodiment of this application. As Figure 1 shown, in the data conversion process, the ROS message data 100 is converted from the version of the ROS platform 120 to the version of the AUTOSAR platform 130 through the conversion tool 110.
[0054] It should be noted that Figure 1 in the scenario shown, only one example of ROS message data and compilation tools is used for illustration, but the embodiment of this application is not limited to this. That is to say, the number of ROS message data and compilation tools can be arbitrary.
[0055] The data conversion method provided by this application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0056] Figure 2 This is a flowchart of the data conversion method provided by an embodiment of this application. As Figure 2 shown, it includes but is not limited to the following steps:
[0057] Step S201: Convert the ROS message file to be converted into a ROS software package and compile the ROS software package.
[0058] Specifically, since the ROS message file itself is a file generated based on the ROS platform, if the ROS message file is not compiled, the ROS message data therein cannot be directly obtained. Therefore, it is first necessary to compile the ROS message file.
[0059] The ROS software package is a format file provided in the ROS platform for packaging relevant data such as ROS message files, and it has a function of compiling ROS message files by itself. Therefore, the ROS message file can be imported into a blank ROS software package, and by compiling the ROS software package, the ROS message file therein can be further compiled.
[0060] This process can be completed by existing tools, without the need to additionally design a compilation software for ROS message files, which is convenient to use and has a small workload.
[0061] Further, the process of converting the ROS message file to be converted into a ROS software and compiling it includes the following steps:
[0062] Step 1 (not shown), create a blank ROS software package.
[0063] Step 2 (not shown), import the ROS message file to be converted into the directory of the ROS software package.
[0064] Step 3 (not shown), based on the compilation command pre-configured in the ROS software package, compile the ROS file package containing the ROS message file.
[0065] Thus, a compiled ROS file package can be obtained for further extracting the ROS message data therein.
[0066] Step S202, extract the ROS message data in the compiled ROS software package through an extraction tool.
[0067] Specifically, for the compiled ROS software package, the ROS message data therein can be extracted through existing extraction tools. The extraction tool can be any tool configured with the function of processing ROS software packages, such as matlab, rviz, etc.
[0068] Through the extraction tool, the ROS message data in the ROS software package can be directly obtained without the need to further process the ROS message file in the ROS software package.
[0069] Among them, the ROS message data is the data transmitted by the ROS node. When converting the ROS software to AUTROSAR, it is necessary to import the ROS message data into the server (similar to the message record for importing data processing). It contains the bus data and corresponding configuration data (such as CMakeLists.txt) that can be directly imported into AUTOSAR.
[0070] Step S203: Based on the set message extraction model, import the ROS message data into the data dictionary file.
[0071] Specifically, through the message extraction model configured in the extraction tool, the bus data to be imported into AUTOSAR can be extracted from the ROS message data and then imported into the data dictionary file for storage in the format of the data dictionary.
[0072] The message extraction model is used to extract the bus data from the ROS message data and transfer the bus data to the data dictionary file for further export to the corresponding format file of AUTOSAR through the AUTOSAR configuration tool.
[0073] Step S204: Based on the pre-configured AUTOSAR configuration tool, convert the data dictionary file into the corresponding format file of AUTOSAR.
[0074] Specifically, the AUTOSAR configuration tool can export the file in the data dictionary format to the corresponding format file of AUTOSAR. Since the message extraction model has converted the bus data into the data dictionary file, it can be further exported to the corresponding format file of AUTOSAR through the AUTOSAR configuration tool.
[0075] The corresponding format file of AUTOSAR is generally an arxml file, which can contain various data such as data types, interaction interfaces, and processes for processing in the corresponding format file of AUTOSAR.
[0076] Since the whole process can be automatically implemented by combining the extraction tool, the message extraction model, and the AUTOSAR configuration tool, it can realize the automatic conversion of the ROS message file into the corresponding format file of AUTOSAR.
[0077] The data conversion method provided by the embodiments of the present application can automatically convert a large number of ROS message files into the corresponding format files of AUTOSAR at one time by combining the extraction tool, the message extraction model, and the AUTOSAR configuration tool, significantly improving the efficiency of data conversion. And there is no need for manual processing in the middle, thus effectively improving the accuracy and reliability of the converted data and avoiding errors.
[0078] Figure 3a This is a flowchart of a data conversion method provided by an embodiment of the present application. As Figure 3a shown, the data conversion method provided by this embodiment includes the following steps:
[0079] Step S301: Based on the development environment where the ROS message file to be converted is located and the instructions pre-configured in the development environment, create a ROS software package.
[0080] Specifically, ROS message files are usually saved in a subdirectory corresponding to the ROS software package. During the system or program development process, there are usually a large number of updates and iterations in the versions of the ROS software package, with a large amount of content. Moreover, programs based on the AUTOSAR platform usually have certain differences from the programs in the ROS software package. Therefore, if the entire ROS software package is directly converted to the AUTOSAR platform, there will be a large amount of unavailable information, and it is cumbersome to extract the ROS message file from it. Therefore, this solution selects to only convert the ROS message file among them.
[0081] By re-creating a blank ROS software package, it is not necessary for the ROS software package under the ROS platform to participate in the relevant progress, which facilitates collaborative development on the AUTOSAR platform.
[0082] Furthermore, the development environment of the ROS message file is generally a Linux development environment. At this time, the pre-configured command to create a ROS software package is catkin_create_pkg. The created software package will automatically include the package.xml and CMakelist.txt files. The former is used to provide configuration information for the ROS software package, and the latter is used to provide information related to the compilation of the ROS software package.
[0083] Step S302: Modify the configuration file in the ROS software package based on the development environment.
[0084] Specifically, in the generated package.xml file, it is necessary to first add dependencies such as std_msgs, rospy, and roscpp (these components are inherent dependencies of the ROS software package. By setting dependencies, when the computer compiles the content in the ROS software package, these components will be compiled first to ensure normal compilation), and then add runtime environment items for message_generation and message_runtime according to information such as the version corresponding to the ROS message file and the version of the development environment to ensure normal compilation.
[0085] Step S303: Add the ROS message file to the ROS software package.
[0086] Specifically, since only the files within the directory of the ROS package are compiled during the compilation of the ROS package, it is necessary to copy the ROS message file to be converted into the root directory of the ROS package (i.e., add it to the ROS package).
[0087] Thus, the combination of the blank ROS package and the ROS message file to be converted is achieved. In subsequent compilations, by compiling the newly created blank ROS package, the ROS message file therein can be compiled, and it is ensured that the original ROS package corresponding to the ROS message file to be converted will not participate in the compilation, improving the processing efficiency.
[0088] Step S304: Compile the ROS package based on the ROS package containing the ROS message file and the configuration file in the ROS package.
[0089] Specifically, the configuration file involved in the compilation in the ROS package is the CMakelist.txt file. By adding the name of the ROS message file to be converted therein, the compilation of the ROS message file can be achieved during compilation.
[0090] Furthermore, when compiling the ROS package, the catkin_make command is usually used to compile the ROS package.
[0091] Furthermore, when there are content errors or format errors in the ROS message file to be converted and it cannot be compiled successfully, an error will be automatically reported during the process of running the catkin_make command for compilation. At this time, the ROS message file can be copied again from the original directory where the ROS message file to be converted is located to the blank ROS package, or the corresponding inspection tool for the ROS message file (such as an automatic inspection program developed based on the rosmsg command) can be run for modification, and then compilation can be performed again.
[0092] Step S305: Add the compiled ROS package to the directory corresponding to the extraction tool.
[0093] Specifically, for the compiled ROS package, the extraction tool can extract the content of each part therein. When the extraction tool is configured with a function specifically for extracting ROS message data, the ROS message data in the ROS message file can be directly extracted from the compiled ROS package.
[0094] The extraction tool usually extracts the ROS packages in the specified directory. Therefore, it is necessary to add (or copy) the compiled ROS package to the specified directory.
[0095] Optionally, the extraction tool is Matlab.
[0096] Specifically, when the extraction tool is Matlab, the specified directory is the "package" folder under the MATLAB working directory (if this folder does not exist, a new folder named "package" will be created), and then the successfully compiled ROS package file is copied to this file directory.
[0097] Step S306: Based on the pre-configured extraction command, extract ROS message data from the compiled ROS package through the extraction tool.
[0098] Specifically, extraction commands for extracting various parts are usually configured in the extraction tool. For example, when the extraction tool is Matlab, the entire ROS package can be read through the rosbag command. Therefore, the ROS message data therein can be extracted through the corresponding extraction command.
[0099] Furthermore, as Figure 3b shown, it is a flowchart for the extraction tool to extract ROS message data. Extracting ROS message data includes the following steps:
[0100] Step S3061: Identify the compiled ROS package based on the pre-configured extraction command in the extraction tool.
[0101] Specifically, in the case where the extraction tool is MATLAB, the command corresponding to extracting ROS message data is rosgenmsg. After running this command, MATLAB will automatically identify the files in the package folder under the working directory, that is, the compiled ROS package.
[0102] Step S3062: Determine that the ROS package passes the detection based on the pre-configured ROS standard specification in the extraction tool.
[0103] Specifically, if the extraction tool is a non-Matlab tool (such as rviz), at this time, to ensure the smooth progress of the extraction process, it is also necessary to add the detection of the standard specification of the compiled ROS package (such as the Automotive Safety Integrity Level specification or the program format specification).
[0104] During the running of the rosgenmsg command in Matlab, it will automatically detect whether the package is correct according to the ROS standard specification and perform subsequent extraction actions after passing the detection. Thus, the efficiency of extracting ROS message data can be improved.
[0105] Step S3063: Extract the ROS message data in the ROS package that passes the detection.
[0106] Specifically, after the compiled ROS software package passes the ROS standard specification, the ROS message data in the ROS message file is loaded into the extraction tool for further processing.
[0107] Further, when the extraction tool is MATLAB, the ROS message data is loaded into the Blank Message module.
[0108] Step S307: Based on the set message extraction model included in the extraction tool, convert the ROS message data into bus data.
[0109] Specifically, the message extraction model is a functional module built into the extraction tool to extract bus data from ROS message data. Through the message extraction model, the bus messages (i.e., bus data) contained in the ROS message data can be obtained.
[0110] Optionally, the message extraction model is the interconnected blank message module and busselector module in Simulink. Simulink is a built-in tool in Matlab. The blank message module is used to save the extracted ROS message data, and the bus selector module is used to extract bus data from the ROS message data.
[0111] Specifically, in the Simulink tool provided by Matlab, create a new blank model, drag the Blank Message module containing the ROS message data and the Bus Selector module into the blank model, and connect the Blank Message to the Bus Selector to import the ROS message data into the Bus Selector module.
[0112] Then, open the option list configured in the Blank Message module, select the successfully imported ROS message data from it, and the corresponding bus message can be automatically generated in the MATLAB workspace.
[0113] Further, the process of establishing the message extraction model and extracting the bus data from the ROS message data can be automatically completed by a program.
[0114] Step S308: Create a blank data dictionary file in the extraction tool.
[0115] Specifically, bus data is usually saved in the form of a data dictionary in the AUTOSAR platform for easy reading. Therefore, it is necessary to save the bus data in the data dictionary format.
[0116] Step S309: Import the bus data into the blank data dictionary file.
[0117] Specifically, in Matlab, a blank data dictionary file can be created and opened, and then the bus messages can be directly imported into the blank data dictionary file. At this time, the Matlab software can automatically complete the conversion of the bus messages to the MATLAB data dictionary.
[0118] Step S310: Based on the pre-configured AUTOSAR configuration tool, convert the data dictionary file into the corresponding format file of AUTOSAR.
[0119] Specifically, the AUTOSAR configuration tool can convert the file saved in the data dictionary format in the extraction tool into the corresponding format file of AUTOSAR. Therefore, based on the configuration of the AUTOSAR configuration tool, the conversion from the data dictionary file to the corresponding format file of AUTOSAR can be completed.
[0120] Furthermore, in Matlab, open the AUTOSAR configuration tool of MATLAB, import the MATLAB data dictionary containing bus data, then select the relevant configuration items in sequence based on the AUTOSAR configuration wizard, and finally, the AUTOSAR standard data type file can be automatically generated.
[0121] Among them, the corresponding format file of AUTOSAR is an arxml format file.
[0122] Specifically, through the generated file in the arxml format, this file can be common in the AUTOSAR platform, saving the subsequent format conversion work.
[0123] The data conversion method provided by the embodiment of the present application, by creating a blank ROS software package, adding the ROS message file to be converted to the ROS software package, then compiling, and extracting the compiled ROS message data through an extraction tool, and then converting the ROS message data into bus data through a message extraction model and exporting it in the data dictionary format, and then exporting the bus data in the data dictionary format as the corresponding format file of AUTOSAR through the AUTOSAR configuration tool. Thus, without the participation of the original ROS software package, the ROS message file can be obtained and automatically converted into the corresponding format file of AUTOSAR, with a fast generation speed, convenient for collaborative development. At the same time, the entire process is automatically completed by an automated tool, saving a large amount of manpower and time.
[0124] Figure 4 This is a schematic structural diagram of a data conversion device provided by an embodiment of the present application. As Figure 4As shown in the figure, the data conversion device 400 includes: a compilation module 410, an extraction module 420, an import module 430, and a conversion module 440. Among them:
[0125] The compilation module 410 is used to convert the ROS message file to be converted into a ROS software package and compile the ROS software package;
[0126] The extraction module 420 is used to extract ROS message data from the compiled ROS software package through an extraction tool;
[0127] The import module 430 is used to import the ROS message data into a data dictionary file based on a set message extraction model;
[0128] The conversion module 440 is used to convert the data dictionary file into a format file corresponding to AUTOSAR based on a pre-configured AUTOSAR configuration tool.
[0129] Optionally, the compilation module 410 is specifically used to create a ROS software package based on the development environment where the ROS message file to be converted is located and the instructions pre-configured in the development environment; modify the configuration file in the ROS software package based on the development environment; add the ROS message file to the ROS software package; and compile the ROS software package based on the ROS software package containing the ROS message file and the configuration file in the ROS software package.
[0130] Optionally, the extraction module 420 is specifically used to add the compiled ROS software package to the directory corresponding to the extraction tool; extract ROS message data from the compiled ROS software package through the extraction tool based on a pre-configured extraction command.
[0131] Optionally, the extraction module 420 is specifically used to identify the compiled ROS software package based on the extraction command pre-configured in the extraction tool; determine that the ROS software package passes the detection based on the ROS standard specification pre-configured in the extraction tool; and extract the ROS message data from the ROS software package that passes the detection.
[0132] Optionally, the import module 430 is specifically used to convert the ROS message data into bus data based on the set message extraction model included in the extraction tool; create a blank data dictionary file in the extraction tool; and import the bus data into the blank data dictionary file.
[0133] Optionally, the extraction module 420 includes Matlab as the extraction tool, and the message extraction model is the interconnected blank message module and bus selector module in Simulink. Simulink is a built-in tool in Matlab. The blank message module is used to save the extracted ROS message data, and the bus selector module is used to extract bus data from the ROS message data.
[0134] Optionally, the conversion module 440 includes an AUTOSAR - corresponding format file in the arxml format.
[0135] In this embodiment, through the combination of each module, the data conversion device can automatically convert the ROS message file into the AUTOSAR - corresponding format file. The entire process is automatically completed by an automated tool, saving a large amount of manpower and time, and at the same time ensuring the accuracy and reliability of the results.
[0136] Figure 5 The following is a schematic structural diagram of a control device provided by an embodiment of the present application, as Figure 5 shown, the control device 500 includes: a memory 510 and a processor 520.
[0137] Among them, the memory 510 stores a computer program executable by at least one processor 520. The computer program is executed by at least one processor 520 to enable the control device to implement the data conversion method provided in any of the above - mentioned embodiments.
[0138] Among them, the memory 510 and the processor 520 can be connected through a bus 530.
[0139] For relevant descriptions, reference can be made to the corresponding descriptions and effects in the method embodiments, and details are not elaborated here.
[0140] An embodiment of the present application provides a computer - readable storage medium, on which a computer program is stored. The computer program is executed by a processor to implement the data conversion method in any of the embodiments corresponding to Figure 2 to FIG. 3.
[0141] Among them, the computer - readable storage medium can be a ROM, a random - access memory (RAM), a CD - ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0142] An embodiment of the present application provides a computer program product, which includes computer - executable instructions. When the computer - executable instructions are executed by a processor, they are used to implement the data conversion method in any of the embodiments corresponding to Figure 2 to FIG. 3.
[0143] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or modules can be in electrical, mechanical or other forms.
[0144] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the disclosure herein. The present application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and embodiments are only regarded as exemplary, and the true scope of the present application is pointed out by the claims.
[0145] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A data conversion method, characterized in that, the data conversion method includes: Converting the ROS message file to be converted into a ROS software package and compiling the ROS software package; Adding the compiled ROS software package to the directory corresponding to the extraction tool; Based on a pre-configured extraction command, extracting ROS message data from the compiled ROS software package through the extraction tool; Based on the set message extraction model included in the extraction tool, converting the ROS message data into bus data; Creating a blank data dictionary file in the extraction tool; Importing the bus data into the blank data dictionary file; Based on a pre-configured AUTOSAR configuration tool, converting the data dictionary file into a format file corresponding to AUTOSAR.
2. The data conversion method according to claim 1, characterized in that, the converting the ROS message file to be converted into a ROS software package and compiling the ROS software package includes: Based on the development environment where the ROS message file to be converted is located and the instructions pre-configured in the development environment, creating a ROS software package; Based on the development environment, modifying the configuration file in the ROS software package; Adding the ROS message file to the ROS software package; Based on the ROS software package containing the ROS message file and the configuration file in the ROS software package, compiling the ROS software package.
3. The data conversion method according to claim 1, characterized in that, the extracting the ROS message data from the compiled ROS software package through the extraction tool based on a pre-configured extraction command includes: Based on the extraction command pre-configured in the extraction tool, identifying the compiled ROS software package; Based on the ROS standard specification pre-configured in the extraction tool, determining that the ROS software package passes the detection; Extracting the ROS message data in the ROS software package that passes the detection.
4. The data conversion method according to any one of claims 1 to 3, characterized in that, the format file corresponding to AUTOSAR is an arxml format file.
5. A data conversion device, characterized in that, including: A compilation module for converting the ROS message file to be converted into a ROS software package and compiling the ROS software package; An extraction module for adding the compiled ROS software package to the directory corresponding to the extraction tool; based on a pre-configured extraction command, extracting ROS message data from the compiled ROS software package through the extraction tool; An import module for converting the ROS message data into bus data based on the set message extraction model included in the extraction tool; creating a blank data dictionary file in the extraction tool; importing the bus data into the blank data dictionary file; A conversion module for converting the data dictionary file into a format file corresponding to AUTOSAR based on a pre-configured AUTOSAR configuration tool.
6. A control device, characterized in that, Comprising: At least one processor; And a memory communicatively connected to the at least one processor; Wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to cause the control device to execute the data conversion 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 computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the data conversion method according to any one of claims 1 to 4.
8. A computer program product, Characterized in that, The computer program product includes a computer program, and when the computer program is executed by a processor, it is used to implement the data conversion method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Data format conversion method and device
CN110941655A
Universal processing system for multi-bus data conversion of avionics system
CN112068808A