JP2000172514A - Task management device and task scheduling method - Google Patents

Task management device and task scheduling method

Info

Publication number
JP2000172514A
JP2000172514A JP10347304A JP34730498A JP2000172514A JP 2000172514 A JP2000172514 A JP 2000172514A JP 10347304 A JP10347304 A JP 10347304A JP 34730498 A JP34730498 A JP 34730498A JP 2000172514 A JP2000172514 A JP 2000172514A
Authority
JP
Japan
Prior art keywords
task
time
priority
group
sharing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP10347304A
Other languages
Japanese (ja)
Other versions
JP3005562B1 (en
Inventor
Izumi Tanaka
泉 田中
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 IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems Co Ltd
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 IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP34730498A priority Critical patent/JP3005562B1/en
Application granted granted Critical
Publication of JP3005562B1 publication Critical patent/JP3005562B1/en
Publication of JP2000172514A publication Critical patent/JP2000172514A/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To allow a low priority task to have the processing opportunity of preset time while keeping a real time property for the task of high priority by switching a ready state and a wait state only for the task of priority specified in a time sharing priority range. SOLUTION: A data processor operated by program control and a storage device for storing information are provided for the management device. The storage device is provided with a ready queue 20 for storing the information of an executable task for each priority, a time sharing wait queue 40, the time sharing priority range 41 and a time sharing time table 43, etc. The data processor is provided with a means 10 for switching an execution task, a task group switching means 30 and a switching time detection means 31. Then, relating to this device, only for the task of the priority specified in the time sharing priority range 41, the task group switching means 30 switches the ready state and the wait state.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、タスクのスケジュ
ール管理技術に関し、特に、リアルタイムOSで使用さ
れる優先度スケジューリングを実行するタスク管理装置
及びタスクスケジューリング方法に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a task schedule management technique, and more particularly to a task management apparatus and a task scheduling method for executing priority scheduling used in a real-time OS.

【0002】[0002]

【従来の技術】従来、組み込みマイクロコンピュータの
応用製品において、システムの大規模化、複合化が進む
中、リアルタイムOSが採用されるようになった。リア
ルタイムOSの多くは、タスク管理装置及びタスクスケ
ジューリング方法により、タスクのスケジュール管理が
行われている。
2. Description of the Related Art Conventionally, a real-time OS has been adopted in an application product of an embedded microcomputer as a system is being scaled up and integrated. In many real-time OSs, task schedule management is performed by a task management device and a task scheduling method.

【0003】従来技術のタスク管理装置及びタスクスケ
ジューリング方法では、タスクの優先度割り付け設計が
重要であり、一般的には、ハード的制約などで急ぐタス
クほど優先度を高くし、急がないタスクは優先度を低く
設定する。システムの実現性を検討する場合、時間的制
約がクリアできるかどうかは、すべてのモジュールの高
優先度タスクについて、優先度、処理時間の検討と調整
が必ず必要である。しかし、低優先度タスクの優先度、
処理時間については、すべてのモジュール間で調整を行
うことは生産性を低下させ、また、再利用時にモジュー
ルの組み合わせが変わるたびにすべてのタスク間で再調
整が必要になるためあまり行われていない。
In prior art task management apparatuses and task scheduling methods, it is important to design priority assignment of tasks. In general, tasks that are urgent due to hardware constraints have higher priorities, and tasks that are not urgent have a higher priority. Set a low priority. When considering the feasibility of the system, it is necessary to consider and adjust the priority and processing time for the high-priority tasks of all modules to determine whether the time constraint can be cleared. However, the priority of low priority tasks,
Coordinating processing time between all modules reduces productivity, and less time is required because re-adjustment must be performed between all tasks every time a combination of modules changes during reuse. .

【0004】まず、従来使用されているタスクスケジュ
ーリング方法について説明する。図9は、従来のタスク
管理装置を説明するためのブロック図である。図9に示
すように、この従来の優先度スケジューリング方法は、
実行タスク切り替え手段(実行タスク決定手段)10
と、実行可能なタスクの情報を優先度毎に記憶するレデ
ィキュー20から構成されている。
First, a conventionally used task scheduling method will be described. FIG. 9 is a block diagram for explaining a conventional task management device. As shown in FIG. 9, the conventional priority scheduling method includes:
Execution task switching means (execution task determination means) 10
And a ready queue 20 for storing information on executable tasks for each priority.

【0005】図10に示すレディキュー20の状態にお
ける、タスクの実行順序について説明する。図10は、
図9のタスク管理装置で実行されるタスクの実行順序を
説明するためのレディキューの状態を示している。図1
0に示すように、実行タスク切り替え手段10によって
選択される実行タスクは優先度3のタスク1Aである。
タスク1Aが終了した場合、優先度4にタスク1B、タ
スク1C、タスク2Aが実行可能となった順番に並んで
いるので、データ処理装置はタスク1Bを選択してこれ
を実行する。以降、実行されるタスクの順番は、タスク
1C→タスク2A→タスク2B→タスク2Cという順番
になる。
[0005] The execution order of the tasks in the state of the ready queue 20 shown in FIG. 10 will be described. FIG.
10 illustrates a state of a ready queue for explaining an execution order of tasks executed by the task management device of FIG. 9; FIG.
As indicated by 0, the execution task selected by the execution task switching means 10 is the task 1A having the priority 3.
When the task 1A is completed, the task 1B, the task 1C, and the task 2A are arranged in the priority 4 in the order in which the tasks can be executed. Therefore, the data processing device selects the task 1B and executes it. Thereafter, the order of tasks to be executed is task 1C → task 2A → task 2B → task 2C.

【0006】次に、優先度スケジューリング方法以外の
タスクスケジューリング方法について説明する。大型コ
ンピュータなどで発展してきたタイムシェアリングによ
るタスクスケジューリング方法の一例が、特開平9−1
98261号公報に記載されている。すなわち、従来技
術は、タスクのCPUに対するスケジュール優先度とは
別に、周辺入出力装置に対する処理優先度をタスク毎に
設定する手段を持つことにより、リアルタイム性が要求
されるタスクを優先的に処理できるようにしたものであ
って、タスクのCPUに対するスケジューリング優先度
とは無関係に、周辺入出力装置に対する入出力処理待ち
キュー上の処理優先度をオペレーティングシステムから
タスク毎に設定する手段、周辺入出力機器に対する入出
力完了時のタスクスケジューリングの優先度を前記オペ
レーティングシステムから設定する手段を有し、入出力
処理待ちキュー上の処理優先度をリアルタイム性を要求
されず、かつバックグラウンドで行う処理でもない一般
のタスクの間で差をつけて設定することが記載されてい
る。これにより、リアルタイム性の要求されるタスクは
周辺装置への出力処理も含めて他のタスクより優先的に
処理されるため、リアルタイム性がより上がり、また、
バッチ処理をバックグラウンドで実行するタスクは、周
辺装置への入出力も含めて他のタスクにあまり性能的な
影響を与えないで処理できるという効果があることが記
載されている。
Next, a task scheduling method other than the priority scheduling method will be described. An example of a task scheduling method based on time sharing that has been developed in large computers and the like is disclosed in Japanese Patent Laid-Open No. 9-1.
98261. In other words, the prior art has a means for setting the processing priority of the peripheral input / output device for each task separately from the schedule priority of the task for the CPU, so that the task requiring real-time processing can be processed preferentially. Means for setting, from an operating system, a processing priority on an input / output processing wait queue for a peripheral input / output device for each task, irrespective of the scheduling priority of the task with respect to the CPU; Means for setting the priority of task scheduling at the time of completion of input / output from the operating system from the operating system, and the processing priority on the input / output processing wait queue does not require real-time processing and is not processing performed in the background. It is described that setting is made differently between tasks . As a result, tasks requiring real-time properties are processed with priority over other tasks, including output processing to peripheral devices, so real-time properties are further improved.
It describes that a task that executes batch processing in the background has an effect that it can be processed without significantly affecting the performance of other tasks, including input and output to peripheral devices.

【0007】[0007]

【発明が解決しようとする課題】しかしながら、従来技
術には以下に掲げる問題点があった。
However, the prior art has the following problems.

【0008】第1の問題点は、タスクスケジューリング
方法では、独立に設計されたモジュールを組み合わせた
場合に、他モジュールのタスクの影響を受け、自モジュ
ールのタスクが思うように動かない場合があるというこ
とである。その理由は、ある優先度で先に実行可能状態
になったタスクの処理時間が長い場合、後から実行可能
状態になった同じ優先度のタスクは、先のタスクが完了
しないと、いつまでたっても処理が行われないためであ
る。
The first problem is that, in the task scheduling method, when independently designed modules are combined, the task of the own module may not behave as expected due to the influence of the task of another module. That is. The reason for this is that if a task that was previously executable at a certain priority takes a long time to process, then a task of the same priority that becomes executable at a later time will last until the previous task is completed. This is because no processing is performed.

【0009】第2の問題点は、タイムシェアリングタス
クスケジューリング方法では、ハードなリアルタイム性
が要求される処理が間に合わないということである。そ
の理由は、一定時間毎にタスクを切り替えるため、タス
クの途中で発生したイベントに対して対応できるのは、
一定時間経過後となる。リアルタイム性を上げる目的
で、一定時間を短くすると、タスク切り替え時間のオー
バーヘッドが大きくなるため、組み込み用途には向かな
い。
A second problem is that in the time sharing task scheduling method, processing that requires hard real-time processing cannot be performed in time. The reason is that the task is switched at regular intervals, so it is possible to respond to events that occur during the task,
After a certain period of time. If the fixed time is shortened for the purpose of improving the real-time property, the overhead of the task switching time increases, which is not suitable for embedded use.

【0010】本発明は斯かる問題点を鑑みてなされたも
のであり、その目的とするところは、リアルタイムOS
で使用される優先度スケジューリングにおいて、ある限
定された範囲の優先度のタスクのレディ状態とウェイト
状態とを指定された時間で入れ替えるタスク管理装置及
びタスクスケジューリング方法を提供する点にある。
[0010] The present invention has been made in view of such a problem, and an object thereof is to provide a real-time OS.
The present invention is to provide a task management device and a task scheduling method for exchanging a ready state and a wait state of a task having a limited range of priority at a designated time in the priority scheduling used in the above.

【0011】[0011]

【課題を解決するための手段】本発明の請求項1に記載
の要旨は、優先度スケジューリングを実行するタスク管
理装置であって、優先度スケジューリングの実行の際、
所定範囲の優先度のタスクのレディ状態とウェイト状態
とを指定された時間に基づいて入れ替える機能を有する
データ処理装置と情報を記憶する記憶装置とを有し、前
記記憶装置は、実行可能なタスクの情報を優先度毎に記
憶するレディキューと、当該レディキューの一部分の情
報を記憶するタイムシェアリングウェイトキューと、タ
イムシェアリングを行う優先度の上位及び下位を記憶す
るタイムシェアリング優先度範囲と、実行中のタスクグ
ループ番号を記憶するアクティブタスクグループと、タ
スクグループ毎の処理時間情報を記憶するタイムシェア
リング時間テーブルとを備え、前記データ処理装置は、
前記レディキューに記憶されている実行可能なタスクの
中から優先度の最も高いタスクを選択して実行する実行
タスク切り替え手段と、前記タイムシェアリング優先度
範囲で指定された範囲のタスクを前記レディキューから
前記タイムシェアリングウェイトキューへ待避させると
ともに、前記タイムシェアリングウェイトキューに待避
されている次のグループのタスクを前記レディキューへ
復帰させるタスクグループ切り替え手段と、前記アクテ
ィブタスクグループに基づいて現在のタスクグループを
判定するとともに、前記タイムシェアリング時間テーブ
ルに記憶された時間の経過を待って前記タスクグループ
切り替え手段を起動する切り替え時間検知手段とを備え
ていることを特徴とするタスク管理装置に存する。また
本発明の請求項2に記載の要旨は、前記タイムシェアリ
ングウェイトキューは、前記タイムシェアリング優先度
範囲で指定された範囲のタスクを前記レディキューから
一時待避するための領域に少なくとも全タスクグループ
分だけ記憶するように構成されていることを特徴とする
請求項1に記載のタスク管理装置に存する。また本発明
の請求項3に記載の要旨は、前記実行タスク切り替え手
段は、前記レディキューを参照するとともに、優先度の
高いタスクを選択して実行させるように構成されている
ことを特徴とする請求項1に記載のタスク管理装置に存
する。また本発明の請求項4に記載の要旨は、前記実行
タスク切り替え手段は、同じ優先度のタスクが複数ある
場合、先にレディ状態になったタスクを選択して実行さ
せるように構成されていることを特徴とする請求項1に
記載のタスク管理装置に存する。また本発明の請求項5
に記載の要旨は、前記タスクグループ切り替え手段は、
前記タイムシェアリング優先度範囲で指定された範囲の
タスクを前記レディキューから前記タイムシェアリング
ウェイトキューへ待避し、次のグループのタスクを前記
レディキューへ復帰させるように構成されていることを
特徴とする請求項1に記載のタスク管理装置に存する。
また本発明の請求項6に記載の要旨は、前記切り替え時
間検知手段は、前記アクティブタスクグループから現在
実行中のグループ番号情報を得て、当該グループの処理
時間情報を前記タイムシェアリング時間テーブルから知
るとともに、当該知り得た時間が経過した際に前記タス
クグループ切り替え手段を起動するように構成されてい
ることを特徴とする請求項1に記載のタスク管理装置に
存する。また本発明の請求項7に記載の要旨は、前記レ
ディキューは、レディ状態のタスクを優先度毎に記憶す
るように構成されていることを特徴とする請求項1に記
載のタスク管理装置に存する。また本発明の請求項8に
記載の要旨は、優先度スケジューリングを実行するタス
クスケジューリング方法であって、優先度スケジューリ
ングの実行の際、所定範囲の優先度のタスクのレディ状
態とウェイト状態とを指定された時間に基づいて入れ替
える機能を有するデータ処理工程と情報を記憶する記憶
工程とを有し、前記記憶工程は、実行可能なタスクの情
報を優先度毎に記憶するレディキュー記憶工程と、当該
レディキュー記憶工程の一部分の情報を記憶するタイム
シェアリングウェイトキュー記憶工程と、タイムシェア
リングを行う優先度の上位及び下位を記憶するタイムシ
ェアリング優先度範囲記憶工程と、実行中のタスクグル
ープ番号を記憶するアクティブタスクグループ記憶工程
と、タスクグループ毎の処理時間情報を記憶するタイム
シェアリング時間テーブル記憶工程とを備え、前記デー
タ処理工程は、前記レディキュー記憶工程に記憶されて
いる実行可能なタスクの中から優先度の最も高いタスク
を選択して実行する実行タスク切り替え工程と、前記タ
イムシェアリング優先度範囲記憶工程で指定された範囲
のタスクを前記レディキュー記憶工程から前記タイムシ
ェアリングウェイトキュー記憶工程へ待避させるととも
に、前記タイムシェアリングウェイトキュー記憶工程に
待避されている次のグループのタスクを前記レディキュ
ー記憶工程へ復帰させるタスクグループ切り替え工程
と、前記アクティブタスクグループ記憶工程に基づいて
現在のタスクグループを判定するとともに、前記タイム
シェアリング時間テーブル記憶工程に記憶された時間の
経過を待って前記タスクグループ切り替え工程を起動す
る切り替え時間検知工程とを備えていることを特徴とす
るタスクスケジューリング方法に存する。また本発明の
請求項9に記載の要旨は、前記タイムシェアリングウェ
イトキュー記憶工程は、前記タイムシェアリング優先度
範囲記憶工程で指定された範囲のタスクを前記レディキ
ュー記憶工程から一時待避するための領域に少なくとも
全タスクグループ分だけ記憶する工程を含むことを特徴
とする請求項8に記載のタスクスケジューリング方法に
存する。また本発明の請求項10に記載の要旨は、前記
実行タスク切り替え工程は、前記レディキュー記憶工程
を参照するとともに、優先度の高いタスクを選択して実
行させる工程を含むことを特徴とする請求項8に記載の
タスクスケジューリング方法に存する。また本発明の請
求項11に記載の要旨は、前記実行タスク切り替え工程
は、同じ優先度のタスクが複数ある場合、先にレディ状
態になったタスクを選択して実行させる工程を含むこと
を特徴とする請求項8に記載のタスクスケジューリング
方法に存する。また本発明の請求項12に記載の要旨
は、前記タスクグループ切り替え工程は、前記タイムシ
ェアリング優先度範囲記憶工程で指定された範囲のタス
クを前記レディキュー記憶工程から前記タイムシェアリ
ングウェイトキュー記憶工程へ待避し、次のグループの
タスクを前記レディキュー記憶工程へ復帰させる工程を
含むことを特徴とする請求項8に記載のタスクスケジュ
ーリング方法に存する。また本発明の請求項13に記載
の要旨は、前記切り替え時間検知工程は、前記アクティ
ブタスクグループ記憶工程から現在実行中のグループ番
号情報を得て、当該グループの処理時間情報を前記タイ
ムシェアリング時間テーブル記憶工程から知るととも
に、当該知り得た時間が経過した際に前記タスクグルー
プ切り替え工程を起動する工程を含むことを特徴とする
請求項8に記載のタスクスケジューリング方法に存す
る。また本発明の請求項14に記載の要旨は、前記レデ
ィキュー記憶工程は、レディ状態のタスクを優先度毎に
記憶する工程を含むことを特徴とする請求項8に記載の
タスクスケジューリング方法に存する。
According to a first aspect of the present invention, there is provided a task management device for executing a priority scheduling, wherein the task management device executes the priority scheduling.
A data processing device having a function of exchanging a ready state and a wait state of a task having a predetermined range of priority based on a designated time and a storage device for storing information; Queue for storing information of each priority, a time-sharing wait queue for storing information of a part of the ready queue, and a time-sharing priority range for storing upper and lower priorities for performing time sharing. An active task group that stores a task group number being executed, and a time sharing time table that stores processing time information for each task group, wherein the data processing device includes:
Executing task switching means for selecting and executing the highest priority task from the executable tasks stored in the ready queue, and executing the task in the range designated by the time sharing priority range to the ready task. A task group switching unit for evacuating the queue from the queue to the time-sharing wait queue and returning the next group of tasks evacuated to the time-sharing wait queue to the ready queue; And a switching time detecting unit that activates the task group switching unit after waiting for the elapse of the time stored in the time sharing time table. Exist. The gist of claim 2 of the present invention is that the time-sharing wait queue includes at least all tasks in an area for temporarily saving tasks in a range specified by the time-sharing priority range from the ready queue. 2. The task management device according to claim 1, wherein the task management device is configured to store only a group. The gist of claim 3 of the present invention is characterized in that the executed task switching means is configured to refer to the ready queue and select and execute a task with a high priority. The task management device according to claim 1 exists. According to another aspect of the present invention, when there are a plurality of tasks having the same priority, the execution task switching unit is configured to select and execute a task that is in a ready state first. The task management device according to claim 1, wherein Claim 5 of the present invention
The gist of the above is that the task group switching means,
A task in a range specified by the time sharing priority range is saved from the ready queue to the time sharing wait queue, and the next group of tasks is returned to the ready queue. The task management device according to claim 1.
The gist of claim 6 of the present invention is that the switching time detecting means obtains information of a group number currently being executed from the active task group, and processes time information of the group from the time sharing time table. 2. The task management device according to claim 1, wherein the task management device is configured to activate the task group switching means when the time when the information has been obtained elapses. The gist of claim 7 of the present invention is that the ready queue is configured to store ready tasks for each priority. Exist. According to another aspect of the present invention, there is provided a task scheduling method for executing a priority scheduling, wherein when executing the priority scheduling, a ready state and a wait state of a task having a predetermined range of priorities are designated. A data processing step having a function of exchanging based on the performed time and a storage step of storing information, wherein the storage step is a ready queue storage step of storing information on executable tasks for each priority, A time-sharing wait queue storing step for storing a part of information of the ready queue storing step, a time-sharing priority range storing step for storing upper and lower priorities for performing the time sharing, and a task group number being executed Active task group storing step of storing the processing time and processing time information for each task group An im-sharing time table storage step, wherein the data processing step is an execution task switching step of selecting and executing the highest priority task from among the executable tasks stored in the ready queue storage step. The tasks in the range specified in the time sharing priority range storing step are saved from the ready queue storing step to the time sharing wait queue storing step, and are also saved in the time sharing wait queue storing step. A task group switching step of returning a task of the next group to the ready queue storage step, and determining a current task group based on the active task group storage step, and storing the current task group in the time sharing time table storage step. Wait for the elapse of time Serial resides in task scheduling method characterized by comprising a switching time detecting step of starting the task group switching step. The gist of the ninth aspect of the present invention is that the time sharing wait queue storing step temporarily saves a task in a range specified in the time sharing priority range storing step from the ready queue storing step. 9. The method according to claim 8, further comprising the step of storing at least all task groups in an area. According to a tenth aspect of the present invention, the executed task switching step includes a step of referring to the ready queue storing step and selecting and executing a task with a high priority. Item 8 is the task scheduling method. The gist of claim 11 of the present invention is characterized in that, when there are a plurality of tasks having the same priority, the executed task switching step includes a step of selecting and executing the task which is in the ready state first. A task scheduling method according to claim 8. The gist of the twelfth aspect of the present invention is that, in the task group switching step, the tasks in the range specified in the time sharing priority range storage step are stored from the ready queue storage step to the time sharing wait queue storage. 9. The task scheduling method according to claim 8, further comprising a step of saving to a step and returning a next group of tasks to the ready queue storing step. The gist of claim 13 of the present invention is that the switching time detecting step obtains the group number information of the currently executing group from the active task group storing step and converts the processing time information of the group to the time sharing time. 9. The task scheduling method according to claim 8, further comprising a step of starting from the table storage step and activating the task group switching step when the obtained time elapses. The gist of claim 14 of the present invention resides in the task scheduling method according to claim 8, wherein the ready queue storing step includes a step of storing a ready state task for each priority. .

【0012】[0012]

【発明の実施の形態】以下に説明する第1、第2実施形
態のタスク管理装置及びタスクスケジューリング方法
は、リアルタイムOS(実時間処理用オペレーティング
ソフトウェア:RTOSと呼ばれることが多い)で使用
される優先度スケジューリングにおいて、ある限定され
た範囲の優先度のタスクのレディ状態とウェイト状態と
を指定された時間で入れ替える点に特徴を有している。
以下、本発明の実施の形態を図面に基づいて詳細に説明
する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A task management device and a task scheduling method according to first and second embodiments described below have a priority used in a real-time OS (operating software for real-time processing: often referred to as RTOS). The degree scheduling is characterized in that a ready state and a wait state of a task having a certain priority within a limited range are switched at a designated time.
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

【0013】(第1実施形態)図1は、本発明のタスク
管理装置の第1実施形態を説明するための機能ブロック
図である。図1を参照すると、第1実施形態のタスク管
理装置は、プログラム制御により動作するデータ処理装
置1(データ処理工程の実行主体)と、情報を記憶する
記憶装置2(記憶工程の実行主体)とを備えている。
(First Embodiment) FIG. 1 is a functional block diagram for explaining a first embodiment of the task management device of the present invention. Referring to FIG. 1, the task management device according to the first embodiment includes a data processing device 1 (subject of execution of a data processing step) that operates under program control, a storage device 2 that stores information (subject of execution of a storage process). It has.

【0014】記憶装置2は、実行可能なタスクの情報を
優先度毎に記憶(レディ状態のタスクを優先度毎に記
憶)するレディキュー20(レディキュー記憶工程の実
行主体)、レディキュー20の一部分の情報を複数記憶
するタイムシェアリングウェイトキュー40(タイムシ
ェアリングウェイトキュー記憶工程の実行主体)、タイ
ムシェアリングを行う優先度の上位と下位を記憶するタ
イムシェアリング優先度範囲41(タイムシェアリング
優先度範囲記憶工程の実行主体)、実行中のタスクグル
ープ番号を記憶するアクティブタスクグループ42(ア
クティブタスクグループ記憶工程の実行主体)、タスク
グループ毎の処理時間情報を記憶するタイムシェアリン
グ時間テーブル43(タイムシェアリング時間テーブル
記憶工程の実行主体)を備えている。
The storage device 2 stores information on executable tasks for each priority (a task in a ready state is stored for each priority). A time-sharing wait queue 40 for storing a plurality of partial information (the subject of executing the time-sharing wait queue storing step), and a time-sharing priority range 41 for storing the upper and lower priorities for performing the time sharing (time sharing). The executing entity of the ring priority range storing step), the active task group 42 storing the number of the task group being executed (the executing entity of the active task group storing step), and the time sharing time table storing the processing time information for each task group 43 (Executing entity of the time sharing time table storage step) It is equipped with a.

【0015】タイムシェアリングウェイトキュー40
は、タイムシェアリング優先度範囲41で指定された範
囲のタスクをレディキュー20から一時待避するための
領域で全タスクグループ分記憶できる。
Time sharing weight queue 40
In the area for temporarily saving the tasks in the range specified by the time sharing priority range 41 from the ready queue 20, all the task groups can be stored.

【0016】データ処理装置1は、実行タスク切り替え
手段(図中、実行タスク決定手段と表記)10、タスク
グループ切り替え手段30、切り替え時間検知手段31
を備えている。
The data processing apparatus 1 includes an execution task switching unit (indicated as an execution task determination unit in the figure) 10, a task group switching unit 30, and a switching time detection unit 31.
It has.

【0017】実行タスク切り替え手段10は、実行タス
ク切り替え工程の実行主体であって、レディキュー20
に記憶されている実行可能なタスクの中から優先度の最
も高いタスクを選択してこれを実行する。また、同じ優
先度のタスクが複数存在するときは、先に実行可能にな
ったタスクから先に実行する。具体的には、実行タスク
切り替え手段10は、レディキュー20を参照し、優先
度の高いタスクを選択して実行させる。同じ優先度のタ
スクが複数ある場合、先にレディ状態になったタスクを
選択して実行させる。
The execution task switching means 10 is an execution subject of the execution task switching step, and includes a ready queue 20.
The task having the highest priority is selected from the executable tasks stored in the. Further, when there are a plurality of tasks having the same priority, the tasks that can be executed first are executed first. Specifically, the execution task switching unit 10 refers to the ready queue 20 to select and execute a task with a high priority. When there are a plurality of tasks having the same priority, the task which is in the ready state first is selected and executed.

【0018】タスクグループ切り替え手段30は、タス
クグループ切り替え工程の実行主体であって、タイムシ
ェアリング優先度範囲41で指定された範囲のタスクを
レディキュー20からタイムシェアリングウェイトキュ
ー40へ待避させ、タイムシェアリングウェイトキュー
40に待避されている次のグループのタスクをレディキ
ュー20へ復帰させる。具体的には、タイムシェアリン
グ優先度範囲41で指定された範囲のタスクをレディキ
ュー20からタイムシェアリングウェイトキュー40へ
待避し、次のグループのタスクをレディキュー20へ復
帰させる。このようにして、限定された範囲の優先度の
タスクのレディ状態とウェイト状態を入れ替えることを
可能にする。
The task group switching means 30 is a subject of execution of the task group switching step, and evacuates tasks in the range specified by the time sharing priority range 41 from the ready queue 20 to the time sharing wait queue 40, The task of the next group saved in the time sharing wait queue 40 is returned to the ready queue 20. Specifically, the task in the range specified by the time sharing priority range 41 is evacuated from the ready queue 20 to the time sharing wait queue 40, and the task of the next group is returned to the ready queue 20. In this manner, the ready state and the wait state of a task having a limited range of priority can be switched.

【0019】切り替え時間検知手段31は、切り替え時
間検知工程の実行主体であって、アクティブタスクグル
ープ42に基づいて、現在のタスクグループを判定し、
タイムシェアリング時間テーブル43に記憶された時間
の経過を待って、タスクグループ切り替え手段30を起
動する。具体的には、アクティブタスクグループ42か
ら現在実行中のグループ番号情報を得て、そのグループ
の処理時間情報をタイムシェアリング時間テーブル43
から知ることができる。さらに、知り得た時間が経過し
た時に、タスクグループ切り替え手段30を起動する。
The switching time detecting means 31 is a subject that executes the switching time detecting step, and determines the current task group based on the active task group 42.
When the time stored in the time sharing time table 43 has elapsed, the task group switching means 30 is activated. Specifically, the group number information of the group currently being executed is obtained from the active task group 42, and the processing time information of the group is stored in the time sharing time table 43.
You can know from. Further, the task group switching means 30 is activated when the time obtained has elapsed.

【0020】次に、図1乃至図4を参照して本実施形態
の全体の動作について詳細に説明する。図2は、図1の
実行タスク切り替え手段10で実行されるタスクスケジ
ューリング方法を説明するためのフローチャートであ
る。まず、タスク状態に変化が発生した場合に、実行タ
スク切り替え手段10が実行タスクを決定する。実行タ
スク切り替え手段10は、レディキュー20に基づい
て、現在実行可能となっているタスクの最高優先度情報
を得る(図2のステップF10)。次に、レディキュー
20に基づいて、現在の最高優先度のタスク番号を得て
(図2のステップF11)、現在実行中のタスク番号と
比較し、一致するかを見る(図2のステップF12)。
一致した場合、現在のタスクの継続であると判定し、も
とのタスク処理へジャンプする。一致しなかった場合、
実行中であったタスクの情報を保存し(図2のステップ
F13)、実行中タスク番号を更新(図2のステップF
14)し、新しいタスク処理へジャンプする。
Next, the overall operation of the present embodiment will be described in detail with reference to FIGS. FIG. 2 is a flowchart for explaining a task scheduling method executed by the execution task switching means 10 of FIG. First, when a change occurs in the task state, the execution task switching unit 10 determines an execution task. The execution task switching means 10 obtains the highest priority information of the currently executable task based on the ready queue 20 (step F10 in FIG. 2). Next, based on the ready queue 20, a task number having the highest priority is obtained (step F11 in FIG. 2), and the task number is compared with the task number currently being executed to see if they match (step F12 in FIG. 2). ).
If they match, it is determined that the current task is a continuation, and the processing jumps to the original task processing. If they don't match,
The information of the task being executed is stored (step F13 in FIG. 2), and the number of the task being executed is updated (step F13 in FIG. 2).
14) Then jump to the new task process.

【0021】切り替え時間検知手段31は、アクティブ
タスクグループ42に対応した処理時間が経過したら、
タスクグループ切り替え手段30を呼び出す。
When the processing time corresponding to the active task group 42 has elapsed, the switching time detecting means 31
The task group switching means 30 is called.

【0022】タスクグループ切り替え手段30は、ま
ず、タイムシェアリング優先度範囲41を参照し、その
優先度範囲のタスク情報をレディキュー20からタイム
シェアリングウェイトキュー40へ移動する。次に、ア
クティブタスクグループ42を更新し、タイムシェアリ
ングウェイトキュー40から新しいタスクグループのタ
スク情報をレディキュー20に移動する。最後にタイム
シェアリング時間テーブル43を参照し、新しいタスク
グループの処理時間を設定する。
The task group switching means 30 first refers to the time sharing priority range 41, and moves the task information in the priority range from the ready queue 20 to the time sharing wait queue 40. Next, the active task group 42 is updated, and the task information of the new task group is moved from the time sharing wait queue 40 to the ready queue 20. Finally, the processing time of the new task group is set with reference to the time sharing time table 43.

【0023】次に、具体例を用いて説明する。図4は、
タスクグループが2つある場合の、タスクグループ切り
替え手段30によるタスクグループ切り替え前と後の、
アクティブタスクグループ42、レディキュー20、タ
イムシェアリングウェイトキュー40の状態を示してい
る。
Next, a specific example will be described. FIG.
When there are two task groups, before and after the task group switching by the task group switching means 30,
The state of the active task group 42, the ready queue 20, and the time sharing wait queue 40 are shown.

【0024】まず、切り替え前の状態について説明す
る。アクティブタスクグループ42(図4中で110と
表記)が1であり、レディキュー20(図4中で210
と表記)の優先度3,4にはグループ1のタスクである
タスク1A、タスク1B、タスク1Cといったタスクが
実行可能な状態として記憶されている。一方、現在アク
ティブではない2のタスクとしては、タイムシェアリン
グウェイトキュー40(図4中で410)のグループ2
用(図4中で412と表記)に、タスク2A、タスク2
B、タスク2Cがウェイト状態として記憶されている。
なお、タイムシェアリング優先度範囲41は優先度3か
ら6である。
First, the state before switching will be described. The active task group 42 (denoted by 110 in FIG. 4) is 1 and the ready queue 20 (210 in FIG. 4)
In the priorities 3 and 4 of “group 1”, tasks 1A, 1B, and 1C, which are tasks of group 1, are stored as executable states. On the other hand, the two tasks that are not currently active include the group 2 of the time-sharing wait queue 40 (410 in FIG. 4).
Task 2A, task 2
B and task 2C are stored as wait states.
It should be noted that the time sharing priority range 41 is priority 3 to 6.

【0025】図3は、図1のタスクグループ切り替え手
段30で実行されるタスクスケジューリング方法を説明
するためのフローチャートである。タスクグループ切り
替え手段30は、アクティブタスクグループ42(図4
中で110と表記)を参照し、待避するグループ情報が
1であることを得る(図3のステップF20)。次に、
タイムシェアリング優先度範囲41を参照し、レディキ
ュー20の参照位置情報として優先度3から6という情
報を得る(図3のステップF21)。さらに、レディキ
ュー20(図4中で210)からタイムシェア範囲のタ
スク情報を獲得し、タイムシェアリングウェイトキュー
40の待避するグループのウェイトキューへタスク情報
を移動する(図3のステップF22)。この時移動した
情報は、タイムシェアリングウェイトキュー40(図4
中で420)のグループ1用(図4中で421)に入っ
ている。次に、アクティブタスクグループ42(図4中
で120と表記)を2に更新(図3のステップF2
3)、タイムシェアリングウェイトキュー40(図4中
で410と表記)のグループ2用(図4中で412)か
らグループ2のタスク情報をレディキュー20(図4中
で220と表記)へ復帰させる(図3のステップF2
4)。この際、タスクのないタイムシェアリングウェイ
トキュー40(図4中で411と表記)は、タイムシェ
アリングウェイトキュー40(図4中で422と表記)
に復帰させる。最後に、タイムシェアリング時間テーブ
ルを参照し、このグループの処理時間を設定する(図3
のステップF25)。
FIG. 3 is a flowchart for explaining a task scheduling method executed by the task group switching means 30 of FIG. The task group switching means 30 includes an active task group 42 (FIG. 4).
In this case, the group information to be saved is 1 (step F20 in FIG. 3). next,
With reference to the time sharing priority range 41, information of priority 3 to 6 is obtained as reference position information of the ready queue 20 (step F21 in FIG. 3). Further, the task information in the time share range is acquired from the ready queue 20 (210 in FIG. 4), and the task information is moved to the wait queue of the group to be saved in the time sharing wait queue 40 (step F22 in FIG. 3). The information moved at this time is stored in the time sharing wait queue 40 (FIG. 4).
(420 in FIG. 4) for group 1 (421 in FIG. 4). Next, the active task group 42 (denoted by 120 in FIG. 4) is updated to 2 (step F2 in FIG. 3).
3) The task information of group 2 is returned from the time sharing wait queue 40 (denoted by 410 in FIG. 4) for group 2 (412 in FIG. 4) to the ready queue 20 (denoted by 220 in FIG. 4) (Step F2 in FIG. 3)
4). At this time, the time-sharing wait queue 40 (shown as 411 in FIG. 4) having no task is replaced with the time-sharing wait queue 40 (shown as 422 in FIG. 4).
To return to. Finally, the processing time of this group is set with reference to the time sharing time table (FIG. 3).
Step F25).

【0026】このようにしてタスクグループの切り替え
が完了する。切り替え後の状態は、アクティブタスクグ
ループ42(図4中で210と表記)が優先度2とな
り、レディキュー20(図4中で220と表記)の優先
度3から6には、グループ2のタスクであるタスク2
A、タスク2B、タスク2Cといったタスクが実行可能
状態な状態として記憶されている。一方切り替え前にア
クティブであったグループ1のタスクは、タイムシェア
リングウェイトキュー40(図4中で420と表記)の
グループ1用(図4中で421と表記)にタスク1A、
タスク1B、タスク1Cがウェイト状態として記憶され
る。
Thus, the task group switching is completed. In the state after the switching, the active task group 42 (denoted by 210 in FIG. 4) has a priority of 2, and the ready queue 20 (denoted by 220 in FIG. 4) includes tasks of group 2 in priority 3 to 6. Is task 2
Tasks such as A, task 2B, and task 2C are stored as executable states. On the other hand, the tasks of group 1 that were active before the switching are tasks 1A and 1A for group 1 (denoted by 421 in FIG. 4) of the time-sharing wait queue 40 (denoted by 420 in FIG. 4).
Task 1B and task 1C are stored as wait states.

【0027】以上説明したように、第1実施形態によれ
ば、第1に、タイムシェアリング優先度範囲41で指定
した優先度のタスクのみを、タスクグループ切り替え手
段30がレディ状態とウェイト状態を入れ替えるので、
リアルタイムな処理が要求される高優先度のタスクに対
しては従来からのリアルタイム性を保持しながら、低優
先度タスクに対しては、予め分けられたタスクグループ
毎に、予め設定した時間の処理機会が提供できる。第2
に、予め分けられたタスクグループ毎に、タスクグルー
プ切り替え手段30がレディ状態とウェイト状態を入れ
替えるので、低優先度のタスクでは、予め設定した時間
の処理機会が与えられることを前提に設計できるので、
優先度や処理時間の調整をモジュール間(タスクグルー
プ間)で行う必要がなくなり、独立性の高いモジュール
単位の設計が可能になり、ソフトウエアの部品化を促進
できるといった効果を奏する。
As described above, according to the first embodiment, first, only the tasks having the priority specified in the time-sharing priority range 41 are set by the task group switching means 30 between the ready state and the wait state. Since it is replaced,
For high-priority tasks that require real-time processing, the conventional real-time performance is maintained, while for low-priority tasks, processing is performed for a preset time for each of the divided task groups. Opportunities can be provided. Second
In addition, since the task group switching means 30 switches the ready state and the wait state for each of the divided task groups, the task of low priority can be designed on the assumption that a processing opportunity of a preset time is given. ,
It is not necessary to adjust the priority and the processing time between modules (between task groups), so that it is possible to design modules with high independence, and to promote the implementation of software components.

【0028】(第2実施形態)次に、本発明の第2実施
形態について図面を参照して詳細に説明する。図5は、
本発明のタスク管理装置の第2実施形態を説明するため
の機能ブロック図である。図5を参照すると、第2実施
形態のタスク管理装置は、データ処理装置1が、図1に
示された第1実施形態におけるデータ処理装置1の構成
に加えて、切り替え時間タイマ管理手段32を有する点
に特徴を有している。
(Second Embodiment) Next, a second embodiment of the present invention will be described in detail with reference to the drawings. FIG.
It is a functional block diagram for explaining a 2nd embodiment of the task management device of the present invention. Referring to FIG. 5, in the task management device of the second embodiment, the data processing device 1 includes a switching time timer management unit 32 in addition to the configuration of the data processing device 1 of the first embodiment shown in FIG. The feature is that it has.

【0029】切り替え時間タイマ管理手段32は、実行
中のタスクがタイムシェアリング優先度範囲41の外の
場合に、切り替え時間検知手段31の切り替え時間タイ
マを一時停止し、タイムシェアリング優先度範囲41の
内の場合に、切り替え時間タイマを再スタートする。実
行タスク切り替え手段10は、実行するタスク決定後
に、切り替え時間タイマ管理手段32を呼び出して、切
り替え時間タイマの一時停止、再スタートを制御する。
When the task being executed is outside the time sharing priority range 41, the switching time timer management means 32 temporarily stops the switching time timer of the switching time detection means 31, and the time sharing priority range 41 Restarts the switching time timer. The execution task switching means 10 calls the switching time timer management means 32 after determining the task to be executed, and controls the suspension and restart of the switching time timer.

【0030】本実施形態の動作を図面を参照して詳細に
説明する。図6は、図5の実行タスク切り替え手段10
で実行されるタスクスケジューリング方法を説明するた
めのフローチャートである。図5のタスクグループ切り
替え手段30、切り替え時間検知手段31の動作、記憶
装置2の構成は、図1に示された実施形態の切り替え時
間検知手段31、切り替え時間タイマ管理手段32の動
作および記憶装置2の構成と同一のため、説明は省略す
る。図1に示された実施形態では、実行中のタスクがタ
イムシェアリング優先度範囲41の外のタスクであって
も、切り替え時間タイマのカウントに含まれていた。す
なわち、切り替え範囲のタスクグループに対して与えら
れる処理時間は、タイムシェアリング時間テーブル43
に記憶しておいた時間から、切り替え範囲より高い優先
度のタスクを実行している時間を引いた時間となってい
た。本実施形態の場合、実行タスク切り替え手段10
が、実行するタスクを決定後、切り替え時間タイマ管理
手段32を呼び出し(図6のステップF15)、切り替
え時間タイマを制御し、タイムシェアリング時間テーブ
ル43に記憶した時間との誤差が出ないようにしてい
る。
The operation of the present embodiment will be described in detail with reference to the drawings. FIG. 6 shows the execution task switching means 10 of FIG.
3 is a flowchart for explaining a task scheduling method executed in the step S1. The operation of the task group switching means 30 and the switching time detecting means 31 in FIG. 5 and the configuration of the storage device 2 are the same as those of the switching time detecting means 31 and the switching time timer managing means 32 in the embodiment shown in FIG. Since the configuration is the same as that of the second embodiment, the description is omitted. In the embodiment shown in FIG. 1, even if the task being executed is a task outside the time sharing priority range 41, it is included in the count of the switching time timer. That is, the processing time given to the task group in the switching range is stored in the time sharing time table 43.
Is the time obtained by subtracting the time during which the task having a higher priority than the switching range is being executed from the time stored in the switch. In the case of the present embodiment, the execution task switching means 10
However, after determining the task to be executed, the switching time timer management means 32 is called (step F15 in FIG. 6), and the switching time timer is controlled so that there is no error with the time stored in the time sharing time table 43. ing.

