Updating method and system for firmware in electronic control unit of vehicle and electronic equipment
By reading and parsing the target update image file in the host computer and using the plug-in configuration file to determine the information sending method, the complex interaction between ECU manufacturers and OEM manufacturers is solved, and efficient, flexible and safe vehicle electronic system upgrades are achieved through firmware updates.
Patent Information
- Application Number
- CN202411321025.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-07
AI Technical Summary
In the existing technology, electronic control unit (ECU) manufacturers need to interact frequently with OEM manufacturers, which makes the OTA upgrade process complex and tool management difficult. It is difficult to achieve unified management of various OTA upgrade processes and flexibly adapt to the needs of different OEM manufacturers, which increases the complexity of development and testing.
A method and system for updating vehicle electronic control unit firmware are provided. The system reads the target update image file through a host computer, parses the target information format, uses the target configuration file of the plugin to determine the information sending method, and sends the update information to the target electronic control unit according to the target information sending method, thus adapting to the needs of different vehicles.
It improves the data integrity and accuracy of firmware updates, reduces development and maintenance costs, achieves high configurability and universality of the firmware update process, and optimizes the performance and security of vehicle electronic systems.
Smart Images

Figure CN119271241A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of automotive electronic technology, and in particular to a method and system for updating firmware in an electronic control unit of a vehicle, and an electronic device. Background Art
[0002] In the modern automobile industry, with the widespread application of ECUs (Electronic Control Units), communication and collaboration between ECUs have become increasingly important. The CP (Classic Platform) under AUTOSAR (Automotive Open System Architecture) provides a standardized framework for such communication, among which FOTA (Firmware Over-The-Air) technology is used to remotely update ECU firmware.
[0003] At the same time, the existing technology usually requires ECU manufacturers to use the encrypted test scripts provided by the OEM (Original Equipment Manufacturer), which results in the ECU manufacturers frequently interacting with OEM manufacturers when conducting OTA (Over-the-air) functional testing, increasing the complexity and time cost of development and testing. At present, there are large differences in the OTA upgrade processes of different OEM manufacturers, and even the processes developed by the same OEM for different models or at different times are different. However, in the existing technology, ECU manufacturers often need to develop special tools to cope with different upgrade requirements, which makes tool management difficult and difficult to reuse, reducing versatility. Therefore, the existing technology cannot effectively reduce the complexity of development and testing, cannot achieve unified management of multiple OTA upgrade processes, and is difficult to meet the flexible requirements of different OEM manufacturers for OTA host computer functions. Summary of the invention
[0004] The present disclosure provides a method, system and electronic device for updating firmware in an electronic control unit of a vehicle, so as to at least solve the problem in the related art of how to cope with the upgrade requirements of different manufacturers and models, reduce the complexity of development and testing, and improve the reusability and versatility of tools. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a method for updating firmware in an electronic control unit of a vehicle is provided, which can be applied to a host computer of a provider to which the electronic control unit belongs, comprising:
[0006] In response to a start instruction of a target update process for a target firmware in a target electronic control unit, a target update image file corresponding to the target firmware is read; the target update image file represents a file for updating the target firmware; the target update image file corresponds to the target update process;
[0007] Parsing the target update image file according to the target information format corresponding to the target electronic control unit to obtain target update information;
[0008] Determine a target information sending method based on a target configuration file of the plug-in in the host computer; the target configuration file corresponds to a target vehicle to which the target electronic control unit belongs;
[0009] In response to the execution instruction of the target update process, the target update information is sent to the target electronic control unit according to the target information sending method to update the firmware.
[0010] According to a second aspect of an embodiment of the present disclosure, there is provided a system for updating firmware in an electronic control unit of a vehicle, comprising:
[0011] An image file reading module, configured to read a target update image file corresponding to the target firmware in a target electronic control unit in response to a start instruction of a target update process; the target update image file represents a file for updating the target firmware; the target update image file corresponds to the target update process;
[0012] An image file parsing module, used for parsing the target update image file according to the target information format corresponding to the target electronic control unit to obtain target update information;
[0013] A sending mode determination module, used to determine a target information sending mode based on a target configuration file of the plug-in in the host computer; the target configuration file corresponds to a target vehicle to which the target electronic control unit belongs;
[0014] The execution sending module is used to respond to the execution instruction of the target update process and send the target update information to the target electronic control unit according to the target information sending method to update the firmware.
[0015] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method as described in any one of the above-mentioned first aspects.
[0016] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any method described in the first aspect of the embodiment of the present disclosure.
[0017] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, enable a computer to execute any one of the methods described in the first aspect of an embodiment of the present disclosure.
[0018] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0019] After receiving the start instruction of the target update process, the host computer reads the target update image file corresponding to the target firmware and parses the file to obtain the target update information that conforms to the target information format corresponding to the target electronic control unit. This not only ensures the integrity and accuracy of the data required for the firmware update, but also enables the host computer to adapt to the actual needs of different electronic control units, thereby avoiding update errors caused by incompatible files or formats.
[0020] Furthermore, by using the target configuration file of the plug-in in the host computer to determine the information sending method, and setting the target configuration file to correspond to the target vehicle to which the target electronic control unit belongs, the host computer can flexibly adapt to the needs of different vehicles, which not only improves the high configurability and versatility of the firmware update process, but also reduces the cost of development and maintenance;
[0021] Through the method disclosed in the present invention, the host computer of the provider of the electronic control unit of the vehicle sends target update information to the target electronic control unit according to the target information sending method, so that the target electronic control unit can receive and apply the updated firmware version, effectively realize the firmware update, thereby optimizing the performance and safety of the vehicle's electronic system.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0024] Figure 1 It is a schematic diagram of an application environment according to an exemplary embodiment.
[0025] Figure 2The present invention is a flowchart of a method for updating firmware in an electronic control unit of a vehicle according to an exemplary embodiment.
[0026] Figure 3 The present invention is a schematic diagram showing a host computer implementing sending and receiving based on an automobile open system architecture according to an exemplary embodiment.
[0027] Figure 4 The invention is a block diagram of a system for updating firmware in an electronic control unit of a vehicle according to an exemplary embodiment.
[0028] Figure 5 The invention is a block diagram of an electronic device for updating firmware in an electronic control unit of a vehicle according to an exemplary embodiment. DETAILED DESCRIPTION
[0029] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0031] See also Figure 1 , Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment. Figure 1 As shown, the application environment may include a host computer 10 , a switching device 20 and a plurality of electronic control units 30 .
[0032] The host computer 10 can be used to perform management and control tasks of firmware updates. Specifically, the host computer 10 may include components such as a processor, a memory, a plug-in, and a network interface. The processor can be used to perform calculation and control tasks related to firmware updates, the memory can be used to store firmware image files, configuration files, and related log information, the plug-in can be used to load and parse different configuration files to meet the needs of different manufacturers, and the network interface can be used to communicate with the electronic control unit 30 and the switching device 20.
[0033] The adapter 20 can be used to convert the communication signal of the host computer 10 into a format that can be received and processed by the electronic control unit 30. The adapter 20 can include multiple physical interfaces, such as a CAN bus interface, a LIN interface, or a FlexRay interface, which are standard protocols for vehicle communications.
[0034] The electronic control unit 30 may be an ECU in a vehicle, used to control automotive functional modules, such as engine management, transmission control or body electronic systems. The electronic control unit 30 may communicate with the host computer 10 via the adapter 20 to receive and execute firmware update instructions.
[0035] In a possible implementation, the host computer 10 may be an executable program running on a PC (Personal Computer) for performing various operations in the firmware update process. The PC may be a physical platform for executing the host computer software, and communicates with the electronic control unit 30 and the switching device 20 through a network interface. The core functions of the host computer 10, including the parsing of the firmware image file, the loading of the plug-in, and the management of the configuration file, are all implemented in the hardware environment of the PC.
[0036] In a possible implementation, the host computer 10 can load different configuration files through plug-ins to meet the firmware update requirements of different manufacturers or models. The configuration file may include information format, information sending method, update protocol, etc., to flexibly respond to diverse firmware update tasks.
[0037] In one possible implementation, each communication port of the adapter device 20 can be connected to an electronic control unit 30. The host computer 10 can determine the electronic control unit 30 to be updated by selecting the channel number of the adapter device 20, thereby communicating with multiple electronic control units 30 respectively to implement firmware updates for multiple ECUs.
[0038] In a possible implementation, the PC can be connected to the adapter 20 via a USB interface or other standard interface, and the adapter 20 is connected to the electronic control unit 30 via its physical interface (such as a CAN bus interface). After the host computer 10 obtains the target update image file from the local storage of the PC or the server, it can determine the information sending method according to the plug-in, and transmit the target update information to the electronic control unit 30 through the adapter 20 to perform the firmware update.
[0039] In an optional implementation, the adapter 20 can support multiple communication protocols, and the host computer 10 can communicate with different types of ECUs by selecting appropriate communication ports. In addition, the adapter 20 can also integrate a diagnostic function to monitor the signal status during the communication process and improve the security and stability of the firmware update process.
[0040] In actual applications, technicians can use a host computer and a switching device to update the firmware of multiple ECUs, which can efficiently manage and update multiple ECUs, reduce operational complexity, and improve the efficiency of vehicle maintenance and updates. The application environment of the collaborative work of the host computer 10, the switching device 20, and the electronic control unit 30 is not only applicable to multiple vehicle types and manufacturers, but also can improve the flexibility and scalability of the entire firmware update process, while reducing development and maintenance costs.
[0041] In addition, it should be noted that Figure 1 The illustrated example is merely an application environment of the method for updating firmware in an electronic control unit of a vehicle provided by the present disclosure.
[0042] It should be noted that the following figure shows a possible order of steps, which is not actually limited to this order. Some steps can be executed in parallel without relying on each other. The user information (including but not limited to user device information, user personal information, user behavior information, etc.) and data (including but not limited to data for display, training data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0043] Figure 2 FIG. 1 is a flow chart showing a method for updating firmware in an electronic control unit of a vehicle according to an exemplary embodiment. Figure 2 As shown, the following steps may be included.
[0044] In step S201, in response to a start instruction of a target update process for a target firmware in a target electronic control unit, a target update image file corresponding to the target firmware is read.
[0045] In the embodiments of this specification, the target electronic control unit may be an ECU in a vehicle, which is used to manage functional modules in the vehicle such as engine control, transmission management, BCM (Body Control Module) or infotainment system, etc. The target electronic control unit is the object of firmware update.
[0046] The target firmware can be the operating program or control software installed in the target electronic control unit. The target firmware is updated to fix software errors, improve performance, or add new functions.
[0047] The target update process may refer to the entire firmware update process, from issuing an update instruction to finally confirming that the update is complete.
[0048] The target update image file may represent a file for updating the target firmware, corresponding to the target update process. The target update image file may be a file stored in a host computer or other storage device, containing update data to be written to the target electronic control unit. The file is usually stored in a binary format or other format, and contains the complete update content of the target firmware, such as new program code, configuration data, and version information.
[0049] In one possible implementation, in response to the update instruction of the target firmware in the target electronic control unit, the host computer can retrieve the target update image file from the local storage or remote server. The image file may be digitally signed or encrypted to protect the integrity and security of the update data. After retrieving the target update image file, the host computer can parse the file and extract the update data related to the target update process, such as the address, length, checksum, etc. of the data block.
[0050] In a possible implementation, reading the target update image file may include multiple steps, such as file format verification, version comparison, and data decompression.
[0051] In an optional implementation, the host computer may first confirm the current firmware version of the target electronic control unit before reading the target update image file, and determine whether an update is required.
[0052] In practical applications, by reading and parsing the target update image file, the target electronic control unit can receive complete and correct data during the update process, reducing update failures caused by file errors or data corruption, thereby improving the reliability and success rate of firmware updates.
[0053] In step S203, the target update image file is parsed according to the target information format corresponding to the target electronic control unit to obtain the target update information.
[0054] In the embodiments of this specification, the target information format may refer to the firmware data format of the target electronic control unit, which may be determined by the communication protocol of the manufacturer of the target electronic control unit. The target information format may include Intel HEX format, S19 format, etc., which are used to represent the binary content and address mapping information of the firmware.
[0055] The target update information may be data parsed from the target update image file, and is the firmware content that needs to be written into the target electronic control unit, and may include the firmware code, configuration information, checksum, and version information of the target electronic control unit.
[0056] In a possible implementation, after receiving the start instruction of the target update process, the host computer may read the target update image file from the storage device and parse it according to the target information format corresponding to the target electronic control unit.
[0057] In an optional implementation, the parsing of the target update information may further include a version verification step. When parsing the target update image file, the host computer may first check the current firmware version of the target electronic control unit and compare it with the version information in the target update image file. If the version information meets the requirements, the parsing continues; otherwise, the update process may be terminated.
[0058] In an optional implementation, the parsing process may also include data integrity verification, such as calculating and verifying a checksum, so that data corruption does not occur during the update process.
[0059] In practical applications, by parsing the target update image file to obtain the target update information, the host computer can reduce the risk of update failure due to data errors or format incompatibility, thereby improving the reliability and success rate of the firmware update process.
[0060] In a possible implementation manner, a target upgrade agreement corresponding to a provider to which the target vehicle belongs is obtained; and a target configuration file matching the target upgrade agreement is determined.
[0061] In the embodiment of this specification, the provider of the target vehicle may refer to the vehicle manufacturer that manufactures the target electronic control unit. The vehicle manufacturer will define the standards and protocols for updating the firmware of the vehicle electronic control unit.
[0062] The target upgrade protocol can be a technical protocol developed by the provider of the target vehicle for updating the firmware of the vehicle's electronic control unit. The protocol specifies the specific steps, data format, communication specifications, and safety certification requirements that must be followed during the firmware update process. Different vehicle manufacturers may have different upgrade protocols, and the same manufacturer may also use different upgrade protocols in different models or versions of vehicles.
[0063] The target configuration file can be a file used in the host computer to configure and control the firmware update process, corresponding to the target vehicle to which the target electronic control unit belongs. This configuration file is based on the target upgrade protocol and is loaded into the host computer in the form of a plug-in. The target configuration file can define how to handle target update information, how to communicate with the target electronic control unit, etc. The flexibility of the target configuration file allows the host computer to adapt to the firmware update requirements of different manufacturers or models.
[0064] In one possible implementation, the host computer may first obtain an upgrade protocol corresponding to the target vehicle, and may select and load a configuration file that matches the target upgrade protocol, which may include communication parameters, data format, encryption method, and other related configurations.
[0065] In a possible implementation, the host computer may automatically match and load a target configuration file suitable for the vehicle by reading identification information of the target vehicle, such as VIN (Vehicle Identification Number), model code, etc., before the firmware is updated.
[0066] In an optional implementation, the target configuration file may be loaded and determined dynamically. The host computer may adjust the configuration file to meet different firmware update requirements.
[0067] In practical applications, by obtaining the target upgrade protocol of the provider to which the target vehicle belongs and matching the corresponding configuration file, the host computer can reduce update failures caused by protocol incompatibility or configuration errors, and improve the reliability and success rate of firmware updates.
[0068] In step S205, the target information sending method is determined based on the target configuration file of the plug-in in the host computer.
[0069] In the embodiment of this specification, the plug-in can be a modular component in the host computer, which is used to load and parse the target configuration file. The plug-in can determine the key parameters and execution logic in the firmware update process by loading the corresponding target configuration file.
[0070] The target information sending method may be a specific strategy for sending the target update information from the host computer to the target electronic control unit during the firmware update process. This strategy may include data segmentation, encryption method, verification method, and transmission order.
[0071] In one possible implementation, the host computer first loads a plug-in that matches the target vehicle, and determines the target information sending method based on the target configuration file in the plug-in. For example, if the electronic control unit of the target vehicle requires a specific data segmentation strategy to be used during the firmware update process, the host computer can read the relevant parameters in the target configuration file through the plug-in and generate a suitable target information sending method based on these parameters.
[0072] In a possible implementation, a target code adapted to a target update process is obtained according to a target configuration file; and a target information sending method is determined based on the target code.
[0073] In the embodiments of this specification, the target code may be a code fragment or instruction set generated according to the target configuration file for specifically executing the target firmware update process. The target code may include implementation details for data transmission, error handling, verification, decryption and other operations.
[0074] In one possible implementation, the target code can be automatically generated based on the compilation stage. The parser of the host computer will read the target configuration file and generate code suitable for the target update process according to the rules and instructions in the file. Specifically, the parser will automatically generate the corresponding interface and implementation code based on the content in the configuration file, such as Sid (Service Identifier), data message format, replacement characters, etc. in the Dcm (Diagnostic Communication Manager) protocol. The generated target code will participate in the compilation of the host computer software and become part of the host computer executable file. In this way, even if the host computer software is distributed to third-party users, the internally generated target code is still protected and will not disclose the specific implementation details in the configuration file.
[0075] In another possible implementation, during the execution of the host computer, the target code is dynamically generated and loaded through the configuration file. In this process, the host computer can adjust various operations in the firmware update process at runtime according to the currently loaded target configuration file, such as the data transmission method, error handling strategy, version verification logic, etc. This method is suitable for scenarios where the host computer behavior needs to be dynamically adjusted according to different firmware update requirements at runtime.
[0076] In another possible implementation, an interface can be reserved in the target configuration file, and the target code can be manually written according to the specific OTA protocol to implement specific logic. This is usually used for special needs of some OEM manufacturers, such as unlocking algorithms or specific security authentication processes, and integrated into the firmware update process of the host computer. By manually writing code, the host computer can handle more complex or customized requirements, further improving the flexibility and adaptability of the system.
[0077] In an optional implementation, the target code may instruct the host computer to calculate a check code before sending each data packet, and to verify the correctness of the check code after receiving the response data.
[0078] In an optional implementation, the target code may also include a specific encryption and decryption algorithm for protecting the security of data during the firmware update process. During data transmission, the target code will instruct the host computer to encrypt the data before sending it and decrypt it after receiving the response data to ensure the integrity and confidentiality of the data.
[0079] In actual applications, by generating, loading or manually writing target code according to the target configuration file, the host computer can flexibly respond to the firmware update requirements of different vehicle manufacturers. This design not only improves the automation and efficiency of the firmware update process, but also strengthens the security and reliability of data, reduces the risk of update failures caused by configuration errors or protocol incompatibility, and also allows the host computer to handle more complex or customized firmware update tasks.
[0080] In step S207, in response to the execution instruction of the target update process, the target update information is sent to the target electronic control unit according to the target information sending method to update the firmware.
[0081] In a possible implementation, after receiving the execution instruction of the target update process, the host computer checks whether the target information sending method has been correctly configured, and then gradually sends the target update information to the target electronic control unit according to the target information sending method.
[0082] In a possible implementation, the target information sending method may be based on the target code previously generated from the target configuration file. The host computer sends the target update information to the target electronic control unit according to the steps defined in these codes.
[0083] In actual applications, by responding to the execution instructions of the target update process and transmitting data in accordance with the predetermined target information sending method, the target electronic control unit can correctly receive and apply the new firmware version, thereby minimizing errors and risks in data transmission and improving the update success rate and safety of the vehicle electronic system.
[0084] In one possible implementation, the host computer communicates with the target electronic control unit via a target switching device; the target output port of the target switching device is connected to the target electronic control unit; a target software development kit is configured to support communication between the host computer and the target switching device; the target software development kit corresponds to the target information format; and the target channel number is determined based on the target output port of the target switching device.
[0085] In the embodiments of this specification, the target switching device can be a hardware device for connecting the host computer and the target electronic control unit. Specifically, the target switching device can be a CAN device or a CAN bus analyzer, etc. The device can convert the communication signal of the host computer into a differential signal format that can be understood and processed by the target electronic control unit based on the transmission mode of differential signals. The target switching device can support multiple brands and models, such as Vector, Kvaser, ZLG, etc.
[0086] The target output port may be a physical interface on the target switching device, which is used to connect to the target electronic control unit. Each target output port may correspond to a communication channel, through which the target switching device sends the data transmitted by the host computer to the target electronic control unit. The target output port may include a variety of standard interfaces, such as CAN bus interface, LIN interface, FlexRay interface, etc.
[0087] The target software development kit (SDK) can be a software toolkit that provides communication support between the host computer and the target switching device, corresponding to the target information format. The toolkit includes an API interface, a driver, a communication protocol stack, etc., so that the host computer can exchange data with the target electronic control unit through the target switching device.
[0088] The target channel number may be a number used to identify a target output port on the target switching device. Before the host computer communicates with the target electronic control unit, it needs to determine a communication path according to the target channel number to transmit to the corresponding electronic control unit.
[0089] In a possible implementation, after configuring the target software development kit of the target switching device, the host computer can select the target output port according to the vehicle and then determine the corresponding target channel number. Through correct channel configuration, communication errors and data transmission failures can be effectively avoided.
[0090] In actual applications, by configuring a target software development kit that supports communication between the host computer and the target adapter device and correctly setting the target channel number, the host computer can send the firmware update data to the target electronic control unit through the correct communication path. This can improve the reliability and efficiency of the firmware update process and reduce the risk of update failure due to communication configuration errors.
[0091] In a possible implementation, according to the target information sending method, the target update information is sent to the target electronic control unit through the target channel corresponding to the target channel number to update the firmware.
[0092] In the embodiments of this specification, the target channel is used to transmit data between the host computer and the target electronic control unit, and corresponds to the target channel number.
[0093] In a possible implementation, during the firmware update process, the host computer first confirms whether the target channel number currently in use matches the communication requirement of the target electronic control unit. Once the match is successful, the host computer will gradually send the target update information to the target electronic control unit through the channel corresponding to the target channel number according to the target information sending method.
[0094] In a possible implementation, the target switching device may be connected to multiple electronic control units, each of which communicates with the host computer through a different target channel number. The host computer selects the correct target channel number so that the data transmission during the firmware update process is carried out for the corresponding target electronic control unit, thereby avoiding data confusion or erroneous transmission.
[0095] In practical applications, by configuring the target channel number, the host computer can transmit the update information to the target electronic control unit through the correct communication channel, and it also allows the host computer to communicate with multiple electronic control units at the same time, improving the update efficiency.
[0096] In one possible implementation, a target information sending method includes an information sending order and a target sending unit length; dividing the target update information into a plurality of update sub-information according to the target sending unit length; sending a first update sub-information to a target electronic control unit based on the information sending order; controlling the target electronic control unit to write the first update sub-information into a corresponding storage area of the target electronic control unit; receiving response data from the target electronic control unit; and sending a second update sub-information to the target electronic control unit when the response data indicates that the first update sub-data is successfully written, until the target update information is sent.
[0097] In the embodiments of this specification, the information sending order may refer to the order in which the host computer gradually sends the target update information to the target electronic control unit during the firmware update process.
[0098] The target sending unit length may refer to the size of the target update information sent in one data transmission.
[0099] The update sub-information may refer to a plurality of data blocks obtained by dividing the complete target update information according to the target transmission unit length. Each update sub-information includes a part of the target update information, and all update sub-information together constitute the complete target update information.
[0100] The first update sub-information belongs to a plurality of update sub-information and can be the first data block cut from the target update information in the information sending order. The first update sub-information usually includes the starting data of the target firmware and information for verification and security verification.
[0101] The response data may be feedback information returned to the host computer by the target electronic control unit after receiving and processing each update sub-information. The response data may indicate whether the first update sub-information is successfully written.
[0102] The second update sub-information may be a second data block adjacent to the first update sub-information in the information transmission sequence and located after the first update sub-information.
[0103] In one possible implementation, after receiving the execution instruction of the target update process, the host computer will gradually send the target update information to the target electronic control unit according to the information sending order and the target sending unit length. In this process, the host computer will make each step of the data transmission comply with the upgrade protocol and security requirements of the provider to which the target vehicle belongs according to the instructions in the target code. For example, the target electronic control unit may only support the transmission of data packets of a specific length, so the target code will instruct the host computer to segment the target update information according to these restrictions.
[0104] In a possible implementation, after starting the firmware update process, the host computer divides the target update information into multiple update sub-information according to the target sending unit length. Each update sub-information is sent to the target electronic control unit in sequence according to a predetermined sending order. After sending each update sub-information, the host computer will wait for the response data returned by the target electronic control unit to confirm whether the data is successfully written into the storage area of the target electronic control unit. If the response data indicates that the writing is successful, the host computer will continue to send the next update sub-information until all the update sub-information are sent, thereby completing the entire firmware update process.
[0105] In a possible implementation, after receiving each update sub-information, the target electronic control unit will first perform an integrity check on the data block, such as calculating a checksum or verifying a digital signature, so that the data will not be tampered with during transmission. If the check passes, the target electronic control unit will write the data block into its internal storage area and return response data to the host computer to confirm that the data is successfully written. If the check fails or an error occurs in the write, the target electronic control unit will return an error code, and the host computer will decide whether to resend the data block or take other error handling measures based on the error code.
[0106] In a possible implementation, each update sub-information is confirmed by response data after being sent. The second update sub-information and subsequent update sub-information are sent in sequence according to the information sending order after the host computer receives the response data of the target electronic control unit until the target update information is sent.
[0107] In an optional implementation, the target information sending method may also include an exception handling mechanism. For example, if a data packet is lost or a transmission error occurs during the firmware update process, the host computer may automatically perform a retransmission operation or trigger an error handling procedure according to the instructions in the target configuration file.
[0108] In practical applications, by determining a reasonable method for sending target information, not only can the update failure caused by transmission errors be reduced, but it can also adapt to the communication requirements of different vehicle manufacturers, thereby improving the versatility and flexibility of the system.
[0109] In one possible implementation, the host computer is configured with an automotive open system architecture, which includes a first data processing layer and a second data processing layer; in response to the sending of a first update sub-information, the first data processing layer is called to generate a first update request, and the first update request and the first update sub-information are sent to the second data processing layer; in response to the first update request, the second data processing layer is called to encapsulate the first update sub-information to obtain a first processed update sub-information, and generate a second update request; the second update request and the first processed update sub-information are sent to the target electronic control unit.
[0110] In the embodiments of this specification, the automotive open system architecture may refer to a communication and data processing architecture designed based on the AUTOSAR framework. The architecture supports a hierarchical communication model to facilitate the implementation of standardized communication and data processing processes in automotive electronic control systems.
[0111] In the embodiments of this specification, the first data processing layer may correspond to the Dcm Task (Diagnostic Communication Manager Task) in AUTOSAR. The Dcm Task is used to process the diagnostic communication requirements of high-level applications, such as generating diagnostic requests, managing diagnostic sessions, and processing the execution logic of diagnostic services.
[0112] The second data processing layer may correspond to the UDS Task (Unified Diagnostic Services Task) in AUTOSAR. The UDS Task is responsible for further processing the high-level data request from the Dcm Task and converting it into a format suitable for the low-level communication protocol (such as CAN). The first update request may be a command generated by the first data processing layer to request data encapsulation and transmission.
[0113] The first processing update sub-information may be an update data packet encapsulated by the second data processing layer. The encapsulation process may include operations such as data segmentation, verification code generation, and data encryption.
[0114] The second update request may be a command generated by the second data processing layer and used to send the first processing update sub-information to the target electronic control unit.
[0115] In a possible implementation, the first data processing layer receives the first update sub-information from the upper computer and generates a corresponding first update request. After receiving the first update request from the first data processing layer, the second data processing layer encapsulates the first update sub-information and converts the high-level data into a low-level communication format suitable for the target electronic control unit to obtain the first processed update sub-information. Subsequently, the second data processing layer generates a second update request, which is transmitted to the target electronic control unit via the lower-level communication protocol.
[0116] In one possible implementation, the host computer is configured with an automotive open system architecture, which includes a data receiving layer, a first data processing layer and a second data processing layer; the data receiving layer is called to receive first response data from a target electronic control unit, and the first response data is forwarded to the second data processing layer; in response to the first response data, the second data processing layer is called to generate second response data; and the first data processing layer is called to receive the second response data.
[0117] In the embodiments of this specification, the data receiving layer may correspond to the Rcv Task (Receive Task, receiving thread) in the AUTOSAR architecture. The Rcv Task is used to receive raw data from the target electronic control unit and pass it to a higher-level processing module of the host computer.
[0118] The first response data may be preliminary feedback data returned by the target electronic control unit to the host computer after receiving the first update sub-information. The first response data may include the processing result of the target electronic control unit on the received data packet, such as confirming whether the data packet has been successfully written, or the integrity check result of the data packet.
[0119] The second response data may be feedback data generated by the second data processing layer and used for high-level applications of the host computer. For example, the second response data may include the progress of the firmware update, or information provided to the host computer for subsequent decision-making.
[0120] In a possible implementation, the data receiving layer first receives the first response data from the target electronic control unit and forwards it to the second data processing layer. After receiving the first response data, the second data processing layer may process it and generate second response data. These data are then passed to the first data processing layer, which receives and performs further operations based on the data, such as continuing to transmit update sub-information or adjusting the update strategy.
[0121] In a possible implementation, the second data processing layer may further process the first response data when generating the second response data. The processing at this level may include rechecking and analyzing the data or generating new instructions according to the update progress.
[0122] For example, Figure 3 For example, Figure 3 This is a schematic diagram of a host computer implementing sending and receiving based on an automotive open system architecture according to an exemplary embodiment. Dcm Task generates a Dcm request based on the requirements of firmware update, and DcmTask sends the request to UDS Task. After receiving the Dcm request from Dcm Task, UDS Task converts the request into a UDS request message suitable for the low-level communication protocol.
[0123] Furthermore, after the UDS Task completes the message encapsulation, it sends the UDS request message to the Ecu. After receiving the UDS request message, the Ecu will perform the corresponding operation according to the content of the message, and then generate a UDS response. The UDS response contains the processing result of the Ecu on the request, such as whether the data is successfully written or the diagnostic instruction is executed. The Ecu sends the generated UDS response back to the host computer through the communication channel.
[0124] In addition, the Rcv Task of the host computer is responsible for receiving the UDS response from Ecu. After receiving the UDS response, the Rcv Task will perform preliminary verification and analysis. After completing the preliminary processing, the Rcv Task forwards the UDS response to the UDS Task. After receiving the UDS response from the Rcv Task, the UDSTask will further process the response. After the analysis is completed, the UDS Task sends the processed response data back to the Dcm Task. After receiving the response data from the UDS Task, the Dcm Task will check the response result to confirm whether the Ecu has successfully executed the requested operation. If the response result shows that the operation is successful, the Dcm Task will continue to process the next firmware update operation; if the response result shows that the operation failed, the Dcm Task may trigger the corresponding error handling process.
[0125] In addition, Dcm Task will also record the entire request and response process in the log module to facilitate subsequent troubleshooting and analysis.
[0126] In actual applications, through the layered processing mechanism in the automotive open system architecture, the host computer can effectively convert the firmware update information from the high-level application into the format required by the low-level communication protocol, so that the update data can be accurately and securely transmitted to the target electronic control unit. Such an architectural design not only improves the security and reliability of the firmware update process, but also simplifies the handling of communication protocol differences between different vehicle manufacturers.
[0127] Figure 4 FIG. 1 is a block diagram of a firmware update system in an electronic control unit of a vehicle according to an exemplary embodiment. Figure 4 , the system may include:
[0128] The image file reading module 401 is used to respond to the start instruction of the target update process of the target firmware in the target electronic control unit, and read the target update image file corresponding to the target firmware; the target update image file represents the file for updating the target firmware; the target update image file corresponds to the target update process;
[0129] The image file parsing module 403 is used to parse the target update image file according to the target information format corresponding to the target electronic control unit to obtain the target update information;
[0130] The sending mode determination module 405 is used to determine the target information sending mode based on the target configuration file of the plug-in in the host computer; the target configuration file corresponds to the target vehicle to which the target electronic control unit belongs;
[0131] The execution sending module 407 is used to respond to the execution instruction of the target update process and send the target update information to the target electronic control unit according to the target information sending method to update the firmware.
[0132] In a possible implementation, the method may further include:
[0133] An upgrade agreement acquisition module is used to acquire a target upgrade agreement corresponding to the provider to which the target vehicle belongs;
[0134] A configuration file determination module, used to determine a target configuration file matching a target upgrade protocol;
[0135] The sending mode determination module 405 includes:
[0136] A code obtaining unit, used for obtaining a target code adapted to a target update process according to a target configuration file;
[0137] The code determining sending mode unit is used to determine the target information sending mode based on the target code.
[0138] In a possible implementation, the target information sending mode includes an information sending order and a target sending unit length; executing the sending module 407 includes:
[0139] An update information segmentation unit, used for segmenting the target update information into a plurality of update sub-information according to the target transmission unit length;
[0140] A sub-information sending unit, configured to send a first update sub-information to a target electronic control unit based on an information sending sequence; the first update sub-information belongs to a plurality of update sub-information;
[0141] a storage area writing unit, used to control the target electronic control unit to write the first update sub-information into a corresponding storage area of the target electronic control unit;
[0142] A response data receiving unit, used to receive response data from a target electronic control unit; the response data indicates whether the first update sub-information is successfully written;
[0143] A continue sending determination unit is used to continue sending a second updated sub-information to a target electronic control unit when the response data indicates that the first updated sub-data is successfully written, until the target updated sub-information is sent; the second updated sub-information is adjacent to the first updated sub-information in the information sending sequence and is located after the first updated sub-information.
[0144] In a possible implementation, the host computer is configured with an automobile open system architecture, which includes a first data processing layer and a second data processing layer; the sub-information sending unit includes:
[0145] a first sending unit, configured to call the first data processing layer in response to the sending of the first update sub-information, generate a first update request, and send the first update request and the first update sub-information to the second data processing layer;
[0146] The first processing unit is used to call the second data processing layer in response to the first update request, encapsulate the first update sub-information, obtain the first processed update sub-information, and generate a second update request;
[0147] The second sending unit is used to send the second update request and the first processing update sub-information to the target electronic control unit.
[0148] In a possible implementation, the host computer is configured with an automotive open system architecture, which includes a data receiving layer, a first data processing layer, and a second data processing layer; the response data receiving unit includes:
[0149] A first receiving unit, used for calling the data receiving layer, receiving first response data from the target electronic control unit, and forwarding the first response data to the second data processing layer;
[0150] A second response data generating unit, configured to call the second data processing layer in response to the first response data to generate second response data;
[0151] The second receiving unit is used to call the first data processing layer to receive second response data.
[0152] In a possible implementation, the host computer communicates with the target electronic control unit via the target switching device; the target output port of the target switching device is connected to the target electronic control unit;
[0153] A toolkit configuration unit is used to configure a target software development toolkit that supports communication between the host computer and the target switching device; the target software development toolkit corresponds to the target information format;
[0154] A channel number determination unit, used to determine a target channel number based on a target output port of a target switching device;
[0155] Execute the sending module 407, including:
[0156] The target channel sending unit is used to send target update information to the target electronic control unit through the target channel corresponding to the target channel number in accordance with the target information sending mode to update the firmware.
[0157] Regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0158] Figure 5 1 is a block diagram of an electronic device for updating firmware in an electronic control unit of a vehicle according to an exemplary embodiment. The electronic device may be a PC, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for updating firmware in an electronic control unit of a vehicle is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0159] Those skilled in the art will understand that Figure 5 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0160] In an exemplary embodiment, an electronic device is also provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method for updating firmware in an electronic control unit of a vehicle as in the embodiment of the present disclosure.
[0161] In an exemplary embodiment, a computer-readable storage medium is also provided, and when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for updating the firmware in the electronic control unit of the vehicle in the embodiment of the present disclosure. The computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0162] In an exemplary embodiment, a computer program product containing instructions is also provided. When the computer program product is run on a computer, the computer is caused to execute the method for updating firmware in an electronic control unit of a vehicle in the embodiment of the present disclosure.
[0163] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0164] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0165] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for updating firmware in an electronic control unit of a vehicle, characterized in that: Applied to a host computer of a provider to which the electronic control unit belongs, the method comprises: In response to a start instruction of a target update process for a target firmware in a target electronic control unit, a target update image file corresponding to the target firmware is read; the target update image file represents a file for updating the target firmware; the target update image file corresponds to the target update process; Parsing the target update image file according to the target information format corresponding to the target electronic control unit to obtain target update information; Determine a target information sending method based on a target configuration file of the plug-in in the host computer; the target configuration file corresponds to a target vehicle to which the target electronic control unit belongs; In response to the execution instruction of the target update process, the target update information is sent to the target electronic control unit according to the target information sending method to update the firmware.
2. The method according to claim 1, characterized in that Before the step of determining the target information sending method based on the target configuration file of the plug-in in the host computer, the method further includes: Obtain the target upgrade agreement corresponding to the provider of the target vehicle; Determining the target configuration file that matches the target upgrade protocol; The determining of the target information sending method based on the target configuration file of the plug-in in the host computer includes: According to the target configuration file, obtaining the target code adapted to the target update process; Based on the target code, a method for sending the target information is determined.
3. The method according to claim 1, characterized in that The target information sending method includes an information sending order and a target sending unit length; and sending the target update information to the target electronic control unit according to the target information sending method includes: Divide the target update information into multiple update sub-information according to the target sending unit length; Based on the information sending order, sending a first update sub-information to the target electronic control unit; the first update sub-information belongs to the multiple update sub-information; Controlling the target electronic control unit to write the first update sub-information into a corresponding storage area of the target electronic control unit; receiving response data from the target electronic control unit; the response data indicating whether the first update sub-information is successfully written; When the response data indicates that the first update sub-data is successfully written, a second update sub-information is sent to the target electronic control unit until the target update information is sent; the second update sub-information is adjacent to the first update sub-information in the information sending order and is located after the first update sub-information.
4. The method according to claim 3, characterized in that The host computer is configured with an automotive open system architecture, and the automotive open system architecture includes a first data processing layer and a second data processing layer; the sending of the first update sub-information to the target electronic control unit includes: In response to sending the first update sub-information, calling the first data processing layer, generating a first update request, and sending the first update request and the first update sub-information to the second data processing layer; In response to the first update request, calling the second data processing layer, encapsulating the first update sub-information, obtaining first processing update sub-information, and generating a second update request; The second update request and the first processing update sub-information are sent to the target electronic control unit.
5. The method according to claim 3, characterized in that: The host computer is configured with an automobile open system architecture, which includes a data receiving layer, a first data processing layer and a second data processing layer; the response data includes first response data and second response data; The receiving of response data from the target electronic control unit comprises: calling the data receiving layer to receive the first response data from the target electronic control unit, and forwarding the first response data to the second data processing layer; In response to the first response data, calling the second data processing layer to generate second response data; The first data processing layer is called to receive the second response data.
6. The method according to claim 1, characterized in that The host computer communicates with the target electronic control unit via the target switching device; The target output port of the target switching device is connected to the target electronic control unit; the method further comprises: Configuring a target software development kit that supports communication between the host computer and the target switching device; the target software development kit corresponds to the target information format; Determining a target channel number based on a target output port of the target switching device; The step of sending the target update information to the target electronic control unit according to the target information sending method to update the firmware includes: According to the target information sending method, the target update information is sent to the target electronic control unit through the target channel corresponding to the target channel number to update the firmware.
7. A system for updating firmware in an electronic control unit of a vehicle, characterized in that: include: An image file reading module, configured to read a target update image file corresponding to the target firmware in a target electronic control unit in response to a start instruction of a target update process of the target firmware; The target update image file represents a file for updating the target firmware; The target update image file corresponds to the target update process; An image file parsing module, used for parsing the target update image file according to the target information format corresponding to the target electronic control unit to obtain target update information; A sending mode determination module, used to determine a target information sending mode based on a target configuration file of the plug-in in the host computer; The target configuration file corresponds to a target vehicle to which the target electronic control unit belongs; The execution sending module is used to respond to the execution instruction of the target update process and send the target update information to the target electronic control unit according to the target information sending method to update the firmware.
8. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method for updating firmware in an electronic control unit of a vehicle according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for updating firmware in an electronic control unit of a vehicle as claimed in any one of claims 1 to 6.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method for updating firmware in an electronic control unit of a vehicle according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Firmware management method and device, equipment, storage medium and program product
CN120780296A