A method for generating an A2L file of an automobile controller diagnosis module

By filling in the vehicle controller diagnostic information in an Excel spreadsheet and generating an A2L file using VBA code, the problem of long generation time and low efficiency in the existing technology is solved, and the A2L file of the diagnostic module is generated efficiently and independently.

CN116822480BActive Publication Date: 2026-06-26CHONGQING CHANGAN AUTOMOBILE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING CHANGAN AUTOMOBILE CO LTD
Filing Date
2023-06-28
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies rely on specialized software tools such as MATLAB to generate A2L files for automotive controllers, resulting in long generation times and low efficiency, especially for controllers with many functional strategies, where the overall generation time is quite long.

Method used

The diagnostic information of the car controller is filled in using an EXCEL spreadsheet template. The data is then processed by VBA code, the data range is determined, and the data is written into a structure array. The A2L file is then formatted and output, reducing the reliance on professional software tools and generating the A2L file of the diagnostic module independently.

Benefits of technology

It improves the efficiency of A2L file generation, reduces the overall project generation time, facilitates developer operations, and reduces reliance on tools such as MATLAB.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116822480B_ABST
    Figure CN116822480B_ABST
Patent Text Reader

Abstract

The application provides a generation method of an A2L file of a vehicle controller diagnosis module, and relates to the technical field of vehicle controller development. First, diagnosis information of the vehicle controller is filled in according to a preset table template, and then data of each row of diagnosis information in the table is processed by traversal. In the traversal process, it is judged whether the data of the diagnosis information is in a preset range, the data of the diagnosis information in the preset range is written into a structure array, and then the structure array is formatted and output as an A2L file containing empty address information. Finally, the variable address of the A2L file containing the empty address information is updated, an A2L file of a diagnosis module participating in calibration of the vehicle controller is generated, and the A2L file of the diagnosis module of the vehicle controller is independently generated, so that the generation time of the overall A2L file of the engineering project is reduced, and efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of automotive controller development, and specifically to a method for generating A2L files for automotive controller diagnostic modules. Background Technology

[0002] The software design architecture of an automotive controller typically includes multiple modules, such as power-on, power-off, NVM (Non-volatile Memory) storage, clutch control, and diagnostic modules. Among them, the diagnostic module enables real-time monitoring, online diagnosis, fault indication, and fault code storage of signal data such as CAN (Controller Area Network) signals, sensor signals, and solenoid valve current signals from the control software.

[0003] Typically, the integration and release of automotive controller software involves not only the necessary flashing files but also the A2L (ASAM MCD-2MC Language) files for the entire project. The A2L file is a crucial description file used during automotive controller calibration. It contains parameters related to automotive controller communication, as well as information such as the types, addresses, and conversion formulas of calibration and measurement variables. The A2L file allows for the calibration and testing of the automotive controller.

[0004] Existing technology discloses a method and apparatus for automatically generating A2L files. First, a MATLAB (Matrix Laboratory) model environment is set up, and an input / output interface database is obtained. Then, based on the MATLAB model environment and the input / output interface database, an A2L input / output interface model is generated. Finally, an A2L template file is generated based on the A2L input / output interface model, achieving low-cost automatic A2L file generation. However, this approach relies on specialized software tools such as MATLAB to generate A2L files. Furthermore, this approach can only generate A2L files for the entire project. For automotive controllers with numerous functional strategies, generating A2L files based on the entire project is time-consuming and inefficient. Summary of the Invention

[0005] To address the issues of long generation time and low efficiency in generating A2L files for current automotive controllers, this invention proposes a method for generating A2L files for automotive controller diagnostic modules. This method generates A2L files for automotive controller diagnostic modules independently, thereby improving the efficiency of A2L file generation.

[0006] To achieve the above-mentioned technical effects, the technical solution of the present invention is as follows:

[0007] A method for generating an A2L file for an automotive controller diagnostic module includes:

[0008] S1. Fill in the diagnostic information of the car controller according to the preset form template;

[0009] S2. Iterate through the data of each row of diagnostic information in the table. During the iteration, determine whether the data of the diagnostic information is within the preset range. Write the data of the diagnostic information within the preset range into the structure array.

[0010] S3. Format the structure array and output it as an A2L file containing null address information;

[0011] S4. Update the variable addresses of the A2L file containing empty address information to generate the diagnostic module A2L file for vehicle controller calibration.

[0012] This technical solution involves filling in the diagnostic information of the vehicle controller in a table template, writing the diagnostic information data within a preset range for each row in the table into a structure array, formatting the structure array for output, generating a separate A2L file for the diagnostic module, and updating the variable addresses in the A2L file. This reduces reliance on specialized software tools and improves the efficiency of A2L file generation.

[0013] Preferably, in step S1, the diagnostic information includes: fault name, filtering time, recovery time, number of operation cycles required to confirm fault code setting, number of warm-up cycles required to clear confirmed fault code, and replacement strategy.

[0014] Preferably, in step S2, it is determined whether the diagnostic information data is within a preset range, wherein the preset range of the filtering time and recovery time is 0 to 65535, and the preset range of the number of operation cycles required to confirm the fault code setting and the number of warm-up cycles required to clear the confirmed fault code is 0 to 255.

[0015] Preferably, in step S2, when traversing the data of each row of diagnostic information in the table, the replacement strategy of each row is converted into an unsigned 32-bit variable, and each bit of the unsigned 32-bit variable is represented by the BOOL (Boolean) type to indicate variable information 0 or 1.

[0016] Preferably, in step S2, the diagnostic information data in each row of the table that is within a preset range is used as a storage variable, and the variable information of the storage variable is written into a structure array. The variable information of the storage variable includes the variable name, variable value, maximum value, minimum value, and variable type.

[0017] Preferably, in step S2, when writing the variable information corresponding to the replacement strategy into the structure array, the multiple replacement strategies listed in each row of the table are combined into an unsigned 32-bit value, and the sequence number of the replacement strategy indicates the BIT (Binary Digit) bit of the 32-bit data.

[0018] Preferably, in step S2, the stored variables also include the fault results corresponding to the data of each row of diagnostic information.

[0019] Preferably, the method further includes storing the variable information of the stored variable into another structure array, outputting the other structure array as a source code C file, compiling the source code C file to obtain a MAP file containing the address information of all variables.

[0020] Preferably, in step S3, according to the variable type of the structure array, the variable information is output as a text block corresponding to the variable type in the format of an A2L file; the variable type is divided into standard quantity and observation quantity.

[0021] Preferably, in step S4, the address information in the MAP file is updated to the corresponding storage variable in the diagnostic module A2L file to obtain the diagnostic module A2L file that participates in the vehicle controller calibration.

[0022] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:

[0023] This invention proposes a method for generating A2L files for automotive controller diagnostic modules. First, diagnostic information for the automotive controller is filled in according to a preset table template. Then, the data in each row of diagnostic information in the table is traversed. During the traversal, it is determined whether the diagnostic information data is within a preset range. Data within the preset range is written into a structure array. The structure array is then formatted and output as an A2L file containing null address information. Finally, the variable addresses of the A2L file containing null address information are updated, generating the A2L file for the diagnostic module participating in the automotive controller calibration. This method generates the A2L file for the automotive controller diagnostic module independently, thereby reducing the overall A2L file generation time for the project. Furthermore, it does not rely on external professional tools such as MATLAB, making it highly efficient, convenient, and easy for developers to operate. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating the method for generating A2L files for the automotive controller diagnostic module proposed in this invention.

[0025] Figure 2 This is a schematic diagram of the Excel preset table proposed in this invention;

[0026] Figure 3This is a schematic diagram of the operation panel proposed in this invention;

[0027] Figure 4 This is a schematic diagram of the A2L file output process of the automotive controller diagnostic module proposed in this invention;

[0028] Figure 5 This is a schematic diagram of the structure array formatted output process proposed in this invention. Detailed Implementation

[0029] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent.

[0030] To better illustrate this embodiment, some parts of the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual dimensions;

[0031] It is understandable to those skilled in the art that some well-known details may be omitted from the accompanying drawings.

[0032] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0033] The positional relationships depicted in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent.

[0034] like Figure 1 As shown in the figure, this embodiment proposes a method for generating A2L files for automotive controller diagnostic modules, including the following steps:

[0035] S1. Fill in the diagnostic information of the car controller according to the preset EXCEL spreadsheet template;

[0036] The diagnostic information includes: fault name, filtering time, recovery time, number of operation cycles required to confirm fault code setting, number of warm-up cycles required to clear confirmed fault code, replacement strategy, etc.

[0037] S2. Iterate through the data of each row of diagnostic information in the EXCEL table. During the iteration, determine whether the data of the diagnostic information is within the preset range, and write the data of the diagnostic information within the preset range into the structure array.

[0038] In practical applications, such as Figure 2 As shown, after the user fills in the diagnostic information of the car controller into the preset Excel spreadsheet template, clicks the operation control in the Excel spreadsheet. At this time, the operation panel pops up. See Figure 3Users can change the output address of the A2L file themselves; generally, there is no need to change the output A2L file address. Users can directly click the "Generate A2L File" button to call macro commands, i.e., VBA (Visual Basic for Applications) code, to traverse and process the diagnostic information data, such as... Figure 4 As shown.

[0039] In this embodiment, as Figure 2 As shown, multiple replacement strategies can be entered in the preset Excel table. The VBA code will automatically recognize the replacement strategies entered in the Excel table and add them to the structure array.

[0040] like Figure 2 As shown, using VBA code, starting from the second row and second column of the filled Excel spreadsheet, the data of each row of diagnostic information in the Excel spreadsheet is traversed and processed sequentially until the data of each row of diagnostic information in the Excel spreadsheet is traversed. The data of each row of diagnostic information in the Excel spreadsheet that is within a preset range is used as a storage variable, and the variable information of the storage variable is written into a structure array. The variable information of the storage variable includes variable name, variable value, maximum value, minimum value, and variable type.

[0041] In this embodiment, the system also includes variables representing the fault results corresponding to each new row of diagnostic information data. These fault result variables are represented by the BOOL type. The fault result variables are also stored in the write structure array.

[0042] In practice, the diagnostic information stored as variables includes at least six variables: filtering time, recovery time, number of operation cycles required to confirm fault code setting, number of warm-up cycles required to clear confirmed fault code, replacement strategy, and fault result.

[0043] S3. Format the structure array and output it as an A2L file containing null address information;

[0044] See [link / reference] for the variable type of the structure array. Figure 5Starting from the first item of the structure array, the variable information is output item by item in the A2L file format, corresponding to the text block of the variable type, until the last item in the structure array is output. The variable type is divided into standard quantity and observation quantity. For example, the standard quantity starts with " / begin CHARACTERISTIC" and ends with " / end CHARACTERISTIC", and contains attributes such as variable name, variable address, maximum value, and minimum value. The observation quantity starts with " / begin MEASUREMENT" and ends with " / end MEASUREMENT", and contains attributes such as variable name, variable address, and variable conversion method.

[0045] S4. Update the variable addresses of the A2L file containing empty address information to generate the diagnostic module A2L file for vehicle controller calibration.

[0046] In this embodiment, VBA code is first called to check if the preset EXCEL table exists. If it exists, the data traversal processing of the diagnostic information is entered; otherwise, the A2L generation process ends and the user is notified.

[0047] Here, an Excel spreadsheet is used for diagnostic information data management, and an A2L file for the automotive controller diagnostic module is generated independently through internal VBA code, thereby reducing the overall A2L file generation time for the project.

[0048] In the steps of the method for generating the A2L file of the vehicle controller diagnostic module proposed in this embodiment, the diagnostic information of the vehicle controller is first filled in according to the preset EXCEL table template. When filling in the diagnostic information of the vehicle controller in the preset EXCEL table template, the data type of the filtering time and recovery time in the EXCEL table is unsigned 32-bit type, and the data type of the number of operation loops required to confirm the fault code setting and the number of warm-up loops required to clear the confirmed fault code is unsigned 8-bit type.

[0049] During the traversal, it is determined whether the diagnostic information data is within a preset range. The preset ranges for filtering time and recovery time are 0 to 65535, and the preset ranges for the number of operation loops required to confirm fault code setting and the number of warm-up loops required to clear confirmed fault codes are 0 to 255.

[0050] In this embodiment, the replacement strategy in the table can be filled in as False / True, FALSE / TRUE, false / true, F / T, 0 / 1. During the traversal, the information filled in as False / FALSE / false / F / 0 in the replacement strategy is converted into variable information 0, and the information filled in as True / TRUE / true / T / 1 is converted into variable information 1, representing different replacement strategy types.

[0051] When writing the variable information corresponding to the replacement strategy into the structure array, in actual operation, each replacement strategy in the EXCEL table is represented by a BOOL type. The VBA code uses bitwise AND to combine all the replacement strategies in each row into an unsigned 32-bit data type. The sequence number of the replacement strategy indicates the bit position of the 32-bit data. In this embodiment, as shown in Figure 2, the replacement strategy of the faulty first row has 3 bits, and the combined value is 4.

[0052] After determining whether the diagnostic information data is within the preset range, the diagnostic information data within the preset range is written into a structure array; then the structure array is formatted and output as an A2L file containing empty address information; finally, the variable addresses of the A2L file containing empty address information are updated to generate the diagnostic module A2L file participating in the vehicle controller calibration.

[0053] In the steps of the method for generating an A2L file for a vehicle controller diagnostic module proposed in this embodiment, the diagnostic information of the vehicle controller is filled in according to a preset EXCEL spreadsheet template; VBA code is called to iterate through the data of each row of diagnostic information in turn, and the data of each row of diagnostic information within a preset range in the EXCEL spreadsheet is used as a storage variable. The variable information of the storage variable is written into a structure array. The variable information of the storage variable includes the variable name, variable value, maximum value, minimum value, and variable type; according to the variable type of the structure array, starting from the first item of the structure array, the variable information is output item by item as an A2L file containing empty address information.

[0054] like Figure 4 As shown, the variable information of the stored variable is stored in another structure array, the other structure array is output as a source code C file, and the source code C file is compiled together with other project code. The output of the compilation process includes a writable binary file, the main A2L file of the project code, and a MAP file containing all variable address information.

[0055] After obtaining the A2L file containing empty address information and the MAP file containing all variable address information of the diagnostic module, the address information in the MAP file is updated to the corresponding storage variables in the A2L file containing empty address information of the diagnostic module using an address update tool, and finally the diagnostic module A2L file participating in the vehicle controller calibration is obtained; in this embodiment, the address update tool can be selected as the ASAP2 tool.

[0056] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. A method for generating an A2L file for an automotive controller diagnostic module, characterized in that, include: S1. Fill in the diagnostic information of the car controller according to the preset form template; S2. Iterate through the data of each row of diagnostic information in the table. During the iteration, determine whether the data of the diagnostic information is within the preset range. Write the data of the diagnostic information within the preset range into the structure array. S3. Format the structure array and output it as an A2L file containing null address information; S4. Update the variable addresses of the A2L file containing empty address information to generate the diagnostic module A2L file for vehicle controller calibration.

2. The method for generating A2L files for automotive controller diagnostic modules according to claim 1, characterized in that, In step S1, the diagnostic information includes: fault name, filtering time, recovery time, number of operation cycles required to confirm fault code setting, number of warm-up cycles required to clear confirmed fault code, and replacement strategy.

3. The method for generating an A2L file for a vehicle controller diagnostic module according to claim 2, in step S2, determining whether the diagnostic information data is within a preset range, wherein, The preset range for filtering time and recovery time is 0 to 65535, and the preset range for the number of operation cycles required to confirm fault code setting and the number of warm-up cycles required to clear confirmed fault code is 0 to 255.

4. The method for generating an A2L file for an automotive controller diagnostic module according to claim 3, characterized in that, In step S2, when traversing the data of each row of diagnostic information in the table, the replacement strategy of each row is converted into an unsigned 32-bit variable, and each bit of the unsigned 32-bit variable is represented by the BOOL type to indicate variable information 0 or 1.

5. The method for generating the A2L file of the automotive controller diagnostic module according to claim 4, characterized in that, In step S2, the diagnostic information data in each row of the table that is within a preset range is used as a storage variable, and the variable information of the storage variable is written into a structure array. The variable information of the storage variable includes the variable name, variable value, maximum value, minimum value, and variable type.

6. The method for generating the A2L file of the automotive controller diagnostic module according to claim 5, characterized in that, In step S2, the stored variables also include the fault results corresponding to the data of each row of diagnostic information.

7. The method for generating the A2L file of the automotive controller diagnostic module according to claim 5, characterized in that, Also includes: The variable information of the stored variable is stored in another structure array, the other structure array is output as a source code C file, the source code C file is compiled to obtain a MAP file containing the address information of all variables.

8. The method for generating an A2L file for an automotive controller diagnostic module according to claim 5, characterized in that, In step S2, when writing the variable information corresponding to the replacement strategy into the structure array, the multiple replacement strategy types listed in each row of the table are combined into an unsigned 32-bit value. The sequence number of the replacement strategy indicates the bit position of the unsigned 32-bit value.

9. The method for generating an A2L file for an automotive controller diagnostic module according to claim 8, characterized in that, In step S3, according to the variable type of the structure array, the variable information is output as a text block corresponding to the variable type in the format of an A2L file; the variable type is divided into standard quantity and observation quantity.

10. The method for generating an A2L file for an automotive controller diagnostic module according to claim 8, characterized in that, In step S4, the address information in the MAP file is updated to the corresponding storage variable in the diagnostic module A2L file to obtain the diagnostic module A2L file that participates in the vehicle controller calibration.