JP2008129709A - Task control method, data processing system, task control program, and its storage medium - Google Patents

Task control method, data processing system, task control program, and its storage medium Download PDF

Info

Publication number
JP2008129709A
JP2008129709A JP2006311798A JP2006311798A JP2008129709A JP 2008129709 A JP2008129709 A JP 2008129709A JP 2006311798 A JP2006311798 A JP 2006311798A JP 2006311798 A JP2006311798 A JP 2006311798A JP 2008129709 A JP2008129709 A JP 2008129709A
Authority
JP
Japan
Prior art keywords
task
slice time
processing
data
abnormality
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2006311798A
Other languages
Japanese (ja)
Inventor
Kenji Ikedo
健二 池戸
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.)
Shinko Electric Industries Co Ltd
Original Assignee
Shinko Electric Industries 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 Shinko Electric Industries Co Ltd filed Critical Shinko Electric Industries Co Ltd
Priority to JP2006311798A priority Critical patent/JP2008129709A/en
Publication of JP2008129709A publication Critical patent/JP2008129709A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a task control method capable of efficiently processing tasks by detecting failure with the tasks, a data processing system, a task control program, and its storage medium. <P>SOLUTION: The task control method for processing data by allocating the process resources of a central processing unit 11 to a plurality of tasks during slice time includes a step (S2) for causing a task monitoring means 25 to detect the workload of data processing by the tasks, a step (S4) for detecting failure with the tasks based on the workload, a step (S6) for determining whether or not the slime time should be extended according to the amount of data waiting to be processed, if no failure with the tasks is detected, and a step (S7) for requesting a system management means 21 for allocating the slice time to extend the slice time if it is determined that the slice time should be extended. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、中央処理装置の処理資源をスライスタイムの間、複数のタスクに割り当てタスクを処理するタスク制御方法、データ処理システム、タスク制御プログラム及びその記憶媒体に関し、特に、タスクの異常を検出して適切な処理を行うタスク制御方法、データ処理システム、タスク制御プログラム及びその記憶媒体に関する。   The present invention relates to a task control method, a data processing system, a task control program, and a storage medium for allocating processing resources of a central processing unit to a plurality of tasks during a slice time, and in particular, detecting a task abnormality. The present invention relates to a task control method for performing appropriate processing, a data processing system, a task control program, and a storage medium thereof.

複数のプログラムが1つの中央処理装置(CPU)の処理資源を共有するマルチプログラミングでは、処理の1単位となるタスクがCPUを占有する時間が極度に偏ることのないように適切なスライスタイムがタスクに割り当てられる。このスライスタイムが短いほど各タスクに均等に処理資源を供給しやすくなるが、あまり短くするとタスク切り替えのオーバーヘッドが生じ効率が低下してしまう。   In multi-programming where multiple programs share the processing resources of one central processing unit (CPU), the appropriate slice time is set so that the time that the task that is a unit of processing occupies the CPU does not deviate extremely. Assigned to. As the slice time becomes shorter, it becomes easier to supply processing resources equally to each task. However, if the slice time is too short, task switching overhead occurs and efficiency decreases.

また、スライスタイムをあまり長くすると特定のタスクがCPUを占有する場合が生じ得るため好ましくない。そこで、適切なスライスタイムを設定し、スライスタイムの間に処理が終了すればタスク側からCPUを開放するが、処理が間に合わずタスクが終了しない場合には、最大でそのスライスタイムまでCPUを占有可能にして複数のタスクを処理している。図1はこの従来のタスク割り当ての概略図である。図1では、タスクAとタスクBがOS(Operating System)により切り替えられて1つのCPUにより処理される。当初、CPUはタスクAを処理しているが、イベントが発生することでタスクBに処理が切り替わる。そして、タスクBの処理が終了すればタスクBが処理資源を開放しタスクAに切り替わる(図1のE1)が、処理が終了しなければスライスタイムを上限にCPUを占有し、スライスタイムが経過するとOSが強制的にタスクAに切り替える(E2)。   Also, if the slice time is too long, it may not be preferable because a specific task may occupy the CPU. Therefore, if an appropriate slice time is set and the processing is completed during the slice time, the CPU is released from the task side. However, if the task is not completed in time, the CPU is occupied up to that slice time. It allows multiple tasks to be processed. FIG. 1 is a schematic diagram of this conventional task assignment. In FIG. 1, task A and task B are switched by an OS (Operating System) and processed by one CPU. Initially, the CPU is processing task A, but when an event occurs, the processing is switched to task B. When the processing of task B is completed, task B releases processing resources and switches to task A (E1 in FIG. 1), but if the processing is not completed, the CPU is occupied with the slice time as the upper limit, and the slice time has elapsed. Then, the OS forcibly switches to task A (E2).

