JP2013152636A - Information processing device and task scheduling method - Google Patents

Information processing device and task scheduling method Download PDF

Info

Publication number
JP2013152636A
JP2013152636A JP2012013404A JP2012013404A JP2013152636A JP 2013152636 A JP2013152636 A JP 2013152636A JP 2012013404 A JP2012013404 A JP 2012013404A JP 2012013404 A JP2012013404 A JP 2012013404A JP 2013152636 A JP2013152636 A JP 2013152636A
Authority
JP
Japan
Prior art keywords
task
data
execution
registration table
information processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012013404A
Other languages
Japanese (ja)
Inventor
Ryoji Iwasaki
良次 岩崎
Yoshihiro Kataoka
好広 片岡
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.)
Toshiba Corp
Toyota Motor Corp
Original Assignee
Toshiba Corp
Toyota Motor Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp, Toyota Motor Corp filed Critical Toshiba Corp
Priority to JP2012013404A priority Critical patent/JP2013152636A/en
Publication of JP2013152636A publication Critical patent/JP2013152636A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an information processing device capable of prohibiting a task having lower necessity for execution from being executed.SOLUTION: An information processing device 100 allocates a task to a resource in the order of priority when there is a conflict among execution timings of a plurality of tasks, and includes a task registration table 33 and scheduling control means 32. In the task registration table 33, for each data shared by a cycle start task and a conflict task having a higher priority than the cycle start task, a set thereof is registered in advance. When there is a conflict in an execution timing between the cycle start task and the conflict task registered in the task registration table in association with the cycle start task, the scheduling control means 32 executes the conflict task in preference to the cycle start task to prohibit execution of the cycle start task in a conflict period.

Description

本発明は、複数のタスクの実行タイミングが競合した場合、優先度順に実行する高いタスクをリソースに割り当てる情報処理装置に関する。   The present invention relates to an information processing apparatus that assigns, to resources, high tasks that are executed in order of priority when execution timings of a plurality of tasks compete.

1つのマイコン上で複数のタスクやスレッド(以下、単にタスクという)がCPUへ割り当てられ実行されるマルチタスク処理が知られている。この割り当て制御は主にOS(Operating System)のスケジューラなどにより行われる。タスクには優先度の記述があり、スケジューラは原則的に優先度の高いタスクから先にCPUへ割り当てる。ここで、スケジューラのタスクの割り当て方法には、ノンプリエンプティブとプリエンプティブがある。ノンプリエンプティブな割り当てでは、すでにCPUが実行中のタスクに対し、実行待ち状態のタスクが発生した場合、スケジューラは実行中のタスクの終了を待つ。プリエンプティブな割り当てでは、実行中のタスクの優先度よりも実行待ち状態のタスクの優先度の方が高い場合に、スケジューラは実行中のタスクを強制的に終了して実行待ち状態のタスクをCPUに割り当てる。プリエンプティブなマルチタスクでは、優先度の関係を維持できるのでリアルタイム性を保証しやすくできる。   Multitask processing is known in which a plurality of tasks and threads (hereinafter simply referred to as tasks) are assigned to a CPU and executed on one microcomputer. This allocation control is mainly performed by an OS (Operating System) scheduler or the like. The task has a description of priority, and the scheduler assigns the task to the CPU in principle from the task with the highest priority. Here, the task assignment method of the scheduler includes non-preemptive and preemptive. In non-preemptive allocation, when a task waiting for execution occurs for a task that is already being executed by the CPU, the scheduler waits for the task being executed to end. In preemptive assignment, if the priority of a task waiting to be executed is higher than the priority of the task being executed, the scheduler forcibly terminates the task that is executing and causes the task waiting for execution to be sent to the CPU. assign. In preemptive multitasking, the priority relationship can be maintained, so that real-time performance can be easily guaranteed.

しかしながら、プリエンプティブなマルチタスクでは、タスク切り替えのために必要なコンテキストの切り替え処理がオーバーヘッドとなる場合がある。そこで、従来からオーバーヘッドを低減する技術が考えられている(例えば、特許文献1参照。)。特許文献1には、競合する複数の周期駆動タスク用に専用のレジスタを用意しておき、タスクが競合した際、専用レジスタに格納された高優先度のタスク情報によりこのタスクをCPUに割り当てる周期駆動タスク実行装置が開示されている。   However, in preemptive multitasking, context switching processing required for task switching may be an overhead. Therefore, a technique for reducing overhead has been conventionally considered (see, for example, Patent Document 1). In Patent Document 1, a dedicated register is prepared for a plurality of competing periodic driving tasks. When a task conflicts, a period in which this task is allocated to the CPU by high priority task information stored in the dedicated register. A driving task execution device is disclosed.

特開2010−102567号公報JP 2010-102567 A

しかしながら、特許文献1ではオーバーヘッドを低減できる可能性があるが、優先度の低いタスクが、結局、優先度の高いタスクの実行終了後に実行されているので、CPU負荷を増大させているという問題がある。また、特許文献1では専用レジスタが必要になるという問題もある。   However, although there is a possibility that the overhead can be reduced in Patent Document 1, since a task with a low priority is eventually executed after the execution of a task with a high priority, the CPU load is increased. is there. Further, Patent Document 1 has a problem that a dedicated register is required.

図1は、優先度の低いタスクの実行による負荷の増大を説明する図の一例である。タスクAは例えばタイマ割込みで定期的に実行されるタスクであり、タスクBは例えばイベント発生により実行されるタスクである。ここではタスクBの優先度>タスクAの優先度であるとする。なお、ISR(Interrupt Service Routine)は割り込み処理を行うサービスで、割込みに対応したタスクを実行する処理などを行う。割り込みハンドラと呼ばれる場合もある。   FIG. 1 is an example for explaining an increase in load due to execution of a low priority task. Task A is a task that is periodically executed by a timer interrupt, for example, and task B is a task that is executed by occurrence of an event, for example. Here, it is assumed that the priority of task B> the priority of task A. Note that ISR (Interrupt Service Routine) is a service that performs interrupt processing, and performs processing that executes tasks corresponding to interrupts. Sometimes called an interrupt handler.

タスクAは例えばセンサからのデータ取得、演算、共有メモリへの書き出しを行う。タスクBは共有メモリからデータを読み出し、車載装置を制御する。このように、タスクAとタスクBにはデータ依存性がある。タスクBとしてはタスクAが更新した(新しい)データを読み出すことが好ましい。   Task A performs, for example, data acquisition from a sensor, calculation, and writing to a shared memory. Task B reads data from the shared memory and controls the in-vehicle device. Thus, task A and task B have data dependency. As task B, it is preferable to read out (new) data updated by task A.

タスクBの優先度>タスクAの優先度なので、2回目の周期のように、実行タイミングが競合した場合、スケジューラはタスクAよりもタスクBを優先してCPUに割り当てる(図のマルの中)。したがって、この周期ではタスクAは共有メモリのデータを更新できないことになり、タスクBは1周期前のデータを共有メモリから読み出す。そして、タスクBの終了後、スケジューラはタスクAをCPUに割り当てるので、タスクAは共有メモリのデータを更新する。   Since the priority of task B> priority of task A, if the execution timing conflicts as in the second cycle, the scheduler assigns the task B to the CPU with priority over the task A (in the circle in the figure). . Therefore, in this cycle, task A cannot update the data in the shared memory, and task B reads the data one cycle before from the shared memory. After the task B ends, the scheduler assigns the task A to the CPU, so the task A updates the data in the shared memory.

タスクAの周期は変わらないので、タスクAは次の周期(図の3回目の周期)が到来すると、共有メモリのデータを更新する。したがって、データの更新周期が短くなり、タスクBが実行された後に更新されたデータは、タスクBに読み出されることなく更新される。このため、タスクAのCPUへの割り当て(2回目の周期の割り当て)が無駄になり、CPU負荷が無駄に増大しているという問題がある。   Since the cycle of task A does not change, task A updates the data in the shared memory when the next cycle (the third cycle in the figure) arrives. Therefore, the data update cycle is shortened, and the data updated after the task B is executed is updated without being read by the task B. For this reason, assignment of task A to the CPU (assignment of the second cycle) is wasted, and there is a problem that the CPU load is unnecessarily increased.

本発明は,上記課題に鑑み、実行する必要性が低いタスクの実行を禁止することができる情報処理装置を提供することを目的とする。   In view of the above problems, an object of the present invention is to provide an information processing apparatus that can prohibit execution of a task that is less necessary to be executed.

本発明は、複数のタスクの実行タイミングが競合した場合、優先度順にタスクをリソースに割り当てる情報処理装置において、周期起動タスク、及び、前記周期起動タスクよりも優先度の高い競合タスクが共有するデータ毎に、周期起動タスクと前記競合タスクの組が予め登録されたタスク登録テーブルと、前記周期起動タスクと、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記競合タスクを優先して実行し、競合した周期における前記周期起動タスクの実行を禁止するスケジューリング制御手段と、を有することを特徴とする。   In the information processing apparatus that assigns tasks to resources in order of priority when the execution timings of a plurality of tasks compete, the present invention shares data that is shared by the periodically activated task and the competing task having a higher priority than the periodically activated task Each time, a task registration table in which a set of a cyclic start task and the competing task is registered in advance, the cyclic start task, and an execution timing of the competing task registered in the task registration table in association with the cyclic start task Scheduling control means for preferentially executing the competing task and prohibiting the execution of the periodic activation task in the conflicting period when there is a conflict.

実行する必要性が低いタスクの実行を禁止することができる情報処理装置を提供することができる。   It is possible to provide an information processing apparatus that can prohibit execution of a task that is less necessary to be executed.

