JP2004220283A - Extraction method, extraction device and computer program - Google Patents

Extraction method, extraction device and computer program Download PDF

Info

Publication number
JP2004220283A
JP2004220283A JP2003006316A JP2003006316A JP2004220283A JP 2004220283 A JP2004220283 A JP 2004220283A JP 2003006316 A JP2003006316 A JP 2003006316A JP 2003006316 A JP2003006316 A JP 2003006316A JP 2004220283 A JP2004220283 A JP 2004220283A
Authority
JP
Japan
Prior art keywords
data
record
key data
records
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003006316A
Other languages
Japanese (ja)
Inventor
Masahiko Nagata
真彦 永田
Masataku Matsuura
正卓 松浦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2003006316A priority Critical patent/JP2004220283A/en
Publication of JP2004220283A publication Critical patent/JP2004220283A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Time Recorders, Dirve Recorders, Access Control (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an extraction method, an extraction device and a computer program, reducing a time of a process for extracting a record including winning data from a database storing records including data on a selection number or the like of a number selection type public lottery wherein a purchaser selects a prescribed number of numerical numbers from a plurality of numerical numbers on the basis of key data on the winning number or the like. <P>SOLUTION: The respective different winning numbers are accepted as the key data (S1), a logic table 10b is produced (S2), and it is decided, about each the received key data, whether according data are included in the records stored in the database 10a or not (S5). When the according data are included about each the data, a true value is recorded into the logic table 10b corresponding to the corresponding key data (S6), and the record is extracted on the basis of the sum of the true values corresponding to the prescribed key data (S9). <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出方法、その方法を適用した抽出装置及びその装置を実現するためのコンピュータプログラムに関し、特に予め選択している数字を示すデータが、当選数字として決定されたキーデータと合致するか否かにより当選の等級を決定する数字選択式宝くじに関する抽出方法、抽出装置及びコンピュータプログラムに関する。
【0002】
【従来の技術】
1から43までの43の数字の中から任意の6の数字を購入者が選択する数字選択式宝くじが注目されている。
このような数字選択式宝くじにおいては、抽選により当選数字として6の本数字及び1の補助数字が決定され、購入者が選択した数字と当選数字との合致状況により当選した等級が決定される。
【0003】
具体的な等級の決定方法は以下の通りである。
選択した6の数字の全てが6の本数字と合致する場合を1等とする。
選択した6の数字の中の5の数字が本数字と合致し、残りの1の数字が補助数字と合致する場合を2等とする。
選択した6の数字の中の5の数字が本数字と合致し、残りの1の数字が補助数字と合致しない場合を3等とする。
選択した6の数字の中の4の数字が本数字と合致する場合を4等とする。
選択した6の数字の中の3の数字が本数字と合致する場合を5等とする。
選択した6の数字の中で本数字と合致する数字が2以下である場合を等外とする。
これらより選択した数字の組み合わせは、6096454通りであり、その中で1等は1通り、2等は6通り、3等は216通り、4等は9990通り、そして5等が155400通りとなる。
【0004】
宝くじを管理する側においては、購入者が選択した数字がデータとしてレコード単位で記録されており、各レコードには購入者が選択した6の数字の他、購入日付、購入時刻、購入店舗、口数及び継続回数等の様々な属性情報が含まれている。
抽選処理はデータベースから当選数字である所定の数字を含むレコードを抽出するSQL(Structure Query Language)命令により行われる。
以下にレコードを記録しているデータベースの名称がdatabase、当選数字の本数字がx1,x2,x3,x4,x5,x6 、そして当選数字の補助数字がx7である場合の各等級の抽選処理のためのSQL命令を示す。
【0005】
1等の抽選処理は、記録されている6の数字が本数字と合致するレコードを抽出するので、
select * from database where a=x1 and b=x2 and c=x3 and d=x4 and e=x5 and f=x6
の1の命令を実行することにより行われる。
【0006】
2等の抽選処理は、記録されている6の数字の中の5の数字が本数字と合致し、残りの1の数字が補助数字と合致するレコードを抽出するので、
select * from database where a=x1 and b=x2 and c=x3 and d=x4 and e=x5 and f=x7
select * from database where a=x1 and b=x2 and c=x3 and d=x4 and e=x7 and f=x6

select * from database where a=x7 and b=x2 and c=x3 and d=x4 and e=x5 and f=x6
の6の命令を実行することにより行われる。
【0007】
3等の抽選処理は、記録されている6の数字の中の5の数字が本数字と合致し、残りの1の数字が補助数字と合致しないレコードを抽出するので、
select * from database where a=x1 and b=x2 and c=x3 and d=x4 and e=x5 and f<>x6 and f<>x7
select * from database where a=x1 and b=x2 and c=x3 and d=x4 and e<>x5 and e<>x7 f=x6

select * from database where a<>x1 and a<>x7 and b=x2 and c=x3 and d=x4 and e=x5 and f=x6
の36の命令を実行することにより行われる。
【0008】
4等の抽選処理は、記録されている6の数字の中の4の数字が本数字と合致するレコードを抽出するので、
select * from database where a=x1 and b=x2 and c=x3 and d=x4 and e<>x5 and f<>x6

の225通りの命令を実行することにより行われる。
【0009】
5等の抽選処理は、記録されている6の数字の中の3の数字が本数字と合致するレコードを抽出するので、
select * from database where a=x1 and b=x2 and c=x3 and d<>x4 and e<>x5 and f<>x6

の400の命令を実行することにより行われる。
これら全ての抽選処理を行うため合計668回の命令を実行し、668回データベースを走査しなければならない。
【0010】
また宝くじを管理する側においては、各購入者が選択した数字を購入店舗等の属性情報と対応付けたレコードとして記録してあるデータベースから、賞金額の決定及び属性情報の集計等の処理を目的として等級別にレコードを抽出する処理をも行う。
この様な場合も同様に668回のSQL命令の実行が必要となる。
なお検索対象から検索パターンを検索する従来の技術として、Aho−Corasick(AC)法、Expanded−Boyer−Moore(EBM)法又はShinohara−Arikawa(SA)法を用いて検索し、抽出する技術がある(例えば特許文献1参照。)。
【0011】
【特許文献1】
特開2002−222194号公報
【0012】
【発明が解決しようとする課題】
しかしながら従来の抽出方法では、命令を実行すべき回数が多く処理に多大な時間を要するという問題があり、これはデータの保守性及び運用性を損ねるという問題にも繋がる。
なお具体的な数字として現在この種の数字選択式宝くじでは、当選レコード抽出処理の場合で875万件のレコードが記録されているデータベースから所定の条件に合致するレコードを抽出する処理が必要であり、この抽出処理に20時間程度の時間を要している。
【0013】
本発明は斯かる事情に鑑みてなされたものであり、当選数字を受け付け、受け付けた当選数字の夫々に対して、合致する数字がレコードに含まれているか否かを判定し、合致すると判定した数字の個数に基づいてレコードを抽出することにより、命令の実行回数を少なくしレコードの抽出処理に要する時間を短縮する抽出方法、その方法を適用した抽出装置及びその装置を実現するためのコンピュータプログラムの提供を目的とする。
【0014】
【課題を解決するための手段】
第1発明に係る抽出方法は、夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出装置を用いた抽出方法において、前記抽出装置は、夫々異なる複数のキーデータを受け付け、受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定し、合致すると判定したデータの個数に基づいてレコードを抽出することを特徴とする。
【0015】
第1発明に係る抽出方法では、複数の数字の中から所定個の数字を購入者が選択する数字選択式宝くじの選択数字等のデータを含むレコードを記録したデータベースから、当選数字等のキーデータに基づいて当選したデータを含むレコードを抽出する場合に、レコードに含まれるデータに合致するキーデータの個数に基づく等級から抽出の要否を判定しレコードを抽出することにより、データベースの走査が1回で良いので、等級毎にキーデータの組み合わせを決定し、決定した組み合わせに合致するレコードをデータベースから抽出する方法の様に何度も抽出命令を実行し何度もデータベースを走査する方法と比べて、処理時間が短くデータの保守性及び運用性を向上させることが可能である。
【0016】
第2発明に係る抽出装置は、夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出装置において、夫々異なる複数のキーデータを受け付ける手段と、受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定する手段と、合致すると判定したデータの個数に基づいてレコードを抽出する手段とを備えることを特徴とする。
【0017】
第2発明に係る抽出装置では、複数の数字の中から所定個の数字を購入者が選択する数字選択式宝くじの選択数字等のデータを含むレコードを記録したデータベースから、当選数字等のキーデータに基づいて当選したデータを含むレコードを抽出する場合に、レコードに含まれるデータに合致するキーデータの個数に基づく等級から抽出の要否を判定し、レコードを抽出することにより、データベースの走査が1回で良いので、等級毎にキーデータの組み合わせを決定し、決定した組み合わせに合致するレコードをデータベースから抽出する方法の様に何度も抽出命令を実行し何度もデータベースを走査する方法と比べて、処理時間が短くデータの保守性及び運用性を向上させることが可能である。
【0018】
第3発明に係る抽出装置は、夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出装置において、夫々異なる複数のキーデータを受け付ける手段と、受け付けた各キーデータに対応する真偽値を夫々記録する論理テーブルを作成する手段と、受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定する手段と、キーデータに合致するデータがレコードに含まれていると判定した場合に、当該キーデータに対応する論理テーブルの記録領域に真値を記録する手段と、所定のキーデータに対応する真値の和を算出する手段と、算出した和に基づいてレコードを抽出する手段とを備えることを特徴とする。
【0019】
第3発明に係る抽出装置では、複数の数字の中から所定個の数字を購入者が選択する数字選択式宝くじの選択数字等のデータを含むレコードを記録したデータベースから、当選数字等のキーデータに基づいて当選したデータを含むレコードを抽出する場合で、キーデータに合致するデータがレコードに含まれているときに、当該キーデータに対応付ける真偽値として真値、例えば「1」を記録し、キーデータに対応付けた真値の和に基づいて等級、例えば真値の和が「6」であれば1等とし、「4」であれば4等と判定し、判定した等級に基づいてレコードを抽出することにより、データベースの走査が1回で良いので、等級毎にキーデータの組み合わせを決定し、決定した組み合わせに合致するレコードをデータベースから抽出する方法の様に何度も抽出命令を実行し何度もデータベースを走査する方法と比べて、処理時間が短くデータの保守性及び運用性を向上させることが可能である。
【0020】
第4発明に係る抽出装置は、第3発明において、前記レコードを抽出する手段は、前記所定のキーデータと異なる他の所定のキーデータの真値、及び算出した和に基づいてレコードを抽出すべくなしてあることを特徴とする。
【0021】
第4発明に係る抽出装置では、当選数字であるキーデータが、本数字である所定のキーデータと補助数字(ボーナス数字)である他の所定のキーデータとに分類される場合に、所定のキーデータに対応する真値の和と他の所定のキーデータの真偽値に基づいて、例えば所定のキーデータに対応する真値の和が「5」で他の所定のキーデータの真偽値が「1」である場合に2等と判定してレコードを抽出することにより、様々な組み合わせにより決定される等級に対応することが可能である。
【0022】
第5発明に係るコンピュータプログラムは、夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを、コンピュータに抽出させるコンピュータプログラムにおいて、コンピュータに、夫々異なるキーデータを受け付けた場合に、受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定させる手順と、コンピュータに、合致すると判定したデータの個数に基づいてレコードを抽出させる手順とを実行させることを特徴とする。
【0023】
第5発明に係るコンピュータプログラムは、汎用型コンピュータ等のコンピュータにて実行することで、コンピュータが抽出装置として動作し、複数の数字の中から所定個の数字を購入者が選択する数字選択式宝くじの選択数字等のデータを含むレコードを記録したデータベースから、当選数字等のキーデータに基づいて当選したデータを含むレコードを抽出する場合に、レコードに含まれるデータに合致するキーデータの個数に基づく等級から抽出の要否を判定し、レコードを抽出することにより、データベースの走査が1回で良いので、等級毎にキーデータの組み合わせを決定し、決定した組み合わせに合致するレコードをデータベースから抽出する方法の様に何度も抽出命令を実行し何度もデータベースを走査する方法と比べて、処理時間が短くデータの保守性及び運用性を向上させることが可能である。
【0024】
【発明の実施の形態】
以下、本発明をその実施の形態を示す図面に基づいて詳述する。
図1は本発明の抽出装置の構成を示すブロック図である。
図1中10は汎用型コンピュータを用いた本発明の抽出装置であり、抽出装置10は、1から43までの43の数字の中から任意の6の数字を購入者が選択する数字選択式宝くじのデータ管理に用いられ、購入者が選択した選択数字をデータとして含むレコードを記録するデータベースから、当選したレコードを抽出する抽出処理を行う。
【0025】
このような数字選択式宝くじにおいては、抽選により当選数字として6の本数字及び1の補助数字(ボーナス数字)が決定され、購入者が選択した選択数字と当選数字との合致状況により当選した等級が決定される。
なお具体的な等級の決定方法は以下の通りである。
6の選択数字の全てが6の本数字と合致する場合を1等とする。
6の選択数字の中の5の数字が本数字と合致し、残りの1の選択数字が補助数字と合致する場合を2等とする。
6の選択数字の中の5の数字が本数字と合致し、残りの1の選択数字が補助数字と合致しない場合を3等とする。
6の選択数字の中の4の数字が本数字と合致する場合を4等とする。
6の選択数字の中の3の数字が本数字と合致する場合を5等とする。
6の選択数字の中で本数字と合致する数字が2以下である場合を等外とする。
【0026】
抽出装置10は、装置全体を制御するCPU11、本発明のコンピュータプログラムPG及びデータ等の各種情報を記録したCD−ROM等の記録媒体RECから各種情報を読み取るCD−ROMドライブ等の補助記憶手段12、補助記憶手段12により読み取られたコンピュータプログラムPG及びデータ等の各種情報を記録するハードディスク等の記録手段13、各種処理に用いられる情報を一時的に記憶するRAM14、マウス及びキーボード等の入力手段15、並びにモニタ及びプリンタ等の出力手段16を備えている。
そして記録手段13から本発明のコンピュータプログラムPG及びデータ等の各種情報を読み取り、RAM14に記憶させてコンピュータプログラムPGに含まれる各種手順をCPU11により実行することで、汎用型コンピュータは本発明の抽出装置10として動作する。
【0027】
記録手段13の記録領域の一部は、購入者が選択した夫々異なる選択数字をデータとして含むレコードを記録するデータベース10aとして用いられる。
なお記録手段13の記録領域の一部をデータベース10aとして用いるのではなく抽出装置10に記録手段を備える他の装置を接続し、他の装置が備える記録手段の記録領域の一部をデータベース10aとして用いるようにしても良い。
また記録手段13及び/又はRAM14の記録領域の一部には購入者が選択した数字の等級判定に用いられる論理的な状態遷移テーブル(オートマトン)である論理テーブル10bが作成される。
【0028】
図2は本発明の抽出装置10が備えるデータベース10aの記録内容を概念的に示す説明図である。
データベース10aには、購入者が選択した数字がデータとしてレコード単位で記録されており、各レコードには、レコードを識別するID及びX1〜X6として示される購入者が選択した6の数字の他、購入日付、購入時刻、購入店舗、口数及び継続回数等の様々な属性情報が含まれている。
【0029】
図3は本発明の抽出装置10に作成される論理テーブル10bの記録内容を概念的に示す説明図である。
論理テーブル10bには、テーブル内のレコードを識別するID、夫々異なる当選数字又は論理式、並びに真偽値又は出力先が記録されている。
【0030】
IDがZ1〜Z7であるレコードには当選数字及び真偽値が記録される。
Z1〜Z6には、昇順に割り当てられた当選数字中の各本数字A1〜A6が対応付けられ、Z6には補助数字A7が対応付けられている。
例えば当選数字中の本数字が08、09、11、27、37及び39であり、補助数字が18である場合、A1に08、A2に09、A3に11、A4に27、A5に37、そしてA6に39が割り当てられ、A7に18が割り当てられる。
Z1〜Z7であるレコードに記録される真偽値とは、購入者が選択した選択数字と合致するか否かを示すフラグであり、購入者が選択した選択数字のいずれかに当選数字が合致する場合、当該当選数字が記録されたレコードの真偽値には真値を示す「1」が記録され、選択数字のいずれにも当選数字が合致しない場合、当該当選数字が記録されたレコードの真偽値には偽値を示す「0」が記録される。
【0031】
IDがZ8〜Z13であるレコードには、論理式及び出力先が記録される。
論理式は当選した等級を判定する式であり、出力先とは等級が判定された、データベース10aに記録されているレコードに含まれるデータの出力先である。
Z8であるレコードには論理式として下記の式1が記録されている。
【0032】
Z1+Z2+Z3+Z4+Z5+Z6=6 …式1
【0033】
式1はZ1〜Z6の真偽値の合計が6であることを示しており、これはZ1〜Z6に対応する真偽値が全て真値を示す「1」であり、購入者が選択した6の選択数字が全て当選数字中の本数字に合致する状況、即ち1等であることを示している。
そして1等に該当するレコードに含まれるデータは、例えば記録手段13内に形成されるFile1に出力されることを示している。
【0034】
Z7であるレコードには論理式として下記の式2が記録されている。
【0035】
(Z1+Z2+Z3+Z4+Z5+Z6=5)AND(Z7) …式2
【0036】
式2はZ1〜Z6の真偽値の合計が5であり、しかもZ7が真値を取ることを示しており、これは購入者が選択した6の選択数字中で5の選択数字が当選数字中の本数字に合致し、選択数字中の1の選択数字が当選数字中の補助数字に合致する状況、即ち2等であることを示している。
そして2等に該当するレコードに含まれるデータは、例えば記録手段13内に記録されるFile2に出力されることを示している。
【0037】
Z9であるレコードには論理式として下記の式3が記録されている。
【0038】
(Z1+Z2+Z3+Z4+Z5+Z6=5)AND(Not Z7)…式3
【0039】
式3はZ1〜Z6の真偽値の合計が5であり、しかもZ7が偽値を取ることを示しており、これは購入者が選択した6の選択数字中で5の選択数字が当選数字中の本数字に合致し、当選数字中の補助数字には合致しない状況、即ち3等であることを示している。
そして3等に該当するレコードに含まれるデータは、例えば記録手段13内に形成されるFile3に出力されることを示している。
【0040】
Z10であるレコードには論理式として下記の式4が記録されている。
【0041】
Z1+Z2+Z3+Z4+Z5+Z6=4 …式4
【0042】
式4はZ1〜Z6の真偽値の合計が4であることを示しており、これは購入者が選択した6の選択数字中で4の選択数字が当選数字中の本数字に合致する状況、即ち4等であることを示している。
そして4等に該当するレコードに含まれるデータは、例えば記録手段13内に形成されるFile4に出力されることを示している。
【0043】
Z11であるレコードには論理式として下記の式5が記録されている。
【0044】
Z1+Z2+Z3+Z4+Z5+Z6=3 …式5
【0045】
式5はZ1〜Z6の真偽値の合計が3であることを示しており、これは購入者が選択した6の選択数字中で3の選択数字が当選数字の本数字に合致する状況、即ち5等であることを示している。
そして5等に該当するレコードに含まれるデータは、例えば記録手段13内に形成されるFile5に出力されることを示している。
【0046】
Z12であるレコードには論理式として下記の式6が記録されている。
【0047】
Z1+Z2+Z3+Z4+Z5+Z6<3 …式6
【0048】
式6はZ1〜Z6の真偽値の合計が3未満であることを示しており、購入者が選択した6の選択数字中で当選数字の本数字に合致する選択数字が3未満である状況、即ち等外であることを示している。
そして等外に該当するレコードに含まれるデータは、例えば記録手段13内に形成されるFile0に出力されることを示している。
【0049】
次に本発明の抽出装置10の処理について説明する。
図4は本発明の抽出装置10の処理を示すフローチャートである。
抽出装置10を操作する担当者は、データベース10aに記録されているレコードの中から各等級に当選しているレコードを抽出する処理を行う場合、レコードが記録されているデータベース10aを指定し、抽選により決定された当選数字を示すキーデータとして本数字及び補助数字を抽出装置10に入力する。
【0050】
抽出装置10は、RAM14に記憶させたコンピュータプログラムPGを実行するCPU11の制御により、入力手段15から入力された6の夫々異なる本数字及び1の補助数字を、当選数字を示すキーデータとして受け付け(ステップS1)、論理テーブル10bを記録手段13及び/又はRAM14に作成し(ステップS2)、受け付けた当選数字を示すキーデータを論理テーブル10bに記録する(ステップS3)。
このとき本数字として入力されたキーデータは昇順に並び替えられ、小さい数字から順にA1、A2、A3、A4、A5及びA6に割り当てられる。
また補助数字として入力されたキーデータは、A7に割り当てられる。
【0051】
そして抽出装置10では、RAM14に記憶させたコンピュータプログラムPGを実行するCPU11の制御により、データベース10aに記録されているレコードを読み取り(ステップS4)、ステップS1にて受け付けステップS3にて論理テーブル10bに記録されたキーデータの夫々に対して、合致するデータを示す数字が読み取ったレコードに含まれているか否かを判定する(ステップS5)。
なお合致の判定は、Aho−Corasick(AC)法、Expanded−Boyer−Moore(EBM)法及びShinohara−Arikawa(SA)法等の公知の検索技術を用いることにより行われる。
抽出装置10では、RAM14に記憶させたコンピュータプログラムPGを実行するCPU11の制御により、各キーデータに対して合致するデータが読み取ったレコードに含まれていると判定した場合に真値である「1」を、そして合致するデータが読み取ったレコードに含まれていないと判定した場合に偽値である「0」を当該キーデータに対応する論理テーブル10bの記録領域に記録する(ステップS6)。
例えばキーデータが割り当てられたA1、A2、A4及びA7に合致するデータが読み取ったレコードに含まれている場合、A1、A2、A4及びA7に対応する真偽値の記録領域には真値を示す「1」が記録され、A3、A5及びA6に対応する真偽値の記録領域には偽値を示す「0」が記録される。
【0052】
抽出装置10では、RAM14に記憶させたコンピュータプログラムPGを実行するCPU11の制御により、前述した式1〜式6に基づいて所定のキーデータ、ここでは本数字が割り当てられたA1〜A6に対応する真偽値の和、実質的には真値の和を算出し(ステップS7)、算出した和及び他の所定のキーデータ、ここでは補助数字が割り当てられたA7に対応する真偽値に基づいて当該レコードに含まれるデータの等級を判定し(ステップS8)、判定した等級に基づいてレコードを抽出し(ステップS9)、等級に対応する出力先に出力する(ステップS10)。
ステップS8に示す判定とは、本数字の真値の和及び補助数字の真偽値に基づいて式1〜式6のいずれに合致するかを判定することをいう。
ステップS7〜ステップS9に示すように、本発明の抽出処理はキーデータに合致すると判定したデータの個数に基づいてレコードを抽出する処理を行っているということができる。
またステップS10の出力とは、ステップS8にて合致すると判定された式に対応する出力先のファイル、具体的には出力先として示されているFile1,File2,File3,File4,File5及びFile0等の名称のファイルとしてレコードに含まれるデータを記録手段13に記録し、かつ出力手段16から出力することをいう。
【0053】
そして抽出装置10では、RAM14に記憶させたコンピュータプログラムPGを実行するCPU11の制御により、データベース10aに記録されているレコードの中で読み取っていないレコードの有無を判定し(ステップS11)、読み取っていないレコードが有ると判定した場合(ステップS11:YES)、ステップS4に戻り、以降の処理を繰り返す。
なおこのとき論理テーブル10bに記録された真偽値は初期化される。
【0054】
ステップS11において、読み取っていないレコードが無いと判定した場合(ステップS11:NO)、全てのレコードに対して抽出処理は完了したとして処理を終了する。
このようにしてデータベース10aに記録されているレコードに含まれるデータの抽選処理及び当選した等級別のレコードにデータとして記録される属性情報の集計処理等の各種処理が行われる。
【0055】
なお上述した本発明の抽出方法により、875万件のレコードが記録されているデータベース10aから所定の条件に合致するレコードを抽出するという処理を行った場合の時間をシミュレーションテスト及び計算から算出したところ理論的には13分で処理が完了することが判明した。
これは従来の等級毎にキーデータの組み合わせを決定し、決定した組み合わせに合致するレコードをデータベース10aから抽出する方法が20時間であったことと比較して飛躍的に時間を短縮することが可能であることを示している。
【0056】
前記実施の形態では、汎用コンピュータを用いた抽出装置10を単独で稼動させる形態を示したが、本発明はこれに限らず、サーバコンピュータを用いた抽出装置10にクライアントコンピュータを接続し、クライアントコンピュータにて入力されたキーデータを抽出装置10へ送信し、抽出装置10にて送信された情報を受け付けて処理を行い、その結果をクライアントコンピュータへ出力する形態でも良い。
また本発明は、数字選択式宝くじの集計に限らず、様々な検索処理に適用することが可能であり、またその場合、データ及びキーデータとして文字列を用いることも可能である。
【0057】
(付記1)夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出装置を用いた抽出方法において、前記抽出装置は、夫々異なる複数のキーデータを受け付け、受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定し、合致すると判定したデータの個数に基づいてレコードを抽出することを特徴とする抽出方法。
(付記2)夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出装置において、夫々異なる複数のキーデータを受け付ける手段と、受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定する手段と、合致すると判定したデータの個数に基づいてレコードを抽出する手段とを備えることを特徴とする抽出装置。
(付記3)夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出装置において、夫々異なる複数のキーデータを受け付ける手段と、受け付けた各キーデータに対応する真偽値を夫々記録する論理テーブルを作成する手段と、受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定する手段と、キーデータに合致するデータがレコードに含まれていると判定した場合に、当該キーデータに対応する論理テーブルの記録領域に真値を記録する手段と、所定のキーデータに対応する真値の和を算出する手段と、算出した和に基づいてレコードを抽出する手段とを備えることを特徴とする抽出装置。
(付記4)前記レコードを抽出する手段は、前記所定のキーデータと異なる他の所定のキーデータの真値、及び算出した和に基づいてレコードを抽出すべくなしてあることを特徴とする付記3に記載の抽出装置。
(付記5)前記データ及びキーデータは数字であることを特徴とする付記2乃至付記4のいずれかに記載の抽出装置。
(付記6)夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを、コンピュータに抽出させるコンピュータプログラムにおいて、コンピュータに、夫々異なるキーデータを受け付けた場合に、受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定させる手順と、コンピュータに、合致すると判定したデータの個数に基づいてレコードを抽出させる手順とを実行させることを特徴とするコンピュータプログラム。
【0058】
【発明の効果】
以上詳述した如く本発明に係る抽出方法、抽出装置及びコンピュータプログラムでは、複数の数字の中から所定個の数字を購入者が選択する数字選択式宝くじの選択数字等のデータを含むレコードを記録したデータベースから、当選数字等のキーデータに基づいて当選したデータを含むレコードを抽出する場合で、キーデータに合致するデータがレコードに含まれているときに、当該キーデータに対応付ける真偽値として真値、例えば「1」を記録し、キーデータに対応付けた真値の和に基づいて等級、例えば真値の和が「6」であれば1等とし、「4」であれば4等と判定し、判定した等級に基づいてレコードを抽出することにより、等級毎にキーデータの組み合わせを決定し、決定した組み合わせに合致するレコードをデータベースから抽出する方法と比べて抽出命令を実行する回数が削減されるので処理時間を短縮し、データの保守性及び運用性を向上させることが可能である等、優れた効果を奏する。
【図面の簡単な説明】
【図1】図1は本発明の抽出装置の構成を示すブロック図である。
【図2】本発明の抽出装置が備えるデータベースの記録内容を概念的に示す説明図である。
【図3】本発明の抽出装置に作成される論理テーブルの記録内容を概念的に示す説明図である。
【図4】本発明の抽出装置の処理を示すフローチャートである。
【符号の説明】
10 抽出装置
11 CPU
12 補助記憶手段
13 記録手段
14 RAM
15 入力手段
16 出力手段
10a データベース
10b 論理テーブル
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an extraction method for extracting records meeting predetermined conditions from a database that records records each including a plurality of different data, an extraction apparatus to which the method is applied, and a computer program for realizing the apparatus. The present invention relates to an extraction method, an extraction device, and a computer program related to a number-selectable lottery that determines a winning class based on whether data indicating a number selected in advance matches key data determined as a winning number.
[0002]
[Prior art]
Attention has been paid to a number selection type lottery in which a purchaser selects an arbitrary number 6 from 43 numbers 1 to 43.
In such a number selection type lottery, six lottery numbers and one supplementary number are determined as winning numbers by lottery, and the winning class is determined based on the matching status between the number selected by the purchaser and the winning numbers.
[0003]
The specific method of determining the grade is as follows.
A case where all of the selected six numbers match the six real numbers is defined as 1 and so on.
A case where the numeral 5 of the selected numeral 6 matches the actual numeral and the remaining numeral 1 coincides with the supplementary numeral is defined as 2 and the like.
A case where the numeral 5 of the selected 6 numerals matches the actual numeral and the remaining 1 numeral does not coincide with the supplementary numeral is defined as 3 or the like.
A case where the numeral 4 of the selected numeral 6 matches the actual numeral is defined as 4 or the like.
A case where the numeral 3 of the selected numeral 6 matches the actual numeral is defined as 5 or the like.
A case where the number that matches the present number among the selected six numbers is 2 or less is regarded as non-equal.
The combination of numbers selected from these is 6,096,454, of which 1 is 1 such, 2 etc. is 6, 3rd etc. is 216, 4 etc. is 9990, and 5 etc. is 155,400.
[0004]
On the side of managing the lottery, the number selected by the purchaser is recorded as data on a record-by-record basis, and in each record, in addition to the six numbers selected by the purchaser, purchase date, purchase time, purchase store, number of units And various attribute information such as the number of continuations.
The lottery process is performed by an SQL (Structure Query Language) instruction for extracting a record including a predetermined number that is a winning number from the database.
Below, the name of the database that records the record is database, the winning numbers are x1, x2, x3, x4, x5, x6, and the auxiliary numbers of the winning numbers are x7. An SQL instruction for execution is shown below.
[0005]
In the lottery processing such as 1 etc., a record in which the recorded number 6 matches the actual number is extracted.
select * from database where a = x1 and b = x2 and c = x3 and d = x4 and e = x5 and f = x6
This is performed by executing one of the following instructions.
[0006]
The lottery process of 2 etc. extracts a record in which 5 of the recorded 6 numbers match the real number and the remaining 1 number matches the auxiliary number.
select * from database where a = x1 and b = x2 and c = x3 and d = x4 and e = x5 and f = x7
select * from database where a = x1 and b = x2 and c = x3 and d = x4 and e = x7 and f = x6

select * from database where a = x7 and b = x2 and c = x3 and d = x4 and e = x5 and f = x6
This is performed by executing the instruction of (6).
[0007]
The lottery process of 3 etc. extracts a record in which 5 of the recorded 6 numbers match the real number and the remaining 1 number does not match the supplementary number.
select * from database where a = x1 and b = x2 and c = x3 and d = x4 and e = x5 and f << x6 and f << x7
select * from database where a = x1 and b = x2 and c = x3 and d = x4 and e <> x5 and e <> x7 f = x6

select * from database where a <> x1 and a <> x7 and b = x2 and c = x3 and d = x4 and e = x5 and f = x6
This is performed by executing the 36 instructions.
[0008]
In the lottery process such as 4, a record in which the numeral 4 of the recorded numeral 6 matches the actual numeral is extracted.
select * from database where a = x1 and b = x2 and c = x3 and d = x4 and e <> x5 and f <> x6

225 instructions are executed.
[0009]
In the lottery process such as 5, a record in which the numeral 3 out of the recorded numeral 6 matches the actual numeral is extracted.
select * from database where a = x1 and b = x2 and c = x3 and d <> x4 and e <> x5 and f <> x6

By executing the 400 instructions.
In order to perform all these lottery processes, a total of 668 instructions must be executed and the database must be scanned 668 times.
[0010]
In addition, the lottery management side aims to determine the award amount and collect attribute information from a database in which the number selected by each purchaser is recorded as a record in association with attribute information such as the store of purchase. The process of extracting records by grade is also performed.
In such a case, the execution of the SQL instruction 668 times is similarly required.
As a conventional technique for searching for a search pattern from a search target, there is a technique for searching and extracting using an Aho-Corasick (AC) method, an Expanded-Boyer-Moore (EBM) method, or a Shinohara-Arikawa (SA) method. (For example, see Patent Document 1).
[0011]
[Patent Document 1]
JP-A-2002-222194
[0012]
[Problems to be solved by the invention]
However, the conventional extraction method has a problem that the number of times an instruction must be executed is large and a large amount of time is required for processing, which leads to a problem that data maintainability and operability are impaired.
As a specific number, in the present type of number selection type lottery, it is necessary to perform a process of extracting a record meeting predetermined conditions from a database in which 8.75 million records are recorded in the case of the winning record extraction process. This extraction process takes about 20 hours.
[0013]
The present invention has been made in view of such circumstances, accepts winning numbers, determines whether or not each of the received winning numbers includes a matching number in a record, and determines that they match. An extraction method for reducing the number of instruction executions and the time required for record extraction processing by extracting records based on the number of numbers, an extraction device to which the method is applied, and a computer program for realizing the device The purpose is to provide.
[0014]
[Means for Solving the Problems]
An extraction method according to a first aspect of the present invention is an extraction method using an extraction device that extracts a record that meets a predetermined condition from a database that records records each including a plurality of different data. Key data is received, and for each of the received key data, it is determined whether or not matching data is included in a record, and records are extracted based on the number of data determined to match. .
[0015]
In the extraction method according to the first invention, key data such as winning numbers are read from a database that records data including data such as selected numbers of a number selection type lottery in which a purchaser selects a predetermined number from a plurality of numbers. When extracting a record including data that has been won based on the data, it is necessary to determine whether or not extraction is necessary based on the grade based on the number of key data that matches the data included in the record, and extract the record. It is possible to determine the combination of key data for each class and execute the extraction command many times like the method of extracting records matching the determined combination from the database and scan the database many times. Thus, the processing time is short, and the maintainability and operability of data can be improved.
[0016]
An extraction device according to a second aspect of the present invention is an extraction device for extracting a record that meets a predetermined condition from a database that records a record including a plurality of different data. For each of the data, there is provided a means for determining whether or not matching data is included in a record, and a means for extracting a record based on the number of data determined to match.
[0017]
In the extraction device according to the second aspect of the present invention, the key data of the winning numbers and the like are stored in a database that stores records including data such as the selected numbers of a number-selectable lottery where the purchaser selects a predetermined number from a plurality of numbers. When extracting records containing data that was won based on the data, it is necessary to determine whether or not extraction is necessary based on the grade based on the number of key data that matches the data included in the records. A method of determining the combination of key data for each class and executing the extraction command many times as in the method of extracting a record matching the determined combination from the database, and scanning the database many times. In comparison, the processing time is short, and the maintainability and operability of data can be improved.
[0018]
An extraction device according to a third aspect of the present invention is an extraction device for extracting a record that meets a predetermined condition from a database that records records each including a plurality of different data, and a unit that receives a plurality of different key data. Means for creating a logical table for recording each of the truth values corresponding to the key data, means for determining whether or not matching data is included in the record for each of the received key data, Means for recording the true value in the recording area of the logical table corresponding to the key data when it is determined that the data matching the record is included in the record, and calculating the sum of the true values corresponding to the predetermined key data And a means for extracting a record based on the calculated sum.
[0019]
In the extraction device according to the third invention, key data such as winning numbers are stored in a database that stores records including data such as selected numbers of a number selection type lottery in which a purchaser selects a predetermined number from a plurality of numbers. In the case of extracting a record including the winning data based on the key data, when data matching the key data is included in the record, a true value, for example, “1” is recorded as a boolean value corresponding to the key data. , Based on the sum of the true values associated with the key data, for example, if the sum of the true values is "6", it is determined to be 1 or the like, and if it is "4", it is determined to be 4 or the like, and based on the determined grade By extracting records, only one scan of the database is required, so that a combination of key data is determined for each class, and a record matching the determined combination is extracted from the database. Compared with the method also scanned many times database running extract command many times, it is possible processing time to improve the maintainability and operability of short data.
[0020]
In the extracting device according to a fourth aspect, in the third aspect, the means for extracting the record extracts the record based on a true value of another predetermined key data different from the predetermined key data and a calculated sum. It is characterized by what it does.
[0021]
In the extraction device according to the fourth invention, when the key data as the winning numeral is classified into the predetermined key data as the actual numeral and another predetermined key data as the auxiliary numeral (bonus numeral), Based on the sum of the true values corresponding to the key data and the true / false values of the other predetermined key data, for example, the sum of the true values corresponding to the predetermined key data is “5” and the true / false of the other predetermined key data is determined. When the value is “1”, it is possible to correspond to a grade determined by various combinations by judging it as 2 and extracting a record.
[0022]
A computer program according to a fifth aspect of the present invention is a computer program that causes a computer to extract a record that meets a predetermined condition from a database that records a plurality of different records each containing a plurality of data. A procedure for determining whether or not a record includes matching data for each of the received key data, and a procedure for causing a computer to extract records based on the number of data determined to match. It is characterized by being executed.
[0023]
The computer program according to the fifth invention is executed by a computer such as a general-purpose computer, whereby the computer operates as an extracting device, and a number-selection-type lottery in which a purchaser selects a predetermined number from a plurality of numbers. When extracting a record containing data that was won based on key data such as winning numbers from a database that records records containing data such as selected numbers, the number of key data that matches the data contained in the record is extracted. By judging the necessity of extraction from the grades and extracting records, the database needs to be scanned only once. Therefore, a combination of key data is determined for each grade, and a record matching the determined combination is extracted from the database. Compared to the method of executing the extraction instruction many times and scanning the database many times like the method, processing While it is possible to improve the maintainability and operability of short data.
[0024]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, the present invention will be described in detail with reference to the drawings showing the embodiments.
FIG. 1 is a block diagram showing the configuration of the extraction device of the present invention.
In FIG. 1, reference numeral 10 denotes an extraction device of the present invention using a general-purpose computer. The extraction device 10 is a number-selection-type lottery in which a purchaser selects an arbitrary number 6 from 43 numbers 1 to 43. And performs an extraction process of extracting a winning record from a database that records records containing data selected by the purchaser as data.
[0025]
In such a lottery of the number-selection type, a lottery determines six real numbers and one supplementary number (bonus number) as a winning number, and the winning class is determined based on the matching status between the selected number selected by the buyer and the winning number. Is determined.
The specific method of determining the grade is as follows.
A case where all of the 6 selected numbers match the 6 real numbers is defined as 1 and so on.
The case where the numeral 5 out of the 6 selected numerals matches the actual numeral, and the case where the remaining 1 selected numeral matches the supplementary numeral is defined as 2 and so on.
A case where the numeral 5 out of the 6 selected numerals matches the actual numeral, and the case where the remaining 1 selected numeral does not match the supplementary numeral is defined as 3 or the like.
A case where the numeral 4 of the 6 selected numerals matches the actual numeral is defined as 4 or the like.
A case where the numeral 3 of the 6 selected numerals matches the actual numeral is assumed to be 5 or the like.
The case where the number that matches this number in the selected numbers of 6 is 2 or less is regarded as non-equal.
[0026]
The extraction device 10 includes a CPU 11 that controls the entire device, an auxiliary storage unit 12 such as a CD-ROM drive that reads various information from a recording medium REC such as a CD-ROM that records various information such as the computer program PG of the present invention and data. A recording unit 13 such as a hard disk for recording various information such as a computer program PG and data read by the auxiliary storage unit 12, a RAM 14 for temporarily storing information used for various processes, and an input unit 15 such as a mouse and a keyboard. And output means 16 such as a monitor and a printer.
Then, the computer program PG of the present invention and various kinds of information such as data are read from the recording means 13 and stored in the RAM 14 to execute various procedures included in the computer program PG by the CPU 11, whereby the general-purpose computer is provided with the extracting device of the present invention It operates as 10.
[0027]
A part of the recording area of the recording means 13 is used as a database 10a for recording a record including, as data, different selection numerals selected by the purchaser.
Note that, instead of using a part of the recording area of the recording means 13 as the database 10a, another device having a recording means is connected to the extraction device 10, and a part of the recording area of the recording means provided in the other device is used as the database 10a. It may be used.
In addition, a logical table 10b, which is a logical state transition table (automaton) used for determining the grade of the number selected by the purchaser, is created in a part of the recording area of the recording unit 13 and / or the RAM 14.
[0028]
FIG. 2 is an explanatory diagram conceptually showing the recorded contents of the database 10a provided in the extraction device 10 of the present invention.
In the database 10a, a number selected by the purchaser is recorded as data on a record-by-record basis. In each record, in addition to the ID for identifying the record and the six numbers selected by the purchaser indicated as X1 to X6, Various attribute information such as purchase date, purchase time, purchase store, number of units, and number of continuations are included.
[0029]
FIG. 3 is an explanatory diagram conceptually showing the recorded contents of the logical table 10b created in the extraction device 10 of the present invention.
In the logical table 10b, an ID for identifying a record in the table, a different winning number or a logical expression, a true / false value, or an output destination are recorded.
[0030]
Winning numbers and truth values are recorded in the records having IDs Z1 to Z7.
The real numbers A1 to A6 in the winning numbers assigned in ascending order are associated with Z1 to Z6, and the auxiliary number A7 is associated with Z6.
For example, if the real numbers in the winning numbers are 08, 09, 11, 27, 37, and 39 and the supplementary numbers are 18, then 08 for A1, 09 for A2, 11 for A3, 27 for A4, 37 for A5, 39 is assigned to A6 and 18 is assigned to A7.
The true / false value recorded in the records Z1 to Z7 is a flag indicating whether or not the selected number selected by the purchaser matches, and the winning number matches one of the selected numbers selected by the purchaser. In this case, the true / false value of the record in which the winning number is recorded is recorded as “1” indicating a true value. “0” indicating a false value is recorded in the true / false value.
[0031]
In the records having IDs Z8 to Z13, a logical expression and an output destination are recorded.
The logical formula is a formula for determining the winning class, and the output destination is the output destination of the data included in the record recorded in the database 10a whose grade has been determined.
The following expression 1 is recorded as a logical expression in the record of Z8.
[0032]
Z1 + Z2 + Z3 + Z4 + Z5 + Z6 = 6 Equation 1
[0033]
Equation 1 indicates that the sum of the truth values of Z1 to Z6 is 6, which is “1” indicating that the truth values corresponding to Z1 to Z6 are all true values and selected by the purchaser. This indicates that all the selected digits of 6 match the actual digits in the winning digits, that is, 1 and so on.
The data included in the record corresponding to 1 or the like is output to, for example, File 1 formed in the recording unit 13.
[0034]
In the record of Z7, the following expression 2 is recorded as a logical expression.
[0035]
(Z1 + Z2 + Z3 + Z4 + Z5 + Z6 = 5) AND (Z7) Equation 2
[0036]
Equation 2 shows that the sum of the truth values of Z1 to Z6 is 5, and that Z7 takes a true value, which means that among the 6 choice digits selected by the purchaser, the 5 choice digits are the winning digits. This indicates that the number matches the actual number in the middle, and that the selected number 1 in the selected number matches the supplementary number in the winning number, that is, it is 2 or the like.
The data included in the record corresponding to 2 or the like is output to File2 recorded in the recording unit 13, for example.
[0037]
In the record of Z9, the following equation 3 is recorded as a logical equation.
[0038]
(Z1 + Z2 + Z3 + Z4 + Z5 + Z6 = 5) AND (Not Z7) Equation 3
[0039]
Equation 3 shows that the sum of the truth values of Z1 to Z6 is 5, and that Z7 takes a false value, which means that among the 6 choice digits selected by the buyer, the 5 choice digits are the winning digits. This indicates that the situation matches the actual number in the middle and does not match the auxiliary number in the winning numbers, that is, 3 or the like.
The data included in the record corresponding to 3 or the like is output to, for example, File 3 formed in the recording unit 13.
[0040]
In the record of Z10, the following equation 4 is recorded as a logical equation.
[0041]
Z1 + Z2 + Z3 + Z4 + Z5 + Z6 = 4 Equation 4
[0042]
Equation 4 indicates that the sum of the truth values of Z1 to Z6 is 4, which is a situation where the selected number of 4 matches the real number of the winning numbers among the 6 selected numbers selected by the purchaser. , That is, 4 and so on.
The data included in the record corresponding to 4 or the like is output to, for example, File 4 formed in the recording unit 13.
[0043]
In the record of Z11, the following Expression 5 is recorded as a logical expression.
[0044]
Z1 + Z2 + Z3 + Z4 + Z5 + Z6 = 3 Equation 5
[0045]
Equation 5 indicates that the sum of the truth values of Z1 to Z6 is 3, which is a situation where the selected number of 3 among the 6 selected numbers selected by the purchaser matches the true number of the winning numbers, That is, it indicates that it is 5 or the like.
The data included in the record corresponding to 5 or the like is output to, for example, File 5 formed in the recording unit 13.
[0046]
In the record of Z12, the following Expression 6 is recorded as a logical expression.
[0047]
Z1 + Z2 + Z3 + Z4 + Z5 + Z6 <3 Equation 6
[0048]
Equation 6 indicates that the sum of the true / false values of Z1 to Z6 is less than 3, and that the number of selected numbers that match the winning number among the 6 selected numbers selected by the purchaser is less than 3. , That is, they are not equal.
The data included in the record corresponding to the outside is output to, for example, File 0 formed in the recording unit 13.
[0049]
Next, the processing of the extraction device 10 of the present invention will be described.
FIG. 4 is a flowchart showing the processing of the extraction device 10 of the present invention.
When a person operating the extraction apparatus 10 performs a process of extracting records that have been won for each grade from among the records recorded in the database 10a, the person in charge specifies the database 10a in which the records are recorded, and performs a lottery. The actual number and the auxiliary number are input to the extraction device 10 as key data indicating the winning number determined by the above.
[0050]
Under the control of the CPU 11, which executes the computer program PG stored in the RAM 14, the extraction device 10 receives the six different real numbers and one supplementary number input from the input means 15 as key data indicating winning numbers ( (Step S1) The logical table 10b is created in the recording means 13 and / or the RAM 14 (Step S2), and key data indicating the accepted winning numbers is recorded in the logical table 10b (Step S3).
At this time, the key data input as actual numbers are rearranged in ascending order, and are assigned to A1, A2, A3, A4, A5 and A6 in ascending numerical order.
The key data input as the supplementary numeral is assigned to A7.
[0051]
Then, in the extraction device 10, under the control of the CPU 11 executing the computer program PG stored in the RAM 14, the record recorded in the database 10a is read (Step S4), accepted in Step S1, and entered in the logical table 10b in Step S3. For each of the recorded key data, it is determined whether or not a numeral indicating matching data is included in the read record (step S5).
The matching is determined by using a known search technique such as the Aho-Corasick (AC) method, the Expanded-Boyer-Moore (EBM) method, and the Shinohara-Arikawa (SA) method.
In the extraction device 10, under the control of the CPU 11 that executes the computer program PG stored in the RAM 14, when it is determined that data matching each key data is included in the read record, the true value “1” is obtained. Is recorded in the recording area of the logical table 10b corresponding to the key data when it is determined that the matching data is not included in the read record (step S6).
For example, if the read record contains data matching A1, A2, A4, and A7 to which key data is assigned, a true value is stored in a Boolean value recording area corresponding to A1, A2, A4, and A7. "1" is recorded, and "0" representing a false value is recorded in the true / false value recording area corresponding to A3, A5, and A6.
[0052]
In the extraction device 10, under the control of the CPU 11 that executes the computer program PG stored in the RAM 14, the key data corresponding to the predetermined key data, here A1 to A6, is assigned based on the above-described equations 1 to 6. The sum of the true / false values, essentially the sum of the true values, is calculated (step S7), and based on the calculated sum and other predetermined key data, here, the true / false value corresponding to A7 to which the auxiliary numeral is assigned. Then, a grade of data included in the record is determined (step S8), a record is extracted based on the determined grade (step S9), and output to an output destination corresponding to the grade (step S10).
The determination shown in step S8 refers to determining which one of Expressions 1 to 6 matches based on the sum of the true values of the actual numbers and the truth value of the auxiliary numbers.
As shown in steps S7 to S9, it can be said that the extraction process of the present invention performs a process of extracting records based on the number of data determined to match key data.
The output of step S10 is a file of the output destination corresponding to the expression determined to match in step S8, specifically, File1, File2, File3, File4, File5, File0, and the like indicated as the output destination. This means that the data contained in the record is recorded in the recording means 13 as a file of the name and output from the output means 16.
[0053]
Then, under the control of the CPU 11 that executes the computer program PG stored in the RAM 14, the extraction device 10 determines whether or not there is a record that has not been read among the records recorded in the database 10a (step S11). If it is determined that there is a record (step S11: YES), the process returns to step S4, and the subsequent processing is repeated.
At this time, the truth value recorded in the logic table 10b is initialized.
[0054]
If it is determined in step S11 that there is no record that has not been read (step S11: NO), the extraction process is completed for all records, and the process ends.
In this manner, various processes such as a lottery process of the data included in the record recorded in the database 10a and a tallying process of the attribute information recorded as data in the winning-specific record are performed.
[0055]
By the above-described extraction method of the present invention, the time when the process of extracting a record meeting predetermined conditions from the database 10a in which 8.75 million records are recorded was calculated from a simulation test and calculation. It was found that the treatment was theoretically completed in 13 minutes.
This can dramatically reduce the time compared to the conventional method of determining a combination of key data for each class and extracting a record matching the determined combination from the database 10a in 20 hours. Is shown.
[0056]
In the above-described embodiment, the mode in which the extraction device 10 using the general-purpose computer is operated alone has been described. However, the present invention is not limited to this, and the client computer is connected to the extraction device 10 using the server computer. May be transmitted to the extraction device 10, the information transmitted by the extraction device 10 may be received and processed, and the result may be output to the client computer.
In addition, the present invention is not limited to the tabulation of the number selection type lottery, and can be applied to various search processes. In that case, a character string can be used as data and key data.
[0057]
(Supplementary Note 1) In an extraction method using an extraction device that extracts a record that meets a predetermined condition from a database that records a record including a plurality of different data, the extraction device receives a plurality of different key data, An extraction method characterized by determining whether or not matching data is included in a record for each of the received key data, and extracting a record based on the number of data determined to match.
(Supplementary Note 2) In an extraction device that extracts a record that meets a predetermined condition from a database that records a record including a plurality of different data, a unit that receives a plurality of different key data, And a means for determining whether or not matching data is included in the record, and a means for extracting the record based on the number of data determined to match.
(Supplementary Note 3) In an extraction device that extracts a record that meets a predetermined condition from a database that records a record including a plurality of different data, a unit that receives a plurality of different key data, and a unit corresponding to each received key data Means for creating a logical table for recording each of the boolean values; means for determining whether or not data matching each of the received key data is included in the record; Means for recording a true value in the recording area of the logical table corresponding to the key data when it is determined that the key data is included in the record; means for calculating the sum of the true values corresponding to the predetermined key data; Means for extracting a record based on the calculated sum.
(Supplementary Note 4) The means for extracting a record is configured to extract a record based on a true value of another predetermined key data different from the predetermined key data and a calculated sum. 4. The extraction device according to 3.
(Supplementary note 5) The extraction device according to any one of supplementary notes 2 to 4, wherein the data and the key data are numbers.
(Supplementary Note 6) In a computer program that causes a computer to extract a record that matches a predetermined condition from a database that records a record including a plurality of different data, when the computer receives different key data, the received key It is characterized in that for each of the data, a procedure for determining whether or not matching data is included in a record, and a procedure for causing a computer to extract a record based on the number of data determined to match are executed. And a computer program.
[0058]
【The invention's effect】
As described in detail above, in the extraction method, the extraction device, and the computer program according to the present invention, a record including data such as a selected number of a number-selectable lottery in which a purchaser selects a predetermined number from a plurality of numbers is recorded. If a record that contains data that has been won based on key data such as winning numbers is extracted from the database that was selected, when data that matches the key data is included in the record, as a boolean value that corresponds to the key data A true value, for example, “1” is recorded, and a grade is set based on the sum of the true values associated with the key data, for example, 1 if the sum of the true values is “6”, and 4 if the sum of the true values is “4”. By extracting records based on the determined grades, a combination of key data is determined for each grade, and records matching the determined combination are retrieved from the database. Since the number of times to execute the extracted instruction as compared with a method of output is reduced to shorten the processing time, it is possible to improve data maintainability and operability etc., an excellent effect.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of an extraction device of the present invention.
FIG. 2 is an explanatory view conceptually showing recorded contents of a database provided in the extraction device of the present invention.
FIG. 3 is an explanatory diagram conceptually showing recorded contents of a logical table created in the extraction device of the present invention.
FIG. 4 is a flowchart showing processing of the extraction device of the present invention.
[Explanation of symbols]
10 Extraction device
11 CPU
12 auxiliary storage means
13 Recording means
14 RAM
15 Input means
16 Output means
10a database
10b Logical table

Claims (5)

夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出装置を用いた抽出方法において、
前記抽出装置は、
夫々異なる複数のキーデータを受け付け、
受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定し、
合致すると判定したデータの個数に基づいてレコードを抽出する
ことを特徴とする抽出方法。
In an extraction method using an extraction device that extracts records that match predetermined conditions from a database that records records each including a plurality of different data,
The extraction device,
Accepts different key data respectively,
For each of the received key data, it is determined whether or not the matching data is included in the record,
An extraction method characterized by extracting records based on the number of data determined to match.
夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出装置において、
夫々異なる複数のキーデータを受け付ける手段と、
受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定する手段と、
合致すると判定したデータの個数に基づいてレコードを抽出する手段と
を備えることを特徴とする抽出装置。
In an extraction device that extracts records that match predetermined conditions from a database that records records including a plurality of different data,
Means for receiving a plurality of different key data,
Means for determining, for each of the received key data, whether or not matching data is included in the record;
Means for extracting records based on the number of data determined to match.
夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを抽出する抽出装置において、
夫々異なる複数のキーデータを受け付ける手段と、
受け付けた各キーデータに対応する真偽値を夫々記録する論理テーブルを作成する手段と、
受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定する手段と、
キーデータに合致するデータがレコードに含まれていると判定した場合に、当該キーデータに対応する論理テーブルの記録領域に真値を記録する手段と、
所定のキーデータに対応する真値の和を算出する手段と、
算出した和に基づいてレコードを抽出する手段と
を備えることを特徴とする抽出装置。
In an extraction device that extracts records that match predetermined conditions from a database that records records including a plurality of different data,
Means for receiving a plurality of different key data,
Means for creating a logical table for recording a boolean value corresponding to each received key data,
Means for determining, for each of the received key data, whether or not matching data is included in the record;
Means for recording a true value in a recording area of a logical table corresponding to the key data when it is determined that data matching the key data is included in the record;
Means for calculating a sum of true values corresponding to predetermined key data;
Means for extracting a record based on the calculated sum.
前記レコードを抽出する手段は、前記所定のキーデータと異なる他の所定のキーデータの真値、及び算出した和に基づいてレコードを抽出すべくなしてあることを特徴とする請求項3に記載の抽出装置。4. The apparatus according to claim 3, wherein the means for extracting the record is configured to extract a record based on a true value of another predetermined key data different from the predetermined key data and a calculated sum. Extraction equipment. 夫々異なる複数のデータを含むレコードを記録するデータベースから所定の条件に合致するレコードを、コンピュータに抽出させるコンピュータプログラムにおいて、
コンピュータに、夫々異なるキーデータを受け付けた場合に、受け付けたキーデータの夫々に対して、合致するデータがレコードに含まれているか否かを判定させる手順と、
コンピュータに、合致すると判定したデータの個数に基づいてレコードを抽出させる手順と
を実行させることを特徴とするコンピュータプログラム。
A computer program that causes a computer to extract a record that matches a predetermined condition from a database that records records each including a plurality of different data,
When the computer receives different key data, for each of the received key data, a procedure for determining whether or not matching data is included in the record; and
Causing the computer to extract records based on the number of data determined to match.
JP2003006316A 2003-01-14 2003-01-14 Extraction method, extraction device and computer program Pending JP2004220283A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003006316A JP2004220283A (en) 2003-01-14 2003-01-14 Extraction method, extraction device and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003006316A JP2004220283A (en) 2003-01-14 2003-01-14 Extraction method, extraction device and computer program

Publications (1)

Publication Number Publication Date
JP2004220283A true JP2004220283A (en) 2004-08-05

Family

ID=32896736

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003006316A Pending JP2004220283A (en) 2003-01-14 2003-01-14 Extraction method, extraction device and computer program

Country Status (1)

Country Link
JP (1) JP2004220283A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012113706A (en) * 2010-11-19 2012-06-14 Internatl Business Mach Corp <Ibm> Computer-implemented method, computer program, and data processing system for optimizing database query
JP2014013519A (en) * 2012-07-05 2014-01-23 Hitachi Ltd Data specification method
CN106652153A (en) * 2016-10-17 2017-05-10 深圳市穗彩科技开发有限公司 Extendable lottery searching and splitting method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012113706A (en) * 2010-11-19 2012-06-14 Internatl Business Mach Corp <Ibm> Computer-implemented method, computer program, and data processing system for optimizing database query
US9569485B2 (en) 2010-11-19 2017-02-14 International Business Machines Corporation Optimizing database query
JP2014013519A (en) * 2012-07-05 2014-01-23 Hitachi Ltd Data specification method
CN106652153A (en) * 2016-10-17 2017-05-10 深圳市穗彩科技开发有限公司 Extendable lottery searching and splitting method and system
CN106652153B (en) * 2016-10-17 2019-03-26 深圳市穗彩科技开发有限公司 Color method and system are sent in expansible lottery ticket retrieval

Similar Documents

Publication Publication Date Title
EP1209582B1 (en) Document retrieval method and system and computer readable storage medium
US7389277B2 (en) Machine learning systems and methods
US8768970B2 (en) Providing alternatives within a family tree systems and methods
JP4814238B2 (en) System and method for searching legal points
US7917377B2 (en) Patient data mining for automated compliance
JP5111423B2 (en) Document examination support apparatus, document examination support method and program
US20040260979A1 (en) Information mining system
JP2009271799A (en) Company correlative information extracting system
EP1293913A2 (en) Information retrieving method
Liang et al. Integrating statistical and inductive learning methods for knowledge acquisition
JP2007310646A (en) Search information management device, search information management program and search information management method
US20050025390A1 (en) Information processing apparatus and method
JP2004220283A (en) Extraction method, extraction device and computer program
JP2007159883A (en) Marketing research system
CN107862043A (en) Check the search method and device of information
Liao et al. An integrated database and expert system for failure mechanism identification: Part II—the system and performance testing
JP3578651B2 (en) Document retrieval system, document retrieval method, and computer-readable recording medium recording program for executing the method
US20030055838A1 (en) Data storing method and data storing structure
JP4342014B2 (en) Ordering system
JPH0969112A (en) Intelligent estate information management system
JP6978997B2 (en) Similar data search method, information retrieval device and program
JPH10301770A (en) Use case evaluation method, use case evaluation device and recording medium
Hui et al. Adaptive model fusion algorithm for decision trees and association rules
JPH10320373A (en) Method and device for analyzing number of data and storage medium stored with number-of-data analyzing program
JP2004110586A (en) Retrieval method, retrieval device, and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050408

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20081107

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20081111

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090109

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090210