Method and device for generating parameter files for electronic control units in vehicles
By using automated tools to process CSV and ELF files and generate A2L files, the problem of low efficiency in generating electronic control unit parameter files is solved, thus simplifying the operation process and improving development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA FAW CO LTD
- Filing Date
- 2023-09-06
- Publication Date
- 2026-06-23
AI Technical Summary
The existing technology for generating parameter files for electronic control units is inefficient, especially in the development of intelligent vehicle domain controllers. Application developers need to manually add a large number of calibration values, which makes the operation cumbersome and prone to errors, thus reducing the efficiency of vehicle controller software development.
Automated tools are used to process CSV and ELF files and generate A2L files, including creating processing functions and dictionary data structures, and automatically generating variable and header information, which simplifies the operation process and reduces manual intervention.
It improves the efficiency of generating electronic control unit parameter files, simplifies the operation process, reduces the workload of developers, and improves the development efficiency of vehicle controller software versions.
Smart Images

Figure CN117246258B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicles, and more specifically, to a method and apparatus for generating parameter files for electronic control units in vehicles. Background Technology
[0002] Currently, the parameter file (ASAM MCD 2MC, abbreviated as ASAP2 file), also known as the A2L file, is an essential file in the calibration project. The A2L file mainly contains the host computer configuration information and variable information. The A2L file can be edited and generated by the A2L file editor (A2L Editor) that comes with the executable file (such as ELF file or HEX file) imported by the tools provided by the calibration host computer (such as CANAPE). During the calibration process, the lower-level developers release an A2L file containing only the host computer configuration information. The variable information requires the application developers to define the variable types in MATLAB, model and generate code in MATLAB, add data locators to the beginning and end of the variables, and then use MATLAB to generate the variable information in the A2L file. Subsequently, the application developers use the calibration host computer tool CANAPE to combine the A2L file containing only the host computer configuration information released by the lower-level developers with the generated variable information to form a complete A2L file before proceeding with the subsequent calibration work. This results in the problem of low efficiency in generating parameter files for the electronic control unit.
[0003] There is currently no effective solution to the problem of low efficiency in generating parameter files for electronic control units. Summary of the Invention
[0004] This invention provides a method and apparatus for generating parameter files of electronic control units in vehicles, so as to at least solve the technical problem of low efficiency in generating parameter files of electronic control units.
[0005] According to one aspect of the present invention, a method for generating a parameter file for an electronic control unit (ECU) in a vehicle is provided. The method may include: determining a table file and an executable file for the ECU; obtaining a table dictionary converted from the table file and an executable dictionary converted from the executable file; obtaining variable information of the ECU based on the table dictionary and the executable dictionary; and obtaining a parameter file that matches the variable information and the header information of the ECU.
[0006] Optionally, determining the table file of the electronic control unit in the vehicle includes: determining the initial table file obtained after developing the application functions of the underlying software of the electronic control unit; filling the calibrated values required by the application functions into the initial table file to obtain the table file.
[0007] Optionally, the executable file of the electronic control unit in the vehicle is determined, including: compiling the source code of the application function to generate an executable file.
[0008] Optionally, obtaining the table dictionary converted from the table file and the executable dictionary converted from the executable file includes: calling a processing function established in the automation tool to receive the table file and the executable file; and obtaining the table dictionary converted from the table file by the processing function and the executable dictionary converted from the executable file by the processing function from the automation tool.
[0009] Optionally, based on the table dictionary and the executable dictionary, the variable information of the electronic control unit is obtained, including: calling a dictionary data structure established in the automation tool, wherein the dictionary data structure contains key fields; based on the key fields in the dictionary data structure, obtaining the value fields of the table dictionary obtained by the automation tool traversing the table dictionary, and obtaining the value fields of the executable dictionary obtained by the automation tool traversing the executable dictionary; converting the key fields and value fields into a format matched by the parameter file to determine the variable information of the electronic control unit.
[0010] Optionally, a parameter file matching the variable information and the header information of the electronic control unit is obtained, including: determining the header information of the electronic control unit based on the header information character segment of the calibration host computer; and obtaining the parameter file obtained by merging the variable information and the header information using an automated tool.
[0011] Optionally, the method further includes: obtaining the parsing result after parsing the parameter file; and calibrating the electronic control unit based on the parsing result.
[0012] According to another aspect of the present invention, an apparatus for generating parameter files of electronic control units in a vehicle is also provided. The apparatus may include: a determining unit for determining a table file and an executable file of the electronic control unit in the vehicle; a first obtaining unit for obtaining a table dictionary converted from the table file and an executable dictionary converted from the executable file; a second obtaining unit for obtaining variable information of the electronic control unit based on the table dictionary and the executable dictionary; and a third obtaining unit for obtaining a parameter file that matches the variable information and the header information of the electronic control unit.
[0013] According to another aspect of the present invention, a vehicle is also provided. This vehicle is used to execute the method for generating parameter files for an electronic control unit in a vehicle according to the embodiments of the present invention.
[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided. The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to execute the method for generating parameter files of an electronic control unit in a vehicle according to the embodiments of the present invention.
[0015] In this embodiment of the invention, a table file and an executable file of the electronic control unit (ECU) in a vehicle are determined; a table dictionary converted from the table file and an executable dictionary converted from the executable file are obtained; based on the table dictionary and the executable dictionary, variable information of the ECU is obtained; and a parameter file matching the variable information and the header information of the ECU is obtained. In other words, this embodiment of the invention determines the table file and the executable file of the ECU in the vehicle, inputs the determined table file and executable file into an automation tool, obtains the table dictionary converted from the table file and the executable dictionary converted from the executable file from the automation tool, and, based on the table dictionary and the executable dictionary, obtains the variable information of the ECU. Furthermore, it obtains a parameter file matching the variable information and the header information of the ECU, thereby improving the efficiency of generating the ECU's parameter file and solving the technical problem of low efficiency in generating ECU parameter files. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0017] Figure 1 This is a flowchart of a method for generating parameter files for an electronic control unit in a vehicle according to an embodiment of the present invention;
[0018] Figure 2 This is a schematic diagram illustrating the interaction between a host computer and an electronic control unit during the calibration process according to an embodiment of the present invention.
[0019] Figure 3 This is a schematic diagram of a device for generating parameter files for an electronic control unit in a vehicle according to an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] Example 1
[0023] According to an embodiment of the present invention, an embodiment of a method for generating parameter files of an electronic control unit in a vehicle is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0024] Figure 1 This is a flowchart illustrating a method for generating parameter files for an electronic control unit in a vehicle according to an embodiment of the present invention, such as... Figure 1 As shown, the method may include the following steps:
[0025] Step S102: Determine the form file and executable file of the electronic control unit in the vehicle.
[0026] In the technical solution provided by step S102 of the present invention, the table file and executable file of the electronic control unit in the vehicle can be determined. The table file can be a file storing table data in plain text format, where each row represents a record and each field is separated by commas. It can be used to store and exchange structured data and can be parsed and processed by various software and programming languages. For example, it can be a CSV file; this is only an example and no specific limitation is made on the format of the table file. The executable file can be a file format for storing and executing software programs and can be used to manage and control various functions of the vehicle. For example, it can be an ELF file or a HEX file; this is only an example and no specific limitation is made on the format of the executable file.
[0027] Optionally, in an Electronic Control Unit (ECU), CSV files can be used to store and import / export information such as parameter configurations, log data, and test results. During development, software developers can compile their code into ELF files and download them to the ECU. The ECU can read the instructions and data in the ELF file and execute the corresponding operations to achieve the desired function.
[0028] Step S104: Obtain the table dictionary converted from the table file, and obtain the executable dictionary converted from the executable file.
[0029] In the technical solution provided in step S104 of the present invention, a table dictionary converted from a table file and an executable dictionary converted from an executable file can be obtained. Each piece of data recorded in the table dictionary is represented as a dictionary, where the key represents a field name and the value represents a field value. The table dictionary can be used to conveniently store and process data with different fields; for example, it can be a CSV dictionary. This is merely an example and no specific restrictions are placed on the format of the table dictionary. The executable dictionary can be a data structure for storing and retrieving data. Data in the executable dictionary is stored in key-value pairs. The key is unique and can be any hashable object, such as a string or number. There is a one-to-one correspondence between the key and the value, and the corresponding value can be accessed through the key. For example, the executable dictionary can be an ELF dictionary; this is merely an example and no specific restrictions are placed on the format of the executable dictionary.
[0030] Optionally, this embodiment inputs the table file and executable file of the determined ECU in the vehicle into an automation tool. The automation tool can convert the table file into a table dictionary and the executable file into an executable dictionary. Furthermore, the table dictionary converted from the table file and the executable dictionary converted from the executable file can be obtained from the automation tool.
[0031] Step S106: Obtain variable information of the electronic control unit based on the table dictionary and the executable dictionary.
[0032] In the technical solution provided by step S106 of the present invention, variable information of the electronic control unit can be obtained based on the determined table dictionary and executable dictionary. The variable information can be parameters and data stored in the electronic control unit, and may include at least input signals, output signals, control parameters, and measurement data.
[0033] Optionally, this embodiment establishes a variable information function for the parameter file of the electronic control unit in an automated tool. Based on a defined table dictionary and executable dictionary, the table dictionary and executable dictionary can be converted into a format matching the parameter file to obtain the variable information of the electronic control unit. The variable information of the electronic control unit can be obtained for use in generating the parameter file.
[0034] Step S108: Obtain the parameter file that matches the variable information and the header information of the electronic control unit.
[0035] In the technical solution provided by step S108 of the present invention, the header information of the electronic control unit can be obtained. Based on the determined variable information and header information, a parameter file matching the variable information and header information can be obtained. The header information can be metadata information, and may at least contain basic information and descriptive information of the electronic control unit. The parameter file (e.g., an A2L file) can be a calibration description file, which can be used to describe information such as parameters, calibration data, and measurement signals of the electronic control unit.
[0036] Optionally, this embodiment acquires the header information of the ECU. Based on the determined variable information and header information, the variable information and header information can be merged to generate a complete A2L file. The A2L file is in text format and can describe the relevant parameters for ECU communication, the addresses of calibration and observation variables, and physical value calculation formulas, etc. The A2L file can include at least device parameter information, interface data information, and ECU parameter information. Among them, the parameter information describes the basic information of the ECU and some common attributes of the ECU data units. The interface data information describes the interface information required for the calibration system to communicate with the ECU. The ECU parameter information describes the detailed contents of the internal data units.
[0037] In steps S102 to S108 of this invention, the table file and executable file of the electronic control unit (ECU) in the vehicle are determined; a table dictionary converted from the table file and an executable dictionary converted from the executable file are obtained; based on the table dictionary and the executable dictionary, the variable information of the ECU is obtained; and a parameter file matching the variable information and the header information of the ECU is obtained. In other words, this embodiment of the invention determines the table file and executable file of the ECU in the vehicle, inputs the determined table file and executable file into an automation tool, obtains the table dictionary converted from the table file and the executable dictionary converted from the executable file from the automation tool, and, based on the table dictionary and the executable dictionary, obtains the variable information of the ECU. Furthermore, it obtains a parameter file matching the variable information and the header information of the ECU, thereby improving the efficiency of generating the ECU parameter file and solving the technical problem of low efficiency in generating ECU parameter files.
[0038] The method described in this embodiment will be further described below.
[0039] As an optional embodiment, step S102, determining the table file of the electronic control unit in the vehicle, includes: determining the initial table file obtained after developing the application functions of the underlying software of the electronic control unit; filling the calibrated values required by the application functions into the initial table file to obtain the table file.
[0040] In this embodiment, an initial table file can be determined after developing the application functions of the underlying software of the electronic control unit. Based on the determined initial table file, the scalar values required by the application functions can be filled into the initial table file to obtain a table file. The initial table file can be a CSV table created during the development of the application functions.
[0041] Optionally, this embodiment obtains the underlying software released to application developers after the underlying developers have developed the underlying basic modules. Based on the obtained underlying software, application functions or application data can be further developed, and a CSV table can be created. Furthermore, the scalar values required by the application functions or application data can be added to the CSV table to obtain a CSV file.
[0042] As an optional embodiment, step S102, determining the executable file of the electronic control unit in the vehicle, includes: compiling the source code of the application function to generate an executable file.
[0043] In this embodiment, depending on the chip architecture type of the current vehicle model controller, a compiler can be selected to compile the source code (e.g., a C language file) of the application function or application data, and compile the source code into an ELF file or a HEX file.
[0044] This embodiment eliminates the need for application developers to manually screen and process data, and provides and implements an automated tool. By inputting ELF and CSV files into this automated tool, A2L files can be directly generated, thereby freeing up the hands of application developers, simplifying the operation process, reducing the workload of application developers, and improving the overall work efficiency of vehicle controller software version development and iteration.
[0045] As an optional embodiment, step S104, obtaining the table dictionary converted from the table file and the executable dictionary converted from the executable file, includes: calling a processing function established in the automation tool to receive the table file and the executable file; and obtaining the table dictionary converted from the table file by the processing function and the executable dictionary converted from the executable file by the processing function from the automation tool.
[0046] In this embodiment, a processing function created in the automation tool can be invoked. This processing function can receive input table files and executable files. After receiving the table files and executable files, the processing function can retrieve, from the automation tool, a table dictionary obtained by the processing function from the table files, and an executable dictionary obtained by the processing function from the executable files.
[0047] Optionally, processing functions that receive CSV and ELF files can be created in the automation tool, and CSV and ELF dictionaries can be generated based on the CSV and ELF files respectively.
[0048] As an optional embodiment, step S106, based on the table dictionary and the executable dictionary, obtains the variable information of the electronic control unit, including: calling a dictionary data structure established in the automation tool, wherein the dictionary data structure contains key fields; based on the key fields in the dictionary data structure, obtaining the value fields of the table dictionary obtained by the automation tool traversing the table dictionary, and obtaining the value fields of the executable dictionary obtained by the automation tool traversing the executable dictionary; converting the key fields and value fields into a format matched by the parameter file to determine the variable information of the electronic control unit.
[0049] In this embodiment, a dictionary data structure established in the automation tool can be invoked. Based on the key fields in the invoked dictionary data structure, the value fields of the table dictionary obtained by the automation tool through traversal, and the value fields of the executable dictionary obtained by the automation tool through traversal, can be obtained. Based on the determined key and value fields of the table dictionary and the executable dictionary, the key and value fields of the table dictionary and the executable dictionary are converted into a format matching the parameter file, respectively, to determine the variable information of the electronic control unit. The dictionary data structure can be a data structure that stores a set of data pairs consisting of keys and values. The dictionary data structure contains key fields and value fields, each key is unique and can be used to identify the corresponding value. Furthermore, the corresponding value can be quickly accessed and retrieved using a given key.
[0050] Optionally, a key-value dictionary data structure can be created in the automation tool. The key field can at least include the name of the standard, the address of the standard, and the basic data type of the standard. Based on the generated CSV and ELF dictionaries, values can be assigned to the corresponding value fields of the key fields in the CSV and ELF dictionaries one by one. A function can be created in the automation tool to generate variable information segments in an A2L file, converting each key-value field in the CSV and ELF dictionaries into the matching format in the A2L file, thus obtaining the variable information in the A2L file.
[0051] For example, you can iterate through and match each key field in the CSV and ELF dictionaries. Based on the CSV dictionary, you can assign values to the corresponding value fields of each key field to improve the CSV dictionary.
[0052] As an optional embodiment, step S108, obtaining a parameter file that matches the variable information and the header information of the electronic control unit, includes: determining the header information of the electronic control unit based on the header information character segment of the calibration host computer; and obtaining the parameter file obtained by merging the variable information and the header information using an automated tool.
[0053] In this embodiment, the header information of the electronic control unit can be determined based on the header information character field of the calibration host computer. Based on the determined header information and variable information, the header information and variable information can be merged to obtain a parameter file. The calibration host computer can be a calibration host computer tool (CANAPE), but this is only an example and no specific limitations are imposed on the calibration host computer. The header information character field can at least include a file identifier, file length, tool name, tool version, calibration time, acquisition device name, acquisition device version, calibration parameters, and calibration results, which can be used to correctly parse and use the A2L file.
[0054] Optionally, a function to generate the header information of the A2L file can be created in the automation tool, and the header information character field of the calibration host computer tool CANAPE can be input to obtain the header information of the A2L file. Based on the determined header information and variable information of the A2L file, the two information fields can be merged to generate a complete A2L file and output it.
[0055] This embodiment inputs the determined CSV and ELF files into the automation tool, which can control the automation tool to automatically generate a complete A2L file, thereby solving the problems of cumbersome calibration and low A2L file generation efficiency in the process of vehicle model controller software development.
[0056] As an optional embodiment, the method further includes: obtaining the parsing result of parsing the parameter file; and calibrating the electronic control unit based on the parsing result.
[0057] In this embodiment, the parameter file can be loaded into the calibration host computer tool for parsing to obtain the parsing result of the parameter file. Based on the parsing result, the electronic control unit can be calibrated.
[0058] Optionally, the generated complete A2L file can be loaded into the calibration host computer tool CANAPE. ELF or HEX files can be burned into the ECU using a debugger, enabling the ECU to operate normally under power. Development boards (e.g., KL30, KL15) and the calibration Controller Area Network (CAN) wiring harness can be connected, and connected to the power supply to ensure the development board can operate under constant power, high voltage, and CAN circuit power supply conditions. The wiring harness between the calibration host computer tool CANAPE and the ECU can be connected, and the channel must be configured correctly in the CANAPE software to ensure a proper link connection. After the ECU is powered on, the host computer tool and the target device can establish a normal handshake connection. Application developers can use the calibration host computer tool CANAPE to perform subsequent observation and calibration work.
[0059] This embodiment determines the table file and executable file of the electronic control unit (ECU) in a vehicle; obtains a table dictionary converted from the table file and an executable dictionary converted from the executable file; obtains the variable information of the ECU based on the table dictionary and the executable dictionary; and obtains a parameter file that matches the variable information and the header information of the ECU. In other words, this embodiment determines the table file and executable file of the ECU in a vehicle, inputs the determined table file and executable file into an automation tool, obtains the table dictionary converted from the table file and the executable dictionary converted from the executable file from the automation tool, and obtains the variable information of the ECU based on the table dictionary and the executable dictionary. Furthermore, it obtains a parameter file that matches the variable information and the header information of the ECU, thereby improving the efficiency of generating the ECU parameter file and solving the technical problem of low efficiency in generating ECU parameter files.
[0060] Example 2
[0061] The technical solutions of the embodiments of the present invention will be illustrated below with reference to preferred embodiments.
[0062] In recent years, with the rapid development of vehicle intelligence and connectivity, the number of ECUs (Electronic Control Units), the core of vehicle electronic control systems, has exploded. During the development of actual systems, the complexity of the control algorithms and parameters within the ECU has also increased, with hundreds of parameters and signals needing effective control and adjustment during ECU operation. Calibration engineers interact with the running ECU using calibration tools on test benches and in actual vehicles. Based on the performance requirements of the ECU or the vehicle as a whole, they adjust or optimize the internal parameters of the ECU to improve the vehicle's power, safety, and stability. Calibration engineers typically use host computer calibration tools (such as CANAPE and INCA) to observe and adjust the corresponding variable values during ECU operation, thus achieving the calibration process.
[0063] The A2L file is a calibration description file in text format. It describes parameters related to ECU communication, addresses of calibration and observation variables, and formulas for calculating physical values. The information in the A2L file allows the calibration protocol (e.g., XCP) master station to communicate with the slave module via XCP. The formatted text file contains event and measurement definitions, as well as other configuration information, which can be used to acquire and stimulate data and execute other functions.
[0064] The A2L file is an essential file in the calibration project. It primarily contains host computer configuration information and variable information. The A2L file can be generated by editing the A2L Editor built into the executable ELF or HEX file imported through the calibration host computer tool CANAPE. During the calibration project development process, the lower-level developers release an A2L file containing only the host computer configuration information. The variable information requires application developers to define variable types in MATLAB, model and generate code in MATLAB, add data locators to the beginning and end of the variables, and then use MATLAB to generate the variable information in the A2L file. Subsequently, the application developers use the calibration host computer tool CANAPE to combine the A2L file containing only the host computer configuration information released by the lower-level developers with the generated variable information to form a complete A2L file, which is then used for subsequent calibration work.
[0065] Currently, in the development of intelligent vehicle domain controllers, the number of calibration values for each steering wheel control (SWC) may be as high as hundreds. The process of applying professional developers to implement and add calibration values to generate A2L files consumes a lot of time and effort. Moreover, carelessness by professional developers can lead to unknown errors in the A2L files. The operation process is too cumbersome and time-consuming, which reduces the efficiency of vehicle controller software development iteration, resulting in the problem of low efficiency in generating parameter files for electronic control units.
[0066] As an alternative example, a calibration data storage method is proposed. This method can effectively manage large blocks of data and ensure efficient data storage even when addresses are not contiguous. It can guarantee data validity and communication efficiency. However, since this method does not involve a method for downloading calibration data, it suffers from low efficiency in generating parameter files for electronic control units.
[0067] As another alternative example, a method and apparatus for updating vehicle calibration data are also proposed. This method supports the updating of vehicle calibration data by the bootloader and application, thereby enabling the selection of different update methods for different calibration data sizes or other different calibration needs. This makes the calibration process more flexible, faster in terms of update speed, and better in terms of scalability. However, since this method does not involve the method of downloading calibration data, it suffers from the problem of low efficiency in generating parameter files for electronic control units.
[0068] As another alternative example, a calibration data management method and apparatus are also proposed. This method can effectively improve the accuracy and efficiency of calibration data, thereby solving the technical problems of poor accuracy and low efficiency of calibration data management in related technologies. However, since this method does not involve diagnostic data storage and automated integration methods, it suffers from low efficiency in generating parameter files for electronic control units.
[0069] To address the aforementioned issues, this embodiment proposes a method for generating parameter files for electronic control units (ECUs) in vehicles. This method allows professional developers to create a CSV file and add the required calibration values. After development, the software can be compiled to generate an ELF file. The automated software algorithm in this method can automatically generate an A2L file from the input CSV and ELF files. The professional developers can then directly import this A2L file into a calibration host computer tool for further work. This eliminates the need for manual addition of calibration values, freeing up the hands of technical developers, simplifying the process, reducing their workload, and improving the overall efficiency of vehicle controller software version development and iteration. This achieves the technical effect of improving the efficiency of generating ECU parameter files, solving the technical problem of low efficiency in generating ECU parameter files.
[0070] This embodiment allows obtaining the underlying software released by the underlying developers to application developers after developing the underlying basic modules. Based on this obtained underlying software, application functions or application data can be developed, and a CSV table can be created. Furthermore, the scalar values required by the application functions or application data can be added to the CSV table to obtain a CSV file. Depending on the chip architecture type of the current vehicle model controller, a compiler can be selected to compile the source code C language files of the application functions or application data into ELF or HEX files.
[0071] Based on defined CSV and ELF files, these files can be input into an automation tool. The automation tool can be implemented using a computer language (e.g., Python syntax) and a Python project can be created using an integrated development environment (e.g., PyCharm). Within the automation tool, processing functions that receive CSV and ELF files can be created, along with key-value dictionary data structures. The key field can at least include the name, address, and basic data type of the standard. Based on the CSV and ELF files, CSV and ELF dictionaries can be generated separately, and values can be assigned to the corresponding value fields of the key fields in each dictionary. Each key field in the CSV and ELF dictionaries can be iterated and matched; using the CSV dictionary as a base, values can be assigned to the corresponding value fields of each key field to complete the CSV dictionary.
[0072] A function can be created within an automation tool to generate the header information of an A2L file. This function can be used as input to the header information field of the calibration tool CANAPE to obtain the A2L file header information. A function can also be created within the automation tool to generate the variable information field of the A2L file. This function can convert each key-value field in a CSV or ELF dictionary into the format that matches the A2L file, thus obtaining the A2L file variable information. Based on the determined A2L file header and variable information, these two information fields can be merged to generate a complete A2L file, which can then be output.
[0073] After obtaining the complete generated A2L file, application developers load it into the calibration host computer tool CANAPE. ELF or HEX files can be burned into the ECU using a debugger, enabling the ECU to operate normally under power. Development boards KL30 and KL15, along with the calibration CAN wiring harness, can be connected to the power supply to ensure the development board can operate under constant power, high voltage, and power supply conditions for the calibration CAN circuit. The wiring harness between the calibration host computer tool CANAPE and the ECU can be connected, and the channel must be configured correctly in the CANAPE software to ensure proper link connection. After the ECU is powered on, the host computer tool and the target device can establish a normal handshake connection. Application developers can then use the calibration host computer tool CANAPE to perform subsequent observation and calibration work.
[0074] An A2L file can include at least device parameter information, interface data information, and ECU parameter information. The parameter information describes the basic information of the ECU and some common attributes of the ECU data units. The interface data information describes the interface information required for communication between the calibration system and the ECU. The ECU parameter information describes the detailed contents of the internal data units. An A2L file can consist of an A2L file header, calibration variable descriptions, observation variable descriptions, and other auxiliary information, conversion formulas, etc. The A2L file header contains item configuration information, which generally does not change with software compilation unless the corresponding parameters are adjusted. The address information contained in the calibration variable descriptions and observation variable descriptions may change with each compilation. Other auxiliary information and conversion formulas generally do not change with software compilation unless the corresponding parameters are adjusted.
[0075] Calibration is the process of adjusting or optimizing the internal parameters of an ECU based on its performance requirements or those of the entire vehicle. It requires certain hardware connections and specific communication protocols to enable the monitoring, modification, recording, and playback of various variables or parameters in the controller software of the vehicle's electronic systems, thereby facilitating the modification of control parameters. Figure 2This is a schematic diagram illustrating the interaction between a host computer and an electronic control unit during the calibration process according to an embodiment of the present invention, as shown below. Figure 2 As shown, the electronic control unit 201 may include at least a steering wheel control SWC, a run-time environment (RTE), a basic software module (BSW) 202, a driver (e.g., XCP-Treiber), a network interface (Netzwerk-Interface), and a debug interface (Debug-Interface). The debug interface connects to a calibration interface (e.g., Vector VXKalibrier-Interface) via a joint test action group (JTAG), a vehicle calibration system (e.g., Nexus), and a data acquisition system (DAP). The calibration interface is then connected to a calibration tool 203. The network interface connects to another network interface via a communication protocol (Universal Measurement and Calibration Protocol, XCP), a calibration constant parameter (CCP), CAN, local area network technology (e.g., Ethernet), and a high-speed data bus communication protocol (e.g., FlexRay), and is then connected to the calibration tool 203.
[0076] The hardware and software environment required for calibration tools can include at least a host computer, a calibration protocol, a database, calibration tools, and a data link. The host computer provides a human-machine interface (HMI) to issue commands to the ECU to observe and modify variables. The calibration protocol (e.g., CCP, XCP, and ETK) enables HMI interaction. The database can correspond to the address, data, and calibration details of the variables based on A2L and ELF files. The calibration tool converts host computer commands into bus data. The data link can be CAN, Controller Area Network Flexible Data Rate (CANFD), or the Internet.
[0077] Calibration values are typically stored in a calibration area on non-volatile memory (FLASH), which is predefined in the linker file. The starting address, length, and correspondence between the FLASH and Random Access Memory (RAM) calibration spaces are also defined in the linker file. After the ECU is powered on, during the initialization phase, the program copies the data from the FLASH area to the corresponding RAN address space via the linker file. During calibration, calibration values are typically stored in RAM. After calibrating the calibration values, the flag values in RAM need to be copied to FLASH; this process is called calibration data download. In existing methods, calibration engineers issue program download commands through the human-machine interface provided by the CANAPE host computer calibration tool, following the XCP protocol. XCP uses a master-slave communication mode, with the host computer tool performing the measurement or calibration as the XCP master node and the ECU being measured or calibrated as the XCP slave node. During the process of sending storage commands through the host computer, the host computer master node sends XCP FLASH write-related commands, and the slave node parses, executes, and returns a response.
[0078] This embodiment determines the table file and executable file of the electronic control unit (ECU) in a vehicle; obtains a table dictionary converted from the table file and an executable dictionary converted from the executable file; obtains the variable information of the ECU based on the table dictionary and the executable dictionary; and obtains a parameter file that matches the variable information and the header information of the ECU. In other words, this embodiment determines the table file and executable file of the ECU in a vehicle, inputs the determined table file and executable file into an automation tool, obtains the table dictionary converted from the table file and the executable dictionary converted from the executable file from the automation tool, and obtains the variable information of the ECU based on the table dictionary and the executable dictionary. Furthermore, it obtains a parameter file that matches the variable information and the header information of the ECU, thereby improving the efficiency of generating the ECU parameter file and solving the technical problem of low efficiency in generating ECU parameter files.
[0079] Example 3
[0080] According to an embodiment of the present invention, an apparatus for generating parameter files for electronic control units in a vehicle is also provided. It should be noted that this apparatus for generating parameter files for electronic control units in a vehicle can be used to execute the method for generating parameter files for electronic control units in a vehicle as described in Embodiment 1.
[0081] Figure 3This is a schematic diagram of a parameter file generation device for an electronic control unit in a vehicle according to an embodiment of the present invention, such as... Figure 3 As shown, the parameter file generation device 300 for the electronic control unit in the vehicle may include: a determination unit 302, a first acquisition unit 304, a second acquisition unit 306, and a third acquisition unit 308.
[0082] The determination unit 302 is used to determine the table file and executable file of the electronic control unit in the vehicle.
[0083] The first acquisition unit 304 is used to acquire a table dictionary converted from a table file and an executable dictionary converted from an executable file.
[0084] The second acquisition unit 306 is used to acquire variable information of the electronic control unit based on the table dictionary and the executable dictionary.
[0085] The third acquisition unit 308 is used to acquire a parameter file that matches the variable information and the header information of the electronic control unit.
[0086] Optionally, the determining unit 302 includes: a first determining module, used to determine the initial table file obtained after developing the application functions of the underlying software of the electronic control unit; and a second determining module, used to fill the calibrated values required by the application functions into the initial table file to obtain the table file.
[0087] Optionally, the determining unit 302 includes: a generation module, used to compile the source code of the application function to generate an executable file.
[0088] Optionally, the first acquisition unit 304 includes: a first calling module, used to call a processing function established in the automation tool to receive the table file and the executable file; and a first acquisition module, used to acquire from the automation tool a table dictionary obtained by the processing function from the table file, and an executable dictionary obtained by the processing function from the executable file.
[0089] Optionally, the second acquisition unit 306 includes: a second invocation module, used to invoke a dictionary data structure established in the automation tool, wherein the dictionary data structure contains key fields; a second acquisition module, used to acquire, based on the key fields in the dictionary data structure, the value fields of the table dictionary obtained by the automation tool traversing the table dictionary, and the value fields of the executable dictionary obtained by the automation tool traversing the executable dictionary; and a third determination module, used to convert the key fields and value fields into a format matched by the parameter file to determine the variable information of the electronic control unit.
[0090] Optionally, the third acquisition unit 308 includes: a fourth determination module, used to determine the header information of the electronic control unit based on the header information character segment of the calibration host computer; and a third acquisition module, used to acquire the parameter file obtained by merging the variable information and header information by the automation tool.
[0091] Optionally, the device further includes: a fourth acquisition unit for acquiring the parsing result obtained after parsing the parameter file; and a calibration unit for calibrating the electronic control unit based on the parsing result.
[0092] In this embodiment of the invention, the determining unit 302 determines the table file and executable file of the electronic control unit (ECU) in the vehicle; the first obtaining unit 304 obtains the table dictionary converted from the table file and the executable dictionary converted from the executable file; the second obtaining unit 306 obtains the variable information of the ECU based on the table dictionary and the executable dictionary; and the third obtaining unit 308 obtains the parameter file that matches the variable information and the header information of the ECU. In other words, this embodiment of the invention determines the table file and executable file of the ECU in the vehicle, inputs the determined table file and executable file into an automation tool, obtains the table dictionary converted from the table file and the executable dictionary converted from the executable file from the automation tool, and obtains the variable information of the ECU based on the table dictionary and the executable dictionary. Furthermore, it obtains the parameter file that matches the variable information and the header information of the ECU, thereby improving the efficiency of generating the ECU parameter file and solving the technical problem of low efficiency in generating ECU parameter files.
[0093] Example 4
[0094] According to an embodiment of the present invention, a vehicle is also provided, which is used to execute the method for generating parameter files of electronic control units in any of the vehicles in Embodiment 1.
[0095] Example 5
[0096] According to an embodiment of the present invention, a computer-readable storage medium is also provided, the storage medium including a stored program, wherein the program executes the method for generating parameter files of electronic control units in a vehicle as described in Embodiment 1.
[0097] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0098] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0099] In the several embodiments provided by this invention, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection can be through some interfaces; the indirect coupling or communication connection of units or modules can be electrical or other forms.
[0100] The units defined as separate components may or may not be physically separate. Similarly, the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0101] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0102] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0103] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for generating parameter files for an electronic control unit in a vehicle, characterized in that, include: Identify the form files and executable files of the electronic control units in the vehicle; Obtain the table dictionary converted from the table file, and obtain the executable dictionary converted from the executable file; Based on the table dictionary and the executable dictionary, the variable information of the electronic control unit is obtained; Obtain a parameter file that matches the variable information and the header information of the electronic control unit; Obtaining the table dictionary converted from the table file and the executable dictionary converted from the executable file includes: calling a processing function established in an automation tool to receive the table file and the executable file; and obtaining, from the automation tool, the table dictionary converted from the table file by the processing function and the executable dictionary converted from the executable file by the processing function. Obtaining the variable information of the electronic control unit based on the table dictionary and the executable dictionary includes: calling a dictionary data structure established in an automation tool, wherein the dictionary data structure contains key fields; based on the key fields in the dictionary data structure, obtaining the value fields of the table dictionary obtained by the automation tool traversing the table dictionary, and obtaining the value fields of the executable dictionary obtained by the automation tool traversing the executable dictionary; converting the key fields and the value fields into a format matched by the parameter file to determine the variable information of the electronic control unit.
2. The method according to claim 1, characterized in that, Determining the form file of the electronic control unit in the vehicle includes: The initial table file obtained after developing the application functions of the underlying software of the electronic control unit; The required calibrated values for the application functions are filled into the initial table file to obtain the table file.
3. The method according to claim 2, characterized in that, Determining the executable file of the electronic control unit in the vehicle includes: The source code of the application function is compiled to generate the executable file.
4. The method according to claim 1, characterized in that, Obtaining the parameter file that matches the variable information and the header information of the electronic control unit includes: Based on the header information character segment of the calibration host computer, the header information of the electronic control unit is determined; The automated tool merges the variable information and the header information to obtain the parameter file.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Obtain the parsing result obtained after parsing the parameter file; Based on the analysis results, the electronic control unit is calibrated.
6. A device for generating parameter files for an electronic control unit in a vehicle, characterized in that, include: The determination unit is used to determine the table files and executable files of the electronic control units in the vehicle; The first acquisition unit is used to acquire a table dictionary converted from the table file and an executable dictionary converted from the executable file; The second acquisition unit is used to acquire variable information of the electronic control unit based on the table dictionary and the executable dictionary; The third acquisition unit is used to acquire a parameter file that matches the variable information and the header information of the electronic control unit; The first acquisition unit is further configured to call a processing function established in the automation tool to receive the table file and the executable file; and to acquire, from the automation tool, the table dictionary obtained by the processing function from the table file, and the executable dictionary obtained by the processing function from the executable file. The second acquisition unit is further configured to invoke a dictionary data structure established in the automation tool, wherein the dictionary data structure contains a key field; based on the key field in the dictionary data structure, acquire the value field of the table dictionary obtained by the automation tool traversing the table dictionary, and acquire the value field of the executable dictionary obtained by the automation tool traversing the executable dictionary; convert the key field and the value field into a format matched by the parameter file, and determine the variable information of the electronic control unit.
7. A vehicle, characterized in that, The vehicle is used to perform the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program performs the method according to any one of claims 1 to 5.