優先度の低いタスクの実行による負荷の増大を説明する図の一例である。It is an example explaining the increase in load by execution of a low priority task. 情報処理装置によるタスク割り当てを説明する図の一例である。It is an example of the figure explaining task assignment by an information processor. 車両に搭載される情報処理装置のハードウェア構成図の一例である。It is an example of the hardware block diagram of the information processing apparatus mounted in a vehicle. タスクのスケジューリング説明する図の一例である。It is an example of the figure explaining scheduling of a task. タスクの処理とその競合を説明する図の一例である。It is an example of the figure explaining the process of a task, and its competition. タスクAとタスクBが競合するタイミングについて説明する図の一例である。It is an example of the figure explaining the timing which the task A and the task B compete. スケジューラの機能ブロック図とタスク排他登録テーブルの一例を示す図である。It is a figure which shows an example of the functional block diagram of a scheduler, and a task exclusive registration table. スケジューリング制御部が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である。FIG. 10 is an example of a flowchart illustrating a procedure in which a scheduling control unit prohibits execution of a low priority task. スケジューラの機能ブロック図、タスク排他登録テーブル、及び、タスク起動管理データ記録部の一例を示す図である(実施例2)。(Example 2) which is a function block diagram of a scheduler, a task exclusive registration table, and an example of a task activation management data recording unit. スケジューリング制御部が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である(実施例2)。FIG. 10 is an example of a flowchart illustrating a procedure in which a scheduling control unit prohibits execution of a low priority task (second embodiment). スケジューラの機能ブロック図、タスク排他登録テーブル、タスク起動管理データ記録部、及び、補間データ記録部の一例を示す図である(実施例3)。(Example 3) which is a functional block diagram of a scheduler, a task exclusive registration table, a task activation management data recording unit, and an interpolation data recording unit. スケジューリング制御部が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である(実施例3)。FIG. 10 is an example of a flowchart illustrating a procedure in which a scheduling control unit prohibits execution of a low priority task (third embodiment). タスクAと補間データ制御部の動作手順を示すフローチャート図の一例である。It is an example of the flowchart figure which shows the operation | movement procedure of the task A and an interpolation data control part. スケジューラの機能ブロック図、タスク排他登録テーブル、タスク起動管理データ記録部、及び、補間データ記録部の一例を示す図である(実施例4)。(Example 4) which is a functional block diagram of a scheduler, a task exclusive registration table, a task activation management data recording unit, and an interpolation data recording unit. スケジューリング制御部が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である(実施例4)。FIG. 10 is an example of a flowchart illustrating a procedure in which a scheduling control unit prohibits execution of a low priority task (Example 4).

以下、本発明を実施するための形態について図面を参照しながら説明する。   Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.

図2は、本実施形態の情報処理装置100によるタスク割り当てを説明する図の一例である。スケジューリング制御部32は後述するスケジューラやOSの機能であり、CPUへのタスクの割り当てを制御する。   FIG. 2 is an example of a diagram illustrating task assignment by the information processing apparatus 100 according to the present embodiment. The scheduling control unit 32 is a function of a scheduler and OS described later, and controls assignment of tasks to the CPU.

タスクAはセンサからのデータ取得、演算、共有メモリへの書き出しを行う。タスクBは共有メモリからデータを読み出し車載装置を制御する。このように、タスクAとタスクBにはデータ依存性がある。タスクAは例えばタイマ割込みで定期的に実行されるタスクである。タスクBは例えばイベント発生により実行されるタスクとするが、タスクBも定周期で実行されるタスクであってもよい。   Task A performs data acquisition from the sensor, calculation, and writing to the shared memory. Task B reads data from the shared memory and controls the in-vehicle device. Thus, task A and task B have data dependency. Task A is a task that is periodically executed by a timer interrupt, for example. For example, task B is a task that is executed when an event occurs, but task B may also be a task that is executed at regular intervals.

スケジューリング制御部32は、タスクAとタスクBの実行タイミングが競合した場合排他登録テーブルを参照して、タスクAの割り当てを制御する必要があるか否かを判定する。排他登録テーブルには、互いにデータ依存性のあるタスクが対応づけて登録されている。図の例では、競合タスクBに対し制御対象としてタスクAが登録されている。制御対象のタスクは競合タスクと競合すると、実行が禁止されるタスクである。   When the execution timings of task A and task B conflict, the scheduling control unit 32 refers to the exclusive registration table and determines whether it is necessary to control task A allocation. In the exclusive registration table, tasks having data dependency are registered in association with each other. In the example in the figure, task A is registered as a control target for competing task B. The task to be controlled is a task whose execution is prohibited when it conflicts with a competing task.

スケジューリング制御部32は、タスクAとタスクBの実行タイミングが同時期に重なると、排他登録テーブルを参照して、タスクAを実行する必要がないと判定する。そして、スケジューリング制御部32は、タスクAの実行を禁止する。すなわち、図示するように、タスクAは定周期の実行タイミングが到来した場合に、競合した周期では実行されない。したがって、従来では、タスクAはタスクBの後に実行されていたが、本実施形態では実行されないのでCPUなどの資源を無駄に使用することを防止できる。   When the execution timings of task A and task B overlap in the same period, the scheduling control unit 32 refers to the exclusive registration table and determines that it is not necessary to execute task A. Then, the scheduling control unit 32 prohibits execution of the task A. That is, as shown in the figure, task A is not executed in the conflicting period when the execution timing of the fixed period arrives. Therefore, conventionally, the task A is executed after the task B. However, since it is not executed in the present embodiment, it is possible to prevent wasteful use of resources such as the CPU.

〔構成例〕
図3は、車両に搭載される情報処理装置100のハードウェア構成図の一例である。情報処理装置100は、ECU(Electronic Control Unit)に搭載されることが想定されているがその用途は車両に限定されない。車載されるECUには、その主要な機能により、エンジンECU、ブレーキECU、ボディECU、ナビゲーションECU(AV・情報処理ECU)、ゲートウェイECU等の種類がある。本実施例の情報処理装置100はECUの機能の違いに影響されず搭載されることが可能である。また、複数の機能が1つに統合されたECUに情報処理装置100を搭載してもよい。
[Configuration example]
FIG. 3 is an example of a hardware configuration diagram of the information processing apparatus 100 mounted on the vehicle. The information processing apparatus 100 is assumed to be mounted on an ECU (Electronic Control Unit), but its application is not limited to a vehicle. There are various types of ECUs mounted on the vehicle, such as an engine ECU, a brake ECU, a body ECU, a navigation ECU (AV / information processing ECU), and a gateway ECU, depending on main functions. The information processing apparatus 100 according to the present embodiment can be mounted without being influenced by the difference in the functions of the ECU. Further, the information processing apparatus 100 may be mounted on an ECU in which a plurality of functions are integrated into one.

情報処理装置100は、メインバス21に接続されたCPU11、RAM12、ROM13、INTC14、WDT15、DMAC16、並びに、ブリッジ17を有し、ブリッジ17には周辺バス22を介してADC(Analog to Digital Converter)19及びCANコントローラ20が接続されている。   The information processing apparatus 100 includes a CPU 11, a RAM 12, a ROM 13, an INTC 14, a WDT 15, a DMAC 16, and a bridge 17 connected to a main bus 21. The bridge 17 has an ADC (Analog to Digital Converter) via a peripheral bus 22. 19 and a CAN controller 20 are connected.

CPU11は1つ以上のコア1〜nを有する。すなわち、各コア1〜nは一般的な演算機能(例えば、ALU等の演算装置、命令バッファ、命令デコーダ、レジスタセット等)を有している。1つのチップに複数のコア1〜nを有するCPU11でなく、複数のCPU11が独立にメインバス21に接続されていてもよい。   The CPU 11 has one or more cores 1 to n. That is, each of the cores 1 to n has a general arithmetic function (for example, an arithmetic device such as an ALU, an instruction buffer, an instruction decoder, a register set, etc.). Instead of the CPU 11 having a plurality of cores 1 to n on one chip, a plurality of CPUs 11 may be independently connected to the main bus 21.

ROM13はフラッシュメモリなどの不揮発メモリであり、CPU11が実行するプログラム30や初期値、パラメータ等を記憶している。   The ROM 13 is a non-volatile memory such as a flash memory, and stores a program 30 executed by the CPU 11, initial values, parameters, and the like.

INTC14はタイマなど、各種の割込み要求に応じてフラグがセットされる割込みレジスタを有している。INTC14は、タイマやI/O18などの受信割込み、その他の割り込み端子を介して周辺機器から入力された割り込み要求を、周辺機器の優先順位に基づき調停してCPU11に通知する。これによりCPU11は、割り込みした周辺機器に応じて決まったアドレスの命令をROM13から読み出して処理を実行する。本実施例ではISR30が起動して割り込み処理を行う。WDT15は、カウント値がオーバーフローする前にクリアされないと、情報処理装置をリセットするなどのフェールセーフを行う。   The INTC 14 has an interrupt register such as a timer in which a flag is set in response to various interrupt requests. The INTC 14 arbitrates based on the priority of the peripheral device and notifies the CPU 11 of a reception interrupt such as a timer and I / O 18 and an interrupt request input from the peripheral device via other interrupt terminals. As a result, the CPU 11 reads an instruction at an address determined according to the interrupted peripheral device from the ROM 13 and executes the process. In this embodiment, the ISR 30 is activated to perform interrupt processing. If the count value is not cleared before the count value overflows, the WDT 15 performs fail-safe such as resetting the information processing apparatus.

RAM12は、CPU11がプログラム30を実行するための作業領域である。CPU11はROM13からプログラム30を読み込み、また、必要であればメインバス21を介してRAM12からデータを読み出しプログラム30を実行する。DMAC16は、CPU11からの指示によりRAM12からブリッジ17を介して周辺機器にデータを送信する。また、周辺機器から割り込みされたCPU11から指示を受けて、ブリッジ17を介して周辺機器からデータを受け取り、RAM12に書き込む。   The RAM 12 is a work area for the CPU 11 to execute the program 30. The CPU 11 reads the program 30 from the ROM 13 and, if necessary, reads data from the RAM 12 via the main bus 21 and executes the program 30. The DMAC 16 transmits data from the RAM 12 to the peripheral device via the bridge 17 according to an instruction from the CPU 11. In response to an instruction from the CPU 11 interrupted by the peripheral device, the data is received from the peripheral device via the bridge 17 and written to the RAM 12.

ブリッジ17は、メインバス21と周辺バス22との間の周波数等の違いを吸収し、メインバス側の回路と周辺バス側の回路のデータを互いに受け渡す。ブリッジ17は、マルチプレクサやブリッジ回路などであり、チャネル毎に、1つ以上のI/O18、ADC19、及び、CANコントローラ20とそれぞれ接続されており、これらの周辺機器とデータを送受信する。   The bridge 17 absorbs a difference in frequency between the main bus 21 and the peripheral bus 22, and transfers data between the main bus side circuit and the peripheral bus side circuit to each other. The bridge 17 is a multiplexer, a bridge circuit, or the like, and is connected to each of one or more I / O 18, ADC 19, and CAN controller 20 for each channel, and transmits / receives data to / from these peripheral devices.

I/O18は、例えばシリアル通信の入出力インタフェースであり、アクチュエータ、スイッチ、監視回路、他のマイコンと通信するために使用される。通信規格はI2C、UART等が知られている。ADC19は、各種のセンサが検出したアナログ信号をデジタル信号に変換する。ADC19は変換の終了を、INTC14を介してCPU11に通知する。CANコントローラ20は、車載ネットワークを介して接続された他のECUと通信するための通信装置である。CANコントローラ20は、CPU11から通信データの送信要求を受け付けるとフレームの各フィールドにCAN IDやデータを格納しCANバスに出力する。また、CANコントローラ20は、受信すべきCAN IDの通信データを検出するとそれを取り込みINTC14を介してCPU11に割り込んで通知する。   The I / O 18 is an input / output interface for serial communication, for example, and is used to communicate with actuators, switches, monitoring circuits, and other microcomputers. As communication standards, I2C, UART, and the like are known. The ADC 19 converts analog signals detected by various sensors into digital signals. The ADC 19 notifies the CPU 11 of the end of conversion via the INTC 14. The CAN controller 20 is a communication device for communicating with other ECUs connected via an in-vehicle network. When receiving a communication data transmission request from the CPU 11, the CAN controller 20 stores the CAN ID and data in each field of the frame and outputs them to the CAN bus. Further, when the CAN controller 20 detects the communication data of the CAN ID to be received, the CAN controller 20 captures it and interrupts it to the CPU 11 via the INTC 14 to notify it.

〔スケジューリングについて〕
図4は、タスクのスケジューリング説明する図の一例である。タスクとは、1つのプログラム(例えば、Main関数を1つのプログラムとして)に含まれるいくつかの機能を機能毎に抽出したものである。どのような機能を1つのタスクとするかは、開発者が設計できる。具体的には、Main関数内の関数、サブルーチンなどが相当する。割込みなどで実行される関数もタスクである。
[About scheduling]
FIG. 4 is an example of a diagram explaining task scheduling. A task is obtained by extracting several functions included in one program (for example, the Main function as one program) for each function. The developer can design what function is one task. Specifically, a function, a subroutine, and the like in the Main function correspond. A function executed by an interrupt or the like is also a task.

タスクは一般に、休止状態、実行可能状態、実行状態、及び、待ち状態の各状態を経る。休止状態は生成直後又は実行が完了したタスクの状態である。実行状態は、コアにより現在、実行されているタスクの状態をいう。実行状態のタスクはコアの数以下しか存在しない。実行可能状態は、周辺機器の入出力などが完了し、実行の準備が整ったタスクの状態をいう。休止状態から実行可能状態への遷移を起床という。実行可能状態のタスクは、コアが実行状態のタスクを終了させれば(コアが空けば)、後述する優先度に従ってコアに割り当てられる(ディスパッチされる)。待ち状態は、周辺機器が入出力を完了させるなど、実行に必要な条件が整うまで待機しているタスクの状態をいう。   In general, a task goes through a dormant state, an executable state, an executing state, and a waiting state. The dormant state is the state of a task that has just been created or has completed execution. The execution state refers to the state of the task currently being executed by the core. There are less than the number of cores in the running state. The executable state refers to a task state in which input / output of peripheral devices is completed and ready for execution. The transition from the sleep state to the executable state is called wake-up. The task in the executable state is assigned (dispatched) to the core according to the priority described later when the core finishes the task in the execution state (if the core is free). The wait state is a state of a task that is waiting until a necessary condition for execution is satisfied, such as a peripheral device completing input / output.

例えば、Main関数のようなプログラムは、割込みの種類に対応したタスクのタスクID、アドレス、優先度等を引数にしてシステムコールなどの仕組みを利用しタスクを生成しておく。これによりスケジューラ31が呼び出され、スケジューラ31がタスクコントロールブロック(TCB)38を作成する(ISRがTCBを作成してもよい)。TCB38は、例えば、タスクID、タスク(関数)の開始アドレス、終了アドレス、コンテキスト(例えば、汎用レジスタ、プログラムカウンタ、スタックポインタ、ステータスフラグの状態など)、状態を表すステータス等の各情報が含まれる。これによりタスクは休止状態になっている。   For example, a program such as the Main function generates a task by using a system call mechanism using the task ID, address, priority, etc. of the task corresponding to the type of interrupt as arguments. As a result, the scheduler 31 is called, and the scheduler 31 creates a task control block (TCB) 38 (an ISR may create a TCB). The TCB 38 includes, for example, information such as a task ID, a task (function) start address, an end address, a context (for example, a general-purpose register, a program counter, a stack pointer, a status flag status), and a status indicating a status. . As a result, the task is in a dormant state.

割込みの発生により割込みに対応した(又は割込みの種類に関係なく共通した)ISR30が実行されると、ISR30は例えばタスクID等を引数にして、タスクを起床するシステムコールを行う。これにより、スケジューラ31がTCB38のステータスを変更してタスクが実行可能状態になる。以降、スケジューラ31は、プリエンプティブな優先度制御を行う。   When the ISR 30 corresponding to the interrupt (or common regardless of the type of interrupt) is executed due to the occurrence of the interrupt, the ISR 30 makes a system call to wake up the task using, for example, the task ID as an argument. As a result, the scheduler 31 changes the status of the TCB 38 so that the task can be executed. Thereafter, the scheduler 31 performs preemptive priority control.

スケジューラ31は優先度毎にレディーキューを管理している。レディーキューには、優先度毎に、実行順にタスクが配列されている。同じ優先度におけるタスクの順番は、タスクが実行可能状態になった順番である。レディーキューは、例えば、タスクIDがキュー構造に配列された構造体である。スケジューラ31は、実行可能状態になったタスクの優先度に応じてレディーキューを選択し、そのレディーキューの末尾にタスクIDを登録する。そして、スケジューラ31は例えば以下のようにして、CPU11などの資源に割り当てるタスクを決定する。
・最も優先度の高いレディーキューのタスクを検索する。タスクがある場合にはキュー内の配置順にタスクを割り当てると決定する。
・最も優先度の高いレディーキューにタスクがない場合、次に優先度が高いレディーキューのタスクを検索する。このレディーキューにタスクがある場合にはキュー内の順にタスクを割り当てると決定する。
The scheduler 31 manages a ready queue for each priority. In the ready queue, tasks are arranged in order of execution for each priority. The order of tasks at the same priority is the order in which the tasks are ready to be executed. The ready queue is, for example, a structure in which task IDs are arranged in a queue structure. The scheduler 31 selects a ready queue in accordance with the priority of a task that has become executable, and registers a task ID at the end of the ready queue. Then, for example, the scheduler 31 determines a task to be assigned to a resource such as the CPU 11 as follows.
-Search for the task with the highest priority ready queue. If there are tasks, it is determined that the tasks are assigned in the order of arrangement in the queue.
If there is no task in the ready queue with the highest priority, the task of the ready queue with the next highest priority is searched. If there are tasks in this ready queue, it is determined that the tasks are assigned in the order in the queue.

このように、スケジューラ31は、原則的に優先度が高いタスクから、同じ優先度の複数のタスクについては実行可能状態になった順からタスクを割り当てると決定する。また、このように優先度だけを考慮すると、長時間実行されないタスクが生じてしまう。そこで、スケジューラ31は例外的に、所定時間、優先度1のタスクを実行したら優先度2のタスクを実行する、などラウンドロビン方式を併用する。   As described above, the scheduler 31 determines that tasks are assigned in order from the task having the highest priority to the plurality of tasks having the same priority in an executable state. In addition, when only the priority is considered in this way, a task that is not executed for a long time is generated. Therefore, the scheduler 31 exceptionally uses a round robin method such as executing a task of priority 2 when a task of priority 1 is executed for a predetermined time.

CPU11などの資源への割り当てはディスパッチャにより行われる。ディスパッチャは、TCB38の開始アドレスを参照してPC(プログラムカウンタ)に配置するなどして、CPU11にタスクを割り当てる。なお、すでに、待ち状態を経たタスクの場合、直前の実行状態を再生するためコンテキストをレジスタ等に再設定する。   Allocation to resources such as the CPU 11 is performed by a dispatcher. The dispatcher allocates a task to the CPU 11 by referring to the start address of the TCB 38 and placing it on a PC (program counter). In the case of a task that has already waited, the context is reset in a register or the like in order to reproduce the previous execution state.

実行状態のタスクは、タスクの終了のシステムコールにより消滅し、起床待ちのシステムコールにより休止状態になる。また、周辺機器からのデータ待ちなどで(セマフォの状態を検出して)必要になれば、待ち状態になるためのシステムコールを実行する。これにより、スケジューラ31は、このタスクのTCB38のステータスを待ち状態にして、ディスパッチャが次に割り当てるタスクをCPU等に割り当てる。なお、スケジューラ31は、待ち状態になった要因のセマフォを監視して、セマフォが変わると、待ち状態のタスクを自動的に実行可能状態に変更する。   The task in the execution state disappears by a system call at the end of the task, and enters a dormant state by a system call waiting for waking up. Also, if necessary, such as waiting for data from a peripheral device (detecting the state of the semaphore), a system call for entering the wait state is executed. As a result, the scheduler 31 sets the status of the TCB 38 of this task in a waiting state, and assigns the task to be assigned next by the dispatcher to the CPU or the like. Note that the scheduler 31 monitors the semaphore that has caused the wait state, and when the semaphore changes, automatically changes the waiting task to an executable state.

本実施形態では、タスクの前にISRがCPUを使用し、ISRがタスクを起床することでタスクが実行可能状態となる。複数のタスクの実行タイミングの競合は、どちらかのISRが実行されれば生じ得る。このため、以下では、ISRの契機である「タスクの割込みが発生する」ことを実行タイミングの競合の契機として説明する。なお、実行タイミングの競合については後述する。   In this embodiment, the ISR uses the CPU before the task, and the task is ready to be executed when the ISR wakes up the task. Contention timing conflicts between multiple tasks can occur if either ISR is executed. Therefore, hereinafter, “task interruption occurs”, which is the trigger of ISR, will be described as a trigger of conflict of execution timing. The execution timing conflict will be described later.

〔タスクの競合の例〕
図5(a)は、タスクの処理とその競合を説明する図の一例である。
タスクA:定周期起動タスク
タスクB:イベント起動タスク(周期的に発生)
タスクBの優先度>タスクAの優先度
タスクAはセンサからのデータ取得、演算、共有メモリへの書き出しを行う。タスクBは共有メモリからデータを読み出し、車載装置を制御する。2回目の周期において、タスクAのISRが実行されている状態で、タスクBの割込みが発生する。なお、タスクAが実行状態になっていてもよい。
[Example of task conflict]
FIG. 5A is an example of a diagram illustrating task processing and its competition.
Task A: Periodic start task B: Event start task (occurs periodically)
Priority of task B> priority of task A Task A performs data acquisition from the sensor, calculation, and writing to the shared memory. Task B reads data from the shared memory and controls the in-vehicle device. In the second cycle, an interrupt for task B occurs while an ISR for task A is being executed. Task A may be in the execution state.

スケジューラ31はタスクAよりもタスクBを優先してCPU11に割り当てる。したがって、この周期ではタスクAは共有メモリのデータを更新できないことになり、タスクBは1周期前のデータを共有メモリから読み出す。この後、タスクAが実行状態になっても、タスクAが更新したデータは、タスクBに読み出されることなく更新される。   The scheduler 31 assigns the task B to the CPU 11 with priority over the task A. Therefore, in this cycle, task A cannot update the data in the shared memory, and task B reads the data one cycle before from the shared memory. Thereafter, even if task A enters the execution state, the data updated by task A is updated without being read out by task B.

そこで、後述するスケジューリング制御部32は、タスクAの実行を禁止する。こうすることで、タスクAが無駄にCPU11へ割り当てられることを防止できる。   Therefore, the scheduling control unit 32 described later prohibits execution of the task A. By doing so, it is possible to prevent the task A from being unnecessarily assigned to the CPU 11.

なお、図5(a)のようにタスクA,Bが競合するのは、CPU11がコアを1つしか有さないシングルコアの場合である。CPU11がマルチコアの場合、優先度の高低だけでは、コア1がタスクAを中断する必要がなくタスクBが優先される必要がない。マルチコアの2つのタスクがデータ依存性を保つには、例えば、セマフォを用いて、タスクBがタスクAのデータ更新を待つことで、タスクAを先に実行することも可能である。   Note that the tasks A and B compete as shown in FIG. 5A when the CPU 11 is a single core having only one core. When the CPU 11 is multi-core, the core 1 does not need to interrupt the task A and the task B does not need to be prioritized only by the priority level. In order to maintain the data dependency of two multi-core tasks, for example, the task A can be executed first by waiting for the task A to update the data of the task A using a semaphore.

しかしながら、本実施例では、データの整合性よりもタスクBが遅延なく実行されることを優先するため、シングルコアかマルチコアかに関係なく、タスクBを優先するものとする。データ依存性があるため、互いに競合するタスクはタスク排他登録テーブル33に登録されている。したがって、本実施例のタスク制御はCPU11がシングルコアかマルチコアかを問わず実現可能である。   However, in the present embodiment, priority is given to the task B being executed without delay rather than data consistency, so the task B is given priority regardless of whether it is a single core or a multi-core. Due to data dependency, tasks that compete with each other are registered in the task exclusive registration table 33. Therefore, the task control of this embodiment can be realized regardless of whether the CPU 11 is a single core or a multi-core.

図5(b)は、タスクAとタスクB(C)の競合を説明する図の一例である。タスクAは、例えば2ミリ秒周期でタイマ割込みが発生することで実行される。タスクBは、クランク角が45度になるというイベント割込みが発生することで実行される。タスクCは、クランク角が60度になるというイベント割込みが発生することで実行される。したがって、例えば、図では4ミリ秒でタスクAとタスクBの競合が、14ミリ秒でタスクAとタスクCの競合が発生している。   FIG. 5B is an example of a diagram illustrating competition between task A and task B (C). Task A is executed, for example, when a timer interrupt occurs at a cycle of 2 milliseconds. Task B is executed by the occurrence of an event interrupt that the crank angle is 45 degrees. Task C is executed by the occurrence of an event interrupt that the crank angle is 60 degrees. Therefore, for example, in the figure, a conflict between task A and task B occurs in 4 milliseconds, and a conflict between task A and task C occurs in 14 milliseconds.

本実施例によれば、スケジューリング制御部は、4ミリ秒と14ミリ秒でタスクAを実行しないので、CPU負荷を低減することができる。クランク角を含め、車両制御では車速やエンジン回転数が高速になるほど、制御のためのタスクが実行される頻度も増大する。このような状況に対応するには、CPU11の機能を増大させる(コスト増となる)などの必要があるが、本実施例では、競合してもタスクAが実行されないのでCPU11の機能を増大させる必要がない。   According to the present embodiment, the scheduling control unit does not execute the task A in 4 milliseconds and 14 milliseconds, so that the CPU load can be reduced. In the vehicle control including the crank angle, the higher the vehicle speed and the engine speed, the more frequently the task for the control is executed. In order to cope with such a situation, it is necessary to increase the function of the CPU 11 (increase the cost). However, in this embodiment, the task A is not executed even if it competes, so the function of the CPU 11 is increased. There is no need.

〔実行タイミングの競合について〕
図6によりタスクAとタスクBが競合するタイミングについて説明する。
(i) タスクBの割込みがタスクAよりも先に発生した場合
優先度が高いタスクBがそのまま(コンテキストスイッチなく)実行される。タスクBの後にタスクAが実行されるが、タスクBはタスクAが更新したデータを参照しないので、タスクAの実行が無駄になる。このため、スケジューリング制御部32はタスクAを実行しないことが好ましい。
(ii) タスクBとタスクAの割込みが同時に発生した場合
優先度によりタスクBが先に実行される。したがって、この場合もタスクBがタスクAよりも先に実行可能状態となった場合と同様である。
(iii) タスクBの割込みがタスクAよりも後に発生した場合(これまでの説明と同様)
タスクAのISR30又はタスクAの実行中にタスクBの割込みが発生する。プリエンプションによりタスクAは中止され、タスクBがCPU11に割り当てられる。この後、タスクAがCPU11に割り当てられても、タスクBはタスクAが更新したデータを参照しないので、タスクAの実行が無駄になる。このため、スケジューリング制御部32はタスクAを実行しない。
[About execution timing conflicts]
The timing when task A and task B compete with each other will be described with reference to FIG.
(I) When an interruption of task B occurs before task A, task B having a higher priority is executed as it is (without context switch). Although task A is executed after task B, since task B does not refer to the data updated by task A, execution of task A is wasted. For this reason, it is preferable that the scheduling control unit 32 does not execute the task A.
(Ii) When task B and task A interrupts occur simultaneously, task B is executed first according to priority. Therefore, this case is the same as the case where the task B is in an executable state before the task A.
(Iii) When task B interrupt occurs after task A (same as above)
Task B interrupt occurs during task A ISR30 or task A execution. Task A is canceled by preemption, and task B is assigned to the CPU 11. After this, even if task A is assigned to CPU 11, task B does not refer to the data updated by task A, so execution of task A is wasted. For this reason, the scheduling control unit 32 does not execute the task A.

したがって、タスクAの実行が禁止されるべき状況としては、タスクAの割込みが発生してからタスクAが終了するまでの間にタスクBの割込みが発生した場合、又は、タスクBの割込みが発生してから、タスクBが終了するまでの間にタスクAの割込みが発生した場合である。よって、(i)〜(iii)の全ての場合、スケジューリング制御部32はタスクAの実行を禁止する。   Therefore, execution of task A should be prohibited when task B interrupt occurs between task A interrupt and task A termination, or task B interrupt occurs. This is a case where an interruption of task A occurs between task B and the end of task B. Therefore, in all cases (i) to (iii), the scheduling control unit 32 prohibits the execution of the task A.

なお、(iii)のような場合において、ISRが終了しタスクAが実行状態になってから、タスクBの割込みが生じる場合がある。この場合、タスクAからタスクBにコンテキストスイッチすることなく、タスクAの実行を完了させることもできる。タスクAの実行時間が短い場合は、コンテキストスイッチしない方が負荷の低減になるためである。   In the case of (iii), the task B may be interrupted after the ISR ends and the task A enters the execution state. In this case, the execution of task A can be completed without context switching from task A to task B. This is because when the execution time of task A is short, the load is reduced if context switching is not performed.

〔スケジューラの機能例〕
図7はスケジューラの機能ブロック図とタスク排他登録テーブル33の一例を示す図である。スケジューラ31はスケジューリング制御部32を有し、RAM12にはタスク排他登録テーブル33が記憶されている。
[Scheduler function examples]
FIG. 7 is a functional block diagram of the scheduler and an example of the task exclusive registration table 33. The scheduler 31 has a scheduling control unit 32, and a task exclusive registration table 33 is stored in the RAM 12.

タスク排他登録テーブル33には、データ競合が発生するタスクの優先度が登録されている。タスク排他登録テーブル33は、開発者が予めスケジューラ31などの一部として記述しておく。タスク排他登録テーブル33は複数のセット(セット1〜n)を有し、競合タスクと制御対象のタスクが登録されている。1つの競合タスクに制御対象のタスクが複数個、登録されていてもよい。競合タスクは優先して実行されるタスクであり、制御対象は競合タスクと競合すると、実行が禁止されるタスクである。多くの場合、競合タスクの優先度>制御対象の優先度、である。例えばデータXに対し競合するタスクがA,Bであることは開発者にとって既知であるので、各種の競合データについて図のようなセットを作成しておくことができる。   In the task exclusion registration table 33, the priority of a task in which data conflict occurs is registered. The task exclusive registration table 33 is described in advance as a part of the scheduler 31 by the developer. The task exclusive registration table 33 has a plurality of sets (sets 1 to n), and the conflicting task and the task to be controlled are registered. A plurality of tasks to be controlled may be registered in one competing task. The conflicting task is a task that is executed with priority, and the controlled object is a task that is prohibited from executing when it competes with the conflicting task. In many cases, the priority of the competing task> the priority of the control target. For example, since it is known to the developer that the tasks competing for the data X are A and B, a set as shown in the figure can be created for various types of competing data.

スケジューリング制御部32はスケジューラ31の機能の1つであり、競合タスクと競合した場合に、例えば実行可能状態のタスクから制御対象のタスクを検出し、該タスクの実行を禁止する。すなわち、スケジューリング制御部32は、競合タスクの割込みが発生すると、タスク排他登録テーブル33にて対応づけられた制御対象のタスクが実行可能状態や休止状態のタスクに含まれるか否かを判定する。制御対象のタスクが検出された場合(図6の(iii)の場合)、スケジューリング制御部32は、レディーキューに登録されている場合はレディーキューから削除しまたTCB38を消去する。レディーキューに登録されていない場合はレディーキューに登録することなくTCBを削除する。これにより、タスクAが実行状態になることを禁止する。   The scheduling control unit 32 is one of the functions of the scheduler 31. When the scheduling control unit 32 competes with a competing task, the scheduling control unit 32 detects a control target task from, for example, an executable task and prohibits the execution of the task. That is, when an interrupt of a competing task occurs, the scheduling control unit 32 determines whether or not the control target task associated with the task exclusive registration table 33 is included in an executable state or a dormant task. When a task to be controlled is detected (in the case of (iii) in FIG. 6), the scheduling control unit 32 deletes the TCB 38 and deletes it from the ready queue when it is registered in the ready queue. If not registered in the ready queue, the TCB is deleted without registering in the ready queue. As a result, the task A is prohibited from entering the execution state.

また、スケジューリング制御部32は、制御対象のタスクAの割込みが発生すると、タスク排他登録テーブル33にて対応づけられた競合タスク(タスクB)が実行可能状態のタスクに含まれるか否か、又は、実行状態か否かを判定する。この場合(図6の(i)の場合)も、制御対象のタスクAを実行する必要性が小さいので、スケジューリング制御部32は、タスクAのTCBをレディーキューに登録することなく削除し、TCB38を消去する。   In addition, when an interrupt of the task A to be controlled occurs, the scheduling control unit 32 determines whether or not the competing task (task B) associated with the task exclusive registration table 33 is included in the executable state task, It is determined whether or not it is in an execution state. Also in this case (in the case of (i) in FIG. 6), since it is less necessary to execute the task A to be controlled, the scheduling control unit 32 deletes the TCB of the task A without registering it in the ready queue, and the TCB 38 Erase.

〔動作手順〕
図8は、スケジューリング制御部32が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である。図8の手順は、例えば新たに割込みが発生するとスタートする。
[Operation procedure]
FIG. 8 is an example of a flowchart illustrating a procedure in which the scheduling control unit 32 prohibits execution of a task having a low priority. The procedure of FIG. 8 starts when, for example, a new interrupt occurs.

まず、スケジューリング制御部32は割込みが生じたタスクに対し、制御対象のタスクがタスク排他登録テーブル33に登録されているか否かを判定する(S10)。   First, the scheduling control unit 32 determines whether or not a task to be controlled is registered in the task exclusive registration table 33 for the interrupted task (S10).

制御対象のタスクがタスク排他登録テーブル33に登録されている場合(S10のYes)、スケジューリング制御部32はレディーキューに制御対象のタスク(タスクAのこと)があるか否かを判定する(S20)。これにより、割込みが生じたタスクBの実行により実行が不要になるタスクAを特定できる。   When the control target task is registered in the task exclusive registration table 33 (Yes in S10), the scheduling control unit 32 determines whether there is a control target task (task A) in the ready queue (S20). ). As a result, it is possible to specify the task A that does not need to be executed by executing the task B in which the interrupt has occurred.

レディーキューに制御対象のタスクがある場合(S20のYes)、スケジューリング制御部32はレディーキューのタスクAを実行禁止にする(S30)。これにより、タスクAが実行されることを防止する。   When there is a task to be controlled in the ready queue (Yes in S20), the scheduling control unit 32 prohibits execution of task A in the ready queue (S30). This prevents the task A from being executed.

なお、レディーキューに制御対象のタスクがない場合(S20のNo)、制御対象のタスクを実行禁止にする必要がないので、スケジューラ31がレディーキューにタスクBを登録する(S60)。これによりタスクBが実行される。   If there is no task to be controlled in the ready queue (No in S20), the scheduler 31 registers task B in the ready queue because there is no need to prohibit execution of the task to be controlled (S60). As a result, task B is executed.

制御対象のタスクがタスク排他登録テーブル33に登録されていない場合(S10のNo)、スケジューリング制御部32は、レディーキューに、割込みが生じたタスクから見て競合タスクがあるか否かを判定する(S40)。これにより、割込みが生じたタスクAの実行を不要にするタスクBの有無を判定できる。   If the task to be controlled is not registered in the task exclusive registration table 33 (No in S10), the scheduling control unit 32 determines whether there is a competing task in the ready queue as seen from the task that caused the interrupt. (S40). Thereby, it is possible to determine whether or not there is a task B that makes it unnecessary to execute the task A in which the interrupt has occurred.

レディーキューに競合タスクがある場合(S40のYes)、スケジューリング制御部32は、割込みが生じた制御対象のタスクであるタスクAを実行禁止にする(S50)。すなわち、タスクAはレディーキューに登録されることなく消滅する。   If there is a competing task in the ready queue (Yes in S40), the scheduling control unit 32 prohibits execution of the task A that is the control target task in which the interrupt has occurred (S50). That is, task A disappears without being registered in the ready queue.

なお、レディーキューに競合タスクがない場合(S40のNo)、割込みが生じたタスクAは制御対象のタスクでないので、スケジューラ31がレディーキューにタスクAを登録する(S60)。したがって、タスクAは、タスクBと実行タイミングが競合しなければ禁止されることなく実行される(この後、タスクBの割込みが生じない限り)。   If there is no competing task in the ready queue (No in S40), since the task A in which the interrupt has occurred is not a control target task, the scheduler 31 registers the task A in the ready queue (S60). Therefore, task A is executed without being prohibited unless execution timing conflicts with task B (unless task B interrupts thereafter).

以上説明したように、本実施例の情報処理装置100は、データ依存性がある2つのタスクの実行タイミングが競合した場合、優先度が低いタスクAの実行を禁止するので、CPU11などの資源を無駄に使用することを防止できる。   As described above, the information processing apparatus 100 according to the present embodiment prohibits the execution of the task A having a low priority when the execution timings of two tasks having data dependency conflict with each other. Useless use can be prevented.

実施例1では、強制的にタスクAの実行を禁止していたが、タスクAの実行が高頻度に禁止されるとタスクBが演算に用いるデータの信頼性が低下するおそれがある。そこで、本実施では、タスクAの実行禁止の妥当性を判定する情報処理装置100について説明する。   In the first embodiment, the execution of the task A is forcibly prohibited. However, if the execution of the task A is prohibited at a high frequency, the reliability of the data used by the task B for the calculation may be reduced. Therefore, in the present embodiment, the information processing apparatus 100 that determines the validity of the prohibition of execution of task A will be described.

図9は、スケジューラ31の機能ブロック図、タスク排他登録テーブル33、及び、タスク起動管理データ記録部34の一例を示す図である。図9において図7と同一部の説明は省略する。本実施例では、RAM12にタスク起動管理データ記録部34が設けられている。タスク起動管理データ記録部34は、競合対象となるデータ毎に「回数」「発動数」「しきい値」の各フィールドを有する。このうち、「しきい値」は固定値であり、開発者等が予めスケジューラ31などの一部として記述しておく。   FIG. 9 is a diagram illustrating an example of a functional block diagram of the scheduler 31, a task exclusive registration table 33, and a task activation management data recording unit 34. In FIG. 9, the description of the same part as in FIG. 7 is omitted. In this embodiment, a task activation management data recording unit 34 is provided in the RAM 12. The task activation management data recording unit 34 has fields of “number of times”, “number of activations”, and “threshold value” for each piece of data to be competing. Among these, the “threshold value” is a fixed value, and a developer or the like is described in advance as a part of the scheduler 31 or the like.

「回数」「発動数」はスケジューリング制御部32が更新するフィールドである。「回数」は、タスクAが禁止されることなく実行され、データXを連続して更新した回数である。すなわち、スケジューリング制御部32はタスクAが終了する毎に「回数」を1つ大きくし、タスクAの実行を禁止すると「回数」をゼロにする。   “Number of times” and “Number of activations” are fields that the scheduling control unit 32 updates. The “number of times” is the number of times that the task A is executed without being prohibited and the data X is continuously updated. In other words, the scheduling control unit 32 increases the “number of times” by one every time the task A is completed, and sets the “number of times” to zero when the execution of the task A is prohibited.

また、「発動数」は、スケジューリング制御部32が制御対象であるタスクAの実行を禁止した回数である。したがって、スケジューリング制御部32は実施例1のようにタスクAの実行を禁止する毎に「発動数」を1つ大きくする。   Further, the “number of activations” is the number of times that the scheduling control unit 32 prohibits execution of the task A that is a control target. Therefore, the scheduling control unit 32 increases the “number of activations” by one each time the execution of the task A is prohibited as in the first embodiment.

「しきい値」は、「回数」と比較される値である。つまり、「回数」が「しきい値」より大きければ、データXは十分に更新されており、タスクAが更新しなくてもタスクBにとって支障は少ないと考えられる。また、「回数」が「しきい値」以下であれば、データXの更新頻度が少ないので、タスクAの実行を禁止すべきでないと考えられる。   The “threshold value” is a value compared with the “number of times”. That is, if the “number of times” is larger than the “threshold value”, the data X is sufficiently updated, and it is considered that there is little trouble for the task B even if the task A is not updated. Further, if the “number of times” is equal to or less than the “threshold value”, the update frequency of the data X is low, and it is considered that the execution of the task A should not be prohibited.

このように、本実施例のスケジューリング制御部32は、「回数」と「しきい値」を比較して、タスクAの実行を禁止するか否かを判定する。   As described above, the scheduling control unit 32 according to the present embodiment compares the “number of times” with the “threshold value” and determines whether or not the execution of the task A is prohibited.

なお、「発動数」は、バッテリが外されるなどしてRAM12が初期化されない限り、最後の値を保持する。「発動数」が多いことは、データの競合回数やタスクAの実行禁止の回数が多いことを意味するので、「発動数」が極端に大きいことは好ましくない。そこで、ディーラなどでは、サービスマンがスキャンツールを車載ネットワークに接続することで「発動数」を読み出し車両の点検に利用することができる。なお、「発動数」は所定期間毎(例えばワントリップ、所定距離の走行毎)に初期化されてもよい。   Note that the “number of activations” holds the last value unless the RAM 12 is initialized by removing the battery or the like. A large “number of activations” means that the number of data conflicts and the number of execution prohibitions of task A are large, and therefore it is not preferable that the “number of activations” is extremely large. Therefore, in a dealer or the like, a serviceman can connect the scan tool to the in-vehicle network to read the “number of activations” and use it for vehicle inspection. It should be noted that the “number of activations” may be initialized every predetermined period (for example, one trip, every predetermined distance traveling).

図10は、スケジューリング制御部32が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である。本実施例では、ステップS25、S45において、スケジューリング制御部32が、「回数」>「しきい値」か否かを判定している。   FIG. 10 is an example of a flowchart illustrating a procedure in which the scheduling control unit 32 prohibits execution of a task having a low priority. In this embodiment, in steps S25 and S45, the scheduling control unit 32 determines whether or not “number of times”> “threshold value”.

すなわち、レディーキューに制御対象のタスクがある場合(S20のYes)、スケジューリング制御部32はタスク起動管理データ記録部34の「回数」が「しきい値」より大きいか否かを判定する(S25)。スケジューリング制御部32は「回数」が「しきい値」より大きい場合にだけ(S25のYes)、レディーキューのタスクAを実行禁止にする(S30)。これにより、タスクAがしきい値より多く連続して実行されている場合には、タスクAが実行されることを禁止できる。   That is, when there is a task to be controlled in the ready queue (Yes in S20), the scheduling control unit 32 determines whether or not the “number of times” in the task activation management data recording unit 34 is larger than the “threshold value” (S25). ). The scheduling control unit 32 prohibits execution of the task A in the ready queue only when the “number of times” is larger than the “threshold value” (Yes in S25) (S30). Thereby, when the task A is continuously executed more than the threshold value, the task A can be prohibited from being executed.

また、レディーキューに競合タスクがある場合(S40のYes)、スケジューリング制御部32はタスク起動管理データ記録部34の「回数」が「しきい値」より大きいか否かを判定する(S45)。スケジューリング制御部32は「回数」が「しきい値」より大きい場合にだけ(S45のYes)、制御対象のタスクAを実行禁止にする(S50)。すなわち、タスクAがしきい値より多く連続して実行されている場合にだけ、タスクAはレディーキューに登録されることなく消滅する。   If there is a competing task in the ready queue (Yes in S40), the scheduling control unit 32 determines whether or not the “number of times” in the task activation management data recording unit 34 is larger than the “threshold value” (S45). Only when the “number of times” is larger than the “threshold value” (Yes in S45), the scheduling control unit 32 prohibits execution of the task A to be controlled (S50). That is, task A disappears without being registered in the ready queue only when task A is continuously executed more than the threshold value.

ステップS25、S45で「回数」が「しきい値」より大きくない場合(S25、S45のNo)、処理はステップS60に進むので、スケジューリング制御部32はタスクBをレディーキューに登録し、タスクAをレディーキューに登録する。したがって、この場合は、タスクAが禁止されることなく実行される。   If the “number of times” is not greater than the “threshold value” in steps S25 and S45 (No in S25 and S45), the process proceeds to step S60, so that the scheduling control unit 32 registers task B in the ready queue and Is registered in the ready queue. Therefore, in this case, task A is executed without being prohibited.

この後、スケジューリング制御部32はタスク起動管理データ記録部34を更新する(S70)。タスクAを実行した場合は「回数」を1つ大きくし、タスクAの実行を禁止した場合は「発動数」を1つ大きくし「回数」をゼロに初期化する。   Thereafter, the scheduling control unit 32 updates the task activation management data recording unit 34 (S70). When the task A is executed, the “number of times” is increased by one, and when the execution of the task A is prohibited, the “number of activations” is increased by one and the “number of times” is initialized to zero.

本実施例の情報処理装置100によれば、実施例1の効果に加えて、タスクAの実行頻度を判定して、タスクBが演算に用いるデータの信頼性が低下するおそれがない場合にのみ、タスクAの実行を禁止することができる。   According to the information processing apparatus 100 of the present embodiment, in addition to the effects of the first embodiment, only when the execution frequency of the task A is determined and there is no possibility that the reliability of the data used by the task B in the calculation is reduced. The execution of task A can be prohibited.

実施例1,2では、タスクAよりも優先度が高いタスクBは、タスクAがデータを更新しないためやや時間的に古いデータを演算に使用している。本実施例では、この古いデータから、タスクBが実行される時のデータを過去のデータの補間により求める情報処理装置100について説明する。   In the first and second embodiments, task B, which has a higher priority than task A, uses data that is slightly older in time for calculation because task A does not update data. In the present embodiment, an information processing apparatus 100 that obtains data when task B is executed from this old data by interpolation of past data will be described.

図11は、スケジューラ31の機能ブロック図、タスク排他登録テーブル33、タスク起動管理データ記録部34、及び、補間データ記録部36の一例を示す図である。図11において図9と同一部の説明は省略する。本実施例では、スケジューラ31が補間データ制御部35を有し、RAM12に補間データ記録部36が設けられている。   FIG. 11 is a diagram illustrating an example of a functional block diagram of the scheduler 31, a task exclusive registration table 33, a task activation management data recording unit 34, and an interpolation data recording unit 36. In FIG. 11, the description of the same parts as those in FIG. 9 is omitted. In this embodiment, the scheduler 31 has an interpolation data control unit 35, and the RAM 12 is provided with an interpolation data recording unit 36.

補間データ記録部36には、過去の所定数のデータ(取得値)と、過去の取得値から求められた予測値が記録される。補間データ記録部36には、タスクAの起動周期である2ミリ秒ごとにタスクAがRAM12に書き込んだデータが記録される。タスクAの実行が禁止された場合、タスクBはこの予測値を車載装置の制御に利用する。具体的には、スケジューリング制御部32が予測値を補間データ記録部36から読み出し、タスクAの代わりにRAM12に書き込む。タスクBはこの予測値をRAM12から読み出して使用することができる。   The interpolation data recording unit 36 records a predetermined number of past data (acquired values) and a predicted value obtained from the past acquired values. In the interpolation data recording unit 36, data written by the task A into the RAM 12 is recorded every 2 milliseconds, which is the task A activation cycle. When execution of task A is prohibited, task B uses this predicted value for control of the in-vehicle device. Specifically, the scheduling control unit 32 reads the predicted value from the interpolation data recording unit 36 and writes it in the RAM 12 instead of the task A. Task B can read out the predicted value from the RAM 12 and use it.

補間データ制御部35は、補間データ記録部36に、タスクAが読み出した取得値を登録する。補間データ記録部36は、リングバッファであり、例えば、6個のデータが記録されると、最も古いデータから上書きされる。補間データ制御部35は、補間データ記録部36に新たにデータを記録すると、予測値を更新する。すなわち、次回、タスクAが実行された場合に、タスクAがRAM12に書き込むであろうデータを予測して、補間データ記録部36の予測値に書き込む。   The interpolation data control unit 35 registers the acquired value read by the task A in the interpolation data recording unit 36. The interpolation data recording unit 36 is a ring buffer. For example, when six pieces of data are recorded, the oldest data is overwritten. When data is newly recorded in the interpolation data recording unit 36, the interpolation data control unit 35 updates the predicted value. That is, the next time task A is executed, the data that task A will write to RAM 12 is predicted and written to the predicted value of interpolation data recording unit 36.

予測のアルゴリズムはどのようなものでもよく、また、データによって異なることが多いので最適なアルゴリズムで予測する。例えば、時間と共に増大するデータであれば、補間データ制御部35は、過去の数個のデータの差を算出し、その差の平均を最後のデータに加えた予測値とする。
例えば、3〜6回分のデータの差が「6,6,5」なので、平均は6(切り上げ)となる。よって予測値=31+6=37となる。
Any prediction algorithm may be used, and since it is often different depending on data, the prediction is performed with an optimal algorithm. For example, if the data increases with time, the interpolation data control unit 35 calculates a difference between several past data, and sets the average of the differences as a predicted value added to the last data.
For example, since the difference in data for 3 to 6 times is “6, 6, 5”, the average is 6 (rounded up). Therefore, the predicted value = 31 + 6 = 37.

また、時間と共に余り変化のないデータであれば、補間データ制御部35は、過去の数個のデータの平均値を予測値とする。例えば、3〜6回分のデータの平均から、予測値=26となる。   If the data does not change much with time, the interpolation data control unit 35 uses an average value of several past data as a predicted value. For example, the predicted value = 26 from the average of 3 to 6 data.

また、最後のデータをそのまま予測値(31)としてもよい。こうすることで、CPU負荷を低減できる。   The last data may be used as the predicted value (31) as it is. By doing so, the CPU load can be reduced.

なお、「タイマー値」は、タスクAがデータXを処理した(演算した、又は、RAM12に書き込んだ)時刻を表す。「タイマー値」により、スケジューリング制御部32はタスクAの起動間隔を検出できる。当然ながら、タスクAの実行が禁止されると、「タイマー値」の間隔が大きくなる。   The “timer value” represents the time when the task A processed the data X (calculated or written in the RAM 12). Based on the “timer value”, the scheduling control unit 32 can detect the activation interval of the task A. Naturally, when the execution of task A is prohibited, the interval of the “timer value” increases.

また、タスク起動管理データ記録部34は「補間有」のフィールドを有する。「補間有」のフィールドは、補間データ制御部35が補間データ記録部36を作成する必要があるか否かを制御するためのフラグである。また、スケジューリング制御部32が、予測値を補間データ記録部36から読み出し、タスクAの代わりにRAM12に書き込むか否かを制御するためのフラグでもある。   Further, the task activation management data recording unit 34 has a field “with interpolation”. The field “with interpolation” is a flag for controlling whether or not the interpolation data control unit 35 needs to create the interpolation data recording unit 36. The scheduling control unit 32 is also a flag for controlling whether or not the predicted value is read from the interpolation data recording unit 36 and written to the RAM 12 instead of the task A.

図12は、スケジューリング制御部32が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である。本実施例では、ステップS30、S50において、タスクAの実行が禁止された後、スケジューリング制御部32が、タスク起動管理データ記録部34を参照して、「補間」が“有り”か否かを判定する(S55)。   FIG. 12 is an example of a flowchart illustrating a procedure in which the scheduling control unit 32 prohibits execution of a task with a low priority. In this embodiment, after the execution of task A is prohibited in steps S30 and S50, the scheduling control unit 32 refers to the task activation management data recording unit 34 to determine whether “interpolation” is “present” or not. Determine (S55).

「補間」が“有り”の場合(S55のYes)、スケジューリング制御部32は補間データ記録部36から予測値を読み出し、RAM12に書き込む(S56)。この後、レディーキューが更新されタスクBが実行されるので、タスクBは予測値を使用して車載装置を制御できる。   When “interpolation” is “present” (Yes in S55), the scheduling control unit 32 reads the predicted value from the interpolation data recording unit 36 and writes it in the RAM 12 (S56). Thereafter, since the ready queue is updated and task B is executed, task B can control the in-vehicle device using the predicted value.

図13は、タスクAと補間データ制御部35の動作手順を示すフローチャート図の一例である。タスクBと実行タイミングが競合せずに実行された場合、又は、タスクBと実行タイミングが競合したが実行された場合、タスクAはセンサ値の読み出し(S101)、演算(S102)、演算結果のRAM12への書き込みを行う(S103)。   FIG. 13 is an example of a flowchart showing an operation procedure of the task A and the interpolation data control unit 35. When the task B and the execution timing are executed without conflict, or when the task B and the execution timing conflict with each other, the task A reads the sensor value (S101), the calculation (S102), and the calculation result. Writing to the RAM 12 is performed (S103).

スケジューリング制御部32はシステムコールによりタスクAの終了を検出すると、タスク起動管理データ記録部34の「補間有」が“有り”になっているため、補間データ制御部35に予測値の補間を要求する。   When the scheduling control unit 32 detects the end of the task A by the system call, the “interpolation present” of the task activation management data recording unit 34 is “present”, so that the interpolation data control unit 35 is requested to interpolate the predicted value. To do.

これにより、補間データ制御部35は以下の処理を開始する。補間データ制御部35は、RAM12からデータXを読み出し(S111)、読み出したデータXを補間データ記録部36に書き込む(S112)。補間データ記録部36において更新されるデータは最も古いデータである。   Thereby, the interpolation data control unit 35 starts the following processing. The interpolation data control unit 35 reads the data X from the RAM 12 (S111), and writes the read data X in the interpolation data recording unit 36 (S112). The data updated in the interpolation data recording unit 36 is the oldest data.

補間データ制御部35は、補間データ記録部の所定数個のデータを用いて予測値を更新する(S113)。これにより、次回、タスクAの実行が禁止された場合、タスクBは予測値を使用して車載装置を制御できる。   The interpolation data control unit 35 updates the predicted value using a predetermined number of pieces of data in the interpolation data recording unit (S113). Thereby, when execution of task A is prohibited next time, task B can control the in-vehicle device using the predicted value.

本実施例の情報処理装置100によれば、実施例1,2の効果に加え、タスクAが実行されない場合、過去のデータからタスクAのデータを予測するので、タスクBは信頼性のあるデータを用いて車載装置を制御できる。   According to the information processing apparatus 100 of the present embodiment, in addition to the effects of the first and second embodiments, when the task A is not executed, the data of the task A is predicted from the past data. The vehicle-mounted device can be controlled using

本実施例では、連続データ更新カウンタの「回数」が「しきい値」より小さい場合でも、データXの更新が遅延している場合は、タスクAの実行を禁止する情報処理装置100について説明する。   In the present embodiment, the information processing apparatus 100 that prohibits the execution of the task A when the update of the data X is delayed even when the “number of times” of the continuous data update counter is smaller than the “threshold value” will be described. .

図14は、スケジューラ31の機能ブロック図、タスク排他登録テーブル33、タスク起動管理データ記録部34、及び、補間データ記録部36の一例を示す図である。図14において図11と同一部の説明は省略する。本実施例では、タスク起動管理データ記録部34に、新たに「起動周期」「周期しきい値」のフィールドが設けられている。「起動周期」は、タスクAの実際の起動周期である。「起動周期」はスケジューリング制御部32が更新するデータであり、スケジューリング制御部32は、補間データ記録部36の「タイマー値」を参照して、「起動周期」に設定する。タスクAの理想的な起動周期は予め既知なので(例えば、2ミリ秒)、「起動周期」によりどの程度、理想的な起動周期に対し遅れているかが検出される。   FIG. 14 is a diagram illustrating an example of a functional block diagram of the scheduler 31, a task exclusive registration table 33, a task activation management data recording unit 34, and an interpolation data recording unit 36. In FIG. 14, the description of the same part as in FIG. 11 is omitted. In this embodiment, the task activation management data recording unit 34 is newly provided with fields of “activation period” and “period threshold value”. The “activation period” is an actual activation period of task A. The “start cycle” is data updated by the scheduling control unit 32, and the scheduling control unit 32 refers to the “timer value” of the interpolation data recording unit 36 and sets it to the “start cycle”. Since the ideal activation cycle of task A is known in advance (for example, 2 milliseconds), it is detected to what extent it is delayed from the ideal activation cycle by the “activation cycle”.

「周期しきい値」は、「起動周期」と比較される値であり、「起動周期>周期しきい値」の場合、スケジューリング制御部32はタスクAの実行を禁止すべきと判定する。例えば、車速が高速なため、タスクAの起動周期が遅れてきた場合、タスクAの実行を停止しないデータの更新がさらに遅れてしまう。そこで、スケジューリング制御部32は「起動周期>周期しきい値」の場合、「回数(例えば、10回)」が「しきい値(例えば、12回)」より小さい場合でも、タスクAの実行を禁止する。   The “periodic threshold value” is a value to be compared with the “activation period”. When “activation period> periodic threshold value”, the scheduling control unit 32 determines that the execution of the task A should be prohibited. For example, if the activation period of task A is delayed because the vehicle speed is high, the update of data that does not stop execution of task A is further delayed. Therefore, when “start cycle> cycle threshold”, the scheduling control unit 32 executes task A even when “number of times (for example, 10 times)” is smaller than “threshold value (for example, 12 times)”. Ban.

図15は、スケジューリング制御部32が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である。本実施例では、ステップS26、S46において、スケジューリング制御部32が、「起動周期」が「周期しきい値」より大きいか否かを判定している。   FIG. 15 is an example of a flowchart illustrating a procedure in which the scheduling control unit 32 prohibits execution of a task with a low priority. In the present embodiment, in steps S26 and S46, the scheduling control unit 32 determines whether or not the “start cycle” is larger than the “cycle threshold”.

すなわち、レディーキューに制御対象のタスクがある場合(S20のYes)、スケジューリング制御部32は「回数」が「しきい値」より大きいか否かを判定する(S25)。スケジューリング制御部32は「回数」が「周期しきい値」以下の場合(S25のNo)、さらにタスク起動管理データ記録部34の「起動周期」が「周期しきい値」より大きいか否かを判定する(S26)。   That is, when there is a task to be controlled in the ready queue (Yes in S20), the scheduling control unit 32 determines whether or not the “number of times” is larger than the “threshold value” (S25). When the “number of times” is equal to or smaller than the “periodic threshold” (No in S25), the scheduling control unit 32 further determines whether the “activation period” of the task activation management data recording unit 34 is greater than the “periodic threshold”. Determine (S26).

スケジューリング制御部32は「起動周期」が「周期しきい値」より大きい場合(S26のYes)、タスクAを実行禁止として、処理をステップS60に進める。これにより、タスクAの起動周期が遅れ気味な場合は、タスクAの実行を禁止し処理遅延の拡大を防止できる。   If the “start cycle” is larger than the “cycle threshold” (Yes in S26), the scheduling control unit 32 prohibits the task A from being executed and advances the process to step S60. As a result, when the activation period of task A seems to be delayed, the execution of task A can be prohibited to prevent an increase in processing delay.

また、レディーキューに競合タスクがある場合(S40のYes)、スケジューリング制御部32はタスク起動管理データ記録部34の「回数」が「しきい値」より大きいか否かを判定する(S45)。スケジューリング制御部32は「回数」が「しきい値」以下の場合(S45のNo)、さらに「起動周期」が「周期しきい値」より大きいか否かを判定する(S46)。   If there is a competing task in the ready queue (Yes in S40), the scheduling control unit 32 determines whether or not the “number of times” in the task activation management data recording unit 34 is larger than the “threshold value” (S45). When the “number of times” is equal to or less than the “threshold value” (No in S45), the scheduling control unit 32 further determines whether the “start cycle” is larger than the “cycle threshold value” (S46).

スケジューリング制御部32は「起動周期」が「周期しきい値」より大きい場合(S46のYes)、タスクAを実行禁止として、処理をステップS60に進める。これにより、タスクAの起動周期が遅れ気味な場合は、タスクAの実行を禁止し処理遅延の拡大を防止できる。   If the “start cycle” is greater than the “cycle threshold” (Yes in S46), the scheduling control unit 32 prohibits execution of the task A and advances the process to step S60. As a result, when the activation period of task A seems to be delayed, the execution of task A can be prohibited to prevent an increase in processing delay.

本実施例によれば、実施例1〜3の効果に加え、連続データ更新カウンタの「回数」が「しきい値」より小さい場合でも、データXの更新が遅延している場合は、タスクAによるデータ更新を確実に行うことができる。   According to the present embodiment, in addition to the effects of the first to third embodiments, even when the “number of times” of the continuous data update counter is smaller than the “threshold value”, if the update of the data X is delayed, the task A It is possible to reliably update the data.

11 CPU
12 RAM
31 スケジューラ
32 スケジューリング制御部
33 タスク排他登録テーブル
34 タスク起動管理データ記録部
35 補間データ制御部
36 補間データ記録部
38 TCB
100 情報処理装置
11 CPU
12 RAM
31 Scheduler 32 Scheduling Control Unit 33 Task Exclusive Registration Table 34 Task Activation Management Data Recording Unit 35 Interpolation Data Control Unit 36 Interpolation Data Recording Unit 38 TCB
100 Information processing apparatus

Claims (8)

複数のタスクの実行タイミングが競合した場合、優先度順にタスクをリソースに割り当てる情報処理装置において、
周期起動タスク、及び、前記周期起動タスクよりも優先度の高い競合タスクが共有するデータ毎に、周期起動タスクと前記競合タスクの組が予め登録されたタスク登録テーブルと、
前記周期起動タスクと、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記競合タスクを優先して実行し、競合した周期における前記周期起動タスクの実行を禁止するスケジューリング制御手段と、
を有することを特徴とする情報処理装置。
When the execution timings of multiple tasks conflict, in the information processing apparatus that assigns tasks to resources in order of priority,
A task registration table in which a set of a cyclic start task and the competing task is registered in advance for each data that is shared by a cyclic start task and a competing task having a higher priority than the cyclic start task,
When the execution timing of the conflicting task registered in the task registration table in association with the periodic activation task and the periodic activation task conflicts, the competitive task is preferentially executed, and the periodic activation in the conflicting cycle Scheduling control means for prohibiting execution of tasks;
An information processing apparatus comprising:
前記周期起動タスクの実行が禁止されずに連続して実行された回数、及び、前記回数の下限値が登録された起動管理テーブルを有し、
前記スケジューリング制御手段は、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記回数が前記下限値より大きい場合にのみ、競合した周期における前記周期起動タスクの実行を禁止する、
ことを特徴とする請求項1記載の情報処理装置。
The number of times the execution of the periodic start task is continuously executed without being prohibited, and a start management table in which a lower limit value of the number of times is registered;
The scheduling control means, when the execution timing of the competing task registered in the task registration table in association with the periodic activation task competes, only when the number of times is larger than the lower limit value, Prohibit execution of cyclically activated tasks,
The information processing apparatus according to claim 1.
前記周期起動タスクが生成した過去のデータが時系列に登録されたデータ登録テーブルと、
前記周期起動タスクが実行された場合に、前記周期起動タスクが生成したデータを前記データ登録テーブルに書き込むデータ書き込み手段と、を有し、
前記スケジューリング制御手段は、前記周期起動タスクと、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記データ登録テーブルに登録された過去の1つ以上のデータから予測された予測値を、前記競合タスクに提供し、前記競合タスクを優先して実行する、
ことを特徴とする請求項2記載の情報処理装置。
A data registration table in which past data generated by the cyclic start task is registered in time series;
Data writing means for writing the data generated by the periodic start task to the data registration table when the periodic start task is executed,
When the execution timing of the competing task registered in the task registration table in association with the periodic activation task conflicts with the periodic activation task, the scheduling control unit is configured to store the past one registered in the data registration table. Providing predicted values predicted from one or more data to the competing task, and executing the competing task with priority.
The information processing apparatus according to claim 2.
前記データ書き込み手段は、前記周期起動タスクが実行された周期情報を前記データ登録テーブルに書き込み、
前記起動管理テーブルに前記周期起動タスクの起動周期の上限値が登録されており、
前記スケジューリング制御手段は、前記データ登録テーブルの前記周期情報が前記上限値を上回っている場合、前記回数が前記下限値以下でも、競合した周期における前記周期起動タスクの実行を禁止する、
ことを特徴とする請求項3記載の情報処理装置。
The data writing means writes, in the data registration table, cycle information on which the cycle activation task has been executed,
An upper limit value of the activation cycle of the periodic activation task is registered in the activation management table,
The scheduling control means prohibits the execution of the periodic activation task in a conflicting period even when the number of times is equal to or less than the lower limit value when the period information of the data registration table exceeds the upper limit value.
The information processing apparatus according to claim 3.
前記スケジューリング制御手段は、競合した周期における前記周期起動タスクの実行を禁止した回数を前記起動管理テーブルに記録する、
ことを特徴とする請求項1〜4いずれか1項記載の情報処理装置。
The scheduling control means records in the activation management table the number of times the execution of the periodic activation task in the conflicting period is prohibited;
The information processing apparatus according to claim 1, wherein the information processing apparatus is an information processing apparatus.
前記スケジューリング制御手段は、前記周期起動タスクと、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記データ登録テーブルにデータの補間指示がある場合にのみ、前記予測値を前記競合タスクに提供する、
ことを特徴とする請求項3記載の情報処理装置。
The scheduling control means has an instruction to interpolate data in the data registration table when the execution timing of the competing task registered in the task registration table in association with the periodic activation task conflicts with the periodic activation task. Only if the prediction value is provided to the competing task,
The information processing apparatus according to claim 3.
前記周期起動タスクはタイマにより周期的に起床され、周辺回路から取得したデータに演算を施しメモリ上のデータを更新するタスクであり、前記競合タスクはセンサが検出したイベント信号により起床され、メモリからデータを読み出し装置を制御するタスクである、
ことを特徴とする請求項1〜6いずれか1項記載の情報処理装置。
The periodic start task is a task that is periodically woken up by a timer, performs a calculation on data acquired from a peripheral circuit, and updates data on the memory, and the competing task is woken up by an event signal detected by a sensor, A task to read data and control the device,
The information processing apparatus according to claim 1, wherein:
複数のタスクの実行タイミングが競合した場合、優先度順にタスクをリソースに割り当てる情報処理装置のタスクスケジューリング方法において、
スケジューリング制御手段が、周期起動タスク、及び、前記周期起動タスクよりも優先度の高い競合タスクが共有するデータ毎に、周期起動タスクと前記競合タスクの組が予め登録されたタスク登録テーブルを参照して、
前記周期起動タスクと、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記競合タスクを優先して実行し、競合した周期における前記周期起動タスクの実行を禁止する、
ことを特徴とするタスクスケジューリング方法。
In the task scheduling method of the information processing apparatus that assigns tasks to resources in order of priority when execution timings of a plurality of tasks conflict,
The scheduling control means refers to a task registration table in which a set of the periodic start task and the competing task is registered in advance for each data shared by the periodic start task and the competing task having a higher priority than the periodic start task. And
When the execution timing of the conflicting task registered in the task registration table in association with the periodic activation task and the periodic activation task conflicts, the competitive task is preferentially executed, and the periodic activation in the conflicting cycle Prohibit execution of tasks,
A task scheduling method characterized by the above.
JP2012013404A 2012-01-25 2012-01-25 Information processing device and task scheduling method Pending JP2013152636A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012013404A JP2013152636A (en) 2012-01-25 2012-01-25 Information processing device and task scheduling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012013404A JP2013152636A (en) 2012-01-25 2012-01-25 Information processing device and task scheduling method

Publications (1)

Publication Number Publication Date
JP2013152636A true JP2013152636A (en) 2013-08-08

Family

ID=49048919

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012013404A Pending JP2013152636A (en) 2012-01-25 2012-01-25 Information processing device and task scheduling method

Country Status (1)

Country Link
JP (1) JP2013152636A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017059009A (en) * 2015-09-17 2017-03-23 横河電機株式会社 Control device
US20200039453A1 (en) * 2016-10-19 2020-02-06 Hitachi Automotive Systems, Ltd. Vehicle controller
WO2021106353A1 (en) * 2019-11-29 2021-06-03 日立Astemo株式会社 Electronic control device
CN116859874A (en) * 2023-09-04 2023-10-10 成都科江科技有限公司 Industrial logic control task scheduling method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017059009A (en) * 2015-09-17 2017-03-23 横河電機株式会社 Control device
US20200039453A1 (en) * 2016-10-19 2020-02-06 Hitachi Automotive Systems, Ltd. Vehicle controller
WO2021106353A1 (en) * 2019-11-29 2021-06-03 日立Astemo株式会社 Electronic control device
JP7333251B2 (en) 2019-11-29 2023-08-24 日立Astemo株式会社 electronic controller
CN116859874A (en) * 2023-09-04 2023-10-10 成都科江科技有限公司 Industrial logic control task scheduling method

Similar Documents

Publication Publication Date Title
JP5347451B2 (en) Multiprocessor system, conflict avoidance program, and conflict avoidance method
US9298504B1 (en) Systems, devices, and techniques for preempting and reassigning tasks within a multiprocessor system
JP5653431B2 (en) Multiprocessor system
US20120233616A1 (en) Stream data processing method and stream processor
JP5861718B2 (en) Electronic control device for vehicle and data receiving method
JP4213572B2 (en) Electronic device and processor speed control method
WO2010067492A1 (en) Multiprocessor system and multiprocessor exclusive control adjustment method
JP5745868B2 (en) Multiprocessor system
US20110022809A1 (en) Consolidated electronic control unit and relay program implemented in the same
US7398378B2 (en) Allocating lower priority interrupt for processing to slave processor via master processor currently processing higher priority interrupt through special interrupt among processors
JP2013152636A (en) Information processing device and task scheduling method
US9367349B2 (en) Multi-core system and scheduling method
JP2014191655A (en) Multiprocessor, electronic control device, and program
US20100281485A1 (en) Method For Changing Over A System Having Multiple Execution Units
JP2010170320A (en) Program and control device
JP2010280356A (en) Onboard system, and load distribution method
JP5726006B2 (en) Task and resource scheduling apparatus and method, and control apparatus
JP2007164421A (en) Parallel processors, parallel processing method and parallel processing program
US20050160425A1 (en) Limitation of the response time of a software process
JP4614239B2 (en) Multitask scheduling function-equipped device and program
JP5699896B2 (en) Information processing apparatus and abnormality determination method
JP2012137920A (en) Electronic control device and start control method
JPWO2018211865A1 (en) Vehicle control device
JP2010140239A (en) Apparatus and method for shortening interrupt latency
JP4441592B2 (en) Parallel processing apparatus and exclusive control method