Automobile data file conversion method, system, storage medium and electronic equipment

Through the method of reading and customizing the CIN file templates in Python, traditional file conversion problems are solved, efficient and accurate conversion of automotive data files is achieved, and the efficiency and accuracy of ECU development is improved.

CN120276717BActive Publication Date: 2025-09-02NANCHANG AUTOMOTIVE INST OF INTELLIGENCE & NEW ENERGY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510749159.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-02
Estimated Expiration
2045-06-06

AI Technical Summary

Technical Problem

Traditional automotive data file conversion methods rely on manual operations or specific tools, are inefficient and error-prone, especially when dealing with complex DTC and ARXML files, requiring developers to have deep expertise and experience, which increases development costs and cycles.

Method used

Using Python built-in file reading and format verification, customizes CIN file generation templates, generates CIN files through intelligent parsing and adaptive conversion, and monitors the conversion process in real time to prevent errors, providing a user-friendly interface and a powerful error detection mechanism.

Benefits of technology

It improves the efficiency and accuracy of file conversion, lowers the threshold for use, enhances the compatibility and flexibility of the tool, and provides an efficient, accurate and easy-to-use file conversion solution for ECU development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276717B_ABST
    Figure CN120276717B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, storage medium, and electronic device for converting automotive data files. The method comprises: reading a DTC file, preprocessing the DTC file, and then obtaining DTC parameters; reading an ARXML file, preprocessing the ARXML file, and then obtaining a DB file; customizing a CIN file to generate a template and inputting the template into the system; based on the template, the system reads the DTC parameters and DB file according to user requirements to generate a text file with a CIN file suffix; and the system monitors the CIN file conversion process in real time and immediately stops the conversion process if a conversion error occurs. The present invention achieves significant innovations in intelligent parsing and adaptive conversion, efficient information integration and formatting, a user-friendly interface and interactive experience, a powerful error detection and handling mechanism, and excellent scalability and customization capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automobile data processing, and in particular to an automobile data file conversion method, system, storage medium and electronic equipment. Background Art

[0002] With the widespread adoption of AUTOSAR (Automotive Open System Architecture) in the automotive electronics industry, Diagnostic Trouble Codes (DTC) files and AUTOSAR Runtime Interface XML (ARXML) files have become indispensable components of ECU (Engine Control Unit) development. DTC files primarily store vehicle fault code information, while ARXML files describe interface configurations and communication relationships within the AUTOSAR system.

[0003] In the current ECU development process, developers often need to convert DTC and ARXML files into other formats for integration and processing in different development environments and tool chains. CIN (Code Interface Description) files, as an important intermediate file format, clearly describe the interface relationships between codes, facilitating automated code generation and system integration.

[0004] Traditional file conversion methods often rely on manual operations or specialized conversion tools, which are inefficient and error-prone. Especially when dealing with complex DTC and ARXML files, manual conversion often requires developers to have deep expertise and extensive experience, which undoubtedly increases development costs and time. Summary of the Invention

[0005] To address the shortcomings of the existing technology, the present invention provides a method for converting automotive data files. This method aims to address the inefficiencies and error-prone nature of traditional file conversion methods, which typically rely on manual operations or specialized conversion tools. In particular, manual conversion often requires developers to possess extensive expertise and experience when processing complex DTC and ARXML files, which undoubtedly increases development costs and timelines.

[0006] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0007] A method for converting automobile data files comprises the following steps:

[0008] Reading a DTC file, preprocessing the DTC file, and then obtaining DTC parameters;

[0009] Read the ARXML file, pre-process the ARXML file, and then obtain the DB file;

[0010] Customize a CIN file generation template and input the CIN file generation template into the system;

[0011] The system generates a template based on the CIN file, reads the DTC parameters and the DB file according to user requirements, and generates a text file with CIN as the file suffix;

[0012] The system monitors the conversion process of the CIN file in real time, and stops the conversion process immediately if a conversion error occurs.

[0013] According to one aspect of the above technical solution, the reading of the DTC file, preprocessing of the DTC file, and then obtaining the DTC parameters specifically include:

[0014] Read the DTC file through the Python built-in file, and perform format verification and data cleaning on the read DTC file;

[0015] Obtain parameter names and parameter values ​​in the DTC file after format verification and data cleaning;

[0016] Storing the parameter names and parameter values ​​in the DTC file in an Excel file;

[0017] Obtain the parameter names and values ​​required for diagnosis and store them in the system memory to obtain DTC parameters.

[0018] According to one aspect of the above technical solution, the reading of the ARXML file, pre-processing of the ARXML file, and then obtaining the DB file specifically include:

[0019] Read the ARXML file through the Python built-in file, and perform format verification and data cleaning on the read ARXML file;

[0020] Using Python's built-in XML reading function, traverse and search for the function information and parameter names required for diagnosis in the ARXML file;

[0021] The function information and parameter names in the ARXML file are converted into a relational database file as a DB file.

[0022] According to one aspect of the above technical solution, the method of traversing and searching the ARXML file for the function information and parameter names required for diagnosis through the built-in XML reading function in Python specifically includes:

[0023] Based on the xml.etree.ElementTree library in Python, load the ARXML file;

[0024] Traverse the AUTOSAR→AR-PACKAGES→AR-PACKAGE→ELEMENTS→PORT-PROTOTYPE hierarchy under the root node in sequence to locate the function node required for diagnosis;

[0025] For each of the function nodes, the following information is extracted:

[0026] Get the function name from the SHORT-NAME child node;

[0027] Traverse the SW-C-INTERFACE→OPERATION→PARAMETER nodes, extract the SHORT-NAME and DATA-TYPE-REF of each parameter, and map the actual data type through the DATA-TYPE node to obtain the parameter list;

[0028] Get the return value type from the RETURN-PARAMETER of the OPERATION node. If it does not exist, it defaults to void. During the parsing process, XPath expressions are used to optimize query efficiency.

[0029] Function information and parameter names are obtained based on the function name, the parameter list and the return value type.

[0030] According to one aspect of the above technical solution, the customized CIN file generation template consists of a file name, a CIN file generation script, and specific parameters. The CIN file generation script is based on the Python language and includes conditional judgment, traversal operations, function information placeholders, and parameter placeholders.

[0031] According to one aspect of the above technical solution, the system generates a template based on the CIN file, reads the DTC parameters and the DB file according to user requirements, and generates a text file with CIN as the file suffix, specifically including:

[0032] The user selects the input file on the interactive page and sets the conversion parameters;

[0033] The system generates a template based on the CIN file and reads the DTC parameters and the DB file according to the user's input to obtain the corresponding parameters;

[0034] The system executes the CIN file generation script in the CIN file generation template, outputs the character string required for generating the CIN file, and saves the generated character string as a text file with CIN as the file suffix.

[0035] The present invention also provides an automobile data file conversion system, comprising:

[0036] The first reading module is used to read the DTC file, pre-process the DTC file, and then obtain the DTC parameters;

[0037] The second reading module is used to read the ARXML file, pre-process the ARXML file, and then obtain the DB file;

[0038] Template definition module: used to customize the CIN file generation template and input the CIN file generation template into the system;

[0039] File generation module: used for the system to generate a template based on the CIN file, read the DTC parameters and the DB file according to user requirements, and generate a text file with CIN as the file suffix;

[0040] Real-time monitoring module: used for the system to monitor the conversion process of the CIN file in real time. If a conversion error occurs, the conversion process is stopped immediately.

[0041] The present invention also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned automobile data file conversion method is implemented.

[0042] The present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned automobile data file conversion method when executing the computer program.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] The present invention's automotive data file conversion method and Python-based tool for converting DTC and ARXML files into CIN files demonstrate significant innovations in intelligent parsing and adaptive conversion, efficient information integration and formatting, a user-friendly interface and interactive experience, robust error detection and handling mechanisms, and excellent scalability and customization. These innovations not only enhance the tool's compatibility and flexibility but also significantly improve conversion efficiency and accuracy, providing an efficient, accurate, easy-to-use, and scalable file conversion solution for ECU development. This invention offers significant technical advantages and application value, and will significantly promote the development and advancement of the automotive electronics industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 Flowchart of the automobile data file conversion method in the first embodiment of the present invention;

[0046] Figure 2 This is a structural block diagram of a vehicle data file conversion system according to a second embodiment of the present invention;

[0047] Figure 3 This is a structural block diagram of an electronic device in a third embodiment of the present invention;

[0048] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0049] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. The drawings illustrate several embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the present invention.

[0050] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is referred to as being "connected to" another element, it may be directly connected to the other element or there may be an intermediate element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only.

[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one skilled in the art to which this invention pertains. The terms used in this specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0052] See also Figure 1 , which shows a method for converting automobile data files in a first embodiment of the present invention, comprising the following steps:

[0053] S10, reading a DTC file, preprocessing the DTC file, and then obtaining DTC parameters;

[0054] S20, reading the ARXML file, preprocessing the ARXML file, and then obtaining the DB file;

[0055] S30, customizing a CIN file generation template and inputting the CIN file generation template into the system;

[0056] S40, the system generates a template based on the CIN file, reads the DTC parameters and the DB file according to user requirements, and generates a text file with CIN as the file suffix;

[0057] S50, the system monitors the conversion process of the CIN file in real time, and stops the conversion process immediately if a conversion error occurs.

[0058] As can be appreciated, the present invention's automotive data file conversion method and Python-based tool for converting DTC and ARXML files to CIN files offer significant innovations in intelligent parsing and adaptive conversion, efficient information integration and formatting, a user-friendly interface and interactive experience, robust error detection and handling mechanisms, and excellent scalability and customization. These innovations not only enhance the tool's compatibility and flexibility but also significantly improve conversion efficiency and accuracy, providing an efficient, accurate, easy-to-use, and scalable file conversion solution for ECU development. This invention possesses significant technical advantages and application value, and will significantly promote the development and advancement of the automotive electronics industry.

[0059] Furthermore, the specific steps of step S10 include:

[0060] Read the DTC file through the Python built-in file, and perform format verification and data cleaning on the read DTC file;

[0061] Obtain parameter names and parameter values ​​in the DTC file after format verification and data cleaning;

[0062] Storing the parameter names and parameter values ​​in the DTC file in an Excel file;

[0063] Obtain the parameter names and values ​​required for diagnosis and store them in the system memory to obtain DTC parameters.

[0064] It can be understood that the Python built-in file in this step can read the DTC file at the function level. The format verification and data cleaning are to ensure the integrity and consistency of the file.

[0065] Furthermore, the specific steps of step S20 include:

[0066] Read the ARXML file through the Python built-in file, and perform format verification and data cleaning on the read ARXML file;

[0067] According to the ARXML file format, using Python's built-in XML reading function, traverse and search for the function information and parameter names required for diagnosis in the ARXML file;

[0068] The function information and parameter names in the ARXML file are converted into a relational database file as a DB file.

[0069] It is understandable that the stored DTC parameters and DB files are for the convenience of subsequent calls.

[0070] Furthermore, the built-in XML reading function in Python is used to traverse and search for the function information and parameter names required for diagnosis in the ARXML file, specifically including:

[0071] Parse the ARXML file based on the xml.etree.ElementTree library in Python. First, load the ARXML file.

[0072] Traverse the AUTOSAR → AR-PACKAGES → AR-PACKAGE → ELEMENTS → PORT-PROTOTYPE hierarchy under the root node (the specific path is adjusted according to the AUTOSAR standard version) and locate the function node required for diagnosis (such as the DIAG-COMMUNICATION-CONTROL type service);

[0073] For each of the function nodes, the following information is extracted:

[0074] Get the function name from the SHORT-NAME child node; for example, "DiagnosticSessionControl";

[0075] Traverse the SW-C-INTERFACE→OPERATION→PARAMETER nodes, extract the SHORT-NAME and DATA-TYPE-REF of each parameter, and map the actual data type (such as uint8, uint16, etc.) through the DATA-TYPE node to obtain the parameter list;

[0076] The return value type is obtained from the RETURN-PARAMETER of the OPERATION node. If it does not exist, it defaults to void. XPath expressions are used during parsing to optimize query efficiency. For example, ". / / *[local-name()='OPERATION'and @SHORT-NAME='DiagnosticReadData']" can be used to directly locate a specific diagnostic service. The parsing results are stored in a dictionary structure, with the key being the function name and the value containing the parameter list and return value type.

[0077] Function information and parameter names are obtained based on the function name, the parameter list and the return value type.

[0078] As you can understand, this step enters the information parsing and extraction phase, which deeply parses the DTC and ARXML files to extract key diagnostic information and interface descriptions. This information forms the basis for the subsequent generation of the CIN (Code Interface Description) file. Since ARXML files are not suitable for direct conversion to CIN files, this tool converts ARXML files into DB files, facilitating further conversion to CIN files.

[0079] Furthermore, the customized CIN file generation template consists of a file name, a CIN file generation script, and specific parameters. The CIN file generation script is based on the Python language and includes conditional judgment, traversal operation, function information placeholder, and parameter placeholder.

[0080] It is understandable that during the CIN file generation process, the tool will strictly follow the CIN file format specifications to ensure that the generated CIN file not only complies with the standards but also accurately reflects the information in the original DTC file and ARXML file.

[0081] Furthermore, the specific steps of step S40 include:

[0082] The user selects the input file on the interactive page and sets the conversion parameters;

[0083] The system generates a template based on the CIN file and reads the DTC parameters and the DB file according to the user's input to obtain the corresponding parameters;

[0084] The system executes the CIN file generation script in the CIN file generation template, outputs the character string required for generating the CIN file, and saves the generated character string as a text file with CIN as the file suffix.

[0085] As you can understand, the system also provides an intuitive and easy-to-use user interface for user convenience. Through this interface, users can select input files, set conversion parameters (such as output path and file name), and start the conversion process. The user interface also displays the conversion progress and results in real time, providing a user-friendly interactive experience.

[0086] Furthermore, the tool performs error detection and handling throughout the conversion process. If an error is detected (such as a file read failure or information parsing error), the tool immediately stops the conversion process and provides an error message and suggested solutions. This step ensures the stability and reliability of the conversion process.

[0087] Furthermore, the tool offers excellent scalability and customization. Users can upgrade and expand the tool's functionality to meet new requirements and challenges in future ECU development. For example, users can add new parsing algorithms, optimize conversion processes, and so on.

[0088] In summary, the automobile data file conversion method in the above embodiment of the present invention has the following advantages:

[0089] 1. The tool uses an intelligent parsing algorithm that can automatically identify and parse different versions of DTC and ARXML files, achieving adaptive conversion. This innovation greatly improves the tool's compatibility and flexibility, eliminating the need for users to perform additional configuration or adjustments for different file versions.

[0090] 2. The tool of this invention utilizes efficient information integration and formatting technology. By deeply integrating the extracted diagnostic information and interface description information, the tool can form a clearly structured and easy-to-understand intermediate data format. This format not only facilitates subsequent processing but also ensures the accuracy and integrity of the information. Furthermore, the tool also utilizes an optimized formatting algorithm to quickly generate output files that conform to the CIN file specification, greatly improving conversion efficiency.

[0091] 3. The tool provides an intuitive and easy-to-use user interface. Users can easily select input files, set conversion parameters, and view conversion progress and results in real time. Furthermore, the tool provides detailed error messages and solution suggestions to help users quickly resolve problems encountered during the conversion process. This innovation makes the tool more user-friendly and easier to use, lowering the barrier to entry for users.

[0092] 4. The tool also offers significant advantages in error detection and handling. It has a powerful built-in error detection mechanism that monitors and handles various errors that may occur during the conversion process in real time. If an error is detected, the tool immediately stops the conversion process and provides a clear error message and suggested solutions. This innovation ensures the stability and reliability of the conversion process, avoiding conversion failures or the generation of incorrect CIN files due to errors.

[0093] 5. The tool also offers excellent scalability and customization. Users can upgrade and expand the tool's functionality to meet new requirements and challenges in future ECU development. For example, users can add new parsing algorithms, optimize conversion processes, or add new output formats.

[0094] Please refer to Figure 2 , shown is a car data file conversion system in a second embodiment of the present invention, comprising:

[0095] The first reading module 11 is used to read the DTC file, pre-process the DTC file, and then obtain DTC parameters;

[0096] The first reading module 11 is specifically used to: read the DTC file through the Python built-in file, and perform format verification and data cleaning on the read DTC file;

[0097] Obtain parameter names and parameter values ​​in the DTC file after format verification and data cleaning;

[0098] Storing the parameter names and parameter values ​​in the DTC file in an Excel file;

[0099] Obtain parameter names and values ​​required for diagnosis and store them in system memory to obtain DTC parameters;

[0100] The second reading module 12 is used to read the ARXML file, pre-process the ARXML file, and then obtain the DB file;

