CN105389266B - A kind of data managing method and device - Google Patents

A kind of data managing method and device Download PDF

Info

Publication number
CN105389266B
CN105389266B CN201510672620.4A CN201510672620A CN105389266B CN 105389266 B CN105389266 B CN 105389266B CN 201510672620 A CN201510672620 A CN 201510672620A CN 105389266 B CN105389266 B CN 105389266B
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.)
Active
Application number
CN201510672620.4A
Other languages
Chinese (zh)
Other versions
CN105389266A (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
Beijing Legend Core Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Legend Core Technology Co Ltd filed Critical Beijing Legend Core Technology Co 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of data managing method and devices, wherein the described method includes: mapping table is divided into M independent mapping table pages, M is positive integer;Unique virtual logical page (LPN) number is distributed for each mapping table page;Based on virtual No. LPN storage mapping table page.Using technical solution of the present invention, unified recycling and management are at least carried out to data page and mapping table convenient for Garbage Collector (GC).

Description

A kind of data managing method and device
Technical field
The present invention relates to solid state hard disk fields, and in particular to a kind of data managing method and device.
Background technique
Mapping table is not capable of fixing update to some or certain in several pieces (block), otherwise, can repeatedly it is erasable some Or certain several pieces, increase the risk of bad block.Therefore need to allow the storage of mapping table to flow in flash memory (flash) as far as possible Come.
If mapping table is divided into several independent pages, be written in flash as common data page (data page), Carry out loss equalization (WL, Wear Leveing) and Garbage Collector (GC, Garbage together with common data page Collector reclaimer operation).But since mapping table page (mapping table page) is without corresponding logical page (LPAGE) (LPN, Logical Page Number) number will cause trouble when GC recycling.
Therefore, how unified recycling and management is carried out to data page and mapping table page convenient for GC to ask as urgently to be resolved Topic.
Summary of the invention
In view of this, at least to data page and being reflected convenient for GC present invention contemplates that provide a kind of data managing method and device Firing table carries out unified recycling and management.
In order to achieve the above objectives, the technical scheme of the present invention is realized as follows:
The invention discloses a kind of data managing methods, which comprises
Mapping table is divided into M independent mapping table pages, M is positive integer;
It is unique No. LPN virtual for the distribution of each mapping table page;
Based on virtual No. LPN storage mapping table page.
In above scheme, it is preferable that described based on virtual No. LPN storage mapping table page, comprising:
Reserve the integer field of the page footing of mapping table page;
Virtual No. LPN is deposited in the integer field.
In above scheme, it is preferable that described for virtual No. LPN of each mapping table page distribution, comprising:
Obtain the first field corresponding to data page;Wherein, first field refers to that file system is reserved for data page Field;
The second field is determined based on first field;Wherein, second field is that the file system does not cover Field;
It is random or be followed successively by each mapping table page in sequence and distribute unique virtual LPN from second field Number.
In above scheme, it is preferable that the method also includes:
When being recycled to data,
No. LPN is obtained corresponding to current page;
Based on the type of described No. LPN determining current page;
When the current page is mapping table page, corresponding race's table judges the validity of mapping table page, if the mapping table Page is invalid, then is recycled to the mapping table page;
When the current page be data page when, correspondence mappings table judges the validity of data page, if the data page without Effect, then be recycled the data page.
In above scheme, it is preferable that the type based on described No. LPN determining current page, comprising:
Field type corresponding to checking described No. LPN;
If the field type is the first field, determine the type of current page for data page;
If the field type is the second field, determine the type of current page for mapping table page.
In above scheme, it is preferable that there is with virtual No. LPN for index, mapping table and physical page number record in race's table The one-to-one relationship of (VPN, Virtual Page Number);
There is with No. LPN for index, the one-to-one relationship of data page and VPN record in the mapping table.
In above scheme, it is preferable that corresponding race's table judges the validity of mapping table page, comprising:
It is No. VPN corresponding to obtain mapping table page;
It is searched and the virtual No. LPN corresponding standard VPN in race's table according to virtual No. LPN of the mapping table page Number;
Judge described No. VPN it is whether consistent with the standard VPN, if unanimously, judging that the mapping table page is effective;Such as Fruit is inconsistent, judges that the mapping table page is invalid.
In above scheme, it is preferable that the correspondence mappings table judges the validity of data page, comprising:
It is No. VPN corresponding to obtain data page;
Standard VPN corresponding with described No. LPN is searched according to the data page No. LPN in the mapping table;
Judge described No. VPN it is whether consistent with the standard VPN;If consistent, judge that the data page is effective;If It is inconsistent, judge that the data page is invalid.
The invention also discloses a kind of data administrator, described device includes:
Division unit, for mapping table to be divided into M independent mapping table pages, M is positive integer;
Allocation unit, for distributing virtual logical page LPN for each mapping table page;
Storage unit, for based on virtual No. LPN storage mapping table page.
In above scheme, it is preferable that the storage unit is also used to:
Reserved module, the integer field of the page footing for reserving mapping table page;
Storage module, for depositing in virtual No. LPN in the integer field.
In above scheme, it is preferable that the allocation unit, comprising:
First obtains module, for obtaining the first field corresponding to data page;Wherein, first field refers to file System is the field that data page is reserved;
First determining module, for determining the second field based on first field;Wherein, second field is described The field that file system does not cover;
Distribution module, for being followed successively by the distribution of each mapping table page at random or in sequence only from second field Virtual No. LPN of one.
In above scheme, it is preferable that described device further include: recovery unit, wherein the recovery unit, comprising:
Second obtains module, for obtaining corresponding to current page No. LPN;
Second determining module, for the type based on described No. LPN determining current page;
First recycling module, for when the current page is mapping table page, corresponding race's table to judge the effective of mapping table page Property, if the mapping table page is invalid, the mapping table page is recycled;
Second recycling module is used for when the current page is data page, and correspondence mappings table judges the validity of data page, If the data page is invalid, the data page is recycled.
Preferably, second determining module, is also used to: field type corresponding to checking described No. LPN;If described Field type is the first field, then determines the type of current page for data page;If the field type is the second field, sentence The type for determining current page is mapping table page.
In above scheme, it is preferable that there is with virtual No. LPN for index, mapping table and physical page number record in race's table The one-to-one relationship of VPN;
There is with No. LPN for index, the one-to-one relationship of data page and VPN record in the mapping table.
In above scheme, it is preferable that first recycling module is also used to:
It is No. VPN corresponding to obtain mapping table page;
It is searched and the virtual No. LPN corresponding standard VPN in race's table according to virtual No. LPN of the mapping table page Number;
Judge described No. VPN it is whether consistent with the standard VPN, if unanimously, judging that the mapping table page is effective;Such as Fruit is inconsistent, judges that the mapping table page is invalid.
In above scheme, it is preferable that second recycling module is also used to:
It is No. VPN corresponding to obtain data page;
Standard VPN corresponding with described No. LPN is searched according to the data page No. LPN in the mapping table;
Judge described No. VPN it is whether consistent with the standard VPN;If consistent, judge that the data page is effective;If It is inconsistent, judge that the data page is invalid.
Mapping table is divided into M independent mapping table pages, M by a kind of data managing method and device provided by the present invention For positive integer;It is unique No. LPN virtual for the distribution of each mapping table page;Based on virtual No. LPN storage mapping table Page;In this way, at least carrying out unified recycling and management to data page and mapping table page convenient for GC.
Detailed description of the invention
Fig. 1 is a kind of implementation process schematic diagram of data managing method provided in an embodiment of the present invention;
Fig. 2 is the implementation process schematic diagram of another data managing method provided in an embodiment of the present invention;
Fig. 3 is the implementation process schematic diagram of another data managing method provided in an embodiment of the present invention;
Fig. 4 (a) is mapping table page schematic diagram provided in an embodiment of the present invention, and Fig. 4 (b) provides for the embodiment of the present invention Another mapping table page schematic diagram, Fig. 4 (c) be current race's table provided in an embodiment of the present invention schematic diagram;
Fig. 5 is the implementation process schematic diagram of another data managing method provided in an embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of data administrator of the embodiment of the present invention;
Fig. 7 is the structural schematic diagram of another kind of embodiment of the present invention data administrator;
Fig. 8 is the structural schematic diagram of another data administrator of the embodiment of the present invention;
Fig. 9 is the structural schematic diagram of another data administrator of the embodiment of the present invention.
Specific embodiment
In order to more fully hereinafter understand the features of the present invention and technology contents, with reference to the accompanying drawing to reality of the invention It is now described in detail, appended attached drawing purposes of discussion only for reference, is not used to limit the present invention.
Embodiment one
Fig. 1 is a kind of implementation process schematic diagram of data managing method provided in an embodiment of the present invention, at the present invention one In preferred embodiment, as shown in Figure 1, the data managing method mainly comprises the steps that
Step 101: mapping table being divided into M independent mapping table pages, M is positive integer.
Step 102: for unique virtual logical page LPN of each mapping table page distribution.
Preferably, described to distribute virtual No. LPN for each mapping table page, may include:
Obtain the first field corresponding to data page;Wherein, first field refers to that file system is reserved for data page Field;
The second field is determined based on first field;Wherein, second field is that the file system does not cover Field;
It is random or be followed successively by each mapping table page in sequence and distribute unique virtual LPN from second field Number.
For example, second field can use complex number field.That is, virtual No. LPN can use file system For No. LPN field (such as complex number field) not covered of data page distribution.
Step 103: based on virtual No. LPN storage mapping table page.
Preferably, described based on virtual No. LPN storage mapping table page, may include:
Reserve the integer field of the page footing of mapping table page;
Virtual No. LPN is deposited in the integer field.
Data managing method described in the present embodiment is deposited due in memory map assignments, being divided into independent mapping table page Storage, and be assigned with for each mapping table page and can be different from virtual No. LPN of data page identification number (i.e. No. LPN);In this way, being convenient for It is subsequent that mapping table is managed.
Embodiment two
Fig. 2 is the implementation process schematic diagram of another data managing method provided in an embodiment of the present invention, in the present invention one In a preferred embodiment, as shown in Fig. 2, the data managing method mainly comprises the steps that
Step 201: obtaining corresponding to current page No. LPN.
It should be noted that the present embodiment be it is shown in Fig. 1 on the basis of complete.That is, will be reflected when being stored Firing table is divided into independent mapping table page, and is assigned with virtual No. LPN for each mapping table page;Meanwhile file system is also every A data page is assigned with No. LPN.
Step 202: based on the type of described No. LPN determining current page.
Preferably, the type based on described No. LPN determining current page may include:
Field type corresponding to checking described No. LPN;
If the field type is the first field, determine the type of current page for data page;
If the field type is the second field, determine the type of current page for mapping table page.
Step 203: the current page being recycled according to preset strategy.
Preferably, the current page is recycled according to preset strategy, may include:
When the current page is mapping table page, corresponding race's table judges the validity of mapping table page, if the mapping table Page is invalid, then is recycled to the mapping table page;
When the current page be data page when, correspondence mappings table judges the validity of data page, if the data page without Effect, then be recycled the data page.
Wherein, there is with virtual No. LPN for index, the one-to-one correspondence of mapping table and physical page number VPN record in race's table Relationship;
There is with No. LPN for index, the one-to-one relationship of data page and VPN record in the mapping table.
Data managing method described in the present embodiment obtains corresponding to current page No. LPN;Worked as based on the LPN determination The type of preceding page;The current page is recycled according to preset strategy;In this way, convenient for data page and mapping table page into Row unified recycling and management.
Embodiment three
Fig. 3 is the implementation process schematic diagram of another data managing method provided in an embodiment of the present invention, in the present invention one In a preferred embodiment, as shown in figure 3, the data managing method mainly comprises the steps that
Step 301: it is No. VPN corresponding to obtain mapping table page.
It should be noted that the present embodiment is that Fig. 2 has determined pair that provides under scene when current page is mapping table page The process flow of mapping table page.
Step 302: corresponding with described virtual No. LPN according to virtual No. LPN lookup of the mapping table page in race's table Standard VPN.
Wherein, there is with virtual No. LPN for index, the one-to-one relationship of mapping table and VPN record in race's table.
Step 303: judge described No. VPN it is whether consistent with the standard VPN, if unanimously, judging the mapping table Page is effectively;If inconsistent, judge that the mapping table page is invalid.
Fig. 4 (a) shows a mapping table page schematic diagram, the length storage of the integer word in the page footing of the mapping table page Virtual No. LPN is 5, and stores the VPN=10 of the mapping table page;
That is, what is stored on VPN=10 is the mapping table page that virtual No. LPN is 5, if this page was replicated, that It certainly exists another and stores the VPN of this page, for example be VPN=20, as shown in Fig. 4 (b);
Fig. 4 (c) shows the schematic diagram of current race's table (cluster table), and according to this race, table judges the mapping The validity of table, from Fig. 4 (c) as can be seen that the corresponding VPN of virtual LPN is 20 since race's table with virtual No. LPN is index, So, the corresponding mapping table page being stored on VPN=10 of Fig. 4 (a) is exactly invalid, should be recycled.
Mapping table has been divided into independent mapping table page in storage, and has been by data managing method described in the present embodiment Each mapping table page is assigned on the basis of virtual No. LPN, is given and how to be corresponded to the validity that race's table judges mapping table page.
Example IV
Fig. 5 is the implementation process schematic diagram of another data managing method provided in an embodiment of the present invention, in the present invention one In a preferred embodiment, as shown in figure 5, the data managing method mainly comprises the steps that
Step 501: it is No. VPN corresponding to obtain data page.
It should be noted that the present embodiment is that Fig. 2 has determined the logarithm that provides under scene when current page is data page According to the process flow of page.
Step 502: searching standard VPN corresponding with described No. LPN according to the data page No. LPN in the mapping table Number.
Wherein, there is with virtual No. LPN for index, the one-to-one relationship of mapping table and VPN record in race's table;
There is with No. LPN for index, the one-to-one relationship of data page and VPN record in the mapping table.
Step 503: judge described No. VPN it is whether consistent with the standard VPN;If consistent, the data page is judged Effectively;If inconsistent, judge that the data page is invalid.
With three the method for above-described embodiment, the present embodiment and embodiment three the difference is that: each data page end stores No. LPN be that only to read No. LPN mode different on the last one page for be centrally stored in each piece, still, with same Sample loading mode, which is tabled look-up, judges validity, and details are not described herein.
Mapping table has been divided into independent mapping table page in storage, and has been by data managing method described in the present embodiment Each mapping table page is assigned on the basis of virtual No. LPN, give how the validity that correspondence mappings table judges data page.
Embodiment five
The embodiment of the invention provides a kind of data administrator, Fig. 6 is a kind of data administrator of the embodiment of the present invention Structural schematic diagram, as shown in fig. 6, the data administrator includes:
Division unit 61, for mapping table to be divided into M independent mapping table pages, M is positive integer;
Allocation unit 62, for distributing virtual No. LPN for each mapping table page;
Storage unit 63, for based on virtual No. LPN storage mapping table page.
Preferably, the allocation unit 62, comprising:
First obtains module 621, for obtaining the first field corresponding to data page;Wherein, first field refers to File system is the field that data page is reserved;
First determining module 622, for determining the second field based on first field;Wherein, second field is The field that the file system does not cover;
Distribution module 623, for being followed successively by each mapping table page point at random or in sequence from second field With unique No. LPN virtual.
For example, second field can use complex number field.That is, virtual No. LPN can use file system For No. LPN field (such as complex number field) not covered of data page distribution
Preferably, the storage unit 63, comprising:
Reserved module 631, the integer field of the page footing for reserving mapping table page;
Storage module 632, for depositing in virtual No. LPN in the integer field.
It will be appreciated by those skilled in the art that in the data administrator of the present embodiment each unit function, before can refer to It states the associated description of file data management method and understands, each unit in the data administrator of the present embodiment, realization can be passed through The analog circuit of function described in the embodiment of the present invention and realize, can also pass through and execute function described in the embodiment of the present invention Operation of the software on intelligent terminal and realize.
It should be noted that the data administrator of the present embodiment can be set in terminal, and described in the embodiment of the present invention Division unit 61, the function of allocation unit 62, storage unit 63 and each unit module for being included can be by the data The central processing unit (CPU, Central Processing Unit) of managing device or the affiliated terminal of the data administrator, Microprocessor (MPU, Micro Processor Unit) or Digital Signal Processing (DSP, Digital Signal Processor) chip etc. is realized.
Using the data administrator of the present embodiment, the storage of mapping table can be made to flow in a flash memory as far as possible, and And mapping table is managed convenient for subsequent.
Embodiment six
The embodiment of the invention provides another data administrator, Fig. 7 is a kind of data management dress of the embodiment of the present invention The structural schematic diagram set, as shown in fig. 7, the data administrator includes:
Division unit 61, for mapping table to be divided into M independent mapping table pages, M is positive integer;
Allocation unit 62, for distributing virtual No. LPN for each mapping table page;
Storage unit 63, for based on virtual No. LPN storage mapping table page;
Recovery unit 64 when for being recycled to data, obtains corresponding to current page No. LPN;Based on described The type of No. LPN determining current page;When the current page is mapping table page, corresponding race's table judges the validity of mapping table page, If the mapping table page is invalid, the mapping table page is recycled;It is corresponding when the current page is data page Mapping table judges the validity of data page, if the data page is invalid, is recycled to the data page.
Wherein, there is with virtual No. LPN for index, the one-to-one correspondence of mapping table and physical page number VPN record in race's table Relationship;
There is with No. LPN for index, the one-to-one relationship of data page and VPN record in the mapping table.
Wherein, the recovery unit 64, comprising:
Second obtains module 641, for obtaining corresponding to current page No. LPN;
Second determining module 642, for the type based on described No. LPN determining current page;
First recycling module 643, for when the current page is mapping table page, corresponding race's table to judge having for mapping table page Effect property, if the mapping table page is invalid, is recycled the mapping table page;
Second recycling module 644, for when the current page is data page, correspondence mappings table to judge the effective of data page Property, if the data page is invalid, the data page is recycled.
Preferably, second determining module 642, is also used to: field type corresponding to checking described No. LPN;If The field type is the first field, then determines the type of current page for data page;If the field type is the second field, Then determine the type of current page for mapping table page.
It will be appreciated by those skilled in the art that in the data administrator of the present embodiment each unit function, before can refer to It states the associated description of file data management method and understands, each unit in the data administrator of the present embodiment, realization can be passed through The analog circuit of function described in the embodiment of the present invention and realize, can also pass through and execute function described in the embodiment of the present invention Operation of the software on intelligent terminal and realize.
It should be noted that the data administrator of the present embodiment can be set in terminal, and described in the embodiment of the present invention The function of division unit 61, allocation unit 62, storage unit 63, recovery unit 64 and each unit module for being included can CPU, MPU or dsp chip by the data administrator or the affiliated terminal of the data administrator etc. are realized.
Using the data administrator of the present embodiment, unified recycling at least is carried out to data page and mapping table page convenient for GC And management.
Embodiment seven
The embodiment of the invention provides another data administrator, Fig. 8 is another number provided in an embodiment of the present invention According to the structural schematic diagram of managing device, as shown in figure 8, the data administrator include: division unit 61, allocation unit 62, Storage unit 63, recovery unit 64;Wherein,
The division unit 61, for mapping table to be divided into M independent mapping table pages, M is positive integer;
The allocation unit 62, for distributing virtual No. LPN for each mapping table page;
The storage unit 63, for based on virtual No. LPN storage mapping table page;
The recovery unit 64, for obtaining corresponding to current page No. LPN;Based on described No. LPN determining current page Type;The current page is recycled according to preset strategy.
Preferably, the recovery unit 64, comprising:
Second obtains module 641, for obtaining corresponding to current page No. LPN;
Second determining module 642, for the type based on described No. LPN determining current page;
First recycling module 643, for when the current page is mapping table page, corresponding race's table to judge having for mapping table page Effect property, if the mapping table page is invalid, is recycled the mapping table page;
Second recycling module 644, for when the current page is data page, correspondence mappings table to judge the effective of data page Property, if the data page is invalid, the data page is recycled.
Preferably, second determining module 642, is also used to: field type corresponding to checking described No. LPN;If The field type is the first field, then determines the type of current page for data page;If the field type is the second field, Then determine the type of current page for mapping table page.
Preferably, first recycling module 643, comprising:
First acquisition submodule 6431, it is No. VPN corresponding for obtaining mapping table page;
First search submodule 6432, in race's table according to the mapping table page it is virtual No. LPN search with it is described Virtual No. LPN corresponding standard VPN;
First judging submodule 6433, it is whether consistent with the standard VPN for judging described No. VPN, if unanimously, Judge that the mapping table page is effective;If inconsistent, judge that the mapping table page is invalid.
It should be noted that the data administrator of the present embodiment can be set in terminal, and described in the embodiment of the present invention The function of division unit 61, allocation unit 62, storage unit 63, recovery unit 64 and each unit module for being included can CPU, MPU or dsp chip by the data administrator or the affiliated terminal of the data administrator etc. are realized.
Using the data administrator of the present embodiment, at least convenient for data page and mapping table page carry out unified recycling and Management, can preferably correspond to the validity that race's table judges mapping table page.
Embodiment eight
The embodiment of the invention provides another data administrator, Fig. 9 is another number provided in an embodiment of the present invention According to the structural schematic diagram of managing device, as shown in figure 9, the data administrator include: division unit 61, allocation unit 62, Storage unit 63, recovery unit 64;Wherein,
The division unit 61, for mapping table to be divided into M independent mapping table pages, M is positive integer;
The allocation unit 62, for distributing virtual No. LPN for each mapping table page;
The storage unit 63, for based on virtual No. LPN storage mapping table page;
The recovery unit 64, for obtaining corresponding to current page No. LPN;Based on described No. LPN determining current page Type;The current page is recycled according to preset strategy.
Preferably, the recovery unit 64, comprising:
Second obtains module 641, for obtaining corresponding to current page No. LPN;
Second determining module 642, for the type based on described No. LPN determining current page;
First recycling module 643, for when the current page is mapping table page, corresponding race's table to judge having for mapping table page Effect property, if the mapping table page is invalid, is recycled the mapping table page;
Second recycling module 644, for when the current page is data page, correspondence mappings table to judge the effective of data page Property, if the data page is invalid, the data page is recycled.
Preferably, second determining module 642, is also used to: field type corresponding to checking described No. LPN;If The field type is the first field, then determines the type of current page for data page;If the field type is the second field, Then determine the type of current page for mapping table page.
Preferably, second recycling module 644, comprising:
Second acquisition submodule 6441, it is No. VPN corresponding for obtaining data page;
Second searches submodule 6442, for being searched and described No. LPN according to the data page No. LPN in the mapping table Corresponding standard VPN;
Second judgment submodule 6443, for judge described No. VPN it is whether consistent with the standard VPN;If one It causes, judges that the data page is effective;If inconsistent, judge that the data page is invalid.
It will be appreciated by those skilled in the art that in the data administrator of the present embodiment each unit function, before can refer to It states the associated description of file data management method and understands, each unit in the data administrator of the present embodiment, realization can be passed through The analog circuit of function described in the embodiment of the present invention and realize, can also pass through and execute function described in the embodiment of the present invention Operation of the software on intelligent terminal and realize.
It should be noted that the data administrator of the present embodiment can be set in terminal, and described in the embodiment of the present invention The function of division unit 61, allocation unit 62, storage unit 63, recovery unit 64 and each unit module for being included can CPU, MPU or dsp chip by the data administrator or the affiliated terminal of the data administrator etc. are realized.
Using the data administrator of the present embodiment, at least convenient for data page and mapping table page carry out unified recycling and The validity that management, preferably correspondence mappings table judge data page.
In several embodiments provided by the present invention, it should be understood that disclosed method, apparatus and electronic equipment, It may be implemented in other ways.Apparatus embodiments described above are merely indicative, for example, the unit is drawn Point, only a kind of logical function partition, there may be another division manner in actual implementation, such as: multiple units or components can To combine, or it is desirably integrated into another system, or some features can be ignored or not executed.In addition, shown or discussed The mutual coupling of each component part or direct-coupling or communication connection can be through some interfaces, equipment or unit Indirect coupling or communication connection can be electrical, mechanical or other forms.
Above-mentioned unit as illustrated by the separation member, which can be or may not be, to be physically separated, aobvious as unit The component shown can be or may not be physical unit, it can and it is in one place, it may be distributed over multiple network lists In member;Some or all of units can be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
In addition, each functional unit in various embodiments of the present invention can be fully integrated in one processing unit, it can also To be each unit individually as a unit, can also be integrated in one unit with two or more units;It is above-mentioned Integrated unit both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through The relevant hardware of program instruction is completed, and program above-mentioned can be stored in a computer readable storage medium, the program When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned include: movable storage device, it is read-only Memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or The various media that can store program code such as person's CD.
If alternatively, the above-mentioned integrated unit of the embodiment of the present invention is realized in the form of software function module and as independence Product when selling or using, also can store in a computer readable storage medium.Based on this understanding, this hair Substantially the part that contributes to existing technology can body in the form of software products in other words for the technical solution of bright embodiment Reveal and, which is stored in a storage medium, including some instructions are with so that a computer is set Standby (can be personal computer, server or network equipment etc.) executes the whole of each embodiment the method for the present invention Or part.And storage medium above-mentioned includes: that movable storage device, ROM, RAM, magnetic or disk etc. are various can store journey The medium of sequence code.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (14)

1. a kind of data managing method, which comprises
Mapping table is divided into M independent mapping table pages, M is positive integer;
Obtain the first field corresponding to data page;Wherein, first field refers to that file system is the word that data page is reserved Section;
The second field is determined based on first field;Wherein, second field is the word that the file system does not cover Section;
It is random or to be followed successively by the distribution of each mapping table page in sequence unique No. LPN virtual from second field;
Based on virtual No. LPN storage mapping table page.
2. according to method described in claim l, which is characterized in that described based on virtual No. LPN storage mapping table Page, comprising:
Reserve the integer field of the page footing of mapping table page;
Virtual No. LPN is deposited in the integer field.
3. the method according to claim 1, wherein the method also includes:
When being recycled to data,
No. LPN is obtained corresponding to current page;
Based on the type of described No. LPN determining current page;
When the current page is mapping table page, corresponding race's table judges the validity of mapping table page, if the mapping table page nothing Effect, then be recycled the mapping table page;
When the current page is data page, correspondence mappings table judges the validity of data page, if the data page is invalid, The data page is recycled.
4. according to the method described in claim 3, it is characterized in that, the type based on described No. LPN determining current page, packet It includes:
Field type corresponding to checking described No. LPN;
If the field type is the first field, determine the type of current page for data page;
If the field type is the second field, determine the type of current page for mapping table page.
5. according to the method described in claim 3, it is characterized in that,
There is with virtual No. LPN for index, the one-to-one relationship of mapping table and physical page number VPN record in race's table;
There is with No. LPN for index, the one-to-one relationship of data page and VPN record in the mapping table.
6. according to the method described in claim 3, it is characterized in that, corresponding race's table judges the validity of mapping table page, packet It includes:
It is No. VPN corresponding to obtain mapping table page;
It is searched and the virtual No. LPN corresponding standard VPN in race's table according to virtual No. LPN of the mapping table page;
Judge described No. VPN it is whether consistent with the standard VPN, if unanimously, judging that the mapping table page is effective;If no Unanimously, judge that the mapping table page is invalid.
7. according to the method described in claim 3, it is characterized in that, the correspondence mappings table judges the validity of data page, packet It includes:
It is No. VPN corresponding to obtain data page;
Standard VPN corresponding with described No. LPN is searched according to the data page No. LPN in the mapping table;
Judge described No. VPN it is whether consistent with the standard VPN;If consistent, judge that the data page is effective;If different It causes, judges that the data page is invalid.
8. a kind of data administrator, which is characterized in that described device includes:
Division unit, for mapping table to be divided into M independent mapping table pages, M is positive integer;
Allocation unit, for distributing virtual logical page LPN for each mapping table page, wherein the allocation unit, comprising:
First obtains module, for obtaining the first field corresponding to data page;Wherein, first field refers to file system The field reserved for data page;
First determining module, for determining the second field based on first field;Wherein, second field is the file The field that system does not cover;
Distribution module, it is unique for being followed successively by the distribution of each mapping table page at random or in sequence from second field It is No. LPN virtual;
Storage unit, for based on virtual No. LPN storage mapping table page.
9. device according to claim 8, which is characterized in that the storage unit is also used to:
Reserved module, the integer field of the page footing for reserving mapping table page;
Storage module, for depositing in virtual No. LPN in the integer field.
10. device according to claim 8, which is characterized in that described device further includes recovery unit, and the recycling is single Member, comprising:
Second obtains module, for obtaining corresponding to current page No. LPN;
Second determining module, for the type based on described No. LPN determining current page;
First recycling module, for when the current page is mapping table page, corresponding race's table to judge the validity of mapping table page, such as Mapping table page described in fruit is invalid, then is recycled to the mapping table page;
Second recycling module is used for when the current page is data page, and correspondence mappings table judges the validity of data page, if The data page is invalid, then is recycled to the data page.
11. device according to claim 10, which is characterized in that second determining module is also used to: checking described Field type corresponding to No. LPN;If the field type is the first field, determine the type of current page for data page; If the field type is the second field, determine the type of current page for mapping table page.
12. device according to claim 10, which is characterized in that
There is with virtual No. LPN for index, the one-to-one relationship of mapping table and physical page number VPN record in race's table;
There is with No. LPN for index, the one-to-one relationship of data page and VPN record in the mapping table.
13. device according to claim 10, which is characterized in that first recycling module is also used to:
It is No. VPN corresponding to obtain mapping table page;
It is searched and the virtual No. LPN corresponding standard VPN in race's table according to virtual No. LPN of the mapping table page;
Judge described No. VPN it is whether consistent with the standard VPN, if unanimously, judging that the mapping table page is effective;If no Unanimously, judge that the mapping table page is invalid.
14. device according to claim 10, which is characterized in that second recycling module is also used to:
It is No. VPN corresponding to obtain data page;
Standard VPN corresponding with described No. LPN is searched according to the data page No. LPN in the mapping table;
Judge described No. VPN it is whether consistent with the standard VPN;If consistent, judge that the data page is effective;If different It causes, judges that the 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 CN105389266A (en) 2016-03-09
CN105389266B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI619018B (en) * 2016-11-10 2018-03-21 慧榮科技股份有限公司 Garbage collection method for data storage device
CN107315648B (en) * 2017-06-29 2020-07-03 成都三零嘉微电子有限公司 Method for improving data moving performance during bad block management
CN107608907B (en) * 2017-09-30 2020-10-23 华为技术有限公司 Method and device for recycling garbage 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

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104714894A (en) * 2015-03-18 2015-06-17 清华大学 Layered phase-change memory abrasion equilibrating method and system based on random mapping

Family Cites Families (5)

* 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
CN100504814C (en) * 2007-01-17 2009-06-24 忆正存储技术(深圳)有限公司 Flash-memory zone block management method
US8954707B2 (en) * 2012-08-03 2015-02-10 International Business Machines Corporation Automatic use of large pages
CN102945208B (en) * 2012-10-25 2016-09-14 记忆科技(深圳)有限公司 Multiuser hard disk system and its implementation

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104714894A (en) * 2015-03-18 2015-06-17 清华大学 Layered phase-change memory abrasion equilibrating method and system based on random mapping

Also Published As

Publication number Publication date
CN105389266A (en) 2016-03-09

Similar Documents

Publication Publication Date Title
CN105389266B (en) A kind of data managing method and device
US11586673B2 (en) Data writing and reading method and apparatus, and cloud storage system
CN110209490B (en) Memory management method and related equipment
CN104731896B (en) A kind of data processing method and system
CN104408163B (en) A kind of data classification storage and device
CN108304484A (en) Key word matching method and device, electronic equipment and readable storage medium storing program for executing
CN110674052B (en) Memory management method, server and readable storage medium
CN108132831A (en) The processing method and processing unit of task
CN107203330A (en) A kind of flash data location mode towards read-write data flow
CN109471725A (en) Resource allocation methods, device and server
CN106933644A (en) Data processing method and device
CN114546295A (en) Intelligent write allocation method and device based on ZNS solid state disk
CN103905310B (en) Message processing method and forwarding device
CN105630419A (en) Partition view sending method of resource pools and management node
CN106550006A (en) Cloud Server resource allocation methods and device
CN104424316A (en) Data storage method, data searching method, related device and system
CN102209016A (en) Data processing method, device and data processing system
CN104426774A (en) High-speed routing lookup method and device simultaneously supporting IPv4 and IPv6
CN109739854A (en) A kind of date storage method and device
CN106570029A (en) Data processing method and data processing system of distributed relation type database
CN104932982B (en) A kind of Compilation Method and relevant apparatus of message memory access
CN106506647A (en) A kind of client has the intelligence community cloud storage system of data backup device
CN114579506A (en) Inter-processor communication method, system, storage medium, and processor
CN104750560B (en) A kind of information processing method and electronic equipment
CN108205460A (en) The generation method and device of host available resources

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