【0031】次に、具体例について説明する。図7は、
図5の切り替え時間タイマ管理手段32で実行されるタ
スクスケジューリング方法を説明するためのフローチャ
ートであり、図8は、図6の実行タスク切り替え手段で
実行されるタスクスケジューリング方法の具体例を示し
ている。実行タスク切り替え手段10が実行するタスク
を決定したとき、レディキュー20の状態が図8の状態
であり、実行するタスクは優先度2のタスク0Aであっ
たとする。実行タスク切り替え手段10から呼び出され
た切り替え時間タイマ管理手段32は、実行するタスク
の優先度2とタイムシェアリング優先度範囲41を比較
し、切り替え範囲かどうかを判定する(図7のステップ
F30)。優先度2は範囲外なので(ステップF30の
「いいえ」)、切り替え時間タイマ停止中かどうかの判
定(図7のステップF32)を行い、停止中でなければ
(ステップF32の「いいえ」)、切り替え時間タイマ
カウントを停止する(図7のステップF34)。タスク
0Aの実行が終了した場合、次に実行されるタスクは優
先度3のタスク1Aとなる。実行タスク切り替え手段1
0から、実行するタスク決定後に切り替え時間タイマ管
理手段32が呼び出され、切り替え範囲の判定(図7の
ステップF30)で、範囲内と判定され(ステップF3
0の「はい」)、切り替え時間タイマはカウント中かの
判定(図7のステップF31)は、「いいえ」なので、
切り替え時間タイマのカウントを開始(図7のステップ
F33)する。
Next, a specific example will be described. FIG.
FIG. 8 is a flowchart for explaining a task scheduling method executed by the switching time timer management means 32 of FIG. 5. FIG. 8 shows a specific example of a task scheduling method executed by the execution task switching means of FIG. . It is assumed that when the execution task switching means 10 determines a task to be executed, the state of the ready queue 20 is as shown in FIG. 8, and the task to be executed is the task 0A of priority 2. The switching time timer management means 32 called from the execution task switching means 10 compares the priority 2 of the task to be executed with the time sharing priority range 41 to determine whether or not the task is in the switching range (step F30 in FIG. 7). . Since the priority 2 is out of the range ("No" in step F30), it is determined whether or not the switching time timer is stopped (step F32 in FIG. 7). If not ("No" in step F32), the switching is performed. The time timer count is stopped (step F34 in FIG. 7). When the execution of the task 0A is completed, the task to be executed next becomes the task 3A of priority 3. Execution task switching means 1
From 0, the switching time timer management means 32 is called after the task to be executed is determined, and the switching range is determined to be within the range (step F3 in FIG. 7) (step F3).
Since the determination of whether the switching time timer is counting (Step F31 in FIG. 7) is “No”,
The counting of the switching time timer is started (step F33 in FIG. 7).

【0032】以上説明したように、第2実施形態によれ
ば、第1実施形態に記載の効果に加えて、実行タスク切
り替え手段10より、呼び出される切り替え時間タイマ
管理手段32により、タイムシェアリング優先度範囲4
1の外のタスク実行中に、切り替え時間タイマのカウン
トが停止するため、タイムシェアリング時間テーブル4
3に設定した時間に対する誤差が少なくなるという新た
な効果を奏する。
As described above, according to the second embodiment, in addition to the effects described in the first embodiment, the switching time timer management means 32 called by the execution task switching means 10 causes the time sharing priority. Degree range 4
Since the count of the switching time timer is stopped while the task other than 1 is being executed, the time sharing time table 4
There is a new effect that the error with respect to the time set to 3 is reduced.

【0033】なお、本実施の形態においては、本発明は
上記実施形態に限定されず、本発明を適用する上で好適
なマイクロコンピュータで実行されるタスクスケジュー
リング技術に適用することができる。また、上記構成部
材の数、位置、形状等は上記実施の形態に限定されず、
本発明を実施する上で好適な数、位置、形状等にするこ
とができる。また、各図において、同一構成要素には同
一符号を付している。
In the present embodiment, the present invention is not limited to the above-described embodiment, but can be applied to a task scheduling technique executed by a microcomputer suitable for applying the present invention. In addition, the number, position, shape, and the like of the constituent members are not limited to the above-described embodiment,
The number, position, shape, and the like suitable for carrying out the present invention can be obtained. In each drawing, the same components are denoted by the same reference numerals.

【0034】[0034]

【発明の効果】本発明は以上のように構成されているの
で、以下に掲げる効果を奏する。第1の効果は、タイム
シェアリング優先度範囲で指定した優先度のタスクのみ
を、タスクグループ切り替え手段がレディ状態とウェイ
ト状態を入れ替えるので、リアルタイムな処理が要求さ
れる高優先度のタスクに対しては従来からのリアルタイ
ム性を保持しながら、低優先度タスクに対しては、予め
分けられたタスクグループ毎に、予め設定した時間の処
理機会が提供できることにある。第2の効果は、予め分
けられたタスクグループ毎に、タスクグループ切り替え
手段がレディ状態とウェイト状態を入れ替えるので、低
優先度のタスクでは、予め設定した時間の処理機会が与
えられることを前提に設計できるので、優先度や処理時
間の調整をモジュール間(タスクグループ間)で行う必
要がなくなり、独立性の高いモジュール単位の設計が可
能になり、ソフトウエアの部品化を促進できることにあ
る。
Since the present invention is configured as described above, the following effects can be obtained. The first effect is that the task group switching means switches between the ready state and the wait state only for the tasks of the priority specified in the time sharing priority range, so that the high priority tasks that require real-time processing can be used. In other words, it is possible to provide a low-priority task with a processing opportunity of a preset time for each of the divided task groups while maintaining the conventional real-time property. The second effect is that the task group switching means switches between the ready state and the wait state for each of the preliminarily divided task groups. Therefore, it is premised that a processing opportunity of a preset time is given to a low priority task. Since the design can be performed, it is not necessary to adjust the priority and the processing time between modules (between task groups), so that it is possible to design a highly independent module unit, and to promote software components.

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

【図1】本発明のタスク管理装置の第1実施形態を説明
するための機能ブロック図である。
FIG. 1 is a functional block diagram for explaining a first embodiment of a task management device of the present invention.

【図2】図1の実行タスク切り替え手段で実行されるタ
スクスケジューリング方法を説明するためのフローチャ
ートである。
FIG. 2 is a flowchart for explaining a task scheduling method executed by an execution task switching unit of FIG. 1;

【図3】図1のタスクグループ切り替え手段で実行され
るタスクスケジューリング方法を説明するためのフロー
チャートである。
FIG. 3 is a flowchart for explaining a task scheduling method executed by a task group switching unit in FIG. 1;

【図4】タスクグループが2つある場合の、タスクグル
ープ切り替え手段によるタスクグループ切り替え前と後
の、アクティブタスクグループ、レディキュー、タイム
シェアリングウェイトキューの状態を示している。
FIG. 4 shows states of an active task group, a ready queue, and a time-sharing wait queue before and after task group switching by a task group switching unit when there are two task groups.

【図5】本発明のタスク管理装置の第2実施形態を説明
するための機能ブロック図である。
FIG. 5 is a functional block diagram for explaining a second embodiment of the task management device of the present invention.

【図6】図5の実行タスク切り替え手段で実行されるタ
スクスケジューリング方法を説明するためのフローチャ
ートである。
FIG. 6 is a flowchart for explaining a task scheduling method executed by the execution task switching means of FIG. 5;

【図7】図5の切り替え時間タイマ管理手段で実行され
るタスクスケジューリング方法を説明するためのフロー
チャートである。
FIG. 7 is a flowchart for explaining a task scheduling method executed by the switching time timer management means of FIG. 5;

【図8】図6の実行タスク切り替え手段で実行されるタ
スクスケジューリング方法の具体例を示している。
8 shows a specific example of a task scheduling method executed by the execution task switching means of FIG.

【図9】従来のタスク管理装置を説明するためのブロッ
ク図である。
FIG. 9 is a block diagram for explaining a conventional task management device.

【図10】図9のタスク管理装置で実行されるタスクの
実行順序を説明するためのレディキューの状態を示して
いる。
10 shows a state of a ready queue for explaining an execution order of tasks executed by the task management device of FIG. 9;

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

1…データ処理装置 2…記憶装置 10…実行タスク切り替え手段 20…レディキュー 30…タスクグループ切り替え手段 31…切り替え時間検知手段 32…切り替え時間タイマ管理手段 40…タイムシェアリングウェイトキュー 41…タイムシェアリング優先度範囲 42…アクティブタスクグループ 43…タイムシェアリング時間テーブル DESCRIPTION OF SYMBOLS 1 ... Data processing device 2 ... Storage device 10 ... Execution task switching means 20 ... Ready queue 30 ... Task group switching means 31 ... Switching time detection means 32 ... Switching time timer management means 40 ... Time sharing wait queue 41 ... Time sharing Priority range 42: Active task group 43: Time sharing time table

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5B045 GG00 5B098 CC01 GA02 GA04 GA08 GB01 GB10 GB13 GC03 GC04 GD02 GD17  ──────────────────────────────────────────────────続 き Continued on the front page F term (reference) 5B045 GG00 5B098 CC01 GA02 GA04 GA08 GB01 GB10 GB13 GC03 GC04 GD02 GD17

Claims (14)

【特許請求の範囲】[Claims] 【請求項1】 優先度スケジューリングを実行するタス
ク管理装置であって、 優先度スケジューリングの実行の際、所定範囲の優先度
のタスクのレディ状態とウェイト状態とを指定された時
間に基づいて入れ替える機能を有するデータ処理装置と
情報を記憶する記憶装置とを有し、 前記記憶装置は、 実行可能なタスクの情報を優先度毎に記憶するレディキ
ューと、当該レディキューの一部分の情報を記憶するタ
イムシェアリングウェイトキューと、タイムシェアリン
グを行う優先度の上位及び下位を記憶するタイムシェア
リング優先度範囲と、実行中のタスクグループ番号を記
憶するアクティブタスクグループと、タスクグループ毎
の処理時間情報を記憶するタイムシェアリング時間テー
ブルとを備え、 前記データ処理装置は、 前記レディキューに記憶されている実行可能なタスクの
中から優先度の最も高いタスクを選択して実行する実行
タスク切り替え手段と、前記タイムシェアリング優先度
範囲で指定された範囲のタスクを前記レディキューから
前記タイムシェアリングウェイトキューへ待避させると
ともに、前記タイムシェアリングウェイトキューに待避
されている次のグループのタスクを前記レディキューへ
復帰させるタスクグループ切り替え手段と、前記アクテ
ィブタスクグループに基づいて現在のタスクグループを
判定するとともに、前記タイムシェアリング時間テーブ
ルに記憶された時間の経過を待って前記タスクグループ
切り替え手段を起動する切り替え時間検知手段とを備え
ていることを特徴とするタスク管理装置。
1. A task management device for executing priority scheduling, wherein when performing priority scheduling, a function of exchanging a ready state and a wait state of a task having a predetermined range of priorities based on a designated time. And a storage device for storing information, the storage device comprising: a ready queue for storing information on executable tasks for each priority; and a time for storing information on a part of the ready queue. A sharing weight queue, a time sharing priority range for storing upper and lower priorities for performing time sharing, an active task group for storing a task group number being executed, and processing time information for each task group. A time-sharing time table to be stored, wherein the data processing device comprises: Execution task switching means for selecting and executing the task with the highest priority from the executable tasks stored in the queue, and executing the tasks in the range specified by the time sharing priority range from the ready queue. Task group switching means for saving to the time sharing wait queue and returning the next group of tasks saved to the time sharing wait queue to the ready queue; and a current task based on the active task group. A task management device, comprising: a switching time detecting unit that determines a group and waits for a lapse of time stored in the time sharing time table to activate the task group switching unit.
【請求項2】 前記タイムシェアリングウェイトキュー
は、前記タイムシェアリング優先度範囲で指定された範
囲のタスクを前記レディキューから一時待避するための
領域に少なくとも全タスクグループ分だけ記憶するよう
に構成されていることを特徴とする請求項1に記載のタ
スク管理装置。
2. The time-sharing wait queue is configured to store at least a task in a range designated by the time-sharing priority range from the ready queue for at least all task groups in an area for temporarily saving the tasks. The task management device according to claim 1, wherein
【請求項3】 前記実行タスク切り替え手段は、前記レ
ディキューを参照するとともに、優先度の高いタスクを
選択して実行させるように構成されていることを特徴と
する請求項1に記載のタスク管理装置。
3. The task management system according to claim 1, wherein the execution task switching unit is configured to refer to the ready queue and select and execute a task having a high priority. apparatus.
【請求項4】 前記実行タスク切り替え手段は、同じ優
先度のタスクが複数ある場合、先にレディ状態になった
タスクを選択して実行させるように構成されていること
を特徴とする請求項1に記載のタスク管理装置。
4. The execution task switching means according to claim 1, wherein, when there are a plurality of tasks having the same priority, a task which is in a ready state first is selected and executed. A task management device according to claim 1.
【請求項5】 前記タスクグループ切り替え手段は、前
記タイムシェアリング優先度範囲で指定された範囲のタ
スクを前記レディキューから前記タイムシェアリングウ
ェイトキューへ待避し、次のグループのタスクを前記レ
ディキューへ復帰させるように構成されていることを特
徴とする請求項1に記載のタスク管理装置。
5. The task group switching means saves a task in a range specified by the time sharing priority range from the ready queue to the time sharing wait queue, and transfers a task of the next group to the ready queue. The task management device according to claim 1, wherein the task management device is configured to return to task.
【請求項6】 前記切り替え時間検知手段は、前記アク
ティブタスクグループから現在実行中のグループ番号情
報を得て、当該グループの処理時間情報を前記タイムシ
ェアリング時間テーブルから知るとともに、当該知り得
た時間が経過した際に前記タスクグループ切り替え手段
を起動するように構成されていることを特徴とする請求
項1に記載のタスク管理装置。
6. The switching time detecting means obtains information on a group number currently being executed from the active task group, obtains processing time information of the group from the time sharing time table, and obtains the obtained time. 2. The task management device according to claim 1, wherein the task group switching unit is activated when a time elapses.
【請求項7】 前記レディキューは、レディ状態のタス
クを優先度毎に記憶するように構成されていることを特
徴とする請求項1に記載のタスク管理装置。
7. The task management device according to claim 1, wherein the ready queue is configured to store ready tasks for each priority.
【請求項8】 優先度スケジューリングを実行するタス
クスケジューリング方法であって、 優先度スケジューリングの実行の際、所定範囲の優先度
のタスクのレディ状態とウェイト状態とを指定された時
間に基づいて入れ替える機能を有するデータ処理工程と
情報を記憶する記憶工程とを有し、 前記記憶工程は、 実行可能なタスクの情報を優先度毎に記憶するレディキ
ュー記憶工程と、当該レディキュー記憶工程の一部分の
情報を記憶するタイムシェアリングウェイトキュー記憶
工程と、タイムシェアリングを行う優先度の上位及び下
位を記憶するタイムシェアリング優先度範囲記憶工程
と、実行中のタスクグループ番号を記憶するアクティブ
タスクグループ記憶工程と、タスクグループ毎の処理時
間情報を記憶するタイムシェアリング時間テーブル記憶
工程とを備え、 前記データ処理工程は、 前記レディキュー記憶工程に記憶されている実行可能な
タスクの中から優先度の最も高いタスクを選択して実行
する実行タスク切り替え工程と、 前記タイムシェアリング優先度範囲記憶工程で指定され
た範囲のタスクを前記レディキュー記憶工程から前記タ
イムシェアリングウェイトキュー記憶工程へ待避させる
とともに、前記タイムシェアリングウェイトキュー記憶
工程に待避されている次のグループのタスクを前記レデ
ィキュー記憶工程へ復帰させるタスクグループ切り替え
工程と、 前記アクティブタスクグループ記憶工程に基づいて現在
のタスクグループを判定するとともに、前記タイムシェ
アリング時間テーブル記憶工程に記憶された時間の経過
を待って前記タスクグループ切り替え工程を起動する切
り替え時間検知工程とを備えていることを特徴とするタ
スクスケジューリング方法。
8. A task scheduling method for executing a priority scheduling, wherein a function of exchanging a ready state and a wait state of a task having a predetermined range of priorities based on a designated time when executing the priority scheduling. And a storage step of storing information. The storage step includes: a ready queue storage step of storing information on executable tasks for each priority; and information of a part of the ready queue storage step. , A time-sharing priority queue storing step of storing upper and lower priorities for performing time sharing, and an active task group storing step of storing a task group number being executed. And time sharing time for storing processing time information for each task group A table storage step, wherein the data processing step is an execution task switching step of selecting and executing a task having the highest priority from among the executable tasks stored in the ready queue storage step, and the time The task in the range specified in the sharing priority range storage step is saved from the ready queue storage step to the time sharing wait queue storage step, and the next group saved in the time sharing wait queue storage step is saved. A task group switching step of returning the current task to the ready queue storing step; determining a current task group based on the active task group storing step; and lapse of time stored in the time sharing time table storing step. Wait for the task group A switching time detecting step of starting a switching step.
【請求項9】 前記タイムシェアリングウェイトキュー
記憶工程は、前記タイムシェアリング優先度範囲記憶工
程で指定された範囲のタスクを前記レディキュー記憶工
程から一時待避するための領域に少なくとも全タスクグ
ループ分だけ記憶する工程を含むことを特徴とする請求
項8に記載のタスクスケジューリング方法。
9. The time-sharing wait queue storing step includes storing at least all task groups in an area for temporarily saving tasks in a range specified in the time-sharing priority range storing step from the ready queue storing step. 9. The method according to claim 8, further comprising the step of storing
【請求項10】 前記実行タスク切り替え工程は、前記
レディキュー記憶工程を参照するとともに、優先度の高
いタスクを選択して実行させる工程を含むことを特徴と
する請求項8に記載のタスクスケジューリング方法。
10. The task scheduling method according to claim 8, wherein the execution task switching step includes a step of referring to the ready queue storage step and selecting and executing a task with a high priority. .
【請求項11】 前記実行タスク切り替え工程は、同じ
優先度のタスクが複数ある場合、先にレディ状態になっ
たタスクを選択して実行させる工程を含むことを特徴と
する請求項8に記載のタスクスケジューリング方法。
11. The execution task switching step according to claim 8, wherein, when there are a plurality of tasks having the same priority, a task which has been brought into a ready state first is selected and executed. Task scheduling method.
【請求項12】 前記タスクグループ切り替え工程は、
前記タイムシェアリング優先度範囲記憶工程で指定され
た範囲のタスクを前記レディキュー記憶工程から前記タ
イムシェアリングウェイトキュー記憶工程へ待避し、次
のグループのタスクを前記レディキュー記憶工程へ復帰
させる工程を含むことを特徴とする請求項8に記載のタ
スクスケジューリング方法。
12. The task group switching step,
Saving the tasks in the range specified in the time sharing priority range storing step from the ready queue storing step to the time sharing wait queue storing step, and returning the next group of tasks to the ready queue storing step; The task scheduling method according to claim 8, comprising:
【請求項13】 前記切り替え時間検知工程は、前記ア
クティブタスクグループ記憶工程から現在実行中のグル
ープ番号情報を得て、当該グループの処理時間情報を前
記タイムシェアリング時間テーブル記憶工程から知ると
ともに、当該知り得た時間が経過した際に前記タスクグ
ループ切り替え工程を起動する工程を含むことを特徴と
する請求項8に記載のタスクスケジューリング方法。
13. The switching time detecting step obtains information on a currently executing group number from the active task group storing step, and obtains processing time information of the group from the time sharing time table storing step. 9. The task scheduling method according to claim 8, further comprising the step of activating said task group switching step when a learned time elapses.
【請求項14】 前記レディキュー記憶工程は、レディ
状態のタスクを優先度毎に記憶する工程を含むことを特
徴とする請求項8に記載のタスクスケジューリング方
法。
14. The task scheduling method according to claim 8, wherein said ready queue storing step includes a step of storing a ready task for each priority.
JP34730498A 1998-12-07 1998-12-07 Task management device and task scheduling method Expired - Lifetime JP3005562B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP34730498A JP3005562B1 (en) 1998-12-07 1998-12-07 Task management device and task scheduling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP34730498A JP3005562B1 (en) 1998-12-07 1998-12-07 Task management device and task scheduling method

