Calibration data source code generation method

Through the calibration data source code generation method, the source code is directly identified and generated from the calibration data file, and the calibration data is applied to the on-board controller software, solving the problems of poor calibration integration and large workload in the prior art, achieving a wider application scenario and higher readability.

CN119987733APending Publication Date: 2025-05-13ZHONGKE FEISHI ELECTRIC TECH (TIANJIN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510022389.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the prior art, the calibration integration of on-board controllers is poor in versatility, has a large workload and is prone to errors, and cannot fully cover all application scenarios.

Method used

Through the calibration data source code generation method, data is directly read from the calibration data file, calibration data is identified, and calibration data is generated based on the preset source code template, and the calibration data is applied to the controller software.

Benefits of technology

It realizes a plain text method of applying calibration data to controller software, and is applicable to more application scenarios. It is simple to use, the generated source code is simple and readable, reducing the difficulty of calibration data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987733A_ABST
    Figure CN119987733A_ABST
Patent Text Reader

Abstract

The invention discloses a calibration data source code generation method, which overcomes the problems of poor calibration integration universality, large workload and error proneness of a vehicle-mounted controller in the prior art, and comprises the following steps: reading a calibration data file; according to a preset symbol type, identifying calibration quantity data in the calibration data file; generating a calibration data source code file based on a preset source code template according to the recognition result; and integrating the obtained calibration data source code file in the controller, and obtaining a calibration quantity data value change point. The software source code is directly generated through the calibration data source code, the calibration data is applied to the controller software in a plaintext mode of the software source code, the application range is wide, the generated source code is simple and high in readability, and the data set calibration difficulty is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of calibration data processing, and in particular to a method for generating a calibration data source code. Background Art

[0002] Vehicle controller calibration is widely used in traditional and new energy vehicle fields. Controller calibration mainly adjusts and optimizes the vehicle controller according to the vehicle design parameters and actual vehicle performance to achieve the best performance and meet customer requirements and national standards. After the controller calibration is completed, the calibration data is applied to the controller software. The calibration tool industry is mature, but how to apply the calibration data to the controller software, the current industry does not have a method that can fully cover all application scenarios.

[0003] There are currently two common solutions for calibration integration: 1) directly generating executable files (.hex or .s19) through Canape; 2) manually modifying the calibration quantity in the source code. However, solution 1) directly generating executable files cannot perform data and code review, and is strictly dependent on the hardware platform and has poor versatility; solution 2) has a large workload and is prone to introducing unexpected defects due to human errors. Summary of the invention

[0004] The purpose of the present invention is to solve the problems in the prior art that the vehicle-mounted controller calibration integration has poor versatility, large workload and is prone to errors. A calibration data source code generation method is provided, which directly generates software source code through the calibration data source code, and applies the calibration data to the controller software in a plain text manner such as the software source code. The method has a wide range of uses, the generated source code is simple and readable, and the difficulty of calibrating the data set is reduced.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions: A method for generating a calibration data source code comprises the following steps: Read calibration data file; According to the preset symbol type, identify the calibration data in the calibration data file; According to the recognition results, based on the preset source code template, a calibration data source code file is generated; The obtained calibration data source code file is integrated in the controller to obtain the calibration quantity data value change point.

[0006] The method of the present invention directly generates software source code through calibration data, and applies the calibration data to the controller software in a plain text manner of the software source code. It is suitable for more application scenarios, is easy to use and has a wide range of applications. The generated source code is simple and readable, which reduces the difficulty of calibrating the data set.

[0007] Preferably, identifying the calibration quantity data includes identifying the calibration quantity data value: if the calibration quantity data type is not an array type, the element after the calibration quantity data type is the calibration quantity data value; otherwise, after the calibration quantity data type, data starting with the third setting symbol from the next row are elements in the calibration quantity data array, and if there is a row that does not start with the third setting symbol, parsing of the calibration quantity data value ends.

[0008] Preferably, identifying the calibration quantity data includes identifying the calibration quantity data type: the element after the calibration quantity name and in the second preset symbol is the calibration data type.

[0009] Preferably, if the calibration quantity data type in the calibration data file is inconsistent with the data type in the corresponding programming language in the controller, mapping processing is performed on the calibration quantity data type in the calibration data file.

[0010] Preferably, identifying the calibration quantity data includes identifying the calibration quantity name: according to the file format of the calibration data file, when the beginning part of each line in the body part is not the first setting symbol, the beginning part is the calibration quantity name.

[0011] Preferably, the generation of the calibration data mask file includes: defining an entity class structure template and generating an entity class structure object according to the identified calibration data; and generating calibration data code for the controller application according to the entity class structure object based on a preset mode layer source code template.

[0012] Preferably, the calibration quantity data type includes a basic data type and an extended data type, and the extended data indicates whether the current calibration quantity is an array type and an array type definition.

[0013] Preferably, the calibration data value includes scientific notation numbers and ordinary numbers, and only ordinary numbers are retained when identifying the calibration data value.

[0014] Preferably, the calibrant name is separated from other elements by spaces.

[0015] Preferably, the vehicle-mounted controller is calibrated, and after the calibration is completed, the calibration data is exported to obtain a calibration data file.

[0016] Therefore, the present invention has the following beneficial effects: directly generating software source code through calibration data, applying the calibration data to the controller software in plain text form through the software source code, being applicable to more application scenarios, being simple to use and having a wide range of applications, and generating simple and readable source code, thereby reducing the difficulty of calibrating the data set. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flowchart of the overall steps of the method for generating a calibration data source code in Example 1.

[0018] Figure 2 This is a flow chart of the steps for identifying calibration data in Example 1.

[0019] Figure 3 This is a flow chart of the steps of the method for generating a calibration data source code in Example 2. DETAILED DESCRIPTION

[0020] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments: Embodiment 1: This embodiment provides a method for generating a calibration data source code, such as Figure 1 As shown, the operation process is as follows: step one, read the calibration data file; step two, identify the calibration data in the calibration data file according to the preset symbol type; step three, generate the calibration data source code file based on the preset source code template according to the recognition result; step four, integrate the obtained calibration data source code file in the controller to obtain the change point of the calibration data value.

[0021] The calibration data source code generation method provided in this embodiment is mainly aimed at the data processing after the vehicle controller is calibrated. After the vehicle controller is calibrated, the software source code is directly generated by the calibration data, and the calibration data is applied to the controller software in a plain text manner through the software source code. It is suitable for more application scenarios, is easy to use and has a wide range of applications. The generated source code is simple and readable, which reduces the difficulty of calibrating the data set.

[0022] The following further illustrates the technical solution and technical effects of the present invention through specific examples and specific application scenarios. The following examples are explanations of the present invention and the present invention is not limited to the following examples.

[0023] The present embodiment provides a method for generating a calibration data source code, the basic idea of ​​which is to generate a calibration data source code by directly identifying a calibration data file.

[0024] Specifically, Figure 1 As shown, a method for generating a calibration data source code specifically includes the following steps: Step 1: Read the calibration data file.

[0025] The vehicle controller is calibrated according to the vehicle design parameters and the actual performance of the vehicle. After the calibration is completed, the relevant calibration data is exported to obtain a calibration data file.

[0026] Specifically, before calibrating the vehicle controller, the following preparations need to be done: (1) Prepare calibration equipment: calibration computer, data cable, controller debugger, etc. (2) Prepare calibration tools: such as calibration software (such as Canape).

[0027] (3) Develop a calibration plan: Based on the target vehicle type information and the vehicle's actual operating performance, develop a calibration plan, including calibration parameters, calibration methods, etc., to achieve optimal performance and meet customer requirements and standards.

[0028] (4) Check the vehicle controller: Check the connection, power supply, and software version of the vehicle controller to ensure that the vehicle controller is not damaged before calibration to avoid affecting the calibration results.

[0029] The calibration process of the vehicle controller includes the following steps: (1) Read calibration data: Read the calibration data of the vehicle controller through the calibration software, including parameters such as power, torque, and speed.

[0030] (2) Calibration parameter adjustment: According to the established calibration plan, the calibration parameters are adjusted, including sensor calibration, software parameter adjustment, etc.

[0031] (3) Calibration data collection: Draw a calibration curve and collect data on the calibration curve. The data on the calibration curve includes parameters such as torque, power, and vehicle speed.

[0032] (4) Calibration data comparison: Compare the data collected on the calibration curve with the calibration data to determine the accuracy of the calibration results.

[0033] (5) Calibration data correction: According to the comparison results, the calibration data is corrected to ensure the accuracy of the calibration results.

[0034] (6) Calibration result check: Check the calibration results to determine whether they meet the requirements.

[0035] (7) Calibration data file output: Output the corrected calibration data to obtain a calibration data file, which contains the calibration data that needs to be flashed into the controller software.

[0036] Step 2: Identify the calibration data in the calibration data file according to the preset symbol type.

[0037] In this embodiment, the identified calibration quantity data includes a calibration quantity name, a calibration quantity data type, and a calibration quantity data value.

[0038] like Figure 2 As shown in Figure 2, the specific process of identifying the calibration data is as follows: Step (1): Identify the calibration quantity name in the calibration data file.

[0039] Identifying the calibration quantity name includes: obtaining the starting part of each line of data in the text part according to the file format of the calibration data file, judging whether the starting part of each line is the first setting symbol, and if the starting part of each line is not the first setting symbol, the starting part is the calibration quantity name.

[0040] The calibration quantity name is separated from other elements in the calibration data by spaces.

[0041] In this embodiment, the first setting symbol is a colon “:”.

[0042] Step (2): Identify the calibration quantity data type in the calibration data file.

[0043] Identifying the calibration quantity data type includes: obtaining the element after the calibration quantity name, judging whether there is an element in the second preset symbol, and if so, the element in the second preset symbol is the calibration data type.

[0044] In this embodiment, the second preset symbol is a square bracket “[]”.

[0045] At the same time, in this embodiment, if the calibration quantity data type in the calibration data file is inconsistent with the data type in the corresponding programming language in the controller, the calibration quantity data type in the calibration data file is mapped and converted into the corresponding programming language data type.

[0046] On the other hand, in this embodiment, the calibrated data type includes a basic data type and an extended data type, and its composition format is: [basic data type, extended data type].

[0047] The extended data is used to indicate whether the current calibration quantity is an array type and the array type definition.

[0048] It is determined whether the identified calibration quantity data type contains the extended data type. If not, it means that the calibration quantity is not array type data. This determination result can be used for the calibration quantity data value identification in step (3).

[0049] In this embodiment, when converting the calibrated quantity data type into the corresponding programming language data type, the specific process of conversion includes: Step (2.1): The basic data types in the calibration data file correspond to the language data types.

[0050] If it is basic data FLOAT, convert the uppercase FLOAT data into lowercase float data. If it is UINT data, convert the uppercase UINT data into lowercase uint data, convert the brackets in the uppercase UINT data into the form of underscore + t, and write the numbers in the brackets of the uppercase UINT data before the underscore.

[0051] Step (2.2): calibrate the correspondence between the extended data types in the data file.

[0052] The extended data type format is (a1, a2, a3, ..., ax). The corresponding relationship is: convert uppercase letters to lowercase letters, discard the second setting symbol, discard the symbol between the array type and the array type definition, and select the numbers in the elements representing the array type definition with the same symbol.

[0053] Example: [FLOAT, (1, 12)] corresponds to: float[1]

[12] .

[0054] Step (3): Identify the calibration data value in the calibration data file.

[0055] In this embodiment, the calibration quantity data value can be obtained in different ways depending on whether the calibration quantity data type is an array type.

[0056] Specifically, identifying the calibration quantity data value includes: if it is determined whether the calibration quantity data type is an array type, if not, the element after the calibration quantity data type is the calibration quantity data value; if the calibration quantity data type is a data type, then after the calibration quantity data type, the data starting with the third setting symbol from the next line is the element in the calibration quantity data array, if there is a line that does not start with the third setting symbol, the calibration quantity data value parsing is completed, and the calibration data file identification result is output.

[0057] In this embodiment, the third setting symbol is a colon “:”.

[0058] The calibration data value includes scientific notation and ordinary number, which is expressed as: scientific notation; ordinary number. When identifying the calibration data value, the scientific notation is directly discarded and only the ordinary number is retained.

[0059] Step 3: Based on the recognition results and the preset source code template, generate a calibration data source code file.

[0060] Specifically, generating a calibration data mask file includes the following steps: Step (1): Based on the identified calibration data, define the entity class structure template and generate the entity class structure object; rules such as field type conversion and annotation addition can be defined in the entity class structure template file. By adjusting the entity class structure template file, the generated entity class code can be customized. Step (2): Generate calibration data code for controller application based on the entity class structure object and a preset mode layer source code template.

[0061] Step 4: Integrate the obtained calibration data source code file in the controller to obtain the calibration quantity data value change point.

[0062] The calibration data source code obtained in the third step is integrated into the controller software, so that the calibration data can be applied to the controller software, so that the vehicle controller can directly use the calibrated data to control the entire vehicle.

[0063] The method for generating a calibration data source code provided in this embodiment has the following beneficial effects: 1. Generate software source code directly from calibration data, and apply calibration data to controller software in plain text form. It is suitable for more application scenarios, easy to use and has a wide range of applications. The generated source code is simple and readable, which reduces the difficulty of calibrating data sets.

[0064] 2. By using source code, you can see the change points more intuitively during integration, and avoid introducing software strategy defects due to calibration.

[0065] Embodiment 2: This embodiment provides a method for generating a calibration data source code, which is used to calibrate the vehicle controller by bringing in a specific application scenario. In order to meet the performance requirements of the engine and the whole vehicle, it is necessary to modify, adjust or optimize the parameters related to the algorithm inside the vehicle controller. The accuracy of the calibration result of the vehicle controller directly affects the performance of the whole vehicle and the service life of the vehicle. When the vehicle controller is developed, the control algorithm is written as a C language code and burned into the controller. In the process of burning the code, it is necessary to take into account the influence of other relevant factors, that is, it is necessary to continuously adjust the values ​​of the relevant parameters through calibration so that they can meet all the performance requirements that need to be considered as much as possible. However, how to apply the calibrated values ​​to the controller software so that the controller can be controlled with the calibrated values ​​is a major difficulty, and there is currently no method that can fully cover all application scenarios. In addition, the traditional vehicle controller software only supports a single calibration parameter when performing calibration. Since different vehicle configuration models correspond to multiple sets of different calibration parameters, when performing software calibration, obtaining the corresponding supporting parameters will increase the software version and reduce the efficiency of software calibration.

[0066] Therefore, the present embodiment provides a method for generating a calibration data source code, which directly generates software source code through calibration data, and applies the software source code to the vehicle controller software. It has strong versatility, is suitable for a variety of application scenarios, has a small workload, is easy to operate, effectively prevents human errors, and improves calibration efficiency.

[0067] It should be noted that this embodiment uses Canape to calibrate the vehicle controller to generate a calibration data file in the .par file format, and the control algorithm is written in C language in the controller software.

[0068] Specifically, Figure 3 As shown, a method for generating a calibration data source code provided in this embodiment includes the following steps: Step 1, read the Canape calibration data file (.par file); Step 2, identify the calibration quantity name in the Canape calibration data file, identify the calibration quantity data type in the Canape calibration data file, and the calibration quantity data value in the Canape calibration data file; generate the calibration data source code (.c file).

[0069] The calibration data source code refers to the C language source file used to calibrate the vehicle controller.

[0070] The calibration data source code generation method provided in this embodiment directly generates software source code through calibration data after calibrating the vehicle controller, so as to achieve the purpose of being applicable to more application scenarios, and is simple to use and has a wide range of applications. The generated source code is simple and readable, which reduces the difficulty of calibrating the data set. When integrating by using the source code, the change points can be seen more intuitively, and the defects of software strategy introduced by calibration can be avoided.

[0071] The following further illustrates the technical solution and technical effects of the present invention through specific examples and specific application scenarios. The following examples are explanations of the present invention and the present invention is not limited to the following examples.

[0072] Step 1: Read the Canape calibration data file (.par file).

[0073] It mainly includes: using Canape to calibrate the controller, exporting the calibration data after the calibration is completed, and obtaining the Canape calibration data file.

[0074] Specifically, using Canape to calibrate the controller includes the following steps: select the protocol type and set the relevant parameters; set the data signal to be collected and configure the sampling period to ensure that the data of the vehicle controller is obtained in real time or near real time; select the corresponding calibration information and perform online calibration and calibration on the vehicle controller.

[0075] Step 2: Identify the calibration quantity name, calibration quantity data type, and calibration quantity data value in the Canape calibration data file.

[0076] The specific process of generating controller software source code from Canape calibration data includes: (1) Identify the calibration quantity names in the Canape calibration data file.

[0077] According to the .par file format, when the beginning part of each line in the body of the file is not ":", the beginning part is the calibrated quantity name, and the calibrated quantity name is separated from other elements by spaces.

[0078] (2) Identify the type of calibration quantity data in the Canape calibration data file.

[0079] The calibrator name is followed by the calibrator data type and the calibrator data type is enclosed in "[]" symbols.

[0080] Because the controller software in this embodiment uses C language to write the control algorithm, if the data type in the .par file is inconsistent with the data type in the C language, mapping processing is required. The data type in the .par file is divided into two parts: basic data type and extended data type (optional), composed of: [basic data type, extended data type], where the extended data type indicates whether the current calibration quantity is an array type and the array type definition. When the extended data type is not included, it means that the calibration quantity is not an array type data.

[0081] In this embodiment, the correspondence table between the basic data types of the .par file and the C language data types is as follows: If the basic data type is: FLOAT, the C language data type is: float; if the basic data type is: UINT(8), the C language data type is: uint8_t; if the basic data type is: UINT(16), the C language data type is: uint16_t; if the basic data type is: UINT(32), the C language data type is: uint32_t; if the basic data type is: UINT(64), the C language data type is: uint64_t.

[0082] FLOAT is a basic data type in C language, which is used to represent single-precision floating-point numbers, that is, real numbers with decimal parts. UINT is a 32-bit unsigned integer data type in C language, ranging from 0 to 4294967295, mainly used to store non-negative integers to avoid integer overflow problems. The correspondence table between the .par file extended data type and the C language data type is as follows: First, the extended data type format is (a1, a2, a3, …, ax).

[0083] If the extended data type is (a1, a2, a3, …, ax), the C language data type is: ax: array subscript definition, example: [FLOAT, (1, 12)] corresponds to: float [1]

[12] .

[0084] (3) Identify the calibration data values ​​in the Canape calibration data file.

[0085] Each calibration data value consists of two parts: a number expressed in scientific notation and a number expressed in ordinary number, which is composed of: scientific notation number; ordinary number. When identifying the calibration data value in the Canape calibration data file, the scientific notation number is directly discarded and only the ordinary number is retained.

[0086] The specific identification process is as follows: if the data type of the calibration data is not an array type, the calibration data value is followed by the calibration data type. If the data type of the calibration data is an array type, the calibration data type is followed by the first element in the calibration data array, and the data starting with ":" from the next line are the elements in the calibration data array in sequence, until there is a line that does not start with ":", indicating that the parsing of the calibration data value is completed.

[0087] Step 3: Generate calibration data source code (.c file).

[0088] The information obtained from the above steps is organized into a source code file, and the calibration software source code is integrated into the vehicle controller software.

[0089] The calibration data source code generation method provided in this embodiment generates the calibration data source code by directly identifying the .par file, and then integrates the generated calibration data source code into the vehicle controller software, so that the vehicle controller uses the calibrated data to control the whole vehicle. A new calibration data processing method is realized, which has the characteristics of simple use, wide application range, simple and readable source code generation, and reduced difficulty in calibration data set.

[0090] The above-described embodiment is only a preferred solution of the present invention and does not limit the present invention in any form. There are other variations and modifications without exceeding the technical solution described in the claims.

Claims

1. A method for generating a calibration data source code, characterized in that: include: Read calibration data file; According to the preset symbol type, identify the calibration data in the calibration data file; According to the recognition results, based on the preset source code template, generate the calibration data source code file; The obtained calibration data source code file is integrated in the controller to obtain the calibration quantity data value change point.

2. A method for generating a calibration data source code according to claim 1, characterized in that: Identifying the calibration quantity data includes identifying the calibration quantity data value: if the calibration quantity data type is not an array type, the element after the calibration quantity data type is the calibration quantity data value; otherwise, after the calibration quantity data type, the data starting with the third setting symbol from the next row is the element in the calibration quantity data array, and if there is a row that does not start with the third setting symbol, the calibration quantity data value parsing ends.

3. A method for generating a calibration data source code according to claim 2, characterized in that: Identifying the calibration quantity data includes identifying the calibration quantity data type: the element after the calibration quantity name and in the second preset symbol is the calibration data type.

4. A method for generating a calibration data source code according to claim 1, 2 or 3, characterized in that: If the calibration quantity data type in the calibration data file is inconsistent with the data type in the corresponding programming language in the controller, the calibration quantity data type in the calibration data file is mapped.

5. A method for generating a calibration data source code according to claim 1, 2 or 3, characterized in that: Identifying the calibration quantity data includes identifying the calibration quantity name: according to the file format of the calibration data file, when the beginning of each line in the body part is not the first setting symbol, the beginning part is the calibration quantity name.

6. A method for generating a calibration data source code according to claim 1, characterized in that: The generation of the calibration data mask file includes: defining an entity class structure template according to the identified calibration data, and generating an entity class structure object; and generating calibration data code for the controller application according to the entity class structure object based on a preset mode layer source code template.

7. A method for generating a calibration data source code according to claim 3, characterized in that: The calibration quantity data type includes a basic data type and an extended data type, and the extended data indicates whether the current calibration quantity is an array type and an array type definition.

8. A method for generating a calibration data source code according to claim 2 or 3, characterized in that: The calibration data value includes scientific notation numbers and ordinary numbers, and only ordinary numbers are retained when identifying the calibration data value.

9. A method for generating a calibration data source code according to claim 5, characterized in that: The calibrated quantity name is separated from other elements by spaces.

10. A method for generating a calibration data source code according to claim 1 or 2 or 3 or 6 or 7, characterized in that: The vehicle controller is calibrated, and after the calibration is completed, the calibration data is exported to obtain a calibration data file.