JP2005202942A - Information recording medium, data processor and data processing method - Google Patents

Information recording medium, data processor and data processing method Download PDF

Info

Publication number
JP2005202942A
JP2005202942A JP2004361668A JP2004361668A JP2005202942A JP 2005202942 A JP2005202942 A JP 2005202942A JP 2004361668 A JP2004361668 A JP 2004361668A JP 2004361668 A JP2004361668 A JP 2004361668A JP 2005202942 A JP2005202942 A JP 2005202942A
Authority
JP
Japan
Prior art keywords
data
logical
recording medium
area
data processing
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.)
Pending
Application number
JP2004361668A
Other languages
Japanese (ja)
Inventor
Hirokazu So
広和 宗
Shinji Inoue
信治 井上
Makoto Ochi
誠 越智
Takuji Maeda
卓治 前田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2004361668A priority Critical patent/JP2005202942A/en
Publication of JP2005202942A publication Critical patent/JP2005202942A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Memory System (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an information recording medium effective for defragmentation of data, for example, a data processor and a data processing method that achieve data processing at high speed and prevention of shortening of the life of memory. <P>SOLUTION: The recording medium (100) comprises a logical-physical conversion table (140) for storing correspondence between a logical address and a physical address of each block of a memory area (130). The recording medium (100) further has a function of replacing the correspondence between the logical address and the physical address in the logical-physical conversion table (140) for a group of logical addresses upon receipt of a predetermined replacement command. The data processor (200) issues a replacement command to the recording medium (100) so that data are located at contiguous areas in a logical address space, thereby executing defragmentation on the logical address space. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、ディジタルデータを格納する情報記録媒体及びその情報記録媒体に格納されたデータの移動処理を行うデータ処理装置及びデータ処理方法に関する。   The present invention relates to an information recording medium for storing digital data, a data processing apparatus and a data processing method for performing movement processing of data stored in the information recording medium.

近年、ディジタルデータの読み書きが可能な記録媒体としてSDメモリカード(登録商標)やメモリスティック(登録商標)、コンパクトフラッシュ(登録商標)といった半導体メモリが普及してきている。   In recent years, semiconductor memories such as an SD memory card (registered trademark), a memory stick (registered trademark), and a compact flash (registered trademark) have become widespread as recording media capable of reading and writing digital data.

これらの半導体メモリを使ってデータを処理するデータ処理装置は、パーソナルコンピュータ、音響機器、映像機器、携帯電話、デジタルカメラなどの電化製品を始め、多岐に渡っている。   Data processing devices that process data using these semiconductor memories are diverse, including electrical appliances such as personal computers, audio equipment, video equipment, mobile phones, and digital cameras.

半導体メモリに格納されるデータはファイルシステムを利用し、ファイル形式でアドレスやサイズ等を管理されることが多い。例えばSDメモリカード(登録商標)の場合にはFAT(ファイル アロケーション テーブル)ファイルシステムが採用されている。   In many cases, data stored in a semiconductor memory uses a file system to manage addresses, sizes, and the like in a file format. For example, in the case of an SD memory card (registered trademark), a FAT (file allocation table) file system is employed.

そのような場合、半導体メモリに対してサイズの異なるファイルの書き込みやファイルの削除を何度も繰り返すことによって、FATファイルシステムの管理情報が断片化された状態になる。すなわち、データを格納した各ファイルや空き領域は、論理アドレス空間上で、離散した状態で存在することになる。断片化によって管理情報が複雑化するために、ファイル読み出しのオーバーヘッドの増加や、ファイル書き込みのための空き領域の検索時間の増加という問題が発生する。さらに、半導体メモリによってはある一定サイズの大きさでデータを書き込むことにより書き込み処理が高速化されるものが存在するが、断片化が発生している場合には前記一定サイズの空き容量を確保できないために書き込み処理が遅くなるという問題が発生する。   In such a case, the management information of the FAT file system is fragmented by repeatedly writing and deleting files of different sizes to the semiconductor memory. That is, each file storing data and free space exists in a discrete state on the logical address space. Since management information becomes complicated due to fragmentation, problems such as an increase in overhead of reading a file and an increase in search time of a free area for writing a file occur. Furthermore, some semiconductor memories have data written at a certain size to speed up the writing process. However, when fragmentation occurs, it is not possible to secure the certain size of free space. This causes a problem that the writing process is slow.

例えば、断片化による管理情報の複雑化は以下のように処理速度の低下を招く。半導体メモリに対してデータの書き込み、読み出しを行うデータ処理装置は、半導体メモリのファイルシステムに関する情報(例えば、リンク情報)をRAM上に読み出して利用する。通常、データ処理装置はRAM容量の制限から、ファイルシステムの情報を全てRAMにロードせず、部分的にファイルシステムの情報をRAM上にロードして利用する。データアクセス時に必要な情報がRAM上に存在しない場合、必要な情報が含まれた部分を再度ロードする。よって、論理アドレス空間上で断片化の程度が大きいと、RAM上にロードされたリンク情報を辿る際に、ファイルシステムの部分的な情報を次々にRAMへロードしなおす必要があり、処理速度の低下を招く。   For example, complication of management information due to fragmentation causes a reduction in processing speed as follows. A data processing apparatus that writes and reads data to and from a semiconductor memory reads and uses information (for example, link information) related to the file system of the semiconductor memory on a RAM. Normally, the data processing apparatus does not load all file system information into the RAM due to the limitation of the RAM capacity, but partially loads the file system information onto the RAM for use. If the information necessary for data access does not exist on the RAM, the portion including the necessary information is loaded again. Therefore, if the degree of fragmentation is large in the logical address space, it is necessary to reload partial information of the file system to the RAM one after another when tracing the link information loaded on the RAM. Incurs a decline.

そこで、この断片化を解消する方法として、連続した記録領域にデータが配置されるようにデータを並べ替えるデフラグ処理がある(例えば、特許文献1参照)。デフラグ処理は、アドレス空間上で離散した各ファイルのデータや空き領域を連続的な領域になるように並べ替えるものであり、一般的に物理アドレス空間上でのデータの移動処理を行うために時間がかかる。また、半導体メモリには一般に読み書きの回数に制限があるため、デフラグ処理によるデータの移動処理は半導体メモリの寿命を低下させるという問題もある。   Therefore, as a method of eliminating this fragmentation, there is a defragmentation process in which data is rearranged so that data is arranged in a continuous recording area (see, for example, Patent Document 1). Defragmentation is a process that rearranges the data and free space of each file that is discrete in the address space so as to become a continuous region, and generally requires time to perform data movement processing in the physical address space. It takes. Further, since the number of times of reading and writing is generally limited in the semiconductor memory, there is a problem that the data movement processing by the defragmentation process decreases the life of the semiconductor memory.

そのため、このデフラグ処理を適当なタイミングで開始するための方法(例えば、特許文献2参照)や、半導体メモリに対しては頻繁にデフラグ処理を行わないようにする方法(例えば、特許文献3参照)が提案されている。
特開2000−305818号公報 特開平8−339318号公報 特開2000−322307号公報
Therefore, a method for starting this defragmentation process at an appropriate timing (for example, see Patent Document 2), or a method for avoiding frequent defragmentation processing for a semiconductor memory (for example, see Patent Document 3). Has been proposed.
JP 2000-305818 A JP-A-8-339318 JP 2000-322307 A

上記の特許文献2、3の方法では、デフラグ処理を実行する際に、半導体メモリの記録領域の物理アドレス空間上で実際にデータを移動してデータの再配置を行っているため、依然としてデフラグ処理に時間がかかり、また、半導体メモリの寿命低下を引起こすという問題がある。   In the methods disclosed in Patent Documents 2 and 3 described above, when the defragmentation process is executed, the data is actually moved on the physical address space of the recording area of the semiconductor memory and the data rearrangement is performed. It takes a long time, and there is a problem that the life of the semiconductor memory is reduced.

本発明は、上記課題を解決しようとするものであり、その目的とするところは、データ処理の高速化かつメモリ寿命の低下の抑制を実現し、例えばデータの断片化解消に有効な情報記録媒体、並びにそのような情報記録媒体に対するデータ処理装置及びデータ処理方法を提供することにある。   An object of the present invention is to solve the above-described problems, and an object of the present invention is to realize an information recording medium that realizes high-speed data processing and suppresses a decrease in memory life, and is effective in eliminating data fragmentation, for example. The present invention also provides a data processing apparatus and a data processing method for such an information recording medium.

本発明に係る情報記録媒体は、データ処理装置によってデータの読み出し、書き込みが可能である。情報記録媒体は、データを格納するための記録領域を有し、記録領域の物理アドレスと論理アドレスの対応関係を格納する論物変換テーブルを格納するデータ格納部と、データ処理装置との通信を行うホストインタフェース部と、データ格納部及びホストインタフェース部に対し制御を行う制御部とを備える。制御部は、ホストインタフェース部を介してデータ処理装置から所定の置換コマンドを受信したときに、置換コマンドで指定される複数の論理アドレス間で、論物変換テーブルにおける論理アドレスに対する物理アドレスを置換する。   The information recording medium according to the present invention can be read and written by a data processing device. The information recording medium has a recording area for storing data, and communicates between a data storage unit that stores a logical-physical conversion table that stores a correspondence relationship between a physical address and a logical address of the recording area, and a data processing apparatus. A host interface unit to perform, and a control unit to control the data storage unit and the host interface unit. When the control unit receives a predetermined replacement command from the data processing device via the host interface unit, the control unit replaces the physical address for the logical address in the logical-physical conversion table between the plurality of logical addresses specified by the replacement command. .

本発明に係るデータ処理装置は、上記の情報記録媒体に対してデータの読み出し、書き込みを行う。データ処理装置は、情報記録媒体を装着するスロットと、スロットに装着された情報記録媒体に対するデータの入出力を行う入出力処理部と、入出力処理部を通じて記録媒体へ入出力するデータの処理を含む所定の制御を行うデータ処理部とを備える。データ処理部は記録媒体に対して置換コマンドを発行する機能を有する。   A data processing apparatus according to the present invention reads and writes data on the information recording medium. The data processing apparatus includes a slot into which an information recording medium is mounted, an input / output processing unit that inputs / outputs data to / from the information recording medium mounted in the slot, and processing of data that is input to and output from the recording medium through the input / output processing unit And a data processing unit that performs predetermined control. The data processing unit has a function of issuing a replacement command to the recording medium.

本発明に係るデータ処理方法は、データを格納するための記録領域を有し、その記録領域の物理アドレスと論理アドレスの対応関係を格納する論物変換テーブルを格納する情報記録媒体に格納されたデータを移動するための方法である。データ処理方法は、情報記録媒体の記録領域上でのデータの書き替え処理を伴わずに、移動前後の領域の間で、論物変換テーブルにおける論理アドレスに対する物理アドレスを置換する。   A data processing method according to the present invention has a recording area for storing data, and is stored in an information recording medium for storing a logical-physical conversion table for storing a correspondence relationship between a physical address and a logical address of the recording area. It is a method for moving data. In the data processing method, the physical address corresponding to the logical address in the logical-physical conversion table is replaced between the areas before and after the movement without rewriting the data on the recording area of the information recording medium.

上記のデータ処理方法において、さらに、情報記録媒体の記録領域において連続した領域にデータが格納されるように決定されたデータの移動先の一覧である移動先リストを作成し、情報記録媒体内のデータの断片化を解消するために、移動先リストに基づいて移動前後の領域を決定し、その決定した移動前後の領域に対して、論物変換テーブル上での論理アドレスに対する物理アドレスを置換するようにしてもよい。   In the above data processing method, a destination list that is a list of destinations of data determined to be stored in a continuous area in the recording area of the information recording medium is further created, In order to eliminate data fragmentation, the area before and after the movement is determined based on the movement destination list, and the physical address corresponding to the logical address on the logical-physical conversion table is replaced with the area before and after the movement. You may do it.

本発明によれば、情報記録媒体におけるデータ移動処理において、データの記録領域上での書き替え処理は実施せずに、論物変換テーブル上でのみデータ移動を行うので、高速なデータ移動処理が可能となる。また、データの記録領域上での書き替えは実施しないことから、メモリ寿命の低下を抑制できる。特に、データの断片化解消処理(デフラグ処理)を実行する際に本発明を適用することで、高速に、且つメモリ寿命の低下を抑制しつつデフラグ処理の実施が可能となる。   According to the present invention, in the data movement process in the information recording medium, the data movement is performed only on the logical-physical conversion table without performing the rewriting process on the data recording area. It becomes possible. In addition, since the data is not rewritten on the recording area, it is possible to suppress a decrease in the memory life. In particular, by applying the present invention when executing data fragmentation elimination processing (defragmentation processing), it is possible to perform defragmentation processing at high speed while suppressing a decrease in memory life.

以下、本発明の実施の形態について添付の図面を参照して説明する。以下では、情報記録システムを例として説明する。図1は、情報記録システムの構成例を説明した図である。同図に示すように、情報記録システムはデータを格納する情報記録媒体(以下単に「記録媒体」という。)100と、その記録媒体100にデータの書き込み、読み出しを行うデータ処理装置200とから構成される。最初に、記録媒体100の詳細を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. Hereinafter, an information recording system will be described as an example. FIG. 1 is a diagram illustrating a configuration example of an information recording system. As shown in the figure, the information recording system comprises an information recording medium (hereinafter simply referred to as “recording medium”) 100 for storing data, and a data processing device 200 for writing and reading data on the recording medium 100. Is done. First, details of the recording medium 100 will be described.

1.情報記録媒体
(情報記録媒体の構成)
図1に示すように、記録媒体100は、ホストインタフェース部110、制御部120及びデータ格納部150から構成される。
1. Information recording medium (configuration of information recording medium)
As shown in FIG. 1, the recording medium 100 includes a host interface unit 110, a control unit 120, and a data storage unit 150.

ホストインタフェース部110は、記録媒体100に対してデータの読み出し、書き込み、その他の制御を行うホスト機器であるデータ処理装置200との間で情報の受け渡しを行う。   The host interface unit 110 exchanges information with the data processing apparatus 200 which is a host device that performs reading, writing, and other control of data with respect to the recording medium 100.

制御部120は記録媒体100の動作制御を行い、ホストインタフェース部110、データ格納部150の制御を行う。   The control unit 120 controls the operation of the recording medium 100 and controls the host interface unit 110 and the data storage unit 150.

データ格納部150は記録領域130及び論物変換テーブル140を含む。記録領域130はディジタルデータを格納し、データ処理装置200からディジタルデータの読み出し、書き込みが可能な領域である。記録領域130はフラッシュメモリで構成されており、書き込みの単位を「ブロック」と呼ぶ。記録領域130は複数のブロック(ブロック#0〜#N)を含む。各ブロックには物理的な位置を示すアドレスである物理アドレスが割当てられている。   The data storage unit 150 includes a recording area 130 and a logical / physical conversion table 140. The recording area 130 is an area where digital data can be stored and digital data can be read and written from the data processing device 200. The recording area 130 is composed of a flash memory, and the unit of writing is called a “block”. The recording area 130 includes a plurality of blocks (blocks # 0 to #N). Each block is assigned a physical address which is an address indicating a physical position.

論物変換テーブル140は、記録領域130の各ブロックの論理アドレスと物理アドレスの変換を行うためのテーブルである。ここで「論理アドレス」とは、ホスト機器であるデータ処理装置200が認識するアドレスであって、データの読み出し、書き込み対象となるブロックを指定する際に使用するアドレスである。論理アドレスは全てのブロックに割当てられていてもよいが、本実施の形態においては、一部のブロックには論理アドレスが割当てられていないものとする。データ処理装置200からは、論理アドレスが割当てられていないブロックを指定することはできない。「物理アドレス」とは、記録媒体100の制御部120が認識する記録領域130のアドレスである。制御部120は物理アドレスを用いて実際の記録領域130におけるアクセス領域を特定する。物理アドレスは記録領域130内の全てのブロックに割当てられる。   The logical-physical conversion table 140 is a table for converting the logical address and physical address of each block in the recording area 130. Here, the “logical address” is an address that is recognized by the data processing apparatus 200 that is a host device, and is an address that is used when designating a block from which data is read or written. Although logical addresses may be assigned to all blocks, in this embodiment, it is assumed that logical addresses are not assigned to some blocks. From the data processing apparatus 200, a block to which no logical address is assigned cannot be specified. The “physical address” is an address of the recording area 130 recognized by the control unit 120 of the recording medium 100. The control unit 120 specifies an access area in the actual recording area 130 using the physical address. The physical address is assigned to all blocks in the recording area 130.

なお、本実施の形態では、記録媒体100上の論理アドレスが割当てられた領域に格納するデータのサイズやアドレスを管理するために、ファイルシステムとして、FATファイルシステムを利用している。   In the present embodiment, a FAT file system is used as a file system in order to manage the size and address of data stored in an area to which a logical address is assigned on the recording medium 100.

データ処理装置200から論理アドレスの指定があった場合、記録媒体100の制御部120は論物変換テーブル140を参照して論理アドレスから物理アドレスを求めることで、記録領域130内のアクセスするブロックを決定する。   When a logical address is specified from the data processing device 200, the control unit 120 of the recording medium 100 refers to the logical-physical conversion table 140 to obtain a physical address from the logical address, thereby determining a block to be accessed in the recording area 130. decide.

図2は、論物変換テーブル140のデータ構造及びデータ例を示した図である。論物変換テーブル140はブロック毎に論理アドレスと物理アドレスの対応を管理する。図2の例では、論理アドレスL0は物理アドレスP972に対応し、論理アドレスL1は物理アドレスP424に対応し、論理アドレスL2は物理アドレスP100に対応している。   FIG. 2 is a diagram illustrating a data structure and a data example of the logical / physical conversion table 140. The logical-physical conversion table 140 manages the correspondence between logical addresses and physical addresses for each block. In the example of FIG. 2, the logical address L0 corresponds to the physical address P972, the logical address L1 corresponds to the physical address P424, and the logical address L2 corresponds to the physical address P100.

さらに、物理的には存在しているが、論理アドレスが割り振られていないブロックに関しても、それぞれの物理アドレス(P507、P130、P881、…)に対し、S0、S1、S2の値を割り当てている。   Further, for the blocks that physically exist but are not assigned logical addresses, the values of S0, S1, and S2 are assigned to the respective physical addresses (P507, P130, P881,...). .

次に、記録媒体100の各部の動作について説明する。   Next, the operation of each part of the recording medium 100 will be described.

(データ読み出し処理)
図3は、記録媒体100がデータ処理装置200からデータ読み出し要求であるReadコマンドを受信したときの動作シーケンス例を示した図である。
(Data read processing)
FIG. 3 is a diagram illustrating an example of an operation sequence when the recording medium 100 receives a Read command that is a data read request from the data processing device 200.

ホストインタフェース部110は、データ処理装置200からReadコマンドを受信すると、制御部120に通知する(S301)。ここで、Readコマンドには、少なくとも読み出しを行う論理アドレス及びサイズが格納されているものとする。   When receiving the Read command from the data processing device 200, the host interface unit 110 notifies the control unit 120 (S301). Here, it is assumed that the Read command stores at least a logical address and a size to be read.

なお、制御部120はReadコマンドを確かに受信したことを、ホストインタフェース部110を介してデータ処理装置200に通知してもよい。   Note that the control unit 120 may notify the data processing device 200 via the host interface unit 110 that the Read command has been received.

制御部120は、論物変換テーブル140を参照し、ステップS301で受信したReadコマンドにおいて指定された論理アドレスに対応する物理アドレスを求める(S302)。   The control unit 120 refers to the logical-physical conversion table 140 and obtains a physical address corresponding to the logical address specified in the Read command received in step S301 (S302).

制御部120は、求めた物理アドレスにおけるデータを読み出す(S303)。読み出されたデータは、ホストインタフェース部110を介して、データ処理装置200に送信される(S304)。   The control unit 120 reads data at the obtained physical address (S303). The read data is transmitted to the data processing device 200 via the host interface unit 110 (S304).

ステップS301で受信したReadコマンドにおいて指定されたサイズ分のデータを、データ処理装置200に送信完了したか否かを判断する(S305)。送信完了の場合は処理を終了する。送信完了したデータが指定されたサイズに満たない場合、次のブロックに格納されたデータを読み出すために、現在の論理アドレスに1を加算してステップS302の処理に進む。   It is determined whether or not transmission of data for the size specified in the Read command received in step S301 has been completed to the data processing device 200 (S305). If the transmission is complete, the process ends. If the transmitted data is less than the specified size, 1 is added to the current logical address and the process proceeds to step S302 in order to read the data stored in the next block.

(データ書き込み処理)
図4は、記録媒体100がデータ処理装置200からデータ書き込み要求であるWriteコマンドを受信したときの動作シーケンス例を示した図である。
(Data writing process)
FIG. 4 is a diagram illustrating an example of an operation sequence when the recording medium 100 receives a Write command that is a data write request from the data processing device 200.

ホストインタフェース部110は、データ処理装置200からWriteコマンドを受信すると、制御部120に通知する(S401)。ここでWriteコマンドには少なくとも書き込みを行う論理アドレス及びサイズが格納されているものとする。   When receiving the Write command from the data processing device 200, the host interface unit 110 notifies the control unit 120 (S401). Here, it is assumed that at least a logical address and a size for writing are stored in the Write command.

なお、制御部120はWriteコマンドを確かに受信したことを、ホストインタフェース部110を介してデータ処理装置200に通知してもよい。   Note that the control unit 120 may notify the data processing device 200 via the host interface unit 110 that the Write command has been received.

制御部120は論物変換テーブル140を参照し、ステップS401で受信したWriteコマンドにおいて指定された論理アドレスに対応する物理アドレスを求める(S402)。   The control unit 120 refers to the logical-physical conversion table 140 and obtains a physical address corresponding to the logical address specified in the Write command received in step S401 (S402).

制御部120は、書き込みを行うための準備処理を行う(S403)。ここで、書き込みの準備処理は例えば次のような処理である。本実施形態の記録領域130を構成するフラッシュメモリは、書き込み前に消去処理が必要である。そのため、ステップS402で算出した物理アドレスに格納されたデータの消去処理を、書き込みを行うための準備処理として行う。   The control unit 120 performs a preparation process for writing (S403). Here, the write preparation process is, for example, the following process. The flash memory constituting the recording area 130 of the present embodiment needs to be erased before writing. For this reason, the erasing process of the data stored in the physical address calculated in step S402 is performed as a preparation process for writing.

または、フラッシュメモリにおいて同一ブロックへの書き込みが集中しないようにするために、以下の方法で準備を行っても良い。すなわち、図2の論物変換テーブル140において、S0、S1、S2、・・・などの論理アドレスが割り振られていないブロックの1つ(これを「ブロックX」と呼ぶ。)に対し、消去処理が行われていなければ消去処理を行う。その後、論物変換テーブル140を書き換えて、消去処理されたブロックXとステップS402で求めたブロックとを交換する。これにより、今までデータが書かれていたブロックは論理アドレスが割り振られていないブロックとなり、逆にブロックXには論理アドレスが割当てられ、書き込み対象のブロックとなるため、特定のブロックに対する集中的な書き込みを避けることができる。   Alternatively, preparation may be performed by the following method in order not to concentrate writing to the same block in the flash memory. That is, in the logical-physical conversion table 140 of FIG. 2, an erasure process is performed on one of the blocks to which logical addresses such as S0, S1, S2,... Are not allocated (this is referred to as “block X”). If not, the erasure process is performed. Thereafter, the logical-physical conversion table 140 is rewritten to replace the erased block X with the block obtained in step S402. As a result, a block in which data has been written until now becomes a block to which no logical address is assigned, and conversely, since a logical address is assigned to block X and becomes a block to be written, a concentrated block for a specific block can be obtained. Writing can be avoided.

準備処理の後、制御部120はホストインタフェース部110を介してデータ処理装置200から書き込むデータを受信する(S404)。なお、受信したWriteコマンドにて指定されたデータのサイズが、記録媒体100で一度に受信できるサイズよりも大きい場合は、適度なサイズに分割されたデータを複数回に分けて受信するものとする。本実施の形態においては、一度に受信できるサイズは1ブロック分のデータであるとする。   After the preparation process, the control unit 120 receives data to be written from the data processing device 200 via the host interface unit 110 (S404). When the size of the data specified by the received Write command is larger than the size that can be received at once by the recording medium 100, the data divided into an appropriate size is received in multiple times. . In the present embodiment, it is assumed that the size that can be received at one time is data for one block.

制御部120は書き込み用のデータを確かに受信したことを、ホストインタフェース部110を介してデータ処理装置200に通知してもよい。   The control unit 120 may notify the data processing device 200 via the host interface unit 110 that the data for writing has been received.

制御部120は、ステップS404で受信した書き込み用のデータを、ステップS403にて書き込み準備をしておいたブロックに書き込む(S405)。   The control unit 120 writes the write data received in step S404 to the block prepared for writing in step S403 (S405).

受信したWriteコマンドにおいて指定されたサイズのデータをデータ処理装置200から全て受信したか否かを判断する(S406)。受信完了の場合は処理を終了する。書き込み完了したデータのサイズが、Writeコマンドで指定されたサイズに満たない場合、次のブロックにさらなるデータを書き込むために、現在の論理アドレスに1を加算してステップS402の処理に戻り、上記処理(S402〜S405)を繰り返す。   It is determined whether or not all data of the size specified in the received Write command has been received from the data processing device 200 (S406). If the reception is completed, the process ends. If the size of the data that has been written is less than the size specified by the Write command, 1 is added to the current logical address to return to the next block in order to write more data to the next block, and the above processing is performed. (S402 to S405) are repeated.

(アドレス置換処理)
図5は、記録媒体100がデータ処理装置200から、本発明による論理アドレスの置換コマンドを受信したときの動作シーケンス例を示した図である。置換コマンドは、そのコマンドで指定した論理アドレス間で、論物変換テーブル140上における論理アドレスに対する物理アドレスの置換を指示するコマンドである。
(Address replacement process)
FIG. 5 is a diagram showing an example of an operation sequence when the recording medium 100 receives a logical address replacement command according to the present invention from the data processing device 200. The replacement command is a command for instructing replacement of a physical address for a logical address on the logical-physical conversion table 140 between logical addresses specified by the command.

ホストインタフェース部110は、データ処理装置200から置換コマンドを受信すると、制御部120に通知する(S501)。置換コマンドにおいては、置換対象となる論理アドレスの組が少なくとも1組指定される。   When receiving the replacement command from the data processing device 200, the host interface unit 110 notifies the control unit 120 (S501). In the replacement command, at least one set of logical addresses to be replaced is designated.

制御部120は置換コマンドを確かに受信したことを、ホストインタフェース部110を介してデータ処理装置200に通知してもよい。   The control unit 120 may notify the data processing apparatus 200 via the host interface unit 110 that the replacement command has been received.

制御部120は論物変換テーブル140を参照して、置換対象となる論理アドレスの組の各アドレスに対し、それぞれの物理アドレスを取得する(S502)。そして、論物変換テーブル140において、お互いの物理アドレスの値を置換する(S503)。このとき、論物変換テーブル140上での物理アドレスの置換のみを行い、後述の図7に示すデータ領域310からデータを読み出し、データ領域310の異なるアドレスへデータを書き替えることは行わない。   The control unit 120 refers to the logical-physical conversion table 140 and acquires each physical address for each address of the logical address set to be replaced (S502). Then, in the logical-physical conversion table 140, the values of the physical addresses of each other are replaced (S503). At this time, only replacement of the physical address on the logical-physical conversion table 140 is performed, data is read from a data area 310 shown in FIG. 7 described later, and data is not rewritten to a different address in the data area 310.

図6に、置換コマンドによる置換処理の前後における論物変換テーブル140のデータ例を示す。図6(a)に示す論物変換テーブル140に対し、論理アドレスL3と論理アドレスL6の置換を実施した場合、図6(b)に示すようにそれらの論理アドレスに対する物理アドレスの値が置換される。   FIG. 6 shows an example of data in the logical-physical conversion table 140 before and after the replacement process by the replacement command. When the logical address L3 and the logical address L6 are replaced with the logical-physical conversion table 140 shown in FIG. 6A, the physical address values for those logical addresses are replaced as shown in FIG. 6B. The

図5に戻り、受信した置換コマンドにおいて論理アドレスの組が複数指定されている場合には、全ての論理アドレスの組に対して置換が完了するまで(S504)、ステップS502、S503の処理を繰り返す。   Returning to FIG. 5, when a plurality of logical address pairs are specified in the received replacement command, the processes in steps S502 and S503 are repeated until replacement is completed for all logical address pairs (S504). .

以上のように、本実施形態では、論物変換テーブル140によって論理アドレスが割当てられている記録領域130の各ブロックは、データ処理装置200から、データ読み出しとデータ書き込みに加えて、論理アドレスの置換が可能である。特に、記録媒体100は、置換コマンドを受信したときに、論理アドレスが割り振られている各ブロックのデータの置換を、実際のデータを書き替えるのではなく、論物変換テーブル140上のアドレス情報を置換することのみによって実現する。このように、データ領域310におけるデータの書き替えを要しないため、高速な処理が実現できるとともに、メモリ寿命の低下を抑制できる。   As described above, in this embodiment, each block in the recording area 130 to which a logical address is assigned by the logical-physical conversion table 140 is replaced with a logical address from the data processing device 200 in addition to data reading and data writing. Is possible. In particular, when receiving a replacement command, the recording medium 100 replaces the data of each block to which a logical address is allocated, instead of rewriting the actual data, instead of using the address information on the logical-physical conversion table 140. Realized only by replacement. As described above, since rewriting of data in the data area 310 is not required, high-speed processing can be realized and a reduction in memory life can be suppressed.

(FATファイルシステム)
前述のように、本実施の形態では、記録媒体100上の論理アドレスが割当てられた領域に格納するデータのサイズやアドレスを管理するためにFATファイルシステムを利用している。以下に、FATファイルシステムの概要を説明する。
(FAT file system)
As described above, in this embodiment, the FAT file system is used to manage the size and address of data stored in the area to which the logical address on the recording medium 100 is assigned. The outline of the FAT file system will be described below.

図7に、FATファイルシステムの構成を示す。FATファイルシステムでは、記録領域130のうち論理アドレスが割当てられた領域において、論理アドレスの先頭に管理情報領域300が存在し、引き続いてファイル内のデータなどを格納するデータ領域310が存在する。   FIG. 7 shows the configuration of the FAT file system. In the FAT file system, the management information area 300 exists at the head of the logical address in the area to which the logical address is allocated in the recording area 130, and subsequently the data area 310 for storing data in the file and the like exists.

管理情報領域300は、情報記録領域を複数のパーティションと呼ばれる領域に分割して管理するための情報を格納するマスターブートレコード・パーティションテーブル、1つのパーティション内の管理情報を格納するパーティションブートセクタ、ファイルに含まれるデータの物理的な格納位置を示すFATテーブル1及びFATテーブル2、ルートディレクトリ直下に存在するファイル、ディレクトリの情報を格納するルートディレクトリエントリから構成される。ここで、FATテーブルが二つ存在しているのは、重要な情報を格納しているために、同じ情報が二重化されているためである。   The management information area 300 includes a master boot record / partition table that stores information for dividing and managing the information recording area into areas called partitions, a partition boot sector that stores management information in one partition, and a file 1 includes a FAT table 1 and a FAT table 2 indicating physical storage positions of data included in the file, files existing immediately under the root directory, and a root directory entry for storing directory information. Here, two FAT tables exist because important information is stored and the same information is duplicated.

データ領域310は複数の「クラスタ」と呼ばれる論理的なブロックに分割され管理されており、各クラスタにはファイルに含まれるデータが格納されている。サイズの大きいデータを格納するファイル等は複数のクラスタを使用しており、各クラスタ間のつながりは、FATテーブル1及びFATテーブル2に格納されたリンク情報により管理されている。   The data area 310 is divided into a plurality of logical blocks called “clusters” and managed, and each cluster stores data included in a file. A file or the like for storing large data uses a plurality of clusters, and the connection between the clusters is managed by link information stored in the FAT table 1 and the FAT table 2.

図8を用いてFATファイルシステムによるファイルデータのより具体的な格納例を説明する。   A more specific example of storing file data by the FAT file system will be described with reference to FIG.

管理情報領域300のルートディレクトリエントリや、データ領域310の一部には、図8(a)に示すような、ファイル名やファイルサイズなどを格納するディレクトリエントリ401が格納される。ファイルデータの格納先であるデータ領域310はクラスタ単位で管理されており、各クラスタには一意に識別可能なクラスタ番号が付与されている。ファイルのデータが格納されているクラスタを特定するために、ディレクトリエントリ401には、ファイルデータの先頭部分を格納するクラスタのクラスタ番号(開始クラスタ番号)が格納されている。図8(a)のディレクトリエントリ401の例は、”FILE001.TXT”という名前を持つファイルについて、クラスタ番号31からデータが格納されていることを示している。   A directory entry 401 for storing a file name, a file size, and the like as shown in FIG. 8A is stored in the root directory entry of the management information area 300 and a part of the data area 310. The data area 310 that is the file data storage destination is managed in cluster units, and each cluster is assigned a uniquely identifiable cluster number. In order to identify the cluster in which the file data is stored, the directory entry 401 stores the cluster number (starting cluster number) of the cluster that stores the head portion of the file data. The example of the directory entry 401 in FIG. 8A indicates that data is stored from the cluster number 31 for a file having the name “FILE001.TXT”.

複数のクラスタにデータが格納されているファイルの場合、リンク情報がFATテーブルに格納される。図8(b)にFATテーブルの例を示す。FATテーブル402には、各クラスタのリンク情報を示すFATエントリが格納される。FATエントリは、次にリンクされるクラスタのクラスタ番号が格納されている。図8(b)の例では、クラスタ番号「31」に対応するFATエントリとして「32」が格納されているため、クラスタ番号「31」のクラスタは、クラスタ番号「32」のクラスタにリンクしていることになる。同様にクラスタ番号「32」に対応するFATエントリには「34」、クラスタ番号「34」に対応するFATエントリには「35」が格納されており、クラスタ番号「31」、「32」、「34」、「35」の順でリンクされていることになる。クラスタ番号「35」に対応するFATエントリには、リンクの終端を意味する「FFF」が格納されている。よって、クラスタ番号「31」から始まるリンクは、「31」、「32」、「34」、「35」の4クラスタで終端することになる。従って、”FILE001.TXT”というファイル名のデータは、データ領域310において、図8(c)に示すようにクラスタ#31、#32、#34、#35に順に格納されていることになる。なお、クラスタ番号「33」に対応するFATエントリに格納されている「0」は、そのクラスタがファイルに割当てられておらず、空き領域であることを意味している。   In the case of a file in which data is stored in a plurality of clusters, link information is stored in the FAT table. FIG. 8B shows an example of the FAT table. The FAT table 402 stores a FAT entry indicating link information of each cluster. The FAT entry stores the cluster number of the next linked cluster. In the example of FIG. 8B, since “32” is stored as the FAT entry corresponding to the cluster number “31”, the cluster with the cluster number “31” is linked to the cluster with the cluster number “32”. Will be. Similarly, “34” is stored in the FAT entry corresponding to the cluster number “32”, “35” is stored in the FAT entry corresponding to the cluster number “34”, and the cluster numbers “31”, “32”, “ 34 "and" 35 "are linked in this order. The FAT entry corresponding to the cluster number “35” stores “FFF” indicating the end of the link. Therefore, the link starting from the cluster number “31” terminates in four clusters “31”, “32”, “34”, and “35”. Therefore, data having a file name “FILE001.TXT” is stored in order in clusters # 31, # 32, # 34, and # 35 in the data area 310 as shown in FIG. 8C. Note that “0” stored in the FAT entry corresponding to the cluster number “33” means that the cluster is not allocated to a file and is a free area.

サイズの異なるファイルの書き込みや消去を繰返し行うことにより、前記FATエントリのリンク情報は複雑になっていく。すなわち、個々のファイルデータはデータ領域310において離散的な状態で格納された状態になる。同様に未使用の領域である空き領域も離散的な状態で存在することになる。これをデータの「断片化」と呼ぶ。   By repeatedly writing and erasing files of different sizes, the link information of the FAT entry becomes complicated. That is, the individual file data is stored in a discrete state in the data area 310. Similarly, empty areas that are unused areas exist in a discrete state. This is called “fragmentation” of data.

なお、以降の説明を簡略化するために、本実施形態は、クラスタは記録領域130のブロックと1対1に対応しているものとし、クラスタ間の境界がブロック間の境界と一致するものとする。   In order to simplify the following description, in the present embodiment, it is assumed that the clusters correspond one-to-one with the blocks in the recording area 130, and the boundaries between the clusters coincide with the boundaries between the blocks. To do.

2.データ処理装置
次に、記録媒体100にアクセスするデータ処理装置200の詳細について説明する。図9はデータ処理装置200の構成例を示した図である。
2. Data Processing Device Next, details of the data processing device 200 that accesses the recording medium 100 will be described. FIG. 9 is a diagram illustrating a configuration example of the data processing device 200.

データ処理装置200は、スロット210、入出力処理部220、データ処理部230、ユーザ入力処理部240、表示処理部250から構成される。   The data processing device 200 includes a slot 210, an input / output processing unit 220, a data processing unit 230, a user input processing unit 240, and a display processing unit 250.

スロット210は記録媒体100を装着するハードウェアである。   The slot 210 is hardware for mounting the recording medium 100.

入出力処理部220は、スロット210に装着された記録媒体100に対してコマンドやデータ等の情報の受け渡しを行う。入出力処理部220は、記録媒体100に対して論理アドレスの置換コマンドを発行する手段を備えている。   The input / output processing unit 220 delivers information such as commands and data to the recording medium 100 mounted in the slot 210. The input / output processing unit 220 includes means for issuing a logical address replacement command to the recording medium 100.

データ処理部230は、記録媒体100に格納されたデータもしくはこれから格納するデータを処理し、データ処理装置200の中心的な処理を担う。例えば、データ処理部230は、記録媒体100に格納されたデータが音声データや映像データである場合には、データを入出力処理部220経由で読み出して再生処理を行う。また、データ処理部230は、記録・編集したデータを入出力処理部220経由で記録媒体100に書き込む。データ処理部230は所定のプログラムを実行することで以下に説明する機能を実現する。   The data processing unit 230 processes data stored in the recording medium 100 or data to be stored in the future, and performs central processing of the data processing apparatus 200. For example, if the data stored in the recording medium 100 is audio data or video data, the data processing unit 230 reads the data via the input / output processing unit 220 and performs a reproduction process. The data processing unit 230 writes the recorded / edited data to the recording medium 100 via the input / output processing unit 220. The data processing unit 230 implements the functions described below by executing a predetermined program.

本実施の形態において、データ処理部230は記録媒体100に格納されたデータの断片化を解消(デフラグ)する機能を備える。すなわち、データ処理部230は記録媒体100のデータ領域310に離散的に格納されたファイルデータを連続的にするための、データの並べ替え処理のための手段を備えている。   In the present embodiment, the data processing unit 230 has a function of eliminating (defragmenting) fragmentation of data stored in the recording medium 100. That is, the data processing unit 230 includes means for data rearrangement processing for making the file data discretely stored in the data area 310 of the recording medium 100 continuous.

データ処理部230はデータの処理中に使用する一時的な記憶領域であるメモリ(図示せず)を備えており、記録媒体100から読み出したデータ等を格納することが可能である。   The data processing unit 230 includes a memory (not shown) that is a temporary storage area used during data processing, and can store data read from the recording medium 100.

ユーザ入力処理部240は、ユーザからの入力を受信する。表示処理部250は、データ処理部230の処理結果や各処理の進行状況などをユーザに通知する。なお、図9においてユーザ入力処理部240及び表示処理部250を破線で示しているのは、これらの構成要素が必須のものでないことを示している。   The user input processing unit 240 receives input from the user. The display processing unit 250 notifies the user of the processing result of the data processing unit 230 and the progress status of each processing. In FIG. 9, the user input processing unit 240 and the display processing unit 250 shown by broken lines indicate that these components are not essential.

3.システム全体の動作
以下、記録媒体100及びデータ処理装置200を構成している各部の動作について図面を用いて説明する。
3. Operation of Entire System Hereinafter, the operation of each part constituting the recording medium 100 and the data processing device 200 will be described with reference to the drawings.

(デフラグ処理)
図10は、データ処理装置200が記録媒体100に格納されたデータの断片化を解消する処理(以下「デフラグ処理」という。)の動作シーケンス例を示した図である。
(Defrag processing)
FIG. 10 is a diagram illustrating an example of an operation sequence of processing (hereinafter referred to as “defragment processing”) for the data processing apparatus 200 to eliminate fragmentation of data stored in the recording medium 100.

データ処理装置200のデータ処理部230は、入出力処理部220を介して、スロット210に装着された記録媒体100から、FATテーブルや各ディレクトリエントリなどを読み出し、解析し、データ領域310に格納されている各ファイルが使用しているクラスタの情報などを収集する(S1001)。   The data processing unit 230 of the data processing device 200 reads and analyzes the FAT table, each directory entry, and the like from the recording medium 100 mounted in the slot 210 via the input / output processing unit 220, and stores them in the data area 310. The cluster information used by each file being collected is collected (S1001).

データ処理部230は、収集した各ファイルの使用しているクラスタ情報をもとに、各クラスタに格納されたデータの移動先を決定する(S1002)。本実施の形態においては、全てのファイル及び空き領域が連続したクラスタに格納されるように移動先を決定する。なお、移動先については公知の方法で決定できる。   The data processing unit 230 determines the destination of the data stored in each cluster based on the cluster information used by each collected file (S1002). In this embodiment, the migration destination is determined so that all files and free areas are stored in a continuous cluster. The destination can be determined by a known method.

ステップS1002の移動先の決定において、データ処理部230は、各クラスタのデータの移動先の情報を格納した移動先リスト500をデータ処理部230の内部メモリ上に生成する。図11に移動先リスト500のデータ例を示す。図11の例は、現在のクラスタ番号「1」のクラスタに格納されているデータは、移動後にクラスタ番号「32」のクラスタに格納され、現在のクラスタ番号「2」のクラスタのデータは移動後にクラスタ番号「3」のクラスタに格納される予定であることを示している。   In the determination of the migration destination in step S1002, the data processing unit 230 generates a migration destination list 500 storing information on the migration destination of the data of each cluster on the internal memory of the data processing unit 230. FIG. 11 shows a data example of the movement destination list 500. In the example of FIG. 11, the data stored in the cluster with the current cluster number “1” is stored in the cluster with the cluster number “32” after the movement, and the data of the cluster with the current cluster number “2” is after the movement. This indicates that the data is to be stored in the cluster with the cluster number “3”.

移動先リスト500に基づき、各クラスタのデータの移動を実施する(S1003)。本実施の形態においては、クラスタ番号「1」から順にクラスタを決定していき、決定したクラスタへデータを移動して行く。この処理は、論理アドレス空間上のクラスタ間のデータの入れ替えにより実現される。例えば、図11の移動先リスト500に基づきデータの移動を実施する場合、まず、移動先クラスタ番号が「1」となっているクラスタ番号を検索する。移動先クラスタ番号が「1」となっているクラスタ番号は「4」である。そこで、クラスタ番号「1」のクラスタとクラスタ番号「4」のクラスタとを置換対象として決定する。データ処理部230はクラスタ番号「1」とクラスタ番号「4」に対応する論理アドレスを指定して記録媒体100に対して置換コマンドを発行する。この移動処理の詳細については後述する。以降、移動先クラスタ番号を順次インクリメントしていき、データの移動処理を行っていく。   Based on the destination list 500, the data of each cluster is moved (S1003). In the present embodiment, clusters are sequentially determined from the cluster number “1”, and data is moved to the determined clusters. This process is realized by exchanging data between clusters on the logical address space. For example, when data is moved based on the movement destination list 500 in FIG. 11, first, a cluster number whose movement destination cluster number is “1” is searched. The cluster number whose destination cluster number is “1” is “4”. Therefore, the cluster with the cluster number “1” and the cluster with the cluster number “4” are determined as replacement targets. The data processing unit 230 issues a replacement command to the recording medium 100 by designating a logical address corresponding to the cluster number “1” and the cluster number “4”. Details of this movement process will be described later. Thereafter, the migration destination cluster number is sequentially incremented, and data migration processing is performed.

ステップS1003でクラスタのデータ移動を行った結果、FATテーブルやディレクトリエントリの情報が変更される場合、データ処理部230は記録媒体100に格納されたこれらの値を更新する(S1004)。その際、移動先リスト500にも移動結果を反映させる。図12は、図11の移動先リスト500において、クラスタ番号「1」のデータとクラスタ番号「4」のデータの入れ替えが完了した結果を反映した図である。移動により、クラスタ番号「4」のデータは、移動前にクラスタ番号「1」のクラスタに格納されていたデータとなり、その移動先クラスタ番号は「32」となっている。   As a result of moving the cluster data in step S1003, when the information in the FAT table or directory entry is changed, the data processing unit 230 updates these values stored in the recording medium 100 (S1004). At that time, the movement result is also reflected in the movement destination list 500. FIG. 12 is a diagram reflecting a result of completion of replacement of data of cluster number “1” and data of cluster number “4” in the movement destination list 500 of FIG. Due to the movement, the data of the cluster number “4” becomes the data stored in the cluster of the cluster number “1” before the movement, and the movement destination cluster number is “32”.

移動先リスト500を参照し、全てのクラスタについてデータ移動がなされたか否かを判断し(S1005)、移動処理が完了した場合には処理を終了する。まだ、移動すべきデータが残っている場合は、ステップS1003の処理に戻り、次のクラスタのデータ移動処理を行う。   The migration destination list 500 is referred to and it is determined whether or not data migration has been performed for all clusters (S1005). If the migration process is completed, the process ends. If there is still data to be moved, the process returns to step S1003 to perform the data movement process for the next cluster.

以上のように、移動先リスト500を参照して移動処理を実施すれば、最終的に、記録媒体のFATテーブル上において全てのファイル及び空き領域が、連続したクラスタに格納されるように並べ替えられることになる。   As described above, when the migration process is performed with reference to the migration destination list 500, all files and free areas are finally rearranged in the continuous cluster on the FAT table of the recording medium. Will be.

(クラスタデータの移動処理)
次に、図10のステップS1003におけるクラスタのデータの移動処理について、図13を用いて説明する。以下、移動処理としてクラスタAとクラスタBの間でデータの入れ替えを行う場合を説明する。
(Cluster data move processing)
Next, cluster data movement processing in step S1003 of FIG. 10 will be described with reference to FIG. Hereinafter, a case where data is exchanged between the cluster A and the cluster B as the movement process will be described.

本実施形態のデータ移動処理の説明に先立ち、従来のデータ入れ替え処理について図13(a)を用いて説明する。従来の方法では、まず、記録媒体の記録領域からクラスタAのデータ(データA)を読み出し、メモリ上に退避する(S1301)。次に、クラスタBのデータ(データB)を読み出してメモリ上に退避する(S1302)。なお、クラスタA及びクラスタBのデータを読み出すときに記録媒体に対して指定する論理アドレスは管理情報領域の情報等から算出する。その後、クラスタAの位置に、退避しておいたクラスタBのデータBを書き込み(S1303)、クラスタBの位置に、退避しておいたクラスタAのデータAを書き込む(S1304)。   Prior to the description of the data movement process of the present embodiment, a conventional data exchange process will be described with reference to FIG. In the conventional method, first, data of cluster A (data A) is read from the recording area of the recording medium and saved in the memory (S1301). Next, the data of cluster B (data B) is read and saved in the memory (S1302). The logical address designated for the recording medium when reading the data of cluster A and cluster B is calculated from the information in the management information area. Thereafter, the saved data B of cluster B is written at the position of cluster A (S1303), and the saved data A of cluster A is written at the position of cluster B (S1304).

このように、従来のデータ入れ替え処理では、データ処理装置は入れ替え処理の対象となっている2つのクラスタのデータを読み出し、その後、それぞれのクラスタにデータの書き込みを行っている。これに対し、後述の本実施形態によるデータ移動(入れ替え)処理では、論理アドレスの置換コマンドを発行するだけでデータの入替えを実現する。置換コマンドは、記録媒体100の論物変換テーブル140を更新するだけであり、データ領域へのデータの書き込み処理は行わない。以下に、図13(b)を参照し、本実施形態によるデータ入れ替え処理(ステップS1003)の詳細を説明する。   As described above, in the conventional data replacement process, the data processing apparatus reads the data of two clusters that are the targets of the replacement process, and then writes the data to each cluster. On the other hand, in the data movement (replacement) process according to this embodiment described later, data replacement is realized simply by issuing a logical address replacement command. The replacement command only updates the logical-physical conversion table 140 of the recording medium 100, and does not perform data write processing to the data area. The details of the data replacement process (step S1003) according to this embodiment will be described below with reference to FIG.

図13(b)において、データ処理部230は、置換対象であるクラスタA及びクラスタBの論理アドレスを管理情報領域300の情報などから算出する(S1310)。   In FIG. 13B, the data processing unit 230 calculates the logical addresses of the cluster A and cluster B to be replaced from the information in the management information area 300 (S1310).

次に、データ処理部230は入出力処理部220を介して、スロット210に装着された記録媒体100に対し、クラスタAの論理アドレスとクラスタBの論理アドレスを入れ替える置換コマンドを発行する(S1311)。記録媒体100はデータ処理装置200から置換コマンドを受信すると、図5に示す処理を実行して、論物変換テーブル140上でのクラスタAとクラスタBのそれぞれに対応する物理アドレスと論理アドレスの対応の置換を行う。   Next, the data processing unit 230 issues a replacement command for switching the logical address of the cluster A and the logical address of the cluster B to the recording medium 100 mounted in the slot 210 via the input / output processing unit 220 (S1311). . When the recording medium 100 receives the replacement command from the data processing device 200, the recording medium 100 executes the processing shown in FIG. 5, and the correspondence between the physical addresses and logical addresses corresponding to the clusters A and B on the logical-physical conversion table 140 Is replaced.

以上のように、本発明によるデータ処理装置200は、デフラグ処理において記録媒体100に格納されたデータを移動させる際に、論理アドレスと物理アドレスの対応関係の置換を指示する置換コマンドを利用する。これにより、記録領域130へのデータの書き込みを行うことなしにデータの並べ替えが行えるため、高速かつフラッシュメモリの寿命低下を抑えたデフラグ処理が可能となり、非常に有効である。また、本実施形態のデフラグ処理によりFAT上で連続的にリンクされるようになるため、データ処理装置200のRAM上へFAT情報を読み出し利用する際に、ロードし直す回数が低減される。   As described above, the data processing apparatus 200 according to the present invention uses the replacement command for instructing replacement of the correspondence relationship between the logical address and the physical address when moving the data stored in the recording medium 100 in the defragmentation process. As a result, the data can be rearranged without writing the data in the recording area 130, so that the defragmentation process can be performed at high speed and the lifetime of the flash memory is suppressed, which is very effective. In addition, since the defragmentation processing according to the present embodiment is continuously linked on the FAT, the number of times of reloading is reduced when the FAT information is read out and used on the RAM of the data processing device 200.

(デフラグ処理の具体例)
上記のデフラグ処理によるクラスタの移動の様子について具体例を挙げて説明する。なお、以下の説明においてクラスタ番号が「m」のクラスタを「クラスタ#m」と表す。今、記録媒体100におけるデータ格納状態が図14に示すような状態である場合を考える。図14(a)はディレクトリエントリ401の内容を、図14(b)はFATテーブル402の内容を、図14(c)はデータ領域310のクラスタ間のリンク状態をそれぞれ示した図である。
(Specific example of defragmentation)
A state of movement of the cluster by the above defragmentation process will be described with a specific example. In the following description, the cluster having the cluster number “m” is represented as “cluster #m”. Consider a case where the data storage state in the recording medium 100 is as shown in FIG. 14A shows the contents of the directory entry 401, FIG. 14B shows the contents of the FAT table 402, and FIG. 14C shows the link state between clusters in the data area 310.

図14(a)に示すように、記録媒体100において”FILE100.TXT”と”FILE200.TXT”の2つのファイルが格納されている。”FILE100.TXT”は、クラスタ#41→クラスタ#45→クラスタ#203→クラスタ#42とリンクし、”FILE200.TXT”は、クラスタ#43→クラスタ#205とリンクしている(図14(b)、(c)参照)。   As shown in FIG. 14A, the recording medium 100 stores two files “FILE100.TXT” and “FILE200.TXT”. “FILE100.TXT” is linked with cluster # 41 → cluster # 45 → cluster # 203 → cluster # 42, and “FILE200.TXT” is linked with cluster # 43 → cluster # 205 (FIG. 14B). ) And (c)).

図15Aに、図14に示す場合においてデフラグ処理のために生成される移動先リスト500の例を示す。また、図15Bに、図14に示す状態における記録媒体100の論物変換テーブル140を示す。   FIG. 15A shows an example of the destination list 500 generated for the defragmentation process in the case shown in FIG. FIG. 15B shows the logical-physical conversion table 140 of the recording medium 100 in the state shown in FIG.

図14に示すデータ格納状態において、デフラグ処理によるクラスタ#42へのデータ移動処理を説明する。データ処理装置200は移動先リスト500を参照し、移動先クラスタ番号が「42」であるクラスタ番号を検索する。図15Aより、移動先クラスタ番号が「42」であるクラスタ番号は「45」であることから、クラスタ#42と置換されるクラスタはクラスタ#45であることがわかる。データ処理装置200はクラスタ#42とクラスタ#45を置換するための置換コマンドを記録媒体100に発行する。このとき、置換コマンドにおいて論理アドレスとして、クラスタ#42とクラスタ#45の論理アドレスがそれぞれ指定される。これにより、図17Bに示すように、クラスタ#42とクラスタ#45について、それぞれのクラスタに対応する論理アドレスに対する物理アドレスが置換される。また、図17Aに示すように、クラスタ#42とクラスタ#45間で、移動先リスト500における移動先クラスタ番号が置換される。   In the data storage state shown in FIG. 14, data migration processing to cluster # 42 by defragmentation processing will be described. The data processing device 200 refers to the movement destination list 500 and searches for a cluster number whose movement destination cluster number is “42”. From FIG. 15A, since the cluster number whose destination cluster number is “42” is “45”, it can be seen that the cluster replaced with cluster # 42 is cluster # 45. The data processing device 200 issues a replacement command for replacing the cluster # 42 and the cluster # 45 to the recording medium 100. At this time, the logical addresses of cluster # 42 and cluster # 45 are designated as logical addresses in the replacement command. As a result, as shown in FIG. 17B, for cluster # 42 and cluster # 45, the physical addresses for the logical addresses corresponding to the respective clusters are replaced. Also, as shown in FIG. 17A, the destination cluster number in the destination list 500 is replaced between the cluster # 42 and the cluster # 45.

以上のように論理アドレスと物理アドレス間の対応関係が置換されたことにより、論理アドレス空間におけるクラスタ間のリンク状態すなわちデータ格納状態が変化する。変化後のデータ格納状態を図16に示す。この場合、図16(b)に示すように、FATテーブル402において、クラスタ#42とクラスタ#45に対するFATエントリ(”203”と”FFF”)が置換される。さらに、それとともに、置換対象であるクラスタ#42とクラスタ#45にリンクするクラスタ#41とクラスタ#203についても、それらのFATエントリの内容が変更される。すなわち、クラスタ#41とクラスタ#203のFATエントリは、”45”と”42”から”42”と”45”へそれぞれ変更される。つまり、この場合、FATテーブル402において4つのFATエントリが変更される。   As described above, the correspondence between logical addresses and physical addresses is replaced, so that the link state between clusters in the logical address space, that is, the data storage state changes. The data storage state after the change is shown in FIG. In this case, as shown in FIG. 16B, FAT entries (“203” and “FFF”) for cluster # 42 and cluster # 45 are replaced in the FAT table 402. At the same time, the contents of the FAT entries of the cluster # 41 and the cluster # 203 linked to the cluster # 42 and the cluster # 45 to be replaced are also changed. That is, the FAT entries of the cluster # 41 and the cluster # 203 are changed from “45” and “42” to “42” and “45”, respectively. That is, in this case, four FAT entries are changed in the FAT table 402.

移動先リスト500を参照しながら、上記のように全クラスタについてクラスタ間の置換によるデータ移動(並べ替え)を行うことにより、最終的に図18に示すような連続的にリンクしたデータ格納状態が得られる。すなわち、データ移動により、図18(b)、(c)に示すように、”FILE100.TXT”は、クラスタ#41→クラスタ#42→クラスタ#43→クラスタ#44とリンクし、”FILE200.TXT”は、クラスタ#45→クラスタ#46とリンクするようになる。このように、デフラグ処理により各ファイルはFAT上で連続した領域で管理されるようになる。”FILE200.TXT”の先頭クラスタは、クラスタ#45になったため、ディレクトリエントリ401の開始クラスタ番号の値も”43”から”45”に変更される。図19A、図19Bはそれぞれ、デフラグ処理後の移動先リスト500と論物変換テーブル140の状態を示した図である。   By referring to the movement destination list 500 and performing data movement (rearrangement) by replacement between clusters for all clusters as described above, the data storage state that is continuously linked as shown in FIG. 18 is finally obtained. can get. That is, by the data movement, as shown in FIGS. 18B and 18C, “FILE100.TXT” is linked with cluster # 41 → cluster # 42 → cluster # 43 → cluster # 44, and “FILE200.TXT” is linked. "Is linked to cluster # 45 → cluster # 46. In this way, each file is managed in a continuous area on the FAT by the defragmentation process. Since the first cluster of “FILE200.TXT” is cluster # 45, the value of the starting cluster number of the directory entry 401 is also changed from “43” to “45”. FIGS. 19A and 19B are diagrams showing the states of the destination list 500 and the logical-physical conversion table 140 after the defragmentation processing, respectively.

上記の例のデフラグ処理では、”FILE200.TXT”に関し、最終的にディレクトリエントリ401の書き換えが生じたが、次に、ディレクトリエントリ401の書き換えが生じないように、データの並べ替えを行う方法について説明する。この場合、データの並べ替えにおいて、ファイルの先頭データを含むクラスタは移動させないようにする。   In the defragmentation process in the above example, regarding “FILE200.TXT”, the directory entry 401 is finally rewritten. Next, the data is rearranged so that the directory entry 401 is not rewritten. explain. In this case, the cluster including the top data of the file is not moved in the data rearrangement.

図14のデータ格納状態に対して、このときの移動先リスト500は図20Aに示すようになる。つまり、ファイルの先頭データを含むクラスタすなわちクラスタ#41とクラスタ#43については、クラスタ番号と移動先クラスタ番号が同じとなっている。図20Bに、このときの論物変換テーブル140を示す。   For the data storage state of FIG. 14, the destination list 500 at this time is as shown in FIG. 20A. That is, the cluster number and the migration destination cluster number are the same for the cluster including the head data of the file, that is, cluster # 41 and cluster # 43. FIG. 20B shows the logical-physical conversion table 140 at this time.

図21は、図20Aに示す移動先リスト500にしたがいデフラグ処理を実行後のデータ格納状態を示した図である。図22A、図22Bはそれぞれ図21のデータ格納状態に対する移動先リスト500及び論物変換テーブル140である。同図の場合、”FILE200.TXT”の先頭データを含むクラスタ#43について移動はなく、この部分を除いてFAT上で連続的にクラスタがリンクされている。   FIG. 21 is a diagram showing a data storage state after the defragmentation process is executed according to the movement destination list 500 shown in FIG. 20A. 22A and 22B are a destination list 500 and a logical-physical conversion table 140 for the data storage state of FIG. In the case of the figure, the cluster # 43 including the head data of “FILE200.TXT” is not moved, and the cluster is continuously linked on the FAT except for this portion.

4.変形例
本発明の思想を上記の実施の形態に基づいて説明してきたが、本発明の思想は上記の実施の形態に限定されないのはもちろんである。以下のような場合も本発明に含まれる。
4). Although the idea of the present invention has been described based on the above embodiment, it is needless to say that the idea of the present invention is not limited to the above embodiment. The following cases are also included in the present invention.

(1)本実施の形態においては、Readコマンドにおいて読み出しを行う論理アドレス及びサイズが格納されているとしたが、Readコマンドにてサイズを指定しなくてもよい。この場合、データ処理装置200が必要なサイズのデータを読み出した後に読み出し停止を指示するようにする。すなわち、データ処理装置200が読み出し停止を指示するまでは、記録媒体100からデータを読み出し続けるようにしてもよい。さらに、読み出しサイズを固定サイズにしてもよいし、他の方式を利用してもよい。なお、Writeコマンドについても同様である。   (1) In the present embodiment, the logical address and size to be read in the Read command are stored, but the size may not be specified in the Read command. In this case, the data processing apparatus 200 instructs to stop reading after reading data of a necessary size. That is, the data may be continuously read from the recording medium 100 until the data processing device 200 instructs to stop reading. Furthermore, the read size may be a fixed size, or another method may be used. The same applies to the Write command.

(2)また、図4のステップS403の処理において書き込みの準備をする際に論物変換テーブル140を更新してもよい旨の説明を行ったが、論物変換テーブル140の更新はステップS405のデータの書き込み処理が完了してから行ってもよい。このとき、書き込み処理中にエラーが発生し、処理が中断した場合にもできるだけ以前のデータを残すことが可能となる。   (2) Further, it has been explained that the logical-physical conversion table 140 may be updated when preparing for writing in the process of step S403 in FIG. 4, but the logical-physical conversion table 140 is updated in step S405. It may be performed after the data writing process is completed. At this time, even if an error occurs during the writing process and the process is interrupted, it is possible to leave the previous data as much as possible.

本発明による記録媒体は、読み出し/書き込みのシーケンスによらず、論理アドレスの置換手段を備えていることが重要である。   It is important that the recording medium according to the present invention includes a logical address replacement means regardless of the read / write sequence.

(3)本実施の形態においては、記録媒体100に格納されたデータの断片化を解消する処理について記述した。本発明の思想はこれに限らず、記録媒体100に格納されたデータを記録媒体100内の他のアドレスに移動する場合に適用できる。特に、ブロックの整数倍のデータを記録領域130内で移動する場合に有効である。   (3) In the present embodiment, a process for eliminating fragmentation of data stored in the recording medium 100 has been described. The idea of the present invention is not limited to this, and can be applied to the case where data stored in the recording medium 100 is moved to another address in the recording medium 100. This is particularly effective when moving data that is an integral multiple of a block within the recording area 130.

(4)図10に示すデフラグ処理においては、全てのファイル及び空き領域が連続したクラスタに格納されるようにデータの並べ替えを行うとしたが、一部のファイルもしくは空き領域だけが連続したクラスタに格納されるようにしてもよい。   (4) In the defragmentation process shown in FIG. 10, the data is rearranged so that all files and free areas are stored in a continuous cluster. You may make it store in.

例えば、音声データや映像データなどのストリーミングデータは、データを論理アドレスが連続した領域に格納させることにより、再生時において次の再生データの位置を簡単に決定できることになる。その結果、データ処理装置での処理が軽減され、消費電力を抑えることが可能となる。そこで、音声データや映像データなどのストリーミングデータのみを対象に断片化の解消を行うようにしてもよい。   For example, streaming data such as audio data and video data can easily determine the position of the next reproduction data at the time of reproduction by storing the data in an area where logical addresses are continuous. As a result, processing in the data processing apparatus is reduced, and power consumption can be suppressed. Therefore, fragmentation may be eliminated only for streaming data such as audio data and video data.

また、ストリーミングデータを記録するデータ処理装置においてはストリーミングデータの記録終了後にストリーミングデータの断片化を解消する処理を自動的に行うようにしてもよい。   In addition, in a data processing apparatus that records streaming data, a process for eliminating fragmentation of streaming data may be automatically performed after the recording of streaming data is completed.

または、ストリーミングデータの記録前に論理アドレスの置換コマンドを用いて空き領域の断片化を解消しておいてもよい。これにより、ストリーミングデータの記録中に空き領域の論理アドレスを検索する処理を簡略化できる。このとき、記録するストリーミングデータも連続した領域になるようにすれば、より効果的である。   Alternatively, fragmentation of free areas may be eliminated using a logical address replacement command before recording streaming data. Thereby, it is possible to simplify the process of searching for the logical address of the free area during recording of streaming data. At this time, it is more effective if the streaming data to be recorded is also a continuous area.

(5)また、図10に示すデフラグ処理において全てのファイル及び空き領域が連続したクラスタに格納されるようにデータを並べ替える処理を記述したが、さらに連続化された空き領域に対してデータの完全消去を行うイレース処理を実施してもよい。   (5) Also, in the defragmentation process shown in FIG. 10, a process for rearranging data so that all files and free areas are stored in a continuous cluster has been described. An erase process for performing complete erasure may be performed.

イレース処理が行われたブロックが多ければ、書き込み前の準備として改めてイレース処理を実行する必要がないため、書き込み処理の高速化が期待できる。   If there are many blocks on which erase processing has been performed, it is not necessary to perform erase processing again as preparation before writing, and therefore it is expected that the writing processing will be accelerated.

また、空き領域が断片化された状態の場合、イレース処理を実行させる空き領域の論理アドレスを各々の空き領域に対して指定することになるため処理が複雑となる。空き領域を連続化した後であれば、イレース処理の開始アドレス及び終了アドレスの指定が容易に行えるという利点がある。   Further, when the free area is fragmented, the logical address of the free area where the erase process is executed is designated for each free area, and the processing becomes complicated. There is an advantage that the start address and end address of the erase process can be easily specified after the empty areas are made continuous.

(6)本実施の形態においては、記録媒体100は半導体メモリであるとし、記録領域130はフラッシュメモリで構成されることにしたが、制御部120及び論物変換テーブル140と同等の機能を有していれば、他の種類の記録媒体であっても本発明の思想は適用できる。例えば、記録媒体100がハードディスク(HDD)であっても良い。   (6) In the present embodiment, it is assumed that the recording medium 100 is a semiconductor memory and the recording area 130 is configured by a flash memory, but has functions equivalent to those of the control unit 120 and the logical-physical conversion table 140. If so, the idea of the present invention can be applied to other types of recording media. For example, the recording medium 100 may be a hard disk (HDD).

(7)本実施の形態においては、FAT上での管理単位であるクラスタと、論物変換テーブル140上での管理単位であるブロックとが1対1で対応しているものとして説明したが、1つのクラスタに複数個のブロックが対応していても本発明は有効である。   (7) In the present embodiment, the cluster that is the management unit on the FAT and the block that is the management unit on the logical-physical conversion table 140 correspond to each other on a one-to-one basis. The present invention is effective even if a plurality of blocks correspond to one cluster.

また、本実施の形態においては、記録媒体の記録領域130の各ブロックのうち論理アドレスが割当てられた領域をFATファイルシステムで管理していたが、NTFSやUDFなどの他のファイルシステムを利用しても良いし、ファイルシステムを使わずに記録アドレスなどを管理してもよい。   In the present embodiment, the area to which the logical address is assigned is managed by the FAT file system among the blocks of the recording area 130 of the recording medium. However, other file systems such as NTFS and UDF are used. Alternatively, recording addresses may be managed without using a file system.

管理しているブロックの境界が、クラスタのような論理的なブロックの境界と一致していれば、前記論理的なブロックの置換を本発明における置換コマンドで実行できるため、本発明は有効である。   Since the replacement of the logical block can be executed by the replacement command in the present invention if the boundary of the managed block coincides with the boundary of the logical block such as a cluster, the present invention is effective. .

(8)本実施の形態においては、物理アドレス及び論理アドレスはブロック毎に割当てられているものとして記述したが、1つのブロックに複数の連続的な物理アドレス及び論理アドレスが割当てられていても、本発明は有効である。図23は1つのブロックに連続した16個の物理アドレス及び論理アドレスが割り振られた場合の論物変換テーブル140のデータ構造及びデータ例である。このとき、論理アドレスを置換する単位は16個の連続した論理アドレスとなる。すなわち、置換の単位は、記録領域130のブロック単位となる。   (8) In this embodiment, the physical address and the logical address are described as being assigned to each block. However, even if a plurality of continuous physical addresses and logical addresses are assigned to one block, The present invention is effective. FIG. 23 shows a data structure and a data example of the logical-physical conversion table 140 when 16 physical addresses and logical addresses continuous are allocated to one block. At this time, the unit for replacing the logical address is 16 consecutive logical addresses. That is, the replacement unit is a block unit of the recording area 130.

(9)本実施の形態においては、図10のデフラグ処理においてクラスタのデータの入れ替え処理を行う度に記録媒体100内のFATテーブルやディレクトリエントリ等のFAT情報を更新するとした。データ書き込み回数を削減するために、記録媒体100内の管理情報領域300へのFAT情報の書き込みは、全てのクラスタのデータ入れ替え処理が完了した後にまとめて行ってもよい。   (9) In the present embodiment, the FAT information such as the FAT table and directory entry in the recording medium 100 is updated every time the cluster data replacement process is performed in the defragmentation process of FIG. In order to reduce the number of times of data writing, the writing of FAT information to the management information area 300 in the recording medium 100 may be performed collectively after the data replacement processing of all the clusters is completed.

(10)本実施の形態においては、記録媒体の書き込み単位を1ブロックと定義したが、書き込み単位の整数倍を1ブロックと定義してもよい。   (10) Although the writing unit of the recording medium is defined as one block in the present embodiment, an integral multiple of the writing unit may be defined as one block.

(11)本実施の形態においては、記録媒体100は2つの論理アドレスの置換を行うコマンドを処理できる機能を備えているとしたが、3つ以上の論理アドレスをまとめて置換するコマンドを処理できる機能を備えていても良い。   (11) In the present embodiment, the recording medium 100 has a function capable of processing a command for replacing two logical addresses, but can process a command for replacing three or more logical addresses together. It may have a function.

図24は、3つの論理アドレスの置換を指示するコマンドによる置換処理を説明した図である。図24(a)の状態から図24(c)の状態にデータの並べ替えを行う場合、2つの論理アドレスの置換を行うコマンドによれば、論理アドレスL0とL1のデータの入れ替えを行って図15(b)の状態にした後で、さらに、論理アドレスL1とL2のデータの入れ替えを行って図15(c)の状態に並べ替える必要がある。このとき記録媒体100は、論理アドレスL0と論理アドレスL1を置換するコマンドと、論理アドレスL1と論理アドレスL2を置換するコマンドとの複数のコマンドを実行する。   FIG. 24 is a diagram for explaining replacement processing by a command instructing replacement of three logical addresses. When data is rearranged from the state of FIG. 24A to the state of FIG. 24C, the command for replacing two logical addresses is used to replace the data at the logical addresses L0 and L1. After changing to the state of 15 (b), it is necessary to further rearrange the data of the logical addresses L1 and L2 and rearrange them to the state of FIG. 15 (c). At this time, the recording medium 100 executes a plurality of commands including a command for replacing the logical address L0 and the logical address L1, and a command for replacing the logical address L1 and the logical address L2.

これに対し、3つの論理アドレス(ここでは、L0,L1,L2)の置換を指示するコマンドによれば、1つのコマンドの実行で、論理アドレスL0のデータは論理アドレスL2に、論理アドレスL1のデータは論理アドレスL0に、論理アドレスL2のデータは論理アドレスL1に同時に移動させることができる。   On the other hand, according to the command for instructing replacement of three logical addresses (here, L0, L1, and L2), the data of the logical address L0 is stored in the logical address L2 and the logical address L1 in one command execution. Data can be moved to logical address L0 and data at logical address L2 can be moved to logical address L1 simultaneously.

(12)本実施の形態においては、図10のデフラグ処理において各クラスタに格納されたデータの移動先が全て決定してから、すなわち、全クラスタに対する移動先リスト500の作成後に、データの移動処理を開始したが、一部のデータの移動先が決まった時点でデータの移動処理を開始してもよい。   (12) In the present embodiment, after all the migration destinations of the data stored in each cluster are determined in the defragmentation process of FIG. 10, that is, after the creation of the migration destination list 500 for all clusters, the data migration process However, the data movement process may be started when the movement destination of some data is determined.

また、ステップS1003のデータの移動処理において2つのクラスタ間でのデータの入れ替え処理を繰り返すことによって全てのデータを並び替える方法を記述したが、同時に2つ以上のデータの入れ替えを行ってもよい。   Moreover, although the method of rearranging all the data by repeating the data exchange process between two clusters in the data movement process of step S1003 has been described, two or more data may be exchanged at the same time.

(13)本実施の形態において、記録媒体100は1つの記録領域130を備えるとしたが、複数の記録領域と、それぞれの記録領域に対応する論物変換テーブルとを備えてもよい。このとき、少なくとも同一の記録領域内での置換が可能であるものとする。   (13) In the present embodiment, the recording medium 100 includes one recording area 130. However, the recording medium 100 may include a plurality of recording areas and a logical-physical conversion table corresponding to each recording area. At this time, it is assumed that at least replacement within the same recording area is possible.

例えばSDメモリカードのような記録媒体の場合、ユーザが自由にアクセスできる記録領域である通常領域と、特定の認証処理に成功したときのみアクセスできる記録領域である認証領域が存在する。このとき、記録媒体は、通常領域用及び認証領域用の2つの論物変換テーブルを備え、さらに、各々の記録領域内でデータの入れ替えを行う置換コマンドを備えてもよい。   For example, in the case of a recording medium such as an SD memory card, there are a normal area that is a recording area that a user can freely access, and an authentication area that is a recording area that can be accessed only when a specific authentication process is successful. At this time, the recording medium may include two logical-physical conversion tables for the normal area and the authentication area, and may further include a replacement command for exchanging data in each recording area.

(14)本実施の形態において、データ処理装置200は記録媒体100の置換コマンドで置換される各ブロックのサイズを予め知っているものとして説明したが、記録媒体100が、各ブロックのサイズをデータ処理装置200に通知するための通知コマンドを備えていても良い。データ処理装置200はその通知用のコマンドを用いて記録媒体100から各ブロックのサイズを取得できる。   (14) In the present embodiment, the data processing apparatus 200 has been described as knowing in advance the size of each block to be replaced by the replacement command of the recording medium 100. However, the recording medium 100 determines the size of each block as data. A notification command for notifying the processing device 200 may be provided. The data processing apparatus 200 can acquire the size of each block from the recording medium 100 using the notification command.

本発明は、情報記録媒体における高速なデータ移動処理を可能とする。このため、情報記録媒体において頻繁にデータ移動が行われるアプリケーション(例えば、デフラグ処理)に有効である。また、本発明は、データ移動処理にともない記録領域上でのデータの書き替えを実施しないため、アクセス回数に制限のある半導体メモリを備えた情報記録媒体に有効である。   The present invention enables high-speed data movement processing in an information recording medium. Therefore, this is effective for an application (for example, defragmentation processing) in which data movement is frequently performed on the information recording medium. In addition, the present invention is effective for an information recording medium including a semiconductor memory with a limited number of accesses because data is not rewritten on a recording area in accordance with data movement processing.

本発明に係る情報記録システムの構成例を示したブロック図である。1 is a block diagram showing a configuration example of an information recording system according to the present invention. 記録媒体における論物変換テーブルのデータ構造及びデータの例を示した図である。It is the figure which showed the data structure and example of data of the logical-physical conversion table in a recording medium. 記録媒体のReadコマンド受信時の動作シーケンス例を示したフローチャートである。It is the flowchart which showed the example of an operation | movement sequence at the time of Read command reception of a recording medium. 記録媒体のWriteコマンド受信時の動作シーケンス例を示したフローチャートである。It is the flowchart which showed the example of an operation | movement sequence at the time of Write command reception of a recording medium. 記録媒体の置換コマンド受信時の動作シーケンス例を示したフローチャートである。It is the flowchart which showed the example of an operation sequence at the time of receiving the replacement command of a recording medium. 置換処理の前後における論物変換テーブルのデータ例を示した図である。It is the figure which showed the example of data of the logical-physical conversion table before and after substitution processing. FATファイルシステムの構成例を示した図である。It is the figure which showed the structural example of the FAT file system. FATファイルシステムにおけるファイルデータの具体的な格納例を示した図である。It is the figure which showed the specific example of storage of the file data in a FAT file system. 本発明の情報記録システムにおけるデータ処理装置の構成例を示したブロック図である。It is the block diagram which showed the structural example of the data processor in the information recording system of this invention. データ処理装置によるデフラグ処理(記録媒体に格納されたデータの断片化を解消するための処理)の動作シーケンス例を示したフローチャートである。It is the flowchart which showed the example of an operation | movement sequence of the defragmentation process (process for eliminating the fragmentation of the data stored in the recording medium) by a data processor. 移動先リストのデータ構造及びデータの例を示した図である。It is the figure which showed the data structure and data example of the movement destination list. 図11の移動先リストにおいて、クラスタ#1への移動完了後のデータ構造及びデータの例を示した図である。FIG. 12 is a diagram illustrating an example of a data structure and data after completion of movement to cluster # 1 in the movement destination list of FIG. 11. (a)従来技術におけるデータ処理装置による記録媒体に格納されたクラスタのデータの移動処理の動作シーケンス例を示したフローチャート、及び(b)本発明によるデータの移動処理の動作シーケンス例を示したフローチャートである。(A) A flowchart showing an example of an operation sequence of data movement processing of a cluster stored in a recording medium by a data processing apparatus in the prior art, and (b) a flowchart showing an example of an operation sequence of data movement processing according to the present invention. It is. FATファイルシステムにおけるファイルデータの格納例を示した図である。It is the figure which showed the example of storage of the file data in a FAT file system. 図14に示す例における移動先リストの例を示した図である。It is the figure which showed the example of the movement destination list | wrist in the example shown in FIG. 図14に示す例における論物変換テーブルの例を示した図である。It is the figure which showed the example of the logical-physical conversion table in the example shown in FIG. 図14に示す例においてクラスタ#42とクラスタ#45の置換後のファイルデータの格納例を示した図である。FIG. 15 is a diagram showing an example of storing file data after replacement of cluster # 42 and cluster # 45 in the example shown in FIG. 図16に示す例における移動先リストの例を示した図である。It is the figure which showed the example of the movement destination list | wrist in the example shown in FIG. 図16に示す例における論物変換テーブルの例を示した図である。It is the figure which showed the example of the logical-physical conversion table in the example shown in FIG. 図14に示す例においてデフラグ処理完了後のファイルデータの格納例を示した図である。FIG. 15 is a diagram showing an example of storing file data after completion of the defragmentation process in the example shown in FIG. 14. 図18に示す例における移動先リストの例を示した図である。It is the figure which showed the example of the movement destination list | wrist in the example shown in FIG. 図18に示す例における論物変換テーブルの例を示した図である。It is the figure which showed the example of the logical-physical conversion table in the example shown in FIG. 図14に示す例において、ファイル先頭データを移動させないようにデフラグ処理を実行するための移動先リストの例を示した図である。In the example shown in FIG. 14, it is the figure which showed the example of the movement destination list | wrist for performing a defragmentation process so that a file head data may not be moved. 図14に示す例における論物変換テーブルの例を示した図である。It is the figure which showed the example of the logical-physical conversion table in the example shown in FIG. 図14に示す例においてファイル先頭データを移動させないようにデフラグ処理を実行した後のファイルデータの格納例を示した図である。FIG. 15 is a diagram illustrating a storage example of file data after performing a defragmentation process so as not to move file head data in the example illustrated in FIG. 14. 図21に示す例における移動先リストの例を示した図である。It is the figure which showed the example of the movement destination list | wrist in the example shown in FIG. 図21に示す例における論物変換テーブルの例を示した図である。It is the figure which showed the example of the logical-physical conversion table in the example shown in FIG. 1つのブロックに連続した16個の物理アドレス及び論理アドレスが割り振られた場合の論物変換テーブルのデータ構造及びデータ例を示した図である。It is the figure which showed the data structure and data example of a logical-physical conversion table when 16 continuous physical addresses and logical addresses are allocated to one block. 3つの論理アドレスの置換を一度に指示するコマンドを説明するための図である。It is a figure for demonstrating the command which instruct | indicates substitution of three logical addresses at once.

符号の説明Explanation of symbols

100 記録媒体
110 ホストインタフェース部
120 制御部
130 記録領域
140 論物変換テーブル
150 データ格納部
200 データ処理装置(ホスト)
210 スロット
220 入出力処理部
230 データ処理部
240 ユーザ入力処理部
250 表示処理部
300 管理情報領域
310 データ領域
401 ディレクトリエントリ
402 FATテーブル
500 移動先リスト
DESCRIPTION OF SYMBOLS 100 Recording medium 110 Host interface part 120 Control part 130 Recording area 140 Logical-physical conversion table 150 Data storage part 200 Data processing apparatus (host)
210 slot 220 I / O processing unit 230 data processing unit 240 user input processing unit 250 display processing unit 300 management information area 310 data area 401 directory entry 402 FAT table 500 destination list

Claims (14)

データ処理装置によってデータの読み出し、書き込みが可能な情報記録媒体であって、
データを格納するための記録領域を有し、該記録領域の物理アドレスと論理アドレスの対応関係を格納する論物変換テーブルを格納するデータ格納部と、
前記データ処理装置との通信を行うホストインタフェース部と、
前記データ格納部及び前記ホストインタフェース部に対し制御を行う制御部とを備え、
前記制御部は、前記ホストインタフェース部を介して前記データ処理装置から所定の置換コマンドを受信したときに、該置換コマンドで指定される複数の論理アドレス間で、前記論物変換テーブルにおける論理アドレスに対する物理アドレスを置換する、情報記録媒体。
An information recording medium from which data can be read and written by a data processing device,
A data storage unit that stores a logical-physical conversion table that has a recording area for storing data and stores a correspondence between a physical address and a logical address of the recording area;
A host interface unit for communicating with the data processing device;
A control unit that controls the data storage unit and the host interface unit,
When the control unit receives a predetermined replacement command from the data processing device via the host interface unit, the control unit applies a logical address in the logical-physical conversion table between a plurality of logical addresses specified by the replacement command. An information recording medium that replaces physical addresses.
前記置換コマンドは2つの論理アドレスを指定する、請求項1に記載の情報記録媒体。   The information recording medium according to claim 1, wherein the replacement command specifies two logical addresses. 前記記録領域はファイルシステムによってクラスタ単位で管理されており、前記クラスタの境界と、前記論物変換テーブル上でのデータ管理単位の境界とが一致する、請求項1記載の情報記録媒体。   The information recording medium according to claim 1, wherein the recording area is managed in cluster units by a file system, and a boundary of the cluster coincides with a boundary of a data management unit on the logical-physical conversion table. 前記記録領域が複数の領域に分割され、該複数の分割領域のそれぞれに対して論物変換テーブルを備えており、前記置換コマンドにより、同一の論物変換テーブル内において複数の論理アドレス間の論理アドレスと物理アドレスの対応関係が置換可能である、請求項1記載の情報記録媒体。   The recording area is divided into a plurality of areas, each having a logical-physical conversion table for each of the plurality of divided areas, and a logical command between a plurality of logical addresses in the same logical-physical conversion table by the replacement command. The information recording medium according to claim 1, wherein a correspondence relationship between an address and a physical address is replaceable. 前記複数の分割領域は、ユーザが自由にアクセス可能な領域と、特定の認証処理に成功したときのみユーザがアクセス可能な領域とを含む、請求項4記載の情報記録媒体。   The information recording medium according to claim 4, wherein the plurality of divided areas include an area that the user can freely access and an area that the user can access only when a specific authentication process is successful. 前記制御部は前記ホストインタフェース部を介して所定の通知コマンドを受信したときに、置換される記録領域のサイズを前記データ処理装置に通知する、請求項1記載の情報記録媒体。   The information recording medium according to claim 1, wherein the control unit notifies the data processing device of a size of a recording area to be replaced when a predetermined notification command is received via the host interface unit. 請求項1記載の情報記録媒体に対してデータの読み出し、書き込みを行うデータ処理装置であって、
前記情報記録媒体を装着するスロットと、
該スロットに装着された前記情報記録媒体に対するデータの入出力を行う入出力処理部と、
該入出力処理部を通じて前記記録媒体へ入出力するデータの処理を含む所定の制御を行うデータ処理部とを備え、
前記データ処理部は前記記録媒体に対して前記置換コマンドを発行する機能を有する、
データ処理装置。
A data processing apparatus for reading and writing data on the information recording medium according to claim 1,
A slot for mounting the information recording medium;
An input / output processing unit for inputting / outputting data to / from the information recording medium mounted in the slot;
A data processing unit that performs predetermined control including processing of data input to and output from the recording medium through the input / output processing unit,
The data processing unit has a function of issuing the replacement command to the recording medium;
Data processing device.
前記データ処理部は、前記記録媒体の記録領域をファイルシステムによってクラスタ単位で管理し、前記クラスタの境界と、前記論物変換テーブル上でのデータ管理単位の境界とが一致するように入出力処理を実行する、請求項7に記載のデータ処理装置。   The data processing unit manages the recording area of the recording medium in units of clusters by a file system, and performs input / output processing so that the boundaries of the clusters coincide with the boundaries of the data management units on the logical-physical conversion table The data processing apparatus according to claim 7, wherein: データを格納するための記録領域を有し、該記録領域の物理アドレスと論理アドレスの対応関係を格納する論物変換テーブルを格納する情報記録媒体に格納されたデータを移動するための方法であって、
前記情報記録媒体の記録領域上でのデータの書き替え処理を伴わずに、移動前後の領域の間で、前記論物変換テーブルにおける論理アドレスに対する物理アドレスを置換する、データ処理方法。
This is a method for moving data stored in an information recording medium having a recording area for storing data and storing a logical-physical conversion table for storing the correspondence between the physical address and logical address of the recording area. And
A data processing method for replacing a physical address for a logical address in the logical-physical conversion table between areas before and after movement without rewriting data on a recording area of the information recording medium.
前記情報記録媒体の記録領域において連続した領域にデータが格納されるように決定されたデータの移動先の一覧である移動先リストを作成し、
前記情報記録媒体内のデータの断片化を解消するために、前記移動先リストに基づいて移動前後の領域を決定し、
該決定した移動前後の領域に対して、前記論物変換テーブル上での論理アドレスに対する物理アドレスを置換する、請求項9に記載のデータ処理方法。
Creating a destination list that is a list of destinations of data determined to be stored in a continuous area in the recording area of the information recording medium;
In order to eliminate fragmentation of data in the information recording medium, determine the area before and after the movement based on the movement destination list,
The data processing method according to claim 9, wherein a physical address corresponding to a logical address on the logical-physical conversion table is replaced with the determined area before and after movement.
データの断片化を解消した後に生じる論理的な空き領域に対してデータの物理的消去を行う、請求項10に記載のデータ処理方法。   The data processing method according to claim 10, wherein physical erasure of data is performed on a logical empty area that occurs after data fragmentation is resolved. 前記記録媒体の前記記録領域にストリーミングデータが格納されている場合、前記ストリーミングデータが格納される領域の論理アドレスに対して前記論物変換テーブル上の置換を行い、前記ストリーミングデータが格納される領域を論理アドレス空間上で連続的にする、請求項10記載のデータ処理方法。   When streaming data is stored in the recording area of the recording medium, the logical address of the area where the streaming data is stored is replaced on the logical-physical conversion table, and the streaming data is stored The data processing method according to claim 10, wherein the data is made continuous in a logical address space. 前記ストリーミングデータは音声データ及び/または映像データを含む、請求項12に記載のデータ処理方法。   The data processing method according to claim 12, wherein the streaming data includes audio data and / or video data. 前記情報記録媒体の記録領域に音声データ及び/または映像データが記録された直後に、前記論物変換テーブルの置換を行い、前記音声データ及び/または映像データが論理的に連続的な領域に記録されるようにする、請求項10記載のデータ処理方法。
Immediately after the audio data and / or video data is recorded in the recording area of the information recording medium, the logical-physical conversion table is replaced, and the audio data and / or video data is recorded in a logically continuous area. The data processing method according to claim 10, wherein:
JP2004361668A 2003-12-16 2004-12-14 Information recording medium, data processor and data processing method Pending JP2005202942A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004361668A JP2005202942A (en) 2003-12-16 2004-12-14 Information recording medium, data processor and data processing method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2003417777 2003-12-16
JP2004361668A JP2005202942A (en) 2003-12-16 2004-12-14 Information recording medium, data processor and data processing method

Publications (1)

Publication Number Publication Date
JP2005202942A true JP2005202942A (en) 2005-07-28

Family

ID=34829161

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004361668A Pending JP2005202942A (en) 2003-12-16 2004-12-14 Information recording medium, data processor and data processing method

Country Status (1)

Country Link
JP (1) JP2005202942A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007257636A (en) * 2006-03-21 2007-10-04 Internatl Business Mach Corp <Ibm> Method, system and computer program for allocating dma address space
JP2007299020A (en) * 2006-02-22 2007-11-15 Matsushita Electric Ind Co Ltd Device driver
JP2008016030A (en) * 2006-07-03 2008-01-24 Lg Electronics Inc System operation control device and method
JP2008077478A (en) * 2006-09-22 2008-04-03 Hitachi Ltd Storage control device, storage control method, storage device and storage control method by storage device
JP2010535375A (en) * 2007-08-01 2010-11-18 エヌエックスピー ビー ヴィ Mobile communication device and method for defragmenting MIFARE memory
US8626987B2 (en) 2009-10-27 2014-01-07 Samsung Electronics Co., Ltd. Flash memory system and defragmentation method
US8750679B2 (en) 2007-09-10 2014-06-10 Sony Corporation Information processing apparatus, recording method, and computer program
US8850105B2 (en) 2011-04-08 2014-09-30 Kabushiki Kaisha Toshiba Method for controlling memory system, information processing apparatus, and storage medium
EP2790108A2 (en) 2013-04-09 2014-10-15 Fujitsu Limited Information processing apparatus, memory control device, data transfer control method, and data transfer control program
EP2869184A1 (en) 2013-10-31 2015-05-06 Fujitsu Limited Information processing apparatus, data transfer control method, and data transfer control program
WO2016113831A1 (en) * 2015-01-13 2016-07-21 株式会社日立製作所 Storage system and memory control method
WO2017212515A1 (en) * 2016-06-06 2017-12-14 株式会社日立製作所 Storage system, computer, and storage control method

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007299020A (en) * 2006-02-22 2007-11-15 Matsushita Electric Ind Co Ltd Device driver
JP2007257636A (en) * 2006-03-21 2007-10-04 Internatl Business Mach Corp <Ibm> Method, system and computer program for allocating dma address space
JP2008016030A (en) * 2006-07-03 2008-01-24 Lg Electronics Inc System operation control device and method
JP2008077478A (en) * 2006-09-22 2008-04-03 Hitachi Ltd Storage control device, storage control method, storage device and storage control method by storage device
JP2010535375A (en) * 2007-08-01 2010-11-18 エヌエックスピー ビー ヴィ Mobile communication device and method for defragmenting MIFARE memory
US8750679B2 (en) 2007-09-10 2014-06-10 Sony Corporation Information processing apparatus, recording method, and computer program
US8626987B2 (en) 2009-10-27 2014-01-07 Samsung Electronics Co., Ltd. Flash memory system and defragmentation method
US8850105B2 (en) 2011-04-08 2014-09-30 Kabushiki Kaisha Toshiba Method for controlling memory system, information processing apparatus, and storage medium
EP2790108A2 (en) 2013-04-09 2014-10-15 Fujitsu Limited Information processing apparatus, memory control device, data transfer control method, and data transfer control program
EP2869184A1 (en) 2013-10-31 2015-05-06 Fujitsu Limited Information processing apparatus, data transfer control method, and data transfer control program
JP2015088069A (en) * 2013-10-31 2015-05-07 富士通株式会社 Information processing device, data transfer control method, and data transfer control program
WO2016113831A1 (en) * 2015-01-13 2016-07-21 株式会社日立製作所 Storage system and memory control method
JPWO2016113831A1 (en) * 2015-01-13 2017-08-24 株式会社日立製作所 Storage system and storage control method
US10067882B2 (en) 2015-01-13 2018-09-04 Hitachi, Ltd. Storage system and storage control method
WO2017212515A1 (en) * 2016-06-06 2017-12-14 株式会社日立製作所 Storage system, computer, and storage control method

Similar Documents

Publication Publication Date Title
US7401174B2 (en) File system defragmentation and data processing method and apparatus for an information recording medium
KR101086857B1 (en) Control Method of Solid State Storage System for Data Merging
JP4287433B2 (en) File recording device
US7849282B2 (en) Filesystem building method
KR100951107B1 (en) Method for managing files for optimal performance
US7536505B2 (en) Storage system and method for controlling block rearrangement
US8291189B2 (en) Storage system and storage control method that compress and store data elements
JP5485163B2 (en) Access module, information recording module, controller, and information recording system
JP5129156B2 (en) Access device and write-once recording system
JP2004334419A (en) Magnetic disk device, file management system, and its method
JP2008015769A (en) Storage system and writing distribution method
JP6094267B2 (en) Storage system
KR20100089229A (en) Method and apparatus for data management in flash memory by address mapping
JP6391061B2 (en) How to write a file on tape
KR20110139956A (en) Data storage device and data management method for processing of mapping table
JP2005202942A (en) Information recording medium, data processor and data processing method
JP4608434B2 (en) Data processing apparatus and data recording method for information recording medium
JP2015052844A (en) Copy controller, copy control method, and copy control program
JP6531574B2 (en) Storage device, storage device control program and storage device control method
WO2013046342A1 (en) Virtual tape device and control method for virtual tape device
WO2010001606A1 (en) Controller, information recording device, access device, information recording system, and information recording method
US9513826B2 (en) Storage apparatus and storage apparatus control method
JP3725375B2 (en) Data reorganization method in storage media library
JP2017146722A (en) Storage device
JP2010238139A (en) Information processing apparatus, information processing method and program

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20061206