AMT control program batch generation and modification method

CN120803538BActive Publication Date: 2026-09-08SHAANXI FAST GEAR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510879438.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2026-09-08
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

[0007]本发明的目的在于,提出一种AMT控制程序批量生成及修改方法,以解决上述现有技术存在的效率地下、可靠性低以及成本高的问题

Benefits of technology

[0016] (1) Efficiency improvement: The use of multi-threaded parallel processing and batch merge technology greatly improves processing efficiency and shortens the development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803538B_ABST
    Figure CN120803538B_ABST
Patent Text Reader

Abstract

The application discloses a kind of AMT control program batch generation and modification method: step 1, user is imported Par file, A2L file, original Hex file, PostBuild file in batches by Matlab UI;A2L file is parsed and information is extracted;Step 2, the calibration quantity name in Par file is dynamically bound with the calibration quantity address in A2L file;Step 3, realize multiple Par file parallel processing, automatically update Hex file data;Step 4, the Hex file obtained in step 3 is CRC checked to ensure data integrity, and FFLS format release file is generated;Step 5, when error occurs, trigger error processing and log, record error information and alarm.The method of the application compared with prior art, efficiency is improved, reliability is enhanced and cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of AMT control technology, specifically relating to a method for batch generation and modification of AMT control programs. Background Technology

[0002] The current technology for generating and modifying AMT control programs heavily relies on foreign professional tools (such as VECTOR vCDMStudio), and generally suffers from the following pain points:

[0003] (1) Efficiency bottleneck: The traditional method uses a calibrated quantity processing mode, which cannot realize batch merge operation of multiple files. Taking the development of a TCU program for a certain model as an example, a single parameter update requires manual processing of more than 200 calibrated quantities, which takes about 4 hours. The inefficiency problem is particularly prominent in the scenario of parallel development of multiple models.

[0004] (2) Reliability risk: Manual operation lacks a systematic verification mechanism, which can easily lead to problems such as address mapping errors and data type mismatch. There have been many instances of gear shifting failures during vehicle road tests due to human error.

[0005] (3) Cost barriers: Foreign software licensing fees are high, with annual licensing fees for a single module exceeding 150,000 yuan, and hardware dongles (priced at approximately 80,000 yuan each) must be purchased in conjunction with the software. In addition, the cost of operation training is high, and new engineers need 3 months of specialized training to master basic operations.

[0006] Therefore, there is an urgent need to research a high-efficiency, high-reliability, and low-cost AMT control program production and modification technology. Summary of the Invention

[0007] The purpose of this invention is to propose a method for batch generation and modification of AMT control programs, thereby addressing the problems of low efficiency, low reliability, and high cost in the existing technologies. This invention's method is based on Matlab's automation solution, integrating file parsing, batch processing, and verification mechanisms to achieve batch generation and modification of AMT control programs, effectively solving the aforementioned problems.

[0008] To achieve the above objectives, the present invention employs the following technical solution:

[0009] A method for batch generation and modification of AMT control programs, specifically including the following steps:

[0010] Step 1: Users import Par files, A2L files, raw Hex files, and PostBuild files in batches through the Matlab UI; the A2L files are parsed and the calibration quantification address, calibration quantification name, data type, and dimension information are extracted.

[0011] Step 2: Dynamically bind the calibration data name in the Par file to the calibration data address in the A2L file to achieve data matching;

[0012] Step 3, Batch Merge: Parallel processing of multiple Par files is achieved using the Matlab parfor loop, automatically updating Hex file data;

[0013] Step 4: Perform CRC check on the Hex file obtained in Step 3 to ensure data integrity, and generate an FFLS format release file;

[0014] Step 5: During the execution of steps 1 to 4, when an error occurs, error handling and logging are triggered to record the error information and issue an alarm.

[0015] Compared with the prior art, the method of the present invention has the following technical effects:

[0016] (1) Efficiency improvement: The use of multi-threaded parallel processing and batch merge technology greatly improves processing efficiency and shortens the development cycle.

[0017] (2) Enhanced reliability: Multiple CRC checks and automatic rollback mechanism effectively reduce errors and improve data integrity.

[0018] (3) Cost reduction: By eliminating dependence on foreign software and hardware and automating processes, licensing and training costs are significantly reduced. Attached Figure Description

[0019] Figure 1 This is a flowchart of the method of the present invention.

[0020] The present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments. Detailed Implementation

[0021] The method for batch generation and modification of AMT control programs provided in this invention specifically includes the following steps:

[0022] Step 1: Users import Par files, A2L files, raw Hex files, and PostBuild files in batches through the Matlab UI; the A2L files are parsed and the calibration quantization address, calibration quantization name, data type, and dimension information are extracted.

[0023] Step 1 specifically includes the following sub-steps:

[0024] Step 1.1: Users can import Par files (supporting .par and .csv formats), A2L files, raw Hex files, and PostBuild files in batches through the Matlab UI;

[0025] Step 1.2: Use regular expressions to parse the A2L file line by line, dividing the A2L file into three blocks: HEADER, MEASUREMENT, and CHARACTERISTIC. Parse these three blocks in parallel to improve efficiency; extract the calibration data name, calibration data address (ECU_ADDRESS), data type (FLOAT32_IEEE), and dimension information (MATRIX_DIM) from the CHARACTERISTIC block.

[0026] Step 1.3: Construct a hash table to store the data obtained in step 1.1 and establish a mapping between calibrated data names and calibrated data addresses. This operation saves more time than reading data row by row, thus achieving a fast query with O(1) time complexity.

[0027] Step 2: Dynamically bind the calibration data name in the Par file to the calibration data address in the A2L file to achieve data matching.

[0028] Step 2 specifically includes the following sub-steps:

[0029] Step 2.1: Parse the standard value names in the Par file and match the standard value addresses in the A2L file using the hash table constructed in Step 1.2; for multidimensional array data in the Par file, perform memory alignment according to ROW_DIR and COLUMN_DIR defined in the A2L file;

[0030] Step 2.2: Based on the dimensions defined by MATRIX_DIM in the A2L file, reconstruct the one-dimensional data in the Par file into a two-dimensional array according to the row-major order rule. This operation enables dynamic processing of multi-dimensional arrays.

[0031] Step 3, Batch Merge: Parallel processing of multiple Par files is achieved using the Matlab parfor loop, automatically updating Hex file data.

[0032] Step 3 specifically includes the following sub-steps:

[0033] Step 3.1: Allocate an independent thread for Merge of each Par file processed in Step 2. Use the API interface of the HexView tool to call the HexWrite function through Matlab to write the calibration values ​​in the Par file processed in Step 2 to the original Hex file according to the calibration address.

[0034] Specifically, based on the matching results of step 2.1, the corresponding calibration address in the A2L file is found based on the calibration value name in the Par file processed in step 2. Since the Par file stores the calibration value name, data type, dimension information, and value line by line, the calibration value (including data type, dimension information, and value) corresponding to the calibration address in the Par file is written into the Hex file based on the calibration address.

[0035] Step 3.2, Process address offset: Adjust the absolute address according to the Extended Linear Address Record (type 04) in the Hex file (the absolute address is an attribute of data storage in the Hex file);

[0036] Step 4: Perform CRC check on the Hex file obtained in Step 3 to ensure data integrity, and generate an FFLS format release file;

[0037] Step 4 specifically includes the following sub-steps:

[0038] Step 41, CRC verification, includes the following process:

[0039] A. CRC Check: A triple redundancy check mechanism is adopted. The 32-bit cyclic redundancy check code of the current Hex file is calculated by the crc32() function and compared with the original Hex file for the first time. If the check fails, a 3-retry loop is started. Each retry includes: reloading the Hex file, restoring the original data from the backup area, and recalculating the CRC check value. When the match is successful, success = true is returned. After 3 failed retries, success = false is returned and the error log is triggered.

[0040] CRC checksums ensure that the program code and data ultimately written to the target device are correct. By extracting valid data from the data records in the Hex file, calculating the CRC checksum according to rules, and comparing the calculated result with the preset checksum in the original Hex file, the data is considered correct if they match.

[0041] B. Backup and recovery: Back up the original file before each CRC check operation. If the check fails, automatically roll back to the backup version.

[0042] Step 42, generate FFLS format release files, including the following process:

[0043] A. Call the HexView toolchain: matlab system('HexView.exe -iinput.hex -ooutput.ffls --checksum'), insert a custom header containing the version number, CRC value and timestamp into the Hex file obtained after CRC verification in step 41, and obtain a new Hex file;

[0044] B. PostBuild file merging: Insert the vehicle-specific code segment into the specified address range of the new Hex file (e.g., 0x8000-0xFFFF);

[0045] C. Calculate the file checksum using the CheckSum algorithm (polynomial: 0x04C11DB7), replace the original checksum field at the end of the Hex file obtained in B, and obtain the FFLS format release file.

[0046] Step 5: During the execution of steps 1-4, if an error occurs, error handling and logging are triggered to record the error information and issue an alarm. Specifically, this includes:

[0047] - Operation time, name of the calibrated quantity processed, address, old / new value;

[0048] - CRC check results and error types (such as address out of bounds, data type mismatch).

[0049] - Error classification and handling: Minor errors (such as a single calibration failure) are skipped and logged; serious errors (such as a corrupted Hex file) terminate the process and issue an alarm.

[0050] Example

[0051] This embodiment illustrates the AMT control program upgrade process for a certain vehicle model. Details are as follows:

[0052] (1) Input data: 3 Par files, A2L file, and basic Hex file;

[0053] (2) Processing procedure:

[0054] ① Batch import of Par files allows the system to quickly complete parsing, improving efficiency by approximately 200% compared to manual extraction of standardized data.

[0055] ②Dynamically matching calibrated addresses improves efficiency by approximately 100% compared to manually querying address information, and is also more reliable.

[0056] ③ Process multiple Par files in parallel to generate temporary Hex files. Compared to manual processing, the more parallel processing, the greater the efficiency improvement.

[0057] ④ Perform CRC check. If the first check fails, automatically roll back and retry if successful to avoid the possibility of errors in manual check and ensure the quality of program release.

[0058] ⑤ Generate FFLS files and insert vehicle code segments, which improves efficiency by about 100% compared to manual merging.

[0059] (3) Effect comparison: Compared with the traditional solution, the method of the present invention significantly improves the processing efficiency by about 200%, completely eliminates human operation errors, and meets the requirements of mass production.

Claims

1. A method for batch generation and modification of AMT control programs, characterized in that, Specifically, the steps include the following: Step 1: Users batch import Par files, A2L files, raw Hex files, and PostBuild files through the Matlab UI; the A2L files are parsed to extract the calibration quantization address, calibration quantization name, data type, and dimension information; Step 2 involves dynamically binding the calibration data names in the Par file to the calibration data addresses in the A2L file to achieve data matching; this includes the following sub-steps: Step 2.1: Parse the standard value names in the Par file and match the standard value addresses in the A2L file using the hash table constructed in Step 1.2; for multidimensional array data in the Par file, perform memory alignment according to ROW_DIR and COLUMN_DIR defined in the A2L file; Step 2.2: Based on the dimensions defined by MATRIX_DIM in the A2L file, reconstruct the one-dimensional data in the Par file into a two-dimensional array according to the row-major rule; Step 3, Batch Merge: This step uses Matlab's `parfor` loop to process multiple Par files in parallel and automatically update Hex file data. Specifically, it includes the following sub-steps: Step 3.1: Allocate an independent thread for Merge of each Par file processed in Step 2, and use the API interface of the HexView tool to call the HexWrite function through Matlab to write the calibration values ​​in the Par file processed in Step 2 to the original Hex file according to the calibration address. Step 3.2, Process address offset: Adjust the absolute address according to the Extended Linear Address Record in the Hex file; Step 4: Perform CRC check on the Hex file obtained in Step 3 to ensure data integrity, and generate an FFLS format release file; Step 5: During the execution of steps 1 to 4, when an error occurs, error handling and logging are triggered to record the error information and issue an alarm.

2. The method for batch generation and modification of AMT control programs as described in claim 1, characterized in that, Step 1 specifically includes the following sub-steps: Step 1.1: Users import Par files, A2L files, raw Hex files, and PostBuild files in batches through the Matlab UI; Step 1.2: Use regular expressions to parse the A2L file line by line, dividing the A2L file into three blocks: HEADER, MEASUREMENT, and CHARACTERISTIC. Parse these three blocks in parallel to improve efficiency; extract the calibration data name, calibration data address, data type, and dimension information from the CHARACTERISTIC block. Step 1.3: Construct a hash table to store the data obtained in Step 1.1, and establish a mapping between calibrated data names and calibrated data addresses.

3. The method for batch generation and modification of AMT control programs as described in claim 1, characterized in that, Step 4 specifically includes the following sub-steps: Step 41, CRC verification, includes the following process: A. CRC Check: A triple redundancy check mechanism is adopted. The 32-bit cyclic redundancy check code of the current Hex file is calculated by the crc32() function and compared with the original Hex file for the first check. If the check fails, a 3-retry loop is started. Each retry includes: reloading the Hex file, restoring the original data from the backup area, and recalculating the CRC check value. When the match is successful, success=true is returned. After 3 failed retries, success=false is returned. B. Backup and recovery: Back up the original file before each CRC check operation. If the check fails, automatically roll back to the backup version. Step 42: Generate FFLS format publishing files.

4. The method for batch generation and modification of AMT control programs as described in claim 3, characterized in that, Step 42 includes the following process: A. Call the HexView toolchain: matlab system('HexView.exe -i input.hex -ooutput.ffls --checksum'), insert a custom header containing the version number, CRC value and timestamp into the Hex file obtained after CRC verification in step 41, and obtain a new Hex file; B. PostBuild file merging: Inserts the vehicle-specific code segment into the specified address range of the new Hex file; C. Calculate the file checksum using the CheckSum algorithm, replace the original checksum field at the end of the Hex file obtained in B, and obtain the FFLS format release file.

5. The method for batch generation and modification of AMT control programs as described in claim 4, characterized in that, In step 5, recording error information and issuing alerts includes: - Operation time, name of the calibrated quantity processed, address, old / new value; - CRC check results and error types, including address out of bounds and data type mismatch; - Error classification and handling: Minor errors are skipped and logged; serious errors terminate the process and issue an alarm.

Citation Information

Patent Citations

  • Method for modifying HEX file based on PC software and application

    CN111796836A

  • AMT program brushing method capable of preventing wrong brushing

    CN119938094A