[go: up one dir, main page]

CN115292399B - Data conversion method, device, equipment and storage medium - Google Patents

Data conversion method, device, equipment and storage medium Download PDF

Info

Publication number
CN115292399B
CN115292399B CN202210940029.2A CN202210940029A CN115292399B CN 115292399 B CN115292399 B CN 115292399B CN 202210940029 A CN202210940029 A CN 202210940029A CN 115292399 B CN115292399 B CN 115292399B
Authority
CN
China
Prior art keywords
ros
data
software package
file
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210940029.2A
Other languages
Chinese (zh)
Other versions
CN115292399A (en
Inventor
李伟超
张天雷
薛运
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhuxian Technology Co Ltd
Original Assignee
Beijing Zhuxian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhuxian Technology Co Ltd filed Critical Beijing Zhuxian Technology Co Ltd
Priority to CN202210940029.2A priority Critical patent/CN115292399B/en
Publication of CN115292399A publication Critical patent/CN115292399A/en
Application granted granted Critical
Publication of CN115292399B publication Critical patent/CN115292399B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/374Thesaurus
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a data conversion method, a device, equipment and a storage medium. The method comprises the steps of determining a user identifier to be tested, converting an ROS (radio frequency identification) message file to be converted into an ROS software package, compiling the ROS software package, extracting ROS message data in the compiled ROS software package through an extraction tool, importing the ROS message data into a data dictionary file based on a set message extraction model, and converting the data dictionary file into a format file corresponding to AUTOSAR based on a pre-configured AUTOSAR configuration tool. The embodiment of the application realizes the automatic conversion of the ROS message file into the format file corresponding to the AUTOSAR, and all the processes are automatically completed by an automation tool, so that a great deal of manpower and time are saved, and the accuracy and reliability of the result are ensured.

Description

Data conversion method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of data processing, in particular to a data conversion method, a device, equipment and a storage medium.
Background
With the generation of diversified traffic demands, automatic driving techniques are increasingly being used. When the development of the automatic driving vehicle system is carried out, a robot operation system ROS platform is generally used for carrying out functional test and verification, but the automatic driving vehicle system developed by the ROS platform cannot meet the standard requirement of automobile safety, so that related data of the automatic driving vehicle system developed by the ROS platform needs to be converted into data in an automobile open system architecture AUTOSAR platform which can meet the standard requirement of automobile safety.
In the prior art, in the data conversion from the ROS platform to the AUTOSAR platform, for the ROS message recorded by the message generated in the ROS platform, the ROS message needs to be manually input into the AUTOSAR platform, which is low in efficiency and prone to error.
Disclosure of Invention
The embodiment of the application provides a data conversion method, a device, equipment and a storage medium, which are used for improving the data conversion efficiency of ROS message.
In a first aspect, an embodiment of the present application provides a data conversion method, where the data conversion method includes:
converting the ROS message file to be converted into an ROS software package, and compiling the ROS software package;
extracting ROS message data in the compiled ROS software package by an extraction tool;
importing ROS message data into a data dictionary file based on a set message extraction model;
and converting the data dictionary file into a format file corresponding to the AUTOSAR based on a pre-configured AUTOSAR configuration tool.
Therefore, a large number of ROS message files can be automatically converted into format files corresponding to AUTOSAR at one time by combining an extraction tool, a message extraction model and an AUTOSAR configuration tool, so that the data conversion efficiency is remarkably improved, manual processing is not needed in the middle, and the accuracy and reliability of the converted data are further improved.
Optionally, converting the ROS message file to be converted into an ROS software package and compiling the ROS software package, including building the ROS software package based on the development environment in which the ROS message file to be converted is located and the pre-configured instructions in the development environment, modifying the configuration files 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 files in the ROS software package.
Therefore, the ROS information file to be converted is in a compilable format and environment by establishing the ROS software package and adding the ROS information file to the ROS software package, so that an extraction tool can conveniently extract data in the ROS information file to be converted directly from the ROS software package, and successful data processing is ensured.
Optionally, extracting ROS message data in the compiled ROS software package by the extraction tool comprises adding the compiled ROS software package to a catalog corresponding to the extraction tool, and extracting ROS message data from the compiled ROS software package by the extraction tool based on a preconfigured extraction command.
Therefore, through a preconfigured extraction command, the corresponding ROS message data in the ROS message file can be directly acquired in the ROS software package, so that further conversion processing is facilitated.
Optionally, extracting ROS message data from the compiled ROS software package by an extraction tool based on the preconfigured extraction command includes identifying the compiled ROS software package based on the preconfigured extraction command in the extraction tool, determining that the ROS software package passes detection based on the preconfigured ROS standard specification in the extraction tool, and extracting ROS message data in the passed detection ROS software package.
Therefore, when the ROS message data are extracted, the ROS file packet is detected, so that the ROS file packet is ensured to meet the ROS standard specification, the data extraction process is ensured to be carried out smoothly, the data extraction abnormality is avoided, meanwhile, the ROS file packet can be detected in advance, and a manager is informed of further processing when the ROS file packet does not meet the standard specification, so that the processing success rate is effectively improved, and the processing efficiency is further improved.
Optionally, importing the ROS message data into the data dictionary file based on the set message extraction model includes converting the ROS message data into bus data based on the set message extraction model contained 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.
Therefore, the ROS message data are converted into the bus data to obtain specific information which is transmitted and received through the bus in the ROS message data, and the bus data in the ROS message data can be stored in a data dictionary format by importing the bus data into the data dictionary file, so that the AUTOSAR configuration file is convenient to read and is converted into a corresponding format file.
Optionally, the format file corresponding to the AUTOSAR is arxml format file.
It can be seen that by converting the bus data into arxml format files, further reading and processing in the AUTOSAR platform is facilitated.
In a second aspect, an embodiment of the present application provides a data conversion apparatus, including:
the compiling module is used for converting the ROS message file to be converted into an ROS software package and compiling the ROS software package;
The extraction module is used for extracting ROS message data in the compiled ROS software package through an extraction tool;
The importing module is used for importing the ROS message data into the data dictionary file based on the set message extraction model;
the conversion module is used for converting the data dictionary file into a format file corresponding to the AUTOSAR based on a pre-configured AUTOSAR configuration tool.
Optionally, the compiling module is specifically configured to build an ROS software package based on a development environment in which the ROS message file to be converted is located and a pre-configured instruction in the development environment, modify a 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.
Optionally, the extraction module is specifically configured to add the compiled ROS software package to a directory corresponding to the extraction tool, and extract ROS message data from the compiled ROS software package by the extraction tool based on a pre-configured extraction command.
Optionally, the extraction module is specifically configured to identify the compiled ROS software package based on a pre-configured extraction command in the extraction tool, determine that the ROS software package passes detection based on a pre-configured ROS standard specification in the extraction tool, and extract ROS message data in the ROS software package that passes detection.
Optionally, the importing module is specifically configured to convert the 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.
Optionally, the extracting module includes an extracting tool is Matlab, the message extracting model is a blank message module and a bus selector module which are connected with each other in a simulink, the simulink is a built-in tool in Matlab, the blank message module is used for storing the extracted ROS message data, and the bus selector module is used for extracting bus data from the ROS message data.
Optionally, the conversion module includes that the format file corresponding to the AUTOSAR is arxml format file.
In a third aspect, an embodiment of the present application further provides a control apparatus, including:
At least one processor;
And a memory communicatively coupled to the at least one processor;
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 perform a data conversion method according to any one of the embodiments of the first aspect of the present application.
In a fourth aspect, embodiments of the present application further provide a computer readable storage medium, where computer executable instructions are stored, where the computer executable instructions when executed by a processor are configured to implement any one of the data conversion methods according to the first aspect of the embodiments of the present application.
In a fifth aspect, embodiments of the present application further provide a computer program product, where the program product contains computer-executable instructions for implementing the data conversion method according to any of the embodiments corresponding to the first aspect of the embodiments of the present application when the computer-executable instructions are executed by a processor.
Drawings
Fig. 1 is an application scenario diagram of a data conversion method according to an embodiment of the present application;
FIG. 2 is a flowchart of a data conversion method according to an embodiment of the present application;
FIG. 3a is a flowchart of a data conversion method according to another embodiment of the present application;
FIG. 3b is a flow chart of an extraction tool for extracting ROS message data in accordance with a further embodiment of the present application;
Fig. 4 is a schematic structural diagram of a data conversion device according to another embodiment of the present application;
Fig. 5 is a schematic structural diagram of a control device according to another embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with embodiments of the application. Rather, they are merely examples of apparatus and methods consistent with aspects of embodiments of the application as detailed in the accompanying claims.
The following describes in 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 with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The following is a noun-related explanation to which the present application relates:
ROS is known as Robot Operating System, a robot operating system, a platform for developing a robot-related system, including corresponding standards, components, code and standard application interfaces.
ROS message data, which is generated when software or applications are developed based on the ROS platform, wherein the file used for storing the ROS message data is an ROS message file.
AUTOSAR is a system platform of a commercial automatic driving vehicle with a full name AUTomotive Open System Architecture and a vehicle open system architecture and a wider application range, comprises corresponding standards, components, codes and standard application interfaces, and has higher stability.
In the development of the automatic driving system and function, since the automatic driving of the vehicle has higher similarity with the development of the automatic robot, the ROS platform is generally used to try to make the automatic driving system or function, and perform verification on the verification device, and then after the verification is passed, based on the system built on the ROS platform, a corresponding commercial version is built on the AUTOSAR platform. Because the system and the function of the automatic driving vehicle generally need to iterate continuously, in order to improve the processing efficiency, the ROS message data of the updated system or function part on the ROS platform is generally directly input into the compiling software, and the corresponding file meeting the requirement of the AUTOSAR platform is obtained through the compiling software.
When the update amount is large, ROS message data which are required to be input into the compiling software are more, the time consumption is long, the processing efficiency is low, and the accuracy is poor due to the fact that the input is performed manually and the input error is easy to occur.
In order to solve the above problems, the embodiment of the application provides a data conversion method, which realizes the automatic processing of all ROS message data by combining an extraction tool, a message extraction model and the like, adapts to the conditions of different data processing amounts and ensures the efficiency and the reliability of data conversion.
Fig. 1 is an application scenario diagram of a data conversion method according to an embodiment of the present application. As shown in fig. 1, in the data conversion process, ROS message data 100 is converted from a version of ROS platform 120 to a version of AUTOSAR platform 130 by conversion tool 110.
It should be noted that, in the scenario shown in fig. 1, the ROS message data and the compiling tool are only illustrated as an example, but the embodiment of the present application is not limited thereto, that is, the number of ROS message data and compiling tools may be arbitrary.
The data conversion method provided by the application is described in detail by a specific embodiment. It should be noted that the following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 2 is a flowchart of a data conversion method according to an embodiment of the application. As shown in fig. 2, including but not limited to the following steps:
Step S201, converting the ROS message file to be converted into an ROS software package, and compiling the ROS software package.
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 in the ROS message file cannot be directly obtained, and therefore, the ROS message file needs to be compiled first.
The ROS software package is a format file provided in the ROS platform and used for packaging relevant data such as ROS message files and the like, and has the function of compiling the ROS message files, so that the ROS message files can be imported into a blank ROS software package, and the ROS message files in the ROS software package can be compiled through compiling the ROS software package.
The process can be completed by the existing tool without additionally designing compiling software of the ROS message file, and is convenient to use and small in workload.
Further, the process of converting the ROS message file to be converted into ROS software and compiling the ROS software comprises the following steps:
Step one (not shown), a blank ROS software package is created.
Step two (not shown), importing the ROS message file to be converted into the catalog of the ROS software package.
Step three (not shown), compiling the ROS file package containing the ROS message file based on a pre-configured compiling command in the ROS software package.
Thus, a compiled ROS file packet may be obtained for further extraction of ROS message data therein.
Step S202, extracting ROS message data in the compiled ROS software package through an extraction tool.
Specifically, the compiled ROS software package can extract ROS message data therein through existing extraction tools. The extraction tool may be any tool configured with the functionality to process ROS packages, such as matlab, rviz, etc.
Through the extraction tool, the ROS message data in the ROS software package can be directly obtained, and further processing of the ROS message file in the ROS software package is not required.
The ROS message data is data transmitted by the ROS node, and when the ROS software is converted into AUTROSAR, the ROS message data needs to be imported into the server (similar to the message record of the imported data processing). Which contains bus data and corresponding configuration data (e.g., cmakelist. Txt) that can be directly imported into the AUTOSAR.
Step S203, importing ROS message data into a data dictionary file based on the set message extraction model.
Specifically, the bus data imported into the AUTOSAR may be extracted from ROS message data by a message extraction model configured in the extraction tool, and then imported into the data dictionary file, thereby being stored in the format of the data dictionary.
The message extraction model is used for extracting bus data in the ROS message data, and transferring the bus data into a data dictionary file so as to be further exported into a format file corresponding to the AUTOSAR through an AUTOSAR configuration tool.
Step S204, converting the data dictionary file into a format file corresponding to the AUTOSAR based on a pre-configured AUTOSAR configuration tool.
Specifically, the AUTOSAR configuration tool can export the file in the data dictionary format into the corresponding format file of AUTOSAR, and because the message extraction model has already converted the bus data into the data dictionary file, the data dictionary file can be exported into the corresponding format file of AUTOSAR by the AUTOSAR configuration tool.
The format file corresponding to the AUTOSAR is generally arxml files, which can contain various data such as data types, interactive interfaces, processes and the like so as to process in the format file corresponding to the AUTOSAR.
The whole process can be automatically realized by combining an extraction tool, a message extraction model and an AUTOSAR configuration tool, so that the ROS message file can be automatically converted into a file in an AUTOSAR corresponding format.
According to the data conversion method provided by the embodiment of the application, a large number of ROS message files can be automatically converted into the format files corresponding to the AUTOSAR at one time by combining the extraction tool, the message extraction model and the AUTOSAR configuration tool, so that the data conversion efficiency is remarkably improved, manual processing is not needed in the middle, the accuracy and the reliability of the converted data are further improved, and errors are avoided.
Fig. 3a is a flowchart of a data conversion method according to an embodiment of the present application. As shown in fig. 3a, the data conversion method provided in this embodiment includes the following steps:
step S301, an ROS software package is established based on a development environment in which an ROS message file to be converted is located and a pre-configured instruction in the development environment.
In particular, the ROS message files are usually stored in subdirectories of corresponding ROS packages, and during the development of the system or the program, versions in the ROS packages are often updated and iterated in a large amount, and the program based on the AUTOSAR platform is often different from the program in the ROS packages to some extent, so if the ROS packages are directly converted into the AUTOSAR platform as a whole, a large amount of unavailable information exists, and the ROS message files are extracted therefrom, which is cumbersome to operate.
By reestablishing a blank ROS software package, the ROS software package under the ROS platform is not required to participate in related progress, and collaborative development on the AUTOSAR platform is facilitated.
Further, the development environment of the ROS message file is generally the linux development environment, and at this time, the preconfigured command for creating the ROS package is catkin _create_pkg, and the created package automatically includes a package. Xml and a cmakelist. Txt file, where the former is used to provide configuration information of the ROS package, and the latter is used to provide information related to compiling the ROS package.
Step S302, based on the development environment, modifying the configuration file in the ROS software package.
Specifically, in the generated package xml file, it is necessary to add the dependency items such as std_ msgs, rospy, roscpp (these components are the dependency items inherent to the ROS software package, by setting the dependency items, when the computer compiles the content in the ROS software package, these components will be compiled first to ensure that the compilation is performed normally), and then add the running environment items of the message_generation and the message_ runtime according to the version corresponding to the ROS message file, the version of the development environment, and the like, so as to ensure that the compilation is performed normally.
Step S303, adding the ROS message file to the ROS software package.
Specifically, since the ROS package is compiled only when compiled, the ROS message file to be converted needs to be copied into the root directory of the ROS package (i.e., added to the ROS package).
Therefore, the combination of the blank ROS software package and the ROS message file to be converted is realized, in the subsequent compiling, the ROS message file in the blank ROS software package can be compiled by compiling the newly-built blank ROS software package, the original ROS software package corresponding to the ROS message file to be converted is ensured not to participate in compiling, and the processing efficiency is improved.
Step S304, 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.
Specifically, the configuration file involved in compiling the ROS software package is a CMakelist.txt file. By adding the name of the ROS message file to be converted, the compiling of the ROS message file can be realized at the compiling time.
Further, when compiling the ROS package, the ROS package is typically compiled using the catkin _make command.
Further, when the ROS message file to be converted has content errors or format errors and cannot be compiled normally, errors are automatically reported in the process of compiling by running catkin _make command. At this point, the modification process may be performed by re-copying the ROS message file from the original directory in which the ROS message file to be converted is located into a blank ROS software package, or running a checking tool (e.g., an automatic checking program developed based on rosmsg command) corresponding to the ROS message file, and then compiling again.
Step S305, adding the compiled ROS software package into a catalog corresponding to the extraction tool.
Specifically, the compiled ROS software package may extract the content of each part thereof by the extraction tool, and when the extraction tool is configured with a function of specifically extracting ROS message data, the ROS message data in the ROS message file may be directly extracted from the compiled ROS software package.
The extraction tool will typically extract the ROS package in a specified directory, and therefore, a compiled ROS package needs to be added (or copied) to the specified directory.
Alternatively, the extraction tool is Matlab.
Specifically, when the extraction tool is Matlab, the specified directory is a folder named "package" under the Matlab working directory (if there is no folder, a new folder named "package" is created), and then the ROS package file that is successfully compiled is copied into the directory.
Step S306, based on the preconfigured extraction command, extracting ROS message data from the compiled ROS software package through an extraction tool.
Specifically, the extraction tool is typically configured with a command to extract each portion of content, such as when the extraction tool is matlab, the entire ROS package may be read via the rosbag command. Thus, ROS message data therein may be extracted by a corresponding extraction command.
Further, as shown in fig. 3b, which is a flowchart of extracting ROS message data by the extracting tool, the extracting ROS message data includes the steps of:
step S3061, based on the extraction command preconfigured in the extraction tool, identifies the compiled ROS package.
Specifically, in the case that the extraction tool is MATLAB, the command corresponding to the command for extracting the ROS message data is rosgenmsg, and after the command is executed, the MATLAB automatically identifies the file in the package folder under the working directory, that is, the compiled ROS package.
Step S3062, determining that the ROS software package passes detection based on the pre-configured ROS standard specification in the extraction tool.
Specifically, if the extracting tool is a non-matlab tool (e.g., rviz), in order to ensure that the extracting process is performed smoothly, it is further necessary to add a standard specification (e.g., auto safety SAFETY INTEGRITY LEVEL specification or program format specification) for the compiled ROS package for detection.
In operation, the command rosgenmsg of matlab automatically detects whether the software package is correct according to the ROS standard specification, and performs subsequent extraction actions after passing detection, so that the efficiency of extracting ROS message data can be improved.
Step S3063, extracting ROS message data in the ROS software package passing the detection.
Specifically, after the compiled ROS software package passes the ROS standard specification, ROS message data in the ROS message file therein is loaded into the extraction tool for further processing.
Further, when the extraction tool is MATLAB, ROS Message data is loaded into the Blank Message module.
Step S307, converting ROS message data into bus data based on the set message extraction model included in the extraction tool.
Specifically, the message extraction model is a functional module which is built in the extraction tool and extracts bus data from the ROS message data, and bus messages (namely bus data) contained in the ROS message data can be obtained through the message extraction model.
Optionally, the message extraction model is a blank message module and a bus selector module which are connected with each other in a simulink, the simulink is a built-in tool in Matlab, the blank message module is used for storing the extracted ROS message data, and the bus selector module is used for extracting bus data from the ROS message data.
Specifically, a Blank model is newly built in a simulink tool provided by matlab, a Blank Message module and a Bus Selector module containing ROS Message data are dragged into the Blank model, and the Blank Message is connected to the Bus Selector, so that the ROS Message data are imported into the Bus Selector module.
Then, an option list configured in the Blank Message module is opened, and the ROS Message data successfully imported is selected from the option list, so that a corresponding bus Message can be automatically generated in the MATLAB working area.
Further, the process of building a message extraction model and extracting bus data in ROS message data may be automatically accomplished by a program.
Step S308, a blank data dictionary file is established in the extraction tool.
In particular, the bus data is typically stored in a data dictionary format in the AUTOSAR platform to facilitate reading, and therefore, the bus data needs to be stored in the data dictionary format.
Step S309, importing the bus data into the blank data dictionary file.
Specifically, in MATLAB, a blank data dictionary file can be created and opened, and then the bus message is directly imported into the blank data dictionary file, and then the MATLAB software can automatically complete the conversion work from the bus message to the MATLAB data dictionary.
Step S310, converting the data dictionary file into a format file corresponding to the AUTOSAR based on a pre-configured AUTOSAR configuration tool.
Specifically, the AUTOSAR configuration tool can convert the file stored in the data dictionary format in the extraction tool into the format file corresponding to the AUTOSAR, so that the conversion work from the data dictionary file to the format file corresponding to the AUTOSAR can be completed based on the configuration of the AUTOSAR configuration tool.
Further, in MATLAB, an AUTOSAR configuration tool of MATLAB is opened, MATLAB data dictionary containing bus data is imported, then related configuration items are sequentially selected based on AUTOSAR configuration guidance, and finally, a data type file of an AUTOSAR standard can be automatically generated.
The format file corresponding to the AUTOSAR is arxml format file.
Specifically, the file with the arxml format can be used in the AUTOSAR platform in a common way through the generated file with the arxml format, so that the subsequent format conversion work is omitted.
According to the data conversion method provided by the embodiment of the application, the ROS information file to be converted is added into the ROS software package by establishing the blank ROS software package, then compiling is carried out, the compiled ROS information data is extracted by the extracting tool, then the ROS information data is converted into bus data by the information extracting model, the bus data in the data dictionary format is exported, and then the bus data in the data dictionary format is exported into a format file corresponding to AUTOSAR by the AUTOSAR configuring tool. Therefore, the ROS message file can be obtained under the condition that the original ROS software package is not involved, and is automatically converted into the format file corresponding to the AUTOSAR, so that the generation speed is high, the collaborative development is convenient, and meanwhile, the whole process is automatically completed by an automatic tool, and a large amount of manpower and time are saved.
Fig. 4 is a schematic structural diagram of a data conversion device according to an embodiment of the present application. As shown in fig. 4, the data conversion apparatus 400 includes a compiling module 410, an extracting module 420, an importing module 430, and a converting module 440. Wherein:
a compiling module 410, configured to convert the ROS message file to be converted into an ROS software package, and compile the ROS software package;
an extraction module 420 for extracting ROS message data in the compiled ROS software package by an extraction tool;
An importing module 430 for importing ROS message data into a data dictionary file based on the set message extraction model;
the conversion module 440 is configured to convert the data dictionary file into a format file corresponding to the AUTOSAR based on a pre-configured AUTOSAR configuration tool.
Optionally, the compiling module 410 is specifically configured to build an ROS software package based on a development environment in which the ROS message file to be converted is located and a pre-configured instruction in the development environment, modify a 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.
Optionally, the extracting module 420 is specifically configured to add the compiled ROS software package to a directory corresponding to the extracting tool, and extract ROS message data from the compiled ROS software package by the extracting tool based on a preconfigured extracting command.
Optionally, the extraction module 420 is specifically configured to identify the compiled ROS software package based on the extraction command preconfigured in the extraction tool, determine that the ROS software package passes detection based on the ROS standard specification preconfigured in the extraction tool, and extract ROS message data in the ROS software package passing detection.
Optionally, the importing module 430 is specifically configured to convert the 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.
Optionally, the extracting module 420 includes an extracting tool that is Matlab, a message extracting model that is a blank message module and a bus selector module that are connected to each other in a simulink, where simulink is a built-in tool in Matlab, the blank message module is used to store the extracted ROS message data, and the bus selector module is used to extract bus data from the ROS message data.
Optionally, the conversion module 440 includes that the format file corresponding to the AUTOSAR is arxml format file.
In this embodiment, the data conversion device can automatically convert the ROS message file into a format file corresponding to the AUTOSAR by combining the modules, and all the processes are automatically completed by the automation tool, so that a great deal of manpower and time are saved, and meanwhile, the accuracy and reliability of the result are ensured.
Fig. 5 is a schematic structural diagram of a control device according to an embodiment of the present application, and as shown in fig. 5, the control device 500 includes a memory 510 and a processor 520.
Wherein the memory 510 stores a computer program executable by the at least one processor 520. The computer program is executed by the at least one processor 520 to cause the control device to implement the data conversion method as provided in any of the embodiments above.
Wherein the memory 510 and the processor 520 may be connected by a bus 530.
The relevant descriptions and effects corresponding to the relevant description and effects corresponding to the method embodiments may be understood, and are not repeated herein.
An embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program that is executed by a processor to implement the data conversion method of any of the embodiments as corresponds to fig. 2 to 3.
The computer readable storage medium may be, among other things, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
An embodiment of the present application provides a computer program product containing computer-executable instructions for implementing the data conversion method of any of the embodiments as corresponding to fig. 2 to 3 when executed by a processor.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules is merely a logical function division, and there may be additional divisions of actual implementation, e.g., multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope of the application being indicated by the following claims.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof.

Claims (8)

1.一种数据转换方法,其特征在于,所述数据转换方法包括:1. A data conversion method, characterized in that the data conversion method comprises: 将待转换的ROS消息文件转化为ROS软件包,并对所述ROS软件包进行编译;Convert the ROS message file to be converted into a ROS software package, and compile the ROS software package; 将所述编译后的ROS软件包添加至提取工具对应的目录中;Add the compiled ROS software package to the directory corresponding to the extraction tool; 基于预先配置的提取命令,通过所述提取工具从所述编译后的ROS软件包中提取ROS消息数据;Based on a preconfigured extraction command, extracting ROS message data from the compiled ROS software package by the extraction tool; 基于所述提取工具中包含的设定的消息提取模型,将所述ROS消息数据转化为总线数据;Based on a 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; 基于预先配置的AUTOSAR配置工具,将数据字典文件转换为AUTOSAR对应的格式文件。Based on the pre-configured AUTOSAR configuration tool, the data dictionary file is converted into the format file corresponding to AUTOSAR. 2.根据权利要求1所述的数据转换方法,其特征在于,所述将待转换的ROS消息文件转化为ROS软件包,并对所述ROS软件包进行编译,包括:2. The data conversion method according to claim 1, characterized in that the converting of the ROS message file to be converted into a ROS software package and compiling the ROS software package comprises: 基于所述待转换的ROS消息文件所在的开发环境和所述开发环境中预先配置的指令,建立ROS软件包;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; 基于所述开发环境,修改所述ROS软件包中的配置文件;Based on the development environment, modify the configuration file in the ROS software package; 将所述ROS消息文件添加至所述ROS软件包中;Adding the ROS message file to the ROS software package; 基于包含所述ROS消息文件的ROS软件包和所述ROS软件包中的配置文件,对所述ROS软件包进行编译。The ROS software package is compiled based on the ROS software package including the ROS message file and the configuration file in the ROS software package. 3.根据权利要求1所述的数据转换方法,其特征在于,所述基于预先配置的提取命令,通过所述提取工具从所述编译后的ROS软件包中提取所述ROS消息数据,包括:3. The data conversion method according to claim 1, characterized in that the extracting the ROS message data from the compiled ROS software package by the extraction tool based on the pre-configured extraction command comprises: 基于所述提取工具中预先配置的提取命令,识别所述编译后的ROS软件包;Based on the extraction command pre-configured in the extraction tool, identifying the compiled ROS software package; 基于所述提取工具中预先配置的ROS标准规范,确定所述ROS软件包通过检测;Determining that the ROS software package passes the test based on a ROS standard specification preconfigured in the extraction tool; 提取通过检测的所述ROS软件包中的ROS消息数据。Extract the ROS message data in the detected ROS package. 4.根据权利要求1至3中任一项所述的数据转换方法,其特征在于,所述AUTOSAR对应的格式文件为arxml格式文件。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.一种数据转换装置,其特征在于,包括:5. A data conversion device, comprising: 编译模块,用于将待转换的ROS消息文件转化为ROS软件包,并对所述ROS软件包进行编译;A compiling module, used to convert the ROS message file to be converted into a ROS software package, and compile the ROS software package; 提取模块,用于将所述编译后的ROS软件包添加至提取工具对应的目录中;基于预先配置的提取命令,通过所述提取工具从所述编译后的ROS软件包中提取ROS消息数据;An extraction module, used to add the compiled ROS software package to a directory corresponding to an extraction tool; based on a pre-configured extraction command, extract ROS message data from the compiled ROS software package through the extraction tool; 导入模块,用于基于所述提取工具中包含的设定的消息提取模型,将所述ROS消息数据转化为总线数据;在所述提取工具中建立空白数据字典文件;将所述总线数据导入所述空白数据字典文件中;An import module, for converting the ROS message data into bus data based on a set message extraction model contained in the extraction tool; establishing a blank data dictionary file in the extraction tool; and importing the bus data into the blank data dictionary file; 转换模块,用于基于预先配置的AUTOSAR配置工具,将数据字典文件转换为AUTOSAR对应的格式文件。The conversion module is used to convert the data dictionary file into a format file corresponding to AUTOSAR based on a pre-configured AUTOSAR configuration tool. 6.一种控制设备,其特征在于,包括:6. A control device, comprising: 至少一个处理器;at least one processor; 以及与所述至少一个处理器通信连接的存储器;and a memory communicatively coupled to the at least one processor; 其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述控制设备执行如权利要求1至4中任一项所述的数据转换方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the control device to perform the data conversion method as described in any one of claims 1 to 4. 7.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现如权利要求1至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.一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时用于实现如权利要求1至4中任一项所述的数据转换方法。8. A computer program product, characterized in that the computer program product comprises 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.
CN202210940029.2A 2022-08-05 2022-08-05 Data conversion method, device, equipment and storage medium Active CN115292399B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210940029.2A CN115292399B (en) 2022-08-05 2022-08-05 Data conversion method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210940029.2A CN115292399B (en) 2022-08-05 2022-08-05 Data conversion method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115292399A CN115292399A (en) 2022-11-04
CN115292399B true CN115292399B (en) 2025-05-27

Family

ID=83828099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210940029.2A Active CN115292399B (en) 2022-08-05 2022-08-05 Data conversion method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115292399B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941655A (en) * 2018-09-21 2020-03-31 中移(杭州)信息技术有限公司 A data format conversion method and device
CN112068808A (en) * 2020-08-13 2020-12-11 中国航空无线电电子研究所 General processing system for multi-bus data conversion of avionics system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9360853B2 (en) * 2011-09-19 2016-06-07 Dspace Gmbh Exchange of files and meta-information between system design tools and behavior modeling tools and/or simulators for the creation of ECU software
CN114840191A (en) * 2022-04-12 2022-08-02 阿尔特汽车技术股份有限公司 Software code automatic generation method, device, equipment and readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941655A (en) * 2018-09-21 2020-03-31 中移(杭州)信息技术有限公司 A data format conversion method and device
CN112068808A (en) * 2020-08-13 2020-12-11 中国航空无线电电子研究所 General processing system for multi-bus data conversion of avionics system

Also Published As

Publication number Publication date
CN115292399A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
CN112835587B (en) Compiling integration method and device
US20070073724A1 (en) System and method for automatic or semi-automatic software integration
CN113407362A (en) SOMEIP communication intermediate layer implementation method and system based on SOA architecture of vehicle-mounted Android system
EP4145761B1 (en) A system and a method for automatic generation of smart contracts across blockchain platforms
CN117170803B (en) Method for generating signal-creation operating system pipeline, electronic equipment and storage medium
CN112463256A (en) Method, system, electronic device and storage medium for determining configuration file
CN111399828B (en) Model-driven logic device modeling method and terminal
CN112925562B (en) Method, device and storage medium for application generation based on Android system
CN115952758B (en) Chip verification method and device, electronic equipment and storage medium
CN110806891B (en) Method and device for generating software version of embedded device
CN112631599B (en) Compilation method, device and storage medium
CN115292399B (en) Data conversion method, device, equipment and storage medium
CN100359485C (en) Embedded system testing device and testing method
CN118012453A (en) Software deployment method, device, electronic device, storage medium and program product
CN117873650A (en) Real-time running environment generation system, method, computer device and storage medium
CN115456628A (en) Intelligent contract viewing method and device based on block chain, storage medium and equipment
CN115080049B (en) Method, system and computer readable storage medium for compiling a simulation model
CN115857900A (en) Code automatic generation method and device, electronic equipment and storage medium
CN117950669A (en) Hot patch generation method and device, electronic equipment and storage medium
CN113204342A (en) Method and terminal for quickly constructing front-end page
CN116991471B (en) Method, device, equipment and storage medium for processing installation package file
CN120335860B (en) Real-time system modularization automatic construction method and system based on dependency graph
CN120687137A (en) Airborne equipment test function middleware and packaging method
CN118035072A (en) Automatic acceptance method and system based on multi-version upgrading
CN119829104A (en) Construction method of Shenwei platform firmware online updating tool

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant