CN106445402A - Storage unit formatting method and system - Google Patents

Storage unit formatting method and system Download PDF

Info

Publication number
CN106445402A
CN106445402A CN201510489005.XA CN201510489005A CN106445402A CN 106445402 A CN106445402 A CN 106445402A CN 201510489005 A CN201510489005 A CN 201510489005A CN 106445402 A CN106445402 A CN 106445402A
Authority
CN
China
Prior art keywords
memory block
memory
protection
memory element
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.)
Withdrawn
Application number
CN201510489005.XA
Other languages
Chinese (zh)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510489005.XA priority Critical patent/CN106445402A/en
Priority to PCT/CN2015/090164 priority patent/WO2016131259A1/en
Publication of CN106445402A publication Critical patent/CN106445402A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Storage Device Security (AREA)

Abstract

The invention provides a storage unit formatting method and system, which is applied to the field of communications. The storage unit formatting method specifically comprises the steps of setting a protective storage region in a storage unit, wherein the protective storage region is used for storing to-be-protected data; and in a process of formatting the storage unit, judging whether a current to-be-formatted storage region is the protective storage region or not, and if yes, not formatting the protective storage region. Compared with the prior art, the method and the system have the advantages that the to-be-protected data is stored in the protective storage region, and stored data in the protective storage region is not deleted in the formatting process, so that important data can be stored without virtue of an external storage unit, a user can conveniently protect the important data during formatting, the important data loss does not need to be worried, and the user experience is improved.

Description

A kind of memory element formatting method and system
Technical field
The present invention relates to the communications field is and in particular to a kind of memory element formatting method and system.
Background technology
Current memory element formats then to format all storage informations in card and deletes, for example This memory element is SD card.In the project supporting external SD card, if formatting lines will be sticked into, can be by All storage informations in card format deletes, and thus can cause the user perplex, if user's want to save Information is accomplished by user and backs up the information otherwise storing in advance losing, some losses of cause the user.
If the vital document of user need to back up in advance or unloading not only loses time to also need to by other equipment Preserve, so the formatting processing mode having needed is avoiding formatting can delete all data problems.
Content of the invention
The main technical problem to be solved in the present invention is to provide a kind of memory element formatting method and system, Solve the problems, such as that can delete all data storages during existing formatting leads to loss of vital data.
For solving the above problems, the present invention provides a kind of memory element formatting method, including:
Setting protection memory block in the memory unit, described protection memory block is used for storing data to be protected;
Described memory element is being formatted in processing procedure, is judging that memory block currently to be formatted is No for protect memory block, in this way, protect memory block not format process to described.
In an embodiment of the present invention, the described protection of setting in the memory unit memory block includes:Institute State the memory area shared by data to be protected described in memory element and described protection memory block, described protection are set Memory block at least includes the memory area shared by described data to be protected.
In an embodiment of the present invention, the described protection of setting in the memory unit memory block also includes:Will The region specified in described memory element is set to protect memory block, and treating in described memory element is protected Shield data conversion storage is to this protection memory block.
In an embodiment of the present invention, specify in described memory element one region is being set to protect Also include before memory block:Determine the storage size in the region specified, the area that described determination is specified The storage size in domain includes:
To fix the storage size of sector sum;
Or
Obtain the sector sum that described data storage to be protected occupies, with this sector sum as storage size.
In an embodiment of the present invention, described memory element has MBR mark;Described in institute The mode stating setting protection memory block in memory element includes:Master by the memory area of described protection memory block Leader record mark is revised as being different from the particular pilot record identification of this MBR mark;Described judgement Currently whether memory block to be formatted is that described protection memory block includes:Judge the guiding of current memory block Whether record identification is MBR mark, if it is not, then being described protection memory block.
For solving the above problems, the present invention also provides a kind of memory element formatting mechanism, including protection setting Module and formatting module:
Described protection setting module is used for setting protection memory block in the memory unit, and described protection memory block is used In storage data to be protected;
Described formatting processing module is used for described memory element is being formatted in processing procedure, judges Currently whether memory block to be formatted is protection memory block, in this way, protects memory block not enter row format to described Change is processed.
In an embodiment of the present invention, described protection setting module is additionally operable to institute in described memory element State the memory area shared by data to be protected and described protection memory block is set, described protection memory block at least includes Memory area shared by described data to be protected.
In an embodiment of the present invention, described protection setting module is additionally operable to described memory element middle finger A fixed region is set to protect memory block, and by the data conversion storage to be protected in described memory element to this guarantor Shield memory block.
In an embodiment of the present invention, described protection setting module is additionally operable to by described memory element Before the region specified is set to protect memory block, determine the storage size in the region specified, institute State and determine that the storage size in the region specified includes:
To fix the storage size of sector sum;
Or
Obtain the sector sum that described data storage to be protected occupies, with this sector sum as storage size.
In an embodiment of the present invention, described memory element has MBR mark;Described protection Setup module is additionally operable to be revised as being different from by the MBR mark of the memory area of described protection memory block The particular pilot record identification of this MBR mark;Described formatting processing module is current for judging The leader record of memory block identifies whether to identify for MBR, if it is not, then storing for described protection Area.
The invention has the beneficial effects as follows:
Memory element formatting method and system that the present invention provides, memory element formatting method is specially Setting protection memory block in memory element, protection memory block is used for storing data to be protected;To memory element Format in processing procedure, judge whether memory block currently to be formatted is protection memory block, in this way, Do not format process to protecting memory block.Compared with prior art, by data storage to be protected in protection In memory block, data storage in protection memory block in formatting procedure, will not be deleted, thus can will be important Data preserve, and do not need by external memory unit, be easy to user when formatting pair Significant data is protected, and without worrying loss of vital data, improves user experience.
Brief description
The memory element formatting method flow chart that Fig. 1 provides for the embodiment of the present invention one;
The memory element formatting method flow chart that Fig. 2 provides for the embodiment of the present invention two;
The memory element formatting mechanism structural representation that Fig. 3 provides for the embodiment of the present invention three.
Specific embodiment
Purpose, technical scheme and advantage for making the embodiment of the present invention are clearer, below in conjunction with the present invention Accompanying drawing in embodiment, the technical scheme in the embodiment of the present invention is clearly and completely described it is clear that Described embodiment is a part of embodiment of the present invention, rather than whole embodiments.Based in the present invention Embodiment, those of ordinary skill in the art obtained under the premise of not making creative work all its His embodiment, broadly falls into the scope of protection of the invention.
Embodiment one:
The memory element formatting method of the embodiment of the present application, as shown in figure 1, the method includes:
S101:Setting protection memory block in the memory unit, protection memory block is used for storing data to be protected;
In this step, protection memory block here is a part for this memory element, that is, from memory element Memory space in select specific memory space as protection memory block.Here memory element refers to permissible It is used for carrying out the storage medium of data storage, can be specifically portable hard drive, disk, SD card etc..Here Refer to that user is not intended to the data deleted with protection data, be for important data for user. Can be specifically file, picture, audio frequency etc..
S102:Memory element is being formatted in processing procedure, is judging memory block currently to be formatted Whether it is protection memory block, in this way, do not format process to protecting memory block.
In this step, when formatting process, the data that will not delete in protection memory block i.e. will not Protection memory block is formatted after processing that is to say, that formatting to this memory element, protection is deposited In storage area, data also can exist, and will not be purged.And for not being the memory block of protection, using existing Memory element formats processing mode, and that is, all data will be removed, and generates guidance information, initialization distribution Table, is divided into several sectors, and each sector marks off identification division ID, spacer GAP data area again DATA etc..
In above-mentioned steps S101, the setting protection specific position in memory block can be according to data to be protected Depending on position, thus can shift without to data to be protected;Specifically, in the memory unit Setting protection memory block includes:Data to be protected corresponding memory area setting protection storage in the memory unit Area;The memory area of protection memory block includes the corresponding memory area of data to be protected.Preferably, protect The memory area of memory block includes the corresponding memory area of data to be protected and includes:Will be corresponding for data to be protected Memory area is set to protect memory block.For example, certain SD card has multiple sectors, and wherein sector 1-5 stores This does not need to protect data, and sector 6-9 stores and needs to protect data;If to fix the big of 5 sectors Little for be set to protect memory block, will sector 6-11 be set to protect memory block, only can be right during format analysis processing Sector 1-5 and other data being stored with the sector of data are purged, without in the 6-11 of sector Data format, that is, the data of storage also exists in the 6-11 of sector after formatting.Certainly, if With the sector sum of this data to be protected, will sector 6-9 be set to protect memory block, during format analysis processing only Sector 1-5 and other data being stored with the sector of data can be purged, without to sector 6-9 In data format, that is, the data of storage also exists in the 6-9 of sector after formatting.
In above-mentioned steps S101, the setting protection specific position in memory block can also be a position specified, So it is easy to disk and formats in processing procedure processed, specifically, arrange in the memory unit Protection memory block also includes:Specify in memory element one region is set to protect memory block, and will store Data conversion storage to be protected in unit is to this protection memory block.Further, by specify in memory element one Region also includes before being set to protect memory block:Determine the storage size in the region specified, determine The storage size in the region specified includes:To fix the storage size of sector sum;Or obtain The sector sum that data storage to be protected occupies, with this sector sum as storage size.For example, certain SD card has 200 sectors, and wherein sector 1-100 is stored with data;And sector 6-9 stores needs Protection data;It is to be selected in the 101-200 of free sector in idle storage space, if to fix 5 fans The size in area is to be set to protect memory block, sector 101-106 will be set to protect memory block, will wait to protect Shield data transfers to sector 101-106;Only can be to sector 1-100 and other data that are stored with during format analysis processing Sector in data be purged, without formatting to the data in the 101-106 of sector, also Be format after in the 101-106 of sector the data of storage also exist.Certainly, if the fan with this data to be protected Area's sum, will sector 101-104 be set to protect memory block, only can be to sector 1-100 during format analysis processing And other data being stored with the sector of data are purged, without to the number in the 101-104 of sector According to formatting, that is, in sector 101-104 after formatting, the data of storage also exists.
Further, because for certain memory element, he has MBR mark, specifically this master Leader record mark can be MBR ID;It is construed as its each storage of certain memory element The guiding mark in area is all as MBR mark.For the ease of learning which is deposited when formatting and processing Storage area can format process, and which does not format process, and memory block here can be single fan Area can also multiple sectors composition memory area.Specifically, memory element has MBR mark; The mode of setting protection memory block includes in the memory unit:Main boot by the memory area of protection memory block Record identification is revised as being different from the particular pilot record identification of this MBR mark;Judge currently to treat lattice Whether the memory block of formula is that protection memory block includes:Judge that the leader record of current memory block identifies whether Identify for MBR, if it is not, then for protecting memory block.Identify phase for MBR Same sector formats process and removes data therein, for the sectors different from MBR mark Do not format process and retain data therein.Illustrate, certain memory element has 200 sectors, Wherein MBR is designated 1, and that is, the leader record mark of each sector is all 1, if 5-10 sector Be set to protect memory block, will 5-10 sector guiding mark be revised as 0, then formatting place During reason, judge that the guiding mark 0 of 5-10 sector is different from the main boot mark 1 of memory element, just not Process can be formatted to this subregion.
Embodiment two:
The memory element formatting method of the embodiment of the present application, the present embodiment with memory element for SD card is mainly Example illustrates, and specific region is protection memory block, as shown in figure 1, the method includes:
Step S201:Click on to contain in the file ejection option that length preserves on demand and " need to preserve simultaneously during formatting Move to specific region ";
Step S202:Acquisition need to preserve initial sector and the sector sum of file, and data compilation is assigned to one Individual specific region;
In this step, specifically store data into specific region process be this region be by directory entry Beginning cluster number points out first cluster number in allocation table for this document, and in this cluster unit, record is this The cluster number of cluster under file, the like until last cluster number of file, so by " cluster chain " The memory space of file is linked together.
Step S203:Reset the ID of this regional guidance record in the initial sector in this region;
In this step, the leader record ID of this specific region particular pilot record identification will be set to, should As long as this is interpreted as that the marks different from MBR mark can.
Step S204:MBR in MBS (Mastor Boot Sector) MBS can be read during formatting (Mastor Boot Record) MBR ID;
Step S205:Read leader record ID in the sector of specific region;
Step S206:If the leader record ID of the MBR ID and specific region that compare reading differs Cause then to format this specific region.
In this embodiment, wherein, MBS is located at 0 magnetic head, 0 cylinder 1 sector of whole storage card, Including Master Boot Record (Master Boot Record) and partition table DPT (Disk Partition Table).MBR (MBR, Master Boot Record) is in one section of guiding foremost (Loader) code.It is responsible for the differentiation of subregion legitimacy when operating system is written and read, subregion guiding letter The positioning of breath, it is produced when initializing to it by operating system.
Embodiment three:
The present embodiment provides a kind of memory element formatting mechanism 300, as shown in figure 3, including protection setting mould Block 301 and formatting module 302:Wherein, protection setting module 301 is used for setting protection in the memory unit Memory block, protection memory block is used for storing data to be protected;Format processing module 302 to be used for storage Unit formats in processing procedure, judges whether memory block currently to be formatted is protection memory block, such as It is not format process to protecting memory block.
Further, protection setting module 301 is additionally operable to the memory block shared by data to be protected in the memory unit Domain setting protection memory block, protection memory block at least includes the memory area shared by data to be protected.
Further, protection setting module 301 is additionally operable to be set to protect by specify in memory element one region Memory block, and by the data conversion storage to be protected in memory element to this protection memory block.
Further, protection setting module 301 is additionally operable to be set to protect by specify in memory element one region Before shield memory block, determine the storage size in the region specified, determine the storage in the region specified Space size includes:To fix the storage size of sector sum;Or acquisition data storage to be protected occupies Sector sum, with this sector sum as storage size.
Further, memory element has MBR mark;Protection setting module 301 is additionally operable to protect The MBR mark of the memory area of memory block is revised as being different from specific the drawing of this MBR mark Lead record identification;Format processing module 302 to be used for judging that the leader record of current memory block identifies whether Identify for MBR, if it is not, then for protecting memory block.
One of ordinary skill in the art will appreciate that all or part of step in said method can by program Lai Instruction related hardware completes, and said procedure can be stored in computer-readable recording medium, such as read-only storage Device, disk or CD etc..Alternatively, all or part of step of above-described embodiment can also using one or Multiple integrated circuits are realizing.Correspondingly, each module/unit in above-described embodiment can adopt the shape of hardware Formula is realized, it would however also be possible to employ the form of software function module is realized.The present invention is not restricted to any particular form Hardware and software combination.
Above example only in order to technical scheme to be described and unrestricted, reference only to preferred embodiment The present invention has been described in detail.It will be understood by those within the art that, can be to the present invention's Technical scheme is modified or equivalent, without deviating from the spirit and scope of technical solution of the present invention, all Should cover in the middle of scope of the presently claimed invention.

Claims (10)

1. a kind of memory element formatting method is it is characterised in that include:
Setting protection memory block in the memory unit, described protection memory block is used for storing data to be protected;
Described memory element is being formatted in processing procedure, is judging that memory block currently to be formatted is No for protect memory block, in this way, protect memory block not format process to described.
2. memory element formatting method as claimed in claim 1 is it is characterised in that described depositing In storage unit, setting protection memory block includes:The storage shared by data to be protected described in described memory element Region arranges described protection memory block, and described protection memory block at least includes depositing shared by described data to be protected Storage area domain.
3. memory element formatting method as claimed in claim 1 is it is characterised in that described depositing In storage unit, setting protection memory block also includes:The region specified in described memory element is set to protect Memory block, and by the data conversion storage to be protected in described memory element to this protection memory block.
4. memory element formatting method as claimed in claim 3 is it is characterised in that will be described The region specified in memory element also includes before being set to protect memory block:The region that determination is specified Storage size, the storage size in the region that described determination is specified includes:
To fix the storage size of sector sum;
Or
Obtain the sector sum that described data storage to be protected occupies, with this sector sum as storage size.
5. the memory element formatting method as described in any one of claim 1-5 it is characterised in that Described memory element has MBR mark;Described setting in described memory element protects memory block Mode includes:The MBR mark of the memory area of described protection memory block is revised as being different from this master The particular pilot record identification of leader record mark;Whether described judgement memory block currently to be formatted is institute State protection memory block to include:Judge that the leader record of current memory block identifies whether to identify for MBR, If it is not, then being described protection memory block.
6. a kind of memory element formatting mechanism is it is characterised in that include protection setting module and form Change module:
Described protection setting module is used for setting protection memory block in the memory unit, and described protection memory block is used In storage data to be protected;
Described formatting processing module is used for described memory element is being formatted in processing procedure, judges Currently whether memory block to be formatted is protection memory block, in this way, protects memory block not enter row format to described Change is processed.
7. memory element formatting mechanism as claimed in claim 6 is it is characterised in that described protection Setup module is additionally operable to the memory area shared by data to be protected described in described memory element and arranges described guarantor Shield memory block, described protection memory block at least includes the memory area shared by described data to be protected.
8. memory element formatting mechanism as claimed in claim 6 is it is characterised in that described protection Setup module is additionally operable to be set to protect memory block by the region specified in described memory element, and will be described Data conversion storage to be protected in memory element is to this protection memory block.
9. memory element formatting mechanism as claimed in claim 8 is it is characterised in that described protection Setup module is additionally operable to before being set to specify in described memory element one region protect memory block, really The storage size in the region surely specified, the storage size in the region that described determination is specified includes:
To fix the storage size of sector sum;
Or
Obtain the sector sum that described data storage to be protected occupies, with this sector sum as storage size.
10. the memory element formatting mechanism as described in any one of claim 6-9 it is characterised in that Described memory element has MBR mark;Described protection setting module is additionally operable to described protection storage The MBR mark of the memory area in area is revised as being different from the particular pilot note of this MBR mark Record mark;Described format processing module be used for judge current memory block leader record identify whether based on Leader record identifies, if it is not, then being described protection memory block.
CN201510489005.XA 2015-08-11 2015-08-11 Storage unit formatting method and system Withdrawn CN106445402A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510489005.XA CN106445402A (en) 2015-08-11 2015-08-11 Storage unit formatting method and system
PCT/CN2015/090164 WO2016131259A1 (en) 2015-08-11 2015-09-21 Storage unit formatting method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510489005.XA CN106445402A (en) 2015-08-11 2015-08-11 Storage unit formatting method and system

Publications (1)

Publication Number Publication Date
CN106445402A true CN106445402A (en) 2017-02-22

Family

ID=56691923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510489005.XA Withdrawn CN106445402A (en) 2015-08-11 2015-08-11 Storage unit formatting method and system

Country Status (2)

Country Link
CN (1) CN106445402A (en)
WO (1) WO2016131259A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0520202A (en) * 1991-07-12 1993-01-29 Canon Inc Ram protecting device for copying device
CN102004703A (en) * 2009-08-31 2011-04-06 比亚迪股份有限公司 Method and system for protecting data
CN201828906U (en) * 2010-08-02 2011-05-11 雅格罗技(北京)科技有限公司 Memory protection device
CN103246850A (en) * 2013-05-23 2013-08-14 福建伊时代信息科技股份有限公司 Method and device for processing file

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1904791A (en) * 2005-07-26 2007-01-31 周宏建 Hidding apparatus for computer data
US7685389B2 (en) * 2005-10-21 2010-03-23 International Business Machines Corporation Apparatus, system, and method for setting protection states of protected partitions in storage media
CN101097571B (en) * 2006-06-26 2011-01-12 凌阳科技股份有限公司 Data storage system and method for supporting file allocation table file systems
CN101349980B (en) * 2007-07-18 2010-10-06 深圳市顶星数码网络技术有限公司 Hard disk data backup and protection method
KR100888967B1 (en) * 2007-09-10 2009-03-17 엘지전자 주식회사 Method and apparatus for formatting a storage medium
CN103971719A (en) * 2013-01-31 2014-08-06 山东先行电子信息技术有限公司 Password memory protection UK disk

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0520202A (en) * 1991-07-12 1993-01-29 Canon Inc Ram protecting device for copying device
CN102004703A (en) * 2009-08-31 2011-04-06 比亚迪股份有限公司 Method and system for protecting data
CN201828906U (en) * 2010-08-02 2011-05-11 雅格罗技(北京)科技有限公司 Memory protection device
CN103246850A (en) * 2013-05-23 2013-08-14 福建伊时代信息科技股份有限公司 Method and device for processing file

Also Published As

Publication number Publication date
WO2016131259A1 (en) 2016-08-25

Similar Documents

Publication Publication Date Title
US10025792B2 (en) Method for divisionally managing files on a user basis, and a storage system and computer program product thereof
US7984231B2 (en) Information recording medium access device, and data recording method
US9830102B2 (en) Method of writing a file to a plurality of media and a storage system thereof
US8312247B2 (en) Plural-partitioned type nonvolatile storage device and system
US20060050622A1 (en) Recording medium, host device, and data processing method
US20110238901A1 (en) Information processing apparatus capable of enabling selection of user data erase method, data processing method, and storage medium
CN101582084B (en) Method and device for data storage
US10268717B2 (en) System and method for reading file blocks
US9916323B2 (en) Support for worm cartridges realized by linear tape file system (LTFS)
US9442656B2 (en) Efficient use of metadata accompanying file writing to media
CN103092849A (en) File system cluster management method
US9733859B2 (en) Method for writing file while spanning file over a plurality of tape cartridges
CN106445402A (en) Storage unit formatting method and system
CN109359488A (en) A kind of software implementation method of safe U disc
WO2009110665A1 (en) Information storage medium for recording data according to journaling file system, and method of and apparatus for writing/recovering data using journaling file system
US7006416B1 (en) Record medium with mechanism of secrecy protection
KR102094786B1 (en) File system and method of storing files based on the file system
US20140052902A1 (en) Electronic device and method of generating virtual universal serial bus flash device
CN102541957A (en) Method and device for operating data files on basis of data flow magnetic tapes
CN100405330C (en) Method and device for getting residual space for FAT file system
CN111831224B (en) Method, system and equipment for erasing residual space of exFAT partition file
KR101214784B1 (en) Multi-channel record and playback apparatus for improving record and playback velocity
US11604593B2 (en) Control apparatus that improves recording of data in a recording medium by allocating directory clusters to recording units in a more effective manner, and control method and non-transitory computer readable storage medium storing instructions thereof
CN112346823B (en) Cloud host data protection method and system
CN102117316B (en) FAT (file allocation table) file system formatting method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20170222

WW01 Invention patent application withdrawn after publication