The invention discloses a double-layer BootLoader method for supporting a UDS service of a
new energy automobile, and the method comprises the steps: S1, starting a first layer BootLoader after a
system is powered on, executing hardware initialization, receiving an external diagnosis instruction according to a UDS protocol, and judging whether a legal
firmware updating request exists or not; if the updating request exists, entering a downloading mode; s2, new
firmware data are received in a segmented mode through the block
transmission function of the UDS service, signature is conducted after
data integrity is verified in real time in the receiving process, then the first layer BootLoader temporarily stores new
firmware in a
backup storage area, version information is updated, and then
system reset is triggered; s3, after the
system is reset, activating the second layer BootLoader, reading the new firmware written into the
backup storage area, verifying the integrity and function logic of the firmware again, and if
verification fails, rolling back to the original version and recording an error log; and if the
verification is successful, the second layer BootLoader skips to the updated application program area for execution. The firmware integrity is guaranteed, and system
paralysis caused by single-point failure is avoided.