JP5664264B2 - Data processing apparatus and data processing method - Google Patents

Data processing apparatus and data processing method Download PDF

Info

Publication number
JP5664264B2
JP5664264B2 JP2011008077A JP2011008077A JP5664264B2 JP 5664264 B2 JP5664264 B2 JP 5664264B2 JP 2011008077 A JP2011008077 A JP 2011008077A JP 2011008077 A JP2011008077 A JP 2011008077A JP 5664264 B2 JP5664264 B2 JP 5664264B2
Authority
JP
Japan
Prior art keywords
data size
unit
data
file
transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2011008077A
Other languages
Japanese (ja)
Other versions
JP2012150611A (en
Inventor
勇樹 今泉
勇樹 今泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2011008077A priority Critical patent/JP5664264B2/en
Publication of JP2012150611A publication Critical patent/JP2012150611A/en
Application granted granted Critical
Publication of JP5664264B2 publication Critical patent/JP5664264B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、データ処理装置、及びデータ処理方法に関する。   The present invention relates to a data processing apparatus and a data processing method.

従来、データの転送を行う際の転送効率の向上が重要となる。このため、様々な技術が提案されている。提案された技術のうちの1つとしては、セクタ単位でデータ転送が行われるデバイスに大容量のデータ転送を行う際、複数セクタを1セクタとみなして、転送する技術が提案されている。このような転送技術を用いることで、転送効率の向上を図ることができる。   Conventionally, it is important to improve transfer efficiency when transferring data. For this reason, various techniques have been proposed. As one of the proposed technologies, a technology has been proposed in which when transferring a large amount of data to a device that performs data transfer in units of sectors, a plurality of sectors are regarded as one sector and transferred. By using such a transfer technique, it is possible to improve transfer efficiency.

しかしながら、上述した従来の技術では、データの転送サイズが1セクタより大きい場合しか考慮しておらず、転送するデータのサイズが1セクタより小さい場合については考慮していなかった。そのため、転送するデータのデータサイズが、1セクタのデータサイズより小さい場合、不要なデータを詰めて調節する必要があるため、転送パフォーマンスが低くなると言う問題があった。   However, the above-described conventional technology considers only the case where the data transfer size is larger than one sector, and does not consider the case where the size of data to be transferred is smaller than one sector. Therefore, when the data size of the data to be transferred is smaller than the data size of one sector, there is a problem that transfer performance is lowered because unnecessary data needs to be packed and adjusted.

本発明は、上記に鑑みてなされたものであって、転送するデータのデータサイズに従って転送パフォーマンスを向上させるデータ処理装置、及びデータ処理方法を提案する。   The present invention has been made in view of the above, and proposes a data processing apparatus and a data processing method that improve transfer performance according to the data size of data to be transferred.

上述した課題を解決し、目的を達成するために、本発明にかかるデータ処理装置は、記憶媒体とデータを送受信する際に、当該記憶媒体のセクタ長以上のデータサイズ単位でデータの送信を制御する送信手段と、前記記憶媒体に送信する、複数のファイルのデータサイズを認識する認識手段と、前記複数のファイルのうち、前記セクタ長よりデータサイズが小さいファイルが含まれていた場合に、前記データサイズ単位で当該小さいファイルを送信する際の冗長データのサイズに基づいて、前記セクタ長以上の前記データサイズ単位で送信するか否かを判定する判定手段と、前記判定手段により送信しないと判定された場合、前記セクタ長より小さいファイルを前記送信手段が送信する際、当該ファイルのデータサイズに基づいて、前記送信手段が送信するデータサイズ単位を調整する調整手段と、を備え、前記判定手段は、さらに、前記セクタ長より小さい複数のファイルの冗長データの合計のデータサイズが、前記送信手段が送信する前記データサイズ単位を変更する変更命令のデータサイズと比べて大きい場合に、前記セクタ長以上の前記データサイズ単位で送信しないと判定し、前記調整手段は、前記判定手段により送信しないと判定された場合、前記変更命令で、前記送信手段が一回に送信するデータサイズ単位を調整すること、を特徴とする。 In order to solve the above-described problems and achieve the object, the data processing apparatus according to the present invention controls data transmission in units of data size equal to or larger than the sector length of the storage medium when transmitting / receiving data to / from the storage medium. Transmitting means, a recognition means for recognizing the data size of a plurality of files to be transmitted to the storage medium, and a file having a data size smaller than the sector length among the plurality of files, Based on the size of redundant data when transmitting the small file in units of data size, a determination unit that determines whether to transmit in the data size unit that is equal to or greater than the sector length, and a determination that the determination unit does not transmit If the transmission means transmits a file smaller than the sector length, the transmission means is based on the data size of the file. Comprising an adjusting means for adjusting a data size unit stage is transmitted, said data said determining means further total data size of the redundant data of the sector plurality of smaller than length file, said transmitting means transmits When it is larger than the data size of the change instruction to change the size unit, it is determined not to transmit in the data size unit equal to or greater than the sector length, and the adjustment unit is determined not to transmit by the determination unit, The change command adjusts a data size unit that the transmission means transmits at a time .

本発明によれば、転送パフォーマンスの低下を抑止できるという効果を奏する。   According to the present invention, it is possible to suppress a decrease in transfer performance.

図1は、実施の形態にかかるASICの構成を示すブロック図である。FIG. 1 is a block diagram illustrating a configuration of the ASIC according to the embodiment. 図2は、従来の手法を用いて、1セクタが512バイトのSDカードに対して、256バイトのファイルを6回送信した例を示した図である。FIG. 2 is a diagram showing an example in which a 256-byte file is transmitted six times to an SD card having one sector of 512 bytes using a conventional method. 図3は、本実施の形態にかかるASICが、SDカードに対して256バイトのファイルを6回送信した例を示した図である。FIG. 3 is a diagram showing an example in which the ASIC according to this embodiment transmits a 256-byte file to the SD card six times. 図4は、ASICが、SDカードに対してデータを送信する際の制御フローを示した図である。FIG. 4 is a diagram showing a control flow when the ASIC transmits data to the SD card. 図5は、判定部により、ファイルを送信する際に転送データサイズを調整するか否かの判定、及び次に転送データサイズを調整するタイミングを特定するための処理フローを示した図である。FIG. 5 is a diagram showing a processing flow for the determination unit to determine whether or not to adjust the transfer data size when transmitting a file, and to specify the next timing to adjust the transfer data size. 図6は、転送データサイズの変更コマンドの発行を行った場合と行っていない場合とにおける、ファイル1個を送信した時の冗長バイト数の例を示した図である。FIG. 6 is a diagram showing an example of the number of redundant bytes when one file is transmitted when a transfer data size change command is issued and when it is not issued. 図7は、転送データサイズの変更コマンドの発行を行った場合と行っていない場合とにおける、ファイル2個を送信した時の冗長バイト数の例を示した図である。FIG. 7 is a diagram showing an example of the number of redundant bytes when two files are transmitted when a transfer data size change command is issued and when it is not issued. 図8は、転送データサイズの変更コマンドの発行を行った場合と行っていない場合とにおける、ファイル4個を送信した時の冗長バイト数の例を示した図である。FIG. 8 is a diagram showing an example of the number of redundant bytes when four files are transmitted when a transfer data size change command is issued and when it is not issued. 図9は、転送データサイズの変更コマンドの発行を行った場合と行っていない場合とにおける、ファイル2個を送信した時の冗長バイト数の例を示した図である。FIG. 9 is a diagram showing an example of the number of redundant bytes when two files are transmitted when a transfer data size change command is issued and when it is not issued. 図10は、転送データサイズを1回も変更しなかった場合の冗長バイト数の合計を示した図である。FIG. 10 is a diagram showing the total number of redundant bytes when the transfer data size is not changed even once. 図11は、転送データサイズを1回だけ変更した場合の冗長バイト数の合計を示した図である。FIG. 11 is a diagram showing the total number of redundant bytes when the transfer data size is changed only once. 図12は、転送データサイズを2回変更した場合の冗長バイト数の合計を示した図である。FIG. 12 is a diagram showing the total number of redundant bytes when the transfer data size is changed twice.

以下に添付図面を参照して、この発明にかかるデータ処理装置、及びデータ処理方法の一実施の形態を詳細に説明する。本実施の形態では、本発明のデータ処理装置をASICに適用した例について説明する。   Exemplary embodiments of a data processing device and a data processing method according to the present invention will be explained below in detail with reference to the accompanying drawings. In this embodiment, an example in which the data processing apparatus of the present invention is applied to an ASIC will be described.

(実施の形態)
図1は、実施の形態にかかるASICの構成を示すブロック図である。当該ASICは、記憶媒体に対して読み書き可能な様々な情報処理装置に搭載することができる。そこで、本実施の形態では、当該ASICを、PC(Personal Computer)などの一般的な情報処理装置に搭載する例について説明する。
(Embodiment)
FIG. 1 is a block diagram illustrating a configuration of the ASIC according to the embodiment. The ASIC can be mounted on various information processing apparatuses that can read and write data from / to a storage medium. Therefore, in this embodiment, an example in which the ASIC is mounted on a general information processing apparatus such as a PC (Personal Computer) will be described.

図1に示すように、ASIC102は、メモリ103と、転送データバッファ104と、DMAC105と、SDホスト106と、データ転送制御部107と、判定部108と、認識部109と、を備える。また、ASIC102は、CPU101と接続されている。そしてCPU101が、ASIC102の設定及び制御を行う。このようにASIC102は、CPU101からの命令に従って様々な処理を行う。また、ASIC102は、SDカード112が接続された場合に、当該SDカード112に対してデータの読み書きを行うことができる。   As shown in FIG. 1, the ASIC 102 includes a memory 103, a transfer data buffer 104, a DMAC 105, an SD host 106, a data transfer control unit 107, a determination unit 108, and a recognition unit 109. The ASIC 102 is connected to the CPU 101. Then, the CPU 101 performs setting and control of the ASIC 102. As described above, the ASIC 102 performs various processes in accordance with instructions from the CPU 101. Further, the ASIC 102 can read / write data from / to the SD card 112 when the SD card 112 is connected.

SDカード112は、セクタ単位でデータの送受信の対象となる記憶媒体とする。本実施の形態は、記憶媒体としてSDカード112を用いた例について説明するが、SDカード以外の記憶媒体や、送受信の対象としてデバイス等に対してデータの送受信を行っても良い。次に、SDカード112に対するデータの送信について説明する。   The SD card 112 is a storage medium that is a target of data transmission / reception in units of sectors. In this embodiment, an example in which the SD card 112 is used as a storage medium will be described. However, data may be transmitted / received to / from a storage medium other than the SD card, a device or the like as a transmission / reception target. Next, data transmission to the SD card 112 will be described.

図2は、従来の手法を用いて、1セクタが512バイトのSDカードに対して、256バイトのファイルを6回送信した例を示した図である。図2に示すように、従来の転送手法では、セクタ長よりもデータサイズが小さいファイルを送信すると、冗長データを詰めた上で送信される。図2に示す例では、セクタ長が512バイトで、転送されファイルのファイルサイズが256バイトであるため、256バイトの冗長データが詰められた上で、SDカードに対して送信される。つまり、従来の手法では、6回256バイトのファイルを送信すると、合計256バイト×6の冗長データが送信されていることになる。このように、従来の手法では、本来必要でないデータ転送を行っているため、転送時間や記憶媒体側の使用領域に冗長がでてしまい、パフォーマンスが低くなる。   FIG. 2 is a diagram showing an example in which a 256-byte file is transmitted six times to an SD card having one sector of 512 bytes using a conventional method. As shown in FIG. 2, in the conventional transfer method, when a file having a data size smaller than the sector length is transmitted, the file is transmitted after filling with redundant data. In the example shown in FIG. 2, since the sector length is 512 bytes and the file size of the transferred file is 256 bytes, 256 bytes of redundant data are packed and transmitted to the SD card. That is, in the conventional method, when a 256-byte file is transmitted six times, a total of 256 bytes × 6 redundant data is transmitted. As described above, in the conventional method, since data transfer which is not originally required is performed, the transfer time and the use area on the storage medium side become redundant, and the performance is lowered.

図3は、本実施の形態にかかるASIC102が、SDカード112に対して、256バイトのファイルを6回送信した例を示した図である。図3に示すように、1セクタのセクタ長が512バイトであり、ASIC102とSDカード112との間で送受信するデータサイズの単位も初期設定では512バイトとしている(以下、SDカード112との間で一回に送受信されるデータサイズ単位を転送データサイズと称する)。しかしながら、256バイトのファイルが6回送信されるため、本実施の形態にかかるASIC102では、予め転送データサイズを512バイトから256バイトに変更するコマンドを発行した後、256バイトのファイルを6回送信する。   FIG. 3 is a diagram illustrating an example in which the ASIC 102 according to the present embodiment transmits a 256-byte file to the SD card 112 six times. As shown in FIG. 3, the sector length of one sector is 512 bytes, and the unit of the data size transmitted / received between the ASIC 102 and the SD card 112 is also 512 bytes in the initial setting (hereinafter referred to as the SD card 112). A data size unit transmitted and received at a time is referred to as a transfer data size). However, since a 256-byte file is transmitted six times, the ASIC 102 according to this embodiment transmits a 256-byte file six times after issuing a command to change the transfer data size from 512 bytes to 256 bytes in advance. To do.

このように、本実施の形態では、転送データサイズが、ファイルサイズと同等に変更した後に、ファイルの送信を行っているため、送信されるデータに冗長部分がなく、転送パフォーマンスを向上させることができる。図1に戻り、ASIC102の具体的構成について説明する。   As described above, in this embodiment, since the file is transmitted after the transfer data size is changed to be equal to the file size, there is no redundant part in the transmitted data, and the transfer performance can be improved. it can. Returning to FIG. 1, a specific configuration of the ASIC 102 will be described.

メモリ103は、SDカード112に転送するデータや、SDカード112から転送されてきたデータを格納する。   The memory 103 stores data to be transferred to the SD card 112 and data transferred from the SD card 112.

DMAC(Direct Memory Access Controller)105は、CPU101の介在なしに、メモリーアクセスをコントロールする。   A DMAC (Direct Memory Access Controller) 105 controls memory access without the intervention of the CPU 101.

認識部109は、SDカード112に送信するために、メモリ103に格納された複数のファイルのデータサイズを認識する。   The recognition unit 109 recognizes data sizes of a plurality of files stored in the memory 103 for transmission to the SD card 112.

転送データバッファ104は、メモリ103から読み出された転送データを格納する。転送データバッファ104は、メモリ103からデータを読み出す際に、予め定められた転送順序に従って転送データの並び替えを行う。本実施の形態にかかる転送データバッファ104は、SDカード112に送信する複数のファイルに対して、認識部109で認識されたデータサイズが大きい順から送信するよう送信順序を並び替える。なお、メモリ103に、本実施の形態に適した順番で転送ファイルが格納されている場合、転送データバッファ104は不要となる。   The transfer data buffer 104 stores the transfer data read from the memory 103. The transfer data buffer 104 rearranges transfer data according to a predetermined transfer order when reading data from the memory 103. The transfer data buffer 104 according to the present embodiment rearranges the transmission order so that the plurality of files to be transmitted to the SD card 112 are transmitted in the order of the data size recognized by the recognition unit 109. If the transfer files are stored in the memory 103 in the order suitable for the present embodiment, the transfer data buffer 104 is not necessary.

判定部108は、変更前冗長バイト数格納部121と、変更後冗長バイト数格納部122と、冗長バイト数比較部124と、セクタ長変更バイト数格納部123と、を備え、SDカード112に対して、転送データサイズを変更するか否かを判定する。   The determination unit 108 includes a pre-change redundant byte number storage unit 121, a post-change redundant byte number storage unit 122, a redundant byte number comparison unit 124, and a sector length change byte number storage unit 123. On the other hand, it is determined whether or not to change the transfer data size.

本実施の形態にかかる判定部108は、認識部109による認識結果において、SDカード112のセクタ長よりデータサイズが小さいファイルが含まれていた場合に、セクタ長と同一以上のデータサイズ単位で当該ファイルを送信する際の冗長データのサイズに基づいて、セクタ長と同一以上の転送データサイズで送信するか否かを判定する。つまり、判定部108は、メモリ103に送信するために格納されている複数のファイルについて、セクタ長と同一以上の転送データサイズで送信した場合の総冗長データのサイズが、SDホスト106が送信する転送データサイズの変更コマンドのデータサイズと比べて大きい場合に、セクタ長と同一以上の転送データサイズで送信しない、換言すれば当該変更コマンドを発行してより小さい転送データサイズで送信すると判定する。一方、判定部108は、総冗長データのサイズが、SDホスト106が送信する転送データサイズの変更コマンドのデータサイズと比べて小さい場合に、セクタ長と同一以上の転送データサイズで送信し続けると判定する。   When the recognition result by the recognition unit 109 includes a file whose data size is smaller than the sector length of the SD card 112, the determination unit 108 according to the present embodiment performs the processing in units of data size equal to or greater than the sector length. Based on the size of the redundant data when transmitting the file, it is determined whether or not to transmit with a transfer data size equal to or larger than the sector length. That is, the determination unit 108 transmits the size of the total redundant data when the SD host 106 transmits the plurality of files stored for transmission to the memory 103 with the transfer data size equal to or larger than the sector length. If the data size is larger than the data size of the transfer data size change command, it is determined that transmission is not performed with a transfer data size equal to or greater than the sector length, in other words, the change command is issued and transmitted with a smaller transfer data size. On the other hand, when the size of the total redundant data is smaller than the data size of the transfer data size change command transmitted by the SD host 106, the determination unit 108 continues to transmit with a transfer data size equal to or greater than the sector length. judge.

本実施の形態にかかる判定部108は、SDカード112に送信するファイルとして、SDカード112のセクタ長よりデータサイズが小さいファイルが複数含まれていることが認識部109により認識された場合、転送データバッファ104により各ファイルのデータサイズが大きい順からに並び替えられた後、データサイズの大きいファイルから順に判定していく。   When the recognition unit 109 recognizes that the file to be transmitted to the SD card 112 includes a plurality of files having a data size smaller than the sector length of the SD card 112, the determination unit 108 according to the present embodiment transfers After the files are rearranged by the data buffer 104 in the descending order of the data size, the determination is made in order from the file having the largest data size.

そして、判定部108は、データサイズの大きいファイルから順の判定で、SDホスト106がセクタ長と同一以上の転送データサイズで送信するのをやめて、セクタ長より小さい転送データサイズで送信を開始するタイミングを決定する。判定部108は、タイミングを決定するために、変更前冗長バイト数格納部121と、変更後冗長バイト数格納部122と、冗長バイト数比較部124と、セクタ長変更バイト数格納部123と、を用いる。   Then, the determination unit 108 determines in order from a file with a larger data size, stops the SD host 106 from transmitting with a transfer data size equal to or larger than the sector length, and starts transmission with a transfer data size smaller than the sector length. Determine timing. In order to determine the timing, the determination unit 108 includes a pre-change redundant byte number storage unit 121, a post-change redundant byte number storage unit 122, a redundant byte number comparison unit 124, a sector length change byte number storage unit 123, Is used.

変更前冗長バイト数格納部121は、認識部109に認識された各ファイルのデータサイズと、転送データバッファ104によりデータサイズが大きい順にファイルが並び替えられた順序と、SDホスト106が現在の転送データサイズと、に基づいて、n番目のファイルで転送データサイズが変更されない場合の冗長データのバイト数の和を一時的に格納する。   The pre-change redundant byte number storage unit 121 includes a data size of each file recognized by the recognition unit 109, an order in which the files are rearranged by the transfer data buffer 104 in descending order of data size, and the SD host 106 performs the current transfer Based on the data size, the sum of the number of bytes of redundant data when the transfer data size is not changed in the nth file is temporarily stored.

変更後冗長バイト数格納部122は、認識部109に認識された各ファイルのデータサイズと、転送データバッファ104によりデータサイズが大きい順にファイルが並び替えられた順序と、調整部111が調整した場合のSDホスト106の転送データサイズと、に基づいて、n番目のファイルで転送データサイズが調整された場合の冗長データのバイト数の和を一時的に格納する。   The post-change redundant byte count storage unit 122 adjusts the data size of each file recognized by the recognition unit 109, the order in which the files are rearranged in the descending order of the data size by the transfer data buffer 104, and the adjustment unit 111 Based on the transfer data size of the SD host 106, the sum of the number of bytes of redundant data when the transfer data size is adjusted in the nth file is temporarily stored.

そのため、本実施の形態にかかる判定部108は、冗長データのサイズを、SDホスト106が送信している転送データサイズ(始めはSDカード112のセクタ長と同一のデータサイズ)から、これから送信するファイルのデータサイズを減算して求める。   Therefore, the determination unit 108 according to the present embodiment transmits the redundant data size from the transfer data size (initially the same data size as the sector length of the SD card 112) transmitted by the SD host 106. Calculate by subtracting the file data size.

冗長バイト数比較部124は、変更前冗長バイト数格納部121に記憶されたバイト数の和と、変更後冗長バイト数格納部122に記憶されたバイト数の和と、を比較する。つまり、冗長バイト数比較部124は、転送データサイズを調整せずに複数のファイルを送信し続けることによる冗長データの総和が、転送データサイズを調整して複数のファイルを送信し続けることによる冗長データの総和と変更コマンドのデータサイズとの総和を上回るか否かを判定する。   The redundant byte number comparison unit 124 compares the sum of the number of bytes stored in the pre-change redundant byte number storage unit 121 with the sum of the number of bytes stored in the post-change redundant byte number storage unit 122. In other words, the redundant byte count comparing unit 124 determines that the sum of redundant data by continuously transmitting a plurality of files without adjusting the transfer data size is redundant by continuously transmitting a plurality of files by adjusting the transfer data size. It is determined whether or not the sum of the data sum and the data size of the change command exceeds the sum.

本実施の形態では、判定部108は、冗長バイト数比較部124により上回ると判定されたタイミングを、SDホスト106が送信するデータサイズを変更する変更タイミングとして決定する。なお、タイミングの具体的な決定手法については後述する。   In the present embodiment, the determination unit 108 determines the timing determined by the redundant byte number comparison unit 124 as the change timing for changing the data size transmitted by the SD host 106. A specific timing determination method will be described later.

そして、判定部108が、上述した判定を繰り返し行うことで、SDホスト106が送信する転送データサイズの変更を複数回行っても良い。そして、判定部108が、送信する転送データサイズを変更した後、次の転送データサイズを調整するタイミングを決定する前に、SDホスト106が送信する全てのファイルのそれぞれについて、上述した変更前との変更後との冗長データの総和による比較が完了した場合、以降転送データサイズを変更するタイミングは無いものとみなし、タイミングの算出を終了する。   Then, the determination unit 108 may change the transfer data size transmitted by the SD host 106 a plurality of times by repeatedly performing the above-described determination. After the determination unit 108 changes the transfer data size to be transmitted and before determining the timing for adjusting the next transfer data size, for each of all files transmitted by the SD host 106, When the comparison based on the sum of redundant data after the change is completed, it is considered that there is no timing to change the transfer data size thereafter, and the timing calculation is terminated.

データ転送制御部107は、調整部111を備え、SDカード112とASIC102との間のデータ転送を制御する。   The data transfer control unit 107 includes an adjustment unit 111 and controls data transfer between the SD card 112 and the ASIC 102.

本実施の形態にかかるデータ転送制御部107の調整部111は、判定部108の判定結果に従って、転送データサイズの変更を行う際に、データ転送の一時停止や、転送データサイズの変更コマンドの設定、変更後の転送データサイズの設定などを行う。   When the adjustment unit 111 of the data transfer control unit 107 according to the present embodiment changes the transfer data size according to the determination result of the determination unit 108, the adjustment of the transfer data size is suspended or the transfer data size change command is set. Set the transfer data size after change.

調整部111は、判定部108により、SDカード112のセクタ長と同一以上の転送データサイズで送信しない、換言すれば変更コマンドを発行してより小さい転送データサイズで送信すると判定された場合、セクタ長より転送データサイズの小さいファイルを、SDホスト106が送信する際、当該ファイルの転送データサイズに基づいて、SDホスト106が送信する転送データサイズの変更コマンドを発行する。これによりSDホスト106が送信する転送データサイズが調整される。一方、調整部111は、判定部108により冗長データの合計のサイズが、変更コマンドのデータサイズよりも小さいと判定された場合、SDホスト106が送信する際の転送データサイズの調整を行わない。   If the determination unit 108 determines that the determination unit 108 does not transmit with a transfer data size equal to or larger than the sector length of the SD card 112, in other words, issues a change command and transmits with a smaller transfer data size, When the SD host 106 transmits a file having a transfer data size smaller than the length, a transfer data size change command transmitted by the SD host 106 is issued based on the transfer data size of the file. Thereby, the transfer data size transmitted by the SD host 106 is adjusted. On the other hand, the adjustment unit 111 does not adjust the transfer data size when the SD host 106 transmits when the determination unit 108 determines that the total size of the redundant data is smaller than the data size of the change command.

SDホスト106は、SDカード112とASIC102とを接続するインターフェースとしての役割を果たし、SDカード112との間のデータの送受信、及びコマンドの発行を行う。SDカード112に対するデータ送信、コマンド発行は、DMAC105や、CPU101からの要求に従って実施される。そして、SDホスト106が、ファイルの送信を行う場合、PIO転送(Programmed Input/Output)による、SDカード112の1セクタ長と同一サイズの転送データサイズでの送信、複数のセクタ長の合計と同一サイズの転送データサイズの送信、またはDMAC105による複数送信が行われる。このように、本実施の形態にかかるSDホスト106は、SDカード112とデータを送受信する際に、当該SDカード112のセクタ長に基づく転送データサイズでデータの送信を制御する。   The SD host 106 serves as an interface for connecting the SD card 112 and the ASIC 102, and transmits / receives data to / from the SD card 112 and issues commands. Data transmission and command issuance to the SD card 112 are performed in accordance with requests from the DMAC 105 and the CPU 101. When the SD host 106 transmits a file, the PIO transfer (Programmed Input / Output) is performed with a transfer data size that is the same size as one sector length of the SD card 112, and the same as the sum of a plurality of sector lengths. Transmission of the size of the transfer data size or multiple transmissions by the DMAC 105 is performed. As described above, the SD host 106 according to the present embodiment controls data transmission with the transfer data size based on the sector length of the SD card 112 when transmitting and receiving data to and from the SD card 112.

このように、データ転送制御部107の調整部111が、CPU101の代わりに設定を行うことで、ソフトウェアの介在なしに、転送データサイズの変更を行いながら、SDカード112に対するデータ転送が可能となる。   As described above, the adjustment unit 111 of the data transfer control unit 107 performs setting instead of the CPU 101, thereby enabling data transfer to the SD card 112 while changing the transfer data size without software intervention. .

図4は、ASIC102が、SDカード112に対してデータを送信する際の制御フローを示した図である。本制御フローにおいては、SDホスト106が送信する際、SDカード112のセクタ長のサイズである512バイトを、転送データサイズの初期値として設定する。なお、セクタ長の初期値が異なる場合、以下の説明もセクタ長に併せて変更されるものとする。   FIG. 4 is a diagram showing a control flow when the ASIC 102 transmits data to the SD card 112. In this control flow, when the SD host 106 transmits, 512 bytes, which is the sector length size of the SD card 112, is set as the initial value of the transfer data size. When the initial value of the sector length is different, the following description is also changed according to the sector length.

まず、認識部109は、メモリ103に格納されている全転送ファイルの転送データサイズを確認する(ステップS401)。   First, the recognizing unit 109 checks the transfer data size of all transfer files stored in the memory 103 (step S401).

そして、転送データバッファ104が、メモリ103から各ファイルを読み出した後、認識部109で認識された転送データサイズに従って、サイズが大きいものから送信するよう、各ファイルを並び替えて格納する。このようにして、各ファイルの転送順序が設定される(ステップS402)。   Then, after the transfer data buffer 104 reads each file from the memory 103, the files are rearranged and stored so as to be transmitted from the largest data according to the transfer data size recognized by the recognition unit 109. In this way, the transfer order of each file is set (step S402).

そして、判定部108は、1セクタ長以上のデータサイズ(512バイト)のファイルがあるか否かを判定する(ステップS403)。1セクタ長以上のデータサイズのファイルが存在しないと判定した場合(ステップS403:No)には、ステップS406の処理に進む。   Then, the determination unit 108 determines whether there is a file having a data size (512 bytes) of one sector length or more (step S403). If it is determined that there is no file having a data size of one sector length or more (step S403: No), the process proceeds to step S406.

また、判定部108により、1セクタ長以上のデータサイズのファイルが存在すると判定された場合(ステップS403:Yes)、さらに判定部108は、SDカード112に送信する全てのファイルが、1セクタ長以上のデータサイズであるか否かを判定する(ステップS404)。1セクタ長以上のデータサイズであると判定した場合(ステップS404:Yes)、SDホスト106が、DMAC105を介して、転送データバッファ104から読み出したファイルを、SDカード112に対して送信する(ステップS411)。   If the determination unit 108 determines that a file having a data size of one sector length or more exists (step S403: Yes), the determination unit 108 further determines that all files transmitted to the SD card 112 have one sector length. It is determined whether or not the data size is the above (step S404). When it is determined that the data size is one sector length or more (step S404: Yes), the SD host 106 transmits the file read from the transfer data buffer 104 to the SD card 112 via the DMAC 105 (step S404). S411).

その後、SDホスト106が、全てのファイルについて送信完了したか否か判定する(ステップS412)。送信完了していない場合には(ステップS412:No)継続してファイルの送信を行い(ステップS411)、全てのファイルの送信が完了した場合には(ステップS412:Yes)処理を終了する。   Thereafter, the SD host 106 determines whether or not transmission has been completed for all files (step S412). If the transmission is not completed (step S412: No), the file is continuously transmitted (step S411). If the transmission of all the files is completed (step S412: Yes), the process is terminated.

一方、判定部108により、SDカード112に送信する全てのファイルが、1セクタ長以上のデータサイズではない、換言すれば1セクタ長より小さいデータサイズのファイルも含まれていると判定した場合(ステップS404:No)、まず、SDホスト106が、1セクタ長よりデータサイズが大きいファイル全てを、転送データバッファ104から取得して、SDカード112に送信する(ステップS405)。   On the other hand, when the determination unit 108 determines that all the files transmitted to the SD card 112 do not have a data size of one sector length or more, in other words, include files having a data size smaller than one sector length ( First, the SD host 106 acquires all files having a data size larger than one sector length from the transfer data buffer 104 and transmits them to the SD card 112 (step S405).

そして、判定部108により、ファイルを送信する際に転送データサイズを調整するか否かの判定、及び次に転送データサイズを調整するタイミングの特定を行う(ステップS406)。   Then, the determination unit 108 determines whether or not to adjust the transfer data size when transmitting the file, and specifies the timing for adjusting the transfer data size next (step S406).

その後、判定部108は、転送データサイズの調整があるか否かを判定する(ステップS407)。判定部108が転送データサイズの調整があると判定した場合(ステップS407:Yes)、調整部111が、ファイルを送信する転送データサイズを調整する(ステップS408)。設定される転送データサイズは、現段階で未転送のファイルのうち、一番データサイズが大きいファイルのバイト数を設定する。一番データサイズが大きいファイルのバイト数を設定する理由は、ファイルサイズより小さい値を、SDホスト106が1回に送信する転送データサイズに設定すると、1つのファイルを転送するために複数回の転送が必要になり、転送パフォーマンスが低下するからである。   Thereafter, the determination unit 108 determines whether there is an adjustment of the transfer data size (step S407). When the determination unit 108 determines that the transfer data size has been adjusted (step S407: Yes), the adjustment unit 111 adjusts the transfer data size for transmitting the file (step S408). As the transfer data size to be set, the number of bytes of the file having the largest data size among the untransferred files at this stage is set. The reason for setting the number of bytes of the file with the largest data size is that if a value smaller than the file size is set as the transfer data size that the SD host 106 transmits at one time, a plurality of times are used to transfer one file. This is because transfer is required and transfer performance is deteriorated.

そして、SDホスト106が、調整した転送データサイズ単位で、転送データバッファ104から読み出したファイルを送信する(ステップS409)。   Then, the SD host 106 transmits the file read from the transfer data buffer 104 in the adjusted transfer data size unit (step S409).

次に、判定部108が、次の調整タイミングになったか否かを判定する(ステップS410)。調整タイミングではないと判定した場合(ステップS410:No)、SDホスト106が、継続してファイルの送信を行う(ステップS409)。調整タイミングになったと判定した場合(ステップS410:Yes)、判定部108及びデータ転送制御部107により、ファイルを送信する際に転送データサイズを調整するか否かの判定、及び次に転送データサイズを調整するタイミングの特定を行う(ステップS406)。その後、判定部108は、転送データサイズの調整があるか否かを判定する(ステップS407)。   Next, the determination unit 108 determines whether or not the next adjustment timing has come (step S410). If it is determined that it is not the adjustment timing (step S410: No), the SD host 106 continuously transmits the file (step S409). When it is determined that the adjustment timing has come (step S410: Yes), the determination unit 108 and the data transfer control unit 107 determine whether to adjust the transfer data size when transmitting the file, and then transfer data size. The timing for adjusting is specified (step S406). Thereafter, the determination unit 108 determines whether there is an adjustment of the transfer data size (step S407).

もう転送データサイズの調整がないと判定した場合には(ステップS407:No)、ステップS411に遷移し、SDホスト106が現在設定されている転送データサイズでファイルの送信し、すべてのファイルの送信が完了した場合(ステップS412)に全ての処理が終了する。   If it is determined that the transfer data size is no longer adjusted (step S407: No), the process proceeds to step S411, the SD host 106 transmits the file with the currently set transfer data size, and all files are transmitted. When the process is completed (step S412), all the processes are completed.

図5は、図4のステップS406で示した、判定部108により、ファイルを送信する際に転送データサイズを調整するか否かの判定、及び次に転送データサイズを調整するタイミングを特定するための処理フローを示した図である。   FIG. 5 illustrates determination of whether or not to adjust the transfer data size when the file is transmitted by the determination unit 108 shown in step S <b> 406 of FIG. 4, and the next timing for adjusting the transfer data size. It is the figure which showed the processing flow.

まず、判定部108が、現在の転送データサイズでファイルを送信した場合に、これから送信する全てのファイル分の冗長バイト数を算出する(ステップS501)。次に、判定部108が、転送データサイズの変更コマンドのバイト数より、算出した冗長バイト数が大きいか否かを判定する(ステップS502)。転送データサイズの変更コマンドのバイト数のほうが、算出した冗長バイト数より大きいと判定した場合(ステップS502:No)、これから転送データサイズの変更を行うことはないものとして処理を終了する。   First, when the determination unit 108 transmits a file with the current transfer data size, it calculates the number of redundant bytes for all the files to be transmitted (step S501). Next, the determination unit 108 determines whether or not the calculated number of redundant bytes is larger than the number of bytes of the transfer data size change command (step S502). If it is determined that the number of bytes of the transfer data size change command is larger than the calculated number of redundant bytes (step S502: No), the process is terminated assuming that the transfer data size will not be changed.

一方、判定部108が、転送データサイズの変更コマンドのバイト数より、算出した冗長バイト数が大きいと判定した場合(ステップS502:Yes)、転送データサイズの変更コマンドを発行する旨を設定する(ステップS503)。変更コマンドを発行する旨の設定とは、図4のステップS407の転送データサイズを変更するためのフラグをONに設定することを意味している。そして本フラグがONの場合に、ステップS408で転送データサイズの調整が行われる。   On the other hand, when the determination unit 108 determines that the calculated number of redundant bytes is larger than the number of bytes of the transfer data size change command (step S502: Yes), it sets that the transfer data size change command is issued ( Step S503). The setting to issue the change command means that the flag for changing the transfer data size in step S407 in FIG. 4 is set to ON. If this flag is ON, the transfer data size is adjusted in step S408.

そして、判定部108が、変数nに初期値‘0’を設定する(ステップS504)。変数nは、転送データサイズを変更してから、送信するファイルを識別する数とする。例えば、n=0は、転送データサイズを調整した後に最初に転送するファイルを表している。   Then, the determination unit 108 sets an initial value “0” for the variable n (step S504). The variable n is a number for identifying a file to be transmitted after changing the transfer data size. For example, n = 0 represents a file to be transferred first after adjusting the transfer data size.

次に、判定部108は、n番目のファイルで転送データサイズを変更しない場合の冗長バイト数を算出する(ステップS505)。そして、判定部108は、n番目のファイルで転送データサイズを変更しない場合の冗長バイト数の和を、変更前冗長バイト数格納部121に格納する。   Next, the determination unit 108 calculates the number of redundant bytes when the transfer data size is not changed in the nth file (step S505). Then, the determination unit 108 stores the sum of the number of redundant bytes when the transfer data size is not changed in the nth file in the pre-change redundant byte number storage unit 121.

次に、判定部108は、n番目のファイルに対して転送データサイズを変更する場合の冗長バイト数を算出する(ステップS506)。そして、判定部108は、n番目のファイルで転送データサイズを変更した場合の冗長バイト数の和を、変更後冗長バイト数格納部122に格納する。   Next, the determination unit 108 calculates the number of redundant bytes when the transfer data size is changed for the nth file (step S506). Then, the determination unit 108 stores the sum of the redundant byte numbers when the transfer data size is changed in the nth file in the changed redundant byte number storage unit 122.

その後、冗長バイト数比較部124が、n番目のファイルにおいて、転送データサイズを変更しない場合の冗長バイト数の和が、転送データサイズを変更する場合の冗長バイト数の和と変更コマンドのバイト数との合計より大きいか否かを判定する(ステップS507)。   Thereafter, the redundant byte number comparison unit 124 determines that the sum of the redundant byte numbers when the transfer data size is not changed in the nth file is the sum of the redundant byte numbers when the transfer data size is changed and the byte number of the change command. It is determined whether or not the sum is larger than (step S507).

そして、冗長バイト数比較部124が、転送データサイズを変更しない場合の冗長バイト数の和が、転送データサイズを変更する場合の冗長バイト数の和と変更コマンドのバイト数との合計以下と判定した場合(ステップS507:No)、変数nに‘1’加算し(ステップS508)、全てのファイルについて比較したか否かを判定する(ステップS509)。そして、冗長バイト数比較部124が、全てのファイルについて比較が終了していないと判定した場合には(ステップS509:No)、ステップS505に戻って再び処理を進める。また、冗長バイト数比較部124が、全てのファイルについて比較が終了したと判定した場合には(ステップS509:Yes)、転送データサイズを変更しない方が、パフォーマンスが良いものとして処理を終了する。   Then, the redundant byte number comparison unit 124 determines that the sum of the redundant byte numbers when the transfer data size is not changed is equal to or less than the sum of the redundant byte number when the transfer data size is changed and the byte number of the change command. If it is determined (step S507: No), '1' is added to the variable n (step S508), and it is determined whether or not all files have been compared (step S509). If the redundant byte number comparison unit 124 determines that the comparison has not been completed for all files (step S509: No), the process returns to step S505 and proceeds again. If the redundant byte number comparison unit 124 determines that the comparison has been completed for all the files (step S509: Yes), the process is terminated because the performance is better if the transfer data size is not changed.

一方、冗長バイト数比較部124が、転送データサイズを変更しない場合の冗長バイト数の和が、転送データサイズを変更する場合の冗長バイト数の和と変更コマンドのバイト数との合計より大きいと判定した場合(ステップS507:Yes)、転送データサイズが変更されたファイルを‘0’番目として、n+1番目のファイルを送信する時を、転送データサイズの調整タイミングとして設定し、処理を終了する(ステップS510)。   On the other hand, when the redundant byte number comparison unit 124 does not change the transfer data size, the sum of the redundant byte numbers is larger than the sum of the redundant byte number when the transfer data size is changed and the byte number of the change command. When the determination is made (step S507: Yes), the file whose transfer data size has been changed is set as the “0” th, and the time when the n + 1th file is transmitted is set as the transfer data size adjustment timing, and the process ends ( Step S510).

上述した処理手順により、転送データサイズを変更するコマンドの発行と、次に転送データサイズを変更するタイミングと、を設定できる。   By the processing procedure described above, it is possible to set a command for changing the transfer data size and a timing for changing the transfer data size next.

次に、SDカード112にファイルを送信する例について説明する。送信の対象となるファイルは、ファイルA:150バイト、ファイルB:260バイト、ファイルC:380バイト、ファイルD:700バイト、ファイルE:1024バイト、ファイルF:128バイト、ファイルG:32バイト、ファイルH:70バイトとする。なお、転送データサイズの初期値は、SDカードのセクタ長と同一である512バイトとする。そして、転送データサイズの変更コマンドのバイト数も512バイトとする。   Next, an example of transmitting a file to the SD card 112 will be described. The files to be transmitted are: file A: 150 bytes, file B: 260 bytes, file C: 380 bytes, file D: 700 bytes, file E: 1024 bytes, file F: 128 bytes, file G: 32 bytes, File H: 70 bytes. The initial value of the transfer data size is 512 bytes which is the same as the sector length of the SD card. The number of bytes of the transfer data size change command is also 512 bytes.

そして、図4のステップS401において、認識部109が、各ファイルのデータサイズを認識する。そして、ステップS401で転送データバッファ104において、転送順序の入れ替えが行われる。これにより、1番目:ファイルE/1024バイト、2番目:ファイルD/700バイト、3番目:ファイルC/380バイト、4番目:ファイルB/260バイト、5番目:ファイルA/150バイト、6番目:ファイルF/128バイト、7番目:ファイルH/70バイト、8番目:ファイルG/32バイトと並び替えられる。   In step S401 in FIG. 4, the recognition unit 109 recognizes the data size of each file. In step S401, the transfer order is changed in the transfer data buffer 104. As a result, the first: file E / 1024 bytes, the second: file D / 700 bytes, the third: file C / 380 bytes, the fourth: file B / 260 bytes, the fifth: file A / 150 bytes, the sixth : File F / 128 bytes, 7th: File H / 70 bytes, 8th: File G / 32 bytes.

その後、ステップS403の判定で、512バイト以上のファイルがあるために、ステップS404に遷移する。そして、ステップS404の判定では、512バイト以上のファイルと、512バイトより小さいファイルと、が混在しているため、ステップS405に遷移する。そして、ステップS405において、SDホスト106が、ファイルEとファイルDと、を、SDカード112に送信する。その後、ステップS406において、転送テータサイズの変更データサイズの調整の判定を行う。   Thereafter, since there is a file of 512 bytes or more in the determination in step S403, the process proceeds to step S404. Then, in the determination in step S404, since a file of 512 bytes or more and a file smaller than 512 bytes are mixed, the process proceeds to step S405. In step S <b> 405, the SD host 106 transmits the file E and the file D to the SD card 112. Thereafter, in step S406, the transfer data size change data size adjustment determination is performed.

図5のステップS501において、現設定の転送データサイズは、512バイトであるため、未転送ファイルの冗長バイトを算出すると以下のようになる。   In step S501 in FIG. 5, since the currently set transfer data size is 512 bytes, the redundant bytes of the untransferred file are calculated as follows.

つまり、3番目のファイルCは512バイト−380バイト=132バイト、4番目のファイルBは512バイト−260バイト=252バイト、5番目のファイルAは512バイト−150バイト=362バイト、6番目のファイルFは512バイト−128バイト=384バイト、7番目のファイルHは512バイト−70バイト=442バイト、8番目のファイルGは512バイト−32バイト=480バイト、となる。   That is, the third file C has 512 bytes-380 bytes = 132 bytes, the fourth file B has 512 bytes-260 bytes = 252 bytes, the fifth file A has 512 bytes-150 bytes = 362 bytes, the sixth file The file F is 512 bytes-128 bytes = 384 bytes, the seventh file H is 512 bytes-70 bytes = 442 bytes, and the eighth file G is 512 bytes-32 bytes = 480 bytes.

したがって未転送部分の冗長バイト数は2052バイトとなり、転送データサイズの初期値である512バイトより大きいため、ステップS503に遷移する。そして、転送データサイズの変更コマンドの発行が設定される。   Accordingly, the number of redundant bytes in the untransferred portion is 2052 bytes, which is larger than 512 bytes, which is the initial value of the transfer data size, and the process proceeds to step S503. Then, issue of a transfer data size change command is set.

そして、変数nに初期値‘0’が設定された後、判定部108が、ステップS505及びステップS506において、転送データサイズを変更しない場合、及び変更する場合の冗長バイト数を算出する。   Then, after the initial value “0” is set to the variable n, the determination unit 108 calculates the number of redundant bytes when the transfer data size is not changed and when it is changed in Step S505 and Step S506.

変更しない場合の転送データサイズは512バイト、変更する場合の転送データサイズは未転送ファイルの最大値(3番目のファイルC)である380バイトである。このため、それぞれ冗長バイト数を算出し、比較する。   The transfer data size when not changing is 512 bytes, and the transfer data size when changing is 380 bytes, which is the maximum value of the untransferred file (third file C). For this reason, the number of redundant bytes is calculated and compared.

図6は、転送データサイズの変更コマンドの発行を行った場合と行っていない場合とにおける、ファイル1個(ファイルC)を送信した時の冗長バイト数の例を示した図である。図6に示す例では、図5のステップS507の判定で、転送データサイズを変更しない場合の冗長バイト数の方が小さいと判定し、ステップS508に遷移する。そして、変数nに1加算した後、全未転送ファイルの比較は行っていないため、ステップS505に遷移して、再度比較が行われる。   FIG. 6 is a diagram showing an example of the number of redundant bytes when one file (file C) is transmitted when the transfer data size change command is issued and when it is not issued. In the example illustrated in FIG. 6, it is determined in step S507 in FIG. 5 that the number of redundant bytes when the transfer data size is not changed is smaller, and the process proceeds to step S508. Then, after adding 1 to the variable n, since all untransferred files are not compared, the process proceeds to step S505, and the comparison is performed again.

図7は、転送データサイズの変更コマンドの発行を行った場合と行っていない場合とにおける、ファイル2個(ファイルC、ファイルB)を送信した時の冗長バイト数の例を示した図である。図7に示す例では、図5のステップS507の判定で、転送データサイズを変更しない場合の冗長バイト数の方が小さいと判定し、ステップS508に遷移する。そして、変数nに1加算した後、全未転送ファイルの比較は行っていないため、ステップS505に遷移して、再度比較が行われる。以降、これら処理が、変更コマンドの発行を行った場合の冗長バイト数が、発行しない場合より小さくなるまで繰り返される。   FIG. 7 is a diagram showing an example of the number of redundant bytes when two files (file C and file B) are transmitted when a transfer data size change command is issued and when it is not issued. . In the example illustrated in FIG. 7, it is determined in step S507 in FIG. 5 that the number of redundant bytes when the transfer data size is not changed is smaller, and the process proceeds to step S508. Then, after adding 1 to the variable n, since all untransferred files are not compared, the process proceeds to step S505, and the comparison is performed again. Thereafter, these processes are repeated until the number of redundant bytes when the change command is issued becomes smaller than when the change command is not issued.

図8は、転送データサイズの変更コマンドの発行を行った場合と行っていない場合とにおける、ファイル4個(ファイルC、ファイルB、ファイルA、ファイルF)を送信した時の冗長バイト数の例を示した図である。図8に示す例では、図5のステップS507の判定で、転送データサイズを変更しない場合の冗長バイト数の方が大きいと判定し、ステップS510に遷移する。そして、ファイルHの送信時に再度、変更コマンドの調整タイミングの判定を行う。その後、転送データサイズの変更の判定のフローは終了し、図4のステップS407に遷移する。   FIG. 8 shows an example of the number of redundant bytes when four files (file C, file B, file A, and file F) are transmitted when the transfer data size change command is issued and not issued. FIG. In the example shown in FIG. 8, it is determined in step S507 of FIG. 5 that the number of redundant bytes when the transfer data size is not changed is larger, and the process proceeds to step S510. When the file H is transmitted, the change command adjustment timing is determined again. Thereafter, the flow for determining the transfer data size change ends, and the process proceeds to step S407 in FIG.

そして、ステップS503で変更コマンドを発行する旨が設定されているため、判定部108が、転送データサイズの調整有りと判定し(ステップS407:Yes)、ステップS408において、調整部111が、転送データサイズを調整する。転送データサイズは、未転送ファイル中最大サイズの380バイトに設定される。   Since it is set to issue the change command in step S503, the determination unit 108 determines that the transfer data size is adjusted (step S407: Yes). In step S408, the adjustment unit 111 transfers the transfer data. Adjust the size. The transfer data size is set to a maximum size of 380 bytes in the untransferred file.

その後、ステップS409及びステップS410のループ部分で、SDホスト106がファイルFまで送信した後、図5のステップS510で設定された調整タイミングとなるので、ステップS410から、ステップS406に遷移する。   Thereafter, in the loop part of steps S409 and S410, after the SD host 106 transmits up to the file F, the adjustment timing set in step S510 of FIG. 5 is reached, so the process proceeds from step S410 to step S406.

今回も、先ほどと同様に、転送データサイズの変更の判定を行う。現在の転送データサイズの380バイトを基準に、未転送ファイル毎に冗長バイト数を算出すると、7番目のファイルH/380バイト−70バイト=310バイト、8番目のファイルG/380バイト−32バイト=348バイトとなる。これら未転送ファイルの冗長バイト数の合計が658バイトとなり、転送データサイズの変更コマンドのバイト数512バイトより大きいため、変更コマンドを発行する旨の設定が行われる。また、前回と同様に、転送データサイズを変更する場合と変更しない場合との冗長バイト数の比較を行うと、図9に示した表のようになる。図9は、転送データサイズの変更コマンドの発行を行った場合と行っていない場合とにおける、ファイル2個(ファイルH、ファイルG)を送信した時の冗長バイト数の例を示した図である。その後、図5による転送データサイズの調整の判定の処理が終了した後、調整部111が、転送データサイズを、ファイルHのデータサイズである70バイトに変更する。そして、SDホスト106が、ファイルHを転送後、再度転送データサイズの変更の判定を行う。   This time as well, the transfer data size change is determined as before. When the number of redundant bytes is calculated for each untransferred file based on the current transfer data size of 380 bytes, the seventh file H / 380 bytes-70 bytes = 310 bytes, the eighth file G / 380 bytes-32 bytes = 348 bytes. Since the total number of redundant bytes of these untransferred files is 658 bytes and is larger than 512 bytes of the transfer data size change command, a setting is made to issue the change command. Similarly to the previous time, when the number of redundant bytes is compared between when the transfer data size is changed and when it is not changed, the table shown in FIG. 9 is obtained. FIG. 9 is a diagram showing an example of the number of redundant bytes when two files (file H and file G) are transmitted when a transfer data size change command is issued and when it is not issued. . After the transfer data size adjustment determination process in FIG. 5 is completed, the adjustment unit 111 changes the transfer data size to 70 bytes, which is the data size of the file H. Then, after transferring the file H, the SD host 106 again determines whether to change the transfer data size.

未転送ファイルは、以下の通りであるため、現転送データサイズである70バイトを基準に冗長バイト数を算出すると、8番目のファイルGは70バイト−32バイト=38バイトとなる。このため、冗長バイト数の合計38バイトが、変更コマンドのバイト数である512バイトより小さいため、変更コマンドが発行される旨の設定は行われず、図5に示された転送データサイズの変更の判定フローが終了する。   Since the untransferred file is as follows, when the number of redundant bytes is calculated based on the current transfer data size of 70 bytes, the eighth file G becomes 70 bytes−32 bytes = 38 bytes. For this reason, since the total number of redundant bytes is smaller than 512 bytes which is the number of bytes of the change command, the setting that the change command is issued is not performed, and the transfer data size change shown in FIG. The determination flow ends.

この場合、判定部108が、転送データサイズの調整は無いと判定し(ステップS407:No)、ステップS411に遷移し、SDホスト106が、ファイルを送信する処理を全て終了するまで繰り返す。そして、全ファイルの送信が完了した場合に、全ての処理が終了となる。   In this case, the determination unit 108 determines that there is no adjustment of the transfer data size (step S407: No), proceeds to step S411, and repeats until the SD host 106 completes all the processes for transmitting the file. Then, when the transmission of all files is completed, all the processes are finished.

以下、転送データサイズを変更した回数に基づく冗長バイト数について説明する。ただし、512バイト以上のファイル転送の記載は省略する。図10は、転送データサイズを1回も変更しなかった場合の冗長バイト数の合計を示した図である。図10に示す例では、冗長バイト数が2052バイトとなる。   Hereinafter, the number of redundant bytes based on the number of times of changing the transfer data size will be described. However, description of file transfer of 512 bytes or more is omitted. FIG. 10 is a diagram showing the total number of redundant bytes when the transfer data size is not changed even once. In the example shown in FIG. 10, the number of redundant bytes is 2052 bytes.

図11は、転送データサイズを1回だけ変更した場合の冗長バイト数の合計を示した図である。図11に示す例では、冗長バイト数が1772バイトとなる。図12は、転送データサイズを2回変更した場合の冗長バイト数の合計を示した図である。図12に示す例では、冗長バイト数が1664バイトとなる。   FIG. 11 is a diagram showing the total number of redundant bytes when the transfer data size is changed only once. In the example shown in FIG. 11, the number of redundant bytes is 1772 bytes. FIG. 12 is a diagram showing the total number of redundant bytes when the transfer data size is changed twice. In the example shown in FIG. 12, the number of redundant bytes is 1664 bytes.

図10〜図12に示すように、変更コマンドが行われた回数に従って冗長バイト数が減少していることが確認できる。   As shown in FIGS. 10 to 12, it can be confirmed that the number of redundant bytes decreases according to the number of times the change command is performed.

上述した本実施の形態にかかるASIC102は、ソフトウェアによる介在なしで、複数のファイル転送時における転送データサイズと、SDカード112のセクタ長のアンマッチによって発生する転送パフォーマンスの低下を防ぐことができる。   The ASIC 102 according to the present embodiment described above can prevent a decrease in transfer performance caused by an unmatch between the transfer data size and the sector length of the SD card 112 when transferring a plurality of files without intervention by software.

さらに、ASIC102からSDカード112に複数のファイルを送信する時の、転送データサイズによって発生する転送パフォーマンスの低下を防ぐことができる。そして、送信されるファイルのファイルサイズに合わせて転送データサイズを、ハードウェア側で最適な値に設定できるので、不必要なデータ転送が生じることを抑止できる。   Furthermore, it is possible to prevent a decrease in transfer performance caused by the transfer data size when a plurality of files are transmitted from the ASIC 102 to the SD card 112. Since the transfer data size can be set to an optimum value on the hardware side in accordance with the file size of the transmitted file, unnecessary data transfer can be prevented from occurring.

(変形例)
上述した実施の形態では、上述したASIC102を、情報処理装置に搭載した例について説明した。しかしながら、上述したASIC102を情報処理装置に搭載することに制限するものではない。そこで、変形例として、ASIC102を、画像形成装置に搭載しても良い。画像形成装置にASIC102を搭載した場合、SDカード112のセクタ長のデータサイズよりも小さい画像データをSDカード112に複数転送する場合に、ASIC102が、上述した実施の形態と同様の処理を行うこととする。これにより、データサイズが小さい画像データをSDカード112に転送する場合の転送効率を向上させることができる。また、画像データの出力先は、SDカードに制限するものではなく、コンパクトフラッシュ(登録商標)カードや光磁気ディスクなどの他の記憶媒体に対して行っても良い。
(Modification)
In the above-described embodiment, the example in which the above-described ASIC 102 is mounted on the information processing apparatus has been described. However, the above-described ASIC 102 is not limited to being mounted on the information processing apparatus. Therefore, as a modification, the ASIC 102 may be mounted on the image forming apparatus. When the ASIC 102 is mounted on the image forming apparatus, the ASIC 102 performs the same processing as the above-described embodiment when transferring a plurality of image data smaller than the data size of the sector length of the SD card 112 to the SD card 112. And Thereby, it is possible to improve transfer efficiency when image data having a small data size is transferred to the SD card 112. Further, the output destination of the image data is not limited to the SD card, and may be performed on another storage medium such as a compact flash (registered trademark) card or a magneto-optical disk.

なお、変形例では画像形成装置として、コピー機能、プリンタ機能、スキャナ機能およびファクシミリ機能のうち少なくとも2つの機能を有する複合機に適用することが考えられるが、複写機、プリンタ、スキャナ装置、ファクシミリ装置等の画像形成装置であればいずれにも適用することができる。   In the modification, the image forming apparatus can be applied to a multifunction machine having at least two functions of a copy function, a printer function, a scanner function, and a facsimile function. The present invention can be applied to any image forming apparatus.

101 CPU
102 ASIC
103 メモリ
104 転送データバッファ
105 DMAC
106 SDホスト
107 データ転送制御部
108 判定部
109 認識部
111 調整部
112 SDカード
121 変更前冗長バイト数格納部
122 変更後冗長バイト数格納部
123 セクタ長変更バイト数格納部
124 冗長バイト数比較部
101 CPU
102 ASIC
103 Memory 104 Transfer Data Buffer 105 DMAC
106 SD host 107 Data transfer control unit 108 Judgment unit 109 Recognition unit 111 Adjustment unit 112 SD card 121 Redundant byte count storage unit before change 122 Redundant byte count storage unit after change 123 Sector length changed byte count storage unit 124 Redundant byte number comparison unit

特開2003−077219号公報Japanese Patent Laid-Open No. 2003-077719

Claims (9)

記憶媒体とデータを送受信する際に、当該記憶媒体のセクタ長以上のデータサイズ単位でデータの送信を制御する送信手段と、
前記記憶媒体に送信する、複数のファイルのデータサイズを認識する認識手段と、
前記複数のファイルのうち、前記セクタ長よりデータサイズが小さいファイルが含まれていた場合に、前記データサイズ単位で当該小さいファイルを送信する際の冗長データのサイズに基づいて、前記セクタ長以上の前記データサイズ単位で送信するか否かを判定する判定手段と、
前記判定手段により送信しないと判定された場合、前記セクタ長より小さいファイルを前記送信手段が送信する際、当該ファイルのデータサイズに基づいて、前記送信手段が送信するデータサイズ単位を調整する調整手段と、
を備え
前記判定手段は、さらに、前記セクタ長より小さい複数のファイルの冗長データの合計のデータサイズが、前記送信手段が送信する前記データサイズ単位を変更する変更命令のデータサイズと比べて大きい場合に、前記セクタ長以上の前記データサイズ単位で送信しないと判定し、
前記調整手段は、前記判定手段により送信しないと判定された場合、前記変更命令で、前記送信手段が一回に送信するデータサイズ単位を調整すること、
を特徴とするデータ処理装置。
A transmission unit that controls transmission of data in units of data size equal to or greater than the sector length of the storage medium when transmitting and receiving data to and from the storage medium;
Recognition means for recognizing the data sizes of a plurality of files to be transmitted to the storage medium;
When a file having a data size smaller than the sector length is included among the plurality of files, the file size is equal to or larger than the sector length based on the size of redundant data when the small file is transmitted in the data size unit. Determining means for determining whether to transmit in units of the data size;
An adjustment unit that adjusts a data size unit transmitted by the transmission unit based on a data size of the file when the transmission unit transmits a file smaller than the sector length when the determination unit determines not to transmit the file. When,
Equipped with a,
The determination unit is further configured such that the total data size of redundant data of a plurality of files smaller than the sector length is larger than the data size of the change instruction for changing the data size unit transmitted by the transmission unit. It is determined not to transmit in the data size unit greater than the sector length,
The adjustment means adjusts the data size unit that the transmission means transmits at a time with the change command when it is determined that the determination means does not transmit;
A data processing apparatus.
前記記憶媒体に送信する前記複数のファイルに対して、前記認識手段で認識されたデータサイズが大きい順から送信するよう送信順序を設定する順序設定手段を、さらに備え、
前記送信手段は、さらに、前記送信順序で前記小さいファイル以降に送信されるファイルについても、前記調整手段で調整された前記データサイズ以下のデータサイズ単位で送信すること、
を特徴とする請求項に記載のデータ処理装置。
Order setting means for setting the transmission order so that the plurality of files to be transmitted to the storage medium are transmitted in descending order of the data size recognized by the recognition means;
The transmission means further transmits a file transmitted after the small file in the transmission order in a data size unit equal to or less than the data size adjusted by the adjustment means,
The data processing apparatus according to claim 1 .
前記判定手段で前記セクタ長以上の前記データサイズ単位で送信しないと判定された場合、
前記判定手段は、さらに前記データサイズ単位を調整せずに複数のファイルを送信し続けることによる冗長データの総和が、前記データサイズ単位を調整して複数のファイルを送信し続けることによる冗長データの総和と前記データサイズ単位を変更する変更命令のデータサイズとの総和を上回るか否かを判定し、
前記調整手段は、前記判定手段で上回ると判定されたタイミングで前記送信手段が送信する前記データサイズ単位を調整すること、
を特徴とする請求項に記載のデータ処理装置。
If it is determined by the determination means that transmission is not performed in units of the data size equal to or greater than the sector length,
The determining means further sum of redundant data by continuing to send multiple files without adjusting the data size unit, the redundant data due to adjust the data size unit continues to send multiple files Determine whether the sum exceeds the sum of the data size of the change instruction to change the data size unit ,
The adjusting unit adjusts the data size unit transmitted by the transmitting unit at a timing determined by the determining unit to exceed,
The data processing apparatus according to claim 2 .
前記判定手段は、前記複数のファイルのうち、前記セクタ長よりデータサイズが小さいファイルが複数含まれていた場合に、当該複数の小さいファイルについて、ファイルサイズの大きいものから順に判定していくこと、
を特徴とする請求項又はに記載のデータ処理装置。
The determination means, when a plurality of files having a data size smaller than the sector length is included among the plurality of files, for the plurality of small files, determining in order from the largest file size,
The data processing apparatus according to claim 2 or 3, characterized in.
前記判定手段が、次に前記データサイズ単位を調整するタイミングを決定する前に、前記送信手段が送信する全てのファイルのそれぞれについて前記冗長データの比較が完了した場合、前記タイミングを算出しないで、処理を進めることを特徴とする請求項に記載のデータ処理装置。 If the comparison of the redundant data is completed for each of all the files transmitted by the transmission unit before the determination unit determines the next timing to adjust the data size unit, without calculating the timing, The data processing apparatus according to claim 4 , wherein the processing proceeds. 前記調整手段は、前記判定手段により前記冗長データの合計のサイズが、前記変更命令のデータサイズよりも小さいと判定された場合、前記送信手段が送信する際のデータサイズ単位を調整しないこと、
を特徴とする請求項1乃至のいずれか1つに記載のデータ処理装置。
The adjusting means does not adjust the data size unit when the transmitting means transmits when the determining means determines that the total size of the redundant data is smaller than the data size of the change instruction;
The data processing apparatus according to any one of claims 1 to 5, characterized in.
前記判定手段は、前記冗長データのサイズを、前記セクタ長から前記小さいファイルのデータサイズを減算して求めること、を特徴とする請求項1乃至のいずれか1つに記載のデータ処理装置。 The determining means, the data processing device according to the size of the redundant data, that obtained by subtracting the data size of the small files from the sector length, any one of claims 1 to 6, wherein. 前記送信手段がファイルの送信を行う場合、PIO転送(Programmed Input/Output)による1セクタ長のデータサイズ単位の送信、複数セクタ長のデータサイズ単位の送信、またはDMACによる複数転送を行うことを特徴とする、請求項1乃至のいずれか1つに記載のデータ処理装置。 When the transmission means transmits a file, it performs transmission in a data size unit of one sector length by PIO transfer (Programmed Input / Output), transmission in a data size unit of a plurality of sector lengths, or multiple transfer by DMAC. The data processing apparatus according to any one of claims 1 to 7 . データ処理装置で実行されるデータ処理方法であって、
送信手段が、記憶媒体とデータを送受信する際に、当該記憶媒体のセクタ長以上のデータサイズ単位でデータの送信を制御する送信ステップと、
認識手段が、前記記憶媒体に送信する、複数のファイルのデータサイズを認識する認識ステップと、
判定手段が、前記複数のファイルのうち、前記セクタ長よりデータサイズが小さいファイルが含まれていた場合に、前記データサイズ単位で当該小さいファイルを送信する際の冗長データのサイズに基づいて、前記セクタ長以上の前記データサイズ単位で送信するか否かを判定する第1判定ステップと、
調整手段が、前記判定ステップにより送信しないと判定された場合、前記セクタ長より小さいファイルを前記送信ステップが送信する際、当該ファイルのデータサイズに基づいて、前記送信ステップが送信するデータサイズ単位を調整する第1調整ステップと、
を含み、
前記判定手段が、さらに、前記セクタ長より小さい複数のファイルの冗長データの合計のデータサイズが、前記送信手段が送信する前記データサイズ単位を変更する変更命令のデータサイズと比べて大きい場合に、前記セクタ長以上の前記データサイズ単位で送信しないと判定する第2判定ステップと、
前記調整手段が、前記第1判定ステップにより送信しないと判定された場合、前記変更命令で、前記送信手段が一回に送信するデータサイズ単位を調整する第2調整ステップと、
を含むことを特徴とするデータ処理方法。
A data processing method executed by a data processing device,
A transmission step for controlling transmission of data in units of data size greater than or equal to the sector length of the storage medium when the transmission means transmits and receives data to and from the storage medium;
A recognition step for recognizing data sizes of a plurality of files transmitted to the storage medium by a recognition unit;
When the determination unit includes a file having a data size smaller than the sector length among the plurality of files, based on the size of redundant data when transmitting the small file in units of the data size, A first determination step for determining whether to transmit in units of the data size equal to or greater than the sector length;
When it is determined that the adjustment unit does not transmit in the determination step, when the transmission step transmits a file smaller than the sector length, the data size unit transmitted by the transmission step is determined based on the data size of the file. A first adjustment step to adjust;
Only including,
In the case where the determination means further has a larger data size of the redundant data of the plurality of files smaller than the sector length compared to the data size of the change instruction for changing the data size unit transmitted by the transmission means, A second determination step of determining not to transmit in units of the data size equal to or greater than the sector length;
A second adjustment step of adjusting a data size unit transmitted by the transmission unit at a time with the change command when the adjustment unit determines that the transmission is not performed in the first determination step;
A data processing method comprising:
JP2011008077A 2011-01-18 2011-01-18 Data processing apparatus and data processing method Expired - Fee Related JP5664264B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011008077A JP5664264B2 (en) 2011-01-18 2011-01-18 Data processing apparatus and data processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011008077A JP5664264B2 (en) 2011-01-18 2011-01-18 Data processing apparatus and data processing method

Publications (2)

Publication Number Publication Date
JP2012150611A JP2012150611A (en) 2012-08-09
JP5664264B2 true JP5664264B2 (en) 2015-02-04

Family

ID=46792803

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011008077A Expired - Fee Related JP5664264B2 (en) 2011-01-18 2011-01-18 Data processing apparatus and data processing method

Country Status (1)

Country Link
JP (1) JP5664264B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201616227D0 (en) * 2016-09-23 2016-11-09 Blancco Oy Ltd Data erasure method and apparatus

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001051803A (en) * 1999-08-17 2001-02-23 Sony Corp Block data transfer mechanism
JP2001282467A (en) * 2000-03-30 2001-10-12 Matsushita Electric Ind Co Ltd Method for reading/writing data from/in sd card certification area and data communication device
EP1526701A1 (en) * 2003-10-22 2005-04-27 Mitsubishi Denki Kabushiki Kaisha Methods and devices for transferring and for recovering data packets
JP4743444B2 (en) * 2008-04-01 2011-08-10 日本電気株式会社 Data transfer method
JP2012010182A (en) * 2010-06-25 2012-01-12 Sony Corp Information processing apparatus and information processing method

Also Published As

Publication number Publication date
JP2012150611A (en) 2012-08-09

Similar Documents

Publication Publication Date Title
EP2365444B1 (en) Dma engine capable of concurrent data manipulation
JP4356765B2 (en) Information processing apparatus and method, and program
US8924606B2 (en) Storage system and data transfer control method
US7895373B2 (en) Electronic device for data access management
CN1881169A (en) Storage system and control method
KR20160049200A (en) Method for operating data storage device, mobile computing device having the same, and method of the mobile computing device
JPWO2010010686A1 (en) COMMUNICATION SYSTEM, COMMUNICATION DEVICE, AND COMMUNICATION METHOD
JP5482230B2 (en) COMMUNICATION DEVICE, INFORMATION PROCESSING DEVICE, COMMUNICATION DEVICE CONTROL METHOD, AND CONTROL PROGRAM
US20060236001A1 (en) Direct memory access controller
JP2015007843A (en) Storage system, storage device, and storage system control method
JP5664264B2 (en) Data processing apparatus and data processing method
KR102334473B1 (en) Adaptive Deep Learning Accelerator and Method thereof
US7596639B2 (en) Skip mask table automated context generation
JP2009070012A (en) Information processor, information processing method, and data transfer unit
JP7179489B2 (en) Storage system and its control method, program, and storage control system
US20150281361A1 (en) Wireless access device and wireless access system
KR20040066311A (en) Apparatus and method for data transmission in dma
JP2008017175A (en) Data processing device
JP6222724B2 (en) USB device, USB system, data transfer method, and program
JP4567373B2 (en) Data transfer device and communication data processing system
EP2372526A2 (en) Data dividing method and data dividing device
JP2019106063A (en) Dma transfer device, method for controlling dma transfer device, and communication device
US20120254538A1 (en) Storage apparatus and computer program product
US20020010815A1 (en) Data transfer method and data recording apparatus
JP5587029B2 (en) Image processing apparatus and image processing apparatus control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20131202

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140731

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140805

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140929

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20141111

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141124

R151 Written notification of patent or utility model registration

Ref document number: 5664264

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees