Software updating method, electronic control unit and system comprising electronic control unit
By adopting the structure of the main controller and multiple auxiliary controllers in the electronic control unit, the software update process is simplified, the problems of complex and cost in the prior art are solved, and efficient and synchronous software update effect is achieved.
Patent Information
- Application Number
- CN202411959555.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-05-02
AI Technical Summary
In the prior art, when updating multiple controller software in the electronic control unit, each controller needs to have an independent software download channel, and a complex public communication bus and internal channel protocol are required, resulting in high costs and complex update processes.
Using the structure of a main controller and multiple auxiliary controllers, in the software update mode, the main controller directs the auxiliary controller to receive external data in turn for software updates, simplifying the update process and sharing communication resources.
This simplifies the software update process, reduces costs, and ensures that the operating modes of each controller are kept in sync, avoiding unnecessary alarm functions.
Smart Images

Figure CN119917134A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle control, and in particular to a method for performing software update on a controller in an electronic control unit, an electronic control unit, and a system including the electronic control unit. Background Art
[0002] With the development and application of artificial intelligence technology, vehicles such as cars are gradually equipped with more and more powerful intelligent driving functions. Correspondingly, the electronic systems on vehicles usually include multiple electronic control units (ECUs). Each electronic control unit includes one or more controllers (MCUs), which are written with corresponding software. The software program in the controller can be responsible for implementing control algorithms, data processing, communication protocol processing, real-time monitoring and control, etc. It is a key part of the normal operation of the electronic control unit and the safe operation of the vehicle.
[0003] In practice, the software programs of the controllers in the electronic control unit usually need to be updated, which can fix software defects, improve performance, add new functions or improve safety. For the update of software programs in an electronic control unit including multiple controllers, existing solutions usually require each controller to have its own separate software download channel, or require a custom protocol between the public communication bus and the internal channel for each controller, which will also require more controller addresses to be configured on the host computer, more public communication buses to be set up for a single electronic control unit, and high bandwidth internal channels. The cost of software updates is high and the software update process is also complicated. Summary of the invention
[0004] An embodiment of the present application provides a method for performing software update on a controller in an electronic control unit, wherein the electronic control unit includes a main controller and M auxiliary controllers, wherein the M auxiliary controllers are controlled by the main controller during software update, and the method includes: in response to the main controller receiving a command to enter a software update mode, the main controller instructing the M auxiliary controllers to enter a software update mode; the main controller and the M auxiliary controllers sequentially receiving corresponding external data in the software update mode to update corresponding software in the main controller and the M auxiliary controllers, respectively; and in response to the main controller receiving a command to exit the software update mode, the main controller and the M auxiliary controllers exit the software update mode, wherein M is an integer greater than or equal to 1.
[0005] In some embodiments, before the main controller receives a command to enter a software update mode, the method further includes: the main controller receives a software update preparation command to prepare the main controller and the M auxiliary controllers to enter a software update mode, the software update preparation command at least including a command to shut down protocol data unit (PDU) communication between each of the multiple controllers; the main controller disables the M auxiliary controllers from responding to external signals from a host computer; and in response to the main controller and the M auxiliary controllers being ready to enter a software update mode, the main controller generates a signal indicating that the main controller and the M auxiliary controllers are ready to enter a software update mode.
[0006] In some embodiments, the main controller and the M auxiliary controllers receive corresponding external data in sequence in the software update mode to update the corresponding software in the main controller and the M auxiliary controllers respectively, including: in response to the main controller completing the update of the corresponding software, the main controller stops its own response function to the external signal, and turns on the response function of the Kth auxiliary controller among the M auxiliary controllers to the external signal, so that the Kth auxiliary controller receives the corresponding external data; in response to the Kth auxiliary controller among the M auxiliary controllers completing the update of the corresponding software, the main controller disables the response function of the Kth auxiliary controller to the external signal, and turns on the response function of the K+1th auxiliary controller among the M auxiliary controllers to the external signal, so that the K+1th auxiliary controller receives the corresponding external data, where K is an integer greater than or equal to 1 and less than or equal to M.
[0007] In some embodiments, the method includes: in response to the Mth auxiliary controller completing the update of corresponding software, the main controller receives the command to exit the software update mode.
[0008] In some embodiments, the external data includes software update data and corresponding storage address information for the main controller and the corresponding controllers among the M auxiliary controllers, and the main controller and the M auxiliary controllers confirm whether to receive the corresponding external data based on the storage address information.
[0009] In some embodiments, the method further includes: in response to the main controller losing control of the M auxiliary controllers during the software update, one of the M auxiliary controllers serves as a backup main controller for controlling the main controller and the remaining auxiliary controllers.
[0010] In some embodiments, in response to the main controller receiving a command to exit the software update mode, the main controller and the M auxiliary controllers exit the software update mode, including: in response to the main controller receiving a command to exit the software update mode, the main controller and the M auxiliary controllers are reset.
[0011] In some embodiments, the method also includes: after the main controller and the M auxiliary controllers are reset, the main controller receives a software update completion command so that the main controller and the M auxiliary controllers are ready to enter a normal working mode, and the software update completion command includes at least a command to enable protocol data unit communication between each of the multiple controllers.
[0012] Another embodiment of the present application provides a method for updating software in a controller in an electronic control unit, wherein the electronic control unit includes a main controller and M auxiliary controllers, wherein the M auxiliary controllers are controlled by the main controller during software updating, and the method includes: a host computer sends a command to the main controller to instruct the main controller to enter a software update mode, and the main controller instructs the M auxiliary controllers to enter the software update mode; the host computer sends corresponding external data to the main controller and the M auxiliary controllers in sequence, respectively, to update the corresponding software in the main controller and the M auxiliary controllers, respectively; and in response to the host computer receiving a signal from the Mth auxiliary controller among the M auxiliary controllers indicating that the Mth auxiliary controller has completed the software update, the host computer sends a command to exit the software update mode to the main controller and the M auxiliary controllers, wherein M is an integer greater than or equal to 1.
[0013] Another embodiment of the present application provides an electronic control unit, including a main controller and M auxiliary controllers, the main controller including a software update main module, each of the M auxiliary controllers including a software update auxiliary module, the software update auxiliary module being configured to be controlled by the software update main module, the software update main module and the software update auxiliary module being configured to control the main controller and the M auxiliary controllers to receive corresponding external data in sequence in a software update mode, so as to update the corresponding software in the main controller and the M auxiliary controllers respectively, wherein the software update main module is further configured to: in response to the main controller receiving a command to enter the software update mode, instruct the M auxiliary controllers to enter the software update mode through the software update auxiliary module; in response to the main controller receiving a command to exit the software update mode, instruct the M auxiliary controllers to exit the software update mode through the software update auxiliary module, wherein M is an integer greater than or equal to 1.
[0014] Another embodiment of the present application provides a system, including a host computer and the electronic control unit described in the aforementioned embodiment, wherein the host computer is interconnected with the main controller and the M auxiliary controllers in the electronic control unit via a first communication bus, and the main controller is interconnected with each of the M auxiliary controllers via a second communication bus.
[0015] These and other advantages of the present application will become apparent from and be elucidated with reference to the embodiments described hereinafter. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Embodiments of the present application will now be described in more detail and with reference to the accompanying drawings, in which:
[0017] Figure 1 An example of a connection topology for multiple electronic control units in a vehicle is illustrated;
[0018] Figure 2 An example of some steps involved in a method for performing software update on a controller in an electronic control unit is schematically shown;
[0019] Figure 3 The schematic diagram shows the communication connection between the host computer and each controller in the electronic control unit and the corresponding relationship between the external data sent by the host computer and each controller;
[0020] Figure 4 Some steps involved in a method for updating software of a controller in an electronic control unit provided in another embodiment of the present application are schematically shown;
[0021] Figure 5 The figure shows a schematic diagram of state synchronization between the main controller and each auxiliary controller in the preparation stage before software update;
[0022] Figure 6 The figure shows a schematic diagram that each controller in the electronic control unit is in the software update mode, and after the main controller MCU1 completes the update of the corresponding software, the auxiliary controller MCU2 performs the software update;
[0023] Figure 7 A schematic diagram for illustrating that each controller exits from the previous software update mode (BOOT mode), and the status synchronization between the main controller and each auxiliary controller is restored to the normal operating mode;
[0024] Figure 8 Some steps involved in a method for updating software in a controller in an electronic control unit provided by another embodiment of the present application are illustrated. DETAILED DESCRIPTION
[0025] The following description provides the specific details of various embodiments of the present application so that those skilled in the art can fully understand and implement the various embodiments of the present application. It should be understood that the technical scheme of the present application can be implemented without some of these details. In some cases, the present application does not show or describe in detail some well-known structures or functions to avoid these unnecessary descriptions from obscuring the description of the embodiments of the present application. The terms used in the present application should be understood in their broadest reasonable manner, even if they are used in conjunction with the specific embodiments of the present application.
[0026] The terms used in this application should be understood in their broadest reasonable manner, even if they are used in conjunction with specific embodiments of the present application. The "host computer" herein is relative to the electronic control unit (ECU) of a vehicle or a vehicle. The host computer is a computer system responsible for managing and controlling the controller in the electronic control unit for software updates. Data exchange and command control can be performed between the host computer and the vehicle or the electronic control unit in the vehicle via a communication interface. The host computer can be located next to the vehicle or a remote computer system far away from the vehicle. The "controller" herein refers to the microcontroller unit (MCU) in the electronic control unit. The controller can be regarded as a highly integrated computing and control unit that can process data, execute control logic, manage hardware resources, etc., and can communicate with external devices.
[0027] Figure 1 An example of a connection topology for multiple electronic control units in a vehicle is shown. Figure 1 As shown, a vehicle (e.g., a car) may include multiple electronic control units (ECUs), such as ECU1, ECU2, and ECU3, each of which may include a controller MCU, and some electronic control units (e.g., electronic control unit ECU3) include multiple controllers (e.g., controllers MCU1, MCU2, and MCU3). The host computer 10 is connected in communication with each electronic control unit (ECU), and each electronic control unit sends data to its internal controller MCU through an internal communication connection, so that the software program in the controller can be updated.
[0028] The embodiment of the present application provides a method for updating software of a controller in an electronic control unit, wherein the electronic control unit includes a main controller and M auxiliary controllers, where M is an integer greater than or equal to 1. The M auxiliary controllers are controlled by the main controller during the software update. Figure 2As shown, the method includes: S201, in response to the main controller receiving a command to enter a software update mode, the main controller instructs the M auxiliary controllers to enter a software update mode; S202, the main controller and the M auxiliary controllers sequentially receive corresponding external data in the software update mode to update the corresponding software in the main controller and the M auxiliary controllers, respectively; and S203, in response to the main controller receiving a command to exit the software update mode, the main controller and the M auxiliary controllers exit the software update mode.
[0029] It can be understood that the "software update mode" mentioned here refers to a working state of the controller. The controller completes the update of the software program therein in the software update mode. After the software update is completed, the controller can exit the software update mode, for example, enter the normal operation mode. In addition, the multiple controllers in the electronic control unit are divided into the main controller and the auxiliary controller. The main controller can control or dominate the auxiliary controller in the software update mode. In step S201, when the main controller receives the command to enter the software update mode, it instructs each auxiliary controller to jump from the previous operation mode to the software update mode, so that each controller in the electronic control unit can enter the software update mode almost at the same time. In step S202, the main controller and each auxiliary controller in the software update mode can receive the corresponding external data in sequence, so as to update the corresponding software in the main controller and each auxiliary controller respectively. In some embodiments, the external data sent from the host computer may include all the data involved in the software update of each controller, and the main controller and each auxiliary controller can receive the corresponding data in sequence, and the corresponding data is written into the corresponding memory of the main controller and each auxiliary controller in sequence, so that the main controller and each auxiliary controller receive and process the data required for the software update in the software update mode. When all controllers in the electronic control have completed the update of the software program, in step S203, the main controller receives a command to exit the software update mode, and the main controller controls each auxiliary controller to exit the software update mode and enter the normal operation mode or the default mode. In other words, each controller in the electronic control unit can exit the software update mode almost at the same time.
[0030] For the method of software updating of the controller in the electronic control unit provided in the embodiment of the present application, each controller in the electronic control unit basically enters the software update mode at the same time, and when all the controllers complete the software program update, each controller basically exits the software update mode at the same time, so that the working modes of each controller in the electronic control unit can be kept synchronously changed, avoiding triggering some unnecessary alarm functions due to the inconsistency of the working modes of each controller. In addition, in the software update mode, the main controller and each auxiliary controller receive the corresponding external data in turn, that is, the data involved in the software update of each controller is written into the corresponding memory of the main controller and each auxiliary control in turn. In other words, after a controller receives the external data involved in its software update from the host computer, the next controller starts to receive the external data involved in the software update of the next controller. In this way, the data required for the software update of each controller can be transmitted from the host computer to the electronic control unit via the communication bus in the form of a single file (for example, a HEX file), and each controller in the electronic control unit can share an address (for example, an ECU address) relative to the host computer, that is, it is only necessary to configure the address resources for the electronic control unit in the host computer, without configuring the address information for each controller in the electronic control unit in the host computer.
[0031] Figure 3 The diagram schematically illustrates the communication connection between the host computer and each controller in the electronic control unit and the corresponding relationship between the external data sent by the host computer and each controller. The host computer can be connected to the electronic control unit ECU via a communication bus (for example, a CAN bus or a CAN FD bus), and the electronic control unit ECU is connected to each controller (including controllers MCU1, MCU2...MCUN) through its internal communication. Figure 3 In the embodiment of the present invention, the controller MCU1 is used as the main controller, and correspondingly, the other controllers are regarded as auxiliary controllers. The main controller MCU1 and each auxiliary controller MCU2, ..., MCUN respectively exchange data through an internal communication bus, and examples of the internal communication bus include but are not limited to a CAN bus, a CAN FD bus, an SPI bus, etc. Figure 3 The figure shows the original software programs APP1, APP2, ..., APPN, etc. in each controller. The external data sent by the host computer to the electronic control unit include DA1, DA2, ..., DAN. The data DA1, DA2, ..., DAN are written into the main controller MCU1 and the corresponding storage areas FC1, FC2, ..., FCN in each auxiliary controller MCU2, ..., MCUN respectively, so that the original software programs APP1, APP2, ..., APPN can be updated.
[0032] In some embodiments, the external data includes software update data and corresponding storage address information for the main controller and the corresponding controllers in the M auxiliary controllers, and the main controller and the M auxiliary controllers confirm whether to receive the corresponding external data according to the storage address information. The storage address information represents the address information in each controller for storing the software update data to be received. In this embodiment, the host computer can send external data to each controller in the electronic control unit through the same address (for example, the ECU address set for the ECU) and via the same communication bus.
[0033] Figure 4 Some steps involved in a method for updating software of a controller in an electronic control unit according to another embodiment of the present application are schematically shown. Figure 4 As shown, steps S404 to S406 are respectively the same as steps S101 to S103 described in the previous embodiment. In this embodiment, the method for performing software update on the controller in the electronic control unit also includes: performing the following steps before the main controller receives a command to enter the software update mode: S401, the main controller receives a software update preparation command to prepare the main controller and the M auxiliary controllers for entering the software update mode, the software update preparation command at least including a command to shut down the protocol data unit (PDU) communication between each of the multiple controllers; S402, the main controller disables the response function of the M auxiliary controllers to the external signal from the host computer; and S403, in response to the main controller and the M auxiliary controllers being ready to enter the software update mode, the main controller generates a signal indicating that the main controller and the M auxiliary controllers are ready to enter the software update mode. Can be combined Figure 5 Steps S401 to S403 described here are further described. Figure 5As shown, the main controller MCU1 can receive a software update preparation command from the host computer so that the main controller and each auxiliary controller are ready to enter the software update mode, and the software update preparation command at least includes a command to close the protocol data unit (PDU) communication between each of the multiple controllers. In some embodiments, the software update for each controller needs to be carried out when the electronic control unit is stationary or safe. At this time, the software update preparation command may also include a command to check and confirm whether the vehicle where the electronic control unit is located is stationary or safe. In the above embodiment, the software update preparation command at least includes a command to close the protocol data unit (PDU) communication between each of the multiple controllers, so that the data exchange between the electronic control unit where the controller to be software updated is located and other electronic control units can be suspended, so that the software update of the controller can be carried out smoothly. In addition, when the main controller MCU1 receives the software update preparation command, the main controller disables the response function of each auxiliary controller to the external signal from the host computer. For example, the main controller can send a command to each auxiliary controller to execute the disablement of the response function of each auxiliary controller to the external signal from the host computer via the internal communication bus between the main controller and each auxiliary controller. That is, in this case, only the main controller MCU1 exchanges signals with the host computer, and each auxiliary controller has no authority to exchange signals with the host computer. However, each auxiliary controller MCU2, ..., MCUN can transmit a response signal to the main controller MCU1, for example, confirming that the response function to the external signal from the host computer has been disabled, and confirming that the protocol data unit (PDU) communication between each controller has been closed, so that the main controller MCU1 can know that the auxiliary controller is ready to enter the software update mode. When the main controller and each auxiliary controller are ready to enter the software update mode, the main controller MCU1 generates a signal indicating that the main controller and each auxiliary controller are ready to enter the software update mode, and the main controller MCU1 can feed back the signal to the host computer.
[0034] In some embodiments, the aforementioned step S202 may include the following steps: in response to the main controller completing the update of the corresponding software, the main controller stops its own response function to the external signal, and enables the Kth auxiliary controller among the M auxiliary controllers to respond to the external signal, so that the Kth auxiliary controller receives the corresponding external data; in response to the Kth auxiliary controller among the M auxiliary controllers completing the update of the corresponding software, the main controller disables the Kth auxiliary controller's response function to the external signal from the host computer, and enables the K+1th auxiliary controller among the M auxiliary controllers to respond to the external signal, so that the K+1th auxiliary controller receives the corresponding external data, where K is an integer greater than or equal to 1 and less than or equal to M. It can be combined with Figure 6 After receiving the command to enter the software update mode from the host computer, the main controller MCU1 instructs each auxiliary controller to jump to the software refresh mode.
[0035] Figure 6 The diagram shows that each controller in the electronic control unit is in the software update mode (BOOT mode), and the auxiliary controller MCU2 performs software update after the main controller MCU1 completes the update of the corresponding software (updates from the original software program APP1 to the new software program). After the main controller MCU1 receives the command to enter the software update mode from the host computer, the main controller MCU1 enters the software update mode and instructs each auxiliary controller to jump to the software update mode. Further, when the main controller MCU1 completes the update of the corresponding software, that is, the data DA1 in the external data is written into the storage area in the main controller MCU1, the main controller MCU1 feeds back to the host computer that the main controller MCU1 has received the data DA1, the main controller MCU1 stops its own response function to the external signal, and starts the response function of the first auxiliary controller to the external signal, so that the first auxiliary controller receives the corresponding external data. Correspondingly, when the first auxiliary controller completes the update of the corresponding software, the main controller MCU1 starts the response function of the second auxiliary controller to the external signal, so that the second auxiliary controller receives the corresponding external data DA2. This process is repeated until the last auxiliary controller MCUN receives corresponding external data to complete the corresponding software update. In this way, each auxiliary controller completes the corresponding software update in an orderly manner similar to a queue under the control of the main controller MCU1.
[0036] In some embodiments, the method for performing software update of the controller in the electronic control unit includes the following steps: in response to the Mth auxiliary controller completing the update of the corresponding software, the main controller and the M auxiliary controllers receive a command to exit the software update mode and exit the software update mode. That is, after the last auxiliary controller MCUN receives the corresponding external data and completes the corresponding software update, the main controller can receive a command to exit the software update mode from the host computer. In some embodiments, the command to exit the software update mode includes a command to restart (reset) each controller, that is, after completing the software update, the main controller and each auxiliary controller restart and exit the software update mode. Figure 7 A schematic diagram for illustrating that each controller exits from the previous software update mode (BOOT mode), and the status between the main controller and each auxiliary controller is synchronously restored to the normal operating mode. After receiving the command to exit the software update mode via the communication bus, the main controller MCU1 can instruct each auxiliary controller to jump to the normal operating mode. At this time, the software programs in each controller have been updated to new software programs APP1', APP2', ..., APPN'.
[0037] In some embodiments, in response to the main controller and each auxiliary controller receiving a command to exit the software update mode and exit the software update mode, the main controller and the M auxiliary controllers are reset. Further, in some embodiments, the method for the controller in the electronic control unit to perform software update also includes: after the main controller and the M auxiliary controllers are reset, the main controller receives a software update completion command so that the main controller and the M auxiliary controllers are ready to enter the normal working mode, and the software update completion command at least includes a command to open the protocol data unit (PDU) communication between each controller in the multiple controllers. As mentioned above, before performing software update on each controller in the electronic control unit, the main controller MCU1 receives a software update preparation command from the host computer so that the main controller and each auxiliary controller are ready to enter the software update mode, and the software update preparation command at least shuts down part of the functions of the electronic control unit or each controller in the electronic control unit, for example, the software update preparation command at least includes a command to shut down the protocol data unit (PDU) communication between each controller in the multiple controllers. The software update completion command here is to restore the function that was previously shut down by the software update preparation command. In addition, in some embodiments, when the main controller MCU1 receives a software update completion command, the main controller may enable each auxiliary controller to respond to an external signal from the host computer, so that each controller has the authority to perform signal interaction with the host computer.
[0038] According to some embodiments of the present application, the method for performing software update on a controller in an electronic control unit further includes the following step: in response to the main controller losing control of the M auxiliary controllers during the software update, one of the M auxiliary controllers acts as a backup main controller for controlling the main controller and the remaining auxiliary controllers. In some embodiments, the controllers including the main controller and the M auxiliary controllers are aware of each other's working status, and in the event that the main controller loses control of the M auxiliary controllers during the software update, one of the M auxiliary controllers can be selected as a backup main controller to replace the function of the previous main controller during the software update mode. For example, referring again to Figure 5 In the software update mode, if the main controller MCU1 loses control of the M auxiliary controllers due to a fault, the "main controller" role can be transferred to the first auxiliary controller MCU2, that is, the first auxiliary controller MCU2 acts as a backup main controller, which can control the auxiliary controllers MCU3...MCUN and the failed main controller MCU1 in order to complete the update of the software program in the software update mode, and the first auxiliary controller MCU2 can respond to various command information received from the host computer. Of course, other auxiliary controllers can also be used as backup main controllers, and the embodiments of the present application do not make specific restrictions on which auxiliary controller is used as the backup main controller.
[0039] Another embodiment of the present application provides a method for updating software in a controller in an electronic control unit. As mentioned above, the electronic control unit includes a main controller and M auxiliary controllers, and the M auxiliary controllers are controlled by the main controller during the software update. Figure 8As shown, the method may include the following steps: S801, the host computer sends a command to the main controller to instruct the main controller to enter the software update mode, so that the main controller instructs the M auxiliary controllers to enter the software update mode; S802, the host computer sends corresponding external data to the main controller and the M auxiliary controllers in sequence respectively, so as to update the corresponding software in the main controller and the M auxiliary controllers respectively; S803, in response to the host computer receiving a signal indicating that the Mth auxiliary controller has completed the software update from the Mth auxiliary controller among the M auxiliary controllers, the host computer sends a command to exit the software update mode to the main controller and the M auxiliary controllers, wherein N is an integer greater than or equal to 1. By using the method for updating the software of the controller in the electronic control unit provided by the embodiment of the present application, each controller can basically enter the software update mode at the same time, and when all the controllers complete the software program update, each controller basically exits the software update mode at the same time, so that the working modes of each controller in the electronic control unit can keep changing synchronously, avoiding triggering some unnecessary alarm functions due to the inconsistency of the working modes of each controller. In addition, each controller within the electronic control unit can share an address (e.g., ECU address) relative to the host computer, that is, it is only necessary to configure address resources for the electronic control unit on the host computer, without having to configure address information for each controller within the electronic control unit on the host computer.
[0040] In some embodiments, the previously referenced Figure 2 The method shown can be implemented in the form of software inside the controller of the electronic control unit, that is, each controller can include a corresponding software update module. Figure 3 An electronic control unit provided by an embodiment of the present application is described. Figure 3As shown, the electronic control unit (ECU) includes a main controller and M auxiliary controllers MCU2...MCUN, that is, in this embodiment, M=N-1, and N is an integer greater than or equal to 2. The main controller MCU1 includes a software update main module SWU1, and each auxiliary controller MCU2...MCUN includes a software update auxiliary module SWU2...SWUN. Each software update auxiliary module is controlled by the software update main module. The software update main module SWU1 and each software update auxiliary module SWU2...SWUN are configured to control the main controller MCU1 and the M auxiliary controllers to receive corresponding external data in sequence in the software update mode, so as to update the corresponding software in the main controller MCU1 and the M auxiliary controllers respectively. The software update main module SWU1 is also configured to: in response to the main controller receiving a command to enter the software update mode, instruct the M auxiliary controllers to enter the software update mode through the software update auxiliary module; in response to the main controller receiving a command to exit the software update mode, instruct the M auxiliary controllers to exit the software update mode through the software update auxiliary module, wherein M is an integer greater than or equal to 1.
[0041] Another embodiment of the present application provides a system, including a host computer and the electronic control unit described in the above embodiment. Figure 3 The host computer can be connected to the main controller and the M auxiliary controllers in the electronic control unit via a first communication bus (for example, a CAN bus or a CAN FD bus, etc.), and the main controller MCU1 can be connected to each of the M auxiliary controllers via a second communication bus (for example, a CAN bus, a CAN FD bus, an SPI bus, etc.). Of course, other signal connection lines ( Figure 3 (not shown), through these other signal connection lines, each controller can know whether the working state of each other is abnormal. The host computer can send corresponding external data to each controller in the electronic control unit to update the software program in the controller. In some embodiments, the host computer can transmit the data required for the software update of each controller to each controller in the electronic control unit in the form of a single file (for example, a HEX file) via the first communication bus. Each controller can share an address (for example, an ECU address) relative to the host computer, without having to configure address resources for each controller in the electronic control unit in the host computer, which is conducive to reducing the cost of software updates and simplifying the process of software updates. Moreover, the working modes of each controller in the electronic control unit can keep changing synchronously, avoiding the triggering of some unnecessary alarm functions due to the inconsistency of the working modes of each controller, and further ensuring the smooth update of the controller software program in the electronic control unit.
[0042] The scope of the present application is limited only by the appended claims. Although individual features may be included in different claims, these may potentially be advantageously combined, and the order of features in the claims does not imply any particular order in which the features must work. Furthermore, in the claims, the word "comprising" does not exclude other elements or steps.
Claims
1. A method for updating software of a controller in an electronic control unit, wherein the electronic control unit comprises a main controller and M auxiliary controllers, wherein the M auxiliary controllers are controlled by the main controller during the software update, the method comprising: In response to the main controller receiving a command to enter a software update mode, the main controller instructs the M auxiliary controllers to enter a software update mode; The main controller and the M auxiliary controllers sequentially receive corresponding external data in the software update mode to update corresponding software in the main controller and the M auxiliary controllers respectively; as well as In response to the main controller receiving a command to exit the software update mode, the main controller and the M auxiliary controllers exit the software update mode, where M is an integer greater than or equal to 1.
2. The method according to claim 1, characterized in that Before the main controller receives a command to enter the software update mode, the method further includes: The main controller receives a software update preparation command to prepare the main controller and the M auxiliary controllers to enter a software update mode, wherein the software update preparation command at least includes a command to shut down a protocol data unit (PDU) communication between each of the plurality of controllers; The main controller disables the M auxiliary controllers from responding to external signals from the host computer; and In response to the primary controller and the M secondary controllers being ready to enter a software update mode, the primary controller generates a signal indicating that the primary controller and the M secondary controllers are ready to enter a software update mode.
3. The method according to claim 2, characterized in that The main controller and the M auxiliary controllers sequentially receive corresponding external data in the software update mode to update the corresponding software in the main controller and the M auxiliary controllers respectively, including: In response to the main controller completing the update of the corresponding software, the main controller stops its own response function to the external signal, and starts the response function of the Kth auxiliary controller among the M auxiliary controllers to the external signal, so that the Kth auxiliary controller receives the corresponding external data; In response to the Kth auxiliary controller among the M auxiliary controllers completing the update of the corresponding software, the main controller disables the response function of the Kth auxiliary controller to the external signal, and enables the response function of the K+1th auxiliary controller among the M auxiliary controllers to the external signal, so that the K+1th auxiliary controller receives the corresponding external data, where K is an integer greater than or equal to 1 and less than or equal to M.
4. The method according to claim 3, characterized in that The method comprises: In response to the Mth auxiliary controller completing the update of the corresponding software, the main controller receives the command to exit the software update mode.
5. The method according to claim 1, characterized in that The external data includes software update data and corresponding storage address information for the main controller and the corresponding controller among the M auxiliary controllers. The main controller and the M auxiliary controllers confirm whether to receive the corresponding external data based on the storage address information.
6. The method according to claim 1, characterized in that The method further comprises: In response to the primary controller losing control of the M secondary controllers during the software update, one of the M secondary controllers serves as a backup primary controller for controlling the primary controller and the remaining secondary controllers.
7. The method according to claim 1, characterized in that In response to the main controller receiving a command to exit the software update mode, the main controller and the M auxiliary controllers exiting the software update mode include: In response to the main controller receiving a command to exit the software update mode, the main controller and the M auxiliary controllers are reset.
8. The method according to claim 7, characterized in that The method further comprises: After the main controller and the M auxiliary controllers are reset, the main controller receives a software update completion command to prepare the main controller and the M auxiliary controllers to enter a normal working mode, and the software update completion command includes at least a command to start protocol data unit communication between each of the multiple controllers.
9. A method for updating software in a controller in an electronic control unit, the electronic control unit comprising a main controller and M auxiliary controllers, the M auxiliary controllers being controlled by the main controller during software update, the method comprising: The host computer sends a command to the main controller to instruct the main controller to enter a software update mode, and the main controller instructs the M auxiliary controllers to enter the software update mode; The host computer sends corresponding external data to the main controller and the M auxiliary controllers in sequence respectively, so as to update corresponding software in the main controller and the M auxiliary controllers respectively; as well as In response to the host computer receiving a signal from the Mth auxiliary controller among the M auxiliary controllers indicating that the Mth auxiliary controller has completed software update, the host computer sends a command to exit software update mode to the main controller and the M auxiliary controllers, where M is an integer greater than or equal to 1.
10. An electronic control unit, comprising a main controller and M auxiliary controllers, wherein the main controller comprises a software update main module, each of the M auxiliary controllers comprises a software update auxiliary module, and the software update auxiliary module is configured to be controlled by the software update main module, characterized in that: The software update main module and the software update auxiliary module are configured to control the main controller and the M auxiliary controllers to sequentially receive corresponding external data in the software update mode, so as to update the corresponding software in the main controller and the M auxiliary controllers respectively, wherein the software update main module is further configured to: In response to the main controller receiving a command to enter a software update mode, instructing the M auxiliary controllers to enter a software update mode through the software update auxiliary module; and In response to the main controller receiving a command to exit the software update mode, the software update auxiliary module instructs the M auxiliary controllers to exit the software update mode, where M is an integer greater than or equal to 1.
11. A system comprising a host computer and the electronic control unit according to claim 10, characterized in that: The host computer is interconnected with the main controller and the M auxiliary controllers in the electronic control unit via a first communication bus, and the main controller is interconnected with each of the M auxiliary controllers via a second communication bus.