また、スライスタイムを可変に制御する技術が提案されている(例えば、特許文献1〜3参照。)。特許文献1記載の技術は、CPUのアイドル比率によりシステムの負荷状態を判定し、負荷が小さい場合にはスライスタイムを延長し負荷が大きい場合には短縮することで、処理効率を最適化するとしている。   In addition, techniques for variably controlling the slice time have been proposed (see, for example, Patent Documents 1 to 3). The technique described in Patent Document 1 determines the system load state based on the CPU idle ratio, and optimizes processing efficiency by extending the slice time when the load is small and shortening when the load is large. Yes.

また、特許文献2記載の技術は、一定期間中の各タスクに対するディスパッチ情報を記憶しておきディスパッチ情報から各タスクの特性を推定し、その推定結果に基づきスライスタイムを調整する。ディスパッチ情報は各タスクがスライスタイムを使い切ったか否かを示す情報を含むので、使い切り回数が少ないタスクはスライスタイムを短くし使い切り回数が多いタスクはスライスタイムを長くすることで、タスクの特性に応じたスライスタイムに調整しうるとしている。   The technique described in Patent Document 2 stores dispatch information for each task during a certain period, estimates the characteristics of each task from the dispatch information, and adjusts the slice time based on the estimation result. Since the dispatch information includes information indicating whether each task has used up the slice time or not, depending on the task characteristics, the task with a small number of times of use shortens the slice time and the task with a large number of times of use increases the slice time. It can be adjusted to the slice time.

また、特許文献3記載の技術では、各タスクにプライオリティを割り当てると共にこのプライオリティに従いCPUの処理資源を割り当て、また、総計された負荷分散から決定される目標負荷分散に対し負荷が少ないタスクには割り当てる処理資源を低減することで、プライオリティの高いタスクに処理資源が割り当てられる頻度が高くなるようにしてタスクを処理する。
特開平5−066954号公報 特開平5−241860号公報 特開平11−249913号公報
In the technique described in Patent Document 3, a priority is assigned to each task, CPU processing resources are assigned according to the priority, and a task with a low load is assigned to a target load distribution determined from the total load distribution. By reducing the processing resources, the task is processed in such a manner that the frequency with which the processing resources are assigned to the task with the higher priority is increased.
JP-A-5-066954 JP-A-5-241860 JP-A-11-249913

しかしながら、特許文献1〜3の技術はいずれも負荷の大きいタスクに対しスライスタイムを延長するものであるため、タスクの処理中に異常が生じた場合でもスライスタイムを延長させてしまうという問題がある。例えば、タスクが暴走した場合、データは処理されていないのにスライスタイムは最大まで延長され、また、その暴走も検知することができない。すなわち、特許文献1〜3の技術では、負荷等に応じてスライスタイムを増大させた場合でも効率的に処理しているとは限らず、また、効率的に処理されているか否かを検出することもできないという問題がある。   However, since all of the techniques of Patent Documents 1 to 3 extend the slice time for a task with a large load, there is a problem that the slice time is extended even if an abnormality occurs during task processing. . For example, when a task runs away, the slice time is extended to the maximum although data is not processed, and the runaway cannot be detected. That is, in the techniques of Patent Documents 1 to 3, even when the slice time is increased according to the load or the like, the processing is not always performed efficiently, and whether or not the processing is performed efficiently is detected. There is a problem that you can't.

なお、システムの暴走を検知する手段として定期的なタイマ割り込みにより暴走していないことを検知しながらプログラムを実行するウォッチドッグタイマが知られているが、タスクが暴走していてもタイマ割り込みは発生するので、ウォッチドッグタイマではタスクの暴走を検知することはできない。   As a means of detecting system runaway, a watchdog timer that executes a program while detecting that it has not runaway due to a periodic timer interrupt is known, but a timer interrupt is generated even if a task runs away Therefore, the watchdog timer cannot detect task runaway.

本発明は、上記課題に鑑み、タスクの異常を検出してタスクを効率よく処理可能なタスク制御方法、データ処理システム、タスク制御プログラム及びその記憶媒体を提供すること目的とする。   In view of the above problems, an object of the present invention is to provide a task control method, a data processing system, a task control program, and a storage medium capable of efficiently processing a task by detecting a task abnormality.

上記課題に鑑み、本発明は、中央処理装置の処理資源をスライスタイムの間、複数のタスクに割り当ててデータを処理するタスク制御方法において、タスク監視手段が、タスクによるデータ処理の仕事量を検出するステップと、仕事量に基づき前記タスクの異常を検出するステップと、タスクの異常が検出されない場合、処理待ちデータ量に基づきスライスタイムを延長するか否かを判定するステップと、スライスタイムを延長すると判定された場合、スライスタイムを割り当てるシステム管理手段にスライスタイムの延長を要求するステップと、を有することを特徴とする。   In view of the above problems, the present invention provides a task control method for processing data by allocating processing resources of a central processing unit to a plurality of tasks during a slice time. A step of detecting an abnormality of the task based on a work amount, a step of determining whether or not to extend a slice time based on an amount of data waiting to be processed if a task abnormality is not detected, and an extension of a slice time If it is determined, the system management means for allocating the slice time requests to extend the slice time.

本発明によれば、タスクによるデータ処理の仕事量を検出するので、タスクの異常を検出することができ、これを利用してバグの洗い出しや異常動作の検知及び処理の限界値を定量的に知ることが可能になる。   According to the present invention, since the workload of data processing by a task is detected, it is possible to detect a task abnormality, and using this, it is possible to detect bugs, detect abnormal operations, and quantitatively limit processing limits. It becomes possible to know.

タスクの異常を検出してタスクを効率よく処理可能なタスク制御方法、システム、タスク制御プログラム及びその記憶媒体を提供することができる。   It is possible to provide a task control method, system, task control program, and storage medium thereof capable of efficiently processing a task by detecting a task abnormality.

以下、本発明を実施するための最良の形態について、図面を参照しながら説明する。
始めに、本実施形態のタスク制御方法の概略を説明する。図2は本実施形態のスライスタイムの延長の概略図を示す。OS(Operating System)は当初、タスクAを実行しているが、イベントが発生することで中央処理装置の処理資源をタスクBに割り当てる(以下、単に「タスクBに処理を切り替える」という。)。タスクAは例えばネットワークからの入力や操作を待つインタラクティブな処理であり、そこで発生するイベントとはデータ受信やユーザの何らかの操作である。処理が切り替わったタスクBは、受信したデータの保存や操作に応じたデータ処理を開始する。
The best mode for carrying out the present invention will be described below with reference to the drawings.
First, an outline of the task control method of this embodiment will be described. FIG. 2 shows a schematic diagram of extending the slice time according to the present embodiment. An OS (Operating System) initially executes task A, but assigns processing resources of the central processing unit to task B when an event occurs (hereinafter simply referred to as “switching processing to task B”). Task A is, for example, interactive processing that waits for input or operation from the network, and the event that occurs is data reception or some user operation. The task B whose processing has been switched starts data processing corresponding to the storage and operation of the received data.

本実施形態では、OSはタスクBの当初のスライスタイムとしてスライスタイムminを割り当て、データの処理状況に応じてスライスタイムmaxを上限にスライスタイムを段階的に延長する。スライスタイムminはタスクの切り替わり時に与えられる最短のスライスタイムであって、タスクBの処理がスライスタイムminの間に終了しない場合、データの処理状況が所定の条件を満たす場合にOSはスライスタイムを段階的に延長する。そしてスライスタイムmaxまで延長してもタスクBの処理が終了しない場合には、OSはタスクAに処理を切り替える。このように、データの処理状況が所定の条件を満たすか否かを判定することで暴走などタスクBの異常状態を検知できるため、正常にデータ処理が実行されている場合にのみスライスタイムを延長することができる。   In the present embodiment, the OS allocates a slice time min as the initial slice time of task B, and extends the slice time stepwise with the slice time max as the upper limit according to the data processing status. The slice time min is the shortest slice time given when the task is switched. If the processing of the task B does not end during the slice time min, the OS sets the slice time when the data processing condition satisfies a predetermined condition. Extend in stages. If the processing of task B does not end even if it is extended to the slice time max, the OS switches the processing to task A. As described above, since it is possible to detect an abnormal state of task B such as runaway by determining whether or not the data processing status satisfies a predetermined condition, the slice time is extended only when data processing is normally executed. can do.

図3は、本実施形態のタスク制御方法を実現するコンピュータ(特許請求の範囲のデータ処理システムに相当)10のハードウェア構成図を示す。このコンピュータ10は、例えば携帯型の電子機器に組み込まれるマイコンである。コンピュータ10は、それぞれバスで相互に接続されているCPU11、RAM12、ROM13、メモリ14、入力装置15、表示制御部16及びメモリカード装着部17を有するように構成される。   FIG. 3 is a hardware configuration diagram of a computer 10 (corresponding to the data processing system in the claims) 10 that implements the task control method of the present embodiment. The computer 10 is a microcomputer incorporated in, for example, a portable electronic device. The computer 10 is configured to include a CPU 11, a RAM 12, a ROM 13, a memory 14, an input device 15, a display control unit 16, and a memory card mounting unit 17 that are mutually connected by a bus.

ROM13は、BIOS(Basic Input Output System)などOSを起動するためのプログラムやパラメータを記憶している。メモリ14はフラッシュメモリなど不揮発性メモリであり、OSやプログラム、データファイル等の各種ファイルが記憶されている。CPU11は、OSやプログラムをメモリ14から読み込んでして実行することで種々の機能を提供すると共に、コンピュータ10が行う処理を統括的に制御する。RAM12は、CPU11がOSやプログラムを実行したりデータを一時保管するための作業領域である。入力装置15はキーボードやタッチパネルなど、ユーザからの様々な操作指示を入力するために用いられる。表示制御部16は、プログラムが指示する画面情報に基づき所定の解像度や色数等で液晶などのディスプレイに描画する。例えば、GUI(Graphical User Interface)画面を形成し、操作に必要な各種ウィンドウやデータ等をディスプレイに表示する。メモリカード装着部17は、フラッシュメモリなどの記憶媒体18を装着して記憶媒体18に記憶されたプログラムやデータファイルを読み出し、また、メモリ14のプログラムやデータファイルを書き込むインターフェイスである。   The ROM 13 stores programs and parameters for starting up the OS such as BIOS (Basic Input Output System). The memory 14 is a nonvolatile memory such as a flash memory, and stores various files such as an OS, a program, and a data file. The CPU 11 provides various functions by reading the OS and programs from the memory 14 and executing them, and comprehensively controls the processing performed by the computer 10. The RAM 12 is a work area for the CPU 11 to execute the OS and programs and temporarily store data. The input device 15 is used for inputting various operation instructions from a user such as a keyboard and a touch panel. The display control unit 16 draws on a display such as a liquid crystal with a predetermined resolution, number of colors, and the like based on screen information instructed by the program. For example, a GUI (Graphical User Interface) screen is formed, and various windows and data necessary for operation are displayed on the display. The memory card loading unit 17 is an interface that loads a storage medium 18 such as a flash memory, reads a program or data file stored in the storage medium 18, and writes a program or data file in the memory 14.

本実施形態のタスク制御方法は、CPU11がタスク制御プログラムを実行することで実現されるものである。タスク制御プログラムは記憶媒体18に記憶して配布されたりまた通信手段によりサーバからダウンロードされメモリ14にインストールされる。   The task control method of the present embodiment is realized by the CPU 11 executing a task control program. The task control program is stored in the storage medium 18 and distributed, or downloaded from the server by communication means and installed in the memory 14.

図4は、タスク制御プログラムが実行されたデータ処理システムの機能ブロック図を示す。CPU11がタスク制御プログラムを実行することでシステム管理手段21、タスク監視手段25及びタスクB23(以下、単にタスクBという)が実現される。システム管理手段21は実行すべきタスクを決定しそのタスクの起動及び停止を制御する例えばディスパッチャでありOSの機能を利用できる。システム管理手段21がタスクBを起動する場合、タスクBにスライスタイムMinを割り当てる。したがって、システム管理手段21にとってタスクBの処理開始時刻及び割り当て後の経過時間は既知である。   FIG. 4 shows a functional block diagram of the data processing system in which the task control program is executed. When the CPU 11 executes the task control program, the system management unit 21, the task monitoring unit 25, and the task B23 (hereinafter simply referred to as task B) are realized. The system management means 21 is, for example, a dispatcher that determines a task to be executed and controls starting and stopping of the task, and can use the function of the OS. When the system management unit 21 activates task B, slice time Min is assigned to task B. Therefore, the processing start time of task B and the elapsed time after the assignment are known to the system management means 21.

起動されたタスクBはタスクBの処理(例えば、データ圧縮、データ保存など)に供される処理待ちデータ22を処理し、処理済データ24を出力する。処理待ちデータ22は作業エリアとしてRAM12に一時記憶されデータバスのビット数に応じて順次CPU11に送出される。送出されたデータはCPU11に処理されRAM12に一時記憶されたのち最終的にメモリ14に記憶される。したがって、RAM12又はメモリ14の処理済データ24を監視することでタスクBのデータ処理量が検出される。   The activated task B processes the process waiting data 22 used for the process of the task B (for example, data compression, data storage, etc.), and outputs processed data 24. The process waiting data 22 is temporarily stored in the RAM 12 as a work area and sequentially sent to the CPU 11 according to the number of bits of the data bus. The sent data is processed by the CPU 11, temporarily stored in the RAM 12, and finally stored in the memory 14. Therefore, the data processing amount of task B is detected by monitoring the processed data 24 in the RAM 12 or the memory 14.

タスク監視手段25はタスクBのデータの処理状況を監視して、システム管理手段21にタスクBの異常を通知し、又は、スライスタイムの延長を要求するものである。   The task monitoring unit 25 monitors the processing status of the data of the task B, notifies the system management unit 21 of the abnormality of the task B, or requests to extend the slice time.

〔タスクの異常の検出処理及びスライスタイムの延長処理〕
タスク監視手段25の処理について説明する。図5は、タスク監視手段25の処理手順を示すフローチャート図である。
(S1)
タスク監視手段25はタスクBの起動をシステム管理手段21から通知されるので、システム管理手段21がタスクBの処理を開始する際に、処理待ちデータ22の処理待ちデータ量を取得しRAM12に記憶する。
(S2)
また、タスク監視手段25は、タスクBの仕事量を算出する。タスク監視手段25は、タスクBの処理を開始してから終了するまでの間、処理済データ24を監視して処理されたデータ量を計測している。処理されたデータ量はサイクル時間毎に検出されるので、例えば、サイクル時間毎に処理したデータ量を除算すれば、サイクル時間毎に単位時間当たりの仕事量が得られる。また、タスクBが起動してからの経過時間は既知であるので、処理されたデータ量を経過時間で除算して単位時間当たりのタスクBの仕事量を算出してもよい。
(S3)
そして、タスク監視手段25は、サイクル時間毎に算出した単位時間当たりの仕事量の平均(以下、平均仕事量という)を算出する。タスク監視手段25は随時更新される単位時間当たりの平均仕事量をRAM12に記憶する。これにより、タスクBに必要な平均的な仕事量を検出することができる。
(S4) 「異常判定」
異常判定は、タスクBの処理が正常に進行しているか否かを判定するための処理である。異常判定をスライスタイムの延長処理に先立って行うことでスライスタイムを延長する前に異常検出が可能になりデータ処理システムの効率低下を防止できる。
[Task abnormality detection processing and slice time extension processing]
Processing of the task monitoring unit 25 will be described. FIG. 5 is a flowchart showing the processing procedure of the task monitoring unit 25.
(S1)
Since the task monitoring unit 25 is notified of the activation of the task B from the system management unit 21, when the system management unit 21 starts processing of the task B, the task monitoring unit 25 acquires the processing waiting data amount of the processing waiting data 22 and stores it in the RAM 12. To do.
(S2)
Further, the task monitoring unit 25 calculates the work amount of the task B. The task monitoring means 25 measures the amount of processed data by monitoring the processed data 24 from the start to the end of the processing of task B. Since the processed data amount is detected every cycle time, for example, if the data amount processed every cycle time is divided, the work amount per unit time can be obtained for each cycle time. Further, since the elapsed time since the task B is activated is known, the work amount of the task B per unit time may be calculated by dividing the processed data amount by the elapsed time.
(S3)
Then, the task monitoring unit 25 calculates an average of work amounts per unit time calculated for each cycle time (hereinafter referred to as average work amount). The task monitoring means 25 stores the average work amount per unit time updated at any time in the RAM 12. Thereby, the average work amount required for the task B can be detected.
(S4) "Abnormality judgment"
The abnormality determination is a process for determining whether or not the task B process is proceeding normally. By performing the abnormality determination prior to the slice time extension process, it is possible to detect the abnormality before extending the slice time, thereby preventing a reduction in the efficiency of the data processing system.

タスク監視手段25はタスクBの仕事量が正常に処理していると推定される仕事量か否かを次の式により判定する。   The task monitoring unit 25 determines whether or not the work amount of the task B is a work amount estimated to be normally processed by the following formula.

平均仕事量−許容値Q>現在の仕事量 …I
式Iは、現在の仕事量が平均仕事量に比べて異常と推定されるほど少ないか否かを判定するための式である。したがって、現在の仕事量がそれまでの平均仕事量に比べ極端に少なくなったような場合は、タスクBに異常が生じているものと判定される。許容値Qは現在の仕事量の誤差を許容するための値であり、例えば、平均仕事量の数%〜数10%の値や予め定められた値である。例えばタスクBが暴走して異常が生じた場合、仕事量は極端に低下するので、式Iの判定によりタスクの異常を検出することができる。
Average work volume-Allowable value Q> Current work volume ... I
Expression I is an expression for determining whether or not the current work amount is so small that it is estimated to be abnormal as compared to the average work amount. Therefore, when the current work amount becomes extremely smaller than the average work amount so far, it is determined that an abnormality has occurred in task B. The allowable value Q is a value for allowing an error in the current work amount, for example, a value of several percent to several tens percent of the average work amount or a predetermined value. For example, when task B runs out of control and an abnormality occurs, the amount of work is extremely reduced, so that the abnormality of the task can be detected by the determination of Formula I.

(S5)
異常と判定された場合(S4のYes)、タスク監視手段25はタスク異常をシステム管理手段21に通知する。システム管理手段21は、タスク異常の通知を受け、タスクBを停止し以降は起動を禁止すると共に、異常を知らせるコードやメッセージを出力する。また、タスクBを初期化して最初から処理待ちデータ22を処理してもよい。したがって、異常が検出された場合はタスク監視手段25の処理はステップS5で終了し以降はシステム管理手段21の処理に移行する。
(S5)
When it is determined that there is an abnormality (Yes in S4), the task monitoring unit 25 notifies the system management unit 21 of the task abnormality. Upon receiving notification of task abnormality, the system management means 21 stops task B and prohibits activation after that, and outputs a code or message notifying abnormality. Alternatively, the task B may be initialized and the process waiting data 22 may be processed from the beginning. Therefore, when an abnormality is detected, the process of the task monitoring unit 25 ends in step S5, and thereafter, the process proceeds to the process of the system management unit 21.

(S6)
異常と判定されない場合(S4のNo)、タスク監視手段25は、スライスタイムを延長するか否かを判定する。
(S6)
When it is not determined to be abnormal (No in S4), the task monitoring unit 25 determines whether to extend the slice time.

処理待ちデータ量>閾値 …II
平均仕事量−許容値P<現在の仕事量 …III
式IIは、処理待ちデータ22に記憶されているタスクBの処理待ちデータ22の量がスライスタイムを延長する必要があるほど残っているか否かを判定するための式である。式IIIは、現在の仕事量が平均仕事量に比べてスライスタイムを延長する必要があるほど多いか否かを判定するための式である。許容値Pは現在の仕事量の誤差を許容するための値であり、例えば、平均仕事量の数%〜数10%の値や予め定められた値である。また、許容値Qと同じ値であってもよい。
Amount of data waiting to be processed> Threshold value ... II
Average work amount-allowable value P <current work amount ... III
Expression II is an expression for determining whether or not the amount of the task B processing waiting data 22 stored in the processing waiting data 22 remains so that the slice time needs to be extended. Formula III is a formula for determining whether or not the current work amount is so large that it is necessary to extend the slice time compared to the average work amount. The allowable value P is a value for allowing an error in the current work amount, for example, a value of several percent to several tens percent of the average work amount or a predetermined value. Further, it may be the same value as the allowable value Q.

なお、スライスタイムminまではスライスタイムを延長する必要がないので、タスク監視手段25はスライスタイムminの直前になってから以降にのみ、スライスタイムを延長するか否かを判定してもよい。
(S7)
データの処理状況が式II及び式IIIの条件を満たす場合(S6のYes)、タスク監視手段25は、システム管理手段21にスライスタイム変更を要求する。スライスタイム変更の要求を受けたシステム管理手段21は現在のスライスタイムに所定時間ΔTを加えた時間をスライスタイムとする。これにより、スライスタイムminがΔT延長された。したがって、式II及び式IIIの条件を満たさない場合、タスク監視手段25はシステム管理手段21にスライスタイム変更を要求しない。
(S8)
データの処理状況が式II及び式IIIの条件を満たさない場合(S6のNo)、又は、スライスタイムを延長した後、タスク監視手段25はタスクBの処理が終了したか否かを判定する。
Since it is not necessary to extend the slice time until the slice time min, the task monitoring unit 25 may determine whether or not to extend the slice time only after immediately before the slice time min.
(S7)
When the data processing status satisfies the conditions of Formula II and Formula III (Yes in S6), the task monitoring unit 25 requests the system management unit 21 to change the slice time. The system management means 21 that has received the request to change the slice time sets the time obtained by adding the predetermined time ΔT to the current slice time as the slice time. As a result, the slice time min is extended by ΔT. Therefore, when the conditions of the formulas II and III are not satisfied, the task monitoring unit 25 does not request the system management unit 21 to change the slice time.
(S8)
When the data processing status does not satisfy the conditions of Formula II and Formula III (No in S6), or after extending the slice time, the task monitoring unit 25 determines whether the processing of the task B is completed.

タスクBの処理が終了した場合、タスクBはシステム管理手段21に処理を戻す。なお、延長前又は延長後のスライスタイムが経過した場合、システム管理手段21がタスクBを停止する。したがって、これらの場合には、タスク監視手段25の処理は終了し、システム管理手段21がCPU11の処理をタスクAに切り替え、CPU11はタスクAの処理を再開することになる。   When the processing of task B is completed, task B returns the processing to system management means 21. When the slice time before or after the extension has elapsed, the system management unit 21 stops the task B. Therefore, in these cases, the processing of the task monitoring unit 25 ends, the system management unit 21 switches the processing of the CPU 11 to the task A, and the CPU 11 resumes the processing of the task A.

タスクBが終了していない場合(S8のNo)、タスク監視手段25はステップS1からの処理を繰り返す。したがって、スライスタイムをΔT延長しても処理待ちデータ22が閾値より多く残っていて、かつ、現在の仕事量が「平均仕事量−許容値P」よりも多い場合にはステップS5により再度スライスタイムが延長される。   If task B has not ended (No in S8), task monitoring means 25 repeats the processing from step S1. Accordingly, even if the slice time is extended by ΔT, if the processing waiting data 22 remains more than the threshold value and the current work amount is larger than “average work amount−allowable value P”, the slice time is again determined in step S5. Is extended.

スライスタイムが延長されるほど式IIと式IIIによる処理状況の判定はYesになりにくいので、処理すべきデータ量が多いタスクほど優先的にスライスタイムが延長されることになりデータ処理システムの効率が向上する。   As the slice time is extended, the judgment of the processing status according to Formula II and Formula III is less likely to be Yes. Therefore, the slice time is preferentially extended for tasks with a large amount of data to be processed, and the efficiency of the data processing system Will improve.

以上のように、本実施形態のタスク制御方法によれば、タスクBの異常を検出した場合にはスライスタイムを延長することがない。したがって、異常によりスライスタイムを延長することがなく処理するデータ量が多いタスクのみスライスタイムを延長するので、データ処理システムの効率を向上することができる。   As described above, according to the task control method of the present embodiment, when an abnormality of task B is detected, the slice time is not extended. Therefore, since the slice time is extended only for a task having a large amount of data to be processed without extending the slice time due to an abnormality, the efficiency of the data processing system can be improved.

また、プログラムの開発段階であれば異常検出によりタスクに潜むバグの洗い出しが容易になり、システム開発の進捗速度が速くなる。また、プログラムの実用段階であればタスクが暴走した場合の検出が容易になり、異常検出後はシステム管理手段21がタスクBを制御するので他のタスクへ影響が及ぶことやデッドロックなどを防止してデータ処理システムへの影響を最小限にすることができる。また、タスク監視手段25はタスクBの仕事量を検出しているので、タスクBの処理の限界値を定量的に知ることができる。   In addition, at the program development stage, it becomes easy to identify bugs hidden in the task by detecting an abnormality, and the system development progress speed increases. Further, if the program is in a practical stage, it is easy to detect when a task runs away, and after the abnormality is detected, the system management means 21 controls task B, thereby preventing other tasks from being affected and deadlocks and the like. Thus, the influence on the data processing system can be minimized. Further, since the task monitoring unit 25 detects the work amount of the task B, the limit value of the task B process can be known quantitatively.

従来のスライスタイムの調整の概略図である。It is the schematic of the adjustment of the conventional slice time. 本実施形態のスライスタイムの調整の概略図である。It is the schematic of adjustment of the slice time of this embodiment. 本実施形態のタスク制御方法を実現するコンピュータのハードウェア構成図である。It is a hardware block diagram of the computer which implement | achieves the task control method of this embodiment. タスク制御プログラムの機能ブロック図である。It is a functional block diagram of a task control program. タスク監視手段の処理手順を示すフローチャート図である。It is a flowchart figure which shows the process sequence of a task monitoring means.

符号の説明Explanation of symbols

10 コンピュータ
11 CPU
12 RAM
13 ROM
14 メモリ
15 入力装置
16 表示制御部
17 メモリカード装着部
18 記憶媒体
21 システム管理手段
22 処理待ちデータ
23 タスクB
24 処理済データ
25 タスク監視手段
10 Computer 11 CPU
12 RAM
13 ROM
14 Memory 15 Input Device 16 Display Control Unit 17 Memory Card Mounting Unit 18 Storage Medium 21 System Management Means 22 Processing Wait Data 23 Task B
24 Processed data 25 Task monitoring means

Claims (5)

中央処理装置の処理資源をスライスタイムの間、複数のタスクに割り当ててデータを処理するタスク制御方法において、
タスク監視手段が、前記タスクによるデータ処理の仕事量を検出するステップと、
前記仕事量に基づき前記タスクの異常を検出するステップと、
前記タスクの異常が検出されない場合、データの処理状況に基づきスライスタイムを延長するか否かを判定するステップと、
スライスタイムを延長すると判定した場合、スライスタイムを割り当てるシステム管理手段にスライスタイムの延長を要求するステップと、
を有することを特徴とするタスク制御方法。
In a task control method for processing data by allocating processing resources of a central processing unit to a plurality of tasks during a slice time,
A task monitoring means for detecting a work amount of data processing by the task;
Detecting an abnormality of the task based on the workload;
If no abnormality of the task is detected, determining whether to extend the slice time based on the data processing status; and
If it is determined to extend the slice time, a step of requesting the system management means for assigning the slice time to extend the slice time;
A task control method comprising:
前記タスクの異常を検出するステップでは、前記仕事量が過去の仕事量の平均よりも少ない場合に異常であると検出する、
ことを特徴とする請求項1記載のタスク制御方法。
In the step of detecting an abnormality of the task, when the work amount is smaller than an average of past work amounts, it is detected as abnormal.
The task control method according to claim 1, wherein:
複数のタスクを中央処理装置が処理するデータ処理システムにおいて、
前記中央処理装置の処理資源をスライスタイムの間、複数の前記タスクに割り当てるシステム管理手段と、
前記タスクを監視するタスク監視手段と、を有し、
前記タスク監視手段は、前記タスクによるデータ処理の仕事量に基づき前記タスクの異常を検出し、異常が検出されない場合は、データの処理状況に基づき前記システム管理手段にスライスタイムの延長を要求する、
ことを特徴とするデータ処理システム。
In a data processing system in which a central processing unit processes a plurality of tasks,
System management means for allocating processing resources of the central processing unit to a plurality of tasks during a slice time;
Task monitoring means for monitoring the task,
The task monitoring means detects an abnormality of the task based on the workload of data processing by the task, and if no abnormality is detected, requests the system management means to extend the slice time based on the data processing status.
A data processing system characterized by that.
中央処理装置の処理資源が割り当てられて、スライスタイムの間データ処理するタスクの仕事量を検出するステップと、
前記仕事量に基づき前記タスクの異常を検出するステップと、
前記タスクの異常が検出されない場合、データの処理状況に基づきスライスタイムを延長するか否かを判定するステップと、
スライスタイムを延長すると判定された場合、スライスタイムを割り当てるシステム管理手段にスライスタイムの延長を要求するステップと、
をコンピュータにより実現することを特徴とするタスク制御プログラム。
Detecting the work of a task to which processing resources of the central processing unit are allocated and processing data during a slice time;
Detecting an abnormality of the task based on the workload;
If no abnormality of the task is detected, determining whether to extend the slice time based on the data processing status; and
If it is determined to extend the slice time, requesting the system management means for allocating the slice time to extend the slice time;
Is realized by a computer.
請求項4記載のプログラムを記憶したコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 4.
JP2006311798A 2006-11-17 2006-11-17 Task control method, data processing system, task control program, and its storage medium Pending JP2008129709A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006311798A JP2008129709A (en) 2006-11-17 2006-11-17 Task control method, data processing system, task control program, and its storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006311798A JP2008129709A (en) 2006-11-17 2006-11-17 Task control method, data processing system, task control program, and its storage medium

Publications (1)

Publication Number Publication Date
JP2008129709A true JP2008129709A (en) 2008-06-05

Family

ID=39555480

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006311798A Pending JP2008129709A (en) 2006-11-17 2006-11-17 Task control method, data processing system, task control program, and its storage medium

Country Status (1)

Country Link
JP (1) JP2008129709A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015079327A (en) * 2013-10-16 2015-04-23 Necプラットフォームズ株式会社 Resource management device, resource management method, and resource management program
CN115396691A (en) * 2021-05-21 2022-11-25 北京金山云网络技术有限公司 Data stream processing method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015079327A (en) * 2013-10-16 2015-04-23 Necプラットフォームズ株式会社 Resource management device, resource management method, and resource management program
CN115396691A (en) * 2021-05-21 2022-11-25 北京金山云网络技术有限公司 Data stream processing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
JP4367856B2 (en) Process control system and control method thereof
US20090228889A1 (en) Storage medium storing job management program, information processing apparatus, and job management method
CN110673927B (en) Scheduling method and device of virtual machine
US9189293B2 (en) Computer, virtualization mechanism, and scheduling method
CN109086135B (en) Resource scaling method and device, computer equipment and storage medium
KR20130087257A (en) Method and apparatus for resource allocation of gpu
JP2009223842A (en) Virtual machine control program and virtual machine system
CN115113987A (en) Method, device, equipment and medium for allocating non-uniform memory access resources
JP2008204243A (en) Job execution control method and system
EP3279795A1 (en) Method and apparatus for deleting cloud host in cloud computing environment, server and storage medium
JP6477260B2 (en) Method and resource manager for executing an application
JP2008129709A (en) Task control method, data processing system, task control program, and its storage medium
KR20130051076A (en) Method and apparatus for scheduling application program
JP2009237858A (en) Server task management program and server task management method
JP6488910B2 (en) Control method, control program, and information processing apparatus
JP4723465B2 (en) Job allocation program and job allocation method
JP5444900B2 (en) Job execution management system, job execution management method, job execution management program
JP2008225641A (en) Computer system, interrupt control method and program
US10528387B2 (en) Computer processing system with resource optimization and associated methods
JP2015121963A (en) Information processing system, monitoring method, and program
CN108804225B (en) Virtual machine load regulation and control method and device
JP2001282560A (en) Virtual computer control method, its performing device and recording medium recording its processing program
JP5417626B2 (en) Management computer, job scheduling method and job scheduling program
KR20150002270A (en) Method and its apparatus for task load balancing for multicore system
CN111124660A (en) Method and device for allocating idle resources in virtual machine