CN109558274B - Information processing method, device and computer readable storage medium - Google Patents

Information processing method, device and computer readable storage medium Download PDF

Info

Publication number
CN109558274B
CN109558274B CN201811243961.XA CN201811243961A CN109558274B CN 109558274 B CN109558274 B CN 109558274B CN 201811243961 A CN201811243961 A CN 201811243961A CN 109558274 B CN109558274 B CN 109558274B
Authority
CN
China
Prior art keywords
information
atomic write
identifier
write operation
protection
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.)
Active
Application number
CN201811243961.XA
Other languages
Chinese (zh)
Other versions
CN109558274A (en
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.)
Datang Microelectronics Technology Co Ltd
Original Assignee
Datang Microelectronics 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 Datang Microelectronics Technology Co Ltd filed Critical Datang Microelectronics Technology Co Ltd
Priority to CN201811243961.XA priority Critical patent/CN109558274B/en
Publication of CN109558274A publication Critical patent/CN109558274A/en
Application granted granted Critical
Publication of CN109558274B publication Critical patent/CN109558274B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1441Resetting or repowering
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The embodiment of the application discloses an information processing method, an information processing device and a storage medium, comprising the following steps: acquiring information of an atomic write identifier and information of a protection identifier of an electrically erasable programmable read-only memory (EEPROM); wherein the information of the protection mark represents an atomic write operation state of the information of the atomic write mark; determining a power failure occurrence stage of the EEPROM according to the obtained information; and according to the information of the atomic write identifier and the information of the protection identifier, which are obtained by the processing of the determined power failure occurrence stage. According to the technical scheme provided by the embodiment of the application, the power-down occurrence stage of the EEPROM is determined according to the information of the atomic write identifier and the information of the protection identifier, so that the information of the atomic write identifier and the information of the protection identifier are processed to ensure the stability of the information, thereby avoiding the instability of data in the EEPROM caused by the instability of the reading of the information of the atomic write identifier and ensuring the consistency of the reading of the data.

Description

Information processing method, device and computer readable storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to an information processing method, an information processing device and a computer readable storage medium.
Background
An atomic write operation refers to a write operation that satisfies atomicity, which type of write operation is required to ensure stability of data in an operation object in the event of a power down exception. Thus, an atomic write operation is performed in a charged EEPROM (Electrically Erasable Programmable read only memory, EEPROM) to ensure that the stability of the data in the EEPROM is guaranteed after a power down and a power up again, i.e. the first read data from the EEPROM and the subsequent read data are identical, and the read data are either new written data or original data before writing, but not unexpected random data.
In the related art, an atomic write identifier is set in the EEPROM, and the information of the atomic write identifier represents the atomic write operation state of data in the EEPROM, so that when power failure and re-power-on occur, a control module for controlling the atomic write determines that the atomic write operation of the EEPROM is started according to the information of the atomic write identifier, performs backup recovery processing on the data in the EEPROM, and sets the information of the atomic write identifier as information for representing that the atomic write operation of the EEPROM is ended, so that the data read in the EEPROM is the original data of the EEPROM in the subsequent process of reading the EEPROM, and when the atomic write operation of the EEPROM is determined to be ended according to the information of the atomic write identifier, no operation is performed, so that the data read in the EEPROM in the subsequent process of reading the EEPROM is new data, thereby ensuring the stability of the data in the EEPROM.
However, the method defaults the stability of the information of the atomic write identifier, namely, the condition that the power failure occurs in the information writing stage of the atomic write identifier is not considered, and when the power failure occurs in the information writing stage of the atomic write identifier, the information of the atomic write identifier is in an unstable state, so that the information reading of the atomic write identifier is correspondingly in an unstable state, and further, the data in the EEPROM read based on the information of the atomic write identifier is also unstable, so that the consistency of the data reading in the EEPROM cannot be ensured.
Disclosure of Invention
In order to solve the technical problems, embodiments of the present application provide an information processing method, an information processing apparatus, and a computer readable storage medium, which can avoid data instability in an EEPROM caused by unstable information reading of atomic write identifiers, so as to ensure consistency of data reading.
In order to achieve the object of the embodiment of the present application, an embodiment of the present application provides an information processing method, including:
acquiring information of an atomic write identifier and information of a protection identifier of the EEPROM; wherein, the information of the protection mark represents the atomic write operation state of the information of the atomic write mark;
determining a power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier;
and according to the information of the atomic write identifier and the information of the protection identifier, which are obtained by the processing of the determined power failure occurrence stage.
Before the information of the atomic write identifier and the information of the protection identifier of the EEPROM are obtained, the method further comprises the following steps:
acquiring an atomic write operation instruction carrying target data;
storing the data in the EEPROM to a pre-designated backup area according to the atomic write operation instruction;
setting the information of the protection identifier as information indicating that the atomic write operation is started, and setting the information of the atomic write identifier as information indicating that the atomic write operation is started;
writing the target data into the EEPROM;
updating the information of the atomic write identifier to be information indicating that the atomic write operation is finished, and updating the information of the protection identifier to be information indicating that the atomic write operation is finished.
The determining the power failure generation stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier comprises the following steps:
if the information of the atomic write identifier is information indicating that the atomic write operation is finished and the information of the protection identifier is information indicating that the atomic write operation is started, determining that the power failure of the EEPROM occurs in a writing stage of the information of the atomic write identifier or an erasing stage of the information of the protection identifier;
the information of the atomic write identifier and the information of the protection identifier, which are obtained according to the determined power failure occurrence stage, comprise:
setting the information of the atomic write identifier as information indicating that the atomic write operation is finished, and setting the information of the protection identifier as information indicating that the atomic write operation is finished.
The determining the power failure generation stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier comprises the following steps:
if the information of the atomic write identifier is information indicating that the atomic write operation is finished, and the information of the protection identifier is not information indicating that the atomic write operation is started and information indicating that the atomic write operation is finished, determining that the power failure of the EEPROM occurs in an erasing or writing stage of the information of the protection identifier;
the information of the atomic write identifier and the information of the protection identifier, which are obtained according to the determined power failure occurrence stage, comprise:
and setting the information of the protection identifier as information indicating that the atomic write operation is finished.
The determining the power failure generation stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier comprises the following steps:
if the information of the atomic write identifier is not the information indicating that the atomic write operation is finished, determining that the power failure of the EEPROM occurs at a stage after the atomic write operation of the EEPROM is started;
the information of the atomic write identifier and the information of the protection identifier, which are obtained according to the determined power failure occurrence stage, comprise:
setting the information of the atomic write identifier as information indicating that the atomic write operation is started;
restoring the data stored in the backup area;
setting the information of the atomic write identifier as information indicating that the atomic write operation is finished, and setting the protected identifier as information indicating that the atomic write operation is finished.
The information indicating the protection identifier that the atomic write operation has started, the information indicating the atomic write identifier that the atomic write operation has ended, and the information indicating the protection identifier that the atomic write operation has ended are all information with bit numbers exceeding a preset bit number.
The embodiment of the application also provides an information processing device, which comprises: a processor and a memory, wherein the memory stores therein the following commands executable by the processor:
acquiring information of an atomic write identifier and information of a protection identifier of the EEPROM; wherein, the information of the protection mark represents the atomic write operation state of the information of the atomic write mark;
determining a power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier;
and according to the information of the atomic write identifier and the information of the protection identifier, which are obtained by the processing of the determined power failure occurrence stage.
The memory also stores therein the following commands executable by the processor:
acquiring an atomic write operation instruction carrying target data;
storing the data in the EEPROM to a pre-designated backup area according to the atomic write operation instruction;
setting the information of the protection identifier as information indicating that the atomic write operation is started, and setting the information of the atomic write identifier as information indicating that the atomic write operation is started;
writing the target data into the EEPROM;
updating the information of the atomic write identifier to be information indicating that the atomic write operation is finished, and updating the information of the protection identifier to be information indicating that the atomic write operation is finished.
Embodiments of the present application also provide a computer-readable storage medium having stored thereon computer-executable instructions for performing the steps of:
acquiring information of an atomic write identifier and information of a protection identifier of the EEPROM; wherein, the information of the protection mark represents the atomic write operation state of the information of the atomic write mark;
determining a power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier;
and according to the information of the atomic write identifier and the information of the protection identifier, which are obtained by the processing of the determined power failure occurrence stage.
The computer executable commands are also for performing the steps of:
acquiring an atomic write operation instruction carrying target data;
storing the data in the EEPROM to a pre-designated backup area according to the atomic write operation instruction;
setting the information of the protection identifier as information indicating that the atomic write operation is started, and setting the information of the atomic write identifier as information indicating that the atomic write operation is started;
writing the target data into the EEPROM;
updating the information of the atomic write identifier to be information indicating that the atomic write operation is finished, and updating the information of the protection identifier to be information indicating that the atomic write operation is finished.
Compared with the prior art, the embodiment of the application at least comprises the following steps: acquiring information of an atomic write identifier and information of a protection identifier of the EEPROM; wherein the information of the protection mark represents an atomic write operation state of the information of the atomic write mark; determining a power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier; and according to the information of the atomic write identifier and the information of the protection identifier, which are obtained by the processing of the determined power failure occurrence stage. According to the technical scheme provided by the embodiment of the application, the power-down occurrence stage of the EEPROM is determined according to the information of the atomic write identifier and the information of the protection identifier, so that the information of the atomic write identifier and the information of the protection identifier are processed to ensure the stability of the information, thereby avoiding the instability of data in the EEPROM caused by the instability of the reading of the information of the atomic write identifier and ensuring the consistency of the reading of the data.
Additional features and advantages of embodiments of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of embodiments of the application. The objectives and other advantages of embodiments of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the technical aspects of embodiments of the application, and are incorporated in and constitute a part of this specification, illustrate and explain the technical aspects of embodiments of the application, and not to limit the technical aspects of embodiments of the application.
Fig. 1 is a schematic flow chart of an information processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of another information processing method according to an embodiment of the present application;
fig. 3 is a flowchart of another information processing method according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in detail hereinafter with reference to the accompanying drawings. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be arbitrarily combined with each other.
In the related art, the atomic write operation of the host computer to the EEPROM includes the following steps:
step 1, a host acquires an atomic write operation instruction carrying target data.
And 2, the host computer stores the original data in the EEPROM and related information (the position and length information of the original data) in a pre-designated backup area.
Step 3, the host sets the information of the atomic write identifier in the EEPROM to be the START_FLAG from the CLEAR_FLAG so as to indicate that the atomic write operation is started; the clear_flag and the start_flag may be expressed in hexadecimal numbers, for example, clear_flag is expressed as 0x5a and start_flag is expressed as 0XA5.
And 4, writing new data.
It should be noted that, due to the characteristics of the EEPROM, the new data is written in the process of actually erasing the original data, and before the erasing and writing of the EEPROM are not stable, the data is random data due to the electrical characteristics of the hardware, and then the new data is written.
And 5, after the new data is written, setting the start_flag to be the clear_flag to indicate that the atomic write operation is finished.
The data writing time is usually about 2 to 4ms, depending on the electrical characteristics of the EEPROM erasing data. If power is lost at this stage, the data read after power-up is unpredictable. Through test analysis, there are two stages in EEPROM erasing process, namely:
1. the erase phase, i.e. the phase of changing from original data to random data (which may also be referred to as intermediate state data). In this stage, when power is lost, intermediate state data may be read for the first time, and after some time, the intermediate state data may be restored to original data due to unstable data, and when the data is read again, the original data is read subsequently, so that the reading result of the data is unstable.
2. A writing phase, a phase of changing the intermediate state data into writing data. In this stage, when power is lost, the data which is written in newly may be read when the data is read for the first time, and the data which is written in newly may be recovered to the intermediate state data after a certain time passes, and when the data is read again subsequently, the intermediate state data is read, so that the reading result of the data is unstable.
Therefore, in the related art, when specific writing of data is performed (i.e., step 4 in the above process), power-down and power-up are performed, information of atomic write identifiers needs to be checked, if the information is not clear_flag, backup data is restored to the EEPROM, and meanwhile, the information of the atomic write identifiers is set to clear_flag, so that the data read from the EEPROM later is the same data, namely, original data, occurrence of random data reading is avoided, and consistency of data reading is realized. However, the related art does not consider the case where the power failure occurs in the information writing stage of the atomic write flag, and when the power failure occurs in the information writing stage of the atomic write flag, the information of the atomic write flag is in an unstable state and thus the information reading of the atomic write flag is correspondingly also in an unstable state. For example, assuming that an atomic write operation is required to change the balance consumed by the user from org_sh to new_sh, if the power is turned off before the information of the atomic write identifier is changed to clear_flag, the identification value read after the 1 st power-on after the power-off may be clear_flag, and thus the data recovery operation is not performed, the data consumption amount read in the EEPROM is new_sh, if the power-off is normally turned on again, the information of the atomic write identifier may not be clear_flag because the information of the atomic write identifier is in an unstable state, and thus the data recovery operation is performed, and the data consumption amount read in the EEPROM is org_sh and the data reading lacks consistency.
An embodiment of the present application provides an information processing method, as shown in fig. 1, including:
and 101, acquiring information of an atomic write identifier and information of a protection identifier of the EEPROM.
Wherein the information of the protection flag indicates an atomic write operation state of the information of the atomic write flag.
And 102, determining a power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier.
It should be noted that, only if the power failure occurrence stage of the EEPROM is determined, it is known whether the information of the atomic write identifier and the information of the protection identifier are in a stable state, and then the information of the atomic write identifier and the information of the protection identifier are processed.
And 103, processing the obtained information of the atomic write identifier and the obtained information of the protection identifier according to the determined power failure occurrence stage.
It should be noted that, the information of the atomic write identifier and the information of the protection identifier obtained according to the processing of the determined power failure occurrence stage can make the information in the unstable state in the stable state, so that the data in the EEPROM is stable.
The information processing method provided by the embodiment of the application obtains the information of the atomic write identifier and the information of the protection identifier of the EEPROM; wherein the information of the protection mark represents an atomic write operation state of the information of the atomic write mark; determining a power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier; and according to the information of the atomic write identifier and the information of the protection identifier, which are obtained by the processing of the determined power failure occurrence stage. According to the technical scheme provided by the embodiment of the application, the power-down occurrence stage of the EEPROM is determined according to the information of the atomic write identifier and the information of the protection identifier, so that the information of the atomic write identifier and the information of the protection identifier are processed to ensure the stability of the information, thereby avoiding the instability of data in the EEPROM caused by the instability of the reading of the information of the atomic write identifier and ensuring the consistency of the reading of the data.
Optionally, before obtaining the information of the atomic write identifier and the information of the protection identifier of the EEPROM, the method further includes:
step 104, acquiring an atomic write operation instruction carrying target data.
And 105, storing the data in the EEPROM into a pre-designated backup area according to the atomic write operation instruction.
Step 106, setting the information of the protection identifier as the information indicating that the atomic write operation is started, and setting the information of the atomic write identifier as the information indicating that the atomic write operation is started.
Step 107, writing the target data into the EEPROM.
Step 108, updating the information of the atomic write identifier to be the information indicating that the atomic write operation has ended, and updating the information of the protection identifier to be the information indicating that the atomic write operation has ended.
Specifically, the flow chart of steps 104-108 may be as shown in FIG. 2.
Optionally, determining the power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier includes:
if the information of the atomic write flag is information indicating that the atomic write operation has ended and the information of the protection flag is information indicating that the atomic write operation has started, determining that the power failure of the EEPROM occurs in a writing stage of the information of the atomic write flag or an erasing stage of the information of the protection flag.
The method comprises the steps of:
the information of the atomic write flag is set to the information indicating that the atomic write operation has ended, and the information of the protection flag is set to the information indicating that the atomic write operation has ended.
It should be noted that, in the embodiment of the present application, setting the information of the atomic write identifier as the information indicating that the atomic write operation has ended refers to: setting information of an atomic write flag as information indicating that an atomic write operation of data in an EEPROM has ended, and setting information of a protection flag as information indicating that an atomic write operation has ended means that: the information of the protection flag is set to be information indicating that the atomic write operation of the information of the atomic write flag has ended.
Specifically, if the power failure of the EEPROM occurs in the writing stage of the information of the atomic write identifier or the erasing stage of the information of the protection identifier, the information of the atomic write identifier is in an unstable state, so that the information of the atomic write identifier needs to be reset to be the information indicating that the atomic write operation has ended at this time, so as to ensure that the information of the atomic write identifier is in a stable state, and the information of the protection identifier is set to be the information indicating that the atomic write operation has ended, so as to indicate that the atomic write operation of the information of the atomic write identifier has ended.
Optionally, determining the power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier includes:
if the information of the atomic write flag is information indicating that the atomic write operation has ended, and the information of the protection flag is not information indicating that the atomic write operation has started and information indicating that the atomic write operation has ended, determining that the power failure of the EEPROM occurs in an erasing or writing stage of the information of the protection flag.
The method comprises the steps of:
the information of the protection flag is set to information indicating that the atomic write operation has ended.
Specifically, if the power failure of the EEPROM occurs in the erasing or writing stage of the information of the protection flag, it is indicated that the information of the atomic write flag should be in a stable state, so only the information of the protection flag needs to be set as the information indicating that the atomic write operation has ended, so that the atomic write operation indicating the information of the atomic write flag has ended.
Optionally, determining the power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier includes:
if the information of the atomic write flag is not information indicating that the atomic write operation has ended, determining that the power down of the EEPROM occurs at a stage after the atomic write operation of the EEPROM has been started.
The method comprises the steps of:
the information of the atomic write flag is set to information indicating that the atomic write operation has been started.
The data stored in the backup area is restored.
The information of the atomic write flag is set to the information indicating that the atomic write operation has ended, and the protected flag is set to the information indicating that the atomic write operation has ended.
Optionally, the information indicating the protection flag that the atomic write operation has started, the information indicating the atomic write flag that the atomic write flag operation has ended, and the information indicating the protection flag that the atomic write operation has ended are all information that the number of bits exceeds a preset number of bits.
Specifically, the information indicating the protection FLAG that the atomic write operation has been started may be valid_flag, the information indicating the atomic write FLAG that the atomic write operation has been started may be start_flag, the information indicating the atomic write FLAG that the atomic write operation has ended may be clear_flag, and the information indicating the protection FLAG that the atomic write operation has ended may be valid_flag. The valid_flag, start_flag, clear_flag, and invalid_flag may be expressed in hexadecimal numbers, for example, clear_flag is expressed as 0xa55aaa55, start_flag is expressed as 0xa55aaa55, clear_flag is expressed as 0X5aa555AA, and invalid_flag is identified as 0X5AA555 AA.
It should be noted that, the information of the atomic write identifier and the information of the protection identifier are represented by the multi-byte regular characteristic data, so that the repetition of the EEPROM erasing intermediate state data and the information of the identifier can be avoided, and the misjudgment of the information of the identifier is effectively reduced.
Specifically, the information processing method provided in the embodiment of the present application may be shown in fig. 3, and the process of the method is described in detail in the above embodiment, which is not repeated here.
The embodiment of the application also provides an information processing device, which comprises a memory and a processor, wherein the memory stores the following commands which can be executed by the processor:
and acquiring information of an atomic write identifier and information of a protection identifier of the EEPROM. Wherein the information of the protection flag indicates an atomic write operation state of the information of the atomic write flag.
And determining the power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier.
And according to the information of the atomic write identifier and the information of the protection identifier, which are obtained by the processing of the determined power failure occurrence stage.
Optionally, the memory also stores the following commands executable by the processor:
and acquiring an atomic write operation instruction carrying target data.
And storing the data in the EEPROM into a pre-designated backup area according to the atomic write operation instruction.
Setting the information of the protection mark as the information indicating that the atomic write operation is started, and setting the information of the atomic write mark as the information indicating that the atomic write operation is started.
Target data is written into the EEPROM.
The information of the update atomic write flag is information indicating that the atomic write operation has ended, and the information of the update protection flag is information indicating that the atomic write operation has ended.
Optionally, the memory has stored therein the following commands executable by the processor:
if the information of the atomic write flag is information indicating that the atomic write operation has ended and the information of the protection flag is information indicating that the atomic write operation has started, determining that the power failure of the EEPROM occurs in a writing stage of the information of the atomic write flag or an erasing stage of the information of the protection flag.
The information of the atomic write flag is set to the information indicating that the atomic write operation has ended, and the information of the protection flag is set to the information indicating that the atomic write operation has ended.
Optionally, the memory has stored therein the following commands executable by the processor:
if the information of the atomic write flag is information indicating that the atomic write operation has ended, and the information of the protection flag is not information indicating that the atomic write operation has started and information indicating that the atomic write operation has ended, determining that the power failure of the EEPROM occurs in an erasing or writing stage of the information of the protection flag.
The information of the protection flag is set to information indicating that the atomic write operation has ended.
Optionally, the memory has stored therein the following commands executable by the processor:
if the information of the atomic write flag is not information indicating that the atomic write operation has ended, determining that the power down of the EEPROM occurs at a stage after the atomic write operation of the EEPROM has been started.
The information of the atomic write flag is set to information indicating that the atomic write operation has been started.
The data stored in the backup area is restored.
The information of the atomic write flag is set to the information indicating that the atomic write operation has ended, and the protected flag is set to the information indicating that the atomic write operation has ended.
Optionally, the information indicating the protection flag that the atomic write operation has started, the information indicating the atomic write flag that the atomic write flag operation has ended, and the information indicating the protection flag that the atomic write operation has ended are all information that the number of bits exceeds a preset number of bits.
The embodiment of the application also provides a computer readable storage medium, wherein the storage medium is stored with computer executable commands, and the computer executable commands are used for executing the following steps:
and acquiring information of an atomic write identifier and information of a protection identifier of the EEPROM. Wherein the information of the protection flag indicates an atomic write operation state of the information of the atomic write flag.
And determining the power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier.
And according to the information of the atomic write identifier and the information of the protection identifier, which are obtained by the processing of the determined power failure occurrence stage.
Optionally, the computer executable instructions are further for performing the steps of:
and acquiring an atomic write operation instruction carrying target data.
And storing the data in the EEPROM into a pre-designated backup area according to the atomic write operation instruction.
Setting the information of the protection mark as the information indicating that the atomic write operation is started, and setting the information of the atomic write mark as the information indicating that the atomic write operation is started.
Target data is written into the EEPROM.
The information of the update atomic write flag is information indicating that the atomic write operation has ended, and the information of the update protection flag is information indicating that the atomic write operation has ended.
Optionally, the computer executable command is specifically configured to perform the steps of:
if the information of the atomic write flag is information indicating that the atomic write operation has ended and the information of the protection flag is information indicating that the atomic write operation has started, determining that the power failure of the EEPROM occurs in a writing stage of the information of the atomic write flag or an erasing stage of the information of the protection flag.
The information of the atomic write flag is set to the information indicating that the atomic write operation has ended, and the information of the protection flag is set to the information indicating that the atomic write operation has ended.
Optionally, the computer executable command is specifically configured to perform the steps of:
if the information of the atomic write flag is information indicating that the atomic write operation has ended, and the information of the protection flag is not information indicating that the atomic write operation has started and information indicating that the atomic write operation has ended, determining that the power failure of the EEPROM occurs in an erasing or writing stage of the information of the protection flag.
The information of the protection flag is set to information indicating that the atomic write operation has ended.
Optionally, the computer executable command is specifically configured to perform the steps of:
if the information of the atomic write flag is not information indicating that the atomic write operation has ended, determining that the power down of the EEPROM occurs at a stage after the atomic write operation of the EEPROM has been started.
The information of the atomic write flag is set to information indicating that the atomic write operation has been started.
The data stored in the backup area is restored.
The information of the atomic write flag is set to the information indicating that the atomic write operation has ended, and the protected flag is set to the information indicating that the atomic write operation has ended.
Optionally, the information indicating the protection flag that the atomic write operation has started, the information indicating the atomic write flag that the atomic write flag operation has ended, and the information indicating the protection flag that the atomic write operation has ended are all information that the number of bits exceeds a preset number of bits.
Although the embodiments of the present application are described above, the embodiments are merely used for facilitating understanding of the embodiments of the present application, and are not intended to limit the embodiments of the present application. Any person skilled in the art can make any modification and variation in form and detail without departing from the spirit and scope of the embodiments of the application, but the scope of the embodiments of the application is defined by the appended claims.

Claims (10)

1. An information processing method, characterized by comprising:
acquiring information of an atomic write identifier and information of a protection identifier of an EEPROM; wherein, the information of the protection mark represents the atomic write operation state of the information of the atomic write mark;
determining a power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier;
and according to the information of the atomic write identifier and the information of the protection identifier obtained by the processing of the determined power failure occurrence stage, ensuring the consistency of data reading in the EEPROM.
2. The information processing method according to claim 1, wherein before the information of the atomic write identifier and the information of the protection identifier of the EEPROM are acquired, further comprising:
acquiring an atomic write operation instruction carrying target data;
storing the data in the EEPROM to a pre-designated backup area according to the atomic write operation instruction;
setting the information of the protection identifier as information indicating that the atomic write operation is started, and setting the information of the atomic write identifier as information indicating that the atomic write operation is started;
writing the target data into the EEPROM;
updating the information of the atomic write identifier to be information indicating that the atomic write operation is finished, and updating the information of the protection identifier to be information indicating that the atomic write operation is finished.
3. The information processing method according to claim 1 or 2, wherein the determining a power-down occurrence stage of the EEPROM based on the obtained information of the atomic write flag and the information of the protection flag includes:
if the information of the atomic write identifier is information indicating that the atomic write operation is finished and the information of the protection identifier is information indicating that the atomic write operation is started, determining that the power failure of the EEPROM occurs in a writing stage of the information of the atomic write identifier or an erasing stage of the information of the protection identifier;
the information of the atomic write identifier and the information of the protection identifier, which are obtained according to the determined power failure occurrence stage, comprise:
setting the information of the atomic write identifier as information indicating that the atomic write operation is finished, and setting the information of the protection identifier as information indicating that the atomic write operation is finished.
4. The information processing method according to claim 1 or 2, wherein the determining a power-down occurrence stage of the EEPROM based on the obtained information of the atomic write flag and the information of the protection flag includes:
if the information of the atomic write identifier is information indicating that the atomic write operation is finished, and the information of the protection identifier is not information indicating that the atomic write operation is started and information indicating that the atomic write operation is finished, determining that the power failure of the EEPROM occurs in an erasing or writing stage of the information of the protection identifier;
the information of the atomic write identifier and the information of the protection identifier, which are obtained according to the determined power failure occurrence stage, comprise:
and setting the information of the protection identifier as information indicating that the atomic write operation is finished.
5. The information processing method according to claim 1 or 2, wherein the determining a power-down occurrence stage of the EEPROM based on the obtained information of the atomic write flag and the information of the protection flag includes:
if the information of the atomic write identifier is not the information indicating that the atomic write operation is finished, determining that the power failure of the EEPROM occurs at a stage after the atomic write operation of the EEPROM is started;
the information of the atomic write identifier and the information of the protection identifier, which are obtained according to the determined power failure occurrence stage, comprise:
setting the information of the atomic write identifier as information indicating that the atomic write operation is started;
restoring the data stored in the backup area;
setting the information of the atomic write identifier as information indicating that the atomic write operation is finished, and setting the protected identifier as information indicating that the atomic write operation is finished.
6. The information processing method according to claim 2, wherein the information indicating the protection flag that the atomic write operation has started, the information indicating the atomic write flag that the atomic write flag operation has ended, and the information indicating the protection flag that the atomic write operation has ended are all information having a bit number exceeding a preset bit number.
7. An information processing apparatus, characterized by comprising: a processor and a memory, wherein the memory stores therein the following commands executable by the processor:
acquiring information of an atomic write identifier and information of a protection identifier of the EEPROM; wherein, the information of the protection mark represents the atomic write operation state of the information of the atomic write mark;
determining a power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier;
and according to the information of the atomic write identifier and the information of the protection identifier obtained by the processing of the determined power failure occurrence stage, ensuring the consistency of data reading in the EEPROM.
8. The information processing apparatus according to claim 7, wherein the memory further stores therein the following commands executable by the processor:
acquiring an atomic write operation instruction carrying target data;
storing the data in the EEPROM to a pre-designated backup area according to the atomic write operation instruction;
setting the information of the protection identifier as information indicating that the atomic write operation is started, and setting the information of the atomic write identifier as information indicating that the atomic write operation is started;
writing the target data into the EEPROM;
updating the information of the atomic write identifier to be information indicating that the atomic write operation is finished, and updating the information of the protection identifier to be information indicating that the atomic write operation is finished.
9. A computer-readable storage medium having stored thereon computer-executable instructions for performing the steps of:
acquiring information of an atomic write identifier and information of a protection identifier of the EEPROM; wherein, the information of the protection mark represents the atomic write operation state of the information of the atomic write mark;
determining a power failure occurrence stage of the EEPROM according to the obtained information of the atomic write identifier and the information of the protection identifier;
and according to the information of the atomic write identifier and the information of the protection identifier obtained by the processing of the determined power failure occurrence stage, ensuring the consistency of data reading in the EEPROM.
10. The computer-readable storage medium of claim 9, wherein the computer-executable instructions are further for performing the steps of:
acquiring an atomic write operation instruction carrying target data;
storing the data in the EEPROM to a pre-designated backup area according to the atomic write operation instruction;
setting the information of the protection identifier as information indicating that the atomic write operation is started, and setting the information of the atomic write identifier as information indicating that the atomic write operation is started;
writing the target data into the EEPROM;
updating the information of the atomic write identifier to be information indicating that the atomic write operation is finished, and updating the information of the protection identifier to be information indicating that the atomic write operation is finished.
CN201811243961.XA 2018-10-24 2018-10-24 Information processing method, device and computer readable storage medium Active CN109558274B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811243961.XA CN109558274B (en) 2018-10-24 2018-10-24 Information processing method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811243961.XA CN109558274B (en) 2018-10-24 2018-10-24 Information processing method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109558274A CN109558274A (en) 2019-04-02
CN109558274B true CN109558274B (en) 2023-08-15

Family

ID=65865013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811243961.XA Active CN109558274B (en) 2018-10-24 2018-10-24 Information processing method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109558274B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552650B (en) * 2020-04-13 2021-03-02 深圳市时创意电子有限公司 Data storage method and device, storage medium and data storage equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1845082A (en) * 2006-04-29 2006-10-11 北京飞天诚信科技有限公司 Safety writing method for flash memory
CN101025715A (en) * 2007-03-07 2007-08-29 北京飞天诚信科技有限公司 Power-fail protection method based on two continuous logical blocks for non-volatile memory
CN101923499A (en) * 2009-03-30 2010-12-22 英特尔公司 Techniques to perform power fail-safe caching without atomic metadata
CN104267975A (en) * 2014-06-11 2015-01-07 大唐微电子技术有限公司 Card, device and method for processing extensive application data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106816175A (en) * 2015-12-01 2017-06-09 中芯国际集成电路制造(上海)有限公司 The control method and device of memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1845082A (en) * 2006-04-29 2006-10-11 北京飞天诚信科技有限公司 Safety writing method for flash memory
CN101025715A (en) * 2007-03-07 2007-08-29 北京飞天诚信科技有限公司 Power-fail protection method based on two continuous logical blocks for non-volatile memory
CN101923499A (en) * 2009-03-30 2010-12-22 英特尔公司 Techniques to perform power fail-safe caching without atomic metadata
CN104267975A (en) * 2014-06-11 2015-01-07 大唐微电子技术有限公司 Card, device and method for processing extensive application data

Also Published As

Publication number Publication date
CN109558274A (en) 2019-04-02

Similar Documents

Publication Publication Date Title
CN108170495B (en) BIOS upgrading method, system, equipment and computer readable storage medium
US9274788B2 (en) Information processing apparatus, method for controlling the same, and storage medium
CN107329905B (en) Data storage device and flash memory control method
CN108958643B (en) Data storage device and operation method thereof
US20110119430A1 (en) Methods for measuring usable lifespan and replacing an in-system programming code of a memory device, and data storage sysem using the same
CN107632943B (en) Solid state disk data protection method and solid state disk
US20150074336A1 (en) Memory system, controller and method of controlling memory system
CN101373451A (en) Computer system for protecting double-basic input /output system program and control method thereof
TW201403309A (en) Data storage device and operating method for flash memory
CN107045423B (en) Memory device and data access method thereof
CN108037932B (en) SPI-NAND configuration file acquisition method and device
CN110688141B (en) Firmware updating method
CN109558274B (en) Information processing method, device and computer readable storage medium
CN112863582B (en) Data power failure holding method and device, computer equipment and storage medium
CN103970616A (en) Data recovery system and method
JP4826232B2 (en) Information processing apparatus and boot program rewriting method
CN113704177B (en) Storage method, system and related components of server firmware upgrade file
CN113434086B (en) Data storage method, device, nonvolatile memory device and memory
JP2009276883A (en) Semiconductor auxiliary storage device
JP4239754B2 (en) Nonvolatile memory system
JP2008225922A (en) Nonvolatile storage device
JP2005321843A (en) Rewriting method for firmware
US20170010827A1 (en) File system of controller
CN111273864B (en) Method and system for reducing NAND FLASH erasing times
CN101464817B (en) Data recovery method

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
GR01 Patent grant
GR01 Patent grant