JPH01106132A - Data processor - Google Patents

Data processor

Info

Publication number
JPH01106132A
JPH01106132A JP62261831A JP26183187A JPH01106132A JP H01106132 A JPH01106132 A JP H01106132A JP 62261831 A JP62261831 A JP 62261831A JP 26183187 A JP26183187 A JP 26183187A JP H01106132 A JPH01106132 A JP H01106132A
Authority
JP
Japan
Prior art keywords
data
storage device
sector
disk storage
written
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
JP62261831A
Other languages
Japanese (ja)
Inventor
Ryoichi Oba
大場 良一
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP62261831A priority Critical patent/JPH01106132A/en
Publication of JPH01106132A publication Critical patent/JPH01106132A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To ensure the recovery of data at the second application of a power supply even in case the power supply is cut off while the data are written into a disk storage device by storing previously the write data into a memory backed up by the power supply. CONSTITUTION:A flag is read out during a write mode of a memory backed up by a power supply and an ON or OFF state of the flag is decided. In an ON state of the flag, it is decided that the power supply is cut off during a write mode of a disk storage device. Then the data stored in said memory backed up by a power supply is written again into the disk storage device. While in an OFF state of the flag during a write mode, a sector corresponding to the record data to be written is read out of the disk storage device to the memory backed up by a power supply. Then the record data is read out of the storage device and stored for update into a position corresponding to the sector data on the memory backed up by a power supply. The updated sector data is written into the disk storage device.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はコンピュータ装置を用いたデータ処理装置に係
り、特にディスク記憶装置のデータの保護を行うに好適
なデータ処理装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a data processing apparatus using a computer device, and particularly to a data processing apparatus suitable for protecting data in a disk storage device.

〔従来の技術〕[Conventional technology]

ディスク記憶装置を備えた・コンピュータ装置において
は、ディスク記憶装置へデータを書込中に電源が切断さ
れるど書込中のデータが破壊されることはもちろん、そ
の前後のデータも破壊される可能性があった。
In computer equipment equipped with a disk storage device, if the power is cut off while data is being written to the disk storage device, not only the data being written will be destroyed, but also the data before and after it. There was sex.

この種の技術に関するものとしては、特開昭59−35
50号、特開昭59−9564号がある。
Regarding this type of technology, Japanese Patent Application Laid-Open No. 59-35
No. 50 and Japanese Unexamined Patent Publication No. 59-9564.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来のコンピュータ装置においては、ディスク記憶装置
へデータを書き込んでいる途中で電源が切断されるとい
う点について考慮されておらず、書き込み中のデータが
破壊され、さらに書き込みデータの前後のデータも破損
される可能性があるという問題があった。
Conventional computer equipment does not take into account the fact that the power may be cut off while data is being written to the disk storage device, which can destroy the data being written and also damage the data before and after the written data. The problem was that there was a possibility that

本発明の目的は、ディスク記憶装置へデータを書き込ん
でいる途中で電源が切断されても次に電源が再投入され
た際、書き込みデータ及びその前後のデータを回復する
データ処理装置を提供することにある。
An object of the present invention is to provide a data processing device that recovers the written data and the data before and after it when the power is turned on again even if the power is turned off while writing data to a disk storage device. It is in.

〔問題点を解決するための手段〕[Means for solving problems]

上記目的は、ディスク記憶装置へデータを書き込む際、
あらかじめ電源バックアップ付記憶装置に書き込みデー
タおよびその前後のデータを記憶しておくことにより達
成される。
The above purpose is to write data to a disk storage device.
This is achieved by storing the write data and the data before and after it in advance in a storage device with power backup.

〔作用〕[Effect]

ディスク記憶装置へデータを書き込む際、まず書き込も
うとしているデータがディスク記憶装置の管理単位に変
換してどの部分に該当するか調べ該当管理単位を電源バ
ックアップ付記憶装置へ読み出し、電源バックアップ付
記憶装置上でデータを更新し、その後、ディスク記憶装
置の管理単位ごとディスク記憶装置へ書き込む。このと
き電源が切断されても、電源ばっくあっぷ行記憶装置に
は、ディスク記憶装置の管理単位分記憶されているので
、電源再投入時、再び電源バックアップ付記憶装置から
ディスク記憶装置へデータを書き込めばデータは回復さ
れる。
When writing data to a disk storage device, first convert the data you are trying to write into a management unit of the disk storage device, check which part it corresponds to, read the corresponding management unit to the storage device with power backup, and write the data to the storage device with power backup. The data is updated above, and then written to the disk storage device for each management unit of the disk storage device. Even if the power is turned off at this time, the storage device with power backup will still store data for the management unit of the disk storage device, so when the power is turned on again, the data will be transferred from the storage device with power backup to the disk storage device again. Once written, the data will be recovered.

〔実施例〕〔Example〕

以下、図に示す本発明の一実施例について説明する。 An embodiment of the present invention shown in the drawings will be described below.

第2図は本発明を適用したデータ処理装置の全体構成を
示すブロック図である。cpuは処理装置であり、記憶
装置RAMに記憶したプログラムに基づいて、また必要
に応じてディスク記憶装置DMからデータを読み出した
り、記憶装置RAMなどに記憶されているデータを書き
込んだりする。
FIG. 2 is a block diagram showing the overall configuration of a data processing device to which the present invention is applied. The CPU is a processing device that reads data from the disk storage device DM or writes data stored in the storage device RAM, etc., based on a program stored in the storage device RAM and as needed.

電源バックアップ付記憶装置SRAMは機能的には記憶
装置RAMと同等であるが、電源バックアップされてお
り、電源を切っても記憶内容が消失しない不揮発形記憶
装置である。
The storage device SRAM with power backup is functionally equivalent to the storage device RAM, but it is a nonvolatile storage device that has power backup and does not lose its stored contents even when the power is turned off.

第3図は、本実施例に示すデータ処理装置のソフトウェ
ア構成である。オペレーティングシステムO5は、種々
の処理プログラムより発行される種々のハードウェア操
作命令を受け、全てのハードウェア操作を一括して処理
する管理プログラムである。DPで示されるデータ保護
手段は、本実施例の主要部であり、ディスク記憶装置D
Mへデータを書き込む場合に定められた手順で処理プロ
グラムAPよりデータ保護手段DPへデータを書込要求
が発行されることにより所定の機能を達成する。ステッ
プlおよび2は、処理プログラムAPからディスク記憶
装置DMへデータ書込要求が発行された場合の処理の流
れを示す。ステップ3は、それ以外のハードウェア操作
要求が処理プログラムAPから発行された場合の処理の
流れを示す。
FIG. 3 shows the software configuration of the data processing apparatus shown in this embodiment. The operating system O5 is a management program that receives various hardware operation instructions issued by various processing programs and processes all hardware operations at once. The data protection means indicated by DP is the main part of this embodiment, and the data protection means is the main part of this embodiment.
When writing data to M, a predetermined function is achieved by issuing a data write request from the processing program AP to the data protection means DP according to a predetermined procedure. Steps 1 and 2 show the flow of processing when a data write request is issued from the processing program AP to the disk storage device DM. Step 3 shows the flow of processing when another hardware operation request is issued from the processing program AP.

第1図は本実施例で扱うディスク記憶装置DMの記憶領
域の構成を示すものである。Si Siオ。
FIG. 1 shows the configuration of the storage area of the disk storage device DM used in this embodiment. Si Si O.

で示すセクタは、物理的な管理単位でオペレーティング
システムDSは、この単位でディスク記憶装置DMとや
りとりを行う。r j+ r j+1等で示すレコード
は論理的な管理単位でその長さは種々の処理プログラム
で自由に定められる。論理単位であるレコードと物理単
位であるセクタとの間の変換は通常管理プログラムであ
るオペレーティングシステムO3によって行われている
The sector indicated by is a physical management unit, and the operating system DS communicates with the disk storage device DM in this unit. A record indicated by r j+ r j+1, etc. is a logical management unit, and its length can be freely determined by various processing programs. Conversion between a logical unit, a record, and a physical unit, a sector, is normally performed by the operating system O3, which is a management program.

第4図に示すデータ保護手段DPの実行にあたっては、
記憶装置RAMおよび電源バックアップ付記憶装置SR
AMに種々の記憶部を設定する。
In implementing the data protection means DP shown in Figure 4,
Storage device RAM and storage device SR with power backup
Set up various storage units in AM.

第8図は記憶装置RAM設定する記憶部であり、以下こ
れらの記憶部について説明する。セクタ長SLはディス
ク記憶装置が管理する物理的単位である中、フタの長さ
である。レコード長RLは種々の処理プログラムが扱う
論理的な記憶単位であるレコードの長さである。レコー
ドNaRNOは処理プログラムAPがディスク記憶装置
DMへ書き込もうとしているレコードの先頭からの位置
である。
FIG. 8 shows storage units for setting the storage device RAM, and these storage units will be explained below. The sector length SL is a physical unit managed by the disk storage device, and is the length of the lid. The record length RL is the length of a record, which is a logical storage unit handled by various processing programs. Record NaRNO is the position from the beginning of the record that the processing program AP is attempting to write to the disk storage device DM.

レコードバッファRBuFFは、ディスク記憶装置DM
へ書き込もうとしているレコードの内°容を記憶するた
めのバッファである。第9図は電源バックアップ付記憶
装置SRAMに設定する記憶部であり、以下これらの記
憶部について説明する。
The record buffer RBuFF is a disk storage device DM.
This is a buffer for storing the contents of the record that is about to be written to. FIG. 9 shows storage units set in the storage device SRAM with power backup, and these storage units will be explained below.

書込中フラグWFは現在、ディスク記憶装置DMへデー
タを書込中か否かを示すフラグである。有効セクタNo
、 S N Oは、セクタバッファ5BuFFに格納さ
れているセクタデータのデータの先頭からの位置を示す
。有効セクタ数5CNTは、セクタバッファ5BuFF
に格納されているセクタデータの数を示す。セクタバッ
ファ5BuFFはディスク記憶装置DMへ書き込もうと
しているセクタデータの内容を記憶するためのバッファ
である。
The writing flag WF is a flag indicating whether or not data is currently being written to the disk storage device DM. Valid sector number
, S NO indicates the position from the beginning of the sector data stored in the sector buffer 5BuFF. The number of effective sectors 5CNT is the sector buffer 5BuFF.
Indicates the number of sector data stored in. The sector buffer 5BuFF is a buffer for storing the contents of sector data to be written to the disk storage device DM.

以下、これらを参照し、データ保護手段DPについて説
明する。第4図にデータ保護手段DPのフローチャート
を示す。ここで、データ保護手段、が実行される前にあ
らかじめ記憶装置RAMのセクタ長SL、レコード長R
L、レコードNαRNOは処理プログラムAPにより既
定の値が設定されていることとする。また、記憶装置R
AMのレコードバッファRBuFFには処理プログラム
APによりディスク記憶装置DMへ書き込むべきレコー
ドデータが設定されていることとする。まず、ステップ
10で電源バックアップ付記憶装置SRAMの書込中フ
ラグWFを読み出し、フラグがONか否か判定する。こ
のフラグがONの時は前回ディスク記憶装置DMへ書込
み中に電源がきれたということを示しているので、ステ
ップ20で電源バックアップ付記憶装置SRAMに記憶
されている有効セクタNa5NO,有効セクタ数5CN
Tを用いてセクタバッファ5BuFFに記憶されている
セクタデータを再度ディスク記憶装置DMへ書き込む。
The data protection means DP will be explained below with reference to these. FIG. 4 shows a flowchart of the data protection means DP. Here, before the data protection means is executed, the sector length SL and record length R of the storage device RAM are set in advance.
It is assumed that the record NαRNO is set to a default value by the processing program AP. In addition, storage device R
It is assumed that record data to be written to the disk storage device DM is set in the record buffer RBuFF of the AM by the processing program AP. First, in step 10, the writing flag WF of the storage device SRAM with power backup is read out, and it is determined whether the flag is ON or not. When this flag is ON, it indicates that the power was cut off while writing to the disk storage device DM last time, so in step 20, the valid sectors Na5NO and the number of valid sectors 5CN stored in the storage device SRAM with power backup are
The sector data stored in the sector buffer 5BuFF is written to the disk storage device DM again using T.

その後、今回の書き込み処理へ戻る。ステップ10で書
込み中フラグWF、がOFFならば、前回の書き込み処
理は正常に終了しているので、ステップ30を実行する
。ステップ30では、記憶装置RAMへ記憶されている
セクタ長SL、レコード長RL、レコードN11RNO
を用いて、書き込もうとしているレコードデータがどの
セクタに該当するか計算し、電源バックアップ付記憶装
置SRAMの有効セクタNLIS N Oへ格納する。
After that, the process returns to the current write process. If the writing flag WF is OFF in step 10, the previous writing process has ended normally, so step 30 is executed. In step 30, the sector length SL, record length RL, and record N11RNO stored in the storage device RAM are
is used to calculate which sector the record data to be written corresponds to and store it in a valid sector NLIS N O of the storage device SRAM with power backup.

次にステップ40で、書き込もうとしているレコードが
セクタ間にまたがるようなものか否か判定する。セクタ
間にまたがるならば、ステップ50で電源バックアップ
付記憶装置SRAMの有効セクタ数5CNTに2をセッ
トする。セクタ間にまたがらなければ、ステップ60で
電源バックアップ付記憶装置SRAMの有効セクタ数5
CNTに1をセットする。次にステップ70で書き込も
うとしているレコードデータが該当するセクタをディス
ク記憶装置DMより電源バックアップ付記憶装置SRA
Mのセクタバッファ5BuFFへ読み込む。次にステッ
プ80で、記憶装置RAMのレコードバッファRBuF
Fよりレコードデータを読み出し、ステップ70で読み
出した電源バックアップ付記憶装置SRAM。
Next, in step 40, it is determined whether the record to be written spans between sectors. If the data spans between sectors, in step 50, the number of effective sectors 5CNT of the storage device SRAM with power backup is set to 2. If it does not span between sectors, in step 60 the effective number of sectors of the storage device SRAM with power backup is 5.
Set CNT to 1. Next, in step 70, the sector corresponding to the record data to be written is transferred from the disk storage device DM to the storage device SRA with power backup.
Read into sector buffer 5BuFF of M. Next, in step 80, the record buffer RBuF of the storage device RAM is
The record data is read from F, and the storage device SRAM with power backup is read out in step 70.

のセクタバッファ5BuFFのセクタデータの該当する
位置へ格納し、セクタデータを更新する。
The sector data is stored in the corresponding position of the sector buffer 5BuFF, and the sector data is updated.

つぎにステップ90で電源バックアップ付記憶装置SR
AMに記憶されている有効セクタN(L S N O、
有効セクタ数5CNTを用いて、更新されたセクタバッ
ファ5BuFFのないようをディスク記憶装置DMへ書
き込む。
Next, in step 90, the storage device SR with power backup
Valid sector N (L S N O,
Using the effective sector number 5CNT, the updated sector buffer 5BuFF is written to the disk storage device DM.

以下、第4図に示す各ステップで実行される各手段を詳
細に説明する。第5図のステップ30で実行されるセク
タ階取得処理手段5ECCALの詳細を示すフローチャ
ートである。ステップ10で記憶装置RAMに記憶され
ているレコードNo、 RN Oとレコード長RLを掛
け、その値をセクタ長SLで割った商を処理プログラム
APが書き込もうとしているレコードに8亥当するセク
タNαとして電源バックアップ付記憶装置sRAMの有
効セクタNo。
Hereinafter, each means executed in each step shown in FIG. 4 will be explained in detail. 6 is a flowchart showing details of the sector floor acquisition processing means 5ECCAL executed in step 30 of FIG. 5. FIG. In step 10, the record No. RN O stored in the storage device RAM is multiplied by the record length RL, and the quotient is divided by the sector length SL to determine the sector Nα corresponding to the record that the processing program AP is about to write. as the effective sector number of the storage device sRAM with power backup.

SNOへ格納する。Store in SNO.

第6図は第4図のステップ20とステップ90で実行さ
れるセクタ書込処理手段5ECWRの詳細を示すフロー
チャートである。ステップ10でセクタ書込処理を開始
したことを示すため、電源バックアップ付記憶装置SR
AM0書込中フラグWFをONにする。ステップ20で
電源バックアップ付記憶装置SRAMに記憶されている
有効セクタNαSNOから有効セクタ数5CNT分セク
タバッファ5BuFFよりディスク記憶装置DMへデー
タを書き込む。ステップ30で、セクタ書込処理が正常
終了したことを示すため、電源バックアップ付記憶装置
SRAM0書込中フラグWFをOFFにする。
FIG. 6 is a flowchart showing details of the sector write processing means 5ECWR executed in step 20 and step 90 of FIG. In order to indicate that the sector write process has started in step 10, the storage device SR with power backup
Turn on the AM0 writing flag WF. In step 20, data is written from the sector buffer 5BuFF to the disk storage device DM by the number of effective sectors NαSNO stored in the storage device SRAM with power backup. In step 30, the writing flag WF of the storage device with power backup SRAM0 is turned OFF to indicate that the sector writing process has ended normally.

第7図は第4図のステップ70で実行されるセク夕読込
処理手段5ECRDの詳細を示すフローチャートである
。ステップ10で電源バックアップ付記憶装置SRAM
に記憶されている有効セクタNo。
FIG. 7 is a flowchart showing details of the sector reading processing means 5ECRD executed in step 70 of FIG. In step 10, the storage device SRAM with power backup
Valid sector number stored in .

SNOから有効セクタ数5CNT分ディスク記憶装置D
Mよりセクタバッファ5BuFFにデータを読み込む。
Disk storage device D with effective sector count 5CNT from SNO
Read data from M into sector buffer 5BuFF.

以上の説明から明らかなように本実施例によれば、ディ
スク記憶装置へ書込中に電源がきれてもデータが破壊さ
れることなしに正常に回復することができ、データの保
護を実現することができる。
As is clear from the above description, according to this embodiment, even if the power is cut off while writing to the disk storage device, the data can be restored normally without being destroyed, and data protection is realized. be able to.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、ディスク記憶装置へデータを書込中に
電源が切断されてもデータを回復できるのでデータの信
頬性を向上させることができる。
According to the present invention, even if the power is cut off while data is being written to a disk storage device, the data can be recovered, thereby improving the reliability of the data.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は、ディスク記憶装置の構成図、第2図は、本実
施例の処理装置構成図、第3図は、本実施例のソフトウ
ェア構成図、第4図は、データ保護手段のフローチャー
ト、第5図は、セクタ阻取得処理手段のフローチャート
、第6図は、セクタ書込処理手段のフローチャート、第
7図は、セクタ読込処理手段のフローチャート、第8図
は、記憶装置の記憶内容を示す図、第9図は、電源バッ
クアップ付記憶装置の記憶内容を示す図である。 cpu・・・処理装置、DM・・・ディスク記憶装置、
RAM・・・記憶装置、SRAM・・・電源バックアッ
プ付記憶装置。 代理人 弁理士  秋 本 正 実
FIG. 1 is a configuration diagram of a disk storage device, FIG. 2 is a configuration diagram of a processing device of this embodiment, FIG. 3 is a software configuration diagram of this embodiment, and FIG. 4 is a flowchart of data protection means. FIG. 5 is a flowchart of the sector acquisition processing means, FIG. 6 is a flowchart of the sector write processing means, FIG. 7 is a flowchart of the sector read processing means, and FIG. 8 shows the storage contents of the storage device. 9 are diagrams showing the storage contents of the storage device with power backup. cpu...processing device, DM...disk storage device,
RAM...Storage device, SRAM...Storage device with power backup. Agent Patent Attorney Masami Akimoto

Claims (1)

【特許請求の範囲】 1、プログラム及びデータ格納用の第1のメモリと、こ
のメモリとの間でデータ授受を行い処理するCPUと、
ディスクメモリと、該ディスクメモリとCPUとの間に
介在しデータの一時記憶を行うバッファと、を有するデ
ータ処理装置において、 上記バッファを不揮発性メモリで構成し、且つ該バッフ
ァ上には、該バッファから前記ディスクメモリへのデー
タ書込み時にONとなり、書込み完了時にOFFとなる
フラグ記憶部を設け、前記ディスクメモリのアクセス時
に該フラグ記憶部がONであれば該バッファ上の前回の
データを前記ディスクメモリへ送り且つ引き続き今回の
データを送り、OFFであれば今回のデータを前記ディ
スクメモリへ送るデータ処理装置。
[Claims] 1. A first memory for storing programs and data, and a CPU that processes and exchanges data with this memory;
In a data processing device having a disk memory and a buffer interposed between the disk memory and a CPU for temporarily storing data, the buffer is configured of a non-volatile memory, and the buffer is provided on the buffer. A flag storage section is provided that is turned ON when data is written to the disk memory and turned OFF when writing is completed, and if the flag storage section is ON when the disk memory is accessed, the previous data on the buffer is transferred to the disk memory. A data processing device that sends the current data to the disk memory and continues to send the current data, and if it is OFF, sends the current data to the disk memory.
JP62261831A 1987-10-19 1987-10-19 Data processor Pending JPH01106132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62261831A JPH01106132A (en) 1987-10-19 1987-10-19 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62261831A JPH01106132A (en) 1987-10-19 1987-10-19 Data processor

Publications (1)

Publication Number Publication Date
JPH01106132A true JPH01106132A (en) 1989-04-24

Family

ID=17367342

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62261831A Pending JPH01106132A (en) 1987-10-19 1987-10-19 Data processor

Country Status (1)

Country Link
JP (1) JPH01106132A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0367323A (en) * 1989-08-04 1991-03-22 Fujitsu Ltd Input/output control system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0367323A (en) * 1989-08-04 1991-03-22 Fujitsu Ltd Input/output control system

Similar Documents

Publication Publication Date Title
US6016536A (en) Method for backing up the system files in a hard disk drive
JPH0291749A (en) Nonvolatile type semiconductor memory device
JPH06250906A (en) Backup/recovery system for data developed in main storage device
JPH01106132A (en) Data processor
JPH0572634B2 (en)
JPH04147495A (en) Data recording method in ic memory card and ic memory card system
JPH06180674A (en) Data storage device
JPH10161942A (en) Method, device for storing information, and information processor
JPS62125452A (en) Data back-up system for storage device
JP3074817B2 (en) File backup circuit
JP3022011B2 (en) Data backup system
JPH053611B2 (en)
JP4009401B2 (en) Disk control apparatus and recording medium recording program
JPH0731640B2 (en) Disk access control method
JPH02245954A (en) Semiconductor storage device
JP3009168B2 (en) Data processing device
JPH0449451A (en) Electronic disk subsystem
JPH03192447A (en) Variable length data processor
JPS6195464A (en) Data protecting system
JPH039433A (en) Information processor
JPH0341538A (en) Main storage device
JPH08335195A (en) Data transfer device for remote file
JPH10312693A (en) Storage device
JPH01300352A (en) Dump area instruction control system
JPH02123426A (en) Microprocessor