JP2000066910A - Task scheduling method and recording medium - Google Patents

Task scheduling method and recording medium

Info

Publication number
JP2000066910A
JP2000066910A JP10235952A JP23595298A JP2000066910A JP 2000066910 A JP2000066910 A JP 2000066910A JP 10235952 A JP10235952 A JP 10235952A JP 23595298 A JP23595298 A JP 23595298A JP 2000066910 A JP2000066910 A JP 2000066910A
Authority
JP
Japan
Prior art keywords
task
execution
group
frequency
deadline
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
JP10235952A
Other languages
Japanese (ja)
Other versions
JP3123714B2 (en
Inventor
Koichi Nakamoto
幸一 中本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP10235952A priority Critical patent/JP3123714B2/en
Publication of JP2000066910A publication Critical patent/JP2000066910A/en
Application granted granted Critical
Publication of JP3123714B2 publication Critical patent/JP3123714B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Power Sources (AREA)

Abstract

PROBLEM TO BE SOLVED: To minimize the consumption of a secondary battery by dividing from an inserted task to a task of an execution sequence which will not be able to keep a deadline into another task groups and merging two groups into one group. SOLUTION: A scheduler 112 calculates the deadline of a task Tk and inserts a data structure for executing the task Tk to an appropriate position of a management queue 113. As the result of inserting the task Tk, the execution frequency (f) of tasks to be increased is calculated. When tasks in the same group are carried out with the execution frequency (f), the first task that does not keep the deadline of the task is defined as Tp. Division is made with from the Tk to the Tp as one task group. When the execution frequency of the former divided group is smaller than that of the latter group, the two groups are merged into one group to balance the execution frequencies of the former and the latter groups so that execution is performed with the same execution frequency.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、リアルタイムシス
テムにおいて、2次電池の消費を最小にするタスクのス
ケジューリング方法に関するものである。
The present invention relates to a task scheduling method for minimizing secondary battery consumption in a real-time system.

【0002】[0002]

【従来の技術】従来の省電力を目的としたシステムの一
例が、1995年にIEEEから発行されたProce
edings of First Symopsium
onOperating Systems Desi
gn and Implementaion の第13
頁ないし第23頁に掲載された、Scheduling
for Reduced CPU Energy と
題するMark Weiser による論文に記載され
ている。
2. Description of the Related Art An example of a conventional system for power saving is a Proceed issued from IEEE in 1995.
edings of First Symposium
onOperating Systems Desi
13th of gn and Implementation
Scheduling published on pages 23 to 23
For Reduced CPU Energy in a paper by Mark Weiser.

【0003】本論文で述べられた従来のシステムは、C
PU、メモリ、クロックジェネレータと、周波数制御回
路、ディスクから構成されている。一般プログラムは、
ディスクに格納されている。メモリには、一般プログラ
ムの実行をスケジュール制御する手段が含まれる。本論
文では、一般プログラムの実行トレースデータを使った
シミュレーションにより、提案した3つのエネルギ節約
スケジューリングアルゴリズムを評価している。 1.unbound−delay perfect−f
uture(OPT):トレースデータ全体に渡ってア
イドル時間をなくすように最小スピードで動作する。し
かしながら、実行時に未来の動作の知識が必要となるの
で非現実的である。応答時間も大きくなり望ましくな
い。 2.bounded−delay limited−f
uture(FUTURE):ある一定時間以内(ウィ
ンドウという)でアイドル時間をなくすように最小スピ
ードで動作する。実行時に未来の動作の知識が必要とな
るので非現実的である。また応答時間はウィンドウ時間
内に収まり望ましい。 3.bounded−delay limited−p
ast(PAST):直前のウィンドウでの動作が次の
それに似ていると仮定してCPUスピードを定める。評
価結果は、adjustment intervalに
依存する。addjustment interval
が長くなるにつれて、PAST,FUTUREは、OP
Tに近づく。PASTの方がFUTUREよりもよい
(excess cycleを次のインターバルに持ち
越すことができるから)。
The conventional system described in this paper is
It consists of a PU, a memory, a clock generator, a frequency control circuit, and a disk. The general program is
Stored on disk. The memory includes means for controlling the schedule of the execution of the general program. In this paper, we evaluate three proposed energy-saving scheduling algorithms by simulation using the execution trace data of a general program. 1. unbound-delay perfect-f
result (OPT): Operate at the minimum speed so as to eliminate idle time over the entire trace data. However, this is unrealistic because it requires knowledge of future operations during execution. The response time is also undesirably increased. 2. bounded-delay limited-f
uture (FUTURE): Operates at the minimum speed so as to eliminate idle time within a certain time (called a window). This is unrealistic because it requires knowledge of future operations at runtime. The response time is desirably within the window time. 3. bounded-delay limited-p
ast (PAST): Determines the CPU speed assuming that the operation in the immediately preceding window is similar to the next one. The evaluation result depends on the adjustment interval. adjustment interval
PAST, FUTURE becomes OP
Approach T. PAST is better than FUTURE (since the access cycle can be carried over to the next interval).

【0004】また、特開平8−6681号公報には、
「省電力制御システム」として、複数のCPUを備える
マルチプロセッサシステムにおいて、プロセッサバスを
監視することで個々のCPUの動作状態を検出するプロ
セッサバス監視部と、システムの負荷状態を監視するシ
ステム状態監視部と、システム状態監視部からの通知に
基づいて個々のCPUによる消費電力を制御するシステ
ム状態制御部と、を設け、キー入力待ちなどのために特
定のCPUに対する負荷が少ない状態が続くと、システ
ム状態制御部により、当該CPUへ供給するクロックを
低い周波数に切り替えるシステムが開示されている。
[0004] Japanese Patent Application Laid-Open No. 8-6681 discloses that
As a "power saving control system", in a multiprocessor system having a plurality of CPUs, a processor bus monitoring unit that detects an operation state of each CPU by monitoring a processor bus, and a system state monitor that monitors a system load state Unit, and a system state control unit that controls power consumption by each CPU based on a notification from the system state monitoring unit, and when a state where the load on a specific CPU is small due to waiting for key input or the like continues, A system in which a system state control unit switches a clock supplied to the CPU to a low frequency is disclosed.

【0005】また、特開平8−6803号公報には、
「情報処理方法とその装置」として、消費電力を最小に
したマルチタスク実行の情報処理方法とその装置が開示
されている。これは、タスクが獲得しているハードウエ
ア資源とその消費電力を検出して、獲得したハードウエ
ア資源のトータル電力が大きいタスクの実行優先度を高
く設定して、オペレーティングシステムのスケジューラ
が、高い実行優先度のタスクを選択して、実行権を与え
る方法である。
[0005] Further, Japanese Patent Application Laid-Open No. 8-6803 discloses that
As an "information processing method and device thereof", an information processing method of multitask execution with minimum power consumption and a device thereof are disclosed. This is because the hardware resources acquired by the task and the power consumption thereof are detected, the execution priority of the task having the large total power of the acquired hardware resources is set high, and the scheduler of the operating system executes the high execution. This is a method of selecting tasks of priority and giving execution rights.

【0006】また、特開平8−50551号公報には、
「リアルタイムアプリケーションタスクスケジューリン
グ及び処理システム」として、ソフトウエアタスクの実
行スケジューリングに関し、特にリアルタイムシステム
用のオンラインタスクスケジューラに関し、タスク要求
がディスパッチャの実行時にそのデッドラインを満たす
かどうかを各要求について確認し、そのデッドラインの
できるだけ近くで終止するべく配置するかのように、C
PUの遅いビジー期間に基づいて、データベース内のタ
スクをスケジューリングする、ことが開示されている。
[0006] Also, Japanese Patent Application Laid-Open No. 8-50551 discloses that
As a `` real-time application task scheduling and processing system '', regarding the execution scheduling of software tasks, in particular, regarding an online task scheduler for a real-time system, check whether each task request satisfies its deadline when executing a dispatcher, As if arranged to end as close as possible to the deadline, C
It is disclosed to schedule tasks in the database based on the PU's late busy period.

【0007】[0007]

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

【0008】第1の問題点は、リアルタイムシステム向
けの考慮がなされておらず、プログラムの実行が完了し
なければならないデッドライン時刻を満たさない場合が
あるということである。
The first problem is that no consideration is given to a real-time system, and a deadline time at which execution of a program must be completed may not be satisfied.

【0009】その理由は、従来の技術がUNIXなどの
タイムシェアリング型のシステムを対象としているため
であり、リアルタイムシステムにおけるデッドライン時
刻を考慮に入れていないためである。
The reason is that the conventional technology is intended for a time-sharing type system such as UNIX, and does not take deadline time in a real-time system into consideration.

【0010】第2の問題点は、2次電池を含めた省電力
になっていないということである。その理由は、2次電
池の存在を考慮していないためである。
The second problem is that power saving including secondary batteries is not achieved. The reason is that the existence of the secondary battery is not considered.

【0011】また、上記各公報に記載の従来例において
も、リアルタイムシステムにおいて、2次電池の消費を
最小にするタスクスケジューリング方法については、開
示がない。
Further, even in the conventional examples described in the above publications, there is no disclosure of a task scheduling method for minimizing secondary battery consumption in a real-time system.

【0012】[発明の目的]本発明の目的は、CPU、
プログラムメモリ、周波数制御機能をもったクロックジ
ェネレータ、および2次電池を有するリアルタイムシス
テムにおいて、CPUに供給されプログラム実行に寄与
する周波数のα乗(α>1)に2次電池の消費電力が比
例することを利用して、リアルタイムシステムを構成す
るタスクのデッドラインを守り、かつ可能な限り低く一
定の周波数で実行させることにより、リアルタイムシス
テムにおいて、2次電池の消費を最小にするタスクのス
ケジューリング方法を提供することにある。
[Object of the Invention] An object of the present invention is to provide a CPU,
In a real-time system having a program memory, a clock generator having a frequency control function, and a secondary battery, the power consumption of the secondary battery is proportional to the α-th power (α> 1) of the frequency supplied to the CPU and contributing to program execution. By taking advantage of this fact, a task scheduling method for minimizing secondary battery consumption in a real-time system is performed by keeping the deadline of the tasks constituting the real-time system and executing the task at a constant frequency as low as possible. To provide.

【0013】[0013]

【課題を解決するための手段】本発明は、上記課題を解
決するための手段として、リアルタイム処理を行うため
の複数のタスクのスケジューリング方法において、同一
周波数で動作するタスクを1つのタスクグループとし、
該タスクグループ中の各タスクは、各タスクごとのデッ
ドライン順に並び、該タスクグループ中の最後のタスク
以外のタスクの実行終了時刻は、当該タスクのデッドラ
インより前であり、タスクグループの最後のタスクの実
行終了時刻は、当該タスクのデッドラインに等しい構成
を有し、リアルタイム処理のデッドラインまでに実行さ
れるタスクグループに、新規タスクを挿入する際に、該
新規タスクを挿入したタスクグループにおいて、該挿入
したタスクから該デッドラインを守れなくなる実行順序
のタスクまでを別のタスクグループに分割し、該分割さ
れて、隣接するタスクグループにおいて、前のタスクグ
ループの実行周波数が後のタスクグループの実行周波数
より小さい場合に、前のタスクグループと後のタスクグ
ループの実行周波数を平均化して、同一実行周波数で実
行するために、該2つのタスクグループを1つのタスク
グループにマージする、ことを特徴とするタスクスケジ
ューリング方法を提供するものである。
According to the present invention, as a means for solving the above-mentioned problems, in a method for scheduling a plurality of tasks for performing real-time processing, tasks operating at the same frequency are grouped into one task group.
Each task in the task group is arranged in the order of deadline for each task, and the execution end time of tasks other than the last task in the task group is before the deadline of the task, and The execution end time of a task has a configuration equal to the deadline of the task, and when a new task is inserted into a task group executed until the deadline of real-time processing, the The task from the inserted task to the task in the execution order that cannot keep the deadline is divided into another task group, and the divided task is executed. If the execution frequency is lower than the execution frequency, The averaged, in order to run in the same execution frequency, to merge the two task groups to one task group, that is to provide a task scheduling method comprising.

【0014】また、CPU100と、メモリ110と、
2次電池120と、クロックジェネレータ130と、該
CPUへ供給するクロックの周波数を制御する周波数制
御回路140を有するリアルタイムシステム001にお
いて、メモリ110には、リアルタイム処理を行うため
の複数のタスクと、該タスクの実行をスケジュール制御
するスケジューラ112と、該タスクの実行管理キュー
113と、を有し、該スケジューラ112は、リアルタ
イムシステム001において、イベントを処理するタス
クTkのデッドラインを算出するステップ(A1)と、
該デッドラインから実行管理キューの適切な位置にタス
クTkの実行を行うための実行キューデータをタスクグ
ループに挿入するステップ(A2,A3)と、該タスク
Tkが挿入された結果、増えるタスクの仕事量wおよび
タスクの実行周波数fを計算するステップ(A4)と、
当該タスクグループ(TGj)中のタスクT(j,1)
からT(j,nj)までを実行周波数fで実行したとき
に、タスクのデッドラインが守れるかどうかを調べ、タ
スクTkもしくは直前タスクグループの最後のタスクT
(j,m)からT(j,nj)までの中でデッドライン
を守れない最初のタスクTpを求めるステップ(A5)
と、該タスクTkを挿入したタスクグループTGjにあ
るタスク数をnjとすると、タスクT(j,1)からT
(j,nj)までのタスクのデッドラインが守れるよう
にタスクグループの分割を行うため、タスクTkもしく
はT(j,n)からTpまでを一つのタスクグループと
して分割し、必要なデータを当該タスクグループ管理デ
ータに設定するステップ(A7)と、隣接するタスクグ
ループTGjとTGj+1において、TGjの実行周波
数<TGj+1の実行周波数でない場合は、上記ステッ
プ(A5、A7)をタスクT(j,nj)まで行うステ
ップ(A6,A9)と、隣接するタスクグループTGj
とTGj+1において、TGjの実行周波数<TGj+
1の実行周波数の場合は、タスクグループTGjとTG
j+1の実行周波数を平均化して、同一実行周波数で実
行するために該2つのタスクグループを1つのタスクグ
ループにマージするステップ(A10)と、実行中のタ
スクの実行が終了した場合に、次に実行するタスクのタ
スクグループが異なるかどうかを調べるステップ(S4
1)と、該異なる場合は、次のタスクグループの実行周
波数を周波数制御回路140に設定するステップ(S4
2)と、次に、実行管理キューの先頭のタスクグループ
に含まれる先頭タスクをキューから外し、次に実行すべ
きタスクの実行を開始するステップ(S43)と、を有
することを特徴とするタスクスケジューリング方法でも
ある。
The CPU 100, the memory 110,
In a real-time system 001 having a secondary battery 120, a clock generator 130, and a frequency control circuit 140 for controlling the frequency of a clock supplied to the CPU, the memory 110 has a plurality of tasks for performing real-time processing. A scheduler 112 for scheduling and controlling the execution of the task; and an execution management queue 113 for the task. The scheduler 112 calculates a deadline of the task Tk for processing the event in the real-time system 001 (A1). When,
A step (A2, A3) of inserting execution queue data for executing the task Tk from the deadline into an appropriate position of the execution management queue into a task group, and a task to be added as a result of the insertion of the task Tk Calculating the quantity w and the task execution frequency f (A4);
Task T (j, 1) in the task group (TGj)
To T (j, nj) at the execution frequency f, it is checked whether or not the deadline of the task can be maintained. The task Tk or the last task T in the immediately preceding task group is checked.
Step (A5) of finding the first task Tp that cannot keep the deadline from (j, m) to T (j, nj)
And the number of tasks in the task group TGj into which the task Tk is inserted is nj, the task T (j, 1)
In order to divide the task group so that the deadline of the tasks up to (j, nj) is protected, the tasks Tk or T (j, n) to Tp are divided into one task group, and necessary data is divided into the tasks. If the step (A7) for setting the group management data and the execution frequency of TGj is not smaller than the execution frequency of TGj + 1 in the adjacent task groups TGj and TGj + 1, the above steps (A5, A7) are repeated until the task T (j, nj). Steps (A6, A9) to be performed and the adjacent task group TGj
And TGj + 1, the execution frequency of TGj <TGj +
In the case of the execution frequency of 1, task groups TGj and TG
averaging the execution frequency of j + 1 and merging the two task groups into one task group to execute at the same execution frequency (A10); Investigating whether the task groups of the tasks to be executed are different (S4
1) and, if not, a step of setting the execution frequency of the next task group in the frequency control circuit 140 (S4).
2) and a step (S43) of removing the first task included in the first task group of the execution management queue from the queue and starting the execution of the task to be executed next (S43). It is also a scheduling method.

【0015】また、前記実行管理キュー113は、同一
周波数で実行されるタスクグループごとに、実行終了時
刻の順に並べられ、該タスクグループの実行開始時刻、
タスクグループの実行終了時刻、タスクグループでの実
行周波数とから構成されるタスクグループの管理データ
と、タスクの実行開始時刻、実行終了時刻、デッドライ
ン、仕事量から構成される各タスクの管理データと、を
有することを特徴とするタスクスケジューリング方法で
もある。
The execution management queue 113 is arranged in the order of the execution end time for each task group executed at the same frequency, and the execution start time,
Task group management data consisting of task group execution end time and task group execution frequency, and task task management data consisting of task execution start time, execution end time, deadline, and workload , The task scheduling method.

【0016】また、CPUの周波数が固定数倍に制御さ
れるリアルタイムシステムにおいて、算出した周波数以
上で最も近い前記固定数倍の周波数を求めるステップを
有することを特徴とするタスクスケジューリング方法で
もある。
Further, in a real-time system in which the frequency of the CPU is controlled to a fixed multiple, a task scheduling method is characterized in that the method further includes a step of finding the frequency of the fixed multiple that is the closest to the calculated frequency.

【0017】また、電源に2次電池を用いることを特徴
とするタスクスケジューリング方法でもある。
[0017] A task scheduling method is characterized in that a secondary battery is used as a power supply.

【0018】また、上述したタスクスケジューリング方
法をコンピュータに行なわせるプログラムを記録したこ
とを特徴とする記録媒体でもある。
Further, there is provided a recording medium on which a program for causing a computer to execute the above-described task scheduling method is recorded.

【0019】[作用]本発明によれば、CPU周波数
を、デッドラインが終了するまでに、タスクが終了でき
るように、かつ最小の周波数となるように、計算し、こ
れに基づいて、タスクの実行開始時刻、実行終了時刻を
設定して、タスクのスケジューリングを行なうことによ
り、リアルタイムシステムを構成するタスクのデッドラ
インを守り、かつ、CPUを可能な限り低く一定の周波
数で実行させることができ、その結果、2次電池の消費
を最小にすることができる。
[Operation] According to the present invention, the CPU frequency is calculated so that the task can be completed by the end of the deadline and to have the minimum frequency. By setting the execution start time and the execution end time and scheduling the tasks, the deadline of the tasks constituting the real-time system can be protected, and the CPU can be executed at a constant frequency as low as possible. As a result, the consumption of the secondary battery can be minimized.

【0020】そのポイントは、CPUを可能な限り低く
一定の周波数で実行することにより、2次電池の消費を
最小にすることができる点を利用しているところであ
る。
The point is to utilize the point that the consumption of the secondary battery can be minimized by executing the CPU at a constant frequency as low as possible.

【0021】また、リアルタイム処理を行うための、複
数の、同一周波数で動作するタスクを1つのタスクグル
ープとし、新規タスクを挿入する際に、該新規タスクを
挿入したタスクグループにおいて、該挿入したタスクか
ら前記リアルタイム処理のデッドラインを守れなくなる
実行順序のタスクまでを別のタスクグループに分割し、
該分割されて、隣接するタスクグループにおいて、前の
タスクグループの実行周波数が後のタスクグループの実
行周波数より小さい場合には、該2つのタスクグループ
を1つのタスクグループにマージして、前のタスクグル
ープと後のタスクグループの実行周波数を平均化して、
同一実行周波数で実行することにより、リアルタイムシ
ステムを構成するタスクのデッドラインを守り、かつ可
能な限り低く一定の周波数で実行させることが可能とな
る。
A plurality of tasks operating at the same frequency for real-time processing are set as one task group, and when a new task is inserted, the inserted task is included in the task group into which the new task is inserted. From to the task in the execution order that can not keep the deadline of the real-time processing is divided into another task group,
If the execution frequency of the previous task group is smaller than the execution frequency of the subsequent task group in the divided adjacent task groups, the two task groups are merged into one task group, and the previous task group is merged. By averaging the execution frequency of the group and the later task group,
By executing at the same execution frequency, it is possible to keep the deadline of the tasks constituting the real-time system and execute the task at a constant frequency as low as possible.

【0022】また、2次電池の消費電力は、CPUに供
給されプログラム実行に寄与する周波数のα乗(α>
1)に比例するため、CPUの周波数を低く、かつ一定
にすることにより、2次電池の消費を最小にすることが
可能となる。
The power consumption of the secondary battery is determined by the power of the frequency supplied to the CPU and contributing to the execution of the program.
Since it is proportional to 1), it is possible to minimize the consumption of the secondary battery by keeping the frequency of the CPU low and constant.

【0023】このように、本発明によれば、リアルタイ
ムシステムにおいて、 (1)消費電力を最小にするようにタスクをスケジュー
リングする; (2)タスクが実行を終了しなければならない時刻を守
るようにスケジューリングする;ことができる。
As described above, according to the present invention, in a real-time system, (1) schedule a task so as to minimize power consumption; (2) observe a time at which the task must end its execution. Scheduling;

【0024】また、本発明は、上記方法を記述したコン
ピュータプログラムを格納したことを特徴とする記録媒
体としての、CD−ROMやフロッピーディスク等か
ら、プログラムをコンピュータのメモリに読み込み、こ
のプログラムにより、CPUを制御して、本発明を実現
することができる。
According to the present invention, a program is read from a CD-ROM, a floppy disk, or the like as a recording medium storing a computer program describing the above-described method into a memory of the computer, and the program is read by the program. The present invention can be realized by controlling the CPU.

【0025】[0025]

【発明の実施の形態】[実施形態1] [構成の説明]図1は、本発明の実施形態の構成を示す
ブロック図である。図1を参照すると、本発明のタスク
スケジューリング方式の実施形態は、プログラム制御に
より動作する。リアルタイムシステム001は、CPU
100と、メモリ110と、2次電池120と、クロッ
クジェネレータ130と、周波数制御回路140から構
成されている。
DESCRIPTION OF THE PREFERRED EMBODIMENTS [First Embodiment] [Description of Configuration] FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention. Referring to FIG. 1, an embodiment of the task scheduling scheme of the present invention operates under program control. The real-time system 001 is a CPU
100, a memory 110, a secondary battery 120, a clock generator 130, and a frequency control circuit 140.

【0026】メモリ110には、リアルタイム処理を行
うためのn個のタスク手段111−i(i=1,
2,..n)と、当該タスクの実行をスケジュール制御
する手段112、及び手段112を処理するためのデー
タ113が含まれる。手段111をタスク、手段112
をスケジューラ、データ113を実行管理キューと呼ぶ
ことにする。また、周波数制御回路140は、CPU1
00へ供給するクロック周波数を制御できる。
The memory 110 has n task means 111-i (i = 1, 1) for performing real-time processing.
2,. . n), means 112 for controlling the schedule of the execution of the task, and data 113 for processing the means 112. Means 111 as a task, means 112
Is called a scheduler, and the data 113 is called an execution management queue. In addition, the frequency control circuit 140
00 can be controlled.

【0027】これらの手段の機能の概略を説明すると、
タスク111−i(i=1,2,..n)は、リアルタ
イムシステム001の外部から入ってくるイベントiに
対応して起動され、スケジューラ112に登録される。
タスク111は、外部から入ってくるイベントに対して
一定時間以内に処理を完了させなければならず、この処
理を終了させなければならない時刻をデッドラインと言
う。本発明では、スケジューラ112は、当該タスクの
デッドライン(実行を終了しなければならない時刻)を
守りつつ、可能な限り低く一定の周波数で実行させるよ
うにスケジューリングを行うことを特徴とする。
The outline of the functions of these means is as follows.
The task 111-i (i = 1, 2,... N) is activated in response to an event i coming from outside the real-time system 001 and registered in the scheduler 112.
The task 111 must complete processing within a certain period of time for an event coming from outside, and the time at which this processing must be terminated is called a deadline. The present invention is characterized in that the scheduler 112 performs scheduling so that the task is executed at a constant frequency as low as possible while observing the deadline (time at which the execution must be completed) of the task.

【0028】図2に、本方式で利用されるデータ構造で
ある実行管理キュー113の一例を示す。タスクグルー
プにおいて、タスクは、同一周波数で実行され、また実
行終了時刻の順に並べられている。各タスクグループを
管理するデータは、タスクグループの実行開始時刻(こ
れは先頭のタスクの実行開始時刻に等しい)、タスクグ
ループの実行終了時刻(これは最後のタスクの実行終了
時刻に等しい)、タスクグループでの実行周波数から構
成される。さらにタスクグループはタスクグループの実
行終了時刻の順に並べられている。
FIG. 2 shows an example of the execution management queue 113 which is a data structure used in this method. In the task group, the tasks are executed at the same frequency and are arranged in the order of the execution end time. The data that manages each task group includes the task group's execution start time (which is equal to the first task's execution start time), task group's execution end time (which is equal to the last task's execution end time), and task It consists of the execution frequency in the group. Further, the task groups are arranged in the order of the execution end times of the task groups.

【0029】各タスクの実行を管理するデータは、タス
クの実行開始時刻、実行終了時刻、デッドライン、仕事
量から構成される。タスクグループの最後のタスクの実
行終了時刻はデッドラインに等しいが、最後以外のタス
クの実行終了時刻はデッドラインよりも前である。
The data for managing the execution of each task includes a task execution start time, a task execution end time, a deadline, and a workload. The execution end time of the last task in the task group is equal to the deadline, but the execution end times of the other tasks are earlier than the deadline.

【0030】[動作の説明]次に、図1〜図5を参照し
て本実施形態の全体の動作について詳細に説明する。
[Explanation of Operation] Next, the overall operation of the present embodiment will be described in detail with reference to FIGS.

【0031】図3〜図5は、スケジューラ112の処理
を示すフローチャートである。
FIGS. 3 to 5 are flowcharts showing the processing of the scheduler 112.

【0032】まず、イベントkが本リアルタイムシステ
ムに到着したときの処理を図3、図4を参照して説明す
る。
First, the processing when the event k arrives at the real-time system will be described with reference to FIGS.

【0033】本イベントを処理するタスクTkが、メモ
リ210に含まれるタスク111−1・・・111−n
から見い出され、タスクTkのデッドラインが計算され
る。このデッドラインの計算は、例えば、イベントの到
着時刻をa、イベントの処理をt時間以内に完了しなけ
ればならないとすると、イベントが処理を完了しなけれ
ばならない時刻dは、d=a+tと計算するようなもの
である(図3のステップA1)。
The task Tk that processes this event is composed of tasks 111-1 to 111 -n included in the memory 210.
And the deadline of task Tk is calculated. The deadline is calculated by, for example, assuming that the arrival time of the event is a and the processing of the event must be completed within t hours, and the time d at which the processing of the event must be completed is calculated as d = a + t. (Step A1 in FIG. 3).

【0034】次に、タスクTkのデッドラインから実行
管理キューの適切な位置(例えば図2に示す位置)にタ
スクTkの実行を行うためのデータ構造を挿入する(図
3のステップA2,A3)。
Next, a data structure for executing the task Tk is inserted from the deadline of the task Tk into an appropriate position in the execution management queue (for example, the position shown in FIG. 2) (steps A2 and A3 in FIG. 3). .

【0035】次に、タスクTkが挿入された結果、増え
るタスクの仕事量wおよびタスクの実行周波数fを計算
する(図3のステップA4)。
Next, as a result of the insertion of the task Tk, the work amount w of the task and the execution frequency f of the task, which increase, are calculated (step A4 in FIG. 3).

【0036】同一グループのタスクT(j,1)からT
(j,nj)までを実行周波数fで実行したときに、タ
スクのデッドラインが守れるかどうかを調べ、Tkもし
くは直前のタスクグループの最後のタスクT(j,m)
からT(j,nj)までのタスクの中でデッドラインを
守れない最初のタスクをTpとする(図4のステップA
5)。
Tasks T (j, 1) to T in the same group
When executing up to (j, nj) at the execution frequency f, it is checked whether or not the deadline of the task can be maintained, and Tk or the last task T (j, m) of the immediately preceding task group is checked.
Tp is the first task that cannot keep the deadline among tasks from T to T (j, nj) (step A in FIG. 4).
5).

【0037】今、タスクグループTGjのi番目、タス
クT(j,i)とタスクT(j,i+1)の間に挿入さ
れたとする。タスクグループTGjにあるタスク数をn
jとすると、T(j,1)からT(j,nj)までのタ
スクのデッドラインが守れるようにタスクグループの分
割を行うため、TkもしくはT(j,m)からTpまで
を一つのタスクグループとして分割し、必要なデータを
当該タスクグループ管理データに設定する(図4のステ
ップA7)。
Now, it is assumed that the task group TGj is inserted between the i-th task T (j, i) and the task T (j, i + 1). Let n be the number of tasks in task group TGj
Assuming that j, the task group is divided so that the deadline of the tasks from T (j, 1) to T (j, nj) is protected, so that one task from Tk or T (j, m) to Tp is performed. The data is divided into groups, and necessary data is set in the task group management data (step A7 in FIG. 4).

【0038】隣接するタスクグループTGjとTGj+
1において、TGjの実行周波数<TGj+1の実行周
波数でない場合(A8)は、上記ステップ(A5、A
7)をタスクT(j,nj)まで行う(A6,A9)。
Adjacent task groups TGj and TGj +
1, if the execution frequency of TGj is not smaller than the execution frequency of TGj + 1 (A8), the above steps (A5, A5
7) is performed up to task T (j, nj) (A6, A9).

【0039】隣接するタスクグループTGjとTGj+
1において、TGjの実行周波数<TGj+1の実行周
波数の場合(A8)は、タスクグループTGjとTGj
+1の実行周波数を平均化して、同一実行周波数で実行
するために該2つのタスクグループの実行周波数を平均
化して1つのタスクグループにマージする(A10)。
Adjacent task groups TGj and TGj +
1, when the execution frequency of TGj <the execution frequency of TGj + 1 (A8), the task groups TGj and TGj
The execution frequency of +1 is averaged, and the execution frequencies of the two task groups are averaged and merged into one task group to execute at the same execution frequency (A10).

【0040】次に図5を用いて現在実行中のタスクの実
行が終了した場合の処理を説明する。
Next, the processing in the case where the execution of the currently executing task has been completed will be described with reference to FIG.

【0041】スケジューラ手段112は、まず次に実行
するタスクのタスクグループが異なるかどうかを調べ
(S41)、異なる場合は次のタスクグループの実行周
波数を周波数制御回路140に設定する(S42)。次
に、実行管理キューの先頭のタスクグループに含まれる
先頭タスクをキューから外し、次に実行すべきタスクと
して実行を開始する準備を行い、当該タスクの実行を開
始する(S43)。
The scheduler means 112 first checks whether the task group of the task to be executed next is different (S41), and if it is different, sets the execution frequency of the next task group in the frequency control circuit 140 (S42). Next, the first task included in the first task group in the execution management queue is removed from the queue, preparations are made to start execution as the next task to be executed, and the execution of the task is started (S43).

【0042】[具体例の説明]タスクグループにおい
て、タスクは同一周波数で実行される。また、実行終了
時刻の順に並べられている。各タスクグループを管理す
るデータは、タスクグループの実行開始時刻(これは先
頭のタスクの実行開始時刻に等しい)、タスクグループ
の実行終了時刻(これは最後のタスクの実行終了時刻に
等しい)、タスクグループでの実行周波数から構成され
る。
[Explanation of Specific Example] In the task group, the tasks are executed at the same frequency. Also, they are arranged in the order of the execution end time. The data that manages each task group includes the task group's execution start time (which is equal to the first task's execution start time), task group's execution end time (which is equal to the last task's execution end time), and task It consists of the execution frequency in the group.

【0043】例として、図6に示すように、タスクグル
ープ1が1つあったと考え、そのタスクグループ1にタ
スク1、2、3が含まれていたとする。
As an example, assume that there is one task group 1 as shown in FIG. 6, and that the task group 1 includes tasks 1, 2, and 3.

【0044】タスク1の実行開始時刻は、時刻100
秒、終了時刻は110秒、デッドラインは113秒、仕
事量は250であり、タスク2の実行開始時刻は、時刻
110秒、終了時刻は115秒、デッドラインは116
秒、仕事量は125であり、タスク3の実行開始時刻は
時刻115秒、終了時刻は130秒、デッドラインは1
30秒、仕事量は375である、とする。
The execution start time of task 1 is 100
Seconds, the end time is 110 seconds, the deadline is 113 seconds, and the workload is 250. The execution start time of task 2 is 110 seconds, the end time is 115 seconds, and the deadline is 116.
Seconds, the workload is 125, the execution start time of task 3 is 115 seconds, the end time is 130 seconds, and the deadline is 1
Assume that the work amount is 375 for 30 seconds.

【0045】タスクグループ1の実行開始時刻は、10
0秒、実行終了時刻は130秒、実行周波数は25MH
zとする。
The execution start time of task group 1 is 10
0 seconds, execution end time is 130 seconds, execution frequency is 25 MH
z.

【0046】また、仕事量の和は750である。さらに
タスクグループはタスクグループの実行終了時刻の順に
並べられている。各タスクの実行を管理するデータはタ
スクの実行開始時刻、実行終了時刻、デッドライン、仕
事量から構成される。
The sum of the work amounts is 750. Further, the task groups are arranged in the order of the execution end times of the task groups. The data for managing the execution of each task includes a task execution start time, a task execution end time, a deadline, and a workload.

【0047】タスクグループの最後のタスクの実行終了
時刻は、デッドラインに等しいが、最後以外のタスクの
実行終了時刻はデッドラインよりも前である。
The execution end time of the last task in the task group is equal to the deadline, but the execution end time of the other tasks is earlier than the deadline.

【0048】図3〜図5は、手段112の処理を示すフ
ローチャートである。
FIGS. 3 to 5 are flowcharts showing the processing of the means 112.

【0049】次に、図1の構成図、図3〜図5のフロー
チャート、図6、図7のデータ構造を参照して本例のよ
り具体的な動作について詳細に説明する。なお、文中の
数値は、説明用に簡略にしたものである。
Next, a more specific operation of the present embodiment will be described in detail with reference to the configuration diagram of FIG. 1, the flowcharts of FIGS. 3 to 5, and the data structures of FIGS. The numerical values in the text are simplified for explanation.

【0050】今、時刻90秒にて、イベント4が本リア
ルタイムシステムに到着したときの処理を図6を参照し
て説明する。このイベントが25秒以内の応答を要求し
ているとする。本イベントを処理するタスク4が見い出
され、タスク4のデッドラインは90十25=115秒
と計算される(図3のステップA1)。
Now, the processing when event 4 arrives at the real-time system at 90 seconds will be described with reference to FIG. Assume that this event requires a response within 25 seconds. Task 4 that processes this event is found, and the deadline of task 4 is calculated as 90, 25 = 115 seconds (step A1 in FIG. 3).

【0051】タスク4の仕事量は100とする。次にタ
スク4のデッドラインから実行管理キューの適切な位置
にタスク4の実行を行うためのデータ構造を挿入する。
今、タスクグループ1のタスク1とタスク2の間に挿入
されたとする(ステップA2、ステップA3)。
The work amount of task 4 is assumed to be 100. Next, a data structure for executing the task 4 is inserted at an appropriate position in the execution management queue from the deadline of the task 4.
Now, it is assumed that a task group 1 is inserted between task 1 and task 2 (step A2, step A3).

【0052】タスクグループ1にあるタスク数は3であ
るので、タスク1からタスク3までのタスクのデッドラ
インが守れるようにタスクグループの分割を行う(ステ
ッブA4からA7)。ステップA4では、タスク4が挿
入された結果、増えるタスクの仕事量wおよびタスクの
実行周波数fを計算する(ステップA4)。すなわち、
周波数fは、仮定から仕事量w=100、周波数f=仕
事量(750+100)/実行時間(130−100)
=28.33MHzとなる。
Since the number of tasks in the task group 1 is 3, the task group is divided so that the deadline of the tasks from the task 1 to the task 3 is protected (steps A4 to A7). In step A4, as a result of the task 4 being inserted, the work amount w of the task and the execution frequency f of the task, which increase, are calculated (step A4). That is,
The frequency f is assumed to be the workload w = 100, the frequency f = the workload (750 + 100) / the execution time (130-100)
= 28.33 MHz.

【0053】タスク1からタスク3までのタスクを実行
周波数f=28.33MHzで実行したときに、タスク
のデッドラインが守れるかどうかを調べる。
When the tasks from task 1 to task 3 are executed at the execution frequency f = 28.33 MHz, it is checked whether the deadline of the task can be maintained.

【0054】タスク1のデッドラインは、l00(秒)
+250/28.33=108.82秒;タスク4のデ
ッドラインは、108.82(秒)+100/28.3
3=112.29秒;タスク2のテッドラインは、11
2.29(秒)+125/28.33=116.70
秒;タスク3のデッドラインは、116.70(秒)+
375/28.33=130秒;となる。
The deadline of task 1 is 100 (second)
+ 250 / 28.33 = 108.82 sec; Task 4 deadline is 108.82 (sec) + 100 / 28.3
3 = 112.29 seconds; Task 2 ted line is 11
2.29 (sec) + 125 / 28.33 = 116.70
Seconds; Task 3 deadline is 116.70 (seconds) +
375 / 28.33 = 130 seconds.

【0055】タスク1からタスク4までのタスクの中で
デッドラインを守れない最初のタスクはタスク2である
(ステップA5)。
The first task that cannot keep the deadline among tasks 1 to 4 is task 2 (step A5).

【0056】そこで、図7に示すように、タスク1、
4、2を一つのタスクグループ1’として分割し、必要
なデータを当該タスクグループ管理データに設定する
(図4のステップA7)。
Therefore, as shown in FIG.
4 and 2 are divided into one task group 1 ', and necessary data is set in the task group management data (step A7 in FIG. 4).

【0057】図7に示すように、新たに作られるタスク
グループ1’に設定される情報は以下のように計算され
る。タスクグループ1’の実行開始時刻は100秒、実
行終了時刻は116秒(=タスク2のデッドライン)、
実行周波数は、仕事量(250+100+125)/実
行時間(116−100)=29.69MHzとなる。
また、仕事量の和は475である。
As shown in FIG. 7, the information set for the newly created task group 1 'is calculated as follows. The execution start time of task group 1 'is 100 seconds, the execution end time is 116 seconds (= deadline of task 2),
The execution frequency is: work amount (250 + 100 + 125) / execution time (116-100) = 29.69 MHz.
The sum of the workload is 475.

【0058】以上から、タスク1の実行開始時刻は、時
刻100秒、終了時刻は100+250/29.69=
108.42秒、タスク4の実行開始時刻は、時刻10
8.42秒、終了時刻は108.42+100/29.
69=111.79秒、タスク2の実行開始時刻は、時
刻111.79秒、終了時刻は111.79+125/
29.69=116秒となり、タスク1,4,2は、各
タスクのデッドラインよりも前に終了する。
From the above, the execution start time of task 1 is 100 seconds, and the end time is 100 + 250 / 29.69 =
108.42 seconds, the execution start time of task 4 is 10
8.42 seconds, end time is 108.42 + 100/29.
69 = 111.79 seconds, the execution start time of task 2 is 111.79 seconds, and the end time is 111.79 + 125 /
29.69 = 116 seconds, and tasks 1, 4, and 2 end before the deadline of each task.

【0059】ステップA4実行の結果、隣接するタスク
グループ1’と2’において、2’の実行周波数の方が
1’の実行周波数よりも大きくなる場合には、1’と
2’の実行周波数を平均化して同一実行周波数で実行す
るようにする。このために、タスクグループのマージが
行なわれる(ステップA10)。
When the execution frequency of 2 ′ is higher than the execution frequency of 1 ′ in the adjacent task groups 1 ′ and 2 ′ as a result of the execution of step A4, the execution frequencies of 1 ′ and 2 ′ are changed. Averaging is performed so as to execute at the same execution frequency. For this, the task groups are merged (step A10).

【0060】この例の場合、タスクグループ1’の周波
数は29.69MHz、タスクグループ2’の周波数は
25MHz(図6に示す)なので、ステップA10は行
なわれず、ステップA9からA5に戻ることは不要であ
る。
In this example, since the frequency of the task group 1 'is 29.69 MHz and the frequency of the task group 2' is 25 MHz (shown in FIG. 6), step A10 is not performed, and it is unnecessary to return from step A9 to A5. It is.

【0061】残りのタスク3については、新たにタスク
グループ2’とする。タスクグループ2’の実行開始時
刻は116秒、実行終了時刻は130秒(=タスク3の
デッドライン)、実行周波数は250/14=17.8
6となる。また、仕事量の和は、250である。
The remaining task 3 is newly set as a task group 2 '. The execution start time of task group 2 ′ is 116 seconds, the execution end time is 130 seconds (= deadline of task 3), and the execution frequency is 250/14 = 17.8.
It becomes 6. The sum of the workload is 250.

【0062】次に、図5を用いて現在実行中のタスクの
実行が終了した場合の処理を説明する。いま、タスクグ
ループが変わって、タスクグループ1’の先頭から処理
されるものとする。スケジューラ手段112は、まず、
次に実行するタスクのタスクグループが異なるかどうか
を調べ、異なる場合は、次のタスクグループの実行周波
数31.67MHzを周波数制御回路140に設定す
る。次に、実行管理キューの先頭のタスクグループに含
まれる先頭タスク1をキューから外し、次に実行される
べきタスクとして実行を開始する準備を行ない、当該タ
スクの実行を開始する。
Next, the processing in the case where the execution of the currently executing task has been completed will be described with reference to FIG. Now, it is assumed that the task group is changed and processing is performed from the beginning of the task group 1 ′. The scheduler means 112 first
It is checked whether the task group of the next task to be executed is different. If the task group is different, the execution frequency of the next task group is set to 31.67 MHz in the frequency control circuit 140. Next, the first task included in the first task group in the execution management queue is removed from the queue, and preparations are made to start execution as the next task to be executed, and the execution of the task is started.

【0063】[実施形態2]リアルタイムシステム中の
周波数制御回路において、CPUの周波数が1/2倍、
1/4 倍..のように固定数倍にしか低く制御できな
い場合のリアルタイムシステムのスケジューラの処理を
説明する。
[Embodiment 2] In the frequency control circuit in the real-time system, the frequency of the CPU is 1/2 times,
1/4 times. . The process of the scheduler of the real-time system in the case where the control can be performed only at a fixed number of times as described above will be described.

【0064】本実施形態が、実施形態1の図3、図4と
異なる点は、図4のステップA7とステップA10の中
の実行周波数の設定において、関数Fが入った点だけで
あり、他の動作は、前述した実施形態1と全く同じであ
る。
This embodiment differs from FIGS. 3 and 4 of the first embodiment only in that a function F is included in the setting of the execution frequency in steps A7 and A10 in FIG. Is exactly the same as in the first embodiment.

【0065】すなわち、本実施形態では、以下の部分が
異なるだけである。 (A7’): : TGj ’の実行周波数:=F((TGj ’の実行終了時刻−TG
j ’の実行開始時刻)/TGj ’の仕事量) ; : (A10’): : TGj の実行周波数:=F((TGj の実行終了時刻−TGj の
実行開始時刻)/TGj の仕事量) ; : 関数F(x)は、引数xの値以上で最も近いCPUの固
定数倍の周波数を求める関数であり、CPUの有する固
定数倍の周波数が、f1 ,f2 ,…fn (f1<f2
…<fn )である時に、関数F(x)の引数xについ
て、fi-1 <x<fi (2≦i<n)となるfi を返す
関数である。
That is, in the present embodiment, only the following parts are different. (A7 '):: TGj' execution frequency: = F ((TGj 'execution end time-TG
: (A10 '):: TGj execution frequency: = F ((TGj execution end time-TGj execution start time) / TGj work); : function F (x) is a function for obtaining the fixed multiple of the frequency of the nearest CPU above the value of the argument x, the fixed multiple of the frequency with the CPU is, f 1, f 2, ... f n (f 1 <f 2 <
... <When a f n), the arguments x of the function F (x), is a function that returns the f i-1 <x <f i (2 ≦ i <n) and becomes f i.

【0066】そこで、引数xとして、ステップA4で計
算して求めた周波数を、関数F(X)に入力することに
より、算出した周波数以上で最も近い前記固定数倍の周
波数を求めることができる。
Then, by inputting the frequency calculated in step A4 as the argument x to the function F (X), the closest multiple of the calculated frequency that is equal to or higher than the calculated frequency can be obtained.

【0067】また、本発明は、上述した方法を記述した
コンピュータプログラムを格納したCD−ROM等の記
録媒体でもあり、この記録媒体から、プログラムをコン
ピュータにインストールすることにより、本発明は、容
易に実施可能となる。
The present invention is also a recording medium such as a CD-ROM in which a computer program describing the above-described method is stored. By installing the program from the recording medium into a computer, the present invention can be easily implemented. It can be implemented.

【0068】以下、図3、図4のフローチャートの各ス
テップの文章を記載しておく。 (A1):イベントkに対応するタスクTkを見い出し、
当該タスクのデッドライン時刻を計算する; (A2):実行管理キューのデータ構造を参照して、タ
スクグループの実行開始時刻<タスクTkのデッドライン
≦タスクグループの実行終了時刻となるタスクグループ
TGjを見い出す; (A3):タスクT(j,i)のデッドライン<Tkのデッドラ
イン<T(j,i+1)のデッドラインとなるT(j,i)を見い出
す,m:=i; (A4):タスクT(j,1)からタスクT(j,nj) までの仕事
量の和Wを求める;仕事量Wの実行に必要な周波数f:
=W/( タスクT(j,nj) の実行終了時刻−タスクT(j,1)
の実行開始時刻 ); (A5):実行周波数fでタスクT(j,m)からT(j,nj) を
実行しようとした時に最初にデッドラインを守れないタ
スクをT(j,p)とする; (A6):p≦nj か?; (A7):タスクT(j,m)からタスクT(j,p)をタスクグル
ープTGj ’として分割する; TGj ’の実行開始時刻:=T(j,m)の実行開始時刻; TGj ’の実行終了時刻:=T(j,p)のデットライン; TGj ’の仕事量:=T(j,m)からT(j,p)までの仕事量の
和; TGj ’の実行周波数:=(TGj ’の実行終了時刻−TGj
’の実行開始時刻)/TGj ’の仕事量; TGj ’に属するタスクを新たにT(j ’,i) (i=1,…
nj’)と番号を振り直す; T(j ’,i) ( i=1,…nj’)の実行開始時刻:=T(j
’,i-1) の実行終了時刻; T(j ’,i) (i=1,…nj’)の実行終了時刻:=T(j
’,i) の実行開始時刻+T(j ’,i) の仕事量/TGj ’
の実行周波数; (A8):タスクグループTGj の実行周波数<タスクグ
ループTGj+1 の実行周波数か?; (A9):m:=p+1; (A10):タスクグループTGj とタスクグループTGj+
1 をタスクグループTGj にマージする; TGj の実行開始時刻:=TGj の実行開始時刻; TGj の実行終了時刻:=TGj+1 の実行終了時刻; TGj の仕事量:=TGj の仕事量+TGj+1 の仕事量; TGj の実行周波数:=(TGj の実行終了時刻−TGj の実
行開始時刻)/TGj の仕事量; TGj に属するタスクを新たにT(j,i)(i=1,…nj)と
番号を振り直す; T(j,i)(i=1,…nj)の実行開始時刻:=T(j,i-1)の
実行終了時刻; T(j,i)(i=1,…nj)の実行終了時刻:=T(j,i)の実
行開始時刻+Tj’,iの仕事量/TGj の実行周波数; 以上。
The text of each step in the flowcharts of FIGS. 3 and 4 will be described below. (A1): Find task Tk corresponding to event k,
Calculate the deadline time of the task; (A2): Referring to the data structure of the execution management queue, the task group that satisfies the task group execution start time <task Tk deadline ≦ task group execution end time
Find TGj; (A3): Find T (j, i) that is deadline of task T (j, i) <deadline of Tk <T (j, i + 1), m: = i (A4): Calculate the sum W of the workload from the task T (j, 1) to the task T (j, nj); the frequency f required for the execution of the workload W:
= W / (execution end time of task T (j, nj)-task T (j, 1)
(A5): The first task that cannot keep the deadline when trying to execute T (j, nj) from task T (j, m) at execution frequency f is T (j, p). (A6): p ≦ nj? (A7): Divide task T (j, p) from task T (j, m) as task group TGj ′; Execution start time of TGj ′: = execution start time of T (j, m); TGj ′ Execution end time: = Debt line of T (j, p); Work amount of TGj ′: = sum of work amounts from T (j, m) to T (j, p); Execution frequency of TGj ′: = (TGj 'execution end time-TGj
'Execution start time of') / Work of TGj '; Tasks belonging to TGj' are newly added to T (j ', i) (i = 1, ...
nj ') and renumber; T (j', i) (i = 1,... nj ') execution start time: = T (j
', i-1) execution end time; T (j', i) (i = 1,... nj ') execution end time: = T (j
', i) execution start time + work of T (j', i) / TGj '
(A8): Is the execution frequency of the task group TGj <the execution frequency of the task group TGj + 1? (A9): m: = p + 1; (A10): task group TGj and task group TGj +
1 is merged into the task group TGj; TGj execution start time: = TGj execution start time; TGj execution end time: = TGj + 1 execution end time; TGj work amount: = TGj work amount + TGj + 1 TGj execution frequency: = (TGj execution end time−TGj execution start time) / TGj work amount; new tasks belonging to TGj are T (j, i) (i = 1,... Nj) T (j, i) (i = 1,... Nj) execution start time: = T (j, i-1) execution end time; T (j, i) (i = 1, ... Execution end time of nj): = execution start time of T (j, i) + work load of Tj ′, i / execution frequency of TGj;

【0069】[0069]

【発明の効果】第1の効果は、2次電池を有するリアル
タイムシステムにおいて、タスクを実行する場合に2次
電池の消費を最小にできることにある。
The first effect is that, in a real-time system having a secondary battery, when a task is executed, the consumption of the secondary battery can be minimized.

【0070】その理由は、本スケジューリング方式によ
れば、リアルタイム処理を行うための、複数の、同一周
波数で動作するタスクを1つのタスクグループとし、新
規タスクを挿入する際に、該新規タスクを挿入したタス
クグループにおいて、前記リアルタイム処理のデッドラ
インを守れなくなる実行順序のタスクを別のタスクグル
ープに分割し、該分割されて、隣接するタスクグループ
において、前のタスクグループの実行周波数が後のタス
クグループの実行周波数より小さい場合には、該2つの
タスクグループを1つのタスクグループにマージして、
前のタスクグループと後のタスクグループの実行周波数
を平均化して、同一実行周波数で実行することにより、
可能な限り同一の低い周波数で、タスクを実行させるこ
とが可能となるためである。2次電池の消費量がCPU
の周波数のα(1)の時に、このようにタスクを実行さ
せると2次電池の消費は最小になる。
The reason is that, according to the present scheduling method, a plurality of tasks operating at the same frequency for real-time processing are made into one task group, and when a new task is inserted, the new task is inserted. In the divided task group, the tasks in the execution order that cannot keep the deadline of the real-time processing are divided into different task groups, and the divided task groups are divided into adjacent task groups and the execution frequency of the previous task group is changed to the later task group. If the execution frequency is smaller than the execution frequency, the two task groups are merged into one task group,
By averaging the execution frequency of the previous task group and the subsequent task group and executing at the same execution frequency,
This is because the task can be executed at the same low frequency as much as possible. Rechargeable battery consumption is CPU
When the task is executed as described above at the frequency α (1), the consumption of the secondary battery is minimized.

【0071】第2の効果は、本スケジューリング方式に
よってタスクの実行を完了しなければならないデッドラ
イン時刻までに実行を終了させることができることにあ
る。
The second effect is that the execution of the task can be completed by the deadline time at which the execution of the task must be completed by this scheduling method.

【0072】その理由は、可能な限り同一周波数で実行
させるときにデッドライン時刻までに実行が終了するよ
うにタスクのスケジューリングを行っているためであ
る。
The reason is that task scheduling is performed so that execution is completed by the deadline time when execution is performed at the same frequency as much as possible.

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

【図1】本発明の実施形態1の構成を示すブロック図で
ある。
FIG. 1 is a block diagram illustrating a configuration of a first exemplary embodiment of the present invention.

【図2】本発明の実施形態1の実行管理キューの構成図
である。
FIG. 2 is a configuration diagram of an execution management queue according to the first embodiment of the present invention.

【図3】本発明の実施形態1のスケジューラ112の動
作を示すフローチャートである。
FIG. 3 is a flowchart illustrating an operation of the scheduler 112 according to the first embodiment of the present invention.

【図4】本発明の実施形態1のスケジューラ112の動
作を示すフローチャートである。
FIG. 4 is a flowchart illustrating an operation of the scheduler 112 according to the first embodiment of the present invention.

【図5】本発明の実施形態1、2のスケジューラの動作
を示すフローチャートである。
FIG. 5 is a flowchart illustrating an operation of a scheduler according to the first and second embodiments of the present invention.

【図6】本発明の実施形態1のスケジューラの動作を説
明するためのキューデータ構造である。
FIG. 6 is a queue data structure for explaining the operation of the scheduler according to the first embodiment of the present invention.

【図7】本発明の実施形態1のスケジューラの動作を説
明するためのキューデータ構造である。
FIG. 7 is a queue data structure for explaining the operation of the scheduler according to the first embodiment of the present invention.

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

001 リアルタイムシステム 100 CPU 110 メモリ 120 二次電池 140 周波数制御回路 130 クロックジェネレータ 001 Real-time system 100 CPU 110 Memory 120 Secondary battery 140 Frequency control circuit 130 Clock generator

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 リアルタイム処理を行うための複数のタ
スクのスケジューリング方法において、 同一周波数で動作するタスクを1つのタスクグループと
し、該タスクグループ中の各タスクは、各タスクごとの
デッドライン順に並び、該タスクグループ中の最後のタ
スク以外のタスクの実行終了時刻は、当該タスクのデッ
ドラインより前であり、タスクグループの最後のタスク
の実行終了時刻は、当該タスクのデッドラインに等しい
構成を有し、 リアルタイム処理のデッドラインまでに実行されるタス
クグループに、新規タスクを挿入する際に、 該新規タスクを挿入したタスクグループにおいて、該挿
入したタスクから該デッドラインを守れなくなる実行順
序のタスクまでを別のタスクグループに分割し、 該分割されて、隣接するタスクグループにおいて、前の
タスクグループの実行周波数が後のタスクグループの実
行周波数より小さい場合に、前のタスクグループと後の
タスクグループの実行周波数を平均化して、同一実行周
波数で実行するために、該2つのタスクグループを1つ
のタスクグループにマージする、ことを特徴とするタス
クスケジューリング方法。
1. A scheduling method for a plurality of tasks for performing real-time processing, wherein tasks operating at the same frequency are set as one task group, and the tasks in the task group are arranged in a deadline order for each task; The execution end time of tasks other than the last task in the task group is before the deadline of the task, and the execution end time of the last task in the task group has a configuration equal to the deadline of the task. When inserting a new task into a task group that is executed before the deadline of real-time processing, in the task group into which the new task is inserted, the tasks from the inserted task to the tasks in the execution order in which the deadline cannot be protected can be performed. Divided into another task group, the divided task group In the step, when the execution frequency of the previous task group is lower than the execution frequency of the subsequent task group, the execution frequency of the previous task group and the execution frequency of the subsequent task group are averaged to execute the same execution frequency. A task scheduling method, wherein two task groups are merged into one task group.
【請求項2】 CPU(100)と、メモリ(110)
と、2次電池(120)と、クロックジェネレータ(1
30)と、該CPUへ供給するクロックの周波数を制御
する周波数制御回路(140)を有するリアルタイムシ
ステム(001)において、 メモリ(110)には、 リアルタイム処理を行うための複数のタスクと、 該タスクの実行をスケジュール制御するスケジューラ
(112)と、 該タスクの実行管理キュー(113)と、を有し、 該スケジューラ(112)は、 リアルタイムシステム(001)において、イベントを
処理するタスクTkのデッドラインを算出するステップ
(A1)と、 該デッドラインから実行管理キューの適切な位置にタス
クTkの実行を行うための実行キューデータをタスクグ
ループに挿入するステップ(A2,A3)と、該タスク
Tkが挿入された結果、増えるタスクの仕事量wおよび
タスクの実行周波数fを計算するステップ(A4)と、 当該タスクグループ(TGj)中のタスクT(j,1)
からT(j,nj)までを実行周波数fで実行したとき
に、タスクのデッドラインが守れるかどうかを調べ、タ
スクTkもしくは直前タスクグループの最後のタスクT
(j,m)からT(j,nj)までの中でデッドライン
を守れない最初のタスクTpを求めるステップ(A5)
と、 該タスクTkを挿入したタスクグループTGjにあるタ
スク数をnjとすると、タスクT(j,1)からT
(j,nj)までのタスクのデッドラインが守れるよう
にタスクグループの分割を行うため、タスクTkもしく
はT(j,n)からTpまでを一つのタスクグループと
して分割し、必要なデータを当該タスクグループ管理デ
ータに設定するステップ(A7)と、 隣接するタスクグループTGjとTGj+1において、
TGjの実行周波数<TGj+1の実行周波数でない場
合は、上記ステップ(A5、A7)をタスクT(j,n
j)まで行うステップ(A6,A9)と、 隣接するタスクグループTGjとTGj+1において、
TGjの実行周波数<TGj+1の実行周波数の場合
は、タスクグループTGjとTGj+1の実行周波数を
平均化して、同一実行周波数で実行するために該2つの
タスクグループを1つのタスクグループにマージするス
テップ(A10)と、 実行中のタスクの実行が終了した場合に、次に実行する
タスクのタスクグループが異なるかどうかを調べるステ
ップ(S41)と、 該異なる場合は、次のタスクグループの実行周波数を周
波数制御回路140に設定するステップ(S42)と、 次に、実行管理キューの先頭のタスクグループに含まれ
る先頭タスクをキューから外し、次に実行すべきタスク
の実行を開始するステップ(S43)と、を有すること
を特徴とするタスクスケジューリング方法。
2. A CPU (100) and a memory (110).
, A secondary battery (120) and a clock generator (1)
30) and in the real-time system (001) having a frequency control circuit (140) for controlling the frequency of a clock supplied to the CPU, the memory (110) has a plurality of tasks for performing real-time processing; And a task execution management queue (113). The scheduler (112) includes a deadline of a task Tk that processes an event in the real-time system (001). (A2), inserting the execution queue data for executing the task Tk from the deadline at an appropriate position in the execution management queue into the task group (A2, A3), As a result of the insertion, the workload w of the task and the execution frequency f of the task are increased. A calculating step (A4); and a task T (j, 1) in the task group (TGj).
To T (j, nj) at the execution frequency f, it is checked whether or not the deadline of the task can be maintained. The task Tk or the last task T in the immediately preceding task group is checked.
Step (A5) of finding the first task Tp that cannot keep the deadline from (j, m) to T (j, nj)
When the number of tasks in the task group TGj into which the task Tk is inserted is nj, the task T (j, 1)
In order to divide the task group so that the deadline of the tasks up to (j, nj) is protected, the tasks Tk or T (j, n) to Tp are divided into one task group, and necessary data is divided into the tasks. In the step (A7) of setting the group management data, in the adjacent task groups TGj and TGj + 1,
If the execution frequency of TGj is not smaller than the execution frequency of TGj + 1, the above-described steps (A5, A7) are performed in the task T (j, n).
j) to steps (A6, A9), and adjacent task groups TGj and TGj + 1,
When the execution frequency of TGj <the execution frequency of TGj + 1, a step of averaging the execution frequencies of the task groups TGj and TGj + 1 and merging the two task groups into one task group in order to execute at the same execution frequency (A10). ), And when the execution of the task being executed is completed, a step (S41) of checking whether the task group of the next task to be executed is different. If the task group is different, the execution frequency of the next task group is controlled. A step (S42) of setting the circuit 140 and a step (S43) of removing the head task included in the head task group of the execution management queue from the queue and starting the execution of the task to be executed next. A task scheduling method comprising:
【請求項3】 前記実行管理キュー(113)は、同一
周波数で実行されるタスクグループごとに、実行終了時
刻の順に並べられ、 該タスクグループの実行開始時刻、タスクグループの実
行終了時刻、タスクグループでの実行周波数とから構成
されるタスクグループの管理データと、 タスクの実行開始時刻、実行終了時刻、デッドライン、
仕事量から構成される各タスクの管理データと、を有す
ることを特徴とする請求項2記載のタスクスケジューリ
ング方法。
3. The execution management queue (113) is arranged in the order of execution end time for each task group executed at the same frequency, and includes an execution start time of the task group, an execution end time of the task group, and a task group. The management data of the task group consisting of the execution frequency and the task execution start time, execution end time, deadline,
3. The task scheduling method according to claim 2, further comprising management data of each task composed of a workload.
【請求項4】 CPUの周波数が固定数倍に制御される
リアルタイムシステムにおいて、 算出した周波数以上で最も近い前記固定数倍の周波数を
求めるステップを有することを特徴とする請求項2記載
のタスクスケジューリング方法。
4. The task scheduling according to claim 2, wherein in a real-time system in which the frequency of the CPU is controlled to be a fixed multiple, a step of obtaining the closest fixed multiple that is equal to or higher than the calculated frequency. Method.
【請求項5】 電源に2次電池を用いることを特徴とす
る請求項1〜4のいずれかに記載のタスクスケジューリ
ング方法。
5. The task scheduling method according to claim 1, wherein a secondary battery is used as a power supply.
【請求項6】 請求項1〜5のいずれかに記載の方法を
コンピュータに行なわせるプログラムを記録したことを
特徴とする記録媒体。
6. A recording medium on which a program for causing a computer to execute the method according to claim 1 is recorded.
JP10235952A 1998-08-21 1998-08-21 Task scheduling method and recording medium Expired - Fee Related JP3123714B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10235952A JP3123714B2 (en) 1998-08-21 1998-08-21 Task scheduling method and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10235952A JP3123714B2 (en) 1998-08-21 1998-08-21 Task scheduling method and recording medium

Publications (2)

Publication Number Publication Date
JP2000066910A true JP2000066910A (en) 2000-03-03
JP3123714B2 JP3123714B2 (en) 2001-01-15

Family

ID=16993651

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10235952A Expired - Fee Related JP3123714B2 (en) 1998-08-21 1998-08-21 Task scheduling method and recording medium

Country Status (1)

Country Link
JP (1) JP3123714B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006178854A (en) * 2004-12-24 2006-07-06 Toshiba Corp Electronic circuit
CN111260106A (en) * 2018-11-30 2020-06-09 顺丰科技有限公司 Transportation task allocation method, device, equipment and storage medium thereof

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4641773B2 (en) * 2004-09-27 2011-03-02 大日本除蟲菊株式会社 Indoor dust mite repellent
CN103914346A (en) * 2013-12-16 2014-07-09 西北工业大学 Group-based dual-priority task scheduling and energy saving method for real-time operating system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006178854A (en) * 2004-12-24 2006-07-06 Toshiba Corp Electronic circuit
CN111260106A (en) * 2018-11-30 2020-06-09 顺丰科技有限公司 Transportation task allocation method, device, equipment and storage medium thereof
CN111260106B (en) * 2018-11-30 2023-09-12 顺丰科技有限公司 Transportation task allocation method, device, equipment and storage medium thereof

Also Published As

Publication number Publication date
JP3123714B2 (en) 2001-01-15

Similar Documents

Publication Publication Date Title
Squillante et al. Using processor-cache affinity information in shared-memory multiprocessor scheduling
Fohler Joint scheduling of distributed complex periodic and hard aperiodic tasks in statically scheduled systems
Hui et al. Improved strategies for dynamic load balancing
KR100864964B1 (en) Arithmetic Processing System and Arithmetic Processing Control Method, Task Management System and Task Management Method, and Storage Medium
US7650601B2 (en) Operating system kernel-assisted, self-balanced, access-protected library framework in a run-to-completion multi-processor environment
JPH0969017A (en) Method and apparatus for management of electric power of computer system
JP2561801B2 (en) Method and system for managing process scheduling
Guan et al. DAG-fluid: A real-time scheduling algorithm for DAGs
CN114327829A (en) Multi-core real-time task scheduling analysis and simulation system and method
Ranjbar et al. Toward the design of fault-tolerance-aware and peak-power-aware multicore mixed-criticality systems
CN111459622A (en) Method and device for scheduling virtual CPU, computer equipment and storage medium
JP3123714B2 (en) Task scheduling method and recording medium
Jeffay Analysis of a synchronization and scheduling discipline for real-time tasks with preemption constraints
Wu et al. Energy-efficient task scheduling and synchronization for multicore real-time systems
Reghenzani et al. A multi-level dpm approach for real-time dag tasks in heterogeneous processors
JP2009048358A (en) Information processor and scheduling method
Thai Real-time scheduling in distributed systems
Gergeleit et al. TaskPair-scheduling with optimistic case execution times-An example for an adaptive real-time system
Choi et al. Work-in-progress: A unified runtime framework for weakly-hard real-time systems
JPH09265459A (en) Method for controlling data processor
Yue et al. Loop-level process control: an effective processor allocation policy for multiprogrammed shared-memory multiprocessors
Tekin et al. Pruda: An api for time and space predictible programming in nvdia gpus using cuda
Rincón et al. SITSA-RT: an information theory inspired real-time multiprocessor scheduler
Schmaus et al. Modern Concurrency Platforms Require Modern System-Call Techniques
Irfanulla et al. Real-time Resource Management in Smart Energy-Harvesting Systems

Legal Events

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

Free format text: PAYMENT UNTIL: 20071027

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20081027

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20091027

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees