CN105389266A - Data management method and apparatus - Google Patents

Data management method and apparatus Download PDF

Info

Publication number
CN105389266A
CN105389266A CN201510672620.4A CN201510672620A CN105389266A CN 105389266 A CN105389266 A CN 105389266A CN 201510672620 A CN201510672620 A CN 201510672620A CN 105389266 A CN105389266 A CN 105389266A
Authority
CN
China
Prior art keywords
page
mapping table
lpn
field
data
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
CN201510672620.4A
Other languages
Chinese (zh)
Other versions
CN105389266B (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.)
Shenzhen Union Memory Information System Co Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201510672620.4A priority Critical patent/CN105389266B/en
Publication of CN105389266A publication Critical patent/CN105389266A/en
Application granted granted Critical
Publication of CN105389266B publication Critical patent/CN105389266B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • G06F2212/1036Life time enhancement

Abstract

The invention discloses a data management method and apparatus. The method comprises: dividing a mapping table into M independent mapping table pages, wherein M is a positive integer; allocating a unique virtual logic page number (LPN) for each mapping table page; and storing the mapping table page based on the virtual LPN. With the adoption of the technical scheme provided by the invention, the convenience is at least provided for a garbage collector (GC) to perform unified recovery and management on data pages and the mapping table pages.

Description

A kind of data managing method and device
Technical field
The present invention relates to solid state hard disc field, be specifically related to a kind of data managing method and device.
Background technology
Mapping table can not fixedly be updated in some or certain several pieces (block), otherwise, can be repeatedly erasable some or certain several pieces, increase the risk of bad block.Therefore need to allow depositing of mapping table flow in flash memory (flash) as far as possible.
If mapping table is divided into some independently pages, being used as common data page (datapage) writes in flash, loss equalization (WL is carried out together with common data page, and the reclaimer operation of Garbage Collector (GC, GarbageCollector) WearLeveing).But because mapping table page (mappingtablepage) does not have corresponding logical page (LPAGE) (LPN, LogicalPageNumber) number, trouble when GC can be caused to reclaim.
Therefore, how to be convenient to GC and unified recovery to be carried out to data page and mapping table page and management becomes problem demanding prompt solution.
Summary of the invention
In view of this, the present invention expects to provide a kind of data managing method and device, is at least convenient to GC and carries out unified recovery and management to data page and mapping table.
For achieving the above object, technical scheme of the present invention is achieved in that
The invention discloses a kind of data managing method, described method comprises:
Mapping table is divided into M independently mapping table page, M is positive integer;
For each mapping table page distributes unique virtual No. LPN;
Described mapping table page is stored based on described virtual No. LPN.
In such scheme, preferably, described based on the described virtual No. LPN described mapping table page of storage, comprising:
Reserve the integer field of the page footing of mapping table page;
Virtual No. LPN is deposited in described integer field.
In such scheme, preferably, describedly distribute virtual No. LPN for each mapping table page, comprising:
Obtain the first field corresponding to data page; Wherein, described first field refers to that file system is the field that data page is reserved;
The second field is determined based on described first field; Wherein, described second field is the field that described file system does not cover;
From described second field, be followed successively by each mapping table page at random or in order distribute unique virtual No. LPN.
In such scheme, preferably, described method also comprises:
When data are recycled,
Obtain No. LPN corresponding to current page;
The type of current page is determined based on described No. LPN;
When described current page is mapping table page, corresponding race table judges the validity of mapping table page, if described mapping table page is invalid, then recycles described mapping table page;
When described current page is data page, correspondence mappings table judges the validity of data page, if described data page is invalid, then recycles described data page.
In such scheme, preferably, the described type determining current page based on described No. LPN, comprising:
Check the field type corresponding to described No. LPN;
If described field type is the first field, then judge that the type of current page is as data page;
If described field type is the second field, then judge that the type of current page is as mapping table page.
In such scheme, preferably, record in described race table with virtual No. LPN for index, the one-to-one relationship of mapping table and physical page number (VPN, VirtualPageNumber);
Record in described mapping table with No. LPN for index, the one-to-one relationship of data page and VPN.
In such scheme, preferably, described corresponding race table judges the validity of mapping table page, comprising:
Obtain No. VPN of mapping table page correspondence;
Search and described virtual No. LPN corresponding No. VPN, standard according to virtual No. LPN of described mapping table page in race's table;
Judge described No. VPN whether consistent with No. VPN, described standard, if unanimously, judge that described mapping table page is effective; If inconsistent, judge that described mapping table page is invalid.
In such scheme, preferably, described correspondence mappings table judges the validity of data page, comprising:
Obtain No. VPN that data page is corresponding;
Search and described No. LPN corresponding No. VPN, standard according to No. LPN of described data page in the mapping table;
Judge described No. VPN whether consistent with No. VPN, described standard; If consistent, judge that described data page is effective; If inconsistent, judge that described data page is invalid.
The invention also discloses a kind of data administrator, described device comprises:
Division unit, for mapping table being divided into M independently mapping table page, M is positive integer;
Allocation units, for distributing No. LPN, virtual logical page for each mapping table page;
Storage unit, for storing described mapping table page based on described virtual No. LPN.
In such scheme, preferably, described storage unit, also for:
Reserved module, for reserving the integer field of the page footing of mapping table page;
Storage module, for depositing in virtual No. LPN in described integer field.
In such scheme, preferably, described allocation units, comprising:
First acquisition module, for obtaining the first field corresponding to data page; Wherein, described first field refers to that file system is the field that data page is reserved;
First determination module, for determining the second field based on described first field; Wherein, described second field is the field that described file system does not cover;
Distribution module, distributes unique virtual No. LPN for being followed successively by each mapping table page from described second field at random or in order.
In such scheme, preferably, described device also comprises: recovery unit, and wherein, described recovery unit, comprising:
Second acquisition module, for obtaining No. LPN corresponding to current page;
Second determination module, for determining the type of current page based on described No. LPN;
First recycling module, for when described current page is mapping table page, corresponding race table judges the validity of mapping table page, if described mapping table page is invalid, then recycles described mapping table page;
Second recycling module, for when described current page is data page, correspondence mappings table judges the validity of data page, if described data page is invalid, then recycles described data page.
Preferably, described second determination module, also for: check the field type corresponding to described No. LPN; If described field type is the first field, then judge that the type of current page is as data page; If described field type is the second field, then judge that the type of current page is as mapping table page.
In such scheme, preferably, record in described race table with virtual No. LPN for index, the one-to-one relationship of mapping table and physical page number VPN;
Record in described mapping table with No. LPN for index, the one-to-one relationship of data page and VPN.
In such scheme, preferably, described first recycling module, also for:
Obtain No. VPN of mapping table page correspondence;
Search and described virtual No. LPN corresponding No. VPN, standard according to virtual No. LPN of described mapping table page in race's table;
Judge described No. VPN whether consistent with No. VPN, described standard, if unanimously, judge that described mapping table page is effective; If inconsistent, judge that described mapping table page is invalid.
In such scheme, preferably, described second recycling module, also for:
Obtain No. VPN that data page is corresponding;
Search and described No. LPN corresponding No. VPN, standard according to No. LPN of described data page in the mapping table;
Judge described No. VPN whether consistent with No. VPN, described standard; If consistent, judge that described data page is effective; If inconsistent, judge that described data page is invalid.
A kind of data managing method provided by the present invention and device, mapping table is divided into M independently mapping table page, M is positive integer; For each mapping table page distributes unique virtual No. LPN; Described mapping table page is stored based on described virtual No. LPN; So, be at least convenient to GC and unified recovery and management are carried out to data page and mapping table page.
Accompanying drawing explanation
The realization flow schematic diagram of a kind of data managing method that Fig. 1 provides for the embodiment of the present invention;
The realization flow schematic diagram of the another kind of data managing method that Fig. 2 provides for the embodiment of the present invention;
The realization flow schematic diagram of another data managing method that Fig. 3 provides for the embodiment of the present invention;
The mapping table page schematic diagram that Fig. 4 (a) provides for the embodiment of the present invention, another mapping table page schematic diagram that Fig. 4 (b) provides for the embodiment of the present invention, the schematic diagram of the current race table that Fig. 4 (c) provides for the embodiment of the present invention;
The realization flow schematic diagram of another data managing method that Fig. 5 provides for the embodiment of the present invention;
Fig. 6 is the structural representation of a kind of data administrator of the embodiment of the present invention;
Fig. 7 is the structural representation of the another kind of data administrator of the embodiment of the present invention;
Fig. 8 is the structural representation of another data administrator of the embodiment of the present invention;
Fig. 9 is the structural representation of another data administrator of the embodiment of the present invention.
Embodiment
In order to more at large understand feature of the present invention and technology contents, below in conjunction with accompanying drawing, realization of the present invention is described in detail, the use of appended accompanying drawing explanation only for reference, is not used for limiting the present invention.
Embodiment one
The realization flow schematic diagram of a kind of data managing method that Fig. 1 provides for the embodiment of the present invention, in a preferred embodiment of the invention, as shown in Figure 1, described data managing method mainly comprises the following steps:
Step 101: mapping table is divided into M independently mapping table page, M is positive integer.
Step 102: for each mapping table page distributes No. LPN, unique virtual logical page.
Preferably, describedly distribute virtual No. LPN for each mapping table page, can comprise:
Obtain the first field corresponding to data page; Wherein, described first field refers to that file system is the field that data page is reserved;
The second field is determined based on described first field; Wherein, described second field is the field that described file system does not cover;
From described second field, be followed successively by each mapping table page at random or in order distribute unique virtual No. LPN.
Such as, described second field can adopt complex number field.That is, virtual No. LPN can adopt file system to be No. LPN field do not covered (as complex number field) that data page distributes.
Step 103: store described mapping table page based on described virtual No. LPN.
Preferably, described based on the described virtual No. LPN described mapping table page of storage, can comprise:
Reserve the integer field of the page footing of mapping table page;
Virtual No. LPN is deposited in described integer field.
Data managing method described in the present embodiment, due to when memory map assignments, is divided into independently mapping table page and stores, and be assigned with virtual No. LPN that can be different from data page identification number (namely No. LPN) for each mapping table page; So, be convenient to follow-uply to manage mapping table.
Embodiment two
The realization flow schematic diagram of the another kind of data managing method that Fig. 2 provides for the embodiment of the present invention, in a preferred embodiment of the invention, as shown in Figure 2, described data managing method mainly comprises the following steps:
Step 201: obtain No. LPN corresponding to current page.
It should be noted that, the present embodiment completes on basis shown in Fig. 1.That is, when storing, mapping table be divide into independently mapping table page, and being assigned with virtual No. LPN for each mapping table page; Meanwhile, file system is also assigned with No. LPN for each data page.
Step 202: the type determining current page based on described No. LPN.
Preferably, the described type determining current page based on described No. LPN, can comprise:
Check the field type corresponding to described No. LPN;
If described field type is the first field, then judge that the type of current page is as data page;
If described field type is the second field, then judge that the type of current page is as mapping table page.
Step 203: described current page is recycled according to preset strategy.
Preferably, according to preset strategy, described current page is recycled, can comprise:
When described current page is mapping table page, corresponding race table judges the validity of mapping table page, if described mapping table page is invalid, then recycles described mapping table page;
When described current page is data page, correspondence mappings table judges the validity of data page, if described data page is invalid, then recycles described data page.
Wherein, record in described race table with virtual No. LPN for index, the one-to-one relationship of mapping table and physical page number VPN;
Record in described mapping table with No. LPN for index, the one-to-one relationship of data page and VPN.
Data managing method described in the present embodiment, obtains No. LPN corresponding to current page; The type of current page is determined based on described No. LPN; According to preset strategy, described current page is recycled; So, be convenient to carry out unified recovery and management to data page and mapping table page.
Embodiment three
The realization flow schematic diagram of another data managing method that Fig. 3 provides for the embodiment of the present invention, in a preferred embodiment of the invention, as shown in Figure 3, described data managing method mainly comprises the following steps:
Step 301: obtain No. VPN of mapping table page correspondence.
It should be noted that, the present embodiment is the treatment scheme to mapping table page provided under the sight of Fig. 2 when having determined that current page is mapping table page.
Step 302: search and described virtual No. LPN corresponding No. VPN, standard according to virtual No. LPN of described mapping table page in race's table.
Wherein, record in described race table with virtual No. LPN for index, the one-to-one relationship of mapping table and VPN.
Step 303: judge described No. VPN whether consistent with No. VPN, described standard, if unanimously, judge that described mapping table page is effective; If inconsistent, judge that described mapping table page is invalid.
Fig. 4 (a) shows a mapping table page schematic diagram, and virtual No. LPN that the length of the integer word in the page footing of this mapping table page stores is 5, and stores the VPN=10 of this mapping table page;
That is, VPN=10 upper store be virtual No. LPN be 5 mapping table page, if this page was replicated, necessarily there is the VPN that another one stores this page in that, is such as VPN=20, as shown in Fig. 4 (b);
Fig. 4 (c) shows the schematic diagram of current race table (clustertable), the validity of described mapping table is judged according to this race table, as can be seen from Fig. 4-c, due to race table with virtual No. LPN for index, the VPN that virtual LPN is corresponding is 20, so, what Fig. 4-a the was corresponding mapping table page be stored on VPN=10 is exactly invalid, should be reclaimed.
Data managing method described in the present embodiment, is divided into independently mapping table page when storing, and is assigned with on the basis of virtual No. LPN for each mapping table page by mapping table, give the validity how corresponding race shows to judge mapping table page.
Embodiment four
The realization flow schematic diagram of another data managing method that Fig. 5 provides for the embodiment of the present invention, in a preferred embodiment of the invention, as shown in Figure 5, described data managing method mainly comprises the following steps:
Step 501: obtain No. VPN that data page is corresponding.
It should be noted that, the present embodiment is the treatment scheme to data page provided under the sight of Fig. 2 when having determined that current page is data page.
Step 502: search and described No. LPN corresponding No. VPN, standard according to No. LPN of described data page in the mapping table.
Wherein, record in described race table with virtual No. LPN for index, the one-to-one relationship of mapping table and VPN;
Record in described mapping table with No. LPN for index, the one-to-one relationship of data page and VPN.
Step 503: judge described No. VPN whether consistent with No. VPN, described standard; If consistent, judge that described data page is effective; If inconsistent, judge that described data page is invalid.
With method described in above-described embodiment three, the difference of the present embodiment and embodiment three is: last No. LPN of storing of each data page is centrally stored on last page of each piece, the mode being only No. LPN, reading is different, but, to table look-up judgement validity with the same manner, do not repeat them here.
Data managing method described in the present embodiment, is divided into independently mapping table page when storing, and is assigned with on the basis of virtual No. LPN for each mapping table page, give the validity how correspondence mappings table judges data page by mapping table.
Embodiment five
Embodiments provide a kind of data administrator, Fig. 6 is the structural representation of a kind of data administrator of the embodiment of the present invention, and as shown in Figure 6, described data administrator comprises:
Division unit 61, for mapping table being divided into M independently mapping table page, M is positive integer;
Allocation units 62, for distributing virtual No. LPN for each mapping table page;
Storage unit 63, for storing described mapping table page based on described virtual No. LPN.
Preferably, described allocation units 62, comprising:
First acquisition module 621, for obtaining the first field corresponding to data page; Wherein, described first field refers to that file system is the field that data page is reserved;
First determination module 622, for determining the second field based on described first field; Wherein, described second field is the field that described file system does not cover;
Distribution module 623, distributes unique virtual No. LPN for being followed successively by each mapping table page from described second field at random or in order.
Such as, described second field can adopt complex number field.That is, virtual No. LPN can adopt file system to be No. LPN field do not covered (as complex number field) that data page distributes
Preferably, described storage unit 63, comprising:
Reserved module 631, for reserving the integer field of the page footing of mapping table page;
Storage module 632, for depositing in virtual No. LPN in described integer field.
Those skilled in the art are to be understood that, the function of each unit in the data administrator of the present embodiment, can refer to the associated description of aforementioned document data managing method and understand, each unit in the data administrator of the present embodiment, realizing by realizing the mimic channel of the function described in the embodiment of the present invention, also can be realized by the operation of the software of the function of execution described in the embodiment of the present invention on intelligent terminal.
It should be noted that, the data administrator of the present embodiment can be arranged at terminal, and the function of module that division unit 61, allocation units 62, storage unit 63 and the unit described in the embodiment of the present invention comprises can by the central processing unit (CPU of terminal belonging to described data administrator or described data administrator, CentralProcessingUnit), microprocessor (MPU, MicroProcessorUnit) or digital signal processing (DSP, DigitalSignalProcessor) chip etc. realize.
Adopt the data administrator of the present embodiment, depositing of mapping table can be made to flow as far as possible in a flash memory, and, be convenient to follow-uply to manage mapping table.
Embodiment six
Embodiments provide another kind of data administrator, Fig. 7 is the structural representation of a kind of data administrator of the embodiment of the present invention, and as shown in Figure 7, described data administrator comprises:
Division unit 61, for mapping table being divided into M independently mapping table page, M is positive integer;
Allocation units 62, for distributing virtual No. LPN for each mapping table page;
Storage unit 63, for storing described mapping table page based on described virtual No. LPN;
Recovery unit 64, during for recycling data, obtains No. LPN corresponding to current page; The type of current page is determined based on described No. LPN; When described current page is mapping table page, corresponding race table judges the validity of mapping table page, if described mapping table page is invalid, then recycles described mapping table page; When described current page is data page, correspondence mappings table judges the validity of data page, if described data page is invalid, then recycles described data page.
Wherein, record in described race table with virtual No. LPN for index, the one-to-one relationship of mapping table and physical page number VPN;
Record in described mapping table with No. LPN for index, the one-to-one relationship of data page and VPN.
Wherein, described recovery unit 64, comprising:
Second acquisition module 641, for obtaining No. LPN corresponding to current page;
Second determination module 642, for determining the type of current page based on described No. LPN;
First recycling module 643, for when described current page is mapping table page, corresponding race table judges the validity of mapping table page, if described mapping table page is invalid, then recycles described mapping table page;
Second recycling module 644, for when described current page is data page, correspondence mappings table judges the validity of data page, if described data page is invalid, then recycles described data page.
Preferably, described second determination module 642, also for: check the field type corresponding to described No. LPN; If described field type is the first field, then judge that the type of current page is as data page; If described field type is the second field, then judge that the type of current page is as mapping table page.
Those skilled in the art are to be understood that, the function of each unit in the data administrator of the present embodiment, can refer to the associated description of aforementioned document data managing method and understand, each unit in the data administrator of the present embodiment, realizing by realizing the mimic channel of the function described in the embodiment of the present invention, also can be realized by the operation of the software of the function of execution described in the embodiment of the present invention on intelligent terminal.
It should be noted that, the data administrator of the present embodiment can be arranged at terminal, and the function of module that division unit 61, allocation units 62, storage unit 63, recovery unit 64 and the unit described in the embodiment of the present invention comprises can be realized by CPU, MPU of terminal belonging to described data administrator or described data administrator or dsp chip etc.
Adopt the data administrator of the present embodiment, be at least convenient to GC and unified recovery and management are carried out to data page and mapping table page.
Embodiment seven
Embodiments provide another data administrator, the structural representation of another data administrator that Fig. 8 provides for the embodiment of the present invention, as shown in Figure 8, described data administrator comprises: division unit 61, allocation units 62, storage unit 63, recovery unit 64; Wherein,
Described division unit 61, for mapping table being divided into M independently mapping table page, M is positive integer;
Described allocation units 62, for distributing virtual No. LPN for each mapping table page;
Described storage unit 63, for storing described mapping table page based on described virtual No. LPN;
Described recovery unit 64, for obtaining No. LPN corresponding to current page; The type of current page is determined based on described No. LPN; According to preset strategy, described current page is recycled.
Preferably, described recovery unit 64, comprising:
Second acquisition module 641, for obtaining No. LPN corresponding to current page;
Second determination module 642, for determining the type of current page based on described No. LPN;
First recycling module 643, for when described current page is mapping table page, corresponding race table judges the validity of mapping table page, if described mapping table page is invalid, then recycles described mapping table page;
Second recycling module 644, for when described current page is data page, correspondence mappings table judges the validity of data page, if described data page is invalid, then recycles described data page.
Preferably, described second determination module 642, also for: check the field type corresponding to described No. LPN; If described field type is the first field, then judge that the type of current page is as data page; If described field type is the second field, then judge that the type of current page is as mapping table page.
Preferably, described first recycling module 643, comprising:
First obtains submodule 6431, for obtaining No. VPN of mapping table page correspondence;
First searches submodule 6432, for searching and described virtual No. LPN corresponding No. VPN, standard according to virtual No. LPN of described mapping table page in race's table;
First judges submodule 6433, for judge described No. VPN whether consistent with No. VPN, described standard, if unanimously, judge that described mapping table page is effective; If inconsistent, judge that described mapping table page is invalid.
It should be noted that, the data administrator of the present embodiment can be arranged at terminal, and the function of module that division unit 61, allocation units 62, storage unit 63, recovery unit 64 and the unit described in the embodiment of the present invention comprises can be realized by CPU, MPU of terminal belonging to described data administrator or described data administrator or dsp chip etc.
Adopt the data administrator of the present embodiment, be at least convenient to carry out unified recovery and management to data page and mapping table page, the validity of mapping table page can be judged by corresponding race table better.
Embodiment eight
Embodiments provide another data administrator, the structural representation of another data administrator that Fig. 9 provides for the embodiment of the present invention, as shown in Figure 9, described data administrator comprises: division unit 61, allocation units 62, storage unit 63, recovery unit 64; Wherein,
Described division unit 61, for mapping table being divided into M independently mapping table page, M is positive integer;
Described allocation units 62, for distributing virtual No. LPN for each mapping table page;
Described storage unit 63, for storing described mapping table page based on described virtual No. LPN;
Described recovery unit 64, for obtaining No. LPN corresponding to current page; The type of current page is determined based on described No. LPN; According to preset strategy, described current page is recycled.
Preferably, described recovery unit 64, comprising:
Second acquisition module 641, for obtaining No. LPN corresponding to current page;
Second determination module 642, for determining the type of current page based on described No. LPN;
First recycling module 643, for when described current page is mapping table page, corresponding race table judges the validity of mapping table page, if described mapping table page is invalid, then recycles described mapping table page;
Second recycling module 644, for when described current page is data page, correspondence mappings table judges the validity of data page, if described data page is invalid, then recycles described data page.
Preferably, described second determination module 642, also for: check the field type corresponding to described No. LPN; If described field type is the first field, then judge that the type of current page is as data page; If described field type is the second field, then judge that the type of current page is as mapping table page.
Preferably, described second recycling module 644, comprising:
Second obtains submodule 6441, for obtaining corresponding No. VPN of data page;
Second searches submodule 6442, for searching and described No. LPN corresponding No. VPN, standard according to No. LPN of described data page in the mapping table;
Second judges submodule 6443, for judge described No. VPN whether consistent with No. VPN, described standard; If consistent, judge that described data page is effective; If inconsistent, judge that described data page is invalid.
Those skilled in the art are to be understood that, the function of each unit in the data administrator of the present embodiment, can refer to the associated description of aforementioned document data managing method and understand, each unit in the data administrator of the present embodiment, realizing by realizing the mimic channel of the function described in the embodiment of the present invention, also can be realized by the operation of the software of the function of execution described in the embodiment of the present invention on intelligent terminal.
It should be noted that, the data administrator of the present embodiment can be arranged at terminal, and the function of module that division unit 61, allocation units 62, storage unit 63, recovery unit 64 and the unit described in the embodiment of the present invention comprises can be realized by CPU, MPU of terminal belonging to described data administrator or described data administrator or dsp chip etc.
Adopt the data administrator of the present embodiment, be at least convenient to carry out unified recovery and management to data page and mapping table page, correspondence mappings table judges the validity of data page better.
In several embodiment provided by the present invention, should be understood that, disclosed method, device and electronic equipment, can realize by another way.Apparatus embodiments described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, and as: multiple unit or assembly can be in conjunction with, maybe can be integrated into another system, or some features can be ignored, or do not perform.In addition, the coupling each other of shown or discussed each ingredient or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of equipment or unit or communication connection can be electrical, machinery or other form.
The above-mentioned unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, also can be distributed in multiple network element; Part or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in various embodiments of the present invention can all be integrated in a processing unit, also can be each unit individually as a unit, also can two or more unit in a unit integrated; Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form that hardware also can be adopted to add SFU software functional unit realizes.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that programmed instruction is relevant, aforesaid program can be stored in a computer read/write memory medium, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: movable storage device, ROM (read-only memory) (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), magnetic disc or CD etc. various can be program code stored medium.
Or, if the above-mentioned integrated unit of the embodiment of the present invention using the form of software function module realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.Based on such understanding, the technical scheme of the embodiment of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium, comprises some instructions and performs all or part of of method described in each embodiment of the present invention in order to make a computer equipment (can be personal computer, server or the network equipment etc.).And aforesaid storage medium comprises: movable storage device, ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.

Claims (16)

1. a data managing method, described method comprises:
Mapping table is divided into M independently mapping table page, M is positive integer;
For each mapping table page distributes No. LPN, unique virtual logical page;
Described mapping table page is stored based on described virtual No. LPN.
2. the method according to claim l, is characterized in that, described based on the described virtual No. LPN described mapping table page of storage, comprising:
Reserve the integer field of the page footing of mapping table page;
Virtual No. LPN is deposited in described integer field.
3. the method according to claim l, is characterized in that, describedly distributes virtual No. LPN for each mapping table page, comprising:
Obtain the first field corresponding to data page; Wherein, described first field refers to that file system is the field that data page is reserved;
The second field is determined based on described first field; Wherein, described second field is the field that described file system does not cover;
From described second field, be followed successively by each mapping table page at random or in order distribute unique virtual No. LPN.
4. method according to claim 3, is characterized in that, described method also comprises:
When data are recycled,
Obtain No. LPN corresponding to current page;
The type of current page is determined based on described No. LPN;
When described current page is mapping table page, corresponding race table judges the validity of mapping table page, if described mapping table page is invalid, then recycles described mapping table page;
When described current page is data page, correspondence mappings table judges the validity of data page, if described data page is invalid, then recycles described data page.
5. method according to claim 4, is characterized in that, the described type determining current page based on described No. LPN, comprising:
Check the field type corresponding to described No. LPN;
If described field type is the first field, then judge that the type of current page is as data page;
If described field type is the second field, then judge that the type of current page is as mapping table page.
6. method according to claim 4, is characterized in that,
Record in described race table with virtual No. LPN for index, the one-to-one relationship of mapping table and physical page number VPN;
Record in described mapping table with No. LPN for index, the one-to-one relationship of data page and VPN.
7. method according to claim 4, is characterized in that, described corresponding race table judges the validity of mapping table page, comprising:
Obtain No. VPN of mapping table page correspondence;
Search and described virtual No. LPN corresponding No. VPN, standard according to virtual No. LPN of described mapping table page in race's table;
Judge described No. VPN whether consistent with No. VPN, described standard, if unanimously, judge that described mapping table page is effective; If inconsistent, judge that described mapping table page is invalid.
8. method according to claim 4, is characterized in that, described correspondence mappings table judges the validity of data page, comprising:
Obtain No. VPN that data page is corresponding;
Search and described No. LPN corresponding No. VPN, standard according to No. LPN of described data page in the mapping table;
Judge described No. VPN whether consistent with No. VPN, described standard; If consistent, judge that described data page is effective; If inconsistent, judge that described data page is invalid.
9. a data administrator, is characterized in that, described device comprises:
Division unit, for mapping table being divided into M independently mapping table page, M is positive integer;
Allocation units, for distributing No. LPN, virtual logical page for each mapping table page;
Storage unit, for storing described mapping table page based on described virtual No. LPN.
10. device according to claim 9, is characterized in that, described storage unit, also for:
Reserved module, for reserving the integer field of the page footing of mapping table page;
Storage module, for depositing in virtual No. LPN in described integer field.
11. devices according to claim 9, is characterized in that, described allocation units, comprising:
First acquisition module, for obtaining the first field corresponding to data page; Wherein, described first field refers to that file system is the field that data page is reserved;
First determination module, for determining the second field based on described first field; Wherein, described second field is the field that described file system does not cover;
Distribution module, distributes unique virtual No. LPN for being followed successively by each mapping table page from described second field at random or in order.
12. devices according to claim 9, it is characterized in that, described device also comprises recovery unit, described recovery unit, comprising:
Second acquisition module, for obtaining No. LPN corresponding to current page;
Second determination module, for determining the type of current page based on described No. LPN;
First recycling module, for when described current page is mapping table page, corresponding race table judges the validity of mapping table page, if described mapping table page is invalid, then recycles described mapping table page;
Second recycling module, for when described current page is data page, correspondence mappings table judges the validity of data page, if described data page is invalid, then recycles described data page.
13. devices according to claim 12, is characterized in that, described second determination module, also for: check the field type corresponding to described No. LPN; If described field type is the first field, then judge that the type of current page is as data page; If described field type is the second field, then judge that the type of current page is as mapping table page.
14. devices according to claim 12, is characterized in that,
Record in described race table with virtual No. LPN for index, the one-to-one relationship of mapping table and physical page number VPN;
Record in described mapping table with No. LPN for index, the one-to-one relationship of data page and VPN.
15. devices according to claim 12, is characterized in that, described first recycling module, also for:
Obtain No. VPN of mapping table page correspondence;
Search and described virtual No. LPN corresponding No. VPN, standard according to virtual No. LPN of described mapping table page in race's table;
Judge described No. VPN whether consistent with No. VPN, described standard, if unanimously, judge that described mapping table page is effective; If inconsistent, judge that described mapping table page is invalid.
16. devices according to claim 12, is characterized in that, described second recycling module, also for:
Obtain No. VPN that data page is corresponding;
Search and described No. LPN corresponding No. VPN, standard according to No. LPN of described data page in the mapping table;
Judge described No. VPN whether consistent with No. VPN, described standard; If consistent, judge that described data page is effective; If inconsistent, judge that described data page is invalid.
CN201510672620.4A 2015-10-16 2015-10-16 A kind of data managing method and device Active CN105389266B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510672620.4A CN105389266B (en) 2015-10-16 2015-10-16 A kind of data managing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510672620.4A CN105389266B (en) 2015-10-16 2015-10-16 A kind of data managing method and device

Publications (2)

Publication Number Publication Date
CN105389266A true CN105389266A (en) 2016-03-09
CN105389266B CN105389266B (en) 2019-03-01

Family

ID=55421570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510672620.4A Active CN105389266B (en) 2015-10-16 2015-10-16 A kind of data managing method and device

Country Status (1)

Country Link
CN (1) CN105389266B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315648A (en) * 2017-06-29 2017-11-03 成都三零嘉微电子有限公司 A kind of method of data-moving performance during raising bad block management
CN108073522A (en) * 2016-11-10 2018-05-25 慧荣科技股份有限公司 Garbage collection method for data storage device
CN108228376A (en) * 2017-12-29 2018-06-29 北京联想核芯科技有限公司 A kind of data processing method and device of SSD hard disks
CN109542800A (en) * 2018-11-23 2019-03-29 深圳大普微电子科技有限公司 Method, solid state hard disk and the storage device of garbage disposal based on flash memory
WO2019062370A1 (en) * 2017-09-30 2019-04-04 华为技术有限公司 Method and device for garbage collection in storage system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1447243A (en) * 2002-03-25 2003-10-08 太和科技股份有限公司 Calculation method executed in quick flash memory fast and not caused abnormal power breakdown as well as its control system
CN1534509A (en) * 2003-03-27 2004-10-06 太和科技股份有限公司 Flash memory calculating method possessing quick and preventing improper operation function and its control system
CN101030167A (en) * 2007-01-17 2007-09-05 忆正存储技术(深圳)有限公司 Flash-memory zone block management
CN102945208A (en) * 2012-10-25 2013-02-27 记忆科技(深圳)有限公司 Multiuser hard disk system and implementation method thereof
US20140040577A1 (en) * 2012-08-03 2014-02-06 International Business Machines Corporation Automatic Use of Large Pages
CN104714894A (en) * 2015-03-18 2015-06-17 清华大学 Layered phase-change memory abrasion equilibrating method and system based on random mapping

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1447243A (en) * 2002-03-25 2003-10-08 太和科技股份有限公司 Calculation method executed in quick flash memory fast and not caused abnormal power breakdown as well as its control system
CN1534509A (en) * 2003-03-27 2004-10-06 太和科技股份有限公司 Flash memory calculating method possessing quick and preventing improper operation function and its control system
CN101030167A (en) * 2007-01-17 2007-09-05 忆正存储技术(深圳)有限公司 Flash-memory zone block management
US20140040577A1 (en) * 2012-08-03 2014-02-06 International Business Machines Corporation Automatic Use of Large Pages
CN102945208A (en) * 2012-10-25 2013-02-27 记忆科技(深圳)有限公司 Multiuser hard disk system and implementation method thereof
CN104714894A (en) * 2015-03-18 2015-06-17 清华大学 Layered phase-change memory abrasion equilibrating method and system based on random mapping

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108073522A (en) * 2016-11-10 2018-05-25 慧荣科技股份有限公司 Garbage collection method for data storage device
CN107315648A (en) * 2017-06-29 2017-11-03 成都三零嘉微电子有限公司 A kind of method of data-moving performance during raising bad block management
CN107315648B (en) * 2017-06-29 2020-07-03 成都三零嘉微电子有限公司 Method for improving data moving performance during bad block management
WO2019062370A1 (en) * 2017-09-30 2019-04-04 华为技术有限公司 Method and device for garbage collection in storage system
CN108228376A (en) * 2017-12-29 2018-06-29 北京联想核芯科技有限公司 A kind of data processing method and device of SSD hard disks
CN109542800A (en) * 2018-11-23 2019-03-29 深圳大普微电子科技有限公司 Method, solid state hard disk and the storage device of garbage disposal based on flash memory

Also Published As

Publication number Publication date
CN105389266B (en) 2019-03-01

Similar Documents

Publication Publication Date Title
CN110209490B (en) Memory management method and related equipment
CN105389266A (en) Data management method and apparatus
CN108287669B (en) Date storage method, device and storage medium
CN105593828A (en) Method for managing files, distributed storage system and management node
CN103995855B (en) The method and apparatus of data storage
CN104408163B (en) A kind of data classification storage and device
CN104156317A (en) Wiping and writing management method and system for non-volatile flash memory
CN110674052B (en) Memory management method, server and readable storage medium
CN105786401A (en) Data management method and device in server cluster system
CN106708968A (en) Distributed database system and data processing method in distributed database system
CN104933051B (en) File storage recovery method and device
CN106445835A (en) Memory allocation method and apparatus
CN103605728A (en) Method and system for hierarchically storing data
CN105468542A (en) Address distribution method and device
CN104714894A (en) Layered phase-change memory abrasion equilibrating method and system based on random mapping
CN104484134A (en) Method and device for allocating distributed type storage magnetic discs
CN104346404A (en) Method, equipment and system for accessing data
WO2016138839A1 (en) Bitmap-based storage space management system and method thereof
CN105550122A (en) Data processing method, storage device and electronic device
CN109039939B (en) Load sharing method and device
CN105630419A (en) Partition view sending method of resource pools and management node
CN106550006A (en) Cloud Server resource allocation methods and device
CN105760112B (en) Extend date storage method, read method and the system of memory use time
CN116662019B (en) Request distribution method and device, storage medium and electronic device
CN103605478A (en) Memory address marking and collocation method and data access method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20170208

Address after: The 100176 branch of the Beijing economic and Technological Development Zone fourteen Street No. 99 building 33 building D No. 2226

Applicant after: Beijing legend core technology Co., Ltd.

Address before: 100085 Haidian District West Road, Beijing, No. 6

Applicant before: Lenovo (Beijing) Co., Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20190808

Address after: 518067 Dongjiaotou Workshop D24/F-02, Houhai Avenue, Shekou Street, Nanshan District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Yi Lian Information System Co., Ltd.

Address before: The 100176 branch of the Beijing economic and Technological Development Zone fourteen Street No. 99 building 33 building D No. 2226

Patentee before: Beijing legend core technology Co., Ltd.

TR01 Transfer of patent right