JP2006259937A - Data collection device and data recovery device - Google Patents

Data collection device and data recovery device Download PDF

Info

Publication number
JP2006259937A
JP2006259937A JP2005074118A JP2005074118A JP2006259937A JP 2006259937 A JP2006259937 A JP 2006259937A JP 2005074118 A JP2005074118 A JP 2005074118A JP 2005074118 A JP2005074118 A JP 2005074118A JP 2006259937 A JP2006259937 A JP 2006259937A
Authority
JP
Japan
Prior art keywords
data
input
value
prediction
compression processing
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
JP2005074118A
Other languages
Japanese (ja)
Inventor
Tadashi Nakamura
直史 中村
Akiharu Takenaka
章晴 竹中
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2005074118A priority Critical patent/JP2006259937A/en
Publication of JP2006259937A publication Critical patent/JP2006259937A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce a writing amount and thus reduce the entire period of time for writing by dynamically compressing input data. <P>SOLUTION: The device is equipped with an input processing part 11 for reading data from an input source such as an external device 20 and storing the data in an input data arrangement memory part 11a, a compression processing part 12 for reading the data in the input data arrangement memory part 11a stored by the input processing part 11 and performing compression processing, a storing processing part 13 for storing the compressed data compressed by the compression processing part 12 in a storage device 21, and a setting processing part 14 for setting operation/function of the input processing part 11 and the compression processing part 12. The input processing part 11 collects/stores a data to be classified into a bit data and a numerical value data and the data are compressed by the compression processing part 12. The compression processing part 12 classifies the input information into the bit data and the numerical value data, performs input value estimation from the characteristic of each data in a time sequence, obtains the difference between the data and an actual input value, represents a difference value with high appearing frequency by a short sign and deletes the data amount. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

この発明は、データ収集装置およびデータ復元装置に関するもので、取得したデータを圧縮して格納したり、その圧縮したデータを復元したりする技術に関する。   The present invention relates to a data collection device and a data restoration device, and relates to a technique for compressing and storing acquired data and restoring the compressed data.

生産工場(製造現場)に設置されるFA(ファクトリーオートメーション)システムの制御を司るPLC(プログラマブルロジックコントローラ)は、制御プログラムに基づいて演算実行するCPUユニット、センサやスイッチなどの入力機器を接続してそれらのオン・オフ信号を入力信号として取り込む入力ユニット、アクチュエータやリレーなどの出力機器を接続してそれらに対して出力信号を送り出す出力ユニット、上位端末装置などと接続してそれと情報をやりとりする通信ユニット、各ユニットに電源を供給する電源ユニット、など複数のユニットを組み合わせることにより構成されている。そしてPLCは、入力ユニットで入力した信号をCPUユニットのI/Oメモリに取り込み(INリフレッシュ処理)、予め登録されたラダー言語で組まれた制御プログラムに基づき論理演算をし(プログラム演算実行処理)、その演算実行結果をI/Oメモリに書き込んで出力ユニットに送り出し(OUTリフレッシュ処理)、その後、ネットワーク接続された上位端末装置や表示器等と通信する(周辺サービス処理)、といった各処理をサイクリックに繰り返す。   A PLC (programmable logic controller) that controls the FA (factory automation) system installed in a production factory (manufacturing site) connects input devices such as CPU units, sensors, and switches that execute calculations based on control programs. An input unit that captures these on / off signals as input signals, an output unit that sends output signals to actuators, relays, and other output devices, and a communication that connects and exchanges information with higher-level terminal devices It is configured by combining a plurality of units such as a unit and a power supply unit that supplies power to each unit. Then, the PLC fetches the signal input from the input unit into the I / O memory of the CPU unit (IN refresh process), and performs a logical operation based on a pre-registered ladder language (program operation execution process). The operation execution result is written in the I / O memory, sent to the output unit (OUT refresh process), and then communicated with a higher-level terminal device or display connected to the network (peripheral service process). Repeat on click.

CPUユニットの処理の一例を簡単に説明すると、まず初期処理をした後、I/Oユニットや高機能ユニットとの間で入/出力データ(I/Oデータ)を交換するI/Oリフレッシュ処理,ユーザプログラムに沿って入力データを論理演算するプログラム実行処理,主に通信ユニットによりネットワークを通じて外部とデータ交換をしたり、外部からのメッセージ要求処理などを行なう周辺処理、といった各処理をサイクリックに実行する。なお、一般に各処理が行われる1サイクルに所要する時間は、サイクルタイムと言われる。   An example of the processing of the CPU unit will be briefly described. First, after initial processing, I / O refresh processing for exchanging input / output data (I / O data) with an I / O unit or a high-function unit. Cyclic execution of program execution processing that performs logical operations on input data in accordance with the user program, and peripheral processing that mainly exchanges data with the outside through the network by the communication unit, and performs message request processing from the outside. To do. In general, the time required for one cycle in which each process is performed is called a cycle time.

CPUユニットはIOメモリを持っており、そのIOメモリにIOユニットや高機能ユニットからの入力データを格納するとともに、ユーザプログラムを実行した結果を出力データとして格納するようになっている。CPUユニットは、出力データをIOユニットや高機能ユニットに送り、それらユニットは受け取った出力データに基づいて出力機器を動作させる。   The CPU unit has an IO memory, and the input data from the IO unit and the high function unit is stored in the IO memory, and the result of executing the user program is stored as output data. The CPU unit sends output data to the IO unit and the high-function unit, and these units operate the output device based on the received output data.

上記のIOメモリには、その時々の入力装置や出力装置についての制御値・現在値(ON/OFF,数値)等が格納されているので、当該IOメモリに格納されているセンサ、アクチュエータ類の現在値等を入力情報として所定のタイミングで周期的にフラッシュメモリやハードディスクなどのストレージデバイスに蓄積することにより、PLCの履歴(IOデータがどのように変化したかの履歴)を記録できるようにしたものもある。この履歴を確認することにより、PLCの動作状態の履歴や被制御機器への制御履歴を知ることができ、FA現場での動作履歴などを後工程で解析することができる。   Since the IO memory stores control values and current values (ON / OFF, numerical values) of the input device and output device at each time, the sensors and actuators stored in the IO memory are stored in the IO memory. PLC history (how IO data has changed) can be recorded by periodically storing the current value, etc. as input information in a storage device such as a flash memory or hard disk at a predetermined timing. There are also things. By confirming this history, it is possible to know the history of the operation state of the PLC and the control history of the controlled device, and the operation history at the FA site can be analyzed in a subsequent process.

このようにデータを収集するための構成としては、例えば、特許文献1に開示されたようなPLCのPLCバスに接続したデータ収集ユニットを用いたり、PLCの通信ユニットを介してPLCに接続され、外部からCPUユニットに対してアクセス通信し、IOメモリに格納されたデータを収集するデータ収集装置を用いるなど、各種の形態がある。   As a configuration for collecting data in this way, for example, a data collection unit connected to the PLC's PLC bus as disclosed in Patent Document 1 is used, or connected to the PLC via the PLC's communication unit. There are various forms such as using a data collection device that accesses and communicates with the CPU unit from the outside and collects data stored in the IO memory.

この時、一般的に後の解析工程での利用を想定し、表計算ソフトなどで使用できるようにカンマ区切りのテキストファイル形式で保存する。これにより、例えば、図1に示すように、各入力データは表の列を構成し、収集時間単位で表の行が構成される。
特開2004−199670号公報
At this time, it is generally assumed that it will be used in later analysis processes, and saved in a comma-delimited text file format so that it can be used in spreadsheet software. Thereby, for example, as shown in FIG. 1, each input data constitutes a column of the table, and a row of the table is constituted by a collection time unit.
Japanese Patent Laid-Open No. 2004-199670

ところで、作業工程の多様化や制御対象の複雑化により、収集・蓄積すべき入力点数は増大するばかりでなく、より高度な解析を行なうために収集周期は短サイクル化している。このため、収集・蓄積すべきデータ量は増大することになるが、FA現場などで使用できるストレージデバイスのサイズには制限があり、適切な解析を行なうために必要な入力情報を蓄積できない状況が発生している。   By the way, not only the number of input points to be collected / accumulated increases due to diversification of work processes and complicated control objects, but the collection cycle is shortened to perform more advanced analysis. For this reason, the amount of data to be collected / stored increases, but there is a limit to the size of storage devices that can be used at FA sites, etc., and there is a situation in which input information necessary for appropriate analysis cannot be stored. It has occurred.

また、これらのストレージデバイスは、パーソナルコンピュータなどで使用されるハードディスクと比較して書き込み速度が低速である。そのため、現在のストレージデバイスの性能では、上述した高度な解析を行なうために要求される収集周期では書き込みができない場合がある。係る場合、間引いた状態でストレージデバイスデバイスにデータを蓄積することになり、解析の精度が低下する。   In addition, these storage devices have a lower writing speed than a hard disk used in a personal computer or the like. For this reason, in the current storage device performance, there are cases where writing cannot be performed in the collection cycle required for performing the above-described advanced analysis. In such a case, data is accumulated in the storage device device in the thinned state, and the accuracy of analysis is reduced.

この発明は、入力データを収集単位や時系列で収集したデータを動的に圧縮することで、書き込み量を減らし、かつ全体の書き込み時間を短縮することができ、期待するデータ量をストレージデバイスの書き込み能力を超えて蓄積可能とすることができ、また、蓄積した圧縮データの利用者は、展開時に完全に入力データを再現できる可逆圧縮を行なうことができ、データ収集装置およびデータ復元装置を提供することを目的とする。   The present invention dynamically compresses data collected in units of collection or time series of input data, thereby reducing the amount of writing and shortening the entire writing time. The data can be stored beyond the writing capability, and the user of the stored compressed data can perform reversible compression that can completely reproduce the input data at the time of decompression, and provides a data collection device and a data restoration device. The purpose is to do.

本発明に係るデータ収集装置は、時系列に変化するデータを周期的に取得する入力データ取得手段と、前記入力データ取得部で取得した直近の所定回数の入力データから次の入力データを予測する予測手段と、その予測手段が予測した予測値と、入力データ取得手段が取得した入力データとを比較する比較手段(実施の形態では、「差分値算出手段」に対応)と、その比較手段で求めた比較値に対して圧縮処理を行なう圧縮処理手段と、その圧縮処理手段で圧縮した圧縮データを記憶手段に向けて出力する手段とを備えて構成した。比較値は、実施の形態では、単純に差分値を求めるようにしたが、一致の程度その他各種の演算により求めることができる。差分値のようにすると、演算処理が簡単で済むので好ましい。ここで、「直近」とは、実施形態で示すように、1つ前のデータ(時系列的に前回のデータ)を含む直前の所定数(1回を含む)が含まれるのはもちろんのこと、たとえば、時系列的な前回データを含ませずに、それ以前のデータであっても直近に含まれる。但し、予測値を求めることができないほど、次回に取得するデータと関連性(つながり)が低い過去のデータは含まない。換言すると、例えば前々回や、それ以前のデータに基づいて次に取得するデータを予測することができる範囲のデータは、直近のデータに含まれる。   A data collection apparatus according to the present invention predicts next input data from input data acquisition means for periodically acquiring data that changes in time series, and the most recent predetermined number of input data acquired by the input data acquisition unit. A prediction means, a comparison means for comparing the prediction value predicted by the prediction means and the input data acquired by the input data acquisition means (corresponding to “difference value calculation means” in the embodiment), and the comparison means Compression processing means for performing compression processing on the obtained comparison value and means for outputting the compressed data compressed by the compression processing means to the storage means are provided. In the embodiment, the comparison value is simply obtained as a difference value. However, the comparison value can be obtained through various calculations. The difference value is preferable because the calculation process is simple. Here, “most recent” includes, as shown in the embodiment, a predetermined number (including one) immediately before including the previous data (previous data in time series). For example, the previous data is not included in the previous time series, and the previous data is included immediately. However, it does not include past data that is so low in relevance (connection) as data to be acquired next time that the predicted value cannot be obtained. In other words, for example, data in a range in which data to be acquired next can be predicted based on previous data or previous data is included in the latest data.

データの圧縮は、一般にデータの冗長性を見つけ、冗長部分を端的に表現することで全体のデータ量を削減する手法がとられる。しかし、例えばFA現場で時系列に入力されるビットデータや数値データは、その入力ソースによってデータの偏りは様々であり、規則的な冗長性は定義できない。そのため、一般的に行なわれている圧縮技術をそのまま適用することは困難である。   In general, data compression is performed by finding the redundancy of data and expressing the redundant portion in a straightforward manner to reduce the total data amount. However, for example, bit data and numerical data input in time series at the FA site vary in data bias depending on the input source, and regular redundancy cannot be defined. Therefore, it is difficult to apply a compression technique that is generally performed as it is.

一方、これらのデータは、現時点に近い数点の既入力データからある程度次回入力値が予測可能である。実施の形態で詳細に説明するように、予測値が入力値と一致したり、近似したりする場合には、入力値と予測値の差分値は図6に示すように値0を中心として一定の範囲に集中する。そこで、本発明では、このデータの出現範囲の偏りを冗長性として捉え、圧縮を実施することに至った。もちろん、本発明が至った経緯は、FA現場での予測値と実際の入力値が一致・近似する確率が高いことに着目して、そのデータの出現範囲の偏りを冗長性として圧縮をするようにしたが、本発明の適用分野はこのようにFA現場に限ることはなく、同様の予測値と実際の入力値と比較結果から偏りがみられ、それを冗長性ととらえて圧縮処理を適用して行なえるものであればよい。   On the other hand, for these data, the next input value can be predicted to some extent from the already input data of several points close to the present time. As will be described in detail in the embodiment, when the predicted value matches or approximates the input value, the difference value between the input value and the predicted value is constant around the value 0 as shown in FIG. Concentrate on the range. Therefore, in the present invention, the bias in the appearance range of the data is regarded as redundancy, and compression is performed. Of course, the reason why the present invention has been reached is that the predicted value in the FA field and the actual input value are likely to match / approximate, and the bias of the appearance range of the data is compressed as redundancy. However, the application field of the present invention is not limited to the FA site in this way, and there is a bias in the same predicted value, actual input value, and comparison result, and this is regarded as redundancy and compression processing is applied. Anything that can be done.

より具体的には、例えば、前記圧縮処理手段が行なう圧縮処理の対象が、同一周期で取得された複数の入力データについての比較値としたり、前記圧縮処理手段が行なう圧縮処理の対象が、連続する複数周期の単独のデータの比較値としたりすることができる。   More specifically, for example, the target of the compression processing performed by the compression processing unit is a comparison value for a plurality of input data acquired in the same cycle, or the target of the compression processing performed by the compression processing unit is continuous. Or a comparison value of single data of a plurality of periods.

また、前記入力データが複数種類存在し、前記圧縮処理手段は、その入力データの種類に応じて、異なる圧縮処理を行なうようにしてもよい。複数種類は、実施の形態では、ビットデータと数値データのように、適する予測アルゴリズムが異なるものである。これにより、各入力データの種類毎に予測値の精度が上がるため、圧縮効率も高くなる。一例としては、入力データをビットデータ、数値データに分別し、それぞれのデータの時系列での特徴より、入力値予測を行なうことがある。   Further, there may be a plurality of types of input data, and the compression processing means may perform different compression processing depending on the type of the input data. In the embodiments, suitable prediction algorithms are different such as bit data and numerical data in the embodiment. As a result, the accuracy of the predicted value increases for each type of input data, and the compression efficiency also increases. As an example, input data is classified into bit data and numerical data, and input value prediction is performed based on the characteristics of each data in time series.

また、前記比較値は、入力値と予測値の差分値であり、前記圧縮処理は、前記差分値の頻度が高い程少ないビット数で表現するようにすることができる。差分値を保存する際に、出現頻度の高い差分値を短い符号で表すことで全体のデータ量を削減する。   Further, the comparison value is a difference value between the input value and the predicted value, and the compression processing can be expressed by a smaller number of bits as the frequency of the difference value is higher. When the difference value is stored, a difference value having a high appearance frequency is represented by a short code to reduce the entire data amount.

本発明のデータ収集装置は、各種の分野に適用することは可能であるが、例えば前記入力データは、FAシステムにおける入力データとすることができる。具体的には、前記入力データは、ON/OFFデータであり、前記予測手段は、直近に得られたON/OFFの状態(複数の場合には、パターン)から次に入力された入力データを予測するものであり、前記圧縮手段は、予測値が当たった場合を0または1とし、予測値がはずれた場合を1または0(予測が当たった場合と反対の値)で表現し、同一数字の連続する数を用いて表現することで圧縮する機能を備えることができる。また、前記入力データは、アナログデータであり、少なくとも直近のN回分のデータを記憶する記憶手段を有し、前記予測手段は、その記憶手段に格納された前記直近のN回分のデータを予め設定された予測演算式に代入して、次に入力される予測値を求め、前記圧縮処理手段は、前記入力値と前記予測値が一致した場合を「0」で表現し、その入力値と予測値との差が小さい程少ないビット数で表現するようにしてもよい。   The data collection device of the present invention can be applied to various fields. For example, the input data can be input data in an FA system. Specifically, the input data is ON / OFF data, and the predicting means calculates the input data input next from the most recently obtained ON / OFF state (in the case of a plurality of patterns). The compression means represents 0 or 1 when the predicted value is hit, and expresses 1 or 0 (the opposite value to the case when the predicted value is hit) when the predicted value is lost. The function of compressing can be provided by expressing using consecutive numbers. The input data is analog data, and has storage means for storing at least the latest N data, and the prediction means presets the latest N data stored in the storage means. The prediction value to be input next is obtained by substituting into the predicted calculation formula, and the compression processing means expresses the case where the input value and the prediction value match with “0”, and the input value and the prediction The smaller the difference from the value, the smaller the number of bits.

FAシステムの場合、IO情報のON/OFFの値の場合、同じ値を連続してとることが多く、また、アナログデータの値には、同じ値を採ったり、変動するにしても急に大きく変化することは少なく、緩やかに変動することが多い。そのため、それ以前に取得したデータに基づいて、次の入力データの予測をしやすいという特質がある。よって、予測値と実際の入力値とが一致する度合い(確率)が高く、仮にはずれたとしても、そのはずれた場合の予測値との差は小さい。よって、ON/OFFデータの場合には、予測が一致した場合を0または1に設定することで、当該0または1が連続する数が増える。その結果、連続した数で表現することで、圧縮が可能となる。また、アナログデータの場合、予測値と一致した場合を0(1ビット)で示し、予測値と実際の入力値の差が小さいほど短いビット数で表現することで、全体を表現する場合に必要なビット数を削減できる。   In the case of FA system, the same value is often taken continuously in the case of the ON / OFF value of IO information, and the value of analog data suddenly increases even if the same value is taken or fluctuates. It rarely changes and often fluctuates slowly. Therefore, there is a characteristic that it is easy to predict the next input data based on data acquired before that time. Therefore, the degree (probability) that the predicted value matches the actual input value is high, and even if the predicted value deviates, the difference from the predicted value when the predicted value deviates is small. Therefore, in the case of ON / OFF data, the number of consecutive 0s or 1s increases by setting 0 or 1 when the predictions match. As a result, compression can be achieved by expressing the numbers as consecutive numbers. Also, in the case of analog data, the case where it matches the predicted value is indicated by 0 (1 bit), and it is necessary for expressing the whole by expressing with a shorter number of bits as the difference between the predicted value and the actual input value is smaller. The number of bits can be reduced.

本発明のデータ復元装置は、上述したデータ収集装置により圧縮されたデータを復元するデータ復元装置であって、前記圧縮したデータと、少なくとも比較値が存在しない入力値と、前記予測手段が予測した予測値またはその予測手段の予測ルール(ハフマンツリー,予測テーブル等)と、を取得する手段と、その取得する手段により取得した圧縮したデータと、比較値が存在しない入力値と、予測値/予測ルールに基づき、入力値を求めるデータ展開手段とを備えて構成した。   The data decompression device of the present invention is a data decompression device that restores the data compressed by the above-described data collection device, the compressed data, at least an input value that does not have a comparison value, and the prediction means predicted Means for obtaining a prediction value or a prediction rule (Huffman tree, prediction table, etc.) of the prediction means, compressed data acquired by the acquisition means, an input value for which no comparison value exists, and prediction value / prediction Based on the rules, the data expansion means for obtaining the input value is provided.

本発明では例えばFA現場における単独または複数の入力情報を元のデータを欠損することなくデータ量を削減し、ストレージデバイス等の記憶手段に保存することができる。また、保存したデータをデータ復元装置(パソコン等により実現できる)で元の入力情報に復元することができる。   In the present invention, for example, single or plural pieces of input information at the FA site can be saved in storage means such as a storage device by reducing the data amount without losing the original data. Further, the stored data can be restored to the original input information by a data restoration device (which can be realized by a personal computer or the like).

本発明のデータ収集装置では、入力データを収集単位や時系列で収集したデータを動的に圧縮することで、書き込み量を減らし、かつ全体の書き込み時間を短縮することができ、期待するデータ量をストレージデバイスの書き込み能力を超えて蓄積可能とすることができる。また、蓄積した圧縮データの利用者は、データ復元装置を用いることで、展開時に完全に入力データを再現できる可逆圧縮を行なうことができる。   In the data collection device of the present invention, the amount of data that can be expected can be reduced by dynamically compressing the input data collected in the collection unit or time series, thereby reducing the amount of writing and the overall writing time. Can be stored beyond the writing capability of the storage device. Further, the user of the stored compressed data can perform lossless compression that can completely reproduce the input data at the time of decompression by using the data decompression device.

図2は、本発明の好適な一実施の形態を示している。図2に示すように、本実施の形態のデータ収集装置10は、PLC1を構成するユニットの1つ(データ収集ユニット)として実現されている。すなわち、データ収集装置10(データ収集ユニット)は、電源ユニット2,CPUユニット3,IOユニット4,マスタ−スレーブ通信をするマスタユニット5などの各種の機能を実現するためのユニットと連結し、PLC1を構成する。従って、本データ収集装置10は、PLCバスを介してCPUユニット3内のIOメモリや、その他にユニットのメモリにアクセスし、データを収集することができる。   FIG. 2 shows a preferred embodiment of the present invention. As shown in FIG. 2, the data collection device 10 of the present embodiment is realized as one of the units (data collection unit) constituting the PLC 1. That is, the data collection device 10 (data collection unit) is connected to a unit for realizing various functions such as a power supply unit 2, a CPU unit 3, an IO unit 4, a master unit 5 that performs master-slave communication, and the PLC 1 Configure. Therefore, the data collection device 10 can collect data by accessing the IO memory in the CPU unit 3 and other unit memories via the PLC bus.

もちろん、CPUユニット3は、PLCバスを介してIOユニット4等を接続していて、そのIOユニットにはIOデバイスが接続されている。IOデバイスは、例えばオン・オフ動作をするセンサやスイッチ等の入力機器や、アクチュエータやパワーリレー等の出力機器のことである。そしてCPUユニット3のIOメモリは、IOデバイスの入力機器のオン・オフ状態に関するデータおよび出力機器の動作状態に関するデータ等を格納している。従って、データ収集装置10は、CPUユニット3のIOメモリをアクセスすることで、IOユニット3に接続されたIO機器の情報や、マスタユニット5がネットワークを介してマスタスレーブ通信により取得した情報を取得することができる。   Of course, the CPU unit 3 is connected to the IO unit 4 or the like via the PLC bus, and an IO device is connected to the IO unit. The IO device is an input device such as a sensor or a switch that performs an on / off operation, or an output device such as an actuator or a power relay. The IO memory of the CPU unit 3 stores data relating to the on / off state of the input device of the IO device, data relating to the operating state of the output device, and the like. Therefore, the data collection device 10 accesses the IO memory of the CPU unit 3 to acquire information on the IO devices connected to the IO unit 3 and information acquired by the master unit 5 through master-slave communication via the network. can do.

図3は、本実施の形態のデータ収集装置10を示している。すなわち、このデータ収集装置10は、外部デバイス類20等の入力ソースからデータを読み出し(収集)し、入力データ配列記憶部11aに格納する入力処理部11と、入力処理部11が格納した入力データ配列記憶部11aを読み出して圧縮処理を行なう圧縮処理部12と、その圧縮処理部12で圧縮処理をした圧縮データを記憶装置たるストレージデバイス21に保存する保存処理部13と、入力処理部11並びに圧縮処理部12の動作・機能を設定する設定処理部14とを備えている。
外部デバイス類20は、CPUユニット3(IOメモリ),他のユニット,PLC1以外のネットワークに接続された機器など、各種のものがある。
FIG. 3 shows the data collection device 10 of the present embodiment. That is, the data collection device 10 reads (collects) data from an input source such as the external device 20 and stores the data in the input data array storage unit 11a, and the input data stored in the input processing unit 11. The compression processing unit 12 that reads the array storage unit 11a and performs compression processing, the storage processing unit 13 that stores the compressed data compressed by the compression processing unit 12 in the storage device 21 that is a storage device, the input processing unit 11 and And a setting processing unit 14 for setting the operation / function of the compression processing unit 12.
The external devices 20 include various devices such as a CPU unit 3 (IO memory), other units, and devices connected to a network other than the PLC 1.

設定処理部14は、収集すべきデータを特定するとともに、その収集すべきデータ、つまり、入力情報毎に、入力周期(時間),入力ソース(メモリアドレス、IO、ネットワーク、など、その入力データが存在する箇所を特定する情報等),入力データの種別(ビット/数値(8ビット、16ビット、32ビットなど整数、浮動小数(単精度、倍精度))を定義し、設定メモリ14aに記憶する。この設定メモリ14aのデータ構造の一例としては、例えば、図4に示すようになる。このように、通常、収集対象となる入力データの種別は、BIT情報や数値データなど、複数種類が混在しているし、入力周期も異なる。もちろん、入力周期は全て等しくても良い。   The setting processing unit 14 specifies the data to be collected, and the input data such as the input cycle (time), input source (memory address, IO, network, etc.) for each piece of data to be collected, that is, input information. Define the existing location, etc.) and the type of input data (bit / numerical value (8 bits, 16 bits, 32 bits, integer, floating point (single precision, double precision)), and store them in the setting memory 14a An example of the data structure of the setting memory 14a is, for example, as shown in Fig. 4. As described above, there are usually a plurality of types of input data to be collected, such as BIT information and numerical data. However, the input periods are different, and of course, all the input periods may be equal.

入力処理部11は、設定メモリ14aから収集すべき各入力の設定を読み出し、各入力の入力周期にしたがって各種デバイス類20などの入力ソースからデータを読み出す。そして、読み出したデータは、後段の圧縮処理の手法の相違から、BIT情報と数値情報に分けて入力データ配列記憶部11aに保存する。換言すると、入力データ配列記憶部11aは、BIT情報用の入力データ配列と、数値情報用の入力データとがある。入力処理部11の処理機能は、具体的には、図5に示すフローチャートを実行するようになる。   The input processing unit 11 reads the setting of each input to be collected from the setting memory 14a, and reads data from an input source such as various devices 20 according to the input cycle of each input. The read data is divided into BIT information and numerical information and stored in the input data array storage unit 11a due to the difference in the subsequent compression processing technique. In other words, the input data array storage unit 11a has an input data array for BIT information and input data for numerical information. Specifically, the processing function of the input processing unit 11 executes the flowchart shown in FIG.

まず、X=1に初期化し(S1)、入力Xの入力周期か否かを判断する(S2)。ここで、入力Xは、入力No.の値を示し、この入力No.は一種のレコードNo.と同様である。入力名(入力A,入力B等)に基づいて処理を実行しても良い。図4に示す例では、Xは、1から10の値を採る。入力Xの周期か否かは、設定メモリ14aに格納されたその入力Xに対応する入力周期に該当するか否かにより決定する。収集対象の入力データの条件が、図4に示す設定メモリ14aのようになっている場合、BITデータの入力周期は1msecであり、数値データの入力周期は2msecとなっているので、現在、上記の各周期に来ているか否かにより容易に判断できる。   First, X is initialized to 1 (S1), and it is determined whether or not the input cycle is the input X (S2). Here, the input X is an input No. This input No. Is a kind of record No. It is the same. Processing may be executed based on the input name (input A, input B, etc.). In the example shown in FIG. 4, X takes a value from 1 to 10. Whether or not it is the cycle of the input X is determined by whether or not it corresponds to the input cycle corresponding to the input X stored in the setting memory 14a. When the condition of the input data to be collected is as in the setting memory 14a shown in FIG. 4, the input cycle of BIT data is 1 msec and the input cycle of numerical data is 2 msec. It can be easily judged by whether or not each period is reached.

入力周期に来ていない場合には、処理ステップS6に飛び、Xを1インクリメントし(S6)、インクリメント後のXの値が、最大値(図4の例では、10)よりも大きい数値になったか否かを判断する(S7)。そして、最大値に達していない場合には、処理ステップS2に戻り、インクリメント後の入力Xの入力周期に来たか否かを判断する。また、Xの値が最大値を超えた(図4に示す設定メモリ14aの場合には、インクリメント後のXが11になった)場合には、処理ステップS7の分岐判断がYesとなるので、処理ステップ1に戻りX=1に初期化し、入力Noが1のデータについての処理に戻る。   If the input cycle has not been reached, the process jumps to processing step S6, X is incremented by 1 (S6), and the value of X after the increment is larger than the maximum value (10 in the example of FIG. 4). It is determined whether or not (S7). If the maximum value has not been reached, the process returns to step S2 to determine whether or not the input cycle of the input X after the increment has been reached. If the value of X exceeds the maximum value (in the case of the setting memory 14a shown in FIG. 4, X after the increment is 11), the branch determination in processing step S7 is Yes, Returning to process step 1, X = 1 is initialized, and the process returns to the process for the data whose input No is 1.

一方、入力Xの入力周期に来た場合には、処理ステップS2の分岐判断がYesとなるので、処理ステップS3に飛び、現在の入力Xの入力種別が、BITか数値かを判断する(S3)。そして、入力種別がBITの場合には、その入力Xの入力ソースからデータを読み出し、読み出したデータをBIT用の入力データ配列に格納する(S4)。また、入力種別が数値の場合には、その入力Xの入力ソースからデータを読み出し、読み出したデータを数値用の入力データ配列に格納する(S5)。上記のS4,S5のいずれかの処理を実行し、所定の入力データ配列にデータを格納したならば、処理ステップS6に進み、Xをインクリメントする。上述した処理を繰り返し実行することにより、設定メモリ14aに格納されたすべての入力データの先頭から最後までについて、順次実行し、収集タイミングに来たならばデータを読み出して、所望の入力データ配列記憶部11aに格納することができる。   On the other hand, when the input cycle of the input X is reached, the branch determination in the processing step S2 is Yes, so that the process jumps to the processing step S3 and determines whether the input type of the current input X is BIT or a numerical value (S3). ). If the input type is BIT, data is read from the input source of the input X, and the read data is stored in the BIT input data array (S4). If the input type is a numerical value, data is read from the input source of the input X, and the read data is stored in the numerical input data array (S5). If any of the processes of S4 and S5 is executed and data is stored in a predetermined input data array, the process proceeds to process step S6, and X is incremented. By repeatedly executing the above-described processing, all input data stored in the setting memory 14a are sequentially executed from the beginning to the end, and when the acquisition timing comes, the data is read and the desired input data array storage It can be stored in the part 11a.

圧縮処理部12は、設定メモリ14aから各入力データについての入力周期と入力種別を読み出す。そして、入力周期,入力種別ごとに入力データを入力データ配列から読み出す。本実施の形態の場合には、実際には、入力処理部が、入力データの入力周期に合わせてデータを読み出して、入力データ配列記憶部11aに格納するとともに、入力周期は、入力種別単位で等しい(BIT:1msec,数値:2msec)ため、入力種別単位で、一括してそれぞれの入力データ配列記憶部11aに格納されたデータを読み出せばよい。   The compression processing unit 12 reads the input cycle and input type for each input data from the setting memory 14a. Then, input data is read from the input data array for each input cycle and input type. In the case of the present embodiment, the input processing unit actually reads out data in accordance with the input cycle of the input data and stores it in the input data array storage unit 11a, and the input cycle is in units of input types. Since they are equal (BIT: 1 msec, numerical value: 2 msec), the data stored in each input data array storage unit 11a may be read in batches in units of input types.

そして、圧縮処理部12における圧縮処理は、基本的には、いずれも、入力値を取得し、それまでの入力値に基づいて、各入力データのそれぞれに対して次の入力値を予測し、次に取得する入力値(実測値)との差分をとる。予測値が入力値に近似する場合、差分値は0を対称軸として図6のような分布になる。このとき、出現回数の多い値を少ないビット数で符号化することで、図1に示すように全ての値を16ビットで表現した場合よりも全体の使用ビット数を削減できる。   The compression processing in the compression processing unit 12 basically obtains an input value, predicts the next input value for each of the input data based on the input value so far, Next, the difference from the acquired input value (actual value) is taken. When the predicted value approximates the input value, the difference value has a distribution as shown in FIG. At this time, by encoding a value with a large number of appearances with a small number of bits, the total number of bits used can be reduced as compared with a case where all values are expressed with 16 bits as shown in FIG.

例えば、差分値が0になる場合が全体の50%とするとこれを1ビットで表現する。さらに、4ビットで表現できる値が全体の40%、12ビットで表される値が全体の9%、18ビットで表される値が全体の1%とすると、ひとつの値あたり必要とするビット数は「0.5+1.6+1.08+0.18=3.36ビット」となり、すべての値を16ビットで表現した場合に比較して1/4以下のビット数で全体が表現できり、圧縮できる。   For example, if the difference value is 0, 50% of the total value is represented by 1 bit. Furthermore, if the value that can be represented by 4 bits is 40% of the whole, the value that is represented by 12 bits is 9% of the whole, and the value that is represented by 18 bits is 1% of the whole, the required bits per value The number is "0.5 + 1.6 + 1.08 + 0.18 = 3.36 bits". Compared to the case where all values are expressed in 16 bits, the whole can be expressed with a bit number of 1/4 or less and can be compressed. .

圧縮の効果は、入力値と予測値との差が、ある一定の値に集中するほど好ましい。従って、予測の精度が高いほど、図6に示す分布のピーク値が高くなり、差分値が0(或いは0に近似する値)になる頻度が高くなり、圧縮の効果が高くなる。そこで、本実施の形態では、入力の種別が、BITと数値のように複数種類存在し、それぞれに適した予測値の算出アルゴリズムが異なることから、圧縮処理部12は、数値用圧縮処理部15と、BIT用圧縮処理部16とを備えている。   The compression effect is more preferable as the difference between the input value and the predicted value concentrates on a certain value. Therefore, the higher the prediction accuracy, the higher the peak value of the distribution shown in FIG. 6, the higher the frequency at which the difference value becomes 0 (or a value approximating 0), and the higher the compression effect. Therefore, in the present embodiment, there are a plurality of types of input such as BIT and numerical values, and the prediction value calculation algorithm suitable for each of them is different. Therefore, the compression processing unit 12 uses the numerical value compression processing unit 15. And a BIT compression processing unit 16.

図7は、数値用圧縮処理部15を示している。この数値用圧縮処理部15は、入力処理部11内の数値用の入力データ配列記憶部11a内から、数値データを読込、一時記憶する入力値バッファ15aと、この入力値バッファ15aに格納される各入力値を順次読み出し、過去の所定数分(本実施形態では、過去4回分)の入力値を記憶する予測テーブル15bと、その予測テーブル15bに格納された過去の入力値に基づき、次の入力値の予測値を求める予測値算出部15cと、入力値バッファ15aに格納された入力値と、予測値算出部15cにより求められた予測値と比較し、その差分を求める差分値算出部15dと、差分値算出部15dにより求めた差分値と、その差分値を取得し、ハフマンツリー記憶部15eに格納されたハフマンツリーに基づき、取得した差分値を符号化する符号化部15fと、その符号化部15fにより符号化されたデータ(圧縮されたデータ)を一時記憶する出力バッファ15gとを備えている。   FIG. 7 shows the numerical value compression processing unit 15. The numerical value compression processing unit 15 reads numerical data from the numerical value input data array storage unit 11a in the input processing unit 11 and temporarily stores the numerical value data, and the input value buffer 15a stores the numerical value data. Each input value is sequentially read out, and based on the past input value stored in the prediction table 15b and the prediction table 15b that stores a predetermined number of past input values (in the present embodiment, the past four times) A predicted value calculation unit 15c that obtains a predicted value of the input value, a difference value calculation unit 15d that compares the input value stored in the input value buffer 15a with the predicted value obtained by the predicted value calculation unit 15c, and obtains the difference between them. And the difference value obtained by the difference value calculation unit 15d and the difference value are acquired, and the acquired difference value is encoded based on the Huffman tree stored in the Huffman tree storage unit 15e. A coding unit 15f, and an output buffer 15g for temporarily storing the encoded data (compressed data) by the coding unit 15f.

従って、入力値バッファ15aには、設定メモリ14aの内容が図4に示す状態とすると、入力データ配列記憶部11a中の入力名称が、入力C,入力E,入力F,入力G,入力H,入力Jに対応するデータが、格納される。そして、それら6つの入力データが、入力値バッファ15aから予測テーブル15bに転送され、各入力データ毎に時系列に格納される。
予測値算出部15cは、予測テーブル15bから、その入力の前4回のデータを読み込み、以下の算出式を利用し、予測値Y(n)を算出する。
Therefore, in the input value buffer 15a, if the contents of the setting memory 14a are in the state shown in FIG. 4, the input names in the input data array storage unit 11a are input C, input E, input F, input G, input H, Data corresponding to input J is stored. These six input data are transferred from the input value buffer 15a to the prediction table 15b and stored in time series for each input data.
The predicted value calculation unit 15c reads four data before the input from the prediction table 15b, and calculates the predicted value Y (n) using the following calculation formula.

Y(n)=−Y(n−4)+4×Y(n−3)−6×Y(n−2)+4×Y(n−1)
すなわち、FAで使用されるアナログデータの値は横軸を時間、縦軸を値とした場合、例えば図8,図9に示すようなパターンを描くことが多く予想される。すなわち、図8(a)に示すようにサイン型の波形,またはコサイン型の波形に類似するパターンや、図8(b)に示すように図8(a)と同様のパターンで変化するが、図中拡大して示すようにデータが滑らかに変化しない場合や、図9(a)に示すように、時間をかけてある値に推移し、その値を維持するようなパターンや、図9(b)に示すように図9(a)と同様のパターンで変化するが、ノイズによるパルスが時々発生するような場合などがある。
Y (n) = − Y (n−4) + 4 × Y (n−3) −6 × Y (n−2) + 4 × Y (n−1)
That is, analog data values used in FA are expected to draw patterns such as those shown in FIGS. 8 and 9, for example, where the horizontal axis represents time and the vertical axis represents values. That is, it changes in a pattern similar to a sine waveform or cosine waveform as shown in FIG. 8A, or a pattern similar to FIG. 8A as shown in FIG. As shown in the enlarged view in the figure, when the data does not change smoothly, or as shown in FIG. 9A, a pattern that changes to a certain value over time and maintains that value, or FIG. As shown in b), the pattern changes in the same pattern as in FIG. 9A, but there are cases where pulses due to noise sometimes occur.

このようなパターンで推移するデータを1msecなどの周期で入力値として読み出した場合、過去の数周期分のデータからN次多項式近似により、次の入力値を予測することができる。例えば、3次曲線の公式
Y=aX+bX+cX+d
のLargrange補間公式の簡易公式
Y(n)=−Y(n−4)+4×Y(n−3)−6×Y(n−2)+4×Y(n−1)
を利用して入力値の直前4回の値(Y(n−4)〜Y(n−1))から次の入力値X(n)を予測することができる。そこで、上述したように、予測値算出部15cにて、次の入力値X(n)の予測値Y(n)を算出する。
When data that transitions in such a pattern is read as an input value at a period of 1 msec or the like, the next input value can be predicted from the data for several past periods by N-order polynomial approximation. For example, cubic curve formula Y = aX 3 + bX 2 + cX + d
Simplified formula of the large range interpolation formula of Y (n) = − Y (n−4) + 4 × Y (n−3) −6 × Y (n−2) + 4 × Y (n−1)
Can be used to predict the next input value X (n) from the values (Y (n−4) to Y (n−1)) four times immediately before the input value. Therefore, as described above, the predicted value calculation unit 15c calculates the predicted value Y (n) of the next input value X (n).

上述したように、本実施の形態では、直前の4回の入力値から次の回の入力値の予測値を算出するようにしたため、予測テーブル15bは、少なくとも直前の4回分の入力値が格納されたテーブルとなる。それ以前のデータについては、記憶保持するようにしても良いし、リングバッファのようにして順次上書きして消去するようにしても良い。ただし、この予測テーブル15b或いは出力バッファ15g或いは別の記憶手段を用いて少なくとも最初の4回分の入力データは記憶保持するようにする。   As described above, in this embodiment, since the predicted value of the next input value is calculated from the previous four input values, the prediction table 15b stores at least the previous four input values. Table. The previous data may be stored and held, or may be overwritten and deleted sequentially like a ring buffer. However, at least the first four input data are stored and held by using the prediction table 15b, the output buffer 15g, or another storage means.

入力Cを例にとり、予測値算出部15cにおける入力値の予測処理と、差分値算出部15dにおける差分値算出処理の具体例を説明する。1回目からの入力値が、図10に示すようになっているものとする。すると、予測値を算出するためには、過去4回分のデータが必要なため、1回目から4回目までは、予測値を求めることが出来ない。そして、上述した予測の算出式に対し、1回目から4回目の各入力値を代入すると、5回目の予想値Y(5)は、
−(1回目の入力値)+4×(2回目の入力値)−6×(3回目の入力値)+4×(4回目の入力値)
=−11+4×12−6×13+4×14
=15
となる。以下、順に同様の処理を実行し、直前4回の入力値から次回の入力値は予測すると、図10の予測値の欄に示すようになる。尚、本実施形態では、Largrange補間公式を用いて予測を行なうようにしたが、他の予測方式を用いて予測値を求めるようにしてももちろん良い。
Taking the input C as an example, a specific example of input value prediction processing in the prediction value calculation unit 15c and difference value calculation processing in the difference value calculation unit 15d will be described. Assume that the input values from the first time are as shown in FIG. Then, in order to calculate the predicted value, data for the past four times are required, and therefore the predicted value cannot be obtained from the first time to the fourth time. When the first to fourth input values are substituted into the above-described prediction calculation formula, the fifth predicted value Y (5) is
− (First input value) + 4 × (second input value) −6 × (third input value) + 4 × (fourth input value)
= −11 + 4 × 12−6 × 13 + 4 × 14
= 15
It becomes. Thereafter, when the same processing is executed in order, and the next input value is predicted from the previous four input values, it is as shown in the predicted value column of FIG. In this embodiment, the prediction is performed using the large-range interpolation formula, but it is needless to say that the prediction value may be obtained using another prediction method.

そして、差分値算出部15bは、「X(n)−Y(n)」を演算処理する。従って、の入力Cについての差分値は、予測値が求められる5回目以降について算出することが出来、具体的には、図11に示すように各回ごとに差分値が算出される。すなわち、入力Cの5回目以降の差分値は0,1、−2,0,0となり、この例では、差分値が0、つまり、予想が当たった回数が最も多くなった。同様に、他の入力E,F,G,H,Jについても、5回目以降に対して各入力回の差分値が求まる。   Then, the difference value calculation unit 15b calculates “X (n) −Y (n)”. Therefore, the difference value for the input C can be calculated for the fifth and subsequent times when the predicted value is obtained, and specifically, the difference value is calculated for each time as shown in FIG. That is, the difference values after the fifth time of the input C are 0, 1, -2, 0, 0, and in this example, the difference value is 0, that is, the number of times the prediction has been made is the largest. Similarly, for the other inputs E, F, G, H, and J, the difference value of each input time is obtained for the fifth time and thereafter.

符号化部15fは、差分算出部15bで求めた各入力データに対する差分値をハフマン符号化する。ここでは、差分値を−256〜+255、−128〜+127など固定の範囲とする。差分値に対応する符号を、ハフマンツリー記憶部15eに記憶保持されたハフマンツリーから検索する。ハフマンツリーに該当する差分値が存在(ヒット)したら、そのヒットした差分値に対応する符号を出力する。また、ヒットしなかったら場合には対応する符号が無いので符号化することなく、差分値をそのまま出力する。   The encoding unit 15f performs Huffman encoding on the difference value for each input data obtained by the difference calculation unit 15b. Here, the difference value is set to a fixed range such as −256 to +255, −128 to +127. The code corresponding to the difference value is searched from the Huffman tree stored and held in the Huffman tree storage unit 15e. If a difference value corresponding to the Huffman tree exists (hits), a code corresponding to the hit difference value is output. If there is no hit, there is no corresponding code, so the difference value is output as it is without encoding.

図12は、ハフマンツリー記憶部15eに格納されるハフマンツリー(値:差分値と符号の対応関係を示すテーブル)の一例を示している。この例では、差分値の範囲を−128〜+127とした場合の例である。   FIG. 12 shows an example of a Huffman tree (value: a table indicating the correspondence between difference values and codes) stored in the Huffman tree storage unit 15e. In this example, the range of the difference value is −128 to +127.

例えば、5回目の6個の入力データ(入力C,E,F,G,H,J)に対する差分値が、図13に示すようになったとすると、各入力データの差分値は、図12に示すハフマンツリーによってハフマンエンコードすることにより、図14に示すように符号化される。よって、5回目の6個の入力データ(入力C,E,F,G,H,J)は、「010100101100101」(2進数)となり、本来の48ビット(8×6)必要であったデータが、15ビットで表現できるようになる。   For example, if the difference values for the sixth input data (inputs C, E, F, G, H, and J) for the fifth time are as shown in FIG. 13, the difference values of the input data are shown in FIG. Encoding is performed as shown in FIG. 14 by performing Huffman encoding using the Huffman tree shown. Therefore, the 6th input data (inputs C, E, F, G, H, J) for the fifth time is “010100101100101” (binary number), and the data that originally required 48 bits (8 × 6) is required. Can be expressed in 15 bits.

上記の符号化されたデータは、各回毎に出力バッファ15gに逐次格納され、すべての数値に対して圧縮処理(符号化)が完了したらならば、出力バッファ15gに格納された圧縮されたデータを保存処理部13に渡す。   The encoded data is sequentially stored in the output buffer 15g each time, and when the compression process (encoding) is completed for all the numerical values, the compressed data stored in the output buffer 15g is stored. The data is passed to the storage processing unit 13.

なお、図9(b)に示すような突発的(瞬間的)に発生するノイズ(異常値)に対しては予測が働かないため圧縮は行われない。ただし、このような値はデータ全体に対する割合が小さく影響は無視できる。   It should be noted that no compression is performed on the noise (abnormal value) that occurs suddenly (instantaneously) as shown in FIG. However, such a value has a small ratio to the whole data, and its influence can be ignored.

なおまた、本実施の形態では、ハフマンツリーを静的に一定なデータとした場合について説明したが、圧縮率をさらに高める手法としてハフマンツリーを毎入力の結果によって動的に最適化する手法を用いても良い。具体的には、入力毎に差分値の登場頻度を再計算し、動的に、登場頻度の高いものを少ないビット数で表現できるようにハフマンツリーを再構成する機能を追加すること実現する。   In this embodiment, the case where the Huffman tree is statically constant data has been described. However, as a technique for further increasing the compression ratio, a technique for dynamically optimizing the Huffman tree based on the result of each input is used. May be. Specifically, it is realized to recalculate the appearance frequency of the difference value for each input and dynamically add a function for reconfiguring the Huffman tree so that a high appearance frequency can be expressed with a small number of bits.

図15は、BIT用圧縮処理部16を示している。このBIT用圧縮処理部16は、入力処理部11内の入力データ配列記憶部11a内から、入力種別がBITデータのものを読込、一時記憶する入力値バッファ16aと、この入力値バッファ16aに格納される各入力値を順次読み出し、過去の所定数分(本実施形態では、過去2回分)の入力値を記憶する予測テーブル16bと、その予測テーブル16bに格納された過去の入力値に基づき、次の入力値の予測値を求める予測値算出部16cと、入力値バッファ16aに格納された入力値と、予測値算出部16cにより求められた予測値と比較し、その差分を求める差分値算出部16dと、差分値算出部16dにより求めた差分値に基づいて圧縮する処理するための予備データを記憶するRLE圧縮用予備バッファ16fと、そのRLE圧縮用予備バッファ16F16fに格納されたデータに基づきRLE(Run Length Encoding)により圧縮するRLE圧縮部16hと、そのRLE圧縮部16Hにより圧縮されたデータを記憶する出力バッファ16gとを備えている。さらに、最終的なRLE圧縮の圧縮率を高めるために、係数差分の大きい入力抽出部16eも備えている。   FIG. 15 shows the BIT compression processing unit 16. The BIT compression processing unit 16 reads an input type of BIT data from the input data array storage unit 11a in the input processing unit 11, stores it in the input value buffer 16a for temporary storage, and stores it in the input value buffer 16a. Each input value is sequentially read out, based on a past predetermined value stored in the prediction table 16b, and a prediction table 16b that stores a predetermined number of past input values (in the present embodiment, past two times), A prediction value calculation unit 16c for obtaining a prediction value of the next input value, a difference value calculation for comparing the input value stored in the input value buffer 16a with the prediction value obtained by the prediction value calculation unit 16c, and obtaining the difference Section 16d, RLE compression spare buffer 16f for storing spare data for processing based on the difference value obtained by difference value calculation section 16d, and its RLE pressure It includes a RLE compression section 16h for compressed by RLE (Run Length Encoding) based on the stored data to use the spare buffer 16F16f, and an output buffer 16g for storing the data compressed by the RLE compression unit 16H. Furthermore, in order to increase the compression rate of final RLE compression, an input extraction unit 16e having a large coefficient difference is also provided.

従って、入力値バッファ16aには、設定メモリ14aの内容が図4に示す状態とすると、BIT用の入力データ配列記憶部11a中の入力名称が、入力A,入力B,入力Dに対応するデータが、格納される。そして、それら3つの入力データが、入力値バッファ16aから予測テーブル16bに転送され、各入力データ毎に時系列に格納される。   Accordingly, in the input value buffer 16a, when the contents of the setting memory 14a are in the state shown in FIG. 4, the input names in the input data array storage unit 11a for BIT are data corresponding to the inputs A, B and D. Is stored. Then, these three input data are transferred from the input value buffer 16a to the prediction table 16b and stored in time series for each input data.

予測テーブル記憶部16bには、図16に示すように、直前m回の値の組み合わせに対し、次に0が出現する頻度と、1が出現する頻度を予測係数としたテーブル構造の予測テーブルが格納されている。このような予測テーブルが、各入力データ毎に作成され、記憶保持される。mの値は1以上をとるが入力値の種別によって決定する(図の場合はm=2)。   In the prediction table storage unit 16b, as shown in FIG. 16, there is a prediction table having a table structure in which the frequency of the next occurrence of 0 and the frequency of occurrence of 1 for the combination of the previous m values are prediction coefficients. Stored. Such a prediction table is created and stored for each input data. The value of m is 1 or more, but is determined by the type of input value (m = 2 in the figure).

本実施の形態では、最終的なRLE圧縮の圧縮効率を高めるために予測一致確率の高い入力から順に処理を行なうようにしている。すなわち、各ビット入力のうち、予測テーブル16bから前2回の入力値と一致するテーブルの中で、予測係数の差分の一番大きい入力から順に処理する。これは“予測係数の差分の大きい場合は、予測一致する確立が高い”ことを利用するためである。この予測一致確立の計算は、予測係数の合計で予測する値(0または1)の出現回数を除算しても同じく算出することが出来るが、本実施の形態では、計算効率を考慮して差分を比較する方法としている。係る処理を係数差分の大きい入力抽出部16eが行なう。   In this embodiment, in order to increase the compression efficiency of the final RLE compression, processing is performed in order from the input with the highest predicted matching probability. That is, among the bit inputs, processing is performed in order from the input with the largest difference in the prediction coefficients in the table that matches the previous two input values from the prediction table 16b. This is to use the fact that “there is a high probability that the prediction matches when the difference in prediction coefficients is large”. The calculation for establishing the prediction match can be similarly calculated by dividing the number of occurrences of the predicted value (0 or 1) by the sum of the prediction coefficients. However, in the present embodiment, the difference is calculated in consideration of the calculation efficiency. As a way to compare. Such processing is performed by the input extraction unit 16e having a large coefficient difference.

このBIT用圧縮処理部16においても、入力値の直前m回(例えば2回)の値から次の入力値を予測し、その予測値と実際の入力値との一致/不一致に基づいて圧縮データを作成する。すなわち、予測値算出部16cは、予測テーブル記憶部16bに格納された図16のような予測テーブルを参照し、直前m回の値の組み合わせ基づき、次に出現する係数(予測係数)の高い値を予測値とする。この予測係数が、予測テーブル係数のサンプル数が多く、かつ、差が大きいほど予測確率は高い。図16に示す予測テーブルを持つ入力データの場合、直前2回のビットデータが「0,0」の場合には、次の入力は0の場合の予測係数が25で、1の場合の予測係数が1であるので、係数の大きいほうの値「0」を予測値とする。なお、入力値バッファ16aに格納された各入力値に基づき、予測テーブルの入力値に一致する予測係数を1加える処理も行なわれる。これより、予測係数が逐次更新され、より精度の高い予測を行なうことが可能な予測テーブルが作り上げられていく。   The BIT compression processing unit 16 also predicts the next input value from the value m times (for example, twice) immediately before the input value, and compresses the compressed data based on the match / mismatch between the predicted value and the actual input value. Create That is, the predicted value calculation unit 16c refers to the prediction table as illustrated in FIG. 16 stored in the prediction table storage unit 16b, and based on the combination of the previous m values, the value of the next appearing coefficient (prediction coefficient) is high. Is a predicted value. As the prediction coefficient has a larger number of samples of the prediction table coefficient and the difference is larger, the prediction probability is higher. In the case of input data having the prediction table shown in FIG. 16, when the last two bit data are “0, 0”, the next input has a prediction coefficient of 25 when 0 and a prediction coefficient of 1 Since the value is 1, the value “0” having the larger coefficient is set as the predicted value. In addition, based on each input value stored in the input value buffer 16a, a process of adding one prediction coefficient that matches the input value of the prediction table is also performed. As a result, the prediction coefficient is sequentially updated, and a prediction table capable of performing prediction with higher accuracy is created.

差分値算出部16は、予測値と入力値とを比較し、差分値が入力値に一致する場合には差分値は0とし、予測が一致しない場合には差分値は1とする。よって、予測の一致確立が高い場合、差分値は0が大勢を占めることになる。しかも、係数差分の大きい入力抽出部16eにより、係数差分の大きい入力を抽出し、それから順に処理するようにしたため、先頭ほど予測値が一致する確率が高く、差分値算出部16dの出力は、同じ数値が連続する確率が高くなる。よって、RLE圧縮による圧縮率も高くなる。なお、入力データが1/0のビットデータであるため、この差分値算出部16dにおける実際の演算処理は、例えば、
差分値=予測値XOR入力値
により求めることが出来る。
The difference value calculation unit 16 compares the predicted value with the input value, and sets the difference value to 0 if the difference value matches the input value, and sets the difference value to 1 if the prediction does not match. Therefore, when the prediction coincidence is high, the difference value is mostly 0. In addition, since the input extraction unit 16e having a large coefficient difference is used to extract an input having a large coefficient difference and then processed in order, the probability that the predicted values match is higher toward the beginning, and the output of the difference value calculation unit 16d is the same. Probability of consecutive numbers increases. Therefore, the compression rate by RLE compression also becomes high. Since the input data is 1/0 bit data, the actual calculation process in the difference value calculation unit 16d is, for example,
Difference value = predicted value XOR input value can be obtained.

差分値算出部16dで求めた各入力データに対する差分値を、RLE圧縮予備バッファ16fに同一の入力回毎に格納する。例えば、複数の入力に対して入力毎の差分値が、図17に示すようになったものとする(0は予測一致、1は不一致を意味する)。なお、本実施形態では、過去2回の入力値に基づいて予測値を求めることから、1回目と2回目の差分値データは、入力値のままとする。そして、このRLE圧縮用予備バッファ16fに格納された各回毎の差分値データは、各回毎に一列にまとめられ記憶保持される。そして、その記憶保持されたデータをRLE圧縮処理部16hが圧縮処理をし、求めた圧縮データを出力バッファ16gに格納する。   The difference value for each input data obtained by the difference value calculation unit 16d is stored in the RLE compression spare buffer 16f every same input time. For example, it is assumed that the difference value for each input with respect to a plurality of inputs is as shown in FIG. 17 (0 means prediction match, 1 means mismatch). In the present embodiment, since the predicted value is obtained based on the past two input values, the first and second difference value data are left as input values. The difference value data stored in the RLE compression spare buffer 16f is collected and held in a line for each time. Then, the RLE compression processing unit 16h compresses the stored data and stores the obtained compressed data in the output buffer 16g.

図17に示すように、入力種別のBITデータの入力数が48個あるとすると、通常これを表すには当然のことながら48ビット(6バイト)が必要となる。これを0,1の連続する個数によるRLEで表現すると、図17に示す各回のデータは、
1回目 35個の0,1個の1,12個の0
2回目 48個の0
3回目 10個の0,1個の1,37個の0
4回目 48個の0
であるため RLEで表現すると
35,1,12
48
10,1,37
48
といった配列で表現でき、この例では、最小で1バイト(8bit)、最大で3バイト(24ビット)で表現できることになる。この場合、すべての回で、元のデータが必要とする48bitを下回り、データ量が圧縮できる。
As shown in FIG. 17, if there are 48 input types of BIT data of the input type, normally, 48 bits (6 bytes) are necessary to express this. If this is expressed by RLE by the continuous number of 0, 1, each data shown in FIG.
1st time 35 0, 1 1, 12 0
Second time 48 0
3rd time 10 0, 1 1,37 0
4th time 48 0
Therefore, when expressed in RLE, 35,1,12
48
10,1,37
48
In this example, it can be expressed by 1 byte (8 bits) at the minimum and 3 bytes (24 bits) at the maximum. In this case, at all times, the amount of data can be compressed by being less than 48 bits required by the original data.

さらに、通常RLEの場合、“値”とその値が“連続する個数”を記録するが、本実施の形態の場合には、値は0,1の2種類のみがトグルで登場するため、“連続する個数”のみを必要とし、“値”の記録は不要となる。   Further, in the case of normal RLE, “value” and “number of consecutive values” are recorded. However, in the case of this embodiment, only two types of values 0 and 1 appear in a toggle. Only the “continuous number” is required, and the recording of “value” is not necessary.

このBIT用圧縮処理部16の機能(作用)を、具体例を挙げつつ説明する。例えば、図18(a)から(c)に示すような予測テーブルを持つ3つのビット入力A,B,Dがある場合において、ある回における直前2回の入力値が、それぞれ、「入力Aが0,1」,「入力Bが1,0」,「入力Dが0,0」であったとする。   The function (action) of the BIT compression processing unit 16 will be described with a specific example. For example, when there are three bit inputs A, B, and D having a prediction table as shown in FIGS. 18A to 18C, the input values of the previous two times at a certain time are “input A is Assume that “0, 1”, “input B is 1, 0”, and “input D is 0, 0”.

この場合、使用する予測テーブルは、入力Aは01,入力Bは10,入力Cは00を使用することとなり、予測値算出部16cで求めた予測値は、それぞれ以下のように予測する。
入力Aは、予測係数が0:2回 < 1:111回 のため 次は1と予測、
入力Bは、予測係数が0:173回 > 1:35回 のため 次は0と予測、
入力Cは、予測係数が0:25回 > 1:10回 のため 次は0と予測することになる。
In this case, the prediction table to be used uses 01 for input A, 10 for input B, and 00 for input C, and the predicted values obtained by the predicted value calculation unit 16c are predicted as follows.
Input A is predicted to be 1 because the prediction coefficient is 0: 2 <1: 111
Input B has a prediction coefficient of 0: 173 times> 1:35 times, so next is predicted to be 0,
Since the prediction coefficient of the input C is 0:25 times> 1:10 times, the next is predicted to be 0.

実際の入力値が図19に示す入力値の欄に示すような履歴をとったとすると、予測値ならびに差分値は、それぞれ図19の各欄に示す値を採る。そして、差分値算出部16dで求めた各入力データに対するある回の差分値を左詰でRLE圧縮用予備バッファ16fに順次格納する。これにより、このRLE圧縮用予備バッファ16fには、例えば、図20に示すようなデータが格納される。ここで、1,2回目は入力値をそのまま使用し、3回目以降は差分値を使用する。   If the actual input value has a history as shown in the input value column shown in FIG. 19, the predicted value and the difference value take the values shown in the respective columns in FIG. Then, the difference value for a certain time with respect to each input data obtained by the difference value calculation unit 16d is left-justified and sequentially stored in the RLE compression spare buffer 16f. Thus, for example, data as shown in FIG. 20 is stored in the RLE compression spare buffer 16f. Here, the input values are used as they are for the first and second times, and the difference values are used for the third and subsequent times.

全ビットを処理後、RLE圧縮部16hがRLE圧縮を実行し、出力バッファに16gに格納する圧縮データを作成する。RLE圧縮は、同じ数値の連続して登場する回数を記録するもので、同じ数値が偏って登場する場合に圧縮率は高くなる。   After processing all the bits, the RLE compression unit 16h executes RLE compression and creates compressed data to be stored in 16g in the output buffer. RLE compression records the number of times the same numerical value appears consecutively, and the compression rate increases when the same numerical value appears unevenly.

本実施の形態では、図20に示すRLE圧縮用予備バッファ16fにおける横方向に差分値の0/1それぞれの連続する登場回数により圧縮を実行する。図20では、入力D以降の差分値が不明なので便宜上、A/B/Dの3入力で実施した場合、
3回目:3、・・・・
4回目:1,2、・・・
5回目:3、・・・
となる。
In the present embodiment, compression is executed by the number of consecutive appearances of 0/1 difference values in the horizontal direction in the RLE compression spare buffer 16f shown in FIG. In FIG. 20, since the difference value after input D is unknown, for the sake of convenience, when implemented with three inputs of A / B / D,
3rd: 3, ...
4th: 1, 2, ...
5th: 3, ...
It becomes.

保存処理部13は、圧縮処理部12で求めた数値圧縮処理とビット圧縮処理のそれぞれの圧縮結果である出力バッファを、ストレージデバイス21に保存する。このとき展開時の効率を考慮し、圧縮処方の違う数値,ビット別,また収集周期別に保存する。ストレージデバイス21に保存する代わりにネットワークを介してストリームデータとして出力することも可能である。さらに、設定メモリの内容をファイルとして保存する。これは展開実行時に使用する。   The storage processing unit 13 stores, in the storage device 21, output buffers that are compression results of the numerical value compression processing and the bit compression processing obtained by the compression processing unit 12. At this time, considering the efficiency at the time of expansion, it is stored for each numerical value, bit, and collection cycle with different compression prescriptions. Instead of saving in the storage device 21, it is also possible to output it as stream data via a network. Further, the contents of the setting memory are saved as a file. This is used when performing deployment.

図21は、本発明に係るデータ復元装置の好適な一実施の形態である展開システムを示している。この展開システムは、例えば、パーソナルコンピュータに所定のアプリケーションプログラムを印ストロールすることで実現することができる。ここで実行する展開については、動的圧縮で得られたデータファイルから圧縮前のデータに展開する。この時データに対して任意の並び替えやタイムスタンプの付加、テキストファイルへの変換などの整形を行い、データの解析を容易にする。   FIG. 21 shows a deployment system which is a preferred embodiment of the data restoration apparatus according to the present invention. This deployment system can be realized, for example, by stamping a predetermined application program on a personal computer. The decompression executed here is decompressed from the data file obtained by dynamic compression to the data before compression. At this time, the data is easily rearranged, added with a time stamp, and converted into a text file to facilitate data analysis.

この展開システム40は、数値データ展開部41と、ビットデータ展開部42と、整形部43を備えている。さらに、整形部43で整形したファイルを記憶する記憶装置44も備えている。この記憶装置44は、外部に設置しても良い。すなわち、圧縮処理の際に説明したように、数値データとBITデータをそれぞれ異なる方式により圧縮したため、展開(復元)処理も、数値データ展開部41,BITデータ展開部42を用いて数値データ,ビットデータ毎に行なう。そして、そのようにして数値,ビットの圧縮方法の違いや、収集周期の違いによって分割されたファイルを、整形部43にて1つの整形されたファイルにする。具体的には、以下に示すような処理を行なう。   The expansion system 40 includes a numerical data expansion unit 41, a bit data expansion unit 42, and a shaping unit 43. Further, a storage device 44 that stores the file shaped by the shaping unit 43 is also provided. The storage device 44 may be installed outside. That is, as described in the compression process, the numerical data and the BIT data are compressed by different methods, so that the decompression (restoration) processing is also performed using the numerical data decompression unit 41 and the BIT data decompression unit 42. This is done for each data. Then, the file divided according to the difference in the compression method of numerical values and bits and the difference in the collection cycle is made into one shaped file by the shaping unit 43. Specifically, the following processing is performed.

まず、数値データ、ビットデータごとにN回目の入力値を求める。すなわち、数値データ展開部41では、1回目、2回目、3回目、4回目は入力値がそのまま保存されているため、計算せずに使用する。そして、5回目以降は保存した圧縮データとハフマンツリー、予測テーブルから各入力のN回目の入力値を計算する。つまり、N回目の圧縮データをよみ、ハフマンテーブルから各入力の差分値を展開し、予測値と差分値から入力値が計算できる。   First, an N-th input value is obtained for each numerical data and bit data. That is, in the numerical data development unit 41, the first, second, third, and fourth times are used without calculation because the input values are stored as they are. From the fifth time onward, the Nth input value of each input is calculated from the stored compressed data, Huffman tree, and prediction table. That is, the Nth compressed data is read, the difference value of each input is expanded from the Huffman table, and the input value can be calculated from the predicted value and the difference value.

例えばN回目の圧縮データが、「010100101100101」とすると、図12に示すハフマンツリーから、差分値は、「0,0,1,0、−1,0」となる。また、予測テーブルから各入力のN回目の予測値を計算する。予測値の計算は、過去4回の入力値のデータに基づいて求める。各入力の予測値が、入力C=15,入力E=100,入力F=200,入力G=1000,入力H=1000,入力J=99とすると、予測値と差分値から入力値を計算した結果(入力値=予測値―差分値)は、図22に示すようになる。N=5から順に1ずつインクリメントしていきながら、上記の予測値と差分値から各回の入力値を算出することが出来る。なお、過去4回分の入力値は、上記のようにして演算処理(展開処理)して得られた値を用いることで予測値を算出することが出来る。   For example, if the Nth compressed data is “010100101100101”, the difference value is “0, 0, 1, 0, −1, 0” from the Huffman tree shown in FIG. Also, the Nth predicted value of each input is calculated from the prediction table. The predicted value is calculated based on the data of the past four input values. When the predicted value of each input is input C = 15, input E = 100, input F = 200, input G = 1000, input H = 1000, input J = 99, the input value is calculated from the predicted value and the difference value. The result (input value = predicted value−difference value) is as shown in FIG. While incrementing one by one from N = 5, the input value for each time can be calculated from the predicted value and the difference value. Note that the predicted values can be calculated by using the values obtained by the arithmetic processing (development processing) as described above as the input values for the past four times.

ビットデータ展開部42は、以下に示す手順により展開処理を行なう。まず、1,2回目については、入力値がそのまま保存されているため計算せずに使用する。そして、3回目以降は保存した圧縮データと、予測テーブルから各入力のN回目の入力値を計算する。   The bit data expansion unit 42 performs expansion processing according to the following procedure. First, the first and second times are used without calculation because the input values are stored as they are. From the third time onward, the Nth input value of each input is calculated from the stored compressed data and the prediction table.

すなわち、例えばN回目の圧縮データからRLEデコードした結果、各入力の差分値が図23のように求まる。すると、入力A,B,DのN回目の差分値が、それぞれ0,0,0であるため、N回目の入力A,B,Dの予測値から「入力値=差分値XOR予測値」を演算し、図23に示すように入力値が求まる。   That is, for example, as a result of RLE decoding from the Nth compressed data, a difference value of each input is obtained as shown in FIG. Then, since the Nth difference values of the inputs A, B, and D are 0, 0, and 0, respectively, “input value = difference value XOR predicted value” is calculated from the predicted values of the Nth input A, B, and D. The input value is obtained as shown in FIG.

上述したように、各展開部41,42により、数値データとビットデータがそれぞれ別々に展開される。そこで、整形部43は、各展開部41,42から取得した展開結果(入力値)と、設定テーブルの情報に基づき、各入力値を設定テーブルの順に従って、データを並び変える。これにより、図25に示すように、N回目の入力データを可逆的に圧縮・再現できる。   As described above, numerical data and bit data are individually developed by the development units 41 and 42, respectively. Therefore, the shaping unit 43 rearranges the data for each input value in the order of the setting table based on the expansion result (input value) acquired from each of the expansion units 41 and 42 and the information of the setting table. Thereby, as shown in FIG. 25, the Nth input data can be reversibly compressed and reproduced.

さらに本実施の形態では、整形部43は、各データをカンマで区切ったテキストデータに変換したデータファイルを作成する機能を備える。これにより、各回毎にカンマ区切りされた1行分のテキストデータが作成され、展開する毎に1行ずつ追加する。このように、設定テーブルに従って数値、ビットデータを並び替え、テキスト変換し、カンマ区切りファイルの1行を逐次追加することで、例えば図26に示すような整形後のデータファイルが作成される。このデータファイルが記憶装置44に格納される。このデータファイルは、表計算アプリケーションソフトで処理可能なカンマ区切りのテキストデータ形式となっているため、その後の解析が容易に行なえる。   Further, in the present embodiment, the shaping unit 43 has a function of creating a data file obtained by converting each data into text data separated by commas. As a result, one line of text data separated by commas is created each time, and one line is added each time the text data is expanded. In this way, numerical data and bit data are rearranged according to the setting table, converted into text, and one line of a comma-separated file is sequentially added to create a formatted data file as shown in FIG. 26, for example. This data file is stored in the storage device 44. Since this data file has a comma-delimited text data format that can be processed by a spreadsheet application software, subsequent analysis can be easily performed.

上述した実施の形態では、同一回で入力される入力データ同士を単位として圧縮したが、本発明はこれに限ることはなく、例えば同一の入力(例えば、入力C)を時系列で取得し、圧縮するようにしても良い。   In the embodiment described above, the input data input at the same time is compressed as a unit, but the present invention is not limited to this, for example, the same input (for example, input C) is acquired in time series, You may make it compress.

また、本発明が適用される範囲は、上述したFAシステムに限ることはなく、予測値と入力値とを比較して得られる値(差分値等)に基づいて圧縮処理が適切に行なえるものであれば、各種のものに適用ことができる。   The range to which the present invention is applied is not limited to the FA system described above, and compression processing can be appropriately performed based on values (difference values, etc.) obtained by comparing predicted values with input values. If so, it can be applied to various types.

圧縮しない場合のデータ収集結果の一例を示す図である。It is a figure which shows an example of the data collection result when not compressing. PLCの一例を示す図である。It is a figure which shows an example of PLC. 本発明に係るデータ収集装置の一実施の形態の内部構造を示す図である。It is a figure which shows the internal structure of one Embodiment of the data collection device which concerns on this invention. 設定メモリのデータ構造の一例を示す図である。It is a figure which shows an example of the data structure of a setting memory. 入力処理部の機能を示すフローチャートである。It is a flowchart which shows the function of an input process part. 入力値と予測値の差分値の分布図の一例を示す図である。It is a figure which shows an example of the distribution map of the difference value of an input value and a predicted value. 数値用圧縮処理部の内部構造の一例を示す図である。It is a figure which shows an example of the internal structure of the compression process part for numerical values. 数値データの時間軸での推移例の一例を示す図である。It is a figure which shows an example of the transition example on the time axis of numerical data. 数値データの時間軸での推移例の一例を示す図である。It is a figure which shows an example of the transition example on the time axis of numerical data. 数値データの予測例を示す図である。It is a figure which shows the example of a prediction of numerical data. 数値データの差分計算例を示す図である。It is a figure which shows the example of a difference calculation of numerical data. ハフマンツリーの一例を示す図である。It is a figure which shows an example of a Huffman tree. 5回目の各入力データ(数値データ)の差分値例を示す図である。It is a figure which shows the example of a difference value of each input data (numerical data) of the 5th time. 図13に示す差分値を、ハフマンツリーを用いて符号化した例を示す図である。It is a figure which shows the example which encoded the difference value shown in FIG. 13 using the Huffman tree. BIT用圧縮処理部16の内部構造の一例を示す図である。It is a figure which shows an example of the internal structure of the compression process part 16 for BIT. ビットデータの予測テーブル例を示す図である。It is a figure which shows the example of a prediction table of bit data. 複数の入力に対して入力毎の差分値の一例を示す図である。It is a figure which shows an example of the difference value for every input with respect to several input. ビットデータ予測例を示す図である。It is a figure which shows the example of bit data prediction. ビットデータ差分値例を示す図である。It is a figure which shows the example of a bit data difference value. ビットデータRLE圧縮用予備バッファのデータ構造の一例を示す図である。It is a figure which shows an example of the data structure of the reserve buffer for bit data RLE compression. 展開システムの一実施の形態を示す構成図である。It is a block diagram which shows one Embodiment of an expansion | deployment system. 数値データの入力値計算例を示す図である。It is a figure which shows the input value calculation example of numerical data. ビットデータのRLEデコード結果の一例を示す図である。It is a figure which shows an example of the RLE decoding result of bit data. ビットデータの入力値計算例を示す図である。It is a figure which shows the example of input value calculation of bit data. 入力データ並び替え例を示す図である。It is a figure which shows the example of input data rearrangement. 展開結果例(テキストファイル)の一例を示す図である。It is a figure which shows an example of an expansion result example (text file).

符号の説明Explanation of symbols

10 データ収集装置
11 入力処理部
11a 入力データ配列記憶部
12 圧縮処理部
13 保存処理部
14 設定処理部
14a 設定メモリ
20 外部デバイス類
DESCRIPTION OF SYMBOLS 10 Data collection device 11 Input processing part 11a Input data arrangement | sequence storage part 12 Compression processing part 13 Storage processing part 14 Setting processing part 14a Setting memory 20 External devices

Claims (9)

時系列に変化するデータを周期的に取得する入力データ取得手段と、
前記入力データ取得部で取得した直近の所定回数の入力データから次の入力データを予測する予測手段と、
その予測手段が予測した予測値と、入力データ取得手段が取得した入力データとを比較する比較手段と、
その比較手段で求めた比較値に対して圧縮処理を行なう圧縮処理手段と、
その圧縮処理手段で圧縮した圧縮データを記憶手段に向けて出力する手段とを備えたデータ収集装置。
Input data acquisition means for periodically acquiring data that changes in time series;
Predicting means for predicting next input data from the most recent predetermined number of input data acquired by the input data acquiring unit;
A comparison unit that compares the predicted value predicted by the prediction unit with the input data acquired by the input data acquisition unit;
Compression processing means for performing compression processing on the comparison value obtained by the comparison means;
A data collection apparatus comprising: means for outputting the compressed data compressed by the compression processing means to the storage means;
前記圧縮処理手段が行なう圧縮処理の対象が、同一周期で取得された複数の入力データについての比較値であることを特徴とする請求項1に記載のデータ収集装置。   2. The data collection apparatus according to claim 1, wherein a target of compression processing performed by the compression processing means is a comparison value for a plurality of input data acquired at the same period. 前記圧縮処理手段が行なう圧縮処理の対象が、連続する複数周期の単独のデータの比較値であることを特徴とする請求項1に記載のデータ収集装置。   2. The data collection apparatus according to claim 1, wherein the object of the compression processing performed by the compression processing means is a comparison value of single data having a plurality of consecutive periods. 前記入力データが複数種類存在し、
前記圧縮処理手段は、その入力データの種類に応じて、異なる圧縮処理を行なうようにしたことを特徴とする請求項1または2に記載のデータ収集装置。
There are multiple types of the input data,
The data collection device according to claim 1 or 2, wherein the compression processing means performs different compression processing depending on the type of input data.
前記比較値は、入力値と予測値の差分値であり、
前記圧縮処理は、前記差分値の頻度が高い程少ないビット数で表現するようにしたことを特徴とする請求項1から4のいずれか1項に記載のデータ収集装置。
The comparison value is a difference value between the input value and the predicted value,
5. The data collection device according to claim 1, wherein the compression processing is expressed by a smaller number of bits as the frequency of the difference value is higher. 6.
前記入力データは、FAシステムにおける入力データであることを特徴とする請求項1から5のいずれか1項に記載のデータ収集装置。   The data collection device according to claim 1, wherein the input data is input data in an FA system. 前記入力データは、ON/OFFデータであり、
前記予測手段は、直近に得られたON/OFFの状態から次に入力された入力データを予測するものであり、
前記圧縮手段は、予測値が当たった場合を0または1とし、予測値がはずれた場合を1または0で表現し、同一数字の連続する数を用いて表現することで圧縮する機能を備えたことを特徴とするとを特徴とする請求項6の記載のデータ収集装置。
The input data is ON / OFF data,
The prediction means predicts the next input data from the most recently obtained ON / OFF state,
The compression means has a function of compressing by expressing 0 or 1 when the predicted value is hit, expressing 1 or 0 when the predicted value is off, and expressing using consecutive numbers of the same number The data collection device according to claim 6, wherein
前記入力データは、アナログデータであり、少なくとも直近のN回分のデータを記憶する記憶手段を有し、
前記予測手段は、その記憶手段に格納された前記直近のN回分のデータを予め設定された予測演算式に代入して、次に入力される予測値を求め、
前記圧縮処理手段は、前記入力値と前記予測値が一致した場合を「0」で表現し、その入力値と予測値との差が小さい程少ないビット数で表現するようにしたことを特徴とする請求項6に記載のデータ収集装置。
The input data is analog data, and has storage means for storing at least the latest N data,
The prediction means substitutes the data for the latest N times stored in the storage means into a preset prediction arithmetic expression to obtain a predicted value to be input next,
The compression processing means expresses a case where the input value and the predicted value match with “0”, and expresses with a smaller number of bits as the difference between the input value and the predicted value is smaller. The data collection device according to claim 6.
請求項1から8のいずれか1項に記載のデータ収集装置により圧縮されたデータを復元するデータ復元装置であって、
前記圧縮したデータと、
少なくとも比較値が存在しない入力値と、
前記予測手段が予測した予測値またはその予測手段の予測ルールと、を取得する手段と、
その取得する手段により取得した圧縮したデータと、比較値が存在しない入力値と、予測値/予測ルールに基づき、入力値を求めるデータ展開手段とを備えたことを特徴とするデータ復元装置。
A data decompression device for decompressing data compressed by the data collection device according to any one of claims 1 to 8,
The compressed data;
At least an input value for which no comparison value exists,
Means for obtaining a prediction value predicted by the prediction means or a prediction rule of the prediction means;
A data restoration apparatus comprising: compressed data acquired by the acquiring means; an input value for which no comparison value exists; and data expansion means for obtaining an input value based on a prediction value / prediction rule.
JP2005074118A 2005-03-15 2005-03-15 Data collection device and data recovery device Pending JP2006259937A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005074118A JP2006259937A (en) 2005-03-15 2005-03-15 Data collection device and data recovery device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005074118A JP2006259937A (en) 2005-03-15 2005-03-15 Data collection device and data recovery device

Publications (1)

Publication Number Publication Date
JP2006259937A true JP2006259937A (en) 2006-09-28

Family

ID=37099149

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005074118A Pending JP2006259937A (en) 2005-03-15 2005-03-15 Data collection device and data recovery device

Country Status (1)

Country Link
JP (1) JP2006259937A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012190356A (en) * 2011-03-11 2012-10-04 Honda Motor Co Ltd Data acquisition device, performance reproduction device and facility operating state management system
US9680499B2 (en) 2015-07-24 2017-06-13 Fujitsu Limited Data compression device and method
JP2021534505A (en) * 2018-08-21 2021-12-09 華為技術有限公司Huawei Technologies Co., Ltd. Data storage method, data acquisition method, and equipment
CN115622568B (en) * 2022-11-08 2023-03-10 中科数智能源科技(深圳)有限公司 Method, system and equipment for compressing historical data of oil reservoir digital twin system
CN116996076A (en) * 2023-09-27 2023-11-03 湖北华中电力科技开发有限责任公司 Intelligent management method for electrical energy consumption data of campus equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62120791A (en) * 1985-11-20 1987-06-02 Fujitsu Ltd Blocking entropy encoding system
JPH01142872A (en) * 1987-11-30 1989-06-05 Toshiba Corp Image processor
JPH0480620A (en) * 1990-07-21 1992-03-13 Hitachi Ltd Monitoring device
JPH0736746A (en) * 1993-07-19 1995-02-07 Mitsubishi Electric Corp Data processor
JPH086607A (en) * 1994-06-20 1996-01-12 Toshiba Corp Process controller
JPH08116263A (en) * 1994-10-17 1996-05-07 Fujitsu Ltd Data processor and data processing method
JPH1069498A (en) * 1996-08-29 1998-03-10 Toshiba Corp Plant data gathering and recording device
JPH1195833A (en) * 1997-07-23 1999-04-09 Toshiba Corp Plant monitoring device
JPH11251923A (en) * 1998-02-27 1999-09-17 Toyo Electric Mfg Co Ltd Monitoring device
JP2000047707A (en) * 1998-07-27 2000-02-18 Omron Corp Information managing device and its control method
JP2004198559A (en) * 2002-12-17 2004-07-15 Dainippon Printing Co Ltd Encoding method and decoding method for time-series signal
JP2004199670A (en) * 2002-12-04 2004-07-15 Omron Corp Data collection device and data collection system

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62120791A (en) * 1985-11-20 1987-06-02 Fujitsu Ltd Blocking entropy encoding system
JPH01142872A (en) * 1987-11-30 1989-06-05 Toshiba Corp Image processor
JPH0480620A (en) * 1990-07-21 1992-03-13 Hitachi Ltd Monitoring device
JPH0736746A (en) * 1993-07-19 1995-02-07 Mitsubishi Electric Corp Data processor
JPH086607A (en) * 1994-06-20 1996-01-12 Toshiba Corp Process controller
JPH08116263A (en) * 1994-10-17 1996-05-07 Fujitsu Ltd Data processor and data processing method
JPH1069498A (en) * 1996-08-29 1998-03-10 Toshiba Corp Plant data gathering and recording device
JPH1195833A (en) * 1997-07-23 1999-04-09 Toshiba Corp Plant monitoring device
JPH11251923A (en) * 1998-02-27 1999-09-17 Toyo Electric Mfg Co Ltd Monitoring device
JP2000047707A (en) * 1998-07-27 2000-02-18 Omron Corp Information managing device and its control method
JP2004199670A (en) * 2002-12-04 2004-07-15 Omron Corp Data collection device and data collection system
JP2004198559A (en) * 2002-12-17 2004-07-15 Dainippon Printing Co Ltd Encoding method and decoding method for time-series signal

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012190356A (en) * 2011-03-11 2012-10-04 Honda Motor Co Ltd Data acquisition device, performance reproduction device and facility operating state management system
US9680499B2 (en) 2015-07-24 2017-06-13 Fujitsu Limited Data compression device and method
JP2021534505A (en) * 2018-08-21 2021-12-09 華為技術有限公司Huawei Technologies Co., Ltd. Data storage method, data acquisition method, and equipment
JP7108784B2 (en) 2018-08-21 2022-07-28 華為技術有限公司 DATA STORAGE METHOD, DATA ACQUISITION METHOD, AND DEVICE
US11960467B2 (en) 2018-08-21 2024-04-16 Huawei Technologies Co., Ltd. Data storage method, data obtaining method, and apparatus
CN115622568B (en) * 2022-11-08 2023-03-10 中科数智能源科技(深圳)有限公司 Method, system and equipment for compressing historical data of oil reservoir digital twin system
CN116996076A (en) * 2023-09-27 2023-11-03 湖北华中电力科技开发有限责任公司 Intelligent management method for electrical energy consumption data of campus equipment
CN116996076B (en) * 2023-09-27 2023-12-19 湖北华中电力科技开发有限责任公司 Intelligent management method for electrical energy consumption data of campus equipment

Similar Documents

Publication Publication Date Title
CN101095284B (en) Device and data method for selective compression and decompression and data format for compressed data
EP0729237A2 (en) Adaptive multiple dictionary data compression
JP7099487B2 (en) Data management system, data management method, and data management program
JP6784636B2 (en) Control device, program update system, program update method
JP6009676B2 (en) Data compression device and data decompression device
US20100289676A1 (en) Data compression/decompression method and computer readable storage medium storing compression/decompression program
CN108023597B (en) Numerical control system reliability data compression method
JP2006259937A (en) Data collection device and data recovery device
EP3444952A1 (en) Data compression apparatus, data decompression apparatus, data compression program, data decompression program, data compression method, and data decompression method
CN104811209A (en) Compressed file data embedding method and device capable of resisting longest matching detection
WO2001063772A1 (en) Method and apparatus for optimized lossless compression using a plurality of coders
CN104156990A (en) Lossless compressed encoding method and system supporting oversize data window
US9479195B2 (en) Non-transitory computer-readable recording medium, compression method, decompression method, compression device, and decompression device
JP2007088962A (en) Ordinal data compressing method, ordinal data decompressing method, ordinal data processing program, ordinal data compressing apparatus, ordinal data decompressing apparatus, and ordinal data processing system
US20150161158A1 (en) Method of compressing compression target data, method of decompressing data in file, and system
CN115882867B (en) Data compression storage method based on big data
JP2536422B2 (en) Data compression device and data decompression device
CN100445951C (en) A firmware executing apparatus and executing method, a firmware configuration device and configuration method
JP7135955B2 (en) Data compression method, data compression device
JP7404734B2 (en) Data compression device, history information management system, data compression method and data compression program
Tuama et al. A new compression algorithm for small data communication in wireless sensor network
US11119702B1 (en) Apparatus for processing received data
EP4280465A1 (en) Data recording apparatus, data recording method, and data recording program
CN117560013A (en) Data compression method and electronic equipment
JP2023170314A (en) Data processing method and data processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071126

A977 Report on retrieval

Effective date: 20090917

Free format text: JAPANESE INTERMEDIATE CODE: A971007

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090924

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091123

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100127

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20100603