JP6702762B2 - Information processing apparatus, information processing apparatus control method, and program - Google Patents

Information processing apparatus, information processing apparatus control method, and program Download PDF

Info

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
Application number
JP2016041460A
Other languages
Japanese (ja)
Other versions
JP2017157099A (en
Inventor
南陽 母里
南陽 母里
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2016041460A priority Critical patent/JP6702762B2/en
Publication of JP2017157099A publication Critical patent/JP2017157099A/en
Application granted granted Critical
Publication of JP6702762B2 publication Critical patent/JP6702762B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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, Patent Document 1 discloses a method for enabling a specific task to be executed more often by using a CPU for a specific task for a long time. In Patent Document 1, it is determined whether or not the process to be executed is a predetermined specific process, and if it is a predetermined specific process, a process of assigning an already assigned process to the specific process I do.

特開2011−186619号公報JP, 2011-186619, A

しかしながら、特許文献1では、予め決められた処理にCPUを割り当てるのみであり、デバイスのレスポンス状況など、動的な条件の場合が考慮されていない。また、処理がキャンセルされてしまった際に途中再開できずに初めから行う必要がある場合についても考慮されていない。そのため、通信先のレスポンスがCPUの使用可能時間より遅い場合に、通信の失敗が続く恐れがある。つまり、実行リソースに制限がある環境下において、デバイスやサーバと通信を行う場合、通信先のレスポンスがCPUの使用可能時間より遅い場合に待機もしくは別の処理を先に実行すると、別の処理によってCPUを消費し、データ通信に失敗してしまう。また、途中で通信がキャンセルされてしまった際に途中再開できずに初めから通信を行う場合、データ通信に失敗した後リトライを行っても繰り返し失敗してしまい、通信が完了しない場合がある。 However, Patent Document 1 only allocates a CPU to a predetermined process, and does not consider a dynamic condition such as a response status of a device. In addition, it does not take into consideration the case that the process cannot be restarted halfway when it is canceled and the process must be performed from the beginning. Therefore, if the response at the communication destination is slower than the available time of the CPU, the communication failure may continue. In other words, when communicating with a device or server in an environment where execution resources are limited, if the response at the communication destination is slower than the available time of the CPU, standby or another process is executed first CPU is consumed and data communication fails. Further, when communication is canceled midway and communication cannot be resumed halfway and communication is performed from the beginning, even if retry is performed after data communication fails, the communication may repeatedly fail and the communication may not be completed.

本発明は、上記課題を鑑みて、実行リソースに制限がある環境下においてデバイスやサーバと通信を行う場合であっても、複数のタスクをバックグラウンドで実行することができる情報処理装置を提供すること目的とする。 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.

全体システム構成の一例を示す概念図である。It is a conceptual diagram which shows an example of the whole system structure. コンピュータのハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of a computer. 全体システム構成の一例を示す詳細図である。It is a detailed diagram showing an example of the whole system configuration. バックグラウンドタスクのソフトウェア構成を示す図である。It is a figure which shows the software structure of a background task. クライアント端末のデータ構造の一例を示す図である。It is a figure which shows an example of the data structure of a client terminal. クライアント端末の一連の処理を示すフローチャートである。It is a flow chart which shows a series of processings of a client terminal. 第1実施形態に係るタスク順序決定処理を示すフローチャートである。It is a flowchart which shows the task order determination process which concerns on 1st Embodiment. 第1実施形態に係るタスク実行処理を示すフローチャートである。6 is a flowchart showing a task execution process according to the first embodiment. 第1実施形態に係る制限あり時実行キューのデータ遷移を示す図である。It is a figure which shows the data transition of the execution queue with a restriction which concerns on 1st Embodiment. 第2実施形態に係るタスク実行処理を示すフローチャートである。It is a flowchart which shows the task execution process which concerns on 2nd Embodiment. 第2実施形態に係るタスク順序決定処理を示すフローチャートである。It is a flowchart which shows the task order determination process which concerns on 2nd Embodiment.

以下、本発明を実施するための最良の形態について図面などを参照して説明する。なお、本明細書で説明するシステムおよび方法は、各デバイスのログを収集、加工し、送信するものである。以降の説明および発明の図の中で、当事者にとって周知であり、本発明の説明を理解するために必要ない箇所は、本明細書では省略する。 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 server computer 102, a client terminal 103, and a device 104, and each device is connected to the Internet 101 via a LAN 207. The Internet 101 is a communication line for exchanging information between the above-mentioned devices across a firewall. Through the Internet 101, the server computer 102, the client terminal 103, and the LAN 207 to which the device 104 belongs can communicate through a firewall. The device 104 refers to a personal computer (information processing device), a virtual PC that virtualizes an operation system of the personal computer, or a remote PC. Further, it may be an image forming apparatus, a built-in computer such as a printer or an MFP (multifunction peripheral). The LAN 207 and the Internet 101 are communication line networks that support the TCP/IP protocol, for example, and may be wired or wireless. In the present embodiment, each of the server computer 102 and the device 104 is shown as one unit, but it may be configured with a plurality of units or as a virtual PC.

図2は、本実施形態に係るコンピュータ200のハードウェア構成の一例を示すブロック図である。なお、特に断らない限り、本発明の機能が実行されるのであれば、単体の機器であっても、複数の機器から成るシステムであってもよい。また、特に断らない限り、本発明の機能が実行されるのであれば、LAN、WAN、インターネット等のネットワークを介して接続が為され処理が行われるシステムであっても本発明を適用できる。 FIG. 2 is a block diagram showing an example of the hardware configuration of the computer 200 according to this embodiment. Unless otherwise specified, the device may be a single device or a system composed of a plurality of devices as long as the functions of the present invention are executed. Further, unless otherwise specified, the present invention can be applied to a system in which a connection is made and a process is performed via a network such as a LAN, WAN, or the Internet, as long as the functions of the present invention are executed.

なお、以降の説明で、コンピュータ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 computer 200 may be any of the server computer 102, the client terminal 103, and the device 104. The computer 200 includes a CPU 201 that executes processing in which graphics, images, characters, tables (including spreadsheets), and the like are mixed based on a program ROM of the ROM 202 or a document processing program stored in the external storage device 205. .. The CPU 201 centrally controls each device connected to the system bus 204. In addition to these, an input/output device may be provided. In addition, the program ROM of the ROM 202 or the external storage device 205 stores an operating system, which is a control program of the CPU 201, various data, and the like. The RAM 203 functions as a main memory, a work area, etc. of the CPU 201, and the network I/F control unit 206 controls data transmission/reception with the LAN 207. In addition, the CPU 201 executes the processing based on the program stored in the external storage device 205, thereby realizing the software configuration of the computer 200 as shown in FIG. 4 described later and the processing of each step of the flowchart described later. It

図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 management server 301 accessible via the Internet 101. The management server 301 may have the same configuration as the server computer 102 shown in FIG. 1, and is a server for collecting the log data collected from the device A and the device B (104). Further, the client terminal 103 has a function of collecting logs from the device A and the device B (104), sending logs to the management server 301, and the like, and includes an application 302 and a background task 303. The application 302 is a program activated by an instruction from the user, and interacts with the user via a user interface (not shown). The application 302 can also start the background task 303 in response to a user instruction. The background task 303 is a program that operates in the background of the client terminal 103. Generally, it is activated from the operating system (hereinafter, OS) at regular intervals, but as described above, it may be activated from the application 302 in response to an instruction from the user. The device A and the device B (104) are directly connected to the Internet 101, receive the request from the client terminal 103, acquire the information in the own device, and transmit the log information.

次に、本実施形態に係るクライアント端末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 background task 303 in the client terminal 103 according to this embodiment is shown in FIG. The background task 303 has a function of collecting and transmitting the log of the device 104. Background tasks 303 can be classified into two types: data processing programs and information storage areas. The data processing program includes a task management unit 401, a task order determination unit 402, a task execution unit 403, a program status management unit 404, and a network I/F 405. The information storage area is composed of execution history information 406, task definition information 407, a limited execution queue 408, and an unlimited execution queue 409. The information storage area may be a file, a memory, or the like regardless of the data storage format, but it is desirable that the information storage area can be permanently stored in the same location as the data ROM of the ROM 202 or the external storage device 205. Further, the two queues of the restricted execution queue 408 and the unrestricted execution queue 409 may have the same configuration, and in the present embodiment, when the two queues are generally described, they are simply described as execution queues. To do.

タスク管理部401は、実行するタスクを管理する処理部である。主な役割としては、本プログラムで実行すべきタスクの決定やキューへの格納および各処理部への指示を行う。また、タスク管理部401は、実行履歴情報406とタスク定義情報407を管理している。タスク順序決定部402は、実行キューに格納されている複数のタスクを、ある条件を基に順序を変更する役割を担う。タスク順序決定部402が行う処理は、図7において後述する。タスク実行部403は、実行キューに格納されている複数のタスクを決められた順序に従って実行する処理部である。プログラム状態管理部404は、プログラムの状態、状況について管理する。具体的には、本プログラムがどのようなトリガーを受けて起動されたかの情報や、使用できるリソースに制限があるかどうか、使用できるリソースを超過したか等の情報を、OSを介して管理している。そして、これらの情報は、各処理部へ通知される。ネットワークI/F405は、外部ネットワークとの接続を行うためのインタフェースを担う部分である。そして、タスク実行部403は、ネットワークI/F405を介して管理サーバ301やデバイス104と通信することが可能である。 The task management unit 401 is a processing unit that manages tasks to be executed. Its main role is to determine the tasks to be executed by this program, store them in a queue, and give instructions to each processing unit. The task management unit 401 also manages execution history information 406 and task definition information 407. The task order determination unit 402 has a role of changing the order of a plurality of tasks stored in the execution queue based on a certain condition. The processing performed by the task order determination unit 402 will be described later with reference to FIG. The task execution unit 403 is a processing unit that executes a plurality of tasks stored in the execution queue in a predetermined order. The program status management unit 404 manages the status and status of the program. Specifically, information such as what triggers this program was activated to start, whether available resources are limited, and whether available resources have been exceeded are managed through the OS. There is. Then, these pieces of information are notified to each processing unit. The network I/F 405 is a part that serves as an interface for connecting to an external network. Then, the task execution unit 403 can communicate with the management server 301 and the device 104 via the network I/F 405.

実行履歴情報406は、実行されたタスクの履歴を格納する領域であり、本プログラムにおいてタスクが完了した場合やタスクが途中でキャンセルされた場合にデータが書き出され、プログラム起動時に参照される。なお、その詳細は、図5(A)にて後述する。タスク定義情報407は、本プログラムが実行するタスクの種類を定義する領域である。なお、その詳細は、図5(B)にて後述する。制限あり時実行キュー408および制限なし時実行キュー409は、実行すべきタスクを格納するキューである。制限あり時実行キュー408は、本プログラムを動作させるCPUに使用制限がある場合に、制限なし時実行キュー409は、CPUの使用制限がない場合に実行されるキューである。実行キュー内のデータは、タスク管理部401によって格納され、タスク実行部403によって取り出される。なお、その詳細は、図5(C)にて後述する。 The execution history information 406 is an area for storing a history of executed tasks. Data is written out when the task is completed in this program or when the task is canceled midway, and is referred to when the program is started. The details will be described later with reference to FIG. The task definition information 407 is an area that defines the type of task executed by this program. The details will be described later with reference to FIG. The restricted execution queue 408 and the unrestricted execution queue 409 are queues that store tasks to be executed. The restricted execution queue 408 is a queue executed when the CPU operating this program has a usage restriction, and the unrestricted execution queue 409 is executed when there is no CPU usage restriction. The data in the execution queue is stored by the task management unit 401 and retrieved by the task execution unit 403. The details will be described later with reference to FIG.

次に、本実施形態に係るクライアント端末103のデータ構造の一例について、図5を参照して説明する。なお、本実施形態で扱う主なデータは、図4に示す実行履歴情報406、タスク定義情報407、制限あり時実行キュー408、制限なし時実行キュー409の4つとするが、これらに限定しない。 Next, an example of the data structure of the client terminal 103 according to the present embodiment will be described with reference to FIG. Note that the main data handled in this embodiment is four pieces of execution history information 406, task definition information 407, restricted execution queue 408, and unrestricted execution queue 409 shown in FIG. 4, but is not limited to these.

図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 execution history information 406. The execution history information 406 includes a history ID 501, a task ID 502, a target device 503, a status 504, and a retry count 505. The history ID 501 is an identifier for uniquely identifying the task execution history. The task ID 502 is an identifier for uniquely identifying the content of the task, and is associated with the information stored in the task definition information 407. The target device 503 indicates to which device the task is directed. In the present embodiment, the name of the device is described, but it may not be the name as long as the device can be specified. The status 504 indicates the current execution status of the task, and there are three types: “unexecuted”, “in execution”, and “completed”. “Not executed” indicates that the target task has not been executed yet. “In progress” indicates that the target task is under execution. That is, it indicates that the program has not been completed when the program was started last time and the program has been canceled midway. “Completed” indicates that the target task is completed, and it is not necessary to execute the task any more.

図5(B)は、タスク定義情報407のデータ構造の一例を示す図である。タスク定義情報407は、タスクID502、処理内容506、タスク種類507から構成されている。処理内容506は、このタスクがどのような内容の処理を行うかを示している。なお、本実施形態では、「デバイスからのログ収集」、「ログの加工」、「管理サーバへログファイル送信」の3種類のタスクが存在するが、これらに限定することなく、他のタスクであってもよい。タスク種類507は、タスクの種類を示し、本実施形態では、「途中再開可能」または「途中再開不可」のいずれかである。文字通り、「途中再開可能」は、タスクがキャンセルされても途中から再開可能であることを示し、「途中再開不可」は、タスクがキャンセルされたら最初からやり直しとなることを示している。 FIG. 5B is a diagram showing an example of the data structure of the task definition information 407. The task definition information 407 includes a task ID 502, a processing content 506, and a task type 507. The processing content 506 indicates what kind of processing this task performs. In addition, in the present embodiment, there are three types of tasks of “log collection from device”, “log processing”, and “send log file to management server”. It may be. The task type 507 indicates the type of task, and in the present embodiment, is either “halfway restartable” or “halfway restart not possible”. Literally, "resumable in the middle" indicates that the task can be resumed from the middle even if it is canceled, and "impossible to resume in the middle" indicates that the task will be restarted from the beginning.

図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 limitation 408 and execution queue with no limitation 409). The execution queue includes a queue ID 508, a task ID 502, a target device 503, and a status 504. The queue ID 508 is an identifier that uniquely identifies the task in the queue, and the task having the queue ID 508 having a small number is preferentially executed. In this case, the log processing process for the device A is executed first, and the log file transmission process for the device B is executed last. In addition, in the present embodiment, unlike the status 504 of FIG. 5A, there are only two types, “unexecuted” and “in execution”. This is because completed tasks are not stored in the execution queue.

次に、クライアント端末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 client terminal 103 will be described using a plurality of flowcharts. In the present embodiment, a case will be described where three types of tasks (a total of 6 tasks) shown in FIG. 5B are executed for two devices, device A and device B, in an environment where there is a CPU limitation. .. First, FIG. 6 is a flowchart showing an example of a series of processes of the client terminal according to the present embodiment, and two steps of a task order determination process (step S1) and a task execution process (step S2) are sequentially executed. .. The process of FIG. 6 is the same process in this embodiment and the second embodiment described later. Step S1 will be described in detail with reference to FIG. 7, and step S2 will be described in detail with reference to FIG.

次に、本実施形態に係るクライアント端末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 client terminal 103 according to the present embodiment, will be described using the flowchart shown in FIG. 7. As described above, this flow is started by the regular activation from the OS or the user's instruction. First, in step S11, the task management unit 401 acquires a task to be executed after starting the program from the execution history information 406 or the task definition information 407. It should be noted that in the present embodiment, the execution task acquisition process has two cases: a case where a new task is executed and a case where the task executed at the time of the previous program startup is executed midway. When a task is newly executed, since the execution history information 406 does not exist, the determined process is acquired from the task definition information 407. In the present embodiment, the defined processing is to execute the log collection processing from the device 104 described in FIG. 5 for the number of connected devices. In order to obtain this number of devices, the information of the device 104 registered in the OS is acquired. When executing from the middle, it recognizes that a task whose status 504 recorded in the execution history information 406 described in FIG. 5 is not “completed” is executed.

実行タスクが取得出来たら、ステップ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 task management unit 401 inquires of the program state management unit 404 whether or not there is a CPU usage restriction in the environment in which the program is operating. If there is no CPU restriction (No), the task to be executed is stored in the unexecuted execution queue 409, the present flow ends, and the process proceeds to the process of executing the task acquired in step S11. On the other hand, if there is a CPU limitation (Yes), it is considered necessary to execute the task in consideration of the limitation, and the task order determining unit 402 is instructed to determine the task order in steps S13 and S14. Further, the acquired task is stored in the restricted execution queue 408.

次に、ステップS13において、タスク順序決定部402は、ステップS11で取得したタスクの中に途中再開不可のタスクが存在するか否かを判定する。存在しない場合(No)、本フローを終了し、タスク実行処理に進む。一方、途中再開不可のタスクが存在する場合(Yes)、ステップS14に進み、途中再開不可のタスクを優先的に実行するように順序を決定する。具体的には、制限あり時キュー408の各タスクのうち、タスク種類507が「途中再開不可」のタスクが先に実行されるようにタスクを並び替える。この処理により途中再開不可のタスクが途中再開可能なタスクより先に実行されるため、途中再開不可のタスクに対してCPUを優先して割り当てることが可能となり、処理途中でCPUの制限超過の可能性を軽減することができる。なお、順序決定の具体例については図9(A)および(B)で後述する。 Next, in step S13, the task order determination unit 402 determines whether or not there is a task that cannot be restarted midway among the tasks acquired in step S11. If it does not exist (No), this flow is ended, and the process proceeds to task execution processing. On the other hand, if there is a task that cannot be resumed midway (Yes), the process proceeds to step S14, and the order is determined so that the task that cannot be resumed midway is preferentially executed. Specifically, among the tasks in the limited time queue 408, the tasks are rearranged so that the task whose task type 507 is "cannot be resumed" is executed first. By this processing, the tasks that cannot be restarted halfway are executed before the tasks that can be restarted halfway, so it is possible to give priority to CPUs for tasks that cannot be restarted halfway, and the CPU limit can be exceeded during processing. It is possible to reduce the sex. A specific example of order determination will be described later with reference to FIGS.

タスク順序が決定したら、タスク実行処理(ステップ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 task execution unit 403. First, in step S21, the task execution unit 403 acquires an execution task from the execution queue. Specifically, if there is a CPU limitation, the task is obtained from the limitation execution queue 408, and if there is no CPU limitation, the task is obtained from the unlimited execution queue 409. Next, in step S22, the task execution unit 403 determines from the task ID 502 whether or not the task to be executed is a log collection task from the device 104. If it is not a log collection task (No), the process proceeds to step S2b and the task is executed. Then, when completed, it is determined in step S2c whether or not the next task exists. If the next task exists (Yes), the process returns to step S21 to execute the next task. On the other hand, if the next task does not exist (No), this flow ends. In the present embodiment, examples of tasks other than the log collection task include a processing task of collected logs and a log transmission task to the management server 301, but detailed description thereof is omitted because it is unnecessary for understanding the present invention. To do.

一方、ステップ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 task execution unit 403 executes the log collection task from the device 104. The task execution unit 403 issues a log request instruction to the device 104 registered in the OS via the network I/F 405. After issuing the request instruction, a response is returned from the device 104. Next, in step S24, the task execution unit 403 determines whether or not the content of the returned response is waiting. If it is not in standby (No), the process proceeds to step S25, and a log file is acquired. After that, this task is ended, and in step S26, it is determined whether or not the next task exists by observing the status of the execution queue. When the next task does not exist (No), this flow is ended, and when the next task exists (Yes), the process returns to step S21, and the task is executed in the same flow for the next task.

一方、ステップ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 state management unit 404 whether or not there is a CPU restriction in the environment of the operation program. If there is no CPU restriction (No), this task can execute the task without considering the CPU usage restriction, so the process proceeds to step S2a and waits for a certain period of time. In this embodiment, since parallel processing by a plurality of threads is possible, it is possible to execute other tasks while waiting. Then, after the standby is completed, the process returns to step S23, and the task execution unit 403 again issues a log request instruction to the device 104 to acquire the log file.

一方、ステップ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 execution queue 408 in this embodiment. First, the data transition before and after the task order determination will be described with reference to FIGS. 9A and 9B, and next, the data transition before and after the task cancellation will be described with reference to FIGS. 9C and 9D.

図9(A)は、タスク順序決定前の制限あり時実行キュー408のデータを示す。本データは、図7で説明したように、タスク管理部401が実行履歴情報406を基に格納を行ったデータである。図9(A)では、デバイスA(104)に対するログの加工処理が実行中、すなわち前回のプログラム起動時に途中でキャンセルされた状態で終了したタスクを含んでいる。また、その他未実行のタスクとしてデバイスA(104)に対するログファイル送信処理とデバイスB(104)に対する3つのタスクが存在していることを示している。 FIG. 9A shows data in the restricted execution queue 408 before the task order is determined. As described with reference to FIG. 7, this data is data stored by the task management unit 401 based on the execution history information 406. In FIG. 9A, the log processing process for the device A (104) is being executed, that is, the task ended in a canceled state during the previous program startup is included. In addition, it also indicates that there are three other unexecuted tasks: a log file transmission process for the device A (104) and three tasks for the device B (104).

図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 execution queue 408 after the task order is determined. That is, the order is changed by executing step S14 from the state of FIG. 9(A). That is, in the state of FIG. 9A, the task order determination unit 402 acquires the task type 507 of the definition information 407 from the task ID 502 of the task of each queue. Then, when the task type 507 is “cannot be resumed midway”, the order of the queues is changed so that the tasks are preferentially executed. In this case, since the log collection processing from the device B (104) is a task that cannot be resumed midway, the queue ID 508 is changed from 0003 (scheduled to be executed third) to 0001 (scheduled to be executed first). .. Further, the tasks whose queue IDs 508 are stored in 0001 and 0002 are changed to queue IDs 0002 and 0003, respectively.

図9(C)は、デバイスB(104)からのログ収集処理後の制限あり時実行キュー408のデータを示している。図9(B)と比較して、キューID508が0001のタスクが実行されているため、キューから取り除かれている状態となっている。このような状態から、タスクのキャンセル(ステップS29)後の制限あり時実行キュー408の状態が図9(D)となる。図に示す通り、実行タスク以外の全てのタスクをキャンセルしてCPUを他のタスクに割り当てないようにするため、キュー内は空の状態となる。 FIG. 9C shows data in the restricted execution queue 408 after the log collection processing from the device B (104). As compared with FIG. 9B, the task with the queue ID 508 is being executed, and thus the task is removed from the queue. From this state, the state of the restricted execution queue 408 after the task is canceled (step S29) is shown in FIG. As shown in the figure, in order to cancel all tasks other than the execution task and not allocate the CPU to other tasks, the queue is in an empty state.

以上のように、本実施形態では、タスク順序決定処理において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 task execution unit 403 according to this embodiment. Note that the task execution processing has already been described with reference to FIG. 8, and here a flowchart limited to error processing at the time of task failure, which is the point of this embodiment, is shown. First, a case where the CPU usage limit is exceeded during execution of a task will be described. While waiting for a certain period of time in step S2a, it is determined in step S31 whether the CPU limit has been exceeded. Specifically, the excess of the CPU limit is notified from the OS to the program state management unit 404, and then to the task execution unit 403. If there is no notification that the CPU limit has been exceeded (No), the process can be continued, and the process returns to step S23. On the other hand, if there is a notification that the CPU limit has been exceeded (Yes), this program will be forcibly terminated by the OS after the termination processing. In the ending process (step S32), the task management unit 401 stores the execution status in the execution history information 406, and at this time, the retry count 505 of the task currently being executed is incremented by 1. By this processing, it is possible to record the number of tries of the task.

次に、図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 execution history information 406 when the CPU limit is exceeded, but the task in the execution queue is moved based on the retry count.

ステップ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 count 505 in the execution history information is a certain number or more. If there are a certain number or more of tasks (Yes), the task is regarded as a task that cannot be processed even if executed in an environment with CPU limitation, and the process proceeds to step S42. Then, in step S42, the task is moved from the restricted execution queue 408 to the unrestricted execution queue 409. As the threshold value of the number of retries, a fixed value may be held in the program, a setting file may be prepared and described, and the value may be read from the setting file when the program is executed.

以上、本実施形態では、タスクの実行が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:
前記CPUの使用制限があり、かつ前記実行手段で実行する前記複数のタスクの中に途中再開不可のタスクが存在する場合、前記途中再開不可のタスクを優先的に実行するように前記複数のタスクの実行順序を決定する決定手段をさらに有し、
前記実行手段は、前記決定手段で決定した前記実行順序に基づいて、前記複数のタスクを実行する
ことを特徴とする請求項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.
記実行手段は、前記待機処理が発生したタスクが所定の条件を満たすと、当該待機処理が発生したタスクをCPUの使用制限がない状況で実行させるように制御する
ことを特徴とする請求項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
前記所定の条件を満たす場合とは、CPUの使用制限を所定の回数以上超過した場合である
ことを特徴とする請求項に記載の情報処理装置。
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 .
前記決定手段は、オペレーティングシステムから前記CPUの使用制限に関する情報を取得し、当該取得した情報を基に前記実行順序を決定する
ことを特徴とする請求項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〜のいずれか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:
請求項1〜のいずれか1項に記載の情報処理装置の各手段としてコンピュータを機能させるためのプログラム。
Program for causing a computer to function as each unit of the information processing apparatus according to any one of claims 1-7.
JP2016041460A 2016-03-03 2016-03-03 Information processing apparatus, information processing apparatus control method, and program Expired - Fee Related JP6702762B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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