JPH04127321A - Sorting system by count classifying method utilizing relative key - Google Patents
Sorting system by count classifying method utilizing relative keyInfo
- Publication number
- JPH04127321A JPH04127321A JP24924190A JP24924190A JPH04127321A JP H04127321 A JPH04127321 A JP H04127321A JP 24924190 A JP24924190 A JP 24924190A JP 24924190 A JP24924190 A JP 24924190A JP H04127321 A JPH04127321 A JP H04127321A
- Authority
- JP
- Japan
- Prior art keywords
- key
- value
- record
- records
- relative
- 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.)
- Granted
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Sorting Of Articles (AREA)
Abstract
Description
【発明の詳細な説明】
〔概要]
相対キーを利用したカウント分類法によるソート方式に
関し、
ハードウェア量を少なくシ、且つ、高速に、多量のレコ
ードを、キー値の順にソートする方式を提供することを
目的とし、
複数個のレコードを格納する入力用バッファと出力用バ
ッファと、該複数個の入力レコードの作業領域と、各レ
コードの順番を付けるカウンタ領域と備えて、該入力用
バッファに格納されたレコードのキー値の順にソートし
て出力用バッファに格納するのに、上記カウンタ領域を
、唯1つ設けて、上記入力用バッファに入力される複数
個のレコードに対して、特定のレコードのキー値を基準
値として設定し、そのキー値を′0゛とし、その他のレ
コードのキー値に対して、上記基準値のキーとの相対値
である相対キーを、相対キー=(変換前のキー)−(基
準値のキー)で算出して、各レコードの相対キーを上記
作業領域に格納し、該格納した作業領域の相対キーが「
負」であるならば、上記カウンタ領域に“‘1’を加算
し、該相対キーが「正J、又は、「0」ならば、その儘
にする処理を繰り返し、上記入力用バッファの全レコー
ドに対して終了したとき、上記カウンタ領域に設定され
ている値だけ「空き」の出力用バッファをスキップした
場所に、上記基準値として設定したレコードを転送する
ことを繰り返してソートするように構成する。[Detailed Description of the Invention] [Summary] Regarding a sorting method based on a count classification method using relative keys, the present invention provides a method for sorting a large number of records in the order of key values with a small amount of hardware and at high speed. The system is equipped with an input buffer and an output buffer for storing a plurality of records, a work area for the plurality of input records, and a counter area for ordering each record. In order to sort the records in the order of their key values and store them in the output buffer, only one counter area is provided, and a specific record is Set the key value as the standard value, set that key value as '0゛, and set the relative key that is the relative value of the key of the above standard value to the key value of other records as relative key = (before conversion) The relative key of each record is calculated as (key) - (key of reference value) and stored in the above work area, and the relative key of the stored work area is "
If it is "negative", add "1" to the counter area, and if the relative key is "positive J" or "0", repeat the process to leave it as it is, and all records in the input buffer are added. When the process is finished, the record set as the reference value above is transferred to the skipped location of the "empty" output buffer by the value set in the counter area above, and then the record is sorted. .
本発明は、相対キーを利用したカウント分類法によるソ
ート方式に関する。The present invention relates to a sorting method using a count classification method using relative keys.
最近、各種の分野において、計算機システムによるデー
タ処理が行われているが、該データが多量のレコードか
ら構成されている場合、該レコード中の特定の情報をキ
ーとしてソートすることが行われる。Recently, data processing by computer systems has been carried out in various fields, and when the data consists of a large number of records, it is sorted using specific information in the records as a key.
この場合、できる限り、少ないノへ−ドウェア量(例え
ば、メモリ量)で、高速にソートできることが要求され
る。In this case, it is required to be able to sort at high speed with as little hardware (for example, memory) as possible.
〔従来の技術と発明が解決しようとする課題〕第2図は
従来のカウント分類法によるソート方式を説明する図で
あり、(a)はノー−ドウニア構成ノ例ヲ示し、(bl
)〜(b4)は、カウント分類法によるソート方式を模
式的示している。[Prior art and problems to be solved by the invention] FIG. 2 is a diagram explaining a sorting method based on the conventional count classification method, in which (a) shows an example of a Nordonia configuration;
) to (b4) schematically show a sorting method based on the count classification method.
カウント分類法によって、複数個のレコードをソートす
る場合には、(a)図に示したように、入力用バッファ
1と、出力用バッファ2と、入力レコードの作業領域3
と、各レコードの順番を付けるカウンタ領域(以下、カ
ウンタということがある)4とを必要とする。When sorting multiple records using the count classification method, (a) as shown in the figure, input buffer 1, output buffer 2, and input record work area 3 are used.
and a counter area (hereinafter sometimes referred to as a counter) 4 for assigning the order of each record.
以下、カウント分類法によるソート方式の手順を(bl
)〜(b4)によって説明する。Below, the procedure of sorting method using count classification method (bl
) to (b4).
1)先ず、カウンタ4の値を°0゛にし、最初のレコー
ド(レコード1)のキ一部のキー値(8”)を作業領域
3に入力し、入力用バッファ 1をポイントするが、そ
れ以外は何も行わない。((bl)図参照)
2)次のレコードのキー値を、該作業領域3に入力し、
既に、入力済みのレコードのキー値との検査を行う。該
検査は、以下の規則により行い、その結果に基づいて、
カウンタ4の値を調整する。1) First, set the value of counter 4 to 0, enter the key value (8") of the first record (record 1) into work area 3, and point to input buffer 1. Do nothing other than that. (See figure (bl)) 2) Input the key value of the next record into the work area 3,
Check the key value of the record that has already been input. The inspection will be conducted according to the following rules, and based on the results,
Adjust the value of counter 4.
(イ)すでに入力済みのレコードのキー値が、最新のレ
コードのキー値より小さい(キー値として強い)時、最
新のレコードのカウンタ4にl゛を加える。(b) When the key value of the record that has already been input is smaller than the key value of the latest record (stronger as a key value), add 1 to the counter 4 of the latest record.
(ロ)すでに入力済みのレコードのキー値が、最新のレ
コードのキー値より大きい(キー値として弱い)時、入
力済みのレコードのカウンタ4に°1°を加える。(b) When the key value of the record that has already been input is larger than the key value of the latest record (weak as a key value), add 1° to the counter 4 of the record that has already been input.
3) 上記2)の処理を、入力用バッファ1に入力され
ている全てのレコード(本例では、レコード1〜4)に
ついて繰り返す。3) Repeat the process in 2) for all records input to the input buffer 1 (records 1 to 4 in this example).
具体例で説明すると、レコード2のキー値(’3’)を
作業領域3に入力したとき、すでに、入力済みのレコー
ドlのキー値(’8’) との間で上記の検査を行う
。To explain with a specific example, when the key value ('3') of record 2 is input into the work area 3, the above-mentioned check is performed against the key value ('8') of record I that has already been input.
該入力済みのレコード1のキー値が、最新のレコード2
のキー値より弱い(具体的には、キー値が大きい)ので
、上記(ロ)の規則に従って、入力済みのレコードのカ
ウンタ4に°1”が加算される結果、該カウンタ4は(
b2)図に示した通りとなる。The key value of the entered record 1 is the latest record 2
is weaker than the key value (specifically, the key value is larger), so according to the rule (b) above, °1" is added to the counter 4 of the input record, and as a result, the counter 4 becomes (
b2) As shown in the figure.
次に、最新のレコード3のキー値(°2”)が作業領域
3に入力された時点では、該レコード3のキー値と、入
力済みのレコード1.2の各キー値との間で上記の検査
が行われるが、上記(ロ)の規則に従う結果、各レコー
ド1,2.3のカウンタ4の値は、「2」 「1」 「
0」となる。Next, when the key value (°2”) of the latest record 3 is input into the work area 3, the above-mentioned However, as a result of following the rule (b) above, the values of counter 4 of each record 1, 2.3 are "2", "1", "
0”.
次に、最新のレコード4のキー値(’7’)が作業領域
3に入力され、該レコード3のキー値と、入力済みのレ
コード1,2の各キー値との間で上記の検査が行われる
場合、レコードlとの間では、上記規則(ロ)に従い、
レコード2,3との間では、上記規則(イ)に従う結果
、レコード1のカウンタ3の値は“2°→“3′ とな
り、レコード2゜3のカウンタ3の値は、その優となり
、レコード4のカウンタ3には、r+1+1・2」とな
って、結局、(b3)図に示したようになる。Next, the key value ('7') of the latest record 4 is input into the work area 3, and the above inspection is performed between the key value of record 3 and each key value of records 1 and 2 that have already been input. If it is done, according to the above rule (b) with record l,
Between records 2 and 3, as a result of following the above rule (a), the value of counter 3 of record 1 becomes "2°→"3', and the value of counter 3 of record 2°3 becomes that superior. 4's counter 3 becomes "r+1+1.2", resulting in the result as shown in figure (b3).
4)入力用バッファ1に入力されている全てのレコード
のキー値に対する上記検査が終了したら、各レコードの
カウンタの値より、例えば、“l゛大きい位置の出力用
バッファ2に転送する。((b4)図参照)
上記の処理を、ソート対象の全てのレコードにツイテ、
例エバ、入力用バッファ 1のレコード数を単位にして
繰り返す。4) When the above inspection of the key values of all the records input to the input buffer 1 is completed, transfer them to the output buffer 2 at a position that is, for example, "l" larger than the counter value of each record. (( b4) See figure) Tweet the above process to all records to be sorted,
Example Eva, input buffer Iterate with the number of records in 1 as a unit.
上記、従来のカウンタ分類法でソートを行う場合、入力
用バッファ1を構成している個数と同じ数のカウンタ4
を必要とする問題と、該入力用バッファlに入力されて
いる全てのレコードに対する検査が終了するまで、出力
用バッファ2にレコードを転送することができない問題
と、該ソートの手順には、レコード間のキー値を比較す
る命令を実行する必要があり、時間がかかる問題があっ
た。When sorting is performed using the conventional counter classification method described above, the same number of counters 4 as the input buffer 1 is used.
The problem is that records cannot be transferred to the output buffer 2 until all the records input to the input buffer l have been inspected, and the sorting procedure requires There was a problem in that it was necessary to execute an instruction to compare the key values between the two, which took time.
本発明は上記従来の欠点に鑑み、相対キーを利用したカ
ウント分類法によってソートを行うのに、ハードウェア
量を少なくシ、且つ、高速に、多量のレコードを、キー
値の順にソートする方式を捉供することを目的とするも
のである。In view of the above-mentioned conventional drawbacks, the present invention provides a method for sorting a large number of records in the order of key values with a small amount of hardware and at high speed when sorting is performed using a count classification method using relative keys. The purpose is to capture and provide information.
上記の問題点は下記の如くに構成した相対キーを利用し
たカウント分類法によるソート方式によって解決される
。The above problem can be solved by a sorting method based on a count classification method using relative keys configured as follows.
複数個のレコードを格納する入力用バッファと出力用バ
ッファと、該複数個の入力レコードの作業領域と、各レ
コードの順番を付けるカウンタ領域と備えて、該入力用
バッファに格納されたレコードのキー値の順にソートし
て出力用バッファに格納する方式であって、
上記カウンタ領域を、唯1つ設けて、
上記入力用バッファに入力される複数個のレコードに対
しで、特定のレコードのキー値を基準値として設定し、
そのキー値を°0゛とし、その他のレコードのキー値に
対して、上記基準値のキーとの相対値である相対キーを
、相対キー=(変換前のキー)−(基準値のキー)で算
出して、各レコードの相対キー値を上記作業領域に格納
し、
該格納した作業領域の相対キーが「負」であるならば、
上記カウンタ領域に°‘1’を加算し、該相対キーが「
正」、又は、「0」ならば、その侭にする処理を繰り返
し、上記入力用バッファの全レコードに対して終了した
とき、上記カウンタ領域(4a)に設定されている値だ
け「空き」の出力用バッファをスキップした場所に、上
記基準値として設定したレコードを転送することを繰り
返してソートするように構成する。An input buffer and an output buffer for storing a plurality of records, a work area for the plurality of input records, a counter area for ordering each record, and a key for the records stored in the input buffer. This method sorts the values in order of value and stores them in the output buffer. Only one counter area is provided, and the key value of a specific record is sorted in the order of values and stored in the output buffer. Set as the reference value,
Let that key value be °0゛, and for the key values of other records, use the relative key that is the relative value to the key of the above standard value, relative key = (key before conversion) - (key of standard value) Calculate and store the relative key value of each record in the above work area, and if the relative key of the stored work area is "negative",
Add °'1' to the above counter area, and the relative key becomes "
If the value is ``correct'' or ``0'', the process is repeated, and when it is completed for all records in the input buffer, the ``free'' area is filled by the value set in the counter area (4a). The configuration is such that the record set as the reference value is repeatedly transferred to the skipped location in the output buffer for sorting.
即ち、本発明によれば、複数個のレコードを格納する入
力用バッファと出力用バッファと、該複数個の入力レコ
ードの作業用領域と、各レコードの順番を付けるカウン
タ領域と備えて、該入力用バッファに格納されたレコー
ドのキー値の順にソートして出力用バッファに格納する
のに、唯1つのカウンタを設けて、例えば、入力用バッ
ファの最初に入力されているレコードのキー値を基準値
として、該基準値のレコードのキー値と各レコードのキ
ー値との差を
相対キー=(変換前のキー)=(基準値のキー)として
計算し、その相対キーが、「負」であるならば、上記カ
ウンタに′1′を加算し、該相対キーが、「正」、又は
、「0」であるときは、該カウンタの値をその優とする
処理を、該入力用バッファに格納されている全てのレコ
ードに対して行う。That is, according to the present invention, the input buffer is provided with an input buffer and an output buffer for storing a plurality of records, a work area for the plurality of input records, and a counter area for ordering each record. To sort the records stored in the input buffer in the order of their key values and store them in the output buffer, a single counter is provided, for example, the key value of the record input first in the input buffer is used as a reference. As a value, calculate the difference between the key value of the record of the reference value and the key value of each record as relative key = (key before conversion) = (key of reference value), and if the relative key is "negative" If so, add '1' to the above counter, and if the relative key is "correct" or "0", perform a process on the input buffer that makes the value of the counter its superior. Perform this for all stored records.
この処理により、基準キーより強いキー値(具体的には
、キー値が小さい)を持つレコードが存在すると、その
レコードの数が、カウンタでは計数されることになるの
で、該基準キーを有するレコードを、その数だけ弱い方
向にスキップして転送することを繰り返すことでソート
を行うことができる。Through this process, if there is a record with a stronger key value (specifically, a smaller key value) than the reference key, the number of records will be counted in the counter, so the record with the reference key will be counted. Sorting can be performed by repeating the process of skipping and transferring in the weaker direction by that number.
更に、このソート方式では、レコード間の演算は、従来
のカウント分類法の比較演算ではなく、単なる減算で済
むので、それだけ、高速にソートを行うことができる。Furthermore, in this sorting method, the operation between records is not a comparison operation in the conventional count classification method, but a simple subtraction, so the sorting can be performed at a correspondingly high speed.
又、カウンタは、1組の入力用バッファに対して、唯1
個で済み、ハードウェア量を削減することができ、それ
だけ、多くのレコードを処理することができる。又、こ
のカウント分類法は、入力レコードを全て入力用バッフ
ァに読み込んでソートする内部ソート技法(即ち、入力
用バッファに入力レコードを全て読み込んでソートする
技法)であるが、前述のように、入力用バッファに入力
された最初の基準レコードに対して、他の全てのレコー
ドとの相対キーを求めた時点で、該基準となったレコー
ドを出力用バッファに転送でき、その空いた入力用バッ
ファに後続する新たなレコードを入力することができる
ので、レコードの移動とキー作成、即ち、入力用バッフ
ァへの新たなレコードの入力と、該レコードのキー値、
又は、相対キー値を作業領域に転送し、入力用バッファ
をポイントする処理が並行して行える。その結果、入力
レコードが、該入力用バッファより多くて、上記内部ソ
ート技法を利用できない場合に行う、所謂、外部ソート
技法において、該入力用バッファ分のソート結果である
ストリングを生成する時に、本発明のカウント分類法を
活用することができる効果が得られる。Also, the counter has only one counter for one set of input buffers.
It is possible to reduce the amount of hardware and process a correspondingly large number of records. In addition, this count classification method is an internal sorting technique that reads all input records into the input buffer and sorts them (that is, a technique that reads all input records into the input buffer and sorts them). When the relative keys of all other records are calculated for the first reference record input into the input buffer, the reference record can be transferred to the output buffer, and the empty input buffer is Since it is possible to input a subsequent new record, it is necessary to move the record and create a key, that is, input the new record into the input buffer, the key value of the record,
Alternatively, the process of transferring the relative key value to the work area and pointing to the input buffer can be performed in parallel. As a result, in the so-called external sorting technique, which is performed when there are more input records than the input buffer and the above internal sorting technique cannot be used, when generating a string that is the sort result for the input buffer, the main The effect of being able to utilize the count classification method of the invention is obtained.
以下本発明の実施例を図面によって詳述する。 Embodiments of the present invention will be described in detail below with reference to the drawings.
第1図が本発明の一実施例を示した図であって、(a)
は構成例を示し、(bl)〜(b6)は本発明のカウン
ト分類法によるソートの動作を模式的に示している。FIG. 1 is a diagram showing an embodiment of the present invention, (a)
shows a configuration example, and (bl) to (b6) schematically show the sorting operation by the count classification method of the present invention.
本発明においては、複数個のレコードを格納する入力用
バッファ1と出力用バッファ2と、該複数個の入力レコ
ードの作業領域3と、各レコードの順番を付けるカウン
タ領域4aとを備えて、該入力用バッファ1に格納され
たレコードのキー値の順にソートして出力用バッファ2
に格納するのに、上記カウンタ領域4aを、唯1つ設け
て、上記入力用バッファ1に入力される複数個のレコー
ドに対して、特定のレコードのキー値を基準値として設
定し、そのキー値を°0゛とじ、その他のレコードのキ
ー値に対して、上記基準値のキーとの相対値である相対
キーを、
相対キー=(変換前のキー)−(基準値のキー)で算出
して、各レコードを上記作業領域3に格納し、該格納し
た作業領域の相対キーが「負」であるならば、上記カウ
ンタ領域4に“1“を加算し、該相対キーが「正j、又
は、「0」ならば、その儘にする処理を繰り返し、上記
入力用バッファlの全レコードに対して終了したとき、
上記カウンタ領域4aに設定されている値だけ「空き」
の出力用バッファ2をスキップした場所に、上記基準値
として設定したレコードを転送することを繰り返してソ
ートする手段が、本発明を実施するのに必要な手段であ
る。尚、全図を通して同じ符号は同じ対象物を示してい
る。The present invention includes an input buffer 1 and an output buffer 2 for storing a plurality of records, a work area 3 for the plurality of input records, and a counter area 4a for ordering each record. Records stored in input buffer 1 are sorted in order of key values and output to output buffer 2.
In order to store data in the input buffer 1, only one counter area 4a is provided, and the key value of a specific record is set as a reference value for a plurality of records input to the input buffer 1, and the key value of the specific record is set as a reference value. Set the value to °0, and calculate the relative key that is the relative value to the key of the above standard value for the key value of other records as relative key = (key before conversion) - (key of standard value) Then, each record is stored in the work area 3, and if the relative key of the stored work area is "negative", "1" is added to the counter area 4, and the relative key is "positive j". , or if it is "0", repeat the process and when it is completed for all records in the input buffer l,
Only the value set in the counter area 4a above is "empty"
A means necessary to carry out the present invention is a means for sorting by repeatedly transferring the record set as the reference value to a skipped location in the output buffer 2 of the above. Note that the same reference numerals indicate the same objects throughout the figures.
以下、第1図に従って、本発明による相対キーを利用し
たカウント分類法によるソート方式を説明する。Hereinafter, a sorting method based on the count classification method using relative keys according to the present invention will be explained with reference to FIG.
本発明においては、(a)図に示したように、入力用バ
ッファl、出力用バッファ2.入力レコードのキー値を
格納する作業領域3と、唯一つのカウンタ領域(カウン
タ) 4aを設ける。In the present invention, as shown in FIG. (a), an input buffer 1, an output buffer 2. A work area 3 for storing key values of input records and only one counter area (counter) 4a are provided.
(1)先ず、カウンタ4aの値を′O°にし、最初のレ
コードlのキ一部のキー値を相対キーの基準値として、
作業領域3に該キー値を格納し、該最初のレコードの格
納されている入力用バッファ1をポイントする。 (
(bl)図参照)(2)次のレコード2のキ一部と、上
記基準値となっているレコード1のキ一部を利用して、
相対キーを、
相対キー−(変換前のキー)−(基準値のキー)の算出
式で生成し、作業領域3に格納する。((b2)図参照
)
(3)このとき、該作業領域3に格納した相対キーが「
負」ならば、カウンタ4aを°+1′シ、該相対キーが
「正」、又は、「0」ならば、該カウンタ4aは、その
侭にしておく。(1) First, set the value of the counter 4a to 'O°, and use the key value of the key part of the first record l as the reference value of the relative key.
The key value is stored in the work area 3 and points to the input buffer 1 where the first record is stored. (
(See figure (bl)) (2) Using part of the key of the next record 2 and part of the key of record 1, which is the reference value above,
A relative key is generated using the formula: relative key - (key before conversion) - (key of reference value) and stored in the work area 3. (See figure (b2)) (3) At this time, the relative key stored in the work area 3 is "
If the relative key is "negative", the counter 4a is set to +1'; if the relative key is "positive" or "0", the counter 4a is left as is.
(4)上記(2) 、 (3)の処理を、入力用バッフ
ァ1に格納されている全てのレコード(本実施例では、
レコード1〜4)に対して行う。((b3) 、 (b
4)図参照)
(5)全てのレコードに対して、上記の処理が終了した
とき、カウンタ4aの値だけ、空きの出力用バッファ2
をスキップして、その場所に、上記基準値として設定し
たレコード(レコード1)を転送する。(4) The processes in (2) and (3) above are performed on all records stored in the input buffer 1 (in this example,
Perform this for records 1 to 4). ((b3), (b
(4) Refer to the figure) (5) When the above processing is completed for all records, the output buffer 2 becomes empty by the value of the counter 4a.
is skipped and the record (record 1) set as the reference value is transferred to that location.
何故ならば、該カウンタ4aの値は、上記基準値となっ
ているキー値を持つレコードより強いキー値(具体的に
は、キー値が小さい)を持つレコードの数を示している
からである。((b5)図参照)(6)最初のレコード
1の転送が終了したら、2番目に入力したレコード2を
次の基準値を持つレコードとして設定し、上記カウンタ
4aの値を“0′にして、上記(2)〜(6)を繰り返
す。((b6)図参照)
最後のレコード(本実施例では、レコード4)を、その
時点で空いている場所に転送して、該入力用バッファ1
に格納されていたレコード1〜4に対するソート処理を
終了する。This is because the value of the counter 4a indicates the number of records that have a stronger key value (specifically, a smaller key value) than the record that has the key value that is the reference value. . (See figure (b5)) (6) When the transfer of the first record 1 is completed, set the second input record 2 as the record with the next reference value, and set the value of the counter 4a to "0". , repeat the above (2) to (6). (See figure (b6)) Transfer the last record (record 4 in this example) to the vacant location at that time, and transfer it to the input buffer 1.
The sorting process for records 1 to 4 stored in .
若し、ソート対象のレコードの数が、上記入力用バッフ
ァ1の数より多いとき、上記(5)の転送処理後に空い
た入力用バッファ1に、次のブロックの最初のレコード
(本実施例では、レコード5〜)から入力して、最初の
レコードでは、そのキー値を、次のレコード以降では、
該ブロックの最初のレコードを基準値とした相対キーを
生成して、作業領域3に格納し、カウンタ4aを上記の
ように調整することを繰り返し、該入力用バッファに一
杯になった時点で、上記基準値のレコードを出力用バッ
ファに転送することを繰り返してソートを行う。If the number of records to be sorted is greater than the number in the input buffer 1, the first record of the next block (in this example, , record 5~), and in the first record, enter that key value, and in subsequent records,
Generate a relative key using the first record of the block as a reference value, store it in the work area 3, and repeat the adjustment of the counter 4a as described above. When the input buffer is full, Sorting is performed by repeatedly transferring the record of the reference value to the output buffer.
この繰り返し処理で生成されるソート結果(これを、前
述のように、ストリングという)が全て集まった時点で
、各ストリングの先頭のレコードを生成順に取り出し、
並び変えて1本のストリングを生成することにより、該
入力用バッファ lの数より多いレコードに対するソー
トを行うことができる。このソート技法を、前述のよう
に、外部ソート技法という。When all the sorting results (called strings as mentioned above) generated by this repeated process have been collected, the first record of each string is extracted in the order of generation.
By rearranging and generating one string, it is possible to sort more records than the number of input buffers l. This sorting technique is referred to as an external sorting technique, as described above.
本発明の相対キーを利用したカウント分類法によるソー
ト方式は、上記のように、外部ソート技法のストリング
生成にも活用することができるのである。As described above, the sorting method based on the count classification method using relative keys of the present invention can also be used to generate strings for external sorting techniques.
以上、詳細に説明したように、本発明の相対キーを利用
したカウント分類法によるソート方式は、従来のカウン
ト分類法が、入力用バッファに入力されているルコード
に対して1つのカウンタ領域(カウンタ)を必要とした
のに対して、相対キーを利用することにより、カウンタ
領域が1つで済むことになり、それだけ、多くのレコー
ドを処理することができる。又、該カウント分類法は内
部ソート技法であるが、相対キーを導入することにより
、残りの全レコードに対して、相対キーを作成した時点
で、基準値としたレコードを出力用バッファに移動する
ことができるため、該レコードの移動と、次のブロック
の最初のレコードを該入力用バッファに入力し、且つ、
作業領域に、該レコードのキー値の設定、相対キーの設
定といったキー作成を並行して行うことができる。従っ
て、前述のように、外部ソート技法のストリング生成に
、本発明の相対キーを利用したカウント分類法によるソ
ート技法を活用することができる効果がある。又、相対
キーの利用により、従来のカウント分類法で必要であっ
た比較命令を極力抑えることができ、ソート実行時間を
削減することができる。As explained above in detail, the sorting method based on the count classification method using relative keys of the present invention is different from the conventional count classification method in which one counter area (counter ), whereas by using a relative key, only one counter area is required, and that much more records can be processed. Furthermore, although the count classification method is an internal sorting technique, by introducing a relative key, the record used as the reference value is moved to the output buffer at the time when relative keys are created for all remaining records. Therefore, it is possible to move the record, input the first record of the next block into the input buffer, and
Key creation such as setting the key value of the record and setting the relative key can be performed in parallel in the work area. Therefore, as described above, it is possible to utilize the sorting technique based on the count classification method using relative keys of the present invention in string generation using the external sorting technique. Furthermore, by using relative keys, the number of comparison instructions required in the conventional count classification method can be minimized, and the sorting execution time can be reduced.
第1図は本発明の一実施例を示した図。
第2図は従来のカウント分類法によるソーを説明する図
。
である。
ト方式
図面において、
1は入力用バッファ、 2は出力用バッファ。
3は作業領域。
4.4aはカウンタ領域(カウンタ)。
をそれぞれ示す。
入力用バッファ
作業領域
カウンタ領域
出力用バッファ
(b3)
入力用バッファ
作業領域
カウンタ領域
出力用バンファ
(b4)
第
図
(その2)
入力用バッファ
イ1ヨiβ11域
(a)
入力用バッファ
作業領域
(bl
入力用バッファ
作業領域
(b2:
カウンタ領域
出力用バッファ
カウンタ領域
出力用バッファ
カウンタ領域
出力用バッファFIG. 1 is a diagram showing an embodiment of the present invention. FIG. 2 is a diagram illustrating a saw using a conventional count classification method. It is. In the drawing, 1 is an input buffer, and 2 is an output buffer. 3 is the work area. 4.4a is a counter area (counter). are shown respectively. Input buffer work area Counter area Output buffer (b3) Input buffer work area Counter area output buffer (b4) Figure (Part 2) Input buffer A1Yiβ11 area (a) Input buffer work area (bl Input Buffer work area (b2: Counter area output buffer Counter area output buffer Counter area output buffer
Claims (1)
出力用バッファ(2)と、該複数個の入力レコードの作
業領域(3)と、各レコードの順番を付けるカウンタ領
域(4a)と備えて、該入力用バッファ(1)に格納さ
れたレコードのキー値の順にソートして出力用バッファ
(2)に格納する方式であって、上記カウンタ領域(4
a)を、唯1つ設けて、上記入力用バッファ(1)に入
力される複数個のレコードに対して、特定のレコードの
キー値を基準値として設定し、そのキー値を‘0’とし
、その他のレコードのキー値に対して、上記基準値のキ
ーとの相対値である相対キーを、 相対キー=(変換前のキー)−(基準値のキー)で算出
して、各レコードの相対キー値を上記作業領域(3)に
格納し、 該格納した作業領域の相対キーが「負」であるならば、
上記カウンタ領域(4)に‘1’を加算し、該相対キー
が「正」、又は、「0」ならば、その儘にする処理を繰
り返し、上記入力用バッファ(1)の全レコードに対し
て終了したとき、上記カウンタ領域(4a)に設定され
ている値だけ「空き」の出力用バッファ(2)をスキッ
プした場所に、上記基準値として設定したレコードを転
送することを繰り返してソートすることを特徴とする相
対キーを利用したカウント分類法によるソート方式。[Claims] An input buffer (1) and an output buffer (2) for storing a plurality of records, a work area (3) for the plurality of input records, and a counter area for ordering each record. (4a), the records stored in the input buffer (1) are sorted in the order of key values and stored in the output buffer (2);
Provide only one a), set the key value of a specific record as a reference value for multiple records input to the input buffer (1), and set that key value as '0'. , for the key values of other records, calculate the relative key, which is the relative value of the key of the standard value above, as relative key = (key before conversion) - (key of standard value), and calculate the relative key of each record. If the relative key value is stored in the work area (3) above, and the relative key of the stored work area is "negative",
Add '1' to the above counter area (4), and if the relative key is 'correct' or '0', repeat the process to leave it as is for all records in the input buffer (1). When the process is finished, the record set as the reference value is transferred to the skipped location of the "empty" output buffer (2) by the value set in the counter area (4a) above, and then sorted. A sorting method based on a count classification method using relative keys.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP24924190A JP3151820B2 (en) | 1990-09-19 | 1990-09-19 | Sorting method based on count classification using relative keys |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP24924190A JP3151820B2 (en) | 1990-09-19 | 1990-09-19 | Sorting method based on count classification using relative keys |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH04127321A true JPH04127321A (en) | 1992-04-28 |
| JP3151820B2 JP3151820B2 (en) | 2001-04-03 |
Family
ID=17190028
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP24924190A Expired - Fee Related JP3151820B2 (en) | 1990-09-19 | 1990-09-19 | Sorting method based on count classification using relative keys |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3151820B2 (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2011040009A (en) * | 2009-08-18 | 2011-02-24 | S Grants Co Ltd | Bit sequence data sorting device, sorting method, and program |
| WO2011024376A1 (en) * | 2009-08-30 | 2011-03-03 | 株式会社エスグランツ | Bit-string data sorting device, method and program |
| US8185525B2 (en) | 2004-11-30 | 2012-05-22 | International Business Machines Corporation | Ordering query results based on value range filtering |
| US8515976B2 (en) | 2008-12-22 | 2013-08-20 | KOUSOKUYA, Inc. | Bit string data sorting apparatus, sorting method, and program |
-
1990
- 1990-09-19 JP JP24924190A patent/JP3151820B2/en not_active Expired - Fee Related
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8185525B2 (en) | 2004-11-30 | 2012-05-22 | International Business Machines Corporation | Ordering query results based on value range filtering |
| US8380708B2 (en) * | 2004-11-30 | 2013-02-19 | International Business Machines Corporation | Methods and systems for ordering query results based on annotations |
| US8515976B2 (en) | 2008-12-22 | 2013-08-20 | KOUSOKUYA, Inc. | Bit string data sorting apparatus, sorting method, and program |
| JP2011040009A (en) * | 2009-08-18 | 2011-02-24 | S Grants Co Ltd | Bit sequence data sorting device, sorting method, and program |
| WO2011021347A1 (en) * | 2009-08-18 | 2011-02-24 | 株式会社エスグランツ | Bit-string data sorting device, sorting method and program |
| WO2011024376A1 (en) * | 2009-08-30 | 2011-03-03 | 株式会社エスグランツ | Bit-string data sorting device, method and program |
| JP2011048801A (en) * | 2009-08-30 | 2011-03-10 | S Grants Co Ltd | Bit stream data sorting device, method, and program |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3151820B2 (en) | 2001-04-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2520541B2 (en) | Merging device and merging method | |
| Sawik | An exact approach for batch scheduling in flexible flow lines with limited intermediate buffers | |
| US6424970B1 (en) | Sorting system and method executed by plural computers for sorting and distributing data to selected output nodes | |
| JPH02178730A (en) | Internal sorting system using dividing method | |
| Kim et al. | Cyclic scheduling of cluster tools with nonidentical chamber access times between parallel chambers | |
| JP3151820B2 (en) | Sorting method based on count classification using relative keys | |
| JP4136594B2 (en) | Data processing method and data processing program | |
| CN112764749B (en) | Method and system for generating software function interface group | |
| US7917459B2 (en) | System and method for executing complex IF-THEN clauses | |
| JPH0855013A (en) | Sorting method and apparatus | |
| JPH03129521A (en) | Stabilizing sorting of sorting accelerator | |
| KUMAR et al. | A nonlinear goal programming model for the loading problem in a flexible manufacturing system | |
| JPH02289005A (en) | Alignment processing system for count information | |
| JPH01134525A (en) | Access system for data processor | |
| Murphy et al. | A mathematical programming approach to the scheduling of sorting operations | |
| Gan et al. | Managing event traces for a web front-end to a parallel simulation | |
| WO2011021347A1 (en) | Bit-string data sorting device, sorting method and program | |
| Park et al. | Enhancing the flexibility of algebraic deadlock avoidance policies through petri net structural analysis | |
| JPH04114207A (en) | Work data preparing system for nc work machine | |
| JPS63126030A (en) | Sort processing system | |
| Choi et al. | A machine‐order search space for job‐shop scheduling problems | |
| CN120448596A (en) | A fuzzy address matching method based on parallel processing in power scenarios | |
| JPS6358534A (en) | Control system for final processing phase in key sort method | |
| JPS6346537A (en) | Method for deciding retrieving condition of retrieving processor | |
| Ripon et al. | Formalizing cCSP synchronous semantics in PVS |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |