WO2020137611A1 - Data compression method - Google Patents

Data compression method Download PDF

Info

Publication number
WO2020137611A1
WO2020137611A1 PCT/JP2019/048912 JP2019048912W WO2020137611A1 WO 2020137611 A1 WO2020137611 A1 WO 2020137611A1 JP 2019048912 W JP2019048912 W JP 2019048912W WO 2020137611 A1 WO2020137611 A1 WO 2020137611A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
block
compression
memory
compressed
Prior art date
Application number
PCT/JP2019/048912
Other languages
French (fr)
Japanese (ja)
Inventor
哲也 福田
佐藤 賢一
圭 大村
Original Assignee
日本電信電話株式会社
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 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Publication of WO2020137611A1 publication Critical patent/WO2020137611A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction

Abstract

The present invention achieves a balance between saving memory and saving disk capacity. A data compression unit 12 fetches uncompressed data stored in time series from a memory 3, compresses the data, and generates a first block comprising the compressed compression data, and a data storage unit 13 re-stores the first block in the memory 3. A block joining unit 14 joins a prescribed number of first blocks, and a joined block compression unit 15 re-compresses the joined prescribed number of first blocks and generates a second block comprising the re-compressed recompression data. A search information generation unit 16 generates a representative key from a plurality of first block unique keys included in the second block, applies the generated representative key to the second block, and generates and retains data search information associating a second block representative key and the plurality of first block unique keys included in the second block. A data write unit 17 writes the second block to which the representative key was applied into a file on a disk 5.

Description

データ圧縮方法Data compression method
 本発明は、IoTデバイスが生成した大量の情報データを省リソース条件下で収集して蓄積するデータベース装置の技術に関する。特に、データベースプロセスが通信ネットワーク経由で情報データを受信してメモリに格納してディスクに書き込むまでのメモリ上の処理に関する。 The present invention relates to a database device technology for collecting and accumulating a large amount of information data generated by an IoT device under resource-saving conditions. In particular, it relates to the processing on the memory until the database process receives the information data via the communication network, stores it in the memory, and writes it to the disk.
 IoT(Internet of Things)において、センサやデバイスなどのIoTデバイスが情報データを生成する場所をクラウドと対比して「エッジ」と呼ぶ。エッジにおいては、クラウドと比較して、計算リソースや記憶リソースの拡張性に強い制約があることが多い。一方、エッジにおいても、IoTデバイスが生成した大量の情報データを処理する必要がある。そこで、省リソース条件下で、IoTデバイスが生成した大量の情報データを収集してディスクに書き込むデータベース装置の技術が検討されている。 In IoT (Internet of Things), the place where an IoT device such as a sensor or device generates information data is called an “edge” in contrast to the cloud. At the edge, there is often a strong constraint on the scalability of computing resources and storage resources as compared with the cloud. On the other hand, even at the edge, it is necessary to process a large amount of information data generated by the IoT device. Therefore, a technique of a database device that collects a large amount of information data generated by an IoT device and writes the data on a disc under resource-saving conditions is under study.
 従来の技術には、2つの共通した特徴がある。1つには、ディスクへの書き込み速度を高速化するため、メモリ上でデータを一定期間追記型のデータ構造で格納することである。追記型のデータ構造とは、データを次々に時系列に追加していくデータ構造をいう。もう1つには、ディスクに大量の情報データを書き込むため、情報データのデータ生成元単位でデータを長期間集めて一度に圧縮することで圧縮率を向上させることである。 The conventional technology has two common features. One is to store data in a write-once type data structure in a memory for a certain period in order to speed up the writing speed to the disc. The write-once data structure is a data structure in which data is added sequentially in time series. Secondly, since a large amount of information data is written to the disk, it is possible to improve the compression rate by collecting data for a long time in units of data generators of information data and compressing the data at once.
 例えば、非特許文献1では、情報データを追記型のデータ構造でメモリ上に格納し、既定量をメモリ上に格納した後に、データ生成元毎に圧縮処理を行ってデータのブロックを生成し、生成したブロックをディスクへ書き込む方式を開示している。 For example, in Non-Patent Document 1, after storing information data in a write-once data structure on a memory and storing a predetermined amount on the memory, a compression process is performed for each data generation source to generate a block of data, A method of writing the generated block to the disk is disclosed.
 非特許文献2では、情報データの収集の際に、情報データの到来順に所定のデータポイント単位で逐次圧縮を行いながら、チャンクと呼ばれる追記型のデータ構造を1単位としてメモリ上に格納する。チャンクは、データ生成元の単位で生成され、サイズは固定である。そして、メモリ使用量と見合わせながらチャンク単位で情報ファイルをディスクへ書き込む。なお、チャンクは、非特許文献1のブロックと同義である。 In Non-Patent Document 2, when collecting information data, a write-once type data structure called a chunk is stored in the memory as one unit while sequentially compressing in the order of arrival of the information data in units of predetermined data points. The chunk is generated in the unit of the data generation source and has a fixed size. Then, the information file is written to the disk in chunk units while matching the memory usage. The chunk is synonymous with the block in Non-Patent Document 1.
 上述の通り、エッジにおいては、計算リソースや記憶リソースの拡張性に強い制約がある中で、IoTデバイスが生成する大量の情報データを収集して蓄積する処理が行われる。そのため、エッジにおける情報データの収集及び蓄積を省リソース条件下で実行可能な手法が必要となる。しかし、従来の技術では、省メモリ、省ディスク容量の両立を実現できない。 As described above, at the edge, a process of collecting and accumulating a large amount of information data generated by the IoT device is performed while there are strong restrictions on the expandability of the calculation resource and the storage resource. Therefore, a method capable of executing collection and storage of information data at the edge under resource saving conditions is required. However, the conventional technology cannot achieve both memory saving and disk saving capacity.
 従来の技術では、データの高圧縮率を実現するため、メモリ上で長期間のデータを1まとめに保持するので、多くのメモリ容量を必要とする。その反面、省メモリ下では、長期間のデータをメモリ上に格納できず、データの圧縮率が悪化するので、ディスク使用量が増加してしまう。 According to the conventional technology, in order to achieve a high data compression rate, long-term data is held in a single unit on the memory, so a large amount of memory capacity is required. On the other hand, under the memory-saving condition, long-term data cannot be stored in the memory, and the data compression rate deteriorates, so that the disk usage increases.
 例えば、非特許技術1では、特にデータ生成元の数が多い場合、データの高圧縮率を達成するためには、メモリ上で情報データを収集するのに使用するメモリ領域を大きくする必要がある。しかし、非圧縮の状態で情報データを保持するため、データポイントあたりのメモリ使用量の効率が悪く、多くのメモリを消費してしまう。また、メモリ領域を小さくした場合、データの圧縮率が悪化してしまう。 For example, in Non-Patent Technology 1, in order to achieve a high data compression rate, especially when the number of data generators is large, it is necessary to increase the memory area used for collecting information data on the memory. .. However, since the information data is held in a non-compressed state, the memory usage per data point is inefficient, and a large amount of memory is consumed. In addition, when the memory area is reduced, the data compression rate deteriorates.
 非特許文献2では、ブロック(チャンク)のサイズは固定であるため、データ生成元が多数になるとともに、ブロックのサイズを小さく設定しなければ、メモリの逼迫につながってしまう。一方、ブロックのサイズを小さくした場合、ブロックで長期間のデータを集めることができず、低圧縮率のデータをブロック単位でディスクへ書き込むことになるので、ディスク容量の増加に繋がってしまう。 In Non-Patent Document 2, since the size of the block (chunk) is fixed, the number of data generators increases, and if the block size is not set small, the memory will be tight. On the other hand, when the block size is reduced, it is not possible to collect data for a long period of time in the block, and low compression rate data is written to the disk in block units, which leads to an increase in disk capacity.
 本発明は、上記事情を鑑みてなされたものであり、省メモリ、省ディスク容量の両立を実現することを目的とする。 The present invention has been made in view of the above circumstances, and an object thereof is to achieve both memory saving and disk saving capacity.
 本発明のデータ圧縮方法は、データ圧縮装置で行うデータ圧縮方法において、メモリに格納された非圧縮データを圧縮し、圧縮した圧縮データを前記メモリに再格納する第1のステップと、所定数の前記圧縮データを結合して再圧縮し、再圧縮した再圧縮データにキー情報を付与してディスクに書き込む第2のステップと、前記再圧縮データのキー情報と、前記再圧縮データに含まれる圧縮データに係る非圧縮データのデータ生成元を示すキー情報と、を関連付けたデータ検索用情報を生成する第3のステップと、を行うことを特徴とする。 The data compression method of the present invention is the data compression method performed by a data compression apparatus, comprising: a first step of compressing uncompressed data stored in a memory, and re-storing the compressed compressed data in the memory; A second step of combining and recompressing the compressed data, adding key information to the recompressed recompressed data, and writing to the disk, key information of the recompressed data, and compression included in the recompressed data. It is characterized by performing a third step of generating data search information in which key information indicating a data generation source of uncompressed data related to data is associated.
 上記データ圧縮方法において、前記第1のステップでは、前記非圧縮データを非圧縮データのデータ生成元毎に圧縮し、前記第2のステップでは、データ生成元が同一であるか否かに関わらず複数のデータ生成元に係る圧縮データの数が前記所定数に達した場合、前記所定数の圧縮データを結合して圧縮することを特徴とする。 In the above data compression method, in the first step, the uncompressed data is compressed for each data generator of the uncompressed data, and in the second step, regardless of whether the data generators are the same or not. When the number of compressed data related to a plurality of data generators reaches the predetermined number, the predetermined number of compressed data are combined and compressed.
 上記データ圧縮方法において、前記第1のステップでは、前記非圧縮データの一部に対して圧縮を行い、前記第2のステップでは、前記非圧縮データの全体に対して圧縮を行うことを特徴とする。 In the above data compression method, in the first step, a part of the uncompressed data is compressed, and in the second step, the entire uncompressed data is compressed. To do.
 本発明によれば、省メモリ、省ディスク容量の両立を実現できる。 According to the present invention, both memory saving and disk capacity saving can be realized.
データ圧縮装置の機能ブロック構成を示す図である。It is a figure which shows the functional block structure of a data compression apparatus. データ圧縮方法の処理フローを示す図である。It is a figure which shows the processing flow of a data compression method. 非圧縮データの格納処理、圧縮処理、圧縮データの再格納処理の様子を示す図である。It is a figure which shows the mode of a storage process of uncompressed data, a compression process, and a re-storing process of compressed data. 圧縮データの再圧縮処理の様子を示す図である。It is a figure which shows the mode of a recompression process of compressed data. 代表キー、時間情報の生成処理の様子を示す図である。It is a figure which shows the mode of a production|generation process of a representative key and time information. ファイル上でのデータレイアウトの例を示す図である。It is a figure which shows the example of the data layout on a file.
 本発明では、上述した省リソース化の課題に対して、省メモリ化した際の圧縮率の悪化を是正する観点からアプローチし、二段階圧縮という方式を提案する。具体的には、メモリ使用量を削減するため、メモリ上のデータを圧縮する一度目の圧縮処理を行い、ディスク使用量を削減するため、複数の圧縮データを結合して再圧縮する二度目の圧縮処理を行う。また、一度目の圧縮処理で得た圧縮データを検索可能にするため、二度目の圧縮処理で得た再圧縮データにキー情報を付与するとともに、再圧縮データのキー情報と再圧縮データに含まれる圧縮データに係る非圧縮データのデータ生成元を示すキー情報とを関連付けたデータ検索用情報を生成する。 In the present invention, the above-mentioned problem of resource saving is approached from the viewpoint of correcting the deterioration of the compression rate when the memory is saved, and a method of two-stage compression is proposed. Specifically, in order to reduce the memory usage, the first compression process that compresses the data in the memory is performed, and in order to reduce the disk usage, multiple compressed data are combined and recompressed for the second time. Performs compression processing. Also, in order to search the compressed data obtained in the first compression process, key information is added to the recompressed data obtained in the second compression process, and the key information of the recompressed data and the recompressed data are included. The data search information associated with the key information indicating the data generation source of the uncompressed data related to the compressed data to be generated is generated.
 このように、本発明では、メモリとディスク双方に対応した二度の圧縮処理とデータ検索用情報の生成処理とを組み合わせた二段階圧縮方式を用いるので、データの検索性を損なうことなく、メモリとディスク双方の使用量を削減できる。以下、本発明を実施する一実施の形態について図面を用いて説明する。 As described above, according to the present invention, since the two-stage compression method that combines the two compression processes corresponding to both the memory and the disk and the generation process of the data search information is used, the memory search can be performed without impairing the searchability of the data. Both disk and disk usage can be reduced. Hereinafter, an embodiment for carrying out the present invention will be described with reference to the drawings.
 図1は、本実施形態に係るデータ圧縮装置1の機能ブロック構成を示す図である。当該データ圧縮装置1は、メモリ3及びディスク5を備えるデータベース装置100で動作し、複数のIoTデバイス300が通信ネットワークを介してデータベース装置100へ送信する情報データを受信して圧縮する装置である。 FIG. 1 is a diagram showing a functional block configuration of a data compression device 1 according to the present embodiment. The data compression apparatus 1 is an apparatus that operates in the database apparatus 100 including the memory 3 and the disk 5 and receives and compresses information data transmitted by the plurality of IoT devices 300 to the database apparatus 100 via the communication network.
 IoTデバイス300は、例えば、センサやデバイスであり、自機で検知したセンタ値等を情報データとして出力する。データベース装置100は、IoTゲートウェイのようなメモリ、ディスク容量がともに少ない機器を使用してもよいし、メモリ、ディスク容量が少ない一般的なパソコンを用いてもよい。 The IoT device 300 is, for example, a sensor or a device, and outputs a center value detected by itself as information data. The database device 100 may use a device such as an IoT gateway having a small memory and disk capacity, or a general personal computer having a small memory and disk capacity.
 まず、データ圧縮装置1の機能について説明する。データ圧縮装置1は、図1に示したように、主として、データ受信部11と、データ圧縮部12と、データ格納部13と、ブロック結合部14と、結合ブロック圧縮部15と、検索情報生成部16と、データ書込部17と、を備えて構成される。 First, the function of the data compression device 1 will be described. As shown in FIG. 1, the data compression device 1 mainly includes a data reception unit 11, a data compression unit 12, a data storage unit 13, a block combination unit 14, a combined block compression unit 15, and search information generation. It is configured to include a unit 16 and a data writing unit 17.
 データ受信部11は、IoTデバイス300が生成した情報データを受信し、受信した情報データをそのまま受信順に追記型のデータ構造でメモリ3に格納する機能を備える。例えば、データ受信部11は、複数のIoTデバイス300から出力された複数の情報データや1つの情報データを構成するデータ列を、受信順に非圧縮状態で次々に時系列にメモリ3に追加する。 The data receiving unit 11 has a function of receiving the information data generated by the IoT device 300 and storing the received information data in the memory 3 as it is in a write-once data structure in the order of reception. For example, the data receiving unit 11 adds a plurality of information data output from a plurality of IoT devices 300 or a data string constituting one information data to the memory 3 in a non-compressed state in the order of reception in time series.
 データ圧縮部12は、時系列に格納された情報データ(非圧縮データ)をメモリ3から取り出し、取り出した非圧縮データを当該非圧縮データのデータ生成元毎(例えば、IoTデバイス毎、IoTデバイス内のアプリ毎)に圧縮し、圧縮した圧縮データからなるブロック(以下、第1ブロック)を生成する機能を備える。第1ブロックの生成方法は、情報データをメモリ3に任意量又は既定量(任意に設定可能)だけ格納した後に圧縮する方法でもよいし、情報データの到来順に逐次的に圧縮して固定サイズのブロックに格納する方法でもよい。 The data compression unit 12 extracts the time-series stored information data (uncompressed data) from the memory 3, and extracts the extracted uncompressed data for each data generator of the uncompressed data (for example, for each IoT device or in the IoT device). (For each application), and has a function of generating a block (hereinafter, referred to as a first block) including compressed compressed data. The method of generating the first block may be a method of compressing after storing the information data in the memory 3 by an arbitrary amount or a predetermined amount (which can be set arbitrarily), or by sequentially compressing the information data in the order of arrival of the information data to obtain a fixed size. It may be stored in blocks.
 データ格納部13は、データ圧縮部12が生成した第1ブロックをメモリ3に再格納する機能を備える。 The data storage unit 13 has a function of re-storing the first block generated by the data compression unit 12 in the memory 3.
 ブロック結合部14は、所定数の第1ブロックをメモリ3から取り出し、取り出した所定数の第1ブロックを結合する機能を備える。例えば、ブロック結合部14は、メモリ3に再格納された第1ブロックの数が任意数又は既定数(任意に設定可能)に到達した後に、当該任意数又は既定数の第1ブロックを結合する。結合対象となる複数の第1ブロックの選定方法は、データ生成元毎に選定してもよいし、複数のデータ生成元の中から選定してもよいし、任意の組み合わせのデータ生成元の中から選定してもよい。データ生成元の種別を問わない複数のデータ生成元の中から選定する方法が高効率である。 The block combining unit 14 has a function of extracting a predetermined number of first blocks from the memory 3 and combining the extracted predetermined number of first blocks. For example, the block combination unit 14 combines the arbitrary number or the predetermined number of first blocks after the number of the first blocks stored again in the memory 3 reaches the arbitrary number or the predetermined number (which can be set arbitrarily). .. The method of selecting the plurality of first blocks to be combined may be selected for each data generation source, may be selected from a plurality of data generation sources, or may be selected among data generation sources of arbitrary combinations. You may choose from. The method of selecting from a plurality of data generation sources regardless of the type of data generation source is highly efficient.
 結合ブロック圧縮部15は、ブロック結合部14が結合した所定数の第1ブロックを再圧縮し、再圧縮した再圧縮データからなるブロック(以下、第2ブロック)を生成する機能を備える。結合ブロック圧縮部15で用いる圧縮方法は、データ圧縮部12が用いる圧縮方法と同じでもよいが、データの圧縮率を高めるために、データの特性や性質等を考慮して異なる圧縮方法又は複数の圧縮方法を組み合わせた圧縮方法を用いることが望ましい。例えば、非圧縮データのデータ構造等に着目し、データ圧縮部12では、非圧縮データを構成するデータ列の一部に対して圧縮を行い、結合ブロック圧縮部15では、圧縮データを構成するデータ列の全体に対して圧縮を行う方法がある。 The combined block compression unit 15 has a function of recompressing a predetermined number of first blocks combined by the block combination unit 14 and generating a block (hereinafter, second block) composed of recompressed recompressed data. The compression method used by the combined block compression unit 15 may be the same as the compression method used by the data compression unit 12, but different compression methods or a plurality of compression methods may be used in consideration of the characteristics and properties of the data in order to increase the data compression rate. It is desirable to use a compression method that is a combination of compression methods. For example, paying attention to the data structure of the uncompressed data, the data compression unit 12 compresses a part of the data sequence forming the uncompressed data, and the combined block compression unit 15 determines the data forming the compressed data. There is a method of performing compression on the entire column.
 ここで、第2ブロックについて説明する。第2ブロックには、データ生成元を示すユニークキーや時間範囲等の異なる複数の第1ブロックが格納される。従来は、ユニークキーを用いることで第1ブロックへ直接アクセス可能であったが、本発明では、第2ブロックに内在する第1ブロックへ直接アクセスできないので、ユニークキーから第2ブロックへの対応が取れるアクセス情報やキー情報を定義する必要がある。 Here, the second block will be explained. In the second block, a plurality of first blocks having different unique keys indicating a data generation source and different time ranges are stored. Conventionally, it was possible to directly access the first block by using a unique key. However, in the present invention, since the first block existing in the second block cannot be directly accessed, the unique key can correspond to the second block. Information and key information need to be defined.
 そこで、まず、第2ブロックの生成元となった複数の第1ブロックのユニークキーから代表キーを生成するとともに、各第1ブロックの最小時刻、最大時刻から当該複数の第1ブロックにおける全体の最小時刻、最大時刻の時間情報を算出して、生成及び算出した第2ブロックに固有の代表キーや時間情報等を当該第2ブロックに付与する。加えて、第2ブロックに、当該第2ブロックに含まれる各第1ブロックのユニークキーと、当該各第1ブロックの最小時刻、最大時刻の時間情報と、を付与する。さらに、第2ブロックの代表キーと、第2ブロックに含まれる各第1ブロックのユニークキーと、を関連付けたデータ検索用情報(検索マップ)を生成して保持する。その後、第2ブロックをディスク5内のファイルへ書き込む。 Therefore, first, the representative key is generated from the unique keys of the plurality of first blocks that are the generation sources of the second block, and the minimum time of each first block and the minimum time of the whole of the plurality of first blocks are calculated from the maximum time. Time information about the time and the maximum time is calculated, and a representative key unique to the generated and calculated second block, time information, and the like are added to the second block. In addition, the unique key of each first block included in the second block and the time information of the minimum time and the maximum time of each first block are added to the second block. Further, the data search information (search map) in which the representative key of the second block and the unique key of each first block included in the second block are associated with each other is generated and held. After that, the second block is written to the file in the disk 5.
 そして、所望の第1ブロックをディスク5のファイルから検索する場合、検索クエリ内のユニークキーに対応する代表キーを検索マップから検索し、検索した代表キーが付与された第2ブロックを特定して、特定した第2ブロックからユニークキーに対応する第1ブロックを取得して解凍する。これにより、ディスク5に書き込まれた情報データを得ることができる。 Then, when the desired first block is searched from the file of the disk 5, the representative key corresponding to the unique key in the search query is searched from the search map to identify the second block to which the searched representative key is added. , The first block corresponding to the unique key is acquired from the specified second block and decompressed. As a result, the information data written on the disc 5 can be obtained.
 そのため、検索情報生成部16は、結合ブロック圧縮部15が生成した第2ブロックに含まれる複数の第1ブロックのユニークキーから代表キーを生成し、生成した代表キーを当該第2ブロックに付与するとともに、第2ブロックの代表キーと、第2ブロックに含まれる複数の第1ブロックのユニークキーと、を関連付けた検索マップを生成して保持する機能を備える。また、データ書込部17は、代表キーが付与された第2ブロックをディスク5内のファイルへ書き込む機能を備える。 Therefore, the search information generation unit 16 generates a representative key from the unique keys of the plurality of first blocks included in the second block generated by the combined block compression unit 15, and attaches the generated representative key to the second block. In addition, it has a function of generating and holding a search map in which the representative key of the second block and the unique keys of the plurality of first blocks included in the second block are associated with each other. Further, the data writing unit 17 has a function of writing the second block to which the representative key is added to the file in the disk 5.
 ここまで、データ圧縮装置1の備える機能について説明した。なお、上述したデータ圧縮装置1の機能ブロック構成は例である。例えば、データ受信部11と、データ圧縮部12と、データ格納部13とを、1つのメモリ削減用圧縮部で実現し、ブロック結合部14と、結合ブロック圧縮部15と、検索情報生成部16と、データ書込部17とを、1つのディスク削減用圧縮部で実現してもよい。 Up to this point, the functions of the data compression device 1 have been described. The functional block configuration of the data compression device 1 described above is an example. For example, the data receiving unit 11, the data compressing unit 12, and the data storing unit 13 are realized by one memory reducing compressing unit, and the block combining unit 14, the combined block compressing unit 15, and the search information generating unit 16 are provided. And the data writing unit 17 may be realized by one disk reduction compression unit.
 この場合、メモリ削減用圧縮部は、メモリ3に格納された非圧縮データを圧縮し、圧縮した圧縮データをメモリ3に再格納する機能を備える。ディスク削減用圧縮部は、所定数の圧縮データを結合して再圧縮し、再圧縮した再圧縮データに代表キーを付与してディスクに書き込むとともに、再圧縮データの代表キーと、再圧縮データに含まれる圧縮データに係る非圧縮データのデータ生成元を示すユニークキーと、を関連付けた検索マップを生成する機能を備える。 In this case, the memory reduction compression unit has a function of compressing the non-compressed data stored in the memory 3 and re-storing the compressed compressed data in the memory 3. The disk reduction compression unit combines a predetermined number of compressed data and recompresses it, adds a representative key to the recompressed recompressed data, and writes it to the disk, and also creates a representative key of the recompressed data and the recompressed data. It is provided with a function of generating a search map in which a unique key indicating a data generation source of uncompressed data related to the included compressed data is associated.
 上記データ圧縮装置1は、CPU、メモリ、入出力インタフェース、通信インタフェース等を備えたコンピュータで実現可能である。また、データ圧縮装置1としてコンピュータを機能させるためのデータ圧縮プログラム、データ圧縮プログラムの記憶媒体の作成も可能である。 The data compression device 1 can be realized by a computer including a CPU, a memory, an input/output interface, a communication interface, and the like. It is also possible to create a data compression program for causing a computer to function as the data compression device 1 and a storage medium for the data compression program.
 次に、データ圧縮装置1で行うデータ圧縮方法について説明する。図2は、データ圧縮方法の処理フローを示す図である。 Next, a data compression method performed by the data compression device 1 will be described. FIG. 2 is a diagram showing a processing flow of the data compression method.
 ステップS1;
 まず、データ受信部11が、データベース装置100がIoTデバイス300から受信した情報データを受け取り、受け取った情報データを受信順に非圧縮状態で次々に時系列にメモリ3に格納する。
Step S1;
First, the data receiving unit 11 receives the information data received by the database apparatus 100 from the IoT device 300, and stores the received information data in the uncompressed order in the order of reception in the memory 3 in time series.
 ステップS2;
 次に、データ圧縮部12は、メモリ3に格納されている情報データ(非圧縮データ)のサイズを当該非圧縮データのデータ生成元毎(ユニークキー毎)に計測し、既定量に達したか否かを判定する。非圧縮データの量が既定量に達していない場合、ステップS1へ戻り、既定量に達した場合、ステップS3へ進む。
Step S2;
Next, the data compression unit 12 measures the size of the information data (non-compressed data) stored in the memory 3 for each data generation source (for each unique key) of the non-compressed data, and reaches the predetermined amount. Determine whether or not. If the amount of uncompressed data has not reached the predetermined amount, the process returns to step S1, and if it reaches the predetermined amount, the process proceeds to step S3.
 ステップS3;
 次に、データ圧縮部12は、既定量に達した非圧縮データを圧縮し、圧縮した圧縮データからなる第1ブロックを生成する。当該ステップS3の圧縮処理が一度目の圧縮処理であり、例えば、非圧縮データのデータ列の中で局所性の高い圧縮(例えば、データ列の前後の値のみを圧縮)を行う。
Step S3;
Next, the data compression unit 12 compresses the uncompressed data that has reached the predetermined amount, and generates the first block composed of the compressed data that has been compressed. The compression process of step S3 is the first compression process, and, for example, compression with high locality is performed in the data sequence of the uncompressed data (for example, only the values before and after the data sequence are compressed).
 ステップS4;
 次に、データ圧縮部12は、第1ブロックに係る非圧縮データのデータ生成元を示すユニークキーを生成するとともに、第1ブロックに係る非圧縮データの最小時刻と最大時刻とをそれぞれ算出する。非圧縮データの最小時刻及び最大時刻については、非圧縮データの受信開始時刻と受信終了時刻をそのまま用いてもよいし、最小時刻をゼロ時刻とし最大時刻を受信開始時刻からの経過時刻としてもよい。
Step S4;
Next, the data compression unit 12 generates a unique key indicating a data generation source of the uncompressed data related to the first block, and calculates the minimum time and the maximum time of the uncompressed data related to the first block, respectively. Regarding the minimum time and the maximum time of the uncompressed data, the reception start time and the reception end time of the uncompressed data may be used as they are, or the minimum time may be zero time and the maximum time may be the elapsed time from the reception start time. ..
 ステップS5;
 次に、データ格納部13は、データ圧縮部12が生成した第1ブロックをメモリ3に再格納する。ステップS1~S5で行う非圧縮データの格納処理、圧縮処理、圧縮データの再格納処理の様子を図3に示す。図3では、key1~key3のユニークキーに係る非圧縮データをそれぞれ時系列に順次格納し、key1のユニークキーに係る非圧縮データの量が既定量に達したため、当該非圧縮データを圧縮し、圧縮した圧縮データからなる第1ブロックをメモリ3に再格納する様子を示している。
Step S5;
Next, the data storage unit 13 re-stores the first block generated by the data compression unit 12 in the memory 3. FIG. 3 shows the states of the non-compressed data storage processing, the compression processing, and the compressed data re-storage processing performed in steps S1 to S5. In FIG. 3, the uncompressed data related to the unique keys of key1 to key3 are sequentially stored in time series, and since the amount of uncompressed data related to the unique key of key1 has reached the predetermined amount, the uncompressed data is compressed. It shows how the first block of compressed data is stored again in the memory 3.
 ステップS6;
 次に、データ圧縮装置1は、第1ブロックの数が既定数に達したか否かを判定する。第1ブロックの数が既定数に達していない場合、ステップS1へ戻る。ステップS1へ戻りステップS1~S5を繰り返し行うことで、概ね同一サイズに圧縮された複数の第1ブロックがユニークキー毎に生成される。そして、第1ブロックの数が既定数に達した場合、ステップS7へ進む。
Step S6;
Next, the data compression device 1 determines whether or not the number of first blocks has reached a predetermined number. If the number of the first blocks has not reached the predetermined number, the process returns to step S1. By returning to step S1 and repeating steps S1 to S5, a plurality of first blocks compressed to approximately the same size are generated for each unique key. Then, when the number of the first blocks reaches the predetermined number, the process proceeds to step S7.
 なお、第1ブロックの数が既定数に達するとは、二度目の圧縮処理を開始する再圧縮条件である。当該再圧縮条件は、ユニークキー単位やユニークキーをまたいで設定可能である。例えば、ユニークキー毎に生成された第1ブロックの総数が既定数に達した場合、全てのユニークキーにわたって生成された第1ブロックの総数が既定数に達した場合、ユニークキーの任意の組み合わせ単位で保持している第1ブロックの総数が既定数に達した場合などである。データ圧縮装置1は、ユーザにより指定された再圧縮条件を用いてステップS6を実行する。 Note that the number of the first blocks reaches the predetermined number is a recompression condition for starting the second compression process. The recompression condition can be set in units of unique keys or across unique keys. For example, when the total number of first blocks generated for each unique key reaches a predetermined number, when the total number of first blocks generated over all unique keys reaches a predetermined number, any combination unit of unique keys This is the case, for example, when the total number of the first blocks held in 1 reaches a predetermined number. The data compression apparatus 1 executes step S6 using the recompression condition designated by the user.
 ステップS7;
 第1ブロックの数が既定数に達した場合(再圧縮条件を満たした場合)、ブロック結合部14は、当該所定数の第1ブロックをメモリ3から取り出し、取り出した所定数の第1ブロックを結合する。
Step S7;
When the number of the first blocks reaches the predetermined number (when the recompression condition is satisfied), the block combination unit 14 extracts the predetermined number of the first blocks from the memory 3 and extracts the predetermined number of the extracted first blocks. Join.
 ステップS8;
 次に、結合ブロック圧縮部15は、ブロック結合部14が結合した所定数の第1ブロックを再圧縮し、再圧縮した再圧縮データからなる第2ブロックを生成して、ディスク5に書き込み可能状態にする。当該ステップS8の圧縮処理が二度目の圧縮処理であり、例えば、GZIP(GNU Zip)やZSTD(Zstandard)等の圧縮プログラムや圧縮アルゴリズムを用いて、結合した全ての圧縮データに含まれるデータ列の全体を圧縮する。
Step S8;
Next, the combined block compression unit 15 recompresses the predetermined number of first blocks combined by the block combination unit 14, generates a second block composed of the recompressed recompressed data, and is in a writable state on the disk 5. To The compression processing in step S8 is the second compression processing, and, for example, by using a compression program or compression algorithm such as GZIP (GNU Zip) or ZSTD (Zstandard), the data strings included in all the combined compressed data are Compress the whole.
 ステップS7~S8で行う圧縮データの結合処理、再圧縮処理の様子を図4に示す。図4では、上述した3種類の再圧縮条件のうち「全てのユニークキーにわたって生成された第1ブロックの総数が既定数に達した場合」を用いた場合であり、key1~key3のユニークキーに係る圧縮データの数が既定数の6に達したため、当該6つの圧縮データを一列に繋いで再圧縮し、再圧縮した再圧縮データからなる第2ブロックをディスク5内のファイルに書き込む様子を示している。 Fig. 4 shows how the compressed data is combined and recompressed in steps S7 to S8. In FIG. 4, among the above-described three types of recompression conditions, “when the total number of first blocks generated over all unique keys reaches a predetermined number” is used, and unique keys of key1 to key3 are used. Since the number of such compressed data has reached the predetermined number of 6, the six compressed data are connected in a row to be recompressed, and the second block composed of the recompressed recompressed data is written to the file in the disk 5. ing.
 ステップS9;
 次に、第2ブロックをディスク5に書き込む前に、検索情報生成部16は、書き込み後の第2ブロック群からなるディスク5内のファイル上で第1ブロックへのアクセスを可能にするためのアクセス情報を作成する。
Step S9;
Next, before writing the second block to the disk 5, the search information generating unit 16 makes an access for enabling access to the first block on the file in the disk 5 including the written second block group. Create information.
 具体的には、検索情報生成部16は、まず、第2ブロックに含まれるユニークキーの集合から単一の代表キーを生成する。例えば、図5に示すように、key1~key3のユニークキーからK1の代表キーを生成する。代表キーの生成方法は、例えば、同じの代表キーに関連付いている複数のユニークキーをソートし、辞書順に最初に来るユニークキー(key1~key3のうちkey1)のワードを利用して代表キー(key1→K1)を生成する。 Specifically, the search information generation unit 16 first generates a single representative key from the set of unique keys included in the second block. For example, as shown in FIG. 5, the representative key of K1 is generated from the unique keys of key1 to key3. The representative key is generated by, for example, sorting a plurality of unique keys associated with the same representative key, and using the word of the first unique key (key1 out of key1 to key3) in the dictionary order to represent the representative key ( key1→K1) is generated.
 次に、検索情報生成部16は、第2ブロック内の各第1ブロックに付与されている最小時刻と最大時刻を全て参照し、その全ての中で最も小さい最小時刻と最も大きい最大時刻を第2ブロックに係る最小時刻と最大時刻にする。例えば、図5に示すように、MIM関数やMAX関数を用いて最小時刻(MinTime1)と最大時刻(MaxTime1)をそれぞれ算出する。 Next, the search information generation unit 16 refers to all the minimum time and the maximum time given to each first block in the second block, and determines the smallest minimum time and the largest maximum time among all of them. Set the minimum time and the maximum time for two blocks. For example, as shown in FIG. 5, the minimum time (MinTime1) and the maximum time (MaxTime1) are calculated using the MIM function and the MAX function, respectively.
 そして、検索情報生成部16は、代表キーと時間範囲(最小時刻,最大時刻)とをインデックス情報1として第2ブロックに付与する。また、検索情報生成部16は、第2ブロックに含まれる各第1ブロックのユニークキーと時間範囲(最小時間,最大時間)とをインデックス情報2として第2ブロックに付与する。 Then, the search information generation unit 16 adds the representative key and the time range (minimum time, maximum time) as the index information 1 to the second block. The search information generation unit 16 also assigns the unique key and the time range (minimum time, maximum time) of each first block included in the second block to the second block as the index information 2.
 さらに、検索情報生成部16は、第2ブロックの代表キーと、当該第2ブロックに含まれる各第1ブロックのユニークキーと、を関連付けた検索マップを生成して保持する。例えば、図5に示すように「m(key1)=m(key2)=m(key3)=K1」といった検索マップを生成する。 Further, the search information generation unit 16 generates and holds a search map in which the representative key of the second block and the unique key of each first block included in the second block are associated with each other. For example, as shown in FIG. 5, a search map such as “m(key1)=m(key2)=m(key3)=K1” is generated.
 ステップS10;
 最後に、データ書込部17は、検索情報生成部16が生成したアクセス情報を持つ第2ブロックをディスク5内のファイルへ書き込む。ファイル内におけるデータレイアウトのイメージを図6に示す。図6では、6つの第1ブロック(圧縮データ)を結合して再圧縮した1つの第2ブロック(再圧縮データ)とともに、各第1ブロックのユニークキーと時間範囲(最小時間,最大時間)と格納位置とを示すインデックス情報2と、第2ブロックの代表キーと時間範囲(最小時間,最大時間)と格納位置とを示すインデックス情報1とのデータレイアウトの例が示されている。
Step S10;
Finally, the data writing unit 17 writes the second block having the access information generated by the search information generating unit 16 to the file in the disk 5. An image of the data layout in the file is shown in FIG. In FIG. 6, together with one second block (recompressed data) obtained by combining and recompressing six first blocks (compressed data), a unique key of each first block and a time range (minimum time, maximum time) An example of the data layout of the index information 2 indicating the storage position, the representative key of the second block, the time range (minimum time, maximum time), and the index information 1 indicating the storage position is shown.
 なお、ステップS6において、「ユニークキーの任意の組み合わせ単位で保持している第1ブロックの総数が既定数に達した場合」の再圧縮条件を用いる場合、書き込みデータに特殊な属性値を付けてもよい。その他、読み込みのパターンを記録して同じタイミングに読み込まれるユニークキー同士をまとめてもよい。 In step S6, when the recompression condition “when the total number of the first blocks held in an arbitrary combination of unique keys reaches a predetermined number” is used, a special attribute value is added to the write data. Good. Alternatively, the reading pattern may be recorded and the unique keys read at the same timing may be grouped together.
 次に、ディスク5からデータを検索するデータ検索方法について説明する。 Next, a data search method for searching the disk 5 for data will be described.
 データベース装置100は、所望のユニークキーと時間範囲とを含む検索クエリを受け付けると、受け付けた検索クエリ内のユニークキーを検索マップより代表キーに変換し、変換した代表キーと検索クエリ内の時間範囲とに該当する第2ブロックをディスク5のファイル上で探索する。第2ブロックを探索した後、データベース装置100は、第2ブロック内のインデックス情報2を参照し、検索クエリに含まれていたユニークキーに該当する第1ブロックの情報を得る。その後、データベース装置100は、当該ユニークキーに該当し、かつ、検索クエリ内の時間範囲に対応する第1ブロックをディスク5のファイルから取得し、一度目の圧縮方法に沿って解凍して情報を得る。なお、二度目の圧縮をユニークキー毎に行った場合は、代表キーに関する手順の省略が可能である。 When the database device 100 receives a search query including a desired unique key and a time range, the database device 100 converts the unique key in the received search query into a representative key from the search map, and the converted representative key and time range in the search query. The second block corresponding to and is searched on the file of the disk 5. After searching the second block, the database device 100 refers to the index information 2 in the second block to obtain the information of the first block corresponding to the unique key included in the search query. After that, the database device 100 acquires the first block corresponding to the unique key and corresponding to the time range in the search query from the file on the disk 5, decompresses it according to the first compression method, and obtains the information. obtain. If the second compression is performed for each unique key, the procedure for the representative key can be omitted.
 以上より、本実施形態によれば、データ圧縮装置1は、メモリ上の非圧縮データを圧縮する一度目の圧縮処理を行うので、メモリ上で圧縮後のデータを保持可能となり、同じ量のデータをメモリ上に保持するのに必要なメモリ量を削減できる。 As described above, according to the present embodiment, the data compression device 1 performs the first compression process of compressing the uncompressed data in the memory, so that the compressed data can be held in the memory, and the same amount of data can be stored. It is possible to reduce the amount of memory required to hold the in memory.
 また、データ圧縮装置1は、複数の圧縮データを結合して再圧縮する二度目の圧縮処理を行うので、ディスク上での圧縮率を向上できる。特に、ユニークキーをまたいで複数の圧縮データを圧縮する場合、ディスク上での圧縮率をより向上できる。つまり、第1ブロック同士をつなぎ合わせることが可能になり、同一のユニークキーのブロックや複数のユニークキーのブロックをまとめて圧縮することが可能になる。このため、小さなブロックしかメモリ上に保持できないような省メモリな場面において、圧縮率を向上できる。 Also, since the data compression device 1 performs the second compression process in which a plurality of compressed data are combined and recompressed, the compression rate on the disk can be improved. In particular, when compressing a plurality of compressed data across unique keys, the compression rate on the disk can be further improved. That is, it is possible to connect the first blocks to each other, and it is possible to collectively compress blocks having the same unique key or blocks having a plurality of unique keys. Therefore, the compression rate can be improved in a memory-saving situation where only a small block can be held in the memory.
 よって、省メモリ、省ディスク容量を両立しながら、データ収集、蓄積を行うことが可能になる。 Therefore, it is possible to collect and store data while achieving both memory saving and disk saving capacity.
 1…データ圧縮装置
 11…データ受信部
 12…データ圧縮部
 13…データ格納部
 14…ブロック結合部
 15…結合ブロック圧縮部
 16…検索情報生成部
 17…データ書込部
 3…メモリ
 5…ディスク(ファイル)
 100…データベース装置
 300…IoTデバイス
DESCRIPTION OF SYMBOLS 1... Data compression device 11... Data receiving part 12... Data compression part 13... Data storage part 14... Block combination part 15... Combined block compression part 16... Search information generation part 17... Data writing part 3... Memory 5... Disk ( File)
100... Database device 300... IoT device

Claims (3)

  1.  データ圧縮装置で行うデータ圧縮方法において、
     メモリに格納された非圧縮データを圧縮し、圧縮した圧縮データを前記メモリに再格納する第1のステップと、
     所定数の前記圧縮データを結合して再圧縮し、再圧縮した再圧縮データにキー情報を付与してディスクに書き込む第2のステップと、
     前記再圧縮データのキー情報と、前記再圧縮データに含まれる圧縮データに係る非圧縮データのデータ生成元を示すキー情報と、を関連付けたデータ検索用情報を生成する第3のステップと、
     を行うことを特徴とするデータ圧縮方法。
    In the data compression method performed by the data compression device,
    A first step of compressing uncompressed data stored in memory and re-storing the compressed compressed data in said memory;
    A second step in which a predetermined number of the compressed data are combined and recompressed, key information is added to the recompressed recompressed data, and the recompressed data is written to the disk;
    A third step of generating data search information in which key information of the recompressed data and key information indicating a data generation source of uncompressed data related to compressed data included in the recompressed data are associated with each other;
    A data compression method comprising:
  2.  前記第1のステップでは、前記非圧縮データを非圧縮データのデータ生成元毎に圧縮し、
     前記第2のステップでは、
     データ生成元が同一であるか否かに関わらず複数のデータ生成元に係る圧縮データの数が前記所定数に達した場合、前記所定数の圧縮データを結合して圧縮することを特徴とする請求項1に記載のデータ圧縮方法。
    In the first step, the uncompressed data is compressed for each data generator of the uncompressed data,
    In the second step,
    When the number of compressed data related to a plurality of data generation sources reaches the predetermined number regardless of whether or not the data generation sources are the same, the predetermined number of compressed data are combined and compressed. The data compression method according to claim 1.
  3.  前記第1のステップでは、前記非圧縮データの一部に対して圧縮を行い、
     前記第2のステップでは、
     前記圧縮データの全体に対して再圧縮を行うことを特徴とする請求項1又は2に記載のデータ圧縮方法。
    In the first step, compression is performed on a part of the uncompressed data,
    In the second step,
    The data compression method according to claim 1, wherein the entire compressed data is recompressed.
PCT/JP2019/048912 2018-12-28 2019-12-13 Data compression method WO2020137611A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018246441A JP2020108045A (en) 2018-12-28 2018-12-28 Data compression method
JP2018-246441 2018-12-28

Publications (1)

Publication Number Publication Date
WO2020137611A1 true WO2020137611A1 (en) 2020-07-02

Family

ID=71126295

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/048912 WO2020137611A1 (en) 2018-12-28 2019-12-13 Data compression method

Country Status (2)

Country Link
JP (1) JP2020108045A (en)
WO (1) WO2020137611A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012095227A (en) * 2010-10-28 2012-05-17 Canon Inc Image processing system, image processing method, and program
JP2014052899A (en) * 2012-09-07 2014-03-20 Toshiba Corp Memory system and control method of the same

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012095227A (en) * 2010-10-28 2012-05-17 Canon Inc Image processing system, image processing method, and program
JP2014052899A (en) * 2012-09-07 2014-03-20 Toshiba Corp Memory system and control method of the same

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FUKUDA, TETSUYA ET AL.: "Two-stage compression method for memory reduction when storing Iot data", LECTURE PROCEEDINGS OF THE 2019 IEICE GENERAL CONFERENCE : INFORMATION AND SYSTEM 1, 5 March 2019 (2019-03-05), pages 39 *
OTSUKA, SHINGO ET AL.: "Two-stage compression for file search system", IEEJ TRANSACTIONS C, vol. 121, no. 7, 1 July 2001 (2001-07-01), pages 1252 - 1260 *

Also Published As

Publication number Publication date
JP2020108045A (en) 2020-07-09

Similar Documents

Publication Publication Date Title
US9514179B2 (en) Table boundary detection in data blocks for compression
US8838551B2 (en) Multi-level database compression
US7937371B2 (en) Ordering compression and deduplication of data
US9195666B2 (en) Location independent files
US20060288036A1 (en) Device specific content indexing for optimized device operation
JP6638821B2 (en) Database archiving method and apparatus, archived database search method and apparatus
US11030172B2 (en) Database archiving method and device for creating index information and method and device of retrieving archived database including index information
CN110058969B (en) Data recovery method and device
JP2018538600A (en) Signature-based cache optimization for data preparation
JP6846426B2 (en) Reduction of voice data and data stored on block processing storage systems
Nafis et al. A secure technique for unstructured big data using clustering method
CN111625531B (en) Merging device based on programmable device, data merging method and database system
JP2010061518A (en) Apparatus and method for storing data and program
CN110020001A (en) Storage, querying method and the corresponding equipment of string data
CN112416879A (en) Block-level data deduplication method based on NTFS (New technology File System)
JP6113816B1 (en) Information processing system, information processing apparatus, and program
WO2020137611A1 (en) Data compression method
CN103761298A (en) Distributed-architecture-based entity matching method
CN110188160A (en) Date storage method and method for reading data
CN103793391A (en) Remote dynamic data processing and verifying method and system
CN107436848B (en) Method and device for realizing conversion between user data and compressed data
US20150269086A1 (en) Storage System and Storage Method
US11652495B2 (en) Pattern-based string compression
US20220245097A1 (en) Hashing with differing hash size and compression size
JP2001022766A (en) Method and device for high speed processing for multidimensional database

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19904975

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19904975

Country of ref document: EP

Kind code of ref document: A1