JPH05143473A - Data write system - Google Patents

Data write system

Info

Publication number
JPH05143473A
JPH05143473A JP3308162A JP30816291A JPH05143473A JP H05143473 A JPH05143473 A JP H05143473A JP 3308162 A JP3308162 A JP 3308162A JP 30816291 A JP30816291 A JP 30816291A JP H05143473 A JPH05143473 A JP H05143473A
Authority
JP
Japan
Prior art keywords
data
check code
stored
storage unit
calculated
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.)
Granted
Application number
JP3308162A
Other languages
Japanese (ja)
Other versions
JP3055986B2 (en
Inventor
Fumiyuki Iwase
史幸 岩瀬
Takashi Takeuchi
隆 竹内
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.)
N T T DATA TSUSHIN KK
NTT Data Corp
Original Assignee
N T T DATA TSUSHIN KK
NTT Data Communications Systems 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 N T T DATA TSUSHIN KK, NTT Data Communications Systems Corp filed Critical N T T DATA TSUSHIN KK
Priority to JP3308162A priority Critical patent/JP3055986B2/en
Publication of JPH05143473A publication Critical patent/JPH05143473A/en
Application granted granted Critical
Publication of JP3055986B2 publication Critical patent/JP3055986B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Detection And Correction Of Errors (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PURPOSE:To improve the reliability of data by inverting and storing a calculated check code in the case of coincidence between the calculated check code and a stored check code and reporting the occurrence of write error at the time of read of pertinent data even in the case that check codes coincide with each other at the time of write. CONSTITUTION:The check code of the final storage unit as the present write object is calculated and is compared with a present check code 3. If they do not coincide with each other, the check code 3 is left unrewritten as it is, and the rewrite processing of next data is started; but otherwise, the check code is inverted and stored because the check code 3 stored at present coincides with the check code calculated in accordance with rewritten data 2, and the next processing is started thereafter. It is discriminated whether data write is completed or not, and this processing is terminated when it is completed.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、記憶情報に関し、特
に、記憶情報の書き込みが中断された場合の信頼性を高
めたデータ書き込み手法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to stored information, and more particularly to a data writing method with improved reliability when writing of stored information is interrupted.

【0002】[0002]

【従来の技術】メモリ上に記憶されたデータの正当性
は、ある決められた格納単位ごとにチェックコードを付
加し、対象データを読みだした際に内蔵する制御素子に
より、格納単位ごとに記憶されているチェックコードと
格納単位のチェックコード計算結果とを比較し、データ
の真偽性を確認するようにされている。
2. Description of the Related Art The validity of data stored in a memory is stored in each storage unit by adding a check code to each predetermined storage unit and by a control element incorporated when the target data is read. The authenticity of the data is confirmed by comparing the check code stored with the check code calculation result of the storage unit.

【0003】具体例として、図3の場合を考える。書き
込むべきエリアの初期状態は、図3のとおりであると
し、チェックコードとして偶数パリティを用いることと
する。ここでは、制御コード(対象セクタの有効/無効
あるいは複数の格納単位にまたがっている際の制御に使
用する)には、01,02,03(h)と格納単位の順
番が入っていると仮定する。この箇所に再度データを書
き込むことを考える。
As a concrete example, consider the case of FIG. The initial state of the area to be written is as shown in FIG. 3, and even parity is used as the check code. Here, it is assumed that the control code (valid / invalid of the target sector or used for control when the storage unit spans a plurality of storage units) includes 01, 02, 03 (h) and the order of the storage units. To do. Consider writing data again at this location.

【0004】最初に受信したブロックを書き込んだとこ
ろ、図4の状態になったとする(図の網かけ部が新し
い)。ここで、伝送が中断されたと仮定する。データの
書き込みが完了していないため、2番目の格納単位のチ
ェックコードは以前の02(h)のままである。
When the first received block is written, it is assumed that the state shown in FIG. 4 is reached (the shaded area in the figure is new). Now assume that the transmission is interrupted. Since the data writing has not been completed, the check code of the second storage unit remains the same as the previous 02 (h).

【0005】このデータを読みだす場合、一つ一つの格
納単位のチェックコードを計算し、格納されているチェ
ックコードと比較していく。2番目の格納単位ではデー
タの内容は変わっているが、チェックコードの計算結果
は前と同じ02(h)となり、格納されているチェック
コードも02(h)である。しかし、2番目の格納単位
の途中以降のデータは信頼性がないものであり、この格
納単位のチェックをした時点で、NGの通知をしなけれ
ばならない。しかし、従来からの方法では、計算結果と
格納されているチェックコードとの比較をした場合、一
致しているために、正しいと判断されてしまう。
When reading this data, the check code of each storage unit is calculated and compared with the stored check code. In the second storage unit, the content of the data has changed, but the calculation result of the check code is 02 (h), which is the same as before, and the stored check code is also 02 (h). However, the data after the middle of the second storage unit is not reliable, and NG must be notified when this storage unit is checked. However, according to the conventional method, when the calculation result and the stored check code are compared, they are determined to be correct because they match.

【0006】すなわち、データを書き込む時の動作は、
データとともにデータ格納単位の制御コードから書き込
みが終了した格納単位のチェックコードを算出し、格納
する。書き込みが途中の格納単位のチェックコードにつ
いては、そのままである。
That is, the operation for writing data is
The check code of the storage unit for which writing has been completed is calculated and stored from the control code of the data storage unit together with the data. The check code of the storage unit in the middle of writing is unchanged.

【0007】そのため、データを読みだす際には、デー
タ自体とともに、対象となる格納単位のチェックコード
を計算し、格納されているコードとの比較をすることに
より、データの正当性を確認し、記憶されているデータ
の信頼性を上位装置に通知する仕組みとなっている。つ
まり、データの信頼性はチェックコードでのみ判断して
おり、たとえ、データが誤っている場合でも、チェック
コードが一致していれば、正しいデータとして認識され
る。
Therefore, when reading out data, the check code of the target storage unit is calculated together with the data itself, and the validity of the data is confirmed by comparing with the stored code. The reliability of the stored data is notified to the host device. That is, the reliability of the data is determined only by the check code, and even if the data is incorrect, if the check codes match, the data is recognized as correct data.

【0008】図4に一般的な従来法の制御を図示してあ
る。この図4における〈中間状態〉でレコードの読みだ
しを行った場合、のチェックコードとチェックコード
を含む格納単位のチェックコードの計算結果とが一致し
た場合には、対象レコードが正当なものと判断され、異
常通知ができないことになる。
FIG. 4 illustrates a general conventional control method. When the record is read in the <intermediate state> in FIG. 4, if the check code of and the calculation result of the check code of the storage unit including the check code match, the target record is determined to be valid. Therefore, the abnormal notification cannot be sent.

【0009】このチェックコードの計算方法としては、
各データの偶数パリティーもしくは奇数パリティー等を
計算する方法あるいは生成多項式を利用する方法があ
る。このチェック方法を複雑にすればデータの信頼性は
向上する。しかし、例えばICカード内にチェック方法
を格納する際のように、限られた資源(ROM及びRA
Mサイズ)をより効率的に使用しなければならない際に
は、複雑なチェック方法を格納するわけにはいかなくな
る。
As a method of calculating the check code,
There is a method of calculating even parity or odd parity of each data, or a method of using a generator polynomial. If the checking method is complicated, the reliability of data is improved. However, limited resources (ROM and RA, for example, when storing the check method in an IC card).
When M size) has to be used more efficiently, complicated check methods cannot be stored.

【0010】その反面、例えばICカードのように金額
を扱ったり、セキュリティを要求される場合には、より
データの信頼性を高めなくてはならない。
On the other hand, in the case of handling an amount of money such as an IC card or requiring security, it is necessary to further enhance the reliability of data.

【0011】すなわち、あまり複雑なチェック方法では
なく、しかもデータの信頼性を高める手法を考えなくて
はならない。
That is, it is necessary to consider not only a complicated check method but also a method of improving the reliability of data.

【0012】[0012]

【発明が解決しようとする課題】上述したようなチェッ
ク方法では、データに異常があった場合でも、格納単位
のチェックコードが偶然一致してしまう場合がある。特
に、データの書き込みが正常に終了していないにもかか
わらず、格納されているチェックコードと算出されたチ
ェックコードとが一致してしまい、そのデータが正しい
と判断されてしまった場合には、データの信頼性が満足
されていない。
In the above checking method, the check codes of the storage units may coincide with each other even if the data is abnormal. In particular, if the stored check code matches the calculated check code even though the writing of the data has not ended normally, and it is determined that the data is correct, Data reliability is not satisfied.

【0013】また、受信バッファサイズに制限がある場
合には、データを分断して受け取り、その書き込みが終
了し、レスポンスを返した後で次ブロックを受け取るチ
ェイニング方式を取らざるを得ない。このため、特に、
長いデータを書き込む際には、書き込みを完了させるた
めにコマンド・レスポンスのやりとりが増えるため、な
んらかの要因で書き込み動作が完了しない場合も考えら
れる。
Further, when the size of the receiving buffer is limited, there is no choice but to adopt a chaining system in which data is divided and received, the writing is completed, and a response is returned, and then the next block is received. For this reason, in particular,
When writing long data, the exchange of commands and responses increases in order to complete the writing, so it is possible that the writing operation may not complete for some reason.

【0014】本発明は、記憶手段への書き込み時におい
て、チェックコードが一致してしまう場合にも、該当デ
ータを読みだした際に、書き込みエラーがあったことを
通知することを可能とし、データの信頼性を高めること
を目的とする。
According to the present invention, even when the check codes match when writing to the storage means, it is possible to notify that there is a write error when reading the corresponding data, and The purpose is to increase the reliability of.

【0015】[0015]

【課題を解決するための手段】上記目的を達成するため
に、本発明のデータ書き込み方式は、記憶手段にデータ
を書き込む際に、データ格納単位ごとのチェックコード
を計算し、格納されているチェックコードと比較し、も
し一致している場合には、そのチェックコードを反転
(補数に置き換える)させて格納することを特徴とす
る。
In order to achieve the above object, the data writing method of the present invention calculates a check code for each data storage unit when writing data in the storage means, and checks the stored check. It is characterized in that it is compared with a code, and if they match, the check code is inverted (replaced with a complement) and stored.

【0016】[0016]

【作用】上述の手段によれば、記憶手段にデータを書き
込む際に、データ格納単位ごとのチェックコードを計算
し、格納されているチェックコードと比較し、もし一致
している場合には、そのチェックコードを反転(補数に
置き換える)させて格納するので、データの書き込みが
中断された場合で、かつ格納されているチェックコード
が一致している場合でも、読みだした際にデータの信頼
性がないことを上位装置に通知することが可能となる。
According to the above-mentioned means, when writing data in the storage means, the check code for each data storage unit is calculated and compared with the stored check code. Since the check code is stored by being inverted (replaced by the complement), the reliability of the data will not be affected when the data is read even if the writing of the data is interrupted and the stored check codes match. It becomes possible to notify the higher-level device that there is not.

【0017】[0017]

【実施例】以下に、本発明の実施例を図面を用いて詳細
に説明する。
Embodiments of the present invention will now be described in detail with reference to the drawings.

【0018】図1は、本発明の一実施例のデータ書き込
み制御方式を説明するための図であり、図2は、本実施
例のデータ書き込みのフローチャートである。図1及び
図2を用いて、本実施例のデータの信頼性を高めたデー
タ書き込み動作を詳細に説明する。
FIG. 1 is a diagram for explaining a data write control system of an embodiment of the present invention, and FIG. 2 is a flow chart of data write of the present embodiment. A data write operation of the present embodiment with improved data reliability will be described in detail with reference to FIGS. 1 and 2.

【0019】既に格納単位にデータが格納されており、
その箇所にデータを書き換える場合を考える。まず、制
御部からの指示により、新たに書き換えようとするデー
タに書き換える(ステップ101)。そして、書き込み
が終了した格納単位については、該当格納単位のチェッ
クコードを計算し(ステップ102)、チェックコード
として正しい値を格納しておく(ステップ103)。
Data is already stored in the storage unit,
Consider the case where data is rewritten to that location. First, according to an instruction from the control unit, the data is newly rewritten (step 101). Then, for the storage unit for which writing has been completed, the check code of the corresponding storage unit is calculated (step 102), and a correct value is stored as the check code (step 103).

【0020】次に、今回の書き込み対象の最終格納単位
のチェックコードを計算し、現在の(過去に記憶され
た)チェックコードとの比較をする(ステップ10
4)。一致していない場合には、チェックコードは現在
のままで書き換えずに、次のデータの書き換え処理に移
る(ステップ106)。一致している場合には、現在記
憶されているチェックコードと書き換えたデータにより
計算したチェックコードとが一致している場合であるか
ら、チェックコードを反転(0、1のビットを入れ替え
る)させて記憶した後、次の処理に移る(ステップ10
6)。ステップ106でデータ書き込みは完了したか否
かを判定し、データ書き込みが完了しておれば、この処
理は終了する。データ書き込みが完了していない場合
は、ステップ101に戻る。
Next, the check code of the final storage unit to be written this time is calculated and compared with the current (previously stored) check code (step 10).
4). If they do not match, the check code remains as it is and is not rewritten, and the process proceeds to rewriting the next data (step 106). If they match, it means that the currently stored check code and the check code calculated by the rewritten data match, so the check code is inverted (0 and 1 bits are exchanged). After storing, move to the next process (step 10
6). In step 106, it is determined whether or not the data writing is completed, and if the data writing is completed, this process ends. If data writing has not been completed, the process returns to step 101.

【0021】すなわち、本実施例では、図3の〈中間状
態〉において、2番目の格納単位のチェックコード02
(h)をFD(h)に変えて格納しておく。これによ
り、このデータを読みだした際には、2番目の格納単位
について、計算結果と格納されているチェックコードの
比較において、不一致と判断されるため、NGの通知が
可能となる。
That is, in this embodiment, the check code 02 of the second storage unit in the <intermediate state> of FIG.
(H) is changed to FD (h) and stored. As a result, when this data is read, it is determined that the second storage unit is inconsistent in the comparison between the calculation result and the stored check code, so that NG can be notified.

【0022】なお、該当データで書き込みが完了する場
合には、比較処理は行わず、正常なチェックコードを格
納することとする。
When the writing is completed with the corresponding data, the comparison process is not performed and a normal check code is stored.

【0023】この図1を図4と比較した場合、チェック
コードが一致することはないために、同じ時点で書き込
みが中断されても、そのレコードの読みだしを行った場
合、従来から備わっているチェックコードの比較により
異常が検出されることになる。
When this FIG. 1 is compared with FIG. 4, since the check codes do not match, even if the writing is interrupted at the same point, the reading of that record is conventionally provided. An abnormality will be detected by comparing the check codes.

【0024】すなわち、データの書き込み動作がその時
点で終了(異常終了)してしまっても、該記憶単位を読
みだした時には、必ず1カ所にチェックコード不一致の
箇所が発見されるため、該記憶データの信頼性がない
旨、上位装置に通知することが可能となる。
That is, even if the data write operation ends (abnormally ends) at that point, when the storage unit is read, a check code mismatch portion is always found in one place, so the storage unit It is possible to notify the upper device that the data is not reliable.

【0025】以上、本発明を実施例に基づき具体的に説
明したが、本発明は、上記実施例に限定されるものでは
なく、その要旨を逸脱しない範囲において種々変更し得
ることはいうまでもない。
Although the present invention has been specifically described based on the embodiments, the present invention is not limited to the above embodiments, and it goes without saying that various modifications can be made without departing from the scope of the invention. Absent.

【0026】[0026]

【発明の効果】以上、説明したように、本発明によれ
ば、データの書き込みが正常に終了しなかった場合で
も、データの信頼性を高めることが可能となる。また、
従来のチェック方法に一部のデータの比較を加えるだけ
であり、それほどプログラムサイズを増すことなくデー
タの信頼性を高めることが可能となる。
As described above, according to the present invention, the reliability of data can be improved even when the writing of data is not normally completed. Also,
Only by comparing some data to the conventional check method, it is possible to increase the reliability of the data without increasing the program size so much.

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

【図1】 本発明の一実施例のデータ書き込み制御方式
を説明するための図、
FIG. 1 is a diagram for explaining a data write control system according to an embodiment of the present invention,

【図2】 本実施例のデータ書き込みのフローチャー
ト、
FIG. 2 is a flowchart of data writing according to the present embodiment,

【図3】 従来のデータ書き込み制御方式を説明するた
めの図、
FIG. 3 is a diagram for explaining a conventional data write control system,

【図4】 従来のデータ書き込み制御方式を説明するた
めの図。
FIG. 4 is a diagram for explaining a conventional data write control method.

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

1…制御コード、2…データ、3…チェックコード、4
…チェックコードの計算範囲、5…以前のデータ。
1 ... control code, 2 ... data, 3 ... check code, 4
… Check code calculation range, 5… previous data.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 記憶手段にデータを書き込む際に、デー
タ格納単位ごとのチェックコードを計算し、格納されて
いるチェックコードと比較し、もし一致している場合に
は、そのチェックコードを反転(補数に置き換える)さ
せて格納することを特徴とするデータ書き込み方式。
1. When writing data to the storage means, a check code for each data storage unit is calculated and compared with the stored check code. If they match, the check code is inverted ( A data writing method characterized by storing after being replaced by a complement).
JP3308162A 1991-11-25 1991-11-25 Data writing method Expired - Lifetime JP3055986B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3308162A JP3055986B2 (en) 1991-11-25 1991-11-25 Data writing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3308162A JP3055986B2 (en) 1991-11-25 1991-11-25 Data writing method

Publications (2)

Publication Number Publication Date
JPH05143473A true JPH05143473A (en) 1993-06-11
JP3055986B2 JP3055986B2 (en) 2000-06-26

Family

ID=17977645

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3308162A Expired - Lifetime JP3055986B2 (en) 1991-11-25 1991-11-25 Data writing method

Country Status (1)

Country Link
JP (1) JP3055986B2 (en)

Also Published As

Publication number Publication date
JP3055986B2 (en) 2000-06-26

Similar Documents

Publication Publication Date Title
KR100343377B1 (en) Data writing to non-volatile memory
US4654847A (en) Apparatus for automatically correcting erroneous data and for storing the corrected data in a common pool alternate memory array
CN100422943C (en) Latent error detection
US4877945A (en) IC card having a function to exclude erroneous recording
RU2269814C2 (en) Method for reliable recording of pointer for circular memory
US6904547B2 (en) Method and apparatus for facilitating validation of data retrieved from disk
JP3055986B2 (en) Data writing method
CN115904230A (en) Data verification method, system and device
JP2000322535A (en) Information processing method and system for ic card
JPH0316655B2 (en)
JPS60144847A (en) Cache memory control system
US6697991B1 (en) Data check circuit of magnetic disk device and data checking method of magnetic disk device
JP2794043B2 (en) Portable electronic devices
JP3358701B2 (en) Verify method and verify device
JP3154853B2 (en) Illegal memory access detection method
EP0655686B1 (en) Retry control method and device for control processor
JPH1153487A (en) Method for deciding validity of written data on ic card
JPS5856291A (en) Self-diagnosing method of memory
JP3222592B2 (en) Data verification device
JPS60207989A (en) Recording system of electronic device
JPH07141120A (en) Processing method for fault in information storage medium
CN118113207A (en) Data writing method, storage device and electronic equipment
US7426686B2 (en) System and method for verifying data integrity
CN117744086A (en) Write vulnerability processing method, electronic equipment and storage medium
TW200539607A (en) System and method for data redundancy checking and correcting

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090414

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090414

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100414

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110414

Year of fee payment: 11

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120414

Year of fee payment: 12