CN105630403A - File storage system and file storage control method and apparatus therefor - Google Patents

File storage system and file storage control method and apparatus therefor Download PDF

Info

Publication number
CN105630403A
CN105630403A CN201510141422.5A CN201510141422A CN105630403A CN 105630403 A CN105630403 A CN 105630403A CN 201510141422 A CN201510141422 A CN 201510141422A CN 105630403 A CN105630403 A CN 105630403A
Authority
CN
China
Prior art keywords
memory
file
page
document
file area
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
CN201510141422.5A
Other languages
Chinese (zh)
Other versions
CN105630403B (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.)
Shanghai Ciyu Information Technologies Co Ltd
Original Assignee
Shanghai Ciyu Information Technologies 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 Shanghai Ciyu Information Technologies Co Ltd filed Critical Shanghai Ciyu Information Technologies Co Ltd
Priority to CN201510141422.5A priority Critical patent/CN105630403B/en
Publication of CN105630403A publication Critical patent/CN105630403A/en
Application granted granted Critical
Publication of CN105630403B publication Critical patent/CN105630403B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System (AREA)

Abstract

The invention discloses a file storage system and a file storage control method and apparatus therefor. The file storage system comprises a first memory adopting whole block reading and writing, and a second memory supporting random storage, wherein the first memory and the second memory are both nonvolatile memories; and the second memory has longer service life and equal or higher reading and writing speed in comparison with the first memory. The method comprises the steps of when a creation or writing operation of a file is performed, allocating a page in a file region of the second memory to the file; and once the size of the file is greater than or equal to that of a storage block in the first memory, writing the page allocated to the file, having the storage capacity corresponding to the size of the storage block and contained in the file region of the second memory into a complete storage block of the first memory, and releasing related pages in the file region of the second memory. According to the file storage system and the file storage control method and apparatus, the problem of reduced system performance or shortened memory life caused by fragmentization of the storage file can be solved.

Description

Document storage system and file storage controlling method thereof and device
Technical field
The present invention relates to file storage technology field, particularly to a kind of document storage system and file storage controlling method thereof and device.
Background technology
In present computer, smart mobile phone, panel computer, user data, file are stored in hard disk, or the solid state hard disc (SSD, SolidStateDrives) formed in nand flash memory chip and by nand flash memory is inner. NAND and solid state hard disc replace the main trend that traditional mechanical hard disk is again an industry development.
NAND is the storage device (blockdevice) of a kind of monoblock read-write, the unit that minimum readable takes is page (page), minimum erasable unit is memory block or block (block), one block is often made up of a lot of page, and after block erasing, the page of the inside can carry out independent write (program) operation.
One problem of nand flash memory is that it has the limited life-span. Each page inside nand flash memory through certain number of times erasable after, will permanent failure can not be continuing with. The current trend of industry development is the capacity of NAND and packing density increases very fast, but to reduce the life-span for cost, erasable number of times is reduced to about current 3000 time from initial 100,000 times.
Can consulting Fig. 1, at software view, the framework of mobile phone and the storage of computer Chinese part is generally as follows:
Application software send to operating system open, close, reading and writing file instruction;
File system portion in operating system is the instruction morphing instruction for reading and writing memory block of reading and writing file;
NAND driving and management software accept the instruction in read-write memory block district, carry out buffer memory, write the optimizations such as balanced, send reading page to chip, write the instructions such as block; Specifically, in mobile phone, NAND reads and writes software usually used as the software module being closely related with operating system, runs on main control chip; In a computer, NAND reads and writes software generally in the upper operation of solid-state hard disk controller (SSDController).
File system is a pith in operating system software, is responsible for solving the storage problem of file. It can be divided into block one by one file, and generally each block is corresponding with a page in nand flash memory. Whenever a new document creation, file system can distribute to its block, when a block is write after completely, and a new block of reallocating. Owing to files a lot of in system are all increasing, the different blocks usually address in a file is discontinuous, and this is just the fragmentation of file. Further, after a file is deleted, the free block discharged can be taken by new file. So, along with the use of product, the fragmentation of file can be increasingly severe.
If using traditional mechanical hard disk storage file, the fragmentation of file is a big problem, because the magnetic head of mechanical hard disk needs long time when finding new address block, the performance causing system is significantly reduced by file fragmentation. If use NAND to store file, although the time finding new address is generally not problem, and file fragmentation is also smaller on the impact of systematic function, but what the service life of NAND was still had a significant impact by file fragmentation.
Summary of the invention
The problem to be solved in the present invention is that the systematic function caused because prior art stores file fragmentation produced by file reduces or storage life shortens.
For solving the problems referred to above, technical solution of the present invention provides a kind of document storage system, including:
First memory, second memory and control unit;
Described first memory is the non-volatile (NV adopting monoblock read-write, NotVolatile) memorizer, described second memory is the nonvolatile memory supporting random storage, and described second memory has longer service life and on an equal basis or faster read or write speed than described first memory;
Described control unit, be suitable to when the establishment or the write operation that perform file, page in the file area of described second memory is distributed to this document, and this document size of memory space shared by described second memory is once more than or equal to the size of a memory block in described first memory, the page that the size distributing to this document and the corresponding described memory block of memory capacity in the file area of described second memory is comprised, write among the full storage block of described first memory, and discharge in the file area of described second memory the related pages written into described first memory.
Optionally, weighed by erasable number of times the service life of described first memory and second memory.
Optionally, in the file area of described second memory, the memory capacity of each page is identical with the memory capacity of each page in the file area of described first memory.
Optionally, described second memory is magnetic RAM (MRAM, MagneticRandomAccessMemory), and described first memory is nand flash memory or solid state hard disc.
Optionally, described second memory is connected with described control unit by DDRDRAM interface.
Optionally, described first memory is solid state hard disc, and described second memory is built among described first memory.
For solving the problems referred to above, technical solution of the present invention also provides for the file storage controlling method of a kind of above-mentioned document storage system, including:
When the establishment or the write operation that perform file, the page in the file area of described second memory is distributed to this document;
If the size of this document shared memory space in described second memory is once more than or equal to the size of a memory block in described first memory, the page then size distributing to this document and the corresponding described memory block of memory capacity in the file area of described second memory comprised, write among the full storage block of described first memory, and discharge in the file area of described second memory the related pages written into described first memory.
Optionally, the page in the file area of described second memory is distributed to this document to include:
When the establishment operation performing file, the free page in the file area of described second memory is distributed to this document;
When performing the write operation of file, writing position according to file finds in the file area of described second memory corresponding page to perform said write operation, or when the new page of needs stores, the free page in the file area of described second memory is distributed to this document.
Optionally, the file storage controlling method of described document storage system also includes: if the quantity of free page is less than lower threshold in the file area of described second memory, then perform to clear up the operation of the file area of described second memory.
Optionally, the operation performing to clear up the file area of described second memory includes:
The time that establishment or write operation occurred by the last time finds the oldest file;
By the oldest described file all pages in the file area of described second memory, write the memory block having free page enough continuously in described first memory;
The file the oldest described in release all pages in the file area of described second memory.
Optionally, described lower threshold is 1 or 2.
Optionally, perform the operation clearing up the operation of the file area of described second memory and the full storage block by the page described first memory of write in the file area of described second memory, and carry out in each independent thread or task between establishment or the write operation of described execution file.
Optionally, the free page in the file area of described second memory is managed by chained list, and described management includes distribution and the release of free page.
For solving the problems referred to above, technical solution of the present invention also provides for the file memory control device of a kind of document storage system, including:
Allocation units, are suitable to, when the establishment or the write operation that perform file, the page in the file area of described second memory be distributed to this document;
Judging unit, be suitable to judge this document in described second memory the size of shared memory space whether more than or equal to the size of a memory block in described first memory;
First transcription unit, be suitable to described judging unit judge this document in described second memory the size of shared memory space once the size of a memory block in more than or equal to described first memory, the page size distributing to this document and the corresponding described memory block of memory capacity in the file area of described second memory comprised, writes among the full storage block of described first memory;
First releasing unit, is suitable to discharge the related pages being write described first memory in the file area of described second memory by described first transcription unit.
Optionally, the file memory control device of described document storage system also includes cleaning unit, when being suitable to that the quantity of free page is less than lower threshold in the file area of described second memory, performs to clear up the operation of the file area of described second memory.
Optionally, described cleaning unit includes:
Search unit, is suitable to occur the time of establishment or write operation to find the oldest file by the last time;
Second transcription unit, is suitable to, by the oldest described file all pages in the file area of described second memory, write the memory block having free page enough continuously in described first memory;
Second releasing unit, is suitable to the file the oldest described in release all pages in the file area of described second memory.
Optionally, the file memory control device of described document storage system also includes free page administrative unit, is suitable to be managed by the free page in the chained list file area to described second memory, and described management includes distribution and the release of free page.
Compared with prior art, technical scheme at least has the advantage that
File is jointly stored by using two distinct types of nonvolatile memory to cooperate, first memory therein adopts monoblock read-write, second memory support stores at random, there is longer service life and on an equal basis or faster read or write speed than first memory, when the establishment or the write operation that perform file, first distribute the page in the file area of second memory to this document, once this document size of shared memory space in described second memory reaches the size of a memory block, then by this document memory capacity in second memory be a memory block size comprise page write first memory full storage block among, and discharge the related pages in the file area of second memory, so can guarantee that big file stores by whole memory block, without making it possible to be dispersed to inside different memory blocks by the data of a memory block storage, thus greatly reduce the probability producing file fragmentation in the first memory.
Relative in prior art only with the document storage mode of nand flash memory or solid state hard disc, technical solution of the present invention makes by being continuously written into the big file created, such as copy, the incoming file of network, monitoring video file etc., nearly all it is stored in inside complete memory block, thus can reduce the erasable number of times of nand flash memory or solid state hard disc further, extend the service life of product; Relative to document storage mode only with mechanical hard disk in prior art, technical solution of the present invention can make file be maintained in a continuous print space as best one can, and the addressing time of address block greatly reduces, and which thereby enhances the performance of system.
Accompanying drawing explanation
Fig. 1 is the configuration diagram that prior art file is stored in software view;
Fig. 2 is the structural representation of the document storage system of the embodiment of the present invention;
Fig. 3 is the structural representation that MRAM is integrated in document storage system by a kind of mode that the embodiment of the present invention provides;
Fig. 4 is the structural representation that MRAM is integrated in document storage system by the another way that the embodiment of the present invention provides;
Fig. 5 is the schematic flow sheet creating operation performing file in the embodiment of the present invention;
Fig. 6 is the schematic flow sheet of the write operation performing file in the embodiment of the present invention;
Fig. 7 is the schematic flow sheet clearing up MRAM file area in the embodiment of the present invention.
Detailed description of the invention
In prior art, if using traditional mechanical hard disk storage file, cost long time is needed owing to finding new address block, the performance causing system is significantly reduced by file fragmentation, if and use NAND stores file, although file fragmentation is less on the impact of systematic function, but the service life of NAND can be produced a very large impact.
Present inventor is analyzed as follows: owing to the minimum erasable unit of NAND is block, one block is likely to there are 32 page, if the file of 32 page is stored to 32 different block, then this file will wipe 32 block when being deleted; If in store 32 files in a block, when any of file is deleted or is modified, the data of alternative document to be also wiped free of therewith and rewrite one time again. Owing to the more erasable number of times of NAND can shorten the life-span of NAND, cause that the product (such as mobile phone, computer etc.) using NAND or solid state hard disc is scrapped in advance.
By analyzing it can be seen that store the epoch of file at use NAND above, it is prevented that file fragmentationization still has great importance. The present inventors considered that, effectively to solve file fragmentation problem, mainly it is the need to ensure that big file stores with whole block, not being distributed to inside different block by the data of a block storage, that is, it is most important that in the aspect of block, prevent file fragmentation.
For this, technical solution of the present invention provides a kind of when using MRAM, the method of the file system software in improvement operating system, it enables to file and is maintained at as best one can in a continuous print memory space, thus realizing alleviating the fragmentation of file in the aspect of memory block.
Understandable for enabling the above-mentioned purpose of the present invention, feature and advantage to become apparent from, below in conjunction with accompanying drawing, specific embodiments of the invention are described in detail.
Technical solution of the present invention be embodied as relating to the amendment of operating system file systems soft ware, accordingly provide a kind of control method utilizing MRAM and NAND collaborative storage file together in the present embodiment, preserve big file mainly for ensureing with whole block.
Implement above-mentioned control method it is first necessary to complete corresponding hardware designs, MRAM is integrated into document storage system, it is provided that a kind of document storage system being different from prior art.
As in figure 2 it is shown, the document storage system that the embodiment of the present invention provides includes: first memory 202, second memory 203 and control unit 201, described first memory 202 is the nonvolatile memory adopting monoblock read-write, described second memory 203 is the nonvolatile memory supporting random storage, and described second memory 203 has longer service life and on an equal basis or faster read or write speed than described first memory 202, described control unit 201, be suitable to when the establishment or the write operation that perform file, page in the file area of described second memory 203 is distributed to this document, and this document size of memory space shared by described second memory is once more than or equal to the size of a memory block in described first memory 202, the page that the size being already allocated to this document and the corresponding described memory block of memory capacity in the file area of described second memory 203 is comprised, write among the full storage block of described first memory 202, and discharge in the file area of described second memory 203 related pages written into described first memory 202.
It should be noted that in the present embodiment, with described second memory 203 for magnetic RAM (MRAM, MagneticRandomAccessMemory), described first memory 202 is that example illustrates for nand flash memory or solid state hard disc. In other embodiments, every memorizer meeting the nonvolatile memory of storage " support random ", " adopting the nonvolatile memory of monoblock read-write " and " second memory has longer service life and on an equal basis or faster read or write speed than first memory " these corresponding conditionses all can realize, such as: along with the development of memory technology, the support more more particularly suitable than MRAM stores at random, long service life, read or write speed are fast nonvolatile memory it will be likely to occur from now on as described second memory; Certainly, described first memory can also be mechanical hard disk.
MRAM is a kind of new internal memory and memory technology, it is possible to as the equally quick random read-write of random access memory (RAM, RandomAccessMemory), it is also possible to forever retain data as nand flash memory after a loss of power. Unlike NAND, MRAM can be erasable infinitely in multiple times, it is contemplated that in following significant period of time, the Capacity Ratio NAND of MRAM is low, cost is higher than NAND, so have employed in the embodiment of the present invention, MRAM and NAND working in coordination with the control carrying out file storage, MRAM assists NAND to serve as storage file and user data task together.
In the present embodiment, the service life of described first memory 202 and second memory 203 is to be undertaken weighing by erasable number of times. Due to the technical characterstic of MRAM, it can be erasable infinitely in multiple times, and NAND through certain number of times erasable after, will permanent failure can not be continuing with, so the service life of MRAM is significantly larger than the service life of NAND.
When reality is implemented, described control unit 201 can be realized by the mode of software and hardware combining, wherein software section is embodied in the amendment of operating system file systems soft ware, it is embodied in file storage and controls the change of (including document creation or write operation) mode, hardware components then passes through Memory Controller, central processing units (CPU) etc. perform file system software, such as in the communication terminals such as mobile phone, in operating system, improved file system software can be run on main control chip, then generally run on solid-state hard disk controller in a computer. certainly, it will be appreciated by persons skilled in the art that corresponding document systems soft ware can also pass through to be cured to the mode of hardware and go to realize.
With continued reference to Fig. 2, below the file storage control process that described control unit 201 realizes is illustrated.
Owing to first memory 202 is the storage device of a kind of monoblock read-write, and those skilled in the art know, what described monoblock was read and write storage device is generally referred to as the storage device using memory block (block) as erasing and the minimum unit of write, and the unit that minimum readable takes is page (page). with block1 in Fig. 2, block2 ... the bold box that blockN carries out indicating represents each memory block of first memory 202, each rectangular grid in bold box represents the page in memory block, wherein each page in this memory block of block1 is in order with page1-1, page1-2, page1-3, page1-4 ... wait expression, each page in this memory block of block2 is in order with page2-1, page2-2, page2-3, page2-4 ... wait expression, by that analogy, each page in this memory block of blockN is in order with pageN-1, pageN-2, pageN-3, pageN-4 ... wait expression. be specially NAND chip or the solid state hard disc being made up of NAND chip due to the first memory 202 in the present embodiment, the file area therefore Page in these memory blocks constituted calls NAND file area.
Second memory 203 is the storage device supporting random storage, this storage device is absent from the concept of block, its memory space can be divided into one by one with the page read-write cell being ultimate unit, it is possible at random the arbitrary page in second memory 203 is read, idle page writes after writing or wipe busy page. In Fig. 2, each rectangular grid in second memory 203 represents a page respectively, and each page is in order with page0-1, page0-2, page0-3, page0-4 ... wait expression. Owing to the second memory 203 in the present embodiment is specially MRAM, the file area therefore this part of MRAMPage constituted calls MRAM file area.
In the specific implementation, if performing establishment or the write operation of certain file, then under control of the control unit 201, page in MRAM file area is distributed to this document store, if created or in ablation process, judge this document in MRAM file area the size of shared memory space once the size of a block in more than or equal to NAND, MRAM file area will be already allocated to the page that the corresponding block size of this document and memory capacity comprises, among the full storage block of write NAND, and discharge in MRAM file area the related pages written into NAND, this document remaining page in MRAM file area then continues to stay in a mram, constantly accumulate along with the lasting write MRAM of this document, until this document in MRAM file area the size of shared memory space again more than or equal to NAND in the size of a block.
It is to be noted, each page and block in first memory 202 is the basic structure characteristic of memorizer, generally predefined according to manufacturing specification, generally can not at will change, the page in second memory 203 then can freely divide as required. In the present embodiment, in the file area of described second memory 203, the memory capacity of each page is identical with the memory capacity of each page in the file area of described first memory 202, so can simplify the amendment for file system, conveniently the page in the file area of second memory 203 is written in the complete b lock of first memory 202, thus improving the efficiency that file storage controls. In other embodiments, in the file area of described second memory 203, the memory capacity of each page can also be different from the memory capacity of each page in the file area of described first memory 202, assume the memory capacity of each page in the file area of described second memory 203 be first memory 202 file area in 2 times of memory capacity of each page, then a page of second memory 203 is accomplished by two page of first memory 202 and could realize storage.
Those skilled in the art are intelligible, in the present embodiment the memory capacity of MRAM should at least above or equal to the size of a block in NAND file area, when reality is implemented, it is only necessary to MRAM one piece more much smaller than NAND capacity can realize.
In conjunction with Fig. 2 for example, if perform the write operation of certain file, page in second memory 203 is distributed to this document storage, assume that these 6 page of page0-4��page0-9 are allocated to this document, lasting write along with file, follow-up again these 26 page of page0-32��page0-57 are distributed to this document successively, when when being sized to 32 page of a block assuming first memory 202, then now control unit 201 will determine that out that this document size of shared memory space in described second memory 203 has reached a block size, meet the condition that the page in second memory 203 is write first memory 202, then control in a complete block by page0-4��page0-9 and page0-32��page0-57 write first memory 202, and complete second memory 203 to after the write operation of first memory 202, release page0-4��page0-9 and page0-32��page0-57, so that these page become idle page.
In the present embodiment, it is all the idle page block constituted that complete block refers to all page in first memory 202. Assume that each page in the block2 of first memory 202 is idle page, then can page0-4��page0-9 and page0-32��page0-57 be write in block2, as shown in Fig. 2 black arrow.
It should be noted that, it is merely illustrative the file storage control process of described control unit 201 above, when reality is implemented, distributing to the page that certain file carries out storing in second memory 203 might not be all continuous print each other, namely time according to above document creation or write operation, file is likely to be stored in discontinuous Page in a mram, but systematic function is not had any impact by this, the size of file shared memory space in second memory 203 is once more than one block, just have whole block and be written into NAND, thus preventing file fragmentation in the aspect of block.
When reality is implemented, described document storage system can apply in the product such as mobile phone or computer, the processor such as CPU or digital signal processor (DSP) is coordinated to be calculated operation owing to this series products generally all also can have some volatile memory, described volatile memory can be Double Data Rate dynamic RAM (DDRDRAM, DoubleDataRateDynamicRandomAccessMemory), and the accessing operation of this type of volatile memory can be subject to the control of described control unit equally. Therefore, a kind of simple embodiment being integrated in document storage system by MRAM and be attached between control unit is: as shown in Figure 3, use the MRAM chip product with DDRDRAM interface, it is linked on the DDRDRAM interface of mobile phone main control chip or computer CPU, using together with original DDRDRAM, main control chip or CPU are by different chip select (chipselect) signal behavior DDRDRAM and MRAM.
In addition it is also possible to by other means MRAM is integrated in document storage system, for instance: as shown in Figure 4, built-in MRAM in solid state hard disc (SSD), and mark off one piece of region (file area) in a mram and allow CPU direct read/write; Certainly, this CPU realizes the read-write operation to DDRDRAM also by DDRDRAM interface.
It should be noted that, MRAM in the present embodiment is not used as the write buffer memory (WriteCache) of NAND, if in buffer memory (Cache) system, the data of one Page will respectively deposit portion in MRAM and NAND, and the fileinfo in the present embodiment only deposits portion in a mram, once satisfy condition, after the page in MRAM is write a block of NAND, MRAM will be released written into the page of NAND, become idle page.
Based on above-mentioned document storage system, the embodiment of the present invention also provides for the file storage controlling method of a kind of above-mentioned document storage system, including: when the establishment or the write operation that perform file, the page in the file area of described second memory is distributed to this document; If the size of this document shared memory space in described second memory is once more than or equal to the size of a memory block in described first memory, the page then size distributing to this document and the corresponding described memory block of memory capacity in the file area of described second memory comprised, write among the full storage block of described first memory, and discharge in the file area of described second memory the related pages written into described first memory.
In the specific implementation, the page in the file area of described second memory is distributed to this document and includes: when the establishment operation performing file, the free page in the file area of described second memory is distributed to this document; When performing the write operation of file, writing position according to file finds in the file area of described second memory corresponding page to perform said write operation, or when the new page of needs stores, the free page in the file area of described second memory is distributed to this document.
In the present embodiment, performed the flow process of establishment operation of file by above-mentioned document storage system as shown in Figure 5.
Step S301 is first carried out, receives the instruction creating file.
After step S301, perform step S302, perform the establishment operation of file, and distribute a MRAMpage to this document. Due to " the establishment operation of file " dawn known to those skilled in the art in step S302, it is not described in detail herein.
In the present embodiment, the memory space creating operation required owing to performing file generally can't be very big, therefore only need one MRAMpage of distribution to file, if the follow-up write operation also needing to perform file, it is still necessary to distribution MRAMpage is to file further.
After step S302, perform step S303, it is judged that the quantity of idle MRAMpage, whether less than N_low, is then execution step S304, the operation of execution cleaning MRAM file area; The otherwise establishment operation of ends file.
In the present embodiment, N_low weighs the lower threshold of the quantity situation of free page in MRAM file area, once judge that the quantity of idle MRAMpage is less than N_low, then show memory space inadequate in MRAM, need to discharge a part of page, now can perform the operation of cleaning MRAM file area.
In the present embodiment, performed the flow process of write operation of file by above-mentioned document storage system as shown in Figure 6.
Step S401 is first carried out, receives the instruction of write file.
After step S401, perform step S402, perform the write operation of file. In step S402, " write operation of file " dawn known to those skilled in the art, is not described in detail herein.
Perform, in the write operation process of file, to perform step S403, it may be judged whether need new page. Owing to when performing the write operation of file, if the data volume of write is relatively big, then page possibly cannot meet memory requirement, now needs to distribute more page and completes write operation.
If step S403 judged result is "Yes", then performs step S404, distribute a new MRAMPage and continued write operation to file; If step S403 judged result is "No", then the write operation of ends file.
After step S404, perform step S405, judge file in the size of memory space shared by MRAM file area whether more than or equal to a block, it is then perform step S406, MRAM file area will be already allocated to the page that the corresponding block size of this document and memory capacity comprises, among the full storage block of write NAND; Otherwise perform step S408.
It should be noted that in the present embodiment, the page of MRAM file area is write by step S406 the process of the full storage block of NAND, it is possible to take the mode write in order. In other embodiments, the mode not write in order can also be taked completely.
After step S406, perform step S407, written into the related pages of NAND in release MRAM file area. After step S407 is finished, then the write operation of ends file.
Perform step S408, it is judged that the quantity of idle MRAMpage, whether less than N_low, is then execution step S409, the operation of execution cleaning MRAM file area, the otherwise write operation of ends file.
In the present embodiment, performed the flow process of operation (such as the step S409 shown in the step S304 shown in Fig. 5 and Fig. 6) of cleaning MRAM file area by above-mentioned document storage system as shown in Figure 7.
Step S501 is first carried out, occurs by the last time time of write operation to find the oldest file. In the present embodiment, the oldest described file refers to the current time distance last time that write operation occurs file at most, namely there is not the file of write operation at most, this class file does not for a long time write, show that the probability of follow-up generation write operation is relatively low, need to be cleaned out MRAM file area, so as to hold the write of alternative document.
Perform step S502, this document all Page in MRAM file area are write the block having enough continuously idle Page in NAND file area.
When reality is implemented, carrying out along with the operation of cleaning MRAM file area, NAND file area will exist occupied page but still there is the block of certain idle Page continuously, in order to reach to be easy to the purpose that file reads and makes full use of memory space, the operation of write NAND file area should be tried one's best in rate-determining steps S502 not across block, if now finding NAND file area exists and having enough continuously the idle page block writing NAND to hold the operation performing cleaning MRAM file area, then the file all Page in MRAM file area being performed cleaning operation are write in this block.
Perform step S503, the file the oldest described in release all Page in MRAM file area.
Perform step S504, it is judged that the quantity of idle MRAMpage, whether less than N_low, is then return step S501, the operation of continuation new round execution cleaning MRAM file area, otherwise terminates the operation of cleaning MRAM file area.
In the present embodiment, when MRAM file area is not enough, by flow process cleaning MRAM file area as shown in Figure 7, the file of write operation is not for a long time occurred to be eliminated away.
It should be noted that, no matter it is the establishment operation performing file at above-mentioned document storage system, or perform the write operation of file, or in performing the process of operation of cleaning MRAM file area, whether capital relates to the quantity judging idle MRAMpage less than N_low, once judged result is yes, it was shown that the memory space inadequate of MRAM file area, it is necessary to begin a clean up MRAM file area or continue cleaning MRAM file area.
Therefore, in the present embodiment, the file storage controlling method of described document storage system also includes: if the quantity of free page is less than lower threshold in the file area of described second memory, then perform to clear up the operation of the file area of described second memory. When reality is implemented, described lower threshold is 1 or 2. It is to say, when MRAM file area not having idle page or only having 1 idle page, it is necessary to perform the operation of cleaning MRAM file area.
In addition, " judge that whether the quantity of idle MRAMpage is less than N_low " and be not limited to the execution opportunity given by the present embodiment, such as: in other embodiments, step S303 shown in Fig. 5 performs after can also being arranged in step S301, and step S408 shown in Fig. 6 performs after can also being arranged in step S401.
In the present embodiment, perform the operation clearing up the operation of the file area of described second memory and the full storage block by the page described first memory of write in the file area of described second memory, and it is carry out in each independent thread or task between establishment or the write operation of described execution file, the synchronization that so will not affect other operations because of the execution time delay of certain operation performs, it is possible to increase the efficiency of file storage.
When being embodied as, the free page in the file area of described second memory can be managed by chained list, it is simple to taking out rapidly and use and discharge into, described management includes distribution and the release of free page. It should be readily apparent to one skilled in the art that " distribution of free page " refers to and certain free page is distributed to certain file, and " release of free page " refers to and certain busy page is carried out release becomes free page.
When reality is implemented, a software module can be implemented into by programming languages such as C, C++ easily by the operation of Fig. 5,6 write operations and execution cleaning MRAM file area operating, performing file with the establishment performing file described by the flow chart shown in 7, to existing file system modification, addition, run in mobile phone, the main control chip of computer or solid-state hard disk controller. Especially, for mobile phone, should select to be exclusively used in the file system of nand flash memory, such as YAFF (YetAnotherFlashFile), carry out the amendment described by the embodiment of the present invention.
Being embodied as of the file storage controlling method of described document storage system with reference to the enforcement of above-mentioned document storage system, can also repeat no more herein.
File based on above-mentioned document storage system stores control, the embodiment of the present invention also provides for the file memory control device of a kind of document storage system, including: allocation units, be suitable to, when the establishment or the write operation that perform file, the page in the file area of described second memory be distributed to this document; Judging unit, be suitable to judge this document in described second memory the size of shared memory space whether more than or equal to the size of a memory block in described first memory; First transcription unit, be suitable to described judging unit judge this document in described second memory the size of shared memory space once the size of a memory block in more than or equal to described first memory, the page size distributing to this document and the corresponding described memory block of memory capacity in the file area of described second memory comprised, writes among the full storage block of described first memory; First releasing unit, is suitable to discharge the related pages being write described first memory in the file area of described second memory by described first transcription unit.
In the present embodiment, the file memory control device of described document storage system also includes cleaning unit, when being suitable to that the quantity of free page is less than lower threshold in the file area of described second memory, performs to clear up the operation of the file area of described second memory.
When being embodied as, described cleaning unit may include that search unit, is suitable to occur the time of establishment or write operation to find the oldest file by the last time; Second transcription unit, is suitable to, by the oldest described file all pages in the file area of described second memory, write the memory block having free page enough continuously in described first memory; Second releasing unit, is suitable to the file the oldest described in release all pages in the file area of described second memory.
Additionally, the file memory control device of described document storage system also includes free page administrative unit, being suitable to be managed by the free page in the chained list file area to described second memory, described management includes distribution and the release of free page.
The enforcement being embodied as being referred to above-mentioned document storage system and file storage controlling method thereof of the file memory control device of described document storage system, repeats no more herein.
It will be appreciated by those skilled in the art that, realize file memory control device all or part of of the document storage system in above-described embodiment to can be by the hardware that program carrys out instruction relevant and complete, described program can be stored in computer-readable recording medium, and described storage medium can be ROM, RAM, magnetic disc, CD etc.
Although present disclosure is as above, but the present invention is not limited to this. Any those skilled in the art, without departing from the spirit and scope of the present invention, all can make various changes or modifications, and therefore protection scope of the present invention should be as the criterion with claim limited range.

Claims (17)

1. a document storage system, it is characterised in that including:
First memory, second memory and control unit;
Described first memory is the nonvolatile memory adopting monoblock read-write, described second memory is the nonvolatile memory supporting random storage, and described second memory has longer service life and on an equal basis or faster read or write speed than described first memory;
Described control unit, when the establishment or the write operation that perform file, page in the file area of described second memory is distributed to this document, and this document size of memory space shared by described second memory is once more than or equal to the size of a memory block in described first memory, the page that the size distributing to this document and the corresponding described memory block of memory capacity in the file area of described second memory is comprised, write among the full storage block of described first memory, and discharge in the file area of described second memory the related pages written into described first memory.
2. document storage system according to claim 1, it is characterised in that the service life of described first memory and second memory is weighed by erasable number of times.
3. document storage system according to claim 1, it is characterised in that in the file area of described second memory, the memory capacity of each page is identical with the memory capacity of each page in the file area of described first memory.
4. document storage system according to claim 1, it is characterised in that described second memory is MRAM, described first memory is nand flash memory or solid state hard disc.
5. document storage system according to claim 1, it is characterised in that described second memory is connected with described control unit by DDRDRAM interface.
6. document storage system according to claim 1, it is characterised in that described first memory is solid state hard disc, and described second memory is built among described first memory.
7. the file storage controlling method of the document storage system as described in any one of claim 1 to 6, it is characterised in that including:
When the establishment or the write operation that perform file, the page in the file area of described second memory is distributed to this document;
If the size of this document shared memory space in described second memory is once more than or equal to the size of a memory block in described first memory, the page then size distributing to this document and the corresponding described memory block of memory capacity in the file area of described second memory comprised, write among the full storage block of described first memory, and discharge in the file area of described second memory the related pages written into described first memory.
8. the file storage controlling method of document storage system according to claim 7, it is characterised in that the page in the file area of described second memory is distributed to this document and includes:
When the establishment operation performing file, the free page in the file area of described second memory is distributed to this document;
When performing the write operation of file, writing position according to file finds in the file area of described second memory corresponding page to perform said write operation, or when the new page of needs stores, the free page in the file area of described second memory is distributed to this document.
9. the file storage controlling method of document storage system according to claim 7, it is characterized in that, also include: if the quantity of free page is less than lower threshold in the file area of described second memory, then perform to clear up the operation of the file area of described second memory.
10. the file storage controlling method of document storage system according to claim 9, it is characterised in that the operation performing to clear up the file area of described second memory includes:
The time that establishment or write operation occurred by the last time finds the oldest file;
By the oldest described file all pages in the file area of described second memory, write the memory block having free page enough continuously in described first memory;
The file the oldest described in release all pages in the file area of described second memory.
11. the file storage controlling method of document storage system according to claim 9, it is characterised in that described lower threshold is 1 or 2.
12. the file storage controlling method of document storage system according to claim 9, it is characterized in that, perform the operation clearing up the operation of the file area of described second memory and the full storage block by the page described first memory of write in the file area of described second memory, and carry out in each independent thread or task between establishment or the write operation of described execution file.
13. the file storage controlling method of document storage system according to claim 7, it is characterised in that the free page in the file area of described second memory is managed by chained list, described management includes distribution and the release of free page.
14. the file memory control device of a document storage system, it is characterised in that including:
Allocation units, are suitable to, when the establishment or the write operation that perform file, the page in the file area of described second memory be distributed to this document;
Judging unit, be suitable to judge this document in described second memory the size of shared memory space whether more than or equal to the size of a memory block in described first memory;
First transcription unit, be suitable to described judging unit judge this document in described second memory the size of shared memory space once the size of a memory block in more than or equal to described first memory, the page size distributing to this document and the corresponding described memory block of memory capacity in the file area of described second memory comprised, writes among the full storage block of described first memory;
First releasing unit, is suitable to discharge the related pages being write described first memory in the file area of described second memory by described first transcription unit.
15. the file memory control device of document storage system according to claim 14, it is characterized in that, also include cleaning unit, when being suitable to that the quantity of free page is less than lower threshold in the file area of described second memory, perform to clear up the operation of the file area of described second memory.
16. the file memory control device of document storage system according to claim 15, it is characterised in that described cleaning unit includes:
Search unit, is suitable to occur the time of establishment or write operation to find the oldest file by the last time;
Second transcription unit, is suitable to, by the oldest described file all pages in the file area of described second memory, write the memory block having free page enough continuously in described first memory;
Second releasing unit, is suitable to the file the oldest described in release all pages in the file area of described second memory.
17. the file memory control device of document storage system according to claim 14, it is characterized in that, also including free page administrative unit, be suitable to be managed by the free page in the chained list file area to described second memory, described management includes distribution and the release of free page.
CN201510141422.5A 2015-03-27 2015-03-27 Document storage system and its file storage controlling method and device Active CN105630403B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510141422.5A CN105630403B (en) 2015-03-27 2015-03-27 Document storage system and its file storage controlling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510141422.5A CN105630403B (en) 2015-03-27 2015-03-27 Document storage system and its file storage controlling method and device

Publications (2)

Publication Number Publication Date
CN105630403A true CN105630403A (en) 2016-06-01
CN105630403B CN105630403B (en) 2018-10-12

Family

ID=56045402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510141422.5A Active CN105630403B (en) 2015-03-27 2015-03-27 Document storage system and its file storage controlling method and device

Country Status (1)

Country Link
CN (1) CN105630403B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107621927A (en) * 2017-09-29 2018-01-23 南京宏海科技有限公司 A kind of Longitudinal Extension method and its device based on super emerging system
CN110609817A (en) * 2018-05-28 2019-12-24 上海磁宇信息科技有限公司 File storage system capable of preventing file fragmentation
CN111444117A (en) * 2020-03-23 2020-07-24 Oppo广东移动通信有限公司 Method and device for realizing fragmentation of storage space, storage medium and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090024810A1 (en) * 2007-07-19 2009-01-22 Hitachi, Ltd. Memory area management method
CN104461397A (en) * 2014-12-19 2015-03-25 上海新储集成电路有限公司 Solid-state drive and read-write method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090024810A1 (en) * 2007-07-19 2009-01-22 Hitachi, Ltd. Memory area management method
CN104461397A (en) * 2014-12-19 2015-03-25 上海新储集成电路有限公司 Solid-state drive and read-write method thereof

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107621927A (en) * 2017-09-29 2018-01-23 南京宏海科技有限公司 A kind of Longitudinal Extension method and its device based on super emerging system
CN107621927B (en) * 2017-09-29 2020-08-14 南京宏海科技有限公司 Longitudinal extension method and device based on super-fusion system
CN110609817A (en) * 2018-05-28 2019-12-24 上海磁宇信息科技有限公司 File storage system capable of preventing file fragmentation
CN111444117A (en) * 2020-03-23 2020-07-24 Oppo广东移动通信有限公司 Method and device for realizing fragmentation of storage space, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN105630403B (en) 2018-10-12

Similar Documents

Publication Publication Date Title
CN102713866B (en) Reduce based on the access contention in the storage system of flash memory
CN109144887B (en) Memory system and control method for controlling nonvolatile memory
EP2715510B1 (en) Method for storage devices to achieve low write amplification with low over provision
JP6343438B2 (en) Computer system and data management method for computer system
KR101297563B1 (en) Storage management method and storage management system
US9183142B2 (en) Reducing flash memory write amplification and latency
CN111356990A (en) Namespace mapping structure adjustment in non-volatile memory devices
JP6459644B2 (en) Storage control device, control system, and control program
KR20120030137A (en) Memory system having persistent garbage collection
KR20130096881A (en) Flash memory device
KR20120012375A (en) Memory menagement device, information processing device and memory menagement methods
CN106201335B (en) Storage system
CN102841851A (en) Flash memory management method and flash memory device
CN105718530A (en) File storage system and file storage control method thereof
CN114372007A (en) Memory system and control method for controlling nonvolatile memory
CN107817945B (en) Data reading method and system of hybrid memory structure
CN103902475B (en) Solid state disk concurrent access method and device based on queue management mechanism
KR20140042432A (en) Computing system and method for managing data in the system
KR20190079672A (en) Information processing apparatus, memory access method, and computer program
US20170003911A1 (en) Information processing device
KR101061483B1 (en) Memory circuit and memory circuit access method, memory management system and memory management method
CN110389712B (en) Data writing method and device, solid state disk and computer readable storage medium
KR20090107098A (en) Locality-Aware Garbage Collection Technique for NAND Flash Memory-Based Storage Systems
CN103942148A (en) System and method of wear leveling for a non-volatile memory
CN105630403A (en) File storage system and file storage control method and apparatus therefor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant