JP6613706B2 - Table design support apparatus, table design support method, and control program - Google Patents
Table design support apparatus, table design support method, and control program Download PDFInfo
- Publication number
- JP6613706B2 JP6613706B2 JP2015161237A JP2015161237A JP6613706B2 JP 6613706 B2 JP6613706 B2 JP 6613706B2 JP 2015161237 A JP2015161237 A JP 2015161237A JP 2015161237 A JP2015161237 A JP 2015161237A JP 6613706 B2 JP6613706 B2 JP 6613706B2
- Authority
- JP
- Japan
- Prior art keywords
- record
- divided
- delimiter
- unit
- record set
- 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.)
- Active
Links
Images
Description
本発明は、テーブル設計支援装置、テーブル設計支援方法及び制御プログラムに関する。 The present invention relates to a table design support apparatus, a table design support method, and a control program.
昨今、コンピュータシステムの進化に伴い、インターネット上で公開されているオープンデータ等、他者から提供されるデータの容量の増加や種類の多様化が進んでいる。データベースによってこれらのデータを管理するにあたり、データの容量が極めて大きい場合は、大量のデータを複数のマシンに分散して処理できるハドゥープ(Hadoop)等のプラットフォームを用いるのが一般的である。一方、これらのデータの容量がギガバイト(GB)オーダー程度であれば、リレーショナルデータベース管理システム(RDBMS)により対応することが可能である。RDBMSでは、普及しているSQL言語をデータベース言語としているので簡便である。 In recent years, with the evolution of computer systems, the amount of data provided by others, such as open data published on the Internet, has been increasing and the types have been diversified. When managing these data using a database, if the data capacity is extremely large, it is common to use a platform such as Hadoop that can process a large amount of data distributed to a plurality of machines. On the other hand, if the capacity of these data is on the order of gigabytes (GB), it can be handled by a relational database management system (RDBMS). The RDBMS is convenient because the SQL language that is prevalent is the database language.
RDBMSに対しデータを格納するためには、対応する形式のテーブル定義データを生成する必要がある。このテーブル定義データの生成には少なからず専門的な知識を要する。特許文献1には、テーブル定義データの生成におけるテーブル設計者の負荷を軽減するため、新たにテーブル定義データを生成する際、予め用意されたテーブル定義データを活用するようにするテーブル設計支援装置が記載されている。
In order to store data in the RDBMS, it is necessary to generate table definition data in a corresponding format. The generation of this table definition data requires a lot of specialized knowledge.
特許文献1に記載されたテーブル設計支援装置では、テーブル設計作業において、テーブル設計者は、入手したレコード集合に対し、各フィールド(列)のデータ型や、一意性などの制約を定める必要がある。オープンデータのように他者からレコード集合のみ提供される場合には、提供されたレコード集合の内容を確認しながらテーブル設計作業を行う必要がある。しかしながら、他者から提供されるレコード集合の規模(データ容量)が大きくなるにつれ、テーブル設計作業においてデータ型の不一致や制約違反などのエラーが生じやすくなり、エラーを修正するための再設計作業が必要になるケースが多くなるという問題があった。ここで、データ型の不一致とは、設計したフィールドのデータ型と実際のレコードのフィールド値との不一致による格納エラーを意味する。また、制約違反とは、フィールドもしくはレコード集合の制約(一意性やヌル(NULL)値の有無など)に対し、実際のレコード集合が違反していることによる格納エラーを意味する。
In the table design support apparatus described in
本発明は、以上の背景に鑑みなされたものであり、リレーショナルデータベース管理システム対するテーブル設計作業において、他者から提供されるレコード集合の規模が大きくなっても、テーブル設計作業においてデータ型の不一致や制約違反などのエラーが生じ難くできるテーブル設計支援装置、テーブル設計支援方法及び制御プログラムを提供することを目的とする。 The present invention has been made in view of the above background, and in the table design work for the relational database management system, even if the size of the record set provided by another person increases, the data type mismatch or It is an object of the present invention to provide a table design support apparatus, a table design support method, and a control program that are unlikely to cause errors such as constraint violations.
かかる課題を解決するために本発明は、リレーショナルデータベース管理システムに対するテーブル設計を支援するテーブル設計支援装置であって、他者から提供されたレコード集合を分割するための区切り文字候補を検出する区切り文字候補検出部と、前記区切り文字候補によって前記レコード集合を分割し分割レコード群を生成するレコード分割部と、前記分割レコード群における各分割レコードに対し、前記リレーショナルデータベース管理システムにおいて格納可能なデータ型及び制約について分析を行い分析結果ファイル群を生成するフィールド分析部と、前記分析結果ファイル群を結合して前記リレーショナルデータベース管理システムで格納が可能なテーブル定義候補を生成する分析結果結合部と、を備えるものである。 In order to solve such a problem, the present invention is a table design support device for supporting table design for a relational database management system, and is a delimiter character for detecting delimiter characters for dividing a record set provided by another person. A candidate detection unit, a record dividing unit that divides the record set by the delimiter candidate and generates a divided record group, a data type that can be stored in the relational database management system for each divided record in the divided record group, and A field analysis unit that analyzes the constraints and generates an analysis result file group; and an analysis result combination unit that combines the analysis result file groups to generate table definition candidates that can be stored in the relational database management system. Is.
また、本発明は、区切り文字候補検出部と、レコード分割部と、フィールド分析部と、分析結果結合部と、を備えるテーブル設計支援装置により、リレーショナルデータベース管理システムに対するテーブル設計を支援するテーブル設計支援方法であって、区切り文字候補検出部が、他者から提供されたレコード集合を分割するための区切り文字候補を検出するステップと、レコード分割部が、前記区切り文字候補によって前記レコード集合を分割し分割レコード群を生成するステップと、フィールド分析部が、前記分割レコード群における各分割レコードに対し、前記リレーショナルデータベース管理システムにおいて格納可能なデータ型及び制約について分析を行い分析結果ファイル群を生成するステップと、分析結果結合部が、前記分析結果ファイル群を結合して前記リレーショナルデータベース管理システムで格納が可能なテーブル定義候補を生成するステップと、を備えるものである。 The present invention also provides table design support for supporting table design for a relational database management system using a table design support device comprising a delimiter candidate detection unit, a record division unit, a field analysis unit, and an analysis result combination unit. A method in which a delimiter candidate detection unit detects a delimiter candidate for dividing a record set provided by another, and a record dividing unit divides the record set by the delimiter candidate. A step of generating a divided record group, and a step of generating an analysis result file group by analyzing a data type and constraints that can be stored in the relational database management system for each divided record in the divided record group And the analysis result combining unit Generating a possible table definition candidate storage in the relational database management system combines the result files are those comprising a.
さらに、本発明は、リレーショナルデータベース管理システムに対するテーブル設計を支援する制御プログラムであって、他者から提供されたレコード集合を分割するための区切り文字候補を検出するステップと、前記区切り文字候補によって前記レコード集合を分割し分割レコード群を生成するステップと、前記分割レコード群における各分割レコードに対し、前記リレーショナルデータベース管理システムにおいて格納可能なデータ型及び制約について分析を行い分析結果ファイル群を生成するステップと、前記分析結果ファイル群を結合して前記リレーショナルデータベース管理システムで格納が可能なテーブル定義候補を生成するステップと、をコンピュータに実行させるものである。 Further, the present invention provides a control program for supporting table design for a relational database management system, the step of detecting a delimiter character candidate for dividing a record set provided by another person, Dividing a record set to generate a divided record group, and generating an analysis result file group by analyzing data types and constraints that can be stored in the relational database management system for each divided record in the divided record group And generating the table definition candidates that can be stored in the relational database management system by combining the analysis result file groups.
本発明によれば、リレーショナルデータベース管理システム対するテーブル設計作業において、他者から提供されるレコード集合の規模が大きくなっても、テーブル設計作業においてデータ型の不一致や制約違反などのエラーが生じ難くできる。 According to the present invention, in the table design work for the relational database management system, even if the size of the record set provided by another person increases, errors such as data type mismatches and constraint violations can hardly occur in the table design work. .
[本発明の特徴]
本発明の実施の形態の説明に先立って、本発明の特徴についてその概要をまず説明する。
[Features of the present invention]
Prior to the description of the embodiments of the present invention, an outline of the features of the present invention will be described first.
図1は、本発明の概要について説明する図である。図1は、本発明の概略構成の一例を示すテーブル設計支援装置1の概略構成の一例を示すブロック図である。テーブル設計支援装置1は、区切り文字候補検出部2と、レコード分割部3と、フィールド分析部4と、分析結果結合部5と、を備えている。
FIG. 1 is a diagram for explaining the outline of the present invention. FIG. 1 is a block diagram showing an example of a schematic configuration of a table
区切り文字候補検出部2は、他者から提供されたレコード集合を適切に分割するための文字(区切り文字候補)を検出する。レコード分割部3は、区切り文字候補検出部2から受け取った区切り文字候補によってレコード集合を分割し分割レコード群を生成する。フィールド分析部4は、分割レコード群における各分割レコードに対し、格納可能なデータ型、及び一意性やNULL値の有無などの制約について分析を行い、分析結果ファイル群を生成する。分析結果結合部5は、分析結果ファイル群を結合してRDBMSで格納が可能なテーブル定義候補を生成する。
The delimiter
テーブル設計支援装置1では、他者から提供されたレコード集合に対し、レコード集合を分割して分割レコード群を生成し、分割レコードごとにデータ型や制約をそれぞれ分析することによって、データ型リレーショナルデータベース管理システム(RDBMS)で格納が可能なテーブル定義候補を自動で生成することができる。これにより、RDBMSにおけるテーブル設計作業において、他者から提供されるレコード集合の規模が大きくなっても、テーブル設計作業においてデータ型の不一致や制約違反などのエラーが生じ難くできる。
The table
以下、図面を参照して本発明の実施の形態について説明する。
まず、本実施の形態にかかるテーブル設計支援装置200の概略構成について以下に説明する。
図2は、本実施の形態にかかるテーブル設計支援装置200の概略構成の一例を示すブロック図である。テーブル設計支援装置200は、入力されたレコード集合をRDBMSに格納することが可能なテーブル定義の候補をクライアント端末100に出力する。図2に示すように、テーブル設計支援装置200は、入力情報受信部201と、入力情報記憶部202と、区切り文字候補検出部203と、区切り文字候補送信部204と、区切り文字受信部205と、レコード分割部206と、フィールド分析部207と、分析結果結合部208と、分析結果送信部209と、記憶装置220と、を有する。
Embodiments of the present invention will be described below with reference to the drawings.
First, a schematic configuration of the table design support
FIG. 2 is a block diagram showing an example of a schematic configuration of the table
他者から提供されるレコード集合111及びRDBMS種別情報は、クライアント端末100の記憶装置110に保存されている。なお、RDBMS種別情報とは、例えば、SQL99、Oracle、MySQL、PostgreSQL等のRDBMSの種別に関する情報を意味する。
A record set 111 and RDBMS type information provided by another person are stored in the storage device 110 of the
入力情報受信部201は、クライアント端末100(入力情報送信部102)から送信されたデータ(レコード集合111及びRDBMS種別情報211)を受け取る。入力情報記憶部202は、入力情報受信部201が受け取ったデータを、RDBMS種別情報211及びレコード集合212として記憶装置210に記憶させる。
The input
区切り文字候補検出部203は、レコード集合212を適切に分割するための文字を検出する。区切り文字候補送信部204は、区切り文字候補検出部203での検出結果が一意に定まらなかった場合にテーブル設計者に確認するため、区切り文字候補をクライアント端末100(区切り文字候補受信部103)に送信する。この場合、テーブル設計者は、区切り文字入力候補の中から選択した区切り文字をクライアント端末100(入力装置101)から入力する。
The delimiter
区切り文字受信部205は、テーブル設計者によって入力された区切り文字をクライアント端末100(区切り文字送信部104)から受け取る。レコード分割部206は、区切り文字候補検出部203もしくは区切り文字受信部205から受け取った区切り文字によってレコード集合212を分割し分割レコード群213を生成する。分割レコード群213は、一時データとして記憶装置210に記憶される。
The delimiter receiving
フィールド分析部207は、分割レコード群213における各分割レコードについてそれぞれ分析し、分析結果ファイル群215を生成する。分析結果結合部208は、分析結果ファイル群215に含まれる各分析結果ファイルを結合し、1つの分析結果ファイル(RDBMで格納可能なテーブル定義候補)を生成する。分析結果送信部209は、テーブル定義候補をクライアント端末100(分析結果受信部105)に送信する。記憶装置220は、フィールド分析部207が分割レコード群213を分析する際に使用する各判定用プログラム(データ型判定プログラム221、NULL値判定プログラム222及び一意性判定プログラム223)を格納する。
The
区切り文字候補検出部203、レコード分割部206、フィールド分析部207及び分析結果結合部208は、これらの一部又は全部をソフトウェア(プログラム)によって構成するようにしても良いし、ハードウェア回路によって構成するようにしても良い。
The delimiter
次に、テーブル設計支援装置200の動作について以下で説明する。なお、以下の説明では、図2についても適宜参照する。
図3は、テーブル設計支援装置200における処理の流れを示すフローチャートである。図3に示すように、ステップS1では、入力情報受信部201がクライアント端末100からRDBMS種別情報とレコード集合111のデータを受信し、入力情報記憶部202を介して受信したデータを記憶装置210に保存する。記憶装置210に保存されたレコード集合をレコード集合212、RDBMS種別情報をRDBMS種別情報211とする。
Next, the operation of the table
FIG. 3 is a flowchart showing the flow of processing in the table
次に、ステップS2では、区切り文字候補検出部203がレコード集合212を分析し、レコード集合212を複数列に分割することが可能な区切り文字候補を検出する。検出された区切り文字候補が単一でない(複数検出された、または、該当する区切り文字がない)場合、区切り文字候補送信部204からクライアント端末側の区切り文字候補受信部103に送信され、テーブル設計者に対して確認を行う。テーブル設計者が入力装置101から区切り文字を選択すると区切り文字送信部104及び区切り文字受信部205を経てレコード分割部206へ送られる。区切り文字候補検出部203により検出された区切り文字候補が単一の場合、そのままレコード分割部206へ送られる。区切り文字候補を決定する処理の詳細については後述する。
Next, in step S2, the delimiter
次に、ステップS3では、レコード分割部206がステップS2において算出された区切り文字によってレコード集合212をフィールド単位に分割し、分割レコード群213として記憶装置210に保存される。レコード集合212の分割について、図4〜7を用いて具体的に説明する。
Next, in step S3, the
図4は、レコード集合212の一例であるレコード集合R100を示す図である。図4に示されたレコード集合R100を区切り文字候補検出部203により検出された区切り文字候補S(この例では“,”(カンマ))で区切った状態を図5に示す。この区切り文字候補Sの位置でレコード集合R100を分割する。レコード集合R100が分割された後、図6に示すように複数の分割レコードR101、R102、R103、R104が生成される。複数の分割レコードR101、R102、R103、R104からなる分割レコード群R105(分割レコード群213の一例)は記憶装置210に保存される。
FIG. 4 is a diagram illustrating a record set R100 that is an example of the
図3に示すように、ステップS3に続き、ステップS4では、フィールド分析部207が、生成された分割レコード群213のそれぞれに対し、NULL値の有無、一意性の有無、RDBMS種別情報211に基づくデータ型及びデータ長、について分析を行う。そして、フィールド単位での格納可能なテーブル定義の候補群を分析結果ファイル群215として記憶装置210に保存される。分割レコード群213に対する分析処理の詳細については後述する。
As shown in FIG. 3, following step S <b> 3, in step S <b> 4, the
次に、ステップS5では、分析結果結合部208がフィールド毎の分析結果ファイル群215を結合して1つのファイルとする。このファイルは、RDBMSに格納することが可能なテーブル定義候補である。テーブル定義候補は、分析結果送信部209を介してクライアント端末100に送信される。
In step S5, the analysis
図3のステップS2において区切り文字候補を決定する処理について以下で説明する。
図7は、レコード集合212において区切り文字の候補を決定する処理の流れを示すフローチャートである。図7に示すように、まず、ステップS21では、既出文字一覧の初期化を行う。既出文字とは、区切り文字の候補を決定する処理フローにおいて処理対象となった文字である。区切り文字候補を決定する処理が完了したとき、レコード集合212に含まれる全ての文字が既出文字一覧に登録される。区切り文字候補を決定する処理の開始時点では既出文字は不明であるため、既出文字一覧をクリアする初期化処理を行う。
A process for determining a delimiter candidate in step S2 of FIG. 3 will be described below.
FIG. 7 is a flowchart showing a flow of processing for determining a delimiter candidate in the
次に、ステップS22では、レコード集合212内の一行を読み込む。最初にレコード集合212の1行目を読み込み、後述するステップS23、ステップS24の処理を行った後、ステップS22に戻って次の行を読み込む。ステップS22〜ステップS24の処理はレコード集合212の最終行まで繰り返される。
Next, in step S22, one line in the record set 212 is read. First, the first line of the record set 212 is read, and after the processing of Step S23 and Step S24 described later, the process returns to Step S22 to read the next line. Steps S22 to S24 are repeated until the last line of the
次に、ステップS23では、ステップ22で読み込みした一行に対し、文字毎の出現回数をカウントする。具体的には、レコード集合212に記載されている文字について既出文字一覧の確認及び登録を行うとともに、行番号と既出文字との連想配列(ハッシュ)に対し、行ごとの文字の出現回数を格納する。なお、既出文字一覧の確認及び登録を行う処理の詳細については後述する。
Next, in step S23, the number of appearances for each character is counted for one line read in
ステップS24では、読み込みした一行がレコード集合212の最後の行か否かを判定する。ステップS24で、読み込みした一行がレコード集合212の最後の行であると判断された場合、ステップS25では、既出文字一覧に登録された各文字について、レコード集合212の行ごとに出現回数の集計を行う。そして、既出文字一覧に登録された各文字について、行ごとの出現回数から、出現回数一致率を算出する。
In step S24, it is determined whether the read one row is the last row of the
ステップS25に続いて、ステップS26では、区切り文字候補を決定する。具体的には、区切り文字候補検出部203が、レコード集合212の行ごとにレコード集合212に含まれるそれぞれの文字の出現回数を集計する。そして、区切り文字候補検出部203が、レコード集合212に含まれる文字ごとに出現回数が一致している行の最大数の全行数に対する比率である出現回数一致率を算出し、出現回数一致率に基づいて区切り文字候補を決定する。出現回数一致率が1である文字は、レコード集合212の全ての行において出現回数が同じであることを意味するので、この文字を区切り文字候補とする。出現回数一致率が1である文字が存在しない場合、最も出現回数一致率の大きい文字を区切り文字候補とする。なお、出現回数一致率が1でない文字が区切り文字候補として選択された場合、出現回数が異なる行については、レコード分割部206における分割レコード生成時において例外行として除外され、以降の処理の対象外とする。区切り文字候補を決定した後、処理を終了する。
Subsequent to step S25, in step S26, a delimiter candidate is determined. Specifically, the delimiter
ステップS24で、読み込みした一行がレコード集合212の最後の行ではないと判断された場合、処理をステップS22に戻し、ステップS22で次の行を読み込む。 If it is determined in step S24 that the read line is not the last line of the record set 212, the process returns to step S22, and the next line is read in step S22.
図8は、区切り文字候補の決定について具体例により説明する図である。図8Aは、行番号と行番号と既出文字一覧に登録された文字(既出文字)との連想配列(ハッシュ)の一例を示す図である。行番号と既出文字との連想配列中の数字(ハッシュ関数値)は、既出文字の出現回数である。また、説明の便宜上、レコード集合212の行数は6行とする。図8Aに示すように、既出文字“,”(カンマ)は、レコード集合212の1〜6行目において出現回数はいずれも3回であるので、出現回数一致率は、(出現回数が一致している行の最大数)/(全行数)=6[行]/6[行]=1.00である。 FIG. 8 is a diagram for explaining determination of a delimiter candidate by a specific example. FIG. 8A is a diagram illustrating an example of an associative array (hash) of line numbers, line numbers, and characters (existing characters) registered in the already-existing character list. A number (hash function value) in the associative array of line numbers and existing characters is the number of appearances of the existing characters. For convenience of explanation, the record set 212 has six rows. As shown in FIG. 8A, since the appearance number “,” (comma) appears three times in the first to sixth lines of the record set 212, the appearance number match rate is (the number of appearance matches). The maximum number of lines) / (total number of lines) = 6 [lines] / 6 [lines] = 1.00.
“,”(カンマ)以外の既出文字について、例えば、既出文字“a”では、レコード集合212の各行における出現回数は、1行目が1回、2行目はなし、3行目は3回、4行目は3回、5行目は1回、6行目は3回、である。既出文字“a”において、出現回数が3回の行は、3行(3行目、4行目、6行目)で最も多い。つまり、出現回数が一致している行の最大数は3行である。よって、出現回数一致率は、(出現回数が一致している行の最大数)/(全行数)=3[行]/6[行]=0.50である。 For the existing characters other than “,” (comma), for example, in the existing character “a”, the number of appearances in each line of the record set 212 is 1 for the first line, 2 for the second line, 3 for the third line, The fourth line is 3 times, the 5th line is 1 time, and the 6th line is 3 times. In the existing character “a”, the number of occurrences of 3 times is the largest in 3 lines (3rd line, 4th line, 6th line). That is, the maximum number of lines with the same number of appearances is three lines. Therefore, the appearance count matching rate is (maximum number of rows with the same appearance count) / (total number of rows) = 3 [rows] / 6 [rows] = 0.50.
図8Bに示すように、既出文字において、“,”(カンマ)の出現回数一致率のみが1.00なので、“,”(カンマ)を区切り文字候補とする(判定結果○)。 As shown in FIG. 8B, since only the appearance frequency matching rate of “,” (comma) is 1.00 in the existing characters, “,” (comma) is set as a delimiter character candidate (determination result ○).
図7のステップS23において、レコード集合212のある一行において各既出文字の出現回数をカウントする処理について以下で説明する。
図9は、レコード集合212のある一行において各既出文字の出現回数をカウントする処理の流れを示すフローチャートである。図9に示すように、まず、ステップS231において、レコード集合212のある一行における一文字を読み込む。最初にレコード集合212のある一行における1文字目を読み込み、後述するステップS232〜ステップS235の処理を行った後、ステップS231に戻って次の文字を読み込む。ステップS231〜ステップS235の処理はレコード集合212のある行の最後の文字まで繰り返す。
A process of counting the number of appearances of each existing character in one line of the record set 212 in step S23 of FIG. 7 will be described below.
FIG. 9 is a flowchart showing a flow of processing for counting the number of appearances of each existing character in one line of the
次に、ステップS232では、読み込んだ一文字が既出文字一覧に登録されているか否かを確認する。ステップS232で読み込んだ一文字が既出文字一覧に登録されていればステップS234に進む。読み込んだ一文字が既出文字一覧に登録されていなければステップS233で読み込んだ一文字を既出文字一覧に登録し、ステップS234に進む。 Next, in step S232, it is confirmed whether or not the read one character is registered in the existing character list. If the single character read in step S232 is registered in the list of existing characters, the process proceeds to step S234. If the read character is not registered in the existing character list, the read one character is registered in the existing character list in step S233, and the process proceeds to step S234.
次に、ステップS234では、行番号と既出文字との連想配列(ハッシュ)におけるハッシュ関数値をカウントアップし、読み込んだ行における各既出文字の出現回数を記録する。次に、ステップS235で、処理を行っている文字がある行内の最後の文字であるか否かを判断する。ステップS24で、処理を行っている文字がある行内の最後の文字であると判断された場合は、処理を終了する。処理を行っている文字がある行内の最後の文字ではないと判断された場合、処理をステップS231に戻し、ステップS231で次の文字を読み込む。 Next, in step S234, the hash function value in the associative array (hash) of line numbers and existing characters is counted up, and the number of appearances of each existing character in the read line is recorded. Next, in step S235, it is determined whether the character being processed is the last character in a line. If it is determined in step S24 that the character being processed is the last character in a line, the processing ends. If it is determined that the character being processed is not the last character in a line, the process returns to step S231, and the next character is read in step S231.
図3のステップS4において、分割レコード群213に対する分析処理について以下で説明する。
図10は、分割レコード群213に対する分析処理の流れを示すフローチャートである。図10に示すように、ステップS41では、分割レコード群213に含まれる分割レコードの1つを読み込む。なお、分割レコード群213に含まれる分割レコードの1つを読み込んだ後、後述するステップS42〜ステップS45の処理を行い、ステップS41に戻って次の分割レコードを読み込む。ステップS41〜ステップS45の処理は、分割レコード群213に含まれる全部の分割レコードを処理し終わるまで繰り返される。
The analysis process for the divided
FIG. 10 is a flowchart showing the flow of analysis processing for the divided
次に、ステップS42では、NULL値判定プログラムにより、分割レコード群213に含まれる分割レコードのそれぞれに対し、文字列長が0であるデータが含まれているかどうかの判定をする(NULL値判定)。そして、NULL値判定において、NULL値が含まれている分割レコードが見つかった場合、当該分割レコードからNULL値を除く処理を行う。なお、分割レコード群213に対し、このNULL値を除く処理を行った後の処理後の分割レコード群が処理後分割レコード群214(図2参照)である。なお、NULL値判定において、分割レコード群213に含まれる分割レコードのいずれからもNULL値が見つからなかった場合、分割レコード群213と処理後分割レコード群214との内容は同一となる。
Next, in step S42, it is determined by the NULL value determination program whether data with a character string length of 0 is included for each of the divided records included in the divided record group 213 (NULL value determination). . Then, in the NULL value determination, when a divided record including the NULL value is found, a process of removing the NULL value from the divided record is performed. Note that the post-processing division record group 214 (see FIG. 2) is a post-processing division record group after the processing except the NULL value is performed on the
次に、ステップS43では、ステップS42でNULL値を除く処理を行った処理後分割レコードに対し、一意性があるか否かの判定を行う。具体的には、一意性判定プログラムにより、処理後分割レコードに対し、まず行単位でのソートを行い、次に前後の行を比較することによって重複する行が存在するかどうかを確認する。処理後分割レコードにおいて重複する行が見つかった場合には、当該重複する行を一つの行にまとめる行統合処理を行う。この行統合処理の前後で処理後分割レコードの行数が同じ場合は、当該処理後分割レコードは一意性があると判定する。 Next, in step S43, it is determined whether or not there is uniqueness to the post-process division record that has undergone the process of removing the NULL value in step S42. Specifically, the uniqueness determination program first sorts the post-processed divided records in units of rows, and then compares the preceding and succeeding rows to check whether there are duplicate rows. When duplicate rows are found in the post-process division record, row integration processing is performed to combine the duplicate rows into one row. If the number of lines in the post-process division record is the same before and after this line integration process, it is determined that the post-process division record has uniqueness.
次に、ステップS44では、ステップS42でNULL値を除く処理を行った処理後分割レコードに対し、RDBMS種別情報211に基づいてRDBMSに格納する際に使用可能なデータ型候補の判定を行う。このデータ型候補の判定処理の詳細については後述する。 Next, in step S44, data type candidates that can be used for storing in the RDBMS based on the RDBMS type information 211 are determined based on the RDBMS type information 211 for the post-processed divided records that have undergone the process of removing the NULL value in step S42. Details of the data type candidate determination process will be described later.
次に、ステップS45では、分割レコード群213に含まれる全部の分割レコードの処理が終わったか否かを判断する。ステップS45で、分割レコード群213に含まれる全部の分割レコードの処理が終わったと判断された場合、ステップS46に進む。ステップS46では分割レコード群213に対する分析結果を分析結果ファイル群215として出力する。ステップS45で、分割レコード群213に含まれる全部の分割レコードの処理が終わっていないと判断された場合、処理をステップS41に戻し、ステップS41で次の分割レコードを読み込む。
Next, in step S45, it is determined whether or not all the divided records included in the divided
図10のステップS44におけるデータ型候補の判定処理について以下で説明する。
図11は、データ型候補の判定処理の流れを示すフローチャートである。図11に示すように、ステップS441でRDBMS種別情報を読み込む。
The data type candidate determination process in step S44 of FIG. 10 will be described below.
FIG. 11 is a flowchart showing the flow of data type candidate determination processing. As shown in FIG. 11, RDBMS type information is read in step S441.
次に、ステップS442では、RDBMS種別情報から得られたRDBMS種別(例えば、SQL99、Oracle、MySQL、PostgreSQL等)において登録済みのデータ型(例えば、IMTEGER型、CHAR型等)の1つに対応する合致判定用プログラムを読み込む。なお、合致判定用プログラムは、RDBMS種別において定義されたデータ型によりそれぞれ異なる。RDBMS種別において登録済みのデータ型の1つに対応する合致判定用プログラムを読み込んだ後、後述するステップS443〜ステップS445の処理を行い、再びステップS442に戻って次の登録済みのデータ型の合致判定用プログラムを読み込む。ステップS442〜ステップS445の処理は、登録済みのデータ型の合致判定用プログラムの全てを実行し終わるまで繰り返される。 Next, in step S442, it corresponds to one of registered data types (for example, IMTEGER type, CHAR type, etc.) in the RDBMS type (for example, SQL99, Oracle, MySQL, PostgreSQL, etc.) obtained from the RDBMS type information. Read the match determination program. Note that the match determination program differs depending on the data type defined in the RDBMS type. After reading the match determination program corresponding to one of the registered data types in the RDBMS type, the processing in steps S443 to S445 described later is performed, and the process returns to step S442 again to match the next registered data type. Load the judgment program. The processes in steps S442 to S445 are repeated until all of the registered data type match determination programs have been executed.
次に、ステップS443では、ステップS42でNULL値を除く処理を行った処理後分割レコードに対し、読み込みした合致判定用プログラムを実行し、処理後分割レコードのデータ型が、実行中の合致判定用プログラムのデータ型と合致するか否かの判定を行う。以下、標準SQL規格SQL99にて定義されているデータ型のうちの、“INTEGER型”の合致判定プログラムと、“CHAR型”の合致判定プログラムと、を例として、処理後分割レコードのデータ型が、実行中の合致判定用プログラムのデータ型と合致するか否かを判定する方法について具体的に説明する。 Next, in step S443, the read match determination program is executed for the post-process division record that has undergone the process of removing the NULL value in step S42, and the data type of the post-process division record is for the match determination being executed. Judges whether it matches the data type of the program. Hereinafter, of the data types defined in the standard SQL standard SQL99, the “INTEGER type” match determination program and the “CHAR type” match determination program are used as examples. A method for determining whether or not the data type of the matching determination program being executed matches will be specifically described.
SQL99におけるINTEGER型は、−2147483648〜2147483647の範囲の整数を格納可能な整数データである。このため、SQL99におけるINTEGER型の合致判定用プログラムでは、まず、処理後分割レコードに整数でない値が含まれているか否かを確認する。整数でない値が含まれていない(すべて整数である)場合に、処理後分割レコードに含まれるデータの最大値と最小値を求め、これがINTERGER型の値の範囲内であれば当該処理後分割レコードはINTERGER型に格納可能であると判定する。SQL99におけるCHAR型は文字で構成されるデータ型であるため、SQL99におけるCHAR型の合致判定用プログラムでは、まず、処理後分割レコードの各行のデータが文字列であるか否かを確認する。処理後分割レコードの各行が文字列である場合、各行の文字列長をそれぞれ算出し、算出した文字列長のうちの最大値をCHAR型の文字列長と定める。 The INTEGER type in SQL99 is integer data that can store an integer in the range of -2147483648 to 2147483647. For this reason, in the INTEGER type match determination program in SQL99, first, it is confirmed whether or not a non-integer value is included in the post-process division record. When non-integer values are not included (all are integers), the maximum value and the minimum value of the data included in the post-process division record are obtained, and if this is within the range of the INTERGER type value, the post-process division record Is determined to be storable in the INTERGER type. Since the CHAR type in SQL99 is a data type composed of characters, the CHAR type match determination program in SQL99 first checks whether the data in each line of the post-process division record is a character string. When each line of the post-process division record is a character string, the character string length of each line is calculated, and the maximum value of the calculated character string lengths is determined as the CHAR type character string length.
ステップS443に続き、ステップS444では、合致判定の結果を記録する。ステップS443でデータ型が合致したと判断された場合には、実行した合致判定用プログラムのRDBMS種別とデータ型とに対応して割り出されるスコアを、実行した合致判定用プログラムに対応するデータ型の”有効なスコア”として記録する。一方、ステップS443において実行した合致判定用プログラムにおいて、データ型が合致しないと判断された場合には、実行した合致判定用プログラムに対応するデータ型についてスコアは記録されない。実行した合致判定用プログラムのRDBMS種別とデータ型とに対応するスコアの一覧表の一例を図12に示す。 Following step S443, in step S444, the result of match determination is recorded. If it is determined in step S443 that the data types match, the score calculated corresponding to the RDBMS type and data type of the executed match determination program is used as the data type corresponding to the executed match determination program. Record as a “valid score”. On the other hand, if it is determined in the match determination program executed in step S443 that the data types do not match, no score is recorded for the data type corresponding to the executed match determination program. An example of a list of scores corresponding to the RDBMS type and data type of the executed match determination program is shown in FIG.
図11に示すように、ステップS444に続くステップS445では、登録済みのデータ型の全てについて、データ型の合致判定が終了したかどうかを判断する。ステップS445で登録済みのデータ型の全てについて、データ型の合致判定が終了したと判断された場合、ステップS446へと進む。一方、ステップS445で登録済みのデータ型の全てについて、データ型の合致判定が終了していないと判断された場合、処理をステップS442に戻し、次の登録済みのデータ型を読み込む。
す。
As shown in FIG. 11, in step S445 following step S444, it is determined whether or not the data type match determination has been completed for all registered data types. If it is determined in step S445 that the data type match determination has been completed for all registered data types, the process proceeds to step S446. On the other hand, if it is determined in step S445 that the data type match determination has not been completed for all registered data types, the process returns to step S442 to read the next registered data type.
The
ステップS446では、ステップS444にて”有効なスコア”が記録されたデータ型を、分割レコード群213の格納が可能なデータ型候補とする。さらに、これらのデータ型候補について有効なスコアが大きい順にソートし、データ型候補の優先度を決める。
In step S446, the data type in which “valid score” is recorded in step S444 is set as a data type candidate capable of storing the divided
図13は、図10のステップS46において出力された分析結果ファイル群を、図3のステップS5において1つのファイルに結合した分析結果ファイル(RDBMSで格納が可能なテーブル定義候補)の一例を示す図である。図13に示すように、例えば、レコード集合の第1番目のフィールド(フィールド1)では、データ型の優先度はSMALLINT型(優先度1)、INTEGER型(優先度2)、CHAR型またはVARCHAR型(優先度3)の順に高い。また、フィールド1には、一意性があり、NULL値が存在しない。
FIG. 13 is a diagram showing an example of an analysis result file (table definition candidates that can be stored in the RDBMS) obtained by combining the analysis result file group output in step S46 of FIG. 10 into one file in step S5 of FIG. It is. As shown in FIG. 13, for example, in the first field (field 1) of the record set, the priority of the data type is SMALLINT type (priority 1), INTEGER type (priority 2), CHAR type or VARCHAR type. In order of (priority 3). Also,
上記実施の形態で説明したテーブル設計支援装置200では、他者から提供されたレコード集合に対し、RDBMSで格納が可能なテーブル定義候補を自動で生成することができる。これにより、リレーショナルデータベース管理システムにおけるテーブル設計作業において、他者から提供されるレコード集合の規模が大きくなっても、テーブル設計作業においてデータ型の不一致や制約違反などのエラーが生じ難くできる。
The table
以上、本発明を上記実施の形態に即して説明したが、本発明は上記実施の形態の構成にのみ限定されるものではなく、本願特許請求の範囲の請求項の発明の範囲内で当業者であればなし得る各種変形、修正、組み合わせを含むことは勿論である。 Although the present invention has been described with reference to the above embodiment, the present invention is not limited only to the configuration of the above embodiment, and within the scope of the invention of the claims of the present application. It goes without saying that various modifications, corrections, and combinations that can be made by those skilled in the art are included.
例えば、上記実施の形態において、クライアント端末100とテーブル設計支援装置200とを別々の装置として構成したが、一体として構成してもよい。また、テーブル設計支援装置200の構成要素は一体として構成したが、別々に構成してもよい。フィールド分析部207を複数の異なる装置内に配置すると、分割レコード群213を並列に分析することができるので処理時間を短縮することが可能になる。なお、フィールド分析部207を複数の異なる装置内に配置する場合、分割レコード群213、処理後分割レコード群214及び分析結果ファイル群215については複数の装置間で共有できるような構成にする。
For example, in the above embodiment, the
1 テーブル設計支援装置
2 区切り文字候補検出部
3 レコード分割部
4 フィールド分析部
5 分析結果結合部
1 Table
Claims (6)
他者から提供されたレコード集合を分割するための区切り文字候補を検出する区切り文字候補検出部と、
前記区切り文字候補によって前記レコード集合を分割し分割レコード群を生成するレコード分割部と、
前記分割レコード群における各分割レコードに対し、前記リレーショナルデータベース管理システムにおいて格納可能なデータ型及び制約について分析を行い分析結果ファイル群を生成するフィールド分析部と、
前記分析結果ファイル群を結合して前記リレーショナルデータベース管理システムで格納が可能なテーブル定義候補を生成する分析結果結合部と、
を備え、
前記区切り文字候補検出部は、前記レコード集合の行ごとに前記レコード集合に含まれるそれぞれの文字の出現回数を集計し、前記レコード集合に含まれる文字ごとに前記出現回数が一致している行の最大数の全行数に対する比率である出現回数一致率を算出し、前記出現回数一致率に基づいて前記区切り文字候補を決定する、テーブル設計支援装置。 A table design support device for supporting table design for a relational database management system,
A delimiter candidate detection unit for detecting delimiter candidates for dividing a record set provided by another person,
A record dividing unit that divides the record set by the delimiter candidate and generates a divided record group;
For each divided record in the divided record group, a field analysis unit that analyzes data types and constraints that can be stored in the relational database management system and generates an analysis result file group;
An analysis result combining unit that combines the analysis result file groups to generate table definition candidates that can be stored in the relational database management system;
Equipped with a,
The delimiter candidate detection unit aggregates the number of appearances of each character included in the record set for each row of the record set, and the number of occurrences of the line where the number of appearances matches for each character included in the record set. A table design support device that calculates an appearance frequency coincidence ratio that is a ratio of the maximum number of all rows and determines the delimiter candidate based on the appearance frequency coincidence rate .
区切り文字候補検出部が、他者から提供されたレコード集合を分割するための区切り文字候補を検出するステップと、
レコード分割部が、前記区切り文字候補によって前記レコード集合を分割し分割レコード群を生成するステップと、
フィールド分析部が、前記分割レコード群における各分割レコードに対し、前記リレーショナルデータベース管理システムにおいて格納可能なデータ型及び制約について分析を行い分析結果ファイル群を生成するステップと、
分析結果結合部が、前記分析結果ファイル群を結合して前記リレーショナルデータベース管理システムで格納が可能なテーブル定義候補を生成するステップと、
を備え、
前記区切り文字候補を検出するステップにおいて、前記区切り文字候補検出部が、前記レコード集合の行ごとに前記レコード集合に含まれるそれぞれの文字の出現回数を集計し、前記レコード集合に含まれる文字ごとに前記出現回数が一致している行の最大数の全行数に対する比率である出現回数一致率を算出し、前記出現回数一致率に基づいて前記区切り文字候補を決定する、テーブル設計支援方法。 A table design support method for supporting table design for a relational database management system by means of a table design support device comprising a delimiter candidate detection unit, a record division unit, a field analysis unit, and an analysis result combination unit,
A delimiter candidate detection unit detecting delimiter candidates for dividing a record set provided by others;
A record dividing unit dividing the record set by the delimiter candidates to generate a divided record group;
A field analysis unit, for each divided record in the divided record group, analyzing data types and constraints that can be stored in the relational database management system to generate an analysis result file group;
An analysis result combining unit generating the table definition candidates that can be stored in the relational database management system by combining the analysis result file groups;
Equipped with a,
In the step of detecting the delimiter candidate, the delimiter candidate detection unit counts the number of appearances of each character included in the record set for each row of the record set, and for each character included in the record set A table design support method for calculating an appearance frequency coincidence ratio that is a ratio of a maximum number of lines having the same appearance frequency to the total number of lines, and determining the delimiter candidate based on the appearance frequency coincidence ratio .
他者から提供されたレコード集合を分割するための区切り文字候補を検出するステップと、
前記区切り文字候補によって前記レコード集合を分割し分割レコード群を生成するステップと、
前記分割レコード群における各分割レコードに対し、前記リレーショナルデータベース管理システムにおいて格納可能なデータ型及び制約について分析を行い分析結果ファイル群を生成するステップと、
前記分析結果ファイル群を結合して前記リレーショナルデータベース管理システムで格納が可能なテーブル定義候補を生成するステップと、をコンピュータに実行させるもので、
前記区切り文字候補を検出するステップにおいて、前記区切り文字候補検出部が、前記レコード集合の行ごとに前記レコード集合に含まれるそれぞれの文字の出現回数を集計し、前記レコード集合に含まれる文字ごとに前記出現回数が一致している行の最大数の全行数に対する比率である出現回数一致率を算出し、前記出現回数一致率に基づいて前記区切り文字候補を決定する、制御プログラム。 A control program that supports table design for a relational database management system,
Detecting a delimiter candidate for dividing a record set provided by others,
Dividing the record set by the delimiter candidates to generate a divided record group;
Analyzing data types and constraints that can be stored in the relational database management system for each divided record in the divided record group, and generating an analysis result file group;
Combining the analysis result file group to generate a table definition candidate that can be stored in the relational database management system ;
In the step of detecting the delimiter candidate, the delimiter candidate detection unit counts the number of appearances of each character included in the record set for each row of the record set, and for each character included in the record set A control program that calculates an appearance frequency coincidence ratio that is a ratio of the maximum number of lines with the same appearance frequency to the total number of lines, and determines the delimiter candidate based on the appearance frequency coincidence ratio .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015161237A JP6613706B2 (en) | 2015-08-18 | 2015-08-18 | Table design support apparatus, table design support method, and control program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015161237A JP6613706B2 (en) | 2015-08-18 | 2015-08-18 | Table design support apparatus, table design support method, and control program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017041017A JP2017041017A (en) | 2017-02-23 |
JP6613706B2 true JP6613706B2 (en) | 2019-12-04 |
Family
ID=58203361
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015161237A Active JP6613706B2 (en) | 2015-08-18 | 2015-08-18 | Table design support apparatus, table design support method, and control program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6613706B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10664245B2 (en) * | 2018-02-01 | 2020-05-26 | Ricoh Company, Ltd. | Guided web-application generation |
JP7436005B2 (en) * | 2020-01-21 | 2024-02-21 | 日本電気通信システム株式会社 | Command conversion processing device, command conversion processing method, control program, and processing device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10143409A (en) * | 1996-11-12 | 1998-05-29 | Meidensha Corp | Data input device in document management system |
JP2002202987A (en) * | 2000-11-02 | 2002-07-19 | At System:Kk | Data management method |
CA2485423C (en) * | 2002-05-10 | 2013-10-08 | Oracle International Corporation | Storing and querying relational data in compressed storage format |
-
2015
- 2015-08-18 JP JP2015161237A patent/JP6613706B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2017041017A (en) | 2017-02-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210004361A1 (en) | Parser for Schema-Free Data Exchange Format | |
US10579661B2 (en) | System and method for machine learning and classifying data | |
US9053386B2 (en) | Method and apparatus of identifying similar images | |
US9639542B2 (en) | Dynamic mapping of extensible datasets to relational database schemas | |
US8645353B2 (en) | Anchor image identification for vertical video search | |
US8645354B2 (en) | Scalable metadata extraction for video search | |
US20150310129A1 (en) | Method of managing database, management computer and storage medium | |
CN104424258B (en) | Multidimensional data query method, query server, column storage server and system | |
US10002142B2 (en) | Method and apparatus for generating schema of non-relational database | |
US10783163B2 (en) | Instance-based distributed data recovery method and apparatus | |
US10248517B2 (en) | Computer-implemented method, information processing device, and recording medium | |
EP3929763B1 (en) | Database access methods and apparatuses | |
EP3217296A1 (en) | Data query method and apparatus | |
US9870394B2 (en) | Query routing method, query routing server performing the same and storage medium storing the same | |
US9881045B2 (en) | System and method for processing data | |
US20170228472A1 (en) | Approximate string matching optimization for a database | |
WO2019120093A1 (en) | Cardinality estimation in databases | |
Cheng et al. | Supporting entity search: a large-scale prototype search engine | |
JP6613706B2 (en) | Table design support apparatus, table design support method, and control program | |
US20180210907A1 (en) | Data management system, data management method, and computer program product | |
US8667008B2 (en) | Search request control apparatus and search request control method | |
CN110019341B (en) | Data query method and device | |
CN117216239A (en) | Text deduplication method, text deduplication device, computer equipment and storage medium | |
CN103455491A (en) | Method and device for classifying search terms | |
Yan et al. | Eliminating the redundancy in mapreduce-based entity resolution |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180705 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20190320 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20190326 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20190509 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20191008 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20191021 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6613706 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |