JP2017037511A - Analyzer, analyzing method, and analyzing program - Google Patents
Analyzer, analyzing method, and analyzing program Download PDFInfo
- Publication number
- JP2017037511A JP2017037511A JP2015158857A JP2015158857A JP2017037511A JP 2017037511 A JP2017037511 A JP 2017037511A JP 2015158857 A JP2015158857 A JP 2015158857A JP 2015158857 A JP2015158857 A JP 2015158857A JP 2017037511 A JP2017037511 A JP 2017037511A
- Authority
- JP
- Japan
- Prior art keywords
- selection condition
- selection
- analysis
- record
- query
- 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
Links
Images
Abstract
Description
本発明は、分析装置、分析方法、および分析プログラムに関する。 The present invention relates to an analysis apparatus, an analysis method, and an analysis program.
近年、ビッグデータと呼ばれる大量のデータから有益な情報を抽出する技術の重要性が増してきている。例えば、販売データの地域や時期の影響を考慮して販売戦略を決める場合に、グループ化演算(group-by)と集約関数(aggregation)とにより表わされる分析命令に対し、全体データの分析結果からの乖離が大きい分析結果を生み出す部分データが有益である場合が多い。 In recent years, the importance of technology for extracting useful information from a large amount of data called big data has increased. For example, when the sales strategy is decided in consideration of the influence of the region and time of sales data, the analysis result expressed by the group data (group-by) and the aggregation function (aggregation) is used. In many cases, partial data that produces analysis results with a large discrepancy between the two is useful.
ここで、部分データとは、属性Aの値がlである場合に、A=lで表される選択条件により選択処理を行うクエリにより、全体データから抽出されるレコード群を意味する。また、乖離が大きい分析結果を生み出す部分データとは、次のように定義される。すなわち、全体データであるテーブルDに対して分析命令qを実行した結果をq(D)と表し、テーブルDの任意の部分データv(D)に対して分析命令qを実行した結果をq*v(D)と表す。この場合に、乖離が大きい分析結果を生み出す部分データとは、q(D)とq*v(D)との乖離が最大となるv(D)を意味し、次式(1)のように定義される。 Here, the partial data means a group of records extracted from the entire data by a query that performs selection processing according to the selection condition represented by A = 1 when the value of the attribute A is l. In addition, partial data that produces analysis results with a large discrepancy are defined as follows. That is, the result of executing the analysis instruction q on the table D as the entire data is represented as q (D), and the result of executing the analysis instruction q on the arbitrary partial data v (D) of the table D is represented by q *. v (D). In this case, the partial data that produces an analysis result with a large divergence means v (D) that maximizes the divergence between q (D) and q * v (D). Defined.
ここで、U(A,B)とは、AとBとの乖離を算出する関数である。このU(A,B)は、入力データDに対して差分計算が可能な関数とする。例えば、ユークリッド距離は、次式(2)に示すように、入力データをD、差分入力データをΔdとしたときに、DとΔdとを分配可能、すなわち、交換法則と結合法則とが成立する関数であり、乖離を算出する関数として利用することができる。 Here, U (A, B) is a function for calculating the difference between A and B. U (A, B) is a function that can calculate a difference with respect to input data D. For example, the Euclidean distance can be distributed between D and Δd when the input data is D and the difference input data is Δd as shown in the following equation (2), that is, the exchange law and the coupling law are established. It is a function and can be used as a function for calculating the deviation.
上記のように表される乖離が大きい分析結果を生み出す部分データを特定するためには、任意の部分データv(D)に対する分析命令qについて、q(D)とq*v(D)との乖離の度合いを算出する必要があるが、これには膨大な時間を要する。 In order to specify the partial data that produces the analysis result with a large difference expressed as described above, for the analysis command q for the arbitrary partial data v (D), q (D) and q * v (D) It is necessary to calculate the degree of divergence, but this takes an enormous amount of time.
従来、複数の選択処理を行うクエリを実行する場合には、各クエリがテーブルDにアクセスするため、実行するクエリ件数の増加に伴い、線形に実行時間が増加するという問題があった。そこで、複数の選択処理の選択条件の属性Aが同一である場合に、選択処理を共有化してテーブルに対するアクセス回数を削減する技術が知られている。例えば、order by句を用いて選択処理で指定される選択条件の属性Aが同一である複数の選択処理のクエリを1つのクエリに等価変換して、データベース管理システム(DBMS)を用いてクエリの処理が行われている(非特許文献1参照)。 Conventionally, when a query that performs a plurality of selection processes is executed, each query accesses the table D. Therefore, there is a problem that the execution time increases linearly as the number of queries to be executed increases. Therefore, a technique is known that reduces the number of accesses to the table by sharing the selection process when the attribute A of the selection conditions of the plurality of selection processes is the same. For example, by performing equivalent conversion of a plurality of selection processing queries having the same selection condition attribute A specified in the selection processing using the order by clause into one query, the database management system (DBMS) is used to Processing is performed (see Non-Patent Document 1).
しかしながら、複数の選択処理で指定される各選択条件の属性Aが異なる場合には、選択処理を共有化することができず、テーブルに対するアクセス回数を削減することができなかった。 However, when the attribute A of each selection condition specified in a plurality of selection processes is different, the selection process cannot be shared, and the number of accesses to the table cannot be reduced.
本発明は、上記に鑑みてなされたものであって、複数の選択条件の属性が異なる場合にも、分析対象のレコードが格納されるテーブルへのアクセス回数を削減して分析処理を高速化することを目的とする。 The present invention has been made in view of the above, and reduces the number of accesses to a table in which records to be analyzed are stored even when attributes of a plurality of selection conditions are different, thereby speeding up analysis processing. For the purpose.
上述した課題を解決し、目的を達成するために、本発明に係る分析装置は、属性の異なる複数の選択条件の指定を受け付け、該選択条件ごとにクエリを生成する生成部と、記憶部に格納されるレコードごとに、前記生成部によって生成された複数のクエリに対応する各選択条件に合致するかをそれぞれ判定し、前記選択条件ごとに、該選択条件に合致するレコードを分析する分析部と、を備えることを特徴とする。 In order to solve the above-described problems and achieve the object, the analysis apparatus according to the present invention accepts designation of a plurality of selection conditions having different attributes, and generates a query for each selection condition, and a storage unit An analysis unit that determines whether each selection condition corresponding to a plurality of queries generated by the generation unit is satisfied for each record to be stored, and analyzes a record that matches the selection condition for each selection condition And.
本発明によれば、複数の選択条件の属性が異なる場合にも、分析対象のレコードが格納されるテーブルへのアクセス回数を削減して分析処理を高速化することができる。 According to the present invention, even when the attributes of a plurality of selection conditions are different, the number of accesses to a table storing records to be analyzed can be reduced to speed up the analysis process.
以下、図面を参照して、本発明の一実施形態を詳細に説明する。なお、この実施形態により本発明が限定されるものではない。また、図面の記載において、同一部分には同一の符号を付して示している。 Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. In addition, this invention is not limited by this embodiment. Moreover, in description of drawing, the same code | symbol is attached | subjected and shown to the same part.
[分析装置]
図1は、本実施形態に係る分析装置の概略構成を示す模式図である。分析装置1は、ワークステーションやパソコン等の汎用コンピュータで実現され、入力部2と、出力部3と、記憶部4と、制御部5とを備える。
[Analysis equipment]
FIG. 1 is a schematic diagram illustrating a schematic configuration of an analyzer according to the present embodiment. The
入力部2は、キーボードやマウス等の入力デバイスを用いて実現され、データ分析者による入力操作に対応して、制御部5に対して処理開始などの各種指示情報を入力する。出力部3は、液晶ディスプレイなどの表示装置、プリンター等の印刷装置、情報通信装置等によって実現され、後述する分析処理の結果等をデータ分析者に対して出力する。
The
記憶部4は、RAM(Random Access Memory)、フラッシュメモリ(Flash Memory)等の半導体メモリ素子、または、ハードディスク、光ディスク等の記憶装置によって実現され、後述する分析処理の対象のテーブルDを格納する。記憶部4は、LANやインターネットなどの電気通信回線を介して制御部5と通信する構成としてもよい。
The
図2は、テーブルDのデータ構成を例示する図である。図2に示すように、テーブルDでは、各レコードについて、複数の属性Aの各属性値lが特定されている。図2には、受注のテーブルDが示されており、属性Aとして、受注番号、販売金額、受注年月、店舗名、商品ジャンル、顧客年齢、および顧客性別が含まれている。そして、例えば受注番号1のレコードについて、販売金額が8000円、受注年月が2015年4月、店舗名が大阪、商品ジャンルが衣服、顧客年齢が45、顧客性別が男性であることが例示されている。
FIG. 2 is a diagram illustrating a data configuration of the table D. As illustrated in FIG. As shown in FIG. 2, in the table D, each
制御部5は、CPU(Central Processing Unit)等の演算処理装置がメモリに記憶された処理プログラムを実行することにより、図1に例示するように、複数クエリ生成部51、複数クエリ実行部52として機能する。
As illustrated in FIG. 1, the
複数クエリ生成部51は、属性の異なる複数の選択条件の指定を受け付け、該選択条件ごとにクエリを生成する。具体的に、複数クエリ生成部51は、データ分析者が入力した分析命令の対象のテーブルDの属性Aに基づいて、属性を特定する選択条件により部分データを取得する選択処理を実行する複数のクエリを生成する。 The multiple query generation unit 51 receives designation of a plurality of selection conditions having different attributes, and generates a query for each of the selection conditions. Specifically, the multiple query generation unit 51 executes a selection process for acquiring partial data according to a selection condition for specifying an attribute, based on the attribute A of the table D that is the target of the analysis instruction input by the data analyst. Generate a query.
例えば、次式(3)に例示する複数の選択条件に対応して、複数のクエリが生成される。本実施形態では、顧客性別を男性とする選択条件1に合致する部分データを取得するためのクエリ、顧客年齢を40代とする選択条件2に合致する部分データを取得するためのクエリ、商品ジャンルを衣服とする選択条件3に合致する部分データを取得するためのクエリ、商品ジャンルを雑貨とする選択条件4に合致する部分データを取得するためのクエリ等が生成される。
For example, a plurality of queries are generated corresponding to a plurality of selection conditions exemplified in the following formula (3). In the present embodiment, a query for acquiring partial data that matches the
複数クエリ実行部52は、クエリ木構築部521と、クエリ木処理部522とを含む。クエリ木構築部521は、複数クエリ生成部51によって生成されたクエリから、各選択条件で指定される属性Aと属性値lとをノードとするクエリ木を構築する。具体的に、クエリ木構築部521は、複数クエリ生成部51が生成した複数のクエリを、クエリ木として、指定された選択条件をキー情報としてキャッシュメモリに記憶する。
The multiple
図3は、クエリ木の構成を例示する図である。図3に示すように、クエリ木では、各選択条件が属性Aとその属性値lとを接続するパスで表されている。図3には、顧客性別を男性とする選択条件1と、顧客年齢を40代とする選択条件2と、商品ジャンルを衣服とする選択条件3と、商品ジャンルを雑貨とする選択条件4との4つの選択条件からなるクエリ木が例示されている。
FIG. 3 is a diagram illustrating a configuration of a query tree. As shown in FIG. 3, in the query tree, each selection condition is represented by a path connecting the attribute A and its attribute value l. FIG. 3 shows
クエリ木処理部522は、複数選択処理と、乖離判定処理とを含む分析処理を行う。複数選択処理では、クエリ木処理部522が、記憶部4に格納されるテーブルDのレコードごとに、複数クエリ生成部51によって生成された複数のクエリに対応する各選択条件に合致するかをそれぞれ判定し、選択条件ごとに、該選択条件に合致するレコードに対する分析命令qを実行する。これにより、各選択条件に合致するレコードの集合である部分データの分析結果を取得する。
The query tree processing unit 522 performs analysis processing including multiple selection processing and divergence determination processing. In the multiple selection process, the query tree processing unit 522 determines for each record of the table D stored in the
具体的に、複数選択処理では、クエリ木処理部522が、記憶部4の分析命令qの対象のテーブルDを参照し、レコードごとに、クエリ木の選択条件と一致する属性Aの属性値lがあるか否かを確認する。一致する場合に、クエリ木処理部522は、同じ属性値lをもつ複数選択処理が処理済みのレコードに対して分析命令qを実行し、当該レコードについての分析結果を適当なメモリ領域に記憶させる。クエリ木処理部522は、以上の処理をテーブルDの全レコードについて行う。
Specifically, in the multiple selection process, the query tree processing unit 522 refers to the table D that is the target of the analysis instruction q in the
ここで、図2〜5を参照して、例えば、分析命令qが次式(4)で表される場合、すなわち、受注のテーブルDについて、受注年月ごとに販売金額の合計を算出することである場合について説明する。 Here, referring to FIGS. 2 to 5, for example, when the analysis instruction q is expressed by the following equation (4), that is, for the order table D, the total sales amount is calculated for each order year and month. The case where it is is demonstrated.
この場合に、図2に示した受注のテーブルDのうち、受注番号1のレコードについて、図3に示したクエリ木の選択条件1〜3に一致する。そこで、クエリ木処理部522は、次式(5)に示すように、クエリ木の選択条件1〜3について、分析命令qを実行し、2015年4月の販売金額に8000円を計上して販売金額の合計を8000円とする。そして、クエリ木処理部522は、図4に例示するように、この分析結果をクエリ木のパスすなわち該当する選択条件1〜3のそれぞれに対応づけて記憶させる。
In this case, the
次に、受注番号2のレコードについて属性Aの値lを確認すると、図3に示したクエリ木の選択条件1〜4のいずれにも一致しない。そこで、検索部522は、受注番号2のレコードについては検索から外し、次のレコードに処理を移す。
Next, when the
次に、受注番号3のレコードについて属性Aの値lを確認すると、図3に示したクエリ木の選択条件1にのみ一致する。そこで、クエリ木処理部522は、次式(6)に示すように、クエリ木の選択条件1についてのみ分析命令qを実行し、2015年4月の販売金額に4000円を計上して販売金額の合計を12000円とする。そして、クエリ木処理部522は、図5に例示するように、この分析結果をクエリ木のパスすなわち該当する選択条件1と対応づけて記憶させる。なお、クエリ木の選択条件2,3については、2015年4月の販売金額の合計は8000円のままとしている。
Next, when the
このように、複数選択処理によれば、クエリ木処理部522は、テーブルDのレコードごとに、複数の属性Aの異なる選択条件により指定された複数の選択処理のクエリを一度に実行した後に分析命令qを実行し、各選択条件に合致する部分データの分析結果を得る。これにより、分析処理を高速化することができる。 As described above, according to the multiple selection processing, the query tree processing unit 522 performs analysis after executing a plurality of selection processing queries specified by different selection conditions of the plurality of attributes A at a time for each record of the table D. The instruction q is executed, and an analysis result of partial data that matches each selection condition is obtained. Thereby, the analysis process can be speeded up.
乖離判定処理では、クエリ木処理部522が、上記したレコードごとの複数選択処理がテーブルDの全てのレコードに対して完了する前に、各選択条件に合致する部分データの分析結果と全体データの分析結果との乖離の度合いを算出し、該乖離の度合いが最大となり得ない選択条件について、以降のレコードに対する複数選択処理を中止する。 In the divergence determination process, the query tree processing unit 522 performs analysis of partial data that matches each selection condition and the entire data before the above-described multiple selection process for each record is completed for all the records in the table D. The degree of divergence from the analysis result is calculated, and the multiple selection processing for the subsequent records is canceled for the selection condition where the degree of divergence cannot be maximized.
ここで、図6を参照して、部分データの分析結果と全体データの分析結果との乖離の度合いについて説明する。図6には、上記式(3)に示した選択条件1〜3に対応する部分データの上記式(4)に示した分析命令qを実行した分析結果の、テーブルDの全体データの分析結果からの乖離度合いすなわちユークリッド距離が示されている。図6のx軸は受注年月を示し、y軸は正規化された販売金額を示す。
Here, with reference to FIG. 6, the degree of deviation between the analysis result of the partial data and the analysis result of the entire data will be described. FIG. 6 shows an analysis result of the entire data of the table D as an analysis result of executing the analysis instruction q shown in the above formula (4) of the partial data corresponding to the
ここで、全体データの分析結果と選択条件1の部分データの分析結果とのユークリッド距離は、各月のユークリッド距離の合計で表される(上記式(2)参照)。また、各月のユークリッド距離は、各月の正規化された販売金額の差で表される。
Here, the Euclidean distance between the analysis result of the entire data and the analysis result of the partial data of the
図6において、各月の全商品の正規化された販売金額と男性の正規化された販売金額との差、すなわち各月のユークリッド距離U(全商品、男性)が、2015年1月が0.1、2月が0.04、3月が0.19、4月が0.02であったとする。この場合に、全体データの分析結果と選択条件1の部分データの分析結果とのユークリッド距離U(全商品、男性)は、2015年1月のユークリッド距離0.1と、2月のユークリッド距離0.04と、3月のユークリッド距離0.19と、4月のユークリッド距離0.02とを合計した0.35と算出される。同様に、全体データの分析結果と選択条件2の部分データの分析結果とのユークリッド距離U(全商品、40代)は、0.30と算出される。また、全体データの分析結果と選択条件3の部分データの分析結果とのユークリッド距離U(全商品、衣服)は、0.74と算出される。したがって、次式(7)を満たす乖離度合いが最大の部分データは、選択条件3の衣類の部分データであることがわかる。
In FIG. 6, the difference between the normalized sales price of all products in each month and the normalized sales price of men, that is, the Euclidean distance U (all products, men) of each month is 0 in January 2015. Suppose that January and February are 0.04, March is 0.19, and April is 0.02. In this case, the Euclidean distance U (all products, male) between the analysis result of the entire data and the analysis result of the partial data of the
本実施形態のクエリ木処理部522は、乖離の度合いを算出する際、全てのレコードの統計情報と、レコードごとの複数選択処理がテーブルDの全てのレコードに対して完了する前に取得した、各選択条件に合致する処理済みのレコードの統計情報とを用いて、各選択条件に合致する未処理のレコードの統計情報を導出し、該未処理のレコードの統計情報を用いて乖離の度合いを算出する。 When calculating the degree of divergence, the query tree processing unit 522 of the present embodiment acquires the statistical information of all records and the multiple selection process for each record before completing all the records in the table D. The statistical information of the unprocessed record that matches each selection condition is derived using the statistical information of the processed record that matches each selection condition, and the degree of deviation is calculated using the statistical information of the unprocessed record. calculate.
具体的に、クエリ木処理部522は、乖離判定処理に先立って、予めテーブルDの全レコード群すなわち全体データについて、分析命令qの対象の属性Aの値lの分布を示すヒストグラムと、各部分データの選択条件で指定されている属性Aの値lの分布を示すヒストグラムとを作成しておく。例えば、上記式(4)に示した分析命令qの対象の属性すなわち販売金額の値の分布を示すヒストグラムを作成しておく。また、上記式(3)に示した選択条件1の属性すなわち顧客性別、選択条件2の属性すなわち顧客年齢、および選択条件3の属性すなわち商品ジャンルの各属性値lの分布を示すヒストグラムを作成しておく。
Specifically, prior to the divergence determination process, the query tree processing unit 522 has a histogram showing the distribution of the
乖離判定処理では、クエリ木処理部522は、まず、上記複数選択処理が処理済みのレコード群D1について、各選択条件に合致する部分データの分析結果(以下、q*選択条件(D1)とも記す)と、D1の分析結果q(D1)との乖離の度合いを算出する。この場合に、乖離の度合いとして、例えば、次式(8)に示すようにユークリッド距離が算出されたものとする。 In the divergence determination process, the query tree processing unit 522 first describes the analysis result of partial data that matches each selection condition (hereinafter referred to as q * selection condition (D1)) for the record group D1 that has been subjected to the multiple selection process. ) And the analysis result q (D1) of D1 is calculated. In this case, as the degree of deviation, for example, it is assumed that the Euclidean distance is calculated as shown in the following equation (8).
ここで、乖離の度合いを算出する関数に対して、次式(9)が成立する。 Here, the following equation (9) is established for the function for calculating the degree of deviation.
そこで、クエリ木処理部522は、レコードごとの複数選択処理が未処理のレコード群D2の各属性値lのヒストグラムを用いて、該未処理のレコード群D2に対して複数選択処理を行った場合の、各選択条件に合致する部分データの分析結果と全体データの分析結果との乖離の度合いの上限値および下限値を算出する。なお、説明の簡略化のため、分析命令qの対象の属性値lは正の値をとるものとする。ただし、分析命令qの対象の属性値lが負の値をとる場合には、値域を正に変換することにより、同様に扱うことが可能となる。 Therefore, when the query tree processing unit 522 performs the multiple selection process on the unprocessed record group D2 using the histogram of the attribute values 1 of the record group D2 in which the multiple selection process for each record is not processed, The upper limit value and the lower limit value of the degree of deviation between the analysis result of the partial data that matches each selection condition and the analysis result of the entire data are calculated. For simplification of explanation, it is assumed that the target attribute value l of the analysis instruction q takes a positive value. However, when the target attribute value l of the analysis instruction q takes a negative value, it can be handled in the same manner by converting the value range to positive.
クエリ木処理部522は、まず、レコードごとの複数選択処理が処理済みのレコード群D1の各属性Aの値lの分布を示すヒストグラムを作成する。そして、全体データのヒストグラムから、該処理済みのレコード群D1のヒストグラムを減算することにより、未処理のレコード群D2の各属性値lのヒストグラムを導出する。例えば、図7は、未処理のレコード群D2についての、分析命令qの対象の属性Aすなわち販売金額の値の分布を例示するヒストグラムである。また、図8は、未処理のレコード群D2についての、顧客年齢の値の分布を例示するヒストグラムである。 First, the query tree processing unit 522 creates a histogram indicating the distribution of the value l of each attribute A of the record group D1 that has been subjected to the multiple selection processing for each record. Then, the histogram of each attribute value l of the unprocessed record group D2 is derived by subtracting the histogram of the processed record group D1 from the histogram of the entire data. For example, FIG. 7 is a histogram illustrating the distribution of the value of the attribute A that is the object of the analysis command q, that is, the sales amount, for the unprocessed record group D2. FIG. 8 is a histogram illustrating the distribution of customer age values for the unprocessed record group D2.
クエリ木処理部522は、未処理のレコード群D2のヒストグラムから、各選択条件の属性Aの値lをもつレコード数を取得する。例えば、図8によれば、選択条件2すなわち顧客年齢が40代の未処理のレコード数が2件であることがわかる。
The query tree processing unit 522 acquires the number of records having the
ここで取得された未処理のレコードが最大の値をとった場合に、未処理のレコード群D2の分析結果と未処理のレコード群D2のうちの各選択条件に合致する部分データの分析結果との乖離の度合いが上限値となる。そこで、クエリ木処理部522は、未処理のレコード群D2の分析対象の属性Aの値lのヒストグラムから大きい順に未処理のレコード数の属性値lを抽出する。 When the unprocessed record acquired here takes the maximum value, the analysis result of the unprocessed record group D2 and the analysis result of the partial data that matches each selection condition of the unprocessed record group D2 The degree of deviation is the upper limit. Therefore, the query tree processing unit 522 extracts the attribute value l of the number of unprocessed records from the histogram of the value l of the attribute A to be analyzed in the unprocessed record group D2.
例えば、図7によれば、販売金額が大きい順に2件の属性値lを抽出すると、10000円が2件である。これにより、未処理のレコード群D2の分析結果と未処理のレコード群D2のうちの選択条件2に合致する部分データの分析結果との乖離の度合いの上限値は、10000+10000=20000と算出される。したがって、テーブルDの分析結果と選択条件2に合致する部分データの分析結果との乖離の度合いの上限値は、上記式(8)のユークリッド距離を参照し、次式(10)に示すように、120000+(10000+10000)=140000と算出される。
For example, according to FIG. 7, if two
同様に、各選択条件の属性Aの値lをもつ未処理のレコードが最小の値をとった場合に、未処理のレコード群D2の分析結果と未処理のレコード群D2のうちの各選択条件に合致する部分データの分析結果との乖離の度合いが下限値となる。そこで、クエリ木処理部522は、未処理のレコード群D2の分析対象の属性Aの値lのヒストグラムから小さい順に未処理のレコード数の属性値を抽出する。
Similarly, when the unprocessed record having the value l of the attribute A of each selection condition takes the minimum value, the analysis result of the unprocessed record group D2 and each selection condition of the unprocessed record group D2 The degree of deviation from the analysis result of the partial data that matches is the lower limit. Therefore, the query tree processing unit 522 extracts the attribute values of the number of unprocessed records from the histogram of the
例えば、未処理のレコード群D2のうち選択条件1の属性Aの値lをもつレコード数が3件だった場合に、図7によれば、販売金額が小さい順に3件の属性値lを抽出すると、4000円が2件、6000円が1件である。そこで、未処理のレコード群D2の分析結果と未処理のレコード群D2のうちの選択条件1に合致する部分データの分析結果との乖離の度合いの下限値は、4000+4000+6000=14000と算出される。したがって、テーブルDの分析結果と選択条件1に合致する部分データの分析結果との乖離の度合いの下限値は、上記式(8)のユークリッド距離を参照し、次式(11)に示すように、250000+(4000+4000+6000)=264000と算出される。
For example, when the number of records having the
クエリ木処理部522は、複数の各選択条件に合致する各部分データの分析結果と全体データの分析結果との乖離の度合いの下限値と上限値とを比較することにより、乖離の度合いが最大となり得ない選択条件を特定する。例えば、ある選択条件に合致する部分データの乖離の度合いの下限値が、他の選択条件に合致する部分データの乖離の度合いの上限値より大きい場合には、後者の乖離の度合いは最大とはなり得ない。上記の例では、選択条件2に合致する部分データの乖離の度合いの上限値が、選択条件1に合致する部分データの乖離の度合いの下限値を下回ることから、選択条件2に合致する部分データの乖離の度合いは最大値とはなり得ないことがわかる。この場合に、クエリ木処理部522は、以降のレコードに対する複数選択処理において、特定された選択条件2についての処理を中止する。
The query tree processing unit 522 compares the lower limit value and the upper limit value of the degree of divergence between the analysis results of the partial data and the analysis results of the whole data that match a plurality of selection conditions, so that the degree of divergence is maximized. Identify the selection conditions that cannot be. For example, if the lower limit of the degree of divergence of partial data that meets a certain selection condition is greater than the upper limit of the degree of divergence of partial data that meets other selection conditions, the latter degree of divergence is It can't be. In the above example, the upper limit value of the degree of divergence of the partial data that matches the
このように、乖離判定処理によれば、レコードごとの複数選択処理がテーブルDの全てのレコードに対して完了する前に、未処理のレコード群D2に対して複数選択処理を行った場合に、各選択条件に合致する部分データの分析結果と全体データの分析結果との乖離の度合いが最大となり得るか否かがわかる。そこで、クエリ木処理部522は、各選択条件に合致する部分データの分析結果と全体データの分析結果との乖離の度合いが最大となり得ない選択条件について、以降のレコードの複数選択処理を中止する。これにより、分析処理を高速化して、全体データの分析結果との乖離の度合いが高い部分データを選択する選択条件を探索することができる。 As described above, according to the divergence determination process, when the multiple selection process for each record is performed on the unprocessed record group D2 before the multiple selection process for each record is completed for all the records in the table D, It can be seen whether or not the degree of divergence between the analysis result of the partial data that matches each selection condition and the analysis result of the entire data can be maximized. Therefore, the query tree processing unit 522 cancels the subsequent multiple selection processing of records for a selection condition in which the degree of divergence between the analysis result of partial data that matches each selection condition and the analysis result of the entire data cannot be maximized. . Thereby, it is possible to speed up the analysis process and search for a selection condition for selecting partial data having a high degree of deviation from the analysis result of the entire data.
[分析処理]
次に、図9および図10のフローチャートを参照して、分析装置1における分析処理手順について説明する。まず、図9は、複数選択処理手順を示すフローチャートである。図9のフローチャートは、例えば、データ分析者により入力部2を介して分析開始の指示入力があったタイミングで開始となる。
[Analysis processing]
Next, the analysis processing procedure in the
クエリ木処理部522は、まず、キャッシュメモリに記憶されたクエリ木を読み込んで(ステップS1)、記憶部4の分析命令qの対象のテーブルDを参照し、複数選択処理が未処理のレコードの有無を確認し(ステップS2)、未処理のレコードがある場合には(ステップS2,Yes)、当該未処理のレコードを読み込む(ステップS3)。このレコードの各属性Aの値lが、選択条件を表すクエリ木のパスに一致すれば、クエリ木処理部522が、当該属性Aの値lをもつ複数選択処理が処理済みのレコード群に対して分析命令を実行する(ステップS4)。また、クエリ木処理部522は、分析結果をパスに対応づけて適当なメモリ領域に記憶させる。
First, the query tree processing unit 522 reads the query tree stored in the cache memory (step S1), refers to the table D that is the target of the analysis instruction q in the
一方、ステップS2の処理で、未処理のレコードがない場合には(ステップS2、No)、クエリ木処理部522は、一連の複数選択処理を終了させる。このようにして、クエリ木処理部522は、テーブルDの全てのレコードについて、複数選択処理を行う。 On the other hand, when there is no unprocessed record in the process of step S2 (step S2, No), the query tree processing unit 522 ends the series of multiple selection processes. In this way, the query tree processing unit 522 performs multiple selection processing for all the records in the table D.
図10は、乖離判定処理手順を示すフローチャートである。図10のフローチャートは、例えば、上記の複数選択処理がテーブルDから検索された全てのレコードに対して完了する前に、データ分析者により入力部2を介して乖離判定の指示入力があったタイミングで開始となる。
FIG. 10 is a flowchart showing the deviation determination processing procedure. The flowchart of FIG. 10 shows, for example, the timing at which a data analyzer inputs a divergence determination instruction via the
クエリ木処理部522は、まず、全体データについてのヒストグラムを読み込む(ステップS11)。具体的に、分析命令qの対象の属性Aの値lの分布を示すヒストグラムと、各部分データの選択条件で指定されている属性Aの値lの分布を示すヒストグラムとが読み込まれる。
The query tree processing unit 522 first reads a histogram for the entire data (step S11). Specifically, a histogram indicating the distribution of the
次に、クエリ木処理部522は、複数選択処理が未処理のレコード群D2の各属性Aの値lのヒストグラムを導出する(ステップS12)。具体的に、クエリ木処理部522は、まず、レコードごとの複数選択処理が処理済みのレコード群D1の各属性Aの値lの分布を示すヒストグラムを作成する。そして、全体データのヒストグラムから、該処理済みのレコード群D1のヒストグラムを減算することにより、未処理のレコード群D2の各属性Aの値lのヒストグラムを導出する。 Next, the query tree processing unit 522 derives a histogram of the value l of each attribute A of the record group D2 in which the multiple selection process has not been processed (step S12). Specifically, the query tree processing unit 522 first creates a histogram indicating the distribution of the value l of each attribute A of the record group D1 that has been subjected to the multiple selection process for each record. Then, the histogram of the value l of each attribute A of the unprocessed record group D2 is derived by subtracting the histogram of the processed record group D1 from the histogram of the entire data.
次に、クエリ木処理部522は、レコードごとの複数選択処理が未処理のレコード群D2の各属性Aの値lのヒストグラムを用いて、各選択条件に合致する部分データの分析結果と全体データの分析結果との乖離の度合いの上限値および下限値を算出する。そして、乖離の度合いが最大となり得ない選択条件について、以降のレコードに対する複数選択処理をスキップする(ステップS13)。
Next, the query tree processing unit 522 uses the histogram of the
以上、説明したように、本実施形態の分析装置1では、複数クエリ生成部51が、属性の異なる複数の選択条件の指定を受け付け、該選択条件ごとにクエリを生成する。また、クエリ木処理部522が、記憶部4に格納されるレコードごとに、複数クエリ生成部51によって生成された複数のクエリに対応する各選択条件に合致するかをそれぞれ判定し、選択条件ごとに、該選択条件に合致するレコードを分析する複数選択処理を行う。
As described above, in the
このように、クエリ木処理部522は、テーブルDのレコードごとに、複数の属性Aの異なる選択条件により指定された複数の選択処理のクエリを一度に実行した後に分析命令qを実行し、各選択条件に合致する部分データの分析結果を得る。これにより、テーブルDへのアクセス回数を削減して分析処理を高速化することができる。 As described above, the query tree processing unit 522 executes the analysis instruction q after executing a plurality of selection processing queries specified by different selection conditions of the plurality of attributes A for each record of the table D at a time. An analysis result of partial data that matches the selection condition is obtained. As a result, the number of accesses to the table D can be reduced to speed up the analysis process.
また、クエリ木処理部522は、上記のレコードごとの複数選択処理がテーブルDの全てのレコードに対して完了する前に、各選択条件に合致する部分データの分析結果と全体データDの分析結果との乖離の度合いを算出し、該乖離の度合いが最大となり得ない選択条件について、以降のレコードに対する複数選択処理を中止する乖離判定処理を行う。 The query tree processing unit 522 also analyzes the partial data analysis result and the overall data D analysis result that match each selection condition before the multiple selection processing for each record is completed for all the records in the table D. The degree of divergence is calculated, and a divergence determination process for canceling a plurality of selection processes for subsequent records is performed for a selection condition in which the degree of divergence cannot be maximized.
乖離の度合いを算出する際、クエリ木処理部522は、全体データDの統計情報と、レコードごとの複数選択処理がテーブルDの全てのレコードに対して完了する前に取得した、各選択条件に合致する処理済みのレコードD1の統計情報とを用いて、各選択条件に合致する未処理のレコードD2の統計情報を導出し、該未処理のレコードD2の統計情報を用いて乖離の度合いを算出する。 When calculating the degree of divergence, the query tree processing unit 522 uses the statistical information of the entire data D and each selection condition acquired before the multiple selection processing for each record is completed for all the records in the table D. The statistical information of the unprocessed record D2 that matches each selection condition is derived using the statistical information of the matched processed record D1, and the degree of divergence is calculated using the statistical information of the unprocessed record D2. To do.
このように、クエリ木処理部522は、各選択条件に合致する部分データの分析結果と全体データの分析結果との乖離の度合いが最大となり得ない選択条件を判定し、当該選択条件について、以降のレコードの複数選択処理を中止する。これにより、分析処理を高速化して、全体データの分析結果との乖離の度合いが高い部分データを選択する選択条件を探索することができる。 In this way, the query tree processing unit 522 determines a selection condition in which the degree of divergence between the analysis result of partial data that matches each selection condition and the analysis result of the entire data cannot be maximized. Cancel the multiple selection process of the record. Thereby, it is possible to speed up the analysis process and search for a selection condition for selecting partial data having a high degree of deviation from the analysis result of the entire data.
このように、本実施形態の分析装置1によれば、分析対象のデータが格納されるテーブルDから部分データを取得するための複数の選択処理で指定される各選択条件の属性Aが異なる場合にも、テーブルDへのアクセス回数を削減して分析処理を高速化することができる。
As described above, according to the
[他の実施形態]
[プログラム]
上記実施形態に係る分析装置1が実行する処理をコンピュータが実行可能な言語で記述したプログラムを作成することもできる。この場合、コンピュータがプログラムを実行することにより、上記実施形態と同様の効果を得ることができる。さらに、係るプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータに読み込ませて実行することにより上記実施形態と同様の処理を実現してもよい。以下に、分析装置1と同様の機能を実現する分析プログラムを実行するコンピュータの一例を説明する。
[Other Embodiments]
[program]
It is also possible to create a program in which processing executed by the
図11に示すように、分析プログラムを実行するコンピュータ1000は、例えば、メモリ1010と、CPU1020と、ハードディスクドライブインタフェース1030と、ディスクドライブインタフェース1040と、シリアルポートインタフェース1050と、ビデオアダプタ1060と、ネットワークインタフェース1070とを有する。これらの各部は、バス1080によって接続される。
As shown in FIG. 11, a
メモリ1010は、ROM(Read Only Memory)1011およびRAM1012を含む。ROM1011は、例えば、BIOS(Basic Input Output System)等のブートプログラムを記憶する。ハードディスクドライブインタフェース1030は、ハードディスクドライブ1031に接続される。ディスクドライブインタフェース1040は、ディスクドライブ1041に接続される。ディスクドライブ1041には、例えば、磁気ディスクや光ディスク等の着脱可能な記憶媒体が挿入される。シリアルポートインタフェース1050には、例えば、マウス1051およびキーボード1052が接続される。ビデオアダプタ1060には、例えば、ディスプレイ1061が接続される。
The
ここで、図11に示すように、ハードディスクドライブ1031は、例えば、OS1091、アプリケーションプログラム1092、プログラムモジュール1093およびプログラムデータ1094を記憶する。上記実施形態で説明した各テーブルは、例えばハードディスクドライブ1031やメモリ1010に記憶される。
Here, as shown in FIG. 11, the hard disk drive 1031 stores, for example, an
また、分析プログラムは、例えば、コンピュータ1000によって実行される指令が記述されたプログラムモジュール1093として、ハードディスクドライブ1031に記憶される。具体的には、上記実施形態で説明した分析装置1が実行する各処理が記述されたプログラムモジュールが、ハードディスクドライブ1031に記憶される。
Further, the analysis program is stored in the hard disk drive 1031 as a
また、分析プログラムによる情報処理に用いられるデータは、プログラムデータ1094として、例えば、ハードディスクドライブ1031に記憶される。そして、CPU1020が、ハードディスクドライブ1031に記憶されたプログラムモジュール1093やプログラムデータ1094を必要に応じてRAM1012に読み出して、上述した各手順を実行する。
Data used for information processing by the analysis program is stored as
なお、分析プログラムに係るプログラムモジュール1093やプログラムデータ1094は、ハードディスクドライブ1031に記憶される場合に限られず、例えば、着脱可能な記憶媒体に記憶されて、ディスクドライブ1041等を介してCPU1020によって読み出されてもよい。あるいは、分析プログラムに係るプログラムモジュール1093やプログラムデータ1094は、LAN(Local Area Network)やWAN(Wide Area Network)等のネットワークを介して接続された他のコンピュータに記憶され、ネットワークインタフェース1070を介してCPU1020によって読み出されてもよい。
Note that the
以上、本発明者によってなされた発明を適用した実施形態について説明したが、本実施形態による本発明の開示の一部をなす記述および図面により本発明は限定されることはない。すなわち、本実施形態に基づいて当業者等によりなされる他の実施形態、実施例および運用技術等は全て本発明の範疇に含まれる。 As mentioned above, although embodiment which applied the invention made | formed by this inventor was described, this invention is not limited with the description and drawing which make a part of indication of this invention by this embodiment. That is, other embodiments, examples, operational techniques, and the like made by those skilled in the art based on this embodiment are all included in the scope of the present invention.
1 分析装置
2 入力部
3 出力部
4 記憶部
5 制御部
51 複数クエリ生成部
52 複数クエリ実行部
521 クエリ木構築部
522 クエリ木処理部
DESCRIPTION OF
Claims (6)
記憶部に格納されるレコードごとに、前記生成部によって生成された複数のクエリに対応する各選択条件に合致するかをそれぞれ判定し、前記選択条件ごとに、該選択条件に合致するレコードを分析する分析部と、
を備えることを特徴とする分析装置。 Receiving a specification of a plurality of selection conditions having different attributes, and generating a query for each of the selection conditions;
For each record stored in the storage unit, it is determined whether each selection condition corresponding to a plurality of queries generated by the generation unit is met, and the record that matches the selection condition is analyzed for each selection condition An analysis unit to
An analysis apparatus comprising:
前記分析部は、前記記憶部に格納されるレコードごとに、前記構築部によって構築されたクエリ木の選択条件に合致するかをそれぞれ判定し、前記選択条件ごとに、該選択条件に合致するレコードを分析することを特徴とする請求項1に記載の分析装置。 A construction unit that constructs a query tree having the attribute and the attribute value specified by each selection condition as nodes from the query generated by the generation unit;
The analysis unit determines, for each record stored in the storage unit, whether the query tree selection condition constructed by the construction unit is met, and for each selection condition, a record that meets the selection condition The analyzer according to claim 1, wherein the analyzer is analyzed.
属性の異なる複数の選択条件の指定を受け付け、該選択条件ごとにクエリを生成する生成工程と、
記憶部に格納されるレコードごとに、前記生成工程において生成された複数のクエリに対応する各選択条件に合致するかをそれぞれ判定し、前記選択条件ごとに、該選択条件に合致するレコードを分析する分析工程と、
を含んだことを特徴とする分析方法。 An analysis method executed by an analyzer,
A generation step of accepting specification of a plurality of selection conditions having different attributes and generating a query for each of the selection conditions;
For each record stored in the storage unit, it is determined whether each selection condition corresponding to a plurality of queries generated in the generation step is met, and a record that matches the selection condition is analyzed for each selection condition Analysis process to
The analysis method characterized by including.
記憶部に格納されるレコードごとに、前記生成ステップにおいて生成された複数のクエリに対応する各選択条件に合致するかをそれぞれ判定し、前記選択条件ごとに、該選択条件に合致するレコードを分析する分析ステップと、
をコンピュータに実行させるための分析プログラム。 A generation step of accepting specification of a plurality of selection conditions having different attributes and generating a query for each of the selection conditions;
For each record stored in the storage unit, it is determined whether each selection condition corresponding to the plurality of queries generated in the generation step is satisfied, and the record that matches the selection condition is analyzed for each selection condition Analysis steps to
An analysis program to make a computer execute.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015158857A JP2017037511A (en) | 2015-08-11 | 2015-08-11 | Analyzer, analyzing method, and analyzing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015158857A JP2017037511A (en) | 2015-08-11 | 2015-08-11 | Analyzer, analyzing method, and analyzing program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2017037511A true JP2017037511A (en) | 2017-02-16 |
Family
ID=58049400
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015158857A Pending JP2017037511A (en) | 2015-08-11 | 2015-08-11 | Analyzer, analyzing method, and analyzing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2017037511A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107220283A (en) * | 2017-04-21 | 2017-09-29 | 东软集团股份有限公司 | Data processing method, device, storage medium and electronic equipment |
-
2015
- 2015-08-11 JP JP2015158857A patent/JP2017037511A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107220283A (en) * | 2017-04-21 | 2017-09-29 | 东软集团股份有限公司 | Data processing method, device, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6843882B2 (en) | Learning from historical logs and recommending database operations for data assets in ETL tools | |
CN105550268B (en) | Big data process modeling analysis engine | |
US11645294B2 (en) | Interactive identification of similar SQL queries | |
US20190347281A1 (en) | Apparatus and method for semantic search | |
JP5477297B2 (en) | Active metric learning device, active metric learning method, and active metric learning program | |
US20160004757A1 (en) | Data management method, data management device and storage medium | |
Anderson et al. | Synthetic data generation for the internet of things | |
US10452700B1 (en) | Systems and methods for parsing log files using classification and plurality of neural networks | |
EP3037983A1 (en) | Data processing system, data processing method, and data processing device | |
US20200125954A1 (en) | Systems and methods for selecting and generating log parsers using neural networks | |
KR102309375B1 (en) | Apparatus and method for knowledge graph indexing | |
US20150379166A1 (en) | Model compilation for feature selection in statistical models | |
US11288266B2 (en) | Candidate projection enumeration based query response generation | |
US10586169B2 (en) | Common feature protocol for collaborative machine learning | |
CN113221570A (en) | Processing method, device, equipment and storage medium based on-line inquiry information | |
CN116235158A (en) | System and method for implementing automated feature engineering | |
Benny et al. | Hadoop framework for entity resolution within high velocity streams | |
Brahim et al. | Model Driven Extraction of NoSQL Databases Schema: Case of MongoDB. | |
US9798449B2 (en) | Fuzzy search and highlighting of existing data visualization | |
JP2017037511A (en) | Analyzer, analyzing method, and analyzing program | |
Masouleh et al. | Optimization of ETL process in data warehouse through a combination of parallelization and shared cache memory | |
Sarno et al. | Workflow common fragments extraction based on WSDL similarity and graph dependency | |
Lydia et al. | Clustering and indexing of multiple documents using feature extraction through apache hadoop on big data | |
US20150193854A1 (en) | Automated compilation of graph input for the hipergraph solver | |
CN111699472A (en) | Method and computer program product for determining measures for developing, designing and/or deploying complex embedded or cyber-physical systems of different technical areas, in particular complex software architectures used therein |