JP4859658B2 - Block data partial update device, block data partial update method, and block data partial update program - Google Patents
Block data partial update device, block data partial update method, and block data partial update program Download PDFInfo
- Publication number
- JP4859658B2 JP4859658B2 JP2006347230A JP2006347230A JP4859658B2 JP 4859658 B2 JP4859658 B2 JP 4859658B2 JP 2006347230 A JP2006347230 A JP 2006347230A JP 2006347230 A JP2006347230 A JP 2006347230A JP 4859658 B2 JP4859658 B2 JP 4859658B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- updated
- update
- check code
- crc
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
本発明は、ブロックデータの部分更新技術に関し、特に、ブロックデータを部分更新する際のチェックコードを生成するブロックデータの部分更新装置、ブロックデータの部分更新方法、およびブロックデータの部分更新プログラムに関する。 The present invention relates to a block data partial update technique, and more particularly to a block data partial update apparatus, a block data partial update method, and a block data partial update program that generate a check code for partial update of block data.
RAID装置は、LBA単位(512バイト(byte))のブロックデータで、ユーザデータを管理し、HDD(Hard Disk Drive)にRead(読み込み)/Write(書き込み)を行っている。
図12は、RAID装置が管理するユーザデータのフォーマット例を示す図である。RAID装置内部では、ユーザデータの信頼性を高めるために、図12(A)に示すように、512バイトのユーザデータに8バイトのBCC(Block Check Code)を付加しており、該BCCに基づいて、装置内部やHDD内部でのデータ化けが容易に検出できるようになっている。
上記8バイトのBCCは、6バイトのBID(Block ID)と、2バイトのブロックチェックコードであるCRCとから構成される。BIDは、ブロックを一意に識別する識別子である。
The RAID device manages user data in block data in units of LBA (512 bytes (bytes)), and performs read (read) / write (write) to an HDD (Hard Disk Drive).
FIG. 12 is a diagram illustrating a format example of user data managed by the RAID device. In the RAID device, in order to improve the reliability of the user data, as shown in FIG. 12A, an 8-byte BCC (Block Check Code) is added to the 512-byte user data. Thus, garbled data inside the apparatus or HDD can be easily detected.
The 8-byte BCC is composed of a 6-byte BID (Block ID) and a CRC that is a 2-byte block check code. BID is an identifier that uniquely identifies a block.
Mainframe系のシステムの場合は、可変長なCKDフォーマットで構成されているため、図12(B)、図12(C)に示すように、512バイトのLBAの中にCount,Key,Dataの3つの可変長フィールドを64バイトの境界で敷き詰めている。このため、Cout,Key,Dataの一部のフィールド(Field)を更新する場合、更新したLBAのBCC(BID+CRC)を更新する必要がある。
MainFrame系のデータを更新する場合、データの信頼性を持たせるため、更新対象となる元データだけでなく、更新ブロックデータ(更新データ)についてもCRCを付加している。更新データの形式の例を以下に示す。
Since the mainframe system is configured in a variable-length CKD format, as shown in FIGS. 12 (B) and 12 (C), 3 bytes of Count, Key, and Data are included in the 512-byte LBA. Two variable length fields are spread on a 64-byte boundary. For this reason, when updating some fields (Field) of Cout, Key, and Data, it is necessary to update the BCC (BID + CRC) of the updated LBA.
When updating MainFrame data, CRC is added not only to the original data to be updated but also to the updated block data (update data) in order to provide data reliability. An example of the update data format is shown below.
1.ブロックデータ全体を更新対象とする更新データの形式
512バイトのブロックデータ全体を更新対象とする場合、BCCも含めたLBA単位で更新データを書き込むことによって、データ更新を行う。
2.ブロックデータを部分更新する場合の更新データの形式
(1)更新データが右詰めされた形式
更新データが右詰めされた形式とは、図13(A)に示すように、更新データを右詰めして、非更新部分を0詰めしたフォーマットである。元データを更新する場合には、更新対象となる元データ上に、更新データを所定の位置まで左シフトして書き込む。この時、元データのBCC(BID+CRC)を更新する必要がある。
(2)更新データがデータ更新位置(元データに対する書き込み位置)に書き込まれた形式
更新データがデータ更新位置に書き込まれた形式とは、図13(B)に示すように、更新データがデータ更新位置に書き込まれ、非更新部分を0詰めしたフォーマットである。元データを更新する場合には、元データ上に該データ更新位置にある更新データをそのまま書き込む。この時、元データのBCC(BID+CRC)を更新する必要がある。
1. Update Data Format for Updating Block Data Entirely When updating the entire 512-byte block data to be updated, data is updated by writing update data in units of LBA including BCC.
2. Update data format for partial update of block data (1) Update data right-justified format Update data right-justified format means that update data is right-justified as shown in FIG. Thus, the non-updated part is padded with zeros. In the case of updating the original data, the update data is written by shifting left to a predetermined position on the original data to be updated. At this time, it is necessary to update the BCC (BID + CRC) of the original data.
(2) Format in which update data is written at data update position (write position with respect to original data) The format in which update data is written at the data update position is as shown in FIG. The format is written at the location and padded with non-updated parts. When the original data is updated, the update data at the data update position is directly written on the original data. At this time, it is necessary to update the BCC (BID + CRC) of the original data.
従来、図14に示すような部分データ更新回路によってブロックデータを部分更新していた。図14に示す部分データ更新回路は、ユーザデータを格納するキャッシュメモリ21と、キャッシュメモリ21に対するデータの読込み/書き込みを媒介するキャッシュメモリインタフェース22と、キャッシュメモリ21から元データと更新データとを読み込むRead DMA23と、元データおよび更新データのBCCのチェックを行うBCCチェッカー24と、元データの上に更新データを書き込んで更新済みデータに更新し、該更新済みデータを更新用データバッファ26に格納するバッファコントローラ25と、更新済みデータが格納される更新用データバッファ26と、更新用データバッファ26に格納された更新済みデータのBCCを生成して該更新済みデータに付加するBCC演算部27と、BCCが付加された更新済みデータをキャッシュメモリに書き込むWrite DMA28とを備える。
図14に示す部分データ更新回路は、例えば以下の[1]〜[8]までの手順に従ってブロックデータの部分更新処理を行う。なお、Mainframe系のシステムに対応するユーザデータのフォーマットに従うと、64バイト単位でデータ更新がされるため、この例では、更新ブロック位置を指定しやすいように、図15に示すように、各々が64バイトのBLK0〜BLK7までの8個のサブブロック(Sub−block)でユーザデータを表記する。
Conventionally, block data is partially updated by a partial data update circuit as shown in FIG. The partial data update circuit shown in FIG. 14 reads a
The partial data update circuit shown in FIG. 14 performs partial update processing of block data according to the following procedures [1] to [8], for example. According to the format of user data corresponding to the mainframe system, data is updated in units of 64 bytes. Therefore, in this example, as shown in FIG. User data is represented by 8 sub-blocks (Sub-block) from BLK0 to BLK7 of 64 bytes.
例えば、更新対象となる元データのBLK4,3,2を更新データで更新する場合、図14に示す部分データ更新回路は、以下の手順で該更新処理を行う。
[1]Read DMA23が、キャッシュメモリ21に格納されている元データを520バイト(512バイトのユーザデータ+8バイトのBCC)読み込む。
[2]BCCチェッカー24が、読み込まれたユーザデータのCRCおよびBIDのチェックを行ない、正当であれば、該ユーザデータのBCCを削除する。
[3]バッファコントローラ25が、更新用データバッファ26内に用意された空のユーザデータのBLK7,6,5,1,0に、元データのBLK7,6,5,1,0のデータを格納する。
[4]Read DMA23が、キャッシュメモリ21に格納されている更新データを520バイト(512バイトのユーザデータ+8バイトのBCC)読み込む。
[5]BCCチェッカー24が、上記手順[4]で読み込まれたユーザデータのCRCおよびBIDのチェックを行ない、正当であれば、該ユーザデータのBCCを削除する。
[6]バッファコントローラ25が、更新データを更新データバッファ26に格納する。該手順[6]においては、更新データが右詰めされた形式か、更新データがデータ更新位置に書き込まれた形式かによって、更新データの格納処理が異なる。
図15中に示すBLK2,1,0のデータが更新データである場合のように、更新データが右詰めされた形式のとき、バッファコントローラ25は、更新用データバッファ26に用意され、上記手順[3]においてBLK7,6,5,1,0に元データが格納されたユーザデータのBLK4,3,2に更新データ(BLK2,1,0のデータ)を格納する。
図15中に示すBLK4,3,2が更新データである場合のように、更新データがデータ更新位置に書き込まれた形式であるとき、バッファコントローラ25は、更新用データバッファ26に用意され、上記手順[3]においてBLK7,6,5,1,0に元データが格納されたユーザデータのBLK4,3,2に更新データ(BLK4,3,2のデータ)を格納する。
For example, when updating the original data BLK4, 3, 2 to be updated with the update data, the partial data update circuit shown in FIG. 14 performs the update process according to the following procedure.
[1] The Read
[2] The
[3] The
[4] The Read
[5] The
[6] The
When the update data is in the right-justified format as in the case where the data of BLK2, 1, 0 shown in FIG. 15 is update data, the
When the update data is written in the data update position as in the case where the
[7]BCC演算部27が、更新用データバッファ26に格納されたユーザデータ(更新済みデータ)に基づいてBCC(CRC+BID)を生成し、生成されたBCCを更新済みデータに付加する。
[8]Write DMA28が、上記手順[7]においてBCCが付加された更新済みデータをキャッシュメモリ21に書き込む。
なお、従来のデータ更新に関する具体的技術として、下記の特許文献1に、書き込みデータ中の更新データからチェックコードを生成し、生成されたチェックコードと書き込みデータ中のチェックコードとの比較結果に基づいて、書き込みデータをディスク部に書き込むディスクアレイ装置に関して記載されている。
[8] The Write
In addition, as a specific technique related to conventional data update, Japanese Patent Application Laid-Open No. 2004-228561 generates a check code from update data in write data and based on a comparison result between the generated check code and the check code in the write data. The disk array device for writing write data to the disk unit is described.
上述した図14に示す従来の部分データ更新回路では、BCCチェッカー24によって元データおよび更新データのBCCを削除し、該BCCが削除された元データを更新データで更新した上で、更新済みデータについてのBCCをBCC演算部27によって生成する。すなわち、従来の部分データ更新回路では、データの更新回路とBCCの演算回路とが分離されていない。
従って、BCCチェッカー24によってユーザデータのBCCが削除されてからBCC演算部27によって更新済みデータについてのBCCが生成されるまでの間の処理(元データの更新用データバッファ26への格納処理および更新データの元データ上への書き込み処理)におけるデータ化けを検出することが困難である。
該データ化けを検出するために、例えばBCCチェッカー24とバッファコントローラ25との間のデータパス、バッファコントローラ25と更新用データバッファ26との間のデータパスにパリティ(Parity)を付加することが考えられる。しかし、更新用データバッファ26のアドレス化け等により、更新用データバッファ26に対して誤ったデータが書き込まれた場合、BCC演算部27は、誤ったデータに対して正当なBCCを付加してしまい、RAID装置の信頼性が低下しまう恐れがある。
In the conventional partial data update circuit shown in FIG. 14 described above, the
Accordingly, the process from when the BCC of the user data is deleted by the
In order to detect the garbled data, for example, a parity may be added to the data path between the
本発明は上記問題点を解決するためになされたものであって、誤った更新済みデータに正しいBCCを付加することを防止するブロックデータの部分更新装置、ブロックデータの部分更新方法、およびブロックデータの部分更新プログラムの提供を目的とする。 The present invention has been made to solve the above-described problem, and is a block data partial update device, a block data partial update method, and block data, which prevent adding correct BCC to erroneous updated data. The purpose is to provide a partial update program.
上記課題を解決するため、本発明においては、データの更新回路とBCCの演算回路とが分離されたブロックデータの部分更新装置を設ける。 In order to solve the above-described problems, the present invention provides a block data partial update device in which a data update circuit and a BCC arithmetic circuit are separated.
すなわち、本発明は、次のようにして前記課題を解決する。
(1)チェックコードで保護されたブロックデータの部分更新装置を設ける。上記ブロックデータの部分更新装置が、チェックコードを生成するチェックコード生成手段と、更新対象となる元データD1の更新される部分のブロックデータBD1上に更新ブロックデータBD2を書き込んで、更新済みデータD2に更新し、該更新済みデータD2に上記チェックコード生成手段で生成されたチェックコードを付加するデータ更新手段とを備える。 また、上記チェックコード生成手段は、更新対象となる元データD1とそのチェックコードBCC1を格納した領域から、更新される部分のブロックデータBD1と、更新対象となる元データD1のチェックコードBCC1を読み取る手段と、上記更新される部分のブロックデータBD1のチェックコードBCCD1を生成する手段と、上記更新対象となる元データD1を更新する更新ブロックデータBD2と、そのチェックコードBCCD2を読み込む手段と、上記更新ブロックデータBD2のチェックコードBCCD2と、上記元データD1のチェックコードBCC1と、更新される部分のブロックデータBD1のチェックコードBCCD1とから、更新済みデータD2のチェックコードBCC2を生成する手段とを備える。
(2)上記更新済みデータD2のチェックコードBCC2を生成する手段が、上記元データD1のチェックコードBCC1と、更新される部分のブロックデータBD1のチェックコードBCCD1と、更新ブロックデータBD2が上記元データD1に対する書き込み位置にあるか否かに応じて決まる更新ブロックデータBD2のチェックコードBCCD2とに基づいて、上記更新済みデータD2のチェックコードBCC2を生成する。
(3)チェックコードで保護されたブロックデータの部分更新方法を実行する。上記ブロックデータの部分更新方法が、更新対象となる元データD1とそのチェックコードBCC1を格納した領域から、更新される部分のブロックデータBD1と、更新対象となる元データD1のチェックコードBCC1を読み取るステップと、上記更新される部分のブロックデータBD1のチェックコードBCCD1を生成するステップと、上記更新対象となる元データD1を更新する更新ブロックデータBD2と、そのチェックコードBCCD2を読み込むステップと、上記更新ブロックデータBD2のチェックコードBCCD2と、上記元データD1のチェックコードBCC1と、更新される部分のブロックデータBD1のチェックコードBCCD1とから、更新済みデータD2のチェックコードBCC2を生成するステップと、上記元データD1の更新される部分のブロックデータBD1上に上記更新ブロックデータBD2を書き込んで、更新済みデータD2に更新し、該更新済みデータD2に上記チェックコードBCC2を付加するステップとからなる。
(4)上記更新済みデータD2のチェックコードBCC2を生成するステップが、上記元データD1のチェックコードBCC1と、更新される部分のブロックデータBD1のチェックコードBCCD1と、更新ブロックデータBD2が上記元データD1に対する書き込み位置にあるか否かに応じて決まる更新ブロックデータBD2のチェックコードBCCD2とに基づいて、上記更新済みデータD2のチェックコードBCC2を生成する。
(5)チェックコードで保護されたブロックデータの部分更新プログラムを設ける。上記ブロックデータの部分更新プログラムが、コンピュータに、更新対象となる元データD1とそのチェックコードBCC1を格納した領域から、更新される部分のブロックデータBD1と、更新対象となる元データD1のチェックコードBCC1を読み取る処理と、上記更新される部分のブロックデータBD1のチェックコードBCCD1を生成する処理と、上記更新対象となる元データD1を更新する更新ブロックデータBD2と、そのチェックコードBCCD2を読み込む処理と、上記更新ブロックデータBD2のチェックコードBCCD2と、上記元データD1のチェックコードBCC1と、更新される部分のブロックデータBD1のチェックコードBCCD1とから、更新済みデータD2のチェックコードBCC2を生成する処理と、上記元データD1の更新される部分のブロックデータBD1上に上記更新ブロックデータBD2を書き込んで、更新済みデータD2に更新し、該更新済みデータD2に上記チェックコードBCC2を付加する処理とを実行させる。
(6)上記更新済みデータD2のチェックコードBCC2を生成する処理が、上記元データD1のチェックコードBCC1と、更新される部分のブロックデータBD1のチェックコードBCCD1と、更新ブロックデータBD2が上記元データD1に対する書き込み位置にあるか否かに応じて決まる更新ブロックデータBD2のチェックコードBCCD2とに基づいて、上記更新済みデータD2のチェックコードBCC2を生成する。
That is, this invention solves the said subject as follows.
(1) A partial update device for block data protected by a check code is provided. The block data partial updating apparatus writes check block generation means BD2 on the block data BD1 of the updated part of the original data D1 to be updated, and the updated data D2 And data updating means for adding the check code generated by the check code generating means to the updated data D2. The check code generation means reads the block data BD1 to be updated and the check code BCC1 of the original data D1 to be updated from the area in which the original data D1 to be updated and the check code BCC1 are stored. Means for generating a check code BCCD1 of the block data BD1 to be updated, updating block data BD2 for updating the original data D1 to be updated, means for reading the check code BCCD2, and the updating Means for generating a check code BCC2 for updated data D2 from the check code BCC2 for block data BD2, the check code BCC1 for the original data D1, and the check code BCCD1 for the block data BD1 to be updated.
(2) The means for generating the check code BCC2 of the updated data D2 includes the check code BCC1 of the original data D1, the check code BCCD1 of the updated block data BD1, and the updated block data BD2 as the original data. The check code BCC2 of the updated data D2 is generated based on the check code BCCD2 of the updated block data BD2 that is determined depending on whether or not it is at the write position for D1.
(3) A partial update method for block data protected by a check code is executed. The partial update method of the block data reads the block data BD1 of the updated portion and the check code BCC1 of the original data D1 to be updated from the area storing the original data D1 to be updated and its check code BCC1. A step of generating a check code BCCD1 of the block data BD1 to be updated, an update block data BD2 for updating the original data D1 to be updated, a step of reading the check code BCCD2, and the update Generating a check code BCC2 of updated data D2 from the check code BCC2 of block data BD2, the check code BCC1 of the original data D1, and the check code BCCD1 of the block data BD1 to be updated; It writes the updated block data BD2 on the block data BD1 of the portion to be updated in the original data D1, and updates the updated data D2, comprising a step of adding the check code BCC2 to the updated data D2.
(4) The step of generating the check code BCC2 of the updated data D2 includes the check code BCC1 of the original data D1, the check code BCCD1 of the updated block data BD1, and the updated block data BD2 The check code BCC2 of the updated data D2 is generated based on the check code BCCD2 of the updated block data BD2 that is determined depending on whether or not it is at the write position for D1.
(5) A partial update program for block data protected by a check code is provided. The block data partial update program stores the original data D1 to be updated and the check code BCC1 in the computer from the area where the block data BD1 to be updated and the check code for the original data D1 to be updated are stored. A process of reading BCC1, a process of generating a check code BCCD1 of the block data BD1 to be updated, an update block data BD2 of updating the original data D1 to be updated, and a process of reading the check code BCCD2 The process of generating the check code BCC2 of the updated data D2 from the check code BCCD2 of the updated block data BD2, the check code BCC1 of the original data D1, and the check code BCCD1 of the block data BD1 to be updated The update block data BD2 is written on the updated block data BD1 of the original data D1, updated to the updated data D2, and the check code BCC2 is added to the updated data D2. Let
(6) The process of generating the check code BCC2 of the updated data D2 is performed by the check code BCC1 of the original data D1, the check code BCCD1 of the updated block data BD1, and the updated block data BD2 The check code BCC2 of the updated data D2 is generated based on the check code BCCD2 of the updated block data BD2 that is determined depending on whether or not it is at the write position for D1.
本発明のブロックデータの部分更新装置においては、更新済みデータのチェックコードを演算する回路と、データの更新回路とが分離されている。従って、本発明によれば、誤った更新済みデータに正しいBCCを付加することを防止することが可能となる。
また、本発明によれば、元データに誤った更新データを上書きしてしまっても、本発明によって生成された正しい更新済みデータのチェックコードに基づいて、該更新済みデータが誤ったデータであることを検出することができる。
また、本発明によれば、正しい更新済みデータに誤ったチェックコードが付加された場合であっても、該チェックコードの正当性のチェックを通じて、正しい更新済みデータに誤ったチェックコードが付加されたことを検出することができる。
In the block data partial update device of the present invention, the circuit for calculating the check code of the updated data and the data update circuit are separated. Therefore, according to the present invention, it is possible to prevent the correct BCC from being added to erroneous updated data.
In addition, according to the present invention, even if erroneous update data is overwritten on the original data, the updated data is incorrect data based on the check code of the correct updated data generated by the present invention. Can be detected.
Further, according to the present invention, even when an incorrect check code is added to correct updated data, an incorrect check code is added to correct updated data through checking the validity of the check code. Can be detected.
図1は、本発明のブロックデータの部分更新装置の構成の一例を示す図である。ブロックデータの部分更新装置1は、ブロックデータを部分更新する処理装置である。ブロックデータの部分更新とは、ブロックデータの一部を更新することをいう。例えば、ブロックデータの部分更新装置1は、ホストコンピュータ(図示を省略)からのブロックデータの部分更新要求を受けて、該ブロックデータの部分更新を行う。
ブロックデータの部分更新装置1は、キャッシュメモリ11、キャッシュメモリインタフェース12、Read DMA13、BIDチェッカー14、元データCRC格納部15、更新部分CRC演算部16、更新データCRC格納部17、BCC演算部18、Write DMA19、CRCチェッカー20、更新データパス30を備える。
FIG. 1 is a diagram showing an example of a configuration of a block data partial updating apparatus according to the present invention. The block data
The block data
図1の点線で囲った部分に示すように、BIDチェッカー14、元データCRC格納部15、更新部分CRC演算部16、更新データCRC格納部17、BCC演算部18が、BCCの演算回路を構成し、Read DMA13、更新データパス30、Write DMA19が、データの更新回路を構成する。
キャッシュメモリ11にはユーザデータが格納される。キャッシュメモリインタフェース12は、キャッシュメモリ11に対するデータの読込み/書き込みを媒介する。Read DMA13は、キャッシュメモリ11から元データと更新データとを読み込む。また、Read DMA13は、読み込んだ更新データを更新データパス30を通じてWrite DMA19に送信する。
BIDチェッカー14は、元データおよび更新データのBCC内部のBIDの正当性のチェックを行う。
1, the
User data is stored in the cache memory 11. The cache memory interface 12 mediates data reading / writing to the cache memory 11. The Read DMA 13 reads original data and update data from the cache memory 11. The Read DMA 13 transmits the read update data to the
The
元データCRC格納部15には、元データのCRC(元データCRC)が格納される。更新元部分CRC演算部16は、元データのうち更新される部分のブロックデータに基づいて、更新元部分CRCを演算して生成する。更新元部分CRCとは、元データのうち更新される部分のブロックデータのCRCである。更新データCRC17には、更新データのCRC(更新データCRC)が格納される。
BCC演算部18は、元データCRC格納部15に格納された元データCRCと、更新元部分CRC演算部16によって生成された更新元部分CRCと、更新データCRC格納部17に格納された更新データCRCとに基づいて、更新済みデータのCRC(更新済みデータCRC)を演算して生成する。更新済みデータとは、元データの更新される部分が更新データによって上書きされた結果得られるデータである。また、BCC演算部18は、生成されたCRCにBIDを付加して更新済みデータのBCCを生成する。
The original data
The
Write DMA19は、Read DMA13から受信した更新データとBCC演算部18によって生成された更新済みデータのBCCとをキャッシュメモリ11に格納されている元データに上書きする。
CRCチェッカー20は、キャッシュメモリ11に格納されているユーザデータのCRCの正当性をチェックする。本発明の一実施例によれば、ブロックデータの部分更新装置1が、ブロックデータの部分更新の結果をホストコンピュータ(図示を省略)に返す際に用いるインタフェースカード(図示を省略)に、ユーザデータのCRCの正当性をチェックする機能を備えたチップを備えるようにしてもよい。
なお、上述したブロックデータの部分更新装置1及びその各部の機能は、CPUとその上で実行されるプログラムにより実現される。本発明を実現するプログラムは、コンピュータが読み取り可能な記録媒体、例えば半導体メモリ、ハードディスク、CD−ROM、DVD等に格納することができ、これらの記録媒体に記録して提供され、又は、通信インタフェースを介してネットワークを利用した送受信により提供される。
The
The
Note that the functions of the block data
図2は、本発明のブロックデータの部分更新処理フローの一例を示す図である。この例では、ユーザデータを、前述した図15に示すようなBLK0〜BLK7までの8個のサブブロックで表記する。また、図2に示す処理フローでは、元データのBLK4,3,2を、データ更新位置(BLK4,3,2)に書き込まれた形式の更新データで更新する処理を例にとって説明する。 FIG. 2 is a diagram showing an example of a partial update processing flow of block data according to the present invention. In this example, user data is represented by eight sub-blocks from BLK0 to BLK7 as shown in FIG. The processing flow shown in FIG. 2 will be described by taking as an example processing for updating the original data BLK4, 3, 2 with the update data in the format written in the data update positions (BLK4, 3, 2).
まず、Read DMA13が、キャッシュメモリ11から、元データのBLK4、3、2とBCCとを読み込む(ステップS1)。次に、BIDチェッカー14が、ステップS1において読み込まれたBCCの内部のBIDの正当性をチェックする(ステップS2)。
更新元部分CRC演算部16が、ステップS1において読み込まれた元データのBLK4,3,2のデータに基づいて、更新元部分CRCを生成する(ステップS3)。Read DMA13が、ステップS1において読み込まれたBCCの内部のCRCを元データCRCとして元データCRC格納部15に格納する(ステップS4)。
First, the Read DMA 13 reads the original data BLK4, 3, 2 and BCC from the cache memory 11 (step S1). Next, the
The update source partial
次に、Read DMA13が、キャッシュメモリ11から更新データのBLK4,3,2とBCCとを読み込み、更新データのBLK4,3,2をWrite DMA19に送信する(ステップS5)。そして、BIDチェッカー14が、上記ステップS5において読み込まれたBCCの内部のBIDの正当性をチェックする(ステップS6)。また、Read DMA13が、上記ステップS5において読み込まれたBCCの内部のCRCを更新データCRCとして更新データCRC格納部17に格納する(ステップS7)。 BCC演算部18が、元データCRC格納部15に格納された元データCRCと、更新元部分CRC演算部16によって生成された更新元部分CRCと、更新データCRC格納部17に格納された更新データCRCとに基づいて、更新済みデータCRCを演算して生成し、生成された更新済みデータCRCにBIDを付加して、更新済みデータのBCCを生成する(ステップS8)。
そして、Write DMA19が、Read DMA13から送信された更新データのBLK4,3,2をキャッシュメモリ11に格納されている元データのBLK4,3,2に上書きするとともに、該更新データの上書き後の更新済みデータに上記ステップS8において生成された更新済みデータのBCCを付加して(ステップS9)、処理を終了する。
Next, the Read DMA 13 reads the update data BLK4, 3, 2 and the BCC from the cache memory 11, and transmits the update data BLK4, 3, 2 to the Write DMA 19 (step S5). Then, the
Then, the
図3は、本発明のブロックデータの部分更新処理フローの他の例を示す図である。図2に示す処理フローでは、図15に示すフォーマットを有する元データのBLK4,3,2を、右詰めされた形式の更新データ(BLK2,1,0の更新データ)で更新する処理を例にとって説明する。
まず、Read DMA13が、キャッシュメモリ11から、元データのBLK4,3,2とBCCとを読み込む(ステップS11)。次に、BIDチェッカー14が、ステップS1において読み込まれたBCCの内部のBIDの正当性をチェックする(ステップS12)。
FIG. 3 is a diagram showing another example of the block data partial update processing flow of the present invention. In the processing flow shown in FIG. 2, the process of updating the original data BLK4, 3, 2 having the format shown in FIG. 15 with update data in the right-justified format (update data of BLK2, 1, 0) is taken as an example. explain.
First, the Read DMA 13 reads the
更新元部分CRC演算部16が、ステップS11において読み込まれた元データのBLK4,3,2のデータに基づいて、更新元部分CRCを生成する(ステップS13)。Read DMA13が、ステップS11において読み込まれたBCCの内部のCRCを元データCRCとして元データCRC格納部15に格納する(ステップS14)。
次に、Read DMA13が、キャッシュメモリ11から更新データのBLK2,1,0とBCCとを読み込み、更新データのBLK2,1,0をWrite DMA19に送信する(ステップS15)。そして、BIDチェッカー24が、上記ステップS15において読み込まれたBCCの内部のBIDの正当性をチェックする(ステップS16)。また、Read DMA13が、上記ステップS15において読み込まれたBCCの内部のCRCを更新データCRCとして更新データCRC格納部17に格納する(ステップS17)。
The update source partial
Next, the Read DMA 13 reads the update data BLK2, 1, 0 and the BCC from the cache memory 11, and transmits the update data BLK2, 1, 0 to the write DMA 19 (step S15). Then, the
BCC演算部18が、元データCRC格納部15に格納された元データCRCと、更新元部分CRC演算部16によって生成された更新元部分CRCと、更新データCRC格納部17に格納された更新データCRCとに基づいて、更新済みデータCRCを演算して生成し、生成された更新済みデータCRCにBIDを付加して、更新済みデータのBCCを生成する(ステップS18)。
そして、Write DMA19が、Read DMA13から送信された更新データのBLK2,1,0をキャッシュメモリ11に格納されている元データのBLK4,3,2に上書きするとともに、該更新データの上書き後の更新済みデータに上記ステップS18において生成された更新済みデータのBCCを付加して(ステップS19)、処理を終了する。
The
Then, the
前述した図1に示す本発明のブロックデータの部分更新装置1では、データの更新回路と、BCCの計算回路とが分離されている。従って、図1に示す本発明のブロックデータの部分更新装置1が、上記図2または図3に示す処理フローに従ってブロックデータの部分更新処理を行うことにより、データ信頼性に対して以下のような効果がある。
(1)Write DMA19がキャッシュメモリ11に対して誤った更新データを書き込んでしまうような場合でも、誤った更新済みデータにはBCC演算部18によって生成された正しい更新済みデータのBCCが付加されている。従って、例えばCRCチェッカー20が、誤った更新済みデータについてのCRCチェックを行うことによって、CRCエラーとなり、該更新済みデータが誤ったデータであることを検出することができる。(2)BCC演算部18が誤ったBCCを生成し、Write DMA19がキャッシュメモリ11に対して正しい更新データと上記誤ったBCCとを書き込んだ場合、更新済みデータについてのCRCチェックの結果、CRCエラーとなるため、該更新済みデータに誤ったBCCが付加されたことを検出することができる。
(3)ブロックデータの部分更新装置が、データの部分更新を行うには、元データのBCCと、更新データのBCCと、更新部分のブロックデータを読込み/書き込みすればよい。従って、キャッシュメモリ11とデータ更新回路との間のデータ転送量を少なくすることができる。
(4)前述した図14に示す従来の部分データ更新回路において必要であった更新用データバッファ26が不要となる。
In the block data
(1) Even when the
(3) The partial update device for block data may read / write the BCC of the original data, the BCC of the update data, and the block data of the update portion in order to perform partial update of the data. Therefore, the amount of data transferred between the cache memory 11 and the data update circuit can be reduced.
(4) The
(実施例)
以下に、本発明の実施例について説明する。図4は、本発明の実施例に係るブロックデータの部分更新装置の構成の一例を示す図である。ブロックデータの部分更新装置3は、キャッシュメモリ11、キャッシュメモリインタフェース12、Read DMA13、BIDチェッカー14、元データCRC格納部15、更新部分CRC演算部16、更新データCRC格納部17、BCC演算部18、Write DMA19、更新データパス30を備える。図4に示すブロックデータの部分更新装置3が備える構成要素のうち、図1に示すブロックデータの部分更新装置1が備える構成要素と同符号のものは、該ブロックデータの部分更新装置1が備える構成要素と同様の機能を有するので、ここでの詳細な説明は省略する。
(Example)
Examples of the present invention will be described below. FIG. 4 is a diagram illustrating an example of the configuration of the block data partial updating apparatus according to the embodiment of the present invention. The block data
更新元部分CRC演算部16は、元データのうち更新される部分のデータと、更新位置パラメータ格納部182に格納された更新位置パラメータ(F(m))とに基づいて、後述する式(10)に従って、更新元部分CRC(以下、「CRCpart」と記述)を算出する。算出されたCRCpartは、更新元部分CRC演算部16内のCRCpartレジスタ(図示を省略)に格納される。上記更新位置パラメータ(F(m))は、上記更新される部分の先頭のブロック位置(更新開始ブロック位置)であるmに対応するパラメータである。更新位置パラメータ(F(m))を示す式については、後述する。
The update source partial
BCC演算部18は、Seedパラメータ格納部181、更新位置パラメータ格納部182、加算回路183、186、マスク回路184、乗算回路185、BID付加部187を備える。Seedパラメータ格納部181には、Seedパラメータ(SEED)が予め格納されている。SEEDとは、後述するSeed値で決まる定数である。SEEDを示す式については後述する。更新位置パラメータ格納部182には、更新位置パラメータ(F(m))が予め格納されている。
加算回路183は、更新データCRC格納部17に格納されている更新データCRC(以下、「CRCmod 」と記述)と、Seedパラメータ格納部181に格納されているSeedパラメータとを加算(XOR演算)する。
The
The adder circuit 183 adds the update data CRC (hereinafter referred to as “CRC mod ”) stored in the update data
マスク回路184は、更新位置パラメータ格納部182から更新位置パラメータを読み出して出力する。更新データが右詰めされた形式である場合、マスク回路184は、更新位置パラメータ格納部182から読み出した更新位置パラメータをそのまま出力する。更新データがデータ更新位置に書き込まれた形式である場合、マスク回路184は、値「1」を出力する。
乗算回路185は、後述するCRC生成多項式G(X)を原始多項式とした乗算回路である。乗算回路185は、加算回路183による加算結果とマスク回路184の出力とを乗算する。
加算回路186は、乗算回路185による乗算結果と更新元部分CRC演算部16によって演算された更新元部分CRCと元データCRC格納部15に格納されている元データCRC(以下、「CRCpre 」と記述)とを加算(XOR演算)して、更新済みデータCRC(以下、「CRCpost」と記述)を生成する。BID付加部187は、CRCpostに更新済みデータに対するBIDを付加する。
The mask circuit 184 reads the update position parameter from the update position parameter storage unit 182 and outputs it. When the update data is in a format right-justified, the mask circuit 184 outputs the update position parameter read from the update position parameter storage unit 182 as it is. When the update data is written in the data update position, the mask circuit 184 outputs the value “1”.
The multiplication circuit 185 is a multiplication circuit in which a CRC generation polynomial G (X) described later is a primitive polynomial. The multiplication circuit 185 multiplies the addition result by the addition circuit 183 and the output of the mask circuit 184.
The addition circuit 186 includes the multiplication result obtained by the multiplication circuit 185, the update source partial CRC calculated by the update source partial
本発明の実施例における、CRCpostの生成処理の例について、以下に説明する。この例では、ユーザデータは、前述した図15に示すような、各々が64バイトのBLK0〜BLK7までの8個のサブブロックで表記されるものとする。また、ブロックデータの部分更新装置3は、図5(A)に示す元データの更新される部分のデータであるP2 を、図5(B)または図5(C)に示す更新データであるQ2 で更新するものとする。図5(A)において、P2 は、更新される部分であるBLKmからBLKn−1までのサブブロックに格納されている。また、P1 およびP3 は、元データにおける更新されない部分のデータである。
なお、図5(B)中のQ2 は、右詰めされた形式の更新データを示し、図5(C)中のQ2 は、データ更新位置に書き込まれた形式の更新データを示している。
An example of CRC post generation processing in the embodiment of the present invention will be described below. In this example, it is assumed that the user data is represented by 8 sub-blocks of BLK0 to BLK7 each having 64 bytes as shown in FIG. Further, the block data
Note that Q 2 in FIG. 5B indicates update data in a right-justified format, and Q 2 in FIG. 5C indicates update data in a format written at a data update position. .
以下、ブロックデータの部分更新装置3が処理する各データを多項式表記で表示する。本発明の実施例においては、以下のように定義される、ANSI T10のCRC演算の生成多項式G(X)を用いる。
G(X)=X16+X15+X11+X9 +X8 +X7 +X5 +X4 +X2 +X1 +1
ここで、一般に、CRCを生成する回路のSeed値(初期値)として、以下の式(1)のように表記されるS(X)を定義する。
Hereinafter, each piece of data processed by the block data
G (X) = X 16 + X 15 + X 11 + X 9 + X 8 + X 7 + X 5 + X 4 + X 2 + X 1 +1
Here, generally, S (X) expressed as the following expression (1) is defined as a seed value (initial value) of a circuit that generates a CRC.
ユーザデータP(X)を、上記式(2)と表記すると、CRCを生成する回路によって生成されるCRCは、以下の(3)式のように表現することができる。
CRC=(S(X)×X4096+P(X)×X16)modG(X)・・・式(3)
When the user data P (X) is expressed as the above equation (2), the CRC generated by the circuit that generates the CRC can be expressed as the following equation (3).
CRC = (S (X) × X 4096 + P (X) × X 16 ) mod G (X) (3)
図6は、上記式(3)に従うCRCの算出処理を説明する図である。一般に、CRCを生成する回路は、図6(A)に示すユーザデータP(X)に16ビット(2バイト)の空の領域を付加するとともに、S(X)を512バイトのデータの先頭にシフトする。そして、CRCを生成する回路は、図6(B)に示すように、P(X)に16ビットの空の領域が付加されたデータとS(X)が512バイトの先頭にシフトされたデータとを加算して、図6(C)に示すような、S(X)とP(X)とが512バイトの領域に格納され、該512バイトの領域に16ビットの空の領域が付加されたデータを生成する。そして、CRCを生成する回路は、図6(D)に示すように、図6(C)に示すデータをG(X)で割って、その余りをCRCとして算出する。算出されたCRCは、図6(E)に示すように、P(X)に付加されていた16ビットの空の領域に格納される。 FIG. 6 is a diagram illustrating CRC calculation processing according to the above equation (3). In general, the CRC generation circuit adds an empty area of 16 bits (2 bytes) to the user data P (X) shown in FIG. 6A, and sets S (X) at the beginning of the 512-byte data. shift. Then, as shown in FIG. 6 (B), the CRC generation circuit has data in which an empty area of 16 bits is added to P (X) and data in which S (X) is shifted to the beginning of 512 bytes. 6 (C), S (X) and P (X) are stored in a 512-byte area, and a 16-bit empty area is added to the 512-byte area. Generated data. Then, as shown in FIG. 6D, the circuit that generates the CRC divides the data shown in FIG. 6C by G (X) and calculates the remainder as CRC. The calculated CRC is stored in a 16-bit empty area added to P (X) as shown in FIG. 6 (E).
本発明の実施例において、前述した図5(A)に示す元データのP1 ,P2 ,P3 と、図5(B)または図5(C)に示す更新データQ2 をそれぞれP1 (X),P2 (X),P3 (X),Q2 (X)と関数表現すると、元データCRC格納部15に格納される元データCRC(CRCpre )は、以下の式(4)のように表現される。
In an embodiment of the present invention, FIG. 5 and P 1, P 2, P 3 of the original data (A), the 5 (B) or FIG update data Q 2 to which is shown in (C), respectively P 1 described above When expressed as functions (X), P 2 (X), P 3 (X), and Q 2 (X), the original data CRC (CRC pre ) stored in the original data
図7は、上記式(4)に従うCRCpre の算出処理を説明する図である。まず、図7(A)に示すような、元データのうち更新される部分のデータP2 、更新されない部分のデータP1 、P3 からなるユーザデータに16ビット(2バイト)の空の領域を付加するとともに、S(X)を512バイトのデータの先頭にシフトする。そして、図7(B)に示すように、ユーザデータに16ビットの空の領域が付加されたデータとS(X)が512バイトの先頭にシフトされたデータとを加算して、図7(C)に示すような、S(X)とP1 、P2 、P3 とが512バイトの領域に格納され、該512バイトの領域に16ビットの空の領域が付加されたデータを生成する。そして、図7(D)に示すように、図7(C)に示すデータをG(X)で割って、その余りをCRCpre として算出する。
また、更新データは、図5(B)または図5(C)に示すQ2 であることから、式(4)中のP2 (X)をQ2 (X)で置き換えることによって、更新済みデータCRC(CRCpost)は、以下の式(5)のように表現される。
FIG. 7 is a diagram for explaining CRC pre calculation processing according to the above equation (4). First, as shown in FIG. 7A, a 16-bit (2-byte) empty area is added to the user data composed of the updated data P 2 and the non-updated data P 1 and P 3 of the original data. Is added, and S (X) is shifted to the beginning of the 512-byte data. Then, as shown in FIG. 7B, the data in which the 16-bit empty area is added to the user data and the data in which S (X) is shifted to the head of 512 bytes are added, and FIG. As shown in C), S (X) and P 1 , P 2 , and P 3 are stored in a 512-byte area, and data in which a 16-bit empty area is added to the 512-byte area is generated. . Then, as shown in FIG. 7D, the data shown in FIG. 7C is divided by G (X), and the remainder is calculated as CRC pre .
Since the update data is Q 2 shown in FIG. 5B or FIG. 5C, it has been updated by replacing P 2 (X) in formula (4) with Q 2 (X). The data CRC (CRC post ) is expressed as the following equation (5).
次に、更新データCRC格納部17に格納されている更新データCRC(CRCmod )について説明する。CRCmod を表現する式は、更新データが右詰めされた形式であるか、更新データがデータ更新位置に書き込まれた形式であるかによって異なる。
図5(B)に示すように、更新データQ2 が右詰めされた形式である場合、CRCmod は、以下のように表現される。
CRCmod =(S(X)×X4096+Q2 (X)×X16)modG(X)・・・式(6)
Next, the update data CRC (CRC mod ) stored in the update data
As shown in FIG. 5 (B), when the update data Q 2 is a right-justified format, CRC mod is expressed as follows.
CRC mod = (S (X) × X 4096 + Q 2 (X) × X 16 ) mod G (X) (6)
図8は、上記式(6)に従うCRCmod の算出処理を説明する図である。まず、図8(A)に示す更新データQ2 に16ビット(2バイト)の空の領域を付加するとともに、S(X)を512バイトのデータの先頭にシフトする。そして、図8(B)に示すように、Q2 に16ビットの空の領域が付加されたデータとS(X)が512バイトの先頭にシフトされたデータとを加算して、図8(C)に示すような、S(X)とQ2 とが512バイトの領域に格納され、該512バイトの領域に16ビットの空の領域が付加されたデータを生成する。そして、図8(D)に示すように、図8(C)に示すデータをG(X)で割って、その余りをCRCmod として算出する。
上記式(4)と式(6)とを用いて、式(5)に示すCRCpostを以下の式(8)に書き換えることができる。下記の式(8)において、+、−はXOR演算を示している。
ここで、前述したSeedパラメータ(SEED)は、以下の式で定義される。
SEED=(S(X)×X4096)modG(X) …式(7)
また、前述した更新位置パラメータF(m)は、以下の式(9)で定義される。
FIG. 8 is a diagram for explaining CRC mod calculation processing according to the above equation (6). First, the addition of an empty area in FIG. 8 update data Q 2 to 16 bits shown in (A) (2 bytes), is shifted to the head of data of 512 bytes S (X). Then, as shown in FIG. 8B, the data in which a 16-bit empty area is added to Q 2 and the data in which S (X) is shifted to the head of 512 bytes are added, and FIG. As shown in C), S (X) and Q 2 are stored in a 512-byte area, and data in which a 16-bit empty area is added to the 512-byte area is generated. Then, as shown in FIG. 8D, the data shown in FIG. 8C is divided by G (X), and the remainder is calculated as CRC mod .
Using the above formula (4) and formula (6), the CRC post shown in formula (5) can be rewritten into the following formula (8). In the following formula (8), + and-indicate XOR operations.
Here, the aforementioned seed parameter (SEED) is defined by the following equation.
SEED = (S (X) × X 4096 ) mod G (X) (7)
Further, the update position parameter F (m) described above is defined by the following equation (9).
本発明の実施例においては、ユーザデータが、BLK0〜BLK7までの8個のサブブロックで表記されることから、更新開始ブロック位置mは、0〜7までの値をとり、F(m)は、該更新開始ブロック位置mに対応するパラメータとなる。
また、更新元部分CRC演算部16が算出するCRCpartは、以下のように表現することができる。
CRCpart=(P2 (X)×X16×F(m))modG(X)・・・式(10)
式(10)は、前述した式(3)においてSeed値=0として、P2 (X)についてCRC生成の演算を行い、F(m)で乗算することによってCRCpartが算出されることを示している。
In the embodiment of the present invention, since the user data is represented by 8 sub-blocks from BLK0 to BLK7, the update start block position m takes a value from 0 to 7, and F (m) is , A parameter corresponding to the update start block position m.
Further, the CRC part calculated by the update source part
CRC part = (P 2 (X) × X 16 × F (m)) mod G (X) (10)
Equation (10) indicates that CRC part is calculated by performing CRC generation calculation for P 2 (X) and multiplying by F (m) with the seed value = 0 in the above-described equation (3). ing.
従って、前述した式(8)で表現されるCRCpostは、式(9)で定義されるF(m)と、式(10)に示されるCRCpartと、式(7)で定義されるSEEDとを用いて、以下の式(11)に書き換えることができる。
CRCpost=CRCpre +CRCpart+((CRCmod +SEED)×F(m))modG(X)・・・式(11)
図5(C)に示すように、更新データQ2 がデータ更新位置に書き込まれた形式である場合、CRCmod は、以下のように表現される。
Therefore, the CRC post expressed by the above-described equation (8) is F (m) defined by the equation (9), the CRC part expressed by the equation (10), and the SEED defined by the equation (7). And can be rewritten into the following formula (11).
CRC post = CRC pre + CRC part + ((CRC mod + SEED) × F (m)) mod G (X) (11)
As shown in FIG. 5 (C), the update data Q 2 may be in a format written in the data update position, CRC mod is expressed as follows.
図9は、上記式(12)に従うCRCmod の算出処理を説明する図である。まず、図9(A)に示す、データ更新位置(BLKm〜BLKn−1)にある更新データQ2 に16ビット(2バイト)の空の領域を付加するとともに、S(X)を512バイトのデータの先頭にシフトする。そして、図9(B)に示すように、Q2 に16ビットの空の領域が付加されたデータとS(X)が512バイトの先頭にシフトされたデータとを加算して、図9(C)に示すような、S(X)とQ2 とが512バイトの領域に格納され、該512バイトの領域に16ビットの空の領域が付加されたデータを生成する。そして、図9(D)に示すように、図9(C)に示すデータをG(X)で割って、その余りをCRCmod として算出する。
前述した式(4)、式(7)、式(9)、式(10)、式(12)を用いて、式(5)に示すCRCpostを以下の式(13)に書き換えることができる。
FIG. 9 is a diagram for explaining CRC mod calculation processing according to the above equation (12). First, in FIG. 9 (A), with the addition of an empty area of the data update position (BLKm~BLKn-1) in the update data Q 2 to 16 bits (2 bytes), S of 512 bytes (X) Shift to the beginning of the data. Then, as shown in FIG. 9B, the data in which a 16-bit empty area is added to Q 2 and the data in which S (X) is shifted to the head of 512 bytes are added, and FIG. As shown in C), S (X) and Q 2 are stored in a 512-byte area, and data in which a 16-bit empty area is added to the 512-byte area is generated. Then, as shown in FIG. 9D, the data shown in FIG. 9C is divided by G (X), and the remainder is calculated as CRC mod .
The CRC post shown in the equation (5) can be rewritten into the following equation (13) by using the above-described equations (4), (7), (9), (10), and (12). .
上記式(13)は、式(11)の右辺の第3項におけるF(m)をF(0)=1としたときの計算と同値である。従って、式(11)で示される、更新データQ2 が右詰めされた形式である場合のCRCpostと、式(13)で示される、更新データQ2 がデータ更新位置に書き込まれた形式である場合のCRCpostは、マスク回路184の出力する値を「1」とすれば、一つのBCCの演算回路で算出することができる。 The above equation (13) is equivalent to the calculation when F (m) in the third term on the right side of equation (11) is F (0) = 1. Therefore, the formula (11), and CRC post when the update data Q 2 is a right-justified format, represented by the formula (13), the update data Q 2 is written into the data update position format The CRC post in a certain case can be calculated by one BCC arithmetic circuit if the value output from the mask circuit 184 is “1”.
図10は、更新データが右詰めされた形式である場合の、ブロックデータの部分更新処理フローの例を示す図である。図10に示す処理フローでは、図15に示すようなフォーマットを有する元データのBLK4,3,2を、BLK2,1,0に書き込まれた形式の更新データで更新する処理を例にとって説明する。
まず、Read DMA13が、キャッシュメモリ11から、元データのBLK4,3,2とBCCとを読み込む(ステップS21)。次に、BIDチェッカー14が、ステップS21において読み込まれたBCCの内部のBIDの正当性をチェックする(ステップS22)。
更新元部分CRC演算部16が、ステップS21において読み込まれた元データのBLK4,3,2のデータに基づいて、CRCpartを算出し、算出したCRCpartをCRCpartレジスタに格納する(ステップS23)。ステップS23において、更新元部分CRC演算部16は、前述した式(3)に従って、Seed値=0としてBLK4,3,2のデータについてCRC生成の演算を行い、更新位置パラメータF(2)で乗算する演算を行う。より具体的には、更新元部分CRC演算部16は、P2 (X)をBLK4,3,2のデータの関数表現、F(m)をF(2)として、式(10)に従ってCRCpartを算出する。
FIG. 10 is a diagram illustrating an example of a partial update processing flow of block data in a case where the update data has a right-padded format. The processing flow shown in FIG. 10 will be described by taking as an example processing for updating BLK4, 3, 2 of the original data having the format shown in FIG. 15 with the update data in the format written in BLK2, 1, 0.
First, the Read DMA 13 reads the original data BLK4, 3, 2 and BCC from the cache memory 11 (step S21). Next, the
The update source part
次に、Read DMA13が、ステップS21において読み込まれたBCCの内部のCRCをCRCpre として元データCRC格納部15に格納する(ステップS24)。 次に、Read DMA13が、キャッシュメモリ11から更新データのBLK2,1,0とBCCとを読み込み、更新データのBLK2,1,0をWrite DMA19に送信する(ステップS25)。そして、BIDチェッカー14が、上記ステップS25において読み込まれたBCCの内部のBIDの正当性をチェックする(ステップS26)。また、Read DMA13が、上記ステップS25において読み込まれたBCCの内部のCRCをCRCmod として更新データCRC格納部17に格納する(ステップS27)。 BCC演算部18が、更新データCRC格納部17に格納されたCRCmod にSEEDを加算(XOR)した後、マスク回路184から出力される更新位置パラメータF(2)を乗算する(ステップS28)。
Next, the Read DMA 13 stores the CRC in the BCC read in step S21 in the original data
BCC演算部18が、ステップS28における乗算結果と、ステップS23においてCRCpartレジスタに格納されたCRCpartと、ステップS24において元データCRC格納部15に格納されたCRCpre とを加算して、CRCpostを算出する(ステップS29)。すなわち、BCC演算部18は、前述した式(11)に従って、CRCpostを算出する。
BCC演算部18のBID付加部187が、ステップS29において算出されたCRCpostにBIDを付加して、更新済みデータのBCCを生成する(ステップS30)。Write DMA19が、Read DMA13から送信された更新データのBLK2,1,0をキャッシュメモリ11に格納されている元データのBLK4,3,2に上書きするとともに、更新済みデータに上記ステップS30において生成された更新済みデータのBCCを付加して(ステップS31)、処理を終了する。
The BID adding unit 187 of the
図11は、更新データがデータ更新位置に書き込まれた形式である場合の、ブロックデータの部分更新処理フローの例を示す図である。図11に示す処理フローでは、元データのBLK4,3,2を、データ更新位置(BLK4,3,2)に書き込まれた形式の更新データで更新する処理を例にとって説明する。 FIG. 11 is a diagram illustrating an example of a partial update processing flow of block data when the update data is written in the data update position. The processing flow shown in FIG. 11 will be described by taking as an example a process of updating the original data BLK4, 3, 2 with the update data in the format written in the data update position (BLK4, 3, 2).
まず、Read DMA13が、キャッシュメモリ11から、元データのBLK4,3,2とBCCとを読み込む(ステップS41)。次に、BIDチェッカー14が、ステップS41において読み込まれたBCCの内部のBIDの正当性をチェックする(ステップS42)。
更新元部分CRC演算部16が、ステップS41において読み込まれた元データのBLK4,3,2のデータに基づいて、CRCpartを算出し、算出したCRCpartをCRCpart レジスタに格納する(ステップS43)。ステップS43において、更新元部分CRC演算部16は、前述した式(3)に従って、Seed値=0としてBLK4,3,2のデータについてCRC生成の演算を行い、更新位置パラメータF(2)で乗算する演算を行う。より具体的には、更新元部分CRC演算部16は、P2 (X)をBLK4,3,2のデータの関数表現、F(m)をF(2)として、式(10)に従ってCRCpartを算出する。
First, the Read DMA 13 reads the
The update source part
Read DMA13が、ステップS41において読み込まれたBCCの内部のCRCをCRCpre として元データCRC格納部15に格納する(ステップS44)。そして、Read DMA13が、キャッシュメモリ11から更新データのBLK4,3,2とBCCとを読み込み、更新データのBLK4,3,2をWrite DMA19に送信する(ステップS45)。そして、BIDチェッカー14が、上記ステップS45において読み込まれたBCCの内部のBIDの正当性をチェックする(ステップS46)。また、Read DMA13が、上記ステップS45において読み込まれたBCCの内部のCRCをCRCmod として更新データCRC格納部17に格納する(ステップS47)。
The Read DMA 13 stores the CRC in the BCC read in step S41 in the original data
BCC演算部18が、更新データCRC格納部17に格納されたCRCmod にSEEDを加算(XOR)した後、マスク回路184から出力される値「1」を乗算する(ステップS48)。
BCC演算部18が、ステップS48における乗算結果と、ステップS43においてCRCpartレジスタに格納されたCRCpartと、ステップS44において元データCRC格納部15に格納されたCRCpre とを加算して、CRCpostを算出する(ステップS49)。すなわち、BCC演算部18は、前述した式(13)に従って、CRCpostを算出する。
BCC演算部18のBID付加部187が、ステップS49において算出されたCRCpostにBIDを付加して、更新済みデータのBCCを生成する(ステップS50)。Write DMA19が、Read DMA13から送信された更新データのBLK4,3,2をキャッシュメモリ11に格納されている元データのBLK4,3,2に上書きするとともに、更新済みデータに上記ステップS50において生成された更新済みデータのBCCを付加して(ステップS51)、処理を終了する。
The
The BID adding unit 187 of the
以上、説明したように、本発明によれば、誤った更新済みデータに正しいBCCを付加することを防止することが可能となる。
また、本発明によれば、元データに誤った更新データを上書きしてしまっても、本発明によって生成された正しい更新済みデータのチェックコードに基づいて、該更新済みデータが誤ったデータであることを検出することができる。
また、本発明によれば、正しい更新済みデータに誤ったチェックコードが付加された場合であっても、該チェックコードの正当性のチェックを通じて、更新済みデータに誤ったチェックコードが付加されたことを検出することができる。
As described above, according to the present invention, it is possible to prevent a correct BCC from being added to erroneous updated data.
In addition, according to the present invention, even if erroneous update data is overwritten on the original data, the updated data is incorrect data based on the check code of the correct updated data generated by the present invention. Can be detected.
In addition, according to the present invention, even when an incorrect check code is added to correct updated data, an incorrect check code is added to the updated data through checking the validity of the check code. Can be detected.
1 ブロックデータの部分更新装置
11、21 キャッシュメモリ
12、22 キャッシュメモリインタフェース
13、23 Read DMA
14 BIDチェッカー
15 元データCRC格納部
16 更新部分CRC演算部
17 更新データCRC格納部
18、27 BCC演算部
19、28 Write DMA
20 CRCチェッカー
24 BCCチェッカー
25 バッファコントローラ
26 更新用データバッファ
30 更新データパス
181 Seedパラメータ格納部
182 更新位置パラメータ格納部
183、186 加算回路
184 マスク回路
185 乗算回路
187 BID付加部
1 Block data
14
20
Claims (6)
チェックコードを生成するチェックコード生成手段と、
更新対象となる元データD1の更新される部分のブロックデータBD1上に更新ブロックデータBD2を書き込んで、更新済みデータD2に更新し、該更新済みデータD2に上記チェックコード生成手段で生成されたチェックコードを付加するデータ更新手段とを備え、
上記チェックコード生成手段は、
更新対象となる元データD1とそのチェックコードBCC1を格納した領域から、更新される部分のブロックデータBD1と、更新対象となる元データD1のチェックコードBCC1を読み取る手段と、
上記更新される部分のブロックデータBD1のチェックコードBCCD1を生成する手段と、
上記更新対象となる元データD1を更新する更新ブロックデータBD2と、そのチェックコードBCCD2を読み込む手段と、
上記更新ブロックデータBD2のチェックコードBCCD2と、上記元データD1のチェックコードBCC1と、更新される部分のブロックデータBD1のチェックコードBCCD1とから、更新済みデータD2のチェックコードBCC2を生成する手段とを備えることを特徴とするブロックデータの部分更新装置。 A partial update device for block data protected by a check code,
Check code generation means for generating a check code;
The updated block data BD2 is written on the updated part of the block data BD1 of the original data D1 to be updated, updated to the updated data D2, and the check data generated by the check code generation means is updated to the updated data D2. Data updating means for adding a code,
The check code generation means is
Means for reading the block data BD1 of the part to be updated and the check code BCC1 of the original data D1 to be updated from the area storing the original data D1 to be updated and the check code BCC1;
Means for generating a check code BCCD1 of the block data BD1 of the part to be updated;
Update block data BD2 for updating the original data D1 to be updated, means for reading the check code BCCD2, and
Means for generating a check code BCC2 of the updated data D2 from the check code BCCD2 of the updated block data BD2, the check code BCC1 of the original data D1, and the check code BCCD1 of the updated block data BD1; A partial update apparatus for block data, comprising:
ことを特徴とする請求項1に記載のブロックデータの部分更新装置。 The means for generating the check code BCC2 of the updated data D2 writes the check code BCC1 of the original data D1, the check code BCCD1 of the updated block data BD1, and the updated block data BD2 to the original data D1. 2. The block data portion according to claim 1, wherein the check code BCC2 of the updated data D2 is generated on the basis of the check code BCCD2 of the updated block data BD2 determined depending on whether or not it is in a position. Update device.
更新対象となる元データD1とそのチェックコードBCC1を格納した領域から、更新される部分のブロックデータBD1と、更新対象となる元データD1のチェックコードBCC1を読み取るステップと、
上記更新される部分のブロックデータBD1のチェックコードBCCD1を生成するステップと、
上記更新対象となる元データD1を更新する更新ブロックデータBD2と、そのチェックコードBCCD2を読み込むステップと、
上記更新ブロックデータBD2のチェックコードBCCD2と、上記元データD1のチェックコードBCC1と、更新される部分のブロックデータBD1のチェックコードBCCD1とから、更新済みデータD2のチェックコードBCC2を生成するステップと、
上記元データD1の更新される部分のブロックデータBD1上に上記更新ブロックデータBD2を書き込んで、更新済みデータD2に更新し、該更新済みデータD2に上記チェックコードBCC2を付加するステップとからなる
ことを特徴とするブロックデータの部分更新方法。 A partial update method of block data protected by a check code,
Reading the block data BD1 of the part to be updated and the check code BCC1 of the original data D1 to be updated from the area storing the original data D1 to be updated and the check code BCC1;
Generating a check code BCCD1 of the updated block data BD1;
An update block data BD2 for updating the original data D1 to be updated, and a step of reading the check code BCCD2;
Generating a check code BCC2 of updated data D2 from the check code BCCD2 of the updated block data BD2, the check code BCC1 of the original data D1, and the check code BCCD1 of the updated block data BD1;
The update block data BD2 is written onto the updated block data BD1 of the original data D1, updated to updated data D2, and the check code BCC2 is added to the updated data D2. A partial update method of block data characterized by the above.
ことを特徴とする請求項3に記載のブロックデータの部分更新方法。 The step of generating the check code BCC2 of the updated data D2 includes writing the check code BCC1 of the original data D1, the check code BCCD1 of the updated block data BD1, and the updated block data BD2 into the original data D1. 4. The block data portion according to claim 3, wherein the check code BCC2 of the updated data D2 is generated on the basis of the check code BCCD2 of the updated block data BD2 determined depending on whether or not it is in a position. Update method.
コンピュータに、
更新対象となる元データD1とそのチェックコードBCC1を格納した領域から、更新される部分のブロックデータBD1と、更新対象となる元データD1のチェックコードBCC1を読み取る処理と、
上記更新される部分のブロックデータBD1のチェックコードBCCD1を生成する処理と、
上記更新対象となる元データD1を更新する更新ブロックデータBD2と、そのチェックコードBCCD2を読み込む処理と、
上記更新ブロックデータBD2のチェックコードBCCD2と、上記元データD1のチェックコードBCC1と、更新される部分のブロックデータBD1のチェックコードBCCD1とから、更新済みデータD2のチェックコードBCC2を生成する処理と、
上記元データD1の更新される部分のブロックデータBD1上に上記更新ブロックデータBD2を書き込んで、更新済みデータD2に更新し、該更新済みデータD2に上記チェックコードBCC2を付加する処理とを実行させる
ことを特徴とするブロックデータの部分更新プログラム。 A partial update program for block data protected by a check code,
On the computer,
A process of reading the updated block data BD1 and the check code BCC1 of the original data D1 to be updated from the area storing the original data D1 to be updated and the check code BCC1;
Processing for generating the check code BCCD1 of the block data BD1 of the part to be updated;
Update block data BD2 for updating the original data D1 to be updated, and processing for reading the check code BCCD2;
A process of generating a check code BCC2 of updated data D2 from the check code BCCD2 of the updated block data BD2, the check code BCC1 of the original data D1, and the check code BCCD1 of the updated block data BD1;
The updated block data BD2 is written on the updated block data BD1 of the original data D1, updated to the updated data D2, and the check code BCC2 is added to the updated data D2. A partial update program for block data.
ことを特徴とする請求項5に記載のブロックデータの部分更新プログラム。 The process of generating the check code BCC2 of the updated data D2 includes writing the check code BCC1 of the original data D1, the check code BCCD1 of the updated block data BD1, and the updated block data BD2 into the original data D1. 6. The block data portion according to claim 5, wherein the check code BCC2 of the updated data D2 is generated on the basis of the check code BCCD2 of the updated block data BD2 determined depending on whether or not it is in a position. Update program.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006347230A JP4859658B2 (en) | 2006-12-25 | 2006-12-25 | Block data partial update device, block data partial update method, and block data partial update program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006347230A JP4859658B2 (en) | 2006-12-25 | 2006-12-25 | Block data partial update device, block data partial update method, and block data partial update program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2008158832A JP2008158832A (en) | 2008-07-10 |
| JP4859658B2 true JP4859658B2 (en) | 2012-01-25 |
Family
ID=39659664
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2006347230A Expired - Fee Related JP4859658B2 (en) | 2006-12-25 | 2006-12-25 | Block data partial update device, block data partial update method, and block data partial update program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4859658B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR102653845B1 (en) * | 2018-12-03 | 2024-04-02 | 에스케이하이닉스 주식회사 | Data Storage Device and Operation Method Thereof, Storage System Having the Same |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH04311217A (en) * | 1991-04-09 | 1992-11-04 | Toshiba Corp | External storage controller |
| JPH04311218A (en) * | 1991-04-09 | 1992-11-04 | Toshiba Corp | External storage controller |
| JPH06202967A (en) * | 1993-01-06 | 1994-07-22 | Nec Corp | Input/output controller |
| JP2000105675A (en) * | 1998-09-29 | 2000-04-11 | Nec Corp | Disk array device |
-
2006
- 2006-12-25 JP JP2006347230A patent/JP4859658B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2008158832A (en) | 2008-07-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103164298B (en) | Produce the data storage device of the redundancy protected for the data path of even-odd check sector | |
| KR101730510B1 (en) | Non-regular parity distribution detection via metadata tag | |
| KR101905280B1 (en) | High performance system providing selective merging of dataframe segments in hardware | |
| US6651212B1 (en) | Recording/reproduction device, semiconductor memory, and memory card using the semiconductor memory | |
| US9377960B2 (en) | System and method of using stripes for recovering data in a flash storage system | |
| US20140068208A1 (en) | Separately stored redundancy | |
| KR20090028507A (en) | Nonvolatile Memory Error Correction System and Method | |
| CN101868830A (en) | Fault Tolerant Non-Volatile Integrated Circuit Memory | |
| CN101512491A (en) | Electrically secure disk storage device, system and method | |
| US7418645B2 (en) | Error correction/detection code adjustment for known data pattern substitution | |
| CN101388256B (en) | Controller and method for generating a low-level error correction code for a memory element | |
| CN101256803B (en) | Error correction device and recording and reproducing device | |
| WO2024098885A1 (en) | Disk array write processing method and apparatus, device, and medium | |
| JP4859658B2 (en) | Block data partial update device, block data partial update method, and block data partial update program | |
| CN114625563B (en) | Data protection method and device of SSD, readable storage medium and electronic equipment | |
| CN104021806A (en) | Data processing method and data processing equipment | |
| CN101273573B (en) | Data descramble apparatus and data descramble method | |
| CN104681095A (en) | Storage device and method of operation thereof | |
| WO2007088597A1 (en) | Error correction code generation method and memory management device | |
| TWI575529B (en) | Method of enhancing error correction in data storage system and data storage system thereof | |
| CN119440901B (en) | Data management method, electronic device, and storage medium | |
| TW200832367A (en) | Decoding apparatus and method | |
| JP2010140261A (en) | Information processor, error correction method and program | |
| TWI273775B (en) | Method for generating syndrome value and related syndrome generator | |
| CN120526833A (en) | Memory encoding and decoding method, device, electronic device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090907 |
|
| 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: 20111101 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20111101 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 4859658 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20141111 Year of fee payment: 3 |
|
| LAPS | Cancellation because of no payment of annual fees |