CN106909512B - Storage device using method and system - Google Patents
Storage device using method and system Download PDFInfo
- Publication number
- CN106909512B CN106909512B CN201510979983.2A CN201510979983A CN106909512B CN 106909512 B CN106909512 B CN 106909512B CN 201510979983 A CN201510979983 A CN 201510979983A CN 106909512 B CN106909512 B CN 106909512B
- Authority
- CN
- China
- Prior art keywords
- address index
- page
- erasing
- reading
- bit
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
- G06F12/0246—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1032—Reliability improvement, data loss prevention, degraded operation etc
- G06F2212/1036—Life time enhancement
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a method and a system for using a storage device. The method comprises the following steps: acquiring an address index and an erasing frequency counting bit after power-on initialization; increasing the number counting bit of the erasing times by 1; judging whether the new erasing times counting bit is smaller than an erasing times threshold value or not; if so, updating the data and the new erasing count bit into the page corresponding to the address index and the page corresponding to the address index plus 1; if not, assigning the erasing times counting bit to be 1, judging whether the address index is smaller than the total page number minus 2, if so, adding 2 to the address index to serve as a new address index, and if not, assigning 2 to the address index to serve as a new address index; and updating data and the count bits of the erasing times into a page corresponding to the new address index and a page corresponding to the new address index plus 1, and updating the new address index into a zeroth page and a first page. The service life of the storage device is prolonged.
Description
Technical Field
The present invention relates to the field of storage device management, and in particular, to a method and a system for using a storage device.
Background
The storage device may include a FLASH, SD (Secure Digital Memory Card) Card, or the like. Taking FLASH as an example, FLASH is a kind of Memory, but has the advantages of both RAM (Random-Access Memory) and ROM (read-only Memory), and is a Memory which can be electrically erased in a system and has no information loss after power failure. Conventional FLASH is in use, data is stored in the data FLASH area. When data are written into the data FLASH region, the data FLASH region needs to be erased firstly, and then the data are written into the data FLASH region. However, the data FLASH region has a certain erasing frequency, and when the erasing frequency of a certain block region in the data FLASH region exceeds a certain erasing frequency, the block region can be damaged and cannot be used again, a chip needs to be replaced, and the service life of the storage device is shortened.
Disclosure of Invention
Therefore, it is necessary to provide a method for using a storage device, which can prolong the service life of the storage device, in order to solve the problem that the service life of the storage device is shortened because a certain data area of the conventional storage device is frequently erased more than times.
In addition, it is necessary to provide a system for using a storage device, which can prolong the service life of the storage device.
A method of using a storage device, comprising the steps of:
acquiring an address index and an erasing frequency counting bit after power-on initialization;
when data in a page of the storage device is updated, increasing 1 to the count bit of the erasing times to obtain a new count bit of the erasing times;
judging whether the new erasing times counting bit is smaller than an erasing times threshold value or not;
if the new count bit of the erasing times is smaller than the threshold value of the erasing times, updating the data and the new count bit of the erasing times into the page corresponding to the address index and the page corresponding to the address index plus 1;
if the new erasing count bit is not less than the erasing threshold, assigning the erasing count bit to be 1, erasing the data in the page corresponding to the address index and the data in the page corresponding to the address index plus 1, judging whether the address index is less than the total page number minus 2, if so, adding 2 to the address index to serve as a new address index, and if not, assigning 2 to the address index to serve as a new address index; and updating data and the count bits of the erasing times into a page corresponding to the new address index and a page corresponding to the new address index plus 1, and updating the new address index into a zeroth page and a first page.
A system for using a storage device, comprising:
the acquisition module is used for acquiring the address index and the erasing and writing frequency counting bit after power-on initialization;
the self-adding module is used for adding 1 to the erasing count bit to obtain a new erasing count bit when the data in the page of the storage device is updated;
the judging module is used for judging whether the new erasing frequency counting bit is smaller than an erasing frequency threshold value or not;
the first updating module is used for updating the data and the new count bit of the erasing times into the page corresponding to the address index and the page corresponding to the address index plus 1 if the new count bit of the erasing times is smaller than the threshold value of the erasing times;
and the second updating module is used for assigning the erasing count bit to be 1 if the new erasing count bit is not less than the erasing threshold, erasing the data in the page corresponding to the address index and the data in the page corresponding to the address index plus 1, judging whether the address index is less than the total page number minus 2, if so, adding 2 to the address index to serve as a new address index, if not, assigning 2 to the address index to serve as a new address index, updating the data and the erasing count bit to the page corresponding to the new address index and the page corresponding to the new address index plus 1, and updating the new address index to the zeroth page and the first page.
The using method and the system of the storage device acquire the address index and the erasing and writing times counting bit, when the data is updated, the erasing and writing times counting bit is increased by 1, whether the erasing and writing times counting bit is smaller than an erasing and writing times threshold value is judged, if the erasing and writing times counting bit is smaller than the erasing and writing times threshold value, the data and the new erasing and writing times counting bit are updated to the page corresponding to the address index, if the erasing and writing times counting bit is not smaller than the erasing and writing times threshold value, the erasing and writing times counting bit is assigned to 1, then whether the address index is smaller than the total page number and is reduced by 2 is judged, if the address index is increased by 2, the data and the erasing and writing times counting bit are updated to the page corresponding to the new address index, if the erasing and writing times reach the erasing and writing times threshold value, the data and the erasing and writing times counting bit are updated to other pages, therefore, different data pages are repeatedly used, the damage caused by the fact that the erasing times of the page reach the maximum erasing times due to the fact that the same page is erased every time is avoided, and the service life of the storage device is prolonged.
Drawings
FIG. 1 is a flow diagram of a method for using a storage device in one embodiment;
FIG. 2 is a diagram illustrating the starting addresses of pages of a memory device, according to one embodiment;
FIG. 3 is a flowchart illustrating the detailed steps of the power-up initialization in one embodiment;
FIG. 4 is a block diagram showing a configuration of a system for using a storage device according to an embodiment;
FIG. 5 is a block diagram showing a configuration of a system for using a storage device in another embodiment;
fig. 6 is a block diagram showing a configuration of a system for using a storage device in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention 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 invention and are not intended to limit the invention.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the present invention.
FIG. 1 is a flow diagram of a method for using a storage device in one embodiment. As shown in fig. 1, a method for using a storage device includes the following steps:
and step 102, acquiring an address index and an erasing frequency counting bit after power-on initialization.
In this embodiment, step 102 includes: and electrifying to initialize and read the zeroth page, acquiring the address index from the zeroth page, acquiring the page corresponding to the address index, and reading the erase count bit from the page.
First, a data area of a storage device is paged to obtain a plurality of pages. For example, the storage device is FLASH. The space size of the data FLASH area is 4KB, the unit of erase is 512 bytes, and the data FLASH area can be divided into 8 pages (4 × 1024/512 ═ 8) with 512 bytes as one page. The start address of the data FLASH is 0x01_ F000, and the end address is 0x01_ FFFF. As shown in fig. 2, the starting address of the Zero-th page Zero page is 0x01_ F000, the starting address of the First page is 0x01_ F200, the starting address of the Second page is 0x01_ F400, the starting address of the Third page is 0x01_ F600, the starting address of the Fourth page is 0x01_ F800, the starting address of the Fifth page is 0x01_ FA00, the starting address of the sixth page Six page is 0x01_ FC00, and the starting address of the Seventh page is 0x01_ FE 00.
The address index Addr _ index is used to find the page of the current data store, the address index being stored in the zeroth page (i.e., in Zero-page). In order to prevent corruption and loss of data, the data in the zeroth page is backed up into the first page.
The data storage is also backed up, the data of the data page where the current data is located is backed up to the next page of the data page where the current data is located, for example, the data is stored in the 2 nd page, and the backup data is stored in the 3 rd page. The Count bit of the erasing and writing times is stored in each page and is used for marking the erasing and writing times of the page, and the Count bit Count of the erasing and writing times is updated along with the updating of the data each time.
An array can be used for storing the initial address of each page, so that subsequent calling is facilitated. For example, Uint32_ t PAGE _ ADDR [8] {0x01_ F000, 0x01_ F200, 0x01_ F400, 0x01_ F600, 0x01_ F800, 0x01_ FA00, 0x01_ FC00, 0x01_ FE00 }.
And step 104, when the data in the page of the storage device is updated, increasing 1 to the count bit of the erasing times to obtain a new count bit of the erasing times.
Specifically, each time data in a page is updated, the erase count bit of the page is incremented by 1 time to obtain a new erase count bit.
Specifically, the threshold of the number of times of erasing and writing is determined as required, and may be 512 times or 300 times, for example.
And when the new erasing count bit is judged to be smaller than the erasing count threshold, updating the data and the new erasing count bit into the page corresponding to the address index and the page corresponding to the address index plus 1.
The page corresponding to the address index plus 1 is a backup page of the data in the page corresponding to the address index.
And when the new erasing times counting bit is judged to be not less than the erasing times threshold, erasing the data in the page corresponding to the address index and the data in the page corresponding to the address index plus 1.
And step 108, updating the data and the new count bits of the erasing times to the page corresponding to the address index and the page corresponding to the address index plus 1, and ending.
Specifically, the data and the new erase Count are updated to PAGE _ ADDR [ ADDR _ index ] corresponding to the address index and PAGE _ ADDR [ ADDR _ index +1] corresponding to the address index plus 1.
In step 110, the erase count bit is assigned to 1, the data in the page corresponding to the address index and the data in the page corresponding to the address index plus 1 are erased, and step 112 is executed.
Specifically, data in the PAGE _ ADDR [ ADDR _ index ] corresponding to the address index and data in the PAGE _ ADDR [ ADDR _ index +1] corresponding to the address index plus 1 are erased.
In step 112, it is determined whether the address index is less than the total page count minus 2, if yes, step 114 is performed, and if no, step 116 is performed.
Specifically, the total number of pages refers to the total number of pages divided after the storage device performs the paging process. When the page corresponding to the address index is the total page number minus 2 pages, the erase count bit of each page reaches the erase count threshold, and the page needs to be re-cycled to the first page (i.e. page 2) of the data page, i.e. the page corresponding to the address index 2, for data update.
Step 116 assigns the address index to 2 as a new address index, and then step 118 is performed.
The address indices correspond to pages one to one. If the address index is 2, the corresponding page is the second page.
Specifically, the data and the erase Count number Count are updated to the PAGE _ ADDR [ ADDR _ index ] address and the PAGE _ ADDR [ ADDR _ index +1] address.
Specifically, the new address index is updated to PAGE zero, Page PAGE _ ADDR [0], and also to PAGE first Page PAGE _ ADDR [1 ].
The using method of the storage device comprises the steps of obtaining an address index and an erasing frequency counting bit, increasing the erasing frequency counting bit by 1 when updating data, assigning the erasing frequency counting bit to be 1 when judging whether the erasing frequency counting bit is smaller than an erasing frequency threshold value or not and updating the data and a new erasing frequency counting bit into a page corresponding to the address index if the erasing frequency counting bit is smaller than the erasing frequency threshold value, then judging whether the address index is smaller than the total page number minus 2, if so, adding 2 to the address index, updating the data and the erasing frequency counting bit into the page corresponding to the new address index, if not, assigning 2 to the address index, updating the data and the erasing frequency counting bit into the page corresponding to the new address index, and updating the data into other pages when the erasing frequency reaches the erasing frequency threshold value, therefore, different data pages are repeatedly used, the damage caused by the fact that the erasing times of the page reach the maximum erasing times due to the fact that the same page is erased every time is avoided, and the service life of the storage device is prolonged.
If 6 pages of data pages are assumed to be divided into an original data page and a backup data page, the maximum erasing frequency of each page of data page is 10 ten thousand, if only the same data page is erased every time, the data page is damaged after 10 ten thousand erasing, and a chip is replaced or the data page which is not damaged is erased by recoding. By adopting the using method of the storage device, the storage device is used in a round-robin manner, and after the erasing and writing times threshold (for example 512 times) of each data page is reached, the data page is moved to another data page, so that different data pages are repeatedly used, each data page can be erased and written 10 ten thousand times, and the calculated erasing and writing times are three times of the original erasing and writing times and are 30 ten thousand times.
In one embodiment, the method for using the storage device further includes: the data in the zeroth page is backed up in the first page.
The step of obtaining the address index and the erasing count after the power-on initialization comprises the following steps: and electrifying to initialize and read the zeroth page or the first page, acquiring the address index from the zeroth page or the first page, acquiring the page corresponding to the address index, and reading the erase count bit from the page.
Specifically, the address index is obtained from the zeroth page or the first page, because the data in the zeroth page and the first page are the same.
Fig. 3 is a flowchart illustrating the steps of reading the zeroth page or the first page during power-up initialization, obtaining an address index from the zeroth page or the first page, obtaining a page corresponding to the address index, and reading an erase count bit from the page according to an embodiment. As shown in fig. 3, the step of reading the erase count bit from the page includes:
Specifically, after power-on initialization, the address of the zeroth PAGE _ ADDR [0] is read to obtain the address index Addr _ index.
Specifically, when reading the address index from the zeroth PAGE fails, the address index ADDR _ index is read from the first PAGE _ ADDR [1] address.
In step 306, the address index is read from the first page, and then step 308 is performed.
In step 310, the data of the first page is updated with the data of the zeroth page, and then step 312 is performed.
Specifically, the address index is successfully read from the first page, which indicates that the data in the first page is not damaged, and the data of the first page may be updated with the data of the zeroth page.
In step 312, the erase count bit in the page corresponding to the address index is read, and then step 314 is executed.
Specifically, the erase Count bit Count in the PAGE _ ADDR [ ADDR _ index ] corresponding to the address index is read.
In step 314, it is determined whether reading the erase count bit is successful, if yes, the process is ended, otherwise, step 316 is executed.
Specifically, the erase Count bit Count in the PAGE _ ADDR [ ADDR _ index +1] corresponding to the read address index plus 1 is read.
In step 318, it is determined whether reading the erase count bit is successful, if yes, step 320 is executed, otherwise, the process is ended.
According to the above power-on initialization address index acquisition method, the address index is acquired in the first page if the address index acquisition in the zeroth page fails, and the data of the zeroth page is backed up through the first page, so that the address index acquisition probability can be improved.
Fig. 4 is a block diagram showing a configuration of a system for using a storage device in one embodiment. As shown in fig. 4, a system for using a storage device includes an obtaining module 410, an adding module 420, a determining module 430, a first updating module 440, and a second updating module 450. Wherein:
the obtaining module 410 is configured to obtain the address index and the erase/write count bits after power-on initialization.
In this embodiment, the obtaining module 410 is further configured to power on to initialize and read a zeroth page, obtain an address index from the zeroth page, obtain a page corresponding to the address index, and read an erase count bit from the page.
The increment module 420 is configured to increment the erase count bit by 1 to obtain a new erase count bit when updating data in a page of the storage device.
The determining module 430 is used to determine whether the new erase count bit is smaller than the erase count threshold.
The first updating module 440 is configured to update the data and the new count bit of the erasure count to the page corresponding to the address index and the page corresponding to the address index plus 1 if the new count bit of the erasure count is smaller than the threshold of the erasure count.
The second updating module 450 is configured to assign the erase count bit to 1 if the new erase count bit is not less than the erase threshold, erase the data in the page corresponding to the address index and the data in the page corresponding to the address index plus 1, determine whether the address index is less than the total page number minus 2, if so, add 2 to the address index to serve as a new address index, otherwise, assign 2 to the address index to serve as a new address index, update the data and the erase count bit to the page corresponding to the new address index and the page corresponding to the new address index plus 1, and update the new address index to the zeroth page and the first page.
The using system of the storage device obtains the address index and the erasing and writing times counting bit, when updating data, the erasing and writing times counting bit is increased by 1, whether the erasing and writing times counting bit is smaller than an erasing and writing times threshold value is judged, if the erasing and writing times counting bit is smaller than the erasing and writing times threshold value, the data and the new erasing and writing times counting bit are updated to a page corresponding to the address index, if the erasing and writing times counting bit is not smaller than the erasing and writing times threshold value, the erasing and writing times counting bit is assigned to 1, then whether the address index is smaller than the total page number minus 2 is judged, if yes, the address index is added with 2, the data and the erasing and writing times counting bit are updated to the page corresponding to the new address index, if not, the address index is assigned to 2, the data and the erasing and writing times counting bit are updated to the page corresponding to the new address index, and when the erasing and writing times reach the erasing and writing times threshold value, the data are updated to other pages, therefore, different data pages are repeatedly used, the damage caused by the fact that the erasing times of the page reach the maximum erasing times due to the fact that the same page is erased every time is avoided, and the service life of the storage device is prolonged.
Fig. 5 is a block diagram showing a configuration of a system for using a storage device in another embodiment. As shown in fig. 5, a system for using a storage device includes a backup module 460 in addition to an acquisition module 410, an autonomic module 420, a judgment module 430, a first update module 440, and a second update module 450. Wherein:
the backup module 460 is used to backup the data in the zeroth page in the first page.
The obtaining module 410 is further configured to power on to initialize and read a zeroth page or a first page, obtain an address index from the zeroth page or the first page, obtain a page corresponding to the address index, and read an erase count bit from the page.
In this embodiment, the obtaining module 410 is further configured to power on, initialize, read the zeroth page, read the address index from the zeroth page, and determine whether reading the address index is successful;
if the address index is successfully read from the zeroth page, reading the erase count bit in the page corresponding to the address index, judging whether the read of the erase count bit is successful, if the read of the erase count bit is successful, ending the process, if the read of the erase count bit is failed, reading the erase count bit in the page corresponding to the address index plus 1, judging whether the read of the erase count bit is successful, if the read of the erase count bit is successful, updating the data in the page corresponding to the address index plus 1 with the data in the page corresponding to the address index, and if the read of the erase count bit is failed, ending the process;
if the reading of the address index from the zeroth page fails, reading the address index from the first page, judging whether the reading of the address index is successful, if so, updating the data of the zeroth page by the data of the first page, reading an erasing frequency counting bit in the page corresponding to the address index, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, ending, if the reading of the erasing frequency counting bit is failed, reading the erasing frequency counting bit in the page corresponding to the address index plus 1, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, updating the data in the page corresponding to the address index by the data in the page corresponding to the address index plus 1, and if the reading of the erasing frequency counting bit is failed, ending.
Fig. 6 is a block diagram showing a configuration of a system for using a storage device in another embodiment. As shown in fig. 5, a system for using a storage device includes a paging module 470 in addition to an obtaining module 410, an adding module 420, a determining module 430, a first updating module 440, and a second updating module 450. Wherein:
the paging module 470 is used for paging the data area of the memory device.
In other embodiments, the system for using the storage device may include any possible combination of the obtaining module 410, the adding module 420, the determining module 430, the first updating module 440, the second updating module 450, the backup module 460, and the paging module 470.
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 a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A method for using a storage device, comprising the steps of:
electrifying to initialize and read a zeroth page, reading an address index from the zeroth page, and judging whether the address index is successfully read;
if the address index is successfully read from the zeroth page, reading an erasing frequency counting bit in a page corresponding to the address index, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, ending, if the reading of the erasing frequency counting bit is failed, reading the erasing frequency counting bit in the page corresponding to the address index plus 1, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, updating data in the page corresponding to the address index plus 1 by using the data in the page corresponding to the address index, and if the reading of the erasing frequency counting bit is failed, ending;
if the reading of the address index from the zeroth page fails, reading the address index from the first page, judging whether the reading of the address index is successful, if so, updating the data of the first page to the data of the zeroth page, reading an erasing frequency counting bit in the page corresponding to the address index, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, ending, if the reading of the erasing frequency counting bit is failed, reading an erasing frequency counting bit in the page corresponding to the address index plus 1, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, updating the data in the page corresponding to the address index plus 1, and if the reading of the erasing frequency counting bit is failed, ending;
when data in a page of the storage device is updated, increasing 1 to the count bit of the erasing times to obtain a new count bit of the erasing times;
judging whether the new erasing times counting bit is smaller than an erasing times threshold value or not;
if the new count bit of the erasing times is smaller than the threshold value of the erasing times, updating the data and the new count bit of the erasing times into the page corresponding to the address index and the page corresponding to the address index plus 1;
if the new erasing count bit is not less than the erasing threshold, assigning the erasing count bit to be 1, erasing the data in the page corresponding to the address index and the data in the page corresponding to the address index plus 1, judging whether the address index is less than the total page number minus 2, if so, adding 2 to the address index to serve as a new address index, and if not, assigning 2 to the address index to serve as a new address index; and updating data and the count bits of the erasing times into a page corresponding to the new address index and a page corresponding to the new address index plus 1, and updating the new address index into a zeroth page and a first page.
2. The method of claim 1, wherein the total number of pages is a total number of pages divided after the paging processing of the storage device.
3. The method of using a storage device according to claim 1, wherein the method further comprises: and backing up the data in the zeroth page in the first page.
4. The method of using a storage device according to claim 1, wherein the method further comprises:
and paging the data area of the storage device.
5. A system for using a storage device, comprising:
the acquisition module is used for electrifying, initializing and reading a zeroth page, reading an address index from the zeroth page and judging whether the address index is successfully read or not;
if the address index is successfully read from the zeroth page, reading an erasing frequency counting bit in a page corresponding to the address index, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, ending, if the reading of the erasing frequency counting bit is failed, reading the erasing frequency counting bit in the page corresponding to the address index plus 1, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, updating data in the page corresponding to the address index plus 1 by using the data in the page corresponding to the address index, and if the reading of the erasing frequency counting bit is failed, ending;
if the reading of the address index from the zeroth page fails, reading the address index from the first page, judging whether the reading of the address index is successful, if so, updating the data of the first page to the data of the zeroth page, reading an erasing frequency counting bit in the page corresponding to the address index, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, ending, if the reading of the erasing frequency counting bit is failed, reading an erasing frequency counting bit in the page corresponding to the address index plus 1, judging whether the reading of the erasing frequency counting bit is successful, if the reading of the erasing frequency counting bit is successful, updating the data in the page corresponding to the address index plus 1, and if the reading of the erasing frequency counting bit is failed, ending;
the self-adding module is used for adding 1 to the erasing count bit to obtain a new erasing count bit when the data in the page of the storage device is updated;
the judging module is used for judging whether the new erasing frequency counting bit is smaller than an erasing frequency threshold value or not;
the first updating module is used for updating the data and the new count bit of the erasing times into the page corresponding to the address index and the page corresponding to the address index plus 1 if the new count bit of the erasing times is smaller than the threshold value of the erasing times;
and the second updating module is used for assigning the erasing count bit to be 1 if the new erasing count bit is not less than the erasing threshold, erasing the data in the page corresponding to the address index and the data in the page corresponding to the address index plus 1, judging whether the address index is less than the total page number minus 2, if so, adding 2 to the address index to serve as a new address index, if not, assigning 2 to the address index to serve as a new address index, updating the data and the erasing count bit to the page corresponding to the new address index and the page corresponding to the new address index plus 1, and updating the new address index to the zeroth page and the first page.
6. The system for using a storage device according to claim 5, wherein the total number of pages is a total number of pages divided after the storage device is subjected to the paging processing.
7. The system for using a storage device according to claim 5, further comprising:
and the backup module is used for backing up the data in the zeroth page in the first page.
8. The system for using a storage device according to claim 5, further comprising:
and the paging module is used for paging the data area of the storage device.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 4.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510979983.2A CN106909512B (en) | 2015-12-23 | 2015-12-23 | Storage device using method and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510979983.2A CN106909512B (en) | 2015-12-23 | 2015-12-23 | Storage device using method and system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN106909512A CN106909512A (en) | 2017-06-30 |
| CN106909512B true CN106909512B (en) | 2021-08-13 |
Family
ID=59200537
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510979983.2A Active CN106909512B (en) | 2015-12-23 | 2015-12-23 | Storage device using method and system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106909512B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107863127A (en) * | 2017-10-31 | 2018-03-30 | 杭州迪普科技股份有限公司 | A kind of storage device memory cell selecting method and device |
| CN108334279B (en) * | 2017-12-26 | 2021-04-06 | 金卡智能集团股份有限公司 | Data reading and writing method based on load balancing mode |
| CN112233715B (en) * | 2019-07-15 | 2024-06-18 | 美光科技公司 | Maintenance operations for memory systems |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI455131B (en) * | 2010-04-16 | 2014-10-01 | Silicon Motion Inc | Data storage device and data writing method for a memory |
| CN102135942B (en) * | 2010-12-31 | 2013-04-24 | 北京握奇数据系统有限公司 | Method for realizing wear-leveling in storage equipment as well as the storage equipment |
| US9009428B2 (en) * | 2011-07-08 | 2015-04-14 | Hewlett-Packard Development Company, L.P. | Data store page recovery |
| CN102394114B (en) * | 2011-11-14 | 2014-01-01 | 清华大学 | BCH code error correction method capable of adaptive error correction |
| KR101365704B1 (en) * | 2012-03-30 | 2014-02-24 | 유비벨록스(주) | Method for managing flash based memory |
| US9384125B2 (en) * | 2012-06-18 | 2016-07-05 | Silicon Motion Inc. | Method for accessing flash memory having pages used for data backup and associated memory device |
| CN103064792A (en) * | 2012-12-26 | 2013-04-24 | 北京创毅讯联科技股份有限公司 | Method and device for writing data |
| CN104111897B (en) * | 2013-04-16 | 2017-06-13 | 华为技术有限公司 | A kind of data processing method, device and computer system |
| CN103914393B (en) * | 2014-04-11 | 2017-01-11 | 四川华拓光通信股份有限公司 | MCU-based (microprogrammed control unit-based) non-loss FLASH storage update method |
-
2015
- 2015-12-23 CN CN201510979983.2A patent/CN106909512B/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| CN106909512A (en) | 2017-06-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9645894B2 (en) | Data storage device and flash memory control method | |
| US10552311B2 (en) | Recovery for non-volatile memory after power loss | |
| US8453021B2 (en) | Wear leveling in solid-state device | |
| US9292432B2 (en) | Garbage collection method for flash memory | |
| US8392649B2 (en) | Memory storage device, controller, and method for responding to host write commands triggering data movement | |
| US9582416B2 (en) | Data erasing method, memory control circuit unit and memory storage apparatus | |
| US10635527B2 (en) | Method for processing data stored in a memory device and a data storage device utilizing the same | |
| US10762972B2 (en) | Method and apparatus for processing data in flash memory | |
| US9569126B2 (en) | Data storage device and flash memory control method | |
| CN107608908A (en) | Wear leveling method for data storage device | |
| US8489942B1 (en) | Memory management method, and memory controller and memory storage device using the same | |
| US20210397370A1 (en) | Data processing method for improving access performance of memory device and data storage device utilizing the same | |
| CN108897492B (en) | Data writing method and device | |
| CN107632943B (en) | Solid state disk data protection method and solid state disk | |
| KR20170086840A (en) | Data storage device and operating method thereof | |
| CN103999059A (en) | Method of erasing information stored in a nonvolatile rewritable memory, storage medium and motor vehicle computer | |
| CN106909512B (en) | Storage device using method and system | |
| US20160054935A1 (en) | Data storing method and memory controller and memory storage device using the same | |
| JP6717894B2 (en) | Method for performing refresh management in a memory device, associated memory device and its controller | |
| US10007601B2 (en) | Data storage device and operating method for flash memory | |
| CN109960611B (en) | Data recovery method and device, electronic equipment and machine-readable storage medium | |
| US20160124650A1 (en) | Data Storage Device and Flash Memory Control Method | |
| CN110865772A (en) | Method and device for protecting system data physical block erasure count value, computer equipment and storage medium | |
| US20180136859A1 (en) | Data writing method and storage controller | |
| CN105335095B (en) | The processing method and processing device of flash memory file system |
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 | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20230710 Address after: B2, Floor 20, Yanxiang Science and Technology Building, No. 31, Gaoxin Middle Fourth Road, Maling Community, Yuehai Street, Nanshan District, Shenzhen, Guangdong 518057 Patentee after: Shenzhen Jiuniuyimao Intelligent Internet of Things Technology Co.,Ltd. Address before: 518107 5th floor, No.1, Yanxiang Zhigu chuangxiangdi, No.11, Gaoxin Road, Guangming New District, Shenzhen City, Guangdong Province Patentee before: EVOC INTELLIGENT TECHNOLOGY Co.,Ltd. |