A software upgrade system and method for electric power steering based on dual ECUs
By implementing file identification verification, A/B backup, and internal CAN status linkage in the dual ECU system, the problems of mixed use of upgrade files and security in the dual ECU system are solved, realizing safe and reliable upgrades of electric power steering systems, and applicable to electric power steering systems with dual ECU architecture.
Patent Information
- Application Number
- CN202611282810.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-17
AI Technical Summary
Existing software upgrade solutions for electric power steering systems fail to effectively address the issues of file differentiation and target controller matching in dual-ECU systems. This can lead to abnormal steering output and system vibration during the upgrade process, affecting safety and control accuracy. Furthermore, the lack of a recovery mechanism after an upgrade failure increases the risk of system failure.
It employs core mechanisms such as file identification verification, A/B backup fault tolerance, internal CAN status linkage, and dual-end joint verification to ensure the target matching and integrity of the upgrade file, and to restore to the previous usable version in case of upgrade failure. It also uses the internal CAN bus to interact with the controller status to ensure security and consistency.
It effectively prevents ECU file mixing, improves the safety and reliability of the upgrade process, reduces system risks, ensures software version consistency and control accuracy of dual ECU systems, and is suitable for electric power steering systems with dual ECU architecture.
Smart Images

Figure CN123116285A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of automotive electronic software upgrade technology, specifically relating to a software upgrade system and method for electric power steering based on dual ECUs, which is particularly suitable for OTA or diagnostic flashing upgrades of electric power steering systems with dual ECUs and dual redundant control channel architectures. Background Technology
[0002] With the development of vehicle electrification, intelligentization, and advanced driver assistance features, electric power steering (EVS) has gradually evolved from a simple component providing steering assistance to a crucial actuator for lateral control of vehicles. To improve system reliability and meet functional safety requirements, an increasing number of EVS systems are adopting a dual-ECU or dual-control-channel architecture. Compared to single-ECU systems, dual-ECU systems require simultaneous management of the software files, software versions, operating status, and fault recovery strategies of two controllers during over-the-air (OTA) updates or diagnostic flashing. This makes the upgrade process more complex and demands higher standards for safety and consistency.
[0003] Existing software upgrade solutions for electric power steering systems are mostly geared towards single-controller systems, typically focusing only on the software integrity verification and flashing results of a single ECU. Applying a single-ECU upgrade solution directly to a dual-ECU steering system presents the following significant technical drawbacks: Existing single-ECU upgrade solutions typically only process one upgrade file, lacking file differentiation and target controller matching mechanisms for dual-ECU systems. In dual-ECU steering systems, the motor control direction, control parameters, or diagnostic logic of the two ECUs differ. If the software of ECU1 is incorrectly flashed to ECU2, or vice versa, it may lead to abnormal steering output, system vibration, or even damage to the controller or actuator.
[0004] During a dual-ECU system upgrade, if one ECU is in an erase, write, reset, or upgrade waiting state, and the other ECU continues to operate according to normal power steering logic, it may produce unexpected power steering output, interfering with vehicle control and affecting the upgrade process and driving safety. Current solutions do not have a linked safety control mechanism designed for dual-ECU upgrade scenarios.
[0005] The existing solution does not adequately consider the recovery mechanism after the upgrade fails. When a power outage, communication interruption, write failure, or verification failure occurs during the upgrade process, the application may become incomplete, causing the ECU to be unable to restart or continue the upgrade, increasing after-sales maintenance costs and the risk of system failure.
[0006] Existing solutions typically only verify the flashing results of a single ECU, lacking joint verification of the combination of two ECU versions, their operating status, and file matching relationships. If the software logic of the two ECUs is incompatible after the upgrade, it will lead to abnormal dual-control coordination, affecting the control accuracy and functional safety of the steering system.
[0007] Therefore, developing an electric power steering software upgrade system and method that is compatible with dual ECU architecture, prevents file mixing, ensures a safe upgrade process, allows for anomaly recovery, and guarantees version consistency is an urgent technical problem to be solved in this field. Summary of the Invention
[0008] To address the problems raised in the background technology above, the purpose of this invention is to provide a software upgrade system and method for electric power steering based on dual ECUs. Through four core mechanisms—file identification verification, A / B backup fault tolerance, internal CAN status linkage, and dual-end joint verification—the system comprehensively improves the safety and reliability of software upgrades for dual ECU steering systems without increasing hardware costs.
[0009] To achieve the above-mentioned technical objectives, the technical solution adopted by the present invention is as follows: A software upgrade system for an electric power steering system based on dual ECUs includes a first controller, a second controller, an internal CAN bus, and a vehicle CAN bus; The first controller and the second controller are electrically connected via an internal CAN bus for exchanging software version numbers, system status, upgrade status, and fault status; both the first controller and the second controller are connected to the vehicle via the vehicle's CAN bus to receive upgrade requests and upgrade data. The storage areas of both the first and second controllers are divided into a BOOT area, an APP running area, and a backup area; the BOOT area is used for power-on startup, application validity judgment, and jump control; the APP running area is used to store the currently running application; and the backup area is used to store the previous available version of the application. Both the first and second controllers are configured with software upgrade management logic, which is used to perform upgrade file verification, program backup and flashing, anomaly recovery and status interaction control.
[0010] Further specifying, the APP running area is area A, and the backup area is area B; Before the upgrade, the first or second controller copies the currently runnable program in area A to area B and performs an integrity check. After the check passes, area A is erased and written. After an upgrade failure, the BOOT area determines the validity of the program in area A. If the program in area A is invalid, the backup program in area B is restored to area A or directly booted to area B for operation.
[0011] Further specified, the upgrade files for the dual ECUs include an ECU1 upgrade file corresponding to the first controller and an ECU2 upgrade file corresponding to the second controller, and each upgrade file has a file identifier field and a hash verification field written in a preset data area; The file identifier field is used to identify the target controller corresponding to the upgrade file, and the hash verification field is used to identify the integrity of the specified data segment of the upgrade file; After receiving the upgrade file, the first or second controller first reads the file identifier field to determine if it matches its own. If they do not match, the flashing is prohibited. If they match, the hash value of the upgrade file is recalculated and compared with the hash verification field. If they do not match, the file is determined to be abnormal and the flashing is prohibited.
[0012] Further defined, the system states include initialization state, normal assist state, fault state, safety state, and flashing state; Before either controller enters the write state, it sends a write status signal to the other controller via the internal CAN bus; upon receiving the signal, the other controller enters a safe state and stops normal power output.
[0013] Further, after both the first and second controllers have completed their upgrades, they exchange the upgraded software version number and system status via the internal CAN bus; the system will only resume normal power output when the software versions of the two controllers meet the preset matching relationship and neither is in an upgrade failure or fault state.
[0014] A method for upgrading the software of an electric power steering system based on dual ECUs includes the following steps: The S1 vehicle terminal sends an upgrade request and two upgrade files. After receiving the files, the system selects the controller to be upgraded according to the preset upgrade order. The S2 controller to be upgraded verifies the corresponding upgrade file. After the verification is successful, it notifies the other controller to enter a safe state. The S3 controller to be upgraded performs a backup of the current program, and then erases and writes the program in the running area; if an abnormality occurs during the upgrade process, it will be restored from the backup area to the previous usable version; After a single S4 controller is upgraded, the two controllers exchange status and version information via an internal bus; the upgrade of the other controller is then completed in a preset order. After both S5 controllers have been upgraded, a joint verification of the version combination and operating status is performed. If the verification passes, normal power output is restored.
[0015] Further specifying, the upgrade file verification in S2 specifically includes: S21: Read the file identifier field in the upgrade file and determine whether it matches the controller to be upgraded; if they do not match, terminate the upgrade and report a file mismatch fault. S22: If the identifier matches, the hash value of the specified data segment of the upgrade file is recalculated according to the preset algorithm and compared with the hash verification field in the file; if the comparison is inconsistent, the file is determined to be abnormal and the upgrade is terminated.
[0016] Further specifying, S3 specifically refers to: The S31 controller to be upgraded copies the current running program in area A to area B for backup and performs a CRC integrity check to confirm the validity of the backup data; After the S32 verification passes, the original program in area A is erased, and upgrade data is received and written. After the S33 write is completed, data verification is performed. If the verification passes, the program validity flag is updated. If there is an abnormal situation such as power failure, communication interruption, or verification failure, the BOOT area will determine that the program in area A is invalid when powered on, and restore the backup program in area B to area A or directly jump to area B for operation.
[0017] Further specifying, the notification to another controller to enter a safe state in S2 specifically refers to: The controller to be upgraded switches its system status to the write state and periodically sends the write status signal through the internal CAN bus; after receiving the write status signal, the other controller switches to the safe state, stops the normal power output, and turns off the drive pre-drive or adjusts the output to the preset safe duty cycle.
[0018] Further specifying, S4 specifically includes the following steps: S41 first completes the upgrade of the first controller in a preset order. If the upgrade is successful, it continues to perform the upgrade process of file verification, status notification, and backup flashing on the second controller. If the upgrade fails, it maintains a safe state and reports the abnormality. S5 specifically includes the following steps: After both the first and second S51 controllers have been upgraded, they send each other their own software version numbers and operating status. After S52 confirms that the version numbers of the first controller and the second controller match the preset relationship and that there are no faults or upgrade failures, the system exits the safe state and resumes normal power output; if the verification fails, the safe state is maintained and an anomaly is reported.
[0019] The beneficial effects of this invention are: 1. This invention effectively prevents the mixing of ECU1 upgrade files and ECU2 upgrade files by setting a target ECU identifier field in the upgrade file and performing target matching verification on the ECU end, thereby reducing the risk of incorrect flashing of dual ECU systems from the source.
[0020] 2. This invention confirms the integrity of the upgrade file data through hash verification, and can identify problems such as file tampering, abnormal transmission or storage, preventing abnormal files from being written or run, and ensuring the reliability of the program after flashing.
[0021] 3. This invention, through an A / B backup strategy, can restore to the previous usable version after upgrade failure, power outage, or verification failure, keeping the controller in a bootable and upgradeable state, greatly reducing the risk of bricking the device and improving upgrade fault tolerance.
[0022] 4. This invention utilizes an internal CAN bus to exchange the upgrade status and system status of the two controllers, so that when one ECU is being upgraded, the other ECU enters a safe state, avoiding unexpected power steering output during the upgrade process and improving the safety of the upgrade process.
[0023] 5. After the upgrade is completed, the present invention jointly confirms the software version number and status of the two ECUs, which can ensure that the dual ECU system operates according to the preset software combination and reduce the control logic differences and coordination anomalies caused by version inconsistencies.
[0024] 6. This invention is mainly implemented through software logic and existing internal CAN communication, without significantly increasing hardware costs. It is suitable for electric power steering systems with dual controllers, dual motors, or redundant control channels, and has strong engineering feasibility. Attached Figure Description
[0025] The present invention can be further illustrated by the non-limiting embodiments given in the accompanying drawings; Figure 1 This is a flowchart illustrating the steps of an embodiment of the electric power steering software upgrade system and method based on dual ECUs of the present invention. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be further described below with reference to the accompanying drawings and embodiments. The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. The technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention. It should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0027] like Figure 1 As shown, the present invention provides a software upgrade system for an electric power steering system based on dual ECUs, including a first controller, a second controller, an internal CAN bus, and a vehicle CAN bus. The first controller and the second controller are electrically connected via an internal CAN bus for exchanging software version numbers, system status, upgrade status, and fault status; both the first controller and the second controller are connected to the vehicle via the vehicle's CAN bus to receive upgrade requests and upgrade data. The storage areas of both the first and second controllers are divided into a BOOT area, an APP running area, and a backup area; the BOOT area is used for power-on startup, application validity judgment, and jump control; the APP running area is used to store the currently running application; and the backup area is used to store the previous available version of the application. Both the first and second controllers are configured with software upgrade management logic, which is used to perform upgrade file verification, program backup and flashing, anomaly recovery and status interaction control.
[0028] In the practical application of this embodiment, the APP running area is area A, and the backup area is area B; Before the upgrade, the first or second controller copies the currently runnable program in area A to area B and performs an integrity check. After the check passes, area A is erased and written. After an upgrade failure, the BOOT area determines the validity of the program in area A. If the program in area A is invalid, the backup program in area B is restored to area A or directly booted to area B for operation.
[0029] In the practical application of this embodiment, the upgrade files of the dual ECUs include the ECU1 upgrade file corresponding to the first controller and the ECU2 upgrade file corresponding to the second controller. Each upgrade file has a file identifier field and a hash verification field written in a preset data area. The file identifier field is used to identify the target controller corresponding to the upgrade file, and the hash verification field is used to identify the integrity of the specified data segment of the upgrade file; After receiving the upgrade file, the first or second controller first reads the file identifier field to determine if it matches its own. If they do not match, flashing is prohibited. If they match, the hash value of the upgrade file is recalculated and compared with the hash verification field. If they do not match, the file is deemed abnormal and flashing is prohibited. Specifically, through dual verification of the file identifier field and the hash verification field, this invention can not only prevent the mixed flashing of ECU1 upgrade files and ECU2 upgrade files, but also detect data anomalies in the generation, transmission, and storage of upgrade files, thereby improving the accuracy and security of dual ECU upgrades.
[0030] In practical applications of this embodiment, the system states include initialization state, normal assist state, fault state, safety state, and flashing state; Before either controller enters the write state, it sends a write status signal to the other controller via the internal CAN bus; upon receiving the signal, the other controller enters a safe state and stops normal power output.
[0031] In the practical application of this embodiment, after both the first controller and the second controller have completed the upgrade, they exchange the upgraded software version number and system status through the internal CAN bus; the system resumes normal power output only when the software versions of the two controllers meet the preset matching relationship and neither of them is in an upgrade failure or fault state.
[0032] Specifically, during the upgrade phase, the upgrade order can be set to upgrade ECU1 first and then ECU2, or it can be set to upgrade ECU2 first and then ECU1, depending on the vehicle's overall strategy. Taking upgrading ECU1 first as an example, before ECU1 enters the flashing state, it sends a flashing status signal to ECU2 via internal CAN. After receiving this signal, ECU2 enters a safe state, stops normal power steering output, or disables pre-drive and adjusts the three-phase output to a preset safe duty cycle. After ECU1 completes the flashing and verification, it sends an upgrade completion or upgrade failure status to ECU2 via internal CAN. If ECU1 upgrades successfully, the system continues to perform the same file identifier verification, hash verification, A / B backup, and flashing process on ECU2; if ECU1 upgrade fails, ECU2 remains in a safe state or fault handling state and reports the upgrade anomaly via the vehicle's CAN bus.
[0033] After both ECU1 and ECU2 have completed their upgrades, the two controllers exchange upgraded software version numbers and system status via internal CAN. Normal power steering is only allowed to resume when the software version numbers of the two controllers meet a preset matching relationship and neither controller is in a failed or faulty state. If the version numbers are inconsistent, the file identifiers do not match, or either controller is in an upgrade failure state, the system remains in a safe state and reports the anomaly to the vehicle.
[0034] A method for upgrading the software of an electric power steering system based on dual ECUs includes the following steps: The S1 vehicle terminal sends an upgrade request and two upgrade files. After receiving the files, the system selects the controller to be upgraded according to the preset upgrade order. The S2 controller to be upgraded verifies the corresponding upgrade file. After the verification is successful, it notifies the other controller to enter a safe state. The S3 controller to be upgraded performs a backup of the current program, and then erases and writes the program in the running area; if an abnormality occurs during the upgrade process, it will be restored from the backup area to the previous usable version; After a single S4 controller is upgraded, the two controllers exchange status and version information via an internal bus; the upgrade of the other controller is then completed in a preset order. After both S5 controllers have been upgraded, a joint verification of the version combination and operating status is performed. If the verification passes, normal power output is restored.
[0035] In the practical application of this embodiment, the upgrade file verification in S2 specifically involves: S21: Read the file identifier field in the upgrade file and determine whether it matches the controller to be upgraded; if they do not match, terminate the upgrade and report a file mismatch fault. S22: If the identifier matches, the hash value of the specified data segment of the upgrade file is recalculated according to the preset algorithm and compared with the hash verification field in the file; if the comparison is inconsistent, the file is determined to be abnormal and the upgrade is terminated.
[0036] In the practical application of this embodiment, S3 specifically refers to: The S31 controller to be upgraded copies the current running program in area A to area B for backup and performs a CRC integrity check to confirm the validity of the backup data; After the S32 verification passes, the original program in area A is erased, and upgrade data is received and written. After the S33 write is completed, data verification is performed. If the verification passes, the program validity flag is updated. If there is an abnormal situation such as power failure, communication interruption, or verification failure, the BOOT area will determine that the program in area A is invalid when powered on, and restore the backup program in area B to area A or directly jump to area B for operation.
[0037] In the practical application of this embodiment, the step S2, which notifies another controller to enter a safe state, specifically means: The controller to be upgraded switches its system status to the write state and periodically sends the write status signal through the internal CAN bus; after receiving the write status signal, the other controller switches to the safe state, stops the normal power output, and turns off the drive pre-drive or adjusts the output to the preset safe duty cycle.
[0038] In practical applications of this embodiment, step S4 specifically includes the following steps: S41 first completes the upgrade of the first controller in a preset order. If the upgrade is successful, it continues to perform the upgrade process of file verification, status notification, and backup flashing on the second controller. If the upgrade fails, it maintains a safe state and reports the abnormality. S5 specifically includes the following steps: After both the first and second S51 controllers have been upgraded, they send each other their own software version numbers and operating status. After S52 confirms that the version numbers of the first controller and the second controller match the preset relationship and that there are no faults or upgrade failures, the system exits the safe state and resumes normal power output; if the verification fails, the safe state is maintained and an anomaly is reported.
[0039] This embodiment applies to an electric power steering system with a dual-ECU architecture. The two controllers are ECU1 and ECU2, which are interconnected via an internal CANFD bus and connected to the vehicle's OTA system via the vehicle's CAN bus. The specific implementation process is as follows: 1. Upgrade file preprocessing and verification rules After the compiler generates a program file in HEX or S19 format, it processes the file using a file handling script: Perform a hash operation on the file data within a preset range from the start address to the end address, and write the result to the preset address of the upgrade file as a hash verification field; Write the file identifier field according to the target controller corresponding to the file. For example, write the first identifier value AAAAAAAA to the ECU1 upgrade file and write the second identifier value 55555555 to the ECU2 upgrade file.
[0040] The controller has the same built-in hash algorithm and identifier judgment logic. After receiving the upgrade file, it first reads the file identifier field. If it does not match its own controller number, the flashing process is terminated and a "file mismatch" fault is reported through the vehicle's CAN bus. If the identifier matches, the hash value is recalculated according to the same address range and compared with the hash verification field in the file. If the comparison is consistent, the erase and write process is allowed. If they are inconsistent, the file is determined to be corrupted or tampered with, and the flashing process is prohibited.
[0041] 2. Controller storage partitioning and A / B backup recovery Each controller's PFLASH area is divided into three parts: BOOT area, A area, and B area. BOOT area: Stores the boot program and is responsible for power-on initialization, program validity verification, and partition jump control; Area A: APP running area, storing currently active applications; Section B: Backup section, storing the complete and usable program of the previous version.
[0042] During the upgrade process based on UDS diagnostic flashing logic, before entering the erase area A process, the controller first copies the current complete program of area A to area B and performs a CRC check to confirm that the data in area B is completely consistent with that in area A and is usable. After the check passes, the erase of area A is performed through the UDS31 service, and the data download and transmission are completed and exited through services 34, 36, and 37. After the download is completed, the data is checked again through service 31.
[0043] If the verification passes, the validity flag of the A-zone program is updated, and the BOOT zone can jump to the A-zone to run normally. If the verification fails, communication is interrupted during the flashing process, or power is lost during the upgrade process, the BOOT zone will check the validity flag of the A-zone when it is powered on again. If the A-zone program is determined to be invalid, the backup program in the B-zone will be automatically restored to the A-zone, or the system will be directly guided to run in the B-zone, keeping the controller in a state where it can be started and upgraded again.
[0044] 3. Internal CAN interaction and safety status control The dual-controller steering system is equipped with an internal CAN bus. The internal CAN uses CANFD communication, and the data domain rate and arbitration domain rate can be set according to the project's communication matrix, for example, a data domain rate of 2MHz, an arbitration domain rate of 500kHz, or other preset rates. The interaction signals are defined as follows: Software version number: 4-byte encoding, with the high byte being the major version number and the low 3 bytes being the sub-version number; System status: 1 byte encoding, corresponding to five states: initialization, normal assist, fault, flashing, and safe waiting; Upgrade status: Indicates the process of upgrade starting, erasing, downloading, verification, upgrade completed, upgrade failed, etc.; fault codes and security confirmation information.
[0045] During normal system operation, the two controllers periodically read each other's version number and status to confirm version matching and normal status. Before one controller enters the flashing process, it switches its own system status to "flashing status" and periodically sends this information via internal CAN. Upon receiving the flashing status, the other controller immediately switches to "safe status," stops normal power assist output, disables drive pre-drive, or adjusts the three-phase output to a preset safe state with a 50% duty cycle. After flashing is complete, the controller being flashed sends an "upgrade complete" or "upgrade failed" status; if the upgrade fails, fault handling is triggered and reported to the vehicle system.
[0046] 4. Complete Dual ECU Upgrade Process The vehicle's OTA (Over-The-Air) system sends an upgrade request to the steering system and distributes two upgrade files, ECU1 and ECU2. The system's default upgrade order is to upgrade ECU1 first, then ECU2. The complete process is as follows: The system first receives two upgrade files, and then performs file identifier verification and hash verification on the ECU1 upgrade file. After the verification is successful, ECU1 switches to flashing mode and notifies ECU2 to enter safe mode via internal CAN. Subsequently, ECU1 executes a complete flashing process, including backing up the program from area A to area B, CRC verification, erasing area A, data download, and writing verification. When ECU1 is successfully upgraded, an upgrade completion status is sent; if the upgrade fails, the system remains in a safe state and reports the upgrade error via the vehicle's CAN bus. After ECU1 is successfully upgraded, the system performs the same verification, status notification, backup and flashing process on the ECU2 upgrade file. After both controllers have been upgraded, they exchange upgraded version numbers and system status with each other via internal CAN. If any ECU experiences a file identifier mismatch, hash verification failure, communication interruption, write failure, or version matching failure during the upgrade process, the system will terminate the current upgrade process, restore the previous available version according to the A / B backup strategy, maintain a safe or faulty state, and report the abnormal information via the vehicle's CAN bus.
[0047] The above embodiments fully realize the safe and reliable upgrade of the dual-ECU electric power steering system. All functions are implemented based on existing hardware and communication resources, without the need for additional hardware costs, and can effectively solve the four core defects of the existing technology.
[0048] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A software upgrade system for an electric power steering system based on dual ECUs, characterized in that: This includes the first controller, the second controller, the internal CAN bus, and the vehicle CAN bus; The first controller and the second controller are electrically connected via an internal CAN bus for exchanging software version numbers, system status, upgrade status, and fault status. Both the first controller and the second controller are connected to the vehicle via the vehicle's CAN bus to receive upgrade requests and upgrade data. The storage areas of both the first and second controllers are divided into a BOOT area, an APP running area, and a backup area; the BOOT area is used for power-on startup, application validity judgment, and jump control; the APP running area is used to store the currently running application; and the backup area is used to store the previous available version of the application. Both the first and second controllers are configured with software upgrade management logic, which is used to perform upgrade file verification, program backup and flashing, anomaly recovery and status interaction control.
2. The electric power steering software upgrade system based on dual ECUs according to claim 1, characterized in that: The APP running area is area A, and the backup area is area B; Before the upgrade, the first or second controller copies the currently runnable program in area A to area B and performs an integrity check. After the check passes, area A is erased and written. After an upgrade failure, the BOOT area determines the validity of the program in area A. If the program in area A is invalid, the backup program in area B is restored to area A or directly booted to area B for operation.
3. The electric power steering software upgrade system based on dual ECUs according to claim 1, characterized in that: The upgrade files for the dual ECUs include an ECU1 upgrade file corresponding to the first controller and an ECU2 upgrade file corresponding to the second controller. Each upgrade file has a file identifier field and a hash verification field written in a preset data area. The file identifier field is used to identify the target controller corresponding to the upgrade file, and the hash verification field is used to identify the integrity of the specified data segment of the upgrade file; After receiving the upgrade file, the first or second controller first reads the file identifier field to determine whether it matches its own; if it does not match, the flashing is prohibited. After matching, the hash value of the upgrade file is recalculated and compared with the hash verification field. If they do not match, the file is determined to be abnormal and flashing is prohibited.
4. The electric power steering software upgrade system based on dual ECUs according to claim 1, characterized in that: The system states include initialization state, normal assist state, fault state, safety state, and flashing state. Before either controller enters the write state, it sends a write status signal to the other controller via the internal CAN bus; upon receiving the signal, the other controller enters a safe state and stops normal power output.
5. The electric power steering software upgrade system and method based on dual ECUs according to claim 1, characterized in that: After both the first and second controllers have completed their upgrades, they exchange the upgraded software version number and system status via the internal CAN bus. The system resumes normal power assist output only when the software versions of the two controllers meet the preset matching relationship and neither of them is in an upgrade failure or fault state.
6. A method for upgrading the software of an electric power steering system based on dual ECUs, characterized in that, Includes the following steps: The S1 vehicle terminal sends an upgrade request and two upgrade files. After receiving the files, the system selects the controller to be upgraded according to the preset upgrade order. The S2 controller to be upgraded verifies the corresponding upgrade file. After the verification is successful, it notifies the other controller to enter a safe state. The S3 controller to be upgraded performs a backup of the current program, and then erases and writes the program in the running area; If an error occurs during the upgrade process, the system will restore the previous usable version from the backup area. After a single S4 controller is upgraded, the two controllers exchange status and version information via an internal bus; the upgrade of the other controller is then completed in a preset order. After both S5 controllers have been upgraded, a joint verification of the version combination and operating status is performed. If the verification passes, normal power output is restored.
7. A method for upgrading electric power steering software based on dual ECUs according to claim 6, characterized in that, The upgrade file verification in S2 specifically involves: S21: Read the file identifier field in the upgrade file and determine whether it matches the controller to be upgraded; if they do not match, terminate the upgrade and report a file mismatch fault. S22: If the identifier matches, the hash value of the specified data segment of the upgrade file is recalculated according to the preset algorithm and compared with the hash verification field in the file; if the comparison is inconsistent, the file is determined to be abnormal and the upgrade is terminated.
8. A method for upgrading electric power steering software based on dual ECUs according to claim 6, characterized in that, Specifically, S3 is: The S31 controller to be upgraded copies the current running program in area A to area B for backup and performs a CRC integrity check to confirm the validity of the backup data; After the S32 verification passes, the original program in area A is erased, and upgrade data is received and written. After the S33 write is completed, data verification is performed. If the verification passes, the program validity flag is updated. If there is an abnormal situation such as power failure, communication interruption, or verification failure, the BOOT area will determine that the program in area A is invalid when powered on, and restore the backup program in area B to area A or directly jump to area B for operation.
9. A method for upgrading electric power steering software based on dual ECUs according to claim 6, characterized in that, Specifically, in S2, notifying the other controller to enter a safe state means: The controller to be upgraded switches its system status to the write state and periodically sends the write status signal through the internal CAN bus; after receiving the write status signal, the other controller switches to the safe state, stops the normal power output, and turns off the drive pre-drive or adjusts the output to the preset safe duty cycle.
10. A method for upgrading electric power steering software based on dual ECUs according to claim 6, characterized in that, S4 specifically includes the following steps: S41 first completes the upgrade of the first controller in a preset order. If the upgrade is successful, it continues to perform the upgrade process of file verification, status notification, and backup flashing on the second controller. If the upgrade fails, it maintains a safe state and reports the abnormality. S5 specifically includes the following steps: After both the first and second S51 controllers have been upgraded, they send each other their own software version numbers and operating status. After S52 confirms that the version numbers of the first controller and the second controller match the preset relationship and that there are no faults or upgrade failures, the system exits the safe state and resumes normal power output; if the verification fails, the safe state is maintained and an anomaly is reported.
