JPH10269147A - Data checking method - Google Patents

Data checking method

Info

Publication number
JPH10269147A
JPH10269147A JP9072414A JP7241497A JPH10269147A JP H10269147 A JPH10269147 A JP H10269147A JP 9072414 A JP9072414 A JP 9072414A JP 7241497 A JP7241497 A JP 7241497A JP H10269147 A JPH10269147 A JP H10269147A
Authority
JP
Japan
Prior art keywords
data
check word
data block
check
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP9072414A
Other languages
Japanese (ja)
Inventor
Koichi Matsukawa
康一 松川
Mitsuru Tsuchida
充 土田
Kazuyoshi Oshima
一能 大島
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP9072414A priority Critical patent/JPH10269147A/en
Publication of JPH10269147A publication Critical patent/JPH10269147A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a data checking method that detects the switching of data blocks when the data blocks used for an operation are switched, also detects data zero when entire data become zero because of a failure, etc., and further detects the inversion of bits when the bits of an even data block are inserted. SOLUTION: A controlling means divides data with a prescribed length and allocates an address to each of plural data blocks. Next, it takes exclusive-OR of each value of the data block and a corresponding address and further takes the total sum of acquired results. Next, it takes exclusive-OR of the complement of two of the total sum and the address of the check word and further creates a check word by adding a preliminarily defined value to the resultant value of the exclusive-OR. Then, the check word created in this way is written in a storage means.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、情報処理機器お
よび通信処理機器のメモリ上に展開される情報の正当性
をブロック単位で検証する手段の処理方法に関するもの
である。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a processing method of means for verifying the validity of information developed on a memory of an information processing device and a communication processing device on a block basis.

【0002】[0002]

【従来の技術】情報処理機器および通信処理機器のメモ
リ上に展開される情報の正当性を簡単に検証する手段と
して、チェックサムによる方法や水平パリティチェック
による方法が知られている。
2. Description of the Related Art As a means for easily verifying the validity of information developed on a memory of an information processing device and a communication processing device, a method using a checksum and a method using a horizontal parity check are known.

【0003】図1は従来のデータチェックを実現するた
めの構成を示した構成図である。図1において、1はデ
ータチェック方法を行うための主要部をなす制御手段で
あり、CPUなどで構成される。また、2はメモリなど
の記憶手段である。
FIG. 1 is a configuration diagram showing a configuration for realizing a conventional data check. In FIG. 1, reference numeral 1 denotes control means which is a main part for performing a data check method, and is constituted by a CPU or the like. Reference numeral 2 denotes a storage unit such as a memory.

【0004】図18は従来のチェックサムによるデータ
チェック方法の一例を示す説明図である。チェックサム
による方法では、図18に示すようにチェック対象とな
るブロックのデータをある単位の長さ(例えば2バイ
ト)に区切り、n個の計算単位に分割する。それらのデ
ータをdata〔k〕(0≦k≦n−1)とする。ま
た、チェックワードを格納する位置をjとし、data
〔j〕にチェックワードを格納するものとする。
FIG. 18 is an explanatory diagram showing an example of a conventional data check method using a checksum. In the method using the checksum, as shown in FIG. 18, data of a block to be checked is divided into a certain unit length (for example, 2 bytes) and divided into n calculation units. Let these data be data [k] (0 ≦ k ≦ n−1). Also, the position where the check word is stored is j, and data
It is assumed that a check word is stored in [j].

【0005】この時にチェックサムによる方法では、以
下の式が成立する場合にブロック内のデータが正当であ
ると判断する。
At this time, according to the checksum method, if the following equation is satisfied, it is determined that the data in the block is valid.

【0006】[0006]

【数1】 (Equation 1)

【0007】この式において、aは0などの定数であ
る。
In this equation, a is a constant such as 0.

【0008】データチェック方法でデータが正当である
と保証されるブロックで、任意の位置kのデータを新デ
ータdata’〔k〕に更新する場合には、以下の式で
求められる値data’〔j〕にチェックワードを更新
する。 (1)新データdata’〔k〕の全ビットを反転した
値に1を加えた値data’’〔k〕を計算する。な
お、以降の式において、全ビット反転(1の補数)演算
を”反転”で記述する。
[0008] When updating data at an arbitrary position k to new data data '[k] in a block whose data is guaranteed to be valid by the data check method, a value data' [ j] is updated. (1) A value data ″ [k] is calculated by adding 1 to a value obtained by inverting all the bits of the new data data ′ [k]. In the following equations, all bit inversion (one's complement) operation is described as “inversion”.

【0009】[0009]

【数2】 (Equation 2)

【0010】(2)上記(1)の計算結果と変更対象と
なるデータdata〔k〕と変更前のチェックワードd
ata〔j〕の和を計算し、変更後のチェックワードと
する。
(2) The calculation result of the above (1), data data [k] to be changed, and the check word d before the change
The sum of data [j] is calculated and used as the changed check word.

【0011】[0011]

【数3】 (Equation 3)

【0012】また、図19は従来のチェックサムによる
データチェック方法の別の例を示す説明図である。図1
9に示すようにチェック対象となるブロックのデータを
ある単位の長さ(例えば2バイト)に区切りn個の計算
単位に分割する。それらのデータをdata〔k〕(0
≦k≦n−1)とする。また、チェック対象のブロック
の領域の外にチェックワードを格納するものとし、ここ
ではcheckwordとしておく。
FIG. 19 is an explanatory view showing another example of a conventional data check method using a checksum. FIG.
As shown in FIG. 9, the data of the block to be checked is divided into a certain unit length (for example, 2 bytes) and divided into n calculation units. These data are stored in data [k] (0
≤ k ≤ n-1). The check word is stored outside the area of the block to be checked, and is set to checkword here.

【0013】このような従来のチェックサムによるデー
タチェック方法では以下の式が成立する場合にブロック
内のデータが正当であると判断する場合がある。
In such a conventional data check method using a checksum, data in a block may be determined to be valid when the following equation is satisfied.

【0014】[0014]

【数4】 (Equation 4)

【0015】また、従来のチェックサムによるデータチ
ェック方法でデータが正当であると保証されるブロック
で、任意の位置kのデータを更新する場合には、変更前
のデータdata〔k〕の全ビットを反転した値に1を
加えた値と新データdata’〔k〕と変更前のチェッ
クワードcheckwordの和にcheckwor
d’にチェックワードを更新し、新データdata’
〔k〕にデータを更新する。
Further, when updating data at an arbitrary position k in a block in which data is guaranteed to be valid by a conventional data check method using a checksum, all bits of data data [k] before change are updated. The value obtained by adding 1 to the value obtained by inverting the value, the new data data '[k], and the sum of the check word checkword before change and checkword
The check word is updated to d 'and the new data data'
The data is updated to [k].

【0016】[0016]

【数5】 (Equation 5)

【0017】また、図20は従来の水平パリティチェッ
クによるデータチェック方法の一例を示す説明図であ
る。図20に示すようにチェック対象となるブロックの
データをある単位の長さ(例えば2バイト)に区切り、
n個の計算単位に分割する。それらのデータをdata
〔k〕(0≦k≦n−1)とする。また、チェックワー
ドを格納する位置をjとし、data〔j〕にチェック
ワードを格納するものとする。
FIG. 20 is an explanatory diagram showing an example of a conventional data check method using a horizontal parity check. As shown in FIG. 20, the data of the block to be checked is divided into unit lengths (for example, 2 bytes).
Divide into n calculation units. Data of those data
[K] (0 ≦ k ≦ n−1). The position where the check word is stored is j, and the check word is stored in data [j].

【0018】従来の水平パリティチェックによるデータ
チェック方法では以下の式が成立する場合にブロック内
のデータが正当であると判断する。なお、以降の式にお
いて、排他的論理和演算を記号“^”で記述する。
In a conventional data check method using a horizontal parity check, data in a block is determined to be valid when the following equation is satisfied. In the following expressions, the exclusive OR operation is described by a symbol “記号”.

【0019】[0019]

【数6】 (Equation 6)

【0020】この式においてaは定数であり、例えばa
=A5A5h(ここでhは16進数を示す)などの値を
用いる。
In this equation, a is a constant, for example, a
= A5A5h (where h indicates a hexadecimal number) or the like.

【0021】従来の水平パリティチェックによるデータ
チェック方法においてブロック内のデータを初期化する
場合、それに対応するチェックワードdata〔j〕は
以下の式で求められる。
When initializing data in a block in a conventional data check method using a horizontal parity check, a check word data [j] corresponding to the data is obtained by the following equation.

【0022】[0022]

【数7】 (Equation 7)

【0023】また、従来の水平パリティチェックによる
データチェック方法でデータが正当であると保証される
ブロックで、任意の位置kのデータを更新する場合に
は、以下の式で求められる値data’〔j〕にチェッ
クワードを更新し、新データdata’〔k〕にデータ
を更新する。
When updating data at an arbitrary position k in a block in which data is guaranteed to be valid by a conventional data check method using a horizontal parity check, the value data '[ j] and the data is updated to new data data '[k].

【0024】[0024]

【数8】 (Equation 8)

【0025】また、図21は従来の水平パリティチェッ
クによるデータチェック方法の別の例を示す説明図であ
る。図21に示すようにチェック対象となるブロックの
データをある単位の長さ(例えば2バイト)に区切り、
n個の計算単位に分割する。それらのデータをdata
〔k〕(0≦k≦n−1)とする。また、チェック対象
のブロックの領域の外にチェックワードを格納するもの
とし、ここではcheckwordとしておく。
FIG. 21 is an explanatory diagram showing another example of a conventional data check method using a horizontal parity check. As shown in FIG. 21, the data of the block to be checked is divided into unit lengths (for example, 2 bytes).
Divide into n calculation units. Data of those data
[K] (0 ≦ k ≦ n−1). The check word is stored outside the area of the block to be checked, and is set to checkword here.

【0026】この従来例では以下の式が成立する場合に
ブロック内のデータが正当であると判断する。
In this conventional example, when the following equation is satisfied, it is determined that the data in the block is valid.

【0027】[0027]

【数9】 (Equation 9)

【0028】また、この従来例におけるデータチェック
方法でデータが正当であると保証されるブロックで、任
意の位置kのデータを更新する場合には、以下の式で求
められる値checkword’にチェックワードを更
新し、新データdata’〔k〕にデータを更新する。
When updating data at an arbitrary position k in a block in which data is guaranteed to be valid by the data check method in the conventional example, a check word 'obtained by the following equation is added to a check word. Is updated to new data data '[k].

【0029】[0029]

【数10】 (Equation 10)

【0030】[0030]

【発明が解決しようとする課題】従来のチェックサムに
よる方法や水平パリティチェックによるデータチェック
方法はこのように構成されており、チェックサムの計
算、および水平パリティチェックの計算に使用している
演算は交換則が成り立つ演算である。このため、演算に
用いられるデータブロックが入れ替わった場合、従来の
方法ではチェックワードの演算結果が不変であるため、
データの入れ替わりを検出できないという問題があっ
た。
A conventional method using a checksum and a data check method using a horizontal parity check are configured as described above, and the calculation used for the checksum calculation and the horizontal parity check calculation is performed as follows. This is an operation for which the commutation rule holds. For this reason, when the data blocks used for the operation are switched, the operation result of the check word is unchanged in the conventional method.
There has been a problem that data interchange cannot be detected.

【0031】また、従来のチェックサムによるデータチ
ェック方法では、データが全て0の場合にチェックワー
ドも0となるので、メモリデバイスの故障などにより、
データが意図せずに全て0になってしまうような事態を
検出できず、この場合でもデータが正当であると誤って
判断してしまうという問題があった。
In the data check method using the conventional checksum, the check word becomes 0 when all data is 0.
A situation in which the data all become 0 unintentionally cannot be detected, and even in this case, there is a problem that the data is erroneously determined to be valid.

【0032】また、従来の水平パリティチェックによる
データチェック方法では、偶数のデータブロックのビッ
トが反転した場合、排他的論理和では反転しない場合と
同一の演算結果となってしまうため、ビットの反転を検
出できないという問題があった。
In the data check method using the conventional horizontal parity check, when the bits of the even-numbered data block are inverted, the same operation result is obtained as when the exclusive OR is not used. There was a problem that it could not be detected.

【0033】この発明はこのような問題点を解決するた
めに為されたものであり、演算に用いられるデータブロ
ックが入れ替わった場合に、このデータの入れ替わりを
検出し、データが全て0の場合を検出し、さらに偶数の
データブロックのビットが反転した場合に、このビット
の反転を検出するデータチェック方法を提供することを
目的とする。
The present invention has been made to solve such a problem, and when data blocks used for calculation are replaced, the replacement of the data is detected, and the case where all data are 0 is detected. It is an object of the present invention to provide a data check method for detecting and inverting a bit of an even-numbered data block when the bit is inverted.

【0034】[0034]

【課題を解決するための手段】第1の発明に係わるデー
タチェック方法は、データを所定の長さで分割して複数
の第1のデータブロックを作成するデータ分割工程と、
上記複数の第1のデータブロックの各々に対してアドレ
スを割り付けるアドレス割り付け工程と、上記複数の第
1のデータブロックの各々に対してこの第1のデータブ
ロックの値と対応するアドレスとの排他的論理和をとっ
て複数の第2のデータブロックを作成する第2データブ
ロック作成工程と、データの信頼性チェックのために、
第1のチェックワードを上記第1のデータブロックのア
ドレス範囲内の所定のアドレスに挿入または追加する第
1チェックワード挿入工程と、上記複数の第2のデータ
ブロックの総和をとり、得られた第2のデータブロック
の総和に対して2の補数をとり、次にこの総和の2の補
数と上記第1のチェックワードのアドレスとの排他的論
理和をとり、さらにこの排他的論理和による結果の値に
予め決められた値を加えて上記第1のチェックワードを
作成する第1チェックワード作成工程と、上記第1のデ
ータブロックと上記第1のチェックワードとを記憶手段
に書込む書込工程と、上記複数の第1のデータブロック
及び上記第1のチェックワードを上記記憶手段から読み
だす際に、上記複数の第1のデータブロックの各々に対
して、この第1のデータブロックの値と対応するアドレ
スとの排他的論理和をとり、複数の第3のデータブロッ
クを作成する第3データブロック作成工程と、上記第1
のチェックワードの値と対応するアドレスとの排他的論
理和をとり、第2のチェックワードを作成する第2チェ
ックワード作成工程と、上記複数の第3のデータブロッ
クの総てと上記第2のチェックワードとの総和をとり第
4のデータブロックを作成する第4データブロック作成
工程と、この第4のデータブロックが上記予め決められ
た値と同じか否かを判断するチェック工程とを備えたも
のである。
A data check method according to a first aspect of the present invention includes a data dividing step of dividing data into predetermined lengths to generate a plurality of first data blocks;
An address allocating step of allocating an address to each of the plurality of first data blocks, and exclusive-use of an address corresponding to the value of the first data block to each of the plurality of first data blocks. A second data block creation step of creating a plurality of second data blocks by taking a logical sum; and for checking data reliability,
A first check word insertion step of inserting or adding a first check word to a predetermined address within an address range of the first data block, and a summation of the plurality of second data blocks, The two's complement of the sum of the two data blocks is calculated, then the exclusive OR of the two's complement of the sum and the address of the first check word is calculated, and the result of the exclusive OR is calculated. A first check word creating step of creating a first check word by adding a predetermined value to a value; and a writing step of writing the first data block and the first check word into storage means. And reading out the plurality of first data blocks and the first check word from the storage means, for each of the plurality of first data blocks, An exclusive OR operation value of Taburokku and corresponding address, and a third data block creation step of creating a plurality of third data blocks, the first
XORing the value of the check word and the corresponding address to create a second check word, and all of the plurality of third data blocks and the second check word. A fourth data block creating step of creating a fourth data block by summing the check data with a check word; and a checking step of determining whether or not the fourth data block is the same as the predetermined value. Things.

【0035】また、第2の発明に係わるデータチェック
方法は、データの更新を行った場合、更新前の第1のチ
ェックワードの値と対応するアドレスとの排他的論理和
をとり、第1の中間データを作成する第1中間データ作
成工程と、複数の第1のデータブロックの内の変更の対
象となる第1のデータブロックに対してこの第1のデー
タブロックの値と対応するアドレスとの排他的論理和を
とり、複数の第2の中間データを作成する第2中間デー
タ作成工程と、変更された第1のデータブロックと上記
第1のチェックワードのアドレスとの排他的論理和をと
り、第3の中間データを作成する第3中間データ作成工
程と、上記第1の中間データと上記複数の第2の中間デ
ータと上記第3の中間データの2の補数との総和をと
り、この総和と上記第1のチェックワードのアドレスと
の排他的論理和をとってデータ更新後の第1のチェック
ワードを作成する工程とを備えたものである。
Further, in the data check method according to the second invention, when data is updated, an exclusive OR of the value of the first check word before the update and the corresponding address is obtained, and A first intermediate data creating step of creating intermediate data, and a first data block to be changed among a plurality of first data blocks, the value of which is associated with an address corresponding to the value of the first data block. A second intermediate data creating step of taking an exclusive OR to create a plurality of second intermediate data; and taking an exclusive OR of the changed first data block and the address of the first check word. A third intermediate data creating step of creating third intermediate data; and taking a sum of the first intermediate data, the plurality of second intermediate data, and the two's complement of the third intermediate data. Sum and above Is obtained by a step of creating a first check word after the data updating takes the exclusive OR of the address of one of the check words.

【0036】また、第3の発明に係わるデータチェック
方法は、データを所定の長さで分割して複数の第1のデ
ータブロックを作成するデータ分割工程と、上記複数の
第1のデータブロックの各々に対してアドレスを割り付
けるアドレス割り付け工程と、上記複数の第1のデータ
ブロックの各々に対してこの第1のデータブロックの値
に、対応するアドレスを加算して複数の第2のデータブ
ロックを作成する第2データブロック作成工程と、デー
タの信頼性チェックのために、第1のチェックワードを
上記第1のデータブロックのアドレス範囲内の所定のア
ドレスに挿入または追加する第1チェックワード挿入工
程と、上記複数の第2のデータブロックの総ての排他的
論理和をとり第3のデータブロックを作成する第3デー
タブロック作成工程と、上記第3のデータブロックの値
とあらかじめ決められた値との排他的論理和をとり、第
4のデータブロックを作成する第4データブロック作成
工程と、上記第1のチェックワードのアドレスの2の補
数をとり、上記第4のデータブロックに加えて上記第1
のチェックワードを作成するチェックワード作成工程
と、上記第1のデータブロックと上記第1のチェックワ
ードとを記憶手段に書込む書込工程と、上記複数の第1
のデータブロック及び上記第1のチェックワードを上記
記憶手段から読みだす際に、上記複数の第1のデータブ
ロックの各々に対して、この第1のデータブロックの値
に、対応するアドレスを加算し、複数の第5のデータブ
ロックを作成する第5データブロック作成工程と、上記
第1のチェックワードの値に、対応するアドレスを加算
し、第2のチェックワードを作成する第2チェックワー
ド作成工程と、上記複数の第5のデータブロックの総て
と上記第2のチェックワードとの排他的論理和をとり第
6のデータブロックを作成する第6データブロック作成
工程と、この第6のデータブロックが上記予め決められ
た値と同じか否かを判断するチェック工程とを備えたも
のである。
The data checking method according to a third aspect of the present invention includes a data dividing step of dividing data into predetermined lengths to generate a plurality of first data blocks, An address allocating step of allocating an address to each of the plurality of first data blocks; a corresponding address is added to the value of the first data block to form a plurality of second data blocks; A second data block creating step of creating, and a first check word inserting step of inserting or adding a first check word to a predetermined address within the address range of the first data block for data reliability check And a third data block creation step of taking the exclusive OR of all of the plurality of second data blocks to create a third data block XORing the value of the third data block with a predetermined value to create a fourth data block, and a fourth data block creating step of creating a fourth data block; Take the two's complement and add the first data block to the fourth data block.
A writing step of writing the first data block and the first check word into storage means; and a writing step of writing the first data block and the first check word into storage means.
When reading the data block and the first check word from the storage means, for each of the plurality of first data blocks, add a corresponding address to the value of the first data block. A fifth data block creating step of creating a plurality of fifth data blocks; and a second check word creating step of adding a corresponding address to the value of the first check word to create a second check word. A sixth data block creating step of taking an exclusive OR of all of the plurality of fifth data blocks and the second check word to create a sixth data block; And a check step of determining whether the value is the same as the predetermined value.

【0037】また、第4の発明に係わるデータチェック
方法は、データの更新を行った場合、更新前の第1のチ
ェックワードの値に、対応するアドレスを加算し、第1
の中間データを作成する第1中間データ作成工程と、複
数の第1のデータブロックの内の変更の対象となる第1
のデータブロックに対してこの第1のデータブロックの
値に、対応するアドレスを加算して、第2の中間データ
を作成する第2中間データ作成工程と、変更された第1
データブロックの値に、対応するアドレスを加算して、
第3の中間データを作成する第3中間データ作成工程
と、上記第1の中間データと上記第2の中間データと上
記第3の中間データとの排他的論理和をとって第4の中
間データを作成する第4中間データ作成工程と、この第
4の中間データに上記第1のチェックワードのアドレス
の2の補数を加算してデータ更新後のチェックワードを
作成する工程とを備えたものである。
In the data check method according to the fourth invention, when data is updated, a corresponding address is added to the value of the first check word before the update, and the first check word is updated.
A first intermediate data creating step of creating intermediate data of a first data block and a first intermediate data to be changed among a plurality of first data blocks.
A second intermediate data creating step of adding a corresponding address to the value of the first data block to create a second intermediate data for the data block of the first data block;
Add the corresponding address to the value of the data block,
A third intermediate data creating step of creating third intermediate data, and an exclusive OR of the first intermediate data, the second intermediate data, and the third intermediate data to obtain fourth intermediate data And a step of adding a two's complement of the address of the first check word to the fourth intermediate data to create a check word after data update. is there.

【0038】また、第5の発明に係わるデータチェック
方法は、データを所定の長さで分割して複数の第1のデ
ータブロックを作成するデータ分割工程と、上記複数の
第1のデータブロックの各々に対してアドレスを割り付
けるアドレス割り付け工程と、上記複数の第1のデータ
ブロックの各々に対してこの第1のデータブロックの値
と対応するアドレスとの排他的論理和をとって複数の第
2のデータブロックを作成する第2データブロック作成
工程と、上記複数の第1のデータブロックを第1の記憶
手段に格納する第1データブロック格納工程と、上記複
数の第2のデータブロックの総和をとり、得られた総和
に基づいてチェックワードを作成するチェックワード作
成工程と、上記チェックワードを第2の記憶手段に格納
するチェックワード格納工程と、上記複数の第1のデー
タブロックを上記第1の記憶手段から読みだす際に、こ
の第1のデータブロックの各々に対してこの第1のデー
タブロックの値と対応するアドレスとの排他的論理和を
とり、複数の第3のデータブロックを作成する第3デー
タブロック作成工程と、上記複数の第3のデータブロッ
クの総和をとり第4のデータブロックを作成する第4デ
ータブロック作成工程と、この第4のデータブロックが
上記第2の記憶手段から読みだしたチェックワードと同
じか否かを判断するチェック工程とを備えたものであ
る。
The data checking method according to a fifth aspect of the present invention includes a data dividing step of dividing data into predetermined lengths to create a plurality of first data blocks; An address allocating step of allocating an address to each of the plurality of first data blocks; and calculating, by exclusive ORing, for each of the plurality of first data blocks, a value of the first data block and an address corresponding to the plurality of second data blocks; A second data block creating step of creating the first data block, a first data block storing step of storing the plurality of first data blocks in the first storage means, and a sum of the plurality of second data blocks. A check word creating step of creating a check word based on the obtained sum, and a check word creating step of storing the check word in the second storage means. A storing step, and when reading the plurality of first data blocks from the first storage means, for each of the first data blocks, a value of the first data block and an address corresponding to the value are stored. A third data block creation step of taking an exclusive OR to create a plurality of third data blocks, and a fourth data block creation of taking a sum of the plurality of third data blocks to create a fourth data block And a check step of determining whether or not the fourth data block is the same as the check word read from the second storage means.

【0039】また、第6の発明に係わるデータチェック
方法は、データの更新を行った場合、変更された第1の
データブロックと対応するアドレスとの排他的論理和を
とり、第1の中間データを作成する第1中間データ作成
工程と、複数の第1のデータブロックの内の変更の対象
となる変更前の第1のデータブロックに対してこの第1
のデータブロックの値と対応するアドレスとの排他的論
理和をとり、第2の中間データを作成する第2中間デー
タ作成工程と、上記第1の中間データと、上記第2の中
間データの2の補数と、更新前のチェックワードの値
と、の総和をとり、データ更新後のチェックワードを作
成する工程とを備えたものである。
Further, in the data checking method according to the sixth invention, when the data is updated, an exclusive OR of the changed first data block and the corresponding address is obtained, and the first intermediate data is updated. A first intermediate data creating step of creating a first intermediate data block and a first intermediate data block of the plurality of first data blocks before the change which is a target of the change.
XORing the value of the data block with the corresponding address to create the second intermediate data, the second intermediate data creating step, and the second intermediate data of the first intermediate data and the second intermediate data. And the step of taking the sum of the complement of the check word and the value of the check word before update to create a check word after data update.

【0040】また、第7の発明に係わるデータチェック
方法は、データを所定の長さで分割して複数の第1のデ
ータブロックを作成するデータ分割工程と、上記複数の
第1のデータブロックの各々に対してアドレスを割り付
けるアドレス割り付け工程と、上記複数の第1のデータ
ブロックの各々に対してこの第1のデータブロックの値
に、対応するアドレスを加算して複数の第2のデータブ
ロックを作成する第2データブロック作成工程と、上記
複数の第1のデータブロックを第1の記憶手段に格納す
る第1データブロック格納工程と、上記複数の第2のデ
ータブロック間の排他的論理和をとり、この排他的論理
和の結果に基づいてチェックワードを作成するチェック
ワード作成工程と、このチェックワードを上記第2の記
憶手段に格納するチェックワード格納工程と、上記複数
の第1のデータブロックを上記第1の記憶手段から読み
だす際に、この第1のデータブロックの各々に対してこ
の第1のデータブロックの値に、対応するアドレスを加
算して複数の第3のデータブロックを作成する第3デー
タブロック作成工程と、上記複数の第3のデータブロッ
クの総ての排他的論理和をとり第4のデータブロックを
作成する第4データブロック作成工程と、この第4のデ
ータブロックが上記第2の記憶手段から読みだしたチェ
ックワードと同じか否かを判断するチェック工程とを備
えたものである。
The data checking method according to a seventh aspect of the present invention includes a data dividing step of dividing the data into predetermined lengths to create a plurality of first data blocks; An address allocating step of allocating an address to each of the plurality of first data blocks; a corresponding address is added to the value of the first data block to form a plurality of second data blocks; A second data block creating step of creating, a first data block storing step of storing the plurality of first data blocks in the first storage means, and an exclusive OR between the plurality of second data blocks. Then, a check word creating step of creating a check word based on the result of the exclusive OR, and storing the check word in the second storage means. And when reading the plurality of first data blocks from the first storage means, for each of the first data blocks, an address corresponding to the value of the first data block. A third data block creating step of creating a plurality of third data blocks by adding a third data block, and a fourth data block of creating the fourth data block by taking an exclusive OR of all the plurality of third data blocks. The method includes a data block creation step and a check step of determining whether or not the fourth data block is the same as the check word read from the second storage means.

【0041】また、第8の発明に係わるデータチェック
方法は、データの更新を行った場合、複数の第1のデー
タブロックの内の変更の対象となる第1のデータブロッ
クに対してこの第1のデータブロックの値に、対応する
アドレスを加算して、複数の第1の中間データを作成す
る第1中間データ作成工程と、変更された第1データブ
ロックの値に、対応するアドレスを加算して、第2の中
間データを作成する第2中間データ作成工程と、更新前
のチェックワードの値と、上記第1の中間データと、上
記第2の中間データとの排他的論理和をとって、データ
更新後のチェックワードを作成する工程とを備えたもの
である。
Further, in the data checking method according to the eighth invention, when the data is updated, the first data block to be changed among the plurality of first data blocks is subjected to the first data block. A first intermediate data creating step of creating a plurality of first intermediate data by adding a corresponding address to the value of the data block, and adding the corresponding address to the changed value of the first data block. A second intermediate data creating step of creating second intermediate data, an exclusive OR of the check word value before update, the first intermediate data, and the second intermediate data is calculated. And creating a check word after updating the data.

【0042】また、第9の発明に係わるデータチェック
方法は、チェック工程が、第1のデータブロック及び第
1のチェックワードを記憶手段から読みだす際に、上記
第1のデータブロックの各々の値がすべて0の場合に、
この第1のデータブロックの値と対応するアドレスとの
排他的論理和をとって作成された複数の第3のデータブ
ロックの総和と、上記第1のチェックワードと対応する
アドレスとの排他的論理和をとって作成された第2のチ
ェックワードと、の和が、予め決められた値と同じか否
かを判断するものである。
Further, in the data checking method according to the ninth invention, when the checking step reads the first data block and the first check word from the storage means, each value of the first data block is read. Are all 0,
The exclusive OR of the sum of the plurality of third data blocks created by taking the exclusive OR of the value of the first data block and the corresponding address, and the exclusive check of the address corresponding to the first check word It is to judge whether or not the sum of the second check word created by taking the sum is the same as a predetermined value.

【0043】また、第10の発明に係わるデータチェッ
ク方法は、チェック工程が、第1のデータブロック及び
第1のチェックワードを記憶手段から読みだす際に、上
記第1のデータブロックの各々の値がすべて0の場合
に、この第1のデータブロックの値に、対応するアドレ
スをそれぞれ加算して作成された複数の第3のデータブ
ロックの総てと、上記第1のチェックワードに対応する
アドレスを加算して作成された第2のチェックワード
と、の排他的論理和が、予め決められた値と同じか否か
を判断するものである。
Also, in the data checking method according to the tenth aspect, when the checking step reads out the first data block and the first check word from the storage means, each value of the first data block is read. Are all 0, all of the plurality of third data blocks created by adding the corresponding address to the value of the first data block and the address corresponding to the first check word, respectively. To determine whether or not the exclusive OR of the second check word created by adding .gamma. Is equal to a predetermined value.

【0044】[0044]

【発明の実施の形態】BEST MODE FOR CARRYING OUT THE INVENTION

実施の形態1.図1はこの発明に係るデータチェックを
実現するための構成を示した構成図である。図1におい
て、1はデータチェック方法を行うための主要部をなす
制御手段であり、CPUなどで構成される。また、2は
メモリなどの記憶手段である。
Embodiment 1 FIG. FIG. 1 is a configuration diagram showing a configuration for realizing a data check according to the present invention. In FIG. 1, reference numeral 1 denotes control means which is a main part for performing a data check method, and is constituted by a CPU or the like. Reference numeral 2 denotes a storage unit such as a memory.

【0045】また、図2はこの発明に係るデータチェッ
ク方法の一実施の形態を示す説明図である。次に、図2
に示すデータチェック方法の動作を説明する。まず、チ
ェック対象となるブロックのデータをある単位の長さ
(例えば2バイト)に区切り、n個の計算単位に分割す
る。それらのデータをdata〔k〕(0≦k≦n−
1)とする。また、各計算単位data〔k〕のブロッ
ク内における相対位置を示す数列をnum〔k〕(0≦
k≦n−1)と定義する。
FIG. 2 is an explanatory diagram showing an embodiment of the data check method according to the present invention. Next, FIG.
The operation of the data check method shown in FIG. First, the data of the block to be checked is divided into a certain unit length (for example, 2 bytes) and divided into n calculation units. These data are converted to data [k] (0 ≦ k ≦ n−
1). Further, a sequence indicating the relative position of each calculation unit data [k] in the block is represented by num [k] (0 ≦
k ≦ n−1).

【0046】また、この数列num〔k〕の周期は、前
記の分割された計算単位の個数n以上であることを前提
とする。また、この実施の形態ではnum〔k〕とし
て、例えば、num〔k〕=kという数列を用いるが、
他の数列を用いてもよい。また、チェックワードを格納
する位置をjとし、data〔j〕にチェックワードを
格納するものとする。
It is assumed that the cycle of the sequence num [k] is equal to or greater than the number n of the divided calculation units. In this embodiment, for example, a sequence of num [k] = k is used as num [k].
Other sequences may be used. The position where the check word is stored is j, and the check word is stored in data [j].

【0047】この時に、この実施の形態1では,以下の
式が成立する場合にブロック内のデータが正当であると
判断する。なお、以下の式では排他的論理和演算を記号
“ ^”で記述している。
At this time, in the first embodiment, if the following equation is satisfied, it is determined that the data in the block is valid. In the following equation, the exclusive OR operation is described with a symbol “^”.

【0048】[0048]

【数11】 [Equation 11]

【0049】この式においてaは定数であり、例えばa
=0とすればよい。
In this equation, a is a constant.
= 0.

【0050】また、この実施の形態1において、データ
ブロック内のデータを初期化する場合、それに対応する
チェックワードdata〔j〕は以下の式で求められ
る。
In the first embodiment, when data in a data block is initialized, a corresponding check word data [j] is obtained by the following equation.

【0051】[0051]

【数12】 (Equation 12)

【0052】また、この実施の形態1におけるデータチ
ェック方法でデータが正当であると保証されるブロック
で、任意の位置kのデータを更新する場合には、以下の
式で求められる値data’〔j〕にチェックワードを
更新し、新データdata’〔k〕にデータを更新すれ
ばよい。
When updating data at an arbitrary position k in a block whose data is guaranteed to be valid by the data check method according to the first embodiment, the value data ′ [ j] and the data may be updated to new data data '[k].

【0053】[0053]

【数13】 (Equation 13)

【0054】なお、この実施の形態1においてk番目と
m番目のデータの入れ替わりを検出できない場合は、以
下の式を満たす場合に限られる。
In the first embodiment, the case where the exchange of the k-th data and the m-th data cannot be detected is limited to the case where the following equation is satisfied.

【0055】[0055]

【数14】 [Equation 14]

【0056】次に、具体例について、下記に示す。例え
ば、初期化処理において、データを”00001101
0101010”に設定する場合について説明する。ま
た、a=000とする。
Next, specific examples will be described below. For example, in the initialization processing, the data is set to “000010110”.
A description will be given of the case of setting 0101010 ″.

【0057】このデータを3バイトずつ分割すると、 0番目のデータ=000 1番目のデータ=011 2番目のデータ=010 3番目のデータ=101 4番目のデータ=010 となる。When this data is divided by 3 bytes, the following result is obtained: 0th data = 000 1st data = 011 1st data = 010 3rd data = 101 4th data = 010

【0058】この場合、例えばチェックワードの位置
を、j=5とすると、 data
In this case, if the position of the check word is j = 5, for example, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010 ... num [4] = 100

【0059】従って、この場合、 となる。Therefore, in this case, Becomes

【0060】従って、チェックワードは、 data〔5〕=〔000+{反転(110+000)+1}〕^101 ={000+(001+1)}^101 =(000+010)^101 =111 となる。Accordingly, the check word is data [5] = [000+ {inversion (110 + 000) +1}]} 101 = {000+ (001 + 1)} ^ 101 = (000 + 010) ^ 101 = 111.

