Electronic control unit upgrading method and system and electronic control unit

By introducing parallel upgraded partition structure and upgrade control unit into the electronic control unit, the problem of low upgrade efficiency and inconsistent processor version of the electronic control unit is solved, and efficient parallel processor upgrade is achieved.

CN119396437APending Publication Date: 2025-02-07Z-ONE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411529123.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, the upgrade efficiency of the electronic control unit is low, and the processor upgrade is not synchronized, resulting in inconsistent processor versions.

Method used

By introducing the first partition and the second partition into the electronic control unit, when the first upgrade control unit is in the running state, the first upgrade control unit parses the processor upgrade package in the upgrade package and flashes it to the second partition and the second partition. The second processor realizes parallel upgrades of different processors in the same electronic control unit.

Benefits of technology

Improve the upgrade efficiency of the electronic control unit and avoid the problem of version inconsistency caused by processor upgrades due to abnormal synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396437A_ABST
    Figure CN119396437A_ABST
Patent Text Reader

Abstract

The invention provides an electronic control unit upgrading method and system and an electronic control unit, the system comprises a diagnostic tool and an electronic control unit, the electronic control unit comprises a first processor and a second processor, the first processor comprises a first partition and a second partition, the first partition comprises a first upgrading control unit, and the first upgrading control unit is in a running state in the first partition. Under the condition that the second partition is in a non-running state, the method comprises the following steps: a first upgrade control unit analyzes a first processor upgrade package and a second processor upgrade package according to an upgrade package sent by a diagnostic tool, and then flashes the first processor upgrade package to the second partition and flashes the second processor upgrade package to a second processor. Therefore, on the basis of the obtained first processor upgrade package and the second processor upgrade package, the second processor and the first processor are flashed, parallel upgrade of the first processor and the second processor can be realized, the upgrade efficiency is improved, and the problem of version inconsistency caused by asynchronous upgrade can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic control unit upgrade, and in particular to an electronic control unit upgrade method, system and electronic control unit. Background Art

[0002] Currently, an electronic control unit (ECU) with a dual processor architecture such as a microcontroller (MCU) and a microprocessor (MPU) or a multi-core heterogeneous chip is usually used to realize various complex algorithm operations, data processing, image processing and other computing tasks such as intelligent driving, smart cockpit, and intelligent networking of automobiles, as well as real-time automobile communication, standby low power consumption and other requirements.

[0003] In the prior art, for the upgrade method of a multi-core heterogeneous electric control unit having dual processors such as MCU and MPU or including such as MCU and MPU, the diagnostic tool usually sends corresponding upgrade packages to the processors such as MCU and MPU respectively, so that the processors such as MCU and MPU are independently upgraded according to the corresponding upgrade packages, and the processors such as MCU and MPU are upgraded respectively, thereby realizing the upgrade of the electric control unit. This upgrade method has the problems of low efficiency of upgrading the electric control unit and asynchronous processor upgrade affecting the consistency of the processor version because different processors such as MCU and MPU included in the electric control unit are upgraded separately. Summary of the invention

[0004] The purpose of this application is to solve the problems existing in the prior art of low upgrade efficiency of the electronic control unit due to separate upgrades of different processors included in the electronic control unit, such as MCU, MPU, etc., and asynchronous processor upgrades affecting processor version consistency.

[0005] Among them, the first upgrade control unit included in the first partition in the running state flashes the second partition in the non-running state and the second processor in the first processor by parsing the first processor upgrade package and the second processor upgrade package from the upgrade package, and can upgrade the first processor and the second processor in the same electronic control unit in parallel, that is, realizes the parallel upgrade of different processors in the same electronic control unit, thereby improving the upgrade efficiency of the electronic control unit and avoiding the problem of inconsistent processor versions caused by asynchronous processor upgrades.

[0006] To solve the above technical problems, in the first aspect, the implementation method of the present application discloses an electric control unit upgrade method, which is applied to an electric control unit upgrade system. The electric control unit upgrade system includes a diagnostic tool and an electric control unit. The electric control unit includes a first processor and a second processor. The first processor includes a first partition and a second partition. The first partition includes a first upgrade control unit. When the first partition is in a running state and the second partition is in a non-running state, the method includes: the first upgrade control unit receives an upgrade package sent by the diagnostic tool, the upgrade package includes a first processor upgrade package corresponding to the first processor and a second processor upgrade package corresponding to the second processor; the first upgrade control unit parses the first processor upgrade package and the second processor upgrade package from the upgrade package, flashes the first processor upgrade package to the second partition, and flashes the second processor upgrade package to the second processor.

[0007] By adopting the above technical solution, when the first partition included in the first processor is in a running state and the second partition is in a non-running state, that is, when the first processor is running in the first partition, the first upgrade control unit included in the first partition parses the upgrade package sent by the diagnostic tool to obtain the first processor upgrade package corresponding to the first processor and the second processor upgrade package corresponding to the second processor, and then the first upgrade control unit flashes the second processor upgrade package to the second processor, and flashes the first processor upgrade package to the second partition. In this way, the first upgrade control unit completes the flashing of the second partition of the first processor and the flashing of the second processor by parsing the first processor upgrade package and the second processor upgrade package obtained from the upgrade package including the first processor upgrade package and the second processor upgrade package, and can perform parallel upgrades on the first processor and the second processor in the same electric control unit, that is, realizes the parallel upgrade of different processors in the same electric control unit, thereby improving the upgrade efficiency of the electric control unit, and can avoid the problem of inconsistent processor versions caused by asynchronous processor upgrades.

[0008] According to another specific implementation of the present application, an implementation of the present application discloses an electric control unit upgrade method, wherein the first processor also includes a storage unit, and the method further includes: the first upgrade control unit stores the upgrade package in the storage unit.

[0009] According to another specific implementation of the present application, the implementation of the present application discloses an electric control unit upgrade method, which also includes: the first upgrade control unit sends the flashing result to the diagnostic tool when the upgrade package for the second partition and the second processor is flashed; the diagnostic tool sends a partition activation request to the first upgrade control unit according to the flashing result; the first upgrade control unit resets the activation flags of the first partition and the second partition of the first processor in response to the partition activation request, so that the activation flag of the first partition is in an inactive state, and the activation flag of the second partition is in an active state; the diagnostic tool sends a reset request to the first upgrade control unit; the first upgrade control unit controls the first processor and the second processor to be reset at the same time in response to the reset request, and after the reset is completed, puts the second partition and the second processor in a running state, and puts the first partition in a non-running state.

[0010] By adopting the above technical solution, after the first upgrade control unit completes the flashing of the second partition of the first processor and the flashing of the second processor, it first resets the activation flags of the first partition and the second partition based on the partition activation request sent by the diagnostic tool, and then controls the first processor and the second processor to be reset at the same time based on the reset request sent by the diagnostic tool, so that after the reset is completed, the first partition is in a non-operating state, and the second partition and the second processor are in an operating state, thereby realizing the parallel upgrade and reset of the first processor and the second processor in the same electronic control unit, which can improve the upgrade efficiency of the electronic control unit and avoid the problem of inconsistent processor versions caused by asynchronous upgrades of different processors.

[0011] According to another specific implementation of the present application, the implementation of the present application discloses an electric control unit upgrade method, wherein the second partition includes a second upgrade control unit, and when the first partition is in a non-operating state and the second partition is in an operating state, the method further includes: the second upgrade control unit included in the second partition obtains the upgrade package from the storage unit, parses the first processor upgrade package from the upgrade package, and flashes the first processor upgrade package to the first partition.

[0012] By adopting the above technical solution, after completing the flashing, activation and resetting of the second partition and the second processor in the first processor, when the first processor is running in the second partition in the running state, the second upgrade control unit completes the flashing of the first partition based on the stored upgrade package, so that the upgrade of the first processor is completed, thereby enabling the parallel upgrade of the first processor and the second processor in the same electronic control unit to improve the upgrade efficiency.

[0013] According to another specific implementation of the present application, an implementation of the present application discloses an electronic control unit upgrade method, before the first upgrade control unit flashes the second processor upgrade package to the second processor, the method also includes: the first upgrade control unit extracts the current program file of the second processor from the second processor, and stores the current program file as the target program file to the storage unit.

[0014] By adopting the above technical solution, the current program file of the second processor is first extracted from the second processor, and then the second processor is flashed based on the upgrade package sent by the diagnostic tool, thereby eliminating the need to obtain the current program file of the second processor from the diagnostic tool, thereby improving the upgrade efficiency.

[0015] According to another specific implementation of the present application, the implementation of the present application discloses an electric control unit upgrade method. When the first partition is in a non-operating state and the second partition is in an operating state, the method also includes: when the second upgrade control unit receives a rollback request for the electric control unit sent by a diagnostic tool, resetting the activation flag bits of the first partition and the second partition of the first processor, so that the activation flag bit of the first partition is in an activated state, and the activation flag bit of the second partition is in an inactivated state, and obtaining the target program file from the storage unit, flashing the target program file to the second processor, and completing the rollback processing for the electric control unit.

[0016] By adopting the above technical solution, when the first processor is running in the second partition, based on the rollback request for the electronic control unit, the activation flag is reset, and after the control is reset, the first partition is put into operation and the second partition is put into non-operation state, thereby realizing the software version rollback function of the first processor and flashing the stored target program file to the second processor, thereby realizing the software version rollback function of the second processor, and then realizing the software version rollback function of the electronic control unit, and performing rollback processing based on the pre-stored target program file, thereby improving the upgrade efficiency.

[0017] According to another specific implementation of the present application, the implementation of the present application discloses an electric control unit upgrade method. When the electric control unit is powered on, the first partition is in a non-operating state, and the second partition is in an operating state, the method also includes: a second upgrade control unit detects a check code of the first processor and a check code of the second processor to verify whether the software version of the currently running first processor and the software version of the second processor belong to the same baseline version; if the check code of the detected first processor is less than the check code of the second processor, it is determined that the software version of the currently running first processor and the software version of the second processor do not belong to the same baseline version, the software version of the first processor is the old baseline version, and the software version of the second processor is the new baseline version, the second upgrade control unit obtains an upgrade package from the storage unit, parses the first processor upgrade package from the upgrade package, and re-writes the first processor upgrade package to the first partition; if the check code of the detected first processor is equal to the check code of the second processor, it is determined that the software version of the currently running first processor and the software version of the second processor belong to the same baseline version, and the first processor and the second processor are upgraded successfully.

[0018] By adopting the above technical solution, when the electronic control unit is powered on and the first partition is in a non-operating state and the second partition is in a running state, it is determined whether the software version of the first processor and the software version of the second processor belong to the same baseline version based on the detected verification code of the first processor and the verification code of the second processor, and if they do not belong to the same baseline version, the first partition in the non-operating state of the first processor is rewritten, which can ensure that the software versions of the first processor and the second processor at power-on operation belong to the same baseline version, thereby avoiding the problem of inconsistent processor versions caused by upgrade interruptions, and can automatically verify and repair the problem of inconsistent processor versions.

[0019] In the second aspect, the implementation method of the present application also discloses an electronic control unit, which includes a first processor and a second processor, the first processor includes a first partition and a second partition, the first partition includes a first upgrade control unit, and when the first partition is in a running state and the second partition is in a non-running state, the first upgrade control unit is used to receive an upgrade package sent by a diagnostic tool, the upgrade package including a first processor upgrade package corresponding to the first processor and a second processor upgrade package corresponding to the second processor, and parse the first processor upgrade package and the second processor upgrade package from the upgrade package, flash the first processor upgrade package to the second partition, and flash the second processor upgrade package to the second processor.

[0020] According to another specific implementation of the present application, the implementation of the present application discloses an electronic control unit, wherein the first processor also includes a storage unit, and the storage unit is used to store an upgrade package and a target program file of the second processor.

[0021] According to another specific implementation method of the present application, the implementation method of the present application discloses an electronic control unit, the second partition includes a second upgrade control unit, the second upgrade control unit is used to obtain an upgrade package from the storage unit, and parse the first processor upgrade package from the upgrade package, and flash the first processor upgrade package to the first partition.

[0022] On the third aspect, the implementation method of the present application also discloses an electronic control unit upgrade system, which includes a diagnostic tool and an electronic control unit, the electronic control unit including a first processor and a second processor, the first processor including a first partition and a second partition, the first partition including a first upgrade control unit, and when the first partition is in a running state and the second partition is in a non-running state, the diagnostic tool is used to send an upgrade request to the first upgrade control unit; the first upgrade control unit is used to respond to the upgrade request, obtain an upgrade package from the diagnostic tool, the upgrade package including a first processor upgrade package corresponding to the first processor and a second processor upgrade package corresponding to the second processor, and parse the first processor upgrade package and the second processor upgrade package from the upgrade package, flash the first processor upgrade package to the second partition, and flash the second processor upgrade package to the second processor.

[0023] It can be understood that the beneficial effects of the second to third aspects mentioned above can also be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a structural schematic diagram of an existing vehicle computer upgrade system provided in an embodiment of the present application;

[0025] Figure 2 It is a structural schematic diagram of an electronic control unit upgrade system provided in an embodiment of the present application;

[0026] Figure 3 is a structural schematic diagram of another electronic control unit upgrade system provided in an embodiment of the present application;

[0027] Figure 4 It is a flow chart of an electric control upgrade method provided in an embodiment of the present application;

[0028] Figure 5 It is a schematic diagram of the principle of extracting the target program file of the microcontroller provided in an embodiment of the present application;

[0029] Figure 6 It is a flowchart of another electric control upgrade method provided in an embodiment of the present application;

[0030] Figure 7 It is a flow chart of another electric control upgrade method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] As mentioned earlier, the intelligence and software of automobiles have become the mainstream development direction of the automotive industry, and intelligent automobiles have also occupied a certain market share.

[0032] At present, electronic control units (ECUs) with dual processor architectures such as microcontrollers (MCUs) and microprocessors (MPUs) or multi-core heterogeneous chips are usually used to realize various complex algorithm operations, data processing, image processing and other computing tasks such as intelligent driving, intelligent cockpits, and intelligent networking of automobiles based on the powerful computing power of MPUs and the real-time performance of MCUs, as well as real-time automobile communications, low standby power consumption and other requirements. Taking the on-board electronic control unit as an example, the MPU chips in the on-board electronic control unit generally have dual partition functions, while most MCU chips do not support dual partition functions. This means that in the case of shorter and shorter iteration cycles of automotive software functions, a fast and reliable overall upgrade method is urgently needed for multi-core heterogeneous electronic control units with dual processors such as MCUs and MPUs or including, for example, MCUs and MPUs.

[0033] In the prior art, for the upgrade method of a multi-core heterogeneous electric control unit having dual processors such as MCU and MPU or including such as MCU and MPU, the diagnostic tool usually sends corresponding upgrade packages to the processors such as MCU and MPU respectively, so that the processors such as MCU and MPU are independently upgraded according to the corresponding upgrade packages, and the processors such as MCU and MPU are upgraded respectively, thereby realizing the upgrade of the electric control unit. This upgrade method has the problems of low efficiency of upgrading the electric control unit and asynchronous processor upgrade affecting the consistency of the processor version because different processors such as MCU and MPU included in the electric control unit are upgraded separately.

[0034] For example, Figure 1 As shown, by introducing an additional "control center", such as a gateway, into the specific vehicle system infotainment head unit (IHU) with MCU and MPU, the gateway sends detection and switching requests to the MCU and MPU respectively, so as to realize the upgrade of MCU and MPU, and when the MCU and MPU are upgraded, the upgrade packages sent to the MCU and MPU respectively by the diagnostic instrument are realized. Therefore, this upgrade method is essentially still to upgrade the MCU and MPU separately, and there are problems of low upgrade efficiency and asynchronous upgrade affecting version consistency.

[0035] Therefore, in the prior art, processors such as MCU and MPU are upgraded individually by respectively obtaining corresponding upgrade packages. However, it is impossible to upgrade different processors such as MCU and MPU in the same electronic control unit in parallel, resulting in low efficiency of electronic control unit upgrade and asynchronous processor upgrade affecting processor version consistency.

[0036] Based on this, the implementation of the present application provides an electric control unit upgrade method, system and electric control unit, wherein the first upgrade control unit included in the first partition in the running state flashes the second partition in the first processor in the non-running state and flashes the second processor through the first processor upgrade package and the second processor upgrade package parsed from the upgrade package, and can upgrade the first processor and the second processor in the same electric control unit in parallel, that is, realizes the parallel upgrade of different processors such as MCU, MPU, etc. in the same electric control unit, thereby improving the upgrade efficiency of the electric control unit and avoiding the problem of inconsistent processor versions caused by asynchronous processor upgrades.

[0037] Next, the electronic control unit upgrade method, system and electronic control unit provided by the implementation of the present application are described in detail.

[0038] In one implementation of the present application, Figure 2 As shown, the ECU upgrade system includes a diagnostic tool and an ECU, the ECU includes a first processor and a second processor, the first processor includes a first partition and a second partition, the first partition includes a first upgrade control unit.

[0039] The following detailed description is given by taking the first processor as a microprocessor and the second processor as a microcontroller as an example.

[0040] When the first partition is in a running state and the second partition is in a non-running state, the diagnostic tool is used to send an upgrade request to the first upgrade control unit.

[0041] The first upgrade control unit is used to respond to an upgrade request, obtain an upgrade package from the diagnostic tool, the upgrade package including a microcontroller upgrade package corresponding to the microcontroller (as an example of a second processor upgrade package) and a microprocessor upgrade package corresponding to the microprocessor (as an example of a first processor upgrade package), and parse the microcontroller upgrade package and the microprocessor upgrade package from the upgrade package, flash the microprocessor upgrade package to the second partition, and flash the microcontroller upgrade package to the microcontroller.

[0042] Exemplarily, the diagnostic tool is used to control the upgrade task flow and transmit the upgrade package, so that the first upgrade control unit obtains the upgrade package sent by the diagnostic tool based on the upgrade request sent by the diagnostic tool, and then completes the flashing of the microcontroller and the flashing of the second partition in the microprocessor that is in a non-operating state based on the microcontroller upgrade package and microprocessor upgrade package obtained from the upgrade package. In this way, based on the obtained microcontroller upgrade package and microprocessor upgrade package, the microcontroller and microprocessor in the same electronic control unit can be upgraded in parallel, thereby improving the upgrade efficiency.

[0043] Exemplarily, the first upgrade control unit may also directly obtain the upgrade package from the diagnostic tool, or the diagnostic tool may send the upgrade package to the first upgrade control unit without requesting the first upgrade control unit to upgrade, or the first upgrade control unit may send an upgrade request to the diagnostic tool, and the diagnostic tool may send the upgrade package to the first upgrade control unit based on the upgrade request, so that the first upgrade control unit may flash the second partition and the microcontroller based on the upgrade package. Of course, the first upgrade control unit may also obtain the upgrade package from the diagnostic tool in other ways.

[0044] Furthermore, when the first partition is in a non-running state and the second partition is in a running state, that is, when the first processor runs the second partition, the second upgrade control unit included in the second partition can implement the flashing of the first partition of the first processor and the flashing of the second processor based on the upgrade request and the upgrade package sent by the diagnostic tool, wherein the flashing process of the second upgrade control unit refers to the flashing process of the first upgrade control unit mentioned above.

[0045] Further, in one implementation of the present application, the electronic control unit includes a microcontroller (as an example of a second processor) and a microprocessor (as an example of a first processor), the microprocessor includes a first partition and a second partition, and the first partition includes a first upgrade control unit.

[0046] When the first partition is in operation and the second partition is in non-operation, the first upgrade control unit is used to receive an upgrade package sent by the diagnostic tool, the upgrade package including a microcontroller upgrade package corresponding to the microcontroller and a microprocessor upgrade package corresponding to the microprocessor, and parse the microcontroller upgrade package and the microprocessor upgrade package from the upgrade package, flash the microprocessor upgrade package to the second partition, and flash the microcontroller upgrade package to the microcontroller.

[0047] Exemplarily, when the microprocessor runs in the first partition, the first upgrade control unit obtains the microcontroller upgrade package and the microprocessor upgrade package according to the upgrade package sent by the diagnostic tool, and then flashes the second partition in the microprocessor and the microcontroller.

[0048] Furthermore, in one implementation of the present application, the microprocessor also includes a storage unit.

[0049] The storage unit is used to store the upgrade package and the target program file of the microcontroller.

[0050] Exemplarily, the first upgrade control unit (or the second upgrade control unit) receives the upgrade package sent by the diagnostic tool, stores the upgrade package in the storage unit, and before flashing the microcontroller, the first upgrade control unit obtains the current program file of the microcontroller from the microcontroller, and stores the current program file as the target program file in the storage unit to implement the rollback function of the microcontroller.

[0051] Further, in an implementation of the present application, the second partition includes a second upgrade control unit.

[0052] The second upgrade control unit is used to obtain the upgrade package from the storage unit, parse the upgrade package to obtain the microprocessor upgrade package from the upgrade package, and write the microprocessor upgrade package to the first partition.

[0053] Exemplarily, after the first upgrade control unit completes the flashing, activation, and resetting of the second partition of the microprocessor and the microcontroller, making the first partition in a non-operating state and the second partition in a running state, the second upgrade control unit included in the second partition obtains the microprocessor upgrade package based on the upgrade package stored in the storage unit, and completes the flashing of the first partition in the microprocessor that is in a non-operating state.

[0054] It should be noted that the first upgrade control unit included in the first partition and the second upgrade control unit included in the second partition can both receive the upgrade package sent by the diagnostic tool to upgrade the microprocessor and the microcontroller. Therefore, when performing the upgrade and flashing, it is determined based on the situation of the microprocessor running in the first partition / second partition. If the microprocessor runs in the first partition, the first upgrade control unit will receive the upgrade package for upgrade and flashing. If the microprocessor runs in the second partition, the second upgrade control unit will receive the upgrade package for upgrade and flashing.

[0055] In this way, the first upgrade control unit / the second upgrade control unit upgrades the dual-processor electronic control unit having the first processor and the second processor according to the upgrade package including the first processor upgrade package and the second processor upgrade package sent by the diagnostic tool, thereby improving the upgrade efficiency.

[0056] Furthermore, a multi-core heterogeneous electronic control unit including a microprocessor MPU and a microcontroller MCU may include multiple MPUs and one MCU, or may include one MPU and multiple MCUs, or may include multiple MPUs and multiple MCUs, thereby realizing parallel upgrading of processors such as MPUs and MCUs in the same electronic control unit through a first upgrade control unit corresponding to the first partition included in the MPU and a second upgrade control unit corresponding to the second partition.

[0057] For example, Figure 3 As shown, the electric control unit upgrade system provided by the implementation of the present application is also a fusion-type intelligent electric control unit upgrade system, including a diagnostic tool and an electric control unit ECU, and the ECU includes a microprocessor MPU and a microcontroller MCU.

[0058] In addition, the MPU has a dual partition function, that is, the MPU includes partition A (that is, the first partition) and partition B (that is, the second partition), and an upgrade control master (UCM for short) (that is, the first upgrade control unit and the second upgrade control unit) are respectively arranged in the A partition and B partition of the MPU as control modules for upgrading the MPU and MCU.

[0059] Furthermore, the MPU also includes a non-volatile memory (NVM for short) (ie, a storage unit) shared by partition A and partition B. Of course, the storage unit may also be other memories.

[0060] Therefore, when the MPU runs in the A partition in the running state, the diagnostic tool is used to send a control command (ie, an upgrade request) and transmit an upgrade package to the UCM (ie, the first upgrade control unit) included in the A partition.

[0061] The UCM included in partition A is used to obtain the upgrade package from the diagnostic tool according to the control command. The upgrade package includes the MCU upgrade package (also known as the microcontroller upgrade package) and the MPU upgrade package (also known as the microprocessor upgrade package). The MCU upgrade package and the MPU upgrade package are decompressed from the upgrade package, the MPU upgrade package is installed to partition B, and the MCU upgrade package is flashed to the MCU.

[0062] The NVM is used to store the upgrade package obtained by the UCM included in the A partition from the diagnostic tool during the upgrade, and the old version of the MCU software (ie, the target program file) read by the UCM included in the A partition from the MCU.

[0063] The UCM included in the B partition is used to obtain the upgrade package from the NVM, decompress the MPU upgrade package from the upgrade package, and install the MPU upgrade package to the A partition.

[0064] Of course, if the MPU runs in the B partition which is in the running state, the upgrade package sent by the diagnostic tool can be received through the UCM (ie, the second upgrade control unit) included in the B partition to perform the above-mentioned upgrade process.

[0065] Next, the electronic control unit upgrade method provided by the implementation of the present application is described.

[0066] In the implementation of the present application, the electric control unit upgrade method provided in the implementation of the present application is applied to the aforementioned electric control unit upgrade system, such as Figure 4 As shown, when the first partition is in a running state and the second partition is in a non-running state, the method specifically includes the following steps.

[0067] S100: A first upgrade control unit receives an upgrade package sent by a diagnostic tool, where the upgrade package includes a first processor upgrade package corresponding to the first processor and a second processor upgrade package corresponding to the second processor.

[0068] S200: The first upgrade control unit parses the upgrade package to obtain a first processor upgrade package and a second processor upgrade package, writes the first processor upgrade package to the second partition, and writes the second processor upgrade package to the second processor.

[0069] The electric control unit upgrade method provided by the implementation of the present application is that when the first partition included in the first processor is in a running state and the second partition is in a non-running state, that is, when the first processor is running in the first partition, the first upgrade control unit included in the first partition parses the upgrade package sent by the diagnostic tool to obtain the first processor upgrade package corresponding to the first processor and the second processor upgrade package corresponding to the second processor, and then the first upgrade control unit flashes the second processor upgrade package to the second processor, and flashes the first processor upgrade package to the second partition. In this way, the first upgrade control unit completes the flashing of the second partition of the first processor and the flashing of the second processor by parsing the first processor upgrade package and the second processor upgrade package obtained from the upgrade package including the first processor upgrade package and the second processor upgrade package, and can perform parallel upgrades on the first processor and the second processor in the same electric control unit, that is, realizes the parallel upgrade of processors such as MCU and MPU in the same electric control unit, thereby improving the upgrade efficiency and avoiding the problem of version inconsistency caused by asynchronous upgrades.

[0070] The following is a detailed description of the first processor being a microprocessor, the second processor being a microcontroller, and the first partition being in a running state and the second partition being in a non-running state. Of course, the first partition may also be in a non-running state and the second partition may be in a running state.

[0071] In the present application, the microprocessor includes a first partition and a second partition, and both the first partition and the second partition have two states, namely, activation and inactivation, and the two partitions are always in a mutually exclusive state. Moreover, each time the microprocessor is powered on or reset, the boot loader is entered, and the boot loader can determine the activation state of the first partition and the second partition to start the software program of the first partition or the second partition in the activated state. Therefore, assuming that the current microprocessor is always in an idle state, and the first partition is in a running state, and the second partition is in a non-running state, and running in the first partition, the diagnostic tool sends an upgrade package to the first upgrade control unit, so that the first upgrade control unit upgrades the microcontroller and the microprocessor based on the upgrade package.

[0072] Exemplarily, with respect to the above-mentioned step S100, the first upgrade control unit receives an upgrade package sent by the diagnostic tool, and the upgrade package includes a first processor upgrade package corresponding to the first processor and a second processor upgrade package corresponding to the second processor. The first upgrade control unit may obtain the upgrade package including the microcontroller upgrade package (that is, the second processor upgrade package) and the microprocessor upgrade package (that is, the first processor upgrade package) from the diagnostic tool through the DoIP (Diagnostic communication over Internet Protocol) 0x38 0x36 0x37 service or the HTTP (Hypertext Transfer Protocol) post / get method.

[0073] The first upgrade control unit may obtain the upgrade package from the diagnostic tool or through other technical means.

[0074] Further, with respect to the above-mentioned step S200, the first upgrade control unit parses the first processor upgrade package and the second processor upgrade package from the upgrade package, flashes the first processor upgrade package to the second partition, and flashes the second processor upgrade package to the second processor. The first upgrade control unit may decompress the received upgrade package, extract the microcontroller upgrade package and the microprocessor upgrade package, thereby installing the microprocessor upgrade package to the second partition in the microprocessor which is in a non-running state, and flashes the microcontroller upgrade package to the microcontroller, thereby realizing the upgrade of the second partition of the microprocessor and the upgrade of the microcontroller.

[0075] Furthermore, the upgrade of a multi-core heterogeneous electric control unit including a microprocessor MPU (also known as the first processor) and a microcontroller MCU (also known as the second processor) can be achieved by, when the electric control unit includes multiple MPUs and one MCU, causing the first upgrade control unit corresponding to the first partition included in the MPU and the second upgrade control unit corresponding to the second partition to flash the multiple MPUs and the MCU according to the upgrade package sent by the diagnostic tool, thereby achieving the upgrade of the multi-core heterogeneous electric control unit; or, when the electric control unit includes one MPU and multiple MCUs, causing the first upgrade control unit corresponding to the first partition included in the MPU and the second upgrade control unit corresponding to the second partition to flash the MPU and the multiple MCUs according to the upgrade package sent by the diagnostic tool, thereby achieving the upgrade of the multi-core heterogeneous electric control unit; or, when the electric control unit includes multiple MPUs and multiple MCUs, causing the first upgrade control unit corresponding to the first partition included in the MPU and the second upgrade control unit corresponding to the second partition to flash the multiple MPUs and the multiple MCUs according to the upgrade package sent by the diagnostic tool, thereby achieving the upgrade of the multi-core heterogeneous electric control unit. In this way, parallel upgrades of MPU, MCU and other processors in the same electronic control unit are achieved.

[0076] Furthermore, in an implementation of the present application, the first processor further includes a storage unit, and the method further includes: the first upgrade control unit stores the upgrade package in the storage unit.

[0077] Exemplarily, after the first upgrade control unit included in the first partition in operation receives the upgrade package transmitted by the diagnostic tool, the upgrade package is stored in the storage unit included in the microprocessor (i.e., the first processor) until it is overwritten during the next upgrade task, thereby ensuring that the software versions of the microcontroller and microprocessor are always the latest versions.

[0078] Furthermore, in one implementation of the present application, before the first upgrade control unit flashes the second processor upgrade package to the second processor, the method also includes: the first upgrade control unit extracts the current program file of the second processor from the second processor, and stores the current program file as the target program file to the storage unit.

[0079] Exemplarily, in order to ensure that the software version of the microcontroller (ie, the second processor) can be rolled back when the upgrade fails, before the microcontroller is flashed, the old software package of the microcontroller (ie, the current program file) is extracted from the microcontroller and stored in the storage unit.

[0080] For example, Figure 5As shown, a program for reading flash is integrated in the first upgrade control unit (that is, the UCM included in partition A), and then the first upgrade control unit first obtains valid MCU software address information from the microcontroller MCU or the MCU software package (that is, the microcontroller upgrade package) obtained from the diagnostic tool, and then reads the MCU's flash program according to the MCU software address information to obtain the software information of the address block.

[0081] For example, use the 0x22 service in the Unified Diagnostic Services (UDS) protocol to read the MCU software address information through the DID (Data Identifier) ​​0xAABB. The diagnostic tool sends the command: 0x22 AABB; the electronic control unit replies: 0x62 02 00030000 0012FFFF 00140000 00157FFF. Among them, 0x02 represents the number of address blocks, and 0x00030000~0x0012FFFF and 0x00140000~0x00157FFF represent the address information. Then use the 0x35, 0x36, and 0x37 services in the UDS protocol to extract the software information of the first address block and the second address block. For the command interaction process, see Figure 5 At the end of each address block software transmission, the ECU replies 0x77XXXX, where XXXX is the CRC (Cyclic Redundancy Check) check value of the transmitted software information. The diagnostic tool compares XXXX with the CRC check value of the diagnostic tool itself on the received software information to verify the integrity of the extracted software information data.

[0082] The following table shows the storage information of the MCU software and Figure 5 The MCU software address information is shown.

[0083] Table 1 MCU software storage information

[0084]

[0085] As shown in Table 1, the storage block identified as 1 in the MCU is BootLoader, with a starting address of 0x00010000, an ending address of 0x0002FFFF, and a size of 0x1FFFF bytes (BootLoader data does not need to be transmitted), the storage block identified as 2 is APP_Application, with a starting address of 0x00030000, an ending address of 0x0012FFFF, and a size of 0x9FFFF bytes, and the storage block identified as 3 is APP_Calibration, with a starting address of 0x00140000, an ending address of 0x00157FFF, and a size of 0x17FFF bytes.

[0086] Table 2 MCU software address information

[0087]

[0088]

[0089] As shown in Table 2, in the MCU software address information 02000300000012FFFF0014000000157FFF, the DID identifier of the MCU software address is AABB, which includes two address blocks 0x02, occupying 1 byte, the address and size of the first memory are 0x00030000 and 0x0012FFFF, respectively, occupying bytes 2-5 and 6-9, and the address and size of the second memory are 0x00140000 and 0x00157FFF, respectively, occupying bytes 10-13 and 14-17. Of course, the MCU software address information can also include information of other address blocks, which will not be described in detail here.

[0090] Furthermore, if Figure 6 As shown, in one implementation of the present application, after the first upgrade control unit completes the flashing of the second partition and the microcontroller (ie, the second processor), the method further includes the following steps.

[0091] S310: When the first upgrade control unit completes flashing of the upgrade package for the second partition and the second processor (ie, the microcontroller), the first upgrade control unit sends a flashing result to the diagnostic tool.

[0092] S320: The diagnostic tool sends a partition activation request to the first upgrade control unit according to the flashing result.

[0093] Exemplarily, when the microprocessor (i.e., the first processor) is running in the first partition, after the first upgrade control unit completes the upgrade of the microcontroller and the second partition of the microprocessor (i.e., the first processor), it feeds back the flashing result of the microcontroller and the second partition to the diagnostic tool. Then, after the diagnostic tool determines that the microcontroller and the second partition have been successfully flashed based on the flashing result, it sends a partition activation request to the first upgrade control unit to request the first upgrade control unit to perform the activation operation.

[0094] S330, the first upgrade control unit resets the activation flags of the first partition and the second partition of the first processor (ie, microprocessor) in response to the partition activation request, so that the activation flag of the first partition is in an inactive state and the activation flag of the second partition is in an active state.

[0095] Exemplarily, after receiving the partition activation request, the first upgrade control unit resets the activation flag to switch the activation flags of the first partition and the second partition, that is, the activation flag of the first partition that was originally in the activated state is switched to the inactivated state, and the activation flag of the second partition that was originally in the inactivated state is switched to the activated state.

[0096] The activation flags of the first partition and the second partition can be determined by pre-defining the activation state flag and the inactivation state flag to determine the current flags of the first partition and the second partition, so that when switching the activation flags of the first partition and the second partition, only the flags of the first partition and the second partition need to be changed. Of course, the activation flags of the first partition and the second partition can also be set in other ways.

[0097] For example, the number "1" indicates the active state, and the number "2" indicates the inactive state, so that when the first partition is in the active state, the current identifier of the first partition is "1", and when the second partition is in the inactive state, the current identifier of the second partition is "2". Furthermore, when resetting the activation flags of the first partition and the second partition, the current identifier of the first partition is switched to "2", and the current identifier of the second partition is switched to "1".

[0098] S340: The diagnostic tool sends a reset request to the first upgrade control unit.

[0099] S350, the first upgrade control unit controls the first processor (i.e., microprocessor) and the second processor (i.e., microcontroller) to reset simultaneously in response to the reset request, and after the reset is completed, puts the second partition and the second processor in a running state, and puts the first partition in a non-running state.

[0100] Exemplarily, after resetting the activation flags of the first partition and the second partition, based on the reset request sent by the diagnostic tool, the microcontroller and the microprocessor are controlled to reset at the same time, and after the reset is completed, the first partition is in a non-operating state, and the second partition and the microcontroller are in an operating state.

[0101] Furthermore, in one implementation of the present application, the second partition includes a second upgrade control unit. When the first partition is in a non-operating state and the second partition is in an operating state, the method also includes: the second upgrade control unit included in the second partition obtains the upgrade package from the storage unit, parses the first processor upgrade package from the upgrade package, and flashes the first processor upgrade package to the first partition.

[0102] Exemplarily, when the second partition is in a running state and the first partition is in a non-running state, that is, when the microprocessor (that is, the first processor) is running in the second partition, the second upgrade control unit included in the second partition determines the microprocessor upgrade package (that is, the first processor upgrade package) based on the stored upgrade package, and then completes the flashing of the first partition in the non-running state, so that the first partition and the second partition of the microprocessor are both flashed, thereby realizing the upgrade of the microprocessor.

[0103] In this way, for the first processor with dual partition function, when flashing the first partition and the second partition, it is only necessary to obtain the upgrade package from the diagnostic tool once, so that when the partition switching flashing is performed subsequently, it is only necessary to obtain the upgrade package from the storage unit to implement the flashing, without the need to obtain the upgrade package from the diagnostic tool again, thereby eliminating the need for secondary interaction between the diagnostic tool and the electronic control unit.

[0104] It should be noted that, in the present application, if the first partition is in a non-operating state and the second partition is in an operating state, the second upgrade control unit included in the second partition flashes the first partition of the microprocessor and the microcontroller based on the upgrade package sent by the received diagnostic tool, and after the flashing is completed, sends the flashing result to the diagnostic tool, so that the diagnostic tool sends a partition activation request to the second upgrade control unit based on the flashing result, so that the second upgrade control unit first resets the activation flag of the first partition and the second partition based on the activation request, and then controls the microprocessor and the microcontroller to reset at the same time based on the reset request, so that after the reset, the first partition is in an operating state and the second partition is in a non-operating state, and then the first upgrade control unit included in the first partition flashes the second partition of the first processor based on the upgrade package stored in the storage unit, completes the upgrade of the microprocessor and the microcontroller, and then completes the upgrade of the electronic control unit.

[0105] Furthermore, in one implementation of the present application, when the first partition is in a non-operating state and the second partition is in an operating state, the method also includes: when the second upgrade control unit receives a rollback request for the electronic control unit sent by the diagnostic tool, resetting the activation flag bits of the first partition and the second partition of the first processor, so that the activation flag bit of the first partition is in an activated state, and the activation flag bit of the second partition is in an inactivated state, and obtaining the target program file from the storage unit, flashing the target program file to the second processor, and completing the rollback processing for the electronic control unit.

[0106] Exemplarily, the second upgrade control unit included in the second partition in the running state completes the rollback processing for the electronic control unit based on the rollback request sent by the diagnostic tool, including: the second upgrade control unit resets the activation flag bits of the first partition and the second partition, and switches the states of the activation flag bits of the first partition and the second partition, so that after completing the reset of the microprocessor (that is, the first processor), the microprocessor runs in the first partition in the running state, and can realize the software version rollback function of the microprocessor without rewriting the microprocessor, and the second upgrade control unit flashes the stored target program file (that is, the old version of the software package of the microcontroller) to the microcontroller (that is, the second processor) to realize the software version rollback of the microcontroller, so that when the microcontroller MCU chip does not have the dual partition function, the rollback function can be realized, and there is no need for the diagnostic tool to transmit the old version of the software package of the microcontroller MCU, that is, the outside world does not need to prepare the old version of the software package, so that the upgrade efficiency can be improved.

[0107] Furthermore, in another implementation of the application, if the first partition is in a running state and the second partition is in a non-running state, the first upgrade control unit, upon receiving a rollback request for the electronic control unit sent by the diagnostic tool, resets the activation flags of the first partition and the second partition, so that the activation flag of the first partition is in a non-activated state and the activation flag of the second partition is in an activated state, obtains the target program file from the storage unit, and flashes the target program file to the second processor to complete the rollback processing for the electronic control unit.

[0108] Exemplarily, when the first partition is in a running state and the second partition is in a non-running state, the activation flags of the first partition and the second partition can be reset by the first upgrade control unit included in the first partition, and the acquired target program file can be flashed to the microcontroller (i.e., the second processor) to implement the rollback processing of the electronic control unit.

[0109] Furthermore, in the present application, after completing the reflashing of the microcontroller and resetting the activation flag, the second upgrade control unit / first upgrade control unit can also control the reset of the microprocessor and microcontroller based on the reset request sent by the diagnostic tool, and after the reset is completed, the microprocessor is run in the newly activated first partition / second partition, and the old version of the microcontroller is run. In this way, based on the rollback request, the software version rollback function of the microprocessor with dual partitions and the software version rollback function of the microcontroller without dual partitions are realized, thereby realizing the software version rollback function of the electronic control unit.

[0110] Furthermore, in one implementation of the present application, when the electronic control unit is powered on, the first partition is in a non-operating state, and the second partition is in an operating state, the method also includes: a second upgrade control unit detects a verification code of the first processor and a verification code of the second processor to verify whether the software version of the currently running first processor and the software version of the second processor belong to the same baseline version.

[0111] If the detected verification code of the first processor is smaller than the verification code of the second processor, it is determined that the software version of the currently running first processor and the software version of the second processor do not belong to the same baseline version, the software version of the first processor is the old baseline version, and the software version of the second processor is the new baseline version. The second upgrade control unit obtains the upgrade package from the storage unit, parses the first processor upgrade package (that is, the microprocessor upgrade package) from the upgrade package, and re-writes the first processor upgrade package to the first partition.

[0112] If the detected verification code of the first processor is equal to the verification code of the second processor, it is determined that the currently running software version of the first processor and the software version of the second processor belong to the same baseline version, and the first processor and the second processor are upgraded successfully.

[0113] Exemplarily, when the electric control unit is powered on, that is, the microcontroller (that is, the second processor) and the microprocessor (that is, the first processor) are powered on and reset, and when the microprocessor is running in the second partition, the second upgrade control unit verifies whether the software versions of the currently running microcontroller MCU and the microprocessor MPU belong to the same baseline version, that is, according to the detected verification code of the MCU and the verification code of the MPU, it is determined whether the MPU software package (that is, the microprocessor upgrade package) and the MCU software package (that is, the microcontroller upgrade package) that are flashed to the microprocessor and the microcontroller in the upgrade task of the microprocessor and the microcontroller are the MPU software package and the MCU software package of the same baseline version. When the verification code of the MCU is greater than the verification code of the MPU, it means that the flashing of the MCU has been successfully completed in the last upgrade task, but the flashing of the MPU is interrupted. Therefore, the second upgrade control unit included in the second partition in the running state obtains the upgrade package stored in the last upgrade task from the NVM (that is, the storage unit), and decompresses the MPU software package (that is, the microprocessor upgrade package) from the upgrade package, and re-writes the MPU software package to the first partition in the non-running state.

[0114] Furthermore, after the second upgrade control unit completes the flashing of the first partition of the microprocessor, it can also send the flashing result to the diagnostic tool, so that the diagnostic tool sends a partition activation request to the second upgrade control unit based on the flashing result, so that the second upgrade control unit resets the activation flags of the first partition and the second partition of the microprocessor based on the received partition activation request, so that the activation flag of the first partition is in an activated state, and the activation flag of the second partition is in an inactive state, so that the first partition of the re-flashed microprocessor can be run when the electronic control unit is powered on next time, that is, the new microprocessor MPU software can be run. In this way, when the upgrade process is interrupted due to unexpected circumstances, the problem of inconsistent software versions can be automatically checked and repaired, and the function of automatic synchronization of the software versions of the microcontroller and the microprocessor can be realized.

[0115] Furthermore, when the checksum of the microcontroller MCU is equal to the checksum of the microprocessor MPU, it indicates that the software version of the microcontroller is consistent with the software version of the microprocessor, and there is no need to perform the "automatic synchronization" operation of the software versions of the microcontroller and the microprocessor. In addition, since in the upgrade task, the activation flags of the first partition and the second partition of the microprocessor are reset only when the microcontroller is successfully flashed, even if the upgrade process is interrupted, the checksum of the MCU will not be less than the checksum of the MPU.

[0116] Furthermore, in another implementation of the application, if the electronic control unit is powered on, the first partition is in a running state, and the second partition is in a non-running state, the first upgrade control unit detects the verification code of the first processor and the verification code of the second processor to verify whether the software version of the currently running first processor and the software version of the second processor belong to the same baseline version.

[0117] If the detected verification code of the first processor is smaller than the verification code of the second processor, it is determined that the software version of the currently running first processor and the software version of the second processor do not belong to the same baseline version, the software version of the first processor is the old baseline version, and the software version of the second processor is the new baseline version. The first upgrade control unit obtains the upgrade package from the storage unit, and parses the first processor upgrade package (that is, the microprocessor upgrade package) from the upgrade package, and re-writes the first processor upgrade package to the second partition.

[0118] If the detected verification code of the first processor is equal to the verification code of the second processor, it is determined that the currently running software version of the first processor and the software version of the second processor belong to the same baseline version, and the first processor and the second processor are upgraded successfully.

[0119] Exemplarily, when the electronic control unit is powered on and the first partition is in a running state and the second partition is in a non-running state, the first upgrade control unit can detect the verification code of the first processor and the verification code of the second processor, and when it is detected that the verification code of the first processor and the verification code of the second processor do not belong to the same baseline version, the first processor upgrade package obtained from the upgrade package stored in the storage unit is rewritten to the second partition in a non-running state, and when the verification code of the first processor is consistent with the verification code of the second processor, it indicates that both the first processor and the second processor are upgraded successfully.

[0120] Furthermore, if Figure 7 As shown, in another implementation of the present application, assuming that the current microprocessor MPU is in an idle state and runs in an activated partition, and partition A is an activated partition (that is, the first partition), and partition B is an inactive partition (that is, the second partition), the electronic control unit upgrade method specifically includes the following steps.

[0121] S1, compressed package release: The publisher combines the MPU software package (also known as the microprocessor upgrade package) and the MCU software package (also known as the microcontroller upgrade package) of the same baseline version into a compressed package (also known as the upgrade package) and releases it.

[0122] For example, when the electronic control unit software is released, the publisher can merge the MCU software package and MPU software package of the same baseline version into one compressed package and only release one compressed package file. This can effectively prevent the upgrade executor from flashing MCU software packages and MPU software packages of different baseline versions into the same electronic control unit when implementing the software upgrade, thereby avoiding vehicle function abnormalities caused by the software versions of the MPU and MCU being out of sync.

[0123] S2, packet transmission: the diagnostic tool requests the upgrade task to start, and the UCM included in the A partition (that is, the first upgrade control unit included in the first partition) obtains a compressed package from the diagnostic tool, and the compressed package includes an MPU software package and an MCU software package.

[0124] Exemplarily, a shared NVM (ie, storage unit) is divided in the MPU, so that after the UCM included in the A partition obtains the compressed package, the compressed package is stored in the NVM to achieve the subsequent software version synchronization function between the MCU and the MPU.

[0125] S3, installation: after the diagnostic tool transfers all the compressed packages to the UCM included in the A partition, it requests the UCM included in the A partition to start installing the MPU and copying the old version software package (ie, the target program file) of the MCU and flashing the MCU.

[0126] Exemplarily, after the UCM included in partition A receives the compressed package transmitted by the diagnostic tool, it decompresses the compressed package, extracts the MPU software package and the MCU software package, and then the UCM included in partition A installs the MPU software package to partition B. Due to the characteristics of the MPU, the process of installing the MPU software package to partition B usually takes a long time, and the installation time is much longer than the flashing time of the MCU.

[0127] At the same time, the UCM included in the A partition first extracts the software data of the current MCU (ie, the old version software package) from the MCU and stores it in the NVM to realize the rollback function of the subsequent MCU, and then flashes the decompressed MCU software package to the MCU.

[0128] For details about copying the old version of the MCU software package, refer to the above description.

[0129] S4, Activation: After the diagnostic tool successfully queries the installation and flashing results (that is, the flashing results), it requests the UCM included in partition A to perform the activation operation, that is, first reset the activation flag of the MPU (that is, the activation flag of the first partition and the second partition of the microprocessor), and then control the MPU and MCU to reset at the same time.

[0130] Exemplarily, after completing the installation of partition B and flashing of the microcontroller MCU, the first upgrade control unit feeds back the successful installation and flashing results to the diagnostic tool, so that the diagnostic tool sends an activation request (i.e., partition activation request) to the first upgrade control unit based on the installation and flashing results. Based on the activation request, the first upgrade control unit resets the activation flag of the MPU to switch partition A to an inactive partition and partition B to an active partition, and then controls the MPU and MCU to reset at the same time. After the reset is completed, the MPU runs partition B and the MCU runs the new version of the MCU software.

[0131] S5, Rollback: The diagnostic tool requests the UCM included in the B partition to perform a rollback operation, that is, the UCM included in the B partition re-writes the old version of the MCU software package to the MCU, and after the flashing is completed, first resets the activation flag of the MPU, and then controls the MPU and MCU to reset at the same time.

[0132] For example, if it is necessary to roll back the software version of the MCU, the UCM included in the B partition will extract the old version of the software package of the MCU and re-flash it to the MCU after receiving the rollback request sent by the diagnostic tool. After the flashing is completed, the activation flag of the MPU will be reset to switch the A partition to the active partition and the B partition to the inactive partition. The MPU and the MCU will then be reset at the same time. After the reset is completed, the MPU will run the A partition and the MCU will run the old version of the MCU software.

[0133] The electric control unit upgrade method provided by the implementation method of the present application is that when the first partition included in the microprocessor MPU is in a running state and the second partition is in a non-running state, the UCM included in the first partition (that is, the first upgrade control unit) obtains the upgrade package from the diagnostic tool and stores it in the NVM (that is, the storage unit), and based on the microcontroller upgrade package and the microprocessor upgrade package obtained from the upgrade package, first extracts the old version software package of the microcontroller (that is, the target program file) and stores it in the NVM, and then flashes the second partition of the microprocessor and the microcontroller MCU. After the flashing is completed, the flashing result is sent to the diagnostic tool, so that the diagnostic tool sends a partition activation request to the UCM included in the first partition based on the flashing result, so that the UCM included in the first partition resets the activation flag bit, so that the activation flag bit of the first partition is in an inactive state. After the activation flag bit of the second partition is in an activated state, the MPU and the MCU are controlled to be reset at the same time, and the second partition and the MCU are run after the reset is completed, and when the software version rollback is required, the old version software package of the extracted MCU is re-flashed to the MCU based on the rollback request sent by the diagnostic tool. Of course, when the first partition is in a non-operating state and the second partition is in an operating state, the second upgrade control unit included in the second partition (ie, the UCM included in the B partition) may perform the above upgrade operation.

[0134] In this way, the upgrade of MCU and MPU is realized based on the UCM included in the first partition of the microprocessor and the UCM included in the second partition, thereby realizing the upgrade of the electronic control unit, so that there is no need to add an additional control center (such as a gateway, etc.) in the vehicle, and the electronic control unit can independently handle its own software upgrade, and the upgrade of MCU and MPU is based on the microcontroller upgrade package and microprocessor upgrade package included in an upgrade package. This can effectively avoid the risk of software version asynchrony between MCU and MPU due to incorrect selection of the required microcontroller upgrade package and microprocessor upgrade package by the upgrade executor, and the upgrade of MCU and MPU is completed based on the microcontroller upgrade package and the microprocessor upgrade package, which can realize parallel upgrade processing of MCU and MPU in the same electronic control unit, save overall upgrade time, thereby improving upgrade efficiency, and avoiding the problem of inconsistent software versions caused by asynchronous upgrade.

[0135] In some possible implementations, various aspects of the method provided in the present application can also be implemented in the form of a program product, which includes program code. When the program product is run on a processor of an electronic device, the program code is used to enable the processor of the electronic device to execute the steps of the method according to various exemplary implementations of the present application described above in this specification. For example, the electronic device can execute the electronic control unit upgrade method recorded in the embodiments of the present application.

[0136] The program product may employ any combination of one or more readable media. The readable medium may be a readable data medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0137] The implementation method of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution of the electric control unit upgrade method in the above-mentioned embodiment can be implemented.

[0138] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable information processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable information processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable information processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0140] These computer program instructions can also be loaded onto a computer or other programmable information processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0141] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

[0142] It should be noted that, in addition to the implementation of the present application described in the above-mentioned specific embodiments, those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Although the description of the present application is introduced in conjunction with the preferred embodiment, this does not mean that the features of this invention are limited to the implementation. On the contrary, the purpose of introducing the invention in conjunction with the implementation is to cover other options or modifications that may extend based on the claims of the present application. In order to provide an in-depth understanding of the present application, the above description contains many specific details, and the present application may also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present application, some specific details will be omitted in the description. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[0143] It should be noted that in this specification, similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0144] The terms “first”, “second”, etc. are only used for distinguishing descriptions and should not be understood as indicating or implying relative importance.

[0145] Although the present application has been illustrated and described by referring to certain preferred implementations of the present application, it should be understood by those skilled in the art that the above contents are further detailed descriptions of the present application in combination with specific implementations, and it cannot be determined that the specific implementation of the present application is limited to these descriptions. Those skilled in the art may make various changes in form and details, including making several simple deductions or substitutions, without departing from the spirit and scope of the present application.

Claims

1. A method for upgrading an electronic control unit, characterized in that: Applied to an electric control unit upgrade system, the electric control unit upgrade system includes a diagnostic tool and an electric control unit, the electric control unit includes a first processor and a second processor, the first processor includes a first partition and a second partition, the first partition includes a first upgrade control unit, when the first partition is in a running state and the second partition is in a non-running state, the method includes: The first upgrade control unit receives an upgrade package sent by the diagnostic tool, wherein the upgrade package includes a first processor upgrade package corresponding to the first processor and a second processor upgrade package corresponding to the second processor; The first upgrade control unit parses the upgrade package to obtain the first processor upgrade package and the second processor upgrade package from the upgrade package, writes the first processor upgrade package to the second partition, and writes the second processor upgrade package to the second processor.

2. The method for upgrading the electronic control unit according to claim 1, characterized in that: The first processor further includes a storage unit, and the method further includes: The first upgrade control unit stores the upgrade package in the storage unit.

3. The method for upgrading the electric control unit according to claim 2, characterized in that: The method further comprises: When the first upgrade control unit completes flashing the upgrade package for the second partition and the second processor, the first upgrade control unit sends a flashing result to the diagnostic tool; The diagnostic tool sends a partition activation request to the first upgrade control unit according to the flashing result; The first upgrade control unit resets the activation flags of the first partition and the second partition of the first processor in response to the partition activation request, so that the activation flag of the first partition is in an inactive state and the activation flag of the second partition is in an active state; The diagnostic tool sends a reset request to the first upgrade control unit; In response to the reset request, the first upgrade control unit controls the first processor and the second processor to be reset simultaneously, and after the reset is completed, puts the second partition and the second processor into a running state and puts the first partition into a non-running state.

4. The method for upgrading the electric control unit according to claim 3, characterized in that: The second partition includes a second upgrade control unit. When the first partition is in a non-operating state and the second partition is in an operating state, the method further includes: The second upgrade control unit included in the second partition obtains the upgrade package from the storage unit, parses the first processor upgrade package from the upgrade package, and writes the first processor upgrade package to the first partition.

5. The method for upgrading the electric control unit according to any one of claims 2 to 4, characterized in that: Before the first upgrade control unit flashes the second processor upgrade package to the second processor, the method further includes: The first upgrade control unit extracts a current program file of the second processor from the second processor, and stores the current program file as a target program file in the storage unit.

6. The method for upgrading the electric control unit according to claim 5, characterized in that: In a case where the first partition is in a non-operating state and the second partition is in an operating state, the method further includes: When the second upgrade control unit receives the rollback request for the electronic control unit sent by the diagnostic tool, it resets the activation flags of the first partition and the second partition of the first processor so that the activation flag of the first partition is activated and the activation flag of the second partition is in an inactive state, and obtains the target program file from the storage unit, flashes the target program file to the second processor, and completes the rollback process for the electronic control unit.

7. The method for upgrading the electric control unit according to claim 4, characterized in that: When the electric control unit is powered on, the first partition is in a non-operating state, and the second partition is in an operating state, the method further includes: The second upgrade control unit detects the verification code of the first processor and the verification code of the second processor to verify whether the currently running software version of the first processor and the software version of the second processor belong to the same baseline version; If the detected check code of the first processor is smaller than the check code of the second processor, it is determined that the software version of the first processor currently running and the software version of the second processor do not belong to the same baseline version, and the software version of the first processor is an old baseline version, and the software version of the second processor is a new baseline version, the second upgrade control unit obtains the upgrade package from the storage unit, parses the upgrade package of the first processor from the upgrade package, and rewrites the upgrade package of the first processor to the first partition; If the detected verification code of the first processor is equal to the verification code of the second processor, it is determined that the currently running software version of the first processor and the software version of the second processor belong to the same baseline version, and the first processor and the second processor are upgraded successfully.

8. An electronic control unit, characterized in that: The electronic control unit includes a first processor and a second processor, the first processor includes a first partition and a second partition, the first partition includes a first upgrade control unit, when the first partition is in a running state and the second partition is in a non-running state, The first upgrade control unit is used to receive an upgrade package sent by a diagnostic tool, the upgrade package including a first processor upgrade package corresponding to the first processor and a second processor upgrade package corresponding to the second processor, and parse the first processor upgrade package and the second processor upgrade package from the upgrade package, flash the first processor upgrade package to the second partition, and flash the second processor upgrade package to the second processor.

9. The electronic control unit according to claim 8, characterized in that: The first processor also includes a storage unit, The storage unit is used to store the upgrade package and the target program file of the second processor.

10. The electronic control unit according to claim 9, characterized in that: The second partition includes a second upgrade control unit, The second upgrade control unit is used to obtain the upgrade package from the storage unit, parse the first processor upgrade package from the upgrade package, and flash the first processor upgrade package to the first partition.

11. An electronic control unit upgrade system, characterized in that: The electric control unit upgrade system includes a diagnostic tool and an electric control unit, wherein the electric control unit includes a first processor and a second processor, wherein the first processor includes a first partition and a second partition, wherein the first partition includes a first upgrade control unit, and when the first partition is in a running state and the second partition is in a non-running state, The diagnostic tool is used to send an upgrade request to the first upgrade control unit; The first upgrade control unit is used to respond to the upgrade request, obtain an upgrade package from the diagnostic tool, the upgrade package including a first processor upgrade package corresponding to the first processor and a second processor upgrade package corresponding to the second processor, and parse the first processor upgrade package and the second processor upgrade package from the upgrade package, flash the first processor upgrade package to the second partition, and flash the second processor upgrade package to the second processor.