JP4921453B2 - Bit string data sorting apparatus, method and program - Google Patents
Bit string data sorting apparatus, method and program Download PDFInfo
- Publication number
- JP4921453B2 JP4921453B2 JP2008325692A JP2008325692A JP4921453B2 JP 4921453 B2 JP4921453 B2 JP 4921453B2 JP 2008325692 A JP2008325692 A JP 2008325692A JP 2008325692 A JP2008325692 A JP 2008325692A JP 4921453 B2 JP4921453 B2 JP 4921453B2
- Authority
- JP
- Japan
- Prior art keywords
- key
- bit position
- difference bit
- difference
- link
- 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.)
- Expired - Fee Related
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/22—Arrangements for sorting or merging computer data on continuous record carriers, e.g. tape, drum, disc
- G06F7/24—Sorting, i.e. extracting data from one or more carriers, rearranging the data in numerical or other ordered sequence, and rerecording the sorted data on the original carrier or on a different carrier or set of carriers sorting methods in general
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、ビット列で表されるキーデータのソート装置、方法及びプログラムに関する。 The present invention relates to an apparatus, a method, and a program for sorting key data represented by a bit string.
近年、社会の情報化が進展し、大規模なデータベースが各所で利用されるようになってきている。このような大規模なデータベースからレコードを検索するには、各レコードの記憶されたアドレスと対応づけられたレコード内の項目をインデックスキーとして検索をし、所望のレコードを探し出すことが通例である。また、全文検索における文字列も、文書のインデックスキーと見なすことができる。 In recent years, with the progress of informatization of society, large-scale databases are being used in various places. In order to search for a record from such a large database, it is usual to search for an item in the record associated with the stored address of each record using an index key to find a desired record. A character string in full-text search can also be regarded as a document index key.
そして、それらのインデックスキーはビット列で表現されることから、データベースの検索はビット列の検索に帰着されるということができる。
一方、データベースに関連した処理として、データベース中のレコードのインデックスキーによるソート処理が行われている。このソート処理もビット列のソート処理に帰着される。
Since these index keys are expressed by bit strings, it can be said that a database search is reduced to a bit string search.
On the other hand, as a process related to the database, a sort process based on an index key of records in the database is performed. This sort process is also reduced to a bit string sort process.
ソートの手法は各種のものが開発されており、下記特許文献1には、クイックソート、ラディックソート(基数ソート)等が紹介されている。また、特許文献2にも基数ソートが記載されている。
Various sort methods have been developed, and the following
図1Aに示すのは、従来の基数ソートの概念を説明する図である。基数ソートによれば、図1Aに例示するソート対象である4ビットのビット列であるキーは、0ビット目から3ビット目に至る各ビット位置におけるビット値による分類を繰り返すことにより、ソートが実行される。以下、図1Aの例示により、基数ソートの概念を説明する。 FIG. 1A is a diagram for explaining the concept of conventional radix sort. According to the radix sort, the key that is the 4-bit bit string to be sorted illustrated in FIG. 1A is sorted by repeating the classification by the bit value at each bit position from the 0th bit to the 3rd bit. The Hereinafter, the concept of the radix sort will be described with reference to FIG. 1A.
図1Aには、ソート対象であるキーからなるキー列100が示されている。図1Aの例示では、キー列100に含まれるキーの存在するキーの位置であるキー位置101が100a(以下、キー位置100aのように表記する。)である記憶領域にはキー“1111”が存在する。また、キー位置100b、100c100d、100eには、それぞれキー“0011”、“1010”、“0001”、“1110”が存在する。
FIG. 1A shows a
図に示すように、まずビット位置毎の分類(0ビット目)110aによりキー列100に含まれるキーの0ビット目による分類が行われる。その結果、キー“0001”とキー“0011”からなる0ビット目の値0の組120aと、キー“1111”、キー“1010”、キー“1110”からなる値1の組121aが得られる。次に値0の組120aはビット位置毎の分類(1ビット目)110bにより、次に値1の組121aはビット位置毎の分類(1ビット目)110eによりそれぞれ1ビット目の値による分類が行われる。
As shown in the figure, first, classification by the 0th bit of the key included in the
ビット位置毎の分類(1ビット目)110bでは、キー“0001”とキー“0011”の1ビット目が共に0であることから、1ビット目の値0の組120bしか得られず、0ビット目の値0の組120aと同じキーが2ビット目による分類の対象となり、ビット位置毎の分類(2ビット目)110cにより2ビット目による分類が行われる。ビット位置毎の分類(2ビット目)110cでは、2ビット目の値0の組120dとして1つのキー“0001”が得られるので、最小値であるキーを格納する、ソート済みキー列130のキーを格納する位置であるキー位置131が130a(以下、キー位置130aのように表記する。)である記憶領域に格納される。同様に、2ビット目の値1の組121dとして1つのキー“0011”が得られるので、ソート済みキー列130の最小値の次の値のキーを格納するキー位置130bに格納される。なお、ソート済みキー列には、キー位置の符号順に小さいほうのキーから格納されるものとする。
In the classification (first bit) 110b for each bit position, since the first bits of the key “0001” and the key “0011” are both 0, only the
一方、ビット位置毎の分類(1ビット目)110eの分類では、1ビット目の値0の組120eとして1つのキー“1010”が得られるので、ソート済みキー列130の次の格納位置であるキー位置130cに格納される。また、1ビット目の値1の組121eとして、キー“1111”とキー“1110”の組が得られ、ビット位置毎の分類(2ビット目)110fの分類で、2ビット目の値に基づく分類が行われる。
On the other hand, in the classification of each bit position (first bit) 110e, one key “1010” is obtained as the
ビット位置毎の分類(2ビット目)110fでは、キー“1111”とキー“1110”の2ビット目が共に1であることから、1ビット目の値1の組121fしか得られず、1ビット目の値1の組121eと同じキーが3ビット目による分類の対象となり、ビット位置毎の分類(3ビット目)110gにより3ビット目の値による分類が行われる。ビット位置毎の分類(3ビット目)110gでは、3ビット目の値0の組120gとして1つのキー“1110”が得られるので、ソート済みキー列130の次の格納位置であるキー位置130dに格納される。同様に、3ビット目の値1の組121gとして1つのキー“1111”が得られるので、ソート済みキー列130の次の格納位置であるキー位置130eに格納される。
In the classification (second bit) 110f for each bit position, since the second bits of the key “1111” and the key “1110” are both 1, only the
以上の処理により、キー列100のキーは、ソート済みキー列130のキー位置130a〜130eにソートされて格納される。しかし、上述の基数ソート方法によりソートを実行する場合には、図1Aに示すビット位置毎の分類(1ビット目)110bやビット位置毎の分類(2ビット目)110fにみられるように、分類が行われない無効な処理が発生する。
そこで本発明の解決しようとする課題は、ビット列データのソート処理において、無効となる処理が発生しない、効率的なソート手法を提供することである。 Therefore, the problem to be solved by the present invention is to provide an efficient sorting method in which invalid processing does not occur in the sort processing of bit string data.
本発明のソート処理によれば、基準となるキーとソート対象であるビット列からなるキーのビット列比較を行い、最初に異なるビット値となるビット位置である差分ビット位置を求め、差分ビット位置によるソート対象のキーの分類を行い、同一の差分ビット位置に分類された複数のキーのうちの基準となるキーについての差分ビット位置による分類をさらに繰り返すことにより、ソート済みキー列を取得する。 According to the sorting process of the present invention, a bit string comparison between a key that is a reference and a bit string that is a sort target is performed, a difference bit position that is a bit position that is a different bit value is first obtained, and sorting by the difference bit position is performed. The target key is classified, and the sorted key string is obtained by further repeating the classification based on the difference bit position for the reference key among the plurality of keys classified into the same difference bit position.
本発明によれば、差分ビット位置によりキーのソートを行うため、分類が行われない無効な処理は発生しない。したがって、効率的なソート処理を実現することができる。 According to the present invention, since the keys are sorted by the difference bit position, invalid processing that does not perform classification does not occur. Therefore, efficient sort processing can be realized.
以下、本発明を実施するための最良の形態を、図1Aに示したキー列100に含まれるキーと同一のキーをソート対象のキーとして例示して説明する。
Hereinafter, the best mode for carrying out the present invention will be described by exemplifying the same key as the key included in the
図1Bに示すのは、本発明の一実施の形態における差分ビット位置によるソート処理の概念を説明する図である。ソート対象のキー列100及びソート済みキー列130は、図1Aに示すものと同じである。
FIG. 1B is a diagram for explaining the concept of the sorting process based on the difference bit position according to the embodiment of the present invention. The sort
キー列100を構成する各キーは、差分ビット位置による分類149aにおいて、最小値キー148a、最小値キーとの差分ビット位置が2であるキー群142a及び最小値キー148aとの差分ビット位置が0であるキー群140aに分類される。図の例では、最小値キー142aは“0001”である。キー群142aには、キー“0011”のみが含まれており、キー群140aにはキー“1010”、“1111”及び“1110”が含まれている。最小値キー148aは、キー列100からキーを差分ビット位置によるソート処理のための入力バッファに読み込むときに求めることができる。
Each key constituting the
最小値キー148aは、図の点線の矢印158aに示すように、ソート済みキー列130のキー位置130aに格納される。また、キー群142aのキーは1つのみであるので、図の点線の矢印152aに示すように、ソート済みキー列130のキー位置130bに格納される。
The
最小値キー148aとの差分ビット位置が0であるキー群140aにはキーが複数含まれているので、図の点線の矢印の組150aに示すように、差分ビット位置による分類149bにおいて、キー群140a内の最小値キー148bと、最小値キー148bとの差分ビット位置が1であるキー群141b、に分類される。図の例では、最小値キー148bは“1010”である。キー群141bには、キー
“1111”とキー“1110”が含まれている。
Since the
最小値キー148bは、図の点線の矢印158bに示すように、ソート済みキー列130のキー位置130cに格納される。
一方、最小値キー148bとの差分ビット位置が1であるキー群141bにはキーが複数含まれているので、図の点線の矢印の組151bに示すように、差分ビット位置による分類149cにおいて、キー群141b内の最小値キー148cと、最小値キー148cとの差分ビット位置が3であるキー群143c、に分類される。図の例では、最小値キー148cは“1110”である。キー群143cにはキー
“1111”のみが含まれている。
The
Meanwhile, since the
最小値キー148cは、図の点線の矢印158cに示すように、ソート済みキー列130のキー位置130dに格納される。また、キー群143cのキーは1つのみであるので、図の点線の矢印153cに示すように、ソート済みキー列130のキー位置130eに格納される。
The minimum value key 148c is stored in the
以上の処理により、キー列100のキーは、ソート済みキー列130のキー位置130a〜130eに昇順で格納され、ソート処理が完了する。そして、本実施の態様によるソート処理は、差分ビット位置に基づいて分類を繰り返すので、分類処理毎に必ずキーの分類が実行される。なお、上述の例では、最小値キーを、差分ビット位置を計算する基準のキーとしているが、最大値キーを、差分ビット位置を計算する基準のキーとすることも可能である。この場合には、図1Bのソート対象キーの例では、最大値キーがキー“1111”であり、最初の差分ビット位置による分類処理の結果として、最大値キー、差分ビット位置が3のキー“1110”、差分ビット位置が1のキー“1010”及び差分ビット位置が0のキー“0011”と“0001”の組が得られる。
Through the above processing, the keys of the
次に、図1Bを参照してその概念を説明した本実施の形態における差分ビット位置によるソート処理を実現するための機能ブロック構成例について説明する。本実施の形態における差分ビット位置によるソート処理は、図1Bに例示した差分ビット位置による分類149a、149b、149c等の処理を実行する機能ブロックを、ソート対象のあらゆるキーの組み合わせに対して用意すれば実現可能であることは明らかである。しかしそれでは資源の無駄遣いであり、その実現手法は現実的でない。そこで本実施の形態においては、以下に説明する工夫を行っている。
Next, an example of a functional block configuration for realizing the sort processing based on the difference bit position in the present embodiment whose concept has been described with reference to FIG. 1B will be described. In the sorting process based on the difference bit position in the present embodiment, functional blocks that execute processes such as
図2Aは、本発明の一実施の形態における差分ビット位置によるソート処理で用いるデータ構造を説明するものである。図2Aに示すように、キー表309、差分ビット位置表310、リンク表311、ソート済みキー表313が用いられる。 FIG. 2A explains the data structure used in the sort processing based on the difference bit position in the embodiment of the present invention. As shown in FIG. 2A, a key table 309, a difference bit position table 310, a link table 311 and a sorted key table 313 are used.
キー表309はソート要求があったときにソート対象のキー602が読み込まれて設定されるものである。図2Aの例示では、ソート対象の5つのキー602は、図1A及び図1B示すキー列100に含まれるものが読み込まれている。キー表309の読出位置601の先頭はP0であり、以下、P1、P2、P3、P4と続いている。読出位置P0には、最小値キー“0001”が設定されているが、別領域に設定しておくことも可能である。点線の矢印689cで示すように、最小値キーはソート済みキー表313の所定の位置に格納される。
The key table 309 is set by reading the
差分ビット位置表310は、最小値キーに対する同一の差分ビット位置を有するキーのうち、最小のキーの読出位置601を親リンク612として差分ビット位置611毎に格納するものである。図2Aの例示では、点線の矢印660aで示すように、最小値キー“0001”との差分ビット位置が0であるキー“1111”、“1010”、“1110”のうち最小のキー“1010”の読出位置P3が差分ビット位置表310の差分ビット位置611が0である位置に格納されている。また、点線の矢印662aで示すように、最小値キー“0001”との差分ビット位置が2であるキーはキー“0011”だけであるので、キー“0011”
の読出位置P2が差分ビット位置表310の差分ビット位置611が2である位置に格納されている。
The difference bit position table 310 stores the
Read position P2 is stored at a position where the
リンク表311は、最小値キーに対する同一の差分ビット位置を有するキーにアクセスするためのものである。図に示すように、キーの読出位置621に対して、同一の差分ビット位置を有するキーの読出位置を示すリンク622が格納されている。
The link table 311 is for accessing a key having the same differential bit position with respect to the minimum value key. As shown in the figure, a
差分ビット位置表310からリンク表311への点線の矢印673bで示すように、同一の差分ビット位置0を有するキーの最小値キーの読出位置P3に対して、その読出位置P3を読出位置621とするリンク表311の読出位置(以下、リンク表311の読出位置P3のようにいう。)に、最小値キー“0001”に対して差分ビット位置0を有するキーの最小値キー“1010”と同一の差分ビット位置0を有するキー“1110”のキー表309の読出位置P4が格納されている。
As indicated by the dotted
そして、図の点線の矢印674cで示すように、リンク表311の読出位置P4に同一の差分ビット位置0を有するキー“1111”のキー表309の読出位置P1が格納されている。また、図の点線の矢印671cで示すように、リンク表311の読出位置P1には、同一の値のキー表309の読出位置P1が格納されている。これにより、それ以上同一の差分ビット位置0を有するキーは存在しないことを表している。
As indicated by the dotted
また、差分ビット位置表310からリンク表311への点線の矢印672bで示すように、同一の差分ビット位置2を有するキーの最小値キーの読出位置P2に対して、リンク表311の読出位置P2には、リンク表311の読出位置P2と同一の値のキー表309の読出位置P2が格納されている。これは、キー表309の読出位置P2のキー“0011”が最小値キー“0001”との差分ビット位置が2であるキーの最小のキーであるとともに、最後のものでもあることを示している。
Further, as indicated by the dotted
上述の図2Aに示す差分ビット位置表310とリンク表311の状態は、図1Bに示す差分ビット位置による分類149aが実行されて得られるものである。
以上の説明から明らかなとおり、上述のキー表309は請求項1に係る発明のソート対象キー記憶手段の一実施例である。また、差分ビット位置表310とリンク表311で分類対象キー差分ビット位置記憶手段の一実施例を構成しており、キー表309の読出位置601はキーの識別情報に相当する。
The states of the difference bit position table 310 and the link table 311 shown in FIG. 2A described above are obtained by executing the classification 149a based on the difference bit positions shown in FIG. 1B.
As is apparent from the above description, the key table 309 described above is an example of the sort target key storage means of the invention according to
図2Bは、本発明の一実施の形態におけるビット列データソート装置の機能ブロック構成を説明する図である。
図に示すように、ビット列データソート装置200は、差分ビット位置計算手段210、差分ビット位置分類手段220、ソート済みキー出力手段230、及び制御手段240を含む。以下、各手段の動作の概要について、図2Aの例示を参照して説明する。
FIG. 2B is a diagram illustrating a functional block configuration of the bit string data sorting device according to the embodiment of the present invention.
As shown in the figure, the bit string
差分ビット位置計算手段210は、キー表309に記憶されたキー602のうちから、差分ビット位置による分類処理の対象となるキーの差分ビット位置を計算する。制御手段240は最初の分類処理の対象をキー表309に記憶された全てのキーとする。この場合、差分ビット位置を計算する基準となるキーは、読出位置P0に格納された最小値キー“0001”である。ソート済みキー出力手段230は、最小値キー“0001”をソート済みキー表313に出力する。
The difference bit position calculation means 210 calculates the difference bit position of the key to be classified by the difference bit position from the
差分ビット位置分類手段220は、差分ビット位置計算手段210の計算結果に基づいて、差分ビット位置表310とリンク表311の書き込みを行う。その結果、キーの識別情報をキー表309の読出位置601として、差分ビット位置が0の組(P3、P4、P1)と差分ビット位置が2の組(P2)に分類される。
The difference bit
制御手段240は、分類後に複数のキーが含まれる組について、さらに差分ビット位置計算手段210による差分ビット位置の計算と差分ビット位置分類手段220による分類処理が繰り返されるように制御する。
The
図3は、本発明を実施するためのハードウェア構成例を説明する図である。
本発明によるソート処理は中央処理装置302及びキャッシュメモリ303を少なくとも備えたデータ処理装置301によりデータ格納装置308を用いて実施される。キー表309、差分ビット位置表310、リンク表311、ソート済みキー表313を有するデータ格納装置308は、主記憶装置305または外部記憶装置306で実現することができ、あるいは通信装置307を介して接続された遠方に配置された装置を用いることも可能である。
FIG. 3 is a diagram for explaining a hardware configuration example for carrying out the present invention.
Sort processing according to the present invention is performed by a data processing device 301 including at least a
図3の例示では、主記憶装置305、外部記憶装置306及び通信装置307が一本のバス304によりデータ処理装置301に接続されているが、接続方法はこれに限るものではない。また、主記憶装置305をデータ処理装置301内のものとすることもできるし、キー表309は外部記憶装置306に、他の表は主記憶装置305に持つなど、使用可能なハードウェア環境、ソート対象キーの集合の大きさ等に応じて適宜ハードウェア構成を選択できることは明らかである。
In the example of FIG. 3, the
また、特に図示されてはいないが、処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた主記憶装置305の一時記憶領域が用いられることは当然である。そして、以下の説明においては、一次記憶領域に格納されるあるいは設定される値を一時記憶領域の名前で呼ぶことがある。
Although not particularly illustrated, it is natural that the temporary storage area of the
次に、本発明の一実施の形態におけるソート処理について、図4A及び図4Bを参照して詳細に説明する。また、その説明において、図1Bあるいは図2Aの例示を適宜用いて説明する。 Next, sorting processing according to an embodiment of the present invention will be described in detail with reference to FIGS. 4A and 4B. Moreover, in the description, it demonstrates using the illustration of FIG. 1B or FIG. 2A suitably.
図4Aは、本発明の一実施の形態におけるソート処理の初段の分類処理とソート済みキーの出力処理の処理フローを説明する図である。キー表にはソート対象のキーが記憶されており、キー表の先頭の読出位置には最小値キーが記憶されていることを前提とする。すなわち、図1Bに示すキー列100に含まれるキーは図2Aに示すようにキー表309に記憶されているものとする。
FIG. 4A is a diagram for explaining the processing flow of the sorting processing at the first stage of the sorting processing and the output processing of sorted keys in one embodiment of the present invention. It is assumed that a key to be sorted is stored in the key table, and a minimum value key is stored at the top reading position of the key table. That is, the keys included in the
まず、ステップS401において、キー表の先頭位置をキー表の読出位置(以下、単に読出位置ということがある。)に設定する。ここでいう「キー表の読出位置」は、先に述べた「処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶領域」の1つである。以下の説明では、「キー表の先頭位置をキー表の読出位置に設定する。」のように、「キー表の読出位置」が図示しない一次記憶領域であることを省略して述べることがある。
上記の設定により、図2Aの例示では、キー表の読出位置にP0が設定される。
First, in step S401, the head position of the key table is set to a key table reading position (hereinafter, simply referred to as a reading position). The “reading position of the key table” here is one of the “temporary storage areas corresponding to each processing in order to use various values obtained during the processing in the subsequent processing” described above. . In the following description, it is sometimes omitted that “the key table read position” is a primary storage area (not shown), such as “the head position of the key table is set as the key table read position”. .
With the above setting, in the example of FIG. 2A, P0 is set at the reading position of the key table.
次にステップS402において、キー表より、先頭位置の指すキーを最小値キーとして取り出す。ここでいう「最小値キーとして取り出す」は、図示しない一次記憶領域である最小値キーに設定する、の意味である。以下においても、同様な表記を用いる場合がある。 In step S402, the key pointed to by the head position is extracted from the key table as the minimum value key. Here, “take out as a minimum value key” means to set to a minimum value key which is a primary storage area (not shown). In the following, similar notation may be used.
ステップS403に進み、読出位置に次の読出位置を設定する。次にステップS404において、全てのキーは処理済みか、すなわち、全てのキーについての初段における分類処理が終了したか判定する。 Proceeding to step S403, the next reading position is set as the reading position. Next, in step S404, it is determined whether all the keys have been processed, that is, whether the classification process at the first stage for all the keys has been completed.
全てのキーが処理済みでなければ、ステップS405に進み、キー表より、読出位置の指すキーをソートキーとして取り出すとともに、読出位置をソートキーの読出位置に設定する。そしてステップS406において、ソートキーと最小値キーの差分ビット位置を得て、差分ビット位置によりソートキーを分類し、ステップS403に戻る。
ステップS406の処理においては、初段における分類処理として差分ビット位置表とリンク表への設定が行われる。その処理の詳細については、後に図5A及び図5Bを参照して説明する。
If all the keys have not been processed, the process proceeds to step S405, where the key pointed to by the reading position is extracted from the key table as a sort key, and the reading position is set as the reading position of the sort key. In step S406, the difference bit position between the sort key and the minimum value key is obtained, the sort key is classified by the difference bit position, and the process returns to step S403.
In the process of step S406, the difference bit position table and the link table are set as the classification process in the first stage. Details of the processing will be described later with reference to FIGS. 5A and 5B.
一方、ステップS404で全てのキーが処理済みであると判定されると、ステップS407に分岐し、ステップS402で得た最小値キーを、ソート済みキー表に設定し、図4Bに示すステップS408以下の処理に進む。以上の処理により、図2Aの例示のように、差分ビット位置表310とリンク表311の各エントリの値が設定される。また、最小値キー“0001”がソート済みキー表313に格納される。 On the other hand, if it is determined in step S404 that all the keys have been processed, the process branches to step S407, where the minimum value key obtained in step S402 is set in the sorted key table, and the steps after step S408 shown in FIG. 4B are performed. Proceed to the process. With the above processing, the values of the entries in the difference bit position table 310 and the link table 311 are set as illustrated in FIG. 2A. Further, the minimum value key “0001” is stored in the sorted key table 313.
図4Bは、本発明の一実施の形態におけるソート処理の初段以降の分類処理とソート済みキーの出力処理の処理フローを説明する図である。 FIG. 4B is a diagram illustrating a processing flow of the sorting process and the sorted key output process after the first stage of the sort process according to the embodiment of the present invention.
ステップS408においては、図示しない一次記憶領域である差分ビット位置に、初期値として差分ビット位置表の差分ビット位置、すなわちソート対象のキーが有する可能性のある差分ビット位置の最大値を設定する。図2Aの例示では、差分ビット位置の最大値として3が設定される。 In step S408, the difference bit position in the difference bit position table, that is, the maximum value of the difference bit position that the sort target key may have is set as an initial value in the difference bit position that is a primary storage area (not shown). In the example of FIG. 2A, 3 is set as the maximum value of the difference bit position.
ステップS409において、差分ビット位置表の全ての差分ビット位置のエントリについて処理済みであるか判定し、処理済みであればソート処理を終了し、処理済みでなければステップS410に進む。 In step S409, it is determined whether entries for all the difference bit positions in the difference bit position table have been processed. If processed, the sort process is terminated, and if not processed, the process proceeds to step S410.
ステップS410では、差分ビット位置表より、差分ビット位置の指すエントリから親リンクを読み出す。差分ビット位置の指すエントリに親リンクが格納されていれば、この読み出された親リンクは一次記憶領域である親リンクに設定される。すなわち、本実施の態様の説明における「親リンクを読み出す」等の表記は、親リンクを読み出して図示しない一次記憶領域である親リンクに設定することを意味することがある。親リンク以外のものに対しても同様である。
ステップS411では、親リンクは設定済みであるか判定する。設定済みでなければステップS416で差分ビット位置から値を1減らしてステップS409に戻り、一方、設定済みであればステップS412に進む。
In step S410, the parent link is read from the entry indicated by the difference bit position from the difference bit position table. If the parent link is stored in the entry indicated by the difference bit position, the read parent link is set as the parent link which is the primary storage area. That is, a notation such as “read parent link” in the description of this embodiment may mean that the parent link is read and set to a parent link which is a primary storage area (not shown). The same applies to items other than the parent link.
In step S411, it is determined whether the parent link has been set. If it has not been set, the value is decremented by 1 from the difference bit position in step S416, and the process returns to step S409.
ステップS412では、キー表より、ステップS410で設定した親リンク(キー表の読出位置)の指すキーをソート済みキーとして取り出し、その取り出したソート済みキーをソート済みキー表に設定する。先に説明したように、差分ビット位置表にその読出位置が格納されているキーは、同一の差分ビット位置に分類されたキーのうちの最小値キーであるので、ステップS412でソート済みキー表に設定する。 In step S412, the key pointed to by the parent link (key table read position) set in step S410 is extracted from the key table as a sorted key, and the extracted sorted key is set in the sorted key table. As described above, since the key whose read position is stored in the difference bit position table is the minimum value key among the keys classified into the same difference bit position, the sorted key table in step S412. Set to.
次にステップS413で、リンク表より、ステップS410で設定した親リンクの指すリンクを次リンクとして読み出し、ステップS414で、差分ビット位置表の、差分ビット位置の指す親リンクを削除してステップS415に進む。ここで差分ビット位置表の差分ビット位置の指す親リンクを削除するのは、キー表の読出位置が親リンクである最小値キーの分類処理はステップS412で完了しており、もはや差分ビット位置表上のこの親リンクは必要がないことと、この親リンクが差分ビット位置表に残っていることによる後続の処理への影響を避けるためである。 Next, in step S413, the link pointed to by the parent link set in step S410 is read from the link table as the next link. In step S414, the parent link pointed to by the difference bit position in the difference bit position table is deleted, and the flow returns to step S415. move on. Here, the parent link pointed to by the difference bit position in the difference bit position table is deleted because the minimum value key classification process in which the reading position of the key table is the parent link has been completed in step S412, and the difference bit position table no longer exists. This is because the above parent link is not necessary and the influence on the subsequent processing due to this parent link remaining in the difference bit position table is avoided.
ステップS415では、ステップS413で読み出した次リンクとステップS410で設定した親リンクが同一であるか判定する。
ステップS415で次リンクと親リンクが同一であると判定されると、先に説明したステップS416を経由してステップS409に戻る。
上述のステップS409〜ステップS416のループ処理により、差分ビット位置の降順でソート済みキーの取り出しとソート済みキー表への格納が行われる。より大きい差分ビット位置を有するキーの値がより最小値キーの値に近いので、差分ビット位置の降順でソート済みキーを取り出すことにより、昇順でソート済みキーをソート済みキー表へ格納することができる。
In step S415, it is determined whether the next link read in step S413 is the same as the parent link set in step S410.
If it is determined in step S415 that the next link and the parent link are the same, the process returns to step S409 via step S416 described above.
By the loop processing from step S409 to step S416 described above, the sorted keys are extracted and stored in the sorted key table in descending order of the difference bit positions. Since the value of the key with the larger difference bit position is closer to the value of the minimum value key, the sorted key can be stored in the sorted key table in ascending order by extracting the sorted key in descending order of the difference bit position. it can.
ステップS415で次リンクと親リンクが同一であると判定されるのは、親リンクが格納された差分ビット位置を有するキーが親リンクをキー表の読出位置とするキーしか存在しない場合である。図2Aの例示では、リンク表311の読出位置621がP2でリンク622がP2の場合である。また、図1Bの例示では、キー群142aがキー“0011”のみで構成され、キー群142aについての分類処理は行われない場合に相当する。そして、この場合は差分ビット位置表に親リンクが格納された差分ビット位置についての分類処理が終了したことを意味するので、差分ビット位置から値1を減らし、次の差分ビット位置についてのステップS409〜S415の処理に進む。図1Bの例示では、差分ビット位置0のキー群140aについての処理が行われる。
In step S415, it is determined that the next link and the parent link are the same when the key having the difference bit position in which the parent link is stored has only the key having the parent link as the reading position of the key table. In the example of FIG. 2A, the
一方、ステップS415で次リンクと親リンクが同一でないと判定されると、ステップS417に進み、同一の差分ビット位置(ステップS408またはステップS416で設定されている。)を有する複数のキーを、下位の差分ビット位置によりさらに分類する。ステップS417の処理の詳細については、後に図5Cを参照して説明する。 On the other hand, if it is determined in step S415 that the next link and the parent link are not the same, the process proceeds to step S417, and a plurality of keys having the same differential bit position (set in step S408 or step S416) are subordinated. Is further classified according to the difference bit position. Details of the processing in step S417 will be described later with reference to FIG. 5C.
次リンクと親リンクが同一でないと判定される場合は、図2Aの例示では、リンク表311の読出位置621がP3でリンク622がP4の場合である。図1Bの例示では、キー群140aの複数のキーについて、差分ビット位置による分類149b、149cが実行される。
ステップS417の処理では、差分ビット位置表とリンク表が再設定され、ステップS408に戻る。そして、再設定された差分ビット位置表の親リンクの設定された差分ビット位置についての処理が繰り返される。
When it is determined that the next link and the parent link are not the same, in the example of FIG. 2A, the
In step S417, the difference bit position table and the link table are reset, and the process returns to step S408. Then, the process for the set differential bit position of the parent link in the reset differential bit position table is repeated.
上述の処理を、ステップS409において、差分ビット位置表の全ての差分ビット位置のエントリについて処理済みである、と判定されるまで繰り返し、その判定が得られるとソート対象のキーのソートが完了しているので処理を終了する。
図4Bに例示する処理は、差分ビット位置を計算する基準となるキーを最小のキーとし、差分ビット位置の降順で処理を行ってソート済みキーを昇順で取り出すものである。しかし、先に述べたように、差分ビット位置を計算する基準となるキーを最大のキーとする場合には、基準キーに対して同一の差分ビット位置を有するキーのうち最大のキーの読出位置を親リンクとし、差分ビット位置の降順で処理を行ってソート済みキーを降順で取り出すことができることは、本明細書及び図面の記載によって当業者に明らかである。
The above-described processing is repeated until it is determined in step S409 that all the differential bit position entries in the differential bit position table have been processed, and when the determination is obtained, sorting of the sorting target keys is completed. The process is terminated.
The process illustrated in FIG. 4B is a process in which the key used as a reference for calculating the difference bit position is the minimum key, the process is performed in the descending order of the difference bit positions, and the sorted keys are extracted in the ascending order. However, as described above, when the key used as the reference for calculating the difference bit position is the maximum key, the reading position of the maximum key among the keys having the same difference bit position with respect to the reference key It was a parent link, that can be taken out sorted key in descending order by performing the forward processing descending the difference bit position will be apparent to those skilled in the art by the description of the specification and drawings.
次に図5A及び図5Bを参照して本発明の一実施の形態におけるキーを分類する処理を説明する。図5A及び図5Bに記載するものは、図4Aに示すステップS406の処理、及び後述の図5Cに示すステップS524の処理の詳細な処理フローである。
図5Aは、本発明の一実施の形態におけるキーを分類する処理の前段の処理フローを説明する図である。
Next, with reference to FIG. 5A and FIG. 5B, processing for classifying keys in one embodiment of the present invention will be described. What is described in FIGS. 5A and 5B is a detailed processing flow of the processing in step S406 shown in FIG. 4A and the processing in step S524 shown in FIG. 5C described later.
FIG. 5A is a diagram for explaining the processing flow of the previous stage of the processing for classifying the keys in one embodiment of the present invention.
図に示すように、ステップS501で、ソートキーに設定されているキーと最小値キーに設定されているキーをビット列として比較し、上位0ビット目からみた最初の不一致ビットのビット位置を、差分ビット位置に設定する。ソートキーは、図4Aに示すステップS405、あるいは後述の図5Cに示すステップS522で設定されるものであり、図5A及び図5Bに示す分類処理の対象のキーである。 As shown in the figure, in step S501, the key set as the sort key and the key set as the minimum value key are compared as a bit string, and the bit position of the first non-matching bit viewed from the upper 0 bit is represented as a difference bit. Set to position. The sort key is set in step S405 shown in FIG. 4A or step S522 shown in FIG. 5C described later, and is a target key for the classification process shown in FIGS. 5A and 5B.
次にステップS502で差分ビット位置表より、ステップS501で設定した差分ビット位置の指す親リンクを読み出し、ステップS503で親リンクは設定済みであるか判定する。親リンクが設定済みでなければ、ステップS504に進み、差分ビット位置表の、差分ビット位置の指す親リンクにソートキーの読出位置を設定し、ステップS505において、リンク表の、ソートキーの読出位置の指すリンクに、ソートキーの読出位置を設定して処理を終了する。 Next, in step S502, the parent link indicated by the difference bit position set in step S501 is read from the difference bit position table, and in step S503, it is determined whether the parent link has been set. If the parent link has not been set, the process proceeds to step S504, where the sort key read position is set to the parent link pointed to by the difference bit position in the difference bit position table. In step S505, the sort key read position is pointed to. The sorting key reading position is set for the link, and the process is terminated.
差分ビット位置表には、先に述べたように同一の差分ビット位置を有するキーのうち、最小のキーの読出位置が親リンクとして格納されるが、上記ステップS504の処理は、最初のソートキーを仮の最小値キーとして、ソートキーの読出位置を差分ビット位置表の差分ビット位置の指す親リンクに設定するものである。一旦親リンクが設定済みとなった後、すなわちステップS503での判定が親リンクは設定済みになると、図5Bに示す後段の処理に進み、ソートキーと最小値キーの大小比較による最小値キーの更新が行われ、最終的には同一の差分ビット位置を有するキーのうち、最小のキーの読出位置が親リンクとして差分ビット位置表に格納される。 In the difference bit position table, the read position of the smallest key among the keys having the same difference bit position as described above is stored as the parent link. However, in the process of step S504, the first sort key is stored. As the temporary minimum value key, the read position of the sort key is set to the parent link pointed to by the difference bit position in the difference bit position table. Once the parent link has been set, that is, when the determination in step S503 is that the parent link has been set, the process proceeds to the subsequent processing shown in FIG. 5B, and the minimum value key is updated by comparing the sort key and the minimum value key. Finally, among the keys having the same difference bit position, the read position of the smallest key is stored as a parent link in the difference bit position table.
なお、ステップS504の処理におけるソートキーの読出位置は、図4Aに示すステップS405あるいは後述の図5Cに示すステップS523で設定されるものである。 Note that the sort key reading position in the processing of step S504 is set in step S405 shown in FIG. 4A or in step S523 shown in FIG. 5C described later.
図5Bは、本発明の一実施の形態におけるキーを分類する処理の後段の処理フローを説明する図である。 FIG. 5B is a diagram for explaining the processing flow of the latter stage of the processing for classifying the keys in one embodiment of the present invention.
図に示すように、ステップS506で、キー表より、親リンクの指すキーを、親ソートキーとして読み出し、ステップS507において、ソートキーは親ソートキーより小さいか判定する。 As shown in the figure, in step S506, the key pointed to by the parent link is read from the key table as the parent sort key, and in step S507, it is determined whether the sort key is smaller than the parent sort key.
ステップS507でソートキーは親ソートキーより小さいと判定されると、ステップS508に進み、差分ビット位置表の、差分ビット位置の指す親リンクにソートキーの読出位置を設定し、ステップS509でリンク表の、ソートキーの読出位置の指すリンクに、ステップS502で得た親リンクを設定して処理を終了する。 If it is determined in step S507 that the sort key is smaller than the parent sort key, the process advances to step S508 to set the sort key read position to the parent link pointed to by the difference bit position in the difference bit position table, and in step S509, the sort key of the link table. The parent link obtained in step S502 is set to the link pointed to by the read position, and the process ends.
上述のステップS508の処理は、差分ビット位置表の差分ビット位置の指す親リンクに同一の差分ビット位置を有するキーのうちで最小のキーの読出位置を設定するために、より小さいキーの読出位置で親リンクを更新するものである。そして、ステップS509の処理は、差分ビット位置表に新たに設定されたソートキーの読出位置の指すリンク表のリンクに、差分ビット位置表に設定されていた親リンクを設定することで、リンク表に、同一の差分ビット位置を有するキーのキー表における読出位置をたどるための情報を保持させるものである。 The processing in step S508 described above is performed in order to set the read position of the smaller key among the keys having the same difference bit position in the parent link pointed to by the difference bit position in the difference bit position table. To update the parent link. Then, the process of step S509 sets the parent link set in the difference bit position table to the link of the link table pointed to by the read position of the sort key newly set in the difference bit position table. The information for tracing the reading position in the key table of the key having the same differential bit position is held.
一方、ステップS507でソートキーは親ソートキーより小さくないと判定されると、ステップS510に進み、リンク表より、親リンクの指すリンクを次リンクとして読み出し、ステップS511で、次リンクと親リンクは同一か判定する。 On the other hand, if it is determined in step S507 that the sort key is not smaller than the parent sort key, the process proceeds to step S510, and the link pointed to by the parent link is read from the link table as the next link. In step S511, the next link and the parent link are the same. judge.
ステップS511で次リンクと親リンクは同一であると判定されると、ステップS512において、リンク表の親リンクの指すリンクに、ソートキーの読出位置を設定する。そして、ステップS513において、リンク表のソートキーの読出位置の指すリンクに、ソートキーの読出位置を設定して処理を終了する。 If it is determined in step S511 that the next link and the parent link are the same, in step S512, the read position of the sort key is set to the link indicated by the parent link in the link table. In step S513, the sorting key reading position is set in the link indicated by the sorting key reading position in the link table, and the process ends.
一方、ステップS511で次リンクと親リンクは同一でないと判定されると、ステップS514に進み、リンク表の親リンクの指すリンクに、ソートキーの読出位置を設定する。そして、ステップS515において、リンク表のソートキーの読出位置の指すリンクに、ステップS510で得た次リンクを設定して処理を終了する。 On the other hand, if it is determined in step S511 that the next link and the parent link are not the same, the process advances to step S514 to set the sort key reading position to the link pointed to by the parent link in the link table. In step S515, the next link obtained in step S510 is set to the link pointed to by the read position of the sort key in the link table, and the process ends.
上述のステップS511の判定は、同一の差分ビット位置を有するキーのうちで分類済みのキーが1つのみであったかの判定と同じである。分類済みのキーが1つのみであればこのキーの読出位置の指すリンク表のリンクにはその読出位置が格納されている。そこで、それをソートキーの読出位置で更新し、ソートキーの読出位置の指すリンク表のリンクにソートキーの読出位置を設定してソートキーが、その時点での最後の分類済みのキーであることを示す。分類済みのキーが2つ以上のときは、ステップS514とステップS515の処理により、リンク表で表現される親リンクと次リンクのリンク関係の間に、ソートキーの読出位置を挿入する。 The determination in step S511 described above is the same as the determination as to whether there is only one classified key among keys having the same differential bit position. If there is only one classified key, the read position is stored in the link of the link table indicated by the read position of this key. Therefore, it is updated at the read position of the sort key, and the read position of the sort key is set in the link of the link table pointed to by the read position of the sort key to indicate that the sort key is the last classified key at that time. When there are two or more classified keys, the sort key read position is inserted between the link relationship between the parent link and the next link expressed in the link table by the processing of step S514 and step S515.
次に図5Cを参照して、図4Bに示すステップS417の処理である、本発明の一実施の形態における同一の差分ビット位置を有する複数のキーをさらに分類する処理の詳細な処理フローを説明する。
図5Cは、本発明の一実施の形態における同一の差分ビット位置を有する複数のキーをさらに分類する処理の詳細な処理フローを説明する図である。
Next, with reference to FIG. 5C, a detailed processing flow of processing for further classifying a plurality of keys having the same difference bit position in the embodiment of the present invention, which is processing in step S417 shown in FIG. 4B, will be described. To do.
FIG. 5C is a diagram illustrating a detailed process flow of a process of further classifying a plurality of keys having the same differential bit position in the embodiment of the present invention.
図に示すように、ステップS521において、最小値キーにソート済みキーを設定する。ソート済みキーは、図4Bに示すステップS412で得たものであり、後記ステップS524においてソートキーの差分ビット位置を計算するための基準となるキーである。 As shown in the drawing, in step S521, the sorted key is set as the minimum value key. The sorted key is obtained in step S412 shown in FIG. 4B, and serves as a reference key for calculating the difference bit position of the sort key in step S524 described later.
ステップS522に進み、キー表より、次リンクの指すキーをソートキーとして取り出すとともに、次リンクをソートキーの読出位置に設定する。そして、ステップS523において、リンク表より次リンクの指すリンクを読み出して退避エリアに退避する。ステップS522における次リンクは、図4Bに示すステップS413において、リンク表より読み出された親リンクの指すリンクである。図2Aの例の差分ビット位置0を有するキーの分類処理であれば、親リンクがP3、次リンクがP4、そして次リンクの指すリンクであって退避エリアに退避されるリンクはP1である。
Proceeding to step S522, the key pointed to by the next link is extracted from the key table as a sort key, and the next link is set as the read position of the sort key. In step S523, the link pointed to by the next link is read from the link table and saved in the save area. The next link in step S522 is a link indicated by the parent link read from the link table in step S413 shown in FIG. 4B. In the case of the classification processing of the key having the
ステップS523において次リンクの指すリンクを退避するのは、次のステップS524において、ステップS522で設定したソートキーの、ステップS521で設定した最小値キーに対する差分ビット位置に基づく分類処理が行われ、その結果としてリンク表の次リンクの指すリンクの値が書き換えられるので、あらかじめ退避しておいて、ステップS524以後の、次リンクの指すリンクを用いた処理を正常に行うためである。 In step S523, the link pointed to by the next link is saved in the next step S524, in which the sorting key set in step S522 is classified based on the difference bit position with respect to the minimum value key set in step S521. This is because the value of the link pointed to by the next link in the link table is rewritten, so that it is saved in advance and the processing using the link pointed to by the next link after step S524 is normally performed.
ステップS524では、図5A及び図5Bを参照して詳細に説明した、ソートキーと最小値キーの差分ビット位置を得て差分ビット位置によりソートキーを分類する処理が実行される。 In step S524, the process of obtaining the difference bit position between the sort key and the minimum value key and classifying the sort key based on the difference bit position, which has been described in detail with reference to FIGS. 5A and 5B, is executed.
そして、ステップS525において、次リンクと退避リンクは一致するか判定される。退避リンクが次リンクと一致すれば、同一差分ビット位置を有する分類対象となるキーは残っていないことから処理を終了する。 In step S525, it is determined whether the next link and the save link match. If the evacuation link matches the next link, the process ends because there are no remaining keys to be classified having the same differential bit position.
一方、ステップS525において、退避リンクが次リンクと一致しないと判定されると、ステップS526において退避リンクを次リンクに設定してステップS522に戻り、新しく設定された次リンクをキー表の読出位置とするキーを分類対象のソートキーとして分類処理を継続する。 On the other hand, if it is determined in step S525 that the save link does not match the next link, the save link is set as the next link in step S526, and the process returns to step S522, and the newly set next link is set as the key table read position. The classification process is continued using the key to be sorted as the sort key to be classified.
上述のステップS522〜S526のループ処理を、退避リンクが次リンクと一致するまで、すなわち分類処理の対象となるキーがなくなるまで繰り返し、分類処理の対象となるキーがなくなると処理を終了する。 The loop processing of steps S522 to S526 described above is repeated until the save link matches the next link, that is, until there is no key to be classified, and the processing is ended when there is no key to be classified.
以上、本発明の最良の実施形態に詳細に説明した。以下においては、本発明の理解をさらに容易にするために、図1B及び図2Aの例示についての処理を、図6A〜図7を参照して説明する。 The best embodiment of the present invention has been described in detail above. In the following, in order to further facilitate the understanding of the present invention, the processing of the example of FIGS. 1B and 2A will be described with reference to FIGS. 6A to 7.
図6Aは、本発明の一実施の形態におけるキーを昇順に取り出す初段の処理のデータの流れを説明する図である。
図6Aの(a)に示すのは、キー列100に含まれるキーをキー表309に設定するデータの流れである。
FIG. 6A is a diagram for explaining the data flow of the first-stage processing for extracting keys in ascending order according to an embodiment of the present invention.
FIG. 6A shows a data flow for setting the keys included in the
キー位置100aのキー“1111”は、点線の矢印651aで示すように、キー表309の読出位置P1に設定される。同様に、キー位置100bのキー“0011”は、点線の矢印651bで示すように、キー表309の読出位置P2に設定され、キー位置100cのキー“1010”は、点線の矢印651cで示すように、キー表309の読出位置P3に設定され、キー位置100eのキー“1110”は、点線の矢印651eで示すように、キー表309の読出位置P4に設定される。キー位置100dのキー“0001”は、点線の矢印651dで示すように、最小値キーとしてキー表309の読出位置P0に設定される。
The key “1111” at the
図6Aの(b)に示すのは、初段の分類処理で最小値キーがソート済みキーとして取り出され、最小値キーを基準のキーとした差分ビット位置によりソート対象のキーを分類した状態である。先に図2Aに示したものと類似のものである。キー表309の先頭の読出位置P0に設定された最小値キー“0001”は、矢印689cに示すように、ソート済みキー表313の先頭の書込位置640aに設定される。
FIG. 6A (b) shows a state in which the minimum value key is extracted as the sorted key in the first-stage classification process, and the sorting target key is classified by the difference bit position using the minimum value key as a reference key. . It is similar to that shown previously in FIG. 2A. The minimum value key “0001” set at the head reading position P0 of the key table 309 is set at the
また、図の点線の矢印660aに示すように、差分ビット位置が0である3つのキーのうち最小のキーである“1010”の読出位置P3が差分ビット位置表310の差分ビット位置0に親リンクとして格納され、差分ビット位置が2である1つのキーであって最小のキーである“0011”の読出位置P2が差分ビット位置表310の差分ビット位置2に親リンクとして格納される。
Also, as indicated by the dotted
リンク表311には、点線の矢印673b及び672bに示すように、差分ビット位置表310に設定された親リンクの読出位置621に、同一の差分ビット位置を有するキーの読出位置が格納されている。すなわち、親リンクP3が指す読出位置621にはリンク622としてP4が、親リンクP2が指す読出位置621にはリンク622としてP2が格納されている。
In the link table 311, as indicated by dotted
点線の矢印674cに示すように、リンクP4が指す読出位置621にはリンク622としてP1が格納され、リンクP1が指す読出位置621には、同一の読出位置P1がリンク622として格納されている。これは、同一の差分ビット位置0を有するキーがそれ以上存在しないことを表している。すなわち、キー表309の読出位置P1のキー“1111”がリンク表311において同一差分ビット位置のキーの最後のキーであることを示している。
As indicated by a
読出位置621がP2のリンク622にP2が格納されているのは、キー表309の読出位置P2のキー“0011”がリンク表311において同一差分ビット位置のキーの唯一のキーであることに対応している。
図6Aの(b)に示す差分ビット位置表310とリンク表311の設定については、後に図7を参照して詳細に説明する。
The fact that P2 is stored in the
The setting of the difference bit position table 310 and the link table 311 shown in (b) of FIG. 6A will be described in detail later with reference to FIG.
図6Aの(c)に示すのは、初段の分類処理で分類されたキー群のうち、差分ビット位置611が2である親リンクP2を読出位置とするキー“0011”を含むキー群(実際には1つのキーしか含まない。)の最小値キー“0011”をソート済みキーとしてソート済みキー表313に格納する流れを説明する図である。
FIG. 6C shows a key group including the key “0011” having the parent link P2 whose
親リンク612は、差分ビット位置表310の差分ビット位置611の降順で取り出される。図の例の場合、矢印682で示す差分ビット位置611が2であるエントリの親リンクP2が取り出され、図の矢印682bに示すように、キー表309の親リンクP2の指す読出位置601からキー“0011”が読み出され、矢印682cに示すようにソート済みキー表313の書込位置640bに書き出される。
The
一方、矢印672bに示す親リンクP2に対応するリンク表311の読出位置621に格納されたリンク622は親リンク612と同一のP2であるから、差分ビット位置2に関するさらなる分類は行われない。そこで、差分ビット位置表310の差分ビット位置2に格納されていた親リンクP2は、以降の処理の妨げにならないように削除される。
On the other hand, since the
図6Bは、本発明の一実施の形態におけるキーを昇順に取り出す中段の処理のデータの流れを説明する図である。
図6Bの(d)に示すのは、図6Aの(c)に示す差分ビット位置2についての処理に続いて、図の矢印680aで示すように差分ビット位置0についての分類処理を開始するときの、差分ビット位置表310とリンク表311の状態である。この状態は、差分ビット位置表の差分ビット位置2のエントリから親リンクP2が削除されている点を除いて、図6Aの(b)に示すものと同様である。ただし、リンク表311の読出位置P2のエントリの値は不必要なので省略している。
FIG. 6B is a diagram for explaining the data flow of the middle stage processing for extracting the keys in ascending order according to the embodiment of the present invention.
FIG. 6B (d) shows a case where the classification process for the
図6Bの(e)に示すのは、図6Aの(b)に示す最小値キー“0001”を基準のキーとしたときの差分ビット位置が0であるキーの分類処理の流れを示すものである。図1Bの例示では、差分ビット位置による分類149bに相当する。
FIG. 6B (e) shows the flow of the classification process of the key whose difference bit position is 0 when the minimum value key “0001” shown in FIG. 6A (b) is used as a reference key. is there. In the illustration of FIG. 1B, it corresponds to the
矢印680aで示す差分ビット表310の差分ビット位置0の親リンクP3が取り出され、点線の矢印683bで示すP3を読出位置とするキー表309からの点線の矢印683dに示すように、キー表309の読出位置P3に格納されたキー“1010”、すなわち親リンクP3の指すキーが図4Bに示すステップS412でソート済みキーとして取り出されて一時記憶領域であるソート済みキー650に設定され、さらにソート済みキー表313の書込位置640cに書き出される。
The parent link P3 at the
一方、ソート済みキー650に設定された、先の分類対象キーのうちの最小値キーであるキー“0001”について同一の差分ビット位置0を有するキーのうち最小の値のキーであるキー“1010”と、同一の差分ビット位置0を有するキー“1111”と“1110”との差分ビット位置1が計算され、図の点線の矢印661aが示すように、小さいほうのキーの読出位置であるP4が差分ビット位置表310の差分ビット位置621が1であるエントリに親リンク612として格納される。
On the other hand, the key “1010” which is the minimum value key among the keys having the same
さらに矢印674bに示すように、親リンクP4の指すリンク表311のリンク622には読出位置P1が格納され、その読出位置P1が指すリンク表311のリンクには、矢印671cで示すように同じP1が格納されている。
Further, as shown by an
図6Bの(f)に示すのは、図6Bの(e)に示す最小値キー“1010”を基準のキーとしたときの差分ビット位置が3であるキーの分類処理の流れを示すものである。図1Bの例示では、差分ビット位置による分類149cに相当する。
FIG. 6B (f) shows the flow of the classification process of the key whose difference bit position is 3 when the minimum value key “1010” shown in (e) of FIG. 6B is used as a reference key. is there. In the example of FIG. 1B, it corresponds to the
矢印681aで示す差分ビット表310の差分ビット位置1の親リンクP4が取り出され、点線の矢印684bで示すP4を読出位置とするキー表309からの点線の矢印684dに示すように、キー表309の読出位置P4に格納されたキー“1110”、すなわち親リンクP4の指すキーが図4Bに示すステップS412でソート済みキーとして取り出されて一次記憶領域であるソート済みキー650に設定され、さらにソート済みキー表313の書込位置640dに書き出される。
The parent link P4 at the
一方、ソート済みキー650に設定された、先の分類対象キーのうちの最小値キーであるキー“1010”について同一の差分ビット位置1を有するキーのうち最小の値のキーであるキー“1110”と、同一の差分ビット位置1を有するキー“1111”との差分ビット位置3が計算され、図の点線の矢印662aが示すように、小さいほう、すなわち唯一のキーの読出位置であるP1が差分ビット位置表310の差分ビット位置621が3であるエントリに親リンク612として格納される。
さらに矢印671bに示すように、親リンクP1の指すリンク表311のリンク622には親リンクと同じ値のP1が格納される。
On the other hand, for the key “1010” that is the minimum value key among the previous classification target keys set as the
Further, as indicated by an
図6Cは、本発明の一実施の形態におけるキーを昇順に取り出す終段の処理のデータの流れを説明する図である。すなわち図6Bの(f)に示す処理により、差分ビット位置表310には、差分ビット位置3のエントリの親リンクP1だけが格納されている。
FIG. 6C is a diagram for explaining the data flow of the final stage processing for extracting the keys in ascending order according to the embodiment of the present invention. That is, only the parent link P1 of the entry of the
差分ビット位置表310の差分ビット位置611の降順で親リンク612が取り出されるので、図の例の場合、矢印683aで示す差分ビット位置611が3であるエントリの親リンクP1が取り出され、図の矢印681bに示すように、キー表309の親リンクP1の指す読出位置601からキー“1111”が読み出され、矢印681cに示すようにソート済みキー表313の書込位置640eに書き出される。
Since the
一方、矢印671bに示す親リンクP1に対応するリンク表311の読出位置621に格納されたリンク622は親リンク612と同一のP1であるから、差分ビット位置3に関するさらなる分類は行われない。そこで、差分ビット位置表310の差分ビット位置3に格納されていた親リンクP1は、削除される。
すると、差分ビット位置表310の全ての親リンクは削除され、全ての差分ビット位置についての処理は完了するので、すべての処理を終了する。
On the other hand, since the
Then, all the parent links in the difference bit position table 310 are deleted, and the processes for all the difference bit positions are completed, so all the processes are ended.
図7は、初段の分類処理のデータの流れ、すなわち、図6Aの(b)に示す差分ビット位置表310とリンク表311の設定を説明する図である。
図7の(a)に示すのは、キー表309にキー602が設定され、差分ビット位置表310とリンク表311には何も設定されていない、初期状態である。
FIG. 7 is a diagram for explaining the data flow of the first-stage classification process, that is, the setting of the difference bit position table 310 and the link table 311 shown in FIG. 6A (b).
FIG. 7A shows an initial state in which the key 602 is set in the key table 309 and nothing is set in the difference bit position table 310 and the link table 311.
なお、読出位置P2に格納されるキー“0011”は省略されている。キー“0011”については、最小値キー“0001”に対する差分ビット位置が2であるキーが唯一のものである。したがって、図5Aに示すステップS504とステップS505で、差分ビット位置表とリンク表311の読出位置P2に関する設定が一度で完成するので、その設定の理解が容易なものであるから省略した。 The key “0011” stored at the reading position P2 is omitted. As for the key “0011”, the key whose difference bit position is 2 with respect to the minimum value key “0001” is the only one. Therefore, since the setting regarding the read position P2 of the difference bit position table and the link table 311 is completed at one time in steps S504 and S505 shown in FIG. 5A, it is omitted because it is easy to understand the setting.
図7の(b)に示すのは、キー表309の読出位置P1に格納されたキー“1111”に関する処理のデータの流れである。点線680dと681dで示すように、読出位置P0に格納された最小値キー“0001”とのビット列比較により差分ビット位置0が計算され、点線の矢印660aに示すように、差分ビット位置表310の差分ビット位置0に読出位置P1が設定される。また、点線の矢印671bで示すように、リンク表311の読出位置P1に、P1が設定される。
FIG. 7B shows a data flow of processing relating to the key “1111” stored at the reading position P1 of the key table 309. As indicated by
図7の(c)に示すのは、キー表309の読出位置P3に格納されたキー“1010”に関する処理のデータの流れである。点線680dと683dで示すように、読出位置P0に格納された最小値キー“0001”とのビット列比較により差分ビット位置0が計算される。そして、差分ビット位置表310の差分ビット位置0に設定されている親リンクP1を読出位置とするキー“1111”との大小比較が図5Bに示すステップS507で行われる。読出位置P3のキーの方が小さいので、点線の矢印660aに示すように、差分ビット位置表310の差分ビット位置0のエントリは読出位置P3に更新される。また、点線の矢印673bで示すように、リンク表311の読出位置P3に、P1が設定される。この設定により、矢印671cで示すように読出位置P3のキーと読出位置P1のキーの差分ビット位置が同一であるというリンク関係が保持される。
FIG. 7C shows a data flow of processing relating to the key “1010” stored at the reading position P3 of the key table 309. As indicated by
図7の(d)に示すのは、キー表309の読出位置P4に格納されたキー“1110”に関する処理のデータの流れである。点線680dと684dで示すように、読出位置P0に格納された最小値キー“0001”とのビット列比較により差分ビット位置0が計算される。そして、差分ビット位置表310の差分ビット位置0に設定されている親リンクP3を読出位置とするキー“1010”との大小比較が図5Bに示すステップS507で行われる。読出位置P4のキーの方が大きいので、点線の矢印660aに示すように、差分ビット位置表310の差分ビット位置0の読出位置P3は更新されない。しかし、点線の矢印673bで示すように、リンク表311の読出位置P3のエントリはP4に更新される。そして、矢印674cで示すように、リンク表311の読出位置P4にP1が設定される。この設定により、矢印674cと矢印671cで示すように、読出位置P3のキー、読出位置P4のキー及び読出位置P1のキーの差分ビット位置が同一であるというリンク関係が保持される。
以上のデータの流れ(読出位置P2については省略)により、初段の分類処理による差分ビット位置表310とリンク表311の設定が行われる。
FIG. 7D shows a data flow of processing relating to the key “1110” stored at the reading position P4 of the key table 309. As indicated by
The difference bit position table 310 and the link table 311 are set by the first-stage classification process according to the above data flow (the reading position P2 is omitted).
以上本発明を実施するための最良の形態について詳細に説明したが、本発明の実施の形態はそれに限ることなく種々の変形が可能であることは当業者に明らかである。
また、本発明のビット列データソート装置が、図2Aに例示するデータ構造を有する記憶手段と図4A及び図4Bに示す処理をコンピュータに実行させるプログラムによりコンピュータ上に構築可能なことは明らかである。
したがって、上記プログラム、及びプログラムを記録したコンピュータ読み取り可能な記録媒体は、本発明の実施の形態に含まれる。
以上詳細に説明した本発明が提供する新しいビット列データソート手法を用いることにより、より高速なビット列データのソートを行うことが可能となる。
Although the best mode for carrying out the present invention has been described in detail above, it is obvious to those skilled in the art that the embodiment of the present invention is not limited thereto and can be variously modified.
In addition, it is obvious that the bit string data sorting apparatus of the present invention can be constructed on a computer by a storage unit having the data structure illustrated in FIG. 2A and a program that causes the computer to execute the processes illustrated in FIGS. 4A and 4B.
Therefore, the program and a computer-readable recording medium recording the program are included in the embodiment of the present invention.
By using the new bit string data sorting method provided by the present invention described in detail above, it is possible to sort bit string data at higher speed.
100 キー列
130 ソート済みキー列
149a、149b、149c 差分ビット位置による分類
200 ビット列データソート装置
210 差分ビット位置計算手段
220 差分ビット位置分類手段
230 ソート済みキー出力手段
240 制御手段
301 データ処理装置
302 中央処理装置
303 キャッシュメモリ
304 バス
305 主記憶装置
306 外部記憶装置
307 通信装置
308 データ格納装置
309 キー表
310 差分ビット位置表
311 リンク表
313 ソート済みキー表
100
Claims (10)
前記ソート対象のキーを記憶するソート対象キー記憶手段と、
前記ソート対象キー記憶手段に記憶された前記ソート処理を構成する分類処理の分類対象である前記キーと、該分類対象であるキーのうち基準となるキーと、のビット列比較により、最初に異なるビット値となる差分ビット位置を求める差分ビット位置計算手段と、
前記差分ビット位置計算手段で求めた差分ビット位置毎に該差分ビット位置を有するキーの識別情報を記憶する分類対象キー差分ビット位置記憶手段と、
前記差分ビット位置計算手段で求めた前記差分ビット位置毎に該差分ビット位置を有するキーの識別情報を前記分類対象キー差分ビット位置記憶手段に書き込むことにより、前記分類対象であるキーを同一の差分ビット位置を有する組に分類する差分ビット位置分類手段と、
前記差分ビット位置分類手段で分類された同一の差分ビット位置を有するキーが1つの場合はそのキーを、同一の差分ビット位置を有するキーが複数の場合はそのうちの次の分類処理において基準となるキーをソート済みキーとして出力するソート済みキー出力手段と、
前記差分ビット位置計算手段、前記差分ビット位置分類手段及び前記ソート済みキー出力手段を制御する制御手段と、
を備え、
前記制御手段は、
前記差分ビット位置計算手段が、前記差分ビット位置計算手段の最初の処理における前記分類対象をソート対象のキー全体とし、以後、前記差分ビット位置分類手段で分類された同一の差分ビット位置を有するキーを複数含むキーの組を前記分類対象として前記差分ビット位置をもとめることを繰り返し、
前記差分ビット位置分類手段が、前記差分ビット位置計算手段で求められた差分ビット位置毎に同一の差分ビット位置を有する組に分類することを繰り返し、
前記ソート済みキー出力手段は、前記差分ビット位置分類手段が前記差分ビット位置毎に同一の差分ビット位置を有する組に分類するたびに、該同一の差分ビット位置を有するキーが1つの場合のキー及び前記基準となるキーをソート済みキーとして出力するように、
前記差分ビット位置計算手段、前記前記差分ビット位置分類手段及び前記ソート済みキー出力手段を制御し、
前記分類対象であるキーのうち基準となるキーを、分類対象であるキーのうち最小の値をとる最小値キーあるいは最大の値をとる最大値キーとすること
を特徴とするビット列データソート装置。 In the bit string data sort device that performs the sort process of the key to be sorted represented by the bit string,
Sort target key storage means for storing the sort target key;
The bit that is initially different by the bit string comparison between the key that is the classification target of the classification process that constitutes the sort process stored in the sort target key storage unit and the key that is the reference among the keys that are the classification target A difference bit position calculation means for obtaining a difference bit position as a value;
Classification target key difference bit position storage means for storing identification information of a key having the difference bit position for each difference bit position obtained by the difference bit position calculation means;
For each difference bit position obtained by the difference bit position calculation means, the identification information of the key having the difference bit position is written in the classification target key difference bit position storage means, so that the key to be classified is the same difference. Differential bit position classification means for classifying into sets having bit positions;
When there is one key having the same differential bit position classified by the differential bit position classification means, that key is used, and when there are a plurality of keys having the same differential bit position, it becomes a reference in the next classification process. Sorted key output means for outputting keys as sorted keys,
And control means for controlling the difference bit position calculating means, before Symbol differencing bit position classifying means and the sorted key output means,
With
The control means includes
The difference bit position calculation means sets the classification target in the first processing of the difference bit position calculation means as a whole sort target key, and thereafter has the same difference bit position classified by the difference bit position classification means. Repeatedly determining the difference bit position as a classification target of a set of keys including a plurality of
The difference bit position classification means repeats classifying into a set having the same difference bit position for each difference bit position obtained by the difference bit position calculation means,
Each time the sorted bit output means classifies the difference bit position classifying means into a set having the same difference bit position for each difference bit position, the key in the case where there is one key having the same difference bit position and to output the key serving as the reference as a sorted key,
Controlling the difference bit position calculation means, the difference bit position classification means and the sorted key output means ,
A bit string data sorting apparatus characterized in that a key serving as a reference among the keys to be classified is a minimum value key having a minimum value or a maximum value key having a maximum value among keys to be classified .
前記キーを識別する情報は、該キーが記憶された前記ソート対象キー記憶手段における該キーのアドレスである読出位置であり、
前記分類対象キー差分ビット位置記憶手段は、前記分類対象であるキーと該分類対象であるキーのうち基準となるキーである前記最小値キーあるいは最大値キーとの差分ビット位置毎に、該最小値キーあるいは最大値キーに対する同一の差分ビット位置を有するキーのうち、最小あるいは最大のキーの前記読出位置である親リンクを格納する差分ビット位置表と、前記読出位置毎に該読出位置のキーと前記同一の差分ビット位置を有するキーの読出位置であるリンクを格納するリンク表から構成されることを特徴とするビット列データソート装置。 The bit string data sorting device according to claim 1 ,
The information for identifying the key is a reading position that is an address of the key in the sort target key storage unit in which the key is stored,
The classification target key difference bit position storage means stores the minimum for each difference bit position between the key to be classified and the minimum value key or the maximum value key that is a reference key among the classification target keys. Among the keys having the same difference bit position with respect to the value key or the maximum value key, a difference bit position table storing the parent link which is the reading position of the minimum or maximum key, and the key of the reading position for each reading position And a bit table data sorting device comprising a link table for storing a link which is a reading position of a key having the same differential bit position.
前記同一の差分ビット位置を有するキーの前記キー表の読出位置をリンク表の読出位置とするリンクは、該リンクをリンク表の読出位置とし、さらに該読出位置に設定されたリンクをたどることにより、前記同一の差分ビット位置を有する全てのキーの前記ソート対象キー記憶手段の読出位置を参照するために設定されており、該同一の差分ビット位置を有するキーのうちの最後のキーの読出位置のリンクには、該最後のキーの読出位置が格納されていることを特徴とするビット列データソート装置。 In the bit string data sorting device according to claim 2 ,
A link having the key table read position of the key having the same differential bit position as the link table read position is set as the link table read position, and the link set in the read position is followed. The read position of the last key among the keys having the same differential bit position is set to refer to the read positions of the sort target key storage means for all the keys having the same differential bit position. The bit string data sorting device is characterized in that the read position of the last key is stored in the link.
前記制御手段は、前記差分ビット位置分類手段が、前記差分ビット位置表の差分ビット位置の降順あるいは昇順に、該差分ビット位置に格納された前記親リンクを読出位置とするキーと同一の差分ビット位置を有する組を分類することを繰り返すように、制御することを特徴とするビット列データソート装置。 In the bit string data sorting device according to claim 3,
The control means has the same difference bit as the key in which the difference bit position classification means uses the parent link stored in the difference bit position as a reading position in descending or ascending order of the difference bit position in the difference bit position table. A bit string data sorting device, characterized in that control is performed so as to repeatedly classify sets having positions.
前記ソート対象のキーを記憶するソート対象キー記憶手段に前記ソート対象のキーを記憶するソート対象キー記憶ステップと、
前記ソート対象キー記憶手段に記憶された前記ソート処理を構成する分類処理の分類対象である前記キーと、該分類対象であるキーのうち基準となるキーと、のビット列比較により、最初に異なるビット値となる差分ビット位置を求める差分ビット位置計算ステップと、
前記差分ビット位置計算ステップで求めた差分ビット位置毎に、分類対象キー差分ビット位置記憶手段に該差分ビット位置を有するキーの識別情報を書き込むことにより、前記分類対象であるキーを同一の差分ビット位置を有する組に分類する差分ビット位置分類ステップと、
前記差分ビット位置分類ステップで分類された同一の差分ビット位置を有するキーが1つの場合はそのキーを、同一の差分ビット位置を有するキーが複数の場合はそのうちの次の分類処理において基準となるキーをソート済みキーとして出力するソート済みキー出力ステップと、
前記差分ビット位置計算ステップ、前記差分ビット位置分類ステップ及び前記ソート済みキー出力ステップを制御する制御ステップと、
を備え、
前記制御ステップは、
最初の処理における前記分類対象をソート対象のキー全体として前記差分ビット位置計算ステップを実行し、以後、前記差分ビット位置分類ステップで分類された同一の差分ビット位置を有するキーを複数含むキーの組を前記分類対象として前記差分ビット位置計算ステップを繰り返し、
前記差分ビット位置計算ステップで求められた差分ビット位置毎に同一の差分ビット位置を有する組に分類する前記差分ビット位置分類ステップを繰り返し、
前記差分ビット位置分類ステップが前記差分ビット位置毎に同一の差分ビット位置を有する組に分類するたびに、前記ソート済みキー出力ステップが、該同一の差分ビット位置を有するキーが1つの場合のキー及び前記基準となるキーをソート済みキーとして出力するように、前記差分ビット位置計算ステップ、前記前記差分ビット位置分類ステップ及び前記ソート済みキー出力ステップを制御するものであり、
前記分類対象であるキーのうち基準となるキーを、分類対象であるキーのうち最小の値をとる最小値キーあるいは最大の値をとる最大値キーとする、
ことを特徴とするビット列データソート方法。 In the bit string data sorting method for sorting the sort target key represented by the bit string,
A sort target key storage step of storing the sort target key in a sort target key storage means for storing the sort target key;
The bit that is initially different by the bit string comparison between the key that is the classification target of the classification process that constitutes the sort process stored in the sort target key storage unit and the key that is the reference among the keys that are the classification target A difference bit position calculation step for obtaining a difference bit position as a value;
For each difference bit position obtained in the difference bit position calculation step, the identification target key difference bit position storage means writes the identification information of the key having the difference bit position to make the key to be classified the same difference bit. A differential bit position classification step for classifying into sets having positions;
If there is a single key having the same differential bit position classified in the differential bit position classification step, that key is used, and if there are a plurality of keys having the same differential bit position, it becomes a reference in the next classification process. A sorted key output step for outputting the key as a sorted key;
And a control step of controlling the difference bit position calculation step, before Symbol differencing bit position classification step and the sorted key output step,
With
The control step includes
A set of keys including a plurality of keys having the same difference bit position classified in the difference bit position classification step after the difference bit position calculation step is executed with the classification target in the first process as a whole sort target key Repeating the difference bit position calculation step for the classification target,
Repeating the difference bit position classification step for classifying into a set having the same difference bit position for each difference bit position obtained in the difference bit position calculation step;
Each time the difference bit position classification step classifies into a group having the same difference bit position for each difference bit position, the sorted key output step is a key when there is one key having the same difference bit position. and to output the key serving as the reference as a sorted key, the difference bit position calculation step, which controls the said difference bit position classification step and the sorted key output step,
Among the keys to be classified, the reference key is a minimum value key that takes the minimum value or a maximum value key that takes the maximum value among the keys to be classified,
A bit string data sorting method characterized by the above.
前記キーを識別する情報は、該キーが記憶された前記ソート対象キー記憶手段における該キーのアドレスである読出位置であり、
前記分類対象キー差分ビット位置記憶手段は、前記分類対象であるキーと該分類対象であるキーのうち基準となるキーである前記最小値キーあるいは最大値キーとの差分ビット位置毎に、該最小値キーあるいは最大値キーに対する同一の差分ビット位置を有するキーのうち、最小あるいは最大のキーの前記読出位置である親リンクを格納する差分ビット位置表と、前記読出位置毎に該読出位置のキーと前記同一の差分ビット位置を有するキーの読出位置であるリンクを格納するリンク表から構成されることを特徴とするビット列データソート方法。 The bit string data sorting method according to claim 5,
The information for identifying the key is a reading position that is an address of the key in the sort target key storage unit in which the key is stored,
The classification target key difference bit position storage means stores the minimum for each difference bit position between the key to be classified and the minimum value key or the maximum value key that is a reference key among the classification target keys. Among the keys having the same difference bit position with respect to the value key or the maximum value key, a difference bit position table storing the parent link which is the reading position of the minimum or maximum key, and the key of the reading position for each reading position And a bit table data sorting method comprising a link table for storing a link which is a reading position of a key having the same differential bit position.
前記同一の差分ビット位置を有するキーの前記キー表の読出位置をリンク表の読出位置とするリンクは、該リンクをリンク表の読出位置とし、さらに該読出位置に設定されたリンクをたどることにより、前記同一の差分ビット位置を有する全てのキーの前記ソート対象キー記憶手段の読出位置を参照するために設定されており、該同一の差分ビット位置を有するキーのうちの最後のキーの読出位置のリンクには、該最後のキーの読出位置が格納されていることを特徴とするビット列データソート方法。 The bit string data sorting method according to claim 6,
A link having the key table read position of the key having the same differential bit position as the link table read position is set as the link table read position, and the link set in the read position is followed. The read position of the last key among the keys having the same differential bit position is set to refer to the read positions of the sort target key storage means for all the keys having the same differential bit position. The bit string data sorting method is characterized in that the read position of the last key is stored in the link.
前記制御ステップは、前記差分ビット位置分類ステップが、前記差分ビット位置表の差分ビット位置の降順あるいは昇順に、該差分ビット位置に格納された前記親リンクを読出位置とするキーと同一の差分ビット位置を有する組を分類することを繰り返すように、制御することを特徴とするビット列データソート方法。 The bit string data sorting method according to claim 7,
In the control step, the difference bit position classification step is the same difference bit as a key that uses the parent link stored in the difference bit position as a reading position in descending or ascending order of the difference bit position in the difference bit position table. A bit string data sorting method characterized by controlling so as to repeatedly classify a set having a position.
A computer-readable storage medium storing a program for causing a computer to execute the bit string data sorting method according to any one of claims 5 to 8.
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008325692A JP4921453B2 (en) | 2008-12-22 | 2008-12-22 | Bit string data sorting apparatus, method and program |
PCT/JP2009/006001 WO2010073471A1 (en) | 2008-12-22 | 2009-11-11 | Bit string data sorting system, method, and program |
US13/067,722 US8515976B2 (en) | 2008-12-22 | 2011-06-22 | Bit string data sorting apparatus, sorting method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008325692A JP4921453B2 (en) | 2008-12-22 | 2008-12-22 | Bit string data sorting apparatus, method and program |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2010146472A JP2010146472A (en) | 2010-07-01 |
JP2010146472A5 JP2010146472A5 (en) | 2012-02-09 |
JP4921453B2 true JP4921453B2 (en) | 2012-04-25 |
Family
ID=42287131
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008325692A Expired - Fee Related JP4921453B2 (en) | 2008-12-22 | 2008-12-22 | Bit string data sorting apparatus, method and program |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP4921453B2 (en) |
WO (1) | WO2010073471A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8515976B2 (en) | 2008-12-22 | 2013-08-20 | KOUSOKUYA, Inc. | Bit string data sorting apparatus, sorting method, and program |
JP5143797B2 (en) * | 2009-08-18 | 2013-02-13 | 株式会社高速屋 | Bit string data sort device, sort method and program |
JP5165654B2 (en) * | 2009-08-30 | 2013-03-21 | 株式会社高速屋 | Bit string data sorting apparatus, method and program |
JP5512031B2 (en) * | 2012-10-19 | 2014-06-04 | 株式会社高速屋 | Bit determination circuit, bit string data selection circuit, and bit string data sequential selection circuit |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0432924A (en) * | 1990-05-23 | 1992-02-04 | Matsushita Electric Ind Co Ltd | Maximum value detector and minimum value detector |
US5396622A (en) * | 1991-12-23 | 1995-03-07 | International Business Machines Corporation | Efficient radix sorting system employing a dynamic branch table |
US5440734A (en) * | 1993-09-14 | 1995-08-08 | International Business Machines Corporation | System for MSD radix sort bin storage management |
JP4581962B2 (en) * | 2005-10-27 | 2010-11-17 | 株式会社日立製作所 | Information retrieval system, index management method and program |
JP4502223B2 (en) * | 2007-12-05 | 2010-07-14 | 株式会社エスグランツ | Bit string merge sort apparatus, method, and program |
-
2008
- 2008-12-22 JP JP2008325692A patent/JP4921453B2/en not_active Expired - Fee Related
-
2009
- 2009-11-11 WO PCT/JP2009/006001 patent/WO2010073471A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2010073471A1 (en) | 2010-07-01 |
JP2010146472A (en) | 2010-07-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4271214B2 (en) | Bit string search device, search method and program | |
CN111259627B (en) | Document analysis method, device, computer storage medium and equipment | |
JP2003044267A (en) | Data sort method, data sort device, and data sort program | |
US11715030B2 (en) | Automatic object optimization to accelerate machine learning training | |
CN111027703A (en) | Quantum line query method and device, storage medium and electronic device | |
JP4921453B2 (en) | Bit string data sorting apparatus, method and program | |
WO2018021163A1 (en) | Signature creation device, signature creation method, recording medium in which signature creation program is recorded, and software determination system | |
US8515976B2 (en) | Bit string data sorting apparatus, sorting method, and program | |
CN110471854B (en) | A Defect Report Assignment Method Based on Hybrid Reduction of High-Dimensional Data | |
US8250089B2 (en) | Bit string search apparatus, search method, and program | |
JP5143797B2 (en) | Bit string data sort device, sort method and program | |
KR20220099745A (en) | A spatial decomposition-based tree indexing and query processing methods and apparatus for geospatial blockchain data retrieval | |
CN118260346A (en) | Log fuzzy retrieval system and method based on time sequence data | |
US4989162A (en) | Method of using an accuracy valve in a conflict resolution of a forward inference | |
JP4189248B2 (en) | Database search path judgment method | |
JP2010146472A5 (en) | ||
Blake et al. | Reinforcement learning based decision tree induction over data streams with concept drifts | |
CN110990256A (en) | Open source code detection method, device and computer readable storage medium | |
JP2020077236A (en) | Search program, search method and search device | |
CN109814734B (en) | Method for correcting Chinese pinyin input and processing terminal | |
CN109740249B (en) | MUX tree logic structure optimization method, module and storage medium | |
US8195667B2 (en) | Bit string search apparatus, search method, and program | |
JP5165654B2 (en) | Bit string data sorting apparatus, method and program | |
CN110162531B (en) | A Distributed Concurrent Data Processing Task Decision-Making Method | |
JP4432475B2 (en) | Document search apparatus, document search method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20111215 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20111215 |
|
A871 | Explanation of circumstances concerning accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A871 Effective date: 20111215 |
|
A975 | Report on accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A971005 Effective date: 20120123 |
|
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: 20120131 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120202 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150210 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150210 Year of fee payment: 3 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150210 Year of fee payment: 3 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |