JP6702762B2 - Information processing apparatus, information processing apparatus control method, and program - Google Patents
Information processing apparatus, information processing apparatus control method, and program Download PDFInfo
- Publication number
- JP6702762B2 JP6702762B2 JP2016041460A JP2016041460A JP6702762B2 JP 6702762 B2 JP6702762 B2 JP 6702762B2 JP 2016041460 A JP2016041460 A JP 2016041460A JP 2016041460 A JP2016041460 A JP 2016041460A JP 6702762 B2 JP6702762 B2 JP 6702762B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- execution
- tasks
- information processing
- cpu
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims description 60
- 230000010365 information processing Effects 0.000 title claims description 21
- 230000008569 process Effects 0.000 claims description 53
- 238000012545 processing Methods 0.000 claims description 53
- 238000007726 management method Methods 0.000 description 22
- 238000004891 communication Methods 0.000 description 21
- 238000010586 diagram Methods 0.000 description 10
- 230000004044 response Effects 0.000 description 9
- 230000006870 function Effects 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 4
- 230000007704 transition Effects 0.000 description 4
- 230000004913 activation Effects 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
本発明は、情報処理装置、情報処理装置の制御方法、及びプログラムに関し、特に実行リソースの使用制限が存在する環境下における、複数のタスクをバックグラウンドで実行する情報処理装置のタスク実行に関する。 The present invention relates to an information processing device, a method for controlling the information processing device, and a program, and more particularly, to task execution of an information processing device that executes a plurality of tasks in the background under an environment where there are usage resource usage restrictions.
デバイス等から使用状況を収集し、収集した使用状況をインターネット上の管理サーバへ送信するシステムの手順として、以下が考えられる。まず、収集対象となるデバイスに対して使用状況を収集するためのリクエストを送信し、使用状況ログを取得する。次に、取得したデータを加工し、管理サーバへ送信する。 The following are possible system procedures for collecting the usage status from devices and transmitting the collected usage status to the management server on the Internet. First, a request for collecting the usage status is transmitted to the device to be collected, and the usage status log is acquired. Next, the acquired data is processed and transmitted to the management server.
ここで、システムを動作させる環境として、実行リソースに制限が存在する環境が考えられる。具体的には、例えば、携帯端末(デバイス)におけるバックグラウンドでの処理等が挙げられる。携帯端末では、バッテリー消費を抑制する目的で、バックグラウンドで動作するプログラムが使用できるリソースに制限がある。このような環境下において、デバイスや管理サーバとの通信を行う場合、通信先のレスポンスがCPUの使用可能時間より遅い場合、待機もしくは別の処理を先に実行すると、その別の処理によってCPUを消費し、データ通信に失敗してしまうことがある。また、デバイスの種類によっては、途中で通信がキャンセルされてしまった場合、途中再開できずに初めから通信を行うことがある。この場合、データ通信に失敗した後リトライを行っても繰り返し失敗してしまい、通信が完了しないこともある。このような状況を解決するために、実行リソースの制限を考慮した実行リソースの配分制御やタスク制御が必要となる。 Here, an environment in which execution resources are limited is conceivable as an environment for operating the system. Specifically, for example, background processing in a mobile terminal (device) can be mentioned. In a mobile terminal, the resources that can be used by a program operating in the background are limited in order to suppress battery consumption. In such an environment, when communicating with a device or a management server, if the response at the communication destination is slower than the available time of the CPU, and if the standby or another process is executed first, the CPU will be processed by the other process. It may be consumed and data communication may fail. Also, depending on the type of device, if the communication is canceled midway, it may not be possible to restart midway, and communication may continue from the beginning. In this case, even if a retry is made after the data communication fails, the communication may repeatedly fail and the communication may not be completed. In order to solve such a situation, it is necessary to control the allocation of the execution resources and the task control in consideration of the limitation of the execution resources.
そこで、特定のタスクに多くの時間CPUを使用して特定の処理をより多く実行できるようにするための方法が特許文献1に開示されている。特許文献1では、実行すべき処理が予め決められた特定の処理であるかどうかを判定し、予め決められた特定の処理である場合、既に割り当てられている処理を前記特定の処理に割当てる処理を行う。
Therefore,
しかしながら、特許文献1では、予め決められた処理にCPUを割り当てるのみであり、デバイスのレスポンス状況など、動的な条件の場合が考慮されていない。また、処理がキャンセルされてしまった際に途中再開できずに初めから行う必要がある場合についても考慮されていない。そのため、通信先のレスポンスがCPUの使用可能時間より遅い場合に、通信の失敗が続く恐れがある。つまり、実行リソースに制限がある環境下において、デバイスやサーバと通信を行う場合、通信先のレスポンスがCPUの使用可能時間より遅い場合に待機もしくは別の処理を先に実行すると、別の処理によってCPUを消費し、データ通信に失敗してしまう。また、途中で通信がキャンセルされてしまった際に途中再開できずに初めから通信を行う場合、データ通信に失敗した後リトライを行っても繰り返し失敗してしまい、通信が完了しない場合がある。
However,
本発明は、上記課題を鑑みて、実行リソースに制限がある環境下においてデバイスやサーバと通信を行う場合であっても、複数のタスクをバックグラウンドで実行することができる情報処理装置を提供すること目的とする。 In view of the above problems, the present invention provides an information processing apparatus capable of executing a plurality of tasks in the background even when communicating with a device or a server in an environment where execution resources are limited. That is the purpose.
上記課題を解決するために、本発明の情報処理装置は、複数のタスクをバックグラウンドで実行する情報処理装置であって、前記複数のタスクを実行する実行手段と、前記実行手段で実行するタスクが途中再開不可のタスクであり、かつ、CPUの使用制限があり、かつ、当該途中再開不可のタスクの待機処理が発生した場合、当該待機処理が発生したタスク以降で実行予定の他のタスクをキャンセルするキャンセル手段と、を備えることを特徴とする。 In order to solve the above problems, an information processing apparatus of the present invention is an information processing apparatus for executing a plurality of tasks in the background, and execution means for executing a plurality of tasks, run by the execution means If the task is a task that cannot be restarted midway, and there is a CPU usage restriction, and standby processing for the task that cannot be restarted midway occurs , another task that is scheduled to be executed after the task in which the standby processing occurred And a canceling means for canceling.
本発明によれば、実行リソースに制限がある環境下においてデバイスやサーバと通信を行う場合であっても、複数のタスクをバックグラウンドで実行することができる情報処理装置を提供することができる。これにより、実行リソースに制限がある環境下における途中再開不可タスクで待機が発生した場合、他のタスクをキャンセルし、実行リソースの割り当てを前記タスクに集中させることで実行リソース制限内にタスクが完了できる確率を高めることができる。また、タスクの実行が実行リソース使用制限内に完了しなかった場合でもリトライ回数が一定値を上回ると実行リソースの制限がないときにのみタスクを実行するようにする。従って、途中再開不可のタスクが繰り返し完了できず、他のタスクにも影響を与える状況を防止することができ、より効率的なタスク処理を実現することが可能となる。 According to the present invention, it is possible to provide an information processing apparatus capable of executing a plurality of tasks in the background even when communicating with a device or a server under an environment where execution resources are limited. As a result, when waiting occurs in a task that cannot be restarted midway in an environment where execution resources are limited, other tasks are canceled and the allocation of execution resources is concentrated on the task, and the task is completed within the execution resource limit. You can increase the probability that you can. Even if the execution of the task is not completed within the execution resource usage limit, if the number of retries exceeds a certain value, the task is executed only when the execution resource is not limited. Therefore, it is possible to prevent a situation in which a task that cannot be restarted midway cannot be completed repeatedly, and that affects other tasks, and it is possible to realize more efficient task processing.
以下、本発明を実施するための最良の形態について図面などを参照して説明する。なお、本明細書で説明するシステムおよび方法は、各デバイスのログを収集、加工し、送信するものである。以降の説明および発明の図の中で、当事者にとって周知であり、本発明の説明を理解するために必要ない箇所は、本明細書では省略する。 Hereinafter, the best mode for carrying out the present invention will be described with reference to the drawings. The system and method described in this specification collect, process, and transmit logs of each device. In the following description and in the drawings of the invention, parts that are well known to persons skilled in the art and are not necessary for understanding the description of the present invention will be omitted herein.
(第1実施形態)
図1は、本実施形態に係る全体システム構成の一例を示す概念図である。本システムは、サーバコンピュータ102と、クライアント端末103と、デバイス104とを備え、各装置は、LAN207を介してインターネット101に接続されている。インターネット101は、ファイアウォールを越えて上述の各装置間で情報をやり取りするための通信回線である。インターネット101により、サーバコンピュータ102、クライアント端末103、デバイス104が属するLAN207とは、ファイアウォールを越えて通信が可能である。なお、デバイス104とは、パーソナルコンピュータ(情報処理装置)や、パーソナルコンピュータでのオペレーションシステムを仮想化した仮想PCやリモートPCを指す。また、画像形成装置、プリンタやMFP(マルチファンクションペリフェラル)等の組み込みコンピュータであってもよい。LAN207およびインターネット101は、例えば、TCP/IPプロトコルなどをサポートする通信回線網であり、有線・無線は問わずいずれであってもよい。なお、本実施形態では、サーバコンピュータ102、デバイス104は、それぞれ1台として示しているが、複数台で構成されていてもよく、仮想PCとして構成されていてもよい。
(First embodiment)
FIG. 1 is a conceptual diagram showing an example of the overall system configuration according to the present embodiment. This system includes a
図2は、本実施形態に係るコンピュータ200のハードウェア構成の一例を示すブロック図である。なお、特に断らない限り、本発明の機能が実行されるのであれば、単体の機器であっても、複数の機器から成るシステムであってもよい。また、特に断らない限り、本発明の機能が実行されるのであれば、LAN、WAN、インターネット等のネットワークを介して接続が為され処理が行われるシステムであっても本発明を適用できる。
FIG. 2 is a block diagram showing an example of the hardware configuration of the
なお、以降の説明で、コンピュータ200は、サーバコンピュータ102、クライアント端末103、デバイス104のいずれであってもよい。コンピュータ200は、ROM202のプログラム用ROMあるいは外部記憶装置205に記憶された文書処理プログラム等に基づいて図形、イメージ、文字、表(表計算等を含む)等が混在した処理を実行するCPU201を備える。CPU201は、システムバス204に接続される各デバイスを統括的に制御する。なお、これら以外に入出力装置を備えていてもよい。また、このROM202のプログラム用ROMあるいは外部記憶装置205には、CPU201の制御プログラムであるオペレーションシステムや各種データ等を記憶する。RAM203は、CPU201の主メモリ、ワークエリア等として機能し、ネットワークI/F制御部206は、LAN207とのデータの送受信を制御する。加えて、CPU201が外部記憶装置205に記憶されているプログラムに基づき処理を実行することによって、後述の図4に示されるようなコンピュータ200のソフトウェア構成及び後述するフローチャートの各ステップの処理が実現される。
In the following description, the
図3は、本実施形態に係る全体システム構成の一例を示す詳細図である。まず、インターネット101経由でアクセス可能な管理サーバ301があるものとする。管理サーバ301は、図1で示すサーバコンピュータ102と同様の構成であってよく、デバイスAおよびデバイスB(104)から収集したログデータを回収するためのサーバである。また、クライアント端末103は、デバイスAおよびデバイスB(104)からのログ収集、管理サーバ301へのログ送信等を行う機能を有し、アプリケーション302と、バックグラウンドタスク303から構成されている。アプリケーション302は、ユーザからの指示で起動するプログラムであり、不図示のユーザインタフェースを介してユーザとやり取りを行う。また、アプリケーション302は、ユーザ指示を受けてバックグラウンドタスク303を起動することも可能である。バックグラウンドタスク303は、クライアント端末103のバックグラウンドで動作するプログラムである。一般的には、定期間隔でオペレーティングシステム(以下、OS)から起動されるが、前述のように、ユーザからの指示を受けてアプリケーション302から起動される場合もある。デバイスAおよびデバイスB(104)は、インターネット101に直接接続されており、クライアント端末103からの要求を受けて自デバイス内の情報を取得し、ログ情報を送信する。
FIG. 3 is a detailed diagram showing an example of the overall system configuration according to the present embodiment. First, it is assumed that there is a
次に、本実施形態に係るクライアント端末103内のバックグラウンドタスク303のソフトウェア構成の一例を図4にて示す。バックグラウンドタスク303は、デバイス104のログを収集、送信する機能を有する。バックグラウンドタスク303は、データ処理プログラムと情報格納領域の2つの種類に分類できる。データ処理プログラムは、タスク管理部401、タスク順序決定部402、タスク実行部403、プログラム状態管理部404、ネットワークI/F405から構成されている。情報格納領域は、実行履歴情報406、タスク定義情報407、制限あり時実行キュー408、制限なし時実行キュー409から構成されている。なお、情報格納領域は、ファイルやメモリなど、データの保存形式は問わないが、ROM202のデータ用ROMあるいは外部記憶装置205と同等の場所に永続的に保管出来ることが望ましい。また、制限あり時実行キュー408と、制限なし時実行キュー409の2つのキューは、同一の構成であってよく、本実施形態では、2つのキューを総じて述べる場合は、単に、実行キューと記載する。
Next, an example of the software configuration of the
タスク管理部401は、実行するタスクを管理する処理部である。主な役割としては、本プログラムで実行すべきタスクの決定やキューへの格納および各処理部への指示を行う。また、タスク管理部401は、実行履歴情報406とタスク定義情報407を管理している。タスク順序決定部402は、実行キューに格納されている複数のタスクを、ある条件を基に順序を変更する役割を担う。タスク順序決定部402が行う処理は、図7において後述する。タスク実行部403は、実行キューに格納されている複数のタスクを決められた順序に従って実行する処理部である。プログラム状態管理部404は、プログラムの状態、状況について管理する。具体的には、本プログラムがどのようなトリガーを受けて起動されたかの情報や、使用できるリソースに制限があるかどうか、使用できるリソースを超過したか等の情報を、OSを介して管理している。そして、これらの情報は、各処理部へ通知される。ネットワークI/F405は、外部ネットワークとの接続を行うためのインタフェースを担う部分である。そして、タスク実行部403は、ネットワークI/F405を介して管理サーバ301やデバイス104と通信することが可能である。
The
実行履歴情報406は、実行されたタスクの履歴を格納する領域であり、本プログラムにおいてタスクが完了した場合やタスクが途中でキャンセルされた場合にデータが書き出され、プログラム起動時に参照される。なお、その詳細は、図5(A)にて後述する。タスク定義情報407は、本プログラムが実行するタスクの種類を定義する領域である。なお、その詳細は、図5(B)にて後述する。制限あり時実行キュー408および制限なし時実行キュー409は、実行すべきタスクを格納するキューである。制限あり時実行キュー408は、本プログラムを動作させるCPUに使用制限がある場合に、制限なし時実行キュー409は、CPUの使用制限がない場合に実行されるキューである。実行キュー内のデータは、タスク管理部401によって格納され、タスク実行部403によって取り出される。なお、その詳細は、図5(C)にて後述する。
The
次に、本実施形態に係るクライアント端末103のデータ構造の一例について、図5を参照して説明する。なお、本実施形態で扱う主なデータは、図4に示す実行履歴情報406、タスク定義情報407、制限あり時実行キュー408、制限なし時実行キュー409の4つとするが、これらに限定しない。
Next, an example of the data structure of the
図5(A)は、実行履歴情報406のデータ構造の一例を示す図である。実行履歴情報406は、履歴ID501、タスクID502、対象デバイス503、ステータス504、リトライ回数505から構成されている。履歴ID501は、タスクの実行履歴を一意に識別するための識別子である。タスクID502は、タスクの内容を一意に識別するための識別子であり、タスク定義情報407に保存されている情報と紐付けられている。対象デバイス503は、どのデバイスに対するタスクであるかを示す。本実施形態では、デバイスの名称を記載しているが、デバイスを特定できれば名称でなくてもよい。ステータス504は、タスクの現在の実行ステータスを示し、「未実行」、「実行中」、「完了」の3つの種類が存在する。「未実行」は、対象のタスクがまだ実行されていないことを示す。「進行中」は、対象のタスクが実行中であることを示す。すなわち、前回のプログラム起動時に実行が完了せずに途中でキャンセルされた状態であることを示す。「完了」は、対象のタスクが完了したことを示し、これ以上タスクを実行する必要はない。
FIG. 5A is a diagram showing an example of the data structure of the
図5(B)は、タスク定義情報407のデータ構造の一例を示す図である。タスク定義情報407は、タスクID502、処理内容506、タスク種類507から構成されている。処理内容506は、このタスクがどのような内容の処理を行うかを示している。なお、本実施形態では、「デバイスからのログ収集」、「ログの加工」、「管理サーバへログファイル送信」の3種類のタスクが存在するが、これらに限定することなく、他のタスクであってもよい。タスク種類507は、タスクの種類を示し、本実施形態では、「途中再開可能」または「途中再開不可」のいずれかである。文字通り、「途中再開可能」は、タスクがキャンセルされても途中から再開可能であることを示し、「途中再開不可」は、タスクがキャンセルされたら最初からやり直しとなることを示している。
FIG. 5B is a diagram showing an example of the data structure of the
図5(C)は、実行キュー(制限あり時実行キュー408および制限なし時実行キュー409)のデータ構造の一例を示す図である。実行キューは、キューID508、タスクID502、対象デバイス503、ステータス504から構成されている。キューID508は、キュー内のタスクを一意に識別する識別子であり、数字が小さいキューID508を有するタスクが優先されて実行される。この場合、デバイスAに対するログの加工処理が始めに実行され、デバイスBに対するログファイルの送信処理が最後に実行される。また、本実施形態では、ステータス504は、図5(A)と異なり、「未実行」および「実行中」の2種類のみが存在する。これは、完了済みのタスクは、実行キューに格納されないためである。
FIG. 5C is a diagram showing an example of the data structure of the execution queues (execution queue with
次に、クライアント端末103が行う処理の一例を、複数のフローチャートを用いて説明する。本実施形態では、CPUの制限が存在する環境下でデバイスA、デバイスBの2つのデバイスに対して図5(B)に示す3種類のタスク(計6タスク)を実行した場合について説明を行う。まず、図6は、本実施形態に係るクライアント端末の一連の処理の一例を示すフローチャートであり、タスク順序決定処理(ステップS1)、タスク実行処理(ステップS2)の2つのステップを順番に実行する。なお、図6の処理は、本実施形態および後述する第2実施形態で同一の処理である。ステップS1については、図7を参照し、ステップS2については、図8を参照して詳細に説明する。
Next, an example of processing performed by the
次に、本実施形態に係るクライアント端末103が実施する、タスクの実行順序を決定するタスク順序決定処理の詳細を、図7に示すフローチャートを用いて説明する。前述したように、OSからの定期起動かユーザ指示により本フローが開始される。まず、ステップS11において、タスク管理部401は、プログラム起動後に実行するタスクを実行履歴情報406またはタスク定義情報407から取得する。なお、本実施形態では、実行タスクの取得処理は、新規にタスクを実行する場合と、前回のプログラム起動時に実行したタスクの途中から実行する場合の2つのケースがある。新規にタスクを実行する場合、実行履歴情報406が存在しないため、定められた処理をタスク定義情報407から取得する。本実施形態において、定められた処理とは、図5で説明したデバイス104からのログ収集処理を、接続されているデバイス数分実行することである。このデバイス数を得るため、OSに登録されているデバイス104の情報を取得する。途中から実行する場合は、図5において説明した実行履歴情報406に記録されている、ステータス504が「完了」でないタスクを実行することを認識する。
Next, details of the task order determination processing for determining the task execution order, which is executed by the
実行タスクが取得出来たら、ステップS12において、タスク管理部401は、プログラムが動作している環境にCPUの使用制限が存在しているか否かを、プログラム状態管理部404に問い合わせる。CPU制限が存在しない場合(No)、制限なし実行キュー409に実行予定のタスクを格納して本フローを終了し、ステップS11で取得したタスクを実行する処理に移る。一方、CPU制限が存在する場合(Yes)、制限を考慮したタスクの実行が必要であるとみなし、ステップS13、S14でタスク順序決定部402に対してタスク順序を決定する指示を行う。また、取得したタスクを制限あり時実行キュー408へと格納する。
When the execution task can be acquired, in step S12, the
次に、ステップS13において、タスク順序決定部402は、ステップS11で取得したタスクの中に途中再開不可のタスクが存在するか否かを判定する。存在しない場合(No)、本フローを終了し、タスク実行処理に進む。一方、途中再開不可のタスクが存在する場合(Yes)、ステップS14に進み、途中再開不可のタスクを優先的に実行するように順序を決定する。具体的には、制限あり時キュー408の各タスクのうち、タスク種類507が「途中再開不可」のタスクが先に実行されるようにタスクを並び替える。この処理により途中再開不可のタスクが途中再開可能なタスクより先に実行されるため、途中再開不可のタスクに対してCPUを優先して割り当てることが可能となり、処理途中でCPUの制限超過の可能性を軽減することができる。なお、順序決定の具体例については図9(A)および(B)で後述する。
Next, in step S13, the task
タスク順序が決定したら、タスク実行処理(ステップS2:図6)が実行される。図8は、タスク実行部403によるタスク実行処理の一例を示すフローチャートである。まず、ステップS21において、タスク実行部403は、実行タスクを実行キューから取得する。具体的には、CPU制限がある場合は、制限あり時実行キュー408から、CPU制限がない場合は、制限なし実行キュー409からタスクを取得する。次に、ステップS22において、タスク実行部403は、実行予定のタスクがデバイス104からのログ収集タスクであるか否かを、タスクID502から判定する。ログ収集タスクでない場合(No)、ステップS2bに進み、当該タスクを実行する。そして、完了したら、ステップS2cにおいて、次のタスクが存在するか否かを判定する。次のタスクが存在する場合(Yes)、ステップS21に戻って、次のタスクを実行する。一方、次のタスクが存在しない場合(No)、本フローを終了する。本実施形態において、ログ収集タスク以外のタスクとしては、収集したログの加工タスクや管理サーバ301へのログ送信タスクが挙げられるが、本発明を理解する上で不要であるため詳細の説明は割愛する。
When the task order is determined, task execution processing (step S2: FIG. 6) is executed. FIG. 8 is a flowchart showing an example of task execution processing by the
一方、ステップS22で、ログ収集タスクである場合(Yes)、ステップS23に進む。そして、ステップS23においてタスク実行部403は、デバイス104からのログ収集タスクを実行する。タスク実行部403は、ネットワークI/F405を介してOSに登録されているデバイス104に対してログ要求指示を出す。要求指示を出した後、デバイス104からレスポンスが返ってくる。次に、ステップS24において、タスク実行部403は、返ってきたレスポンスの内容が待機であるか否かを判定する。待機ではない場合(No)、ステップS25に進み、ログファイルを取得する。その後は本タスクを終了し、ステップS26において、次のタスクが存在するか否かを、実行キューの状況をみて判定する。次のタスクが存在しない場合(No)、本フローを終了し、次のタスクが存在する場合(Yes)、ステップS21に戻り、次のタスクについて同様のフローでタスクを実行する。
On the other hand, in step S22, if the task is a log collection task (Yes), the process proceeds to step S23. Then, in step S23, the
一方、ステップS24で、待機処理が発生した場合(Yes)、ステップS27に進み、動作プログラムの環境においてCPU制限があるか否かを、プログラム状態管理部404を介して取得する。CPU制限がない場合(No)、本タスクはCPUの使用制限を考慮することなくタスクを実行できるため、ステップS2aに進み、一定時間待機を行う。なお、本実施形態は、複数スレッドによる並行処理も可能であるため、待機中は、他のタスクを実行することが可能である。そして、待機完了後、ステップS23に戻り、タスク実行部403は、再度デバイス104に対してログ要求指示を出し、ログファイルの取得をする。
On the other hand, if the standby process occurs in step S24 (Yes), the process proceeds to step S27, and it is acquired via the program
一方、ステップS27で、CPU制限がある場合(Yes)、ステップS28に進み、当該タスクが途中再開不可のタスクであるか否かを判定する。途中再開不可のタスクでない場合(No)、CPU制限下においてタスクが途中でキャンセルされてしまっても途中から再開できるため処理のオーバーヘッドは発生しない。そのため、CPU制限を考慮せずにタスクを実行することが可能であり、ステップS2aに進み、一定時間待機する。一方、ステップS28で、途中再開不可のタスクである場合(Yes)、CPU制限下においてタスクが途中でキャンセルされてしまうと初めからやり直しになり、処理のオーバーヘッドが発生してしまう。そのため、CPU制限内での実行完了を試みるためにステップS29に進み、現在キューに格納されている他のタスクをキャンセルし、当該タスク以外のタスクの実行によりCPUを消費しないようにする。つまり、実行するタスク以降で実行予定のタスクをキャンセルする。そして、キャンセル後にステップS2aに進み、一定時間待機を行う。 On the other hand, if the CPU is restricted in step S27 (Yes), the process proceeds to step S28, and it is determined whether the task is a task that cannot be restarted midway. If the task cannot be restarted midway (No), the processing overhead does not occur because the task can be restarted midway even if the task is canceled midway under the CPU limitation. Therefore, the task can be executed without considering the CPU limitation, and the process proceeds to step S2a and waits for a certain period of time. On the other hand, if the task cannot be restarted midway in step S28 (Yes), if the task is canceled midway under the CPU limitation, the task will be restarted from the beginning and processing overhead will occur. Therefore, in order to attempt execution completion within the CPU limit, the process proceeds to step S29, the other tasks currently stored in the queue are canceled, and the CPU is not consumed by executing the tasks other than the task. That is, the task scheduled to be executed after the task to be executed is canceled. After canceling, the process proceeds to step S2a and waits for a certain period of time.
以上のように、図8では、タスク実行処理フローの一例を示したが、本実施形態は、図に示したフローに限定されるものではない。例えば、ステップS24で待機が発生した場合にCPU制限があるか否かを判定した後、途中再開不可のタスクであるか否かを判定したが、これら2つのステップの順序を入れ替えたフローでもよい。また、待機が発生した後、CPU制限があるか否かを判定しているが、タスク実行前にCPU制限があるか否かを判定し、その情報に基づいて、ステップS28以降の処理を実行する順序であってもよい。 As described above, FIG. 8 shows an example of the task execution processing flow, but the present embodiment is not limited to the flow shown in the figure. For example, after determining in step S24 whether or not there is a CPU limitation when a standby occurs, it is determined whether or not the task cannot be restarted midway, but a flow in which the order of these two steps is interchanged may be used. .. Further, after the standby occurs, it is determined whether or not there is a CPU limitation. However, it is determined whether or not there is a CPU limitation before the task execution, and based on the information, the processing of step S28 and thereafter is executed. The order may be the order.
次に、図9は、本実施形態における制限あり時実行キュー408のデータ遷移の一例を示す図である。まず、図9(A)と図9(B)でタスク順序決定前後のデータ遷移を、次に、図9(C)と図9(D)でタスクのキャンセル前後のデータ遷移について説明する。
Next, FIG. 9 is a diagram showing an example of data transition of the restricted
図9(A)は、タスク順序決定前の制限あり時実行キュー408のデータを示す。本データは、図7で説明したように、タスク管理部401が実行履歴情報406を基に格納を行ったデータである。図9(A)では、デバイスA(104)に対するログの加工処理が実行中、すなわち前回のプログラム起動時に途中でキャンセルされた状態で終了したタスクを含んでいる。また、その他未実行のタスクとしてデバイスA(104)に対するログファイル送信処理とデバイスB(104)に対する3つのタスクが存在していることを示している。
FIG. 9A shows data in the restricted
図9(B)は、タスク順序決定後の制限あり時実行キュー408のデータを示す。すなわち、図9(A)の状態からステップS14が実行されることにより順序が変更された状態である。つまり、図9(A)の状態において、タスク順序決定部402は各キューのタスクのタスクID502から、定義情報407のタスク種類507を取得する。そして、タスク種類507が「途中再開不可」である場合、優先的に実行するようにキューの順序を変更する。この場合、デバイスB(104)からのログ収集処理が途中再開不可のタスクであるため、キューID508が0003(3番目に実行予定)からキューID508が0001(1番目に実行予定)に変更される。また、キューID508が0001と0002に格納されていたタスクは、それぞれキューIDが0002、0003へと変更される。
FIG. 9B shows data in the restricted
図9(C)は、デバイスB(104)からのログ収集処理後の制限あり時実行キュー408のデータを示している。図9(B)と比較して、キューID508が0001のタスクが実行されているため、キューから取り除かれている状態となっている。このような状態から、タスクのキャンセル(ステップS29)後の制限あり時実行キュー408の状態が図9(D)となる。図に示す通り、実行タスク以外の全てのタスクをキャンセルしてCPUを他のタスクに割り当てないようにするため、キュー内は空の状態となる。
FIG. 9C shows data in the restricted
以上のように、本実施形態では、タスク順序決定処理においてCPU制限がある場合、複数あるタスクのうち途中再開不可のタスクを優先的に実行するように、優先度を高くして順序を決定することで、当該タスクにCPUを優先的に割り当てている。また、タスク実行処理において、CPU制限がある状況で途中再開不可のタスクで待機が発生した場合、他のタスクを実行してCPUの割り当てを前記タスクに集中させることでCPU制限内にタスクが完了できる確率を高めている。これらの処理により、途中再開不可のタスクが繰り返し完了できないケースを軽減することができ、効率の良いタスク処理を実現することができる。 As described above, in the present embodiment, when there is a CPU limitation in the task order determination processing, the order is determined by increasing the priority so that a task that cannot be resumed midway among the plurality of tasks is preferentially executed. Therefore, the CPU is preferentially assigned to the task. Further, in the task execution process, when a wait occurs for a task that cannot be restarted midway under the condition that the CPU is limited, the task is completed within the CPU limitation by executing another task to concentrate the CPU allocation on the task. It increases the probability that you can do it. By these processes, it is possible to reduce the case where a task that cannot be restarted midway cannot be completed repeatedly, and it is possible to realize efficient task processing.
(第2実施形態)
第1実施形態では、CPUの制限が存在する環境下で2種類のデバイスに対して3種類のタスクを実行した場合について説明をした。第1実施形態により、デバイスとの通信において待機をする必要があった場合に他のタスクをキャンセルしてCPU消費を抑えることでデバイスとの通信をCPU制限内で完了させる確率を高めることが可能となった。しかしながら、ネットワークの状態やデバイスからのレスポンスが極端に遅い場合はタスク実行を完了できない場合がある。そこで、本実施形態では、CPU制限が存在する環境下で途中再開不可のタスクが失敗してしまった場合のエラー処理について説明する。
(Second embodiment)
In the first embodiment, a case has been described where three types of tasks are executed for two types of devices in an environment where there is a CPU limitation. According to the first embodiment, it is possible to increase the probability that communication with a device is completed within the CPU limit by canceling other tasks and suppressing CPU consumption when it is necessary to wait for communication with a device. Became. However, task execution may not be completed if the network status or the response from the device is extremely slow. Therefore, in the present embodiment, error processing in the case where a task that cannot be restarted halfway fails under an environment where there is a CPU limitation will be described.
図10は、本実施形態における、タスク実行部403が行うタスク実行処理の一例を示すフローチャートである。なお、タスク実行処理は、図8において説明済みであり、ここでは本実施形態のポイントとなるタスク失敗時のエラー処理に限定したフローチャートを示す。まず、タスクが実行中にCPU使用制限を超過してしまった場合について説明する。ステップS2aの一定時間待機中、ステップS31において、CPU制限を超過したか否かを判定する。具体的には、CPU制限の超過は、OSからプログラム状態管理部404に対して通知され、その後、タスク実行部403に通知される。CPU制限を超過した通知がない場合(No)、処理を継続可能であるため、ステップS23に戻る。一方、CPU制限を超過した通知がある場合(Yes)、本プログラムは、終了処理を経た後、OSによって強制的に終了させられてしまう。その終了処理(ステップS32)においてタスク管理部401は、実行履歴情報406に実行ステータスを格納するが、その際に現在実行中のタスクのリトライ回数505を1増加させる。この処理により、タスクが何回目のトライであるかを記録することができる。
FIG. 10 is a flowchart showing an example of task execution processing performed by the
次に、図11を用いて本実施形態におけるタスク順序決定部が行うタスク順序決定処理の一例を示す。本実施形態では、図10で説明したフローがCPU制限超過により終了した後、次にプログラムが起動された際に本フローが実行される場合について説明する。すなわち、図10では、CPU制限を超過した場合に実行履歴情報406にリトライ回数を記録したが、このリトライ回数を基に実行キュー中のタスクを移動する処理を行う。
Next, an example of the task order determining process performed by the task order determining unit in the present embodiment will be described using FIG. 11. In the present embodiment, a case will be described in which, after the flow described in FIG. 10 ends due to the CPU limit being exceeded, this flow is executed the next time the program is started. That is, in FIG. 10, the retry count is recorded in the
ステップS11、S12で実行履歴情報を取得した後、CPU制限があった場合(ステップS12でYes)、実行履歴情報内のリトライ回数505が一定以上のタスクが存在するか否かを判定する。一定数以上のタスクが存在する場合(Yes)、そのタスクはCPU制限がある環境において実行しても処理できないタスクであるとみなし、ステップS42に進む。そして、ステップS42において、制限あり時実行キュー408から制限なし時実行キュー409にタスクを移動させる。なお、リトライ回数の閾値は、プログラム内に固定値を保持していても良いし設定ファイルを用意して記載しておき、プログラム実行時に前記設定ファイルから値を読み出してもよい。
After the execution history information is acquired in steps S11 and S12, if there is a CPU limitation (Yes in step S12), it is determined whether or not there is a task whose retry
以上、本実施形態では、タスクの実行がCPU使用制限内に完了しなかった場合にリトライ回数を記憶し、リトライ回数が一定値を上回るとCPU制限あり時に実行しないようにキューを移動させる処理を行う。これにより、永続的に実行エラーが発生し、他のタスクにも影響を与えることを防止することができ、より効率的なタスク処理を実現することが可能となる。 As described above, in the present embodiment, the process of storing the number of retries when the execution of the task is not completed within the CPU usage limit, and moving the queue so as not to execute when the number of retries exceeds a certain value when the CPU is restricted is executed. To do. As a result, it is possible to prevent an execution error from occurring permanently and affecting other tasks, and it is possible to realize more efficient task processing.
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program. It can also be realized by the processing. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
また、本発明の好ましい実施形態について説明したが、本発明は、これらの実施形態に限定されず、その要旨の範囲内で種々の変形および変更が可能である。 Although the preferred embodiments of the present invention have been described, the present invention is not limited to these embodiments, and various modifications and changes can be made within the scope of the gist thereof.
Claims (9)
前記複数のタスクを実行する実行手段と、
前記実行手段で実行するタスクが途中再開不可のタスクであり、かつ、CPUの使用制限があり、かつ、当該途中再開不可のタスクの待機処理が発生した場合、当該待機処理が発生したタスク以降で実行予定の他のタスクをキャンセルするキャンセル手段と、
を備える
ことを特徴とする情報処理装置。 An information processing device that executes a plurality of tasks in the background,
Executing means for executing the plurality of tasks,
A task task in the middle resume not to run in the execution unit, and there are restrictions on the use of CPU and if the standby processing of the middle Resume Call task occurs, since the task of the standby processing has occurred Canceling means to cancel other tasks scheduled to be executed in
An information processing apparatus comprising:
前記実行手段は、前記決定手段で決定した前記実行順序に基づいて、前記複数のタスクを実行する
ことを特徴とする請求項1に記載の情報処理装置。 There are restrictions on the use of the CPU, and the plurality of cases where there is the middle resume not tasks in the task, the plurality of tasks the tasks of the middle Resume Call to preferentially executed to run in the execution unit Further has a determining means for determining the execution order of
The information processing apparatus according to claim 1, wherein the execution unit executes the plurality of tasks based on the execution order determined by the determination unit.
ことを特徴とする請求項1または2に記載の情報処理装置。 The execution means, if said other task has been canceled by the canceling means, a predetermined time, the information processing apparatus according to claim 1 or 2, characterized in that the wait for execution of the task.
ことを特徴とする請求項3に記載の情報処理装置。 Before you line means, and the task satisfies a predetermined condition that the standby processing has occurred, the <br/> controlling the tasks to which the standby processing occurred so as to run in situations without the restriction of the use of CPU The information processing apparatus according to claim 3, characterized in that
ことを特徴とする請求項4に記載の情報処理装置。 The information processing apparatus according to claim 4 , wherein the case of satisfying the predetermined condition is a case where the use restriction of the CPU is exceeded a predetermined number of times or more .
ことを特徴とする請求項2に記載の情報処理装置。 The information processing apparatus according to claim 2, wherein the determining unit acquires information regarding a usage restriction of the CPU from an operating system and determines the execution order based on the acquired information. ..
ことを特徴とする請求項1〜6のいずれか1項に記載の情報処理装置。 The middle Resume Call task, the information processing apparatus according to any one of claims 1 to 6, characterized in that a logging task of the image forming apparatus.
前記複数のタスクを実行する実行工程と、
前記実行工程において実行するタスクが途中再開不可のタスクであり、かつ、CPUの使用制限があり、かつ、当該途中再開不可のタスクの待機処理が発生した場合、当該待機処理が発生したタスク以降で実行予定の他のタスクをキャンセルするキャンセル工程と、
を有する
ことを特徴とする情報処理装置の制御方法。 A method for controlling an information processing device, which executes a plurality of tasks in the background ,
An execution step for executing the plurality of tasks,
Wherein an execution step odor Te perform the task is in the middle resume Call task, and there are restrictions on the use of CPU and if the standby processing of the middle Resume Call task occurs, the task of the standby processing has occurred A cancellation process to cancel other tasks scheduled to be executed later,
A method for controlling an information processing device, comprising:
Program for causing a computer to function as each unit of the information processing apparatus according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016041460A JP6702762B2 (en) | 2016-03-03 | 2016-03-03 | Information processing apparatus, information processing apparatus control method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016041460A JP6702762B2 (en) | 2016-03-03 | 2016-03-03 | Information processing apparatus, information processing apparatus control method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017157099A JP2017157099A (en) | 2017-09-07 |
JP6702762B2 true JP6702762B2 (en) | 2020-06-03 |
Family
ID=59809877
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016041460A Expired - Fee Related JP6702762B2 (en) | 2016-03-03 | 2016-03-03 | Information processing apparatus, information processing apparatus control method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6702762B2 (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08212086A (en) * | 1994-09-30 | 1996-08-20 | Microsoft Corp | System and method for operating of office machine |
JP2006235763A (en) * | 2005-02-22 | 2006-09-07 | Ricoh Co Ltd | Data transmitter, data collection device, data transmission method, data collection method, data transmission program, data collection program and computer-readable recording medium |
JP5573180B2 (en) * | 2010-01-18 | 2014-08-20 | 日本電気株式会社 | CPU resource management system |
WO2014054079A1 (en) * | 2012-10-05 | 2014-04-10 | Hitachi, Ltd. | Job management system and job control method |
CN104699218B (en) * | 2013-12-10 | 2019-04-19 | 华为终端(东莞)有限公司 | A kind of task management method and equipment |
-
2016
- 2016-03-03 JP JP2016041460A patent/JP6702762B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2017157099A (en) | 2017-09-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20120086978A1 (en) | Cloud computing system, information processing method, and storage medium | |
US8717602B2 (en) | Cloud computing system, document processing method, and storage medium in which a number of processing units is adjusted based on processing status | |
US9596121B2 (en) | Server apparatus communicating with a client apparatus via the internet, system, and control method thereof | |
US8547840B1 (en) | Bandwidth allocation of bursty signals | |
US9560116B2 (en) | Network device, system, method, and storage medium | |
JP2005276175A (en) | Scalable print spooler | |
JP5677393B2 (en) | Information processing apparatus and instruction offloading method | |
US8730506B2 (en) | Image forming apparatus that can request ending time for processing print data by an external apparatus from the external apparatus and control method thereof | |
JP5065173B2 (en) | Image forming apparatus, log control method, and program | |
EP2913981B1 (en) | Image forming system, relay server, communication controlling method and non-transitory computer readable recording medium | |
JP6303571B2 (en) | Data processing apparatus, data processing system, data processing method, and program | |
JP6024138B2 (en) | Cluster system | |
JP6702762B2 (en) | Information processing apparatus, information processing apparatus control method, and program | |
JP2014010703A (en) | System that supports cooperation of information processing systems, device, and cooperation method | |
JP5678556B2 (en) | Job execution system, job execution device, and program | |
KR102274930B1 (en) | Method and Apparatus for Managing Channel Connect | |
US11360727B2 (en) | Non-transitory computer-readable medium, terminal management apparatus and terminal management system configured to transmit a received instruction to a relay apparatus without being divided | |
JP5024024B2 (en) | Spool server and data communication control method | |
JP7052396B2 (en) | Data collection server, data collection system, data collection method and data collection program | |
US20120167119A1 (en) | Low-latency communications | |
JP2016045802A (en) | Information processing apparatus, load sharing system, load sharing method, and program | |
JPS6077258A (en) | Load dispersing processing method in computer network system | |
JP2018041190A (en) | Information processing device, control method and program | |
JP5115122B2 (en) | Module having processing performance adjustment function, processing performance adjustment method, and processing performance adjustment program | |
WO2013065151A1 (en) | Computer system, data transmission method, and data transmission program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190227 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20191226 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20200121 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200319 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20200407 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200507 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6702762 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
LAPS | Cancellation because of no payment of annual fees |