WO2016131259A1 - 一种存储单元格式化方法和系统 - Google Patents

一种存储单元格式化方法和系统 Download PDF

Info

Publication number
WO2016131259A1
WO2016131259A1 PCT/CN2015/090164 CN2015090164W WO2016131259A1 WO 2016131259 A1 WO2016131259 A1 WO 2016131259A1 CN 2015090164 W CN2015090164 W CN 2015090164W WO 2016131259 A1 WO2016131259 A1 WO 2016131259A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage area
protected
storage
storage unit
area
Prior art date
Application number
PCT/CN2015/090164
Other languages
English (en)
French (fr)
Inventor
司路路
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016131259A1 publication Critical patent/WO2016131259A1/zh

Links

Images

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

Definitions

  • Embodiments of the present invention relate to, but are not limited to, the field of communications, and in particular, to a storage unit formatting method and system.
  • formatting the storage unit deletes all the storage information in the card, for example, the storage unit is an SD card.
  • the storage unit is an SD card.
  • all the storage information in the card will be formatted and deleted, which will cause trouble to the user. If the user wants to save the information, the user needs to back up in advance or store it. Information will be lost, causing some damage to the user.
  • Embodiments of the present invention provide a storage unit formatting method and system, which solves the problem that all stored data is deleted during formatting in the related art, resulting in loss of important data.
  • An embodiment of the present invention provides a storage unit formatting method, including:
  • the storage area to be formatted is a protected storage area, and if so, the protected storage area is not formatted.
  • the setting the protection storage area in the storage unit includes: setting, in the storage unit, the storage area occupied by the data to be protected, the protection storage area, where the protection storage area includes at least The storage area occupied by the protected data is described.
  • the setting the protection storage area in the storage unit comprises: setting an area specified in the storage unit as a protection storage area, and transferring the data to be protected in the storage unit to the protection Storage area.
  • the method before setting an area specified in the storage unit as a protection storage area, the method further includes: determining a storage space size of the specified area, where determining the storage space size of the specified area includes :
  • the total number of fixed sectors is the size of the storage space.
  • the manner of setting the protection storage region in the storage unit includes: modifying a primary boot record identifier of the storage region of the protected storage region to be different from a specific boot record identifier of the master boot record identifier of the storage unit; determining whether the current storage area to be formatted is the protected storage area includes: determining whether the boot record identifier of the current storage area is a master boot record identifier, If not, then the protected storage area.
  • the embodiment of the invention further provides a storage unit formatting device, including a protection setting module and a formatting module:
  • the protection setting module is configured to set a protection storage area in the storage unit, where the protection storage area is used to store data to be protected;
  • the formatting processing module is configured to determine whether the storage area to be formatted is a protected storage area during the formatting process of the storage unit, and if not, perform formatting processing on the protected storage area.
  • the protection setting module is configured to set, in the storage unit, a storage area occupied by the data to be protected, where the protection storage area includes at least the data to be protected The storage area occupied.
  • the protection setting module is configured to set an area specified in the storage unit as a protection storage area, and dump the data to be protected in the storage unit to the protection storage area.
  • the protection setting module is further configured to determine a storage space size of the specified area before setting an area specified in the storage unit to protect the storage area, where the storage space of the specified area is determined. Size includes:
  • the total number of fixed sectors is the size of the storage space.
  • the storage unit has a master boot record identifier
  • the protection setting module is further configured to modify a master boot record identifier of the storage area of the protected storage area to be different from a master boot record of the storage unit
  • the formatting processing module is configured to determine whether the boot record identifier of the current storage area is a primary boot record identifier, and if not, the protected storage area.
  • the embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
  • the storage unit formatting method includes: setting a protection storage area in the storage unit, the protection storage area is configured to store data to be protected; in the process of formatting the storage unit, It is determined whether the storage area to be formatted is a protected storage area, and if so, the protected storage area is not formatted.
  • the data to be protected is stored in the protection storage area, and the data stored in the protection storage area is not deleted during the formatting process, so that important data can be saved without using an external storage unit. Users protect important data while formatting, without worrying about important data loss and improving user experience.
  • FIG. 1 is a flowchart of a method for formatting a storage unit according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a method for formatting a storage unit according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic structural diagram of a storage unit formatting apparatus according to Embodiment 3 of the present invention.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • the storage unit formatting method of this embodiment is as shown in FIG. 1 , and the method includes:
  • S101 Set a protection storage area in the storage unit, where the protection storage area is used to store data to be protected;
  • the protected storage area here is a part of the storage unit, that is, a specific storage space is selected from the storage space in the storage unit as a protected storage area.
  • the storage unit here refers to a storage medium that can be used for data storage, and can be a mobile hard disk, a magnetic disk, an SD card, or the like.
  • the data to be protected here refers to data that the user does not want to delete, that is, data that is important to the user. Can be files, pictures, audio, etc.
  • S102 In the process of formatting the storage unit, determining whether the storage area to be formatted is a protected storage area, and if so, not formatting the protected storage area.
  • the data in the protected storage area is not deleted, and the protected storage area is not formatted, that is, the data in the storage area is protected after formatting the storage unit. It will still exist and will not be cleared.
  • a storage unit formatting method of the related art is adopted, that is, all data will be cleared, boot information is generated, an allocation table is initialized, and divided into a plurality of sectors, and each sector is further divided. The part ID, the interval GAP, the data area DATA, and the like are identified.
  • the location of the protection storage area may be determined according to the location of the data to be protected, so that the data to be protected may not be transferred; for example, setting the protection storage area in the storage unit includes: in the storage unit The storage area corresponding to the data to be protected is set to a protection storage area; the storage area of the protection storage area includes a storage area corresponding to the data to be protected.
  • the storage area of the protection storage area, including the storage area corresponding to the data to be protected includes: setting the storage area corresponding to the data to be protected as the protection storage area.
  • the location of the protection storage area may also be a specified location, so that the disk is processed during the formatting process, that is, the protection storage is set in the storage unit.
  • the storage area further includes: setting an area specified in the storage unit as a protection storage area, and transferring the data to be protected in the storage unit to the protection storage area.
  • the method before setting an area specified in the storage unit to protect the storage area, the method further includes: determining a storage space size of the specified area, and determining a storage space size of the specified area, including: storing the total number of fixed sectors. The size of the space; or the total number of sectors occupied by the data storage to be protected, and the total number of sectors is the storage space.
  • an SD card has multiple sectors, where the sectors 1-5 store this does not require protection data, while the sectors 6-9 store the data that needs to be protected; if the fixed 5 sectors are set to protect the storage area , that is, the sector 6-11 is set as the protection storage area, and only the data in the sector 1-5 and other sectors in which the data is stored are cleared in the format processing, and the data in the sector 6-11 is not Formatting, that is, the data stored in sector 6-11 after formatting is still in progress.
  • the total number of sectors of the data to be protected that is, the sector 6-9 is set as the protected storage area, only the data in the sector 1-5 and other sectors in which the data is stored are cleared during the format processing.
  • the data in sectors 6-9 is not formatted, that is, the data stored in sectors 6-9 is still formatted.
  • an SD card has 200 sectors, wherein the sectors 1-100 all store data; and the sectors 6-9 store data that needs to be protected; in the free storage space, that is, the free sectors 101-200, If the size of the fixed 5 sectors is set as the protected storage area, that is, the sectors 101-106 are set as the protected storage area, the data to be protected is transferred to the sectors 101-106; the format processing is only for the sector 1-100. And the data in other sectors in which the data is stored is cleared without formatting the data in sectors 101-106, that is, the data stored in sectors 101-106 after formatting is still present.
  • the data to be protected is transferred to the sectors 101-104, and the format processing is only for the sectors 1-100 and others.
  • the data in the sector in which the data is stored is cleared without formatting the data in sectors 101-104, that is, the data stored in sectors 101-104 after formatting is still present.
  • the master boot record identifier may be a master boot record ID; it should be understood that for a storage unit, the boot identifier of each storage area is The master boot record identifier is the same.
  • the memory area herein may be a single sector or a plurality of sectors.
  • the manner of setting the protection storage area in the storage unit includes: modifying the primary boot record identifier of the storage area of the protected storage area into a zone a specific boot record identifier that is different from the primary boot record identifier of the storage unit; determining whether the current storage area to be formatted is a protected storage area includes: determining whether the boot record identifier of the current storage area is a primary boot record identifier, if not , to protect the storage area. That is, the same processing as the main boot record identifier is performed to erase the data therein, and the sector different from the main boot record identifier is not formatted to retain the data therein.
  • a storage unit has 200 sectors, wherein the primary boot record identifier is 1, that is, the boot record identifier of each sector is 1, and if 5-10 sectors are set as the protection storage area, 5-10 is to be If the boot record identifier of the sector is modified to 0, then in the process of formatting, it is judged that the boot record identifier 0 of the 5-10 sector is different from the master boot record identifier 1 of the storage unit, and the partial region is not formatted. Processing.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the storage unit is an SD card as an example, and the specific area is a protected storage area.
  • the storage unit formatting method includes:
  • Step S201 Clicking the long press to save the file pop-up option includes "Save and move to a specific area when formatting";
  • Step S202 obtaining the starting sector and the total number of sectors of the file to be saved, and distributing the data to a specific area;
  • the specific area is the first cluster number in the allocation table indicating the file (to be protected data) by the starting cluster number of the directory entry, and in the cluster number unit, the cluster number of the next cluster of the file is recorded.
  • the analogy is followed by the last cluster number of the file, thus connecting the storage spaces of the files together by the "cluster number chain”.
  • Step S203 reset the ID of the area boot record in the start sector of the specific area
  • the boot record ID of the specific area is set to a specific boot record identifier, which should be understood as long as the identifier different from the master boot record identifier is acceptable.
  • Step S204 The MBR (Mastor Boot Record) main boot record ID in the main boot sector of the MBS (Mastor Boot Sector) is read during formatting;
  • Step S205 Read the boot record ID in the sector of the specific area
  • Step S206 If the read master boot record ID is compared with the boot record ID of the specific area, Consistent will not format this particular area.
  • the main boot sector is located in the 0 head 0 sector 1 of the entire memory card, and includes a master boot record (MBR) and a partition table DPT (Disk Partition Table).
  • MRR master boot record
  • DPT disk Partition Table
  • the Master Boot Record (MBR) is a piece of Booter code at the forefront. It is responsible for the discrimination of partition legality when the operating system reads and writes, and the location of the partition boot information, which is generated by the operating system when it is initialized.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • the embodiment provides a storage unit formatting device 300, as shown in FIG. 3, including a protection setting module 301 and a formatting module 302:
  • the protection setting module 301 is configured to set a protection storage area in the storage unit, and the protection storage area is configured to store data to be protected;
  • the formatting processing module 302 is configured to determine whether the storage area to be formatted is a protected storage area during the formatting process of the storage unit, and if not, to format the protected storage area.
  • the protection setting module 301 is configured to set a storage area occupied by the data to be protected in the storage unit, and the protection storage area includes at least a storage area occupied by the data to be protected.
  • the protection setting module 301 is configured to set an area specified in the storage unit as a protection storage area, and dump the data to be protected in the storage unit to the protection storage area.
  • the protection setting module 301 is further configured to: before setting an area specified in the storage unit to protect the storage area, determine a storage space size of the specified area, and determine a storage space size of the specified area, including: The total number of sectors is the storage space size; or the total number of sectors occupied by the data storage to be protected is obtained, and the total number of sectors is the storage space size.
  • the storage unit has a master boot record identifier; the protection setting module 301 is further configured to modify the master boot record identifier of the storage area of the protected storage area to a specific boot record identifier different from the master boot record identifier of the storage unit;
  • the formatting processing module 302 is configured to determine whether the boot record identifier of the current storage area is the primary boot record identifier, and if not, protect the storage area.
  • the above program may be stored in a computer readable storage medium such as a read only memory, a magnetic disk or an optical disk.
  • a computer readable storage medium such as a read only memory, a magnetic disk or an optical disk.
  • all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits.
  • each module/unit in the foregoing embodiment may be implemented in the form of hardware or in the form of a software function module. Embodiments of the invention are not limited to any specific form of combination of hardware and software.
  • the data to be protected is stored in the protection storage area, and the data stored in the protection storage area is not deleted during the formatting process, so that important data can be saved, and the external storage unit is not needed, so that the user can Protect important data while formatting, without worrying about important data loss and improving user experience.

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

一种存储单元格式化方法和装置。所述存储单元格式化方法包括在存储单元中设置保护存储区,保护存储区用于存储保护数据(S101);在对存储单元进行格式化处理过程中,判断当前待格式化的存储区是否为保护存储区,如是,对保护存储区不进行格式化处理(S102)。

Description

一种存储单元格式化方法和系统 技术领域
本发明实施例涉及但不限于通信领域,尤其涉及一种存储单元格式化方法和系统。
背景技术
相关技术中存储单元进行格式化会将卡内的所有存储信息格式化删除,例如该存储单元为SD卡。在支持外置SD卡的项目中,如果将卡进行格式化则会将卡内的所有存储信息格式化删除,这样就会给用户造成困扰,如果用户想保存信息就需要用户提前备份否则存储的信息会丢失,给用户造成一些损失。
如果用户的重要文件需提前备份或转存不仅浪费时间还需要借助其他设备保存,所以需要好的格式化处理方式来避免格式化会删除所有数据问题。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本发明实施例提供一种存储单元格式化方法和系统,解决相关技术中格式化时会删除所有存储数据导致重要数据丢失的问题。
本发明实施例提供一种存储单元格式化方法,包括:
在存储单元中设置保护存储区,所述保护存储区用于存储待保护数据;
在对所述存储单元进行格式化处理过程中,判断当前待格式化的存储区是否为保护存储区,如是,对所述保护存储区不进行格式化处理。
可选地,其中,所述在存储单元中设置保护存储区包括:在所述存储单元中将所述待保护数据所占的存储区域设置所述保护存储区,所述保护存储区至少包括所述待保护数据所占的存储区域。
可选地,其中,所述在存储单元中设置保护存储区包括:将所述存储单元中指定的一区域设置为保护存储区,并将所述存储单元中的待保护数据转存至该保护存储区。
可选地,在将所述存储单元中指定的一区域设置为保护存储区之前,所述方法还包括:确定指定的一区域的存储空间大小,所述确定指定的一区域的存储空间大小包括:
以固定扇区总数为存储空间大小;或
获取所述待保护数据存储占据的扇区总数,以该扇区总数为存储空间大小。
可选地,其中,所述存储单元具有主引导记录标识;所述在所述存储单元中设置保护存储区的方式包括:将所述保护存储区的存储区域的主引导记录标识修改为区别于所述存储单元的主引导记录标识的特定引导记录标识;所述判断当前待格式化的存储区是否为所述保护存储区包括:判断当前的存储区的引导记录标识是否为主引导记录标识,如果不是,则为所述保护存储区。
本发明实施例还提供一种存储单元格式化装置,包括保护设置模块和格式化模块:
所述保护设置模块,设置为在存储单元中设置保护存储区,所述保护存储区用于存储待保护数据;
所述格式化处理模块,设置为在对所述存储单元进行格式化处理过程中,判断当前待格式化的存储区是否为保护存储区,如是,对所述保护存储区不进行格式化处理。
可选地,其中,所述保护设置模块是设置为在所述存储单元中将所述待保护数据所占的存储区域设置所述保护存储区,所述保护存储区至少包括所述待保护数据所占的存储区域。
可选地,其中,所述保护设置模块是设置为将所述存储单元中指定的一区域设置为保护存储区,并将所述存储单元中的待保护数据转存至该保护存储区。
可选地,所述保护设置模块还设置为在将所述存储单元中指定的一区域设置为保护存储区之前,确定指定的一区域的存储空间大小,所述确定指定的一区域的存储空间大小包括:
以固定扇区总数为存储空间大小;或
获取所述待保护数据存储占据的扇区总数,以该扇区总数为存储空间大小。
可选地,其中,所述存储单元具有主引导记录标识;所述保护设置模块还设置为将所述保护存储区的存储区域的主引导记录标识修改为区别于所述存储单元的主引导记录标识的特定引导记录标识;所述格式化处理模块是设置为判断当前的存储区的引导记录标识是否为主引导记录标识,如果不是,则为所述保护存储区。
本发明实施例还提供一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上述方法。
本发明实施例提供的存储单元格式化方法和系统,存储单元格式化方法包括在存储单元中设置保护存储区,保护存储区用于存储待保护数据;在对存储单元进行格式化处理过程中,判断当前待格式化的存储区是否为保护存储区,如是,对保护存储区不进行格式化处理。与相关技术相比,将待保护数据存储在保护存储区中,格式化过程中不会删除保护存储区中存储数据,这样就可以将重要的数据保存下来,并且不需要借助外部存储单元,便于用户在进行格式化时对重要数据进行保护,不用担心重要数据丢失,提高用户体验度。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1为本发明实施例一提供的存储单元格式化方法流程图;
图2为本发明实施例二提供的存储单元格式化方法流程图;
图3为本发明实施例三提供的存储单元格式化装置结构示意图。
本发明的实施方式
下面将结合附图对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。
实施例一:
本实施例的存储单元格式化方法,如图1所示,该方法包括:
S101:在存储单元中设置保护存储区,保护存储区用于存储待保护数据;
在该步骤中,这里的保护存储区为该存储单元的一部分,即从存储单元中的存储空间中选择特定的存储空间作为保护存储区。这里的存储单元是指可以用来进行数据存储的存储介质,可以是移动硬盘,磁盘,SD卡等。这里的待保护数据是指用户不希望删除的数据,也即对于用户来说比较重要的数据。可以是文件,图片,音频等。
S102:在对存储单元进行格式化处理过程中,判断当前待格式化的存储区是否为保护存储区,如是,对保护存储区不进行格式化处理。
在该步骤中,在进行格式化处理时,不会删除保护存储区中的数据即不会对保护存储区进行格式化处理,也就是说对该存储单元进行格式化后,保护存储区中数据还会存在,不会进行清除。而对于不是保护存储区的存储区,采用相关技术的存储单元格式化处理方式,即所有数据将会清除,生成引导信息,初始化分配表,划分为多个扇区,每个扇区又划分出标识部分ID、间隔区GAP和数据区DATA等。
在上述步骤S101中,设置保护存储区的位置可以是根据待保护数据的位置而定的,这样就可以不用对待保护数据进行转移;例如,在存储单元中设置保护存储区包括:在存储单元中将待保护数据对应的存储区域设置保护存储区;保护存储区的存储区域包括待保护的数据对应的存储区域。可选的,保护存储区的存储区域包括待保护数据对应的存储区域包括:将待保护数据对应的存储区域设置为保护存储区。
在上述步骤S101中,设置保护存储区的位置还可以是一个指定的位置,这样便于磁盘进行格式化处理过程中进行处理,即在存储单元中设置保护存 储区还包括:将存储单元中指定的一区域设置为保护存储区,并将存储单元中的待保护数据转存至该保护存储区。可选地,在将存储单元中指定的一区域设置为保护存储区之前还包括:确定指定的一区域的存储空间大小,确定指定的一区域的存储空间大小包括:以固定扇区总数为存储空间大小;或获取待保护数据存储占据的扇区总数,以该扇区总数为存储空间大小。
例如,一个SD卡有多个扇区,其中扇区1-5存储这不需要保护数据,而扇区6-9存储着需要保护数据;如果以固定5扇区的大小为设置为保护存储区,即将扇区6-11设置为保护存储区,格式处理时只会对扇区1-5以及其他存储有数据的扇区中的数据进行清除,而不会对扇区6-11中的数据进行格式化,也就是格式化后扇区6-11中存储的数据还在。当然,如果以该待保护数据的扇区总数,即将扇区6-9设置为保护存储区,格式处理时只会对扇区1-5以及其他存储有数据的扇区中的数据进行清除,而不会对扇区6-9中的数据进行格式化,也就是格式化后扇区6-9中存储的数据还在。
再例如,一个SD卡有200个扇区,其中扇区1-100都存储有数据;并且扇区6-9存储着需要保护数据;在空闲存储空间即空闲扇区101-200中进行选择,如果以固定5扇区的大小为设置为保护存储区,即将扇区101-106设置为保护存储区,将待保护数据转移到扇区101-106;格式处理时只会对扇区1-100以及其他存储有数据的扇区中的数据进行清除,而不会对扇区101-106中的数据进行格式化,也就是格式化后扇区101-106中存储的数据还在。当然,如果以该待保护数据的扇区总数,即将扇区101-104设置为保护存储区,将待保护数据转移到扇区101-104,格式处理时只会对扇区1-100以及其他存储有数据的扇区中的数据进行清除,而不会对扇区101-104中的数据进行格式化,也就是格式化后扇区101-104中存储的数据还在。
可选地,由于对于一个存储单元来说,其具有主引导记录标识,其中该主引导记录标识可以是主引导记录ID;应该理解为对于一个存储单元,其每个存储区的引导标识都与主引导记录标识一样。为了便于在格式化处理时得知哪些存储区会进行格式化处理,哪些不进行格式化处理,这里的存储区可以是单个扇区也可以多个扇区组成的存储区域。其中,在存储单元中设置保护存储区的方式包括:将保护存储区的存储区域的主引导记录标识修改为区 别于所述存储单元的主引导记录标识的特定引导记录标识;判断当前待格式化的存储区是否为保护存储区包括:判断当前的存储区的引导记录标识是否为主引导记录标识,如果不是,则为保护存储区。即对于与主引导记录标识相同的扇区进行格式化处理清除其中的数据,对于与主引导记录标识不同的扇区不进行格式化处理保留其中的数据。举例说明,一个存储单元具有200个扇区,其中主引导记录标识为1,即每个扇区的引导记录标识都为1,如果把5-10扇区设置为保护存储区,即将5-10扇区的引导记录标识修改为0,那么在进行格式化处理过程中,判断5-10扇区的引导记录标识0与存储单元的主引导记录标识1不同,就不会对这部分区域进行格式化处理。
实施例二:
本实施例主要以存储单元为SD卡为例进行说明,并且特定区域为保护存储区,如图1所示,该存储单元格式化方法包括:
步骤S201:点击长按需要保存的文件弹出选项中含有“格式化时需保存并移至特定区域”;
步骤S202:获得需保存文件的起始扇区和扇区总数,将数据整理分配到一个特定区域;
该特定区域是由目录项的起始簇号指出该文件(待保护数据)在分配表中的第一个簇号,在这个簇号单元里,记载的是该文件下一簇的簇号,依次类推直至文件的最后一个簇号,这样通过“簇号链”将文件的存贮空间连接在一起。
步骤S203:在该特定区域的起始扇区重设该区域引导记录的ID;
在该步骤中,即将该特定区域的引导记录ID设置为特定引导记录标识,应该理解为只要与主引导记录标识不同的标识都可以。
步骤S204:格式化时会读取MBS(Mastor Boot Sector)主引导扇区中MBR(Mastor Boot Record)主引导记录ID;
步骤S205:读取特定区域扇区中引导记录ID;
步骤S206:如果比较读取的主引导记录ID与特定区域的引导记录ID不 一致则不会格式化该特定区域。
在该实施例中,其中,主引导扇区位于整个存储卡的0磁头0柱面1扇区,包括主引导记录MBR(Master Boot Record)和分区表DPT(Disk Partition Table)。主引导记录(MBR,Master Boot Record)是位于最前边的一段引导(Loader)代码。它负责操作系统进行读写时分区合法性的判别、分区引导信息的定位,它由操作系统在对其进行初始化时产生的。
实施例三:
本实施例提供一种存储单元格式化装置300,如图3所示,包括保护设置模块301和格式化模块302:其中,
保护设置模块301,设置为在存储单元中设置保护存储区,保护存储区用于存储待保护数据;
格式化处理模块302,设置为在对存储单元进行格式化处理过程中,判断当前待格式化的存储区是否为保护存储区,如是,对保护存储区不进行格式化处理。
可选地,保护设置模块301是设置为在存储单元中将待保护数据所占的存储区域设置保护存储区,保护存储区至少包括待保护数据所占的存储区域。
可选地,保护设置模块301是设置为将存储单元中指定的一区域设置为保护存储区,并将存储单元中的待保护数据转存至该保护存储区。
可选地,保护设置模块301还设置为在将存储单元中指定的一区域设置为保护存储区之前,确定指定的一区域的存储空间大小,确定指定的一区域的存储空间大小包括:以固定扇区总数为存储空间大小;或获取待保护数据存储占据的扇区总数,以该扇区总数为存储空间大小。
可选地,存储单元具有主引导记录标识;保护设置模块301还设置为将保护存储区的存储区域的主引导记录标识修改为区别于所述存储单元的主引导记录标识的特定引导记录标识;格式化处理模块302是设置为判断当前的存储区的引导记录标识是否为主引导记录标识,如果不是,则为保护存储区。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成,上述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本发明实施例不限制于任何特定形式的硬件和软件的结合。
工业实用性
本发明实施例将待保护数据存储在保护存储区中,格式化过程中不会删除保护存储区中存储数据,这样就可以将重要的数据保存下来,并且不需要借助外部存储单元,便于用户在进行格式化时对重要数据进行保护,不用担心重要数据丢失,提高用户体验度。

Claims (11)

  1. 一种存储单元格式化方法,包括:
    在存储单元中设置保护存储区,所述保护存储区用于存储待保护数据;
    在对所述存储单元进行格式化处理过程中,判断当前待格式化的存储区是否为保护存储区,如是,对所述保护存储区不进行格式化处理。
  2. 如权利要求1所述的存储单元格式化方法,其中,所述在存储单元中设置保护存储区包括:在所述存储单元中将所述待保护数据所占的存储区域设置所述保护存储区,所述保护存储区至少包括所述待保护数据所占的存储区域。
  3. 如权利要求1所述的存储单元格式化方法,其中,所述在存储单元中设置保护存储区包括:将所述存储单元中指定的一区域设置为保护存储区,并将所述存储单元中的待保护数据转存至该保护存储区。
  4. 如权利要求3所述的存储单元格式化方法,在将所述存储单元中指定的一区域设置为保护存储区之前,所述方法还包括:确定指定的一区域的存储空间大小,所述确定指定的一区域的存储空间大小包括:
    以固定扇区总数为存储空间大小;或
    获取所述待保护数据存储占据的扇区总数,以该扇区总数为存储空间大小。
  5. 如权利要求1-4任一项所述的存储单元格式化方法,其中,
    所述存储单元具有主引导记录标识;
    所述在所述存储单元中设置保护存储区的方式包括:将所述保护存储区的存储区域的主引导记录标识修改为区别于所述存储单元的主引导记录标识的特定引导记录标识;
    所述判断当前待格式化的存储区是否为所述保护存储区包括:判断当前的存储区的引导记录标识是否为主引导记录标识,如果不是,则为所述保护存储区。
  6. 一种存储单元格式化装置,包括保护设置模块和格式化模块:
    所述保护设置模块,设置为在存储单元中设置保护存储区,所述保护存储区用于存储待保护数据;
    所述格式化处理模块,设置为在对所述存储单元进行格式化处理过程中,判断当前待格式化的存储区是否为保护存储区,如是,对所述保护存储区不进行格式化处理。
  7. 如权利要求6所述的存储单元格式化装置,其中,所述保护设置模块是设置为在所述存储单元中将所述待保护数据所占的存储区域设置所述保护存储区,所述保护存储区至少包括所述待保护数据所占的存储区域。
  8. 如权利要求6所述的存储单元格式化装置,其中,所述保护设置模块是设置为将所述存储单元中指定的一区域设置为保护存储区,并将所述存储单元中的待保护数据转存至该保护存储区。
  9. 如权利要求8所述的存储单元格式化装置,其中,所述保护设置模块还设置为在将所述存储单元中指定的一区域设置为保护存储区之前,确定指定的一区域的存储空间大小,所述确定指定的一区域的存储空间大小包括:
    以固定扇区总数为存储空间大小;或
    获取所述待保护数据存储占据的扇区总数,以该扇区总数为存储空间大小。
  10. 如权利要求6-9任一项所述的存储单元格式化装置,其中,
    所述存储单元具有主引导记录标识;
    所述保护设置模块还设置为将所述保护存储区的存储区域的主引导记录标识修改为区别于所述存储单元的主引导记录标识的特定引导记录标识;
    所述格式化处理模块是设置为判断当前的存储区的引导记录标识是否为主引导记录标识,如果不是,则为所述保护存储区。
  11. 一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现权利要求1-5任一项所述的方法。
PCT/CN2015/090164 2015-08-11 2015-09-21 一种存储单元格式化方法和系统 WO2016131259A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510489005.X 2015-08-11
CN201510489005.XA CN106445402A (zh) 2015-08-11 2015-08-11 一种存储单元格式化方法和系统

Publications (1)

Publication Number Publication Date
WO2016131259A1 true WO2016131259A1 (zh) 2016-08-25

Family

ID=56691923

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/090164 WO2016131259A1 (zh) 2015-08-11 2015-09-21 一种存储单元格式化方法和系统

Country Status (2)

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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1904791A (zh) * 2005-07-26 2007-01-31 周宏建 计算机数据之隐藏装置
CN1953087A (zh) * 2005-10-21 2007-04-25 国际商业机器公司 存储媒体中设置受保护分区保护状态的装置、系统及方法
CN101097571A (zh) * 2006-06-26 2008-01-02 凌阳科技股份有限公司 一种支持文件分配表文件系统的数据存储系统及方法
CN101349980A (zh) * 2007-07-18 2009-01-21 深圳市顶星数码网络技术有限公司 硬盘资料备份与保护方法
US20090070537A1 (en) * 2007-09-10 2009-03-12 Cho Chung Hee Method and apparatus for formatting storage medium
CN103971719A (zh) * 2013-01-31 2014-08-06 山东先行电子信息技术有限公司 密码记忆保护uk盘

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0520202A (ja) * 1991-07-12 1993-01-29 Canon Inc 複写装置のram保護装置
CN102004703A (zh) * 2009-08-31 2011-04-06 比亚迪股份有限公司 保护数据的方法及其系统
CN201828906U (zh) * 2010-08-02 2011-05-11 雅格罗技(北京)科技有限公司 存储器保护装置
CN103246850A (zh) * 2013-05-23 2013-08-14 福建伊时代信息科技股份有限公司 文件处理方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1904791A (zh) * 2005-07-26 2007-01-31 周宏建 计算机数据之隐藏装置
CN1953087A (zh) * 2005-10-21 2007-04-25 国际商业机器公司 存储媒体中设置受保护分区保护状态的装置、系统及方法
CN101097571A (zh) * 2006-06-26 2008-01-02 凌阳科技股份有限公司 一种支持文件分配表文件系统的数据存储系统及方法
CN101349980A (zh) * 2007-07-18 2009-01-21 深圳市顶星数码网络技术有限公司 硬盘资料备份与保护方法
US20090070537A1 (en) * 2007-09-10 2009-03-12 Cho Chung Hee Method and apparatus for formatting storage medium
CN103971719A (zh) * 2013-01-31 2014-08-06 山东先行电子信息技术有限公司 密码记忆保护uk盘

Also Published As

Publication number Publication date
CN106445402A (zh) 2017-02-22

Similar Documents

Publication Publication Date Title
JP5055853B2 (ja) ファイル管理装置及び電子機器
WO2012149728A1 (zh) 一种数据删除方法及装置
US20120101996A1 (en) Apparatus and method for snapshot image segmentation
WO2018006587A1 (zh) 一种文件存储方法、终端及存储介质
WO2018040802A1 (zh) 一种全镜像文件的生成方法及装置、计算机存储介质
JP5729479B2 (ja) 仮想テープ装置及び仮想テープ装置の制御方法
US8595426B2 (en) Handling commands within a write-once read-many storage device configuration
KR100797122B1 (ko) 휴대 단말기의 이동식 저장 매체를 이용한 파일 처리 장치및 방법
US11176089B2 (en) Systems and methods for implementing dynamic file systems
CN104156175A (zh) 一种虚拟磁盘容量平滑拓展方法
WO2016131259A1 (zh) 一种存储单元格式化方法和系统
US10318204B2 (en) Information processing device and information processing method for writing plurality of files on recording medium
JP5304154B2 (ja) ドライブ装置、マウントプログラムおよびマウント方法
JP2007140628A (ja) 情報処理装置、撮像装置、および情報処理方法、並びにコンピュータ・プログラム
JP2008234268A (ja) 情報処理装置及び情報処理方法並びにプログラム
CN102591806A (zh) 防止文件的删除的电子装置和方法
CN110795389A (zh) 基于存储快照的拷贝方法、用户设备、存储介质及装置
JP2006268219A (ja) ディジタル記録方法およびディジタル記録装置
WO2017050029A1 (zh) 一种数据块处理的方法、装置及设备
US20060004947A1 (en) File updating method
TWI387874B (zh) 存儲裝置
KR20140039756A (ko) 데이터 저장 장치 및 그 동작 방법
KR20160119037A (ko) 저장 매체에 대한 접근 관리 방법, 이를 실행하는 단말 장치 및 서비스 시스템
TW201506790A (zh) 系統開機方法以及開機系統
JP2004302704A (ja) ファイル管理方法及びそれを用いたファイル管理機能付き記録再生装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15882398

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15882398

Country of ref document: EP

Kind code of ref document: A1