【0061】従って、 dataTherefore, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 data〔5〕=111……num〔5〕=101……チェックワード[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010 ... num [4] = 100 data [5] = 111 ... num [5] = 101 ... checkword

【0062】従って、この場合、 dataTherefore, in this case, data

〔0〕^num[0] @num

〔0〕=000 data〔1〕^num〔1〕=010 data〔2〕^num〔2〕=000 data〔3〕^num〔3〕=110 data〔4〕^num〔4〕=110 data〔5〕^num〔5〕=010……チェックワード a=000 となる。[0] = 000 data [1] @num [1] = 010 data [2] @num [2] = 000 data [3] @num [3] = 110 data [4] @num [4] = 110 data [5] $ num [5] = 010 ... Check word a = 000.

【0063】この場合、前記のデータを読みだしたと
き、a=000であるため、装置はこのデータが正当で
あると判断する。
In this case, when aforesaid data is read out, since a = 000, the apparatus determines that this data is valid.

【0064】次に、このデータブロックで、任意の位置
のデータを変更した場合の動作について説明する。例え
ばnum〔2〕のデータdata〔2〕を ”01
0”から”000”に変更した場合、変更後のdat
a’〔2〕=000 となる。
Next, the operation when data at an arbitrary position is changed in this data block will be described. For example, the data data [2] of num [2] is set to "01".
When changing from “0” to “000”, the changed dat
a ′ [2] = 000.

【0065】従って、この場合、 dataTherefore, in this case, data

〔0〕 =000……num[0] = 000… num

〔0〕=000 data〔1〕 =011……num〔1〕=001 data’〔2〕=000……num〔2〕=010……変更後のデータ data〔3〕 =101……num〔3〕=011 data〔4〕 =010……num〔4〕=100[0] = 000 data [1] = 011... Num [1] = 001 data '[2] = 000... Num [2] = 010... Data after change data [3] = 101. 3] = 011 data [4] = 010... Num [4] = 100

【0066】従って、この場合、 dataTherefore, in this case, data

〔0〕 ^num[0] $ num

〔0〕=000 data〔1〕 ^num〔1〕=010 data’〔2〕^num〔2〕=010……変更後のデータ data〔3〕 ^num〔3〕=110 data〔4〕 ^num〔4〕=110 合計=000 となる。[0] = 000 data [1] ^ num [1] = 010 data '[2] ^ num [2] = 010... Data after change data [3] ^ num [3] = 110 data [4] 変 更num [4] = 110 Total = 000

【0067】従って、新チェックワードは、 data〔5〕=〔010+000+{反転(000^010)+1}〕^10 1 ={010+(101+1)}^101 =000^101 =101Therefore, the new check word is: data [5] = [010 + 000 + {inversion (000 ^ 010) +1}] ^ 10 1 = {010+ (101 + 1)} ^ 101 = 000 ^ 101 = 101

【0068】従って、 dataTherefore, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=000……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 data〔5〕=101……num〔5〕=101……新チェックワード[0] = 000 data [1] = 011 ... num [1] = 001 data [2] = 000 ... num [2] = 010 data [3] = 101 ... num [3] = 011 data [4 ] = 010 ... num [4] = 100 data [5] = 101 ... num [5] = 101 ... new check word

【0069】従って、この場合、 dataTherefore, in this case, data

〔0〕^num[0] @num

〔0〕=000 data〔1〕^num〔1〕=010 data〔2〕^num〔2〕=010 data〔3〕^num〔3〕=110 data〔4〕^num〔4〕=110 data〔5〕^num〔5〕=000……新チェックワード a=000 となる。[0] = 000 data [1] @num [1] = 010 data [2] @num [2] = 010 data [3] @num [3] = 110 data [4] @num [4] = 110 data [5] $ num [5] = 000 ... New check word a = 000.

【0070】このように、データを変更した場合、新チ
ェックワードをすべてのデータから求めるのではなく、
変更対象のデータを元に極めて簡単な演算で求めること
ができ、演算の高速化を図ることができる。
As described above, when the data is changed, a new check word is not obtained from all data, but
An extremely simple calculation can be performed based on the data to be changed, and the calculation can be speeded up.

【0071】次に、データの入れ替えが発生した場合の
動作について説明する。例えば、0番目のデータと2番
目のデータを入れ替えた場合、データ入れ替え前データ
は data
Next, the operation in the case where data exchange has occurred will be described. For example, when the 0th data and the 2nd data are exchanged, the data before the data exchange is data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 data〔5〕=111……num〔5〕=101……チェックワード であり、[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010 ... num [4] = 100 data [5] = 111 ... num [5] = 101 ... checkword

【0072】 dataThe data

〔0〕^num[0] @num

〔0〕=000 data〔1〕^num〔1〕=010 data〔2〕^num〔2〕=000 data〔3〕^num〔3〕=110 data〔4〕^num〔4〕=110 data〔5〕^num〔5〕=010……チェックワード a=000 であった。[0] = 000 data [1] @num [1] = 010 data [2] @num [2] = 000 data [3] @num [3] = 110 data [4] @num [4] = 110 data [5] $ num [5] = 010 ... Check word a = 000.

【0073】一方、データ入れ替え後のデータは dataOn the other hand, the data after the data exchange is data

〔0〕=010……num[0] = 010 ... num

〔0〕=000……入れ替え後のデータ data〔1〕=011……num〔1〕=001 data〔2〕=000……num〔2〕=010……入れ替え後のデータ data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 data〔5〕=111……num〔5〕=101……チェックワード となる。[0] = 000 ... Data after replacement data [1] = 011 ... num [1] = 001 data [2] = 000 ... num [2] = 010 ... Data after replacement data [3] = 101... Num [3] = 011 data [4] = 010... Num [4] = 100 data [5] = 111... Num [5] = 101.

【0074】従って、 dataTherefore, data

〔0〕^num[0] @num

〔0〕=010……入れ替え後のデータ data〔1〕^num〔1〕=010 data〔2〕^num〔2〕=010……入れ替え後のデータ data〔3〕^num〔3〕=110 data〔4〕^num〔4〕=110 data〔5〕^num〔5〕=010……チェックワード a=100 となる。[0] = 010 ... Data after replacement data [1] @num [1] = 010 data [2] @num [2] = 010 ... Data after replacement data [3] @num [3] = 110 data [4] @num [4] = 110 data [5] @num [5] = 010 ... check word a = 100.

【0075】このように、例えば、装置の誤動作などに
より、データブロック内のデータの格納位置の入れ替え
が発生すると、aの値すなわち総和が変わるので、この
aの値を調べることにより、データブロック内のデータ
の格納位置の入れ替わりを検出でき、対策を講じること
ができるようになる。
As described above, for example, when the storage position of the data in the data block is changed due to a malfunction of the device, the value of a, that is, the sum changes. Of the data storage position can be detected, and countermeasures can be taken.

【0076】以下に、図1に示す制御手段1のこの実施
の形態における動作をフローチャートを用いて説明す
る。図3はこの実施の形態における制御手段1のデータ
初期化の動作を示すフローチャートである。次に、デー
タ初期化の動作を図3に示すフローチャート動作を用い
て説明する。
The operation of the control means 1 shown in FIG. 1 in this embodiment will be described below with reference to a flowchart. FIG. 3 is a flowchart showing the data initialization operation of the control means 1 in this embodiment. Next, the operation of data initialization will be described using the flowchart operation shown in FIG.

【0077】まず、制御手段1はデータを分割して複数
のデータブロックを作成する(ステップS301)。次
に、制御手段1は各データブロックに異なるアドレスを
割り付ける(ステップS302)。次に、制御手段1は
各データブロックと対応するアドレスとの排他的論理和
により、複数の第2のデータブロックを作成する(ステ
ップS303)。
First, the control means 1 divides data to create a plurality of data blocks (step S301). Next, the control means 1 assigns a different address to each data block (step S302). Next, the control unit 1 creates a plurality of second data blocks by an exclusive OR of each data block and the corresponding address (step S303).

【0078】次に、制御手段1は第2のデータブロック
の総和とチェックワードのアドレスから数式(12)に
従ってチェックワードを作成する(ステップS30
4)。次に、制御手段1はデータブロックに上記のチェ
ックワードを挿入する(ステップS305)。次に、制
御手段1はデータを記憶手段2に書き込む(ステップS
306)。
Next, the control means 1 creates a check word from the sum of the second data block and the address of the check word in accordance with equation (12) (step S30).
4). Next, the control means 1 inserts the above-mentioned check word into the data block (step S305). Next, the control means 1 writes the data into the storage means 2 (step S
306).

【0079】また、図4はこの実施の形態における制御
手段1のデータチェックの動作を示すフローチャートで
ある。次に、データチェックの動作を図4に示すフロー
チャートを用いて説明する。
FIG. 4 is a flowchart showing a data check operation of the control means 1 in this embodiment. Next, the data check operation will be described with reference to the flowchart shown in FIG.

【0080】まず、制御手段1は初期化時と同じ方法で
データを分割して複数のデータブロックを作成し、各デ
ータブロックに異なるアドレスを割り付ける(ステップ
S401)。次に、制御手段1はデータブロックとアド
レスの排他的論理和により、第3のデータブロックを作
成する(ステップS402)。次に、制御手段1はチェ
ックワードとアドレスの排他的論理和により第2チェッ
クワードを作成する(ステップS403)。
First, the control means 1 divides data by the same method as at initialization to create a plurality of data blocks, and assigns different addresses to each data block (step S401). Next, the control means 1 creates a third data block by the exclusive OR of the data block and the address (step S402). Next, the control means 1 creates a second check word by the exclusive OR of the check word and the address (step S403).

【0081】次に、制御手段1は第3のデータブロック
の全てと第2チェックワードとの総和をとることによ
り、第4のデータブロックを作成する(ステップS40
4)。次に、制御手段1は第4のデータブロックと予め
決めてある値を比較し(ステップS405)、一致した
らデータが正常であると判断する(ステップS40
6)。また、ステップS405の比較において、不一致
であれば、データ異常であると判断する(ステップS4
07)。
Next, the control means 1 creates a fourth data block by calculating the sum of all the third data blocks and the second check word (step S40).
4). Next, the control means 1 compares the fourth data block with a predetermined value (step S405), and if they match, determines that the data is normal (step S40).
6). If the comparisons in step S405 do not match, it is determined that the data is abnormal (step S4).
07).

【0082】また、図5はこの実施の形態における制御
手段1のデータ更新処理の動作を示すフローチャートで
ある。次に、データ更新処理の動作を図5に示すフロー
チャート動作を用いて説明する。
FIG. 5 is a flow chart showing the operation of the data updating process of the control means 1 in this embodiment. Next, the operation of the data update process will be described using the flowchart operation shown in FIG.

【0083】まず、制御手段1は初期化時と同じ方法で
データを分割して複数のデータブロックを作成し、各デ
ータブロックに異なるアドレスを割り付ける(ステップ
S501)。次に、制御手段1はデータ更新前のチェッ
クワードと対応するアドレスの排他的論理和により、第
1の中間データを作成する(ステップS502)。次
に、制御手段1はデータ更新前のデータブロックと対応
するアドレスの排他的論理和により第2の中間データを
作成する(ステップS503)。
First, the control means 1 creates a plurality of data blocks by dividing data in the same manner as in the initialization, and assigns different addresses to each data block (step S501). Next, the control means 1 creates first intermediate data by exclusive ORing the check word before data update and the address corresponding to the check word (step S502). Next, the control means 1 creates the second intermediate data by the exclusive OR of the data block before the data update and the address corresponding to the data block (step S503).

【0084】次に、制御手段1はデータ更新後のデータ
ブロックと対応するアドレスの排他的論理和により、第
3の中間データを作成する(ステップS504)。上記
第1〜第3の中間データとチェックワードのアドレスを
元に数式(13)に従って更新後のチェックワードを作
成する(ステップS505)。次に、制御手段1は更新
後のデータブロックとチェックワードを記憶手段2に書
き込む(ステップS506)。
Next, the control means 1 creates third intermediate data by exclusive-ORing the address corresponding to the updated data block with the data block (step S504). Based on the first to third intermediate data and the address of the check word, an updated check word is created according to equation (13) (step S505). Next, the control means 1 writes the updated data block and check word into the storage means 2 (step S506).

【0085】実施の形態2.また、図6はこの発明に係
るデータチェック方法の別の実施の形態を示す説明図で
ある。次に、図6に示すデータチェック方法を説明す
る。図6に示すように、チェック対象となるブロックの
データをある単位の長さ(例えば2バイト)に区切り、
n個の計算単位に分割する。それらのデータをdata
〔k〕(0≦k≦n−1)とする。
Embodiment 2 FIG. 6 is an explanatory diagram showing another embodiment of the data check method according to the present invention. Next, the data check method shown in FIG. 6 will be described. As shown in FIG. 6, the data of the block to be checked is divided into unit lengths (for example, 2 bytes).
Divide into n calculation units. Data of those data
[K] (0 ≦ k ≦ n−1).

【0086】また、各計算単位data〔k〕のブロッ
ク内における相対位置を示す数列をnum〔k〕(0≦
k≦n−1)と定義する。この数列num〔k〕の1周
期は計算単位の長さ、例えば2バイトで示すことのでき
る数以上で、かつ、計算単位の個数以下であれば、デー
タ順序の反転を検出できる。簡単にはnum〔k〕=k
とすればよいが他の数列でもよい。また、チェックワー
ドを格納する位置をjとし、data〔j〕にチェック
ワードを格納するものとする。
A sequence indicating the relative position of each calculation unit data [k] in the block is represented by num [k] (0 ≦
k ≦ n−1). If one cycle of the sequence num [k] is equal to or more than the length of a calculation unit, for example, a number that can be represented by 2 bytes, and is equal to or less than the number of calculation units, the inversion of the data order can be detected. Num [k] = k
However, another sequence may be used. The position where the check word is stored is j, and the check word is stored in data [j].

【0087】この実施の形態2では以下の式が成立する
場合にブロック内のデータが正当であると判断する。
In the second embodiment, if the following equation is satisfied, it is determined that the data in the block is valid.

【0088】[0088]

【数15】 (Equation 15)

【0089】この式においてaは定数であり、例えばa
=A5A5hとすればよい。
In this equation, a is a constant.
= A5A5h.

【0090】この実施の形態2において、ブロック内の
データを初期化する場合、それに対応するチェックワー
ドdata〔j〕は以下の式で求められる。
In the second embodiment, when data in a block is initialized, a corresponding check word data [j] is obtained by the following equation.

【0091】[0091]

【数16】 (Equation 16)

【0092】また、この実施の形態2におけるデータチ
ェック方法でデータが正当であると保証されるブロック
で、任意の位置kのデータを更新する場合には、以下の
式で求められる値data’〔j〕にチェックワードを
更新し、新データdata’〔k〕にデータを更新すれ
ばよい。
When updating data at an arbitrary position k in a block whose data is guaranteed to be valid by the data check method according to the second embodiment, the value data ′ [ j] and the data may be updated to new data data '[k].

【0093】[0093]

【数17】 [Equation 17]

【0094】なお、この実施の形態2においてk番目と
m番目のデータの入れ替わりを検出できない場合は、以
下の式を満たす場合に限られる。
In the second embodiment, when the switching of the k-th data and the m-th data cannot be detected, it is limited to the case where the following equation is satisfied.

【0095】[0095]

【数18】 (Equation 18)

【0096】次に、具体例について、下記に示す。例え
ば、初期化処理において、データを実施の形態1と同
じ”000011010101010”に設定し、水平
パリティチェックで各ビットが偶数となるようにチェッ
クワードを決める場合について説明する。この場合、水
平パリティa=010とする。
Next, specific examples are shown below. For example, a case will be described where, in the initialization processing, data is set to “000011010101010”, which is the same as in the first embodiment, and a check word is determined so that each bit becomes an even number in the horizontal parity check. In this case, the horizontal parity a is set to 010.

【0097】このデータを3バイトずつ分割すると、 0番目のデータ=000 1番目のデータ=011 2番目のデータ=010 3番目のデータ=101 4番目のデータ=010 となる。When this data is divided into 3 bytes, the following is obtained: 0th data = 000 1st data = 011 1st data = 010 3rd data = 101 4th data = 010

【0098】この場合、例えばチェックワードの位置
を、j=5とすると、 data
In this case, if the position of the check word is j = 5, for example, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010 ... num [4] = 100

【0099】従って、この場合、 となる。Therefore, in this case, Becomes

【0100】従って、チェックワードは、 data〔5〕={010^000^100^100^000^110}+ {反転101+1} =010^110+(010+1) =100+011 =111 となる。Therefore, the check word is data [5] = {010/000/100/100/000/110} + {inversion 101 + 1} = 010/110 + (010 + 1) = 100 + 011 = 111

【0101】従って、 dataTherefore, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 data〔5〕=111……num〔5〕=101……チェックワード[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010 ... num [4] = 100 data [5] = 111 ... num [5] = 101 ... checkword

【0102】従って、この場合、 dataTherefore, in this case, data

〔0〕+num[0] + num

〔0〕=000 data〔1〕+num〔1〕=100 data〔2〕+num〔2〕=100 data〔3〕+num〔3〕=000 data〔4〕+num〔4〕=110 data〔5〕+num〔5〕=100……チェックワード a=010 となる。[0] = 000 data [1] + num [1] = 100 data [2] + num [2] = 100 data [3] + num [3] = 000 data [4] + num [4] = 110 data [5] + num [5] = 100... Check word a = 010.

【0103】この場合、前記のデータを読みだしたと
き、a=010であれば、装置はこのデータが正当であ
ると判断する。
In this case, when the data is read out, if a = 010, the apparatus determines that the data is valid.

【0104】次に、このデータブロックで、任意の位置
のデータを変更した場合の動作について説明する。例え
ば、num〔2〕のデータdata〔2〕を ”01
0”から”000” に変更した場合、変更後のdat
a’〔2〕=000 となる。
Next, the operation when data at an arbitrary position is changed in this data block will be described. For example, the data data [2] of num [2] is changed to “01”.
When changing from “0” to “000”, the changed dat
a ′ [2] = 000.

【0105】従って、この場合、 dataTherefore, in this case, data

〔0〕 =000……num[0] = 000… num

〔0〕=000 data〔1〕 =011……num〔1〕=001 data’〔2〕=000……num〔2〕=010……変更後のデータ data〔3〕 =101……num〔3〕=011 data〔4〕 =010……num〔4〕=100[0] = 000 data [1] = 011... Num [1] = 001 data '[2] = 000... Num [2] = 010... Data after change data [3] = 101. 3] = 011 data [4] = 010... Num [4] = 100

【0106】従って、この場合、 dataTherefore, in this case, data

〔0〕 +num[0] + num

〔0〕=000 data〔1〕 +num〔1〕=100 data’〔2〕+num〔2〕=010……変更後のデータ data〔3〕 +num〔3〕=000 data〔4〕 +num〔4〕=110 EXOR=000 となる。[0] = 000 data [1] + num [1] = 100 data '[2] + num [2] = 010 ... changed data data [3] + num [3] = 000 data [4] + num [4] = 110 EXOR = 000.

【0107】従って、新チェックワードは、 data〔5〕={100^010^100}+{反転101+1} =010+(010+1) =010+011 =101 となる。Accordingly, the new check word is data [5] = {100 {010} 100} + {inversion 101 + 1} = 010 + (010 + 1) = 010 + 011 = 101.

【0108】従って、 dataTherefore, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=000……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 data〔5〕=101……num〔5〕=101……新チェックワード[0] = 000 data [1] = 011 ... num [1] = 001 data [2] = 000 ... num [2] = 010 data [3] = 101 ... num [3] = 011 data [4 ] = 010 ... num [4] = 100 data [5] = 101 ... num [5] = 101 ... new check word

【0109】従って、この場合、 dataTherefore, in this case, data

〔0〕+num[0] + num

〔0〕=000 data〔1〕+num〔1〕=100 data〔2〕+num〔2〕=010 data〔3〕+num〔3〕=000 data〔4〕+num〔4〕=110 data〔5〕+num〔5〕=010……新チェックワード a=010 となる。[0] = 000 data [1] + num [1] = 100 data [2] + num [2] = 010 data [3] + num [3] = 000 data [4] + num [4] = 110 data [5] + num [5] = 010 ... new check word a = 010

【0110】このように、データを変更した場合、新チ
ェックワードをすべてのデータから求めるのではなく、
変更対象のデータを元に極めて簡単な演算で求めること
ができ、演算の高速化を図ることができる。
As described above, when data is changed, a new check word is not obtained from all data, but
An extremely simple calculation can be performed based on the data to be changed, and the calculation can be speeded up.

【0111】次に、データの入れ替えが発生した場合の
動作について説明する。例えば、0番目のデータと2番
目のデータを入れ替えた場合、データ入れ替え前データ
は data
Next, the operation in the case where data exchange has occurred will be described. For example, when the 0th data and the 2nd data are exchanged, the data before the data exchange is data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 data〔5〕=111……num〔5〕=101……チェックワード であり、[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010 ... num [4] = 100 data [5] = 111 ... num [5] = 101 ... checkword

【0112】 data[0112] data

〔0〕+num[0] + num

〔0〕=000 data〔1〕+num〔1〕=100 data〔2〕+num〔2〕=100 data〔3〕+num〔3〕=000 data〔4〕+num〔4〕=110 data〔5〕+num〔5〕=100……チェックワード a=010 であった。[0] = 000 data [1] + num [1] = 100 data [2] + num [2] = 100 data [3] + num [3] = 000 data [4] + num [4] = 110 data [5] + num [5] = 100 The check word a = 010.

【0113】一方、データ入れ替え後のデータは dataOn the other hand, the data after the data exchange is data

〔0〕=010……num[0] = 010 ... num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=000……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 data〔5〕=111……num〔5〕=101……チェックワード となる。なお、チェックワードは以前のままである。[0] = 000 data [1] = 011 ... num [1] = 001 data [2] = 000 ... num [2] = 010 data [3] = 101 ... num [3] = 011 data [4 ] = 010 ... num [4] = 100 data [5] = 111 ... num [5] = 101 ... check word. Note that the check word is the same as before.

【0114】従って、 dataTherefore, data

〔0〕+num[0] + num

〔0〕=010 data〔1〕+num〔1〕=100 data〔2〕+num〔2〕=010 data〔3〕+num〔3〕=000 data〔4〕+num〔4〕=110 data〔5〕+num〔5〕=100……チェックワード a=110 となる。[0] = 010 data [1] + num [1] = 100 data [2] + num [2] = 010 data [3] + num [3] = 000 data [4] + num [4] = 110 data [5] + num [5] = 100... Check word a = 110.

【0115】このように、例えば、装置の誤動作などに
より、データブロック内のデータの格納位置の入れ替え
が発生すると、aの値すなわち排他的論理和(EXO
R)をとった値の水平パリティの値が変わるので、この
aの値を調べることにより、データブロック内のデータ
の格納位置の入れ替わりを検出でき、対策を講じること
ができるようになる。
As described above, for example, when the data storage position in the data block is switched due to a malfunction of the device, the value of a, that is, the exclusive OR (EXO)
Since the value of the horizontal parity of the value obtained by R) changes, by examining the value of a, it is possible to detect the change of the storage position of the data in the data block, and to take measures.

【0116】以下に、図1に示す制御手段1のこの実施
の形態における動作をフローチャートを用いて説明す
る。図7はこの実施の形態における制御手段1のデータ
初期化の動作を示すフローチャートである。次に、デー
タ初期化の動作を図7に示すフローチャート動作を用い
て説明する。
The operation of the control means 1 shown in FIG. 1 in this embodiment will be described below with reference to a flowchart. FIG. 7 is a flowchart showing the data initialization operation of the control means 1 in this embodiment. Next, the operation of data initialization will be described using the flowchart operation shown in FIG.

【0117】まず、制御手段1はデータを分割して複数
のデータブロックを作成する(ステップS701)。次
に、制御手段1は各データブロックに異なるアドレスを
割り付ける(ステップS702)。次に、制御手段1は
各データブロックに、対応するアドレスを加算すること
により、複数の第2のデータブロックを作成する(ステ
ップS703)。次に、制御手段1は複数の第2のデー
タブロックの総てに対して各々の間で排他的論理和をと
ることにより、第3のデータブロックを作成する(ステ
ップS704)。
First, the control means 1 divides data to create a plurality of data blocks (step S701). Next, the control means 1 assigns a different address to each data block (step S702). Next, the control unit 1 creates a plurality of second data blocks by adding a corresponding address to each data block (step S703). Next, the control means 1 creates a third data block by performing an exclusive OR operation on all of the plurality of second data blocks (step S704).

【0118】次に、制御手段1は第3のデータブロック
と予め決めてある値との排他的論理和をとって、第4の
データブロックを作成する(ステップS705)。次
に、制御手段1は第4のデータブロックとチェックワー
ドのアドレスから数式(16)に従ってチェックワード
を作成する(ステップS706)。次に、制御手段1は
上記チェックワードをデータブロックに挿入する(ステ
ップS707)。次に、制御手段1はチェックワードと
データブロックから成るデータを記憶手段2に書き込む
(ステップS708)。
Next, the control means 1 performs an exclusive OR operation on the third data block and a predetermined value to create a fourth data block (step S705). Next, the control means 1 creates a check word from the address of the fourth data block and the check word according to equation (16) (step S706). Next, the control means 1 inserts the check word into the data block (step S707). Next, the control unit 1 writes the data including the check word and the data block into the storage unit 2 (step S708).

【0119】また、図8はこの実施の形態における制御
手段1のデータチェックの動作を示すフローチャートで
ある。次に、データチェックの動作を図8に示すフロー
チャート動作を用いて説明する。
FIG. 8 is a flowchart showing the data check operation of the control means 1 in this embodiment. Next, the data check operation will be described using the flowchart operation shown in FIG.

【0120】まず、制御手段1は初期化時と同じ方法で
データを分割して複数のデータブロックを作成し、各デ
ータブロックに異なるアドレスを割り付ける(ステップ
S801)。次に、制御手段1は各データブロックに、
対応するアドレスを加算することにより、複数の第5の
データブロックを作成する(ステップS802)。次
に、制御手段1はチェックワードに、対応するアドレス
を加算することにより、第2のチェックワードを作成す
る(ステップS803)。
First, the control means 1 divides data by the same method as at the time of initialization to create a plurality of data blocks, and assigns different addresses to each data block (step S801). Next, the control means 1 assigns
A plurality of fifth data blocks are created by adding the corresponding addresses (step S802). Next, the control means 1 creates a second check word by adding the corresponding address to the check word (step S803).

【0121】次に、制御手段1は第5のデータブロック
の全てと第2チェックワードとの排他的論理和をとるこ
とにより、第6のデータブロックを作成する(ステップ
S804)。次に、制御手段1は第6のデータブロック
と予め決めてある値を比較し(ステップS805)、一
致したらデータが正常であると判断する(ステップS8
06)。また、ステップS805の比較において、不一
致であれば、データ異常であると判断する(ステップS
807)。
Next, the control means 1 creates the sixth data block by taking the exclusive OR of all of the fifth data block and the second check word (step S804). Next, the control means 1 compares the sixth data block with a predetermined value (step S805), and if they match, determines that the data is normal (step S8).
06). If the comparisons in step S805 do not match, it is determined that the data is abnormal (step S805).
807).

【0122】また、図9はこの実施の形態における制御
手段1のデータ更新処理の動作を示すフローチャートで
ある。次に、データ更新処理の動作を図9に示すフロー
チャートを用いて説明する。
FIG. 9 is a flow chart showing the operation of the data updating process of the control means 1 in this embodiment. Next, the operation of the data update process will be described with reference to the flowchart shown in FIG.

【0123】まず、制御手段1は初期化時と同じ方法で
データを分割して複数のデータブロックを作成し、各デ
ータブロックに異なるアドレスを割り付ける(ステップ
S901)。次に、制御手段1はデータ更新前のチェッ
クワードに対応するアドレスを加算することにより、第
1の中間データを作成する(ステップS902)。次
に、制御手段1はデータ更新前のデータブロックに対応
するアドレスを加算することにより第2の中間データを
作成する(ステップS903)。
First, the control means 1 divides data by the same method as at the time of initialization to create a plurality of data blocks, and assigns different addresses to each data block (step S901). Next, the control unit 1 creates first intermediate data by adding an address corresponding to the check word before data update (step S902). Next, the control unit 1 creates the second intermediate data by adding the address corresponding to the data block before the data update (step S903).

【0124】次に、制御手段1はデータ更新後のデータ
ブロックに対応するアドレスを加算することにより、第
3の中間データを作成する(ステップS904)。次
に、制御手段1は上記第1〜第3の中間データとチェッ
クワードのアドレスを元に数式(17)に基づいて更新
後のチェックワードを作成する(ステップS905)。
次に、制御手段1は更新後のデータブロックとチェック
ワードを記憶手段2に書き込む(ステップS906)。
Next, the control means 1 creates third intermediate data by adding an address corresponding to the updated data block (step S904). Next, the control means 1 creates an updated check word based on the equation (17) based on the first to third intermediate data and the address of the check word (step S905).
Next, the control unit 1 writes the updated data block and check word into the storage unit 2 (step S906).

【0125】実施の形態3.図10はこの発明に係るデ
ータチェック方法の別の実施の形態を示す説明図であ
る。図10に示すようにチェック対象となるブロックの
データをある単位の長さ(例えば2バイト)に区切り、
n個の計算単位に分割する。それらのデータをdata
〔k〕(0≦k≦n−1)とする。また、各計算単位d
ata〔k〕のブロック内における相対位置を示す数列
をnum〔k〕(0≦k≦n−1)と定義する。
Embodiment 3 FIG. 10 is an explanatory diagram showing another embodiment of the data check method according to the present invention. As shown in FIG. 10, the data of the block to be checked is divided into unit lengths (for example, 2 bytes).
Divide into n calculation units. Data of those data
[K] (0 ≦ k ≦ n−1). Also, each calculation unit d
A sequence indicating the relative position of ata [k] in the block is defined as num [k] (0 ≦ k ≦ n−1).

【0126】この数列num〔k〕の周期は、前記の分
割された計算単位の個数n以上であることを前提とす
る。また、この実施の形態ではnum〔k〕として、例
えば、num〔k〕=kという数列を用いるが、他の数
列を用いてもよい。また、チェック対象のブロックの領
域の外にチェックワードを格納するものとし、ここでは
checkwordとしておく。
It is assumed that the period of the sequence num [k] is equal to or greater than the number n of the divided calculation units. Further, in this embodiment, for example, a sequence of num [k] = k is used as num [k], but another sequence may be used. The check word is stored outside the area of the block to be checked, and is set to checkword here.

【0127】この時に、この実施の形態3 では以下の
式が成立する場合にブロック内のデータが正当であると
判断する。
At this time, in the third embodiment, if the following equation is satisfied, it is determined that the data in the block is valid.

【0128】[0128]

【数19】 [Equation 19]

【0129】また、この実施の形態3におけるデータチ
ェック方法でデータが正当であると保証されるブロック
で、任意の位置kのデータを更新する場合には、以下の
式で求められる値checkword’にチェックワー
ドを更新し、新データdata’〔k〕にデータを更新
すればよい。
When updating data at an arbitrary position k in a block whose data is guaranteed to be valid by the data check method according to the third embodiment, the value checkword 'obtained by the following equation is used. The check word may be updated, and the data may be updated to new data data '[k].

【0130】[0130]

【数20】 (Equation 20)

【0131】次に、具体例について、下記に示す。例え
ば、初期化処理において、データを実施の形態1と同
じ”000011010101010”に設定し、デー
タの総和をチェックワードとする場合について説明す
る。
Next, specific examples will be described below. For example, a case will be described where, in the initialization processing, the data is set to “00001101010101010” as in the first embodiment, and the sum of the data is used as a check word.

【0132】このデータを3バイトずつ分割すると、 0番目のデータ=000 1番目のデータ=011 2番目のデータ=010 3番目のデータ=101 4番目のデータ=010 となる。When this data is divided by 3 bytes, the following result is obtained: 0th data = 000 1st data = 011 1st data = 010 3rd data = 101 4th data = 010

【0133】この場合、 dataIn this case, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010 ... num [4] = 100

【0134】従って、この場合、 dataTherefore, in this case, data

〔0〕^num[0] @num

〔0〕=000 data〔1〕^num〔1〕=010 data〔2〕^num〔2〕=000 data〔3〕^num〔3〕=110 data〔4〕^num〔4〕=110 となる。従って、これらのデータの総和の下位3ビット
であるチェックワードは チェックワード =110 となる。
[0] = 000 data [1] @num [1] = 010 data [2] @num [2] = 000 data [3] @num [3] = 110 data [4] @num [4] = 110 Become. Therefore, the check word that is the lower 3 bits of the sum of these data is check word = 110.

【0135】次に、このデータブロックで、任意の位置
のデータを変更した場合の動作について説明する。例え
ば、num〔2〕のデータdata〔2〕を ”01
0”から”000” に変更した場合、変更後のdat
a’〔2〕=000 となる。
Next, an operation when data at an arbitrary position is changed in this data block will be described. For example, the data data [2] of num [2] is changed to “01”.
When changing from “0” to “000”, the changed dat
a ′ [2] = 000.

【0136】変更前のデータは、 dataThe data before the change is data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 であった。[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010... Num [4] = 100.

【0137】従って、この場合、 dataTherefore, in this case, data

〔0〕^num[0] @num

〔0〕=000 data〔1〕^num〔1〕=010 data〔2〕^num〔2〕=000 data〔3〕^num〔3〕=110 data〔4〕^num〔4〕=110 となる。従って、これらのデータの総和の下位3ビット
であるチェックワードは チェックワード =110 となる。
[0] = 000 data [1] @num [1] = 010 data [2] @num [2] = 000 data [3] @num [3] = 110 data [4] @num [4] = 110 Become. Therefore, the check word that is the lower 3 bits of the sum of these data is check word = 110.

【0138】また、変更後のデータは dataThe data after the change is data

〔0〕 =000……num[0] = 000… num

〔0〕=000 data〔1〕 =011……num〔1〕=001 data’〔2〕=000……num〔2〕=010……変更後のデータ data〔3〕 =101……num〔3〕=011 data〔4〕 =010……num〔4〕=100[0] = 000 data [1] = 011... Num [1] = 001 data '[2] = 000... Num [2] = 010... Data after change data [3] = 101. 3] = 011 data [4] = 010... Num [4] = 100

【0139】従って、この場合、 dataTherefore, in this case, data

〔0〕 ^num[0] $ num

〔0〕=000 data〔1〕 ^num〔1〕=010 data’〔2〕^num〔2〕=010……変更後のデータ data〔3〕 ^num〔3〕=110 data〔4〕 ^num〔4〕=110 となる。従って、これらのデータの総和の下位3ビット
であるチェックワードは チェックワード =000 となる。
[0] = 000 data [1] ^ num [1] = 010 data '[2] ^ num [2] = 010... Data after change data [3] ^ num [3] = 110 data [4] 変 更num [4] = 110. Therefore, the check word that is the lower 3 bits of the sum of these data is check word = 000.

【0140】この実施の形態では上記のデータ変更後の
チェックワードを以下の演算により算出する。 変更後のチェックワード=010+(反転000+1)+110 =010+(111+1)+110 =010+000+110 =000
In this embodiment, the check word after the data change is calculated by the following operation. Check word after change = 010 + (inversion 000 + 1) + 110 = 010 + (111 + 1) + 110 = 010 + 000 + 110 = 000

【0141】このように、データを変更した場合、新チ
ェックワードをすべてのデータから求めるのではなく、
変更対象のデータを元に極めて簡単な演算で求めること
ができ、演算の高速化を図ることができる。
As described above, when data is changed, a new check word is not obtained from all data,
An extremely simple calculation can be performed based on the data to be changed, and the calculation can be speeded up.

【0142】次に、データの入れ替えを行った場合の動
作について説明する。例えば、0番目のデータと2番目
のデータを入れ替えた場合、データ入れ替え前データは data
Next, the operation when data exchange is performed will be described. For example, when the 0th data and the 2nd data are exchanged, the data before the data exchange is data

〔0〕=000……num[0] = 000… num

〔0〕=000……入れ替え対象のデータ data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010……入れ替え対象のデータ data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 であり、[0] = 000 ... Data to be replaced data [1] = 011 ... num [1] = 001 data [2] = 010 ... num [2] = 010 ... Data to be replaced data [3] = 101 ... num [3] = 011 data [4] = 010 ... num [4] = 100

【0143】 dataData

〔0〕^num[0] @num

〔0〕=000……入れ替え対象のデータ data〔1〕^num〔1〕=010 data〔2〕^num〔2〕=000……入れ替え対象のデータ data〔3〕^num〔3〕=110 data〔4〕^num〔4〕=110 であった。従って、これらのデータの総和の下位3ビッ
トであるチェックワードは チェックワード =110 となる。
[0] = 000 ... Data to be replaced data [1] @num [1] = 010 data [2] @num [2] = 000 ... Data to be replaced data [3] @num [3] = 110 data [4] ^ num [4] = 110 Therefore, the check word that is the lower 3 bits of the sum of these data is check word = 110.

【0144】一方、データ入れ替え後のデータは dataOn the other hand, the data after the data exchange is data

〔0〕=010……num[0] = 010 ... num

〔0〕=000……入れ替え後のデータ data〔1〕=011……num〔1〕=001 data〔2〕=000……num〔2〕=010……入れ替え後のデータ data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 となる。[0] = 000 ... Data after replacement data [1] = 011 ... num [1] = 001 data [2] = 000 ... num [2] = 010 ... Data after replacement data [3] = 101 ... num [3] = 011 data [4] = 010 ... num [4] = 100

【0145】従って、 dataTherefore, data

〔0〕^num[0] @num

〔0〕=010……入れ替え後のデータ data〔1〕^num〔1〕=010 data〔2〕^num〔2〕=010……入れ替え後のデータ data〔3〕^num〔3〕=110 data〔4〕^num〔4〕=110 となる。従って、これらのデータの総和の下位3ビット
であるチェックワードは チェックワード =010 となる。
[0] = 010 ... Data after replacement data [1] @num [1] = 010 data [2] @num [2] = 010 ... Data after replacement data [3] @num [3] = 110 data [4] ^ num [4] = 110. Therefore, the check word that is the lower 3 bits of the sum of these data is check word = 010.

【0146】このように、例えば、装置の誤動作などに
より、データブロック内のデータの格納位置の入れ替え
が発生すると、チェックワードすなわち各データの総和
が変わるので、このチェックワードを調べることによ
り、データブロック内のデータの格納位置の入れ替わり
を検出でき、対策を講じることができるようになる。
As described above, for example, when the storage position of the data in the data block is changed due to a malfunction of the device, the check word, that is, the sum of each data changes. It is possible to detect a change in the storage position of the data in the device, and take measures.

【0147】以下に、図1に示す制御手段1のこの実施
の形態における動作をフローチャートを用いて説明す
る。図11はこの実施の形態における制御手段1のデー
タ初期化の動作を示すフローチャートである。次に、デ
ータ初期化の動作を図11に示すフローチャートを用い
て説明する。
The operation of the control means 1 shown in FIG. 1 in this embodiment will be described below with reference to a flowchart. FIG. 11 is a flowchart showing the data initialization operation of the control means 1 in this embodiment. Next, the data initialization operation will be described with reference to the flowchart shown in FIG.

【0148】まず、制御手段1はデータを分割して複数
のデータブロックを作成する(ステップS1101)。
次に、制御手段1は各データブロックに異なるアドレス
を割り付ける(ステップS1102)。次に、制御手段
1は各データブロックと対応するアドレスとの排他的論
理和により、複数の第2のデータブロックを作成する
(ステップS1103)。
First, the control means 1 divides data to create a plurality of data blocks (step S1101).
Next, the control means 1 assigns a different address to each data block (step S1102). Next, the control unit 1 creates a plurality of second data blocks by an exclusive OR of each data block and the corresponding address (step S1103).

【0149】次に、制御手段1はデータを記憶手段2に
書き込む(ステップS1104)。次に、制御手段1は
第2のデータブロックの総和をとってチェックワードを
作成する(ステップS1105)。次に、制御手段1は
チェックワードを記憶手段2に書き込む(ステップS1
106)。
Next, the control means 1 writes the data into the storage means 2 (step S1104). Next, the control means 1 creates a check word by summing up the second data blocks (step S1105). Next, the control means 1 writes the check word into the storage means 2 (step S1).
106).

【0150】また、図12はこの実施の形態における制
御手段1のデータチェックの動作を示すフローチャート
である。次に、データチェックの動作を図12に示すフ
ローチャートを用いて説明する。
FIG. 12 is a flowchart showing the data check operation of the control means 1 in this embodiment. Next, the data check operation will be described with reference to the flowchart shown in FIG.

【0151】まず、制御手段1は初期化時と同じ方法で
データを分割して複数のデータブロックを作成し、各デ
ータブロックに異なるアドレスを割り付ける(ステップ
S1201)。次に、制御手段1はデータブロックと対
応するアドレスの排他的論理和により、第3のデータブ
ロックを作成する(ステップS1202)。次に、制御
手段1は第3のデータブロックの総和をとることによ
り、第4のデータブロックを作成する(ステップS12
03)。
First, the control means 1 creates a plurality of data blocks by dividing data in the same manner as in the initialization, and assigns a different address to each data block (step S1201). Next, the control means 1 creates a third data block by exclusive-ORing the address corresponding to the data block (step S1202). Next, the control means 1 creates a fourth data block by summing up the third data block (step S12).
03).

【0152】次に、制御手段1は第4のデータブロック
と初期化時に記憶手段に格納してあるチェックワードと
を比較し(ステップS1204)、一致したらデータが
正常であると判断する(ステップS1205)。また、
ステップS1204の比較において、不一致であれば、
データ異常であると判断する(ステップS1206)。
Next, the control means 1 compares the fourth data block with the check word stored in the storage means at the time of initialization (step S1204), and if they match, determines that the data is normal (step S1205). ). Also,
If the comparisons in step S1204 do not match,
It is determined that the data is abnormal (step S1206).

【0153】また、図13はこの実施の形態における制
御手段1のデータ更新処理の動作を示すフローチャート
である。次に、データ更新処理の動作を図13に示すフ
ローチャートを用いて説明する。
FIG. 13 is a flowchart showing the operation of the data updating process of the control means 1 in this embodiment. Next, the operation of the data update process will be described with reference to the flowchart shown in FIG.

【0154】まず、制御手段1は初期化時と同じ方法で
データを分割して複数のデータブロックを作成し、各デ
ータブロックに異なるアドレスを割り付ける(ステップ
S1301)。次に、制御手段1はデータ更新後のデー
タブロックと対応するアドレスとの排他的論理和によ
り、第1の中間データを作成する(ステップS130
2)。
First, the control means 1 divides data by the same method as at the time of initialization to create a plurality of data blocks, and assigns different addresses to each data block (step S1301). Next, the control means 1 creates first intermediate data by exclusive-ORing the updated data block with the corresponding address (step S130).
2).

【0155】次に、制御手段1はデータ更新前のデータ
ブロックと対応するアドレスとの排他的論理和により、
第2の中間データを作成する(ステップS1303)。
次に、制御手段1は第1、第2の中間データとチェック
ワードのアドレスを元に数式(20)に従って更新後の
チェックワードを作成する(ステップS1304)。次
に、制御手段1は更新後のデータブロックとチェックワ
ードを記憶手段2に書き込む(ステップS1305)。
Next, the control means 1 calculates the exclusive OR of the data block before the data update and the corresponding address.
The second intermediate data is created (step S1303).
Next, the control means 1 creates an updated check word according to the equation (20) based on the first and second intermediate data and the address of the check word (step S1304). Next, the control means 1 writes the updated data block and check word into the storage means 2 (step S1305).

【0156】実施の形態4.図14はこの発明に係るデ
ータチェック方法の別の実施の形態を示す説明図であ
る。図14に示すようにチェック対象となるブロックの
データをある単位の長さ(例えば2バイト)に区切り、
n個の計算単位に分割する。それらのデータをdata
〔k〕(0≦k≦n−1)とする。また、各計算単位d
ata〔k〕のブロック内における相対位置を示す数列
をnum〔k〕(0≦k≦n−1)と定義する。
Embodiment 4 FIG. 14 is an explanatory diagram showing another embodiment of the data check method according to the present invention. As shown in FIG. 14, the data of the block to be checked is divided into unit lengths (for example, 2 bytes).
Divide into n calculation units. Data of those data
[K] (0 ≦ k ≦ n−1). Also, each calculation unit d
A sequence indicating the relative position of ata [k] in the block is defined as num [k] (0 ≦ k ≦ n−1).

【0157】この数列num〔k〕の周期は、前記の分
割された計算単位の個数n以上であることを前提とす
る。また、この実施の形態ではnum〔k〕として、例
えば、num〔k〕=kという数列を用いるが、他の数
列を用いてもよい。また、チェック対象のブロックの領
域の外にチェックワードを格納するものとし、ここでは
checkwordとしておく。
It is assumed that the cycle of the sequence num [k] is equal to or greater than the number n of the divided calculation units. Further, in this embodiment, for example, a sequence of num [k] = k is used as num [k], but another sequence may be used. The check word is stored outside the area of the block to be checked, and is set to checkword here.

【0158】この実施の形態4では以下の式が成立する
場合にブロック内のデータが正当であると判断する。
In the fourth embodiment, when the following equation is satisfied, it is determined that the data in the block is valid.

【0159】[0159]

【数21】 (Equation 21)

【0160】また、この実施の形態4におけるデータチ
ェック方法でデータが正当であると保証されるブロック
で、任意の位置kのデータを更新する場合には、以下の
式で求められる値checkword’にチェックワー
ドを更新し、新データdata’〔k〕にデータを更新
すればよい。
When updating data at an arbitrary position k in a block whose data is guaranteed to be valid by the data check method according to the fourth embodiment, the value checkword 'obtained by the following equation is used. The check word may be updated, and the data may be updated to new data data '[k].

【0161】[0161]

【数22】 (Equation 22)

【0162】次に、具体例について、下記に示す。例え
ば、初期化処理において、データを実施の形態1と同
じ”000011010101010”に設定し、水平
パリティチェックで各ビットが偶数となるようにチェッ
クワードを決める場合について説明する。
Next, specific examples will be described below. For example, a case will be described where, in the initialization processing, data is set to “000011010101010”, which is the same as in the first embodiment, and a check word is determined so that each bit becomes an even number in the horizontal parity check.

【0163】このデータを3バイトずつ分割すると、 0番目のデータ=000 1番目のデータ=011 2番目のデータ=010 3番目のデータ=101 4番目のデータ=010 となる。When this data is divided into three bytes, the following is obtained: 0th data = 000 1st data = 011 1st data = 010 3rd data = 101 4th data = 010

【0164】この場合、 dataIn this case, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 である。[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010... Num [4] = 100.

【0165】従って、この場合、 dataTherefore, in this case, data

〔0〕+num[0] + num

〔0〕=000+000=000 data〔1〕+num〔1〕=011+001=100 data〔2〕+num〔2〕=010+010=100 data〔3〕+num〔3〕=101+011=000 data〔4〕+num〔4〕=010+100=110 となる。従って、これらのデータの排他的論理和をとっ
たチェックワードは チェックワード =110 となる。
[0] = 000 + 000 = 000 data [1] + num [1] = 011 + 001 = 100 data [2] + num [2] = 010 + 010 = 100 data [3] + num [3] = 101 + 011 = 000 data [4] + num [4 ] = 010 + 100 = 110. Therefore, the check word obtained by taking the exclusive OR of these data becomes check word = 110.

【0166】この実施の形態では上記のチェックワード
を以下の演算により算出する。 チェックワード=000^100^100^000^1
10=110
In this embodiment, the above-mentioned check word is calculated by the following calculation. Check word = 000/100/100/000/1
10 = 110

【0167】この場合、前記のデータを読みだしたと
き、チェックワード=110であれば、装置はこのデー
タが正当であると判断する。
In this case, when the data is read, if the check word is 110, the device determines that the data is valid.

【0168】次に、このデータブロックで、任意の位置
のデータを変更した場合の動作について説明する。例え
ば、num〔2〕のデータdata〔2〕を ”01
0”から”000” に変更した場合、変更後のdat
a’〔2〕=000 となる。
Next, the operation when data at an arbitrary position is changed in this data block will be described. For example, the data data [2] of num [2] is changed to “01”.
When changing from “0” to “000”, the changed dat
a ′ [2] = 000.

【0169】変更前のデータは、 dataThe data before the change is data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 であった。[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010... Num [4] = 100.

【0170】従って、 dataTherefore, data

〔0〕+num[0] + num

〔0〕=000 data〔1〕+num〔1〕=100 data〔2〕+num〔2〕=100……変更対象のデータ data〔3〕+num〔3〕=000 data〔4〕+num〔4〕=110 チェックワード =110 であった。[0] = 000 data [1] + num [1] = 100 data [2] + num [2] = 100... Data to be changed data [3] + num [3] = 000 data [4] + num [4] = 110 Check word = 110

【0171】また、変更後のデータは dataThe changed data is data

〔0〕 =000……num[0] = 000… num

〔0〕=000 data〔1〕 =011……num〔1〕=001 data’〔2〕=000……num〔2〕=010……変更後のデータ data〔3〕 =101……num〔3〕=011 data〔4〕 =010……num〔4〕=100 となる。[0] = 000 data [1] = 011... Num [1] = 001 data '[2] = 000... Num [2] = 010... Data after change data [3] = 101. 3] = 011 data [4] = 010... Num [4] = 100.

【0172】従って、この場合、 dataTherefore, in this case, data

〔0〕 +num[0] + num

〔0〕=000 data〔1〕 +num〔1〕=100 data’〔2〕+num〔2〕=010……変更後のデータ data〔3〕 +num〔3〕=000 data〔4〕 +num〔4〕=110 となる。従って、これらのデータの排他的論理和をとっ
たチェックワードは チェックワード =000 となる。
[0] = 000 data [1] + num [1] = 100 data '[2] + num [2] = 010 ... changed data data [3] + num [3] = 000 data [4] + num [4] = 110. Therefore, the check word obtained by taking the exclusive OR of these data is check word = 000.

【0173】この実施の形態では上記データ変更後のチ
ェックワードを以下の演算により算出する。 変更後のチェックワード=110^(010+010)^(000+010) =110^100^010 =000
In this embodiment, the check word after the data change is calculated by the following operation. Check word after change = 110 / (010 + 010) / (000 + 010) = 110/100/010 = 000

【0174】このように、データを変更した場合、新チ
ェックワードをすべてのデータから求めるのではなく、
変更対象のデータを元に極めて簡単な演算で求めること
ができ、演算の高速化を図ることができる。
As described above, when data is changed, a new check word is not obtained from all data,
An extremely simple calculation can be performed based on the data to be changed, and the calculation can be speeded up.

【0175】次に、データの入れ替えを行った場合の動
作について説明する。例えば、0番目のデータと2番目
のデータを入れ替えた場合、データ入れ替え前データは data
Next, the operation when data exchange is performed will be described. For example, when the 0th data and the 2nd data are exchanged, the data before the data exchange is data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=010……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 であり、[0] = 000 data [1] = 011... Num [1] = 001 data [2] = 010... Num [2] = 010 data [3] = 101... Num [3] = 011 data [4 ] = 010 ... num [4] = 100,

【0176】 であった。[0176] Met.

【0177】一方、データ入れ替え後のデータは dataOn the other hand, the data after data exchange is data

〔0〕=010……num[0] = 010 ... num

〔0〕=000 data〔1〕=011……num〔1〕=001 data〔2〕=000……num〔2〕=010 data〔3〕=101……num〔3〕=011 data〔4〕=010……num〔4〕=100 となる。[0] = 000 data [1] = 011 ... num [1] = 001 data [2] = 000 ... num [2] = 010 data [3] = 101 ... num [3] = 011 data [4 ] = 010... Num [4] = 100.

【0178】従って、 dataTherefore, data

〔0〕+num[0] + num

〔0〕=010 data〔1〕+num〔1〕=100 data〔2〕+num〔2〕=010 data〔3〕+num〔3〕=000 data〔4〕+num〔4〕=110 となる。これらのデータの排他的論理和をとったチェッ
クワードは チェックワード=010 となる。
[0] = 010 data [1] + num [1] = 100 data [2] + num [2] = 010 data [3] + num [3] = 000 data [4] + num [4] = 110. The check word obtained by taking the exclusive OR of these data is check word = 010.

【0179】このように、例えば、装置の誤動作などに
より、データブロック内のデータの格納位置の入れ替え
が発生すると、チェックワードすなわち各データの排他
的論理和をとった値が変わるので、このチェックワード
を調べることにより、データブロック内のデータの格納
位置の入れ替わりを検出でき、対策を講じることができ
るようになる。
As described above, for example, when the storage position of the data in the data block is changed due to a malfunction of the device, the check word, that is, the value obtained by taking the exclusive OR of each data changes. By examining, it is possible to detect a change in the storage position of the data in the data block, and take measures.

【0180】以下に、図1に示す制御手段1のこの実施
の形態における動作をフローチャートを用いて説明す
る。図15はこの実施の形態における制御手段1のデー
タ初期化の動作を示すフローチャートである。次に、デ
ータ初期化の動作を図15に示すフローチャートを用い
て説明する。
The operation of the control means 1 shown in FIG. 1 in this embodiment will be described below with reference to a flowchart. FIG. 15 is a flowchart showing the data initialization operation of the control means 1 in this embodiment. Next, the data initialization operation will be described with reference to the flowchart shown in FIG.

【0181】まず、制御手段1はデータを分割して複数
のデータブロックを作成する(ステップS1501)。
次に、制御手段1は各データブロックに異なるアドレス
を割り付ける(ステップS1502)。次に、制御手段
1は各データブロックに対応するアドレスを加算するこ
とにより、複数の第2のデータブロックを作成する(ス
テップS1503)。
First, the control means 1 divides data to create a plurality of data blocks (step S1501).
Next, the control means 1 assigns a different address to each data block (step S1502). Next, the control means 1 creates a plurality of second data blocks by adding the addresses corresponding to the respective data blocks (step S1503).

【0182】次に、制御手段1はデータを記憶手段2に
書き込む(ステップS1504)。次に、制御手段1は
総ての第2のデータブロックの排他的論理和をとってチ
ェックワードを作成する(ステップS1505)。次
に、制御手段1はチェックワードを記憶手段2に書き込
む(ステップS1506)。
Next, the control means 1 writes the data into the storage means 2 (step S1504). Next, the control means 1 creates a check word by taking the exclusive OR of all the second data blocks (step S1505). Next, the control unit 1 writes the check word into the storage unit 2 (Step S1506).

【0183】また、図16はこの実施の形態における制
御手段1のデータチェックの動作を示すフローチャート
である。次に、データチェックの動作を図16に示すフ
ローチャートを用いて説明する。
FIG. 16 is a flowchart showing a data check operation of the control means 1 in this embodiment. Next, the data check operation will be described with reference to the flowchart shown in FIG.

【0184】まず、制御手段1は初期化時と同じ方法で
データを分割して複数のデータブロックを作成し、各デ
ータブロックに異なるアドレスを割り付ける(ステップ
S1601)。次に、制御手段1はデータブロックに対
応するアドレスを加算することにより、第3のデータブ
ロックを作成する(ステップS1602)。次に、制御
手段1は第3のデータブロックの全ての排他的論理和を
とることにより、第4のデータブロックを作成する(ス
テップS1603)。
First, the control means 1 divides data by the same method as at the time of initialization, creates a plurality of data blocks, and assigns different addresses to each data block (step S1601). Next, the control unit 1 creates a third data block by adding an address corresponding to the data block (step S1602). Next, the control means 1 creates a fourth data block by taking the exclusive OR of all the third data blocks (step S1603).

【0185】次に、制御手段1は初期化時に記憶手段2
に格納したチェックワードを上記記憶手段2から読みだ
してこのチェックワードと第4のデータブロックの値と
を比較し(ステップS1604)、一致したらデータが
正常であると判断する(ステップS1605)。また、
ステップS1604の比較において、不一致であれば、
データ異常であると判断する(ステップS1606)。
Next, the control means 1 stores the memory means 2 at the time of initialization.
Is read from the storage means 2 and the check word is compared with the value of the fourth data block (step S1604). If they match, it is determined that the data is normal (step S1605). Also,
If the comparisons in step S1604 do not match,
It is determined that the data is abnormal (step S1606).

【0186】また、図17はこの実施の形態における制
御手段1のデータ更新処理の動作を示すフローチャート
である。次に、データ更新処理の動作を図17に示すフ
ローチャートを用いて説明する。
FIG. 17 is a flowchart showing the operation of the data updating process of the control means 1 in this embodiment. Next, the operation of the data update process will be described with reference to the flowchart shown in FIG.

【0187】まず、制御手段1は初期化時と同じ方法で
データを分割して複数のデータブロックを作成し、各デ
ータブロックに異なるアドレスを割り付ける(ステップ
S1701)。次に、制御手段1はデータ更新後のデー
タブロックに、対応するアドレスを加算することによ
り、第1の中間データを作成する(ステップS170
2)。次に、制御手段1はデータ更新前のデータブロッ
クに、対応するアドレスを加算することにより、第2の
中間データを作成する(ステップS1703)。
First, the control means 1 divides data by the same method as at the time of initialization to create a plurality of data blocks, and assigns different addresses to each data block (step S1701). Next, the control means 1 creates the first intermediate data by adding the corresponding address to the updated data block (step S170).
2). Next, the control unit 1 creates the second intermediate data by adding the corresponding address to the data block before the data update (step S1703).

【0188】次に、制御手段1は第1、第2の中間デー
タと更新前のチェックワードを元に数式(22)に従っ
て更新後のチェックワードを作成する(ステップS17
04)。次に、制御手段1は更新後のデータブロックと
チェックワードを記憶手段2に書き込む(ステップS1
705)。
Next, the control means 1 creates an updated check word according to the formula (22) based on the first and second intermediate data and the check word before update (step S17).
04). Next, the control means 1 writes the updated data block and check word into the storage means 2 (step S1).
705).

【0189】実施の形態5.また、実施の形態1におい
てメモリデバイスの故障等により全領域が0となった場
合、以下の式が成立する場合以外であれば、全領域が0
となったことを検出できる。
Embodiment 5 FIG. In the first embodiment, when the entire area becomes 0 due to a failure of the memory device or the like, the entire area becomes 0 unless the following equation is satisfied.
Can be detected.

【0190】[0190]

【数23】 (Equation 23)

【0191】例えば、この式が成立しないためには、a
=0である場合、nが4以上であればよい。
For example, in order that this equation does not hold, a
When = 0, n may be 4 or more.

【0192】次に、具体例について、下記に示す。例え
ば、初期化処理において、全データを”0000000
00000000”に設定する場合について説明する。
また、a=000とする。
Next, specific examples will be described below. For example, in the initialization process, all data is set to “00000000”.
00000000 "will be described.
Also, let a = 000.

【0193】このデータを3バイトずつ分割すると、 0番目のデータ=000 1番目のデータ=000 2番目のデータ=000 3番目のデータ=000 4番目のデータ=000 となる。When this data is divided into three bytes, the following is obtained: 0th data = 000 1st data = 000 2nd data = 000 3rd data = 000 4th data = 000

【0194】この場合、例えばチェックワードの位置
を、j=5とすると、 data
In this case, if the position of the check word is j = 5, for example, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=000……num〔1〕=001 data〔2〕=000……num〔2〕=010 data〔3〕=000……num〔3〕=011 data〔4〕=000……num〔4〕=100 となる。[0] = 000 data [1] = 000 ... num [1] = 001 data [2] = 000 ... num [2] = 010 data [3] = 000 ... num [3] = 011 data [4 ] = 000... Num [4] = 100.

【0195】従って、この場合、 となる。Therefore, in this case, Becomes

【0196】従って、チェックワードは、 data〔5〕=000+{反転(010+000)+1}^101 =000+{101+1}^101 =000+110^101 =011 となる。Accordingly, the check word is data [5] = 000 + {inverted (010 + 000) +1} 101 = 000 + {101 + 1} 101 = 000 + 110} 101 = 011.

【0197】従って、 data〔5〕^num〔5〕=011^101=11
0 となる。
Therefore, data [5] ^ num [5] = 011 ^ 101 = 11
It becomes 0.

【0198】従って、この場合、 dataTherefore, in this case, data

〔0〕^num[0] @num

〔0〕=000 data〔1〕^num〔1〕=001 data〔2〕^num〔2〕=010 data〔3〕^num〔3〕=011 data〔4〕^num〔4〕=100 data〔5〕^num〔5〕=110……チェックワード 合計=000 となる。[0] = 000 data [1] @num [1] = 001 data [2] @num [2] = 010 data [3] @num [3] = 011 data [4] @num [4] = 100 data [5] $ num [5] = 110 ... Check words Total = 000.

【0199】上記のデータを読み出したとき、a=00
0であれば、装置はこのデータが正当であると判断す
る。従って、この場合、合計の値がaを示し、a=00
0であるからデータは正当であると判断する。
When the above data is read, a = 00
If it is 0, the device determines that this data is valid. Therefore, in this case, the total value indicates a, and a = 00
Since it is 0, the data is determined to be valid.

【0200】一方、メモリデバイスの故障などにより、
チェックワードを含むデータがすべて0になった場合、 data
On the other hand, due to the failure of the memory device, etc.
When all data including the check word becomes 0, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=000……num〔1〕=001 data〔2〕=000……num〔2〕=010 data〔3〕=000……num〔3〕=011 data〔4〕=000……num〔4〕=100 data〔5〕=000……num〔5〕=101……チェックワード となる。[0] = 000 data [1] = 000 ... num [1] = 001 data [2] = 000 ... num [2] = 010 data [3] = 000 ... num [3] = 011 data [4 ] = 000... Num [4] = 100 data [5] = 000... Num [5] = 101...

【0201】従って、この場合、 dataTherefore, in this case, data

〔0〕^num[0] @num

〔0〕=000 data〔1〕^num〔1〕=001 data〔2〕^num〔2〕=010 data〔3〕^num〔3〕=011 data〔4〕^num〔4〕=100 data〔5〕^num〔5〕=101……チェックワード 合計=111 となる。[0] = 000 data [1] @num [1] = 001 data [2] @num [2] = 010 data [3] @num [3] = 011 data [4] @num [4] = 100 data [5] ^ num [5] = 101... Check word total = 111.

【0202】上記のデータを読み出したとき、a=00
0であれば、装置はこのデータが正当であると判断す
る。また、a=000でなければ、メモリデバイスの故
障などによって発生した不正なデータであると判断す
る。この場合、合計の値がaを示し、a=111であ
り、a=000でないからデータは不正であると判断す
る。
When the above data is read, a = 00
If it is 0, the device determines that this data is valid. If a is not equal to 000, it is determined that the data is invalid data generated due to a failure of the memory device or the like. In this case, since the total value indicates a, a = 111, and a = 000 is not satisfied, it is determined that the data is invalid.

【0203】このように、メモリデバイスの故障などで
データがすべて0になるような事態を検出することがで
きるので、対策を講じることが可能になるという効果を
奏する。
As described above, it is possible to detect a situation in which all data becomes 0 due to a failure of a memory device or the like, so that it is possible to take measures.

【0204】実施の形態6.また、実施の形態2におい
てメモリデバイスの故障等により全領域が0となった場
合、以下の式が成立する場合以外であれば、全領域が0
となったことを検出できる。
Embodiment 6 FIG. In the second embodiment, when the entire area becomes 0 due to a memory device failure or the like, the entire area becomes 0 unless the following equation is satisfied.
Can be detected.

【0205】[0205]

【数24】 (Equation 24)

【0206】例えば、この式が成立しないためには、a
=0である場合、nが4の倍数以外であればよい。
For example, in order that this equation does not hold, a
In the case of = 0, n may be other than a multiple of 4.

【0207】次に、具体例について、下記に示す。例え
ば、初期化処理において、全データを”0000000
00000000”に設定する場合について説明する。
また、a=010とする。
Next, specific examples will be described below. For example, in the initialization process, all data is set to “00000000”.
00000000 "will be described.
Also, let a = 010.

【0208】このデータを3バイトずつ分割すると、 0番目のデータ=000 1番目のデータ=000 2番目のデータ=000 3番目のデータ=000 4番目のデータ=000 となる。When this data is divided into three bytes, the following is obtained: 0th data = 000 1st data = 000 2nd data = 000 3rd data = 000 4th data = 000

【0209】この場合、例えばチェックワードの位置
を、j=5とすると、 data
In this case, if the position of the check word is j = 5, for example, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=000……num〔1〕=001 data〔2〕=000……num〔2〕=010 data〔3〕=000……num〔3〕=011 data〔4〕=000……num〔4〕=100 となる。[0] = 000 data [1] = 000 ... num [1] = 001 data [2] = 000 ... num [2] = 010 data [3] = 000 ... num [3] = 011 data [4 ] = 000... Num [4] = 100.

【0210】従って、この場合、 となる。Accordingly, in this case, Becomes

【0211】従って、チェックワードは、 data〔5〕={010^000^001^010^011^100}+ {反転101+1} =010^100+(010+1) =110+011 =001 となる。Therefore, the check word is data [5] = {010/000/001/010/011/100} + {inversion 101 + 1} = 010/100 + (010 + 1) = 110 + 011 = 001.

【0212】従って、チェックワードは data〔5〕+num〔5〕=001+101=11
0 となる。
Therefore, the check word is data [5] + num [5] = 001 + 101 = 11
It becomes 0.

【0213】従って、この場合、 dataAccordingly, in this case, data

〔0〕+num[0] + num

〔0〕=000 data〔1〕+num〔1〕=001 data〔2〕+num〔2〕=010 data〔3〕+num〔3〕=011 data〔4〕+num〔4〕=100 data〔5〕+num〔5〕=110……チェックワード EXOR=010 となる。[0] = 000 data [1] + num [1] = 001 data [2] + num [2] = 010 data [3] + num [3] = 011 data [4] + num [4] = 100 data [5] + num [5] = 110... Check word EXOR = 010.

【0214】上記のデータを読み出したとき、a=00
0であれば、装置はこのデータが正当であると判断す
る。従って、この場合、すべての排他的論理和の値がa
を示し、a=010であるからデータは正当であると判
断する。
When the above data is read, a = 00
If it is 0, the device determines that this data is valid. Therefore, in this case, all the values of the exclusive OR are a
, And since a = 010, the data is determined to be valid.

【0215】一方、メモリデバイスの故障などにより、
チェックワードを含むデータがすべて0になった場合、 data
On the other hand, due to the failure of the memory device, etc.
When all data including the check word becomes 0, data

〔0〕=000……num[0] = 000… num

〔0〕=000 data〔1〕=000……num〔1〕=001 data〔2〕=000……num〔2〕=010 data〔3〕=000……num〔3〕=011 data〔4〕=000……num〔4〕=100 data〔5〕=000……num〔5〕=101……チェックワード となる。[0] = 000 data [1] = 000 ... num [1] = 001 data [2] = 000 ... num [2] = 010 data [3] = 000 ... num [3] = 011 data [4 ] = 000... Num [4] = 100 data [5] = 000... Num [5] = 101...

【0216】従って、この場合、 dataTherefore, in this case, data

〔0〕+num[0] + num

〔0〕=000 data〔1〕+num〔1〕=001 data〔2〕+num〔2〕=010 data〔3〕+num〔3〕=011 data〔4〕+num〔4〕=100 data〔5〕+num〔5〕=101……チェックワード EXOR=001 となる。[0] = 000 data [1] + num [1] = 001 data [2] + num [2] = 010 data [3] + num [3] = 011 data [4] + num [4] = 100 data [5] + num [5] = 101... Check word EXOR = 001.

【0217】上記のデータを読み出したとき、a=01
0であれば、装置はこのデータが正当であると判断す
る。また、a=010でなければ、メモリデバイスの故
障などによって発生した不正なデータであると判断す
る。この場合、すべての排他的論理和の値がaを示し、
a=001であり、a=010でないからデータは不正
であると判断する。
When the above data is read, a = 01
If it is 0, the device determines that this data is valid. If a is not equal to 010, it is determined that the data is invalid data generated due to a memory device failure or the like. In this case, the values of all exclusive ORs indicate a,
Since a = 001 and a = 010 is not satisfied, it is determined that the data is invalid.

【0218】このように、メモリデバイスの故障などで
データがすべて0になるような事態を検出することがで
きるので、対策を講じることが可能になるという効果を
奏する。
As described above, it is possible to detect a situation where all data becomes 0 due to a failure of the memory device or the like, so that it is possible to take measures.

【0219】[0219]

【発明の効果】以上のように、第1の発明によれば、チ
ェックサムの値を調べることにより、データブロック内
のデータの格納位置の入れ替わりを検出でき、対策を講
じることができるようになるという効果を奏する。
As described above, according to the first aspect of the present invention, by examining the value of the checksum, it is possible to detect a change in the data storage position in the data block, and to take measures. This has the effect.

【0220】また、第2の発明によれば、新チェックワ
ードをすべてのデータから求めるのではなく、変更対象
のデータを元に極めて簡単な演算で求めるので、演算の
高速化を図ることができるという効果を奏する。
According to the second aspect of the present invention, a new check word is not obtained from all data but is obtained by an extremely simple operation based on data to be changed, so that the operation can be speeded up. This has the effect.

【0221】また、第3の発明によれば、水平パリティ
の値を調べることにより、データブロック内のデータの
格納位置の入れ替わりを検出でき、対策を講じることが
できるようになるという効果を奏する。
According to the third aspect of the present invention, by examining the value of the horizontal parity, it is possible to detect a change in the storage position of the data in the data block, and to take measures.

【0222】また、第4の発明によれば、データを変更
した場合、新チェックワードをすべてのデータから求め
るのではなく、変更対象のデータを元に極めて簡単な演
算で求めるので、演算の高速化を図ることができるとい
う効果を奏する。
According to the fourth aspect, when data is changed, a new check word is not obtained from all data but is obtained by an extremely simple calculation based on the data to be changed. This has the effect of realizing the conversion.

【0223】また、第5の発明によれば、チェックワー
ドを調べることにより、データブロック内のデータの格
納位置の入れ替わりを検出でき、対策を講じることがで
きるようになるという効果を奏する。
Further, according to the fifth aspect, by examining the check word, it is possible to detect a change in the storage position of the data in the data block, and to take measures.

【0224】また、第6の発明によれば、データを変更
した場合、新チェックワードをすべてのデータから求め
るのではなく、変更対象のデータを元に極めて簡単な演
算で求めるので、演算の高速化を図ることができるとい
う効果を奏する。
According to the sixth aspect of the present invention, when data is changed, a new check word is not obtained from all data but is obtained by an extremely simple operation based on data to be changed. This has the effect of realizing the conversion.

【0225】また、第7の発明によれば、チェックワー
ドを調べることにより、データブロック内のデータの格
納位置の入れ替わりを検出でき、対策を講じることがで
きるようになるという効果を奏する。
Further, according to the seventh aspect, by checking the check word, it is possible to detect a change in the storage position of the data in the data block, and to take an effect that a countermeasure can be taken.

【0226】また、第8の発明によれば、データを変更
した場合、新チェックワードをすべてのデータから求め
るのではなく、変更対象のデータを元に極めて簡単な演
算で求めるので、演算の高速化を図ることができるとい
う効果を奏する。
According to the eighth aspect, when data is changed, a new check word is not obtained from all data but is obtained by an extremely simple calculation based on the data to be changed. This has the effect of realizing the conversion.

【0227】また、第9の発明によれば、チェックサム
の値を調べることにより、メモリデバイスの故障などで
データがすべて0になるような事態を検出することがで
きるので、対策を講じることが可能になるという効果を
奏する
Further, according to the ninth aspect, by checking the value of the checksum, it is possible to detect a situation in which the data becomes all 0 due to a failure of the memory device or the like. Has the effect of being possible

【0228】また、第10の発明によれば、水平パリテ
ィの値を調べることにより、メモリデバイスの故障など
でデータがすべて0になるような事態を検出することが
できるので、対策を講じることが可能になるという効果
を奏する。
Further, according to the tenth aspect, by checking the value of the horizontal parity, it is possible to detect a situation where all data becomes 0 due to a failure of a memory device or the like. It has the effect that it becomes possible.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 従来およびこの発明に係るデータチェックを
行うための構成を示した構成図である。
FIG. 1 is a configuration diagram showing a configuration for performing data check according to the related art and the present invention.

【図2】 この発明に係るデータチェック方法の一実施
の形態を示す説明図である。
FIG. 2 is an explanatory diagram showing one embodiment of a data check method according to the present invention.

【図3】 実施の形態1における制御手段1のデータ初
期化の動作を示すフローチャートである。
FIG. 3 is a flowchart showing an operation of data initialization of the control means 1 according to the first embodiment.

【図4】 実施の形態1における制御手段1のデータチ
ェックの動作を示すフローチャートである。
FIG. 4 is a flowchart showing a data check operation of the control means 1 according to the first embodiment.

【図5】 実施の形態1における制御手段1のデータ更
新処理の動作を示すフローチャートである。
FIG. 5 is a flowchart showing an operation of a data updating process of the control means 1 according to the first embodiment.

【図6】 この発明に係るデータチェック方法の別の実
施の形態を示す説明図である。
FIG. 6 is an explanatory diagram showing another embodiment of the data check method according to the present invention.

【図7】 実施の形態2における制御手段1のデータ初
期化の動作を示すフローチャートである。
FIG. 7 is a flowchart showing an operation of data initialization of the control means 1 according to the second embodiment.

【図8】 実施の形態2における制御手段1のデータチ
ェックの動作を示すフローチャートである。
FIG. 8 is a flowchart showing a data check operation of the control means 1 according to the second embodiment.

【図9】 実施の形態2における制御手段1のデータ更
新処理の動作を示すフローチャートである。
FIG. 9 is a flowchart showing an operation of a data updating process of the control means 1 according to the second embodiment.

【図10】 この発明に係るデータチェック方法の別の
実施の形態を示す説明図である。
FIG. 10 is an explanatory diagram showing another embodiment of the data check method according to the present invention.

【図11】 実施の形態3における制御手段1のデータ
初期化の動作を示すフローチャートである。
FIG. 11 is a flowchart showing an operation of data initialization of the control means 1 according to the third embodiment.

【図12】 実施の形態3における制御手段1のデータ
チェックの動作を示すフローチャートである。
FIG. 12 is a flowchart showing a data check operation of the control means 1 according to the third embodiment.

【図13】 実施の形態3における制御手段1のデータ
更新処理の動作を示すフローチャートである。
FIG. 13 is a flowchart showing an operation of a data update process of the control means 1 according to the third embodiment.

【図14】 この発明に係るデータチェック方法の別の
実施の形態を示す説明図である。
FIG. 14 is an explanatory diagram showing another embodiment of the data check method according to the present invention.

【図15】 実施の形態4における制御手段1のデータ
初期化の動作を示すフローチャートである。
FIG. 15 is a flowchart showing an operation of data initialization of the control means 1 according to the fourth embodiment.

【図16】 実施の形態4における制御手段1のデータ
チェックの動作を示すフローチャートである。
FIG. 16 is a flowchart showing a data check operation of the control means 1 according to the fourth embodiment.

【図17】 実施の形態4における制御手段1のデータ
更新処理の動作を示すフローチャートである。
FIG. 17 is a flowchart showing an operation of a data updating process of the control means 1 according to the fourth embodiment.

【図18】 従来のチェックサムによるデータチェック
方法の一例を示す説明図である。
FIG. 18 is an explanatory diagram showing an example of a conventional data check method using a checksum.

【図19】 従来のチェックサムによるデータチェック
方法の別の例を示す説明図である。
FIG. 19 is an explanatory diagram showing another example of a conventional data check method using a checksum.

【図20】 従来の水平パリティチェックによるデータ
チェック方法の一例を示す説明図である。
FIG. 20 is an explanatory diagram showing an example of a conventional data check method using a horizontal parity check.

【図21】 従来の水平パリティチェックによるデータ
チェック方法の別の例を示す説明図である。
FIG. 21 is an explanatory diagram showing another example of a conventional data check method using a horizontal parity check.

【符号の説明】[Explanation of symbols]

1 制御手段 2 記憶手段 1 control means 2 storage means

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 データを所定の長さで分割して複数の第
1のデータブロックを作成するデータ分割工程と、上記
複数の第1のデータブロックの各々に対してアドレスを
割り付けるアドレス割り付け工程と、上記複数の第1の
データブロックの各々に対してこの第1のデータブロッ
クの値と対応するアドレスとの排他的論理和をとって複
数の第2のデータブロックを作成する第2データブロッ
ク作成工程と、データの信頼性チェックのために、第1
のチェックワードを上記第1のデータブロックのアドレ
ス範囲内の所定のアドレスに挿入または追加する第1チ
ェックワード挿入工程と、上記複数の第2のデータブロ
ックの総和をとり、得られた第2のデータブロックの総
和に対して2の補数をとり、次にこの総和の2の補数と
上記第1のチェックワードのアドレスとの排他的論理和
をとり、さらにこの排他的論理和による結果の値に予め
決められた値を加えて上記第1のチェックワードを作成
する第1チェックワード作成工程と、上記第1のデータ
ブロックと上記第1のチェックワードとを記憶手段に書
込む書込工程と、上記複数の第1のデータブロック及び
上記第1のチェックワードを上記記憶手段から読みだす
際に、上記複数の第1のデータブロックの各々に対し
て、この第1のデータブロックの値と対応するアドレス
との排他的論理和をとり、複数の第3のデータブロック
を作成する第3データブロック作成工程と、上記第1の
チェックワードの値と対応するアドレスとの排他的論理
和をとり、第2のチェックワードを作成する第2チェッ
クワード作成工程と、上記複数の第3のデータブロック
の総てと上記第2のチェックワードとの総和をとり第4
のデータブロックを作成する第4データブロック作成工
程と、この第4のデータブロックが上記予め決められた
値と同じか否かを判断するチェック工程とを備えたこと
を特徴とするデータチェック方法。
1. A data dividing step of dividing data by a predetermined length to create a plurality of first data blocks, and an address allocating step of allocating an address to each of the plurality of first data blocks. Creating a plurality of second data blocks by performing an exclusive OR operation on a value of the first data block and a corresponding address for each of the plurality of first data blocks Process and data reliability checks
A first check word insertion step of inserting or adding the check word at a predetermined address within the address range of the first data block, and a second sum obtained by summing the plurality of second data blocks. Take the two's complement of the sum of the data blocks, then take the exclusive OR of the two's complement of this sum with the address of the first check word, and further take the value resulting from the exclusive OR. A first check word creating step of creating the first check word by adding a predetermined value; a writing step of writing the first data block and the first check word into storage means; When the plurality of first data blocks and the first check word are read from the storage means, the first data block is read from each of the plurality of first data blocks. A third data block creation step of taking an exclusive OR of the value of the block and the corresponding address to create a plurality of third data blocks; and performing an exclusive OR of the address of the first check word and the corresponding address. A second check word creating step of taking a logical sum to create a second check word; and taking a sum of all of the plurality of third data blocks and the second check word to form a fourth check word.
A data check method, comprising: a fourth data block creation step of creating a data block of (i), and a check step of determining whether or not the fourth data block is the same as the predetermined value.
【請求項2】 データの更新を行った場合、更新前の第
1のチェックワードの値と対応するアドレスとの排他的
論理和をとり、第1の中間データを作成する第1中間デ
ータ作成工程と、複数の第1のデータブロックの内の変
更の対象となる第1のデータブロックに対してこの第1
のデータブロックの値と対応するアドレスとの排他的論
理和をとり、複数の第2の中間データを作成する第2中
間データ作成工程と、変更された第1のデータブロック
と上記第1のチェックワードのアドレスとの排他的論理
和をとり、第3の中間データを作成する第3中間データ
作成工程と、上記第1の中間データと上記複数の第2の
中間データと上記第3の中間データの2の補数との総和
をとり、この総和と上記第1のチェックワードのアドレ
スとの排他的論理和をとってデータ更新後の第1のチェ
ックワードを作成する工程とを備えたことを特徴とする
請求項1記載のデータチェック方法。
2. A first intermediate data creation step of taking an exclusive OR of a value of a first check word before update and a corresponding address when updating data, and creating first intermediate data. And a first data block to be changed among the plurality of first data blocks.
XORing the value of the data block with the corresponding address to create a plurality of second intermediate data, a second intermediate data creating step, and the changed first data block and the first check A third intermediate data generating step of obtaining an exclusive OR with a word address to generate third intermediate data; and a step of generating the first intermediate data, the plurality of second intermediate data, and the third intermediate data. And taking the exclusive OR of the sum and the address of the first check word to create a first check word after updating the data. 2. The data check method according to claim 1, wherein:
【請求項3】 データを所定の長さで分割して複数の第
1のデータブロックを作成するデータ分割工程と、上記
複数の第1のデータブロックの各々に対してアドレスを
割り付けるアドレス割り付け工程と、上記複数の第1の
データブロックの各々に対してこの第1のデータブロッ
クの値に、対応するアドレスを加算して複数の第2のデ
ータブロックを作成する第2データブロック作成工程
と、データの信頼性チェックのために、第1のチェック
ワードを上記第1のデータブロックのアドレス範囲内の
所定のアドレスに挿入または追加する第1チェックワー
ド挿入工程と、上記複数の第2のデータブロックの総て
の排他的論理和をとり第3のデータブロックを作成する
第3データブロック作成工程と、上記第3のデータブロ
ックの値とあらかじめ決められた値との排他的論理和を
とり、第4のデータブロックを作成する第4データブロ
ック作成工程と、上記第1のチェックワードのアドレス
の2の補数をとり、上記第4のデータブロックに加えて
上記第1のチェックワードを作成するチェックワード作
成工程と、上記第1のデータブロックと上記第1のチェ
ックワードとを記憶手段に書込む書込工程と、上記複数
の第1のデータブロック及び上記第1のチェックワード
を上記記憶手段から読みだす際に、上記複数の第1のデ
ータブロックの各々に対して、この第1のデータブロッ
クの値に、対応するアドレスを加算し、複数の第5のデ
ータブロックを作成する第5データブロック作成工程
と、上記第1のチェックワードの値に、対応するアドレ
スを加算し、第2のチェックワードを作成する第2チェ
ックワード作成工程と、上記複数の第5のデータブロッ
クの総てと上記第2のチェックワードとの排他的論理和
をとり第6のデータブロックを作成する第6データブロ
ック作成工程と、この第6のデータブロックが上記予め
決められた値と同じか否かを判断するチェック工程とを
備えたことを特徴とするデータチェック方法。
3. A data dividing step of dividing data by a predetermined length to generate a plurality of first data blocks, and an address allocating step of allocating an address to each of the plurality of first data blocks. A second data block creating step of adding a corresponding address to the value of the first data block for each of the plurality of first data blocks to create a plurality of second data blocks; Inserting a first check word into a predetermined address within an address range of the first data block to add or check a reliability of the first data block; and inserting a first check word into the plurality of second data blocks. A third data block creation step of taking all exclusive ORs to create a third data block; A fourth data block creation step of taking an exclusive OR with a determined value to create a fourth data block; and taking a 2's complement of the address of the first check word to obtain a fourth data block. A writing step of writing the first data block and the first check word into storage means; and a writing step of writing the first data block and the first check word into storage means. When reading the block and the first check word from the storage means, for each of the plurality of first data blocks, add a corresponding address to the value of the first data block, and A fifth data block creating step of creating a fifth data block, and adding a corresponding address to the value of the first check word to create a second check word A second check word creating step of: performing an exclusive OR operation of all of the plurality of fifth data blocks with the second check word to create a sixth data block; A check step of determining whether or not the sixth data block is equal to the predetermined value.
【請求項4】 データの更新を行った場合、更新前の第
1のチェックワードの値に、対応するアドレスを加算
し、第1の中間データを作成する第1中間データ作成工
程と、複数の第1のデータブロックの内の変更の対象と
なる第1のデータブロックに対してこの第1のデータブ
ロックの値に、対応するアドレスを加算して、第2の中
間データを作成する第2中間データ作成工程と、変更さ
れた第1データブロックの値に、対応するアドレスを加
算して、第3の中間データを作成する第3中間データ作
成工程と、上記第1の中間データと上記第2の中間デー
タと上記第3の中間データとの排他的論理和をとって第
4の中間データを作成する第4中間データ作成工程と、
この第4の中間データに上記第1のチェックワードのア
ドレスの2の補数を加算してデータ更新後のチェックワ
ードを作成する工程とを備えたことを特徴とする請求項
3記載のデータチェック方法。
4. When data is updated, a first intermediate data creating step of adding a corresponding address to a value of a first check word before updating to create first intermediate data, A second intermediate block for creating second intermediate data by adding a corresponding address to a value of the first data block to be changed in the first data block, the value of the first data block. A data creating step, a third intermediate data creating step of adding a corresponding address to the changed value of the first data block to create third intermediate data, and the first intermediate data and the second intermediate data A fourth intermediate data creating step of creating an exclusive OR of the intermediate data of the third intermediate data and the third intermediate data to create fourth intermediate data;
4. A data check method according to claim 3, further comprising the step of: adding a two's complement of the address of said first check word to said fourth intermediate data to create a check word after data update. .
【請求項5】 データを所定の長さで分割して複数の第
1のデータブロックを作成するデータ分割工程と、上記
複数の第1のデータブロックの各々に対してアドレスを
割り付けるアドレス割り付け工程と、上記複数の第1の
データブロックの各々に対してこの第1のデータブロッ
クの値と対応するアドレスとの排他的論理和をとって複
数の第2のデータブロックを作成する第2データブロッ
ク作成工程と、上記複数の第1のデータブロックを第1
の記憶手段に格納する第1データブロック格納工程と、
上記複数の第2のデータブロックの総和をとり、得られ
た総和に基づいてチェックワードを作成するチェックワ
ード作成工程と、上記チェックワードを第2の記憶手段
に格納するチェックワード格納工程と、上記複数の第1
のデータブロックを上記第1の記憶手段から読みだす際
に、この第1のデータブロックの各々に対してこの第1
のデータブロックの値と対応するアドレスとの排他的論
理和をとり、複数の第3のデータブロックを作成する第
3データブロック作成工程と、上記複数の第3のデータ
ブロックの総和をとり第4のデータブロックを作成する
第4データブロック作成工程と、この第4のデータブロ
ックが上記第2の記憶手段から読みだしたチェックワー
ドと同じか否かを判断するチェック工程とを備えたこと
を特徴とするデータチェック方法。
5. A data dividing step of dividing data by a predetermined length to generate a plurality of first data blocks, and an address allocating step of allocating an address to each of the plurality of first data blocks. Creating a plurality of second data blocks by performing an exclusive OR operation on a value of the first data block and a corresponding address for each of the plurality of first data blocks And a step of dividing the plurality of first data blocks into a first data block.
A first data block storing step of storing in a storage means of
A check word creating step of calculating a sum of the plurality of second data blocks and creating a check word based on the obtained sum, a check word storing step of storing the check word in second storage means, Multiple first
When reading out the data block from the first storage means, the first data block
A third data block creating step of taking an exclusive OR of the value of the data block and the corresponding address to create a plurality of third data blocks; and taking a total sum of the plurality of third data blocks to obtain a fourth data block. And a check step of determining whether or not the fourth data block is the same as the check word read from the second storage means. Data check method.
【請求項6】 データの更新を行った場合、変更された
第1のデータブロックと対応するアドレスとの排他的論
理和をとり、第1の中間データを作成する第1中間デー
タ作成工程と、複数の第1のデータブロックの内の変更
の対象となる変更前の第1のデータブロックに対してこ
の第1のデータブロックの値と対応するアドレスとの排
他的論理和をとり、第2の中間データを作成する第2中
間データ作成工程と、上記第1の中間データと、上記第
2の中間データの2の補数と、更新前のチェックワード
の値と、の総和をとり、データ更新後のチェックワード
を作成する工程とを備えたことを特徴とする請求項5記
載のデータチェック方法。
6. When data is updated, a first intermediate data creating step of taking an exclusive OR of the changed first data block and a corresponding address to create first intermediate data; An exclusive OR of a value of the first data block and an address corresponding to the first data block before the change to be changed among the plurality of first data blocks is calculated. A second intermediate data generating step of generating intermediate data; a sum of the first intermediate data, a two's complement of the second intermediate data, and a value of a check word before updating; 6. The data check method according to claim 5, further comprising the step of:
【請求項7】 データを所定の長さで分割して複数の第
1のデータブロックを作成するデータ分割工程と、上記
複数の第1のデータブロックの各々に対してアドレスを
割り付けるアドレス割り付け工程と、上記複数の第1の
データブロックの各々に対してこの第1のデータブロッ
クの値に、対応するアドレスを加算して複数の第2のデ
ータブロックを作成する第2データブロック作成工程
と、上記複数の第1のデータブロックを第1の記憶手段
に格納する第1データブロック格納工程と、上記複数の
第2のデータブロック間の排他的論理和をとり、この排
他的論理和の結果に基づいてチェックワードを作成する
チェックワード作成工程と、このチェックワードを上記
第2の記憶手段に格納するチェックワード格納工程と、
上記複数の第1のデータブロックを上記第1の記憶手段
から読みだす際に、この第1のデータブロックの各々に
対してこの第1のデータブロックの値に、対応するアド
レスを加算して複数の第3のデータブロックを作成する
第3データブロック作成工程と、上記複数の第3のデー
タブロックの総ての排他的論理和をとり第4のデータブ
ロックを作成する第4データブロック作成工程と、この
第4のデータブロックが上記第2の記憶手段から読みだ
したチェックワードと同じか否かを判断するチェック工
程とを備えたことを特徴とするデータチェック方法。
7. A data dividing step of dividing data by a predetermined length to create a plurality of first data blocks, and an address assigning step of assigning an address to each of the plurality of first data blocks. A second data block creating step of adding a corresponding address to a value of the first data block for each of the plurality of first data blocks to create a plurality of second data blocks; A first data block storing step of storing a plurality of first data blocks in a first storage means, and an exclusive OR of the plurality of second data blocks is calculated based on a result of the exclusive OR. A check word creating step of creating a check word, and a check word storing step of storing the check word in the second storage means.
When reading out the plurality of first data blocks from the first storage means, a value corresponding to the value of the first data block is added to each of the first data blocks to obtain a plurality of first data blocks. A third data block creating step of creating a third data block, and a fourth data block creating step of taking an exclusive OR of all of the plurality of third data blocks to create a fourth data block. A check step of determining whether or not the fourth data block is the same as a check word read from the second storage means.
【請求項8】 データの更新を行った場合、複数の第1
のデータブロックの内の変更の対象となる第1のデータ
ブロックに対してこの第1のデータブロックの値に、対
応するアドレスを加算して、複数の第1の中間データを
作成する第1中間データ作成工程と、変更された第1デ
ータブロックの値に、対応するアドレスを加算して、第
2の中間データを作成する第2中間データ作成工程と、
更新前のチェックワードの値と、上記第1の中間データ
と、上記第2の中間データとの排他的論理和をとって、
データ更新後のチェックワードを作成する工程とを備え
たことを特徴とするデータチェック方法。
8. When data is updated, a plurality of first
A first intermediate block for generating a plurality of first intermediate data by adding a corresponding address to a value of the first data block to be changed among the first data blocks of the first data block A data creation step, a second intermediate data creation step of adding a corresponding address to the changed value of the first data block to create second intermediate data,
The exclusive OR of the value of the check word before update, the first intermediate data, and the second intermediate data is calculated,
Creating a check word after updating the data.
【請求項9】 チェック工程は、第1のデータブロック
及び第1のチェックワードを記憶手段から読みだす際
に、上記第1のデータブロックの各々の値がすべて0の
場合に、この第1のデータブロックの値と対応するアド
レスとの排他的論理和をとって作成された複数の第3の
データブロックの総和と、上記第1のチェックワードと
対応するアドレスとの排他的論理和をとって作成された
第2のチェックワードと、の和が、予め決められた値と
同じか否かを判断することを特徴とする請求項1に記載
のデータチェック方法。
9. The checking step includes: when reading out the first data block and the first check word from the storage means, if all the values of the first data block are all 0, The exclusive OR of the plurality of third data blocks created by taking the exclusive OR of the value of the data block and the corresponding address, and the exclusive OR of the address corresponding to the first check word 2. The data check method according to claim 1, wherein it is determined whether the sum of the created second check word and the second check word is the same as a predetermined value.
【請求項10】 チェック工程は、第1のデータブロッ
ク及び第1のチェックワードを記憶手段から読みだす際
に、上記第1のデータブロックの各々の値がすべて0の
場合に、この第1のデータブロックの値に、対応するア
ドレスをそれぞれ加算して作成された複数の第3のデー
タブロックの総てと、上記第1のチェックワードに対応
するアドレスを加算して作成された第2のチェックワー
ドと、の排他的論理和が、予め決められた値と同じか否
かを判断することを特徴とする請求項3に記載のデータ
チェック方法。
10. The checking step includes: when reading out the first data block and the first check word from the storage means, when all the values of the first data block are all 0, A second check created by adding all of the plurality of third data blocks created by adding the corresponding addresses to the data block values and the addresses corresponding to the first check words, respectively. 4. The data check method according to claim 3, wherein it is determined whether or not the exclusive OR of the word and the word is equal to a predetermined value.
JP9072414A 1997-03-25 1997-03-25 Data checking method Pending JPH10269147A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9072414A JPH10269147A (en) 1997-03-25 1997-03-25 Data checking method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9072414A JPH10269147A (en) 1997-03-25 1997-03-25 Data checking method

Publications (1)

Publication Number Publication Date
JPH10269147A true JPH10269147A (en) 1998-10-09

Family

ID=13488610

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9072414A Pending JPH10269147A (en) 1997-03-25 1997-03-25 Data checking method

Country Status (1)

Country Link
JP (1) JPH10269147A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013050839A (en) * 2011-08-31 2013-03-14 Nec Computertechno Ltd Information processor, information processing method, and information processing program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013050839A (en) * 2011-08-31 2013-03-14 Nec Computertechno Ltd Information processor, information processing method, and information processing program

Similar Documents

Publication Publication Date Title
CN108681565B (en) Block chain data parallel processing method, device, equipment and storage medium
CN110096227B (en) Data storage method, data processing device, electronic equipment and computer readable medium
KR101905280B1 (en) High performance system providing selective merging of dataframe segments in hardware
US20140068208A1 (en) Separately stored redundancy
CN100507878C (en) Access control apparatus, access control method, memory access control device, and memory access control method
US7418645B2 (en) Error correction/detection code adjustment for known data pattern substitution
US7406563B1 (en) Method and apparatus for accessing a striped configuration of disks
US3218612A (en) Data transfer system
TW201937370A (en) Semiconductor device and semiconductor system equipped with the same
KR101666974B1 (en) Prime number generation
JPH10269147A (en) Data checking method
JP2000181807A (en) Method and device for inspecting data in recording medium
CN110470310A (en) Automatic map generates
CN114253478B (en) Method and device for calculating RAID check disk position
JP3170145B2 (en) Memory control system
JP4336859B2 (en) Redundant drive group and writing method and data restoring method using the same
US20080195809A1 (en) Raid system and the operating method for the same
JP2007257628A (en) Method for error correction and error detection for reading out stored information data and storage control unit therefor
US8805904B2 (en) Method and apparatus for calculating the number of leading zero bits of a binary operation
RU2211492C2 (en) Fault-tolerant random-access memory
CN112035850B (en) Data processing method and device and electronic equipment
US7574561B2 (en) Method and apparatus for storing a data to memory devices
US20060179215A1 (en) Apparatus for detecting disk write omissions
US7810012B1 (en) Format for randomized data block in a storage device
KR20220168337A (en) Method and apparatus for providing blockchain