CN112347002A - flash data storage method and system, computer equipment and storage medium - Google Patents

flash data storage method and system, computer equipment and storage medium Download PDF

Info

Publication number
CN112347002A
CN112347002A CN202011268987.7A CN202011268987A CN112347002A CN 112347002 A CN112347002 A CN 112347002A CN 202011268987 A CN202011268987 A CN 202011268987A CN 112347002 A CN112347002 A CN 112347002A
Authority
CN
China
Prior art keywords
data
group
sector
last
sectors
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.)
Granted
Application number
CN202011268987.7A
Other languages
Chinese (zh)
Other versions
CN112347002B (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.)
Xiamen Reliable Intellectual Property Service Co ltd
Original Assignee
Hangzhou Aixin Intelligent 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 Hangzhou Aixin Intelligent Technology Co ltd filed Critical Hangzhou Aixin Intelligent Technology Co ltd
Priority to CN202011268987.7A priority Critical patent/CN112347002B/en
Publication of CN112347002A publication Critical patent/CN112347002A/en
Application granted granted Critical
Publication of CN112347002B publication Critical patent/CN112347002B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • 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)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The application relates to a flash data storage method and device, computer equipment and a storage medium. The method comprises the following steps: a, B configuring two sectors, dividing each sector into n groups; reading the effective mark values of the same group of data in the sectors A and B, and searching the position of the last data record according to the effective mark values of the same group of data in the two sectors; judging an invalid sector according to the valid mark value of the specific group, and erasing the data of the invalid sector; new data is written by the next group of locations of the last data record. According to the technical scheme, the position of the last data recording is searched through the effective mark value of each group, the invalid sectors in the two sectors are judged, the data of the invalid sectors are deleted before the data are written, meanwhile, the data are written from the next group of the last data recording position, the effective writing address is improved, sector erasing operation is reduced, and timeliness is improved.

Description

flash data storage method and system, computer equipment and storage medium
Technical Field
The present application relates to the field of depth camera technology, and in particular, to a method and system for storing flash data, a computer device, and a storage medium.
Background
In the computer system of today, it is not new to mount several flash chips to achieve the way of permanently saving more data. The larger the capacity of the memory chip is, the more and more data stored in the memory chip is, so that how to efficiently and safely read and write the flash chip is very important. In addition, the embedded equipment is smaller and smaller, and the UPS power supply system is difficult to implant, and the abnormal power failure processing of the flash chip is also worth attention at the moment.
In the current flash data writing process, the two steps are generally divided into two steps, namely, the sector where the designated address is located is firstly erased, and then the data is written in the designated address. When some data needs to be written frequently, the following problems can be caused in such a rough operation mode: each time of reading and writing is at a fixed address, but the number of times of reading and writing of the flash is fixed, which can cause premature damage of the flash, and simultaneously, before each time of writing data, the whole sector needs to be erased, when a program needs to frequently write data into the flash, the erasing process will consume a great deal of time, and the timeliness of the program is seriously affected.
Disclosure of Invention
In view of the above, it is necessary to provide a method for storing flash data in order to solve the above technical problems.
A method for storing flash data comprises the following steps:
a, B configuring two sectors, dividing each sector into n groups;
reading the effective mark values of the same group of data in the sectors A and B, and searching the position of the last data record according to the effective mark values of the same group of data in the two sectors;
judging an invalid sector according to the valid mark value of the specific group, and erasing the data of the invalid sector;
new data is written by the next group of locations of the last data record.
In one embodiment, the method further comprises the following steps:
reading the data of the next group according to the position of the last data record;
judging whether the read group data exists or not;
if the data exists, representing that the data writing fails caused by the last power failure, and recording a last writing failure mark.
In an embodiment, the finding the position of the last data record according to the valid flag values of the same group of data in the two sectors specifically includes the following steps:
reading valid flag values of a first set of data of the A sector and the B sector;
and searching the position of the last data record according to the valid mark values of the two first groups of data.
In an embodiment, the finding the position of the last data record according to the valid flag values of the two first groups of data specifically includes the following steps:
the first group of data of the A sector is marked as A1, and the first group of data of the B sector is marked as B1;
reading the valid flag values in A1 and B1, wherein the valid flag value of A1 is marked as X, the valid flag value of B1 is marked as Y, and meanwhile, when the value of the valid flag value is 0xFF, the group of data is represented to be invalid, and when the value of the valid flag value is 0X7F, the group of data is represented to be valid;
if X, Y is equal to 0xFF, the data representing the A sector and the B sector are invalid, An or Bn is the position of the last data record by default, the data of An or Bn is read when the data is read next time, An is the last group of data of the A sector, and Bn is the last group of data of the B sector;
if X, Y is equal to 0x7F, then the valid flag value Z in An must be read again, and if Z is equal to 0xFF, then the last data record is located at A1; if Z is not equal to 0xFF, the position of the last data record is B1;
if X is equal to 0xFF and Y is equal to 0X7F, reading the last group of data of the B sector forwards, and searching group data Bt with a first effective mark value of 0X7F as the position of the last data record, wherein Bt is represented as the data of the t-th group of the B sector;
if X is equal to 0X7F and Y is equal to 0xFF, reading from the last group of data of the A sector and searching for the group data At with the first valid flag value of 0X7F as the position of the last data record, where At is the t-th group of data of the A sector.
In an embodiment, the determining, in combination with the valid flag value of the specific group, an invalid sector, and erasing data of the invalid sector specifically includes the following steps:
when X, Y is equal to 0x7F, the valid flag value Z in An needs to be read again, if Z is equal to 0xFF, all data in B sector is erased; if Z is not equal to 0xFF, all data in the A sector is erased.
In one embodiment, the method further comprises the following steps:
judging whether the previous power failure has sector erasing failure;
if the position of the last data record is in the A sector, reading the effective mark value of Bn; when the effective mark value of Bn is not equal to 0xFF, the B sector is erased again;
if the position of the last data recording is in the B sector, reading the effective mark value of An; when the valid flag value of An is not equal to 0xFF, the A sector is re-erased.
In one embodiment, the method further comprises the following steps:
when new data is written in, analyzing the value of the last write failure mark;
if the last write failure flag is characterized as failure, skipping the group of the last write operation failure;
and if the last write failure mark is characterized as successful, normally judging to write.
In an embodiment, if the last write failure flag is characterized as a failure, the group in which the last write operation failed needs to be skipped, specifically including the following steps:
if the read group is the last group of the sectors, erasing the data of the other sector, switching to the first group of the sectors which are just erased for writing during writing, and erasing the sectors which are fully written before the writing is finished;
if the read group is the penultimate group of the sector, switching to the first group of the other sector for writing during writing, and erasing the sector which is fully written before the writing is finished;
if the read group is any group except the two cases, writing the read group into the next group of the read group;
in addition to the above, if the last write failure flag is characterized as successful, then normally determining the write, specifically includes the following steps:
if the read group is the last group of the sectors, switching to the first group of another sector for writing during writing, and erasing the sectors which are fully written before the writing after the writing;
if the read group is any group that is not the last group, the next group of the read group is written.
A flash data saving system, comprising:
a configuration module, configured A, B two sectors, each sector being divided into n groups;
the searching module is used for reading the effective mark values of the same group of data in the A and B sectors and searching the position of the last data record according to the effective mark values of the same group of data in the two sectors;
the erasing module is used for judging invalid sectors according to the valid mark values of the specific group and erasing the data of the invalid sectors; and
and the writing module is used for writing new data into the next group of the position recorded by the last data.
A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of a method for saving flash data when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of a method for saving flash data.
The method adopts a flash memory space partition management method, in the memory, the storage space required to store specific data is divided into two sectors for management, each sector is divided into each group according to the size of the specific data, and the reading and writing of the flash are operated by taking the group as a unit; when writing operation is carried out, information in a sector is read firstly, the address written at this time is judged, and when data is written, a specific effective mark value is additionally arranged at the tail of the data to indicate whether the group of data is effective or not, so that power failure caused by half writing of the data is prevented, and the data is unreliable. And simultaneously, after the writing is finished, the written data is read immediately, the read data is compared with the written data, and if the read data is inconsistent with the written data, flash life exhaustion early warning is carried out.
An erase sector operation erases another sector only if the address where the data is written is the first group of the current sector. Therefore, the problem that the operation timeliness of the program is influenced because the sector where the data is located needs to be erased before the data is written every time is solved.
During reading operation, the information of each sector is read first, and the address read this time is judged. And the read data is subjected to identification judgment, so that the real validity of the data is ensured. If invalid, it is considered to take the last written data.
Drawings
FIG. 1 is a diagram illustrating an exemplary embodiment of a method for storing flash data;
FIG. 2 is a flowchart illustrating a method for storing flash data according to an embodiment;
FIG. 3 is a block diagram showing a configuration of a flash data saving system according to an embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The flash data storage method can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and the like, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in FIG. 2, a method for saving flash data is provided. The method is described as an example of the application to the terminal in fig. 1, and the method includes the following steps:
s100, configuring A, B two sectors, and dividing each sector into n groups.
S200, reading the effective mark values of the same group of data in the sectors A and B, and searching the position of the last data record according to the effective mark values of the same group of data in the two sectors.
S300, judging an invalid sector by combining the valid mark values of the specific group, and erasing the data of the invalid sector;
s400, new data is written by the next group of the position recorded by the last data.
The specific content of step S100 includes the following steps:
and after power-on operation, setting the initial state of each variable value. A, B two sectors are configured for storing specific data, the first address of record A, B sector is Paddr1, Paddr2, valid flag value Fvalue2 of each group in A, B sector is 0x7F, sector flag fsegction is 0, group number Fgroup is 0, flash life alarm flag Ferror is 0, last write failure flag Fw _ fail is 0. Where Fsection is an a sector when Fsection is 1, a B sector when Fsection is 2, and Fvalue2 is 0xFF indicating data invalid (set to valid by default, Fvalue2 is 0x 7F).
In another embodiment, step S100 further includes the following steps:
when the initial state of each variable value is configured, an address Paddr0 is configured to store an enable flag value Fvalue1 ═ 0xAA 55.
After the initial state of each variable value is configured, first, whether a storage method of flash data is enabled or not is detected, two bytes of data are read from an address Paddr0 and are marked as T:
if T is equal to Fvalue1, the storage method of the flash data is enabled, and A, B sectors do not need to be erased;
if T is not equal to Fvalue1, indicating that the storage method of the flash data is not enabled, A, B sectors need to be erased, and then Fvalue1 is written into the address of Paddr 0.
Each sector is divided into n groups, the n groups of data of the a sector are respectively a1-An, the n groups of data of the B sector are respectively B1-Bn, the size of the group is the size of the specific data plus one byte (for putting a valid flag value), and therefore, the group number Fgroup is (1, 2, 3 … … n). And if the sector space has not enough space after the sharing, abandoning the use of the space.
The specific contents of step S200 and step S300 include the following steps:
the position of the last data record is found according to the valid flag values of the same group of data in the two sectors, and the same group of data can be found for the data of any one of the sectors, for example, the position of the last data record can be found through the valid flag values of A1 and B1, can be found through An and Bn, and can be found through At and Bt (At is the data of the t-th group in the A sector, Bt is the data of the t-th group in the B sector, and t is any number in 1-n).
In the present embodiment, a1 and B1 are exemplified for detailed description:
reading valid marker values in A1 and B1, wherein the valid marker value of A1 is marked as X, the valid marker value of B1 is marked as Y (X, Y only represents the marker values in each group, and has no other specific meanings, the same applies to Z), and meanwhile, when the value of the valid marker value is 0xFF, the group of data is represented to be invalid, and when the value of the valid marker value is 0X7F, the group of data is represented to be valid;
if X, Y is equal to 0xFF, the data representing the a sector and the B sector are invalid, An or Bn is the default position of the last data record, the data of An or Bn is read when the data is read next time, An is the last group of data of the a sector, Bn is the last group of data of the B sector, and at this time, the initial variable is fsegction-1 or fsegction-2, and Fgroup-n;
if X, Y is equal to 0x7F, the valid flag value Z in An needs to be read again, if Z is equal to 0xFF, the position of the last data record is a1, and at the same time, the initial variable Fsection is set to 1, and all data in the B sector are erased; if Z is not equal to 0xFF, the position of the last data record is B1, meanwhile, the initial variable Fsection is set to be 2, and all data in the A sector are erased;
if X is equal to 0xFF and Y is equal to 0X7F, reading from the last group of data in the B sector, and finding out group data Bt with a first valid flag value of 0X7F, which is the position of the last data record, where Bt is represented as the data in the t-th group of the B sector, at this time, setting an initial variable Fsection to 2, and Fgroup to t;
if X is equal to 0X7F and Y is equal to 0xFF, the last group of data in the a sector is read forward, and the group data At with the first valid flag value of 0X7F is the position of the last data record, where At represents the data in the t-th group of the a sector, and At this time, the initial variable Fsection is set to 1 and Fgroup is set to t.
Considering the accuracy of the method affected by the special situation, therefore, the determination S500 is performed to determine whether there is a sector erasure failure in the last power failure, and step S500 specifically includes the following steps:
if the position of the last data recording is in the A sector (Fsection is 1), reading a valid flag value of Bn; when the effective mark value of Bn is not equal to 0xFF, the B sector is erased again;
if the position of the last data recording is in the B sector (Fsection is 2), reading a valid flag value of An; when the valid flag value of An is not equal to 0xFF, the A sector is re-erased.
In another embodiment, before new data is written, a power-down writing determination step S600 is performed, where the step S600 specifically includes the following steps:
reading the data of the next group according to the position of the last data record;
judging whether the read group data has invalid data or not;
if invalid data exists (namely, data in the invalid data is not equal to 0xFF), the data write failure caused by last power failure is represented, and a last write failure mark is recorded, and at this time, a last write failure mark Fw _ fail is set to 1.
In the above process, the data of the next group of operation addresses is read, and the operation address calculation formula is as follows:
if Fsection is 1, the operation address Paddr1+ (Fgroup-1) × (data size + 1);
if Fsection is 2, the operation address Paddr2+ (Fgroup-1) × (data size + 1).
The specific content of step S400 includes the following steps:
when new data is written in, analyzing the value of the last write failure mark;
if the last write failure flag is characterized as failure (Fw _ fail ═ 1), skipping the group in which the last write operation failed;
if the last write failure flag is characterized as successful (Fw _ fail ═ 0), then the write is normally judged.
If Fw _ fail is 1, the method specifically includes the following steps:
if the read group is the last group of the sectors (i.e. Fgroup is n, which indicates that the previous writing in the 1 st group of another sector fails), erasing the data of another sector, when new data is written, switching to the first group of the sectors which are just erased for writing, erasing the sectors which are full before the writing is completed, setting the last writing failure flag Fw _ fail to be 0, simultaneously, after the writing is completed, reading the written data and comparing the written data with the target data, and if the read data is inconsistent with the target data, setting the flash life alarm flag Ferror to be 1;
if the read group is the penultimate group of the sectors (i.e. Fgroup +1 equals n, which indicates that the last group of the sectors failed to be written in at the time of the last time), when new data is written, switching to the first group of another sector for writing, erasing the sectors which are fully written before the writing is finished, setting the last writing failure flag Fw _ fail to be 0, simultaneously, after the writing is finished, reading the written data and comparing the written data with target data, and if the written data is not consistent with the target data, setting the flash life alarm flag Ferror equals 1;
if the read group is any one of the two cases (i.e., Fgroup +1< n), new data is written into the next group of the read group (i.e., Fgroup +1), and after the write is completed, the last write failure flag Fw _ fail is set to 0. Then reading the written data and comparing the data with the target data, and if the data is inconsistent with the target data, setting a flash life alarm mark Ferror to be 1;
if Fw _ fail is equal to 0, the method specifically includes the following steps:
if the read group is the last group of the sectors (that is, Fgroup is n), during writing, switching to the first group of another sector for writing, erasing the sectors which are fully written before the writing is finished, simultaneously, after the writing is finished, reading the written data and comparing the written data with the target data, and if the written data is not consistent with the target data, setting a flash life alarm mark Ferror to be 1;
and if the read group is any group which is not the last group (namely Fgroup < n), writing the next group of the read group, simultaneously, after the writing is finished, comparing the read and written data with the target data, and if the read and written data are inconsistent with the target data, setting a flash service life alarm mark Ferror to be 1.
Because the flash service life alarm mark Ferror is generated when data is written in, the flash data storage method can perform early warning, and the phenomenon that the read data is unreliable and the normal operation of the read data is influenced is avoided.
In another embodiment, the method for saving flash data of the present invention further includes the following steps:
during a read operation, whether the last data read is the data which is successfully written or the data which is failed to be written last time can be determined according to the value of Fw _ fail and the operation addresses represented by Fsection and Fgroup.
The flash data storage method solves the problem that the flash is prematurely damaged due to frequent writing because each read and write is carried out at a fixed address by partition and grouping storage, prolongs the service life of the flash, and can inquire the data written in history; the strategy that the erasing operation is executed only when the sector is fully written is adopted, so that the problem that the time consumption is large because the whole sector needs to be erased before data is written every time is solved, and the running timeliness is optimized; by comparing the effective mark values, the problem that the normal operation of the data is influenced because the data is not real when the power is turned on and started next time due to power failure in the data writing operation process is solved;
in one embodiment, as shown in fig. 3, a system for saving flash data further includes a configuration module 1, a search module 2, an erase module 3, and a write module 4. The configuration module 1 is used for configuring A, B two sectors, and dividing each sector into n groups; the searching module 2 is used for reading the effective mark values of the same group of data in the sectors A and B and searching the position of the last data record according to the effective mark values of the same group of data in the two sectors; the erasing module 3 is used for judging an invalid sector according to the valid mark value of the specific group and erasing the data of the invalid sector; the write module 4 is used for writing new data from the next group of locations where the last data was recorded.
For the specific limitation of the above-mentioned flash data saving system, reference may be made to the above limitation on the flash data saving method, and details are not described herein again. The various modules in the above-described apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used for storing the data of the human face living body detection method based on the infrared image. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a human face living body detection method based on infrared images.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
s100, configuring A, B two sectors, and dividing each sector into n groups.
S200, reading the effective mark values of the same group of data in the sectors A and B, and searching the position of the last data record according to the effective mark values of the same group of data in the two sectors.
And S300, judging an invalid sector according to the valid mark value of the specific group, and erasing the data of the invalid sector.
S400, new data is written by the next group of the position recorded by the last data.
The specific content of step S100 includes the following steps:
and after power-on operation, setting the initial state of each variable value. A, B two sectors are configured for storing specific data, the first address of record A, B sector is Paddr1, Paddr2, valid flag value Fvalue2 of each group in A, B sector is 0x7F, sector flag fsegction is 0, group number Fgroup is 0, flash life alarm flag Ferror is 0, last write failure flag Fw _ fail is 0. Where Fsection is an a sector when Fsection is 1, a B sector when Fsection is 2, and Fvalue2 is 0xFF indicating data invalid (set to valid by default, Fvalue2 is 0x 7F).
In another embodiment, step S100 further includes the following steps:
when the initial state of each variable value is configured, an address Paddr0 is configured to store an enable flag value Fvalue1 ═ 0xAA 55.
After the initial state of each variable value is configured, first, whether a storage method of flash data is enabled or not is detected, two bytes of data are read from an address Paddr0 and are marked as T:
if T is equal to Fvalue1, the storage method of the flash data is enabled, and A, B sectors do not need to be erased;
if T is not equal to Fvalue1, indicating that the storage method of the flash data is not enabled, A, B sectors need to be erased, and then Fvalue1 is written into the address of Paddr 0.
Each sector is divided into n groups, the n groups of data of the a sector are respectively a1-An, the n groups of data of the B sector are respectively B1-Bn, the size of the group is the size of the specific data plus one byte (for putting a valid flag value), and therefore, the group number Fgroup is (1, 2, 3 … … n). And if the sector space has not enough space after the sharing, abandoning the use of the space.
The specific contents of step S200 and step S300 include the following steps:
the position of the last data record is found according to the valid flag values of the same group of data in the two sectors, and the same group of data can be found for the data of any one of the sectors, for example, the position of the last data record can be found through the valid flag values of A1 and B1, can be found through An and Bn, and can be found through At and Bt (At is the data of the t-th group in the A sector, Bt is the data of the t-th group in the B sector, and t is any number in 1-n).
In the present embodiment, a1 and B1 are exemplified for detailed description:
the effective marker values in A1 and B1 are read, the effective marker value in A1 is recorded as X, and the effective marker value in B1 is recorded as Y (X, Y only represents the marker values in each group, and has no other specific meanings, and Z is the same): meanwhile, when the value of the valid flag value is 0xFF, the group of data is represented to be invalid, and when the value of the valid flag value is 0x7F, the group of data is represented to be valid;
if X, Y is equal to 0xFF, the data representing the a sector and the B sector are invalid, An or Bn is the default position of the last data record, the data of An or Bn is read when the data is read next time, An is the last group of data of the a sector, Bn is the last group of data of the B sector, and at this time, the initial variable is fsegction-1 or fsegction-2, and Fgroup-n;
if X, Y is equal to 0x7F, the valid flag value Z in An needs to be read again, if Z is equal to 0xFF, the position of the last data record is a1, and at the same time, the initial variable Fsection is set to 1, and all data in the B sector are erased; if Z is not equal to 0xFF, the position of the last data record is B1, meanwhile, the initial variable Fsection is set to be 2, and all data in the A sector are erased;
if X is equal to 0xFF and Y is equal to 0X7F, reading from the last group of data in the B sector, and finding out group data Bt with a first valid flag value of 0X7F, which is the position of the last data record, where Bt is represented as the data in the t-th group of the B sector, at this time, setting an initial variable Fsection to 2, and Fgroup to t;
if X is equal to 0X7F and Y is equal to 0xFF, the last group of data in the a sector is read forward, and the group data At with the first valid flag value of 0X7F is the position of the last data record, where At represents the data in the t-th group of the a sector, and At this time, the initial variable Fsection is set to 1 and Fgroup is set to t.
Considering the accuracy of the method affected by the special situation, therefore, the determination S500 is performed to determine whether there is a sector erasure failure in the last power failure, and step S500 specifically includes the following steps:
if the position of the last data recording is in the A sector (Fsection is 1), reading a valid flag value of Bn; when the effective mark value of Bn is not equal to 0xFF, the B sector is erased again;
if the position of the last data recording is in the B sector (Fsection is 2), reading a valid flag value of An; when the valid flag value of An is not equal to 0xFF, the A sector is re-erased.
In another embodiment, before new data is written, a power-down writing determination step S600 is performed, where the step S600 specifically includes the following steps:
reading the data of the next group according to the position of the last data record;
judging whether the read group data has invalid data or not;
if invalid data exists (namely, data in the invalid data is not equal to 0xFF), the data write failure caused by last power failure is represented, and a last write failure mark is recorded, and at this time, a last write failure mark Fw _ fail is set to 1.
In the above process, the data of the next group of operation addresses is read, and the operation address calculation formula is as follows:
if Fsection is 1, the operation address Paddr1+ (Fgroup-1) × (data size + 1);
if Fsection is 2, the operation address Paddr2+ (Fgroup-1) × (data size + 1).
The specific content of step S400 includes the following steps:
when new data is written in, analyzing the value of the last write failure mark;
if the last write failure flag is characterized as failure (Fw _ fail ═ 1), skipping the group in which the last write operation failed;
if the last write failure flag is characterized as successful (Fw _ fail ═ 0), then the write is normally judged.
If Fw _ fail is 1, the method specifically includes the following steps:
if the read group is the last group of the sectors (i.e. Fgroup is n, which indicates that the previous writing in the 1 st group of another sector fails), erasing the data of another sector, when new data is written, switching to the first group of the sectors which are just erased for writing, erasing the sectors which are full before the writing is completed, setting the last writing failure flag Fw _ fail to be 0, simultaneously, after the writing is completed, reading the written data and comparing the written data with the target data, and if the read data is inconsistent with the target data, setting the flash life alarm flag Ferror to be 1;
if the read group is the penultimate group of the sectors (i.e. Fgroup +1 equals n, which indicates that the last group of the sectors failed to be written in at the time of the last time), when new data is written, switching to the first group of another sector for writing, erasing the sectors which are fully written before the writing is finished, setting the last writing failure flag Fw _ fail to be 0, meanwhile, after the writing is finished, reading the written data and comparing the written data with target data, and if the written data is inconsistent, setting the flash life alarm flag Ferror to be 1;
if the read group is any one of the two cases (i.e., Fgroup +1< n), new data is written into the next group of the read group (i.e., Fgroup +1), and after the write is completed, the last write failure flag Fw _ fail is set to 0. Subsequently, reading and writing data and comparing the data with target data, and if the data are inconsistent, setting a flash life alarm mark Ferror to be 1 and a last writing failure mark Fw _ fail to be 0;
if Fw _ fail is equal to 0, the method specifically includes the following steps:
if the read group is the last group of the sectors (that is, Fgroup is n), during writing, switching to the first group of another sector for writing, erasing the sectors which are fully written before the writing is finished, simultaneously, after the writing is finished, reading the written data and comparing the written data with the target data, and if the written data is not consistent with the target data, setting a flash life alarm mark Ferror to be 1;
and if the read group is any group which is not the last group (namely Fgroup < n), writing the next group of the read group, simultaneously, after the writing is finished, comparing the read and written data with the target data, and if the read and written data are inconsistent with the target data, setting a flash service life alarm mark Ferror to be 1.
Because the flash service life alarm mark Ferror is generated when data is written in, the flash data storage method can perform early warning, and the phenomenon that the read data is unreliable and the normal operation of the read data is influenced is avoided.
In another embodiment, the method for saving flash data of the present invention further includes the following steps:
during a read operation, whether the last data read is the data which is successfully written or the data which is failed to be written last time can be determined according to the value of Fw _ fail and the operation addresses represented by Fsection and Fgroup.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
s100, configuring A, B two sectors, and dividing each sector into n groups.
S200, reading the effective mark values of the same group of data in the sectors A and B, and searching the position of the last data record according to the effective mark values of the same group of data in the two sectors.
And S300, judging an invalid sector according to the valid mark value of the specific group, and erasing the data of the invalid sector.
S400, new data is written by the next group of the position recorded by the last data.
The specific content of step S100 includes the following steps:
and after power-on operation, setting the initial state of each variable value. A, B two sectors are configured for storing specific data, the first address of record A, B sector is Paddr1, Paddr2, valid flag value Fvalue2 of each group in A, B sector is 0x7F, sector flag fsegction is 0, group number Fgroup is 0, flash life alarm flag Ferror is 0, last write failure flag Fw _ fail is 0. Where Fsection is an a sector when Fsection is 1, a B sector when Fsection is 2, and Fvalue2 is 0xFF indicating data invalid (set to valid by default, Fvalue2 is 0x 7F).
In another embodiment, step S100 further includes the following steps:
when the initial state of each variable value is configured, an address Paddr0 is configured to store an enable flag value Fvalue1 ═ 0xAA 55.
After the initial state of each variable value is configured, first, whether a storage method of flash data is enabled or not is detected, two bytes of data are read from an address Paddr0 and are marked as T:
if T is equal to Fvalue1, the storage method of the flash data is enabled, and A, B sectors do not need to be erased;
if T is not equal to Fvalue1, indicating that the storage method of the flash data is not enabled, A, B sectors need to be erased, and then Fvalue1 is written into the address of Paddr 0.
Each sector is divided into n groups, the n groups of data of the a sector are respectively a1-An, the n groups of data of the B sector are respectively B1-Bn, the size of the group is the size of the specific data plus one byte (for putting a valid flag value), and therefore, the group number Fgroup is (1, 2, 3 … … n). And if the sector space has not enough space after the sharing, abandoning the use of the space.
The specific contents of step S200 and step S300 include the following steps:
the position of the last data record is found according to the valid flag values of the same group of data in the two sectors, and the same group of data can be found for the data of any one of the sectors, for example, the position of the last data record can be found through the valid flag values of A1 and B1, can be found through An and Bn, and can be found through At and Bt (At is the data of the t-th group in the A sector, Bt is the data of the t-th group in the B sector, and t is any number in 1-n).
In the present embodiment, a1 and B1 are exemplified for detailed description:
the effective marker values in A1 and B1 are read, the effective marker value in A1 is recorded as X, and the effective marker value in B1 is recorded as Y (X, Y only represents the marker values in each group, and has no other specific meanings, and Z is the same): meanwhile, when the value of the valid flag value is 0xFF, the group of data is represented to be invalid, and when the value of the valid flag value is 0x7F, the group of data is represented to be valid;
if X, Y is equal to 0xFF, the data representing the a sector and the B sector are invalid, An or Bn is the default position of the last data record, the data of An or Bn is read when the data is read next time, An is the last group of data of the a sector, Bn is the last group of data of the B sector, and at this time, the initial variable is fsegction-1 or fsegction-2, and Fgroup-n;
if X, Y is equal to 0x7F, the valid flag value Z in An needs to be read again, if Z is equal to 0xFF, the position of the last data record is a1, and at the same time, the initial variable Fsection is set to 1, and all data in the B sector are erased; if Z is not equal to 0xFF, the position of the last data record is B1, meanwhile, the initial variable Fsection is set to be 2, and all data in the A sector are erased;
if X is equal to 0xFF and Y is equal to 0X7F, reading from the last group of data in the B sector, and finding out group data Bt with a first valid flag value of 0X7F, which is the position of the last data record, where Bt is represented as the data in the t-th group of the B sector, at this time, setting an initial variable Fsection to 2, and Fgroup to t;
if X is equal to 0X7F and Y is equal to 0xFF, the last group of data in the a sector is read forward, and the group data At with the first valid flag value of 0X7F is the position of the last data record, where At represents the data in the t-th group of the a sector, and At this time, the initial variable Fsection is set to 1 and Fgroup is set to t.
Considering the accuracy of the method affected by the special situation, therefore, the determination S500 is performed to determine whether there is a sector erasure failure in the last power failure, and step S500 specifically includes the following steps:
if the position of the last data recording is in the A sector (Fsection is 1), reading a valid flag value of Bn; when the effective mark value of Bn is not equal to 0xFF, the B sector is erased again;
if the position of the last data recording is in the B sector (Fsection is 2), reading a valid flag value of An; when the valid flag value of An is not equal to 0xFF, the A sector is re-erased.
In another embodiment, before new data is written, a power-down writing determination step S600 is performed, where the step S600 specifically includes the following steps:
reading the data of the next group according to the position of the last data record;
judging whether the read group data has invalid data or not;
if invalid data exists (namely, data in the invalid data is not equal to 0xFF), the data write failure caused by last power failure is represented, and a last write failure mark is recorded, and at this time, a last write failure mark Fw _ fail is set to 1.
In the above process, the data of the next group of operation addresses is read, and the operation address calculation formula is as follows:
if Fsection is 1, the operation address Paddr1+ (Fgroup-1) × (data size + 1);
if Fsection is 2, the operation address Paddr2+ (Fgroup-1) × (data size + 1).
The specific content of step S400 includes the following steps:
when new data is written in, analyzing the value of the last write failure mark;
if the last write failure flag is characterized as failure (Fw _ fail ═ 1), skipping the group in which the last write operation failed;
if the last write failure flag is characterized as successful (Fw _ fail ═ 0), then the write is normally judged.
If Fw _ fail is 1, the method specifically includes the following steps:
if the read group is the last group of the sectors (i.e. Fgroup is n, which indicates that the previous writing in the 1 st group of another sector fails), erasing the data of another sector, when new data is written, switching to the first group of the sectors which are just erased for writing, erasing the sectors which are full before the writing is completed, setting the last writing failure flag Fw _ fail to be 0, simultaneously, after the writing is completed, reading the written data and comparing the written data with the target data, and if the read data is inconsistent with the target data, setting the flash life alarm flag Ferror to be 1;
if the read group is the penultimate group of the sectors (i.e. Fgroup +1 equals n, which indicates that the last group of the sectors failed to be written in at the time of the last time), when new data is written, switching to the first group of another sector for writing, erasing the sectors which are fully written before the writing is finished, setting the last writing failure flag Fw _ fail to be 0, meanwhile, after the writing is finished, reading the written data and comparing the written data with target data, and if the written data is inconsistent, setting the flash life alarm flag Ferror to be 1;
if the read group is any one of the two cases (i.e., Fgroup +1< n), new data is written into the next group of the read group (i.e., Fgroup +1), and after the write is completed, the last write failure flag Fw _ fail is set to 0. Then reading the written data and comparing the data with the target data, and if the data is inconsistent with the target data, setting a flash life alarm mark Ferror to be 1;
if Fw _ fail is equal to 0, the method specifically includes the following steps:
if the read group is the last group of the sectors (that is, Fgroup is n), during writing, switching to the first group of another sector for writing, erasing the sectors which are fully written before the writing is finished, simultaneously, after the writing is finished, reading the written data and comparing the written data with the target data, and if the written data is not consistent with the target data, setting a flash life alarm mark Ferror to be 1;
and if the read group is any group which is not the last group (namely Fgroup < n), writing the next group of the read group, simultaneously, after the writing is finished, comparing the read and written data with the target data, and if the read and written data are inconsistent with the target data, setting a flash service life alarm mark Ferror to be 1.
Because the flash service life alarm mark Ferror is generated when data is written in, the flash data storage method can perform early warning, and the phenomenon that the read data is unreliable and the normal operation of the read data is influenced is avoided.
In another embodiment, the method for saving flash data of the present invention further includes the following steps:
during a read operation, whether the last data read is the data which is successfully written or the data which is failed to be written last time can be determined according to the value of Fw _ fail and the operation addresses represented by Fsection and Fgroup.
The invention adopts a flash memory space partition management method, in a memory, a storage space for storing specific data is divided into two sectors for management, each sector is divided into each group according to the size of the specific data, and the read-write of the flash is operated by taking the group as a unit; when writing operation is carried out, information in a sector is read firstly, the address written at this time is judged, and when data is written, a specific effective mark value is additionally arranged at the tail of the data to indicate whether the group of data is effective or not, so that power failure caused by half writing of the data is prevented, and the data is unreliable. And simultaneously, after the writing is finished, the written data is read immediately, the read data is compared with the written data, and if the read data is inconsistent with the written data, flash life exhaustion early warning is carried out.
An erase sector operation erases another sector only if the address where the data is written is the first group of the current sector. Therefore, the problem that the operation timeliness of the program is influenced because the sector where the data is located needs to be erased before the data is written every time is solved.
During reading operation, the information of each sector is read first, and the address read this time is judged. And the read data is subjected to identification judgment, so that the real validity of the data is ensured. If invalid, it is considered to take the last written data.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1. A method for storing flash data is characterized by comprising the following steps:
a, B configuring two sectors, dividing each sector into n groups;
reading the effective mark values of the same group of data in the sectors A and B, and searching the position of the last data record according to the effective mark values of the same group of data in the two sectors;
judging an invalid sector according to the valid mark value of the specific group, and erasing the data of the invalid sector;
new data is written by the next group of locations of the last data record.
2. The method for saving flash data according to claim 1, further comprising the steps of:
reading the data of the next group according to the position of the last data record;
judging whether the read group data exists or not;
if the data exists, representing that the data writing fails caused by the last power failure, and recording a last writing failure mark.
3. The method for saving flash data according to claim 1 or 2, wherein the step of finding the position of the last data record according to the valid flag values of the same group of data in the two sectors specifically comprises the following steps:
reading valid flag values of a first set of data of the A sector and the B sector;
and searching the position of the last data record according to the valid mark values of the two first groups of data.
4. The method for saving flash data according to claim 3, wherein the step of finding the position of the last data record according to the valid flag values of the two first groups of data specifically comprises the following steps:
the first group of data of the A sector is marked as A1, and the first group of data of the B sector is marked as B1;
reading the valid flag values in A1 and B1, wherein the valid flag value of A1 is marked as X, the valid flag value of B1 is marked as Y, and meanwhile, when the value of the valid flag value is 0xFF, the group of data is represented to be invalid, and when the value of the valid flag value is 0X7F, the group of data is represented to be valid;
if X, Y is equal to 0xFF, the data representing the A sector and the B sector are invalid, An or Bn is the position of the last data record by default, the data of An or Bn is read when the data is read next time, An is the last group of data of the A sector, and Bn is the last group of data of the B sector;
if X, Y is equal to 0x7F, then the valid flag value Z in An must be read again, and if Z is equal to 0xFF, then the last data record is located at A1; if Z is not equal to 0xFF, the position of the last data record is B1;
if X is equal to 0xFF and Y is equal to 0X7F, reading the last group of data of the B sector forwards, and searching group data Bt with a first effective mark value of 0X7F as the position of the last data record, wherein Bt is represented as the data of the t-th group of the B sector;
if X is equal to 0X7F and Y is equal to 0xFF, reading from the last group of data of the A sector and searching for the group data At with the first valid flag value of 0X7F as the position of the last data record, where At is the t-th group of data of the A sector.
5. The method for saving flash data according to claim 4, wherein the determining invalid sectors in combination with the valid flag values of a specific group and erasing the data of the invalid sectors comprises the following steps:
when X, Y is equal to 0x7F, the valid flag value Z in An needs to be read again, if Z is equal to 0xFF, all data in B sector is erased; if Z is not equal to 0xFF, all data in the A sector is erased.
6. The method for saving flash data according to claim 4 or 5, further comprising the steps of:
judging whether the previous power failure has sector erasing failure;
if the position of the last data record is in the A sector, reading the effective mark value of Bn; when the effective mark value of Bn is not equal to 0xFF, the B sector is erased again;
if the position of the last data recording is in the B sector, reading the effective mark value of An; when the valid flag value of An is not equal to 0xFF, the A sector is re-erased.
7. The method for saving flash data according to claim 2, further comprising the steps of:
when new data is written in, analyzing the value of the last write failure mark;
if the last write failure flag is characterized as failure, skipping the group of the last write operation failure;
and if the last write failure mark is characterized as successful, normally judging to write.
8. The method for saving flash data according to claim 7, wherein if the last write failure flag is characterized as failure, the group in which the last write operation failed needs to be skipped, specifically comprising the following steps:
if the read group is the last group of the sectors, erasing the data of the other sector, switching to the first group of the sectors which are just erased for writing during writing, and erasing the sectors which are fully written before the writing is finished;
if the read group is the penultimate group of the sector, switching to the first group of the other sector for writing during writing, and erasing the sector which is fully written before the writing is finished;
if the read group is any group except the two cases, writing the read group into the next group of the read group;
in addition to the above, if the last write failure flag is characterized as successful, then normally determining the write, specifically includes the following steps:
if the read group is the last group of the sectors, switching to the first group of another sector for writing during writing, and erasing the sectors which are fully written before the writing after the writing;
if the read group is any group that is not the last group, the next group of the read group is written.
9. A system for storing flash data, comprising:
a configuration module, configured A, B two sectors, each sector being divided into n groups;
the searching module is used for reading the effective mark values of the same group of data in the A and B sectors and searching the position of the last data record according to the effective mark values of the same group of data in the two sectors;
the erasing module is used for judging invalid sectors according to the valid mark values of the specific group and erasing the data of the invalid sectors; and
and the writing module is used for writing new data into the next group of the position recorded by the last data.
10. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202011268987.7A 2020-11-13 2020-11-13 flash data storage method, system, computer equipment and storage medium Active CN112347002B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011268987.7A CN112347002B (en) 2020-11-13 2020-11-13 flash data storage method, system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011268987.7A CN112347002B (en) 2020-11-13 2020-11-13 flash data storage method, system, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112347002A true CN112347002A (en) 2021-02-09
CN112347002B CN112347002B (en) 2023-07-28

Family

ID=74363648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011268987.7A Active CN112347002B (en) 2020-11-13 2020-11-13 flash data storage method, system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112347002B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220239A (en) * 2021-05-24 2021-08-06 厦门四信通信科技有限公司 Erasing and writing method, device and equipment for flash storage and readable storage medium
CN113656081A (en) * 2021-08-05 2021-11-16 深圳市同泰怡信息技术有限公司 Method and device for synchronizing configuration information of baseboard management controller and computer equipment
CN118069067A (en) * 2024-04-16 2024-05-24 泉州华中科技大学智能制造研究院 Nor Flash data storage method and device based on master-slave-free TCP communication

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5524230A (en) * 1991-07-12 1996-06-04 International Business Machines Incorporated External information storage system with a semiconductor memory
CN1937077A (en) * 2005-09-22 2007-03-28 康佳集团股份有限公司 Multi-state management method for data in flash-memory medium
US20070091679A1 (en) * 2005-10-20 2007-04-26 Sony Corporation Storage device, computer system, and data writing method
JP2010061705A (en) * 2008-09-01 2010-03-18 Toshiba Storage Device Corp Method for controlling storage device, and storage device
CN102890656A (en) * 2012-09-25 2013-01-23 Tcl光电科技(惠州)有限公司 Method for improving service life of FLASH
CN103229245A (en) * 2010-07-28 2013-07-31 富士通半导体欧洲有限公司 Electronic apparatuses
US20140244895A1 (en) * 2013-02-25 2014-08-28 Freescale Semiconductor, Inc. Robust Sector ID Scheme for Tracking Dead Sectors to Automate Search and Copydown
CN105988722A (en) * 2015-01-27 2016-10-05 纬创资通股份有限公司 Data storage method and embedded system
CN109754839A (en) * 2017-11-07 2019-05-14 恩智浦美国有限公司 Dynamic compression in electrically erasable programmable read-only memory analogue system
CN110209349A (en) * 2019-04-25 2019-09-06 科华恒盛股份有限公司 The method and terminal device of data processing

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5524230A (en) * 1991-07-12 1996-06-04 International Business Machines Incorporated External information storage system with a semiconductor memory
CN1937077A (en) * 2005-09-22 2007-03-28 康佳集团股份有限公司 Multi-state management method for data in flash-memory medium
US20070091679A1 (en) * 2005-10-20 2007-04-26 Sony Corporation Storage device, computer system, and data writing method
JP2010061705A (en) * 2008-09-01 2010-03-18 Toshiba Storage Device Corp Method for controlling storage device, and storage device
CN103229245A (en) * 2010-07-28 2013-07-31 富士通半导体欧洲有限公司 Electronic apparatuses
CN102890656A (en) * 2012-09-25 2013-01-23 Tcl光电科技(惠州)有限公司 Method for improving service life of FLASH
US20140244895A1 (en) * 2013-02-25 2014-08-28 Freescale Semiconductor, Inc. Robust Sector ID Scheme for Tracking Dead Sectors to Automate Search and Copydown
CN105988722A (en) * 2015-01-27 2016-10-05 纬创资通股份有限公司 Data storage method and embedded system
CN109754839A (en) * 2017-11-07 2019-05-14 恩智浦美国有限公司 Dynamic compression in electrically erasable programmable read-only memory analogue system
CN110209349A (en) * 2019-04-25 2019-09-06 科华恒盛股份有限公司 The method and terminal device of data processing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
宁飞: "大容量存储中NAND Flash坏块的管理方法", 《电子测试》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220239A (en) * 2021-05-24 2021-08-06 厦门四信通信科技有限公司 Erasing and writing method, device and equipment for flash storage and readable storage medium
CN113656081A (en) * 2021-08-05 2021-11-16 深圳市同泰怡信息技术有限公司 Method and device for synchronizing configuration information of baseboard management controller and computer equipment
CN113656081B (en) * 2021-08-05 2023-08-22 深圳市同泰怡信息技术有限公司 Method, device and computer equipment for synchronizing configuration information of baseboard management controller
CN118069067A (en) * 2024-04-16 2024-05-24 泉州华中科技大学智能制造研究院 Nor Flash data storage method and device based on master-slave-free TCP communication