Publications (2)

Publication Number Publication Date
JP3005562B1 JP3005562B1 (en) 2000-01-31
JP2000172514A true JP2000172514A (en) 2000-06-23

Family

ID=18389318

Family Applications (1)

Application Number Title Priority Date Filing Date
JP34730498A Expired - Lifetime JP3005562B1 (en) 1998-12-07 1998-12-07 Task management device and task scheduling method

Country Status (1)

Country Link
JP (1) JP3005562B1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100349149C (en) * 2003-01-24 2007-11-14 中兴通讯股份有限公司 Process scheduling method in embedded type real time operating system
CN100442239C (en) * 2007-01-09 2008-12-10 上海新时达电气有限公司 Time-sharing operating method for interrupt program
JP2008305065A (en) * 2007-06-06 2008-12-18 Nec Computertechno Ltd Cpu resource management method
CN102043667A (en) * 2010-11-25 2011-05-04 深圳市科陆电子科技股份有限公司 Task scheduling method for embedded operating system
KR20150121600A (en) * 2014-04-21 2015-10-29 삼성전자주식회사 Apparatus for scheduling task based on hardware and method thereof

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190335B (en) * 2021-05-07 2023-05-26 安徽南瑞中天电力电子有限公司 Multi-task scheduling and collecting method of power collecting terminal and power collecting system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100349149C (en) * 2003-01-24 2007-11-14 中兴通讯股份有限公司 Process scheduling method in embedded type real time operating system
CN100442239C (en) * 2007-01-09 2008-12-10 上海新时达电气有限公司 Time-sharing operating method for interrupt program
JP2008305065A (en) * 2007-06-06 2008-12-18 Nec Computertechno Ltd Cpu resource management method
JP4650697B2 (en) * 2007-06-06 2011-03-16 エヌイーシーコンピュータテクノ株式会社 CPU resource management method
CN102043667A (en) * 2010-11-25 2011-05-04 深圳市科陆电子科技股份有限公司 Task scheduling method for embedded operating system
KR20150121600A (en) * 2014-04-21 2015-10-29 삼성전자주식회사 Apparatus for scheduling task based on hardware and method thereof
KR102182295B1 (en) 2014-04-21 2020-11-24 삼성전자 주식회사 Apparatus for scheduling task based on hardware and method thereof

Also Published As

Publication number Publication date
JP3005562B1 (en) 2000-01-31

Similar Documents

Publication Publication Date Title
US6006247A (en) Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system
JPH10301793A (en) Information processor and scheduling method
JP2561801B2 (en) Method and system for managing process scheduling
JPH113232A (en) Signal generation and distribution for double level multi-thread system
KR970016979A (en) Queuing system and method of tasks in a multiprocessing system
US5241676A (en) Method for controlling process priority in semaphore operation
JP3005562B1 (en) Task management device and task scheduling method
US8555285B2 (en) Executing a general-purpose operating system as a task under the control of a real-time operating system
JPH0877025A (en) Method and device for controlling priority of task
JP2001256062A (en) Interruption processing method and operation processor using the same
JPH05250188A (en) Priority control system of process
JP2001236236A (en) Task controller and its task scheduling method
JPH05108380A (en) Data processing system
JP2693916B2 (en) Task scheduling method
JP3576437B2 (en) Multiprocessor task control method and task control device
JP2597283B2 (en) Scheduling method for interrupt
JP3043748B1 (en) Task scheduling method and device
JPH11184828A (en) Test system for multiprocessor system
JPH08314740A (en) Process dispatch method
JPH11203149A (en) Device and method for scheduling task
JPH07114518A (en) Task scheduling system of multiprocessor system
JPH05241860A (en) Time slice optimization system
JPS63636A (en) Task control system
JP3093714B2 (en) Multitasking execution priority determination system
JP2000029850A (en) Task controlling method using inter-processor communication of operating system