[0101] The second reading module 12 is specifically used to: read the ARXML file through the Python built-in file, and perform format verification and data cleaning on the read ARXML file;

[0102] Using Python's built-in XML reading function, traverse and search for the function information and parameter names required for diagnosis in the ARXML file;

[0103] Convert the function information and parameter names in the ARXML file into a relational database file as a DB file;

[0104] The built-in XML reading function in Python is used to traverse and search for the function information and parameter names required for diagnosis in the ARXML file, specifically including:

[0105] Based on the xml.etree.ElementTree library in Python, load the ARXML file;

[0106] Traverse the AUTOSAR→AR-PACKAGES→AR-PACKAGE→ELEMENTS→PORT-PROTOTYPE hierarchy under the root node in sequence to locate the function node required for diagnosis;

[0107] For each of the function nodes, the following information is extracted:

[0108] Get the function name from the SHORT-NAME child node;

[0109] Traverse the SW-C-INTERFACE→OPERATION→PARAMETER nodes, extract the SHORT-NAME and DATA-TYPE-REF of each parameter, and map the actual data type through the DATA-TYPE node to obtain the parameter list;

[0110] Get the return value type from the RETURN-PARAMETER of the OPERATION node. If it does not exist, it defaults to void. During the parsing process, XPath expressions are used to optimize query efficiency.

[0111] Obtaining function information and parameter names based on the function name, the parameter list, and the return value type;

[0112] Template definition module 13: used to customize the CIN file generation template and input the CIN file generation template into the system; the customized CIN file generation template consists of a file name, a CIN file generation script, and specific parameters. The CIN file generation script is based on the Python language and includes conditional judgment, traversal operation, function information placeholder, and parameter placeholder;

[0113] File generation module 14: used for the system to generate a template based on the CIN file, read the DTC parameters and the DB file according to user requirements, and generate a text file with CIN as the file suffix;

[0114] The file generation module 14 is specifically used to: the user selects an input file on the interactive page and sets conversion parameters;

[0115] The system generates a template based on the CIN file and reads the DTC parameters and the DB file according to the user's input to obtain the corresponding parameters;

[0116] The system executes the CIN file generation script in the CIN file generation template, outputs the character string required to generate the CIN file, and saves the generated character string as a text file with CIN as the file suffix;

[0117] The real-time monitoring module 15 is used to monitor the conversion process of the CIN file in real time. If a conversion error occurs, the conversion process is stopped immediately.

[0118] The third embodiment of the present invention further provides an electronic device, see Figure 3 , shown is an electronic device in a third embodiment of the present invention, including a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20. When the processor 20 executes the computer program 30, the above-mentioned automobile data file conversion method is implemented.

[0119] The memory 10 includes at least one type of storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10 may be an internal storage unit of the electronic device, such as the hard disk of the electronic device. In other embodiments, the memory 10 may also be an external storage device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, the memory 10 may include both an internal storage unit of the electronic device and an external storage device. The memory 10 can be used not only to store application software installed in the electronic device and various types of data, but also to temporarily store data that has been output or is about to be output.

[0120] Among them, in some embodiments, the processor 20 can be an electronic control unit (Electronic Control Unit, abbreviated as ECU, also known as a vehicle computer), a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run the program code stored in the memory 10 or process data, such as executing access restriction programs.

[0121] It should be pointed out that Figure 3 The structure shown does not constitute a limitation to the electronic device. In other embodiments, the electronic device may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0122] An embodiment of the present invention further provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the vehicle data file conversion method described above is implemented.

[0123] Those skilled in the art will appreciate that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device.

[0124] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting, or processing it in another suitable manner as necessary, and then storing it in a computer memory.

[0125] It should be understood that various components of the present invention may be implemented using hardware, software, firmware, or a combination thereof. In the aforementioned embodiments, multiple steps or methods may be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one or a combination of the following technologies known in the art may be used: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field-programmable gate array (FPGA), etc.

[0126] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0127] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A method for converting automobile data files, characterized in that: The steps include: Reading a DTC file, preprocessing the DTC file, and then obtaining DTC parameters; Read the ARXML file, pre-process the ARXML file, and then obtain the DB file; Customize a CIN file generation template and input the CIN file generation template into the system; The system generates a template based on the CIN file, reads the DTC parameters and the DB file according to user requirements, and generates a text file with CIN as the file suffix; The system monitors the conversion process of the CIN file in real time and stops the conversion process immediately if any conversion error occurs; The reading of the DTC file, pre-processing of the DTC file, and then obtaining the DTC parameters specifically include: Read the DTC file through the Python built-in file, and perform format verification and data cleaning on the read DTC file; Obtain parameter names and parameter values ​​in the DTC file after format verification and data cleaning; Storing the parameter names and parameter values ​​in the DTC file in an Excel file; Obtain parameter names and values ​​required for diagnosis and store them in system memory to obtain DTC parameters; The reading of the ARXML file, pre-processing of the ARXML file, and then obtaining the DB file specifically include: Read the ARXML file through Python built-in file, and perform format verification and data cleaning on the read ARXML file; Using Python's built-in XML reading function, traverse and search for the function information and parameter names required for diagnosis in the ARXML file; The function information and parameter names in the ARXML file are converted into a relational database file as a DB file.

2. The automobile data file conversion method according to claim 1, characterized in that: The built-in XML reading function in Python is used to traverse and search for the function information and parameter names required for diagnosis in the ARXML file, specifically including: Based on the xml.etree.ElementTree library in Python, load the ARXML file; Traverse the AUTOSAR→AR-PACKAGES→AR-PACKAGE→ELEMENTS→PORT-PROTOTYPE hierarchy under the root node in sequence to locate the function node required for diagnosis; For each of the function nodes, the following information is extracted: Get the function name from the SHORT-NAME child node; Traverse the SW-C-INTERFACE→OPERATION→PARAMETER nodes, extract the SHORT-NAME and DATA-TYPE-REF of each parameter, and map the actual data type through the DATA-TYPE node to obtain the parameter list; Get the return value type from the RETURN-PARAMETER of the OPERATION node. If it does not exist, it defaults to void. During the parsing process, XPath expressions are used to optimize query efficiency. Function information and parameter names are obtained based on the function name, the parameter list and the return value type.

3. The automobile data file conversion method according to claim 1, characterized in that: The customized CIN file generation template consists of a file name, a CIN file generation script, and specific parameters. The CIN file generation script is based on the Python language and includes conditional judgment, traversal operation, function information placeholder, and parameter placeholder.

4. The automobile data file conversion method according to claim 3, characterized in that: The system generates a template based on the CIN file and reads the DTC parameters and the DB file according to user requirements to generate a text file with CIN as the file suffix, specifically including: The user selects the input file on the interactive page and sets the conversion parameters; The system generates a template based on the CIN file and reads the DTC parameters and the DB file according to the user's input to obtain the corresponding parameters; The system executes the CIN file generation script in the CIN file generation template, outputs the character string required for generating the CIN file, and saves the generated character string as a text file with CIN as the file suffix.

5. An automobile data file conversion system, characterized in that: include: The first reading module is used to read the DTC file, pre-process the DTC file, and then obtain the DTC parameters; The first reading module is specifically used for: Read the DTC file through the Python built-in file, and perform format verification and data cleaning on the read DTC file; Obtain parameter names and parameter values ​​in the DTC file after format verification and data cleaning; Storing the parameter names and parameter values ​​in the DTC file in an Excel file; Obtain parameter names and values ​​required for diagnosis and store them in system memory to obtain DTC parameters; The second reading module is used to read the ARXML file, pre-process the ARXML file, and then obtain the DB file; The second reading module is specifically used for: Read the ARXML file through Python built-in file, and perform format verification and data cleaning on the read ARXML file; Using Python's built-in XML reading function, traverse and search for the function information and parameter names required for diagnosis in the ARXML file; Convert the function information and parameter names in the ARXML file into a relational database file as a DB file; Template definition module: used to customize the CIN file generation template and input the CIN file generation template into the system; File generation module: used to enable the system to generate a template based on the CIN file, read the DTC parameters and the DB file according to user requirements, and generate a text file with CIN as the file suffix; Real-time monitoring module: used to enable the system to monitor the conversion process of the CIN file in real time, and immediately stop the conversion process if a conversion error occurs.

6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the automobile data file conversion method according to any one of claims 1 to 4 is implemented.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the automobile data file conversion method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • File conversion method and device, electronic equipment and readable storage medium

    CN117667099A