[go: up one dir, main page]

CN100552648C - Dynamic management method for portable storage device - Google Patents

Dynamic management method for portable storage device Download PDF

Info

Publication number
CN100552648C
CN100552648C CNB2006100785197A CN200610078519A CN100552648C CN 100552648 C CN100552648 C CN 100552648C CN B2006100785197 A CNB2006100785197 A CN B2006100785197A CN 200610078519 A CN200610078519 A CN 200610078519A CN 100552648 C CN100552648 C CN 100552648C
Authority
CN
China
Prior art keywords
data area
state
mark
memory device
dynamic management
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.)
Expired - Fee Related
Application number
CNB2006100785197A
Other languages
Chinese (zh)
Other versions
CN101071400A (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.)
Apacer Technology Inc
Original Assignee
Apacer Technology Inc
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 Apacer Technology Inc filed Critical Apacer Technology Inc
Priority to CNB2006100785197A priority Critical patent/CN100552648C/en
Publication of CN101071400A publication Critical patent/CN101071400A/en
Application granted granted Critical
Publication of CN100552648C publication Critical patent/CN100552648C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a dynamic management method of a portable storage device, the portable storage device comprises a flash memory for planning a reserved area and a data area, the reserved area comprises a plurality of active blocks for accessing and replacing damaged blocks, the method comprises the following steps: providing a flag for setting to determine the access status of the data area; opening the data area for access when the flag is set to the first state; and restricting the data area from being accessed when the flag is set to the second state. When the number of the active blocks is larger than zero, setting the mark as a first state for opening the data area for access, when the number of the active blocks is equal to zero, setting the mark as a second state for limiting the data area to be accessed, reading the mark before the data area is accessed, and determining to open or limit the data area to be accessed according to the mark state; and detecting whether the number of the active blocks is zero after the data area is accessed, if so, setting the mark to be in a second state, thereby endowing the portable storage device with a more flexible access function and achieving the effect of dynamic management.

Description

可携式储存装置的动态管理方法 Dynamic management method of portable storage device

技术领域 technical field

本发明涉及一种可携式储存装置,特别是涉及一种可自动设定或被动地由使用者设定,而可弹性变更存取功能,能达到动态管理的可携式储存装置的动态管理方法。The present invention relates to a portable storage device, in particular to a dynamic management of a portable storage device that can be automatically set or passively set by the user, and can flexibly change the access function and achieve dynamic management. method.

背景技术 Background technique

近年来,“资料带着走”的观念越来越普及,而使得各种可携式储存装置,如USB随身碟、MP3、CD或DVD光碟、各式记忆卡与硬碟等,成为消费者最常购买使用的配备。其中又以USB随身碟最方便且最普遍。In recent years, the concept of "carry data with you" has become more and more popular, making various portable storage devices, such as USB flash drives, MP3, CD or DVD discs, various memory cards and hard drives, etc. The most commonly purchased and used equipment. Among them, the USB flash drive is the most convenient and common.

USB随身碟具有可读写的双向存取功能,相较于CD及DVD光碟,USB随身碟多了写入的优势;USB随身碟随插即用,相较于各式记忆卡,USB随身碟有着价格优势与使用的便利性;USB随身碟的体积可以做得很小,相较于硬碟,USB随身碟有着体积较小的优势。综合上述几点,USB随身碟成为使用者心中最佳的可携式储存装置。USB flash drives have bidirectional access functions that can be read and written. Compared with CD and DVD discs, USB flash drives have more writing advantages; USB flash drives can be plugged and played. Compared with various memory cards, USB flash drives It has the advantage of price and convenience of use; the volume of the USB flash drive can be made very small. Compared with the hard disk, the USB flash drive has the advantage of smaller size. Based on the above points, the USB flash drive has become the best portable storage device in the minds of users.

并且,随着可携式储存装置的储存容量越来越大,价格越来越便宜,使得可携式储存装置的普及性越来越高,使用者对于这些装置的依赖性也相对提升。然而,所有的可携式储存装置都是有寿命限制的,装置的储存容量越大,使用者可以储存更多的资料,但是,一旦装置寿命到了,储存在装置里的资料越多,使用者遗失的资料也就越多。这些装置中,又以利用快闪记忆体(记忆体即存储介质,存储器,内存等,以下均称为记忆体)为储存媒介的USB随身碟或MP3问题最大。Moreover, as the storage capacity of the portable storage device increases and the price becomes cheaper, the popularity of the portable storage device becomes higher and higher, and the user's dependence on these devices is relatively increased. However, all portable storage devices have a limited lifespan. The larger the storage capacity of the device, the more data the user can store. However, once the life of the device is up, the more data stored in the device, the user The more data is lost. Among these devices, the USB flash drive or MP3 that utilizes flash memory (memory is a storage medium, memory, internal memory, etc., hereinafter all referred to as memory) as a storage medium has the biggest problem.

以硬碟而言,硬碟在损坏之前,会先有坏轨出现,一旦硬碟开始出现坏轨,使用者便会注意到该硬碟的寿命是否已经快到了,进而将硬碟中的资料备份出来,此外,硬碟的坏轨是慢慢出现的,使用者即使遗失资料,也是遗失部分资料,不会一次遗失整个硬碟的资料。As far as the hard disk is concerned, before the hard disk is damaged, there will be bad sectors first. Once the hard disk starts to have bad sectors, the user will notice whether the life of the hard disk is approaching, and then save the data in the hard disk. In addition, the bad sectors of the hard disk appear gradually. Even if the user loses data, he will lose part of the data, and will not lose the entire hard disk at once.

但是,USB随身碟或MP3因为是以快闪记忆体为储存媒介,且快闪记忆体具有写入(write)及删除(erase)次数的限制,因此为了让快闪记忆体的储存空间可以被平均利用,USB随身碟或MP3会使用一软件(软件即韧体,以下均称为软件)来进行记忆体分配与管理。However, because the USB flash drive or MP3 uses flash memory as the storage medium, and the flash memory has a limitation on the number of times of writing (write) and deletion (erase), so in order to allow the storage space of the flash memory to be On average, the USB flash drive or MP3 will use a piece of software (software is firmware, hereinafter referred to as software) for memory allocation and management.

请参阅图1所示是现有传统的快闪记忆体及其规划管理方式的示意图,以图1所示的一128MB的快闪记忆体为例,软件将快闪记忆体切割成1024个区块,每个区块(block)128K,并将该等区块分成保留区与资料区两个区域,资料区与保留区所拥有的区块是固定的,例如资料区占992个区块,保留区占32个区块。而保留区主要包含了活动区块(Free Blocks)、损坏区块(Bad Blocks)及其他区块(Other Blocks),USB随身碟或MP3需要利用活动区块达到资料存取的目的,因此活动区块的数量必须大于0,但损坏区块与活动区块是相对的,多一个损坏区块,则需以一活动区块来替代,因此,随着USB随身碟或MP3使用次数的增加,损坏区块逐渐增加,使得活动区块相对减少,一旦活动区块数量等于0,USB随身碟或MP3就没有活动区块可以进行存取(删除或写入)功能,USB随身碟或MP3的寿命即告终,而无法再被使用。Please refer to Figure 1, which is a schematic diagram of the existing traditional flash memory and its planning and management methods. Taking the 128MB flash memory shown in Figure 1 as an example, the software divides the flash memory into 1024 areas Blocks, each block (block) 128K, and these blocks are divided into two areas, the reserved area and the data area. The blocks owned by the data area and the reserved area are fixed. For example, the data area occupies 992 blocks. The reserved area occupies 32 blocks. The reserved area mainly includes active blocks (Free Blocks), damaged blocks (Bad Blocks) and other blocks (Other Blocks). The USB flash drive or MP3 needs to use the active blocks to achieve the purpose of data access, so the active area The number of blocks must be greater than 0, but the damaged block is relative to the active block. If there is one more damaged block, it needs to be replaced by an active block. Blocks increase gradually, so that the active blocks are relatively reduced. Once the number of active blocks is equal to 0, there will be no active blocks in the USB flash drive or MP3 to access (delete or write), and the life of the USB flash drive or MP3 will be short. ends and can no longer be used.

由此可见,上述现有的可携式储存装置的管理方法在管理方法与使用上,显然仍存在有不便与缺陷,而亟待加以进一步改进。为了解决上述存在的问题,相关厂商莫不费尽心思来谋求解决之道,但长久以来一直未见适用的设计被发展完成,而一般管理方法又没有适切的方法能够解决上述问题,此显然是相关业者急欲解决的问题。因此如何能提供一种新的可携式储存装置的动态管理方法,实属当前重要课题之一,亦成为当前业界极需改进的目标。It can be seen that the above-mentioned existing management method of the portable storage device obviously still has inconvenience and defects in the management method and use, and needs to be further improved urgently. In order to solve the above-mentioned problems, the relevant manufacturers have tried their best to find a solution, but no suitable design has been developed for a long time, and the general management method has no suitable method to solve the above-mentioned problems. This is obviously a Issues that relevant industry players are eager to solve. Therefore, how to provide a new dynamic management method for portable storage devices is one of the current important issues and has become a goal that the industry needs to improve.

有鉴于上述现有的可携式储存装置的管理方法存在的缺陷,本发明人基于从事此类产品设计制造多年丰富的实务经验及专业知识,并配合学理的运用,积极加以研究创新,以期创设一种新的可携式储存装置的动态管理方法,能够改进一般现有的管理方法,使其更具有实用性。经过不断的研究、设计,并经反复试作及改进后,终于创设出确具实用价值的本发明。In view of the defects in the above-mentioned existing management methods of portable storage devices, the inventor actively researches and innovates based on years of rich practical experience and professional knowledge engaged in the design and manufacture of such products, and cooperates with the application of academic theories, in order to create A new dynamic management method of a portable storage device can improve the general existing management method and make it more practical. Through continuous research, design, and after repeated trials and improvements, the present invention with practical value is finally created.

发明内容 Contents of the invention

本发明的目的在于,克服现有的可携式储存装置的管理方法存在的缺陷,而提供一种新的可携式储存装置的动态管理方法,所要解决的技术问题是使其可自动设定或被动地由使用者设定,而可以弹性变更可携式储存装置的存取功能,从而更加适于实用。The purpose of the present invention is to overcome the defects in the existing management methods of portable storage devices and provide a new dynamic management method for portable storage devices. The technical problem to be solved is to make it automatically set Or it can be passively set by the user, so that the access function of the portable storage device can be changed flexibly, so that it is more suitable for practical use.

本发明的目的及解决其技术问题是采用以下技术方案来实现的。依据本发明提出的一种可携式储存装置的动态管理方法,该可携式储存装置包含一快闪记忆体,该快闪记忆体包括一供储存资料的资料区,该资料区是由多个资料区块组成,且该快闪记忆体还包括一保留区,该保留区包含多个供进行存取作业及取代该资料区的损坏区块的活动区块,该方法包括以下步骤:(A)、设定一标记,以决定该资料区的存取状态;(B)、检查该标记,若该标记被设定为一第一状态,开放该资料区供存取;(C)、若该标记被设定为一第二状态,限制该资料区被存取;以及(D)、当该活动区块数量大于零时,将该标记设定为该第一状态,当该活动区块数量等于零时,将该标记设定为该第二状态。The purpose of the present invention and the solution to its technical problems are achieved by adopting the following technical solutions. According to a dynamic management method of a portable storage device proposed by the present invention, the portable storage device includes a flash memory, and the flash memory includes a data area for storing data, and the data area is composed of multiple data blocks, and the flash memory also includes a reserved area, the reserved area includes a plurality of active blocks for performing access operations and replacing damaged blocks in the data area, the method includes the following steps: ( A), setting a mark, to determine the access status of the data area; (B), checking the mark, if the mark is set to a first state, open the data area for access; (C), If the flag is set to a second state, restrict the data area from being accessed; and (D), when the number of active blocks is greater than zero, set the flag to the first state, when the active area When the number of blocks is equal to zero, the flag is set to the second state.

本发明的目的及解决其技术问题还可采用以下技术措施进一步实现。The purpose of the present invention and its technical problems can also be further realized by adopting the following technical measures.

多个前述的可携式储存装置的动态管理方法,其中该方法更包括有步骤(E):在该资料区被存取后,侦测该活动区块数量是否为零,若是,将该标记设定为该第二状态。A plurality of aforementioned dynamic management methods for portable storage devices, wherein the method further includes step (E): after the data area is accessed, detect whether the number of active blocks is zero, and if so, mark Set to this second state.

前述的可携式储存装置的动态管理方法,其中该方法更包括有步骤(F):在该资料区被存取前,判读该标记并执行步骤(B)及步骤(C)。The aforementioned dynamic management method of a portable storage device, wherein the method further includes a step (F): before the data area is accessed, read the mark and execute steps (B) and (C).

前述的可携式储存装置的动态管理方法,其中该等方法步骤是由该可携式储存装置中的一软件程序(软件程序即韧体程式,以下均称为软件程序)所执行。In the aforementioned dynamic management method for a portable storage device, the method steps are executed by a software program (a software program is a firmware program, hereinafter referred to as a software program) in the portable storage device.

前述的可携式储存装置的动态管理方法,其中当该标记是该第二状态时,是限制该资料区只能被读取。In the aforementioned dynamic management method of a portable storage device, when the flag is in the second state, the data area is restricted to be read only.

前述的可携式储存装置的动态管理方法,其中当该标记是该第二状态时,是限制该资料区不能被存取。In the aforementioned dynamic management method of a portable storage device, when the flag is in the second state, the data area is restricted from being accessed.

前述的可携式储存装置的动态管理方法,其中该方法更包括有步骤(G):当该标记是该第二状态时,该可携式储存装置可通过一与其连接的个人计算机(即个人电脑,以下均称为个人计算机)变更该标记的状态,以改变该资料区的存取限制。The dynamic management method of the aforementioned portable storage device, wherein the method further includes step (G): when the flag is in the second state, the portable storage device can be connected to it through a personal computer (i.e. personal Computers, hereinafter referred to as personal computers) change the state of the flag to change the access restrictions of the data area.

前述的可携式储存装置的动态管理方法,其中所述的步骤(GD)中,该个人计算机可将该标记由该第二状态变更至一第三状态,以限制该资料区只能被读取。In the aforementioned dynamic management method of a portable storage device, in the step (GD), the personal computer can change the flag from the second state to a third state, so that the data area can only be read Pick.

前述的可携式储存装置的动态管理方法,其中所述的步骤(G)中,该个人计算机可将该标记由该第二状态变更至一第四状态,使无法回复地限制该资料区不能被存取。In the aforementioned dynamic management method of a portable storage device, in the step (G), the personal computer can change the flag from the second state to a fourth state, so that the data area cannot be restricted irreversibly. is accessed.

前述的可携式储存装置的动态管理方法,其中所述的步骤(GD)中,该个人计算机更可根据该可携式储存装置的资料区容量,动态增加该保留区的活动区块数量,并将该标记变更为该第一状态。In the aforementioned dynamic management method of a portable storage device, in the step (GD), the personal computer may further dynamically increase the number of active blocks in the reserved area according to the capacity of the data area of the portable storage device, and change the flag to the first state.

前述的可携式储存装置的动态管理方法,其中所述的步骤(G)中,当该个人计算机根据该资料区容量,判断无法再增加该保留区的活动区块的数量时,则将该标记变更至一第三状态,限制该资料区只能被读取。In the aforementioned dynamic management method of a portable storage device, in the step (G), when the personal computer judges that the number of active blocks in the reserved area cannot be increased according to the capacity of the data area, the The flag changes to a third state, restricting the data area to be read only.

前述的可携式储存装置的动态管理方法,其中所述的步骤(G)中,当该个人计算机根据该资料区容量判断无法再增加该保留区的活动区块的数量时,则将该标记变更至一第四状态,使无法回复地限制该资料区不能被存取。The dynamic management method of the aforementioned portable storage device, wherein in the step (G), when the personal computer judges that the number of active blocks in the reserved area can no longer be increased according to the capacity of the data area, it will mark the Changing to a fourth state irreversibly restricts the data area from being accessed.

前述的可携式储存装置的动态管理方法,其中所述的步骤(G)中,该个人计算机更可根据该资料区容量,动态增加该保留区的活动区块数量,并将该标记变更为该第一状态。In the aforementioned dynamic management method of a portable storage device, in the step (G), the personal computer can dynamically increase the number of active blocks in the reserved area according to the capacity of the data area, and change the flag to the first state.

前述的可携式储存装置的动态管理方法,其中所述的步骤(G)中,该个人计算机更可将该标记变更至一第四状态,使无法回复地限制该资料区不能被存取。In the aforementioned dynamic management method of a portable storage device, in the step (G), the personal computer can further change the flag to a fourth state, so that the data area cannot be accessed irreversibly.

前述的可携式储存装置的动态管理方法,其中所述的该标记被记录在该保留区中。In the aforementioned dynamic management method for a portable storage device, the mark is recorded in the reserved area.

前述的可携式储存装置的动态管理方法,其中所述的该等标记状态及其所对应的资料区存取状态,记录在一储存于该快闪记忆体的保留区中的模式标记设定表。The dynamic management method of the aforementioned portable storage device, wherein the states of the flags and the corresponding access state of the data area are recorded in a mode flag setting stored in the reserved area of the flash memory surface.

前述的可携式储存装置的动态管理方法,其中所述的步骤(B)及步骤(C)是由一预设在该可携式储存装置中的软件程序实现。In the aforementioned dynamic management method for a portable storage device, the steps (B) and (C) are realized by a software program preset in the portable storage device.

前述的可携式储存装置的动态管理方法,其中所述的步骤(G)是由一预设在该个人计算机中的软件程序(即软体程式,以下均称为软件程序)实现。In the aforementioned dynamic management method of a portable storage device, the step (G) is realized by a software program preset in the personal computer (that is, a software program, hereinafter referred to as a software program).

本发明与现有技术相比具有明显的优点和有益效果。由以上可知,本发明是有关于一种可携式储存装置的动态管理方法,该可携式储存装置包含规划有一保留区及一资料区的一快闪记忆体,该保留区包含多个供进行存取作业及取代损坏区块的活动区块,该方法提供一标记,当该活动区块数量大于零时,将该标记设定为开放该资料区供存取的一第一状态,当该活动区块数量等于零时,将该标记设定为限制该资料区被存取的一第二状态,且在该资料区被存取前,需判读该标记,以根据该标记状态,决定开放或限制存取该资料区;并在该资料区被存取后,侦测该活动区块数量是否为零,若是,将该标记设定为该第二状态,借此,赋予可携式储存装置更弹性的存取功能。Compared with the prior art, the present invention has obvious advantages and beneficial effects. From the above, it can be known that the present invention relates to a dynamic management method of a portable storage device. The portable storage device includes a flash memory planned with a reserved area and a data area. The reserved area includes multiple Perform access operation and replace the active block of the damaged block. The method provides a flag. When the number of active blocks is greater than zero, the flag is set to a first state of opening the data area for access. When When the number of active blocks is equal to zero, the flag is set to a second state that restricts the data area from being accessed, and before the data area is accessed, the flag needs to be read to decide to open according to the state of the flag Or restrict access to the data area; and after the data area is accessed, detect whether the number of active blocks is zero, if so, set the flag to the second state, thereby granting portable storage Device more flexible access function.

借由上述技术方案,本发明可携式储存装置的动态管理方法至少具有下列优点:本发明的优点在于借由上述标记及判断流程设计,可携式储存装置本身或使用者可通过变更标记,更改可携式储存装置的存取功能,以协助可携式储存装置由异常状态回复至可备份状态或正常状态,并让使用者可借由变更标记,防止他人窃取或修改可携式储存装置中储存的资料,而可以达到动态管理可携式储存装置的目的与功效。With the above technical solution, the dynamic management method of the portable storage device of the present invention has at least the following advantages: The advantage of the present invention is that the portable storage device itself or the user can change the mark, Change the access function of the portable storage device to help the portable storage device recover from an abnormal state to a back-up state or a normal state, and allow users to change the mark to prevent others from stealing or modifying the portable storage device The data stored in the device can achieve the purpose and effect of dynamically managing the portable storage device.

综上所述,本发明新颖的可携式储存装置的动态管理方法,可自动设定或被动地由使用者设定,而可弹性变更可携式储存装置的存取功能,防止他人窃取或修改可携式储存装置中储存的资料,而可达到动态管理可携式储存装置的功效,非常适于实用。本发明具有上述诸多优点及实用价值,其不论在管理方法或功能上皆有较大的改进,在技术上有显著的进步,并产生了好用及实用的效果,且较现有的可携式储存装置的管理方法具有增进的突出功效,从而更加适于实用,并具有产业的广泛利用价值,诚为一新颖、进步,实用的新设计。In summary, the novel dynamic management method of the portable storage device of the present invention can be set automatically or passively by the user, and can flexibly change the access function of the portable storage device to prevent others from stealing or Modifying the data stored in the portable storage device can achieve the effect of dynamically managing the portable storage device, which is very suitable for practical use. The present invention has many advantages and practical value mentioned above. It has great improvements in both management methods and functions, and has made remarkable progress in technology, and has produced easy-to-use and practical effects, and is more portable than the existing ones. The management method of the type storage device has the prominent function of promotion, thereby is more suitable for practical use, and has the extensive utilization value of industry, is a novel, progressive, practical new design.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其他目的、特征和优点能够更明显易懂,以下特举较佳实施例,并配合附图,详细说明如下。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the following preferred embodiments are specifically cited below, and are described in detail as follows in conjunction with the accompanying drawings.

附图说明 Description of drawings

图1是现有传统的快闪记忆体及其规划管理方式的示意图。FIG. 1 is a schematic diagram of an existing traditional flash memory and its planning and management method.

图2是本发明可携式储存装置的动态管理方法的第一较佳实施例的流程图。FIG. 2 is a flowchart of a first preferred embodiment of a dynamic management method for a portable storage device of the present invention.

图3是本发明可携式储存装置的动态管理方法的第二较佳实施例的流程图。FIG. 3 is a flow chart of the second preferred embodiment of the dynamic management method of the portable storage device of the present invention.

图4是本发明第二实施例的可携式储存装置在异常模式下通过个人计算机进行标记状态设定的流程图。FIG. 4 is a flow chart of flag state setting by the personal computer in the abnormal mode of the portable storage device according to the second embodiment of the present invention.

图5是本发明第二实施例的可携式储存装置在备份模式下通过个人计算机进行标记状态变更设定的流程图。FIG. 5 is a flow chart of the portable storage device in the backup mode using the personal computer to change the flag state according to the second embodiment of the present invention.

图6是本发明第二实施例的可携式储存装置在正常模式下通过个人计算机进行标记状态变更设定的流程图。FIG. 6 is a flow chart of the flag state change setting performed by the personal computer in the normal mode of the portable storage device according to the second embodiment of the present invention.

图7是本发明第二实施例通过个人计算机动态增加可携式储存装置的快闪记忆体的保留区容量的流程图。7 is a flow chart of dynamically increasing the capacity of the reserved area of the flash memory of the portable storage device through the personal computer according to the second embodiment of the present invention.

具体实施方式 Detailed ways

为更进一步阐述本发明为达成预定发明目的所采取的技术手段及功效,以下结合附图及较佳实施例,对依据本发明提出的可携式储存装置的动态管理方法其具体实施方式、管理方法、步骤、特征及其功效,详细说明如后。In order to further explain the technical means and effects of the present invention to achieve the intended purpose of the invention, the specific implementation and management methods of the dynamic management method for portable storage devices proposed according to the present invention will be described below in conjunction with the accompanying drawings and preferred embodiments. The method, steps, features and effects thereof are described in detail below.

有关本发明的前述及其他技术内容、特点与功效,在以下配合参考图式的一个实施例的详细说明中,将可清楚的呈现。The foregoing and other technical contents, features and effects of the present invention will be clearly presented in the following detailed description of an embodiment with reference to the drawings.

请参阅图2所示,是本发明可携式储存装置的动态管理方法的第一较佳实施例,在本实施例中,该可携式储存装置是一USB随身碟或MP3,其主要包括一第一记忆单元、一第二记忆单元及一控制晶片,其中,该第一记忆单元是一快闪记忆体(Flash memory),该第二记忆单元包含一随机存取记忆体(RAM)及一只读记忆体(ROM),且该控制晶片中载置有一用以规划及管理该快闪记忆体的软件程序。See also shown in Fig. 2, be the first preferred embodiment of the dynamic management method of portable storage device of the present invention, in this embodiment, this portable storage device is a USB flash drive or MP3, and it mainly includes A first memory unit, a second memory unit and a control chip, wherein the first memory unit is a flash memory (Flash memory), and the second memory unit includes a random access memory (RAM) and A read-only memory (ROM), and a software program for planning and managing the flash memory is loaded in the control chip.

同样以图1所示的128MB快闪记忆体为例,该软件程序将快闪记忆体切割成1024个区块,每个区块(block)128K容量,并将该等区块划分成一保留区与一资料区两个区域,资料区与保留区所拥有的区块是固定的,例如资料区占992个区块(代表使用者有992x128k=124MB的空间可存取资料),保留区占32个区块(代表软件即韧体有32x128k=4MB的空间可运用)。其中保留区又由活动区块(最多31个)、损坏区块(最初0个)及其他区块(1个)组成,USB随身碟或MP3需要通过活动区块达到资料读写的目的,因此活动区块的数量必须大于0,但是当有一个区块损坏时,又须以一活动区块来替代,故损坏区块越多,活动区块即相对减少。Also taking the 128MB flash memory shown in Figure 1 as an example, the software program cuts the flash memory into 1024 blocks, each block (block) has a capacity of 128K, and divides these blocks into a reserved area There are two areas with a data area. The blocks owned by the data area and the reserved area are fixed. For example, the data area occupies 992 blocks (meaning that the user has 992x128k=124MB of space to access data), and the reserved area occupies 32 blocks. blocks (representing that the software or firmware has 32x128k=4MB of space available). Among them, the reserved area is composed of active blocks (up to 31), damaged blocks (0 initially) and other blocks (1). The USB flash drive or MP3 needs to achieve the purpose of data reading and writing through the active blocks, so The number of active blocks must be greater than 0, but when a block is damaged, it must be replaced by an active block, so the more damaged blocks, the relatively fewer active blocks.

因此,为了得知活动区块的数量状态,以适时对可携式储存装置进行弹性且有利的控制,让使用者不致因可携式储存装置的活动区块为0,而再也无法操作可携式储存装置进行资料存取动作。所以如下面的表1所示,本实施例提供一用以决定该资料区的存取状态的标记及一模式标记设定表(表1),当该活动区块数量大于0时,该标记被设定为一开放该资料区供存取的第一状态(0),当该活动区块数目等于0时,该标记被变更至限制该资料区被存取的一第二状态(1),亦即,当该标记是第一状态(0)时,可携式储存装置处于一正常模式,而令该资料区可供读、写及删除资料,而当该标记是第二状态(1)时,可携式储存装置处于一备份模式,而限制资料区只能供读取资料,不能被写入或删除资料。Therefore, in order to know the status of the number of active blocks, the portable storage device can be flexibly and advantageously controlled in a timely manner, so that the user will no longer be unable to operate the portable storage device because the active block is 0. The portable storage device performs data access operations. So as shown in the following table 1, the present embodiment provides a mark for determining the access state of the data area and a mode mark setting table (table 1), when the number of active blocks is greater than 0, the mark is set to a first state (0) that opens the data area for access, and when the number of active blocks is equal to 0, the flag is changed to a second state (1) that restricts the data area from being accessed , that is, when the flag is in the first state (0), the portable storage device is in a normal mode, so that the data area can be read, written and deleted, and when the flag is in the second state (1 ), the portable storage device is in a backup mode, and the restricted data area can only be used for reading data, and cannot be written or deleted.

  模式 model   标记状态 flag state   功能 Function   正常 normal   0(第一状态) 0 (first state)   所有存取功能(读、写删除) All access functions (read, write, delete)   备份 backup   1(第二状态) 1 (second state)   只提供读取功能 Only provide read function

表1Table 1

且该标记的目前状态被记录在保留区的其他区块中,而标记的所有可能状态及其所对应的资料区存取状态,则被记录在保留区的其他区块中的模式标记设定表(表1)中。And the current state of the mark is recorded in other blocks of the reserved area, and all possible states of the mark and their corresponding data area access states are set by the mode flag recorded in other blocks of the reserved area Table (Table 1).

因此,根据上述表1的模式标记设定表,当可携式储存装置每次与一外部电子装置,例如个人计算机(PC)连接时,可携式储存装置中的软件程序会被载入执行并进行如图2所示的判断流程。Therefore, according to the mode flag setting table in Table 1 above, when the portable storage device is connected to an external electronic device, such as a personal computer (PC), the software program in the portable storage device will be loaded and executed. And carry out the judgment process as shown in FIG. 2 .

首先,如图2的步骤21及步骤22,程序(即程式,以下均称为程序)读取记录在保留区的标记并暂存在第二记忆单元的随机存取记忆体(RAM)中,且判断标记的状态是否在正常模式(即第一状态(0))?若是,如步骤23,根据模式标记设定表的设定,开放资料区供个人计算机进行存取(包含读、写及删除等动作)。且由于在存取过程中资料区可能会有区块损坏,需要以活动区块替代,使活动区块数目减少,因此在存取动作结束后,程序会进行步骤24,判断活动区块数目是否为0?,若否,则结束判断流程,否则,表示保留区已无活动区块可供进行写入及删除动作,但为了让资料区的资料仍可以被读取,因此,如步骤25,程序将标记由第一状态(0)变更至第二状态(1),并参照模式标记设定表,使可携式储存装置进入一限制资料区只供读取不能写入的备份模式。First, as shown in steps 21 and 22 of Figure 2, the program (i.e. the program, hereinafter referred to as the program) reads the mark recorded in the reserved area and temporarily stores it in the random access memory (RAM) of the second memory unit, and Determine whether the state of the flag is in the normal mode (that is, the first state (0))? If so, as in step 23, open the data area for the personal computer to access (including operations such as reading, writing and deleting) according to the setting of the mode flag setting table. And because there may be blocks in the data area damaged during the access process, they need to be replaced by active blocks to reduce the number of active blocks. Therefore, after the access operation is completed, the program will proceed to step 24 to determine whether the number of active blocks is is 0? , if not, then end the judging process, otherwise, it means that there is no active block in the reserved area for writing and deleting, but in order to allow the data in the data area to still be read, therefore, as in step 25, the program will mark Change from the first state (0) to the second state (1), and refer to the mode flag setting table, so that the portable storage device enters a backup mode in which the data area is limited to read but not write.

反之,当在步骤22判断标记的状态不是在正常模式时,即表示标记是在第二状态(1),则如步骤26,令可携式储存装置进入备份模式,以限制资料区只能被读取。On the contrary, when judging in step 22 that the state of the mark is not in the normal mode, it means that the mark is in the second state (1), then as in step 26, the portable storage device is made to enter the backup mode, so that the data area can only be accessed read.

且在流程结束后,暂存在第二记忆单元的随机存取记忆体中的标记状态被写回第一记忆单元(快闪记忆体)的保留区中。And after the process ends, the flag state temporarily stored in the random access memory of the second memory unit is written back into the reserved area of the first memory unit (flash memory).

因此,借由上述标记及流程设计,并参照模式标记设定表,即使在保留区的活动区块已经用完而无法再让个人计算机写入资料的情况下,借由软件程序自动变更标记状态至备份模式,让使用者仍可通过可携式储存装置开放的读取功能,将存放在资料区中的资料备份出来,从而避免了可携式储存装置的记忆体中的活动区块一旦用完,就变成完全无法存取备份的情况发生。Therefore, with the above flag and process design, and referring to the mode flag setting table, even if the active blocks in the reserved area have been used up and the personal computer can no longer write data, the state of the flag can be automatically changed by the software program To the backup mode, the user can still back up the data stored in the data area through the read function opened by the portable storage device, thereby avoiding the use of the active block in the memory of the portable storage device. After that, the backup becomes completely inaccessible.

请再参阅图3所示,是本发明可携式储存装置的动态管理方法的第二较佳实施例,此实施例是要通过可携式储存装置中的一软件程序与个人计算机端的一软件程序来达成。并且如下面的表2所示,如同第一实施例,本实施例除了采用标记表示资料区的存取状态之外,同样需要预先建立一记录在保留区中的模式标记设定表(表2),以根据标记状态,决定该资料区的存取状态,其中当标记为一第一状态(0)时,令可携式储存装置处于一开放所有存取功能的正常模式,当标记为一第二状态(1)时,令可携式储存装置处于不提供存取功能的异常模式,当标记为一第三状态(2)时,令可携式储存装置处于一只提供读取功能(备份功能)的备份模式,当标记为一第四状态(3)时,令可携式储存装置处于不提供存取功能且无法回复功能的维修模式,且在本实施例中,限定可携式储存装置中的软件程序只能将可携式储存装置由正常模式转成异常模式,其他模式之间的转换则需要通过外部个人计算机的软件程序来执行。Please refer to Fig. 3 again, it is the second preferred embodiment of the dynamic management method of the portable storage device of the present invention, this embodiment is to pass a software program in the portable storage device and a software on the personal computer end program to achieve. And as shown in the following table 2, like the first embodiment, the present embodiment needs to set up a mode mark setting table (table 2) recorded in the reserved area in advance except adopting the access status of the mark to represent the data area. ), to determine the access state of the data area according to the state of the flag, wherein when the flag is a first state (0), the portable storage device is in a normal mode in which all access functions are open; when the flag is a During the second state (1), the portable storage device is in an abnormal mode that does not provide an access function, and when marked as a third state (2), the portable storage device is in a state that only provides a read function ( backup function), when marked as a fourth state (3), the portable storage device is in a maintenance mode that does not provide access functions and cannot restore functions, and in this embodiment, the portable storage device is limited to The software program in the storage device can only convert the portable storage device from the normal mode to the abnormal mode, and the conversion between other modes needs to be executed by the software program of the external personal computer.

  模式 model   状态 state   功能 Function   正常 normal   0(第一状态) 0 (first state)   所有存取功能(读、写、删除) All access functions (read, write, delete)   异常 Abnormal   1(第二状态) 1 (second state)   不提供存取功能,但可回复 Does not provide access function, but can reply   备份 backup   2(第三状态) 2 (third state)   只提供存取功能 Only provide access function   维修 repair   3(第四状态) 3 (fourth state)   不提供存取功能且无法回复 Does not provide access and cannot reply

表2Table 2

而且,同样地,当可携式储存装置被连接至个人计算机进行存取时,该可携式储存装置中的软件程序被执行并进行如图3所示的判断流程,程序读取记录在保留区的标记并暂存在第二记忆单元的随机存取记忆体(RAM)中,其中步骤401~404与第一实施例图2所示的步骤21~24相同,其不同之处只在于,当步骤402,根据标记状态判断可携式储存装置不是在正常模式时,则进入步骤405,判断标记状态是否在异常模式?若是,则进行步骤406,进入异常模式,不提供所有存取功能,但允许个人计算机的软件程序改变标记状态,若否,则进入步骤407,判断标记状态是否为备份模式?若是,进行步骤408,进入备份模式,提供读取功能,且允许个人计算机的软件程序改变标记状态。若否,则进行步骤409,进入维修模式,不提供所有存取功能,且令个人计算机的软件程序不能改变标记状态。另外,在步骤404中,当判断活动区块数目等于0时,即进行步骤410,将标记变更至第二状态(1),并令可携式储存装置进入不提供存取功能的异常模式。And, similarly, when the portable storage device is connected to the personal computer for access, the software program in the portable storage device is executed and the judgment process shown in Figure 3 is performed, and the program read record is reserved The mark of the zone is temporarily stored in the random access memory (RAM) of the second memory unit, wherein steps 401 to 404 are the same as steps 21 to 24 shown in FIG. 2 of the first embodiment, and the only difference is that when Step 402, when judging that the portable storage device is not in the normal mode according to the status of the flag, go to step 405, judging whether the status of the flag is in the abnormal mode? If so, then proceed to step 406, enter the abnormal mode, do not provide all access functions, but allow the software program of the personal computer to change the flag state, if not, then enter step 407, judge whether the flag state is a backup mode? If yes, go to step 408 to enter the backup mode, provide the reading function, and allow the software program of the personal computer to change the status of the flag. If not, proceed to step 409, enter the maintenance mode, do not provide all access functions, and make the software program of the personal computer unable to change the flag state. In addition, in step 404, when it is judged that the number of active blocks is equal to 0, proceed to step 410, change the flag to the second state (1), and make the portable storage device enter into an abnormal mode that does not provide access function.

因此,在异常模式下,可携式储存装置将不会提供任何的存取功能,借此,让使用者意识到快闪记忆体中的活动区块可能用完的讯息,此时,使用者可以通过个人计算机执行软件程序,对可携式储存装置进行模式状态切换及设定。Therefore, in the abnormal mode, the portable storage device will not provide any access function, thereby allowing the user to realize the message that the active blocks in the flash memory may be used up. At this time, the user The software program can be executed by the personal computer, and the mode state switching and setting of the portable storage device can be performed.

请参阅图4所示,是本发明第二实施例的可携式储存装置在异常模式下通过个人计算机进行标记状态设定的流程图,并请参照上述表2所示,当可携式储存装置在异常模式下连接到个人计算机时,个人计算机中预设的软件程序被(自动或被动地)启动,并进行以下流程。Please refer to FIG. 4, which is a flow chart of the portable storage device according to the second embodiment of the present invention to set the flag status through the personal computer in the abnormal mode, and please refer to the above table 2. When the portable storage device When the device is connected to the personal computer in abnormal mode, the preset software program in the personal computer is started (automatically or passively), and the following process is performed.

首先,程序会在个人计算机的显示画面上提供一操作介面(图中未示出),然后,进行步骤601,程序询问并判断使用者是否要变更标记状态,若是,表示此时使用者已设定(输入)想要变更的标记状态,接着,进行步骤602,判断标记是否变更至第三状态(2),若是,则执行步骤603,令可携式储存装置进入只提供读取功能的备份模式;否则,进行步骤604,判断标记是否变更至第四状态(3)?若是,则执行步骤605,令可携式储存装置进入不提供任何存取功能且无法回复的维修状态,否则,至此表示使用者并未输入想要变更的标记状态,则进行步骤606,询问使用者是否增加快闪记忆体的保留区容量(亦即增加活动区块数量),若是,表示可携式储存装置是因为活动区数目为0才进入异常模式。First of all, the program will provide an operation interface (not shown in the figure) on the display screen of the personal computer, then, proceed to step 601, the program inquires and judges whether the user wants to change the flag state, if so, it means that the user has set Decide (input) the flag state that wants to change, then, carry out step 602, judge whether flag changes to the 3rd state (2), if so, then execute step 603, make portable storage device enter the backup that only provides read function mode; otherwise, go to step 604 to determine whether the flag is changed to the fourth state (3)? If so, then execute step 605, so that the portable storage device enters into a maintenance state that does not provide any access function and cannot be restored; Or whether to increase the capacity of the reserved area of the flash memory (that is, to increase the number of active blocks), if so, it means that the portable storage device enters the abnormal mode because the number of active areas is 0.

因此,进入步骤607,程序侦测可携式储存装置目前的资料区容量,并根据资料区容量,动态增加保留区容量,以新增活动区块的数量,然后,如步骤608,程序判断增加保留区容量的作业是否成功?若是,则进行步骤609及610,自动将标记变更至第一状态(0),使可携式储存装置回复至提供所有存取功能的正常模式。Therefore, enter step 607, the program detects the current data area capacity of the portable storage device, and dynamically increases the capacity of the reserved area according to the capacity of the data area to increase the number of active blocks, and then, as in step 608, the program determines to increase Was the job for the reserved area capacity successful? If yes, proceed to steps 609 and 610, automatically change the flag to the first state (0), and make the portable storage device return to the normal mode providing all access functions.

反之,当在步骤608,发现增加保留区容量的作业不成功时,表示可携式储存装置的快闪记忆体已经没有多余的资料区可供挪用做为保留区,亦即,该可携式储存装置已经完全无法再提供写入或删除的功能,则如步骤611,程序会自动将标记变更至第三状态(2),让可携式储存装置至少回复至只提供读取功能的备份模式(步骤603)。当然,在步骤608中,当程序判断不成功时,亦可不执行步骤611,而直接结束流程,使可携式储存装置仍维持在异常模式。On the contrary, when in step 608, when it is found that the operation of increasing the capacity of the reserved area is unsuccessful, it means that the flash memory of the portable storage device has no redundant data area to be used as the reserved area, that is, the portable The storage device can no longer provide the function of writing or deleting, then as in step 611, the program will automatically change the flag to the third state (2), so that the portable storage device can at least return to the backup mode that only provides the read function (step 603). Of course, in step 608, when the program determines that it is unsuccessful, step 611 may not be executed, and the process may be ended directly, so that the portable storage device remains in the abnormal mode.

再回到步骤606,当判断使用者并非想要增加快闪记忆体的保留区容量时,表示可携式储存装置是在正常模式下经由人为设定才进入异常模式,而非保留区的活动区块数目已等于0,因此进入步骤612,进一步询问使用者是否要将可携式储存装置回复至正常模式,若是,则将标记变更至第一状态,并进入步骤610,令可携式储存装置回复至正常模式。否则,结束流程。Going back to step 606, when it is judged that the user does not want to increase the capacity of the reserved area of the flash memory, it means that the portable storage device enters the abnormal mode through artificial setting in the normal mode, rather than the activity of the reserved area. The number of blocks has been equal to 0, so enter step 612, further inquire whether the user will return the portable storage device to the normal mode, if so, then change the flag to the first state, and enter step 610 to make the portable storage device The device returns to normal mode. Otherwise, end the process.

因此,通过个人计算机,使用者在可携式储存装置发生异常而无法存取的情况下,可借由个人计算机变更可携式储存装置的标记状态,使可携式储存装置回复至可以被读取的备份模式或重新回到正常模式。而且,使用者亦可通过个人计算机将可携式储存装置由正常模式设定为异常模式,而可防止他人窃取或修改可携式储存装置中储存的资料。Therefore, through the personal computer, when the portable storage device is abnormal and cannot be accessed, the user can change the flag state of the portable storage device through the personal computer, so that the portable storage device can be restored to be readable. Take backup mode or return to normal mode. Moreover, the user can also set the portable storage device from the normal mode to the abnormal mode through the personal computer, thereby preventing others from stealing or modifying the data stored in the portable storage device.

接着请参阅图5所示,是本发明第二实施例的可携式储存装置在备份模式下通过个人计算机进行标记状态变更设定的流程图,并请参照上述表2所示,当可携式储存装置是在备份模式下连接至个人计算机,并启动个人计算机中预设的软件程序时,类似图4的流程,在步骤701,程序首先询问并判断使用者是否要变更标记状态?若是,接着进行步骤702,判断标记是否变更至第二状态(1),若是,则如步骤703,令可携式储存装置进入异常模式,否则,进行步骤704,判断标记是否变更至第四状态(3),若是,则如步骤705,令可携式储存装置进入维修模式;否则,接着如步骤706,询问使用者是否增加保留区容量,若是,则进行步骤707~710(如同上述步骤507~510),试着新增保留区容量,以将可携式储存装置回复至正常模式,否则,如步骤711,询问可携式储存装置是否回复至正常模式。Then please refer to FIG. 5 , which is a flow chart of the portable storage device according to the second embodiment of the present invention under the backup mode to carry out the flag state change setting through the personal computer, and please refer to the above table 2, when the portable storage device When the removable storage device is connected to the personal computer in the backup mode and the preset software program in the personal computer is started, similar to the flow in FIG. 4 , in step 701, the program first asks and determines whether the user wants to change the flag state? If so, proceed to step 702 to determine whether the flag has changed to the second state (1), if so, to make the portable storage device enter the abnormal mode as in step 703, otherwise, proceed to step 704 to judge whether the flag has changed to the fourth state (3), if so, then as in step 705, make the portable storage device enter the maintenance mode; otherwise, then as in step 706, ask the user whether to increase the capacity of the reserved area, if so, then proceed to steps 707~710 (like the above-mentioned step 507 ~510), try to increase the capacity of the reserved area to restore the portable storage device to the normal mode, otherwise, as in step 711, ask the portable storage device whether to return to the normal mode.

因此,通过个人计算机,使用者在可携式储存装置只能提供读取功能的情况下,可借由个人计算机变更可携式储存装置的标记状态,让可携式储存装置可由备份模式进入异常模式、维修模式或重新回到正常模式。Therefore, through the personal computer, when the portable storage device can only provide the reading function, the user can change the flag state of the portable storage device through the personal computer, so that the portable storage device can enter the abnormal state from the backup mode. mode, maintenance mode or return to normal mode.

请再参阅图6所示,是本发明第二实施例的可携式储存装置在正常模式下通过个人计算机进行标记状态变更设定的流程图,并请参照上述的表2所示,当可携式储存装置是在正常模式下连接个人计算机,并启动个人计算机中预设的应用程序时,如步骤81,程序询问使用者是否变更标记状态,若是,接着如步骤82,判断是否变更标记至第二状态(1),若是,则如步骤83,令可携式储存装置进入异常模式,否则,如步骤84,再判断是否变更标记至第三状态(2),若是,则如步骤85,令可携式储存装置进入备份模式,否则,即结束流程。Please refer to FIG. 6 again, which is a flow chart of the portable storage device according to the second embodiment of the present invention to set the flag state change setting through the personal computer in the normal mode, and please refer to the above-mentioned Table 2, when it can be When the portable storage device is connected to the personal computer in the normal mode, and the preset application program in the personal computer is activated, as in step 81, the program asks the user whether to change the flag state, if so, then as in step 82, it is judged whether to change the flag to Second state (1), if so, then as in step 83, make the portable storage device enter the abnormal mode, otherwise, as in step 84, judge whether to change the flag to the third state (2), if so, as in step 85, Make the portable storage device enter the backup mode, otherwise, end the process.

因此,在正常模式下,使用者可通过个人计算机,变更可携式储存装置的标记状态为不提供存取功能的异常模式或只提供读取功能的备份模式,借此防止第三人对可携式储存装置存取或写入资料,而可达到资料保密的作用。Therefore, in the normal mode, the user can change the marked state of the portable storage device to an abnormal mode that does not provide an access function or a backup mode that only provides a read function through a personal computer, thereby preventing a third person from accessing the portable storage device. Portable storage devices access or write data, which can achieve the function of data security.

而且,值得一提的是,前述图4所示的步骤607或图5所示的步骤707可以如下的技术手段来达成。Moreover, it is worth mentioning that the aforementioned step 607 shown in FIG. 4 or step 707 shown in FIG. 5 can be achieved by the following technical means.

首先,个人计算机的应用程序执行步骤607或707之前,在可携式储存装置的第二记忆单元的只读记忆体中,需要先预设一如下面表3所示的使用阶层对照表,其中由上而下规划有n个阶层,该n个阶层以等差级数(差8)方式由小至大递增地定义保留区容量和对应的资料区容量,以128Mb的快闪记忆体为例,当n=1(第1阶层)时,令软件程序将快闪记忆体规划成具有32个区块(128Kb/区块)的保留区以及具有992个区块的资料区,当n=2时,则保留区具有40(32+8)个区块,资料区具有984个区块,以此类推。且可携式储存装置目前所使用的阶层是以一标签(Tag)记录在快闪记忆体的保留区的其它区块中。First of all, before the application program of the personal computer executes step 607 or 707, in the read-only memory of the second memory unit of the portable storage device, it is necessary to preset a usage level comparison table as shown in Table 3 below, wherein There are n levels planned from top to bottom. The n levels define the reserved area capacity and the corresponding data area capacity incrementally in the form of arithmetic progression (difference 8). Taking 128Mb flash memory as an example , when n=1 (1st level), make the software program plan the flash memory into a reserved area with 32 blocks (128Kb/block) and a data area with 992 blocks, when n=2 , the reserved area has 40 (32+8) blocks, the data area has 984 blocks, and so on. Moreover, the currently used hierarchy of the portable storage device is recorded in other blocks of the reserved area of the flash memory by a tag (Tag).

  阶层 class   保留区容量(区块数) Reserved area capacity (number of blocks)   资料区容量(区块数) Data area capacity (number of blocks)   1 1   32 32   992 992   2 2   40 40   984 984   3 3   48 48   976 976   ... ...   ... ...   ... ...   N N   32+8(n-1) 32+8(n-1)   992-8(n-1) 992-8(n-1)

表3table 3

因此,当执行步骤607或707时(可先将存放在资料区中的资料备份出来),如图7所示,是本发明第二实施例通过个人计算机动态增加可携式储存装置的快闪记忆体的保留区容量的流程图,如图7的流程所示,软件程序进行步骤101,首先读取保留区中的代表目前阶层的标签,并如步骤102,判断标签是否到达使用阶层对照表中定义的最后一个阶层,若是,则传回无法进阶的讯息并结束流程,否则,如步骤103,将标签值加1,并如步骤104,令可携式储存装置的管理快闪记忆体的软件程序根据阶层对照表中的定义,重新调整保留区与资料区的区块数量后,如步骤105,对快闪记忆体重新格式化,即完成新增保留区容量(即活动区块)的作业。Therefore, when step 607 or 707 is executed (the data stored in the data area can be backed up first), as shown in FIG. The flow chart of the reserved area capacity of the memory, as shown in the flow chart of Figure 7, the software program proceeds to step 101, first reads the label representing the current level in the reserved area, and as in step 102, judges whether the label has reached the usage level comparison table If it is the last level defined in , if so, return a message that cannot be advanced and end the process, otherwise, as in step 103, add 1 to the tag value, and as in step 104, make the management flash memory of the portable storage device After readjusting the number of blocks in the reserved area and the data area according to the definition in the hierarchical comparison table, the software program re-formats the flash memory as in step 105, and then completes the addition of reserved area capacity (ie, active blocks) homework.

综上所述,本发明借由上述标记及判断流程设计,并参照模式标记设定表,使可携式储存装置在保留区的活动区块已经用完而无法让个人计算机存取资料的情况下,可自动变更标记状态至备份模式,让使用者可将存放在资料区中的资料备份出来;此外,本发明借由预设在个人计算机上的应用程序,让使用者在可携式储存装置发生异常而无法存取的情况下,可借由个人计算机变更可携式储存装置的标记状态,让可携式储存装置回复至备份模式或重新回到正常模式,并且让使用者可通过个人计算机将可携式储存装置由正常模式设定为异常模式,而可以防止他人窃取或修改可携式储存装置中储存的资料,达到动态管理可携式储存装置的目的及功效。To sum up, the present invention utilizes the design of the above flags and judgment process, and refers to the mode flag setting table, so that the portable storage device has run out of active blocks in the reserved area and cannot allow the personal computer to access data. Under this condition, the marked state can be automatically changed to the backup mode, so that the user can back up the data stored in the data area; in addition, the present invention allows the user to save data in the portable storage by means of an application program preset on the personal computer. When the device is abnormal and cannot be accessed, the flag state of the portable storage device can be changed through the personal computer, so that the portable storage device can return to the backup mode or return to the normal mode, and the user can use personal The computer sets the portable storage device from the normal mode to the abnormal mode, which can prevent others from stealing or modifying the data stored in the portable storage device, and achieves the purpose and effect of dynamic management of the portable storage device.

以上所述,仅是本发明的较佳实施例而已,并非对本发明作任何形式上的限制,虽然本发明已以较佳实施例揭露如上,然而并非用以限定本发明,任何熟悉本专业的技术人员,在不脱离本发明技术方案范围内,当可利用上述揭示的技术内容作出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本发明技术方案内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本发明技术方案的范围内。The above description is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Anyone familiar with this field Those skilled in the art, without departing from the scope of the technical solution of the present invention, may use the technical content disclosed above to make some changes or modify them into equivalent embodiments with equivalent changes, but as long as they do not depart from the technical solution of the present invention, the Technical Essence Any simple modifications, equivalent changes and modifications made to the above embodiments still fall within the scope of the technical solution of the present invention.

Claims (18)

1, a kind of dynamic management approach of portable memory device, this portable memory device comprises a fast flash memory bank, this fast flash memory bank comprises an information data area that Gong stores data, this information data area is made up of a plurality of data blocks, and this fast flash memory bank also comprises a reserved area, this reserved area comprises the active block that a plurality of confessions are carried out access operation and replaced the bad block of this information data area, it is characterized in that this method may further comprise the steps:
(A), set a mark, to determine the access status of this information data area;
(B), check this mark, if this mark is set to one first state, open this information data area is for access;
(C), if this mark be set to one second state, limit this information data area by access; And
(D), when this active block quantity greater than zero the time, be this first state with this flag settings, when this active block quantity equals zero, be this second state with this flag settings.
2, the dynamic management approach of portable memory device according to claim 1, it is characterized in that wherein this method more comprises step (E): after this information data area is by access, whether be zero, if be this second state with this flag settings if detecting this active block quantity.
3, the dynamic management approach of portable memory device according to claim 1 is characterized in that wherein this method more comprises step (F): before this information data area is by access, and this mark of interpretation and execution in step (B) and step (C).
4,, it is characterized in that wherein these method steps are performed by the software program in this portable memory device according to the dynamic management approach of the described portable memory device of arbitrary claim in the claim 1 to 3.
5, the dynamic management approach of portable memory device according to claim 1 is characterized in that wherein being to limit this information data area can only be read when this mark is this second state.
6, the dynamic management approach of portable memory device according to claim 1 is characterized in that wherein when this mark is this second state, be limit this information data area can not be by access.
7, the dynamic management approach of portable memory device according to claim 6, it is characterized in that wherein this method more comprises step (G): when this mark is this second state, this portable memory device can change the state of this mark by a connected personal computer, to change the limited-access of this information data area.
8, the dynamic management approach of portable memory device according to claim 7 is characterized in that in the wherein said step (G), and this personal computer can only be read to limit this information data area with this mark by this second Status Change to a third state.
9, the dynamic management approach of portable memory device according to claim 7, it is characterized in that in the wherein said step (G), this personal computer can be with this mark by this second Status Change to a four condition, make can't limit this information data area with replying can not be by access.
10, the dynamic management approach of portable memory device according to claim 7, it is characterized in that in the wherein said step (G), this personal computer more can be according to the information data area capacity of this portable memory device, dynamically increase the active block quantity of this reserved area, and this mark is changed to this first state.
11, the dynamic management approach of portable memory device according to claim 10, it is characterized in that in the wherein said step (G), when this personal computer according to this information data area capacity, when judgement can't increase the active block quantity of this reserved area again, then this mark is changed to a third state, limiting this information data area can only be read.
12, according to the dynamic management approach of the described portable memory device of claim 1Q, it is characterized in that in the wherein said step (G), when this personal computer can't increase the active block quantity of this reserved area again according to this information data area capacity judgement, then this mark is changed to a four condition, make can't limit this information data area with replying can not be by access.
13, the dynamic management approach of portable memory device according to claim 8, it is characterized in that in the wherein said step (G), this personal computer more can dynamically increase the active block quantity of this reserved area according to this information data area capacity, and this mark is changed to this first state.
14, the dynamic management approach of portable memory device according to claim 8, it is characterized in that in the wherein said step (G), this personal computer more can change to this mark one four condition, make can't limit this information data area with replying can not be by access.
15, the dynamic management approach of portable memory device according to claim 1 is characterized in that wherein said this mark is recorded in this reserved area.
16, the dynamic management approach of portable memory device according to claim 1, it is characterized in that wherein said these flag states and pairing information data area access status thereof, be recorded in a mode flag setting table that is stored in the reserved area of this fast flash memory bank.
17, the dynamic management approach of portable memory device according to claim 1 is characterized in that wherein said step (B) and step (C) are to be realized by a software program that is preset in this portable memory device.
18,, it is characterized in that wherein said step (G) is to be realized by a software program that is preset in this personal computer according to the dynamic management approach of the described portable memory device of arbitrary claim in the claim 7 to 14.
CNB2006100785197A 2006-05-08 2006-05-08 Dynamic management method for portable storage device Expired - Fee Related CN100552648C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100785197A CN100552648C (en) 2006-05-08 2006-05-08 Dynamic management method for portable storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100785197A CN100552648C (en) 2006-05-08 2006-05-08 Dynamic management method for portable storage device

Publications (2)

Publication Number Publication Date
CN101071400A CN101071400A (en) 2007-11-14
CN100552648C true CN100552648C (en) 2009-10-21

Family

ID=38898632

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100785197A Expired - Fee Related CN100552648C (en) 2006-05-08 2006-05-08 Dynamic management method for portable storage device

Country Status (1)

Country Link
CN (1) CN100552648C (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8744971B2 (en) * 2011-08-29 2014-06-03 Sony Computer Entertainment America Llc Dynamic redemption codes

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6026016A (en) * 1998-05-11 2000-02-15 Intel Corporation Methods and apparatus for hardware block locking in a nonvolatile memory
CN1279808A (en) * 1997-11-14 2001-01-10 爱特梅尔股份有限公司 Programmable access protection in a flash memory device
CN1467750A (en) * 2002-07-11 2004-01-14 腾研科技股份有限公司 Flash memory device and method of providing security thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1279808A (en) * 1997-11-14 2001-01-10 爱特梅尔股份有限公司 Programmable access protection in a flash memory device
US6026016A (en) * 1998-05-11 2000-02-15 Intel Corporation Methods and apparatus for hardware block locking in a nonvolatile memory
CN1467750A (en) * 2002-07-11 2004-01-14 腾研科技股份有限公司 Flash memory device and method of providing security thereof

Also Published As

Publication number Publication date
CN101071400A (en) 2007-11-14

Similar Documents

Publication Publication Date Title
CN102508787B (en) System and method for memory allocation of composite memory
CN106548789B (en) Method and apparatus for operating stacked tile type magnetic recording equipment
US8195971B2 (en) Solid state disk and method of managing power supply thereof and terminal including the same
TWI382421B (en) Hybrid density memory storage device
JP2005301628A5 (en)
US20120317337A1 (en) Managing data placement on flash-based storage by use
TWI330373B (en)
US8156278B2 (en) Non-volatile data storage system and method thereof
CN110515549B (en) A data migration method and device
CN102214143A (en) Method and device for managing multilayer unit flash memory, and storage equipment
US8161251B2 (en) Heterogeneous storage array optimization through eviction
CN102012873B (en) Cache system of Not AND (NAND) flash memory and cache method
CN101556555A (en) Block management method for flash memory, controller and storage system thereof
CN116048430B (en) Random write instruction processing method, SMR hard disk and computer equipment
CN102200946B (en) Data access method, memory controller and storage system
CN109491592A (en) Storage device, data writing method and storage device therefor
CN101625661B (en) Data management method, storage system and controller for flash memory
CN110262980B (en) High-speed storage system based on limited-life storage medium
CN107122223A (en) Data migration method and device
CN105205015B (en) A kind of date storage method and storage equipment
CN100552648C (en) Dynamic management method for portable storage device
CN105589912B (en) A kind of method and storage organization using MRAM processing frequency written document
TWI317525B (en) The method of index for logical to physical blocks translation in flash storage device
CN103176753A (en) Storage device and data management method of storage device
CN109119123A (en) A kind of classification method of senior middle school's low order flash memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20091021

Termination date: 20190508