JPS63126030A - Sort processing system - Google Patents

Sort processing system

Info

Publication number
JPS63126030A
JPS63126030A JP27159886A JP27159886A JPS63126030A JP S63126030 A JPS63126030 A JP S63126030A JP 27159886 A JP27159886 A JP 27159886A JP 27159886 A JP27159886 A JP 27159886A JP S63126030 A JPS63126030 A JP S63126030A
Authority
JP
Japan
Prior art keywords
sort
sub
sorting
processing
input
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
JP27159886A
Other languages
Japanese (ja)
Inventor
Yukihiko Saitou
斉藤 至彦
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP27159886A priority Critical patent/JPS63126030A/en
Publication of JPS63126030A publication Critical patent/JPS63126030A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To effectively utilize the resource of a computer system and to shorten the execution time of sort processing by executing the sort processing by one main sort process and plural sub-sort processes. CONSTITUTION:A sub-sort process forming mans 11 in the main sort process 1 divides data in the leading block number of an input file 4 into block groups 41-43 equal to the number of primary intermediate files 61-63 and forms sub-sort processes 31-33 corresponding to the block groups 41-43. When a replacing information storing means 2 confirms the end of the sort processing of all the formed processes 31-33, a merging means 12 inputs data records from the field 61-63 storing the sorted results of the processes 31-33, executes merge processing and outputs the final sorted result for all the data records in an input file 4 to an output file 5.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はソート処理方式に関し、特に電子計算機システ
ムにおいて補助記憶装置を利用しデータのソート処理を
行う場合のソート処理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a sort processing method, and particularly to a sort processing method when data is sorted using an auxiliary storage device in a computer system.

〔従来の技術〕[Conventional technology]

従来、この種のソート処理方式では、1つのソート処理
を実行する場合に常に1つのプロセスによりソート処理
が実行されており、データの入力処理、キーの比較処理
、中間ファイルの入出力処理およびデータの出力処理等
の一連の処理を1つのソートプロセスが順次行っていた
Conventionally, in this type of sort processing method, when one sort process is executed, the sort process is always executed by one process, and the process includes data input processing, key comparison processing, intermediate file input/output processing, and data processing. A single sorting process sequentially performs a series of processes such as output processing.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述した従来のソート処理方式では、常に1つのプロセ
スでしかソート処理が実行できないので、電子計算機シ
ステムで利用が可能な主記憶装置や補助記憶装置の容量
や装置数が十分にあってもそれらを並行して利用するこ
とができず、大量の入力データのソート処理を行う場合
にソート処理の実行時間が長大になるという欠点がある
In the conventional sort processing method described above, only one process can execute the sort process at any time, so even if the computer system has sufficient capacity and number of main storage and auxiliary storage devices, it is difficult to use them. They cannot be used in parallel, and have the disadvantage that the sorting process takes a long time when sorting a large amount of input data.

本発明の目的は、上述の点に鑑み、1つの主と。In view of the above points, the present invention has one main objective.

なるソート処理のプロセスの他に複数の副次的なソート
処理のプロセスを生成しソート処理の対象の入力データ
を区分して複数の副次的なソート処理のプロセスにより
独立に並行してソート処理を行うことにより、主記憶装
置や補助記憶vt置等の電子計算機システムの資源を有
効に利用しソート処理の実行時間を短縮することができ
るソート処理方式を提供することにある。
In addition to the sorting process, multiple secondary sorting processes are generated, the input data to be sorted is divided, and the multiple secondary sorting processes are used to sort the data independently and in parallel. It is an object of the present invention to provide a sort processing method that can effectively utilize the resources of a computer system such as a main storage device and an auxiliary storage space and shorten the execution time of a sort process.

〔問題点を解決するための手段〕[Means for solving problems]

本発明のソート処理方式は、ソート処理の対象のデータ
レコードおよびソート処理の対象のブロック数である有
効ブロック数のデータを格納しているランダムアクセス
が可能な補助記憶装置上の入力ファイルと、ソート利用
者により起動され副ソートプロセス生成手段とマージ手
段とを有する主ソートプロセスと、前記入力ファイルに
格納されている有効ブロック数のデータを読み込みこの
有効ブロック数に基づき前記入力ファイル内のブロック
を複数の一次中間ファイルの数に等しい数のブロック群
に区分しこの区分に基づく人力ファイル区分情報を交換
情報記憶手段に設定して区分されたブロック群のそれぞ
れを対象にソート処理を行う副ソートプロセスを生成す
る前記副ソートプロセス生成手段と、前記交換情報記憶
手段に設定された前記入力ファイル区分情報に基づいて
前記入力ファイル内の1つのブロック群を入力し入力し
たブロック群を対象としたソート処理を行いソート処理
が終了するとソート結果のデータレコードを前記一次中
間ファイルに格納しソート処理の終了情報を前記交換情
報記憶手段に設定する前記副ソートプロセスと、前記主
ソートプロセスと前記副ソートプロセスとの間で交換を
行う情報を記憶する前記交換情報記憶手段と、前記副ソ
ートプロセスによりブロック群を対象としたソート処理
が行われたデータレコードを格納する前記一次中間ファ
イルと、前記副ソートプロセス生成手段で生成された全
ての前記副ソートプロセスのソート処理の終了を前記交
換情報記憶手段に設定された前記ソート処理の終了情報
により確認した後に前記副ソートプロセスによるソート
結果が格納されている全ての前記一次中間ファイルから
データレコードを入力してマージ処理を行い前記入力フ
ァイル内の全でのデータレコードを対象とした最終的な
ソート結果を出力する前記マージ手段とを有する。
The sort processing method of the present invention requires an input file on an auxiliary storage device that can be randomly accessed, which stores data records to be sorted and an effective number of blocks, which is the number of blocks to be sorted; A main sorting process that is started by a user and has a sub-sorting process generation means and a merging means, reads data on the number of effective blocks stored in the input file, and divides the blocks in the input file into multiple blocks based on this number of effective blocks. A sub-sorting process that divides into block groups of a number equal to the number of primary intermediate files, sets manual file classification information based on this division in an exchange information storage means, and performs a sorting process on each of the divided block groups. a sorting process targeting the input block group by inputting one block group in the input file based on the sub-sorting process generating means and the input file classification information set in the exchange information storage means; the sub-sorting process, which stores the data record of the sorting result in the primary intermediate file when the sorting process is completed, and sets the completion information of the sorting process in the exchange information storage means; the main sorting process and the sub-sorting process; said exchange information storage means for storing information exchanged between said primary intermediate file storing data records subjected to sorting processing for a group of blocks by said sub-sorting process, and said sub-sorting process generation; After confirming the completion of the sort processing of all the sub-sorting processes generated by the means using the end information of the sorting processing set in the exchange information storage means, all the sorting results of the sub-sorting process are stored. and the merging means for inputting data records from the primary intermediate file, performing a merging process, and outputting a final sorting result for all data records in the input file.

〔作用〕[Effect]

本発明のソート処理方式では、入力ファイルがランダム
アクセスが可能な補助記憶装置上でソート処理の対象の
データレコードおよびソート処理の対象のブロック数で
ある有効ブロック数のデータを格納し、主ソートプロセ
スがソート利用者により起動され副ソートプロセス生成
手段とマージ手段とを有し、副ソートプロセス生成手段
が入力ファイルに格納されている有効ブロック数のデー
タを読み込みこのを効ブロンク数に基づき入力ファイル
内のブロックを複数の一次中間ファイルの数に等しい数
のブロック群に区分しこの区分に基づく入力ファイル区
分情報を交換情報記憶手段に設定して区分されたブロッ
ク群のそれぞれを対象にソート処理を行う副ソートプロ
セスを生成し、副ソートプロセスが交換情報記憶手段に
設定された入力ファイル区分情報に基づいて入力ファイ
ル内の1つのブロック群を入力し入力したブロック群を
対象としたソート処理を行いソート処理が終了するとソ
ート結果のデータレコードを一次中間ファイルに格納し
ソート処理の終了情報を交換情報記憶手段に設定し、交
換情報記憶手段が主ソートプロセスと副ソートプロセス
との間で交換を行う情報を記憶し、一次中間ファイルが
副ソートプロセスによりブロック群を対象としたソート
処理が行われたデータレコードを格納し、マージ手段が
副ソートプロセス生成手段で生成された全ての副ソート
プロセスのソート処理の終了を交換情報記憶手段に設定
されたソート処理の終了情報により確認した後に副ソー
トプロセスによるソート結果が格納されている全ての一
次中間ファイルからデータレコードを入力してマージ処
理を行い入力ファイル内の全てのデータレコードを対象
とした最終的なソート結果を出力する。
In the sort processing method of the present invention, the input file stores data records to be sorted and the effective number of blocks, which is the number of blocks to be sorted, on an auxiliary storage device that can be randomly accessed, and the main sort process is activated by a sort user and has a sub-sort process generation means and a merging means, and the sub-sort process generation means reads the data of the effective number of blocks stored in the input file and processes the data in the input file based on the number of effective blocks. divides the blocks into block groups of a number equal to the number of the plurality of primary intermediate files, sets input file classification information based on this division in the exchange information storage means, and performs a sorting process on each of the divided block groups. A sub-sort process is generated, and the sub-sort process inputs one block group in the input file based on the input file classification information set in the exchange information storage means, performs sorting processing on the input block group, and performs sorting. When the processing is completed, the data record of the sorting result is stored in the primary intermediate file, the completion information of the sorting processing is set in the exchange information storage means, and the exchange information storage means exchanges information between the main sorting process and the sub-sorting process. , the primary intermediate file stores data records that have been subjected to sorting processing for block groups by the sub-sorting process, and the merging means stores the sorting processing of all the sub-sorting processes generated by the sub-sorting process generation means. After confirming the completion of the sorting process using the sorting completion information set in the exchange information storage means, data records are input from all primary intermediate files in which the sorting results of the sub-sorting process are stored, and the merge process is performed and the data is stored in the input file. Outputs the final sorting results for all data records.

〔実施例〕〔Example〕

次に、本発明について図面を参照して詳細に説明する。 Next, the present invention will be explained in detail with reference to the drawings.

第1図は、本発明のソート処理方式の一実施例の構成を
示すブロック図である0本実施例のソート処理方式は、
ソート利用者により起動され入力ファイル4内のデータ
レコードのソート処理を実行する主ソートプロセス1と
、主ソートプロセス1と副ソートプロセス31.32お
よび33との間で交換を行う情報を記憶する交換情報記
憶手段2と、ソート処理の対象のデータレコードを格納
しているランダムアクセスが可能な補助記憶装置(図示
せず)上の入力ファイル4と、最終的なソート結果が出
力される出力ファイル5と、交換情報記憶手段2から入
力ファイル区分ソート処理情報21゜22および23(
第3図参照)を取り出して入力ファイル4内のブロック
群41.42および43を入力し二次中間ファイル71
.72および73を利用してソート処理を行いその処理
が終了するとソート結果のデータレコードを一次中間フ
ァイル61.62および63に格納しソート処理の終了
情報を交換情報記憶手段2に設定する副ソートプロセス
31.32および33と、副ソートプロセス31.32
および33によりブロック群41.42および43を対
象としたソート処理が行われたデータレコードを格納す
る一次中間ファイル61.62および63と、副ソート
プロセス31.32および33のソート処理の過程で一
時的なデータレコードの格納のために使用される二次中
間ファイル71.72および73とから構成されている
FIG. 1 is a block diagram showing the configuration of an embodiment of the sorting method of the present invention.
A main sort process 1 activated by a sort user to perform a sort process on data records in an input file 4, and an exchange for storing information exchanged between the main sort process 1 and sub-sort processes 31, 32 and 33. Information storage means 2, an input file 4 on a randomly accessible auxiliary storage device (not shown) that stores data records to be sorted, and an output file 5 to which the final sorting results are output. and input file classification sort processing information 21, 22 and 23 (
(see Figure 3) and input the block groups 41, 42 and 43 in the input file 4 into the secondary intermediate file 71.
.. A sub-sorting process that performs sorting processing using 72 and 73, and when the processing is completed, stores the data records of the sorting results in primary intermediate files 61, 62 and 63, and sets the end information of the sorting processing in the exchange information storage means 2. 31.32 and 33 and sub-sort process 31.32
and primary intermediate files 61, 62 and 63 that store data records subjected to sorting processing for block groups 41, 42 and 43 by 33, and temporary files 61. It consists of secondary intermediate files 71, 72 and 73 used for storing data records.

主ソートプロセス1は、入力ファイル4の先頭に格納さ
れている有効ブロック数40のデータを読み込み入力フ
ァイル4内のブロックを一次中間ファイル61.62お
よび63の数に等しい数のブロック群41.42および
43に区分しこの区分に基づく入力ファイル区分ソート
処理情報21.22および23を交換情報記憶手段2に
設定してブロック群41.42および43に対応した副
ソートプロセス31.32および33を生成する副ソー
トプロセス生成手段11と、副ソートプロセス生成手段
11で生成された全ての副ソートプロセス31.32お
よび33のソート処理の終了を交換情報記憶手段2によ
り確認した後に副ソートプロセス31.32および33
のソート結果が格納されている一次中間ファイル61.
62および63からデータレコードを入力してマージ処
理を行い入力ファイル4内の全てのデータレコードを対
象とした最終的なソート結果を出力ファイル5に出力す
るマージ手段12とを含んで構成されている。
The main sorting process 1 reads the data of 40 effective blocks stored at the beginning of the input file 4 and divides the blocks in the input file 4 into block groups 41, 42 whose number is equal to the number of primary intermediate files 61, 62 and 63. and 43, and input file classification sort processing information 21, 22 and 23 based on this classification are set in the exchange information storage means 2 to generate sub-sort processes 31, 32 and 33 corresponding to block groups 41, 42 and 43. After confirming by the exchange information storage means 2 that the sorting process of all the sub-sort processes 31.32 and 33 generated by the sub-sort process generation means 11 and 33 generated by the sub-sort process generation means 11 has been confirmed by the exchange information storage means 2, the sub-sort process 31.32 and 33
A primary intermediate file 61. in which the sort results of are stored.
The merging means 12 inputs data records from 62 and 63, performs merging processing, and outputs a final sorting result for all data records in the input file 4 to the output file 5. .

入力ファイル4は、有効ブロック数40と、ブロック群
41.42および43とを含んで構成されている。
The input file 4 includes the number of effective blocks 40 and block groups 41, 42, and 43.

第2図を参照すると、有効ブロック数40は、入力ファ
イル4の先頭に位置して入力ファイル4に含まれるソー
ト処理の対象のブロック数N(正整数)を格納している
Referring to FIG. 2, the number of effective blocks 40 is located at the beginning of the input file 4 and stores the number N (positive integer) of blocks included in the input file 4 that are the targets of the sorting process.

ブロック群41.42および43は、一次中間ファイル
61.62および63の数と同数に区分され、副ソート
プロセス31.32および33がソート処理の対象とし
て入力するブロック数を含んでいる。すなわち、有効ブ
ロック数40が示すNを一次中間ファイル61゜62お
よび63の数の3で除算した商のM(正整数)が副ソー
トプロセス31および32が入力するブロック数として
ブロック群41および42に含まれ、ブロック群41お
よび42に含まれなかった残りのブロック数(N−2X
M)が副ソートプロセス33が入力するブロック数とし
てブロック群43に含まれる。
The block groups 41, 42, and 43 are divided into the same number as the primary intermediate files 61, 62, and 63, and contain the number of blocks that the sub-sorting processes 31, 32, and 33 input as targets for sorting. That is, the quotient M (positive integer) obtained by dividing N indicated by the effective block number 40 by 3, which is the number of primary intermediate files 61, 62, and 63, is used as the number of blocks input by the sub-sorting processes 31 and 32. The remaining number of blocks included in block groups 41 and 42 (N-2X
M) is included in the block group 43 as the number of blocks input by the sub-sorting process 33.

第3図を参照すると、交換情報記憶手段2に設定される
情報は、入力ファイル4内の1ブロツクの大きさを示す
ブロックの大きさ20と、副ソートプロセス31.32
および33が行うソート処理の対象のブロック群41.
42および43に対応してそれぞれ設定される入力ファ
イル区分ソート処理情報21゜22および23とからな
る。
Referring to FIG. 3, the information set in the exchange information storage means 2 includes the block size 20 indicating the size of one block in the input file 4, and the sub-sorting process 31, 32.
Block group 41. and 33 are the targets of the sorting process.
The input file classification sort processing information 21, 22, and 23 are set corresponding to 42 and 43, respectively.

入力ファイル区分ソート処理情報21.22および23
は、副ソートプロセス3L 32および33がソート処
理を行うために入力ファイル4から入力するブロックの
先頭のブロック番号を示す入力開始ブロック番号211
221および231 と、副ソートプロセス31.32
および33がソート処理を行うために入力ファイル4か
ら人力するブロック数を示す入力ブロック数212,2
22および232と(以上の入力開始ブロック番号21
1,221および231 と入力ブロック数212.2
22および232とを併せて入力ファイル区分情報とい
うことができる)、副ソートプロセス生成手段11によ
る副ソートプロセス31.32および33の生成時に全
てオフ状態に設定され副ソートプロセス31.32およ
び33のソート処理の終了時にオン状態に設定される副
ソートプロセス処理終了フラグ213,223および2
33とからなっている。後述するように、入力開始ブロ
ック番号211には「1」、入力ブロック数212には
「M」、入力開始ブロック番号221にはrM+IJ、
入力プロツク数222には「M」、入力開始ブロック番
号231にはr2XM+IJ、入力ブロック数232に
はrN−2×M」という情報がそれぞれ格納されている
Input file classification sort processing information 21, 22 and 23
is the input start block number 211 indicating the first block number of the block input from the input file 4 for the sub-sorting processes 3L 32 and 33 to perform the sorting process.
221 and 231 and sub-sort process 31.32
and 33 indicate the number of blocks manually input from the input file 4 to perform sorting processing 212, 2
22 and 232 (input start block number 21
1,221 and 231 and number of input blocks 212.2
22 and 232 can be collectively referred to as input file classification information). Sub-sort process processing end flags 213, 223, and 2 are set to on state when sorting processing ends.
It consists of 33. As will be described later, the input start block number 211 is "1", the input block number 212 is "M", the input start block number 221 is rM+IJ,
The input block number 222 stores the information "M," the input start block number 231 stores the information "r2XM+IJ," and the input block number 232 stores the information "rN-2×M."

−gに、ランダムアクセスが可能な補助記憶装置上の1
つのファイル内ではブロックの大きさは全て同しである
ことから、入力すべきブロック番号が決定されると、 (ブロック番号−1)×ブロックの大きさという計算式
によりそのブロックの占めるファイル内での位置を節単
に計算することができ、所望のブロックの入力を行うこ
とができる。
-g is one on the auxiliary storage device that can be accessed randomly.
Since all blocks are the same size within one file, once the block number to be input is determined, the calculation formula (block number - 1) x block size is used to calculate the block size within the file that block occupies. The position of the block can be simply calculated and the input of the desired block can be made.

以上のことから、副ソートプロセス31.32および3
3においても、入力開始ブロック番号211,221お
よび231から入力ファイル4内での入力すべきブロッ
クの位置が簡単に計算できて所望のブロック群41.4
2および430入力を行うことができる。
From the above, sub-sort processes 31, 32 and 3
3, the position of the block to be input in the input file 4 can be easily calculated from the input start block numbers 211, 221, and 231, and the desired block group 41.4 can be easily calculated.
2 and 430 inputs can be made.

第4図を参照すると、副ソートプロセス生成手段11の
処理は、有効ブロック数読込みおよびブロックの大きさ
格納ステップ101 と、副ソートプロセス数決定ステ
ップ102と、副ソートプロセス人カブロック数計算ス
テップ103と、カウンタ初期値設定ステップ104と
、副ソートプロセスカウンタ判定ステップ105と、交
換情報記憶手段白情報設定ステップ106と、副ソート
プロセス生成起動ステンブ107と、カウンタ増加ステ
ップ108と、交換情報記憶手段内最終副ソートプロセ
ス対応情報設定ステップ109と、最終側ソートプロセ
ス生成起動ステップ110とからなる。
Referring to FIG. 4, the processing of the sub-sort process generation means 11 includes a step 101 of reading the number of effective blocks and storing the block size, a step 102 of determining the number of sub-sort processes, and a step 103 of calculating the number of sub-sort process blocks. , counter initial value setting step 104 , sub-sort process counter determination step 105 , exchange information storage means white information setting step 106 , sub-sort process generation startup step 107 , counter increase step 108 , and exchange information storage means white information setting step 106 It consists of a final sub-sorting process correspondence information setting step 109 and a final-side sorting process generation activation step 110.

次に、このように構成された本実施例のソート処理方式
の動作について説明する。
Next, the operation of the sort processing method of this embodiment configured as described above will be explained.

入力ファイル4内のデータレコードのソート処理を行う
場合には、まずソート利用者により主ソートプロセス1
が起動され、主ソートプロセス1内の副ソートプロセス
生成手段11が実行される。
When sorting the data records in the input file 4, the sorting user first sorts the data records in the main sorting process 1.
is activated, and the sub-sorting process generating means 11 in the main sorting process 1 is executed.

副ソートプロセス生成手段11では、入力ファイル4内
の有効ブロック数40からNが読み込まれるとともに、
ソート利用者からの指示や入力ファイル4からの読込み
等により取得された入力ファイル4内の1ブロツクの大
きさが交換情報記憶手段2のブロックの大きさ20に格
納される(ステップ101)。
The sub-sort process generation means 11 reads N from the number of effective blocks 40 in the input file 4, and
The size of one block in the input file 4 obtained by an instruction from the sort user or by reading from the input file 4 is stored in the block size 20 of the exchange information storage means 2 (step 101).

次に、ソート利用者によって指定された一次中間ファイ
ル61.62および63の数(この場合には3)が調べ
られ、その数が生成すべき副ソートプロセス31.32
および330数(この数は入力ファイル4内のブロック
群41.42および43の数でもある)とされる(ステ
ップ1o2)。
Next, the number of primary intermediate files 61, 62 and 63 specified by the sort user (3 in this case) is checked, and the number is determined by the sub-sort process 31, 32 to be generated.
and 330 (this number is also the number of block groups 41, 42 and 43 in input file 4) (step 1o2).

さらに、入力ファイル4内の有効ブロック数40のNが
一次中間ファイル61.62および63の数の3で除算
されて副ソートプロセス31および32が入力するブロ
ック数Mが算出される(ステップ103)。
Furthermore, N, which is the number of effective blocks in the input file 4, 40, is divided by 3, which is the number of primary intermediate files 61, 62, and 63, to calculate the number of blocks, M, which is input to the sub-sorting processes 31 and 32 (step 103). .

ここで、副ソートプロセス31.32および33の数を
数える副ソートプロセスカウンタとしての正整数Jに初
期値として1が設定され、入力開始ブロック番号211
,221および231を示す入力開始ブロック番号カウ
ンタとしての正整数Kに初期値として1が設定される(
ステップ104)。
Here, 1 is set as an initial value to a positive integer J as a sub-sort process counter that counts the number of sub-sort processes 31, 32 and 33, and input start block number 211
, 221 and 231, a positive integer K serving as an input start block number counter is set to 1 as an initial value (
Step 104).

次に、副ソートプロセスカウンタJが一次中間ファイル
61..62および63の数の3以上であるか否かが判
定される(ステップ105)。
Next, the secondary sorting process counter J counts the primary intermediate file 61. .. It is determined whether the number is 3 or more of the numbers 62 and 63 (step 105).

この判定でJが3より小さい場合には、交換情報記憶手
段2の中の5番目の副ソートプロセス(副ソートプロセ
ス31または副ソートプロセス32)に対応する領域の
入力開始ブロック番号211または221への入力開始
ブロック番号カウンタにの値の格納および入力ブロック
数212または222へのステップ103で算出された
ブロック数Mの格納が行われ、副ソートプロセス処理終
了フラグ213または223が副ソートプロセス31お
よび32の未終了を示すためにオフ状態に設定される(
ステップ106)。
If J is smaller than 3 in this judgment, the input start block number 211 or 221 of the area corresponding to the fifth sub-sorting process (sub-sorting process 31 or sub-sorting process 32) in the exchange information storage means 2 is selected. The value is stored in the input start block number counter and the block number M calculated in step 103 is stored in the input block number 212 or 222, and the sub-sort process processing end flag 213 or 223 is set to the sub-sort process 31 or 222. 32 is set to the off state to indicate unfinished (
Step 106).

さらに、オペレーティングシステム(図示せず)に存在
するジョブ自動生成機能が使用され、5番目の副ソート
プロセス31または32が生成されて起動される(ステ
ップ107)。
Furthermore, the automatic job generation function present in the operating system (not shown) is used to generate and start the fifth sub-sort process 31 or 32 (step 107).

次に、副ソートプロセスカウンタJに1が加算され、入
力開始ブロック番号カウンタKにMが加算されて(ステ
ップ108)、ステップ105の処理に制御が戻り、副
ソートプロセスカウンタJが一次中間ファイル61.6
2および63の数(この場合には3)に等しくなるまで
上述のステップ106〜ステツプ108の処理が繰り返
される。
Next, 1 is added to the secondary sorting process counter J, M is added to the input start block number counter K (step 108), control returns to the process of step 105, and the secondary sorting process counter J is added to the primary intermediate file 61. .6
The processes of steps 106 to 108 described above are repeated until the number is equal to 2 and 63 (in this case, 3).

ステップ105の判定でJが3に等しくなった場合には
、交換情報記19手段2の中の5番目の副ソートプロセ
ス(すなわち、最終の副ソートプロセス33)に対応す
る領域の入力開始ブロック番号231に入力開始ブロッ
ク番号カウンタにの値の((J−1)XM+1) 、す
なわち(2XM+1)が格納され、入力ブロック数23
2に(N−(J−1)XM) 、すなわち(N−2xM
)が格納され、副ソートプロセス処理終了フラグ233
がオフ状態に設定され(ステップ109)、5番目(最
終)の副ソートプロセス33がジョブ自動生成機能が使
用され生成されて起動される(ステップ110)。
If J is equal to 3 as determined in step 105, the input start block number of the area corresponding to the fifth sub-sorting process (i.e., the final sub-sorting process 33) in the exchange information record 19 means 2. 231 stores the value of the input start block number counter ((J-1)XM+1), that is, (2XM+1), and the number of input blocks is 23.
2 to (N-(J-1)XM), i.e. (N-2xM
) is stored, and the sub-sort process processing end flag 233
is set to an off state (step 109), and the fifth (final) sub-sorting process 33 is generated using the job automatic generation function and activated (step 110).

このようにして生成されて起動された副ソートプロセス
31.32および33では、交換情報記憶手段2の入力
ファイル区分ソート処理情報21.22および23が参
照され、入力ファイル4内のブロック群41、42およ
び43からデータレコードが入力されてソート処理が行
われる(副ソートプロセス31.32および33による
ソート処理は並行して実行される)。このソート処理に
おいて中間ファイルが必要な場合には、二次中間ファイ
ル71.72および73が使用される。
The sub-sorting processes 31, 32 and 33 generated and started in this way refer to the input file classification sorting processing information 21, 22 and 23 of the exchange information storage means 2, and the block group 41 in the input file 4, Data records are input from 42 and 43 and sorted (the sorting by the sub-sorting processes 31, 32 and 33 is executed in parallel). If intermediate files are required in this sorting process, secondary intermediate files 71, 72 and 73 are used.

副ソートプロセス31.32および33のソート処理が
終了すると、ソート結果のデータレコードが一次中間フ
ァイル61.62および63に格納され、副ソートプロ
セス31.32および33のソート処理の終了情報の交
換情報記憶手段2への設定(副ソートプロセス処理終了
フラグ213,223および233をオン状態に設定す
ること)が行われる。
When the sorting processes of the secondary sorting processes 31.32 and 33 are completed, the data records of the sorting results are stored in the primary intermediate files 61.62 and 63, and the exchange information of the completion of the sorting process of the secondary sorting processes 31.32 and 33 is stored. Setting in the storage means 2 (setting the sub-sort process processing end flags 213, 223, and 233 to the on state) is performed.

主ソートプロセス1内のマージ手段12では、交換情報
記憶手段2の参照により全ての副ソートプロセス31.
32および33のソート処理の終了(副ソートプロセス
処理終了フラグ213.223および233のオン状態
)がGi tUされた後に、一次中間ファイル61.6
2および63からブロック群41.42および43を対
象としたソート処理済みのデータレコードが入力されて
マージ処理が行われ、そのマージ処理による入力ファイ
ル4内の全てのデータレコードを対象とした最終的なソ
ート処理の結果が出力ファイル5に出力される。
The merging means 12 in the main sorting process 1 merges all the sub-sorting processes 31 .
After the sort processing of 32 and 33 is completed (the sub-sort process processing end flags 213, 223 and 233 are on), the primary intermediate file 61.6 is GitUed.
2 and 63, the sorted data records targeting block groups 41, 42 and 43 are input and merge processing is performed, and the final data records targeting all data records in input file 4 are input through the merge processing. The results of the sorting process are output to the output file 5.

なお、本実施例では入力ファイル4内のブロック群41
.42および43の数(副ソートプロセス31゜32お
よび33の数)が3である、場合について述べたが、こ
の数はソート利用者による−次中間ファイル61.62
および63の数の指定により自在に設定できることはい
うまでもない。
Note that in this embodiment, the block group 41 in the input file 4
.. 42 and 43 (the number of sub-sort processes 31 and 32 and 33) is 3, but this number is determined by the sort user's -next intermediate file 61.62
It goes without saying that the number can be freely set by specifying the numbers of and 63.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、ソート処理を1つの主ソ
ートプロセスと複数の副ソートプロセスによって実行す
るようにし、ソート処理の対象の入力データを複数のブ
ロック群に区分して各ブロック群を対象としたソート処
理を複数の副ソートプロセスにより独立に並行して行う
ことにより、電子計算機システムの資源を有効に利用し
てソート処理(特に大量の入力データのソート処理)の
実行時間を短縮することができるという効果がある。
As explained above, the present invention executes the sorting process by one main sorting process and a plurality of sub-sorting processes, divides the input data to be sorted into a plurality of block groups, and targets each block group. To effectively utilize the resources of a computer system and shorten the execution time of sorting processing (especially sorting processing of a large amount of input data) by performing sorting processing independently and in parallel using multiple sub-sorting processes. It has the effect of being able to

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例の構成を示すブロフク図、 第2図は第1図中の入力ファイル内のデータの構成を示
す図、 第3図は第1図中の交換情報記憶手段に設定される情報
の構成を示す図、 第4図は第1図中の副ソートプロセス生成手段の処理を
示す流れ図である。 図において、 1・・・主ソートプロセス、 2・・・交換情報記憶手段、 4・・・入力ファイル、 5・・・出力ファイル、 11・・・副ソートプロセス生成手段、12・・・マー
ジ手段、 20・・・ブロックの大きさ、 21〜23・入力ファイル区分ソート処理情報、31〜
33・副ソートプロセス、 40・・・有効ブロック数、 41〜43・ブロック群、 61〜63・一次中間ファイル、 71〜73・二次中間ファイル、 211.221,231  ・・・入力開始ブロック番
号、212.222,232  ・・・入力プロツク数
、213.223.233  ・・・副ソートプロセス
処理終了フラグである。
FIG. 1 is a blog diagram showing the configuration of an embodiment of the present invention, FIG. 2 is a diagram showing the structure of data in the input file in FIG. 1, and FIG. 3 is an exchange information storage means in FIG. 1. FIG. 4 is a flowchart showing the processing of the sub-sorting process generating means in FIG. 1. In the figure, 1... Main sorting process, 2... Exchange information storage means, 4... Input file, 5... Output file, 11... Sub sorting process generation means, 12... Merging means. , 20...Block size, 21-23-Input file classification sorting processing information, 31-
33. Sub-sort process, 40... Number of effective blocks, 41-43. Block group, 61-63. Primary intermediate file, 71-73. Secondary intermediate file, 211.221,231... Input start block number. , 212.222, 232: Number of input processes, 213.223.233: Sub-sort process end flag.

Claims (1)

【特許請求の範囲】 ソート処理の対象のデータレコードおよびソート処理の
対象のブロック数である有効ブロック数のデータを格納
しているランダムアクセスが可能な補助記憶装置上の入
力ファイルと、 ソート利用者により起動され副ソートプロセス生成手段
とマージ手段とを有する主ソートプロセスと、 前記入力ファイルに格納されている有効ブロック数のデ
ータを読み込みこの有効ブロック数に基づき前記入力フ
ァイル内のブロックを複数の一次中間ファイルの数に等
しい数のブロック群に区分しこの区分に基づく入力ファ
イル区分情報を交換情報記憶手段に設定して区分された
ブロック群のそれぞれを対象にソート処理を行う副ソー
トプロセスを生成する前記副ソートプロセス生成手段と
前記交換情報記憶手段に設定された前記入力ファイル区
分情報に基づいて前記入力ファイル内の1つのブロック
群を入力し入力したブロック群を対象としたソート処理
を行いソート処理が終了するとソート結果のデータレコ
ードを前記一次中間ファイルに格納しソート処理の終了
情報を前記交換情報記憶手段に設定する前記副ソートプ
ロセスと、 前記主ソートプロセスと前記副ソートプロセスとの間で
交換を行う情報を記憶する前記交換情報記憶手段と、 前記副ソートプロセスによりブロック群を対象としたソ
ート処理が行われたデータレコードを格納する前記一次
中間ファイルと、 前記副ソートプロセス生成手段で生成された全ての前記
副ソートプロセスのソート処理の終了を前記交換情報記
憶手段に設定された前記ソート処理の終了情報により確
認した後に前記副ソートプロセスによるソート結果が格
納されている全ての前記一次中間ファイルからデータレ
コードを入力してマージ処理を行い前記入力ファイル内
の全てのデータレコードを対象とした最終的なソート結
果を出力する前記マージ手段と、 を有することを特徴とするソート処理方式。
[Scope of Claims] An input file on an auxiliary storage device that can be randomly accessed and stores data records to be subjected to sort processing and data for an effective number of blocks that is the number of blocks to be sorted; and a sort user. a main sorting process that is started by and has a sub-sorting process generation means and a merging means; reads data on the number of effective blocks stored in the input file and converts the blocks in the input file into a plurality of primary sort processes based on the number of effective blocks; Generates a sub-sorting process that divides into block groups of a number equal to the number of intermediate files, sets input file classification information based on this division in the exchange information storage means, and performs a sorting process on each of the divided block groups. One block group in the input file is input based on the input file classification information set in the sub-sort process generation means and the exchange information storage means, and a sorting process is performed on the input block group. between the main sorting process and the sub-sorting process, the sub-sorting process storing the data record of the sorting result in the primary intermediate file when the processing is completed, and setting the completion information of the sorting process in the exchange information storage means; said exchange information storage means for storing information to be exchanged; said primary intermediate file for storing data records subjected to sorting processing for block groups by said sub-sorting process; and generated by said sub-sorting process generation means. After confirming the completion of the sort processing of all the sub-sort processes that have been performed based on the end information of the sort processing set in the exchange information storage means, all the primary intermediates in which the sort results of the sub-sort processes are stored are A sorting processing method comprising: the merging means for inputting data records from a file, performing merging processing, and outputting a final sorting result for all data records in the input file.
JP27159886A 1986-11-14 1986-11-14 Sort processing system Pending JPS63126030A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27159886A JPS63126030A (en) 1986-11-14 1986-11-14 Sort processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27159886A JPS63126030A (en) 1986-11-14 1986-11-14 Sort processing system

Publications (1)

Publication Number Publication Date
JPS63126030A true JPS63126030A (en) 1988-05-30

Family

ID=17502308

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27159886A Pending JPS63126030A (en) 1986-11-14 1986-11-14 Sort processing system

Country Status (1)

Country Link
JP (1) JPS63126030A (en)

Similar Documents

Publication Publication Date Title
Lauff et al. Scheduling with common due date, earliness and tardiness penalties for multimachine problems: A survey
US8996464B2 (en) Efficient partitioning techniques for massively distributed computation
JPH04241072A (en) Wiring path search device
JPH02178730A (en) Internal sorting system using dividing method
CN109934507A (en) A kind of method and device of operation flow scheduling
CN112001797A (en) Method and device for grouping transactions in blockchain
CN108415912A (en) Data processing method based on MapReduce model and equipment
JPH04237341A (en) Interface inspection processing system
CN110706108B (en) Method and apparatus for concurrently executing transactions in a blockchain
CN112765014A (en) Automatic test system for multi-user simultaneous operation and working method
JPS63126030A (en) Sort processing system
CN108121745B (en) Data loading method and device
JPH0782429B2 (en) How to merge multiple files
CN110377601B (en) B-tree data structure-based MapReduce calculation process optimization method
JPS63142431A (en) Pipeline control system
CN106777262B (en) High-throughput sequencing data quality filtering method and filtering device
CN110399354A (en) The subregion of database exchanges method and device
US20240134932A1 (en) Distributed matrix computation control method and apparatus supporting matrix fused operation
JPH04127321A (en) Sorting system by count classifying method utilizing relative key
JPS6266326A (en) Array processing system for japanese data
JPH02273828A (en) Internal sorting system
JP2921045B2 (en) Index generation method
Alpay A memetic algorithm for parallel machine scheduling
JPH05241890A (en) Data trace system
CN116595944A (en) Parallel routing DRC repairing method and related device