CN100487818C - Method for analyzing storage capacity of portable storage device - Google Patents
Method for analyzing storage capacity of portable storage device Download PDFInfo
- Publication number
- CN100487818C CN100487818C CNB2005101304077A CN200510130407A CN100487818C CN 100487818 C CN100487818 C CN 100487818C CN B2005101304077 A CNB2005101304077 A CN B2005101304077A CN 200510130407 A CN200510130407 A CN 200510130407A CN 100487818 C CN100487818 C CN 100487818C
- Authority
- CN
- China
- Prior art keywords
- configuration information
- storage device
- analyzing
- update
- section
- 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
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域 technical field
本发明涉及一种分析可携式储存装置容体信息的方法,特别涉及一种分析可携式储存装置储存容量的方法。The invention relates to a method for analyzing volume information of a portable storage device, in particular to a method for analyzing storage capacity of a portable storage device.
背景技术 Background technique
可显示容体信息的可携式储存装置,是利用控制器的分析模组分析装置上的储存媒体,以取得储存容体分割区、文件系统格式、可用空间、容体标签名称等储存容体相关信息,接着将分析的信息显示在显示装置上,借此让使用者得以观看其可携式储存装置上的储存容体信息,以供使用者随时掌握储存容体的使用状态及提高使用方便性。The portable storage device that can display volume information uses the analysis module of the controller to analyze the storage medium on the device to obtain storage volume related information such as storage volume partition, file system format, available space, volume label name, etc., and then The analyzed information is displayed on the display device, so that the user can view the storage volume information on the portable storage device, so that the user can grasp the use status of the storage volume at any time and improve the convenience of use.
然而,当控制器要分析储存媒体时,通过文件系统辨识(File SystemIdentification)找到储存媒体的配置信息(Allocation Information)并得知储存媒体的规格(如:FAT16、FAT32、NTFS及HFS等规格)。借储存媒体的配置信息可掌握储存媒体内数据的配置状况,经过计算分析后可在显示装置上显示容量的相关信息。当向储存媒体读写数据,造成储存媒体内数据内容或其存放的位址有所变动时,其配置信息亦将针对这些变动予以更新,以确实记录储存媒体内所有数据的配置位置。However, when the controller wants to analyze the storage medium, it finds the allocation information (Allocation Information) of the storage medium through the file system identification (File System Identification) and knows the specification of the storage medium (such as: FAT16, FAT32, NTFS and HFS, etc.). The configuration information of the storage medium can be used to grasp the configuration status of the data in the storage medium, and the related information of the capacity can be displayed on the display device after calculation and analysis. When reading and writing data to the storage medium, resulting in changes in the content of the data in the storage medium or its storage address, its configuration information will also be updated in response to these changes, so as to accurately record the configuration locations of all data in the storage medium.
请参阅图1,其是公知的配置信息更新控制流程图,其中描述读写或存取储存媒体内的数据,将更新配置信息及容体信息,进而在显示装置上显示更新后的容体信息。首先,可携式储存装置与应用系统(电脑)连线进入连线状态,启动系统端通讯协定(如图1中的步骤S101),接着判断应用系统是否下达指令(如图1中的步骤S103),若没有下达指令,则进入待命状态的步骤(如图1中的步骤S105),若有下达指令,则判断该指令是否为读取状态的指令(如图1中的步骤S107),若为读取状态的指令则直接执行指令,而不需触发更新扫描配置信息(如图1中的步骤S109),然后返回步骤S105。若不是读取状态的指令,则判断写入的指令是否影响配置信息(如图1中的步骤S111),若不影响配置信息则直接执行指令,而不需触发更新扫描配置信息(如图1中的步骤S109),然后返回步骤S105。若会影响配置信息,则触发容体信息更新操作(如图1中的步骤S113),接着便执行写入操作,直到完成数据的传输(如图1中的步骤S115)。由于此时储存媒体内容体信息已有变更,于是读取储存媒体所更新的容体信息(如图1中的步骤S117)。根据读取储存媒体所更新的容体信息来更新储存于容体信息储存区的容体信息(如图1中的步骤S119),然后根据储存于容体信息储存区的容体信息来更新显示装置的显示内容(如图1中的步骤S121),最后回复待命状态(如图1中的步骤S123)。Please refer to FIG. 1 , which is a known configuration information updating control flow chart, which describes reading and writing or accessing data in a storage medium, updating configuration information and volume information, and then displaying the updated volume information on a display device. First, the portable storage device is connected to the application system (computer) to enter the connection state, and the system-side communication protocol is started (step S101 in Figure 1), and then it is judged whether the application system has issued an instruction (step S103 in Figure 1) ), if no instruction is issued, then enter the step of standby state (step S105 in Figure 1), if there is an order issued, then judge whether the instruction is the instruction of read state (step S107 in Figure 1), if The instruction for reading the status is directly executed without triggering to update the scanning configuration information (eg, step S109 in FIG. 1 ), and then returns to step S105. If it is not an instruction to read the state, then judge whether the written instruction affects the configuration information (step S111 in Figure 1), if it does not affect the configuration information, then directly execute the instruction without triggering to update the scanning configuration information (as shown in Figure 1 in step S109), and then return to step S105. If the configuration information will be affected, the capacity information update operation is triggered (step S113 in FIG. 1 ), and then the write operation is performed until the data transmission is completed (step S115 in FIG. 1 ). Since the content volume information of the storage medium has been changed at this time, the updated volume information of the storage medium is read (step S117 in FIG. 1 ). Update the volume information stored in the volume information storage area according to the volume information updated by reading the storage medium (step S119 in Figure 1), and then update the display content of the display device according to the volume information stored in the volume information storage area ( Step S121 in Fig. 1), and finally return to the standby state (step S123 in Fig. 1).
接着请参阅图2,其是公知的配置信息更新操作程序,当储存媒体内数据的读写或存取影响配置信息,即进行配置信息更新操作(如图2中的步骤S201)。通过文件系统辨识(File System Identification)来识别文件系统的格式及分析方式(如图2中的步骤S203);取得配置信息的起始位址与长度,及将剩余可用空间累计归零(如图2中的步骤S205);读取储存媒体取得配置信息,将取得的配置信息传至数据缓冲区(如图2中的步骤S207);读取数据缓冲区以累计剩余可用空间(如图2中的步骤S209);判断是否完成扫描(如图2中的步骤S211),若尚未完成扫描则累加读取位址及累计扫描长度(如图2中的步骤S213);若已完成扫描,则依据累计结果转换剩余可用空间容量数值使之符合显示格式(如图2中的步骤S215);然后控制显示装置介面呈现最新的容体信息(如图2中的步骤S217);最后完成更新及显示容体信息操作返回待机状态(如图2中的步骤S219)。Next, please refer to FIG. 2 , which is a known configuration information update operation program. When the read/write or access of data in the storage medium affects the configuration information, the configuration information update operation is performed (step S201 in FIG. 2 ). Identify the format and analysis method of the file system through File System Identification (as shown in step S203 in Figure 2); obtain the initial address and length of the configuration information, and reset the remaining available space to zero (as shown in Figure 2 Step S205 in 2); read the storage medium to obtain configuration information, and pass the configuration information obtained to the data buffer (as in step S207 in Figure 2); read the data buffer to accumulate the remaining available space (as in Figure 2 Step S209 of step S209); Judging whether to finish scanning (as in step S211 in Fig. 2), if scanning has not yet been completed, accumulatively read address and accumulative scanning length (as in step S213 in Fig. 2); If scanning has been completed, then according to The cumulative result converts the value of the remaining free space capacity to conform to the display format (step S215 in Figure 2); then controls the display device interface to present the latest container information (step S217 in Figure 2); finally completes updating and displaying the container information The operation returns to the standby state (like step S219 in FIG. 2).
因此,更新及扫描配置信息内容的工作在容量信息的分析上是重要的一环。然而,在分析剩余可用容量时,特别当储存媒体容量较大,其配置信息空间较大时,可携式储存装置上的控制器对配置信息的扫描更新时间相对地变长,分析操作需较长时间,进而影响可携式储存装置进行一般存取操作的效果。Therefore, the work of updating and scanning the content of the configuration information is an important part in the analysis of the capacity information. However, when analyzing the remaining available capacity, especially when the capacity of the storage medium is large and its configuration information space is relatively large, the time for the controller on the portable storage device to scan and update the configuration information is relatively long, and the analysis operation needs to be longer. For a long time, it will affect the general access operation effect of the portable storage device.
接着以FAT32为例解释,当控制器通过文件系统辨识找到文件配置表(File Allocation Table),记录着文件所存放的位置,控制器只要参考文件配置表就可以快速的找到数据。不过,当储存容量为十亿位元组(1GB)大小时,其文件配置表的大小就有一百万位元组(1MB),进而为二十亿位元组(2GB)大小时,其文件配置表的大小就有二百万位元组(2MB)。控制器要扫描完一百万位元组(1MB)或二百万位元组(2MB)大小的文件配置表将需要不少时间,进而影响储存操作效果。更不用说容量为二十亿位元组(2GB)大小以上的储存装置,其扫描对应的文件配置表所花的时间将更长,对于储存操作效果影响更大。Then take FAT32 as an example to explain, when the controller finds the File Allocation Table (File Allocation Table) through file system identification, which records the storage location of the file, the controller can quickly find the data just by referring to the file allocation table. However, when the storage capacity is one billion bytes (1GB), the size of its file allocation table is one million bytes (1MB), and then two billion bytes (2GB). The size of the file configuration table is just two million bytes (2MB). It will take a lot of time for the controller to scan the one-megabyte (1MB) or two-megabyte (2MB) file configuration table, which will affect the effect of the storage operation. Not to mention the storage device with a capacity of more than two gigabytes (2GB), it will take longer to scan the corresponding file configuration table, which will have a greater impact on the storage operation effect.
发明内容 Contents of the invention
本发明所要解决的技术问题在于,针对现有技术的不足,提供一种分析可携式储存装置储存容量的方法,以提高存取效果。The technical problem to be solved by the present invention is to provide a method for analyzing the storage capacity of a portable storage device to improve the access effect.
为解决上述的技术问题,本发明提供一种分析可携式储存装置储存容量的方法,利用一控制器扫描一配置信息区段以分析一储存媒体的容量,步骤包括:In order to solve the above-mentioned technical problems, the present invention provides a method for analyzing the storage capacity of a portable storage device. A controller is used to scan a section of configuration information to analyze the capacity of a storage medium. The steps include:
将该储存媒体的该配置信息区段分为复数个配置信息子区段;dividing the configuration information section of the storage medium into a plurality of configuration information subsections;
当有数据读写该储存媒体,而使该配置信息子区段有所变动时,设定一更新信号以表示有变动的该配置信息子区段;When there is data to be read and written to the storage medium, so that the configuration information sub-section changes, an update signal is set to indicate that the configuration information sub-section has changed;
该控制器扫描该配置信息区段,针对设定有该更新信号的该配置信息子区段,读取该配置信息子区段的配置信息;及The controller scans the configuration information section, and reads the configuration information of the configuration information subsection for the configuration information subsection set with the update signal; and
该控制器扫描该配置信息区段,对未设定该更新信号的该配置信息子区段,直接累加计算该配置信息子区段的配置信息。The controller scans the configuration information section, and directly accumulates and calculates the configuration information of the configuration information subsection for which the update signal is not set.
本发明将储存容体配置信息划分为若干份;且在一控制单元中设置容体配置信息分析结果暂存区,以记录分段分析结果;向应用系统写入配置信息时,即以特定标记标示该分段分析结果须予更新;其系统并未写入而无需更新的分段予以累加计算,仅针对具有特定标示而需更新的分段,进行读取储存媒体取得配置信息,以便执行统计运算及更新分段记录信息的操作。因此,在两次更新容体配置信息计算期间,仅针对有写入改变储存媒体所记录配置信息的分段位置,进行读取及计算更新记录的操作,可大幅降低更新配置信息所需的时间,进而达到提高存取效果的目的。The present invention divides the storage capacity configuration information into several parts; and sets a temporary storage area for the analysis result of the capacity configuration information in a control unit to record the segmented analysis results; when writing the configuration information to the application system, mark the specific mark Segment analysis results must be updated; the system has not written into the segments that do not need to be updated, and the cumulative calculation is performed. Only for the segments with specific marks that need to be updated, the storage medium is read to obtain configuration information, so as to perform statistical calculations and An operation to update segment record information. Therefore, during the calculation period of updating the configuration information of the container twice, only the operation of reading and calculating the updated record is performed for the segment position where the configuration information recorded in the storage medium has been changed, which can greatly reduce the time required for updating the configuration information. Thereby, the purpose of improving the access effect is achieved.
本发明的分析可携式储存装置储存容量的方法,步骤还包括:In the method for analyzing the storage capacity of the portable storage device of the present invention, the steps further include:
在一储存媒体中设置一容体信息记录区;setting a volume information recording area in a storage medium;
开机时由该容体信息记录区载入容体信息至一控制器;loading volume information from the volume information recording area to a controller when starting up;
当有数据写入而改变一配置信息区的配置信息时,该控制器则扫描该配置信息区,并更新容体信息;及When data is written to change configuration information in a configuration information area, the controller scans the configuration information area and updates the volume information; and
每当该控制器完成扫描更新容体信息后,随即将更新后的信息储存在该容体信息记录区。Whenever the controller finishes scanning and updates the volume information, it stores the updated information in the volume information recording area.
本发明在储存媒体中设置一专属区间保存记录容体配置信息各区段统计结果,在每次更新完成后储存装置控制器随即将统计结果储存记录于专属区间;在下回储存装置启动时,即可直接将上次离线或关闭之前最后更新的结果,直接从储存媒体中载入控制器;免除重新启动时须进行完整扫描更新容体配置信息的必要。In the present invention, an exclusive section is set in the storage medium to save and record the statistical results of each section of the volume configuration information. After each update is completed, the storage device controller immediately stores and records the statistical results in the exclusive section; when the storage device is started next time, it can directly The last update result before offline or shutdown is directly loaded into the controller from the storage medium; it eliminates the need to perform a complete scan to update the volume configuration information when restarting.
本发明另提供一种分析可携式储存装置储存容量的方法,具体的步骤如下:The present invention also provides a method for analyzing the storage capacity of a portable storage device, the specific steps are as follows:
判断一应用系统对该可携式储存装置的一写入指令是否影响该可携式储存装置内一储存媒体的一配置信息表;judging whether a write command of an application system to the portable storage device affects a configuration information table of a storage medium in the portable storage device;
分析写入数据所对应的该配置信息表,并设定一标示信号;Analyzing the configuration information table corresponding to the written data, and setting a flag signal;
触发一延迟周期,开始计时;Trigger a delay period and start timing;
到达该延迟周期的周期时间时,更新该延迟周期内须更新的扫描该配置信息表;及When the cycle time of the delay period is reached, update the scanning configuration information table that needs to be updated within the delay period; and
扫描该配置信息表,更新该可携式储存装置储存容量的记录。The configuration information table is scanned to update the storage capacity record of the portable storage device.
本发明当写入操作产生首次触发更新时,启动一延迟更新周期计时;在延迟更新周期计时期间,不执行更新操作;在达到延迟更新周期时,一次更新在此延迟更新周期间所有受写入动作影响的容体配置信息。由于在触发过程采取延时触发批次处理的方式,减少执行更新容体配置信息的频率,可达到降低更新容体配置信息对存取效果发生的影响。In the present invention, when the write operation generates the first trigger update, a delayed update cycle timing is started; during the delayed update cycle timing, the update operation is not performed; The container configuration information affected by the action. Since the delay triggering batch processing method is adopted in the triggering process, the frequency of updating the volume configuration information is reduced, and the impact of updating the volume configuration information on the access effect can be reduced.
本发明又提供一种分析可携式储存装置储存容量的方法,步骤包括:The present invention further provides a method for analyzing the storage capacity of a portable storage device, the steps comprising:
提供一扫描子区段的限制,使一控制器根据该扫描子区段的限制扫描一配置信息区段;providing a scan sub-section limit, so that a controller scans a configuration information segment according to the scan sub-section limit;
载入该配置信息子区段扫描记录起始位址;Load the start address of the configuration information sub-section scan record;
检查该配置信息子区段是否需要更新;Check whether the configuration information subsection needs to be updated;
若该配置信息子区段需要更新,则扫描该配置信息子区段;If the configuration information subsection needs to be updated, scan the configuration information subsection;
扫描该配置信息子区段后,更新该配置信息子区段扫描记录;After scanning the configuration information subsection, update the configuration information subsection scanning record;
更新该配置信息子区段扫描记录后,判断是否已达该扫描子区段的限制;After updating the scanning record of the configuration information sub-section, it is judged whether the limit of the scanning sub-section has been reached;
若判断已达该扫描子区段的限制,则中断操作返回待命;If it is judged that the limit of the scanning subsection has been reached, the interrupt operation returns to standby;
若判断该配置信息资子区段不需要更新或未达该扫描子区段的限制,则直接累计该配置信息子区段的配置信息;及If it is judged that the configuration information sub-section does not need to be updated or the limit of the scanning sub-section is not reached, the configuration information of the configuration information sub-section is directly accumulated; and
检查是否已完成全部该配置信息子区段的累计。Check whether the accumulation of all the configuration information subsections has been completed.
本发明在批次扫描执行更新操作中,累计执行分段扫描的次数,若累计达到一较大数目的次数,而恐怕会影响正常存取时,随即终止容体配置信息更新操作,返回正常存取操作,而因分段更新结果均已记录于控制器内,下回启动更新操作时,直接累计已更新区段,并迅速进入未更新区段进行扫描更新。可限定执行容体配置信息更新操作的最大区间,避免影响正常启动或存取操作。In the present invention, in the update operation of batch scan execution, the number of segmented scans is accumulated. If the accumulated number of times reaches a relatively large number, which may affect normal access, the update operation of the volume configuration information is immediately terminated, and the normal access is returned. operation, and because the segment update results have been recorded in the controller, when the update operation is started next time, the updated segments will be accumulated directly, and the unupdated segments will be scanned and updated quickly. The maximum interval for performing the update operation of the volume configuration information can be limited, so as to avoid affecting normal startup or access operations.
附图说明 Description of drawings
图1是公知的配置信息更新控制流程图;Fig. 1 is a known configuration information update control flow chart;
图2是公知的配置信息更新操作程序;Fig. 2 is a known operating procedure for updating configuration information;
图3是为本发明较佳实施例的容体配置信息分段扫描暂存数据示意图;Fig. 3 is a schematic diagram of segmental scanning of temporarily stored data for volume configuration information in a preferred embodiment of the present invention;
图4是为本发明较佳实施例的限制扫描配置信息子区段的流程图;FIG. 4 is a flow chart of a subsection of restricted scan configuration information in a preferred embodiment of the present invention;
图5A是为本发明较佳实施例的容体信息记录区动作示意图;FIG. 5A is a schematic diagram of the operation of the volume information recording area in a preferred embodiment of the present invention;
图5B是为本发明较佳实施例的容体信息记录区动作示意图;FIG. 5B is a schematic diagram of the operation of the volume information recording area in a preferred embodiment of the present invention;
图6是为本发明较佳实施例的写入数据与触发更新配置信息的时序图;及FIG. 6 is a timing diagram for writing data and triggering updating configuration information in a preferred embodiment of the present invention; and
图7是为本发明较佳实施例的延时触发配置信息更新控制流程图。Fig. 7 is a flow chart of delay trigger configuration information update control in a preferred embodiment of the present invention.
下面是主要元件的附图标记说明:The following is a description of the reference numerals of the main components:
储存媒体1
配置信息区段12
配置信息子区段121
容体信息记录区14Volume
储存媒体的总容量VThe total capacity of storage media V
配置信息区段的起始位址SThe start address S of the configuration information section
配置信息区段的长度LThe length L of the configuration information section
配置信息子区段的数目MThe number of configuration information subsections M
配置信息子区段的长度NThe length N of the configuration information subsection
具体实施方式 Detailed ways
为了能更进一步了解本发明为达成预定目的所采取的技术、手段及功效,请参阅以下有关本发明的详细说明与附图,相信本发明的目的、特征与特点,能由此得以被深入且具体了解,然而,所附的附图仅用于提供参考与说明,并非用来对本发明加以限制。In order to further understand the technology, means and effects that the present invention adopts to achieve the predetermined purpose, please refer to the following detailed description and accompanying drawings of the present invention. In particular, however, the accompanying drawings are only for reference and description, and are not intended to limit the present invention.
可携式储存装置由控制器扫描容体配置信息表,得以掌握储存媒体内的配置情况。当一个系统向储存媒体中写入数据,此时储存媒体中的配置信息会对应其写入数据来更新配置信息,而让控制器扫描后得知储存媒体内实际的配置情形。请参阅图3,其是本发明较佳实施例的容体配置信息分段扫描暂存数据示意图。一以FAT32规划的储存媒体1,其中储存媒体1的容量为十亿位元组(1GB),而其配置信息区段12的大小为一百万位元组(1MB),有2048个扇区(sector)。The controller of the portable storage device scans the volume configuration information table, so as to grasp the configuration situation in the storage medium. When a system writes data into the storage medium, the configuration information in the storage medium will update the configuration information corresponding to the written data, so that the controller can know the actual configuration in the storage medium after scanning. Please refer to FIG. 3 , which is a schematic diagram of segmental scanning of temporarily stored data of volume configuration information according to a preferred embodiment of the present invention. A
首先将配置信息区段12分为100等份的配置信息子区段121,所以每个配置信息子区段121便有20个扇区,然而将其储存媒体1的容量分为100等份,每一等份为一千万位元组(10MB)。所以,若向储存媒体1内写入10MB以内的数据,配置信息区段12更新其对应的一个配置信息子区段121,以表示对应的储存媒体有所变动,并以一标示信号标记此配置信息子区段121,该标示信号为表示此配置信息子区段121的容体信息分析结果需要更新的信号。换言之,其标示特定标示信号的配置信息子区段121,是表示该配置信息子区段121所对应的储存媒体的内容已有所变更,而其特定的标示信号供控制器(图未示)来辨识以扫描分析其更新的容体信息。例如此一配置信息子区段121的标示信号为“1”,则为对应的储存媒体有所变动,此一配置信息子区段121的容体信息分析结果需要更新;若此一配置信息子区段121的标示信号为“0”,则为对应的储存媒体没有变动,此一配置信息子区段121的容体信息分析结果不需要更新。如此,在控制器计算容量时,可根据分段的配置信息子区段121来分段扫描分析,且记录分段分析的结果于控制器中所设置的容体配置信息分析结果暂存区(图未示)。然而控制器在进行分析统计容体配置状况时,于系统并未写入数据于储存媒体1而无需更新的配置信息子区段121予以累加计算,而仅针对特定的标示信号而须更新的配置信息子区段121,进行读取储存媒体取得配置信息。因此,若在储存媒体1上读写10MB以内的数据,控制器仅需扫描一个配置信息子区段121,即为20个扇区,不必从头到尾的扫描全部2048个扇区。Firstly, the
另外,配置信息区段12的分段亦可为不等份的子区段,而上述标示信号亦可为一旗标信号来表示。In addition, the segments of the
接着以ANSI C语言为例说明储存媒体1的平均分割方式,假设储存媒体1的容量为V(单位为磁区),经文件系统格式化后,其配置信息区段(例如:FAT-File Allocation Table)位于储存媒体1的起始位置S,其配置信息区段长度为L(单位为磁区);控制器中设置配置信息分析结果暂存区可记录配置信息子区段121统计信息最多M组,则每一组分段统计结果代表配置信息子区段121长度N的计算方式为:Next, the ANSI C language is used as an example to illustrate the average partition method of the
if((L%M)!=0){if((L%M)!=0){
N=INT(L/M)+1;N=INT(L/M)+1;
}else{}else{
N=L/M;N=L/M;
}}
但是,应注意其中L/M未能整除(L%M!=0)时,最后一组暂存区所表示的配置信息子区段121长度为:However, it should be noted that when L/M is not evenly divisible (L%M!=0), the length of the
N_last_entry=L%N;N_last_entry = L%N;
借由上述分段的方法,仅针对有写入数据而改变配置信息的配置信息子区段121,进行读取及计算更新记录的操作,可大幅降低更新配置信息所需的时间,进而达到提高存取效果的目的。By means of the above segmentation method, the operations of reading and calculating update records are performed only for the
但当可携式储存装置开机时,必须先扫描整个配置信息区段12,将会影响开机程序,而拖延到开机的时间;或是当写入数据比较大时,也需要扫描多个配置信息子区段121,其有可能影响工作效果。所以在执行分段扫描时,可限制控制器扫描配置信息子区段121的数目,当控制器扫描配置信息子区段121的数目达到限制的数目,将中断扫描并返回开机或读写程序,下回启动更新操作时,因分段更新结果均已记录于控制器暂存区内,直接累计已更新区段,再迅速进入扫描更新未更新的配置信息子区段121,以此循环至扫描更新完整个配置信息区段或所需更新的配置信息子区段121。例如限制扫描次数为10,所以控制器每扫描10个配置信息资子区段121便将结果记录于控制器内的暂存区后即返回执行开机或读写程序,等下回启动更新操作时直接累计已更新的配置信息子区段121,并继续扫描未更新的配置信息子区段121,如此以降低扫描配置信息区段操作对开机及读写操作的影响。However, when the portable storage device is turned on, it is necessary to scan the entire
请参阅图4,其是本发明较佳实施例的限制扫描配置信息子区段的流程图,首先由控制器内的暂存区内载入配置信息子区段扫描记录的起始位址(如图4中的步骤S401)。然后检查配置信息子区段上的更新旗标,以判断其配置信息子区段是否需要更新(如图4中的步骤S403)。若需要更新则开始扫描其配置信息子区段(如图4中的步骤S405),接着更新配置信息子区段的扫描记录,并清除更新旗标(如图4中的步骤S407)。清除更新旗标后便判断扫描子区段限制是否已达(如图4中的步骤S409),若已达扫描子区段限制,则中断扫描更新操作,并将该配置信息子区段更新结果储存在控制器中的一暂存区(如图4中的步骤S411),然后返回待命(如图4中的步骤S423)。若未达扫描子区段限制或是检查更新旗标后判断其配置信息子区段不需要更新,则直接累计配置信息子区段的配置信息(如图4中的步骤S413)。累计配置信息子区段的配置信息后,判断是否已完成全部配置信息子区段的累计(如图4中的步骤S415)。若尚未完成全部配置信息子区段的累计,则累进配置信息子区段的扫描位址,接着返回步骤S403检查下一个配置信息子区段的更新旗标(如图4中的步骤S417)。若已完成全部配置信息子区段的累计,则控制器更新配置信息并写入储存媒体内的一储存区间(如图4中的步骤S419)。接着驱动显示装置并更新剩余容量的显示(如图4中的步骤S421),然后返回待命(如图4中的步骤S423)。Please refer to Fig. 4, which is a flow chart of limiting scanning of configuration information subsections in a preferred embodiment of the present invention. First, the start address ( As shown in step S401 in Figure 4). Then check the update flag on the configuration information subsection to determine whether the configuration information subsection needs to be updated (step S403 in FIG. 4 ). If update is required, scan the configuration information subsection (step S405 in FIG. 4 ), then update the scanning record of the configuration information subsection and clear the update flag (step S407 in FIG. 4 ). After clearing the update flag, it is judged whether the scan sub-section limit has been reached (step S409 in Figure 4), if the scan sub-section limit has been reached, the scan update operation is interrupted, and the configuration information sub-section update result Store in a temporary storage area in the controller (as in step S411 in FIG. 4 ), and then return to standby (as in step S423 in FIG. 4 ). If the scanning sub-section limit is not reached or the configuration information sub-section does not need to be updated after checking the update flag, the configuration information of the configuration information sub-section is directly accumulated (step S413 in FIG. 4 ). After accumulating the configuration information of the configuration information sub-sections, it is judged whether the accumulation of all the configuration information sub-sections has been completed (step S415 in FIG. 4 ). If the accumulation of all configuration information subsections has not been completed, the scanning address of the configuration information subsection is incremented, and then returns to step S403 to check the update flag of the next configuration information subsection (step S417 in FIG. 4 ). If the accumulation of all configuration information subsections is completed, the controller updates the configuration information and writes it into a storage interval in the storage medium (eg, step S419 in FIG. 4 ). Then drive the display device and update the display of the remaining capacity (step S421 in FIG. 4 ), and then return to standby (step S423 in FIG. 4 ).
借由上述限制扫描子区段的方法,可限定执行容体配置信息更新操作最大期间,避免影响正常启动或存取操作;因分段更新结果均已记录于控制器内,下回启动更新操作时,直接累计已更新区段,并迅速进入未更新区段进行扫描更新。By means of the above-mentioned method of limiting the scanning of sub-sections, the maximum period for performing volume configuration information update operations can be limited to avoid affecting normal startup or access operations; because the segment update results have been recorded in the controller, when the update operation is started next time , directly accumulating the updated section, and quickly enter the unupdated section to scan and update.
请参阅图5A,其是本发明较佳实施例的容体信息记录区动作示意图。本发明另提供一方法解决可携式储存装置开机时,必须先扫描整个配置信息区段12,将影响开机程序而拖延到开机时间的问题。在储存媒体1中设置一容体信息记录区14来记录容体配置信息区段12的统计结果。当有数据写入而改变配置信息区段12的配置信息时,控制器则执行扫描更新配置信息区段12,而在每次扫描更新配置信息区段12后,储存装置控制器(图未示)随即将统计结果储存记录于容体信息记录区14。请参阅图5B,其是本发明较佳实施例的容体信息记录区动作示意图。在下回储存装置启动时,即可直接将上次离线或关闭前,最后更新的结果直接由容体信息记录区14中载入控制器的暂存区中,借此免除重新启动时须进行完整扫描更新配置信息区段12的必要,而供控制器掌握信息配置情况以分析统计储存装置的容体信息。Please refer to FIG. 5A , which is a schematic diagram of the operation of the volume information recording area in a preferred embodiment of the present invention. The present invention also provides a method to solve the problem that the entire
另外,配置信息区段12亦可如上述分段的方法进行扫描更新,即在有所变动的配置信息区段12的分段设置一标示信号,该标示信号可为一旗标信号,控制器根据该标示信号扫描更新配置信息区段12的记录,并分析统计出储存装置的容体信息后储存于容体信息记录区14中。In addition, the
当一应用系统向储存媒体写入数据而使配置信息区段有所变动时,必须启动一触发更新,以让控制器读取储存媒体的配置信息。但应用系统再写入数据时,常受限于电器介面、通讯协定、指令集、缓冲区大小及系统分时多工等需求,未必一次将所有拟写入的信息全部完成,而往往就一连续区间分多次写入。When an application system writes data to the storage medium to change the configuration information section, a trigger update must be initiated to allow the controller to read the configuration information of the storage medium. However, when the application system rewrites data, it is often limited by the requirements of electrical interface, communication protocol, instruction set, buffer size, and system time-division multiplexing. The continuous interval is divided into multiple writes.
请参阅图6,其是本发明较佳实施例的写入数据与触发更新配置信息的时序图,系统向储存媒体写入一数据D1,而由上述影响分为数据d11、数据d12、数据d13、数据d14、数据d15及数据d16来写入。而以往每写入一笔数据,配置信息表将各会启动一次触发更新(R11、R12、R13、R14、R15及R16)。然而这样多次中断或暂缓写入操作,执行配置信息更新操作频率过高的结果,势必会大幅影响正常数据存取操作的效果。另外,若数据写完后触发更新的时间t1为0.1秒,而t2为0.2的话,对使用者来说如此短时间的更新似乎无太大意义。Please refer to FIG. 6, which is a timing diagram of writing data and triggering updating configuration information in a preferred embodiment of the present invention. The system writes a data D1 to the storage medium, and is divided into data d11, data d12, and data d13 by the above-mentioned influence. , data d14, data d15 and data d16 to write. In the past, every time a piece of data is written, the configuration information table will trigger a trigger update (R11, R12, R13, R14, R15 and R16). However, as a result of interrupting or suspending the writing operation for many times and performing the configuration information update operation frequency too high, it is bound to greatly affect the effect of the normal data access operation. In addition, if the time t1 to trigger the update after the data is written is 0.1 seconds, and t2 is 0.2, such a short time update does not seem to make much sense to the user.
所以,当系统写入数据D1其中的第一笔数据d11后,将触发第一次更新信号R11执行更新容体信息,写完第二笔数据d12后,触发第二次更新信号R12执行更新容体信息,直到写完数据D1的最后一笔数据d16后,触发第六次更新信号R16执行更新容体信息。为了降低影响正常数据存取操作的效果,可将其中部分的更新触发动作省略,仅利用第一个写入数据所触发的更新信号来触发延迟扫描开始计时,在一延迟周期内的更新信号都不执行更新扫描,当到达延迟周期的时间所触发的更新信号时,再将之前写入数据而变更的配置信息表作一次更新。Therefore, when the system writes the first data d11 in data D1, it will trigger the first update signal R11 to update the volume information, and after writing the second data d12, it will trigger the second update signal R12 to update the volume information , until the last piece of data d16 of the data D1 is written, the sixth update signal R16 is triggered to update the capacity information. In order to reduce the effect of affecting normal data access operations, some of the update trigger actions can be omitted, and only the update signal triggered by the first written data is used to trigger the delayed scan to start timing. The update signals within a delay period are all The update scan is not performed, and when the update signal triggered by the time of the delay period arrives, the configuration information table changed by writing data before is updated once again.
也就是说,当数据D1其中的第一笔数据d11写完后触发更新信号R11动作,此时开始计时一个延迟周期T,并设定一更新旗标表示数据d11写入储存媒体,而该数据d11所写入的储存媒体位址其对应的配置信息表已有变更,另于延迟周期T内的触发更新信号R11、R12、R13及R14都不执行更新配置信息表的动作,而分别设定一更新旗标于对应的配置信息表。而在延迟周期T到达时,将根据延迟周期T内所触发的更新信号R11、R12、R13及R14一起一次更新配置信息表。当数据d15写完,触发更新信号R15动作,并设定一更新旗标于其对应的配置信息表。而数据d16写完后,触发更新信号R16,并设定一更新旗标于其对应的配置信息表。而D2中数据d21写完后,触发更新信号R21,并设定一更新旗标于其对应的配置信息表。然而,触发更新信号R15、R16及R21,这都是在延迟周期T中,当延迟周期T到达时,一起一次更新配置信息表。接着数据D2中的数据d22写入完毕,其触发更新信号R22动作,而d23写入完毕,其触发更新信号R23动作。分别设定一更新旗标于其对应的配置信息表,等待下一个延迟周期T到达时,连同延迟周期内需要更新的配置信息表作一次更新。同理继续执行之后的数据写入及配置信息表更新扫描的动作,当延迟周期T时间到达时一次扫描更新延迟周期T内需要更新的配置信息表,最后由储存装置的控制器根据配置信息表的更新旗标,扫描分析储存媒体的容体信息。That is to say, when the first data d11 in the data D1 is written, the update signal R11 is triggered to act. At this time, a delay period T is started, and an update flag is set to indicate that the data d11 is written into the storage medium, and the data The configuration information table corresponding to the storage medium address written in d11 has been changed, and the trigger update signals R11, R12, R13, and R14 within the delay period T do not perform the action of updating the configuration information table, but set An update flag is assigned to the corresponding configuration information table. When the delay period T arrives, the configuration information table will be updated once according to the update signals R11 , R12 , R13 and R14 triggered within the delay period T. When the data d15 is written, the update signal R15 is triggered to act, and an update flag is set in its corresponding configuration information table. After the data d16 is written, the update signal R16 is triggered, and an update flag is set in its corresponding configuration information table. After the data d21 in D2 is written, the update signal R21 is triggered, and an update flag is set in its corresponding configuration information table. However, the trigger update signals R15 , R16 and R21 are all within the delay period T, and when the delay period T arrives, the configuration information table is updated together at one time. Then the writing of data d22 in the data D2 is completed, which triggers the action of the update signal R22 , and the writing of d23 is completed, which triggers the action of the update signal R23 . An update flag is respectively set in its corresponding configuration information table, and when the next delay period T arrives, an update is performed together with the configuration information tables that need to be updated within the delay period. In the same way, continue to execute the subsequent data writing and configuration information table update scanning actions. When the delay period T time arrives, a scan updates the configuration information table that needs to be updated within the delay period T, and finally the controller of the storage device according to the configuration information table scan and analyze the volume information of the storage medium.
请参阅图7,其是本发明较佳实施例的延时触发配置信息更新控制流程图。首先,可携式储存装置与一应用系统连线,启动系统端通讯协定并向控制器载入储存媒体内配置信息的初始记录(如图7中的步骤S701),检查应用系统是否下达指令(如图7中的步骤S703),若应用系统没有下达指令则执行步骤S705,则将可携式储存装置处于待命状态(如图7中的步骤S705)。于待命状态后要判断更新扫描信号是否已触发(如图7中的步骤S719)。又若应用系统有下达指令,则判断指令是否为读取或取得状态(如图7中的步骤S707),若应用系统所下的指令为读取或取得状态,则直接执行指令不进行更新扫描配置信息区(如图7中的步骤S709),接着返回步骤S705。若应用系统所下的指令不是读取或取得状态,则判断应用系统所写入的指令是否使配置信息区有所变动(如图7中的步骤S711)。若应用系统所写入的指令不影响配置信息区,则返回步骤S709。若应用系统所写入的指令使配置信息区有所变动,便分析写入的位置并设定更新旗标(如图7中的步骤S713)。接着执行写入操作完成数据传输(如图7中的步骤S714)。然后判断是否已触发延迟更新周期的计时(如图7中的步骤S715),若尚未触发延迟更新周期的计时,则触发延迟更新周期的计时(如图7中的步骤S717)。操作完成后判断更新扫描信号是否已触发(如图7中的步骤S719)。若更新扫描信号没有触发,则返回步骤S703。若更新扫描信号已触发,则判断延迟更新周期是否已到达(如图7中的步骤S721)。若延迟更新周期未达,则返回步骤S703,并于待命状态下持续检查更新周期是否已达。若延迟更新周期已达,则根据更新旗标分段扫描配置信息区,并记录更新累计操作(如图7中的步骤S723)。接着判断是否中断扫描(如图7中的步骤S725),这可根据是否已达分段扫描的限制来判断。若执行中断扫描则返回步骤S703,检查是否接获应用系统下达指令,并优先予以执行。若不执行中断扫描,则更新配置信息显示内容(如图7中的步骤S727)。Please refer to FIG. 7 , which is a flow chart of delay-triggered configuration information update control in a preferred embodiment of the present invention. First, the portable storage device is connected to an application system, starts the system-side communication protocol and loads the initial record of the configuration information in the storage medium to the controller (step S701 in Figure 7), and checks whether the application system has issued an instruction ( Step S703 in FIG. 7 ), if the application system does not issue an instruction, step S705 is executed, and the portable storage device is placed in a standby state (step S705 in FIG. 7 ). After the standby state, it is necessary to determine whether the update scanning signal has been triggered (step S719 in FIG. 7 ). If the application system has issued an instruction, it is judged whether the instruction is in the state of reading or obtaining (step S707 in Figure 7), if the instruction issued by the application system is in the state of reading or obtaining, then the instruction is directly executed without updating scan Configure the information area (as shown in step S709 in Figure 7), and then return to step S705. If the command issued by the application system is not to read or obtain the state, it is judged whether the command written by the application system changes the configuration information area (step S711 in FIG. 7 ). If the command written by the application system does not affect the configuration information area, return to step S709. If the command written by the application system changes the configuration information area, analyze the written position and set an update flag (step S713 in FIG. 7 ). Next, a write operation is performed to complete data transmission (eg, step S714 in FIG. 7 ). Then determine whether the timing of the delayed update cycle has been triggered (step S715 in FIG. 7), if the timing of the delayed update cycle has not been triggered, then the timing of the delayed update cycle is triggered (step S717 in FIG. 7). After the operation is completed, it is judged whether the update scanning signal has been triggered (step S719 in FIG. 7). If the update scanning signal is not triggered, return to step S703. If the update scan signal is triggered, it is determined whether the delayed update period has arrived (step S721 in FIG. 7 ). If the delayed update period has not been reached, return to step S703, and continuously check whether the update period has been reached in the standby state. If the delay update period has been reached, the configuration information area is scanned in segments according to the update flag, and the update accumulation operation is recorded (step S723 in FIG. 7 ). Then judge whether to interrupt the scan (step S725 in FIG. 7 ), which can be judged according to whether the limit of segmented scan has been reached. If the scan is interrupted, return to step S703, check whether an instruction from the application system is received, and execute it preferentially. If the interrupt scan is not performed, the display content of the configuration information is updated (step S727 in FIG. 7).
但是,以上所述,仅为本发明较佳的具体实施例的详细说明与附图,而本发明的特征并不局限于此,并非用以限制本发明,本发明的所有范围应以其权利要求为准,凡合于本发明权利要求的精神与其类似变化的实施例,皆应包含于本发明的范畴中,任何熟悉该项技艺者在本发明的领域内,可轻易想到的变化或修饰皆可涵盖于本发明的权利要求的范围。However, the above description is only a detailed description and accompanying drawings of preferred specific embodiments of the present invention, and the features of the present invention are not limited thereto, and are not intended to limit the present invention. All scope of the present invention should be defined by its rights Requirements prevail, and all embodiments that conform to the spirit of the claims of the present invention and similar changes thereof shall be included in the scope of the present invention, and any changes or modifications that can be easily conceived by those skilled in the art in the field of the present invention All can fall within the scope of the claims of the present invention.
Claims (23)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2005101304077A CN100487818C (en) | 2005-12-09 | 2005-12-09 | Method for analyzing storage capacity of portable storage device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2005101304077A CN100487818C (en) | 2005-12-09 | 2005-12-09 | Method for analyzing storage capacity of portable storage device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1979689A CN1979689A (en) | 2007-06-13 |
| CN100487818C true CN100487818C (en) | 2009-05-13 |
Family
ID=38130812
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB2005101304077A Expired - Fee Related CN100487818C (en) | 2005-12-09 | 2005-12-09 | Method for analyzing storage capacity of portable storage device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN100487818C (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1295332A (en) * | 1999-10-29 | 2001-05-16 | 惠普公司 | MRAM device having digital detection amplifier |
| CN1349226A (en) * | 2000-10-17 | 2002-05-15 | 三菱电机株式会社 | Thin film magnet storage device for writing easy-control data into current |
-
2005
- 2005-12-09 CN CNB2005101304077A patent/CN100487818C/en not_active Expired - Fee Related
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1295332A (en) * | 1999-10-29 | 2001-05-16 | 惠普公司 | MRAM device having digital detection amplifier |
| CN1349226A (en) * | 2000-10-17 | 2002-05-15 | 三菱电机株式会社 | Thin film magnet storage device for writing easy-control data into current |
Also Published As
| Publication number | Publication date |
|---|---|
| CN1979689A (en) | 2007-06-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101331463B (en) | Optimize memory write and wear performance | |
| CN107608908B (en) | Wear leveling method for data storage devices | |
| JP4802284B2 (en) | Semiconductor memory device and control method thereof | |
| CN113867645B (en) | Data migration and data reading and writing method and device, computer equipment and storage medium | |
| CN105808163B (en) | A method and server for accessing a shingled magnetic recording SMR hard disk | |
| CN110673789B (en) | Metadata storage management method, device, equipment and storage medium of solid-state hard disk | |
| CN102063943A (en) | NAND flash parameter automatic detection system | |
| CN107632942A (en) | A kind of method that solid state hard disc realizes LBA rank TRIM orders | |
| CN110674056B (en) | Garbage recovery method and device | |
| CN109240939B (en) | Method for rapidly processing solid state disk TRIM | |
| EP3346387A1 (en) | Storage system and system garbage collection method | |
| JP6975202B2 (en) | Recovery process and equipment from momentary interruptions, and computer-readable storage media | |
| CN101582084A (en) | Method and device for data storage | |
| WO2025194825A1 (en) | Abnormal power-down processing method and apparatus, device, medium and product | |
| CN107229580B (en) | Sequence flow detection method and device | |
| US9910788B2 (en) | Cache access statistics accumulation for cache line replacement selection | |
| CN103176753A (en) | Storage device and data management method of storage device | |
| CN115756619B (en) | Hard disk startup method, device, equipment, medium and program product | |
| CN100487818C (en) | Method for analyzing storage capacity of portable storage device | |
| TW202326439A (en) | Method for automatic deletion and persistent storage device | |
| US10168944B2 (en) | Information processing apparatus and method executed by an information processing apparatus | |
| JP2018088212A (en) | Information control device, information control method, and program | |
| TWI417889B (en) | Write timeout methods for a flash memory and memory device using the same | |
| US8166243B2 (en) | Information processing system and program for controlling the information processing system | |
| CN108958657A (en) | A kind of date storage method, storage equipment and storage system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| C17 | Cessation of patent right | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090513 Termination date: 20131209 |