JPH0447428A - File updating device - Google Patents

File updating device

Info

Publication number
JPH0447428A
JPH0447428A JP2152673A JP15267390A JPH0447428A JP H0447428 A JPH0447428 A JP H0447428A JP 2152673 A JP2152673 A JP 2152673A JP 15267390 A JP15267390 A JP 15267390A JP H0447428 A JPH0447428 A JP H0447428A
Authority
JP
Japan
Prior art keywords
record
update
file
status
state
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
JP2152673A
Other languages
Japanese (ja)
Inventor
Yoshiaki Yuyama
好章 湯山
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2152673A priority Critical patent/JPH0447428A/en
Publication of JPH0447428A publication Critical patent/JPH0447428A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To automatically execute the restoration processing at a high speed by holding a record state before updating at the time of updating a file, and restoring releasing the file by discriminating the record state, in the case an error is generated. CONSTITUTION:At the time of updating a file by an updating record, a record before updating is saved in a backup memory 22, and thereafter, in accordance with the updating kind instructed by a record unit, the file is updated. At the time of updating this file, a state of each updating record is detected by referring to an updating state table 13 and a record state table 14, and held in an updating state management memory 21. In such a state, when an error is generated at the time of updating the file, a restoration processing of the file is executed, based on a record state stored in the memory 21. In such a way even if an error is generated at the time of updating the record on the file, the restoration processing can be executed automatically and at a high speed.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、オフィスコンピュータ等において、ファイル
上のレコード更新中にエラーが発生した場合、そのファ
イルを復旧する機能を備えたファイル更新装置に関する
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a file update device that has a function of restoring a file when an error occurs while updating a record on a file in an office computer or the like.

[発明の概要コ 本発明のファイル更新装置は、ファイル更新時、更新前
のファイルに対するレコード状態をレコード単位で保持
しておき、ファイル復旧時に、上記各レコード状態を判
別して直ちにファイルを復旧するようにしたものである
[Summary of the Invention] When updating a file, the file updating device of the present invention maintains the record status of the file before the update on a record-by-record basis, and when restoring the file, determines each of the above record status and immediately restores the file. This is how it was done.

[従来技術] 従来のオフィスコンピュータ等におけるファイル更新装
置は、既に作成されているファイルに対して更新を行な
う場合、他のプロセスによりデータが書替えられないよ
うにファイル全体にロックを掛け、ファイル単位にレコ
ード情報を全て更新させ、エラー(矛盾)が発生した場
合、そのエラーとなったレコードをNGレコードとして
別のファイルに保存しておき、全ての更新が終了した段
階で保存されたNGレコードをプリンタ等に出力させ、
その後のりカバリ−はユーザーが行なうようになってい
る。ファイルが重要で、その復旧を確実に行ないたい場
合は、ユーザーがファイル更新に際して予めファイル単
位にバックアップをとっておき、エラーが発生するとバ
ックアップデータを元に戻すようにしている。
[Prior Art] When updating a file that has already been created, a conventional file update device in an office computer, etc. locks the entire file to prevent the data from being rewritten by other processes, and updates the file on a file-by-file basis. If all record information is updated and an error (inconsistency) occurs, save the record with the error as an NG record in a separate file, and then print the saved NG record when all updates are completed. etc., output it to
After that, the user is responsible for repairing the adhesive. If a file is important and the user wants to restore it reliably, the user backs up each file before updating the file, and then restores the backup data if an error occurs.

[発明が解決しようとする課題] 従来のファイル更新装置は、上記のようにファイル更新
によりエラーが発生すると、更新終了後にNGレコード
を出力してユーザーに知らせるだけであり、その後の処
理はユーザーが行なわなければならず、ファイルの復旧
操作が非常に面倒であると共に、復旧に時間がかかると
いう問題があった。
[Problems to be Solved by the Invention] When an error occurs due to a file update as described above, the conventional file update device simply outputs an NG record to notify the user after the update is completed, and the subsequent processing is left to the user. However, there are problems in that the file recovery operation is extremely troublesome and takes a long time.

このような原因は、ファイル更新に際してユーザーが予
めファイルのバックアップをとるという操作を行なわな
ければならず、また、エラーが発生した場合には、デー
タ容量が大きいファイル単位でエラー復旧を行なうとこ
ろにあると考えられる。
The reason for this is that when updating a file, the user must back up the file in advance, and when an error occurs, error recovery is performed in units of files with large data volumes. it is conceivable that.

してみれば、ファイル更新時に更新前のレコード状態を
レコード単位で保持しておき、エラーが発生した場合に
は、上記各レコード状態を判別してファイルを自動的に
復旧させることにより、ユーザーは復旧操作を行なうこ
となく、ファイルの復旧を迅速に行なわせ得ることは明
らかである。
When updating a file, the record status before the update is maintained for each record, and if an error occurs, the user can automatically recover the file by determining the record status above. It is clear that files can be quickly recovered without performing any recovery operations.

本発明の課題は、ファイル上のレコードを更新している
際にエラーが発生した場合、その復旧処理を自動的に、
かつ、高速で実行し得るファイル更新装置を提供するこ
とである。
An object of the present invention is to automatically perform recovery processing when an error occurs while updating a record on a file.
Another object of the present invention is to provide a file update device that can be executed at high speed.

[課題を解決するための手段] 本発明の手段は次の通りである。[Means to solve the problem] The means of the present invention are as follows.

(1) 更新用レコードによるファイル更新時、更新前
のレコードを別途保存した上で、レコード単位で指示さ
れた更新種に応じてファイル更新を行なうファイル更新
手段。
(1) A file update means that, when updating a file using an update record, separately saves the record before update and then updates the file according to the update type specified for each record.

例えば更新前のレコードを保存するバックアップメモリ
22、更新用レコードファイル16がら読出される更新
用レコードの更新種に応じて動作するCPUI 1であ
る。
For example, the CPU 1 operates according to the type of update of the update record read out from the backup memory 22 and the update record file 16, which stores records before update.

(2) 上記ファイル更新時、各更新レコードに対応し
て そのレコードが更新前のファイルに存在してファイルか
ら削除すべきものなのか、 そのレコードが更新前のファイルに存在して書替えられ
たものなのか、 そのレコードが更新前のファイルに存在せず、追加され
たものなのか、 の何れかの状態を保持する状態保持手段。
(2) When updating the above file, for each updated record, check whether the record exists in the file before the update and should be deleted from the file, or whether the record exists in the file before the update and has been rewritten. A state retention means that maintains either of the following states: or whether the record did not exist in the file before the update and was added.

例えば更新状態テーブル13及びレコード状態テーブル
14を参照して状態を保持する更新状態レジスタ17、
レコード状態レジスタ18である。
For example, an update status register 17 that holds the status by referring to the update status table 13 and the record status table 14;
This is the record status register 18.

(3) ファイル復旧時、更新済みの各レコード状態を
判別し、 追加状態であれば、そのレコードを削除して、この追加
状態を解除し、 書替状態であれば、更新時に保持された更新前のレコー
ドに書替えて、この書替状態を解除し、削除状態であれ
ば、この削除状態を解除する状態解除手段。
(3) When restoring a file, determine the state of each updated record, and if it is in an added state, delete that record to cancel the added state, and if it is in a rewritten state, delete the updates that were retained at the time of update. A state canceling means that rewrites the previous record to cancel the rewritten state, and if it is a deleted state, cancels the deleted state.

例えば更新状態管理メモリ21に記憶された各レコード
状態を判別して動作するCPUI 1である。
For example, the CPU 1 operates by determining the status of each record stored in the update status management memory 21.

[作用〕 本発明の手段の作用は次の通りである。[Effect] The operation of the means of the invention is as follows.

更新用レコードによりファイルを更新する際、更新前の
レコードがバックアップメモリに保存され、その後、レ
コード単位で指示された更新種に応じてファイル更新が
行なわれる。このファイル更新時、各更新レコードの状
態が更新状態テーブル、レコード状態テーブルを参照し
て検出され、更新状態管理メモリに保持される。
When updating a file using an update record, the record before the update is saved in the backup memory, and then the file is updated according to the update type specified for each record. When this file is updated, the status of each updated record is detected by referring to the update status table and the record status table, and is held in the update status management memory.

そして、ファイル更新時にエラーが発生すると、上記更
新状態管理メモリに記憶されているレコード状態に基づ
いてファイルの復旧処理が行なわれる。
If an error occurs during a file update, file recovery processing is performed based on the record status stored in the update status management memory.

[実施例] 以下、一実施例を第1図ないし第8図を参照しながら説
明する。
[Example] An example will be described below with reference to FIGS. 1 to 8.

第1図は、全体の構成を示すブロック図である。FIG. 1 is a block diagram showing the overall configuration.

同図において、符号11は回路全体の制御を行なうCP
Uで、このCPUI 1にはパスライン12を介して更
新状態テーブル13、レコード状態テーブル14、更新
用レコードレジスタ15、更新用レコードファイル16
、更新状態レジスタ17、レコード状態レジスタ18、
更新用バッファ19、ワークメモリ20、更新状態管理
メモリ21、ノ(ツタアップメモリ22、ソースファイ
ル23が接続される。
In the figure, reference numeral 11 indicates a CP that controls the entire circuit.
U, this CPU 1 is connected to an update state table 13, a record state table 14, an update record register 15, and an update record file 16 via a pass line 12.
, update status register 17, record status register 18,
An update buffer 19, a work memory 20, an update state management memory 21, an ivy-up memory 22, and a source file 23 are connected.

更新状態テーブル13には、第2図(a)、(b)に示
す更新状態テーブルI、■が設定される。
In the update state table 13, update state tables I and 2 shown in FIGS. 2(a) and 2(b) are set.

第2図(a)の更新状態テーブルは、同一ファイルの同
一レコードに対して最初の処理を実行する時の管理状態
を示すもので、更新種とファイル上のレコードの有無に
よって「削」、「追」、r訂」、「集」、「エラー」の
状態が設定されている。これらの各状態において、 「削」 :削除を意味し、レコードなしの状態にする、 「追」:追加を意味し、レコードを新規に作成する、 r訂」:訂正を意味し、対象レコードのフィールドの値
にフィールドの内容を修正する、「集」:集計で対象レ
コードのフィールドの値を加算する、 ことを示している。
The update status table in Figure 2(a) shows the management status when the first process is executed on the same record in the same file, and depending on the update type and the presence or absence of a record on the file, it shows the management status of "delete", "delete", " The following states are set: ``additional'', ``revised'', ``collection'', and ``error''. In each of these states, ``delete'': means deletion, leaving a state with no record; ``add'': means addition, creating a new record; Modify the field contents to the field value, "Collection": Indicates that the field value of the target record is added in the aggregation.

また、更新種としては、■「削除」、■「追加」、■「
追加・訂正」、■「追加・集計」、■U訂正」、■「集
計」の6種類がある。
In addition, the update types include ■"Delete", ■"Add", ■"
There are six types: ``Addition/Correction'', ■``Addition/Tally'', ■U Correction'', and ■``Tally''.

上記更新種は、更新用レコードの作成に際して次のよう
な使い分けを行なう。
The above update types are used as follows when creating an update record.

追加;該当キーのレコードがファイル内に無ければ追加
したいが、有れば更新の必要が無い場合。
Add: If there is no record with the corresponding key in the file, you want to add it, but if there is, there is no need to update it.

訂正、削除、集計:該当キーのレコードがファイル内に
有れば更新処理(訂正、削除、集計)したいが、無けれ
ば更新の必要が無い場合。
Correction, deletion, aggregation: If there is a record with the relevant key in the file, you want to update it (correction, deletion, aggregation), but if there is no record, there is no need to update it.

追加・訂正、追加・集計:該当キーのレコードにより必
ず更新する必要が有る場合。
Addition/Correction, Addition/Aggregation: When it is necessary to update the record of the corresponding key.

上記更新状態テーブルIにおいて、例えば今回の更新種
が「削除」の場合、ファイル上のレコードがあれば「削
除」、レコードが無ければ「エラー」として更新状態を
認識する。
In the update status table I, for example, if the current update type is "delete", the update status is recognized as "delete" if there is a record on the file, and as "error" if there is no record.

第2図(b)に示す更新状態テーブル■は、更新種と前
回の更新状態との関係を示している。同一レコードに対
して2回目以降の更新を行なう場合、前回のレコード状
態と今回の更新種によりレコード状態を認識するもので
、その際に更新状態テーブル■が使用される。なお、今
回の更新種が「削除」で、前回のレコード状態が「追」
、r訂」、「集」であること、及び今回の更新種が「追
加」で、前回のレコード状態が「訂」、「集」であるこ
とは、更新種が■「削除」■「追加」 ■「追加・訂正
」 ■「追加・集計」、■「訂正」、■「集計」の昇順
にソートされていることを前提としているために論理的
に有り得ないので、状態設定は行なっていない。
The update state table (2) shown in FIG. 2(b) shows the relationship between the update type and the previous update state. When updating the same record for the second time or later, the record status is recognized based on the previous record status and the current update type, and the update status table (2) is used at this time. Please note that the update type this time is "Delete" and the previous record status is "Add".
, r-revised", "collection", and the current update type is "addition", and the previous record status was "revised", "collection". ” ■ “Add/Correct” ■ “Add/Tally” ■ “Correction” ■ “Tally” Sort in ascending order, so it is logically impossible, so the status is not set. .

上記更新状態テーブル■において、今回の高新種が例え
ば「訂正」の場合、前回の更新状態が「削」であれば「
エラー」 それ以外であれば「訂正」として更新状態を
認識する。
In the update status table ■ above, if the current high-new species is, for example, "correction", and the previous update status is "deleted", then "
"Error" Otherwise, the update status is recognized as "Correction".

また、レコード状態テーブル14には、第3図(a)、
(b)に示すレコード状態テーブルI。
In addition, the record status table 14 includes FIG. 3(a),
Record status table I shown in (b).

■が設定される。■ is set.

第3図(a)のレコード状態テーブルIは、同一ファイ
ルの同一レコードに対して最初の処理を実行する時のレ
コード状態を示すもので、上記6種の更新種とファイル
上のレコードの有無によってrDELJ   rエラー
」、rRWTJ、rAPDJ状態が決定される。これら
の各状態において、 DEL:ファイル上のレコード削除、 エラー:は論理的矛盾発生、 RWT :ファイル上のレコード書替、APD :ファ
イルへのレコード追加、を示している。
Record status table I in Figure 3(a) shows the record status when the first process is executed for the same record in the same file, and it shows the record status depending on the six types of updates mentioned above and the presence or absence of records on the file. rDELJ rError, rRWTJ, rAPDJ status is determined. In each of these states, DEL: Deletion of a record on a file, Error: Occurrence of a logical contradiction, RWT: Rewriting of a record on a file, APD: Addition of a record to a file.

そして、第3図(b)に示すレコード状態テーブル■は
、更新種と前回のレコード状態との関係を示している。
The record status table (2) shown in FIG. 3(b) shows the relationship between the update type and the previous record status.

同一レコードに対して2回目以降の更新を行なう場合、
前回のレコード状態と今回の更新種によりレコード状態
を認識するもので、その際にレコード状態テーブル■が
使用される。
When updating the same record for the second time or later,
The record status is recognized based on the previous record status and the current update type, and the record status table ■ is used at this time.

なお、今回の更新種が「削除」の場合、前回のレコード
状態がrAPDJ、rRWTJであることは、上記した
ように更新種によりソートされていることを前提として
いるために論理的に有り得ないので、状態設定は行なっ
ていない。
Note that if the current update type is "delete", it is logically impossible for the previous record status to be rAPDJ, rRWTJ, since it is assumed that the records are sorted by update type as described above. , no state setting is performed.

更新状態管理メモリ21には、第4図に示すようにファ
イル識別子21a1対象レコードのレングス21b1対
象レコードのキーワード数21c。
As shown in FIG. 4, the update status management memory 21 contains a file identifier 21a, a length 21b of the target record, and a number of keywords 21c of the target record.

対象レコードのレコード番号21d、更新状態21e、
レコード状態21fが、更新対象レコードの数だけ設定
される。上記ファイル識別子21aは更新対象ファイル
のオーブン時の識別子、対象レコードのレングス21b
はバックアップした更新対象レコードのレングス、対象
レコードのキーワード数21cは更新対象レコードのキ
ーワード数、対象レコードのレコード番号21dは更新
対象レコードの物理レコード番号を示している。
Record number 21d of target record, update status 21e,
The record status 21f is set for the number of records to be updated. The above file identifier 21a is the oven identifier of the file to be updated, and the length 21b of the target record.
indicates the length of the backed up record to be updated, the number of keywords in the record to be updated 21c indicates the number of keywords in the record to be updated, and the record number 21d of the record to be updated is the physical record number of the record to be updated.

また、更新状態21eは第2図における「削除」、「追
加」、「訂正」、「集計」の状態を示し、レコード状態
21fは第3図における更新レコードの状態モードを示
している。
Further, the update status 21e indicates the status of "deletion", "addition", "correction", and "totalization" in FIG. 2, and the record status 21f indicates the status mode of the update record in FIG. 3.

更新用レコードファイル16には、第5図に示すように
「ファイル名」、「更新種」、「キーワードK」、「デ
ータワードA」〜「データワードG」からなる更新用レ
コードが記憶される。
As shown in FIG. 5, the update record file 16 stores update records consisting of "file name", "update type", "keyword K", and "data word A" to "data word G". .

また、ソースファイル23には、第6図に示すように「
キーワードK」、「データワードA」〜「データワード
G」からなるソースレコードが記憶される。
Also, in the source file 23, as shown in FIG.
A source record consisting of "keyword K" and "data word A" to "data word G" is stored.

次に上記実施例の動作を説明する。Next, the operation of the above embodiment will be explained.

予め作成された更新用レコードは、更新用レコードファ
イル16に蓄えられている。そして、この更新用レコー
ドファイル16に蓄えられた更新用レコードにより、ソ
ースファイル23に対するファイル更新が行なわれる。
Update records created in advance are stored in an update record file 16. Then, the source file 23 is updated using the update record stored in the update record file 16.

以下、このファイル更新の処理動作を第7図のフローチ
ャートに従って説明する。このフローチャートは、CP
UIIの制御に従って実行される。
The processing operation of this file update will be explained below according to the flowchart of FIG. This flowchart is
Executed under the control of the UII.

まず、更新用レコードファイル16に記憶されている更
新用レコードをキー分類別に、つまり、■「削除」、■
「追加」、■「追加・訂正」、■「追加・集計」、■「
訂正」、■「集計」の昇順にソートする(ステップAl
)。上記のソート処理は、ワークメモリ20を利用して
行なわれる。
First, update records stored in the update record file 16 are classified by key classification, that is, ■ "Delete", ■
"Add", ■ "Addition/Correction", ■ "Addition/Aggregation", ■ "
Sort in ascending order of "Correction" and ■"Tally" (Step Al
). The above sorting process is performed using the work memory 20.

このソート終了後、更新用レコードファイル16から更
新用レコードを更新用レコードレジスタ15に読出しく
ステップA2)、ソースファイル23上に該当するレコ
ードが存在するが否がを判断する(ステップA3)。そ
して、このファイル上のレコードの有無と今回の更新種
に基づいて、更新状態テーブル13及びレコード状態テ
ーブル14の内のテーブルI(第2図(a)、第3図(
a)参照)より、今回の更新状態、レコード状態を読出
しくステップA4)、エラーであるか否かを判別する(
ステップA5)。この場合、更新状態テーブル13及び
レコード状態テーブル14の何れにおいても、更新種が
「追加」であればレコード有りの状態、更新種が「削除
」、「訂正」、「集計」であればレコード無しの状態が
エラーとなる。
After this sorting is completed, the update record is read from the update record file 16 into the update record register 15 (step A2), and it is determined whether the corresponding record exists in the source file 23 (step A3). Then, based on the presence or absence of records in this file and the current update type, Table I of the update status table 13 and record status table 14 (Fig. 2 (a), Fig. 3 (
Read the current update status and record status from step A4) and determine whether there is an error (see step A4).
Step A5). In this case, in both the update status table 13 and the record status table 14, if the update type is "Add", there is a record, and if the update type is "Delete", "Correction", or "Aggregation", there is no record. status is an error.

上記ステップA5でエラーと判断された場合は、詳細を
後述するステップA6のエラー処理を実行し、エラーで
なければ上記更新状態を更新状態レジスタ17に、レコ
ード状態をレコード状態レジスタ18に記憶する(ステ
ップA7)。そして、上記更新用レコードレジスタ15
に保持している更新用レコード、更新状態レジスタ17
及びレコード状態レジスタ18の保持データから第4図
に示す更新状態管理レコードを作成し、更新状態管環メ
モリ21に記憶する(ステップA8)。
If it is determined that there is an error in step A5, the error processing in step A6, which will be described in detail later, is executed, and if there is no error, the update status is stored in the update status register 17 and the record status is stored in the record status register 18 ( Step A7). Then, the update record register 15
Update records held in the update status register 17
The update state management record shown in FIG. 4 is created from the data held in the record state register 18 and stored in the update state ring memory 21 (step A8).

更に、上記レコード状態レジスタ18に保持されている
レコード状態が「RWT (書替)」、rAPD(追加
)」、rDEL(削除)」の何れであるかを判別しくス
テップA9)、rRWTJであればステップAl01r
APDJであればステップA14、rDELJであれば
ステップA18の処理に進む。
Furthermore, it is determined whether the record status held in the record status register 18 is "RWT (rewrite)", "rAPD (addition)", or "rDEL (deletion)" (step A9); if rRWTJ; Step Al01r
If it is APDJ, the process proceeds to step A14, and if it is rDELJ, the process proceeds to step A18.

上記レコード状態レジスタ18におけるレコード状態が
rRWTJでステップAIOに進んだ場合、ソースファ
イル23における更新対象ファイルの該当レコードを外
部からアクセスできないようにロックする。次いで上記
該当レコードをバックアップメモリ22に書き込んでバ
ックアップする(ステップA11)。その後、ソースフ
ァイル23から上記の該当レコードを更新用バッファ1
9に読出して、更新用レコードレジスタ15に保持して
いる更新用レコードにより修正する(ステップA12.
 A13)。
When the record status in the record status register 18 is rRWTJ and the process proceeds to step AIO, the corresponding record of the update target file in the source file 23 is locked so that it cannot be accessed from the outside. Next, the corresponding record is written to the backup memory 22 and backed up (step A11). After that, the above corresponding record is transferred from the source file 23 to the update buffer 1.
9 and corrected using the update record held in the update record register 15 (step A12.
A13).

上記レコード状態レジスタ18におけるレコード状態が
rAPDJでステ・ツブA14に進んだ場合、ソースフ
ァイル23における対象ファイルを更新し、その該当レ
コードを口・ツクする(ステ、ツブA15)。次いで上
記該当レコードをノ<・ンクア・ノブメモリ22に書き
込んでバ・ソファ・ツブすると共に、その該当レコード
を更新用/く・ソファ19へ転送する(ステップAle
、 A17)。
When the record status in the record status register 18 is rAPDJ and the process advances to step A14, the target file in the source file 23 is updated and the corresponding record is clicked (step A15). Next, the corresponding record is written to the knob memory 22, and the corresponding record is transferred to the update controller 19 (step ALE).
, A17).

上記レコード状態レジスタ18におけるレコード状態が
rDELJでステップA18に進んた場合、ソースファ
イル23における対象ファイルの該当レコードをロック
する。次いで上記該当レコードをバックアップメモリ2
2に書き込んでノ<・ツクアップすると共に、その該当
レコードを更新用ツク、ソファ19へ転送する(ステ・
ツブA20. A21)。
When the record status in the record status register 18 is rDELJ and the process advances to step A18, the corresponding record of the target file in the source file 23 is locked. Next, back up the above records to memory 2.
2 and upload it, and then transfer the corresponding record to update and sofa 19 (step
Tubu A20. A21).

そして、上記ステップA13、A17、A20の処理を
終了すると、ステップA21に進んで更新用レコードフ
ァイル16から次の更新用レコードを更新用レコードレ
ジスタ15に読出し、前回と同一キーか否かを判別する
(ステ・ツブA22)。
When the processes of steps A13, A17, and A20 are completed, the process proceeds to step A21, where the next update record is read from the update record file 16 to the update record register 15, and it is determined whether the key is the same as the previous one. (Ste Tsubu A22).

前回と同一キーの場合は、前回の更新状態、レコード状
態に対する今回の更新種に基づいて、更新状態テーブル
13及びレコード状態テーブル14の内のテーブル■(
第2図(b)、第3図(b)参照)より、今回の更新状
態、レコード状態の読出しを行ない、エラーか否かをチ
エツクする。この場合、更新状態テーブル13では、前
回の更新状態が「削」で今回の更新種として「削除」、
「訂正」、「集計」が指定された時、及び前回の更新状
態が「追」で今回の更新種として「追加」が指定された
時にエラーとなる。また、レコード状態テーブル14で
は、前回の更新状態がrDELJで今回の更新種として
「削除」、「訂正」、「集計」が指定された時、前回の
更新状態がAPDJで今回の更新種として「追加」が指
定された時、前回の更新状態がrRWTJで今回の更新
種として「追加」が指定された時にエラーとなる。
If the key is the same as the previous one, the table ■(
(See FIGS. 2(b) and 3(b)), the current update status and record status are read out, and it is checked whether there is an error or not. In this case, in the update status table 13, the previous update status is "delete" and the current update type is "delete".
An error occurs when "correction" or "aggregation" is specified, or when the previous update status is "addition" and the current update type is "addition". In addition, in the record status table 14, when the previous update status is rDELJ and the current update type is "delete", "correction", or "summarization", the previous update status is APDJ and the current update type is " When "Add" is specified, the previous update status is rRWTJ and "Add" is specified as the current update type, an error occurs.

上記ステップA24でエラーと判断された場合は、エラ
ー処理(ステップAS)を実行し、エラーでなければ上
記更新状態テーブル13のテーブル■から読出した更新
状態を更新状態レジスタ17に、レコード状態テーブル
14のテーブル■から読出したレコード状態をレコード
状態レジスタ18に記憶する(ステップA25)。次い
で更新用バッファ19の内容を今回の更新用レコード及
び更新状態に基づいて更新する(ステップA26)。ま
た、上記更新用レコードレジスタ15に保持している更
新用レコード、更新状態レジスタ17及びレコード状態
レジスタ18の保持データから第4図に示す更新状態管
理レコードを作成し、更新状態管理メモリ21に記憶す
る(ステップA27)。
If it is determined that there is an error in step A24, error processing (step AS) is executed, and if there is no error, the update state read from table 2 of the update state table 13 is stored in the update state register 17 and recorded in the record state table 14. The record status read from table 2 is stored in the record status register 18 (step A25). Next, the contents of the update buffer 19 are updated based on the current update record and update status (step A26). Further, the update state management record shown in FIG. 4 is created from the update record held in the update record register 15, the data held in the update status register 17, and the record status register 18, and is stored in the update status management memory 21. (Step A27).

その後、上記ステップA21に進んで更新用レコードフ
ァイル16から次の更新用レコードを更新用レコードレ
ジスタ15に読出し、前回と同一キーか否かを判別する
(ステップA22)。前回と同一キーの場合は、上記ス
テップA23〜A27の処理を繰り返し実行するが、同
一キーでない場合は更に更新用レコードファイル16に
次のレコードが有るか否かをチエツクする(ステップA
28)。
Thereafter, the process proceeds to step A21, where the next update record is read from the update record file 16 to the update record register 15, and it is determined whether the key is the same as the previous one (step A22). If the key is the same as the previous one, the processes of steps A23 to A27 are repeated, but if the key is not the same, it is further checked whether there is a next record in the update record file 16 (step A
28).

更新用レコードファイル]86に次のレコードがある場
合は、レコード状態レジスタ18の記憶内容から、現在
のレコード状態がrAPDJ、「RWT」、「DEL」
の何れであるかを判別する(ステップA29)。
If there is a next record in the update record file] 86, the current record status is rAPDJ, "RWT", or "DEL" from the contents of the record status register 18.
(Step A29).

レコード状態がrAPDJの場合は、更に更新状態レジ
スタ17により現在の更新状態が「追加」、「訂正」、
「集計」の何れであるかを判別しくステップA30)、
「訂正」あるいは「集計」であれば更新用バッファ19
に保持されている内容をソースファイル23に書き込み
(ステップ八31)  該当レコードをロックする(ス
テップA32)。また、上記ステップA29おいて現在
のレコード状態が「RWTJであると判別された場合も
上記ステップA3L、A32の処理を実行する。
When the record status is rAPDJ, the update status register 17 further indicates the current update status as "addition", "correction",
Step A30) to determine which one is “aggregation”;
If “correction” or “aggregation”, update buffer 19
writes the contents held in the source file 23 (step 831) and locks the corresponding record (step A32). Also, when it is determined in step A29 that the current record status is "RWTJ", the processes in steps A3L and A32 are executed.

そして、上記ステップA32の処理を終了した場合、ス
テップA30で現在の更新状態が「追加」であると判別
された場合、ステップA29で現在のレコード状態が「
DELJであると判別された場合は、ステップA3に戻
り、更新用レコードレジスタ15に保持されている更新
用レコードに従って上記した処理を繰り返して実行する
Then, when the process of step A32 is finished, if the current update status is determined to be "addition" in step A30, the current record status is changed to "addition" in step A29.
If it is determined that it is DELJ, the process returns to step A3 and the above-described process is repeated according to the update record held in the update record register 15.

上記した処理により更新用レコードファイル16に保持
されている更新用レコードか全て読出され、ステップA
2gにおいて更新用レコードファイル16には次のレコ
ードが記憶されていないと判断されると、ステップA3
3に進んで更新状態管理メモリ21から先頭レコードを
ワークメモリ20に読出し、そのレコード状態がrDE
LJであるか、またはrAPDJ、「RWT」であるか
を判別する(ステップA34)。
Through the above processing, all update records held in the update record file 16 are read out, and step A
2g, if it is determined that the next record is not stored in the update record file 16, step A3
Proceed to step 3 to read the first record from the update state management memory 21 to the work memory 20, and set the record state to rDE.
It is determined whether it is LJ, rAPDJ, or "RWT" (step A34).

レコード状態が「DEL」の場合は、該当レコードをソ
ースファイル23から削除する。このステップA35の
処理を終了した場合、あるいは上記ステップA34でレ
コード状態がrADDJまたはrRWTJであると判別
された場合は、ステップA3Bに進んで、更新状態管理
メモリ21からのレコード読出しを全て終了したか否か
をチエツクし、終了していなければ更新状態管理メモリ
21から次のレコードをワークメモリ20に読出しくス
テップA37)、その後、ステップA34に戻って同様
の処理を繰り返して実行する。そして、上記更新状態管
理メモリ21に記憶されているレコードに対する処理を
全て終了すると、ステ・ツブA36よりステップA38
に進んでソースファイル23における全レコードのロッ
クを解除し、ファイル更新処理を終了する。
If the record status is "DEL", the corresponding record is deleted from the source file 23. If the process of step A35 is completed, or if it is determined in step A34 that the record status is rADDJ or rRWTJ, the process advances to step A3B, and whether reading of all records from the update status management memory 21 is completed or not. If it has not been completed, the next record is read from the update state management memory 21 to the work memory 20 (step A37), and then the process returns to step A34 and the same process is repeated. When all the processing for the records stored in the update state management memory 21 is completed, step A38 is sent from step A36 to step A38.
The process proceeds to step 100, where all records in the source file 23 are unlocked, and the file update process is ended.

次に上記ステップA6のエラー処理の詳細を第8図のフ
ローチャートに従って説明する。
Next, details of the error processing in step A6 will be explained according to the flowchart of FIG.

このエラー処理では、まず、更新状態管理メモリ21か
ら先頭レコードをワークメモリ2゜に読出しくステップ
Bl)  レコード状態がrRWTJ、rAPDJ、r
DELJの何れであるかを判別しくステップB2)、r
RWTJであればステップB3、「APD」であればス
テップB6、rDELJであればステップB8の処理に
進む。
In this error processing, first, the first record is read from the update state management memory 21 to the work memory 2° (step Bl).The record states are rRWTJ, rAPDJ, r
Step B2), r
If it is RWTJ, the process proceeds to step B3, if it is "APD", the process proceeds to step B6, and if rDELJ, the process proceeds to step B8.

上記レコード状態がrRWTJでステップB3に進んだ
場合、バックアップメモリ22がら該当キーの更新前の
レコードを読出し、ソースファイル23の該当レコード
を更新前の状態に書替え(ステップB4)、該当レコー
ドのロックを解除する。
If the record status is rRWTJ and the process advances to step B3, the record of the corresponding key before the update is read from the backup memory 22, the corresponding record of the source file 23 is rewritten to the state before the update (step B4), and the corresponding record is locked. unlock.

また、上記レコード状態がrAPDJでステップB6に
進んだ場合、バックアップメモリ22から対応するレコ
ードのキーを読出し、ソースファイル23の該当するキ
ーのレコードを削除する(ステップB7)。
If the record status is rAPDJ and the process advances to step B6, the key of the corresponding record is read from the backup memory 22, and the record with the corresponding key is deleted from the source file 23 (step B7).

また、上記レコード状態がrDELJでステップB8に
進んだ場合、バックアップメモリ22から対応するレコ
ードのキーを読出し、ソースファイル23の該当するキ
ーのレコードのロックを解除する(ステップB7)。
If the record status is rDELJ and the process advances to step B8, the key of the corresponding record is read from the backup memory 22, and the record with the corresponding key in the source file 23 is unlocked (step B7).

上記ステップB5、B7、B9の何れtXの処理を終了
すると、更新状態管理メモリ21からのレコード読出し
を全て終了したか否かを判断しくステップBIO)、レ
コード読出しか終了していなければ、更新状態管理メモ
リ21から次のレコードをワークメモリ20に読出しく
ステップB11)、その後、ステップB2に戻ってレコ
ード状態を判別し、その判別結果に従って上記した処理
を実行する。
When the processing of tX in steps B5, B7, and B9 is completed, it is determined whether or not all record reading from the update state management memory 21 has been completed (step BIO). If only record reading has been completed, the update status is The next record is read from the management memory 21 to the work memory 20 (step B11), and then the process returns to step B2 to determine the record status and execute the above-described process according to the determination result.

そして、上記更新状態管理メモリ21に記憶されている
レコードに対する処理を全て終了すると、その状態がス
テップBIOにより判別されてエラー処理を終了する。
When all the processes for the records stored in the update status management memory 21 are completed, the status is determined in step BIO and the error process is terminated.

[発明の効果] 以上詳記したように本発明によれば、ファイル更新時に
更新前のレコード状態をレコード単位で保持しておき、
エラーが発生した場合には、上記各レコード状態を判別
してファイルを自動的に復旧させるようにしたので、エ
ラーが発生してもユーザーは復旧操作を行なうことなく
、その復旧処理を自動的に、かつ、高速で実行させるこ
とができる。
[Effects of the Invention] As detailed above, according to the present invention, when a file is updated, the record state before update is held for each record,
If an error occurs, the file is automatically restored by determining the status of each record listed above, so even if an error occurs, the user does not have to perform any recovery operations, and the recovery process is automatically performed. , and can be executed at high speed.

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

第1図は本発明の一実施例によるファイル更新装置の回
路構成を示すブロック図、第2図(a)。 (b)は更新状態テーブルの設定内容を示す図、第3図
(a)、(b)はレコード状態テーブルの設定内容を示
す図、第4図は更新状態管理メモリの記憶構成を示す図
、第5図は更新用【ノコードファイルのレコード形態を
示す図、第6図はソースファイルのレコード形態を示す
図、第7図はファイル更新処理を示すフローチャート、
第8図はエラー処理を示すフローチャートである。 11・・・CPU、12・・・パスライン、13・・・
更新状態テーブル、14・・・レコード状態テーブル、
15・・・更新用レコードレジスタ、16・・・更新用
レコードファイル、17・・・更新状態レジスタ、18
・・・レコード状態レジスタ、19・・・更新用バッフ
ァ、20・・・ワークメモリ、21・・・更新状態管理
メモリ、22・・・バックアップメモリ、23・・・ソ
ースファイル。
FIG. 1 is a block diagram showing the circuit configuration of a file updating device according to an embodiment of the present invention, and FIG. 2(a) is a block diagram showing the circuit configuration of a file updating device according to an embodiment of the present invention. (b) is a diagram showing the settings of the update status table, FIGS. 3(a) and (b) are diagrams showing the settings of the record status table, and FIG. 4 is a diagram showing the storage configuration of the update status management memory. Fig. 5 is a diagram showing the record format of the update [nocode file], Fig. 6 is a diagram showing the record format of the source file, and Fig. 7 is a flowchart showing the file update process.
FIG. 8 is a flowchart showing error processing. 11...CPU, 12...Pass line, 13...
Update status table, 14... Record status table,
15... Update record register, 16... Update record file, 17... Update status register, 18
... Record status register, 19... Update buffer, 20... Work memory, 21... Update status management memory, 22... Backup memory, 23... Source file.

Claims (1)

【特許請求の範囲】 更新用レコードによるファイル更新時、更新前のレコー
ドを別途保存した上で、レコード単位で指示された更新
種に応じてファイル更新を行なうファイル更新手段と、 上記ファイル更新時、各更新レコードに対応して そのレコードが更新前のファイルに存在してファイルか
ら削除すべきものなのか、 そのレコードが更新前のファイルに存在して書替えられ
たものなのか、 そのレコードが更新前のファイルに存在せず、追加され
たものなのか、 の何れかの状態を保持する状態保持手段と、ファイル復
旧時、更新済みの各レコード状態を判別し、 追加状態であれば、そのレコードを削除して、この追加
状態を解除し、 書替状態であれば、更新時に保持された更新前のレコー
ドに書替えて、この書替状態を解除し、削除状態であれ
ば、この削除状態を解除する状態解除手段とを具備した
ことを特徴とするファイル更新装置。
[Scope of Claims] A file update means that separately saves the record before update when updating a file using an update record, and updates the file according to an update type specified for each record; For each updated record, check whether the record exists in the file before the update and should be deleted from the file, or whether the record exists in the file before the update and has been rewritten. A state retention means that maintains either the state of whether the record does not exist in the file or has been added, and when the file is restored, determines the state of each updated record, and if it is in the added state, deletes the record. If the record is in a rewrite state, it is rewritten to the pre-update record that was retained at the time of update and the rewrite state is canceled. If it is in a delete state, the deletion state is canceled. A file update device comprising: a state release means.
JP2152673A 1990-06-13 1990-06-13 File updating device Pending JPH0447428A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2152673A JPH0447428A (en) 1990-06-13 1990-06-13 File updating device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2152673A JPH0447428A (en) 1990-06-13 1990-06-13 File updating device

Publications (1)

Publication Number Publication Date
JPH0447428A true JPH0447428A (en) 1992-02-17

Family

ID=15545607

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2152673A Pending JPH0447428A (en) 1990-06-13 1990-06-13 File updating device

Country Status (1)

Country Link
JP (1) JPH0447428A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5575783A (en) * 1992-09-28 1996-11-19 The Procter & Gamble Company Absorbent article with dynamic elastic feature comprising elasticized hip panels
US5669896A (en) * 1994-06-16 1997-09-23 Kimberly-Clark Worldwide, Inc. Absorbent garment comprising dual containment flaps

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5575783A (en) * 1992-09-28 1996-11-19 The Procter & Gamble Company Absorbent article with dynamic elastic feature comprising elasticized hip panels
US5669896A (en) * 1994-06-16 1997-09-23 Kimberly-Clark Worldwide, Inc. Absorbent garment comprising dual containment flaps
US5824172A (en) * 1994-06-16 1998-10-20 Kimberly-Clark Worldwide, Inc. Method of making an absorbent garment comprising dual containment flaps
US6110158A (en) * 1994-06-16 2000-08-29 Kimberly-Clark Worldwide, Inc. Absorbent garment comprising dual containment flaps

Similar Documents

Publication Publication Date Title
CA2933790C (en) Apparatus and method for creating a real time database replica
US10642696B2 (en) Copying compressed pages without uncompressing the compressed pages
US10235375B1 (en) Persistent file system objects for management of databases
JP3856855B2 (en) Differential backup method
US6898688B2 (en) Data management appliance
EP1461700B1 (en) Appliance for management of data replication
US7340645B1 (en) Data management with virtual recovery mapping and backward moves
US6938056B2 (en) System and method for restoring a file system from backups in the presence of deletions
US8504528B2 (en) Duplicate backup data identification and consolidation
JP2531776B2 (en) How to recover your database
US20060200698A1 (en) Information replication system mounting partial database replications
US20030131253A1 (en) Data management appliance
US7290100B2 (en) Computer system for managing data transfer between storage sub-systems
US20020065834A1 (en) Maintenance of data integrity during transfer among computer networks
CN117130827A (en) Restoring databases using fully hydrated backups
CN109325005B (en) Data processing method and electronic equipment
JPH0447428A (en) File updating device
US10671488B2 (en) Database in-memory protection system
JP3037183B2 (en) Hard disk device management method and method
JP3220182B2 (en) File copying machine
JPH0447427A (en) File updating device
JPH01140353A (en) System for maintaining data in data base
JP4161362B2 (en) Computer system having data recovery function and data recovery method
JPH02211557A (en) Data base saving system
JPH04141751A (en) Fault recovery system for mass storage medium