JP2005107808A - Data deletion method for logging device, and program - Google Patents

Data deletion method for logging device, and program Download PDF

Info

Publication number
JP2005107808A
JP2005107808A JP2003339532A JP2003339532A JP2005107808A JP 2005107808 A JP2005107808 A JP 2005107808A JP 2003339532 A JP2003339532 A JP 2003339532A JP 2003339532 A JP2003339532 A JP 2003339532A JP 2005107808 A JP2005107808 A JP 2005107808A
Authority
JP
Japan
Prior art keywords
data
file
storage medium
deleted
logging device
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
JP2003339532A
Other languages
Japanese (ja)
Inventor
Masayuki Miyanari
雅之 宮成
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.)
Yaskawa Electric Corp
Original Assignee
Yaskawa Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yaskawa Electric Corp filed Critical Yaskawa Electric Corp
Priority to JP2003339532A priority Critical patent/JP2005107808A/en
Publication of JP2005107808A publication Critical patent/JP2005107808A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method for deleting old data such that influence is not affected to record of latest data, in a logging device, and to provide a program. <P>SOLUTION: When free capacity of a storage medium becomes small, contents of an old file are deleted more than the data amount written to a latest file, to secure free capacity of the storage medium. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、ロギング装置に係り、特に記憶媒体に記録したデータの削除方法およびプログラムに関する。   The present invention relates to a logging device, and more particularly to a method and program for deleting data recorded in a storage medium.

情報処理装置やプラント装置、工作機械など多くのシステムにおいて、システムで実行された処理や操作、各種センサによる計測値といったデータを記録するためのロギング装置が備えられている。
収集されたデータは磁気ディスクなどの記憶媒体にファイルとして保管される。一般的にこのようなログファイルは1時間や1日といった周期で新しいものが作成される。しかし時間の経過とともに次々に新たなログファイルが作成されると記憶媒体の空き容量がなくなりいずれデータを記録できなくなるため、古いログファイルを削除するなどの管理が必要となる。
ログファイル管理方法として特許文献1のような、ログファイルを複数の子ファイルにより構成し、すべての子ファイルがデータで一杯になったなら最も古い子ファイルを削除し、新たな子ファイルを作成してそのファイルにデータを記録する方法などが採られていた。
In many systems such as information processing devices, plant devices, machine tools, etc., a logging device is provided for recording data such as processing and operations executed in the system and measurement values by various sensors.
The collected data is stored as a file in a storage medium such as a magnetic disk. In general, a new log file is created with a period of one hour or one day. However, as new log files are created one after another over time, the storage medium will run out of space and data will no longer be recorded, so management such as deleting old log files is required.
As a log file management method, as in Patent Document 1, a log file is composed of a plurality of child files, and when all the child files are full of data, the oldest child file is deleted and a new child file is created. The method of recording data in the file was taken.

特開平11−65895号公報JP 11-65895 A

従来のログファイルの削除方法では、記憶媒体の空き容量を確保するためにログファイルを一度に削除していた。しかしロギング装置では長時間・高頻度でデータの読み書きを行うため、ログファイルのサイズは大きくなり、さらに記憶媒体上ではファイルの断片化(フラグメンテーション)が発生している。このような状態でファイルの削除処理を行うと時間がかかり最新のデータの記録に影響を及ぼし、最悪の場合欠測するという問題があった。
本発明はこのような問題点に鑑みてなされたものであり、最新のデータの記録に影響を及ぼさないように古いデータを削除する方法およびプログラムを提供することを目的とする。
In the conventional log file deletion method, the log file is deleted at a time in order to secure free space on the storage medium. However, since the logging device reads and writes data frequently for a long time, the log file size increases, and file fragmentation occurs on the storage medium. If the file deletion process is performed in such a state, it takes time and affects the recording of the latest data.
The present invention has been made in view of such problems, and an object thereof is to provide a method and program for deleting old data so as not to affect the recording of the latest data.

上記問題を解決するため、請求項1および請求項2に記載の発明は、対象となる機器から常時データを収集する処理装置と、前記データを記録する記憶媒体とを備え、所定の時間間隔で前記記録媒体にファイルを作成し、前記データを前記ファイルに記録するロギング装置のデータ削除方法およびプログラムにおいて、前記記憶媒体の空き容量が少なくなった場合、古い前記ファイルの内容を最新の前記ファイルに書き込むデータ量以上削除して、前記記憶媒体の空き容量を確保することを特徴とするものである。   In order to solve the above problems, the inventions according to claim 1 and claim 2 comprise a processing device that constantly collects data from a target device, and a storage medium that records the data, at predetermined time intervals. In the data deletion method and program of the logging device for creating a file on the recording medium and recording the data in the file, when the free space of the storage medium is reduced, the contents of the old file are changed to the latest file. More than the amount of data to be written is deleted to secure the free space of the storage medium.

本発明によると、記憶媒体のアクセス負荷を低減させることができ、データの削除処理によってロギング装置のデータ記録に影響を及ぼさないようにすることができる。   According to the present invention, the access load on the storage medium can be reduced, and the data recording process of the logging device can be prevented from being affected by the data deletion process.

以下、本発明の具体的実施例について、図に基づいて説明する。   Hereinafter, specific examples of the present invention will be described with reference to the drawings.

図1は、本発明の方法を実施するロギング装置の構成例である。図1において1はロギング装置であり、処理装置2と記憶媒体3から構成されており、ロギング装置1と、データを収集する対象となる機器8はケーブル7によって接続されている。
処理装置2は、例えばCPUやメモリから構成され、対象となる機器8からある一定周期ごとにデータを収集し記憶媒体3に記録する。
記憶媒体3は、例えばハードディスクであり、処理装置2は時間単位や日単位で新しいファイルを記憶媒体3上に作成し、対象となる機器8から収集されたデータを書き足していく。
対象となる機器8は、例えばPLC(プログラマブル・ロジック・コントローラ)などであり、ケーブル7は、例えばLANケーブルなどである。
FIG. 1 shows an example of the configuration of a logging apparatus that implements the method of the present invention. In FIG. 1, reference numeral 1 denotes a logging device, which includes a processing device 2 and a storage medium 3, and the logging device 1 and a device 8 that collects data are connected by a cable 7.
The processing device 2 is composed of, for example, a CPU and a memory, collects data from the target device 8 at certain intervals, and records the data in the storage medium 3.
The storage medium 3 is, for example, a hard disk, and the processing device 2 creates a new file on the storage medium 3 on an hourly or daily basis, and adds data collected from the target device 8.
The target device 8 is, for example, a PLC (programmable logic controller), and the cable 7 is, for example, a LAN cable.

図2は本発明のロギング装置のデータ保存およびデータ削除の処理手順を示すフローチャートである。この図を用いて本発明の方法について順を追って説明する。
ここで、対象となる機器8から1度に収集して記憶媒体3に書き込むデータ量は一定であるとし、1度のデータ削除処理で削除する削除データ量およびデータ削除処理を行うか否かの判断材料となる記憶媒体3の空き容量の閾値を予め決めておく。さらに
空き容量の閾値>削除データ量>書き込むデータ量
であるとする。
FIG. 2 is a flowchart showing the data storage and data deletion processing procedure of the logging apparatus according to the present invention. The method of the present invention will be described step by step with reference to this figure.
Here, it is assumed that the amount of data collected from the target device 8 at a time and written to the storage medium 3 is constant, and the amount of deleted data to be deleted by one data deletion processing and whether to perform the data deletion processing. A threshold of the free capacity of the storage medium 3 that is a judgment material is determined in advance. Furthermore, it is assumed that the threshold value of free space> the amount of deleted data> the amount of data to be written.

はじめに、ステップS1で記憶媒体3の空き容量が閾値以上であるか否かチェック作業を行う。ステップS2で閾値以上であるか否かが判断される。閾値以上の空き容量があるならステップS9〜S11にて、収集したデータを記憶媒体3の最新のログファイル4に書き込む。
閾値以上の空き容量がない場合には、ステップS3に進む。ステップS3では最古のログファイル6のサイズが削除データ量以上であるかどうかをチェックする。削除データ量より大きい場合は、ステップS5〜S7にて最古のログファイル6を開いて削除データ量だけ内容を削除した後、閉じる。
First, in step S1, it is checked whether or not the free space of the storage medium 3 is equal to or greater than a threshold value. In step S2, it is determined whether or not the threshold value is exceeded. If there is free space equal to or greater than the threshold, the collected data is written to the latest log file 4 of the storage medium 3 in steps S9 to S11.
If there is no free space equal to or greater than the threshold, the process proceeds to step S3. In step S3, it is checked whether the size of the oldest log file 6 is equal to or larger than the deleted data amount. If it is larger than the deleted data amount, the oldest log file 6 is opened in steps S5 to S7, the contents are deleted by the deleted data amount, and the content is closed.

データを削除する際に時間単位や日単位で保存されている古いログファイルを削除するということを行わずに、古いログファイルの内容を、保存するデータ量以上のサイズだけ削除処理する。例えば、100msecごとに0.5kBのデータを保存しているときに、2secごとに100kBのデータを削除するようにする。これにより、記憶媒体3にデータを保存する容量を確保している。   When deleting data, the old log file saved by the hour or day is not deleted, but the contents of the old log file are deleted by a size larger than the amount of data to be saved. For example, when data of 0.5 kB is stored every 100 msec, data of 100 kB is deleted every 2 sec. Thereby, a capacity for storing data in the storage medium 3 is secured.

最古のログファイル6のサイズが1回の削除データ量(本実施例では100kB)より小さい場合は、ステップS8にて最古のログファイル6を削除する。この際、最古のログファイル6はファイルサイズが小さくなっているため、削除する際にフラグメンテーションの影響を受けることなく短時間で削除できる。このため、ファイル削除の際に最新のデータの記録に影響を与えることがない。最古のログファイル6が削除されると次回のデータ削除の際には次に古いログファイル5が最古のログファイル6としてデータ削除の対象となる。
データ削除の後、ステップS9〜S11にて収集したデータを記憶媒体3の最新のログファイル4に書き込む。
If the size of the oldest log file 6 is smaller than the deleted data amount (100 kB in this embodiment), the oldest log file 6 is deleted in step S8. At this time, since the oldest log file 6 has a small file size, it can be deleted in a short time without being affected by fragmentation. Therefore, the latest data recording is not affected when the file is deleted. When the oldest log file 6 is deleted, the next oldest log file 5 is subject to data deletion as the oldest log file 6 at the next data deletion.
After data deletion, the data collected in steps S9 to S11 is written in the latest log file 4 of the storage medium 3.

このように、データを保存する量以上のサイズ分だけ削除する手順をとるので、最新データの記録に影響を及ぼさないように記憶媒体の空き容量を確保することができる。
以上のデータ削除方法は、予め処理装置2内に組み込まれたプログラムにより自動的に実行される。
As described above, the procedure for deleting the data by the size larger than the data storage amount is taken, so that the free space of the storage medium can be secured so as not to affect the recording of the latest data.
The above-described data deletion method is automatically executed by a program previously installed in the processing device 2.

本発明は常時稼動するシステムの状態監視などの用途に利用できる。   The present invention can be used for applications such as monitoring the status of a system that is always operating.

本発明の方法を適用するロギング装置の構成を示す図The figure which shows the structure of the logging apparatus which applies the method of this invention 本発明の方法の処理手順を示すフローチャートThe flowchart which shows the process sequence of the method of this invention.

符号の説明Explanation of symbols

1 ロギング装置
2 処理装置
3 記憶媒体
4 最新のログファイル
5 ログファイル
6 最古のログファイル
7 ケーブル
8 対象となる機器
DESCRIPTION OF SYMBOLS 1 Logging apparatus 2 Processing apparatus 3 Storage medium 4 Latest log file 5 Log file 6 Oldest log file 7 Cable 8 Target apparatus

Claims (2)

対象となる機器から常時データを収集する処理装置と、前記データを記録する記憶媒体とを備え、所定の時間間隔で前記記録媒体にファイルを作成し、前記データを前記ファイルに記録するロギング装置のデータ削除方法において、
前記記憶媒体の空き容量が少なくなった場合、古い前記ファイルの内容を最新の前記ファイルに書き込むデータ量以上削除して、前記記憶媒体の空き容量を確保することを特徴とするロギング装置のデータ削除方法。
A logging device that includes a processing device that constantly collects data from a target device and a storage medium that records the data, creates a file on the recording medium at predetermined time intervals, and records the data in the file In the data deletion method,
Data deletion of the logging device, wherein when the free capacity of the storage medium decreases, the content of the old file is deleted more than the amount of data to be written to the latest file, and the free space of the storage medium is secured Method.
対象となる機器から常時データを収集する処理装置と、前記データを記録する記憶媒体とを備え、所定の時間間隔で前記記録媒体にファイルを作成し、前記データを前記ファイルに記録するロギング装置のデータ削除プログラムにおいて、
前記記憶媒体の空き容量が少なくなった場合、古い前記ファイルの内容を最新の前記ファイルに書き込むデータ量以上削除して、前記記憶媒体の空き容量を確保することを特徴とするロギング装置のデータ削除プログラム。
A logging device that includes a processing device that constantly collects data from a target device and a storage medium that records the data, creates a file on the recording medium at predetermined time intervals, and records the data in the file In the data deletion program,
Data deletion of the logging device, wherein when the free capacity of the storage medium decreases, the content of the old file is deleted more than the amount of data to be written to the latest file to ensure the free capacity of the storage medium program.
JP2003339532A 2003-09-30 2003-09-30 Data deletion method for logging device, and program Pending JP2005107808A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003339532A JP2005107808A (en) 2003-09-30 2003-09-30 Data deletion method for logging device, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003339532A JP2005107808A (en) 2003-09-30 2003-09-30 Data deletion method for logging device, and program

Publications (1)

Publication Number Publication Date
JP2005107808A true JP2005107808A (en) 2005-04-21

Family

ID=34534701

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003339532A Pending JP2005107808A (en) 2003-09-30 2003-09-30 Data deletion method for logging device, and program

Country Status (1)

Country Link
JP (1) JP2005107808A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007166175A (en) * 2005-12-13 2007-06-28 Fuji Xerox Co Ltd Image processing program, image processing method, image processing apparatus, and image processing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007166175A (en) * 2005-12-13 2007-06-28 Fuji Xerox Co Ltd Image processing program, image processing method, image processing apparatus, and image processing system

Similar Documents

Publication Publication Date Title
JP5459325B2 (en) Cache device, cache program, and communication device
US8538925B2 (en) System and method for backing up test data
US20100312807A1 (en) Recording device, recording method and program
CN103713972B (en) A kind of incremental backup system and method
JP2009187545A (en) Method for protecting saved operational data of machine equipment or similar equipment
CN105653393B (en) A method of mass file backup is carried out based on USN log modes
TWI519951B (en) Data storage device and flash memory control method
CN111966531B (en) Data snapshot method and device, computer equipment and storage medium
JP2005107808A (en) Data deletion method for logging device, and program
CN106484564B (en) Collected data storage method
CN109753222B (en) Data deleting method, server and computer readable medium
WO2020005633A1 (en) Download management
JP2006221439A (en) Method for storing log
JP2013025655A (en) Log file management module and log file management method
CN115328851A (en) Data protection method, device, equipment and medium
CN105706067A (en) Microcomputer with built-in flash memory, method for writing data to built-in flash memory of microcomputer, and program for writing data to flash memory
JP7067260B2 (en) Control device and data recording method
CN109660576B (en) User data real-time migration method, storage medium, electronic device and system
CN109508446B (en) Log processing method and device
JP7358772B2 (en) Control device, control method, control program
JP2006227888A (en) Backup system and method
US20070288699A1 (en) System and method of protecting data in write-back cache between storage systems
JP2009048749A (en) File system management method, file system management device, and recording medium with file system management program recorded thereon
JP2006195516A (en) Data management device, image processor, data management method, and data management program
JPH09259029A (en) Control system for storage device using eeprom