CN107273303B - Flash memory data management system and method, flash memory chip and storage device - Google Patents

Flash memory data management system and method, flash memory chip and storage device Download PDF

Info

Publication number
CN107273303B
CN107273303B CN201710368964.5A CN201710368964A CN107273303B CN 107273303 B CN107273303 B CN 107273303B CN 201710368964 A CN201710368964 A CN 201710368964A CN 107273303 B CN107273303 B CN 107273303B
Authority
CN
China
Prior art keywords
data
flash memory
area
random
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710368964.5A
Other languages
Chinese (zh)
Other versions
CN107273303A (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.)
Jian Rong semiconductor (Shenzhen) Co., Ltd.
Original Assignee
Jianrong Semiconductor Shenzhen 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 Jianrong Semiconductor Shenzhen Co ltd filed Critical Jianrong Semiconductor Shenzhen Co ltd
Priority to CN201710368964.5A priority Critical patent/CN107273303B/en
Publication of CN107273303A publication Critical patent/CN107273303A/en
Application granted granted Critical
Publication of CN107273303B publication Critical patent/CN107273303B/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/0253Garbage collection, i.e. reclamation of unreferenced memory
    • 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/72Details relating to flash memory management
    • G06F2212/7202Allocation control and policies

Abstract

The invention is suitable for the technical field of flash memories, and provides a flash memory data management system, a flash memory data management method, a flash memory chip and a storage device, wherein the system comprises a flash memory controller and a flash memory, and the flash memory controller is used for classifying external data when the external data is written, and distinguishing continuous data and random data; the flash memory comprises a system area, a temporary storage area and a data area, wherein the system area comprises a random block for storing the random data and a continuous block for storing the continuous data; the temporary storage area is used for the flash memory controller to store the effective pages in the random block when the random block is sorted, and when the effective page quantity of the temporary storage area meets the set condition, the effective pages are transferred to the data area. By adopting the technical scheme of the invention, the data sorting speed and the system compatibility can be improved.

Description

Flash memory data management system and method, flash memory chip and storage device
Technical Field
The invention belongs to the technical field of storage, and particularly relates to a flash memory data management system and method, a flash memory chip and a storage device.
Background
In an existing Flash Translation Layer (FTL) algorithm, a Block (Block) with a large number of Invalid pages (Invalid pages) is generally selected for merging in a Garbagegistration (GC). This causes problems in that when the flash Memory Block (Block Memory) has too many Invalid pages (Invalid pages), it takes much time to integrate data, and some compatibility problems with the Host (Host) often arise.
Disclosure of Invention
The embodiment of the invention provides a flash memory data management system and method, a flash memory chip and a storage device, and aims to solve the existing problems.
In an embodiment of the present invention, there is provided a flash memory data management system, which includes a flash memory controller and a flash memory,
the flash memory controller is used for classifying external data when the external data are written, and distinguishing continuous data and random data;
the flash memory comprises a system area, a temporary storage area and a data area,
the system area includes a random block for storing the random data and a continuous block for storing the continuous data;
the temporary storage area is used for storing the effective pages in the random block when the random block is sorted by the flash memory controller, and when the effective page quantity of the temporary storage area meets the set condition, the effective pages are transferred to the data area.
In the embodiment of the invention, the flash controller distinguishes continuous data from random data according to the data length of the external data.
In an embodiment of the present invention, when the data in the continuous block is full, the flash memory controller moves the data in the continuous block to the data area and releases the continuous block.
In the embodiment of the present invention, when the data in the random block is full, the flash memory controller sorts the valid pages of the random block and stores the valid pages into the temporary storage area.
In an embodiment of the present invention, when the number of valid pages in the temporary storage area does not reach the set number, the flash memory controller releases the random block and moves the valid pages in the temporary storage area to the random block.
In an embodiment of the present invention, a flash memory data management method is further provided, where the flash memory includes a system area, a temporary storage area, and a data area, and the method includes:
a pretreatment step: when external data is written, classifying the external data to distinguish continuous data and random data;
a data storage step: storing the classified external data into the system area, wherein the system area comprises a random block and a continuous block, the random block stores the random data, and the continuous block stores the continuous data;
data arrangement: sorting the effective pages in the random block, and storing the effective pages into the temporary storage area;
a data unloading step: and judging whether the number of the effective pages in the temporary storage area meets a set condition, and when the number of the effective pages meets the set condition, transferring the effective pages to the data area.
In the preprocessing step, continuous data and random data are distinguished according to the data length of the external data.
In the data storage step, when the data in the continuous block is filled, the data in the continuous block is moved to the data area, and the continuous block is released.
In the data sorting step, after the valid pages in the temporary storage area are moved to the data area, the random blocks and the temporary storage area are released.
In the data transfer step, when the number of the effective pages in the temporary storage area does not reach the set number, the random block is released, and the effective pages in the temporary storage area are moved to the random block.
In an embodiment of the present invention, a flash memory chip is further provided, where the flash memory chip includes at least one processor, a memory, and an interface, and the at least one processor, the memory, and the interface are all connected through a bus;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored in the memory, so that the flash memory chip executes the flash memory data management method.
In an embodiment of the present invention, a storage device is further provided, where the storage device stores instructions, and the instructions, when executed by a processor, implement the steps of the above-mentioned flash data management method.
Compared with the prior art, in the technical scheme of the invention, the storage space of the flash memory is divided into a system area, a temporary storage area and a data area, when external data is written, the external data is classified to distinguish continuous data and random data, when the data is written, the data is firstly written into the system area, the temporary storage area is adopted to arrange effective pages of the random data in the temporary storage area, and finally the arranged data is stored into the data area, so that the data in the storage space is well ordered, more invalid pages can not exist, and the data arrangement speed and the system compatibility are improved.
Drawings
Fig. 1 is a schematic structural diagram of a flash memory data management system according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a state of a flash memory data management system for organizing random blocks in a system area according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a state of a flash memory data management system for organizing random blocks in a system area according to an embodiment of the present invention;
FIG. 4 is a flowchart of a flash memory data management method according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a flash memory chip according to a third embodiment of the present invention.
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.
The following detailed description of the implementation of the present invention is made with reference to specific embodiments:
example one
In this embodiment, a flash memory data management system and a method of managing a memory in the system are described.
Fig. 1 shows a schematic structural diagram of a flash data management system according to an embodiment of the present invention, where the flash data management system includes a flash controller 10 and a flash memory 20, and the flash memory 20 is divided into a system area 21, a temporary storage area 22, and a data area 23. The details will be described below.
The flash memory controller 10 is configured to classify external data when the external data is written, and distinguish continuous data from random data. When external data is written, the external data may be scattered data or may be continuous data of a whole block. When classifying the external data, the flash memory controller 10 distinguishes continuous data from random data according to the data length of the external data, where the external data is scattered data and classified as random data, and the external data is a whole block of data and classified as continuous data.
The system area 21 includes a random block 211 for storing the random data and a continuous block 212 for storing the continuous data, the random block 211 being used for storing the random data. After distinguishing the continuous data and the random data from the external data, the flash memory controller 10 writes the random data into the random block 211, and writes the continuous data into the continuous block 212. When one of the continuous blocks 212 in the system area 21 is full, the flash controller 10 moves the continuous data in the continuous block 212 to the data area 23 and releases the continuous block 212.
The temporary storage area 22 is used for the flash memory controller 10 to store the valid pages in the random block 211 when the random block 211 is sorted, and when the number of the valid pages in the temporary storage area 22 meets the set condition, the valid pages are transferred to the data area 23
The data area 23 is used for storing the valid pages sorted out from the random block 211 and the continuous data in the continuous block 212.
Fig. 2 and fig. 3 show a process of arranging the random block 221 in the system area 21 by the flash data management system according to an embodiment of the present invention. When the random block 211 in the system area 21 is full, the flash memory controller 10 sorts the full random block 211, puts the valid pages of the random block 211 into the temporary storage area 22, and counts the number of the valid pages, and when the number of the valid pages in the temporary storage area 22 does not reach the set number, the flash memory controller 10 releases the random block 211, and moves the valid pages in the temporary storage area 22 to the random block 211, and the random block 211 continues to receive receipts. When the number of valid pages in the temporary storage area 22 satisfies a set condition, the flash memory controller 10 transfers the valid pages to the data area 23 and releases the temporary storage area 22.
By adopting the flash memory data management system, the data in the memory space is well ordered, and more invalid pages can not exist, so that the data sorting speed and the system compatibility are improved.
Example two
Fig. 4 shows a flow of a flash memory data management method according to a second embodiment of the present invention, in this embodiment, a flash memory includes a system area, a temporary storage area, and a data area, and the method is implemented by using steps S1 to S4. The details will be described below.
Step S1, preprocessing step: when external data is written, the external data is classified to distinguish continuous data from random data.
It should be noted that, when external data is written, the external data may be scattered data or continuous data in whole block, and therefore, in the preprocessing step, the continuous data and the random data are distinguished according to the data length of the external data, and when the external data is scattered data, the external data is classified as random data, and when the external data is data in whole block, the external data is classified as continuous data.
Step S2, data storage step: and storing the classified external data into the system area. Wherein the system area includes a random block into which the random data is stored and a continuous block into which the continuous data is stored.
In the data storage step, when the data in the continuous block is full, the data in the continuous block is moved to the data area, and the continuous block is released; when the data in the random block is full, step S3 is started to sort the valid pages in the random block.
Step S3, data arrangement step: and arranging the effective pages in the random block, and storing the effective pages into the temporary storage area.
It should be noted that in the data sorting step, after the valid page in the temporary storage area is moved to the data area, the random block and the temporary storage area are released.
Step S4, data dump step: and judging whether the number of the effective pages in the temporary storage area meets a set condition, and when the number of the effective pages meets the set condition, transferring the effective pages to the data area.
It should be noted that, in the data transfer step, when the number of valid pages in the temporary storage area does not reach the set number, the random block is released, the valid pages in the temporary storage area are moved to the random block, and the random block continues to receive external random data.
After the processing of the steps, the data in the memory space are well ordered, and a plurality of invalid pages are avoided, so that the data sorting speed is increased, and the system compatibility is improved.
EXAMPLE III
As shown in fig. 5, a third embodiment of the present invention provides a flash memory chip in the third embodiment of the present invention, which includes at least one processor 310, a memory 320 and an interface 330, wherein the at least one processor 310, the memory 320 and the interface 330 are all connected by a bus;
the memory 320 stores computer-executable instructions;
the at least one processor 310 executes the computer executable instructions stored in the memory 320, so that the flash memory chip executes the flash memory data management method according to the second embodiment.
In an embodiment of the present invention, a storage device is further provided, where the storage device stores instructions, and the instructions, when executed by a processor, implement the steps of the flash memory data management method according to the second embodiment.
In summary, by using the flash memory data management system, method, flash memory chip and storage device of the present invention, the storage space of the flash memory is divided into the system area, the temporary storage area and the data area, when external data is written, the external data is classified to distinguish continuous data and random data, when data is written, the data is written into the system area first, and the temporary storage area is used to sort the valid pages of the random data in the temporary storage area, and finally the sorted data is stored into the data area, so that the data in the memory space is well ordered, and there are no more invalid pages, thereby improving the speed of sorting data and the compatibility of the system.
Notably, one of ordinary skill in the art will understand that: the steps or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, the program may be stored in a computer-readable storage medium, and when executed, the program performs the steps including the above method embodiments, and the storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (12)

1. A flash memory data management system, which is characterized in that the system comprises a flash memory controller and a flash memory,
the flash memory controller is used for classifying external data when the external data are written, and distinguishing continuous data and random data;
the flash memory comprises a system area, a temporary storage area and a data area,
the system area includes a random block for storing the random data and a continuous block for storing the continuous data;
the temporary storage area is used for storing the effective pages in the random block when the flash memory controller sorts the random block, and when the number of the effective pages in the temporary storage area meets a set condition, the effective pages are transferred to the data area;
when data is written in, the data is written in the system area, the temporary storage area is used for storing the effective pages of the sorted random data, and finally the data of the effective pages is stored in the data area, so that the data in the flash memory space is well ordered, and a plurality of invalid pages can not exist.
2. The flash data management system of claim 1,
the flash controller distinguishes continuous data from random data according to a data length of the external data.
3. The flash memory data management system of claim 1, wherein the flash memory controller moves the data of the contiguous block to the data area and releases the contiguous block when the data in the contiguous block is full.
4. The flash data management system of claim 1,
when the data in the random block is filled, the flash memory controller sorts the valid pages of the random block and stores the valid pages into the temporary storage area.
5. The flash memory data management system of claim 4, wherein the flash memory controller releases the random block and moves the valid pages in the temporary area to the random block when the number of valid pages in the temporary area does not reach a predetermined number.
6. A flash memory data management method is characterized in that the flash memory comprises a system area, a temporary storage area and a data area, and the method comprises the following steps:
a pretreatment step: when external data is written, classifying the external data to distinguish continuous data and random data;
a data storage step: storing the classified external data into the system area, wherein the system area comprises a random block and a continuous block, the random block stores the random data, and the continuous block stores the continuous data;
data arrangement: sorting the effective pages in the random block, and storing the effective pages into the temporary storage area;
a data unloading step: judging whether the number of the effective pages in the temporary storage area meets a set condition, and when the number of the effective pages meets the set condition, transferring the effective pages to the data area;
when data is written in, the data is written in the system area, the temporary storage area is used for storing the organized random data effective page, and finally the data of the effective page is stored in the data area, so that the data in the flash memory space is well ordered, and a plurality of invalid pages can not exist.
7. The flash memory data management method of claim 6, wherein in the preprocessing step, the continuous data and the random data are distinguished according to a data length of the external data.
8. The method for managing data in a flash memory according to claim 6, wherein in the data storing step, when the data in the continuous block is full, the data in the continuous block is moved to the data area, and the continuous block is released.
9. The method as claimed in claim 6, wherein in the step of sorting the data, the random block and the temporary storage area are released after the valid page in the temporary storage area is moved to the data area.
10. The method as claimed in claim 6, wherein in the data transferring step, when the number of valid pages in the temporary storage area does not reach a predetermined number, the random block is released and the valid pages in the temporary storage area are moved to the random block.
11. A flash memory chip is characterized in that the flash memory chip comprises at least one processor, a memory and an interface, wherein the at least one processor, the memory and the interface are all connected through a bus;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the flash memory chip to perform the flash memory data management method of any of claims 6-10.
12. A storage device having stored thereon instructions which, when executed by a processor, carry out the steps of the flash data management method according to any one of claims 6 to 10.
CN201710368964.5A 2017-05-23 2017-05-23 Flash memory data management system and method, flash memory chip and storage device Active CN107273303B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710368964.5A CN107273303B (en) 2017-05-23 2017-05-23 Flash memory data management system and method, flash memory chip and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710368964.5A CN107273303B (en) 2017-05-23 2017-05-23 Flash memory data management system and method, flash memory chip and storage device

Publications (2)

Publication Number Publication Date
CN107273303A CN107273303A (en) 2017-10-20
CN107273303B true CN107273303B (en) 2020-06-26

Family

ID=60064740

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710368964.5A Active CN107273303B (en) 2017-05-23 2017-05-23 Flash memory data management system and method, flash memory chip and storage device

Country Status (1)

Country Link
CN (1) CN107273303B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11287989B2 (en) 2020-03-24 2022-03-29 Western Digital Technologies, Inc. Dynamic allocation of sub blocks
CN112506442A (en) * 2020-12-22 2021-03-16 深圳市时创意电子有限公司 Flash memory chip data processing method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419834A (en) * 2007-10-22 2009-04-29 群联电子股份有限公司 Average abrasion method and controller using the method
CN101630233A (en) * 2008-07-17 2010-01-20 群联电子股份有限公司 Data access method used for flash memory, storage system and controller
CN102521160A (en) * 2011-12-22 2012-06-27 上海交通大学 Write buffer detector, addressing method of written data and parallel channel write method
CN103456357A (en) * 2012-06-01 2013-12-18 三星电子株式会社 Storage device having nonvolatile memory device and write method
CN104903842A (en) * 2012-12-31 2015-09-09 桑迪士克科技股份有限公司 Method and system for asynchronous die operations in a non-volatile memory
CN106569959A (en) * 2016-10-28 2017-04-19 郑州云海信息技术有限公司 Cache replacing method and system based on SSD

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9916238B2 (en) * 2015-08-25 2018-03-13 Sandisk Technologies Llc Memory system and method for performing garbage collection on blocks based on their obsolescence patterns

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419834A (en) * 2007-10-22 2009-04-29 群联电子股份有限公司 Average abrasion method and controller using the method
CN101630233A (en) * 2008-07-17 2010-01-20 群联电子股份有限公司 Data access method used for flash memory, storage system and controller
CN102521160A (en) * 2011-12-22 2012-06-27 上海交通大学 Write buffer detector, addressing method of written data and parallel channel write method
CN103456357A (en) * 2012-06-01 2013-12-18 三星电子株式会社 Storage device having nonvolatile memory device and write method
CN104903842A (en) * 2012-12-31 2015-09-09 桑迪士克科技股份有限公司 Method and system for asynchronous die operations in a non-volatile memory
CN106569959A (en) * 2016-10-28 2017-04-19 郑州云海信息技术有限公司 Cache replacing method and system based on SSD

Also Published As

Publication number Publication date
CN107273303A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
CN101630290B (en) Method and device of processing repeated data
KR101929584B1 (en) Data storage device and operating method thereof
US7937522B2 (en) Method for flash memory data management
CN105607867B (en) Master-slave deduplication storage system, method thereof, and computer-readable storage medium
US20150026391A1 (en) Block grouping method for garbage collection of solid state drive
RU2014127817A (en) SYSTEM AND METHOD FOR MANAGING AND ORGANIZING A WEB BROWSER CACHE
CN105095287A (en) LSM (Log Structured Merge) data compact method and device
CN105745628B (en) A kind of method for writing data into flash memory device, flash memory device and storage system
CN104298606A (en) Garbage collection action control method in SSD
CN105117351A (en) Method and apparatus for writing data into cache
CN109086141B (en) Memory management method and device and computer readable storage medium
CN103713861A (en) File processing method and system based on hierarchical division
CN107273303B (en) Flash memory data management system and method, flash memory chip and storage device
US10628487B2 (en) Method for hash collision detection based on the sorting unit of the bucket
CN108536609B (en) Memory fragment management system and method
CN107193498B (en) Method and device for carrying out de-duplication processing on data
CN104932830B (en) Information processing method and electronic equipment
CN110399101A (en) A kind of Write-operation process method of disk, device, system and storage medium
CN109213423A (en) Concurrent I/O command is handled without lock based on address barrier
CN105988719B (en) Storage device and its method for handling data
CN105653466A (en) Data storage device and flash memory control method
CN106201918A (en) A kind of method and system quickly discharged based on big data quantity and extensive caching
CN106371765B (en) Method for removing memory jitter by LTL model detection of efficient large-scale system
CN104750621A (en) Caching method and control system
CN105574124A (en) Data storage system based on product information

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: 20191226

Address after: 518000 District 652, district a, huameiju business center, Xinhu Road, Haiyu community, Xin'an street, Bao'an District, Shenzhen City, Guangdong Province

Applicant after: Jian Rong semiconductor (Shenzhen) Co., Ltd.

Address before: 518000 Guangdong city of Shenzhen province science and Technology Park of Nanshan District high new technology building B505 Fu'an

Applicant before: Jian Rong semiconductor (Shenzhen) Co., Ltd.

Applicant before: Jianrong Integrated Circuit Technology (Zhuhai) Co., Ltd.

Applicant before: ZHUHAI HUANGRONG INTEGRATED CIRCUIT TECHNOLOGY CO., LTD.

GR01 Patent grant
GR01 Patent grant