[go: up one dir, main page]

CN111198705A - Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment - Google Patents

Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment Download PDF

Info

Publication number
CN111198705A
CN111198705A CN201911320063.4A CN201911320063A CN111198705A CN 111198705 A CN111198705 A CN 111198705A CN 201911320063 A CN201911320063 A CN 201911320063A CN 111198705 A CN111198705 A CN 111198705A
Authority
CN
China
Prior art keywords
checksum
data
backup
preset
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911320063.4A
Other languages
Chinese (zh)
Inventor
纪小娟
刘晓波
艾聪
潘文卿
葛云东
付世杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weichai Power Co Ltd
Original Assignee
Weichai Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Weichai Power Co Ltd filed Critical Weichai Power Co Ltd
Priority to CN201911320063.4A priority Critical patent/CN111198705A/en
Publication of CN111198705A publication Critical patent/CN111198705A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Retry When Errors Occur (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

本发明公开了一种防止ECU刷死的内存备份方法、装置、存储介质及电子设备,所述方法包括:获取预设第一校验和;获取预设备份区对应的第二校验和;当所述第一校验和与所述第二校验和不一致时,判断所述第一校验和是否正确后得到判断结果;基于所述判断结果完成内存数据备份。因此,采用本申请实施例,可以防止ECU刷死和数据丢失。

Figure 201911320063

The invention discloses a memory backup method, device, storage medium and electronic equipment for preventing ECU from being flashed dead. The method includes: obtaining a preset first checksum; obtaining a second checksum corresponding to a preset backup area; When the first checksum is inconsistent with the second checksum, a judgment result is obtained after judging whether the first checksum is correct; and memory data backup is completed based on the judgment result. Therefore, by adopting the embodiments of the present application, it is possible to prevent the ECU from being flashed dead and data loss.

Figure 201911320063

Description

Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment
Technical Field
The invention relates to the field of automobile electronic control, in particular to a memory backup method and device for preventing an ECU from being brushed, a storage medium and electronic equipment.
Background
With the rapid development of society, automobiles have become an indispensable part of every family. An ECU (electronic control unit), i.e., a traveling computer, in an automobile is a core configuration of the automobile. After the automobile is started, the upper computer or the flash tool can flash data of the ECU.
In the prior art, the ECU has no memory backup, and when the upper computer or the brushing tool brushes data of the ECU, the ECU is not brushed successfully, so that the ECU is brushed, and the probability of data loss is increased.
Disclosure of Invention
The embodiment of the application provides a memory backup method and device for preventing ECU (electronic control unit) from being swiped up, a storage medium and electronic equipment. The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview and is intended to neither identify key/critical elements nor delineate the scope of such embodiments. Its sole purpose is to present some concepts in a simplified form as a prelude to the more detailed description that is presented later.
In a first aspect, an embodiment of the present application provides a memory backup method for preventing an ECU from being swiped, where the method includes:
acquiring a preset first check sum;
acquiring a second checksum corresponding to the preset backup area;
when the first checksum and the second checksum are inconsistent, judging whether the first checksum is correct or not to obtain a judgment result;
and finishing memory data backup based on the judgment result.
Optionally, before the obtaining the preset first checksum, the method further includes:
when a data change instruction for an offline variable storage area is received, changing the data to generate changed data;
calculating the modified data based on a preset checksum algorithm to generate a checksum corresponding to the modified data, and taking the checksum corresponding to the modified data as a first checksum;
and flashing the changed data and the checksum to the offline variable storage area to generate data and a first checksum in the offline variable storage area.
Optionally, the completing the memory data backup based on the determination result includes:
and when the first checksum is correct, copying the data in the offline variable storage area to the preset backup area.
Optionally, the completing the memory data backup based on the determination result includes:
and when the first checksum is incorrect, copying the backup data of the preset backup area to the offline variable storage area.
In a second aspect, an embodiment of the present application provides a memory backup device for preventing an ECU from being swiped, where the device includes:
the first check sum acquisition module is used for acquiring a preset first check sum;
the second checksum obtaining module is used for obtaining a second checksum corresponding to the preset backup area;
a result obtaining module, configured to, when the first checksum is inconsistent with the second checksum, determine whether the first checksum is correct, and obtain a determination result;
and the backup completion module is used for completing the memory data backup based on the judgment result.
Optionally, the apparatus further comprises:
the data change module is used for changing the data to generate changed data when receiving a data change instruction aiming at the offline variable storage area;
the checksum generation module is used for calculating the modified data based on a preset checksum algorithm to generate a checksum corresponding to the modified data, and taking the checksum corresponding to the modified data as a first checksum;
and the data storage module is used for flashing the changed data and the checksum to the offline variable storage area.
Optionally, the backup completing module is specifically configured to:
and when the first checksum is correct, copying the data in the offline variable storage area to the preset backup area.
Optionally, the backup completing module is specifically configured to:
and when the first checksum is incorrect, copying the backup data of the preset backup area to the offline variable storage area.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
in the embodiment of the application, the vehicle computer firstly obtains a preset first checksum, then obtains a second checksum corresponding to the preset backup area, then judges whether the first checksum is correct or not when the first checksum is inconsistent with the second checksum to obtain a judgment result, and finally completes memory data backup based on the judgment result. According to the scheme, the partitions with the same size are added in advance to perform data backup on the lower limit variable storage area which is frequently subjected to data flashing, and under the condition that the flashing is unsuccessful, the data in the backup area can be copied into the lower limit variable storage area based on the calculated checksum.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a schematic flowchart of a memory backup method for preventing an ECU from being swiped up according to an embodiment of the present application;
FIG. 2 is a process diagram of a memory backup process for preventing an ECU from being swiped up according to an embodiment of the present application;
FIG. 3 is a schematic flowchart of another memory backup method for preventing an ECU from being swiped up according to an embodiment of the present application;
FIG. 4 is a schematic flowchart of another memory backup method for preventing an ECU from being swiped up according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a memory backup device for preventing an ECU from being swiped up according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another memory backup device for preventing an ECU from being swiped up according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description and the drawings sufficiently illustrate specific embodiments of the invention to enable those skilled in the art to practice them.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
So far, the ECU has no memory backup, when the upper computer or the brushing tool carries out data brushing on the ECU, when the data brushing is unsuccessful, the ECU is brushed, and the probability of data loss is increased. Therefore, the present application provides a memory backup method, device, storage medium and electronic device for preventing an ECU from being swiped up, so as to solve the problems existing in the related art. In the technical scheme provided by the application, as the partition with the same size is added in advance to the lower limit variable storage area which is frequently subjected to data flashing for carrying out data backup on the lower limit variable storage area, under the condition of unsuccessful flashing, the data in the backup area can be copied into the lower limit variable storage area based on the calculated checksum.
The memory backup method for preventing the ECU from being swiped up according to the embodiment of the present application will be described in detail below with reference to fig. 1 to 4.
Referring to fig. 1, a schematic flow chart of a memory backup method for preventing an ECU from being swiped up is provided in an embodiment of the present application. As shown in fig. 1, the method of the embodiment of the present application may include the steps of:
s101, acquiring a preset first checksum;
and the checksum is obtained by calculating the data of the storage area according to a checksum algorithm. The data of the storage area is data stored in, for example, EOL (offline variable storage area) and the data stored in the area needs to be changed frequently. The EOL is a data storage area in an EMS (Engine Management System), the EMS is an application program area of an ECU (electronic control Unit), and represents a program required by the ECU to control the normal operation of an engine, and an internal area of the ECU is divided into two large areas, namely a Bootloader and an EMS area, wherein the Bootloader is a bootstrap loader for updating the EMS area by a user.
Generally, before calculating a checksum, data backup is performed on partitions with the same size added to an EOL area (a lower limit variable storage area), the added backup partitions are referred to as backup partitions, then an algorithm for calculating a checksum is set, the checksum algorithm can be set by itself, and is not limited herein.
In the embodiment of the application, a user uses an upper computer (INCA or a flash tool) to change data in an EOL area and then generate changed data, the upper computer needs to recalculate a checksum on the changed data according to a preset checksum algorithm, after the checksum calculation is completed, the upper computer finally writes the changed data and a new checksum into the EOL area for storage, and at this time, the new checksum is regarded as a first checksum. After the upper computer is refreshed, the ECU is electrified again to enter the Bootloader, and the ECU firstly obtains a first check sum.
S102, acquiring a second checksum corresponding to a preset backup area;
and the second checksum is a checksum corresponding to the backup data in the backup area.
In the embodiment of the present application, after the user uses the upper computer to modify the data of the EOL area, it needs to determine whether the checksum of the EOL area is correct, and in the determination process, the ECU first obtains the first checksum, that is, the checksum corresponding to the modified data stored in the EOL area, based on step S101. And then, a checksum corresponding to the backup data stored in the backup area is obtained.
S103, when the first checksum and the second checksum are inconsistent, judging whether the first checksum is correct or not to obtain a judgment result;
in a feasible implementation manner, the ECU firstly obtains the first checksum and the second checksum based on steps S101 and S102, and then compares the first checksum and the second checksum according to a value corresponding to the first checksum and a value corresponding to the second checksum, at this time, since the user uses the upper computer to change the EOL area data, a value of the first checksum stored in the EOL area and a value of the second checksum are definitely not equal, at this time, it is necessary to determine whether the first checksum stored in the EOL area is correct, and the ECU determines the first checksum according to a set determination program and generates a determination result.
And S104, finishing memory data backup based on the judgment result.
In a possible implementation manner, the result of the determination obtained based on step S103 may be that the first checksum is correct, and the first checksum error may also occur.
Optionally, when the first checksum determined by the ECU is correct, the ECU copies the data content after the EOL area change to the backup area, and the data is successfully written.
Optionally, when the first checksum determined by the ECU is incorrect, the ECU copies the data content in the backup area to the EOL area, and the data flush fails, which may effectively protect the data stored in the EOL area from being maliciously tampered.
In another possible implementation manner, when the user does not perform the flash change on the data of the EOL area, the data of the EOL area and the data of the backup area at this time are consistent, in this case, the ECU also needs to calculate a checksum on the data of the EOL area to determine whether the checksum is correct, and when the checksum is correct, it indicates that the data of the EOL area and the data of the backup area are consistent, and no operation is needed. When the judgment result is incorrect, the data is maliciously tampered, but the modifier does not know the checksum algorithm at this time, so that the checksum is not modified, and therefore whether the data is modified or not can be judged according to the checksum, and the data in the backup area needs to be copied to the EOL area at this time, so that the data maliciously tampered is effectively prevented.
And after the backup area is added, the ECU copies the data content of the backup area to the EOL area according to the judgment result of the checksum, so that the ECU can normally operate.
For example, as shown in fig. 2, when a user uses an upper computer to perform a flash change on data in an EOL area, a change instruction is generated and sent to the ECU, and after receiving the change instruction, the ECU first determines whether the checksum stored in the EOL area and the backup area are consistent.
And when the checksums are consistent, the ECU judges whether the checksum of the EOL area is correct or not, if the checksum is correct, the operation is not needed, if the checksum is wrong, the EOL area data is changed, and if the checksum is not changed, the content of the backup area needs to be copied to the EOL area.
And when the checksums are not consistent, the ECU judges whether the EOL area checksums are correct or not, if so, the EOL area data and the checksums are changed, and the EOL area data and the checksums are correct, the content of the EOL area needs to be copied to a backup area, and the flash is successful. If the judgment is wrong, the EOL area data and the checksum are changed, but the checksum is not correct, and the content of the backup area needs to be copied to the EOL area.
In the embodiment of the application, the vehicle computer firstly obtains a preset first checksum, then obtains a second checksum corresponding to the preset backup area, then judges whether the first checksum is correct or not when the first checksum is inconsistent with the second checksum to obtain a judgment result, and finally completes memory data backup based on the judgment result. According to the scheme, the partitions with the same size are added in advance to perform data backup on the lower limit variable storage area which is frequently subjected to data flashing, and under the condition that the flashing is unsuccessful, the data in the backup area can be copied into the lower limit variable storage area based on the calculated checksum.
Fig. 3 is a schematic flow chart of a memory backup method for preventing an ECU from being swiped up according to an embodiment of the present application. The present embodiment is exemplified by applying the image processing method to an electronic device. The memory backup method for preventing the ECU from being swiped up can comprise the following steps:
s201, when a data change instruction for the offline variable storage area is received, changing the data to generate changed data;
in a possible implementation manner, when a user uses an upper computer to perform data flashing, firstly, a command of the flashing is sent to the ECU, and when the ECU receives the data of the EOL area to be flashed, the data in the EOL area is modified according to the command of the flashing to generate modified data.
S202, calculating the modified data based on a preset checksum algorithm to generate a checksum corresponding to the modified data, and taking the checksum corresponding to the modified data as a first checksum;
in a possible implementation manner, based on the modified data obtained in step S201, when the data is modified, the ECU obtains a checksum calculation rule preset by the user, for example, adding an offset to a multiplication factor of data (four bytes) in a range except for the checksum in the EOL area and the backup area, and then accumulating, where the final sum is the checksum, or using a general CRC algorithm, and the like. The specific checksum algorithm may be determined according to actual situations, and is not limited herein. And after the modified data is calculated according to the checksum algorithm, generating a checksum corresponding to the modified data, wherein the modified data sum can be regarded as a first checksum.
S203, the changed data and the check sum are written into the offline variable storage area in a flashing mode to generate data and a first check sum in the offline variable storage area.
In the embodiment of the present application, based on the step S202, the checksum corresponding to the modified data may be obtained, and when the checksum corresponding to the modified data is obtained, the ECU saves the modified data and the checksum in the EOL area in a flash manner.
S204, acquiring a preset first checksum;
specifically, refer to step S101, which is not described herein again.
S205, acquiring a second checksum corresponding to the preset backup area;
specifically, refer to step S102, which is not described herein again.
S206, when the first checksum and the second checksum are not consistent, judging whether the first checksum is correct or not to obtain a judgment result;
specifically, refer to step S103, which is not described herein again.
And S207, when the first checksum is correct, copying the data in the offline variable storage area to the preset backup area.
Specifically, refer to step S104, which is not described herein again.
In the embodiment of the application, the vehicle computer firstly obtains a preset first checksum, then obtains a second checksum corresponding to the preset backup area, then judges whether the first checksum is correct or not when the first checksum is inconsistent with the second checksum to obtain a judgment result, and finally completes memory data backup based on the judgment result. According to the scheme, the partitions with the same size are added in advance to perform data backup on the lower limit variable storage area which is frequently subjected to data flashing, and under the condition that the flashing is unsuccessful, the data in the backup area can be copied into the lower limit variable storage area based on the calculated checksum.
Fig. 4 is a schematic flow chart of a memory backup method for preventing an ECU from being swiped up according to an embodiment of the present application. The present embodiment is exemplified by applying the image processing method to an electronic device. The memory backup method for preventing the ECU from being swiped up can comprise the following steps:
s301, when a data change instruction for the offline variable storage area is received, changing the data to generate changed data;
specifically, refer to step S201, which is not described herein again.
S302, calculating the modified data based on a preset checksum algorithm to generate a checksum corresponding to the modified data, and taking the checksum corresponding to the modified data as a first checksum;
specifically, refer to step S202, which is not described herein again.
And S303, flashing the changed data and the check sum to the offline variable storage area to generate the data and the first check sum in the offline variable storage area.
Specifically, refer to step S203, which is not described herein again.
S304, acquiring a preset first checksum;
specifically, refer to step S101, which is not described herein again.
S305, acquiring a second checksum corresponding to the preset backup area;
specifically, refer to step S102, which is not described herein again.
S306, when the first checksum and the second checksum are not consistent, judging whether the first checksum is correct or not to obtain a judgment result;
specifically, refer to step S103, which is not described herein again.
S307, when the first checksum is incorrect, copying the backup data of the preset backup area to the offline variable storage area.
Specifically, refer to step S104, which is not described herein again.
In the embodiment of the application, the vehicle computer firstly obtains a preset first checksum, then obtains a second checksum corresponding to the preset backup area, then judges whether the first checksum is correct or not when the first checksum is inconsistent with the second checksum to obtain a judgment result, and finally completes memory data backup based on the judgment result. According to the scheme, the partitions with the same size are added in advance to perform data backup on the lower limit variable storage area which is frequently subjected to data flashing, and under the condition that the flashing is unsuccessful, the data in the backup area can be copied into the lower limit variable storage area based on the calculated checksum.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.
Referring to fig. 5, a schematic structural diagram of a memory backup device for preventing an ECU from being swiped up according to an exemplary embodiment of the present invention is shown. The memory backup device for preventing the ECU from being swiped can be realized by software, hardware or a combination of the software and the hardware to be all or part of equipment. The device 1 comprises a first checksum obtaining module 10, a second checksum obtaining module 20, a result obtaining module 30 and a backup completing module 40.
A first checksum obtaining module 10, configured to obtain a preset first checksum;
the second checksum obtaining module 20 is configured to obtain a second checksum corresponding to the preset backup area;
a result obtaining module 30, configured to, when the first checksum is inconsistent with the second checksum, determine whether the first checksum is correct, and obtain a determination result;
and a backup completion module 40, configured to complete memory data backup based on the determination result.
Optionally, as shown in fig. 6, the memory backup device 1 for preventing the ECU from being swiped up further includes:
the data modification module 50 is configured to modify the data to generate modified data when a data modification instruction for the offline variable storage area is received;
a checksum generating module 60, configured to calculate the modified data based on a preset checksum algorithm to generate a checksum corresponding to the modified data, and use the checksum corresponding to the modified data as a first checksum;
a data saving module 70, configured to flush the modified data and the checksum to the offline variable storage area.
It should be noted that, when the memory backup method for preventing the ECU from being swiped up is used for the memory backup device for preventing the ECU from being swiped up, the division of the functional modules is merely used for illustration, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the memory backup device for preventing the ECU from being swiped up and the memory backup method embodiment for preventing the ECU from being swiped up provided by the above embodiments belong to the same concept, and the detailed implementation process is shown in the method embodiment and will not be described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the embodiment of the application, the vehicle computer firstly obtains a preset first checksum, then obtains a second checksum corresponding to the preset backup area, then judges whether the first checksum is correct or not when the first checksum is inconsistent with the second checksum to obtain a judgment result, and finally completes memory data backup based on the judgment result. According to the scheme, the partitions with the same size are added in advance to perform data backup on the lower limit variable storage area which is frequently subjected to data flashing, and under the condition that the flashing is unsuccessful, the data in the backup area can be copied into the lower limit variable storage area based on the calculated checksum.
The present invention also provides a computer readable medium, on which program instructions are stored, which when executed by a processor implement the memory backup method for preventing ECU from being swiped up, provided by the above-mentioned method embodiments.
The present invention also provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the memory backup method for preventing ECU from being swiped.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 7, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, memory 1005, at least one communication bus 1002.
Wherein a communication bus 1002 is used to enable connective communication between these components.
The user interface 1003 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Processor 1001 may include one or more processing cores, among other things. The processor 1001 interfaces various components throughout the electronic device 1000 using various interfaces and lines to perform various functions of the electronic device 1000 and to process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1005 and invoking data stored in the memory 1005. Alternatively, the processor 1001 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 1001 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 1001, but may be implemented by a single chip.
The Memory 1005 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable medium. The memory 1005 may be used to store an instruction, a program, code, a set of codes, or a set of instructions. The memory 1005 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 7, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a memory backup application program for preventing an ECU from being swiped.
In the electronic device 1000 shown in fig. 7, the user interface 1003 is mainly used as an interface for providing input for a user, and acquiring data input by the user; and the processor 1001 may be configured to invoke a memory backup application stored in the memory 1005 that prevents ECU flashing, and specifically perform the following operations:
acquiring a preset first check sum;
acquiring a second checksum corresponding to the preset backup area;
when the first checksum and the second checksum are inconsistent, judging whether the first checksum is correct or not to obtain a judgment result;
and finishing memory data backup based on the judgment result.
In one embodiment, the processor 1001, before performing the obtaining of the preset first checksum, further performs the following operations:
when a data change instruction for an offline variable storage area is received, changing the data to generate changed data;
calculating the modified data based on a preset checksum algorithm to generate a checksum corresponding to the modified data, and taking the checksum corresponding to the modified data as a first checksum;
and flashing the changed data and the checksum to the offline variable storage area to generate data and a first checksum in the offline variable storage area.
In an embodiment, when the processor 1001 executes the memory data backup based on the determination result, the following operations are specifically executed:
and when the first checksum is correct, copying the data in the offline variable storage area to the preset backup area.
In an embodiment, when the processor 1001 executes the memory data backup based on the determination result, the following operations are specifically executed:
and when the first checksum is incorrect, copying the backup data of the preset backup area to the offline variable storage area.
In the embodiment of the application, the vehicle computer firstly obtains a preset first checksum, then obtains a second checksum corresponding to the preset backup area, then judges whether the first checksum is correct or not when the first checksum is inconsistent with the second checksum to obtain a judgment result, and finally completes memory data backup based on the judgment result. According to the scheme, the partitions with the same size are added in advance to perform data backup on the lower limit variable storage area which is frequently subjected to data flashing, and under the condition that the flashing is unsuccessful, the data in the backup area can be copied into the lower limit variable storage area based on the calculated checksum.
Those of skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments disclosed herein, it should be understood that the disclosed methods, articles of manufacture (including but not limited to devices, apparatuses, etc.) may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
It should be understood that the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. The present invention is not limited to the procedures and structures that have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A memory backup method for preventing ECU from being swiped up is characterized by comprising the following steps:
acquiring a preset first check sum;
acquiring a second checksum corresponding to the preset backup area;
when the first checksum and the second checksum are inconsistent, judging whether the first checksum is correct or not to obtain a judgment result;
and finishing memory data backup based on the judgment result.
2. The method according to claim 1, wherein before the obtaining the preset first checksum, the method further comprises:
when a data change instruction for an offline variable storage area is received, changing the data to generate changed data;
calculating the modified data based on a preset checksum algorithm to generate a checksum corresponding to the modified data, and taking the checksum corresponding to the modified data as a first checksum;
and flashing the changed data and the checksum to the offline variable storage area to generate data and a first checksum in the offline variable storage area.
3. The method of claim 1, wherein completing the memory data backup based on the determination comprises:
and when the first checksum is correct, copying the data in the offline variable storage area to the preset backup area.
4. The method of claim 1, wherein completing the memory data backup based on the determination comprises:
and when the first checksum is incorrect, copying the backup data of the preset backup area to the offline variable storage area.
5. A memory backup device for preventing ECU from being swiped, the device comprising:
the first check sum acquisition module is used for acquiring a preset first check sum;
the second checksum obtaining module is used for obtaining a second checksum corresponding to the preset backup area;
a result obtaining module, configured to, when the first checksum is inconsistent with the second checksum, determine whether the first checksum is correct, and obtain a determination result;
and the backup completion module is used for completing the memory data backup based on the judgment result.
6. The apparatus of claim 5, further comprising:
the data change module is used for changing the data to generate changed data when receiving a data change instruction aiming at the offline variable storage area;
the checksum generation module is used for calculating the modified data based on a preset checksum algorithm to generate a checksum corresponding to the modified data, and taking the checksum corresponding to the modified data as a first checksum;
and the data storage module is used for flashing the changed data and the checksum to the offline variable storage area.
7. The apparatus of claim 5, wherein the backup completion module is specifically configured to:
and when the first checksum is correct, copying the data in the offline variable storage area to the preset backup area.
8. The apparatus of claim 5, wherein the backup completion module is specifically configured to:
and when the first checksum is incorrect, copying the backup data of the preset backup area to the offline variable storage area.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to perform the method steps according to any of claims 1 to 4.
10. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 4.
CN201911320063.4A 2019-12-19 2019-12-19 Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment Pending CN111198705A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911320063.4A CN111198705A (en) 2019-12-19 2019-12-19 Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911320063.4A CN111198705A (en) 2019-12-19 2019-12-19 Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111198705A true CN111198705A (en) 2020-05-26

Family

ID=70746569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911320063.4A Pending CN111198705A (en) 2019-12-19 2019-12-19 Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111198705A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111796839A (en) * 2020-07-07 2020-10-20 北京经纬恒润科技有限公司 Controller program management method and device
CN112579135A (en) * 2020-12-22 2021-03-30 潍柴动力股份有限公司 Flash control method and system for vehicle control unit and vehicle
CN112698857A (en) * 2021-01-04 2021-04-23 潍柴动力股份有限公司 Data flashing method and device
CN112783056A (en) * 2021-01-04 2021-05-11 潍柴动力股份有限公司 Data programming method, device and equipment of ECU and storage medium
CN113551856A (en) * 2021-07-21 2021-10-26 安徽江淮汽车集团股份有限公司 Off-line detection method for pipeline leakage of fuel vehicle
CN114265382A (en) * 2021-11-12 2022-04-01 潍柴动力股份有限公司 ECU (electronic control Unit) flash fault processing method and device, electronic equipment and storage medium
CN116301963A (en) * 2023-01-09 2023-06-23 上海加糖科技有限公司 System firmware upgrade method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103593265A (en) * 2012-08-16 2014-02-19 现代自动车株式会社 Method and system for preventing loss of trip data in vehicle
CN108062259A (en) * 2017-11-01 2018-05-22 联创汽车电子有限公司 MCU internal data store ECC processing systems and its processing method
GB201903088D0 (en) * 2019-03-07 2019-04-24 Delphi Tech Ip Ltd Automotive bootloader
CN110083374A (en) * 2019-03-25 2019-08-02 深圳猛犸电动科技有限公司 A kind of upgrading rollback method, system and terminal device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103593265A (en) * 2012-08-16 2014-02-19 现代自动车株式会社 Method and system for preventing loss of trip data in vehicle
CN108062259A (en) * 2017-11-01 2018-05-22 联创汽车电子有限公司 MCU internal data store ECC processing systems and its processing method
GB201903088D0 (en) * 2019-03-07 2019-04-24 Delphi Tech Ip Ltd Automotive bootloader
CN110083374A (en) * 2019-03-25 2019-08-02 深圳猛犸电动科技有限公司 A kind of upgrading rollback method, system and terminal device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111796839A (en) * 2020-07-07 2020-10-20 北京经纬恒润科技有限公司 Controller program management method and device
CN111796839B (en) * 2020-07-07 2024-04-09 北京经纬恒润科技股份有限公司 Controller program management method and device
CN112579135A (en) * 2020-12-22 2021-03-30 潍柴动力股份有限公司 Flash control method and system for vehicle control unit and vehicle
CN112698857A (en) * 2021-01-04 2021-04-23 潍柴动力股份有限公司 Data flashing method and device
CN112783056A (en) * 2021-01-04 2021-05-11 潍柴动力股份有限公司 Data programming method, device and equipment of ECU and storage medium
CN112698857B (en) * 2021-01-04 2023-09-19 潍柴动力股份有限公司 A method and device for data flashing
CN113551856A (en) * 2021-07-21 2021-10-26 安徽江淮汽车集团股份有限公司 Off-line detection method for pipeline leakage of fuel vehicle
CN114265382A (en) * 2021-11-12 2022-04-01 潍柴动力股份有限公司 ECU (electronic control Unit) flash fault processing method and device, electronic equipment and storage medium
CN116301963A (en) * 2023-01-09 2023-06-23 上海加糖科技有限公司 System firmware upgrade method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111198705A (en) Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment
CN109491671B (en) Diagnostic software downloading method and device, terminal equipment and storage medium
CN111209343B (en) Node data synchronization method, device, equipment and storage medium
CN109814524B (en) Vehicle diagnosis method, device and system
CN103577201B (en) The update method and system of Embedded Double system
CN106775610B (en) Electronic equipment starting method and electronic equipment
CN110930131A (en) Vehicle maintenance method, device, equipment and medium
KR20230004394A (en) Hared memory access control method, device, electronic device and autonomous vehicle
WO2019077607A1 (en) System and method for managing program memory on a storage device
CN113272785B (en) A method, terminal device and storage medium for mounting a file system
CN108271150B (en) Method and system for supporting simultaneous flashing or data clearing of multiple mobile phones
CN112269665B (en) Memory processing method and device, electronic equipment and storage medium
CN113672258A (en) System upgrade method, device, computer equipment and storage medium of vehicle
CN111221553A (en) Method and device for upgrading firmware
CN117997745A (en) Remote upgrading method and device for vehicle software, computer equipment and storage medium
CN107193582B (en) Publishing method and system
CN110674050B (en) Memory out-of-range detection method and device, electronic equipment and computer storage medium
CN109165712A (en) Distributed generation method, device and computer storage medium by stages number
CN110009742B (en) System and method for finite element mesh repair
CN116450184A (en) System upgrading method and device, electronic equipment and storage medium
CN114265613B (en) Method and system for differentially upgrading firmware of all electric control units of whole vehicle
CN109375953B (en) Operating system starting method and device
CN111143360B (en) Road uplink and downlink identification method and device based on spatial index algorithm, storage medium and terminal
US20170090820A1 (en) Method and device for operating a many-core system
CN110309149B (en) Data table processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination