JP2760721B2 - Computer system - Google Patents

Computer system

Info

Publication number
JP2760721B2
JP2760721B2 JP32744992A JP32744992A JP2760721B2 JP 2760721 B2 JP2760721 B2 JP 2760721B2 JP 32744992 A JP32744992 A JP 32744992A JP 32744992 A JP32744992 A JP 32744992A JP 2760721 B2 JP2760721 B2 JP 2760721B2
Authority
JP
Japan
Prior art keywords
execution
task
time slot
cycle
scheduling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP32744992A
Other languages
Japanese (ja)
Other versions
JPH06149599A (en
Inventor
正博 中村
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 JP32744992A priority Critical patent/JP2760721B2/en
Publication of JPH06149599A publication Critical patent/JPH06149599A/en
Application granted granted Critical
Publication of JP2760721B2 publication Critical patent/JP2760721B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、複数タスクが実行さ
れる計算機システムに係わり、特に固有の実行周期と実
行時間を保有する複数のタスクを管理してスケジューリ
ングする機能を有する計算機システムに関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer system in which a plurality of tasks are executed, and more particularly to a computer system having a function of managing and scheduling a plurality of tasks having a specific execution cycle and execution time. is there.

【0002】[0002]

【従来の技術】図15は、例えば「三菱電機統合制御シ
ステムMELTAS JP−EI S/W構築マニュア
ル」(1991年5月第1版発行)で提供されている計
算機システムのスケジューリングに関する部分の構成図
である。
2. Description of the Related Art FIG. 15 is a block diagram of a part related to scheduling of a computer system provided in, for example, "MELTAS JP-EIS / W Construction Manual for Mitsubishi Electric Integrated Control System" (published the first edition in May 1991). It is.

【0003】まず、周期的スケジューリングの概念につ
いて、図16を用いて説明する。図中の最小基準周期と
は、周期的にタスクの起動をチェックする際の基準周期
となるもので、周期的に実行されるアプリケーションタ
スク1〜L(Lはタスク数)をスケジューリングする最
小周期である。タイムスロットとは、上記最小基準周期
を所定値N(ユーザがシステムに合わせて決定する)で
割った時間単位で、タイムスロット時間毎に、スケジュ
ーラが実行タスク1〜Lの選択を行う。実行レベルと
は、実行タスク1〜Lを周期毎に分類した複数のタスク
の集合で、タイムスロット1〜Nにその実行レベル1〜
Mが割当てられる(割当て方法は後述する)。スケジュ
ーラはスケジューリング実行時に、あるタイムスロット
でそのタイムスロットに割当てられた該実行レベルの起
動待ちタスクを優先的に実行する(実行レベルの選択方
法は後述する)。
First, the concept of periodic scheduling will be described with reference to FIG. The minimum reference cycle in the figure is a reference cycle for periodically checking task activation, and is a minimum cycle for scheduling application tasks 1 to L (L is the number of tasks) to be executed periodically. is there. The time slot is a time unit obtained by dividing the minimum reference cycle by a predetermined value N (determined by the user according to the system), and the scheduler selects the execution tasks 1 to L for each time slot time. The execution level is a set of a plurality of tasks in which the execution tasks 1 to L are classified for each cycle.
M is assigned (the assignment method will be described later). When executing the scheduling, the scheduler preferentially executes the task waiting for activation of the execution level assigned to the time slot in a certain time slot (an execution level selection method will be described later).

【0004】図16の例では、タイムスロット1とタイ
ムスロット2に実行レベル1を、タイムスロット3に実
行レベル2を、タイムスロット(N−1)に実行レベル
Mを割当て、タイムスロットNは、実行レベルの選択時
間やタイムスロットの計算時間として、各タイムスロッ
処理に要するシステム時間のための予備のタイムスロ
ット(α)であり、実行レベル1を割当てる。実行レベ
ル1にはタスク1とタスク2の2つのタスクが、実行レ
ベル2にはタスク3が、実行レベルMにはタスクLが所
属している。スケジューリング時、タイマの値から、後
述するタイムスロット計算部がタイムスロット値を計算
する。最小基準周期毎に、実行周期が巡ってきた実行レ
ベルのタスクが後述する起動タスクキューイング部によ
り起動要求されるが、異なった実行レベルが同時に起動
要求された場合、以下の様にタイムスロット毎に起動要
求実行レベルの切換が実行される。タイムスロット1に
おいては、実行レベル1が選択され、実行レベル1のタ
スク1が実行されている。タイムスロット2において
も、実行レベル1が選択され、同様にタスク1が実行さ
れている。タイムスロット3においては実行レベル2が
選択され、実行レベル2の所属タスク3が実行される。
タイムスロットNは、予備のタイムスロットなので、最
小基準周期内で未実行のタスクが実行される。以上の様
な実行レベル選択が、最小基準周期毎に繰り返される。
In the example shown in FIG. 16, an execution level 1 is assigned to time slot 1 and time slot 2, an execution level 2 is assigned to time slot 3, and an execution level M is assigned to time slot (N-1). A spare time slot (α) for the system time required for each time slot processing , and an execution level 1 is assigned as the execution level selection time and the time slot calculation time. Two tasks, task 1 and task 2, belong to execution level 1, task 3 belongs to execution level 2, and task L belongs to execution level M. At the time of scheduling, a time slot calculator described later calculates a time slot value from the value of the timer. For each minimum reference cycle, the execution
The task of the bell is executed by the activation task queuing unit described later.
Start request, but different run levels start at the same time
If requested, activation is required for each time slot as follows:
The request execution level is switched. In time slot 1, execution level 1 is selected, and task 1 of execution level 1 is being executed. In the time slot 2, the execution level 1 is selected, and the task 1 is executed similarly. In the time slot 3, the execution level 2 is selected, and the task 3 belonging to the execution level 2 is executed.
Since the time slot N is a spare time slot, an unexecuted task is executed within the minimum reference cycle. The execution level selection as described above is repeated every minimum reference cycle.

【0005】図15において、11は、ユーザから提供
される各タスクに対する固有の実行周期と実行時間を含
むタスク情報12からタスクを実行レベルに分類し、実
行レベルを割当てたタイムスロットの情報を含むテーブ
ル情報(変更値)23を生成し、タイムスロット対応タ
スク情報テーブル21に該テーブル情報23を格納する
タイムスロット割当て部であり、図17に示すように、
タスク情報12から各タスクの実行周期を判別する実行
周期判別手段11aと、この判別結果に基づき各タスク
を実行周期の短い実行レベルから長いレベルまでレベル
分けする分類手段11bと、各タイムスロットに上記実
行レベルを割当てるタイムスロット割当て手段11c等
から成る。一方、図15の13は後述するタイムスロッ
ト計算部16からのタイムスロット変更割込み17をト
リガとして、タイムスロット対応タスク情報テーブル2
1からのテーブル情報(現在値)22と、後述するタイ
ムスロット情報格納部18からのタイムスロット値(現
在値)20に基づき実行タスクを選択し、起動をかける
スケジューリング実行部、16はオペレーティングシス
テムの機能であるソフトウエア(以下、S/Wと略記す
る)タイマ14からの定周期割込み15で起動され、現
在の時刻からタイムスロット値(変更値)19を算出
し、タイムスロット情報格納部18にその値を書き込む
とともに、このタイムスロット情報変更時にスケジュー
リング実行部13にタイムスロット変更割込み17をか
け、現在のタスク実行を中断させ、起動タスク選択をス
ケジューリング実行部13に行わせるタイムスロット計
算部であり、算出したタイムスロット値は内部にも保持
され、このタイムスロット値が次回の算出時にタイムス
ロットの前回値としてインクリメントされる。24は、
ユーザからタスク情報12として渡される起動要求タス
ク25を、タイムスロット対応タスク情報テーブル21
内の後述するタスク管理テーブルで生成されるキュー
(待ち行列)にキューイングする起動タスクキューイン
グ部である。
[0005] In FIG. 15, reference numeral 11 denotes a task classified into execution levels from task information 12 including a unique execution cycle and execution time for each task provided by a user, and includes information on a time slot to which the execution level is assigned. A time slot allocating unit that generates table information (change value) 23 and stores the table information 23 in the time slot corresponding task information table 21, as shown in FIG.
An execution cycle determining means 11a for determining an execution cycle of each task from the task information 12, a classification means 11b for classifying each task from an execution level having a short execution cycle to a long execution cycle based on a result of the determination; It comprises time slot allocating means 11c for allocating an execution level. On the other hand, 13 in FIG. 15 is triggered by a time slot change interrupt 17 from a time slot calculation unit 16 described later, and
A scheduling execution unit for selecting an execution task based on table information (current value) 22 from 1 and a time slot value (current value) 20 from a time slot information storage unit 18 described later, and activating the task. The software (hereinafter, abbreviated as S / W), which is a function, is started by a periodic interrupt 15 from a timer 14, calculates a time slot value (change value) 19 from the current time, and stores it in the time slot information storage unit 18. A time slot calculation unit that writes the value and, when the time slot information is changed, interrupts the scheduling execution unit 13 with a time slot change interrupt 17 to interrupt the current task execution and allows the scheduling execution unit 13 to select the activation task. , The calculated time slot value is also held internally, Tsu capital value is incremented as the previous value of the time slot at the time of the calculation of the next time. 24 is
The activation request task 25 passed from the user as the task information 12 is stored in the time slot corresponding task information table 21.
Is a startup task queuing unit that queues in a queue (queue) generated by a task management table described later.

【0006】図18は図15のタイムスロット対応タス
ク情報テーブル21に含まれる各テーブルの詳細図であ
る。211はタイムスロット1〜Nの各々に割当てた実
行レベル1〜Mの情報を格納するタイムスロット管理テ
ーブル、212a〜212cは各タイムスロット値に割
当てられた各実行レベルのタスクのキューイング状態を
格納するレベル管理テーブル、213a1〜213a
n,213b1,213c1,213c2は上述したキ
ューを生成するためのタスク管理テーブルである。上記
タイムスロット管理テーブル211には、各タイムスロ
ット1〜Nに割当てられた実行レベル1〜Mに対応する
レベル管理テーブル212a〜212cのアドレスを示
すポインタa〜cが格納される。タイムスロットNはシ
ステム時間のための予備のタイムスロット(α)で、実
行レベル小のタスクを優先的に実行するために実行レベ
ル1を割当てる。タスク管理テーブル213a1〜21
3c2には、次のタスク管理テーブルのアドレスを指す
ポインタ(ただし、キューの最後尾のタスク管理テーブ
ル213an,213b1,213c2のポインタは後
に続くテーブルがないことを示すNULLポインタ)
と、起動タスクの情報が格納される。また、レベル管理
テーブル212a〜212cには、各々の実行レベルで
のキューの先頭にあるタスク管理テーブルのアドレスを
指すポインタと、最後尾にあるタスク管理テーブルのア
ドレスを指すポインタが格納される。例えば、レベル1
用のレベル管理テーブル212aには、実行レベル1に
所属するキューイングタスクの先頭タスク管理テーブル
213a1のアドレスを示すポインタa1と、同最後尾
タスク管理テーブル213anのアドレスを示すポイン
タanを格納することで、これらのタスク管理テーブル
213a1〜213anに示されたタスクが実行待ちタ
スクであるという情報を提供する。
FIG. 18 is a detailed diagram of each table included in the time slot corresponding task information table 21 of FIG. A time slot management table 211 stores information on execution levels 1 to M assigned to each of the time slots 1 to N, and 212a to 212c stores a queuing state of a task of each execution level assigned to each time slot value. Level management table 213a1 to 213a
n, 213b1, 213c1, and 213c2 are task management tables for generating the above-described queues. The time slot management table 211 stores pointers a to c indicating the addresses of the level management tables 212a to 212c corresponding to the execution levels 1 to M assigned to the time slots 1 to N, respectively. The time slot N is a spare time slot (α) for the system time, and is assigned an execution level 1 to preferentially execute a task with a small execution level. Task management tables 213a1 to 213a21
A pointer 3c2 indicates the address of the next task management table (however, the pointers of the last task management tables 213an, 213b1, and 213c2 in the queue are NULL pointers indicating that there is no following table).
And information of the activation task. In the level management tables 212a to 212c, a pointer indicating the address of the task management table at the head of the queue at each execution level and a pointer indicating the address of the task management table at the end are stored. For example, level 1
A pointer a1 indicating the address of the head task management table 213a1 of the queuing task belonging to the execution level 1 and a pointer an indicating the address of the tail task management table 213an of the queuing task belonging to the execution level 1 are stored in the level management table 212a. , Provides information that the tasks shown in these task management tables 213a1 to 213an are tasks waiting to be executed.

【0007】次に動作について説明する。まず、タイム
スロット割当て部11による上記タイムスロット管理テ
ーブル211への実行レベルの割当て手段について、図
19,図20のフロー図を用いて説明する。割当てに先
立って、入力されたタスク情報12に基づき、実行周期
判別手段11aと分類手段11bにより、全ての起動タ
スクを実行周期毎にM個(ユーザが実行タスク数とシス
テムの能力から決定する数)の実行レベルに分類する
(ST191)。次に、タイムスロット割当て手段11
cにより、実行レベル1〜Mについて以下の処理を繰り
返す(ST192)。まず、実行レベル1について、最
小基準周期単位の実行時間の合計を、実行レベル1に所
属する全てのタスク実行時間の総和に、実行レベル1の
実行周期の最小基準周期に対する割合を掛けることで求
める(ST193)。例えば、実行レベル1のタスクの
実行周期が100ms、実行レベル1のタスクの実行時
間合計が40ms、最小基準周期が50msの時、40
×(50/100)=20msが求める値となる。即
ち、実行レベル1は最小基準周期内で20msの実行時
間が必要となる。その結果をタイムスロット時間で割
り、小数点以下を切上げ、最小基準周期内で実行レベル
1に必要なタイムスロット数を求める(ST194)。
前述の例では、タイムスロット時間が10msの時、2
0/10=2、故に2個のタイムスロットが必要とな
る。以上の処理を同様に実行レベル2からMまで繰り返
し(ST195)、各実行レベルに必要なタイムスロッ
ト数を求める。次に最小基準周期内でタスクの実行に必
要となるシステムの実行時間に必要なタイムスロット数
を、システム実行時間をタイムスロット時間で割り、少
数点以下を切り上げて求める(ST196)。以上で、
各々の実行レベルとシステムが必要とするタイムスロッ
ト数が算出できるが、ただし、その合計が最小基準周期
のタイムスロット数Nを越えると、実行最大負荷を越え
スケジューリング不可となるため、その合計と最小基準
周期のタイムスロット数Nを比較し(ST197)、合
計の方がタイムスロット数Nより大きい場合は、実行レ
ベル1から順に必要タイムスロット数だけ、レベル管理
テーブルへのポインタをタイムスロット管理テーブル2
11に格納し、タイムスロット管理テーブル211が満
たされたとき、残りのレベルは無視するようにする(S
T199)。合計がタイムスロット数Nより小さい場合
は、実行レベル1から順にタイムスロット管理テーブル
211に格納する(ST198)。以上でタイムスロッ
トへの実行レベルの割当てを終了する。
Next, the operation will be described. First, means for allocating the execution level to the time slot management table 211 by the time slot allocating unit 11 will be described with reference to the flowcharts of FIGS. Prior to the assignment, based on the input task information 12, the execution cycle determining unit 11a and the classifying unit 11b execute M activation tasks for each execution cycle (the number determined by the user based on the number of execution tasks and the capacity of the system). ) (ST191). Next, the time slot allocating means 11
According to c, the following processing is repeated for execution levels 1 to M (ST192). First, for the execution level 1, the total of the execution times in the minimum reference cycle unit is obtained by multiplying the sum of all the task execution times belonging to the execution level 1 by the ratio of the execution cycle of the execution level 1 to the minimum reference cycle. (ST193). For example, when the execution cycle of the task of execution level 1 is 100 ms, the total execution time of the task of execution level 1 is 40 ms, and the minimum reference cycle is 50 ms, 40
× (50/100) = 20 ms is the value to be obtained. That is, the execution level 1 requires an execution time of 20 ms within the minimum reference cycle. The result is divided by the time slot time, rounded up to the decimal point, and the number of time slots required for execution level 1 within the minimum reference cycle is obtained (ST194).
In the above example, when the time slot time is 10 ms, 2
0/10 = 2, so two time slots are required. The above processing is similarly repeated from execution levels 2 to M (ST195), and the number of time slots required for each execution level is obtained. Next, the number of time slots required for the execution time of the system required to execute the task within the minimum reference period is obtained by dividing the system execution time by the time slot time and rounding up the decimal point (ST196). Above,
Each execution level and the number of time slots required by the system can be calculated. However, if the total exceeds the number N of time slots of the minimum reference period, the maximum execution load is exceeded and scheduling becomes impossible. The number N of time slots in the reference cycle is compared (ST197), and if the total is greater than the number N of time slots, pointers to the level management table are shifted from execution level 1 by the required number of time slots to time slot management table 2 in order.
11 and when the time slot management table 211 is satisfied, the remaining levels are ignored (S
T199). If the total is smaller than the number N of time slots, the time slots are stored in the time slot management table 211 in order from the execution level 1 (ST198). This completes the assignment of the execution level to the time slot.

【0008】次に、スケジューリング実行部13による
タイムスロット管理テーブル211を用いたスケジュー
リング方法を、図21のフロー図を用いて説明する。S
/Wタイマ14からの定周期タイマ割込み15を受け
て、タイムスロット計算部16はタイムスロット値19
を計算し、タイムスロット情報格納部18にその値を格
納し、タイムスロット変更割込み17をスケジューリン
グ実行部13に出力する。スケジューリング実行部13
はこの変更割込み17を受けて、動作を開始する。現在
のタイムスロット値20をタイムスロット情報格納部1
8から獲得し(ST211)、獲得したタイムスロット
値に割当てられている実行レベルを図18のタイムスロ
ット管理テーブル211の実行レベル1〜Mから獲得す
る(ST212)。該実行レベルにキューイングされた
タスク(実行待ちタスク)の存在を、該レベル管理テー
ブル212a〜212cを用いてチェックし(ST21
3)、キューイングされていればその先頭タスクを実行
する(ST214)。例えば、タイムスロット情報格納
部18からのタイムスロット値が1の時、スケジューリ
ング実行部13はタイムスロット管理テーブル211に
よりポインタaで示されるレベル管理テーブル212a
を確認し、そのポインタa1で示される先頭タスク管理
テーブル213a1のタスクを実行する。キューインイ
グされていなければ実行レベルをインクリメントし(S
T216)、次の実行レベルのレベル管理テーブルにつ
いてキューイング状態のチェックを繰り返す。実行レベ
ルのチェックは、現タイムスロットに割り当てられた実
行レベルを先頭に、図22のようにサイクリックに行う
ため、実行レベルがMを越えたら実行レベルを1に戻す
(ST217,ST218)。以上のチェックで全ての
実行レベルを一巡したら(ST219)、全ての実行レ
ベルに実行タスク無しと判断する(ST220)。実行
タスクが有る場合,無い場合ともに、タイムスロット変
更割込み17を待って(ST215)、次のタイムスロ
ット値の獲得へ戻り、以上の動作を繰り返す。
Next, a scheduling method by the scheduling execution unit 13 using the time slot management table 211 will be described with reference to a flowchart of FIG. S
In response to the fixed-period timer interrupt 15 from the / W timer 14, the time slot calculator 16
Is calculated, the value is stored in the time slot information storage unit 18, and the time slot change interrupt 17 is output to the scheduling execution unit 13. Scheduling execution unit 13
Receives the change interrupt 17 and starts operation. The current time slot value 20 is stored in the time slot information storage 1
8 (ST211), and the execution levels assigned to the obtained time slot values are obtained from the execution levels 1 to M of the time slot management table 211 in FIG. 18 (ST212). The existence of a task (task waiting to be executed) queued at the execution level is checked using the level management tables 212a to 212c (ST21).
3) If it is queued, execute the first task (ST214). For example, when the time slot value from the time slot information storage unit 18 is 1, the scheduling execution unit 13 uses the time slot management table 211 to indicate the level management table 212a indicated by the pointer a.
And executes the task of the head task management table 213a1 indicated by the pointer a1. If not queued, the execution level is incremented (S
T216), the queuing state check is repeated for the level management table of the next execution level. Since the execution level is checked cyclically as shown in FIG. 22 starting with the execution level assigned to the current time slot, the execution level is returned to 1 when the execution level exceeds M (ST217, ST218). When all the execution levels have gone through the above check (ST219), it is determined that there is no execution task in all the execution levels (ST220). When there is an execution task or no execution task, the process waits for the time slot change interrupt 17 (ST215), returns to the acquisition of the next time slot value, and repeats the above operation.

【0009】[0009]

【発明が解決しようとする課題】従来の計算機システム
は以上の様に構成されているので、図19,図20に示
したタイムスロット割当て方法では、周期的スケジュー
リングを行なうことでプロセッサへの負担を均等にでき
るが、最小基準周期でタスク起動の周期的チェックを実
行するため、最小基準周期未満の周期的スケジューリン
グは不可能となる。このため、最小基準周期未満の実行
周期のタスクについては、このようなタスクが存在しな
いようにユーザは実行周期を決定せねばならないという
問題点があった。また、予めユーザより指定された実行
要求タスク,即ちタイムスロット管理テーブルに割付け
られたタスクしか実行できないので、周期的タスクとと
もに、エラー処理等の非周期的に発生する割込み処理を
行なうことができないという問題点があった。
Since the conventional computer system is configured as described above, the time slot allocation method shown in FIGS. 19 and 20 reduces the load on the processor by performing periodic scheduling. Evenly, the task can be periodically checked for the task activation at the minimum reference cycle, so that periodic scheduling less than the minimum reference cycle becomes impossible. For this reason, there is a problem that the user has to determine an execution cycle of a task having an execution cycle shorter than the minimum reference cycle so that such a task does not exist. Also, since only the execution request task specified by the user in advance, that is, the task assigned to the time slot management table, can be executed, it is not possible to perform the non-periodic interrupt processing such as the error processing together with the periodic task. There was a problem.

【0010】この発明は上記のような課題を解決するた
めになされたものであり、従来の周期的スケジューリン
グに加え、実行周期が最小基準周期未満のタスクが存在
する場合のスケジューリングを提供し、全ての周期のタ
スクのスケジューリングを可能にした計算機システムを
得ることを目的とする。また、周期的タスクとともに、
エラー処理等の非周期的に発生する割込み処理も可能に
した計算機システムを得ることを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problem. In addition to the conventional periodic scheduling, the present invention provides a scheduling when there is a task whose execution cycle is less than a minimum reference cycle. It is an object of the present invention to obtain a computer system capable of scheduling tasks having a period of. Also, along with periodic tasks,
It is an object of the present invention to obtain a computer system that also enables non-periodic interrupt processing such as error processing.

【0011】[0011]

【課題を解決するための手段】この発明の第1の発明に
係る計算機システムは、固有の実行周期と実行時間を保
有する複数のタスクを管理してスケジューリングする機
能を有する計算機システムにおいて、各タスクの実行周
期を判別する実行周期判別手段と、この実行周期判別手
段の判別結果に基づき、各タスクを実行周期の短い実行
レベルから長い実行レベルまでレベル分けする分類手段
と、周期的にタスクの起動をチェックする際の基準とな
る最小基準周期を所定値で割った時間単位であるタイム
スロットに、上記実行レベルを割当てるタイムスロット
割当て手段と、最小実行周期のタスクが分類された実行
レベルの実行周期が上記最小基準周期より短いか否かを
判定する比較手段と、この比較結果に基づき、予め設定
された周期に従って、各タイムスロットに上記実行レベ
ルを割当てる周期的スケジューリングモードと、全ての
タイムスロットに最小実行周期のタスクが分類された実
行レベルを割当てるプライオリティスケジューリングモ
ードとを切換えるスケジューリングモード切換手段と、
現時刻に対応するタイムスロットに割当てられた実行レ
ベルからタスクスケジューリングを実行するスケジュー
リング実行手段とを備え、上記比較手段で最小実行周期
のタスクが分類された実行レベルの実行周期が最小基準
周期よりも短いと判定されたとき、上記スケジューリン
グモード切換手段は通常の周期的スケジューリングモー
ドからプライオリティスケジューリングモードに切換
え、これに基づき上記タイムスロット割当て手段は、全
てのタイムスロットに最小実行周期のタスクが分類され
た実行レベルを割当てるようにしたものである。
According to a first aspect of the present invention, there is provided a computer system having a function of managing and scheduling a plurality of tasks each having a unique execution cycle and execution time. An execution cycle determining means for determining an execution cycle of the task; a classification means for classifying each task from an execution level having a short execution cycle to a long execution level based on the determination result of the execution cycle determining means; Time slot allocating means for allocating the execution level to a time slot, which is a time unit obtained by dividing a minimum reference cycle as a reference when checking by a predetermined value, and an execution cycle of an execution level in which tasks of the minimum execution cycle are classified Means for determining whether is shorter than the minimum reference cycle, and a preset value based on the comparison result.
A scheduling mode switching means for switching between a periodic scheduling mode for allocating the execution level to each time slot and a priority scheduling mode for allocating an execution level in which tasks having a minimum execution cycle are classified to all time slots,
Scheduling execution means for executing task scheduling from the execution level assigned to the time slot corresponding to the current time, wherein the execution cycle of the execution level in which the task of the minimum execution cycle is classified by the comparison means is smaller than the minimum reference cycle. When it is determined that the time is short, the scheduling mode switching means switches from the normal periodic scheduling mode to the priority scheduling mode, and based on this, the time slot allocating means classifies the tasks having the minimum execution period into all the time slots. An execution level is assigned.

【0012】また、第2の発明に係る計算機システム
は、各タスクの実行周期を判別する実行周期判別手段
と、この実行周期判別手段の判別結果に基づき、各タス
クを実行周期の短い実行レベルから長い実行レベルまで
レベル分けする分類手段と、周期的にタスクの起動をチ
ェックする際の基準となる最小基準周期を所定値で割っ
た時間単位であるタイムスロットに、上記実行レベルを
割当てるタイムスロット割当て手段と、現時刻に対応す
るタイムスロットに割当てられた実行レベルからタスク
スケジューリングを実行するスケジューリング実行手段
とを備えるとともに、エラー発生等の非周期的イベント
の発生を上記スケジューリング実行手段に割込みで通知
する割込み発生手段と、上記割込み発生時の処理を行な
う割込み処理手段とを備え、上記スケジューリング実行
手段は、上記割込み発生時、予め定められた上記周期的
タスクと割込み処理の優先度,即ちプライオリティに基
づき割込み処理が周期的タスクよりプライオリティが高
い時は、上記周期的タスクの実行を一時中断して上記割
込み処理手段に割込み処理を実行させるようにしたもの
である。
Further, a computer system according to a second aspect of the present invention provides an execution cycle determining means for determining an execution cycle of each task, and based on a result of the determination by the execution cycle determining means, executes each task from an execution level having a short execution cycle. A classifying means for classifying the execution level to a long execution level, and a time slot assignment for assigning the execution level to a time slot which is a time unit obtained by dividing a minimum reference cycle as a reference for periodically checking task activation by a predetermined value. Means, and scheduling execution means for executing task scheduling from an execution level assigned to a time slot corresponding to the current time, and notifying the scheduling execution means of the occurrence of an aperiodic event such as an error by interruption. Interrupt generating means and interrupt processing means for performing processing when the above-mentioned interrupt occurs. In addition, the scheduling execution means, when the interrupt occurs, when the priority of the periodic task and the interrupt processing is higher than the periodic task based on the priority of the predetermined periodic task and the interrupt processing, that is, when the priority of the periodic task is higher than the priority of the periodic task, The execution is temporarily suspended, and the interruption processing means is caused to execute the interruption processing.

【0013】一方、第3の発明に係る計算機システム
は、上記第1の発明同様、各タスクの実行周期を判別す
る実行周期判別手段と、この実行周期判別手段の判別結
果に基づき、各タスクを実行周期の短い実行レベルから
長い実行レベルまでレベル分けする分類手段と、周期的
にタスクの起動をチェックする際の基準となる最小基準
周期を所定値で割った時間単位であるタイムスロット
に、上記実行レベルを割当てるタイムスロット割当て手
段と、最小実行周期のタスクが分類された実行レベルの
実行周期が上記最小基準周期より短いか否かを判定する
比較手段と、この比較結果に基づき、予め設定された周
期に従って、各タイムスロットに上記実行レベルを割当
てる周期的スケジューリングモードと、全てのタイムス
ロットに最小実行周期のタスクが分類された実行レベル
を割当てるプライオリティスケジューリングモードとを
切換えるスケジューリングモード切換手段と、現時刻に
対応するタイムスロットに割当てられた実行レベルから
タスクスケジューリングを実行するスケジューリング実
行手段とを備えるとともに、ハードウェアタイマからの
クロックに基づきタイムスロット時間毎に上記スケジュ
ーリング実行手段に割込みを発生する割込み発生器と、
ハードウェアタイマからのクロックに基づき各タイムス
ロット値をカウントするカウンタと、上記カウンタによ
りタイムスロット値がセットされ、上記割込み発生器か
らの割込み発生毎に上記スケジューリング実行手段によ
り現時刻のタイムスロット値が読み出されるレジスタと
を備え、上記比較手段で最小実行周期のタスクが分類さ
れた実行レベルの実行周期が最小基準周期よりも短いと
判定されたとき、上記スケジューリングモード切換手段
は通常の周期的スケジューリングモードからプライオリ
ティスケジューリングモードに切換え、これに基づき上
記タイムスロット割当て手段は、全てのタイムスロット
に最小実行周期のタスクが分類された実行レベルを割当
てるようにしたものである。
On the other hand, a computer system according to a third aspect of the present invention provides an execution cycle determining means for determining an execution cycle of each task and a task based on the determination result of the execution cycle determining means, as in the first invention. Classification means for classifying the execution level from a short execution level to a long execution level, and a time slot which is a time unit obtained by dividing a minimum reference cycle as a reference when periodically checking task activation by a predetermined value, Time slot allocating means for allocating an execution level, comparison means for determining whether or not the execution cycle of the execution level in which the tasks of the minimum execution cycle are classified is shorter than the minimum reference cycle, and a preset time slot based on the comparison result. Lap
A scheduling mode switching means for switching between a periodic scheduling mode for assigning the execution level to each time slot according to a period, and a priority scheduling mode for assigning an execution level in which tasks of the minimum execution cycle are classified to all time slots; And a scheduling execution means for executing task scheduling from an execution level assigned to a time slot corresponding to the time slot, and generating an interrupt to the scheduling execution means for each time slot time based on a clock from a hardware timer. When,
A counter that counts each time slot value based on a clock from a hardware timer, and a time slot value is set by the counter. Each time an interrupt is generated from the interrupt generator, the time slot value at the current time is set by the scheduling execution unit. A register to be read out, and when it is determined by the comparing means that the execution cycle of the execution level at which the task of the minimum execution cycle is classified is shorter than the minimum reference cycle, the scheduling mode switching means performs the normal periodic scheduling mode. To the priority scheduling mode, based on which the time slot allocating means allocates an execution level in which the tasks of the minimum execution cycle are classified to all the time slots.

【0014】[0014]

【作用】第1の発明における計算機システムは、タイム
スロット割当て手段が実行レベルのタイムスロット割当
てを実行するに先立って、上記実行周期判別手段,分類
手段及び比較手段により、最小基準周期未満の実行周期
のタスクの存在をチェックする。もし存在した場合は、
スケジューリングモード切換手段が通常の周期的スケジ
ューリングモードからプライオリティスケジューリング
モードに切換える。タイムスロット割当て手段は、スケ
ジューリングモードがプライオリティスケジューリング
モードとなっていることを認識すると、全てのタイムス
ロットに最小実行周期の実行レベルを割当てる。スケジ
ューリング実行手段は、全てのタイムスロットで、割当
てられた最小実行周期の実行レベルから順にタスクを実
行する。全てのタイムスロットに最小実行周期の実行レ
ベルを割当てることで、常に最小実行周期の実行レベル
から順にタスクをチェックすることになり、結果とし
て、最小実行周期の実行レベルに最大のプライオリティ
を与え、タイムスロット単位でタスクの起動をチェック
するプライオリティスケジューリングが実現される。
In the computer system according to the first aspect of the present invention, before the time slot allocating means executes the time slot allocation at the execution level, the execution cycle determining means, the classifying means and the comparing means execute the execution cycle less than the minimum reference cycle. Check for the existence of the task. If present,
Scheduling mode switching means switches from the normal periodic scheduling mode to the priority scheduling mode. When recognizing that the scheduling mode is the priority scheduling mode, the time slot allocating means allocates the execution level of the minimum execution cycle to all the time slots. The scheduling execution means executes tasks in all time slots in order from the execution level of the assigned minimum execution cycle. By assigning the execution level of the minimum execution cycle to all time slots, tasks are always checked in order from the execution level of the minimum execution cycle, and as a result, the execution level of the minimum execution cycle is given the highest priority and the time is given. Priority scheduling that checks task activation in slot units is realized.

【0015】また、第2の発明における計算機システム
は、スケジューリング実行手段が割込み発生手段からの
割込みの有無をチェックし、割込みが無い場合は通常の
周期的スケジューリングを行なう。割込みが有れば、周
期的タスクと割込み処理のプライオリティに基づき、割
込み処理のプライオリティが高ければ割込み処理手段に
割込み処理を行なわせる。割込み処理のプライオリティ
が低ければ通常の周期的スケジューリングを行なう。こ
れにより、周期的スケジューリングと、エラー処理等の
非周期的に発生する割込み処理のプライオリティ制御が
可能となる。
Further, in the computer system according to the second invention, the scheduling execution means checks for the presence or absence of an interrupt from the interrupt generation means, and if there is no interrupt, performs normal periodic scheduling. If there is an interrupt, based on the priority of the periodic task and the interrupt processing, if the priority of the interrupt processing is high, the interrupt processing means is caused to perform the interrupt processing. If the priority of the interrupt processing is low, normal periodic scheduling is performed. As a result, it is possible to control the periodic scheduling and the priority of interrupt processing that occurs aperiodically, such as error processing.

【0016】一方、第3の発明における計算機システム
は、ハードウェアタイマからのクロックにより割込み発
生器及びカウンタが動作し、割込み発生器からスケジュ
ーリング実行手段へタイムスロット時間毎に割込みが発
生するとともに、カウンタからレジスタに各時刻のタイ
ムスロット値がセットされる。スケジューリング実行手
段は、タイムスロット時間毎の割込みが入るとレジスタ
を見に行き、現時刻に対応するタイムスロット値を得
る。このタイムスロット値を用いて、上記第1の発明と
同様のスケジューリング処理を行なう。タイマにハード
ウェアタイマを用い、レジスタに自動的にタイムスロッ
ト値をセットすることによって、システムにかかる負荷
を軽減し、処理速度の向上を実現できる。
On the other hand, in the computer system according to the third aspect of the present invention, the interrupt generator and the counter operate according to the clock from the hardware timer, and the interrupt generator generates an interrupt from the interrupt generator to the scheduling execution means at every time slot time. , The time slot value of each time is set in the register. The scheduling execution means goes to a register when an interrupt occurs for each time slot time, and obtains a time slot value corresponding to the current time. Using this time slot value, the same scheduling processing as in the first invention is performed. By using a hardware timer for the timer and automatically setting the time slot value in the register, the load on the system can be reduced and the processing speed can be improved.

【0017】[0017]

【実施例】実施例1.以下、この発明の実施例を図につ
いて説明する。図1は、実施例1による計算機システム
のスケジューリングに関する部分の構成図である。図に
おいて、26は新たに設けられたスケジューリングモー
ド選択部であり、タスク情報12から、起動タスクの実
行周期中,最小基準周期未満のタスクの有無をチェック
し、もし存在すればスケジューリングモードとしてプラ
イオリティスケジューリングモードを選択し、存在しな
ければ従来の周期的スケジューリングモードを選択す
る。27は上記スケジューリングモード選択部26が選
択結果として出力するスケジューリングモード信号であ
る。11は、上記スケジューリングモード選択部26か
らスケジューリングモード信号17を受け取り、周期的
スケジューリングモードなら従来のものと同様の動作を
行い、プライオリティスケジューリングモードなら、全
てのタイムスロットに実行レベル1を割当てるタイムス
ロット割当て部であり、この機能は図17に示したタイ
ムスロット割当て手段11cにより実現される。その他
については従来のシステムと同様である。
[Embodiment 1] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a configuration diagram of a part related to scheduling of the computer system according to the first embodiment. In the figure, reference numeral 26 denotes a newly provided scheduling mode selection unit, which checks, from the task information 12, whether or not there is a task shorter than the minimum reference cycle during the execution cycle of the activation task, and if there is, the priority mode is set as the scheduling mode. Select the mode, and if not, select the conventional periodic scheduling mode. Reference numeral 27 denotes a scheduling mode signal output by the scheduling mode selection unit 26 as a selection result. 11 receives a scheduling mode signal 17 from the scheduling mode selector 26, performs the same operation as the conventional one in the case of the periodic scheduling mode, and assigns the execution level 1 to all the time slots in the case of the priority scheduling mode. This function is realized by the time slot allocating means 11c shown in FIG. Others are the same as the conventional system.

【0018】図2は上記スケジューリングモード選択部
26の内部構成を示す機能ブロック図である。図におい
て、26aはタスク情報12に基づき各タスクの実行周
期を判別する実行周期判別手段、26bは上記実行周期
判別手段26aの判別結果に基づき、各タスクを実行周
期の短い実行レベルから長い実行レベルまでレベル分け
する分類手段、26cは上記分類手段26bにより最小
実行周期のタスクが分類された実行レベルの実行周期が
上記最小基準周期より短いか否かを判定する比較手段、
26dはこの比較結果に基づき、従来からの周期的スケ
ジューリングモードと、新たなスケジューリングモード
として全てのタイムスロットに最小実行周期のタスクが
分類された実行レベルを割当てるプライオリティスケジ
ューリングモードとを切換えるスケジューリングモード
切換手段であり、このスケジューリングモード切換手段
26dの出力がスケジューリングモード信号27とな
る。なお、上記実行周期判別手段26aと分類手段26
bは、従来からタイムスロット割当て部11に備わって
いる実行周期判別手段11a及び分類手段11b(図1
7参照)と同様なものである。従って、これらを一組だ
け備えてタイムスロット割当て部11とスケジューリン
グモード選択部26で共用することも可能である。
FIG. 2 is a functional block diagram showing the internal configuration of the scheduling mode selector 26. In the figure, reference numeral 26a denotes an execution cycle determining means for determining the execution cycle of each task based on the task information 12, and 26b designates each task from an execution level having a short execution cycle to a long execution level based on the determination result of the execution cycle determining means 26a. Classifying means for classifying the tasks to levels up to 26c; comparing means for determining whether or not the execution cycle of the execution level at which the task of the minimum execution cycle is classified by the classification means 26b is shorter than the minimum reference cycle;
26d is a scheduling mode switching means for switching between a conventional periodic scheduling mode and a priority scheduling mode for assigning an execution level in which a task having the minimum execution cycle is classified to all time slots as a new scheduling mode based on the comparison result. The output of the scheduling mode switching means 26d becomes the scheduling mode signal 27. Note that the execution cycle determining means 26a and the classifying means 26
b is an execution period discriminating means 11a and a classifying means 11b (FIG. 1) conventionally provided in the time slot allocating unit 11.
7). Therefore, it is also possible to provide only one set of these and share them between the time slot assignment unit 11 and the scheduling mode selection unit 26.

【0019】次に、本実施例におけるタイムスロット割
当て方法について図3,図4のフロー図を用いて説明す
る。まず、スケジューリングモード選択部26は、実行
周期判別手段26aにより全ての起動タスクの実行周期
を判別し、分類手段26bにより実行周期別に実行レベ
ルに分類する(ST31)。例えば、実行周期50ms
のタスクは実行レベル1に、実行周期70msのタスク
は実行レベル2に、という具合に分類する。次に、スケ
ジューリングモード選択部26は、比較手段26cによ
り最小実行周期のタスクが所属する実行レベル1の実行
周期と最小基準周期を比較し(ST32)、実行レベル
1の周期の方が小さければ、スケジューリングモード切
換手段26dによりプライオリティスケジューリングモ
ードを選択し(ST34)、大きければ従来同様の周期
的スケジューリングモードを選択する。(ST33)。
次に、タイムスロット割当て部11は、スケジューリン
グモード信号27を受け取り、このモードをチェックし
(ST35)、これがプライオリティスケジューリング
モードの場合は、図5に示すように、タイムスロット管
理テーブル211の全てのタイムスロット1〜Nに実行
レベル1を割当てる(ST36)。スケジューリングモ
ードが周期的スケジューリングモードの場合は、従来の
システムと同様の処理を行なう。即ち、タイムスロット
割当て部11は、実行レベル1〜Mについて以下の処理
を行う(ST37)。実行レベル1について、実行レベ
ル1の全てのタスク実行時間の総和に、実行レベル1の
実行周期の最小基準周期に対する割合を掛けることで、
実行レベル1のタスクの実行時間合計が最小基準周期内
に占める時間を求める(ST38)。従来例でも述べた
ように、例えば、実行レベル1のタスクの実行周期が1
00ms、実行レベル1のタスクの実行時間合計が40
ms、最小基準周期が50msの時、40×(50/1
00)=20msが求める値となる。即ち、実行レベル
1は最小基準周期内で20msの実行時間が必要とな
る。その結果をタイムスロット時間で割り、小数点以下
を切上げ、最小基準周期内で実行レベル1に必要なタイ
ムスロット数を求める(ST39)。前述の例では、タ
イムスロット時間が10msの時、20/10=2、故
に2個のタイムスロットが必要となる。以上の処理を同
様に実行レベル2からMまで繰り返し(ST40)、各
実行レベルに必要なタイムスロット数を求める。次にタ
スクの実行に必要となるシステムの実行時間に必要なタ
イムスロット数を求める(ST41)。以上で、各々の
実行レベルが必要とするタイムスロット数が算出できる
が、ただし、その合計が最小基準周期のタイムスロット
数Nを越えると、実行最大負荷を越え制御不可となるた
め、その合計とNを比較し(ST42)、合計がタイム
スロット数Nを越えている場合は、実行レベル1から順
に必要タイムスロット数だけタイムスロット管理テーブ
ル211に格納し、テーブルが満たされたとき、残りの
レベルは無視するようにする(ST44)。Nのほうが
大きい場合は問題なく、実行レベル1から順にタイムス
ロット管理テーブル211に格納する(ST43)。以
上でタイムスロットへの実行レベルの割当てを終了す
る。
Next, a method of allocating a time slot according to the present embodiment will be described with reference to flowcharts shown in FIGS. First, the scheduling mode selection unit 26 determines the execution cycle of all activated tasks by the execution cycle determination unit 26a, and classifies the execution tasks into execution levels by execution cycle by the classification unit 26b (ST31). For example, an execution cycle of 50 ms
Are classified into an execution level 1, tasks with an execution period of 70 ms are classified into an execution level 2, and so on. Next, the scheduling mode selecting unit 26 compares the execution cycle of the execution level 1 to which the task of the minimum execution cycle belongs with the minimum reference cycle by the comparing means 26c (ST32). If the cycle of the execution level 1 is smaller, The priority scheduling mode is selected by the scheduling mode switching means 26d (ST34), and if it is larger, the same periodic scheduling mode as the conventional one is selected. (ST33).
Next, the time slot allocating unit 11 receives the scheduling mode signal 27 and checks this mode (ST35). If this mode is the priority scheduling mode, as shown in FIG. The execution level 1 is assigned to the slots 1 to N (ST36). When the scheduling mode is the periodic scheduling mode, the same processing as in the conventional system is performed. That is, the time slot allocating unit 11 performs the following processing for the execution levels 1 to M (ST37). For execution level 1, by multiplying the sum of all task execution times of execution level 1 by the ratio of the execution cycle of execution level 1 to the minimum reference cycle,
The time that the total execution time of the task of the execution level 1 occupies in the minimum reference cycle is obtained (ST38). As described in the conventional example, for example, when the execution cycle of a task of execution level 1 is 1
00 ms, total execution time of task of execution level 1 is 40
ms, when the minimum reference cycle is 50 ms, 40 × (50/1
00) = 20 ms is the value to be obtained. That is, the execution level 1 requires an execution time of 20 ms within the minimum reference cycle. The result is divided by the time slot time, rounded up below the decimal point, and the number of time slots required for the execution level 1 within the minimum reference cycle is obtained (ST39). In the above example, when the time slot time is 10 ms, 20/10 = 2, so two time slots are required. The above processing is similarly repeated from execution levels 2 to M (ST40), and the number of time slots required for each execution level is obtained. Next, the number of time slots required for the execution time of the system required for executing the task is obtained (ST41). As described above, the number of time slots required by each execution level can be calculated. However, if the total exceeds the number N of time slots in the minimum reference cycle, the execution maximum load is exceeded and control becomes impossible. N are compared (ST42), and if the total exceeds the number N of time slots, the required number of time slots is stored in the time slot management table 211 in order from the execution level 1; Is ignored (ST44). If N is larger, there is no problem and it is stored in the time slot management table 211 in order from the execution level 1 (ST43). This completes the assignment of the execution level to the time slot.

【0020】タイムスロット割当て後のスケジューリン
グ実行は、従来の手段と同様の動作を行う。この時、プ
ライオリティスケジューリングモードで図5に示したよ
うにタイムスロット管理テーブル211が生成された場
合は、従来例で示した図21のフロー図は図6に示すよ
うになり、全てのタイムスロットで実行レベル1を得て
ST221)、実行レベル1から図22に従ってレベ
ル管理テーブル212a〜212cをチェックし、最初
に発見したキューイングタスクを実行する。この結果、
実行レベル1に最大のプライオリティを与え、実行レベ
ルMに最小のプライオリティを与えることになる。即
ち、どのタイムスロットにおいても実行レベル1を獲得
し、図22の実行レベル探索に従い実行タスクを決定す
るので、実行レベルの小さいタスクが終了しない限り、
大きいタスクは実行されない。この結果、実行レベルの
小さいタスクほど高いプライオリティを与えるプライオ
リティスケジューリングが実現される。この場合、従来
例で示した図16は図7に示すようになる。
The execution of the scheduling after the allocation of the time slot performs the same operation as the conventional means. At this time, when the time slot management table 211 is generated in the priority scheduling mode as shown in FIG. 5, the flow chart of FIG. 21 shown in the conventional example becomes as shown in FIG. The execution level 1 is obtained ( ST221 ), the level management tables 212a to 212c are checked from the execution level 1 according to FIG. 22, and the queuing task found first is executed. As a result,
Execution level 1 is given the highest priority, and execution level M is given the lowest priority. That is, the execution level 1 is obtained in any time slot and the execution task is determined according to the execution level search shown in FIG. 22.
Large tasks are not executed. As a result, priority scheduling is realized, in which a task with a lower execution level is given a higher priority. In this case, FIG. 16 shown in the conventional example becomes as shown in FIG.

【0021】実施例2.図8は実施例2の計算機システ
ムのスケジューリングに関する部分の構成図である。本
実施例は、図1の実施例1のものに、エラー発生等の非
周期的イベントの発生をスケジューリング実行部13に
割込みで知らせる割込み発生部28と、割込みが生じた
時の処理を行なう割込み処理部29と、予め定められた
周期的タスクと上記割込み処理との間のプライオリティ
情報を格納しておくプライオリティ情報格納部30とを
設けたものである。そして、スケジューリング実行部1
3は、通常は実施例1のような周期的スケジューリング
を行い、エラー発生等により割込み発生部28より割込
み(割込み種類を含む)31が入った時は、プライオリ
ティ情報格納部30からのプライオリティ情報32に基
づき、その割込み処理が周期的タスクよりプライオリテ
ィが高ければ、割込み処理要求(割込み種類を含む)3
3を割込み処理部29へ送り、周期的タスクの実行を一
時中断して割込み処理を行なうようにしたものである。
Embodiment 2 FIG. FIG. 8 is a configuration diagram of a portion related to scheduling of the computer system according to the second embodiment. This embodiment is different from the first embodiment in FIG. 1 in that an interrupt generation unit 28 that notifies the scheduling execution unit 13 of the occurrence of an aperiodic event such as an error by an interrupt, and an interrupt that performs processing when an interrupt occurs. A processing unit 29 and a priority information storage unit 30 for storing priority information between a predetermined periodic task and the interrupt processing are provided. Then, the scheduling execution unit 1
3 normally performs the periodic scheduling as in the first embodiment, and when an interrupt (including an interrupt type) 31 is received from the interrupt generation unit 28 due to an error or the like, the priority information 32 from the priority information storage unit 30 If the priority of the interrupt processing is higher than that of the periodic task, the interrupt processing request (including the type of interrupt) 3
3 is sent to the interrupt processing unit 29, and the execution of the periodic task is temporarily interrupted to execute the interrupt processing.

【0022】上記割込み発生部28は、図9に示すよう
に、割込み種類通知テーブル28aと、割込み発生通知
テーブル28bと、実行タスク監視部28cとを有して
おり、以下、エラー割込みを例にとって説明する。計算
機システムの実行中タスク28dは自タスク内に何らか
のエラーが生じると、その割込み種類28eを割込み種
類テーブル28aに書き込み、割込み発生通知テーブル
28bには割込み発生信号28fをセットする。一方、
実行タスク監視部28cは、割込み発生通知テーブル2
8bを一定周期でポーリングし、該テーブル28bから
の割込み発生信号28gがセットされると、割込み種類
通知テーブル28aから割込み種類28hを獲得し、そ
れを割込み31によりスケジューリング実行部13へ送
る。処理終了後は、再び割込み発生通知テーブル28b
のポーリングに入る。一方、上記割込み処理部29は、
図10に示すように、割込み種類通知テーブル29a
と、割込み処理要求通知テーブル29bと、割込みハン
ドラ29cと、割込み種類に対応した複数の割込み処理
ルーチン(1)29d〜(n)29fとを有している。
スケジューリング実行部13は、割込み発生部28から
割込み種類を含む割込み31を受けとると、割込み種類
に対応する割込み処理のプライオリティと周期的タスク
のプライオリティを比較し、割込み処理のプライオリテ
ィの方が高ければ、割込み処理部29の割込み種類通知
テーブル29aに該割込み種類33bを書き込み、その
後,割込み処理要求通知テーブル29bに割込み処理要
求33aをセットする。一方、割込みハンドラ29c
は、割込み処理要求通知テーブル29bを一定周期でポ
ーリングし、もし該テーブル29bからの割込み処理要
求29gがセットされると、割込み種類通知テーブル2
9aから割込み種類29hを獲得し、それに応じて割込
み処理起動信号29i〜29kを出力し割込み処理ルー
チン(1)29d〜(n)29fのうち1つを起動す
る。処理が終了すると、再び割込み処理要求通知テーブ
ル29bのポーリングに入る。
As shown in FIG. 9, the interrupt generation section 28 has an interrupt type notification table 28a, an interrupt generation notification table 28b, and an execution task monitoring section 28c. explain. If any error occurs in the task during execution of the computer system, the task 28d writes the interrupt type 28e in the interrupt type table 28a and sets the interrupt generation signal 28f in the interrupt generation notification table 28b. on the other hand,
The execution task monitoring unit 28c sets the interrupt occurrence notification table 2
When the interrupt generation signal 28g from the table 28b is set, an interrupt type 28h is obtained from the interrupt type notification table 28a and sent to the scheduling execution unit 13 by the interrupt 31. After the processing is completed, the interrupt occurrence notification table 28b is again
Enter polling. On the other hand, the interrupt processing unit 29
As shown in FIG. 10, the interrupt type notification table 29a
And an interrupt processing request notification table 29b, an interrupt handler 29c, and a plurality of interrupt processing routines (1) 29d to (n) 29f corresponding to interrupt types.
Upon receiving the interrupt 31 including the interrupt type from the interrupt generating unit 28, the scheduling execution unit 13 compares the priority of the interrupt process corresponding to the interrupt type with the priority of the periodic task, and if the priority of the interrupt process is higher, The interrupt type 33b is written in the interrupt type notification table 29a of the interrupt processing unit 29, and then the interrupt processing request 33a is set in the interrupt processing request notification table 29b. On the other hand, the interrupt handler 29c
Polls the interrupt processing request notification table 29b at regular intervals, and if an interrupt processing request 29g from the table 29b is set, the interrupt type notification table 2
An interrupt type 29h is obtained from 9a, and interrupt processing activation signals 29i to 29k are output in response thereto, and one of the interrupt processing routines (1) 29d to (n) 29f is activated. When the processing is completed, polling of the interrupt processing request notification table 29b is started again.

【0023】次に、本実施例のスケジューリング動作に
ついて、図11のフロー図を用いて説明するまず、スケ
ジューリング実行部13が割込みの有無をチェックし
(ST111)、割込みが無い場合は実施例1同様の周
期的スケジューリングを行なう。割込みが有れば以下の
処理を行なう。割込み処理と周期的タスクの間のプライ
オリティが予め格納されたプライオリティ情報格納部3
0から、割込み処理と周期的タスクのプライオリティ情
報32を得てこれらを比較し(ST112)、割込み処
理のプライオリティが高ければ、割込み処理を実行し
(ST114)、割込みをクリアする(ST115)。
割込み処理のプライオリティが低ければ、割込みをペン
ディングし(ST113)、実施例1における通常の周
期的スケジューリングを行なう。ただし、この周期的ス
ケジューリングにおいて、実行タスクが無い場合(ST
124)、このタイムスロットを利用してペンディング
割込みの処理を行なう(ST125→ST126)。割
込み処理後は割込みをクリアする(ST127)。以上
の動作により、周期的スケジューリングと、エラー処理
等の非周期的に発生する割込み処理のプライオリティ制
御も可能となる。即ち、従来例や実施例1においては、
予めユーザにより指定されてタイムスロット管理テーブ
ル211に割付けられたタスクしか実行できないが、上
記のような割込み発生部28と割込み処理部29を付加
することで、非周期的に発生するエラー処理などを、そ
のプライオリティを予め高くしておくことにより、周期
的スケジューリングを一時中断して実行することができ
る。なお、本実施例では、図1の実施例1のものに上記
のような割込み処理機能を付加したものについて説明し
たが、図15の従来例のものに適用することも可能であ
る。
Next, the scheduling operation of the present embodiment will be described with reference to the flowchart of FIG. 11. First, the scheduling execution unit 13 checks whether or not there is an interrupt (ST111). Is performed. If there is an interrupt, the following processing is performed. Priority information storage unit 3 in which priorities between interrupt processing and periodic tasks are stored in advance
From 0, the priority information 32 of the interrupt process and the periodic task is obtained and compared (ST112). If the priority of the interrupt process is higher, the interrupt process is executed (ST114) and the interrupt is cleared (ST115).
If the priority of the interrupt processing is low, the interrupt is pending (ST113), and normal periodic scheduling in the first embodiment is performed. However, in this periodic scheduling, when there is no execution task (ST
124), a pending interrupt process is performed using this time slot (ST125 → ST126). After the interrupt processing, the interrupt is cleared (ST127). With the above operation, it is also possible to control the priority of the periodic scheduling and the non-periodic interrupt processing such as the error processing. That is, in the conventional example and the first embodiment,
Only the tasks specified by the user in advance and assigned to the timeslot management table 211 can be executed. However, by adding the interrupt generation unit 28 and the interrupt processing unit 29 as described above, error processing that occurs aperiodically can be performed. By setting the priority in advance, the periodic scheduling can be suspended and executed. In the present embodiment, an example in which the above-described interrupt processing function is added to that of the first embodiment of FIG. 1 has been described. However, the present embodiment can be applied to the conventional example of FIG.

【0024】実施例3.図13は実施例3の計算機シス
テムのスケジューリングに関する部分の構成図である。
本実施例は、図1の実施例1におけるS/Wタイマ1
4,タイムスロット計算部16及びタイムスロット情報
格納部18をハードウェアで構成したものである。即
ち、34は図1のS/Wタイマ14の代りとなるハード
ウェア(以下、H/Wと略記する)タイマで、計算機シ
ステムが元々有するものである。35は上記H/Wタイ
マ34からのクロック36に基づきタイムスロット時間
毎にスケジューリング実行部13に割込み37を発生す
る割込み発生器、38〜40は上記H/Wタイマ34か
らのクロック36に基づき各タイムスロット値1〜Nを
それぞれカウントするN個のカウンタで、これら割込み
発生器35及びカウンタ38〜40は図1のタイムスロ
ット計算部16の代りに設けられたものである。41は
上記各カウンタ38〜40の出力42により各タイムス
ロット値1〜Nに対応するビットがセットされ、上記割
込み発生器35からの割込み発生毎にスケジューリング
実行部13により現時刻のタイムスロット値43が読み
出されるタイムスロットレジスタで、これは図1のタイ
ムスロット情報格納部18の代りに設けられたものであ
る。
Embodiment 3 FIG. FIG. 13 is a configuration diagram of a part related to scheduling of the computer system according to the third embodiment.
This embodiment is different from the S / W timer 1 in the first embodiment shown in FIG.
4. The time slot calculation section 16 and the time slot information storage section 18 are configured by hardware. That is, reference numeral 34 denotes a hardware (hereinafter abbreviated as H / W) timer which is a substitute for the S / W timer 14 in FIG. 1, and is originally provided in the computer system. An interrupt generator 35 generates an interrupt 37 to the scheduling execution unit 13 at each time slot time based on the clock 36 from the H / W timer 34, and 38 to 40 generate respective interrupts based on the clock 36 from the H / W timer 34. The interrupt generator 35 and the counters 38 to 40 are provided in place of the time slot calculation unit 16 in FIG. Bits 41 corresponding to the respective time slot values 1 to N are set by the outputs 42 of the counters 38 to 40, and the scheduling execution unit 13 sets the current time slot value 43 by the scheduling execution unit 13 every time an interrupt is generated from the interrupt generator 35. Is a time slot register to be read out, and is provided in place of the time slot information storage section 18 in FIG.

【0025】次に、本実施例のスケジューリング動作に
ついて、図14のフロー図を用いて説明する。H/Wタ
イマ34のクロック36を用い、割込み発生器35はタ
イムスロット時間毎にスケジューリング実行部13に割
込み37を発生する。カウンタ(1)38からカウンタ
(N)40はH/Wタイマ34のクロック36を利用し
て、それぞれ定められたタイムスロット値1〜Nをカウ
ントし、最小基準周期毎にタイムスロットレジスタ41
の対応ビットをセットする。スケジューリング実行部1
3は、割込み発生器35からタイムスロット時間毎の割
込み37が入るとタイムスロットレジスタ41を見に行
き、セットされたビットからタイムスロット値43を得
る(ST141)。スケジューリング実行部13は、タ
イムスロット値を獲得後、タイムスロットレジスタ41
をリセットする。このタイムスロット値を用いて、実施
例1と同様のスケジューリング処理を行ない、H/Wタ
イマ割込みを待って(ST145)、次のタイムスロッ
ト値の獲得へ戻り、以上の動作を繰り返す。タイマにH
/Wタイマを用い、レジスタに自動的にタイムスロット
値をセットすることによって、システムにかかる負荷を
軽減し、処理速度の向上を実現できる。即ち、実施例1
では、オペレーティングシステムのS/Wタイマ機能を
用い、現在の時刻を獲得する処理,タイムスロットの計
算,スケジューリング実行部13へのタイムスロット変
更割込みの通知といった処理を全てソフトウエアで実現
している。この場合、タイムスロットの前回値の保持が
必要な上、オーバヘッド時間(図7のシステム時間)が
大きくなるという欠点がある。これに対し、本実施例の
ように、以上の機能を、H/Wタイマを用いて割込み発
生器,カウンタ及びレジスタなどのハードウェアで実現
した場合、タイムスロットの前回値保持が不要となる
上、オーバヘッドを低減でき、高速なスケジューリング
が可能となる。
Next, the scheduling operation of this embodiment will be described with reference to the flowchart of FIG. Using the clock 36 of the H / W timer 34, the interrupt generator 35 generates an interrupt 37 to the scheduling execution unit 13 for each time slot time. The counter (1) 38 to the counter (N) 40 use the clock 36 of the H / W timer 34 to count the time slot values 1 to N, respectively, determined.
Set the corresponding bit of. Scheduling execution unit 1
3 receives the interrupt 37 for each time slot from the interrupt generator 35, goes to the time slot register 41, and obtains the time slot value 43 from the set bits (ST141). The scheduling execution unit 13
After acquiring the time slot value, the time slot register 41
Reset. Using this time slot value, the same scheduling processing as in the first embodiment is performed, and after waiting for an H / W timer interrupt (ST145), the process returns to the acquisition of the next time slot value, and the above operation is repeated. H for timer
By automatically setting the time slot value in the register using the / W timer, the load on the system can be reduced and the processing speed can be improved. That is, the first embodiment
In this example, the processing of acquiring the current time, the calculation of the time slot, and the notification of the time slot change interrupt to the scheduling execution unit 13 are all realized by software using the S / W timer function of the operating system. In this case, the previous value of the time slot needs to be held, and the overhead time (the system time in FIG. 7) increases. On the other hand, when the above functions are realized by hardware such as an interrupt generator, a counter, and a register using an H / W timer as in the present embodiment, it is not necessary to hold the previous value of the time slot. , Overhead can be reduced, and high-speed scheduling can be performed.

【0026】[0026]

【発明の効果】以上のように、この発明の第1の発明に
よれば、固有の実行周期と実行時間を保有する複数のタ
スクを管理してスケジューリングする機能を有する計算
機システムにおいて、各タスクの実行周期を判別する実
行周期判別手段と、この実行周期判別手段の判別結果に
基づき、各タスクを実行周期の短い実行レベルから長い
実行レベルまでレベル分けする分類手段と、周期的にタ
スクの起動をチェックする際の基準となる最小基準周期
を所定値で割った時間単位であるタイムスロットに、上
記実行レベルを割当てるタイムスロット割当て手段と、
最小実行周期のタスクが分類された実行レベルの実行周
期が上記最小基準周期より短いか否かを判定する比較手
段と、この比較結果に基づき、予め設定された周期に従
って、各タイムスロットに上記実行レベルを割当てる周
期的スケジューリングモードと、全てのタイムスロット
に最小実行周期のタスクが分類された実行レベルを割当
てるプライオリティスケジューリングモードとを切換え
るスケジューリングモード切換手段と、現時刻に対応す
るタイムスロットに割当てられた実行レベルからタスク
スケジューリングを実行するスケジューリング実行手段
とを備え、上記比較手段で最小実行周期のタスクが分類
された実行レベルの実行周期が最小基準周期よりも短い
と判定されたとき、上記スケジューリングモード切換手
段は通常の周期的スケジューリングモードからプライオ
リティスケジューリングモードに切換え、これに基づき
上記タイムスロット割当て手段は、全てのタイムスロッ
トに最小実行周期のタスクが分類された実行レベルを割
当てるようにしたので、可能な限り周期的スケジューリ
ングを行うことでプロセッサへの負担を均等にするとと
もに、スケジューリング不可能な周期のタスクが存在す
る場合は、それを最優先で実行することになり、全ての
周期のタスクに対応したスケジューリングが可能になる
という効果が得られる。
As described above, according to the first aspect of the present invention, in a computer system having a function of managing and scheduling a plurality of tasks having a unique execution cycle and execution time, each An execution cycle determining means for determining an execution cycle; a classifying means for classifying each task from an execution level having a short execution cycle to a long execution level based on a result of the determination by the execution cycle determining means; Time slot allocating means for allocating the execution level to a time slot which is a time unit obtained by dividing a minimum reference period serving as a reference when checking by a predetermined value;
Comparing means for determining whether or not the execution cycle of the execution level in which the tasks of the minimum execution cycle are classified is shorter than the minimum reference cycle; and, based on the comparison result, according to a preset cycle.
A scheduling mode switching means for switching between a periodic scheduling mode for assigning the execution level to each time slot and a priority scheduling mode for assigning an execution level in which tasks having the minimum execution cycle are classified to all time slots; Scheduling execution means for executing task scheduling from the execution level assigned to the time slot corresponding to the time slot, wherein the execution cycle of the execution level in which the task of the minimum execution cycle is classified by the comparison means is shorter than the minimum reference cycle. When the determination is made, the scheduling mode switching means switches from the normal periodic scheduling mode to the priority scheduling mode, and based on this, the time slot allocating means sets the minimum execution cycle to all time slots. Tasks are assigned to categorized execution levels.Periodic scheduling is performed as much as possible to equalize the load on the processor, and if there is a task with a non-schedulable cycle, it is minimized. Since the execution is performed with priority, it is possible to obtain an effect that scheduling corresponding to tasks in all cycles can be performed.

【0027】また、第2の発明によれば、各タスクの実
行周期を判別する実行周期判別手段と、この実行周期判
別手段の判別結果に基づき、各タスクを実行周期の短い
実行レベルから長い実行レベルまでレベル分けする分類
手段と、周期的にタスクの起動をチェックする際の基準
となる最小基準周期を所定値で割った時間単位であるタ
イムスロットに、上記実行レベルを割当てるタイムスロ
ット割当て手段と、現時刻に対応するタイムスロットに
割当てられた実行レベルからタスクスケジューリングを
実行するスケジューリング実行手段とを備えるととも
に、エラー発生等の非周期的イベントの発生を上記スケ
ジューリング実行手段に割込みで通知する割込み発生手
段と、上記割込み発生時の処理を行なう割込み処理手段
とを備え、上記スケジューリング実行手段は、上記割込
み発生時、予め定められた上記周期的タスクと割込み処
理のプライオリティに基づき割込み処理が周期的タスク
よりプライオリティが高い時は、上記周期的タスクの実
行を一時中断して上記割込み処理手段に割込み処理を実
行させるようにしたので、周期的スケジューリングと、
エラー処理等の非周期的に発生する割込み処理のプライ
オリティ制御が可能となる効果が得られる。
According to the second aspect of the present invention, the execution cycle determining means for determining the execution cycle of each task, and each task is executed from a short execution level to a long execution level based on the determination result of the execution cycle determining means. Classifying means for classifying levels into levels, and time slot allocating means for allocating the execution level to a time slot which is a time unit obtained by dividing a minimum reference cycle, which is a reference when periodically checking task activation, by a predetermined value. Scheduling execution means for executing task scheduling from the execution level assigned to the time slot corresponding to the current time, and generating an interrupt to notify the scheduling execution means of the occurrence of an aperiodic event such as an error by interruption. Means, and interrupt processing means for performing processing when the interrupt occurs. When the interrupt occurs, when the interrupt processing has a higher priority than the periodic task based on the predetermined priority of the periodic task and the interrupt processing, the execution of the periodic task is temporarily suspended, and Since the interrupt processing means is made to execute the interrupt processing, periodic scheduling,
An effect is obtained in which priority control of interrupt processing that occurs aperiodically, such as error processing, can be performed.

【0028】一方、第3の発明によれば、上記第1の発
明同様に、各タスクの実行周期を判別する実行周期判別
手段と、この実行周期判別手段の判別結果に基づき、各
タスクを実行周期の短い実行レベルから長い実行レベル
までレベル分けする分類手段と、周期的にタスクの起動
をチェックする際の基準となる最小基準周期を所定値で
割った時間単位であるタイムスロットに、上記実行レベ
ルを割当てるタイムスロット割当て手段と、最小実行周
期のタスクが分類された実行レベルの実行周期が上記最
小基準周期より短いか否かを判定する比較手段と、この
比較結果に基づき、予め設定された周期に従って、各タ
イムスロットに上記実行レベルを割当てる周期的スケジ
ューリングモードと、全てのタイムスロットに最小実行
周期のタスクが分類された実行レベルを割当てるプライ
オリティスケジューリングモードとを切換えるスケジュ
ーリングモード切換手段と、現時刻に対応するタイムス
ロットに割当てられた実行レベルからタスクスケジュー
リングを実行するスケジューリング実行手段とを備える
とともに、ハードウェアタイマからのクロックに基づき
タイムスロット時間毎に上記スケジューリング実行手段
に割込みを発生する割込み発生器と、ハードウェアタイ
マからのクロックに基づき各タイムスロット値をカウン
トするカウンタと、上記カウンタによりタイムスロット
値がセットされ、上記割込み発生器からの割込み発生毎
に上記スケジューリング実行手段により現時刻のタイム
スロット値が読み出されるレジスタとを備え、上記比較
手段で最小実行周期のタスクが分類された実行レベルの
実行周期が最小基準周期よりも短いと判定されたとき、
上記スケジューリングモード切換手段は通常の周期的ス
ケジューリングモードからプライオリティスケジューリ
ングモードに切換え、これに基づき上記タイムスロット
割当て手段は、全てのタイムスロットに最小実行周期の
タスクが分類された実行レベルを割当てるようにしたの
で、上記第1の発明と同様な効果が得られるとともに、
タイマにH/Wタイマを用い、レジスタに自動的にタイ
ムスロット値をセットすることによって、システムにか
かる負荷を軽減し、処理速度の向上を実現できる効果が
得られる。
On the other hand, according to the third invention, similarly to the first invention, the execution cycle determining means for determining the execution cycle of each task, and each task is executed based on the determination result of the execution cycle determining means. A classifying means for classifying the execution level from a short execution level to a long execution level; and a time slot which is a time unit obtained by dividing a minimum reference cycle, which is a reference for periodically checking task activation, by a predetermined value. A time slot allocating means for allocating a level, a comparing means for determining whether or not the execution cycle of the execution level in which the task of the minimum execution cycle is classified is shorter than the minimum reference cycle, and a predetermined setting based on the comparison result . According to the cycle,
A scheduling mode switching means for switching between a periodic scheduling mode for assigning the execution level to the time slot, a priority scheduling mode for assigning an execution level in which the tasks having the minimum execution cycle are classified to all the time slots, and a time corresponding to the current time. A scheduling execution means for executing task scheduling from an execution level assigned to a slot, and an interrupt generator for generating an interrupt to the scheduling execution means for each time slot time based on a clock from a hardware timer; A counter for counting each time slot value based on a clock from a timer; and a time slot value set by the counter. The scheduler is set every time an interrupt is generated from the interrupt generator. And a register for time slot value at the present time is read by the packaging executing means, when the execution cycle of the execution level minimum execution cycle of the task is classified by the comparison means it determines that less than a minimum reference period,
The scheduling mode switching means switches from a normal periodic scheduling mode to a priority scheduling mode, and based on this, the time slot allocating means allocates an execution level in which a task having a minimum execution cycle is classified to all time slots. Therefore, the same effects as those of the first invention can be obtained, and
By using the H / W timer as the timer and automatically setting the time slot value in the register, the load on the system can be reduced and the processing speed can be improved.

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

【図1】この発明の実施例1による計算機システムのス
ケジューリングに関する部分の構成図である。
FIG. 1 is a configuration diagram of a part related to scheduling of a computer system according to a first embodiment of the present invention.

【図2】図1のスケジューリングモード選択部の内部構
成を示す機能ブロック図である。
FIG. 2 is a functional block diagram illustrating an internal configuration of a scheduling mode selection unit in FIG. 1;

【図3】図1のスケジューリングモード選択部とタイム
スロット割当て部の動作を示すフロー図である。
FIG. 3 is a flowchart showing operations of a scheduling mode selecting unit and a time slot allocating unit of FIG. 1;

【図4】図3の続きを示すフロー図である。FIG. 4 is a flowchart showing a continuation of FIG. 3;

【図5】プライオリティスケジューリング時のタイムス
ロット対応タスク情報テーブル内の詳細図である。
FIG. 5 is a detailed diagram in a time slot corresponding task information table at the time of priority scheduling.

【図6】プライオリティスケジューリング時のスケジュ
ーリング実行部の動作を示すフロー図である。
FIG. 6 is a flowchart showing an operation of a scheduling execution unit at the time of priority scheduling.

【図7】プライオリティスケジューリング時のタスクの
実行状態を示す図である。
FIG. 7 illustrates an execution state of a task at the time of priority scheduling.

【図8】この発明の実施例2による計算機システムのス
ケジューリングに関する部分の構成図である。
FIG. 8 is a configuration diagram of a part related to scheduling of a computer system according to a second embodiment of the present invention.

【図9】図8の割込み発生部の内部構成図である。9 is an internal configuration diagram of the interrupt generation unit of FIG.

【図10】図8の割込み処理部の内部構成図である。FIG. 10 is an internal configuration diagram of an interrupt processing unit in FIG. 8;

【図11】図8のスケジューリング動作を示すフロー図
である。
FIG. 11 is a flowchart showing the scheduling operation of FIG. 8;

【図12】図11の続きを示すフロー図である。FIG. 12 is a flowchart showing a continuation of FIG. 11;

【図13】この発明の実施例3による計算機システムの
スケジューリングに関する部分の構成図である。
FIG. 13 is a configuration diagram of a part related to scheduling of a computer system according to Embodiment 3 of the present invention.

【図14】図13のスケジューリング動作を示すフロー
図である。
FIG. 14 is a flowchart showing the scheduling operation of FIG.

【図15】従来の計算機システムのスケジューリングに
関する部分の構成図である。
FIG. 15 is a configuration diagram of a portion related to scheduling of a conventional computer system.

【図16】スケジューリング時のタスクの実行状態を示
す図である。
FIG. 16 is a diagram illustrating an execution state of a task at the time of scheduling.

【図17】タイムスロット割当て部の内部構成を示す機
能ブロック図である。
FIG. 17 is a functional block diagram showing an internal configuration of a time slot assignment unit.

【図18】タイムスロット対応タスク情報テーブル内の
詳細図である。
FIG. 18 is a detailed diagram in a time slot corresponding task information table.

【図19】図15のタイムスロット割当て部の動作を示
すフロー図である。
FIG. 19 is a flowchart showing the operation of the time slot allocator in FIG. 15;

【図20】図19の続きを示すフロー図である。FIG. 20 is a flowchart showing a continuation of FIG. 19;

【図21】スケジューリング実行部の動作を示すフロー
図である。
FIG. 21 is a flowchart showing the operation of the scheduling execution unit.

【図22】実行レベルのチェックの順番を示す図であ
る。
FIG. 22 is a diagram showing the order of checking the execution level.

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

11 タイムスロット割当て部 11a 実行周期判別手段 11b 分類手段 11c タイムスロット割当て手段 12 タスク情報 13 スケジューリング実行部(スケジューリング実行
手段) 14 S/Wタイマ 15 定周期割込み 16 タイムスロット計算部 17 タイムスロット変更割込み 18 タイムスロット情報格納部 19 タイムスロット値(変更値) 20 タイムスロット値(現在値) 21 タイムスロット対応タスク情報テーブル 22 テーブル情報(現在値) 23 テーブル情報(変更値) 24 起動タスクキューイング部 25 起動要求タスク 26 スケジューリングモード選択部 26a 実行周期判別手段 26b 分類手段 26c 比較手段 26d スケジューリングモード切換手段 27 スケジューリングモード信号 28 割込み発生部(割込み発生手段) 29 割込み処理部(割込み処理手段) 30 プライオリティ情報格納部 31 割込み(割込み種類を含む) 32 プライオリティ情報 33 割込み処理要求(割込み種類を含む) 34 H/Wタイマ 35 割込み発生器 36 クロック 37 割込み 38〜40 カウンタ 41 タイムスロットレジスタ 42 カウンタ出力 43 タイムスロット値 211 タイムスロット管理テーブル 212a〜212c レベル管理テーブル 213a1〜213an,213b1,213c1,2
13c2 タスク管理テーブル
Reference Signs List 11 time slot allocating unit 11a execution period discriminating unit 11b classifying unit 11c time slot allocating unit 12 task information 13 scheduling executing unit (scheduling executing unit) 14 S / W timer 15 fixed period interrupt 16 time slot calculating unit 17 time slot change interrupt 18 Time slot information storage unit 19 Time slot value (changed value) 20 Time slot value (current value) 21 Time slot corresponding task information table 22 Table information (current value) 23 Table information (changed value) 24 Activation task queuing unit 25 Activation Requested task 26 Scheduling mode selection unit 26a Execution cycle determination unit 26b Classification unit 26c Comparison unit 26d Scheduling mode switching unit 27 Scheduling mode signal 28 Interrupt generation unit (Interrupt generating means) 29 Interrupt processing unit (interrupt processing means) 30 Priority information storage unit 31 Interrupt (including interrupt type) 32 Priority information 33 Interrupt processing request (including interrupt type) 34 H / W timer 35 Interrupt generator 36 Clock 37 Interrupt 38 to 40 Counter 41 Time slot register 42 Counter output 43 Time slot value 211 Time slot management table 212a to 212c Level management table 213a1 to 213an, 213b1, 213c1,
13c2 Task management table

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 固有の実行周期と実行時間を保有する複
数のタスクを管理してスケジューリングする機能を有す
る計算機システムにおいて、各タスクの実行周期を判別
する実行周期判別手段と、この実行周期判別手段の判別
結果に基づき、各タスクを実行周期の短い実行レベルか
ら長い実行レベルまでレベル分けする分類手段と、周期
的にタスクの起動をチェックする際の基準となる最小基
準周期を所定値で割った時間単位であるタイムスロット
に、上記実行レベルを割当てるタイムスロット割当て手
段と、最小実行周期のタスクが分類された実行レベルの
実行周期が上記最小基準周期より短いか否かを判定する
比較手段と、この比較結果に基づき、予め設定された周
期に従って、各タイムスロットに上記実行レベルを割当
てる周期的スケジューリングモードと、全てのタイムス
ロットに最小実行周期のタスクが分類された実行レベル
を割当てるプライオリティスケジューリングモードとを
切換えるスケジューリングモード切換手段と、現時刻に
対応するタイムスロットに割当てられた実行レベルから
タスクスケジューリングを実行するスケジューリング実
行手段とを備え、上記比較手段で最小実行周期のタスク
が分類された実行レベルの実行周期が最小基準周期より
も短いと判定されたとき、上記スケジューリングモード
切換手段は通常の周期的スケジューリングモードからプ
ライオリティスケジューリングモードに切換え、これに
基づき上記タイムスロット割当て手段は、全てのタイム
スロットに最小実行周期のタスクが分類された実行レベ
ルを割当てることを特徴とする計算機システム。
1. A computer system having a function of managing and scheduling a plurality of tasks each having a unique execution cycle and execution time, an execution cycle determination means for determining an execution cycle of each task, and an execution cycle determination means Based on the determination result, a classifying means for classifying each task from an execution level having a short execution cycle to a long execution level, and a minimum reference cycle serving as a criterion for periodically checking task activation is divided by a predetermined value. Time slot allocating means for allocating the execution level to a time slot which is a unit of time; and comparing means for determining whether or not the execution cycle of the execution level in which the task of the minimum execution cycle is classified is shorter than the minimum reference cycle. Based on the result of this comparison, a preset
A scheduling mode switching means for switching between a periodic scheduling mode for assigning the execution level to each time slot according to a period, and a priority scheduling mode for assigning an execution level in which tasks of the minimum execution cycle are classified to all time slots; Scheduling execution means for executing task scheduling from the execution level assigned to the time slot corresponding to the time slot, wherein the execution cycle of the execution level in which the task of the minimum execution cycle is classified by the comparison means is shorter than the minimum reference cycle. When it is determined, the scheduling mode switching means switches from the normal periodic scheduling mode to the priority scheduling mode, and based on this, the time slot allocating means sets the minimum real time for all the time slots. Computer system and wherein the assigning the execution level period of the task is classified.
【請求項2】 固有の実行周期と実行時間を保有する複
数のタスクを管理してスケジューリングする機能を有す
る計算機システムにおいて、各タスクの実行周期を判別
する実行周期判別手段と、この実行周期判別手段の判別
結果に基づき、各タスクを実行周期の短い実行レベルか
ら長い実行レベルまでレベル分けする分類手段と、周期
的にタスクの起動をチェックする際の基準となる最小基
準周期を所定値で割った時間単位であるタイムスロット
に、上記実行レベルを割当てるタイムスロット割当て手
段と、現時刻に対応するタイムスロットに割当てられた
実行レベルからタスクスケジューリングを実行するスケ
ジューリング実行手段と、エラー発生等の非周期的イベ
ントの発生を上記スケジューリング実行手段に割込みで
通知する割込み発生手段と、上記割込み発生時の処理を
行なう割込み処理手段とを備え、上記スケジューリング
実行手段は、上記割込み発生時、予め定められた上記周
期的タスクと割込み処理の優先度に基づき割込み処理が
周期的タスクより優先度が高い時は、上記周期的タスク
の実行を一時中断して上記割込み処理手段に割込み処理
を実行させることを特徴とする計算機システム。
2. A computer system having a function of managing and scheduling a plurality of tasks each having a unique execution cycle and execution time, an execution cycle discrimination means for discriminating an execution cycle of each task, and an execution cycle discrimination means. Based on the determination result, a classifying means for classifying each task from an execution level having a short execution cycle to a long execution level, and a minimum reference cycle serving as a criterion for periodically checking task activation is divided by a predetermined value. Time slot allocating means for allocating the execution level to a time slot which is a unit of time; scheduling executing means for performing task scheduling from the execution level allocated to the time slot corresponding to the current time; An interrupt occurrence that notifies the above scheduling execution means of the occurrence of an event by an interrupt Means; and interrupt processing means for performing processing when the interrupt occurs. The scheduling execution means periodically performs the interrupt processing based on the predetermined periodic task and the priority of the interrupt processing when the interrupt occurs. A computer system wherein when the priority is higher than the task, the execution of the periodic task is temporarily interrupted and the interrupt processing means executes the interrupt processing.
【請求項3】 固有の実行周期と実行時間を保有する複
数のタスクを管理してスケジューリングする機能を有す
る計算機システムにおいて、各タスクの実行周期を判別
する実行周期判別手段と、この実行周期判別手段の判別
結果に基づき、各タスクを実行周期の短い実行レベルか
ら長い実行レベルまでレベル分けする分類手段と、周期
的にタスクの起動をチェックする際の基準となる最小基
準周期を所定値で割った時間単位であるタイムスロット
に、上記実行レベルを割当てるタイムスロット割当て手
段と、最小実行周期のタスクが分類された実行レベルの
実行周期が上記最小基準周期より短いか否かを判定する
比較手段と、この比較結果に基づき、予め設定された周
期に従って、各タイムスロットに上記各実行レベルを割
当てる周期的スケジューリングモードと、全てのタイム
スロットに最小実行周期のタスクが分類された実行レベ
ルを割当てるプライオリティスケジューリングモードと
を切換えるスケジューリングモード切換手段と、現時刻
に対応するタイムスロットに割当てられた実行レベルか
らタスクスケジューリングを実行するスケジューリング
実行手段と、ハードウェアタイマからのクロックに基づ
きタイムスロット時間毎に上記スケジューリング実行手
段に割込みを発生する割込み発生器と、ハードウェアタ
イマからのクロックに基づき各タイムスロット値をカウ
ントするカウンタと、上記カウンタによりタイムスロッ
ト値がセットされ、上記割込み発生器からの割込み発生
毎に上記スケジューリング実行手段により現時刻のタイ
ムスロット値が読み出されるレジスタとを備え、上記比
較手段で最小実行周期のタスクが分類された実行レベル
の実行周期が最小基準周期よりも短いと判定されたと
き、上記スケジューリングモード切換手段は通常の周期
的スケジューリングモードからプライオリティスケジュ
ーリングモードに切換え、これに基づき上記タイムスロ
ット割当て手段は、全てのタイムスロットに最小実行周
期のタスクが分類された実行レベルを割当てることを特
徴とする計算機システム。
3. A computer system having a function of managing and scheduling a plurality of tasks each having a unique execution cycle and execution time, an execution cycle determination means for determining an execution cycle of each task, and an execution cycle determination means. Based on the determination result, a classifying means for classifying each task from an execution level having a short execution cycle to a long execution level, and a minimum reference cycle serving as a criterion for periodically checking task activation is divided by a predetermined value. Time slot allocating means for allocating the execution level to a time slot which is a unit of time; and comparing means for determining whether or not the execution cycle of the execution level in which the task of the minimum execution cycle is classified is shorter than the minimum reference cycle. Based on the result of this comparison, a preset
Scheduling mode switching means for switching between a periodic scheduling mode for assigning each execution level to each time slot according to a period, and a priority scheduling mode for assigning an execution level in which tasks of the minimum execution cycle are classified to all time slots. Scheduling execution means for executing task scheduling from an execution level assigned to a time slot corresponding to time; an interrupt generator for generating an interrupt to the scheduling execution means for each time slot time based on a clock from a hardware timer; A counter that counts each time slot value based on a clock from a hardware timer; and a time slot value is set by the counter, and the schedule is set every time an interrupt is generated from the interrupt generator. A register from which the time slot value at the current time is read by the ring executing means, and when the comparing means determines that the execution cycle of the execution level at which the task of the minimum execution cycle is classified is shorter than the minimum reference cycle, The scheduling mode switching means switches from a normal periodic scheduling mode to a priority scheduling mode, and based on this, the time slot allocating means allocates an execution level in which a task having a minimum execution cycle is classified to all time slots. Computer system.
JP32744992A 1992-11-12 1992-11-12 Computer system Expired - Lifetime JP2760721B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32744992A JP2760721B2 (en) 1992-11-12 1992-11-12 Computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32744992A JP2760721B2 (en) 1992-11-12 1992-11-12 Computer system

Publications (2)

Publication Number Publication Date
JPH06149599A JPH06149599A (en) 1994-05-27
JP2760721B2 true JP2760721B2 (en) 1998-06-04

Family

ID=18199289

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32744992A Expired - Lifetime JP2760721B2 (en) 1992-11-12 1992-11-12 Computer system

Country Status (1)

Country Link
JP (1) JP2760721B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2732788B1 (en) * 1995-04-06 1997-05-30 Bull Sa DEVICE FOR MANAGING SELECTIVE CYCLIC CALLS FOR MONITORING COMPUTER RESOURCES IN A NETWORK AND METHOD IMPLEMENTED BY SUCH A DEVICE
JP3813930B2 (en) 2002-01-09 2006-08-23 松下電器産業株式会社 Processor and program execution method
JP4750350B2 (en) 2003-03-13 2011-08-17 パナソニック株式会社 Task switching device, method and program
JP2006146789A (en) * 2004-11-24 2006-06-08 Denso Corp Electronic controller, its control method, and program
WO2008105051A1 (en) * 2007-02-26 2008-09-04 Toshiba Mitsubishi-Electric Industrial Systems Corporation Scheduler
JP5171536B2 (en) * 2008-10-15 2013-03-27 京セラドキュメントソリューションズ株式会社 Electronics
JP4857325B2 (en) * 2008-10-31 2012-01-18 パナソニック株式会社 Task switching device, method and program
JP6065730B2 (en) * 2013-04-22 2017-01-25 株式会社デンソー Information processing apparatus and program

Also Published As

Publication number Publication date
JPH06149599A (en) 1994-05-27

Similar Documents

Publication Publication Date Title
US6986140B2 (en) Method for determining idle processor load balancing in a multiple processors system
US6735769B1 (en) Apparatus and method for initial load balancing in a multiple run queue system
Ramos-Thuel et al. On-line scheduling of hard deadline aperiodic tasks in fixed-priority systems
Carpenter et al. A Categorization of Real-Time Multiprocessor Scheduling Problems and Algorithms.
US20050210472A1 (en) Method and data processing system for per-chip thread queuing in a multi-processor system
US6430594B1 (en) Real-time operating system and a task management system therefor
EP0488501A2 (en) Scheduling input/output operations in multitasking systems
US6560628B1 (en) Apparatus, method, and recording medium for scheduling execution using time slot data
US6993762B1 (en) Process for improving the performance of a multiprocessor system comprising a job queue and system architecture for implementing the process
US5379427A (en) Task tracing apparatus in a multitask operating system
EP0598231A2 (en) Method and apparatus for dynamic work reassignment among asymmetric, coupled processors
US20040181791A1 (en) Task switching apparatus, method and program
JP2003256221A (en) Parallel process executing method and multi-processor type computer
JPWO2002069174A1 (en) Parallel process execution method and multiprocessor computer
JP2760721B2 (en) Computer system
KR100791296B1 (en) Apparatus and method for providing cooperative scheduling on multi-core system
US20030110203A1 (en) Apparatus and method for dispatching fixed priority threads using a global run queue in a multiple run queue system
JP2000056992A (en) Task scheduling system, its method and recording medium
Horowitz A run-time execution model for referential integrity maintenance
JPH1027167A (en) Method for distributing load of parallel computer
JPH02242434A (en) Task scheduling method
JP5243822B2 (en) Workload management in a virtualized data processing environment
JP2716019B2 (en) Job class determination method
JP2667575B2 (en) Task scheduling method
JP2924725B2 (en) Buffer allocation control system

Legal Events

Date Code Title Description
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080320

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090320

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100320

Year of fee payment: 12

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100320

Year of fee payment: 12

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110320

Year of fee payment: 13

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 13

Free format text: PAYMENT UNTIL: 20110320

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 14

Free format text: PAYMENT UNTIL: 20120320

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130320

Year of fee payment: 15

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130320

Year of fee payment: 15