Also Published As

Publication number Publication date
CN112347002B (en) 2023-07-28

Similar Documents

Publication Publication Date Title
US10255192B2 (en) Data storage device and data maintenance method thereof
CN112347002A (en) flash data storage method and system, computer equipment and storage medium
US8006030B2 (en) Memory controller for identifying the last valid page/segment in a physical block of a flash memory
US7246268B2 (en) Method and apparatus for dynamic degradation detection
US9075740B2 (en) Memory system
US7171536B2 (en) Unusable block management within a non-volatile memory system
US8732519B2 (en) Method for using bad blocks of flash memory
JP2005258851A (en) Memory card
US6839798B1 (en) Flash memory capable of storing frequently rewritten data
CN114089915B (en) File additional writing operation method and device based on FLASH memory
CN111324549B (en) Memory and control method and device thereof
KR101826778B1 (en) EEPROM Emulation Method Considering implementation of Flash Life Cycle and Performance Improvement
US20180052635A1 (en) Electronic control apparatus and information storage method for the same
CN113918485B (en) Method, device, equipment and storage medium for preventing flash memory data from being lost
CN112579004A (en) Method, system, computer equipment and storage medium for quickly deleting flash data
CN111090542A (en) Abnormal block identification method and device based on abnormal power failure and computer equipment
CN113434086A (en) Data storage method and device, nonvolatile memory device and memory
CN110795275A (en) Abnormal block identification method and device based on abnormal power failure process
US20220091778A1 (en) Semiconductor storage device and writing method of operation control program of semiconductor storage device
CN111708487A (en) Data storage method and device and computer storage medium
US20130346680A1 (en) Emulated electrically erasable memory having an address ram for data stored in flash memory
JP2015049722A (en) Microcomputer and block control method of non-volatile memory
JP2513421B2 (en) Storage device
CN116225326A (en) Data storage method, module, unmanned aerial vehicle control device and readable storage medium
CN114003438A (en) Mapping table recovery method and device for solid state disk, computer 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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230324

Address after: Room 418, Building 1, No. 66, Dongxin Avenue, Puyan Street, Binjiang District, Hangzhou City, Zhejiang Province, 310000

Applicant after: Hangzhou Xinjushi Artificial Intelligence Technology Co.,Ltd.

Address before: 310051 rooms 1505 and 1506, 5th floor, building 1, Edie building, 66 Dongxin Avenue, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: HANGZHOU AIXIN INTELLIGENT TECHNOLOGY CO.,LTD.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240613

Address after: Room 501, 85 Xiaguang Dongli, Haicang District, Xiamen City, Fujian Province, 361000

Patentee after: Xiamen reliable intellectual property service Co.,Ltd.

Country or region after: China

Address before: Room 418, Building 1, No. 66, Dongxin Avenue, Puyan Street, Binjiang District, Hangzhou City, Zhejiang Province, 310000

Patentee before: Hangzhou Xinjushi Artificial Intelligence Technology Co.,Ltd.

Country or region before: China