JP2000322236A - Sort processor - Google Patents

Sort processor

Info

Publication number
JP2000322236A
JP2000322236A JP2000125681A JP2000125681A JP2000322236A JP 2000322236 A JP2000322236 A JP 2000322236A JP 2000125681 A JP2000125681 A JP 2000125681A JP 2000125681 A JP2000125681 A JP 2000125681A JP 2000322236 A JP2000322236 A JP 2000322236A
Authority
JP
Japan
Prior art keywords
data
sort
key value
comparator
processor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2000125681A
Other languages
Japanese (ja)
Inventor
Shinya Fushimi
信也 伏見
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2000125681A priority Critical patent/JP2000322236A/en
Publication of JP2000322236A publication Critical patent/JP2000322236A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To designate a raising/lowering order of each sort key by inverting the bit of a designated key value different from the comparing function of a comparator for comparing the large/small relation of consecutive comparing object data of a data string so as to transmit to a sorting processor of an initial stage. SOLUTION: Designated keys 1 and 3 different from the comparing function of a comparator are raising-order-designated and a control part 19 receives designation on whether these keys are in a raising order or a lowering order from a host computer, interprets this and controls a key conversion part 20 to send data to a first sorting processor 11 by inverting the bit of the key 1 and the key 3. Thus, the sort processor can obtain a sort with respect to plural keys where the raising order and the lowering order are mixed in spite of having a function for only a lowering order sort.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、データベース処
理、ビジネスデータ処理等における、大量データの並べ
替え、所謂ソート処理を行なうソートプロセッサ及びソ
ート処理装置に関するものである。なお、この明細書に
おいては、部分的なソート処理を行なうプロセッサをソ
ートプロセッサと称し、ソートプロセッサ複数個を、直
列に接続して、完全なソート処理を行なう装置をソート
処理装置と称して、区別するものとする。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a sort processor and a sort processor for performing a sort of so-called sort processing of a large amount of data in database processing, business data processing and the like. In this specification, a processor that performs a partial sort process is called a sort processor, and a device that connects a plurality of sort processors in series and performs a complete sort process is called a sort processing device. It shall be.

【0002】[0002]

【従来の技術】図6は、例えば「情報処理」Vol.3
3、No.12、P1416ー1423、1992に開
示されている従来のソート処理装置を備えた計算機シス
テムの構成を示す図である。図において、1はソート処
理装置、2はホスト計算機のシステムバス、3はホスト
計算機の主記憶装置、4はホスト計算機のCPU、5は
ホスト計算機上でデータを格納するディスク装置、6は
ホスト計算機である。
2. Description of the Related Art FIG. 6 shows, for example, "Information Processing" Vol. 3
3, No. 12 is a diagram showing a configuration of a computer system including a conventional sort processing device disclosed in P1416-1423, 1992. In the figure, 1 is a sort processing device, 2 is a system bus of a host computer, 3 is a main storage device of the host computer, 4 is a CPU of the host computer, 5 is a disk device for storing data on the host computer, and 6 is a host computer It is.

【0003】以下、図を参照しながら動作について説明
する。先ず、概略の動作について説明する。ホスト計算
機6においてデータ処理の要求が発生すると、ホスト計
算機6のCPU4は対象データが格納されているディス
ク装置5からデータを連続的に取り出して、これをシス
テムバス2を経由して連続的にソート処理装置1に送
る。なお、このとき、必要に応じてホスト計算機1の主
記憶装置3が入出力バッファ領域として用いられる。ソ
ート処理装置1においては、データが入力されると、ソ
ート処理を行い、結果を再びシステムバス2を経由して
ホスト計算機6に送り返す。ホスト計算機6は送り返さ
れた結果データを入力時と同様にしてディスク装置5に
格納する。なお、ソート処理装置1に対するデータの入
力と、ソート処理装置1からの結果データの出力は並列
に実行される。
Hereinafter, the operation will be described with reference to the drawings. First, the general operation will be described. When a data processing request is generated in the host computer 6, the CPU 4 of the host computer 6 continuously retrieves data from the disk device 5 in which the target data is stored, and sorts it continuously via the system bus 2. Send to processing device 1. At this time, the main storage device 3 of the host computer 1 is used as an input / output buffer area as needed. In the sort processing device 1, when data is input, the sort process is performed, and the result is sent back to the host computer 6 via the system bus 2 again. The host computer 6 stores the returned result data in the disk device 5 in the same manner as at the time of input. Note that input of data to the sort processing device 1 and output of result data from the sort processing device 1 are executed in parallel.

【0004】次にソート処理装置1の動作の詳細につい
て説明する。ソート処理装置1はホスト計算機6から送
られてくるデータの列を連続的に入力して、これを指定
された順序に並べ替えて、結果を再びホスト計算機6に
返す。この様子を、同じく上記「情報処理」に開示され
ている図5を用いて説明する。図7は、図6におけるソ
ート処理装置1の構成を示す図で、ソート処理装置1
は、ソートプロセッサ11、12、13、及び14を線
形に接続して構成される。各ソートプロセッサ11〜1
4には、各々データ記憶装置15、16、17、及び1
8が接続されている。また、21はホスト計算機6との
データのやりとり、処理の指示のやりとりを行うための
ホスト計算機インタフェースであり、19はソート処理
装置1全体を制御する制御部である。ソートプロセッサ
11〜14は、各々先頭から第1段目のソートプロセッ
サ、第2段目のソートプロセッサ、第3段目のソートプ
ロセッサ等と呼ばれる。第i段目のソートプロセッサ
は、2i-1データ分の容量の記憶装置を各々有してい
る。
Next, the operation of the sorting apparatus 1 will be described in detail. The sort processing device 1 continuously inputs a sequence of data sent from the host computer 6, rearranges the sequence in a specified order, and returns the result to the host computer 6 again. This situation will be described with reference to FIG. 5, which is also disclosed in the above-mentioned “information processing”. FIG. 7 is a diagram showing the configuration of the sort processing device 1 in FIG.
Is configured by connecting the sort processors 11, 12, 13, and 14 linearly. Each sort processor 11-1
4 includes data storage devices 15, 16, 17, and 1 respectively.
8 are connected. Reference numeral 21 denotes a host computer interface for exchanging data with the host computer 6 and exchanging processing instructions, and 19 denotes a control unit for controlling the entire sort processing apparatus 1. The sort processors 11 to 14 are respectively called a first-stage sort processor, a second-stage sort processor, a third-stage sort processor, and the like from the top. The i-th sort processor has storage devices each having a capacity of 2 i−1 data.

【0005】ここでは、”8、2、1、3、5、7、
6、4、・・・”の順にデータがソート処理装置1に入
力される場合を例にして、動作を説明する。先ず、先頭
の第1段目のソートプロセッサ11は、入力されたデー
タを2つずつ取り出し、これを指定の順序に並び替えて
次段のソートプロセッサに送り出す。次段のソートプロ
セッサに、2つずつにソートされて入力されるデータは
(8、2)、(3、1)、(7、5)、(6、4)、・
・・・となる。このように、第1段目のソートプロセッ
サ11では、”1、3”の順序で入力されたデータは順
序が入れ代わり、(3、1)の順でソートされた2つの
データの組みとなって出力されている。このように、ソ
ートされたデータの組みをデータストリングまたはスト
リングと以降呼ぶことにする。第2段目のソートプロセ
ッサ12は、この2つずつにソートされたデータストリ
ングを入力して、これを2組ずつ取り出し、併合して、
4つずつにソートされたデータストリングを次段のソー
トプロセッサ13に送り出す。その結果は、(8、3、
2、1)、(7、6、5、4)、・・・・となる。この
ように、第2段目のソートプロセッサ12では、入力デ
ータストリング(8、2)と(3、1)がソート処理さ
れた結果、併合されて出力データストリング(8、3、
2、1)となる。第3段目のソートプロセッサ13は、
この4つずつにソートされたデータストリングを入力し
て、これを2組みずつ取り出し、併合して、8つずつに
ソートされたデータストリングを次段のソートプロセッ
サ14に送り出す。この結果は、(8、7、6、5、
4、3、2、1)、・・・・となる。第4段目のソート
プロセッサ14以降も同様な処理を行う。
Here, "8, 2, 1, 3, 5, 7, 7,
The operation will be described by taking as an example a case where data is input to the sort processing device 1 in the order of "6, 4,...". Two pieces are taken out, rearranged in a specified order, and sent to the next-stage sort processor, and the data input to the next-stage sort processor after being sorted by two are (8, 2), (3, 1), (7, 5), (6, 4),
... As described above, in the first-stage sort processor 11, the data input in the order of "1, 3" is replaced by the order, and becomes a set of two data sorted in the order of (3, 1). Has been output. The set of data sorted in this manner is hereinafter referred to as a data string or a string. The second-stage sort processor 12 inputs the data strings sorted by two, takes out two sets of the data strings, merges them, and
The data strings sorted into groups of four are sent to the sort processor 13 at the next stage. The result is (8, 3,
2, 1), (7, 6, 5, 4),... As described above, in the second-stage sort processor 12, the input data strings (8, 2) and (3, 1) are sorted, and as a result, the output data strings (8, 3,.
2, 1). The third stage sort processor 13
The data strings sorted into groups of four are input, extracted in pairs of two, merged, and the data strings sorted into groups of eight are sent to the sort processor 14 at the next stage. The results are (8, 7, 6, 5,
4, 3, 2, 1),. The same processing is performed for the fourth-stage sort processor 14 and thereafter.

【0006】ところで、各段のソートプロセッサは、図
8に示すように、前段のソートプロセッサがすべての処
理を終えない内に処理を開始することが可能であり、こ
れにより、データを連続的に入力すると若干の遅れ時間
を経てデータ入力と並列にソート結果が出力されること
がわかる。このようにして、n個のソートプロセッサに
より2n個のデータの並び替え、即ちソート処理が行わ
れる。なお、各ソートプロセッサは、これら比較併合処
理において、各々に接続されたデータ記憶装置15、1
6、17、18を記憶領域として使用する。
By the way, as shown in FIG. 8, each stage of the sort processor can start the processing before the preceding stage of the sort processor has finished all the processing, whereby the data can be continuously read. It can be seen that the sorting result is output in parallel with the data input after a slight delay time when input. Thus, the rearrangement of 2 n data, that is, the sort processing is performed by the n sort processors. In addition, in these comparison and merging processes, each sort processor performs operations on the data storage devices 15 and 1 connected thereto.
6, 17, and 18 are used as storage areas.

【0007】次に、図9に示す「情報処理」Vol.3
1、No.4、P457ー465、1990に開示され
ている従来のソートプロセッサの構成図を参照しなが
ら、ソートプロセッサ内部における動作について説明す
る。なお、この図9においては、説明を簡単にするため
図7におけるソートプロセッサ12のみの内部について
を示しているが、他のソートプロセッサの内部も同様な
構成である。図9において、120はデータストリング
を比較する比較器、121、122は各々比較されるデ
ータの一部を一次的に格納するラッチレジスタ、12
3、124は比較器120のデータ入力ポート、125
はソートプロセッサの動作を制御する制御部である。ラ
ッチレジスタ121、122は、比較器120の比較デ
ータサイズ及び比較器の入力ポート123、124のデ
ータ幅と等しいデータサイズを有している。以下の説明
では、この大きさは4バイトとする。126は前段のソ
ートプロセッサ11からのデータを入力する入力バス、
127は次段のソートプロセッサ13にデータを出力す
る出力バス、128は接続されているデータ記憶装置1
6とのデータをやりとりするアドレス及びデータバスで
ある。
Next, “information processing” shown in FIG. 3
1, No. 4, P457-465, 1990, the operation inside the sort processor will be described with reference to the configuration diagram of the conventional sort processor. Although FIG. 9 shows only the inside of the sort processor 12 in FIG. 7 for simplicity of description, the inside of the other sort processors has the same configuration. In FIG. 9, reference numeral 120 denotes a comparator for comparing data strings, 121 and 122 denote latch registers for temporarily storing a part of data to be compared, and 12
3, 124 are data input ports of the comparator 120, 125
Is a control unit for controlling the operation of the sort processor. The latch registers 121 and 122 have a data size equal to the comparison data size of the comparator 120 and the data width of the input ports 123 and 124 of the comparator. In the following description, this size is 4 bytes. 126 is an input bus for inputting data from the preceding sort processor 11;
127 is an output bus for outputting data to the next-stage sort processor 13, and 128 is the connected data storage device 1.
6 and an address and data bus for exchanging data with the data bus.

【0008】以下、ソートプロセッサ12のソート処理
の詳細について説明する。ソートプロセッサ12に対し
て、前段のソートプロセッサ11からデータストリング
(8、2)、(3、1)、・・・が順次入力されると、
ソートプロセッサ12はこれを併合してデータストリン
グ(8、3、2、1)、・・・として次段のソートプロ
セッサ13に出力する場合を例にとって説明する。
Hereinafter, the details of the sorting process of the sort processor 12 will be described. When the data strings (8, 2), (3, 1),... Are sequentially input from the preceding sort processor 11 to the sort processor 12,
An example will be described in which the sort processor 12 combines the data and outputs the data strings (8, 3, 2, 1) to the next-stage sort processor 13 as an example.

【0009】先ず、最初に入力されるデータストリング
(8、2)はそのままの順序を保ちながら、ソートプロ
セッサ12に接続されたデータ記憶装置16に格納され
る。次に、データストリング(3、1)のデータ「3」
がソートプロセッサ12に入力され、同様にデータ記憶
装置16に記憶される。続いて、最初のデータストリン
グ(8、2)の先頭データ「8」と、データストリング
(3、1)の先頭データ「3」が4バイトずつデータ記
憶装置16からラッチレジスタ121、122にロード
されて、比較器120において比較が行われる。この比
較はデータを4バイト毎に順に比較することにより行わ
れる。
First, the data strings (8, 2) input first are stored in the data storage device 16 connected to the sort processor 12 while maintaining the same order. Next, the data “3” of the data string (3, 1)
Is input to the sort processor 12 and is similarly stored in the data storage device 16. Subsequently, the leading data “8” of the first data string (8, 2) and the leading data “3” of the data string (3, 1) are loaded from the data storage device 16 into the latch registers 121 and 122 by 4 bytes. Thus, the comparison is performed in the comparator 120. This comparison is performed by sequentially comparing data every four bytes.

【0010】なお、このソート処理において、ソートキ
ーに対する順序指定として昇順が指定されている場合に
は、比較結果はいずれか小さい方が先に出力される。ま
た、同様に順序指定として降順が指定されている場合に
は、比較結果はいずれか大きい方が先に出力される。こ
れらの昇順降順に対する制御は、データの先頭バイトか
ら始まるソートキーに対して、制御部125が制御を行
う。比較結果が確定すると、データは次のソートプロセ
ッサ13に出力される。この比較処理と並行して、2番
めのデータストリング(3、1)中の次のデータ「1」
がデータ記憶装置16に格納される。この例の場合に
は、比較の結果、データ「8」が次段のソートプロセッ
サ13に出力される。このため、続く比較では、データ
「3」と、データストリング(8、2)の「8」に続く
データ「2」が比較される。比較は、同様にデータ記憶
装置16から、データ「3」とデータ「2」を4バイト
ずつ各々ラッチレジスタ121、122に入力して、4
バイトずつ比較を行うことにより処理される。
In this sort processing, when ascending order is specified as the order specification for the sort key, the smaller of the comparison results is output first. Similarly, when the descending order is designated as the order designation, the larger one of the comparison results is output first. The control for these ascending and descending orders is performed by the control unit 125 for the sort key starting from the first byte of the data. When the comparison result is determined, the data is output to the next sort processor 13. In parallel with this comparison processing, the next data “1” in the second data string (3, 1)
Is stored in the data storage device 16. In the case of this example, as a result of the comparison, data “8” is output to the next-stage sort processor 13. Therefore, in the subsequent comparison, data "3" is compared with data "2" following "8" of data string (8, 2). The comparison is similarly performed by inputting data “3” and data “2” from the data storage device 16 to the latch registers 121 and 122 in 4-byte units, respectively.
Processed by performing byte-by-byte comparisons.

【0011】[0011]

【発明が解決しようとする課題】従来のソート処理装置
は、以上のように構成されていたので、ソート処理にお
いては、一般にレコード内部の複数のフィールドを組合
せて、これらのフィールド各々に昇順降順を独立に指定
して、その指定によってデータを並びかえることが必要
となる。このため、ソートプロセッサの制御装置では、
これら複数のキーフィールド各々に対して各々昇順、降
順の別を解釈し、それに応じた処理を行う必要があり、
ハードウェア論理が複雑になるという問題があった。
Since the conventional sort processing apparatus is configured as described above, in the sort processing, a plurality of fields in a record are generally combined, and these fields are arranged in ascending and descending order. It is necessary to specify them independently and rearrange the data according to the specification. For this reason, in the control device of the sort processor,
It is necessary to interpret the ascending order and descending order for each of these multiple key fields and perform the processing accordingly.
There was a problem that hardware logic became complicated.

【0012】この発明は、以上のような問題点を解消す
るためになされたもので、ソート処理におけるソートキ
ー毎の昇降順指定を可能としつつ、ソートプロセッサの
内部処理は昇順または降順ソートのみで可能なようにし
て、ソートプロセッサの内部構成を簡素化することを目
的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problems, and the internal processing of a sort processor can be performed only in ascending or descending order while enabling the designation of ascending or descending order for each sort key in the sort processing. An object of the present invention is to simplify the internal configuration of a sort processor.

【0013】[0013]

【課題を解決するための手段】この発明に係わるソート
プロセッサは、入力データストリングを格納するデータ
記憶装置と、前記データストリングの連続する比較対象
データの大小関係を比較する比較器と、前記データ記憶
装置および前記比較器を制御する制御部を有するソート
プロセッサを複数台直列に接続して、各ソートプロセッ
サが並列に動作して、各々の比較器を用いて繰返し比較
処理を行うことで、複数のデータのソート処理を行うソ
ート処理装置において、前記比較器の比較機能と異なる
指定のキー値について、このキー値のビットを反転させ
て、初段のソートプロセッサに伝送するキー値変換部を
備えるようにしたものである。
According to the present invention, there is provided a sort processor comprising: a data storage device for storing an input data string; a comparator for comparing magnitude relations of successive comparison target data of the data string; A plurality of sort processors having a control unit for controlling the apparatus and the comparator are connected in series, and each sort processor operates in parallel, and performs a repetitive comparison process using each comparator. In a sort processing device that performs data sort processing, a key value conversion unit that inverts bits of the key value for a designated key value different from the comparison function of the comparator and transmits the inverted key value to the first-stage sort processor is provided. It was done.

【0014】また、前記比較器が比較するデータの大き
いほうを取り出すように構成されているときには、前記
キー値変換部は、降順指定のキー値のビットを反転させ
るようにしたものである。
Further, when the comparator is configured to take out the larger one of the data to be compared, the key value converter inverts the bits of the key value designated in descending order.

【0015】また、前記比較器が比較するデータの小さ
いほうを取り出すように構成されているときには、前記
キー値変換部は、昇順指定のキー値のビットを反転させ
るようにしたものである。
When the comparator is configured to take out the smaller one of the data to be compared, the key value converter inverts the bits of the key value specified in ascending order.

【0016】[0016]

【発明の実施の形態】この実施の形態においては、一度
に比較するデータ数をK=4、比較するデータ幅を4バ
イトとした場合について説明する。図1は、この発明に
よるソートプロセッサとソートプロセッサ間の接続関係
を示す図である。図において、11、12、13はソー
トプロセッサ、15、16、17は、ソート処理するデ
ータストリングを格納する各ソートプロセッサが有する
データ記憶装置である。各ソートプロセッサ11〜13
は、データのソートキー(以降、キー値と称す)を格納
する4個のキー格納領域130〜139、ラッチレジス
タ140、比較器130およびソートプロセッサ全体を
制御する制御部125から構成されている。なお、比較
器130は、特別の回路構成を採らずに2入力の比較器
を複数組み合わせることにより実現できる。また、ラッ
チレジスタ140は、一般的なレジスタで構成するよう
にしてもよい。
DESCRIPTION OF THE PREFERRED EMBODIMENTS In this embodiment, a case where the number of data to be compared at a time is K = 4 and the data width to be compared is 4 bytes will be described. FIG. 1 is a diagram showing a connection relationship between sort processors according to the present invention. In the figure, reference numerals 11, 12, and 13 denote sort processors, and reference numerals 15, 16, and 17 denote data storage devices included in each sort processor for storing data strings to be sorted. Each sort processor 11-13
Is composed of four key storage areas 130 to 139 for storing data sort keys (hereinafter, referred to as key values), a latch register 140, a comparator 130, and a control unit 125 for controlling the entire sort processor. Note that the comparator 130 can be realized by combining a plurality of 2-input comparators without employing a special circuit configuration. Further, the latch register 140 may be configured by a general register.

【0017】また、126は前段のソートプロセッサ1
1からのデータを入力する入力バス、127は次段のソ
ートプロセッサ13にデータを出力する出力バス、12
8は接続されているデータ記憶装置16とのデータをや
りとりするアドレス及びデータバスである。136〜1
40は比較器130の入力ポートである。なお、ラッチ
レジスタ140は、比較器130で一度に比較するビッ
ト幅のレジスタであり、キー値格納部131〜134
は、データのキー値部分全てを格納できる容量を有する
レジスタファイルやメモリ素子等で構成されている。ま
た、キー値格納部131、132、133、134を便
宜上、各々1番目、2番目、3番目、4番目のキー値格
納部と称することにする。
Reference numeral 126 denotes a sort processor 1 in the preceding stage.
An input bus 127 for inputting data from 1 is an output bus for outputting data to the next sort processor 13,
Reference numeral 8 denotes an address and data bus for exchanging data with the connected data storage device 16. 136-1
Reference numeral 40 denotes an input port of the comparator 130. The latch register 140 is a register having a bit width to be compared by the comparator 130 at one time, and the key value storage units 131 to 134
Is composed of a register file, a memory element, and the like having a capacity capable of storing all the key value portions of data. In addition, the key value storage units 131, 132, 133, and 134 are referred to as first, second, third, and fourth key value storage units, respectively, for convenience.

【0018】最初に、上記のように構成されたソートプ
ロセッサのソート処理における概略の動作について説明
する。 (1)ソートプロセッサの制御部125は、比較される
個々のデータのキー値を対応するキー値格納部(131
〜134)に格納する。 (2)比較の結果、一つのデータが出力された場合、次
にデータ記憶装置16から入力するデータのキー値を、
例えば4バイト単位にラッチレジスタ135に入力し
て、比較を行い、同時に、空いているキー値格納部にも
同じデータを順次入力する。 (3)各ソートプロセッサで繰返し実行される比較処理
の最初の比較処理の開始において、比較対象となる4個
のデータの内の3個のデータのキー値各々を4個のキー
値格納部(131〜134)の内の3個のキー値格納部
(131〜133)に格納して、ソートプロセッサ内の
制御部は比較対象としてこれら3個のキー値格納部(1
31〜133)に対応する入力ポート(136〜13
8)と、ラッチレジスタ135に接続されている入力ポ
ート140を選択して、4個目のデータのキー値の先頭
部分がラッチレジスタ135に格納されると同時に比較
処理を開始する。並行して4個目のデータのキー値は、
4番目のキー値格納部134に格納する。 (4)各ソートプロセッサで繰返し実行される比較処理
の最初ではない比較処理においては、比較器130によ
る4個のデータのキー値の比較の結果、最も小さいデー
タ(昇順ソートの場合)を判定して、これを出力し、次
の比較において、出力されたデータにかわる次のデータ
のキー値をラッチレジスタ135に入力して、比較を開
始すると共に、並行して、出力されたデータのキー値が
格納されていたキー値格納部にこのデータのキー値を格
納することにより昇順のソートを行う。 (5)降順ソートの場合においては、比較の結果、最も
大きいデータを判定し、これを出力することにより、降
順のソートを実現する。 (6)ラッチレジスタ135に入力されて比較が行わ
れ、かつキー値格納部に同時に格納されているデータ
が、昇順または降順比較の結果選択され、出力された場
合、このデータにかわる次のデータに対しては、同様に
そのキー値の先頭をラッチレジスタ135に入力し、比
較を開始すると共に、並行して、出力されたデータのキ
ー値が格納されていたキー値格納部にこのデータのキー
値を入力し、このデータが比較の結果、選択されず、出
力されなかった場合には、このデータに代わって出力さ
れたデータにかわる次のデータのキー値をラッチレジス
タ135に格納して、比較を開始すると共に、並行し
て、出力されたデータのキー値が格納されていたキー値
格納部にこのデータのキー値を格納する。 (7)出力されていったデータにかわるデータがなくな
った場合、制御部125は、このデータのキー値が格納
されていたキー値格納部に対応する比較器130の入力
ポートをその後選択せず、その後の比較において比較対
象としないように制御する。
First, a schematic operation in the sort processing of the sort processor configured as described above will be described. (1) The control unit 125 of the sort processor stores the key value of each data to be compared in the corresponding key value storage unit (131).
To 134). (2) If one data is output as a result of the comparison, the key value of the data next input from the data storage device 16 is
For example, the data is input to the latch register 135 in units of 4 bytes, and comparison is performed. At the same time, the same data is sequentially input to an empty key value storage. (3) At the start of the first comparison process of the comparison process repeatedly executed by each sort processor, each of the key values of three of the four data to be compared is stored in four key value storage units ( 131 to 134) in the three key value storage units (131 to 133), and the control unit in the sort processor sets these three key value storage units (1
Input ports (136 to 13) corresponding to the input ports (136 to 133)
8), the input port 140 connected to the latch register 135 is selected, and the comparison process is started at the same time when the leading part of the key value of the fourth data is stored in the latch register 135. In parallel, the key value of the fourth data is
The information is stored in the fourth key value storage unit 134. (4) In the comparison process that is not the first of the comparison processes repeatedly executed by each sort processor, the smallest data (in the case of ascending sort) is determined as a result of the comparison of the key values of the four data by the comparator 130. Then, in the next comparison, the key value of the next data in place of the output data is input to the latch register 135 to start the comparison and, in parallel, the key value of the output data. By storing the key value of this data in the key value storage unit in which has been stored, sorting is performed in ascending order. (5) In the case of the descending sort, the largest data is determined as a result of the comparison, and the largest data is output to realize the descending sort. (6) When the data input to the latch register 135 for comparison and simultaneously stored in the key value storage section is selected and output as a result of the ascending or descending comparison, the next data instead of this data is output. , The head of the key value is similarly input to the latch register 135 to start the comparison, and in parallel, the key value of the output data is stored in the key value storage unit. If a key value is input and this data is not selected or output as a result of the comparison, the key value of the next data instead of the output data is stored in the latch register 135 instead of this data. , The comparison is started, and in parallel, the key value of the output data is stored in the key value storage unit in which the key value of the data is stored. (7) When there is no more data replacing the output data, the control unit 125 does not subsequently select the input port of the comparator 130 corresponding to the key value storage unit in which the key value of the data has been stored. Is controlled so as not to be compared in the subsequent comparison.

【0019】図2は、この発明によるソートプロセッサ
を用いて構成されたソート処理装置を示す図で、ソート
処理装置1は、ソートプロセッサ11〜14、各ソート
プロセッサ用のデータ記憶装置15から18、ホスト計
算機とのデータのやりとり、処理の指示のやりとりを行
うためのホスト計算機とのインタフェース部21、デー
タのキー部の値を変換するキー変換部20およびソート
処理装置1全体の制御を行なうソート処理装置制御部1
9から構成されている。キー変換部20は、先頭のソー
トプロセッサ11に接続して構成されている。以下、図
を参照しながら、この実施の形態における動作について
説明するが、ホスト計算機からデータをソート処理装置
1に入力し、ソート処理装置1がこれをソートしてホス
ト計算機に返す部分は同一であり、説明を省略する。
FIG. 2 is a diagram showing a sort processing device constructed using the sort processor according to the present invention. The sort processing device 1 includes sort processors 11 to 14, data storage devices 15 to 18 for each sort processor, An interface unit 21 with the host computer for exchanging data with the host computer and exchanging processing instructions, a key conversion unit 20 for converting the value of a key part of data, and a sort process for controlling the entire sort processing device 1. Device control unit 1
9. The key conversion unit 20 is configured to be connected to the first sort processor 11. Hereinafter, the operation of this embodiment will be described with reference to the drawings. However, the data input from the host computer to the sort processing device 1 and the sort processing device 1 sorts the data and returns it to the host computer are the same. Yes, description is omitted.

【0020】先ず、図2を参照しながら、この発明によ
るキー変換部20について説明する。図2は、従来例で
説明した図6と類似した構成であるが、各ソートプロセ
ッサに付加されたデータ記憶装置15、16、17、1
8の容量及び各ソートプロセッサの内部構成が異なって
いる。ソート処理装置1はホスト計算機から送られてく
るデータの列を連続的に入力して、これを指定された順
序に並べ替えて、結果を再びホスト計算機に返す。ソー
ト処理装置は、ソートプロセッサ群11、12、13、
14及びこれらソートプロセッサ群に各々付加されるデ
ータ記憶装置群15、16、17、18を線形に接続
し、更に先頭のソートプロセッサ11の前にキー変換装
置20を接続して構成される。
First, the key conversion unit 20 according to the present invention will be described with reference to FIG. FIG. 2 has a configuration similar to that of FIG. 6 described in the conventional example, except that data storage devices 15, 16, 17, 1
8 and the internal configuration of each sort processor are different. The sort processing device 1 continuously inputs a sequence of data sent from the host computer, rearranges the data sequence in a specified order, and returns the result to the host computer again. The sort processing device includes sort processor groups 11, 12, 13,
14 and a data storage device group 15, 16, 17, 18 respectively added to the sort processor group are connected linearly, and a key conversion device 20 is connected before the leading sort processor 11.

【0021】ソート処理においては、データ中のキー値
を基にして、データの並べ変えを行なう。例えば、ソー
ト対象のデータの形式が以下のようになっていたとし
て、ソートプロセッサは降順ソートのみが可能である場
合について説明する。 ・データ形式:キー1+キー2+キー3+非キーデータ ここで、キー1とキー3とは昇順指定で、キー2は降順
とする。制御部19は、キー1からキー3までに関し
て、昇順か、降順かの指定をホスト計算機から受取り、
これを解釈して、キー変換部20に対して、入力される
各データに対して、そのキー1とキー3に関しては、そ
のビットを反転して最初のソートプロセッサ11にデー
タを送り出すように制御する。これによって、ソートプ
ロセッサは降順ソートのみの機能しか持っていなくて
も、例に示すような昇順と降順とが混じった複数のキー
に対するソートを実現することができる。
In the sorting process, the data is rearranged based on the key values in the data. For example, assuming that the format of the data to be sorted is as follows, a case will be described in which the sort processor can perform only descending sort. Data format: key 1 + key 2 + key 3 + non-key data Here, keys 1 and 3 are specified in ascending order, and key 2 is in descending order. The control unit 19 receives designation of ascending order or descending order from the host computer for the keys 1 to 3,
By interpreting this, the key conversion unit 20 controls each input data to invert the bits of the keys 1 and 3 and send the data to the first sort processor 11. I do. As a result, even if the sort processor has only the function of sorting in descending order, it is possible to realize sorting for a plurality of keys in which ascending order and descending order are mixed as shown in the example.

【0022】以下に、具体例を示して説明する。例え
ば、2つのデータのキー1が”2”と”4”であった場
合、これらの2進数表記は”0010”と”0100”
であり、これらを昇順ソートすると、”2”、”4”の
順で出力することが必要である。一方、これらをビット
反転すると,1101”、”1011”であり、これら
は各々10進数”13”、”11”である。従ってこれ
らを降順ソートしても同様な順序が得られる。同様に、
ソートプロセッサが昇順ソートのみの機能しか持ってい
ない場合には、この例では、キー2に対してビット反転
を行うように、制御部19がキー変換部20に対して指
示を行なうようにすればよい。
A specific example will be described below. For example, when the key 1 of two data is “2” and “4”, these binary notations are “0010” and “0100”.
When these are sorted in ascending order, it is necessary to output them in the order of “2” and “4”. On the other hand, when these bits are bit-inverted, they are 1101 "and" 1011 ", which are decimal numbers" 13 "and" 11 ", respectively, so that a similar order can be obtained by sorting them in descending order.
If the sort processor has only the function of sorting in ascending order only, in this example, if the control unit 19 instructs the key conversion unit 20 to perform bit inversion on the key 2, Good.

【0023】次にソートプロセッサの動作について具体
的な例を用いて説明する。ソートプロセッサは、各々先
頭から第1段目のソートプロセッサ(P1)、第2段目
のソートプロセッサ(P2)、第3段目のソートプロセ
ッサ(P3)等と呼ばれる。第i段目のソートプロセッ
サは、(Kー1)Ki-1データ分の容量のデータ記憶装置
を各々有している。以下K=4として動作の説明を行
う。動作の例として、ソート処理装置1に8、2、1、
3、5、7、6、4、9、0、8、5、1、10、3、
4、・・・の順にデータが入力されると、まず先頭の第
1段目のソートプロセッサ11は入力されたデータを4
つずつ取り出し、これを並び替えて次段のソートプロセ
ッサ12に送り出す。
Next, the operation of the sort processor will be described using a specific example. The sort processors are called a first-stage sort processor (P 1 ), a second-stage sort processor (P 2 ), a third-stage sort processor (P 3 ), and the like, respectively, from the top. The i-th sort processor has a data storage device having a capacity of (K-1) K i-1 data. Hereinafter, the operation will be described with K = 4. As an example of the operation, the sort processing device 1, 8, 2, 1,.
3, 5, 7, 6, 4, 9, 0, 8, 5, 1, 10, 3,
When data is input in the order of 4,..., First, the first-stage sort processor 11
These are taken out one by one, rearranged and sent to the next-stage sort processor 12.

【0024】なお、ここで、データ「8」、「2」、
「1」・・・は、10進数の数字を意味するものではな
く、各々キー値とデータ本体部で構成されたデータ(但
し、キー値のみで構成される場合もある)であり、単に
データとしての大きさを表すものである。次段のソート
プロセッサ12に4つずつにソートされて入力されるデ
ータは(8、3、2、1)、(7、6、5、4)、
(9、8、5、0)、(10、4、3、1)、・・・・
となる。
Here, data "8", "2",
“1”... Does not mean a decimal number, but is data composed of a key value and a data body (however, it may be composed of only a key value). Represents the size as The data input to the next-stage sort processor 12 after being sorted by four are (8, 3, 2, 1), (7, 6, 5, 4),
(9, 8, 5, 0), (10, 4, 3, 1), ...
Becomes

【0025】2段目のソートプロセッサ12は、この4
つずつソートされたデータを入力して、これを4組ずつ
取り出し、併合して、16ずつソートされたデータ列を
次段のソートプロセッサ13に送り出す。その結果は
(10、9、8、8、7、6、5、5、4、4、3、
3、2、1、1、0)、・・・となる。第3段目のソー
トプロセッサ13以降も同様な処理を行う。この様子を
図3に示す。従来技術と同様に、図3に示すように、各
段のソートプロセッサは、前段のソートプロセッサがす
べての処理を終えない内に処理を開始することが可能で
あり、これにより、データを連続的に入力すると若干の
遅れ時間を経てデータの入力と並列にソート結果が出力
されることがわかる。
The second stage sort processor 12 outputs
The data sorted one by one is input, four sets are taken out, merged, and the data sequence sorted by 16 is sent to the sort processor 13 at the next stage. The results are (10, 9, 8, 8, 7, 6, 5, 5, 4, 4, 3,
3, 2, 1, 1, 0),. The same processing is performed for the third-stage sort processor 13 and thereafter. This is shown in FIG. As in the prior art, as shown in FIG. 3, the sort processor in each stage can start processing before the sort processor in the preceding stage finishes all the processes, whereby data can be continuously output. It can be seen that when the input is made, the sort result is output in parallel with the input of the data after a slight delay time.

【0026】このようにして、n個のソートプロセッサ
によりKn個のデータの並び替え、即ちソート処理が行
われる。別の言い方をすると、N個のデータのソート
は、logKN個のソートプロセッサにより実現され
る。例えば220=410=100万個のデータのソートに
は、従来の2個のデータ比較による方式では、ソートプ
ロセッサは20個必要であったが、K=4とした本方式
ではソートプロセッサは10個で済むことがわかる。な
お、各ソートプロセッサは、これら比較併合処理におい
て、各々に接続されたデータ記憶装置15、16、1
7、18を記憶領域として使用する。
In this manner, the rearrangement of K n data, that is, the sort processing is performed by the n sort processors. Stated another way, the sorting of N data is implemented by log K N sort processors. For example, in order to sort 2 20 = 4 10 = 1 million data, 20 sort processors are required in the conventional method of comparing two data, but in the present method in which K = 4, the sort processor is not used. It turns out that ten pieces are enough. Note that each sort processor performs the comparison and merging process by using the data storage devices 15, 16, 1
7, 18 are used as storage areas.

【0027】次に、ソートプロセッサの内部動作につい
て、図1を参照しながら説明する。ソートプロセッサ1
2に対して、前段のソートプロセッサ11からデータス
トリング(8、3、2、1)、(7、6、5、4)、
(9、8、5、0)、(10、4、3、1)・・・が入
力され、ソートプロセッサ12において、これが併合さ
れてデータストリング(10、9、8、8、7、6、
5、5、4、4、3、3、2、1、1、0)、・・・と
して次段のソートプロセッサ13に出力される場合を例
にとって説明する。
Next, the internal operation of the sort processor will be described with reference to FIG. Sort processor 1
2, the data strings (8, 3, 2, 1), (7, 6, 5, 4),
(9, 8, 5, 0), (10, 4, 3, 1)... Are input and sorted by the sort processor 12, and the data strings (10, 9, 8, 8, 7, 6, 6,
, 5, 5, 4, 4, 3, 3, 2, 1, 1, 0),... Will be described as an example.

【0028】まず、入力バス126からソートプロセッ
サ12に入力されるてくるデータストリング(8、3、
2、1)、(7、6、5、4)、(9、8、5、0)
は、そのままの順序を保ちながら、ソートプロセッサ1
2に接続されたデータ記憶装置16に格納される。この
とき、データ記憶装置16へのデータの格納と平行し
て、データストリング(8、3、2、1)の先頭のデー
タ「8」、データストリング(7、6、5、4)の先頭
データ「7」、データストリング、(9、8、5、0)
の先頭データ「9」のキー値の部分が各々1番目、2番
目3番目のキー値格納部131、132、133に格納
される。この時点では、4個あるキー値格納部の内、4
番目のキー値格納部134は、まだ空きの状態である。
ここには、後に、4番目のデータストリング(10、
4、3、1)のデータのキー値が格納される。即ち、 ・1番目のキー値格納部:1番目のデータストリングの
キー値 ・2番目のキー値格納部:2番目のデータストリングの
キー値 ・3番目のキー値格納部:3番目のデータストリングの
キー値 ・4番目のキー値格納部:4番目のデータストリングの
キー値 のように対応が決められ、固定される。以上の動作は制
御部125により制御される。
First, the data strings (8, 3,...) Input from the input bus 126 to the sort processor 12 are input.
2, 1), (7, 6, 5, 4), (9, 8, 5, 0)
Is the sort processor 1 while maintaining the same order.
2 is stored in the data storage device 16 connected to the storage device 2. At this time, in parallel with storing the data in the data storage device 16, the leading data "8" of the data string (8, 3, 2, 1) and the leading data of the data string (7, 6, 5, 4) "7", data string, (9, 8, 5, 0)
Are stored in the first, second, and third key value storage units 131, 132, and 133, respectively. At this point, of the four key value storage units, 4
The key value storage unit 134 is still empty.
Here, the fourth data string (10,
4, 3, and 1) are stored. 1st key value storage: 1st data string key value 2nd key value storage: 2nd data string key value 3rd key value storage: 3rd data string 4th key value storage unit: The correspondence is determined and fixed as in the 4th data string key value. The above operation is controlled by the control unit 125.

【0029】次に、制御部125は、比較器130及び
そのデータ入力ポート136、137、138、13
9、140の内、キー値が格納されているキー値格納部
の最初のKー1個に相当する1番目、2番目および3番
目のキー値格納部136、137、138と、ラッチレ
ジスタ135に接続されたデータ入力ポート140から
入力されるデータ(キー値)を比較器130により比較
するように設定を行う。続いて、残っていた4番目のデ
ータストリング(10、4、3、1)が前段のソートプ
ロセッサ11から順に入力バス126に入力される。ソ
ートプロセッサ12は、まずその先頭のデータ「10」
のキー値4バイトづつ順にラッチレジスタ135に格納
し、比較を4バイトずつ行う。同時に、入力されるデー
タのキー値の部分は空いているキー値格納部134へ格
納する。
Next, the control unit 125 comprises a comparator 130 and its data input ports 136, 137, 138, 13
9 and 140, the first, second and third key value storage units 136, 137 and 138 corresponding to the first K-1 of the key value storage units storing the key values, and the latch register 135. Is set so that the comparator 130 compares data (key value) input from the data input port 140 connected to the. Subsequently, the remaining fourth data string (10, 4, 3, 1) is sequentially input to the input bus 126 from the preceding sort processor 11. First, the sort processor 12 first outputs the data “10”
Are stored in the latch register 135 in order of 4 bytes at a time, and the comparison is performed 4 bytes at a time. At the same time, the key value portion of the input data is stored in the empty key value storage unit 134.

【0030】少し補足を加えると、ラッチレジスタ13
5にデータ「10」のキー値の最初の4バイトが格納さ
れると同時比較器130での比較が開始され、この例の
場合には、データ「10」が最も大きいので、データ
「10」のキー値が4バイトずつ順番にラッチレジスタ
135に格納されていくことになる。また、データ「1
0」を他のデータストリングと同様にデータ記憶装置1
6に格納するようにしてもよい。
With a little supplement, the latch register 13
When the first 4 bytes of the key value of the data “10” are stored in 5, the comparison by the simultaneous comparator 130 starts. In this example, since the data “10” is the largest, the data “10” Are stored in the latch register 135 in order of 4 bytes. In addition, data “1”
0 "as in the other data strings.
6 may be stored.

【0031】比較器130においては、「8」、
「7」、「9」、「10」が比較される。その結果、最
も大きいデータ「10」が出力される。この例のよう
に、ラッチレジスタ135に入力されているデータがそ
のまま比較の結果次段に出力される場合には、まず、こ
のデータのキー部が比較器130から出力され、そのま
まデータ出力バス127を通じて次段のソートプロセッ
サ13に出力される。続いて、このデータにキーでない
データ部分がある場合には、データ入力バス126から
入力されてくるこのデータの非キー値データの部分をそ
のままデータ出力バス127を通じて出力する。これら
の制御は制御部125によって行われる。
In the comparator 130, "8",
“7”, “9”, and “10” are compared. As a result, the largest data "10" is output. When the data input to the latch register 135 is directly output to the next stage as a result of the comparison as in this example, first, the key portion of this data is output from the comparator 130 and the data output bus 127 is output as it is. Is output to the sort processor 13 at the next stage. Subsequently, when there is a non-key data portion in this data, the non-key value data portion of this data input from the data input bus 126 is output through the data output bus 127 as it is. These controls are performed by the control unit 125.

【0032】続いて、4番目のデータストリングのデー
タ「10」に続くデータ「4」が入力バス126から入
力されてくる。このデータは、データ「10」の場合と
同様に、ラッチレジスタ135に4バイトづつ入力さ
れ、キー値格納部131、132、133中のデータ
「8」、「7」、「9」と4バイトずつ比較される。ま
た、ラッチレジスタ135への入力と同時に、このデー
タ「4」のキー値は空きとなっているキー値格納部13
4に格納される。この比較においては、ラッチレジスタ
135に入力されてくるデータ「4」ではなく、キー値
格納部133に格納されているデータ「9」が比較の結
果出力される。従って、この場合には、まずこのデータ
「9」のキー値の部分が比較器130からデータ出力バ
ス127を経由して次段のソートプロセッサ13に出力
される。続いて、このデータ「9」のキーでないデータ
部分がある場合には、データ記憶装置16からこのデー
タ「9」の非キー値部分を読みだし、データ出力バス1
27を経由してこれらを次段のソートプロセッサ13に
出力する。また、キー値の比較が完了したときに、デー
タ「4」においてキー値に続くキーでないデータ部分が
ある場合には、データ入力バス126により前段のソー
トプロセッサ11から送られてくるこれらデータ部分
は、データ記憶装置16に送られて記憶される。
Subsequently, data “4” following data “10” of the fourth data string is input from the input bus 126. As in the case of the data “10”, this data is input to the latch register 135 in 4-byte units, and the data “8”, “7”, “9” in the key value storage units 131, 132, and 133 are stored in 4 bytes. Are compared one by one. At the same time as the input to the latch register 135, the key value of the data "4" is stored in the vacant key value storage unit 13.
4 is stored. In this comparison, the data “9” stored in the key value storage 133 is output as a result of the comparison, instead of the data “4” input to the latch register 135. Therefore, in this case, first, the key value portion of the data “9” is output from the comparator 130 to the next-stage sort processor 13 via the data output bus 127. Subsequently, when there is a non-key data portion of the data “9”, the non-key value portion of the data “9” is read from the data storage device 16 and the data output bus 1
These are output to the sort processor 13 of the next stage via 27. When the comparison of the key values is completed, if there is a non-key data portion following the key value in the data “4”, these data portions sent from the preceding sort processor 11 by the data input bus 126 are Are sent to the data storage device 16 and stored therein.

【0033】この段階において、先程は空き(次段のソ
ートプロセッサに出力済みで不要のデータの残ってい
る)となっていたキー値格納部134には、データ
「4」のキー値が格納されており、一方、先程「9」の
キー値が格納されていたキー値格納部133が空きとな
っている。従って、制御部125は、比較器130に対
して、そのデータ入力ポート136、137、139、
140からのデータの比較するように設定を行う。設定
が終了すると、比較器130に接続されているラッチレ
ジスタ135には、データ記憶装置16から、データス
トリング(9、8、5、0)のデータ「9」に続くデー
タ「8」のキー値が4バイトずつ読み出されて格納され
て、他のキー値格納部131、132、134にそれぞ
れ格納されているデータ「8」、「7」、「4」と比較
器130において4バイトずつ比較される。この比較動
作は、データ「8」のキー値の最初の4バイトがラッチ
レジスタ135に格納されると同時に始まる。データ
「8」のキー値のラッチレジスタ135への格納と同時
に空いているキー値格納部133に同じものが格納され
て行く。さらに、同時にデータ入力バス126により前
段のソートプロセッサ11から送られてくる(10、
4、3、1)中の「4」に続くデータ「3」をデータ記
憶装置16に格納する。
At this stage, the key value of data "4" is stored in the key value storage unit 134 which was previously empty (output to the next-stage sort processor and unnecessary data remains). On the other hand, the key value storage unit 133 in which the key value of “9” was stored is vacant. Therefore, the control unit 125 sends the data input ports 136, 137, 139,
The setting is made so as to compare the data from 140. When the setting is completed, the key value of the data “8” following the data “9” of the data string (9, 8, 5, 0) is stored in the latch register 135 connected to the comparator 130 from the data storage device 16. Are read out and stored in units of 4 bytes, and compared with the data “8”, “7”, and “4” stored in the other key value storage units 131, 132, and 134, respectively, in the comparator 130 in units of 4 bytes. Is done. This comparison operation starts as soon as the first four bytes of the key value of data “8” are stored in the latch register 135. At the same time as storing the key value of data “8” in the latch register 135, the same key value is stored in the vacant key value storage unit 133. Further, at the same time, the data is sent from the preceding sort processor 11 by the data input bus 126 (10,
Data “3” following “4” in (4, 3, 1) is stored in the data storage device 16.

【0034】図4は、以上説明したソート処理におけ
る、データの流れを図示化したものである。図におい
て、10Kはデータ「10」のキー値を示し、10K
1、10Kー2は各々データ「10」のキー値の最初の
4バイト、次の4バイトを示している。 また、この図
の例では、キー値が8バイト(4バイト*2)の場合を
示している。
FIG. 4 illustrates the flow of data in the sort processing described above. In the figure, 10 K indicates the key value of the data “10”, and 10 K −1 and 10 K −2 indicate the first 4 bytes and the next 4 bytes of the key value of the data “10”, respectively. Also, the example of this figure shows a case where the key value is 8 bytes (4 bytes * 2).

【0035】なお、上記の説明において、データ「9」
が出力された後に、データ「8」のキー値部分をデータ
記憶装置16から読み出して、キー値格納部133に、
また、キー値を4バイトずつ順番にラッチレジスタに格
納するように説明したが、この動作は、図1に示したソ
ートプロセッサの構成においては、制御部125がキー
値格納部に接続されているバスを時分割に使用して行な
う。また、データ記憶装置16と、キー値格納部131
〜134およびラッチレジスタ135と、を別のバスで
接続するようにしてもよい。
In the above description, the data "9"
Is output, the key value portion of the data “8” is read from the data storage device 16 and stored in the key value storage unit 133.
Also, the description has been made such that the key value is stored in the latch register in order of 4 bytes. However, in the operation of the sort processor shown in FIG. 1, the control unit 125 is connected to the key value storage unit. This is performed using the bus in a time-sharing manner. Further, the data storage device 16 and the key value storage unit 131
To 134 and the latch register 135 may be connected by another bus.

【0036】以上の動作を繰り返して行くことによりソ
ート処理が完了する。ここで、ソート処理が完了に近づ
くと、4本あるデータストリングのデータがなくなって
行く。例えば、この例の場合には、データストリング
(8、3、2、1)、(7、6、5、4)、(9、8、
5、0)、(10、4、3、1)・・・・が入力され、
ソートプロセッサ12はこれを併合してデータストリン
グ(10、9、8、8、7、6、5、5、4、4、3、
3、2、1、1、0)、・・・を出力するが、出力にお
いて、2つのデータ「4」が出力されてしまうと、2本
目のデータストリング(7、6、5、4)のデータは、
このソートプロセッサ12からはなくなる。このような
データストリングに対しては、対応するキー値格納部か
らのデータを比較対象としないように制御部125が比
較器130を制御する。
By repeating the above operation, the sorting process is completed. Here, as the sort process approaches to completion, the data of the four data strings is lost. For example, in the case of this example, the data strings (8, 3, 2, 1), (7, 6, 5, 4), (9, 8,
5, 0), (10, 4, 3, 1)...
The sort processor 12 merges the data strings into data strings (10, 9, 8, 8, 7, 6, 5, 5, 4, 4, 3,.
3, 2, 1, 1, 0),..., But when two data “4” are output, the second data string (7, 6, 5, 4) is output. Data is,
This sort processor 12 is no longer present. For such a data string, the control unit 125 controls the comparator 130 so that the data from the corresponding key value storage unit is not compared.

【0037】次に、データ記憶装置15〜18の構成に
ついて説明する。データ記憶装置15〜18は、通常D
RAMにより構成される。例えば、100万件、64M
Bのデータのソート処理を行なうことを考えると、従来
技術と本発明では図4に示すような差異が生じる。図5
は、一度に比較するデータを変化させたときのデータ記
憶装置と必要なDRAMの数量の比較を示す図である。
このように、従来技術に比較して、本発明は、ハードウ
ェア量の減少が可能であるが、更に、比較器で一度に比
較する個数KをDRAMの容量、例えば、容量16Mb
it、8ビット幅のDRAM4つでの最小単位が8MB
であることに注目し、これの約数(この場合には4)を
選んで実現することで、DRAMの個数が少なくなるハ
ードウェア実装が可能であることがわかる。
Next, the configuration of the data storage devices 15 to 18 will be described. The data storage devices 15 to 18 are usually D
It is composed of a RAM. For example, 1 million, 64M
Considering that the B data is sorted, there is a difference as shown in FIG. 4 between the prior art and the present invention. FIG.
FIG. 5 is a diagram showing a comparison of the number of DRAMs required for a data storage device when data to be compared at a time is changed.
As described above, the present invention can reduce the amount of hardware compared to the prior art, and furthermore, the number K to be compared at a time by the comparator is determined by the capacity of the DRAM, for example, the capacity of 16 Mb.
It, the minimum unit for 4 DRAMs of 8 bit width is 8MB
It can be seen that hardware implementation that reduces the number of DRAMs is possible by selecting and implementing a divisor of this (4 in this case).

【0038】以上のように、この実施の形態によれば、
LSIのピン数制限のために生じるソートプロセッサの
LSI化の実装問題を解決することができる。また、L
SI化の実装問題を解決することにより、ソート処理装
置で必要とするソートプロセッサの数を減少させ、以っ
てソート処理装置のハードウェア規模を小さくし、一定
データ量をソートするソート処理装置を小型化すること
が可能となる。また、このようなソート処理装置内部で
用いられるデータ記憶装置のDRAMの個数を減少さ
せ、ソート処理装置を小型化することを可能とする。ま
た、ソートプロセッサを本発明による構成にしても、ソ
ートプロセッサのデータ記憶装置へのアクセス回数増加
による性能低下が発生しない。また、ソート処理装置に
対し入力されるデータが複数のソートキーを有し、それ
らソートキー各々に対して昇順降順のソート指定が独立
に指定されている場合にも、ソートプロセッサは単一の
キーに対して降順または昇順のソートのみ行えばよく、
ソートプロセッサのハードウェアを簡素化することがで
きる。
As described above, according to this embodiment,
It is possible to solve the problem of mounting the sort processor on the LSI, which is caused by the limitation of the number of pins of the LSI. Also, L
By solving the SI implementation problem, the number of sort processors required in the sort processing device is reduced, thereby reducing the hardware scale of the sort processing device and providing a sort processing device for sorting a fixed amount of data. It is possible to reduce the size. Further, it is possible to reduce the number of DRAMs of the data storage device used inside such a sort processing device, and to reduce the size of the sort processing device. In addition, even if the sort processor is configured according to the present invention, performance degradation due to an increase in the number of times the sort processor accesses the data storage device does not occur. Also, when the data input to the sort processing device has a plurality of sort keys, and the sort specification of the ascending order and the descending order is independently specified for each of the sort keys, the sort processor performs the processing for the single key. Only sort in descending or ascending order.
The hardware of the sort processor can be simplified.

【0039】[0039]

【発明の効果】以上のように、この発明によれば、キー
値データを反転させるキー値変換部を設けるようにした
ので、ソートプロセッサの有する比較器には比較するデ
ータのうち、最も大きいデータまたは最も小さいデータ
を選択する機能だけせれば良い。
As described above, according to the present invention, the key value conversion section for inverting the key value data is provided, so that the comparator having the sort processor has the largest data among the data to be compared. Alternatively, only the function of selecting the smallest data may be provided.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 この発明による、ソートプロセッサの一実施
の形態を示す図である。
FIG. 1 is a diagram showing an embodiment of a sort processor according to the present invention.

【図2】 この発明による、ソートプロセッサを用いて
構成したソート処理装置の構成を示す図である。
FIG. 2 is a diagram showing a configuration of a sort processing device configured using a sort processor according to the present invention.

【図3】 ソート処理装置によるソートの様子を示す図
である。
FIG. 3 is a diagram showing a state of sorting by a sort processing device.

【図4】 ソートプロセッサのソート処理におけるデー
タの流れを示す図である。
FIG. 4 is a diagram showing a data flow in a sort process of a sort processor.

【図5】 一度に比較するデータを変化させたときのデ
ータ記憶装置と必要なDRAMの数量の比較を示す図で
ある。
FIG. 5 is a diagram showing a comparison between the data storage device and the required number of DRAMs when data to be compared at one time is changed.

【図6】 従来のソート処理装置のがホスト計算機との
接続形態を示す図である。
FIG. 6 is a diagram showing a connection form of a conventional sort processing device with a host computer.

【図7】 従来のソート処理装置の構成を示す図であ
る。
FIG. 7 is a diagram illustrating a configuration of a conventional sort processing device.

【図8】 従来のソート処理装置によるデータのソート
の様子を示す図である。
FIG. 8 is a diagram showing how data is sorted by a conventional sort processing device.

【図9】 従来のソート処理装置内部で用いられている
ソートプロセッサを示す図である。
FIG. 9 is a diagram showing a sort processor used inside a conventional sort processing device.

【図10】 従来のソートプロセッサにおいて、一度に
比較するデータの数を2から2より大きい数に増加させ
た場合に発生する性能低下を説明するための図である。
FIG. 10 is a diagram for explaining performance degradation that occurs when the number of data to be compared at a time is increased from 2 to a number larger than 2 in a conventional sort processor.

【符号の説明】[Explanation of symbols]

11、12、13、14 ソートプロセッサ、15、1
6、17、18 データ記憶装置、19 ソート処理装
置の制御部、20 キー変換装置、125 ソートプロ
セッサ内部の制御部、130 比較器、131、13
2、133、134 キー値格納部、135 ラッチレ
ジスタ、136、137、138、139140 入力
ポート。
11, 12, 13, 14 sort processor, 15, 1
6, 17, 18 Data storage device, 19 Control unit of sort processing device, 20 Key conversion device, 125 Control unit inside sort processor, 130 Comparator, 131, 13
2, 133, 134 Key value storage, 135 Latch register, 136, 137, 138, 139140 Input port.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 入力データストリングを格納するデータ
記憶装置と、前記データストリングの連続する比較対象
データの大小関係を比較する比較器と、前記データ記憶
装置および前記比較器を制御する制御部を有するソート
プロセッサを複数台直列に接続して、各ソートプロセッ
サが並列に動作して、各々の比較器を用いて繰返し比較
処理を行うことで、複数のデータのソート処理を行うソ
ート処理装置において、前記比較器の比較機能と異なる
指定のキー値について、このキー値のビットを反転させ
て、初段のソートプロセッサに伝送するキー値変換部を
備えたことを特徴とするソート処理装置。
1. A data storage device for storing an input data string, a comparator for comparing the magnitude relation of successive comparison target data of the data string, and a control unit for controlling the data storage device and the comparator. In a sort processing device that sorts a plurality of data by connecting a plurality of sort processors in series, each sort processor operates in parallel, and repeatedly performs a comparison process using each comparator. A sort processing device comprising: a key value conversion unit that inverts a bit of a specified key value different from a comparison function of a comparator and transmits the inverted key value to a first-stage sort processor.
【請求項2】 前記比較器が比較するデータの大きいほ
うを取り出すように構成されているときには、前記キー
値変換部は、降順指定のキー値のビットを反転させるこ
とを特徴とする請求項1に記載のソート処理装置。
2. The apparatus according to claim 1, wherein when the comparator is configured to take out the larger one of the data to be compared, the key value converter inverts the bits of the key value specified in descending order. 2. The sort processing device according to 1.
【請求項3】 前記比較器が比較するデータの小さいほ
うを取り出すように構成されているときには、前記キー
値変換部は、昇順指定のキー値のビットを反転させるこ
とを特徴とする請求項1に記載のソート処理装置。
3. The key value conversion unit according to claim 1, wherein when the comparator is configured to take out the smaller one of the data to be compared, the key value conversion unit inverts the bits of the key value specified in ascending order. 2. The sort processing device according to 1.
JP2000125681A 2000-01-01 2000-04-26 Sort processor Pending JP2000322236A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000125681A JP2000322236A (en) 2000-01-01 2000-04-26 Sort processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000125681A JP2000322236A (en) 2000-01-01 2000-04-26 Sort processor

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP10700196A Division JP3196637B2 (en) 1996-04-26 1996-04-26 Sort processor and sort processing device

Publications (1)

Publication Number Publication Date
JP2000322236A true JP2000322236A (en) 2000-11-24

Family

ID=18635590

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000125681A Pending JP2000322236A (en) 2000-01-01 2000-04-26 Sort processor

Country Status (1)

Country Link
JP (1) JP2000322236A (en)

Similar Documents

Publication Publication Date Title
JP3262602B2 (en) Dictionary-based data compression / decompression system
US20150070957A1 (en) Semiconductor device and method of writing/reading entry address into/from semiconductor device
JP3026962B2 (en) Word string compression circuit
US5081608A (en) Apparatus for processing record-structured data by inserting replacement data of arbitrary length into selected data fields
JP3196637B2 (en) Sort processor and sort processing device
US5974411A (en) N-way processing of bit strings in a dataflow architecture
US5511189A (en) Data sorting apparatus capable of detecting completion of data sorting early and sorting method therefor
JPH0666050B2 (en) Sort processing method
JP2000322236A (en) Sort processor
JPS5941215B2 (en) Main memory write control method
JPH0317780A (en) Method and device for retrieving symbol string
JPH05143287A (en) Hardware sorting processor
JP3113765B2 (en) Variable length code decoding circuit
JPS63231526A (en) Sort processor
JP2590866B2 (en) Data retrieval device
JPH0531790B2 (en)
JPS6237739A (en) Sorting processor
JP3447180B2 (en) Data operation circuit
JPH0275018A (en) Merge processing method
JPS63172335A (en) Sorting processor
JPH0271327A (en) Sorting processor
JPH0797311B2 (en) Data sorter
JPH0748309B2 (en) Symbol string matching memory and its cascade connection method
JPH0926872A (en) Pipeline merge sorter
JPH0628151A (en) Parallel latch circuit for serial data

Legal Events

Date Code Title Description
A02 Decision of refusal

Effective date: 20040427

Free format text: JAPANESE INTERMEDIATE CODE: A02