Software program rollback method and device based on diagnostic service message

Through the method based on diagnostic service packets, software programs are downloaded, backed up and rolled back, and the checksum verification operation is successful, solving the problem of software unsuccessful update in the existing technology with low freedom of software rollback operation and abnormality. It realizes flexible backup and rollback of software.

CN118885332APending Publication Date: 2024-11-01BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411018049.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The existing software program rollback logic has low freedom. The abnormal situation during update causes the software to fail to rollback successfully, and the old software is erased, making it difficult to trigger the rollback logic.

Method used

Using the software program rollback method based on diagnostic service messages, by obtaining the target download request, downloading the software to the running area, performing backup and rollback operations, using the checksum verification operation to successfully, and processing the reset of the electronic control unit when the backup fails state.

Benefits of technology

It realizes flexible backup and rollback of software programs, avoiding the difficulty of software rollback, and improving operational flexibility and success rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885332A_ABST
    Figure CN118885332A_ABST
Patent Text Reader

Abstract

The invention provides a software program rollback method and device based on a diagnosis service message, and the method comprises the steps: obtaining a target downloading request, and downloading first target software to a software operation region based on the downloading request; obtaining a first diagnosis service message, wherein the message comprises a backup operation request; executing a backup operation based on the operation request, the backup operation being used for copying the first target software from the software operation area to a software backup storage area for storage to obtain second target software; obtaining a second diagnosis service message, wherein the second diagnosis service message comprises a rollback operation request; and executing a rollback operation based on the operation request, the rollback operation being used for erasing the first target software in the software operation area, and copying the second target software from the software backup storage area to the software operation area to obtain third target software. Therefore, after the software is downloaded, the software is backed up, and then the rollback operation is performed based on the backup, so that the condition that the software program is difficult to roll back is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automotive electronics technology, and in particular to a software program rollback method and device based on a diagnostic service message. Background Art

[0002] At present, for the existing program logic, whether to perform program backup and whether to enter program rollback when the program is abnormal, the degree of freedom in executing these operations is not high; secondly, the abnormal situation generated when updating the software causes the software to fail to update successfully, and the old software has been erased. This makes it difficult to roll back when the software is abnormal.

[0003] Therefore, there is an urgent need for a software program rollback method to avoid the situation where the software program is difficult to roll back. Summary of the invention

[0004] In view of this, the present application provides a software program rollback method and device based on diagnostic service messages.

[0005] In a first aspect, the present application provides a software program rollback method based on a diagnostic service message, the method comprising:

[0006] Get the target download request;

[0007] Downloading the first target software to the software running area based on the target download request;

[0008] Obtaining a first diagnostic service message, wherein the first diagnostic service message includes a backup operation request;

[0009] Performing a backup operation based on the backup operation request, wherein the backup operation is used to copy the first target software from the software running area to the software backup storage area for storage, thereby obtaining a second target software;

[0010] Obtaining a second diagnostic service message, where the second diagnostic service message includes a rollback operation request;

[0011] A rollback operation is performed based on the rollback operation request, wherein the rollback operation is used to erase the first target software in the software running area and copy the second target software from the software backup storage area to the software running area to obtain the third target software.

[0012] In a possible implementation, downloading the target software to the software running area based on the target download request includes:

[0013] Get the first checksum;

[0014] Taking the data content of the first target software as input, calculating a second checksum;

[0015] If the first checksum is the same as the second checksum, it is determined that the software running area is a valid area and the target software is successfully downloaded to the software running area.

[0016] In a possible implementation manner, the performing the backup operation based on the backup operation request includes:

[0017] Taking the data content of the second target software as input, calculating a third checksum;

[0018] If the second checksum is the same as the third checksum, it is determined that the software backup storage area is a valid area and that the backup operation is successfully performed.

[0019] In a possible implementation manner, performing the rollback operation based on the rollback operation request includes:

[0020] Taking the data content of the third target software as input, calculating a fourth checksum;

[0021] If the third checksum is the same as the fourth checksum, it is determined that the rollback operation is successfully performed.

[0022] In a possible implementation, if the backup operation fails, the method further includes:

[0023] Get target reset data;

[0024] determining whether the electronic control unit is in a reset state based on the target reset data;

[0025] If the electronic control unit is in a reset state, an abnormal message is sent to the electronic control unit, where the abnormal message is used to indicate that the software backup storage area is an invalid area.

[0026] In a second aspect, the present application further provides a program rollback device based on a diagnostic service message, the device comprising:

[0027] A first acquisition unit, used for acquiring a target download request;

[0028] A downloading unit, configured to download the first target software to a software running area based on the target download request;

[0029] A second acquiring unit, configured to acquire a first diagnostic service message, wherein the first diagnostic service message includes a backup operation request;

[0030] A backup unit, configured to perform a backup operation based on the backup operation request, wherein the backup operation is used to copy the first target software from the software running area to the software backup storage area for storage, thereby obtaining a second target software;

[0031] A third acquiring unit, configured to acquire a second diagnostic service message, wherein the second diagnostic service message includes a rollback operation request;

[0032] The rollback unit is used to perform a rollback operation based on the rollback operation request, wherein the rollback operation is used to erase the first target software in the software running area and copy the second target software from the software backup storage area to the software running area to obtain the third target software.

[0033] In a possible implementation, the downloading unit is specifically used to:

[0034] Get the first checksum;

[0035] Taking the data content of the first target software as input, calculating a second checksum;

[0036] If the first checksum is the same as the second checksum, it is determined that the software running area is a valid area and the target software is successfully downloaded to the software running area.

[0037] In a possible implementation, the backup unit is specifically used to:

[0038] Taking the data content of the second target software as input, calculating a third checksum;

[0039] If the second checksum is the same as the third checksum, it is determined that the software backup storage area is a valid area and that the backup operation is successfully performed.

[0040] In a possible implementation, the rollback unit is specifically configured to:

[0041] Taking the data content of the third target software as input, calculating a fourth checksum;

[0042] If the third checksum is the same as the fourth checksum, it is determined that the rollback operation is successfully performed.

[0043] In a possible implementation, if the backup operation fails, the device further includes:

[0044] A fourth acquisition unit, used to acquire target reset data;

[0045] a determination unit, configured to determine whether the electronic control unit is in a reset state based on the target reset data;

[0046] A control unit is used to send an abnormal message to the electronic control unit if the electronic control unit is in a reset state, wherein the abnormal message is used to indicate that the software backup storage area is an invalid area.

[0047] It can be seen that this application has the following beneficial effects:

[0048] The present application provides a software program rollback method and device based on a diagnostic service message, first, obtaining a target download request; then downloading a first target software to a software running area based on the target download request; obtaining a first diagnostic service message, wherein the first diagnostic service message includes a backup operation request; performing a backup operation based on the backup operation request, wherein the backup operation is used to copy the first target software from the software running area to the software backup storage area for storage, thereby obtaining a second target software; obtaining a second diagnostic service message, wherein the second diagnostic service message includes a rollback operation request; performing a rollback operation based on the rollback operation request, wherein the rollback operation is used to erase the first target software in the software running area, and copy the second target software from the software backup storage area to the software running area, thereby obtaining a third target software. In this way, after downloading the software, the software is backed up in combination with the diagnostic service message, and then the rollback operation is performed based on the software backup in combination with the diagnostic service message, thereby avoiding the situation where the software program is difficult to roll back. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0050] Figure 1 A method flow chart of a software program rollback method based on a diagnostic service message provided in an embodiment of the present application;

[0051] Figure 2 A device flow chart of a software program rollback device based on diagnostic service messages provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to facilitate understanding and explanation of the technical solutions provided by the embodiments of the present application, the terms that may be involved in the embodiments of the present application and the background technology of the present application are first described below:

[0053] Unified Diagnostic Services (UDS).

[0054] Electronic Control Unit ECU (Electronic Control Unit, ECU).

[0055] A software program refers to the program of this software, which can also be called software or application software. A software program refers to a collection of computer data and instructions organized in a specific order. Simply put, a software program is a set of instructions designed for a computer to guide its work. Generally speaking, software programs are divided into two categories: system software and application software. System software is responsible for managing various independent hardware in a computer system so that they can work in coordination. Application software is software developed for a specific purpose.

[0056] Software execution area: also called software running area, the address area where the application software logic is executed. When the application software is stored in the software running area, it can be jumped to execute through the bootloader (BT), that is, the bootloader jumps to the software running area to execute the software, and every time the BT (bootloader) updates the software in the download area, it means that the software is updated in the software running area.

[0057] Software backup area: It can also be called software backup storage area. It is the destination area where the copy action is performed when backing up application software. Generally, the software in this area will not be executed. The software in the software backup storage area is copied from the software in the software running area. When the rollback operation is performed, the software in the software backup storage area will be copied to the software running area. Software execution area / software backup area valid: refers to the software execution area being valid and the software backup area being valid, that is, the software execution area stores fully functional software and the software backup area also stores fully functional software. Specifically, it can be manifested as the valid flag bit in the software execution area is equal to the valid value set in the software execution area, and the valid flag bit in the software backup area is equal to the valid value set in the software backup area.

[0058] The software execution area / software backup area is invalid: refers to the software execution area and the software backup area being invalid, that is, no software with complete functions is stored in the software execution area and no software with complete functions is stored in the software backup area. Specifically, it can be manifested as the valid flag bit in the software execution area is not equal to the valid value set in the software execution area, and the valid flag bit in the software backup area is not equal to the valid value set in the software backup area.

[0059] Software execution area valid flag: This flag is stored in a given unused address of the code and needs to be set to a valid value. When the bootloader completes the software update, a valid value will be written to the storage address of the flag; if the A area is to be erased, the valid flag of the software execution area will be cleared before that.

[0060] Software backup area valid flag: This flag is stored in a given unused address of the code and needs to be set to a valid value. When the rollback operation is completed, a string will be written to this address; if the software backup area is to be erased, the valid flag of the software backup area will be cleared before that.

[0061] At present, for the existing software program rollback logic, whether to perform program backup when the software program is updated and whether to enter program rollback when the software program is abnormal, these operations will be automatically executed, resulting in a low degree of freedom of these operations; secondly, the abnormal situation of the application (software program) that the rollback logic can identify is the abnormal situation generated when the software is updated (such as power failure during the update process, abnormal communication of the host computer during the update process, etc.), resulting in the failure of the software update, and the old software has been erased. If the old software (software before the update) itself has a logical problem, for example, the software before the update will have an abnormal reset when running to a specific logic, this situation will cause the software program to restart continuously and will not trigger the rollback logic. It can be seen from this that if there is a logical problem with the software program, the rollback logic cannot be triggered.

[0062] Due to the above-mentioned problems, the present application provides a software program rollback method and device based on a diagnostic service message, first, obtaining a target download request; then downloading a first target software to a software running area based on the target download request; obtaining a first diagnostic service message, wherein the first diagnostic service message includes a backup operation request; performing a backup operation based on the backup operation request, wherein the backup operation is used to copy the first target software from the software running area to the software backup storage area for storage, thereby obtaining a second target software; obtaining a second diagnostic service message, wherein the second diagnostic service message includes a rollback operation request; performing a rollback operation based on the rollback operation request, wherein the rollback operation is used to erase the first target software in the software running area, and copy the second target software from the software backup storage area to the software running area, thereby obtaining a third target software. In this way, after downloading the software, the software is backed up in combination with the diagnostic service message, and then the rollback operation is performed based on the software backup in combination with the diagnostic service message, thereby avoiding the situation where the software program is difficult to roll back.

[0063] To facilitate understanding of the technical solution provided in the embodiment of the present application, a software program rollback method and device based on a diagnostic service message provided in the embodiment of the present application are described below in conjunction with the accompanying drawings.

[0064] First, see Figure 1 As described, the figure is a flow chart of a software program rollback method based on a diagnostic service message provided in an embodiment of the present application, and the method specifically includes S101-S104.

[0065] S101: Obtain a target download request.

[0066] The download request sent by the host computer is received, and specifically, the download request sent by the host computer is received by the ECU.

[0067] Start and complete the download process; the software is downloaded to area A, and the effective flag of area A is set; after any ECU is reset, the ECU jumps to area A to execute the software;

[0068] S102: Downloading the first target software to the software running area based on the target download request.

[0069] After receiving the target download request, the first target software is downloaded to the software running area based on the target download request. That is, after receiving the target download request, the download process of the target software is started and completed, and the target software is downloaded to the software running area. After any ECU is reset, the ECU can jump to the software running area to execute the target software that has been downloaded.

[0070] Furthermore, after the target software is downloaded, it is necessary to verify the downloaded target software, specifically:

[0071] After the software is downloaded to the software running area, a first checksum is obtained, that is, a checksum (checksum) transmitted by the host computer through a message is obtained, and this checksum is the first checksum. Then, another checksum (checksum) is calculated using the entire data content of the software in the software running area as input, and this checksum is the second checksum. Since the target software is downloaded in the software running area, the entire content of the software in the software running area is the content of the target software at this time. The first checksum is compared with the second checksum. If the first checksum is the same as the second checksum, it can be considered that the target software is successfully downloaded to the software running area, and the software running area is a valid area.

[0072] In one possible implementation, when the ECU starts to execute software in the software running area, a reset occurs within 5 seconds, then the abnormal reset counter (first-level counter) is increased by 1, and the ECU continues to jump to the software running area to execute the software. The above steps are repeated a total of 5 times, and the first-level counter is full to 5. At this time, the software running area is set to invalid, that is, the software running area is an invalid area at this time.

[0073] It should be noted that for the abnormal reset counter, after the ECU is reset, the boot program (BT) determines whether the reset is an abnormal reset. If the reset is an abnormal reset, the first-level counter will be increased by 1. After the ECU is reset, the boot program (BT) determines whether the reset is an abnormal reset. If the reset is not an abnormal reset, there are two situations: one is that if the reset source of the reset is a power-on reset, the abnormal reset counter remains unchanged. In the other case, if the reset source of the reset is not a power-on reset, the abnormal reset counter is cleared.

[0074] Specifically, judging whether the reset is an abnormal reset can be that after the reset, judging whether the reset occurs within 5 seconds after entering the executable program and is not a power-on reset. If the reset occurs within 5 seconds after entering the executable program and is a power-on reset, then the reset is recorded as an abnormal reset.

[0075] Furthermore, an abnormal reset flag can be set, which is stored in EEPROM (Electrically Erasable Programmable Read-Only Memory, EE for short). After the software program starts executing, the flag is set and a 5s timer is started. If the 5s timer is full, the flag is cleared, and no abnormal reset occurs at this time; if the 5s timer is reset before the 5s timer is full, there is no flag clearing operation, and an abnormal reset occurs at this time.

[0076] S103: Obtain a first diagnostic service message, where the first diagnostic service message includes a backup operation request.

[0077] After completing the download of the target software, active backup can be performed, that is, receiving the specified UDS active backup message through the ECU and then performing a backup operation, that is, obtaining the first diagnostic service message, which includes a backup operation request. Specifically, the diagnostic service message can be obtained through the ECU, and subsequent backup operations can be performed based on the backup operation request.

[0078] S104: Execute a backup operation based on the backup operation request, wherein the backup operation is used to copy the first target software from the software running area to the software backup storage area for storage, to obtain a second target software.

[0079] After obtaining the backup operation request in the diagnostic service message, the backup operation is performed based on the request. The specific execution process of the backup operation is: copying the target software from the software running area to the backup storage area for storage. In order to distinguish, we can call the target software stored in the software running area the first target software, and the target software stored in the backup storage area the second target software.

[0080] After performing the backup operation, it is necessary to use the checksum for verification again. Specifically, it is necessary to use the data content of the second target software as input to calculate the third checksum, and then determine whether the second checksum in the above S102 is the same as the third checksum. If the second checksum in the above S102 is the same as the third checksum, it is determined that the software backup storage area is a valid area and the backup operation is successfully executed.

[0081] If the backup operation fails, it is necessary to obtain the target reset data, that is, to determine the reset status of the ECU, and determine whether the electronic control unit (ECU) is in a reset state based on the target reset data; if the electronic control unit (ECU) is in a reset state, send an abnormal message to the electronic control unit (ECU), and the abnormal message is used to indicate that the software backup storage area is an invalid area.

[0082] S105: Obtain a second diagnostic service message, where the second diagnostic service message includes a rollback operation request.

[0083] After completing the backup operation, an active rollback can be performed, that is, the ECU receives the specified UDS active rollback message and then performs a rollback operation, that is, obtains the second diagnostic service message, which includes a rollback operation request. Specifically, the diagnostic service message can be obtained through the ECU, and the rollback operation can be performed based on the rollback operation request.

[0084] S106: Perform a rollback operation based on the rollback operation request, wherein the rollback operation is used to erase the first target software in the software running area and copy the second target software from the software backup storage area to the software running area to obtain a third target software.

[0085] After receiving the rollback operation request, based on the rollback operation request, the first target software in the software running area is erased, and the second target software is copied from the software backup storage area to the software running area to obtain the third target software. At this time, the rollback operation indicated in the rollback operation request is completed.

[0086] After completing the rollback operation, it is necessary to use the checksum for verification again, and use the data content of the third target software as input to calculate the fourth checksum; determine whether the third checksum in the above S104 is the same as the fourth checksum. If the third checksum is the same as the fourth checksum, it is determined that the rollback operation is executed successfully.

[0087] In a possible implementation, after the abnormal reset counter (first level counter) is added by 1 (for the abnormal resetter, see step S102), the abnormal rollback counter (second level counter) is judged whether the current value of the abnormal reset counter (first level counter) is not less than 5. If the current value of the abnormal reset counter (first level counter) is not less than 5, the abnormal reset counter (first level counter) is cleared, and the abnormal rollback counter (second level counter) is added by 1. At this time, the software running area is an invalid area. If the current value of the abnormal reset counter (first level counter) is less than 5, the above operation is not performed. The above steps are performed multiple times, and after each step is completed, it is judged whether the abnormal rollback counter (second level counter) is not less than 2. If the abnormal rollback counter (second level counter) is not less than 2, the second level counter is cleared, and the software running area and the software backup storage area are both set to invalid areas. At this time, if the target software needs to be run, the target software can be run in the boot program.

[0088] In one embodiment, when both the software running area and the software backup storage area are valid, an abnormality occurs during the download operation, rollback operation or backup operation, such as the power is cut off, the host computer communication is cut off, etc., and then the ECU is reset. At this time, when the software running area is invalid and the software backup storage area is valid, the ECU will enter the RemainBoot state after the reset. In this state, the ECU will keep monitoring the bus for a period of time (the recommended monitoring delay or response time is 20ms). If a fixed RemainBoot instruction message is received during this period, the software backup storage area is determined to be an invalid area, and the boot program is entered to execute the software; if no fixed RemainBoot instruction message is received during this period, a rollback operation is performed.

[0089] It should be noted that the above-mentioned download operation and backup operation can be performed separately, that is, if only download is required, only the download operation is performed, that is, the operations from step S101 to step S102 are performed. If only backup is required, only the backup operation is performed, that is, the operations from step S101 to step S104 are performed. In this way, the download operation, backup operation or rollback operation can be performed in a targeted manner, thereby improving the flexibility of the operation.

[0090] A regional ID flag can also be set to identify which group of software programs is currently performing a download operation, rollback operation, or backup operation. The regional ID flag is stored in the EE, and different standard values ​​represent different operations. If the value of the regional ID flag of the software program is equal to a certain standard value, the operation and area indicated by the standard value can be used to determine which of the download operation, rollback operation, or backup operation the software program is currently performing, and to determine which area of ​​the software backup storage area or software running area the software program is located in. It should be noted that multiple groups of software backup storage areas and software running areas can be stored in an ECU, that is, multiple groups of software programs can exist in an ECU. Between each group of software programs, the download operation, update operation, rollback operation, and backup operation will not affect each other. When a group of backup storage areas and software running areas need to perform a download operation, rollback operation, or backup operation, the regional ID flag will be judged before this to determine which group of backup storage areas and software running areas are performing the download operation, rollback operation, or backup operation.

[0091] Based on the relevant contents of S101-S106, it can be known that the present application provides a software program rollback method based on diagnostic service messages. After downloading the software, the software is backed up in combination with the diagnostic service message, and then the rollback operation is performed based on the backup of the software in combination with the diagnostic service message, so as to avoid the situation where the software program is difficult to roll back. In addition, the download operation, backup operation or rollback operation can be performed in a targeted manner, thereby improving the flexibility of the operation.

[0092] and Figure 1 Corresponding to the method described above, the embodiment of the present application also provides a software program rollback device based on a diagnostic service message, for Figure 1 In the specific implementation of the method, a software program rollback device based on a diagnostic service message provided in an embodiment of the present application can be applied to a computer terminal or various mobile devices, and its structural diagram is shown in FIG. Figure 2 As shown, a software program rollback device based on a diagnostic service message in the present application specifically includes:

[0093] The present application also provides a software program rollback device based on a diagnostic service message, the device comprising:

[0094] A first acquisition unit 201 is used to acquire a target download request;

[0095] A downloading unit 202, configured to download the first target software to a software running area based on the target download request;

[0096] A second acquisition unit 203 is used to acquire a first diagnostic service message, where the first diagnostic service message includes a backup operation request;

[0097] A backup unit 204, configured to perform a backup operation based on the backup operation request, wherein the backup operation is used to copy the first target software from the software running area to the software backup storage area for storage, to obtain a second target software;

[0098] A third acquisition unit 205 is used to acquire a second diagnostic service message, where the second diagnostic service message includes a rollback operation request;

[0099] The rollback unit 206 is used to perform a rollback operation based on the rollback operation request, wherein the rollback operation is used to erase the first target software in the software running area and copy the second target software from the software backup storage area to the software running area to obtain the third target software.

[0100] In a possible implementation, the downloading unit 202 is specifically configured to:

[0101] Get the first checksum;

[0102] Taking the data content of the first target software as input, calculating a second checksum;

[0103] If the first checksum is the same as the second checksum, it is determined that the software running area is a valid area and the target software is successfully downloaded to the software running area.

[0104] In a possible implementation, the backup unit 204 is specifically configured to:

[0105] Taking the data content of the second target software as input, calculating a third checksum;

[0106] If the second checksum is the same as the third checksum, it is determined that the software backup storage area is a valid area and that the backup operation is successfully performed.

[0107] In a possible implementation, the rollback unit 206 is specifically configured to:

[0108] Taking the data content of the third target software as input, calculating a fourth checksum;

[0109] If the third checksum is the same as the fourth checksum, it is determined that the rollback operation is successfully performed.

[0110] If the backup operation fails, the device further comprises:

[0111] The fourth acquisition unit 207 is used to acquire target reset data;

[0112] a determination unit 208, configured to determine whether the electronic control unit is in a reset state based on the target reset data;

[0113] The control unit 209 is used to send an abnormal message to the electronic control unit if the electronic control unit is in a reset state, wherein the abnormal message is used to indicate that the software backup storage area is an invalid area.

[0114] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0115] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A software program rollback method based on diagnostic service message, characterized in that: The method comprises: Get the target download request; Downloading the first target software to the software running area based on the target download request; Obtaining a first diagnostic service message, wherein the first diagnostic service message includes a backup operation request; Performing a backup operation based on the backup operation request, wherein the backup operation is used to copy the first target software from the software running area to the software backup storage area for storage, thereby obtaining a second target software; Obtaining a second diagnostic service message, where the second diagnostic service message includes a rollback operation request; A rollback operation is performed based on the rollback operation request, wherein the rollback operation is used to erase the first target software in the software running area and copy the second target software from the software backup storage area to the software running area to obtain the third target software.

2. The method according to claim 1, characterized in that: The downloading of the target software to the software running area based on the target download request includes: Get the first checksum; Taking the data content of the first target software as input, calculating a second checksum; If the first checksum is the same as the second checksum, it is determined that the software running area is a valid area and the target software is successfully downloaded to the software running area.

3. The method according to claim 2, characterized in that The performing the backup operation based on the backup operation request includes: Taking the data content of the second target software as input, calculating a third checksum; If the second checksum is the same as the third checksum, it is determined that the software backup storage area is a valid area and that the backup operation is successfully performed.

4. The method according to claim 3, characterized in that The performing the rollback operation based on the rollback operation request includes: Taking the data content of the third target software as input, calculating a fourth checksum; If the third checksum is the same as the fourth checksum, it is determined that the rollback operation is successfully performed.

5. The method according to claim 3, characterized in that: If the backup operation fails, the method further includes: Get target reset data; determining whether the electronic control unit is in a reset state based on the target reset data; If the electronic control unit is in a reset state, an abnormal message is sent to the electronic control unit, where the abnormal message is used to indicate that the software backup storage area is an invalid area.

6. A program rollback device based on diagnostic service message, characterized in that: The device comprises: A first acquisition unit, used for acquiring a target download request; A downloading unit, configured to download the first target software to a software running area based on the target download request; A second acquiring unit, configured to acquire a first diagnostic service message, wherein the first diagnostic service message includes a backup operation request; A backup unit, configured to perform a backup operation based on the backup operation request, wherein the backup operation is used to copy the first target software from the software running area to the software backup storage area for storage, thereby obtaining a second target software; A third acquiring unit, configured to acquire a second diagnostic service message, wherein the second diagnostic service message includes a rollback operation request; The rollback unit is used to perform a rollback operation based on the rollback operation request, wherein the rollback operation is used to erase the first target software in the software running area and copy the second target software from the software backup storage area to the software running area to obtain the third target software.

7. The device according to claim 6, characterized in that The downloading unit is specifically used for: Get the first checksum; Taking the data content of the first target software as input, calculating a second checksum; If the first checksum is the same as the second checksum, it is determined that the software running area is a valid area and the target software is successfully downloaded to the software running area.

8. The device according to claim 7, characterized in that The backup unit is specifically used for: Taking the data content of the second target software as input, calculating a third checksum; If the second checksum is the same as the third checksum, it is determined that the software backup storage area is a valid area and that the backup operation is successfully performed.

9. The device according to claim 8, characterized in that The rollback unit is specifically used for: Taking the data content of the third target software as input, calculating a fourth checksum; If the third checksum is the same as the fourth checksum, it is determined that the rollback operation is successfully performed.

10. The device according to claim 3, characterized in that If the backup operation fails, the device further comprises: A fourth acquisition unit, used to acquire target reset data; a determination unit, configured to determine whether the electronic control unit is in a reset state based on the target reset data; A control unit is used to send an abnormal message to the electronic control unit if the electronic control unit is in a reset state, wherein the abnormal message is used to indicate that the software backup storage area is an invalid area.