JP2014211682A - Information processor and information processing method - Google Patents

Information processor and information processing method Download PDF

Info

Publication number
JP2014211682A
JP2014211682A JP2013086466A JP2013086466A JP2014211682A JP 2014211682 A JP2014211682 A JP 2014211682A JP 2013086466 A JP2013086466 A JP 2013086466A JP 2013086466 A JP2013086466 A JP 2013086466A JP 2014211682 A JP2014211682 A JP 2014211682A
Authority
JP
Japan
Prior art keywords
data
register
information processing
unit
comparison
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
Application number
JP2013086466A
Other languages
Japanese (ja)
Other versions
JP5960639B2 (en
Inventor
青木 孝
Takashi Aoki
孝 青木
英一 細谷
Hidekazu Hosoya
英一 細谷
大塚 卓哉
Takuya Otsuka
卓哉 大塚
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2013086466A priority Critical patent/JP5960639B2/en
Publication of JP2014211682A publication Critical patent/JP2014211682A/en
Application granted granted Critical
Publication of JP5960639B2 publication Critical patent/JP5960639B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/22Arrangements for sorting or merging computer data on continuous record carriers, e.g. tape, drum, disc
    • G06F7/24Sorting, 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

Abstract

PROBLEM TO BE SOLVED: To provide an information processor capable of reducing the required quantity of a storage device in on-line algorithm type merge sort processing.SOLUTION: An information processor for performing merge sorting to stream data by using an on-line type algorithm includes: a storage part for storing at least a first half portion of data consisting of a first half portion and a second half portion input as the stream data, and separately sorted in advance in accordance with a predetermined rule; and a sort processing part for performing merge sorting to the data of the second half portion and the first half portion, and outputting the data. The sort processing part is configured so as to be shared by a region in which the first half portion is stored and a region in which the second half portion is stored in the storage part.

Description

本発明は、複数のデータを並び替える技術、特に、オンライン型アルゴリズムを利用してストリームデータをソートする技術に関する。   The present invention relates to a technique for rearranging a plurality of data, and more particularly to a technique for sorting stream data using an online algorithm.

従来のマージソータをストリームデータに対してオンライン型アルゴリズムで実装する場合では、マージソータの各段に、該当段におけるマージソート対象のデータ個数、すなわち、第n段の場合では2^(n−1)で2組、つまり2^n個のデータに相当する記憶装置が必要であった。   In the case where the conventional merge sorter is implemented on the stream data by an online algorithm, the number of merge sort target data in each stage of the merge sorter, that is, 2 ^ (n-1) in the case of the nth stage. Two sets of storage devices corresponding to 2 ^ n pieces of data were required.

従来のマージソートの一例が非特許文献1に開示されている。図7を参照して、非特許文献1に開示されたマージソートの手順を説明する。マージソートは、各1個のデータの比較を行う1段目と、1段目の結果を各2個ずつ2組にして一時的に格納し、これを比較しつつ併合する2段目と、2段目の結果を各4個ずつ2組にして一時的に格納し、これを比較しつつ併合する3段目とを有する構成である。   An example of a conventional merge sort is disclosed in Non-Patent Document 1. With reference to FIG. 7, the procedure of the merge sort disclosed in Non-Patent Document 1 will be described. The merge sort is a first stage for comparing each piece of data, a second stage for temporarily storing the results of the first stage in two sets of two each, and merging while comparing the two sets, The second stage results are stored in two sets of four each, and the third stage is merged while comparing them.

“マージソート[Merge Sort]”、[online]、[平成25年4月2日検索]、インターネット<URL:http:// www.codereading.com/ algo_and_ds/ algo/ merge_sort. html>“Merge Sort [Merge Sort]”, [online], [Search April 2, 2013], Internet <URL: http://www.codereading.com/algo_and_ds/algo/merge_sort.html>

特に、絶え間なく到来するデータに対して、常に停滞することなくソートを行い続けるマージソートのオンライン実装では、以下に説明するように、段数が増えることにより記憶装置の所要量の増大が避けられない。   In particular, in the online implementation of merge sort that keeps sorting without stagnation for constantly arriving data, as described below, the increase in the number of stages is inevitable due to the increase in the number of stages. .

初段には、比較するデータ各1個のための記憶装置が必要であり、比較の結果、時間的に指定の大小順になるように出力する機能を備え、第2段には、比較するデータ各2個のための記憶装置が必要であり、比較の結果、時間的に指定の大小順になるように出力する機能を備えている。一般に、第n段には、比較するデータ各(2^(n−1))個のための記憶装置が必要であり、比較の結果、時間的に指定の大小順になるように出力する機能を備えることが必要であった。これは、各段でデータ比較を進めていく途中で、2つデータ列のどちらが、どれだけ残るかを、予め決めることができないため、どちらについても、全体を格納できる記憶容量を考慮して第n段に2組の(2^(n−1))個の比較対象のデータを保持するための記憶装置を用意しなければならないことに起因する。オンライン型実装に期待される間断ない動作のためには、これらの総和の記憶装置を備えることが必要である。   The first stage requires a storage device for each piece of data to be compared, and has a function of outputting the result of comparison in order of the specified magnitude in time, and the second stage has each data to be compared. Two storage devices are required, and as a result of the comparison, a function is provided to output in order of the designated magnitude in time. In general, the n-th stage requires a storage device for each (2 ^ (n-1)) pieces of data to be compared. It was necessary to prepare. This is because it is not possible to determine in advance how much of the two data strings will remain in the middle of the data comparison at each stage. This is because two sets of (2 ^ (n-1)) comparison target data must be prepared in n stages. For the uninterrupted operation expected for online implementation, it is necessary to provide a storage device for these sums.

また、処理対象となるデータの増大に対して、ハードウェアとして必要な記憶装置の所要量が増大してしまうという問題がある。   In addition, there is a problem that the required amount of storage devices required as hardware increases as the data to be processed increases.

本発明は上述したような技術が有する問題点を解決するためになされたものであり、オンラインアルゴリズム型のマージソートの処理において、記憶装置の所要量の削減を可能にした情報処理装置および情報処理方法を提供することを目的とする。   The present invention has been made to solve the above-described problems of the technology, and an information processing apparatus and information processing capable of reducing a required amount of a storage device in an online algorithm type merge sort process. It aims to provide a method.

上記目的を達成するための本発明の情報処理装置は、オンライン型アルゴリズムを利用してストリームデータをマージソートする情報処理装置であって、
前記ストリームデータとして入力され、所定のルールにしたがって予め別々にソートされた前半部分および後半部分からなるデータのうち、少なくとも該前半部分を記憶する記憶部と、
前記後半部分および前記前半部分のデータをマージソートして出力するソート処理部と、を有し、
前記ソート処理部は、前記記憶部において、前記前半部分を記憶する領域と前記後半部分を記憶する領域とで共用する構成である。
In order to achieve the above object, an information processing apparatus of the present invention is an information processing apparatus that merges and sorts stream data using an online algorithm,
A storage unit that stores at least the first half part of the data consisting of the first half part and the second half part, which is input as the stream data and sorted separately in advance according to a predetermined rule;
A sort processing unit that outputs a merge sort of the data of the latter half and the first half, and
In the storage unit, the sort processing unit is configured to be shared by the area for storing the first half part and the area for storing the second half part.

また、本発明の情報処理方法は、オンライン型アルゴリズムを利用してストリームデータをマージソートする情報処理装置による情報処理方法であって、
所定のルールにしたがって予め別々にソートされた前半部分および後半部分からなるデータのうち、前記ストリームデータとして入力される前記前半部分のデータを前記情報処理装置の記憶部に格納し、
前記ストリームデータとして入力される前記後半部分のデータと前記記憶部に格納された前記前半部分のデータをマージソートして出力し、
前記マージソートを行う際、前記記憶部において、前記前半部分を記憶する領域と前記後半部分を記憶する領域とで共用するものである。
The information processing method of the present invention is an information processing method by an information processing apparatus that performs merge sort on stream data using an online algorithm,
Of the data consisting of the first half part and the second half part separately sorted in advance according to a predetermined rule, the data of the first half part input as the stream data is stored in the storage unit of the information processing apparatus,
Merge sort and output the latter half of the data input as the stream data and the first half of the data stored in the storage unit,
When performing the merge sort, in the storage unit, the area for storing the first half part and the area for storing the second half part are shared.

本発明によれば、記憶装置の所要量を削減でき、処理対象の増大に対するハードウェアの増大を緩和できる。   According to the present invention, the required amount of storage devices can be reduced, and the increase in hardware with respect to the increase in processing targets can be mitigated.

第1の実施形態の情報処理装置の一構成例を示すブロック図である。It is a block diagram which shows the example of 1 structure of the information processing apparatus of 1st Embodiment. 第1の実施形態のマージソータの第n段の構成例を示す図である。It is a figure which shows the structural example of the nth stage of the merge sorter of 1st Embodiment. 第1の実施形態の情報処理装置によるマージソートの動作手順を示すフローチャートである。It is a flowchart which shows the operation | movement procedure of the merge sort by the information processing apparatus of 1st Embodiment. 第n段の入力となるデータの時系列の一例を示す図である。It is a figure which shows an example of the time series of the data used as the nth step input. 第n段の出力となるデータの時系列の一例を示す図である。It is a figure which shows an example of the time series of the data used as the output of the nth stage. 第2の実施形態のマージソータの一構成例を示すブロック図である。It is a block diagram which shows the example of 1 structure of the merge sorter of 2nd Embodiment. 従来のマージソートの手順を説明するための図である。It is a figure for demonstrating the procedure of the conventional merge sort.

オンラインアルゴリズム型のマージソータを構成する、本発明の情報処理装置および情報処理方法について、実施形態を説明する。   An embodiment of an information processing apparatus and an information processing method of the present invention constituting an online algorithm type merge sorter will be described.

(第1の実施形態)
本実施形態の情報処理装置の構成を説明する。本実施形態は、第1段から第n段(nは2以上の整数)のマージソータを有するオンラインアルゴリズム型のマージソータの場合である。図1は本実施形態の情報処理装置の一構成例を示すブロック図である。
(First embodiment)
The configuration of the information processing apparatus according to this embodiment will be described. This embodiment is a case of an online algorithm type merge sorter having a merge sorter from the first stage to the n-th stage (n is an integer of 2 or more). FIG. 1 is a block diagram illustrating a configuration example of the information processing apparatus according to the present embodiment.

図1に示すように、情報処理装置10は、前段のソータから到来するストリームデータを受け付ける入力部11と、マージソートの対象となるデータを保持する記憶部12と、マージソートを実行するソート処理部13と、マージソート後のデータを順に出力する出力部14とを有する。ソート処理部13は、プログラムにしたがって処理を実行するCPU(Central Processing Unit)(不図示)と、プログラムを記憶するメモリ(不図示)とを有する。   As illustrated in FIG. 1, the information processing apparatus 10 includes an input unit 11 that receives stream data coming from a previous sorter, a storage unit 12 that holds data to be merged, and a sort process that performs merge sort. Section 13 and an output section 14 that sequentially outputs the data after the merge sort. The sort processing unit 13 includes a CPU (Central Processing Unit) (not shown) that executes processing according to a program, and a memory (not shown) that stores the program.

図2は本実施形態のマージソータの第n段の構成例を示す図である。ここで、第(n−1)段でソートされたデータの長さをNとすると、N=2^(n−1)である。   FIG. 2 is a diagram illustrating a configuration example of the nth stage of the merge sorter according to the present embodiment. Here, if the length of the data sorted in the (n−1) th stage is N, N = 2 ^ (n−1).

第n段のマージソータは、図2に示すように、カウンタ21と、ラベル生成部22と、レジスタR_0〜R_Nと、比較選択部23と、制御部24とを有する構成である。図1に示したソート処理部13におけるCPU(不図示)がプログラムにしたがって処理を実行することで、図2に示すカウンタ21、ラベル生成部22、比較選択部23および制御部24が情報処理装置10に仮想的に構成される。レジスタR_0〜R_Nが図1に示した記憶部12に含まれている。   As shown in FIG. 2, the n-th merge sorter includes a counter 21, a label generation unit 22, registers R_ 0 to R_N, a comparison / selection unit 23, and a control unit 24. A CPU (not shown) in the sort processing unit 13 illustrated in FIG. 1 executes processing according to a program, whereby the counter 21, the label generation unit 22, the comparison selection unit 23, and the control unit 24 illustrated in FIG. 10 is virtually configured. Registers R_0 to R_N are included in the storage unit 12 shown in FIG.

以下では、カウンタ21がカウントする値をcとし、ラベル生成部22が生成するラベルをLとする。   Hereinafter, the value counted by the counter 21 is set as c, and the label generated by the label generation unit 22 is set as L.

kを0からNの任意の整数とすると、各レジスタR_kは、ラベル生成部22で付与されるラベルの値を記録するためのフィールドL_kと、比較対象のデータを記録するためのフィールドv_kからなる。   When k is an arbitrary integer from 0 to N, each register R_k includes a field L_k for recording a label value given by the label generation unit 22 and a field v_k for recording comparison target data. .

カウンタ21は、第(n−1)段から出力されるデータが入力される度に、カウント値cを「c+1」に更新する。カウンタ21は、c=Nになると、カウント値cをリセットして0にする。   The counter 21 updates the count value c to “c + 1” every time data output from the (n−1) -th stage is input. The counter 21 resets the count value c to 0 when c = N.

ラベル生成部22は、第(n−1)段から出力されるデータが入力される度に、データにラベルLを付与する。また、ラベル生成部22は、カウント値cを監視し、c=Nになると、データに付与するラベルを(L+1)mod 4の値に更新する。   The label generation unit 22 assigns a label L to the data every time data output from the (n−1) -th stage is input. Further, the label generation unit 22 monitors the count value c, and when c = N, updates the label to be added to the data to the value of (L + 1) mod 4.

比較選択部23は、第(n−1)段でソートされた、前半部分および後半部分からなるデータのうち、前半部分がレジスタR_1〜R_Nに格納された後、後半部分のデータが新たにレジスタR_0に格納される度に、レジスタR_1〜R_kに格納された後半部分の先頭のデータとv_Nの値を比較し、昇順に出力する場合には小さい方を出力値とし、降順に出力する場合には大きい値を出力値とする。昇順および降順がソートに関するルールに相当し、本実施形態では、昇順に出力する場合で説明する。   The comparison / selection unit 23 stores the first half of the data sorted in the (n-1) -th stage and the latter half in the registers R_1 to R_N, and then the second half of the data is newly registered. Each time the data is stored in R_0, the first half data stored in the registers R_1 to R_k is compared with the value of v_N. When outputting in ascending order, the smaller value is used as the output value, and when outputting in descending order. The output value is a large value. The ascending order and descending order correspond to the rules relating to sorting, and in the present embodiment, description will be made on the case of outputting in ascending order.

具体的には、比較選択部23は、各レジスタR_kのフィールドL_kを参照し、<条件式(1)>「隣接する2つの値(L_k,L_(k+1))について(1,0)または(3,2)となる箇所がある」を満たすkがあるか否かを調べ、該当するkがあると、<条件式(2)>「v_k<v_N」を満たすか否か判定し、条件式(2)を満たしていると、v_kの値を出力値とする。一方、比較選択部23は、条件式(1)を満たさない、または条件式(1)を満たしても条件式(2)を満たさない場合、v_Nの値を出力値とする。さらに、比較選択部23は、その出力結果を制御部24に通知する。   Specifically, the comparison / selection unit 23 refers to the field L_k of each register R_k, and <conditional expression (1)> “adjacent two values (L_k, L_ (k + 1)) (1, 0) or ( 3, 2) ”is checked. If there is a corresponding k, it is determined whether <conditional expression (2)>“ v_k <v_N ”is satisfied. If (2) is satisfied, the value of v_k is set as the output value. On the other hand, the comparison / selection unit 23 sets the value of v_N as the output value when the conditional expression (1) is not satisfied, or when the conditional expression (1) is not satisfied even if the conditional expression (1) is satisfied. Further, the comparison / selection unit 23 notifies the control unit 24 of the output result.

制御部24は、ラベルの付与されたデータをレジスタR_1〜R_Nに順次シフトさせて格納する。また、制御部24は、比較選択部23から受け取る出力結果がv_kを出力したことを示していると、レジスタR_1からR_kのそれぞれの値をレジスタR_(k−1)の値に更新する。また、制御部24は、受け取った出力結果がv_Nを出力したことを示していると、レジスタR_1からR_Nのそれぞれの値をレジスタR_(k−1)の値に更新する。そして、制御部24は、出力結果がいずれの場合でも、R_0の値を新たに入力されたデータの値xに更新する。   The control unit 24 sequentially shifts and stores the labeled data in the registers R_1 to R_N. Further, when the output result received from the comparison / selection unit 23 indicates that v_k is output, the control unit 24 updates each value of the registers R_1 to R_k to the value of the register R_ (k−1). Further, when the received output result indicates that v_N is output, the control unit 24 updates each value of the registers R_1 to R_N to the value of the register R_ (k−1). Then, the control unit 24 updates the value of R_0 to the value x of the newly input data regardless of the output result.

従来のオンラインアルゴリズム型のマージソータでは、比較対象のデータを保持するために、第n段において、(2^(n−1))個のレジスタを含む記憶装置を2組、すなわち(2^n)個のレジスタを用意していた。この記憶装置が2組必要になるのは、最悪の場合、どちらか一方の記憶装置のデータを全て、他方の記憶装置に後続して出力しなければならず、前半あるいは後半どちらがどれだけ残るかは、処理毎に変わるからである。しかしながら、処理の途中で、双方の記憶装置には空きができる。   In the conventional online algorithm type merge sorter, in order to hold the data to be compared, two sets of storage devices including (2 ^ (n-1)) registers in the n-th stage, that is, (2 ^ n) Registers were prepared. In the worst case, two sets of this storage device are required, and all the data in one storage device must be output to the other storage device, and how much of the first half or the second half remains. This is because it changes for each process. However, in the middle of processing, both storage devices are free.

これに対して、本実施形態の構成では、図2に示すように、記憶装置はR_0〜R_Nで十分であり、該当する第n段には1組の(2^(n−1)+1)個のレジスタを含む記憶装置を用意すればよい。そのため、本実施形態では、各段における記憶装置の所要量を削減でき、空き容量を再利用することができる。   On the other hand, in the configuration of the present embodiment, as shown in FIG. 2, R_0 to R_N are sufficient for the storage device, and one set of (2 ^ (n-1) +1) is included in the corresponding n-th stage. A storage device including a plurality of registers may be prepared. For this reason, in the present embodiment, the required amount of the storage device in each stage can be reduced, and the free space can be reused.

なお、本実施形態では、CPU(不図示)がプログラムにしたがって処理を実行することで、カウンタ21、ラベル生成部22、比較選択部23および制御部24が情報処理装置10に仮想的に構成される場合で説明しているが、これらの構成のうち、一部または全部がそれぞれ専用の回路で構成されてもよい。   In the present embodiment, the CPU (not shown) executes processing according to a program, so that the counter 21, the label generation unit 22, the comparison selection unit 23, and the control unit 24 are virtually configured in the information processing apparatus 10. However, some or all of these configurations may be configured by dedicated circuits.

次に、本実施形態の情報処理装置による、第n段のマージソートの動作を説明する。ここでは、n=3の場合で説明する。   Next, the operation of the n-th merge sort by the information processing apparatus of this embodiment will be described. Here, the case where n = 3 will be described.

図3は本実施形態の情報処理装置によるマージソートの動作手順を示すフローチャートである。ここでは、昇順にソートする場合で説明する。降順にソートする場合は、図3に示すフローのステップ106における判定式「v_k<v_N」を「v_k>v_N」に置き換えればよい。   FIG. 3 is a flowchart showing the operation procedure of merge sort by the information processing apparatus of this embodiment. Here, the case of sorting in ascending order will be described. When sorting in descending order, the determination formula “v_k <v_N” in step 106 of the flow shown in FIG. 3 may be replaced with “v_k> v_N”.

カウント値cおよびラベルLの初期値を0とし、各フィールドL_k(k=0,・・・,N)の初期値を0とする。各フィールドv_k(k=0,・・・,N)の初期値は、無効値であり任意であるが、例えば、0とする。   The initial value of the count value c and the label L is set to 0, and the initial value of each field L_k (k = 0,..., N) is set to 0. The initial value of each field v_k (k = 0,..., N) is an invalid value and is arbitrary, but is set to 0, for example.

第(n−1)段から出力されるデータが1つ入力される度に、ソート処理部13は、図3に示す動作フローを実行する。第(n―1)段からデータが入力され、この値を「x」とすると、カウンタ21はカウント値cを「c+1」に更新する(ステップ101)。カウンタ21およびラベル生成部22は、c=Nであるか否かの判定を行い(ステップ102)、c=Nの場合、カウンタ21はカウント値cをリセットし、ラベル生成部22はラベルの値を更新する(ステップ102)。ステップ102において、c=Nでない場合、ラベルLは更新されず、カウント値cはリセットされない。   Each time one piece of data output from the (n−1) -th stage is input, the sort processing unit 13 executes the operation flow shown in FIG. When data is input from the (n−1) th stage and this value is “x”, the counter 21 updates the count value c to “c + 1” (step 101). The counter 21 and the label generation unit 22 determine whether c = N (step 102). If c = N, the counter 21 resets the count value c, and the label generation unit 22 sets the label value. Is updated (step 102). In step 102, when c = N is not satisfied, the label L is not updated and the count value c is not reset.

続いて、ソート処理部13は、図2に示したレジスタR_0〜R_Nに記録される情報について、次のように更新の判定を行う。   Subsequently, the sort processing unit 13 determines whether to update the information recorded in the registers R_0 to R_N illustrated in FIG. 2 as follows.

制御部24は、ラベルの付与されたデータをレジスタR_0〜R_Nに順次シフトさせて格納し、比較選択部23は、全てのレジスタR_0〜R_Nに記録されたラベルについて、<条件式(1)>を満たすか否か判定する(ステップ104)。比較選択部23は、該当するkの値を取得する。   The control unit 24 sequentially shifts and stores the labeled data in the registers R_0 to R_N, and the comparison / selection unit 23 sets <conditional expression (1)> for the labels recorded in all the registers R_0 to R_N. It is determined whether or not the condition is satisfied (step 104). The comparison / selection unit 23 acquires the corresponding value of k.

条件式(1)を満たすkがある場合、比較選択部23は、該当するkを取得し、取得したkに対応するv_kの値が、<条件式(2)>を満たすか否か判定する(ステップ105)。条件式(2)を満たす場合、比較選択部23は、v_kの値を出力値yとし、その出力結果を制御部24に通知する。制御部24は、比較選択部23から受け取る出力結果により、レジスタR_1〜R_kのそれぞれに保持される値を、レジスタR_(k−1)に保持された値に更新する。その際、制御部24は、レジスタR_0のフィールドL_0にラベル生成部22によって付与されたラベルLの値を格納し、フィールドv_0にxの値を格納して、レジスタR_0を更新する(ステップ106)。レジスタR_(k−1)に格納されていたデータがレジスタR_kにシフトする。これにより、昇順が維持されたままレジスタR_Nの方にレジスタ間でデータがシフトする。   When there is k that satisfies the conditional expression (1), the comparison / selection unit 23 acquires the corresponding k, and determines whether or not the value of v_k corresponding to the acquired k satisfies <conditional expression (2)>. (Step 105). When the conditional expression (2) is satisfied, the comparison / selection unit 23 sets the value of v_k as the output value y and notifies the control unit 24 of the output result. The control unit 24 updates the value held in each of the registers R_1 to R_k to the value held in the register R_ (k−1) based on the output result received from the comparison / selection unit 23. At that time, the control unit 24 stores the value of the label L given by the label generation unit 22 in the field L_0 of the register R_0, stores the value of x in the field v_0, and updates the register R_0 (step 106). . The data stored in the register R_ (k−1) is shifted to the register R_k. As a result, data is shifted between the registers toward the register R_N while maintaining the ascending order.

例えば、レジスタR_1のv_1に保持されていた値が出力値yとなった場合、レジスタR_1に保持される値がレジスタR_0に保持されていた値に更新され、新たに入力されたデータの値xがレジスタR_0のフィールドv_0に格納される。   For example, when the value held in v_1 of the register R_1 becomes the output value y, the value held in the register R_1 is updated to the value held in the register R_0, and the value x of the newly input data Is stored in the field v_0 of the register R_0.

一方、ステップ104の判定で条件式(1)を満たさない場合、または、条件式(1)を満たしてもステップ105の判定で条件式(2)を満たさない場合、比較選択部23は、v_Nの値を出力値yとし、その出力結果を制御部24に通知する。制御部24は、比較選択部23から受け取る出力結果により、レジスタR_1〜R_Nのそれぞれに保持される値を、レジスタR_(k−1)に保持された値に更新する。その際、制御部24は、レジスタR_0のフィールドL_0にラベル生成部22によって付与されたラベルLの値を格納し、フィールドv_0にxの値を格納して、レジスタR_0を更新する(ステップ107)。   On the other hand, if the conditional expression (1) is not satisfied in the determination in step 104, or if the conditional expression (2) is not satisfied in the determination in step 105 even if the conditional expression (1) is satisfied, the comparison / selection unit 23 determines that v_N Is set as an output value y, and the output result is notified to the control unit 24. The control unit 24 updates the value held in each of the registers R_1 to R_N to the value held in the register R_ (k−1) based on the output result received from the comparison / selection unit 23. At that time, the control unit 24 stores the value of the label L given by the label generation unit 22 in the field L_0 of the register R_0, stores the value of x in the field v_0, and updates the register R_0 (step 107). .

このようにして、第n段のマージソータは、第(n−1)段から入力されるデータに対して、カウンタ21で計数し、ラベルLを付与し、上述した論理判断にしたがってレジスタR_0〜R_Nに順次格納して更新することで、N=2^(n−1)個のソートの済んだ2つのデータ系列を、昇順にマージして、2^n個のソートの済んだ1つのデータ系列を生成する。   In this way, the n-th merge sorter counts the data input from the (n−1) -th stage by the counter 21, adds the label L, and registers R_0 to R_N according to the above-described logical determination. Are sequentially stored and updated, so that two data series that have been sorted by N = 2 ^ (n-1) are merged in ascending order, and one data series that has been sorted by 2 ^ n. Is generated.

次に、図3に示した手順の具体例を、図4および図5を参照して説明する。   Next, a specific example of the procedure shown in FIG. 3 will be described with reference to FIGS.

図4は第n段の入力となるデータの時系列の一例を示す図である。図5は第n段の出力となるデータの時系列の一例を示す図である。説明を簡単にするために、n=3とする。   FIG. 4 is a diagram illustrating an example of a time series of data to be input at the nth stage. FIG. 5 is a diagram illustrating an example of a time series of data to be output at the nth stage. In order to simplify the explanation, n = 3.

第n段の入力となるデータ系列は、すでに(2^(n−1))の系列についてソートの済んでいる2つのデータ系列を連結したものである。n=3の場合の出力は、図4に示すように、ソートの済んだ4つのデータで構成されるデータ系列を、2つ連結させたものになる。   The data series that becomes the input of the nth stage is obtained by concatenating two data series that have already been sorted with respect to the (2 ^ (n-1)) series. As shown in FIG. 4, the output when n = 3 is a concatenation of two data series composed of four sorted data.

n=3の場合の第n段のマージソータが達成する機能は、図5に示すように、N=4個(=2^(n−1)個)のソートの済んだ2つのデータ系列を昇順にマージして、8個(=2^n個)のソートの済んだ1つのデータ系列を生成することである。   As shown in FIG. 5, the function achieved by the nth-stage merge sorter in the case of n = 3 is ascending order of two data series in which N = 4 (= 2 ^ (n-1)) are sorted. To generate one data series that has been sorted into 8 pieces (= 2 ^ n pieces).

第3段のマージソータにおいて、初期化直後に、図4に示すデータ系列が入力されるものとして説明する。   In the third-stage merge sorter, it is assumed that the data series shown in FIG. 4 is input immediately after initialization.

時刻t0に、値x=2のデータが入力されると、カウンタ21が計数を行う。カウント値cの初期値は0なので、このデータの入力により、カウント値cは1となる。続いて、カウンタ21およびラベル生成部22がc=Nであるか否かの判定を行うが、c=Nではないので、カウント値c=1のままである。また、入力されたデータに対して、ラベル生成部22が初期値0のラベルLを付与する。 When data of value x = 2 is input at time t 0 , the counter 21 performs counting. Since the initial value of the count value c is 0, the count value c becomes 1 by inputting this data. Subsequently, the counter 21 and the label generation unit 22 determine whether or not c = N. However, since c = N is not satisfied, the count value c = 1 is maintained. Further, the label generation unit 22 assigns a label L having an initial value 0 to the input data.

次の時刻t0+1に値x=3のデータが入力されるとき、制御部24はレジスタR_0のフィールドL_0に「0」を格納し、フィールドv_0にデータ「2」を格納する。このようにして、時刻t0+3までに最初の4つのデータが順にレジスタに格納される。 When data of the value x = 3 is input at the next time t 0 + 1 , the control unit 24 stores “0” in the field L_0 of the register R_0 and stores data “2” in the field v_0. In this way, the first four data are sequentially stored in the register by time t 0 + 3 .

時刻t0+4に、[数1]のように最初の4つのデータがレジスタR_0〜R_3に格納されたところで、値x=1のデータが入力される。 At the time t 0 + 4 , when the first four data are stored in the registers R_0 to R_3 as in [Equation 1], the data of the value x = 1 is input.

値x=1のデータが入力されたとき、c=Nが成立するので、ラベルLが更新される。次の時刻t0+5に値x=5のデータが入力されるとき、制御部24はレジスタR_0のフィールドL_0に「1」を格納し、フィールドv_0にデータ「1」を格納する。レジスタR_0〜R_4に保持される値は[数2]のようになる。 When data of value x = 1 is input, since c = N is established, the label L is updated. When data of the value x = 5 is input at the next time t 0 + 5 , the control unit 24 stores “1” in the field L_0 of the register R_0 and stores data “1” in the field v_0. The values held in the registers R_0 to R_4 are as shown in [Formula 2].

値x=5のデータが入力されるとき、[数2]を参照すると、条件式(1)がk=0において成立し、さらに、<条件式(2)>も成立するため、v_0=1がyとして出力される。ステップ106において、レジスタR_0のみが更新される。その結果、レジスタR_0〜R_4に保持される値は[数3]のようになる。   When data of value x = 5 is input, referring to [Equation 2], since conditional expression (1) is satisfied at k = 0, and <conditional expression (2)> is also satisfied, v_0 = 1 Is output as y. In step 106, only register R_0 is updated. As a result, the values held in the registers R_0 to R_4 are as shown in [Formula 3].

これ以降、時刻t0+12まで値xのデータが入力される度に、ソート処理部13が図3に示した動作フローを実行する。時刻t0+6〜t0+12における、レジスタR_0〜R_4に保持される値および出力値yを[数4]から[数10]に示す。なお、図4に示さないデータの値を「*」で表記する。 Thereafter, every time data of value x is input until time t 0 + 12 , the sort processing unit 13 executes the operation flow shown in FIG. The values held in the registers R_0 to R_4 and the output value y at times t 0 + 6 to t 0 + 12 are shown in [Expression 4] to [Expression 10]. Note that data values not shown in FIG. 4 are represented by “*”.

次の時刻では、v_4に格納された「*1」の値とv_0に格納された「*5」の値の比較が行われる。以降、第3段では、間断なく到来する図4と同周期の入力に対して、ソート処理部13は、第3段の処理を行い、図5と同周期の出力を発生させる。この出力は、第4段の入力となる。   At the next time, the value of “* 1” stored in v_4 is compared with the value of “* 5” stored in v_0. Thereafter, in the third stage, the sort processing unit 13 performs the third stage processing on the input having the same cycle as in FIG. 4 that arrives without interruption, and generates the output in the same cycle as in FIG. This output is the fourth stage input.

以上のように、レジスタR_0〜R_4、すなわち第n段において、(2^(n−1)+1)個のレジスタ(記憶装置)によって、マージソートの処理が行われることがわかる。   As described above, it is understood that the merge sort process is performed by the registers R_0 to R_4, that is, the (2 ^ (n-1) +1) registers (storage devices) in the nth stage.

本実施形態では、マージソートのオンラインアルゴリズムを実装した場合に前半データと後半データのそれぞれの記憶のために必要となる記憶装置を共用することにより、記憶装置の所要量が概ね半分で済み、記憶装置の所要量を削減することが可能となる。その結果、処理対象の増大に対するハードウェアの増大を緩和できる。   In this embodiment, when the merge sort online algorithm is implemented, by sharing the storage devices required for storing the first half data and the second half data, the required amount of the storage device can be almost halved. It is possible to reduce the amount of equipment required. As a result, an increase in hardware with respect to an increase in processing targets can be mitigated.

(第2の実施形態)
本実施形態は、第1の実施形態で説明したマージソータとは異なる構成の場合である。なお、本実施形態の情報処理装置の全体は、図1のブロック図に示した装置と同様であり、本実施形態では、第1の実施形態と同様な構成についての詳細な説明を省略し、第1の実施形態と異なる点を説明する。
(Second Embodiment)
The present embodiment is a case of a configuration different from the merge sorter described in the first embodiment. Note that the entire information processing apparatus of the present embodiment is the same as the apparatus shown in the block diagram of FIG. 1, and in this embodiment, detailed description of the same configuration as that of the first embodiment is omitted. Differences from the first embodiment will be described.

本実施形態のマージソータの構成を説明する。図6は本実施形態のマージソータの第n段の構成例を示すブロック図である。   The configuration of the merge sorter of this embodiment will be described. FIG. 6 is a block diagram showing a configuration example of the nth stage of the merge sorter of this embodiment.

図6に示すように、第n段のマージソータは、ラベル生成部31と、レジスタR_0〜R_Nと、制御部32_kと、セレクタ33_kと、バス34と、比較選択部35と、分配部36とを有する。   As shown in FIG. 6, the n-th merge sorter includes a label generation unit 31, registers R_0 to R_N, a control unit 32_k, a selector 33_k, a bus 34, a comparison / selection unit 35, and a distribution unit 36. Have.

図1に示したソート処理部13におけるCPU(不図示)がプログラムにしたがって処理を実行することで、図6に示すラベル生成部31、制御部32_0〜32_N、セレクタ33_0〜33_N、バス34、分配部36および比較選択部35が情報処理装置10に仮想的に構成される。レジスタR_0〜R_Nが図1に示した記憶部12に含まれている。   A CPU (not shown) in the sort processing unit 13 illustrated in FIG. 1 executes processing according to a program, whereby the label generation unit 31, the control units 32_0 to 32_N, the selectors 33_0 to 33_N, the bus 34, and the distribution illustrated in FIG. The unit 36 and the comparison / selection unit 35 are virtually configured in the information processing apparatus 10. Registers R_0 to R_N are included in the storage unit 12 shown in FIG.

ラベル生成部31は、カウント値cを計数するカウンタ21およびラベルLを生成するラベル生成部22を有し、これらの値を更新する機能を有する。   The label generation unit 31 includes a counter 21 that counts the count value c and a label generation unit 22 that generates a label L, and has a function of updating these values.

レジスタR_kは、ラベルLを保持するためのフィールドL_kと、比較対象のデータを保持するためのフィールドv_kとを有する。k=2〜Nの場合で、各レジスタR_kの入力はレジスタR_(k−1)の出力と接続されている。   The register R_k has a field L_k for holding a label L and a field v_k for holding data to be compared. In the case of k = 2 to N, the input of each register R_k is connected to the output of the register R_ (k−1).

制御部32_kは、ラベルの付与されたデータをレジスタR_0〜R_Nに順次シフトさせて格納し、条件式(1)を満たすか否か、(L_k,L_(k+1))を調べ、条件式(1)の真偽に対応する制御信号をセレクタ33_kに送信することでセレクタ33_kを制御する。具体的には、制御部32_kは、条件式(1)が満たされる場合、「真」であることを示す第1の制御信号をセレクタ33_kに送信し、条件式(1)が満たされない場合、「偽」であることを示す第2の制御信号をセレクタ33_kに送信する。図6に示すように、制御部32_0〜32_Nから出力される制御信号は比較選択部35にも伝送される。   The control unit 32_k sequentially shifts and stores the labeled data in the registers R_0 to R_N, checks whether or not the conditional expression (1) is satisfied, checks whether (L_k, L_ (k + 1)) satisfies the conditional expression (1 ) Is sent to the selector 33_k to control the selector 33_k. Specifically, when the conditional expression (1) is satisfied, the control unit 32_k transmits a first control signal indicating “true” to the selector 33_k, and when the conditional expression (1) is not satisfied, A second control signal indicating “false” is transmitted to the selector 33_k. As shown in FIG. 6, the control signals output from the control units 32_0 to 32_N are also transmitted to the comparison / selection unit 35.

また、制御部32_kは、比較選択部35の比較結果に対応して、第1の実施形態と同様に、レジスタR_kが保持するデータを更新する。この更新処理の詳細は後述する。   Further, the control unit 32_k updates the data held in the register R_k in accordance with the comparison result of the comparison / selection unit 35, as in the first embodiment. Details of this update process will be described later.

セレクタ33_kは、制御部32_kから受信する制御信号にしたがって、レジスタR_kのv_kの値または0を選択して出力する。具体的には、セレクタ33_kは、第1の制御信号を制御部32_kから受信すると、レジスタR_kのv_kの値を出力し、第2の制御信号を制御部32_kから受信すると、0の値を出力する。   The selector 33_k selects and outputs the value v_k or 0 of the register R_k according to the control signal received from the control unit 32_k. Specifically, the selector 33_k outputs the value of v_k of the register R_k when receiving the first control signal from the control unit 32_k, and outputs the value of 0 when receiving the second control signal from the control unit 32_k. To do.

バス34は、セレクタ33_0〜33_Nの出力の論理和を求めて比較選択部35に出力する。条件式(1)を満たすkに対応するv_kが、バス34を介して、比較選択部35に提供される。   The bus 34 calculates the logical sum of the outputs of the selectors 33_0 to 33_N and outputs the logical sum to the comparison / selection unit 35. V_k corresponding to k that satisfies the conditional expression (1) is provided to the comparison / selection unit 35 via the bus 34.

比較選択部35は、v_Nの値、制御部32_kからの制御信号、およびバス34の出力値に基づいて、出力値yを決定し、比較結果dを分配部36に出力する。具体的には、比較選択部35は、制御部32_0〜32_Nから受信する制御信号により条件式(1)の真偽を判定し、真がある場合には、バス34から受け取るv_kの値とレジスタR_Nのv_Nの値を比較し、条件式(2)を満たすか否かを判定し、v_Nまたはv_kの値をyとして出力する。さらに、比較選択部35は、条件式(2)の判定結果を比較結果dとして分配部36に出力する。   The comparison selection unit 35 determines the output value y based on the value of v_N, the control signal from the control unit 32_k, and the output value of the bus 34, and outputs the comparison result d to the distribution unit 36. Specifically, the comparison / selection unit 35 determines whether the conditional expression (1) is true or false based on the control signal received from the control units 32_0 to 32_N, and if there is true, the value of v_k received from the bus 34 and the register The v_N values of R_N are compared to determine whether or not the conditional expression (2) is satisfied, and the value of v_N or v_k is output as y. Further, the comparison / selection unit 35 outputs the determination result of the conditional expression (2) to the distribution unit 36 as the comparison result d.

例えば、データを昇順に並べる場合、v_k<v_Nであるとき、比較結果dは真となり、比較選択部35はv_kの値を出力値yとする。そして、v_k<v_Nでないとき、比較結果dは偽となり、比較選択部35はv_Nの値を出力値yとする。   For example, when arranging data in ascending order, when v_k <v_N, the comparison result d is true, and the comparison / selection unit 35 sets the value of v_k as the output value y. When v_k <v_N is not satisfied, the comparison result d is false, and the comparison / selection unit 35 sets the value of v_N as the output value y.

分配部36は、比較選択部35から受信する比較結果dを制御部32_0〜32_Nに分配する。   The distribution unit 36 distributes the comparison result d received from the comparison / selection unit 35 to the control units 32_0 to 32_N.

ここで、制御部32_kによる、レジスタR_kに格納される値の更新方法を説明する。   Here, a method of updating the value stored in the register R_k by the control unit 32_k will be described.

制御部32_kは、条件式(2)の判定結果を比較結果dとして分配部36から受け取り、条件式(2)の判定結果が真であり、条件式(1)の判定結果が真である場合には、条件式(2)を満たすkについて、k以下のレジスタR_kの値をR_(k−1)の値に更新し、レジスタR_0については、入力されたデータの(L,x)に更新する。全てのレジスタの各レジスタR_kの入力はレジスタR_(k−1)の出力と接続されており、更新には、その値が用いられる。   The control unit 32_k receives the determination result of the conditional expression (2) from the distribution unit 36 as the comparison result d, and the determination result of the conditional expression (2) is true and the determination result of the conditional expression (1) is true For k satisfying conditional expression (2), the value of the register R_k equal to or less than k is updated to the value of R_ (k−1), and the register R_0 is updated to (L, x) of the input data. To do. The input of each register R_k of all the registers is connected to the output of the register R_ (k−1), and the value is used for updating.

一方、条件式(1)の判定結果が偽である場合、または、条件式(2)の判定結果が偽である場合には、全ての制御部32_0〜32_Nは、レジスタR_1〜R_Nの全てのレジスタの値をレジスタR_(k−1)の値に更新し、レジスタR_0については、入力されたデータの(L,x)に更新する。全てのレジスタの各レジスタR_kの入力はレジスタR_(k−1)の出力と接続されており、更新には、その値が用いられる。   On the other hand, when the determination result of the conditional expression (1) is false or when the determination result of the conditional expression (2) is false, all the control units 32_0 to 32_N have all the registers R_1 to R_N. The value of the register is updated to the value of the register R_ (k−1), and the register R_0 is updated to (L, x) of the input data. The input of each register R_k of all the registers is connected to the output of the register R_ (k−1), and the value is used for updating.

なお、制御部32_Nが判断対象として用いるL_(N+1)については、R_(N+1)として用意する必要はなく、L_(N+1)のみもしくは、固定値で「3」または「1」としておくこと等により、境界条件を打ち消すことができる。また、セレクタ33_Nに対応するv_kがv_Nに相当し、本実施形態では、必須の構成ではないため、図に示すことを省略している。   Note that L_ (N + 1) used as a determination target by the control unit 32_N does not need to be prepared as R_ (N + 1), and only L_ (N + 1) or a fixed value “3” or “1” is set. , Can cancel the boundary condition. In addition, since v_k corresponding to the selector 33_N corresponds to v_N and is not an essential configuration in this embodiment, the illustration is omitted.

さらに、本実施形態では、CPU(不図示)がプログラムにしたがって処理を実行することで、ラベル生成部31、制御部32_0〜32_N、セレクタ33_0〜33_N、バス34、分配部36および比較選択部35が情報処理装置10に仮想的に構成される場合で説明したが、これらの構成のうち、一部または全部がそれぞれ専用の回路で構成されてもよい。   Furthermore, in the present embodiment, a CPU (not shown) executes processing according to a program, whereby the label generation unit 31, the control units 32_0 to 32_N, the selectors 33_0 to 33_N, the bus 34, the distribution unit 36, and the comparison selection unit 35. However, some or all of these configurations may be configured by dedicated circuits.

図6に示したマージソータが図2に示したマージソータと同様な機能を有し、本実施形態においても、図3に示した動作フローと同様な処理が実行されるため、本実施形態における動作手順についての詳細な説明を省略する。   The merge sorter shown in FIG. 6 has the same function as the merge sorter shown in FIG. 2, and the same processing as the operation flow shown in FIG. 3 is also executed in this embodiment. The detailed description about is omitted.

本実施形態においても、第1の実施形態と同様な効果が得られる。また、本実施形態では、図6に示したように、第n段は、構成単位(2^n+1)個で構成され、この構成単位は、どの段であるかによらず同一である。そのため、予めこの構成単位を用意しておけば、需要に応じて即座に所定の第n段を構成することが可能となる。つまり、マージソータの各段においてソート対象のデータを記憶する部品の設計が、その部品が使われるソータの段によって変わるということがなく、どの段に対しても共通化できる。各段の構成部品の規格を共通化することで、必要に応じて所定の段を構成する際に、設計変更を速やかに実行することが可能となる。   Also in this embodiment, the same effect as the first embodiment can be obtained. Further, in the present embodiment, as shown in FIG. 6, the n-th stage is composed of (2 ^ n + 1) structural units, and the structural units are the same regardless of which stage. Therefore, if this structural unit is prepared in advance, a predetermined n-th stage can be configured immediately according to demand. In other words, the design of the part storing the data to be sorted in each stage of the merge sorter does not change depending on the stage of the sorter in which the part is used, and can be made common to any stage. By standardizing the standards of the component parts of each stage, it is possible to quickly execute a design change when configuring a predetermined stage as necessary.

10 情報処理装置
12 記憶部
13 ソート処理部
21 カウンタ
22、31 ラベル生成部
23、35 比較選択部
24、32_0〜32_N 制御部
33_0〜33_N セレクタ
36 分配部
DESCRIPTION OF SYMBOLS 10 Information processing apparatus 12 Storage part 13 Sort processing part 21 Counter 22, 31 Label generation part 23, 35 Comparison selection part 24, 32_0-32_N Control part 33_0-33_N Selector 36 Distribution part

Claims (5)

オンライン型アルゴリズムを利用してストリームデータをマージソートする情報処理装置であって、
前記ストリームデータとして入力され、所定のルールにしたがって予め別々にソートされた前半部分および後半部分からなるデータのうち、少なくとも該前半部分を記憶する記憶部と、
前記後半部分および前記前半部分のデータをマージソートして出力するソート処理部と、を有し、
前記ソート処理部は、前記記憶部において、前記前半部分を記憶する領域と前記後半部分を記憶する領域とで共用する、情報処理装置。
An information processing apparatus that merges and sorts stream data using an online algorithm,
A storage unit that stores at least the first half part of the data consisting of the first half part and the second half part, which is input as the stream data and sorted separately in advance according to a predetermined rule;
A sort processing unit that outputs a merge sort of the data of the latter half and the first half, and
The sort processing unit is an information processing apparatus in the storage unit that is shared by an area for storing the first half part and an area for storing the second half part.
請求項1に記載の情報処理装置において、
前記記憶部は、所定の順序で配置され、データ数が「前記前半部分のデータ数+1」のデータを格納するための複数のレジスタを有し、
前記ソート処理部は、
前記前半部分のデータを前記所定のルールに準じて前記複数のレジスタに順次シフトさせて格納し、前記後半部分のデータが1つ入力される度に、前記複数のレジスタのうち、順序が最初のレジスタに該データを格納し、該後半部分の先頭のデータと順序が最後のレジスタに格納されたデータとの大きさを比較し、前記所定のルールに基づいて1つのデータを選択して出力し、前記記憶部に残されたデータを前記順序が最後のレジスタの方にレジスタ間でシフトさせる、情報処理装置。
The information processing apparatus according to claim 1,
The storage unit is arranged in a predetermined order, and has a plurality of registers for storing data whose number of data is “the number of data in the first half + 1”.
The sort processing unit
The first half of the data is sequentially shifted and stored in the plurality of registers according to the predetermined rule, and each time the second half of the data is input, the first of the plurality of registers is in the first order. Store the data in a register, compare the size of the first data in the latter half with the data stored in the last register in the order, and select and output one data based on the predetermined rule An information processing apparatus that shifts data remaining in the storage unit from one register to another toward the last register in the order.
請求項2に記載の情報処理装置において、
前記ソート処理部は、
入力されるデータの数をカウントするカウンタと、
前記入力されるデータにラベルを付与し、前記カウンタによるカウント値が所定の値になると前記ラベルを更新するラベル生成部と、
入力される順序が隣り合う2つのデータの前記ラベルが所定の条件を満たす場合、前記複数のレジスタのデータのうち、前記後半部分の先頭のデータと前記順序が最後のレジスタに格納されたデータとの大きさを比較し、前記所定のルールに基づいて1つのデータを選択して出力し、前記2つのデータの前記ラベルが所定の条件を満たさない場合、前記順序が最後のレジスタに格納されたデータを出力する比較選択部と、
前記比較選択部の出力結果に基づいて、前記記憶部に残されたデータを前記順序が最後のレジスタの方にレジスタ間でシフトさせる制御部と、を有する情報処理装置。
The information processing apparatus according to claim 2,
The sort processing unit
A counter that counts the number of input data;
A label is attached to the input data, and a label generator that updates the label when the count value of the counter reaches a predetermined value;
When the labels of two pieces of data that are adjacent to each other in the input order satisfy a predetermined condition, among the data of the plurality of registers, the first data in the second half part and the data stored in the last register in the order If the labels of the two data do not satisfy a predetermined condition, the order is stored in the last register. A comparison selection unit for outputting data;
An information processing apparatus comprising: a control unit that shifts the data remaining in the storage unit based on an output result of the comparison / selection unit to shift the register toward the last register in the order.
請求項2に記載の情報処理装置において、
前記ソート処理部は、
入力されるデータの数をカウントするとともに該データにラベルを付与し、カウント値が所定の値に達すると前記ラベルを更新するラベル生成部と、
前記複数のレジスタに対応して設けられた、複数のセレクタおよび複数の制御部と、
前記複数のセレクタの出力の論理和を出力するバスと、
前記複数の制御部から受信する制御信号により、前記バスから受け取るデータと前記順序が最後のレジスタに格納されたデータとの大きさを比較するか否かを判定し、該比較の結果または前記制御信号に基づいて、出力するデータを決定する比較選択部と、
前記比較選択部の比較結果を前記複数の制御部に出力する分配部と、を有し、
前記複数の制御部のそれぞれは、対応するレジスタと隣り合うレジスタの2つのデータの前記ラベルが前記所定の条件を満たすか否かを示す前記制御信号を、対応するセレクタと前記比較選択部に出力し、該制御信号と前記比較結果とに基づいて、対応するレジスタに格納されたデータを順序が次のレジスタにシフトさせるか否かを判断し、
前記複数のセレクタのそれぞれは、対応する前記制御部から受信する前記制御信号にしたがって、対応するレジスタに格納されたデータまたは0を選択して前記バスに出力し、
前記比較選択部は、前記複数の制御部から受信する前記制御信号のうち、いずれか1つが前記所定の条件を満たすものである場合、前記バスから受け取るデータと前記順序が最後のレジスタに格納されたデータとの大きさを比較し、前記所定のルールに基づいて1つのデータを選択して出力し、前記制御信号が前記所定の条件を満たすものでない場合、前記順序が最後のレジスタに格納されたデータを出力する、情報処理装置。
The information processing apparatus according to claim 2,
The sort processing unit
A label generation unit that counts the number of input data and assigns a label to the data, and updates the label when the count value reaches a predetermined value;
A plurality of selectors and a plurality of control units provided corresponding to the plurality of registers;
A bus for outputting a logical sum of outputs of the plurality of selectors;
The control signal received from the plurality of control units determines whether to compare the size of the data received from the bus and the data stored in the last register in the order, and the result of the comparison or the control A comparison / selection unit for determining data to be output based on the signal;
A distribution unit that outputs a comparison result of the comparison selection unit to the plurality of control units,
Each of the plurality of control units outputs the control signal indicating whether or not the label of two data of a register adjacent to the corresponding register satisfies the predetermined condition to the corresponding selector and the comparison / selection unit And determining whether or not to shift the data stored in the corresponding register to the next register based on the control signal and the comparison result,
Each of the plurality of selectors selects data stored in a corresponding register or 0 according to the control signal received from the corresponding control unit, and outputs the selected data to the bus.
The comparison / selection unit stores the data received from the bus and the order in the last register when any one of the control signals received from the plurality of control units satisfies the predetermined condition. If the control signal does not satisfy the predetermined condition, the order is stored in the last register. An information processing device that outputs data.
オンライン型アルゴリズムを利用してストリームデータをマージソートする情報処理装置による情報処理方法であって、
所定のルールにしたがって予め別々にソートされた前半部分および後半部分からなるデータのうち、前記ストリームデータとして入力される前記前半部分のデータを前記情報処理装置の記憶部に格納し、
前記ストリームデータとして入力される前記後半部分のデータと前記記憶部に格納された前記前半部分のデータをマージソートして出力し、
前記マージソートを行う際、前記記憶部において、前記前半部分を記憶する領域と前記後半部分を記憶する領域とで共用する、情報処理方法。
An information processing method by an information processing device that performs merge sort on stream data using an online algorithm,
Of the data consisting of the first half part and the second half part separately sorted in advance according to a predetermined rule, the data of the first half part input as the stream data is stored in the storage unit of the information processing apparatus,
Merge sort and output the latter half of the data input as the stream data and the first half of the data stored in the storage unit,
An information processing method in which, when performing the merge sort, an area for storing the first half part and an area for storing the second half part are shared in the storage unit.
JP2013086466A 2013-04-17 2013-04-17 Information processing apparatus and information processing method Expired - Fee Related JP5960639B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013086466A JP5960639B2 (en) 2013-04-17 2013-04-17 Information processing apparatus and information processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013086466A JP5960639B2 (en) 2013-04-17 2013-04-17 Information processing apparatus and information processing method

Publications (2)

Publication Number Publication Date
JP2014211682A true JP2014211682A (en) 2014-11-13
JP5960639B2 JP5960639B2 (en) 2016-08-02

Family

ID=51931426

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013086466A Expired - Fee Related JP5960639B2 (en) 2013-04-17 2013-04-17 Information processing apparatus and information processing method

Country Status (1)

Country Link
JP (1) JP5960639B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0728624A (en) * 1993-07-13 1995-01-31 Mitsubishi Electric Corp Device and method for sorting

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0728624A (en) * 1993-07-13 1995-01-31 Mitsubishi Electric Corp Device and method for sorting

Also Published As

Publication number Publication date
JP5960639B2 (en) 2016-08-02

Similar Documents

Publication Publication Date Title
US10824585B2 (en) Comparison-based sort in a reconfigurable array processor having multiple processing elements for sorting array elements
US11068265B2 (en) Sequence alignment method of vector processor
JP2017138964A5 (en)
US8161274B2 (en) Command selection method and its apparatus
US11372929B2 (en) Sorting an array consisting of a large number of elements
US20180129766A1 (en) Clock Jitter Emulation
US10528558B2 (en) Processing a database query in a database system
US10101965B1 (en) Method and apparatus for high speed streaming sorter
US7734456B2 (en) Method and apparatus for priority based data processing
JP2013206095A (en) Data processor and control method for data processor
JP5960639B2 (en) Information processing apparatus and information processing method
KR102295677B1 (en) Parallel processing apparatus capable of consecutive parallelism
US8196082B1 (en) Signal routing and pin placement
JP4323663B2 (en) Image filter circuit and image filtering method
CN111865683B (en) Virtual gateway version gray level publishing method, device, equipment and storage medium
CN109766074B (en) Data sorting circuit and sorting method
Kohútka et al. Reliable real-time task scheduler based on Rocket Queue architecture
CN103020203B (en) Method and device for processing data
JP6473023B2 (en) Performance evaluation module and semiconductor integrated circuit incorporating the same
JP2015053001A (en) Layout method of semiconductor integrated circuit and layout program of semiconductor integrated circuit
TW201913365A (en) Reduced logic level operation folding of context history in a history register in a prediction system for a processor-based system
TWI730335B (en) Sorting device
US10515171B2 (en) Circuit description generation apparatus and circuit description generation method
US10496564B2 (en) Bus control circuit, information processing apparatus, and control method for bus control circuit
JP6005578B2 (en) Information processing apparatus and information processing method

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20141027

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20141031

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150701

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20151001

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20151005

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: 20160621

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160622

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160623

R150 Certificate of patent or registration of utility model

Ref document number: 5960639

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees