[go: up one dir, main page]

JPH1185571A - System for storing log into flash memory - Google Patents

System for storing log into flash memory

Info

Publication number
JPH1185571A
JPH1185571A JP9238349A JP23834997A JPH1185571A JP H1185571 A JPH1185571 A JP H1185571A JP 9238349 A JP9238349 A JP 9238349A JP 23834997 A JP23834997 A JP 23834997A JP H1185571 A JPH1185571 A JP H1185571A
Authority
JP
Japan
Prior art keywords
log
record
flash memory
information
log record
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
JP9238349A
Other languages
Japanese (ja)
Inventor
Koichi Taneda
幸一 種田
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP9238349A priority Critical patent/JPH1185571A/en
Publication of JPH1185571A publication Critical patent/JPH1185571A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To shorten log time, to prolong the service life of a flash memory while effectively utilizing a log area and to remove an illegal log record when write is not normally finished during logging. SOLUTION: A CPU 1, flash memory device(FMEM) 2 and real-time clock device(RTC) 3 are connected through a bus 5, one log header and plural log records are provided on the FMEM 2 and when an event to be logged occurs, the log record composed of time stamp information, which is read out of the RTC 3 when log data information is logged, the type information of the log record and the record length information of the log record is written in the FMEM 2. When the log header and the log record are periodically referred to and the log is newly added, the log record information is read out of the FMEM 2 and outputted to an external storage device 4.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、情報処理装置にお
けるロギング方式に関し、特に、フラッシュメモリデバ
イスに対するロギングに関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a logging system in an information processing apparatus, and more particularly, to logging for a flash memory device.

【0002】[0002]

【従来の技術】一般に、フラッシュメモリデバイス(F
MEM)は、ブロック単位の消去、バイト単位の書き込
みができるデバイスであり、システムで発生したイベン
トをこのデバイス上のログすることが可能である。
2. Description of the Related Art Generally, flash memory devices (F)
The MEM) is a device that can perform erasing in blocks and writing in bytes, and can log events occurring in the system on this device.

【0003】従来、システムのイベントログのデバイス
として不揮発性のランダムアクセスメモリ(nvRA
M)が用いられることが多い。しかし、FMEMの方が
安価で大容量であることから最近はFMEMも使われ始
めている。
Conventionally, a nonvolatile random access memory (nvRA) has been used as a device for an event log of a system.
M) is often used. However, FMEM has recently begun to be used because FMEM is cheaper and has a larger capacity.

【0004】FMEM又はnvRAMはCPUから直接
リード・ライトできるデバイスであるため、システムの
運用が保証できないような致命的な障害が発生した場合
に、最優先の割り込み処理(一般にソフトウェアでマス
ク不可能な割り込み処理)で直ちにログされるので、ロ
ギングできる可能性が高い。ここでロギングされたデー
タは、システム再立ち上げ等がなされ、システムの動作
が安定した状態で、外部記憶に転送される。
[0004] Since the FMEM or nvRAM is a device that can be read and written directly by the CPU, when a catastrophic failure occurs that cannot guarantee the operation of the system, the highest priority interrupt processing (generally maskable by software) Since logging is performed immediately in interrupt processing), there is a high possibility that logging can be performed. The logged data is transferred to an external storage in a state where the operation of the system is stabilized after the system is restarted.

【0005】外部記憶に比べ、FMEM及びnvRAM
は、記憶容量に対して単価が高いので、効率よく記録す
ることが求められる。
[0005] Compared to external storage, FMEM and nvRAM
Since the unit price is higher than the storage capacity, efficient recording is required.

【0006】FMEMはnvRAMに比べて記憶容量の
単価が安いが、消去については、例えば、100,00
0回迄という制限があり、また、書き込みにかかる時間
は、1バイトにつき10〜160マイクロ秒かかる。そ
れに対して、nvRAMは書き込み制限はなく、ライト
は1マイクロ秒あれば十分である。
[0006] FMEM has a lower storage capacity unit price than nvRAM.
There is a limit of 0 times, and the writing time takes 10 to 160 microseconds per byte. On the other hand, nvRAM has no write restriction, and writing for 1 microsecond is sufficient.

【0007】そこで、FMEMの寿命及びFMEMに対
するロギング性能を考慮すると、FMEMに対するライ
トについては、nvRAMよりさらに書き込みバイト数
を少なくすることが求められる。
Therefore, in consideration of the life of the FMEM and the logging performance for the FMEM, it is required to further reduce the number of bytes to be written for the FMEM as compared to the nvRAM.

【0008】従来、ロギングされるタイムスタンプ情報
は、図4に示されるように、年・月・日・時・分・秒の
6バイトのタイムスタンプデータが固定的に採られてい
る。タイムスタンプの情報を圧縮する手法として、例え
ば、特開平4−257936号公報に記載されたものが
知られている。ここでは、年・月・日・時・分・秒の情
報として以前に発生した時刻との差分情報のみを記録す
るようにしている。例えば、年・月・日が以前のタイム
スタンプと同じであった場合には、時・分・秒だけを記
録するというものである。
Conventionally, as shown in FIG. 4, 6-byte time stamp data of year / month / date / hour / minute / second is fixedly used as time stamp information to be logged. As a method of compressing the information of the time stamp, for example, a method described in Japanese Patent Application Laid-Open No. 4-257936 is known. Here, only the difference information from the previously generated time is recorded as the year / month / day / hour / minute / second information. For example, if the year, month, and day are the same as the previous time stamp, only the hour, minute, and second are recorded.

【0009】[0009]

【発明が解決しようとする課題】ところで、特開平4−
257936号公報に記載された手法では、差分だけを
記録している関係上、タイムスタンプのデータを圧縮で
きるが、逆に記録されたタイムスタンプデータから本来
の年・月・日・時・分・秒には簡単には戻せないという
問題点がある。つまり、タイムスタンプ情報が何バイト
に圧縮されたかを示す情報がないため、タイムスタンプ
情報がどこまであり、どこから次のイベント情報なのか
を簡単に識別することが困難なため、イベントログ情報
とタイムスタンプ情報の分離を行う際には、例えば、熟
練した人間に頼らざるを得なくなってしまう。
By the way, Japanese Patent Application Laid-Open No.
According to the method described in Japanese Patent No. 257936, the time stamp data can be compressed because only the difference is recorded, but the original year / month / day / hour / minute / There is a problem that seconds cannot be easily returned. In other words, since there is no information indicating how many bytes the time stamp information has been compressed, it is difficult to easily identify where the time stamp information is and from where the next event information is. When separating information, for example, it is necessary to rely on a skilled person.

【0010】さらに、FMEMの場合、各ログレコード
を書き込み中に電源断等でその処理が途中で中断してし
まうと、不正なログレコードが発生してしまうというと
いう問題点がある。つまり、FMEMでは、一度、1→
0にライトしてしまうと、ブロック単位で消去しない限
り、0→1に戻らないという特性があるため、後から、
そのレコードの上に新しいログレコード、上書きするこ
とで消去できず、その結果、不正なログレコードが発生
してしまうというという問題点がある。
Further, in the case of FMEM, if the processing is interrupted in the middle of writing each log record due to a power failure or the like, an incorrect log record is generated. In other words, once in FMEM, 1 →
If it is written to 0, it will not return to 0 → 1 unless it is erased in block units.
There is a problem that a new log record over the record cannot be erased by overwriting, and as a result, an incorrect log record is generated.

【0011】本発明の目的は、ロギングされるタイムス
タンプを圧縮して容易に伸張して効率的にFMEMを使
用することのできるログ格納方式を提供することにあ
る。
SUMMARY OF THE INVENTION An object of the present invention is to provide a log storage method capable of compressing and easily expanding a time stamp to be logged and using FMEM efficiently.

【0012】本発明の他の目的は、FMEMにおいて書
き込みが中断された場合の不良ログを取り除くことがで
きるログ格納方式を提供することにある。
Another object of the present invention is to provide a log storage method capable of removing a bad log when writing is interrupted in FMEM.

【0013】[0013]

【課題を解決するための手段】本発明では、ログレコー
ド書き込み手段において、リアルタイムクロックデバイ
ス(RTC)のタイムスタンプデータを以前のログレコ
ードのタイムスタンプとの差分からタイムスタンプデー
タを圧縮してフラッシュメモリデバイス(FMEM)に
書き込み、ログレコード読み出し手段において、圧縮さ
れたタイムスタンプデータを伸張して外部記憶装置に書
き出す。これによって、外部記憶に対しては従来と同じ
ログデータを保証しつつ、FMEM上のログデータは圧
縮して効率よくログすることが可能になる。また、ログ
レコードの中にはロギング中フラグが備えられており、
上記のログレコード書き込み手段において、ロギング開
始時は上記ロギング中フラグを1の状態でレコード長を
ライトし、ロギング終了時には、上記ロギング中フラグ
を0の状態にしてレコード長を再ライトし、上記ログレ
コード読み出し手段において、ロギング完了フラグが1
の場合は、不良レコードとして当該ログレコードを無視
する。これによって、不良ログを除去することができ
る。
According to the present invention, in the log record writing means, the time stamp data of the real time clock device (RTC) is compressed from the difference between the time stamp data of the previous log record and the time stamp data and the flash memory is written. The data is written to a device (FMEM), and the log record reading means expands the compressed time stamp data and writes the data to an external storage device. As a result, the log data on the FMEM can be compressed and efficiently logged while guaranteeing the same log data as the conventional one for the external storage. In addition, a logging flag is provided in the log record,
In the above log record writing means, at the start of logging, the record length is written with the logging flag set to 1, and at the end of logging, the logging flag is set to 0 at the end of logging, and the record length is rewritten. In the record reading means, the logging completion flag is set to 1
In the case of, the log record is ignored as a bad record. Thereby, the failure log can be removed.

【0014】ログエリア初期化手段は、パワーオンセル
フテスト(POST)時に、全く初期化されていないF
MEMが検出された時に一度だけ行われる。
[0014] The log area initializing means is an F which is not initialized at all during the power-on self test (POST).
Only done once when MEM is detected.

【0015】ログすべきイベントが発生すると、最優先
割り込み処理でログレコード書き込み手段によりFME
Mにログが書き込まれる。最優先の割り込み処理のた
め、オペレーティングシステムがまともに動作しない場
合でも、ログを残すことが可能である。この時タイムス
タンプ情報は圧縮される。
When an event to be logged occurs, the log record writing means performs FME in the highest priority interrupt processing.
A log is written to M. Due to the highest priority interrupt processing, a log can be left even when the operating system does not operate properly. At this time, the time stamp information is compressed.

【0016】また、オペレーティング上でログ読み出し
手段は定期的にFMEM上のフラッシュログエリアを参
照し、新しいログレコードが発見されると、適宜拡張記
憶に転送する。これは、オペレーティングシステムが正
常に稼働している時に行われる。この時、圧縮されたタ
イムスタンプ情報は伸張される。また、不正なログレコ
ードは転送されない。
The log reading means on the operating system periodically refers to the flash log area on the FMEM, and when a new log record is found, transfers the log record to the extended storage as appropriate. This is done when the operating system is running normally. At this time, the compressed time stamp information is expanded. Also, incorrect log records are not transferred.

【0017】また、ログレコード再初期化手段もオペレ
ーティングシステムが正常に稼働している時に行われ
る。
The log record re-initializing means is also performed when the operating system is operating normally.

【0018】[0018]

【発明の実施の形態】以下本発明について図面を参照し
て説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings.

【0019】図1を参照して、図示の情報処理装置は中
央処理装置(CPU)1を備えており、CPU1には最
優先の割り込み端子(SMI)101が備えられてい
る。CPU1はバス(BUS)5を介してフラッシュメ
モリデバイス(FMEM)2、リアルタイムクロックデ
バイス(RTC)3,及び外部記憶装置4に接続されて
いる。外部記憶装置4として、例えば、固定ディスク装
置が用いられる。なお、図示の例では、バス5は簡単化
のため一本で表しているが、バス5は複数のバスで構成
されるかもしれない。
Referring to FIG. 1, the illustrated information processing apparatus includes a central processing unit (CPU) 1, and the CPU 1 includes an interrupt terminal (SMI) 101 having the highest priority. The CPU 1 is connected to a flash memory device (FMEM) 2, a real-time clock device (RTC) 3, and an external storage device 4 via a bus (BUS) 5. As the external storage device 4, for example, a fixed disk device is used. In the illustrated example, the bus 5 is represented by a single bus for simplification, but the bus 5 may be composed of a plurality of buses.

【0020】図2を参照して、図示の例では、FMEM
2は4つのバンク21,22,23,及び24を備えて
おり、ブロック消去はこのバンク単位に行われる。ログ
エリアはこのうちの一つのバンク(図示の例ではバンク
22)上に置かれる。このバンク22の先頭に32バイ
トのログヘッダ221がある。そして、その後ろにログ
レコード群222が置かれる。ログレコード群222
は、先頭から順番にログレコード2221、ログレコー
ド2222と書き込まれ、現在はログレコード2223
まで書かれている。次に、ログすべきイベントが発生す
ると、空きエリア2224の先頭にログレコードが書き
込まれることになる。
Referring to FIG. 2, in the illustrated example, FMEM
2 has four banks 21, 22, 23, and 24, and block erase is performed in units of the banks. The log area is placed on one of the banks (bank 22 in the illustrated example). At the head of the bank 22, there is a 32-byte log header 221. Then, a log record group 222 is placed behind it. Log record group 222
Are written as a log record 2221 and a log record 2222 in order from the top.
It is written until. Next, when an event to be logged occurs, a log record is written at the head of the free area 2224.

【0021】図3にログヘッダ221を詳細に示す。後
述するように、ログエリア初期化手段によって、ログヘ
ッダ221は最初に初期化される。ログヘッダ識別子、
ヘッダID、メイジャレビジョン、マイナレビジョンロ
グエリア長は、ログエリア初期化手段によって初期化さ
れた以降、常に同一の値が格納される。最後に消去され
た年・月・日・時・分・秒には、ログエリア初期化手
段、又は後述するログエリア再初期化手段によってバン
ク22が消去された最新の日付が格納される。また、消
去された回数は、ログエリア再初期化手段がバンクを消
去する度に1プラスされる。
FIG. 3 shows the log header 221 in detail. As described later, the log header 221 is first initialized by the log area initializing means. Log header identifier,
The header ID, major revision, and minor revision log area length always store the same value after being initialized by the log area initialization means. In the lastly deleted year, month, day, hour, minute, and second, the latest date when the bank 22 was deleted by the log area initializing means or the log area reinitializing means described later is stored. The number of times of erasure is increased by one each time the log area re-initialization means erases a bank.

【0022】図4に、従来の各ログレコードを示す。最
初の1バイトはレコード長で、0−7fHの値が入る。
ログの最大レコードは128バイトであるので、その時
は0が入る。
FIG. 4 shows each conventional log record. The first byte is the record length and contains a value of 0-7fH.
Since the maximum record of the log is 128 bytes, 0 is entered at that time.

【0023】レコードタイプは1−FEHのコードが入
る。これで、どの様なシステムイベントが発生したかが
識別できる。このレコードコードによって、ログ本体に
さらに固定長の詳細なデータがあったり、または可変長
のデータがあったり、さらにはログ本体は何もなかった
りする。
The record type contains a code of 1-FEH. This makes it possible to identify what kind of system event has occurred. Depending on the record code, there are more fixed-length detailed data or variable-length data in the log body, and there is no log body.

【0024】従来、タイムスタンプ年・月・日・時・分
・秒は必ず6バイト有していた。そのため、図5に示す
8バイトは必ずログレコードに存在していた。
Conventionally, the time stamp year / month / date / hour / minute / second always has 6 bytes. Therefore, the 8 bytes shown in FIG. 5 always existed in the log record.

【0025】従来、タイムスタンプはBCD(2進数1
0進数)で表記されていた。従って、YYの部分の上位
4ビットは0から9までの値しか入らないことに着目し
て、YYを以下のように定義する。
Conventionally, the time stamp is BCD (binary 1).
0). Therefore, paying attention to the fact that the upper 4 bits of the YY portion can only contain values from 0 to 9, YY is defined as follows.

【0026】YYの上位4ビットで、 0〜9の場合:BCD表記でYYは0〜99を表し、従
来のフォーマットと同一。
Upper 4 bits of YY, 0 to 9: YY represents 0 to 99 in BCD notation, the same as the conventional format.

【0027】0Ahの場合:YYの下位4ビットは、以
前のログからの経過時間(0〜15秒)を表し、ログ本
体はMM(オフセット3)から始まる。
0Ah: The lower 4 bits of YY represent the elapsed time (0 to 15 seconds) from the previous log, and the log body starts from MM (offset 3).

【0028】0Bhの場合:YYの下位4ビット及びM
Mは、以前のログからの経過時間(0〜0fffh秒)
を表し、ログ本体はDD(オフセット4)から始まる。
In the case of 0Bh: lower 4 bits of YY and M
M is the elapsed time from the previous log (0 to 0ffffh seconds)
, And the log body starts from DD (offset 4).

【0029】0Chの場合:YYの下位4ビット及びM
M,DDは、以前のログからの経過時間(0〜0fff
ffh秒)を表し、ログ本体はhh(オフセット5)か
ら始まる。hh,mm,ssは省略される。
In the case of 0Ch: lower 4 bits of YY and M
M and DD are elapsed times from the previous log (0 to 0fff)
ffh seconds), and the log body starts from hh (offset 5). hh, mm, and ss are omitted.

【0030】0Dhの場合:YYの下位4ビット及びM
M,DD,hhは、以前のログからの経過時間(0〜0
fffffh秒)を表し、ログ本体はmm(オフセット
6)から始まる。と、定義することによって、レコード
ヘッダ部を圧縮することが可能となる。
In the case of 0Dh: lower 4 bits of YY and M
M, DD, and hh are elapsed times (0 to 0) from the previous log.
ffffh second), and the log body starts from mm (offset 6). Thus, the record header part can be compressed.

【0031】図6を参照して、ログエリア初期化手段に
ついて説明する。このログエリア初期化手段は、パワー
オンセルフテスト(POST)によって、実行される。
最初に、ログヘッダ識別子及びヘッダIDが有効かをチ
ェックして(ステップs1)、すでに有効な場合には、
後続の処理はスキップされる。
The log area initializing means will be described with reference to FIG. This log area initialization means is executed by a power-on self test (POST).
First, it is checked whether the log header identifier and the header ID are valid (step s1).
Subsequent processing is skipped.

【0032】有効でなければ、この例では、ログエリア
がFMEMのバンク22にあるので、FMEMのバンク
22をブロック消去する(ステップs2)。このブロッ
ク消去によって、バンク22のデータは全て0FFhに
初期化される。
If it is not valid, in this example, since the log area is in the bank 22 of FMEM, the bank 22 of FMEM is block erased (step s2). By this block erasure, all the data in the bank 22 is initialized to 0FFh.

【0033】次に、ログヘッダ・メイジャレビジョン・
マイナレビジョン・ログエリア長をライトする(ステッ
プs3)。この値は、システムで固定値である。
Next, the log header, major revision,
Write the minor revision log area length (step s3). This value is fixed in the system.

【0034】次に、RTCから現在時刻をリードし(ス
テップs4)、その値を最後に消去された年・月・日・
時・分・秒のエリアにライトする(ステップs5)。そ
して、ブロック消去された回数は0とする(ステップs
6)。
Next, the current time is read from the RTC (step s4), and the value is read from the last deleted year, month, day,
The data is written in the hour / minute / second area (step s5). Then, the number of times of block erasure is set to 0 (step s).
6).

【0035】図7を参照して、ログレコード書き込み手
段について説明する。ログレコード書き込み手段は、C
PUに最優先割り込みが入った際実行される。
The log record writing means will be described with reference to FIG. The log record writing means is C
Executed when the highest priority interrupt enters the PU.

【0036】まず、最初にログレコード群の先頭のログ
レコードから、順番にレコードタイプをチェックし、レ
コードタイプが0FFhのものを探す。0FFhをサー
チする際に、各ログレコードのタイムスタンプもチェッ
クし、最初の“YYMMDDhhmmss”から、最後
に採取されたログが何秒経過しているかを計算する(ス
テップs7)。0FFhのものを見つけた後、ログエリ
アが今回のログレコードを書き込むのに十分なスペース
が残っていることを確認する(ステップs8)。空きエ
リアが十分にない場合には、ログヘッダのオーバフロー
フラグをセットして(ステップs9)、終了する。空き
エリアが十分ある場合には、RTCから現在の時刻を読
み込み(ステップs10)、RTCから読んだ現在の時
刻と、0FFhのサーチの時に計算した最初の“YYM
MDDhhmmss”から最後に採取されたログが何秒
経過した時間とから、圧縮されたタイムスタンプデータ
を作る(ステップs11)。
First, the record type is checked in order from the log record at the head of the log record group, and a record type with a record type of 0FFh is searched. When searching for 0FFh, the time stamp of each log record is also checked, and how many seconds have elapsed since the first “YYMMDDhhmmss” is calculated for the last collected log (step s7). After finding the one of 0FFh, it is confirmed that the log area has enough space to write the current log record (step s8). If there is not enough free area, the overflow flag in the log header is set (step s9), and the process ends. If there is enough free area, the current time is read from the RTC (step s10), and the current time read from the RTC and the first "YYM" calculated at the time of the search for 0FFh are read.
Compressed timestamp data is created from the number of seconds elapsed from the last collected log from MDDhhmmss ”(step s11).

【0037】ここで、図8を参照して、タイムスタンプ
データの圧縮について説明する。
Here, the compression of the time stamp data will be described with reference to FIG.

【0038】まず、最初のログレコードであるか否かを
確認する(ステップt1)。最初のログレコードの場合
には、“YYMMDDhhmmss”でタイムスタンプ
する(ステップt2)。それ以降のログは前回との時間
の差分でログする。つまり、最初のログレコードでなけ
れば、最後のログのタイムスタンプと現在時刻との差を
計算する(ステップt3)。ログとログの時間差は15
秒以内の場合(ステップt4)、タイムスタンプデータ
は0Axhの1バイトに圧縮される(ステップt5)。
差分時間≧15秒であると、1時間8分15秒(0ff
fh秒)以内の時は(ステップt6)、0Bxxxhの
2バイトに圧縮される(ステップt7)。以下同様にし
て、12日3時間16分15秒(0Cxxxxxh秒)
以内の時は(ステップt8)、0Cxxxxxhの3バ
イト(ステップt9)、3106日21時間24分15
秒(0xdxxxxxxxh秒)以内の時は(ステップ
t10)、4バイトとなる(ステップt11)。
First, it is confirmed whether or not this is the first log record (step t1). In the case of the first log record, a time stamp is given with "YYMMDDhhmmss" (step t2). Logs after that are logged with the time difference from the previous time. That is, if it is not the first log record, the difference between the time stamp of the last log and the current time is calculated (step t3). The time difference between logs is 15
If the time is within seconds (step t4), the time stamp data is compressed to one byte of 0Axh (step t5).
If the difference time ≧ 15 seconds, 1 hour, 8 minutes, 15 seconds (0ff
(fh seconds) or less (step t6), the data is compressed to 2 bytes of 0Bxxxh (step t7). Similarly, 12 days, 3 hours, 16 minutes, and 15 seconds (0Cxxxxh seconds)
When the time is within (step t8), 3 bytes of 0Cxxxxxxh (step t9), 3106 days 21 hours 24 minutes 15
When the time is within seconds (0xdxxxxxxh seconds) (step t10), the length is 4 bytes (step t11).

【0039】再び、図7を参照して、上述のようにし
て、タイムスタンプデータの圧縮を行った後、今回ログ
のログタイプを書き込む。次に、ログレコード長のbi
t7を1にセットしたものを書き込み、圧縮されたタイ
ムスタンプデータを書き込む(ステップs12)。その
後、引き続いてログ本体を書き込み(ステップs1
3)、最後にレコード中のbit7を0にした値を再度
書き込む(ステップs14)。
Referring to FIG. 7 again, after the time stamp data is compressed as described above, the log type of the current log is written. Next, log record length bi
The data with t7 set to 1 is written, and the compressed time stamp data is written (step s12). Thereafter, the log body is continuously written (step s1
3) Finally, a value in which bit 7 in the record is set to 0 is written again (step s14).

【0040】以上の操作によって、ログレコード長のb
it7を1にセットした後、ログレコード中のbit7
を0に再ライトするまでの間に電源が落ちたり、ストー
ルした場合に書き込み途中のログを無効にするのに有効
となる。
By the above operation, the log record length b
After setting it7 to 1, bit7 in the log record
This is effective for invalidating the log in the middle of writing if the power is turned off or stalls before rewriting to 0.

【0041】次に、図9にOS動作中に定期的に実行さ
れるログレコード読み出し手順を示す。
Next, FIG. 9 shows a log record reading procedure periodically executed during the OS operation.

【0042】図9を参照して、ログレコード群の先頭か
ら順番にログタイプをチェックし、タイプが0FFhの
ものが発見されるまでサーチする(ステップs15)。
まだ拡張記憶装置に転送されていないログが見つけられ
たら(ステップs16)、レコード長のbit7をチェ
ックし(ステップs17)、bit7が0となっている
有効なログだけを取り出して、圧縮されたタイムスタン
プデータをもとの“YYMMDDhhmmss”の6バ
イトのタイムスタンプデータに伸張して(ステップs1
8)、ログレコード全体を拡張記憶装置転送する(ステ
ップs19)。そして、次のログを検索して(ステップ
s20)、同様の処理を行う。
Referring to FIG. 9, the log type is checked sequentially from the beginning of the log record group, and a search is performed until a log type of 0FFh is found (step s15).
If a log that has not yet been transferred to the extended storage device is found (step s16), the record length bit7 is checked (step s17), and only a valid log whose bit7 is 0 is extracted, and the compressed time is extracted. The stamp data is expanded to the original 6-byte time stamp data of "YYMMDDhhmmss" (step s1).
8) The entire log record is transferred to the extended storage device (step s19). Then, the next log is searched (step s20), and the same processing is performed.

【0043】全てのログを転送した後、ログエリアの空
き容量をチェックし、空き容量がある程度以下(例え
ば、全体の30%未満)になった場合には、この後、ロ
グ再初期化手段が実行される。
After all the logs have been transferred, the free space in the log area is checked. If the free space falls below a certain level (for example, less than 30% of the total), the log re-initializing means is thereafter executed. Be executed.

【0044】図10を参照して、ログ再初期化手段につ
いて説明する。
The log re-initialization means will be described with reference to FIG.

【0045】まず、ログヘッダの消去された回数をリー
ドし(ステップs21)、その後、ログ初期化手段と同
様に、バンク22をブロック消去し(ステップs2
2)、ログヘッダ識別子、ヘッダID、メイジャレビジ
ョン、マイナレビジョン、ログエリア長をライトする
(ステップs23)。
First, the number of times the log header has been erased is read (step s21), and then the block is erased from the bank 22 in the same manner as the log initialization means (step s2).
2) Write the log header identifier, header ID, major revision, minor revision, and log area length (step s23).

【0046】次にRTCから現在の時刻をリードして
(ステップs24)、その値を最後に消去された年・月
・日・時・分・秒をライトし(ステップs25)、最初
に読んだ消去された回数の値に1加算した値をライトす
る(ステップs26)。
Next, the current time is read from the RTC (step s24), and its value is written with the last erased year, month, date, hour, minute, and second (step s25), and is read first. A value obtained by adding 1 to the value of the number of erases is written (step s26).

【0047】[0047]

【発明の効果】以上説明したように、本発明では、FM
EMにタイムスタンプデータを圧縮して格納するように
したので、FMEMを効率的に使用でき、その結果、F
MEMをブロック消去する頻度が減少して、FMEMの
寿命が長くすることができるという効果がある。
As described above, according to the present invention, the FM
Since the time stamp data is compressed and stored in the EM, the FMEM can be used efficiently.
There is an effect that the frequency of erasing the block of the MEM is reduced and the life of the FMEM can be extended.

【0048】さらに、本発明では、ログレコード全体の
長さが短くなるので、最優先割り込みでFMEMに書き
込みに要する時間が短縮できるという効果がある。
Further, in the present invention, since the entire length of the log record is shortened, the time required for writing to the FMEM by the highest priority interrupt can be reduced.

【0049】また、本発明では、ログ中に電源断はその
他の要因で書き込みが途中に中断してしまった場合で
も、その不良ログレコードを検出して除去できるという
効果がある。
Further, according to the present invention, even if the power is interrupted during the log and the writing is interrupted on the way due to other factors, the defective log record can be detected and removed.

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

【図1】本発明によるログ格納方式が用いられるシステ
ムの一例を示すブロック図である。
FIG. 1 is a block diagram showing an example of a system using a log storage method according to the present invention.

【図2】図1に示すFMEM内のバンク構成、ログエリ
アの構成、及びログレコード群の構成を示す図である。
FIG. 2 is a diagram showing a bank configuration, a log area configuration, and a log record group configuration in the FMEM shown in FIG.

【図3】ログヘッダを詳細に示す図である。FIG. 3 is a diagram showing a log header in detail.

【図4】従来のログレコードを詳細に示す図である。FIG. 4 is a diagram showing a conventional log record in detail.

【図5】タイムスタンプを示す図である。FIG. 5 is a diagram showing a time stamp.

【図6】ログエリア初期化手段における処理を示すため
のフローチャートである。
FIG. 6 is a flowchart showing a process in a log area initialization unit.

【図7】ログレコード書き込み手段における処理を示す
ためのフローチャートである。
FIG. 7 is a flowchart showing a process in a log record writing unit.

【図8】ログレコード書き込み手段におけるタイムスタ
ンプ圧縮を説明するためのフローチャートである。
FIG. 8 is a flowchart for explaining time stamp compression in log record writing means.

【図9】ログレコード読み出し手段における処理を示す
ためのフローチャートである。
FIG. 9 is a flowchart illustrating a process in a log record reading unit.

【図10】ログレコード再初期化手段における処理を示
すためのフローチャートである。
FIG. 10 is a flowchart showing a process in a log record reinitialization unit.

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

1 中央処理装置(CPU) 2 フラッシュメモリデバイス(FMEM) 3 リアルタイムクロックデバイス(RTC) 4 外部記憶装置 5 バス(BUS) REFERENCE SIGNS LIST 1 Central processing unit (CPU) 2 Flash memory device (FMEM) 3 Real-time clock device (RTC) 4 External storage device 5 Bus (BUS)

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 中央処理装置と、ログデータが格納され
るフラッシュメモリデバイスと、現在の年・月・日・時
・分・秒を示すリアルタイムクロックデバイスとがバス
を介して接続される情報処理システムにおいて、前記中
央処理装置には、前記フラッシュメモリデバイス上に一
つのログヘッダと複数のログレコードとを有し、前記フ
ラッシュメモリデバイス上のログヘッダとログレコード
を全てブロック初期化してログヘッダを前記フラッシュ
メモリに書き込むログエリア初期化手段と、ログすべき
イベントが発生した際ログデータ情報とログされた時に
前記リアルタイムクロックデバイスから読み出したタイ
ムスタンプ情報とログレコードのタイム情報とログレコ
ードのレコード長情報とからなるログレコードを前記フ
ラッシュメモリデバイスに書き込むログレコード書き込
み手段と、前記ログヘッダ及びログレコードを定期的に
参照して、新しくログが追加された場合には前記ログレ
コード情報を前記フラッシュメモリデバイスから読み出
して外部記憶装置に出力するログレコード読み出し手段
と、ログ読み出し後ログできる空きエリアが予め定めら
れた程度以下に達するとログヘッダ及びログレコードエ
リアをブロック初期化し、ログヘッダを再び前記フラッ
シュメモリデバイスに書き込むログエリア再初期化手段
とが備えられていることを特徴とするフラッシュメモリ
へのログ格納方式。
An information processing system in which a central processing unit, a flash memory device storing log data, and a real-time clock device indicating current year / month / date / hour / minute / second are connected via a bus. In the system, the central processing unit has one log header and a plurality of log records on the flash memory device, and initializes all the log headers and log records on the flash memory device in blocks to store the log header in the flash memory device. Log area initializing means for writing the log data information when an event to be logged occurs, time stamp information read from the real-time clock device when the event was logged, time information of the log record, and record length information of the log record. Log record to the flash memory device Log record writing means for writing to a device, and a log for periodically reading the log record information from the flash memory device and outputting the log record information to an external storage device when a new log is added by periodically referring to the log header and the log record. A record reading means, and a log area re-initializing means for block initializing a log header and a log record area when a free area that can be logged after reading the log reaches a predetermined extent or less, and writing a log header to the flash memory device again. A method of storing logs in flash memory, which is characterized in that:
【請求項2】 請求項1に記載されたフラッシュメモリ
へのログ格納方式において、前記ログレコード書き込み
手段では、前記リアルタイムクロックデバイスのタイム
スタンプデータを以前のログレコードのタイムスタンプ
との差分からタイムスタンプデータを圧縮して前記フラ
ッシュメモリデバイスに書き込み、前記ログレコード読
み出し手段では、圧縮されてタイムスタンプデータを伸
張して外部出力に書き出すことを特徴とするフラッシュ
メモリへのログ格納方式。
2. The log storage method according to claim 1, wherein the log record writing means converts the time stamp data of the real-time clock device from a difference from a time stamp of a previous log record. A log storage method in a flash memory, wherein data is compressed and written to the flash memory device, and the log record reading means expands the time stamp data and writes it to an external output.
【請求項3】 請求項2に記載されたフラッシュメモリ
へのログ格納方式において、前記ログレコードの中には
ロギング中フラグが備えられており、前記ログレコード
書き込み手段では、ロギング開始時において前記ロギン
グ中フラグを1の状態でレコード長をライトし、ロギン
グ終了時には前記ロギング中フラグを0の状態にしてレ
コード長を再ライトし、前記ログレコード読み出し手段
では、ロギング完了フラグが1の場合には不良レコード
として当該ログレコードを無視するようにしたことを特
徴とするフラッシュメモリへのログ格納方式。
3. The log storage method according to claim 2, wherein a log flag is provided in the log record, and the log record writing unit performs the logging at the start of logging. The record length is written with the medium flag set to 1, and at the end of logging, the logging flag is set to 0 and the record length is rewritten. A log storage method in a flash memory, wherein the log record is ignored as a record.
JP9238349A 1997-09-03 1997-09-03 System for storing log into flash memory Pending JPH1185571A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9238349A JPH1185571A (en) 1997-09-03 1997-09-03 System for storing log into flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9238349A JPH1185571A (en) 1997-09-03 1997-09-03 System for storing log into flash memory

Publications (1)

Publication Number Publication Date
JPH1185571A true JPH1185571A (en) 1999-03-30

Family

ID=17028887

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9238349A Pending JPH1185571A (en) 1997-09-03 1997-09-03 System for storing log into flash memory

Country Status (1)

Country Link
JP (1) JPH1185571A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7562199B2 (en) 2005-09-30 2009-07-14 Kabushiki Kaisha Toshiba Method, apparatus and program for management of access history, storage unit, and information processing apparatus
JP2011505046A (en) * 2007-11-28 2011-02-17 サンドフォース インコーポレイテッド Increasing spare area in memory to extend memory life
JP2013171431A (en) * 2012-02-21 2013-09-02 Fujitsu Telecom Networks Ltd Log recording device, method for recording log and recording medium
US8990535B2 (en) 2011-08-04 2015-03-24 Samsung Electronics Co., Ltd. Method for operating memory controller, and memory system including the same

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63217441A (en) * 1987-03-06 1988-09-09 Nec Corp Journal collecting system
JPS6429946A (en) * 1987-07-24 1989-01-31 Nec Corp Data processor
JPH02227756A (en) * 1989-02-28 1990-09-10 Yokogawa Electric Corp digital arithmetic unit
JPH04257936A (en) * 1991-02-12 1992-09-14 Nec Eng Ltd Trace information recorder for information processing system
JPH0561720A (en) * 1991-09-04 1993-03-12 Fujitsu Ltd Trace data collector
JPH05173964A (en) * 1991-12-20 1993-07-13 Fujitsu Ltd History acquisition system for input/output data
JPH07319741A (en) * 1994-05-26 1995-12-08 Hitachi Ltd Logging information collection method for information processing equipment
JPH08235028A (en) * 1995-02-28 1996-09-13 Toshiba Corp Data management method for flash memory card and data processing apparatus using the data management method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63217441A (en) * 1987-03-06 1988-09-09 Nec Corp Journal collecting system
JPS6429946A (en) * 1987-07-24 1989-01-31 Nec Corp Data processor
JPH02227756A (en) * 1989-02-28 1990-09-10 Yokogawa Electric Corp digital arithmetic unit
JPH04257936A (en) * 1991-02-12 1992-09-14 Nec Eng Ltd Trace information recorder for information processing system
JPH0561720A (en) * 1991-09-04 1993-03-12 Fujitsu Ltd Trace data collector
JPH05173964A (en) * 1991-12-20 1993-07-13 Fujitsu Ltd History acquisition system for input/output data
JPH07319741A (en) * 1994-05-26 1995-12-08 Hitachi Ltd Logging information collection method for information processing equipment
JPH08235028A (en) * 1995-02-28 1996-09-13 Toshiba Corp Data management method for flash memory card and data processing apparatus using the data management method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7562199B2 (en) 2005-09-30 2009-07-14 Kabushiki Kaisha Toshiba Method, apparatus and program for management of access history, storage unit, and information processing apparatus
JP2011505046A (en) * 2007-11-28 2011-02-17 サンドフォース インコーポレイテッド Increasing spare area in memory to extend memory life
US8990535B2 (en) 2011-08-04 2015-03-24 Samsung Electronics Co., Ltd. Method for operating memory controller, and memory system including the same
JP2013171431A (en) * 2012-02-21 2013-09-02 Fujitsu Telecom Networks Ltd Log recording device, method for recording log and recording medium

Similar Documents

Publication Publication Date Title
US5913219A (en) Database recovery apparatus and method of using dual plane nonvolatile memory
US7065608B2 (en) Apparatus for recording data and method for writing data to flash memory
US6865658B2 (en) Nonvolatile data management system using data segments and link information
US7397707B2 (en) Compressed event counting technique and application to a flash memory system
US5579502A (en) Memory card apparatus using EEPROMS for storing data and an interface buffer for buffering data transfer between the EEPROMS and an external device
US6154808A (en) Method and apparatus for controlling data erase operations of a non-volatile memory device
US5699549A (en) Memory card having a card management information area for improved format capability and recording, reproducing, and erasing methods therefor
US7872922B2 (en) Memory system and method of writing into nonvolatile semiconductor memory
US5745912A (en) Memory card apparatus including a link table for managing the correspondency between the recorded contents in the memory card and that in the link table
US7725646B2 (en) Method of using a flash memory for a circular buffer
KR19990007270A (en) Memory Management Method
US8447964B2 (en) File update system and boot management system of mobile communication terminal, method of updating file in mobile communication terminal, and method of booting mobile communication terminal
JP2007128562A (en) Electronic part having synchronous memory
CN115291815A (en) Memory and control method thereof and memory system
JP3615299B2 (en) Rewriteable ROM storage method and storage device
JPH04307644A (en) Memory card storage control system
JPH1185571A (en) System for storing log into flash memory
US20020027508A1 (en) Power failure managing device and method for managing a power failure
JP4217909B2 (en) Reproduction method of management data record of memory erasable by block
US5048004A (en) Optical recording medium recording and reproducing device
JPH11110300A (en) External storage device and device and method for data processing
US20030026020A1 (en) Data storage
JP2003036209A (en) Nonvolatile memory and data rewriting method thereof
US20060026432A1 (en) Drive tracking system for removable media
JP3471827B2 (en) IC memory card control method and device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20000830