CN114490453A - EEPROM data storage protection control method, computer storage medium and vehicle - Google Patents

EEPROM data storage protection control method, computer storage medium and vehicle Download PDF

Info

Publication number
CN114490453A
CN114490453A CN202210060274.4A CN202210060274A CN114490453A CN 114490453 A CN114490453 A CN 114490453A CN 202210060274 A CN202210060274 A CN 202210060274A CN 114490453 A CN114490453 A CN 114490453A
Authority
CN
China
Prior art keywords
data
storage
eeprom
backup
writing
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
CN202210060274.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.)
Burleton Technology Co ltd
Original Assignee
Burleton Technology 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 Burleton Technology Co ltd filed Critical Burleton Technology Co ltd
Priority to CN202210060274.4A priority Critical patent/CN114490453A/en
Publication of CN114490453A publication Critical patent/CN114490453A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/16Protection against loss of memory contents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/1456Hardware arrangements for backup

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention relates to an EEPROM data storage protection control method, a computer storage medium and a vehicle, comprising the following steps: selecting 3 positions for storing EEPROM state information in the EEPROM; before storing data, writing 0 in a storage state position; before writing a datum, writing the datum into a backup data position for backup, and simultaneously writing a current data serial number into a storage serial number position in which the state information is written; after the current data backup is completed, the data is powered off and stored; after the storage is finished, continuing to write backup information into the next data to be stored, and then storing; after all data are stored, writing 1 the storage mark written with the state information; before next power-on, reading a storage mark written with the state information, and judging whether the storage mark is 1; if the storage flag is 1, the last data storage is normal; otherwise, the last data storage is not completed, and the backup data is used as the value of the stored value of the corresponding sequence number.

Description

EEPROM data storage protection control method, computer storage medium and vehicle
Technical Field
The invention relates to the technical field of EEPROM data storage, in particular to an EEPROM data storage protection control method, a computer storage medium and a vehicle.
Background
In many controllers such as a vehicle control unit and a transmission controller, an EEPROM (Electrically Erasable Programmable Read-Only Memory) is required to be used, and the EEPROM can erase existing information on a computer or a special device, reprogram the information, and generally store data which cannot be lost when the vehicle is powered off. Such as control parameters obtained by self-learning of the system in the program running process, accumulated driving mileage of the vehicle and the like.
When the EEPROM data is stored, the original data needs to be erased first, and then a new value needs to be written, so that after the value is erased, writing of the new value is not completed, and the writing is terminated due to power failure of the controller, which causes an error in the value read at the next power-on.
The foregoing description is provided for general background information and is not admitted to be prior art.
Disclosure of Invention
The invention aims to provide an EEPROM data storage protection control method, a computer storage medium and a vehicle.
The invention provides an EEPROM data storage protection control method, which comprises the following steps:
s1: selecting 3 positions for storing EEPROM state information in the EEPROM, respectively naming the positions as a storage state position, a storage sequence number position and a backup data position, and entering the step S2;
s2: before storing the data, writing 0 in the storage state position, which indicates that the EEPROM write flow has been entered, and proceeding to step S3;
s3: before writing a piece of data, writing the data into a backup data position for backup, writing a current data serial number into a storage serial number position of the written state information, and entering the step S4;
s4: after the current data is backed up, powering off the data for storage, and entering the step S5;
s5: after the storage is finished, continuing to write the backup information into the next data to be stored, then storing until all the data are stored, and entering the step S6;
s6: after all data are stored, writing 1 into the storage flag of the written state information, and entering the step of S7;
s7: before next power-on, reading the storage mark of the written state information, and entering the step S8;
s8: judging whether the storage mark is 1 or not;
if the storage flag is 1, the last data storage is normal;
if the storage flag is not 1, the last data storage is not completed, and the backup data is used as the value of the stored value corresponding to the sequence number.
The invention also provides a computer storage medium, which comprises a computer program, and when the computer program is executed, the method for controlling the EEPROM data storage protection is executed to load the EEPROM data storage protection.
The invention further provides a vehicle, and the vehicle stores vehicle data by adopting the EEPROM data storage protection control method.
The EEPROM data storage protection control method provided by the invention ensures the reasonability of the data and prevents data from being abnormal or unreasonable by using the last value if the storage fails in the data storage process; the phenomenon that the stored value of the EEPROM data is abnormal or lost can be effectively ensured.
Drawings
Fig. 1 is a schematic flow chart of an EEPROM data storage protection control method according to an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
Fig. 1 is a schematic flow chart of an EEPROM data storage protection control method according to an embodiment of the present invention. Referring to fig. 1, the EEPROM data storage protection control method provided by the embodiment of the present invention includes the following steps:
s1: selecting 3 positions for storing EEPROM state information in the EEPROM, respectively naming the positions as a storage state position, a storage sequence number position and a backup data position, and entering the step S2;
s2: before storing the data, writing 0 in the storage state position, which indicates that the EEPROM write flow has been entered, and proceeding to step S3;
s3: before writing a piece of data, writing the data into a backup data position for backup, writing a current data serial number into a storage serial number position of the written state information, and entering the step S4;
s4: after the current data is backed up, powering off the data for storage, and entering the step S5;
s5: after the storage is finished, continuing to write the backup information into the next data to be stored, then storing until all the data are stored, and entering the step S6;
s6: after all data are stored, writing 1 into the storage flag of the written state information, and entering the step of S7;
s7: before next power-on, reading the storage mark of the written state information, and entering the step S8;
s8: judging whether the storage mark is 1 or not;
if the storage flag is 1, the last data storage is normal;
if the storage flag is not 1, the last data storage is not completed, and the backup data is used as the value of the stored value corresponding to the sequence number. Specifically, if the previous data storage is not completed, a certain data value may be incorrect, and at this time, it is known that the storage process is stopped when the previous data is stored through the backup data and the storage sequence number written with the state information, and then the backup data is directly used as the value of the storage value corresponding to the sequence number, which is equivalent to directly using the previous value when the storage fails.
It should be noted that, in the EEPROM data storage protection control method provided in the embodiments of the present invention, a single storage data backup method is used to protect the storage data, and in the data storage process, if the storage fails, the last value is used, so that the rationality of the data is ensured, and abnormal or unreasonable data is prevented; the phenomenon that the stored value of the EEPROM data is abnormal or lost can be effectively ensured.
The invention also provides a computer storage medium, which comprises a computer program, and when the computer program is executed, the EEPROM data storage protection control method is executed to load the EEPROM data storage protection.
The invention also provides a vehicle, which stores the vehicle data by adopting the EEPROM data storage protection control method; for other technical features of the vehicle, please refer to the prior art, which is not described herein.
Based on the above description, the present invention has the following advantages:
1. the EEPROM data storage protection control method provided by the invention adopts a single storage data backup method to protect the storage data, and ensures the rationality of the data and prevents data from being abnormal or unreasonable by using the last value if the storage fails in the data storage process; the phenomenon that the stored value of the EEPROM data is abnormal or lost can be effectively ensured.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (3)

1. An EEPROM data storage protection control method is characterized by comprising the following steps:
s1: selecting 3 positions for storing EEPROM state information in the EEPROM, respectively naming the positions as a storage state position, a storage sequence number position and a backup data position, and entering the step S2;
s2: before storing data, at the storage state position 0, indicating that the EEPROM write flow has been entered, and proceeding to step S3;
s3: before writing a piece of data, writing the data into a backup data position for backup, writing a current data serial number into a storage serial number position of the written state information, and entering the step S4;
s4: after the current data is backed up, powering off the power supply for storing the data, and entering the step S5;
s5: after the storage is finished, continuing to write the backup information into the next data to be stored, then storing until all the data are stored, and entering the step S6;
s6: after all data are stored, writing 1 into the storage flag of the written state information, and entering the step of S7;
s7: before next power-on, reading the storage mark of the written state information, and entering the step S8;
s8: judging whether the storage mark is 1 or not;
if the storage flag is 1, the last data storage is normal;
if the storage flag is not 1, the last data storage is not completed, and the backup data is used as the value of the stored value corresponding to the sequence number.
2. A computer storage medium comprising a computer program that, when executed, loads data storage protection for an EEPROM by performing the EEPROM data storage protection control method of claim 1.
3. A vehicle characterized by storing vehicle data using the EEPROM data storage protection control method claimed in claim 1.
CN202210060274.4A 2022-01-19 2022-01-19 EEPROM data storage protection control method, computer storage medium and vehicle Pending CN114490453A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210060274.4A CN114490453A (en) 2022-01-19 2022-01-19 EEPROM data storage protection control method, computer storage medium and vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210060274.4A CN114490453A (en) 2022-01-19 2022-01-19 EEPROM data storage protection control method, computer storage medium and vehicle

Publications (1)

Publication Number Publication Date
CN114490453A true CN114490453A (en) 2022-05-13

Family

ID=81471749

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210060274.4A Pending CN114490453A (en) 2022-01-19 2022-01-19 EEPROM data storage protection control method, computer storage medium and vehicle

Country Status (1)

Country Link
CN (1) CN114490453A (en)

Similar Documents

Publication Publication Date Title
CN103853582B (en) Flash memory update method
US6549457B1 (en) Using multiple status bits per cell for handling power failures during write operations
EP2386921B1 (en) Method to separate and persist static and dynamic portions of a control application
US20110029726A1 (en) Data updating method, memory system and memory device
CN101246738A (en) Memory system with backup circuit and programming method
CN1236452A (en) Method of updating program code for an optical disc drive microcontroller and an optical disc drive
CN102568609A (en) Systems and methods for autonomous nand refresh
CN101373451B (en) Computer system for protecting double-basic input /output system program and control method thereof
CN103914407A (en) Secure digital memory (SD) card power down protection and restoring method and SD card with power down protection function
US20070250254A1 (en) On-vehicle control apparatus
CN107678420A (en) A kind of engine data on-line storage method
CN109240622A (en) A kind of method and system of EEPROM data write-in
CN106503542B (en) Equipment parameter rewriting prevention method, equipment and air conditioner
CN111506449B (en) Air conditioner parameter storage method and device and storage medium
CN114490453A (en) EEPROM data storage protection control method, computer storage medium and vehicle
CN115793995B (en) Pflash-only data storage method for traditional MCU
JP4647010B2 (en) Electronic control unit
CN110781031B (en) Controller data recovery method and device, controller and automobile
CN113724751A (en) Power management chip, memory protection system and method
JP7007223B2 (en) Control device and abnormality detection method
US9773562B2 (en) Storage apparatus, flash memory control apparatus, and program
CN105706067A (en) Microcomputer with built-in flash memory, method for writing data to built-in flash memory of microcomputer, and program for writing data to flash memory
US20090019213A1 (en) Method and control unit for operating a non-volatile memory, in particular for use in motor vehicles
CN111258922B (en) Method and device for reading threshold parameters
EP2916232B1 (en) Electronic control device for vehicle

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 208, Floor 2, Building 3, No. 168, Shennan Road, Minhang District, Shanghai, 201108

Applicant after: Bureton Technology Co.,Ltd.

Address before: 201100 room g68, 3 / F, building 6, 4299 Jindu Road, Minhang District, Shanghai

Applicant before: Burleton Technology Co.,Ltd.