Hex program offline calibration method based on dynamic search
Patent Information
- Application Number
- CN202610939169.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-10-20
AI Technical Summary
[0005]本发明旨在解决现有HEX离线标定方法消耗时间过长的技术问题,而提出了一种基于动态搜索的HEX程序离线标定方法
[0054]1、本发明在对待标定变量按照ECU地址排序后,利用前一待标定变量的位置和地址差值动态确定后续变量的二分搜索边界,避免每个变量均从完整Block范围重新搜索,进一步减少重复查找过程,缩短批量标定耗时。
Smart Images

Figure FT_1 
Figure FT_2 
Figure SMS_1
Abstract
Description
Technical Field
[0001] This invention relates to offline calibration methods, specifically to an offline calibration method for HEX programs based on dynamic search. Background Technology
[0002] With the continuous iteration and upgrading of intelligent vehicle automatic transmission technology, models equipped with automatic transmissions have achieved mass production and deployment. Due to differences in vehicle configuration, customer customization requirements, engine models, manufacturer production numbers, and product order numbers, different models and batches of automatic transmissions require dedicated control programs and calibration parameters. The industry needs to complete large-scale customized development and offline calibration of HEX programs for various differentiated operating conditions. As the core file that the transmission control unit hardware can directly recognize and burn, the offline calibration of the HEX program is a crucial step in program mass production and version upgrades. The calibration efficiency directly determines the transmission program iteration and vehicle production progress.
[0003] Currently, most mainstream automakers in the industry use the traditional offline calibration method to create HEX programs. This method is cumbersome, has low automation integration, and relies entirely on serial single-program calibration processing. It takes about one minute to complete the offline calibration and verification of a single transmission HEX program. In mass production scenarios involving regular version upgrades of transmission programs, when the number of HEX programs to be calibrated reaches 3,000, the complete offline calibration cycle can take up to 15 days. This calibration method lacks batch parallel processing capabilities; in large-scale calibration scenarios, the time consumption increases linearly, resulting in extremely low overall efficiency.
[0004] In summary, existing HEX offline calibration technology suffers from core flaws: long calibration times and poor batch processing capabilities significantly extend the iteration cycle of transmission programs, greatly increasing R&D and production time costs for enterprises. Furthermore, the lengthy offline calibration process severely restricts the speed of automatic transmission product updates and mass production delivery efficiency, making it difficult to meet the current automotive industry's differentiated, batch-oriented, and rapid program calibration production needs. Therefore, there is an urgent need to propose an efficient HEX offline calibration solution to address the technical problems of long calibration times and low batch processing efficiency in existing technologies. Summary of the Invention
[0005] This invention aims to solve the technical problem of excessive time consumption in existing HEX offline calibration methods, and proposes a dynamic search-based offline calibration method for HEX programs.
[0006] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0007] An offline calibration method for HEX programs based on dynamic search is characterized by the following steps:
[0008] Step 1: Obtain the list of variables to be calibrated based on the configuration data, calibration parameters, and vehicle matching conditions required for actual working conditions;
[0009] Step 2: Determine the number of HEX program calibration tasks to be created based on the number of variables to be calibrated, and enqueue the number of calibration tasks.
[0010] Step 3: Perform offline calibration on each variable in the list of variables to be calibrated in turn until the number of calibration tasks is 0, and complete the offline calibration of the HEX program.
[0011] Furthermore, step 3 specifically includes:
[0012] Step 3.1: Read the name and value of each variable to be calibrated from the list of variables to be calibrated;
[0013] Step 3.2: Load the A2L file; the A2L file includes the names and ECU addresses of all variables to be calibrated; obtain the ECU addresses of all variables to be calibrated from the A2L file according to the names of each variable.
[0014] Step 3.3: Load the template program HEX file, which includes the names and block indexes of all variables to be calibrated; obtain the block indexes of all variables to be calibrated based on their names.
[0015] Step 3.4: Perform offline calibration on each variable in the list of variables to be calibrated until the number of calibration tasks is 0, thus completing the offline calibration of the HEX program.
[0016] Furthermore, after step 3.3 and before step 3.4, the following is also included:
[0017] For each variable to be calibrated in the list, sort the variables in the ECU address from smallest to largest. Then, the variables to be calibrated at larger addresses will be placed after the variables to be calibrated at smaller addresses.
[0018] In step 3.4, each variable in the list of variables to be calibrated is calibrated offline in sequence according to the order listed, until the number of calibration tasks is 0.
[0019] Furthermore, step 3.4 specifically includes:
[0020] Step 3.41: Read in the first variable to be calibrated from the variable table, use the upper and lower boundaries of its Block index as the actual left and right boundaries of the binary search for the first variable to be calibrated, perform a binary search to determine the position of the first variable to be calibrated in the template program HEX file, write the variable value of the first variable to be calibrated into that position, and complete the offline calibration of the first variable to be calibrated.
[0021] Step 3.42: Read in the next variable to be calibrated from the variable table and determine whether the current variable to be calibrated has the same Block index as the previous variable to be calibrated.
[0022] If they are the same, proceed to step 3.43;
[0023] If they are different, proceed to step 3.44;
[0024] If all variables in the variable table to be calibrated have been calibrated, then the offline calibration of the variable table to be calibrated is complete.
[0025] Step 3.43: Determine the actual left boundary serL and the actual right boundary serR of the current binary search for the variable to be calibrated, and complete their calibration. Return to step 3.42.
[0026] Step 3.44: Use the upper and lower boundaries of the Block index range of the variable to be calibrated as its actual left boundary and actual right boundary of the binary search, respectively, and complete its calibration. Return to step 3.42.
[0027] Furthermore, step 3.43 specifically includes:
[0028] Step A1: Calculate the difference n between the ECU address VarAddr[i] of the current variable to be calibrated and the ECU address VarAddr[i-1] of the previous variable to be calibrated.
[0029] n = VarAddr[i] - VarAddr[i-1];
[0030] Where i represents the variable to be calibrated;
[0031] Step A2: Take the row number corresponding to the ECU address of the (i-1)th variable to be calibrated as the actual left boundary serL of the binary search for the i-th variable to be calibrated, and calculate the theoretical right boundary serR of the binary search for the current variable to be calibrated.
[0032] serR = serL + n;
[0033] Step A3: Determine whether the theoretical binary search right boundary serR of the variable to be calibrated is within the Block index range of the variable to be calibrated.
[0034] If the theoretical right boundary of the binary search of the variable to be calibrated, serR, is within its Block index range, then the theoretical right boundary of the binary search, serR, is taken as the actual right boundary of the binary search, serR, of the variable to be calibrated.
[0035] If the theoretical right boundary of the binary search of the variable to be calibrated, serR, is outside its Block index range, then the lower boundary of the Block index range of the variable to be calibrated is taken as its actual right boundary of the binary search, serR.
[0036] Step A4: Determine the position of the current variable to be calibrated in the template program HEX file based on the actual left boundary serL and the actual right boundary serR of the binary search. Write the variable value of the current variable to be calibrated into this position to complete the calibration of the i-th variable to be calibrated; return to step 3.42.
[0037] Furthermore, step 3.44 specifically includes:
[0038] Using the upper and lower boundaries of the Block index range to which the variable to be calibrated belongs as the actual left boundary serL and the actual right boundary serR of the binary search, respectively, determine the position of the variable to be calibrated in the template program HEX file, write the variable value of the variable to be calibrated into this position, and complete the calibration of the variable to be calibrated; return to step 3.42.
[0039] Furthermore, step 3.41 specifically includes:
[0040] Step B1: Read in the first variable to be calibrated from the variable table, and use the upper and lower boundaries of its Block index as the actual binary search left boundary serL and the actual binary search right boundary serR of the first variable to be calibrated.
[0041] Step B2: Calculate the current binary search middle row number serM using the actual binary search left boundary serL and the actual binary search right boundary serR of the first variable to be calibrated.
[0042] serM=(serL+serR) / 2
[0043] serM retrieves the integer row number;
[0044] Step B3: Read the HEX Record in the serM line of the template program HEX file, and parse the start ECU address RecordStart and end ECU address RecordEnd corresponding to that line;
[0045] Step B4: Compare the ECU address VarAddr[1] of the first variable to be calibrated with RecordStart and RecordEnd:
[0046] If RecordStart≤VarAddr[1]≤RecordEnd, then determine that the first serM line is the target HEX Record line containing the first variable to be calibrated, and execute step E;
[0047] If VarAddr[1] < RecordStart, update the actual right boundary serR of the binary search to serM-1, and return to step B2 until RecordStart ≤ VarAddr[1] ≤ RecordEnd;
[0048] If VarAddr[1] > RecordEnd, update the actual left boundary serL of the binary search to serM+1, and return to step B2 until RecordStart ≤ VarAddr[1] ≤ RecordEnd;
[0049] Step B5: Calculate the byte offset according to the ECU address of the first variable to be calibrated and the starting ECU address of the target HEX Record line;
[0050] Step B6: Determine the position of the first variable to be calibrated in the HEX file of the template program according to the byte offset, write the variable value of the first variable to be calibrated into the position, and complete the offline calibration of the first variable to be calibrated.
[0051] Further, step 1 is specifically:
[0052] Screen according to the engine number, manufacturer number and order number based on the configuration data, calibration parameters and vehicle model matching conditions required by the actual working conditions, and obtain the list of variables to be calibrated.
[0053] Beneficial effects of the present invention:
[0054] 1. After sorting the variables to be calibrated by ECU address, the present invention dynamically determines the binary search boundary for subsequent variables by using the position and address difference of the previous variable to be calibrated, which avoids re-searching each variable from the complete Block range, further reduces the repeated search process, and shortens the time-consuming of batch calibration.
[0055] 2. The present invention can realize automatic search, automatic writing and batch offline calibration of variables to be calibrated, reduce the operation of manually modifying variables item by item through calibration tools such as CANape, lower the risk of manual misoperation, and improve the accuracy and stability of the offline calibration process of the HEX program. Brief Description of the Drawings
[0056] Figure 1 is a schematic flowchart of the embodiment corresponding to step 2 to step 3 of the present invention;
[0057] Figure 2 is a schematic flowchart of the embodiment corresponding to step 3.4 in the embodiment of the present invention Detailed Description of the Embodiments
[0058] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] This invention provides an offline calibration method for HEX programs based on dynamic search, the method comprising the following steps:
[0060] Step 1: Based on the configuration data, calibration parameters, and vehicle matching conditions required for actual working conditions, filter by engine number, manufacturer number, and order number to obtain a list of variables to be calibrated.
[0061] In this embodiment, the preset configuration data, calibration parameters, and vehicle model matching conditions are the same as the configuration data, calibration parameters, and vehicle model matching conditions agreed upon with the OEM.
[0062] Step 2: Determine the number of HEX program calibration tasks to be created based on the number of variables to be calibrated, and enqueue the number of calibration tasks.
[0063] Step 3: Perform offline calibration on each variable in the list of variables to be calibrated sequentially until the number of calibration tasks is 0, thus completing the offline calibration of the HEX program. Specifically, this includes:
[0064] Step 3.1: Read the name and value of each variable to be calibrated from the list of variables to be calibrated;
[0065] Step 3.2, as follows Figure 1 As shown, load the A2L file; the A2L file includes the names and ECU addresses of all variables to be calibrated; obtain the ECU addresses of all variables to be calibrated from the A2L file according to the names of each variable to be calibrated;
[0066] Step 3.3: Load the template program HEX file, which includes the names and block indexes of all variables to be calibrated; obtain the block indexes of all variables to be calibrated based on their names; sort the variables to be calibrated in each list of variables to be calibrated from smallest to largest according to their ECU addresses, so that the variables to be calibrated at larger addresses are located after the variables to be calibrated at smaller addresses.
[0067] Step 3.4: Perform offline calibration on each variable in the list of variables to be calibrated in the ordered order until the number of calibration tasks is 0, thus completing the offline calibration of the HEX program; for example... Figure 2 As shown, it specifically includes:
[0068] Step 3.41: Read the first variable to be calibrated in the to-be-calibrated variable table, take the upper and lower boundaries of the Block index it belongs to as the actual binary search left boundary and the actual binary search right boundary of the first variable to be calibrated (where "upper" corresponds to "left" and "lower" corresponds to "right"), perform a binary search to determine the position of the first variable to be calibrated in the template program HEX file, write the variable value of the first variable to be calibrated into this position, and complete the offline calibration of the first variable to be calibrated; specifically including:
[0069] Step B1: Read the first variable to be calibrated in the to-be-calibrated variable table, and take the upper and lower boundaries of its Block index as the actual binary search left boundary serL and the actual binary search right boundary serR of the first variable to be calibrated;
[0070] Step B2: Calculate the current binary search middle line number serM through the actual binary search left boundary serL and the actual binary search right boundary serR of the first variable to be calibrated:
[0071] serM=(serL+serR) / 2
[0072] serM takes an integer line number;
[0073] Step B3: Read the HEX Record at line serM in the template program HEX file, and parse the starting ECU address RecordStart and the ending ECU address RecordEnd corresponding to this line;
[0074] Step B4: Compare the ECU address VarAddr[1] of the first variable to be calibrated with RecordStart and RecordEnd:
[0075] If RecordStart≤VarAddr[1]≤RecordEnd, then determine that the serM-th line is the target HEX Record line where the first variable to be calibrated is located, and execute Step E;
[0076] If VarAddr[1]<RecordStart, update the actual binary search right boundary serR to serM-1, and return to Step B2 until RecordStart≤VarAddr[1]≤RecordEnd;
[0077] If VarAddr[1]>RecordEnd, update the actual binary search left boundary serL to serM+1, and return to Step B2 until RecordStart≤VarAddr[1]≤RecordEnd;
[0078] Step B5: Calculate the byte offset based on the ECU address of the first variable to be calibrated and the starting ECU address of the target HEX Record line;
[0079] Step B6: Determine the location of the first variable to be calibrated in the template program HEX file based on the byte offset, write the variable value of the first variable to be calibrated into that location, and complete the offline calibration of the first variable to be calibrated.
[0080] Step 3.42: Read in the next variable to be calibrated from the variable table and determine whether the current variable to be calibrated has the same Block index as the previous variable to be calibrated.
[0081] If they are the same, proceed to step 3.43;
[0082] If they are different, proceed to step 3.44;
[0083] If all variables in the variable table to be calibrated have been calibrated, then the offline calibration of the variable table to be calibrated is complete.
[0084] Step 3.43: Determine the actual left boundary (serL) and right boundary (serR) of the current binary search for the variable to be calibrated, and complete their calibration. Return to step 3.42; specifically including:
[0085] Step A1: Calculate the difference n between the ECU address VarAddr[i] of the current variable to be calibrated and the ECU address VarAddr[i-1] of the previous variable to be calibrated.
[0086] n = VarAddr[i] - VarAddr[i-1];
[0087] Where i represents the variable to be calibrated;
[0088] Step A2: Take the row number corresponding to the ECU address of the (i-1)th variable to be calibrated as the actual left boundary serL of the binary search for the i-th variable to be calibrated, and calculate the theoretical right boundary serR of the binary search for the current variable to be calibrated.
[0089] serR = serL + n;
[0090] Step A3: Determine whether the theoretical binary search right boundary serR of the variable to be calibrated is within the Block index range of the variable to be calibrated.
[0091] If the theoretical right boundary of the binary search of the variable to be calibrated, serR, is within its Block index range, then the theoretical right boundary of the binary search, serR, is taken as the actual right boundary of the binary search, serR, of the variable to be calibrated.
[0092] If the theoretical right boundary of the binary search of the variable to be calibrated, serR, is outside its Block index range, then the lower boundary of the Block index range of the variable to be calibrated is taken as its actual right boundary of the binary search, serR.
[0093] Step A4: Determine the position of the current variable to be calibrated in the template program HEX file based on the actual left boundary serL and the actual right boundary serR of the binary search. Write the variable value of the current variable to be calibrated into this position to complete the calibration of the i-th variable to be calibrated; return to step 3.42.
[0094] Step 3.44: Using the upper and lower boundaries of the Block index range of the variable to be calibrated as the actual left boundary serL and the actual right boundary serR of the binary search, respectively, determine the position of the variable to be calibrated in the template program HEX file, write the variable value of the variable to be calibrated into this position, and complete the calibration of the variable to be calibrated; return to step 3.42.
[0095] One hundred sets of variables to be calibrated were selected as test objects. In addition to offline calibration of the HEX program using the methods described above, a loop search calibration method and a manual calibration method based on CDM (Calibration Data Management) tools such as CANape were also used for comparative testing. During the test, the average time required to rewrite each set of variables to be calibrated and the calibration accuracy were statistically analyzed for the three methods. The results are shown in Table 1 below.
[0096] Table 1 Comparison of different methods
[0097]
[0098] As shown in Table 1, the offline calibration method for dynamic search HEX programs proposed in this invention significantly shortens the rewriting time of the variables to be calibrated while ensuring calibration accuracy. Compared with the loop search calibration method, the average time of the method in this invention is reduced from 30s to 6s; compared with the manual calibration method, the method in this invention can effectively avoid the inefficiency and risk of misoperation caused by manual item-by-item searching and modification, and has higher calibration efficiency and stability.
[0099] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present invention should be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for offline calibration of HEX programs based on dynamic search, characterized in that, Includes the following steps: Step 1: Obtain the list of variables to be calibrated based on the configuration data, calibration parameters, and vehicle matching conditions required for actual working conditions; Step 2: Determine the number of HEX program calibration tasks to be created based on the number of variables to be calibrated, and enqueue the number of calibration tasks. Step 3: Perform offline calibration on each variable in the list of variables to be calibrated in turn until the number of calibration tasks is 0, and complete the offline calibration of the HEX program.
2. The offline calibration method for HEX programs based on dynamic search according to claim 1, characterized in that, Step 3 specifically includes: Step 3.1: Read the name and value of each variable to be calibrated from the list of variables to be calibrated; Step 3.2: Load the A2L file; the A2L file includes the names and ECU addresses of all variables to be calibrated; obtain the ECU addresses of all variables to be calibrated from the A2L file according to the names of each variable. Step 3.3: Load the template program HEX file, which includes the names and block indexes of all variables to be calibrated; obtain the block indexes of all variables to be calibrated based on their names. Step 3.4: Perform offline calibration on each variable in the list of variables to be calibrated until the number of calibration tasks is 0, thus completing the offline calibration of the HEX program.
3. The offline calibration method for HEX programs based on dynamic search according to claim 2, characterized in that, The process after step 3.3 and before step 3.4 also includes: For each variable to be calibrated in the list, sort the variables in the ECU address from smallest to largest. Then, the variables to be calibrated at larger addresses will be placed after the variables to be calibrated at smaller addresses. In step 3.4, each variable in the list of variables to be calibrated is calibrated offline in sequence according to the order listed, until the number of calibration tasks is 0.
4. The offline calibration method for HEX programs based on dynamic search according to claim 3, characterized in that, Step 3.4 specifically includes: Step 3.41: Read in the first variable to be calibrated from the variable table, use the upper and lower boundaries of its Block index as the actual left and right boundaries of the binary search for the first variable to be calibrated, perform a binary search to determine the position of the first variable to be calibrated in the template program HEX file, write the variable value of the first variable to be calibrated into that position, and complete the offline calibration of the first variable to be calibrated. Step 3.42: Read in the next variable to be calibrated from the variable table and determine whether the current variable to be calibrated has the same Block index as the previous variable to be calibrated. If they are the same, proceed to step 3.43; If they are different, proceed to step 3.44; If all variables in the variable table to be calibrated have been calibrated, then the offline calibration of the variable table to be calibrated is complete. Step 3.43: Determine the actual left boundary serL and the actual right boundary serR of the current binary search for the variable to be calibrated, and complete their calibration. Return to step 3.
42. Step 3.44: Use the upper and lower boundaries of the Block index range of the variable to be calibrated as its actual left boundary and actual right boundary of the binary search, respectively, and complete its calibration. Return to step 3.
42.
5. The offline calibration method for HEX programs based on dynamic search according to claim 4, characterized in that, Step 3.43 specifically includes: Step A1: Calculate the difference n between the ECU address VarAddr[i] of the current variable to be calibrated and the ECU address VarAddr[i-1] of the previous variable to be calibrated. n = VarAddr[i] - VarAddr[i-1]; Where i represents the variable to be calibrated; Step A2: Take the row number corresponding to the ECU address of the (i-1)th variable to be calibrated as the actual left boundary serL of the binary search for the i-th variable to be calibrated, and calculate the theoretical right boundary serR of the binary search for the current variable to be calibrated. serR = serL + n; Step A3: Determine whether the theoretical binary search right boundary serR of the variable to be calibrated is within the Block index range of the variable to be calibrated. If the theoretical right boundary of the binary search of the variable to be calibrated, serR, is within its Block index range, then the theoretical right boundary of the binary search, serR, is taken as the actual right boundary of the binary search, serR, of the variable to be calibrated. If the theoretical right boundary of the binary search of the variable to be calibrated, serR, is outside its Block index range, then the lower boundary of the Block index range of the variable to be calibrated is taken as its actual right boundary of the binary search, serR. Step A4: Determine the position of the current variable to be calibrated in the template program HEX file based on the actual left boundary serL and the actual right boundary serR of the binary search. Write the variable value of the current variable to be calibrated into this position to complete the calibration of the i-th variable to be calibrated; return to step 3.
42.
6. The offline calibration method for HEX programs based on dynamic search according to claim 4 or 5, characterized in that, Step 3.44 specifically refers to: The upper and lower boundaries of the Block index range to which the variable to be calibrated belongs are used as the actual left boundary serL and the actual right boundary serR of the binary search, respectively. The position of the variable to be calibrated in the template program HEX file is determined, and the variable value of the variable to be calibrated is written into the position to complete the calibration of the variable to be calibrated. Return to step 3.
42.
7. The offline calibration method for HEX programs based on dynamic search according to claim 6, characterized in that, Step 3.41 specifically includes: Step B1: Read in the first variable to be calibrated from the variable table, and use the upper and lower boundaries of its Block index as the actual binary search left boundary serL and the actual binary search right boundary serR of the first variable to be calibrated. Step B2: Calculate the current binary search middle row number serM using the actual binary search left boundary serL and the actual binary search right boundary serR of the first variable to be calibrated. serM=(serL+serR) / 2; serM retrieves the integer row number; Step B3: Read the HEX Record in the serM line of the template program HEX file, and parse the start ECU address RecordStart and end ECU address RecordEnd corresponding to that line; Step B4: Compare the ECU address VarAddr[1] of the first variable to be calibrated with RecordStart and RecordEnd: If RecordStart≤VarAddr[1]≤RecordEnd, then determine that the first serM line is the target HEX Record line containing the first variable to be calibrated, and execute step E; If VarAddr[1] is less than RecordStart, the actual right boundary serR of the binary search is updated to serM-1, and the process returns to step B2, until RecordStart≤VarAddr[1]≤RecordEnd; If VarAddr[1] is greater than RecordEnd, the actual left boundary serL of the binary search is updated to serM+1, and the process returns to step B2, until RecordStart≤VarAddr[1]≤RecordEnd; Step B5: Calculate a byte offset according to the ECU address of the first variable to be calibrated and the start ECU address of the target HEX Record line; Step B6: Determine the position of the first variable to be calibrated in the template program HEX file according to the byte offset, write the variable value of the first variable to be calibrated into this position, and complete the offline calibration of the first variable to be calibrated.
8. The offline calibration method for HEX programs based on dynamic search according to claim 7, characterized in that, Step 1 is specifically: Screen according to the engine serial number, manufacturer serial number and order number based on the configuration data, calibration parameters and vehicle model matching conditions required by the actual working condition, to obtain a list of variables to be calibrated.