JP2013156744A - Information processing device and data storage method - Google Patents

Information processing device and data storage method Download PDF

Info

Publication number
JP2013156744A
JP2013156744A JP2012015460A JP2012015460A JP2013156744A JP 2013156744 A JP2013156744 A JP 2013156744A JP 2012015460 A JP2012015460 A JP 2012015460A JP 2012015460 A JP2012015460 A JP 2012015460A JP 2013156744 A JP2013156744 A JP 2013156744A
Authority
JP
Japan
Prior art keywords
data
task
safety
storage
storage unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012015460A
Other languages
Japanese (ja)
Other versions
JP5849731B2 (en
Inventor
Tetsuya Taira
哲也 平
Koji Bito
浩司 尾藤
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.)
Toyota Motor Corp
Original Assignee
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 Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2012015460A priority Critical patent/JP5849731B2/en
Publication of JP2013156744A publication Critical patent/JP2013156744A/en
Application granted granted Critical
Publication of JP5849731B2 publication Critical patent/JP5849731B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To preferentially store data of a specific task.SOLUTION: An information processing device includes: a storage unit for storing therein first data and second data whose storage priority is higher than the first data; a task execution unit for scheduling and executing a first task of storing the first data in the storage unit and a second task of storing the second data in the storage unit; and a data storage control unit for storing the first data in the storage unit in place of the first task in response to a data storage request from the first task, and for storing the second data in the storage unit in place of the second task in response to a data storage request from the second task. When receiving the data storage request from the second task at the time of storage of the second data, the data storage control unit stores the second data in the storage unit in response to the data storage request from the second task even if receiving the data storage request from the first task.

Description

本発明は、情報処理装置及びデータ格納方法に関し、特に、データを格納するタスクと、そのデータよりも格納する優先度の高いデータを格納するタスクとを実行する情報処理装置及びデータ格納方法に関する。   The present invention relates to an information processing apparatus and a data storage method, and more particularly, to an information processing apparatus and a data storage method for executing a task for storing data and a task for storing higher priority data than the data.

サービスロボットは、外界センサや自己診断装置によって安全状態を常時監視し、何らかの危険を検知した場合に適切な安全制御ロジックを実行することで、機能安全を確保する必要がある。   Service robots must ensure functional safety by constantly monitoring the safety state with external sensors and self-diagnosis devices and executing appropriate safety control logic when any danger is detected.

上述したサービスロボットのほか、運輸機器等の電気的な原理で動作するシステムを対象とした機能安全に関する国際標準としてIEC 61508が制定されている。IEC 61508では、機能安全の確保のために設けられるシステムのことを安全関連系と呼んでいる。IEC 61508は、マイクロプロセッサ及びPLC(Programmable Logic Controller)等のハードウェアとコンピュータプログラム(ソフトウェア)によって安全関連系を構築するための様々な技法を定めている。IEC 61508で定められている技法を用いることで、コンピュータシステムを用いて安全関連系を構築することが可能となる。   In addition to the service robots described above, IEC 61508 has been established as an international standard for functional safety for systems that operate on electrical principles such as transportation equipment. In IEC 61508, a system provided for ensuring functional safety is called a safety-related system. IEC 61508 defines various techniques for constructing a safety-related system using hardware such as a microprocessor and a PLC (Programmable Logic Controller) and a computer program (software). By using the technique defined in IEC 61508, it is possible to construct a safety-related system using a computer system.

一方で、近年、マイクロプロセッサ等のプログラマブル電子機器の処理能力が向上している。このため、マルチタスクOS(Operating System)を利用し、1つのコンピュータシステム上で様々なアプリケーションプログラムを並列実行することで、サービスロボット及び自動車等の機器に搭載されている複数用途のコンピュータシステムを統合することができる。   On the other hand, in recent years, the processing capability of programmable electronic devices such as microprocessors has improved. For this reason, a multi-task OS (Operating System) is used, and various application programs are executed in parallel on one computer system, thereby integrating multiple-use computer systems installed in service robots and automobiles. can do.

例えば特許文献1に、機能安全の確保に関するアプリケーションプログラム(以下、安全関連アプリケーションと呼ぶ)を、その他のアプリケーションプログラム(以下、非安全関連アプリケーションと呼ぶ)と共に1つのコンピュータシステム上で動作させる技術が開示されている。   For example, Patent Literature 1 discloses a technique for causing an application program (hereinafter referred to as a safety-related application) related to ensuring functional safety to operate on one computer system together with other application programs (hereinafter referred to as a non-safety-related application). Has been.

IEC 61508で定められている技法を、安全関連アプリケーションおよび非安全関連アプリケーションを含むソフトウェア全体に適用すると、非安全関連アプリケーションにまで適用する必要性が生じる。このため、ソフトウェア開発コストが増大するという問題がある。   When the technique defined in IEC 61508 is applied to the entire software including safety-related applications and non-safety-related applications, it is necessary to apply even to non-safety-related applications. For this reason, there is a problem that the software development cost increases.

そこで、特許文献1に開示される技術では、システムプログラムのタイム・パーティションニングによって、安全関連アプリケーション(安全監視プログラム及び安全制御プログラム)を非安全関連アプリケーション(通常制御プログラム)から独立させている。このため、通常制御プログラムを安全関連系から除外することができ、コンピュータシステムを用いて構成される安全関連系の低コスト化に寄与することができる。   Therefore, in the technique disclosed in Patent Document 1, safety-related applications (safety monitoring program and safety control program) are made independent from non-safety-related applications (normal control program) by time partitioning of the system program. For this reason, the normal control program can be excluded from the safety-related system, which can contribute to the cost reduction of the safety-related system configured using the computer system.

ここで、特許文献1に開示の技術では、リソース・パーティショニングという技術を採用している。この技術では、実行用メモリ等の固定的な資源をリソースパーティションと言われるパーティションにパーティショニングしている。そして、アプリケーションは、予め割り当てられたリソースパーティションを超えて他のリソースにアクセスすることが禁止される。   Here, the technique disclosed in Patent Document 1 employs a technique called resource partitioning. In this technique, fixed resources such as execution memory are partitioned into partitions called resource partitions. The application is prohibited from accessing other resources beyond the pre-assigned resource partition.

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

本願出願人は、特許文献1に開示されるような安全制御装置に基づいて、新たに、ログを保存する安全制御装置を検討するにあたり、以下に説明する課題を見出した。以下、その課題について説明する。なお、以下に説明する内容は、本願出願人が新たに検討した内容であって、従来技術を説明したものではない。   Based on the safety control device disclosed in Patent Document 1, the applicant of the present application has newly found a problem to be described below when examining a safety control device that stores a log. The problem will be described below. In addition, the content demonstrated below is the content which the present applicant newly examined, and is not what demonstrated the prior art.

安全制御装置の動作・制御状況の調査を容易にする手法として、ログを保存することが考えられる。ここで、安全制御装置では、安全関連アプリケーションから起動される安全関連系タスクと、非安全関連アプリケーションから起動される非安全関連系タスクとが並列実行されることになる。   As a method for facilitating the investigation of the operation / control status of the safety control device, it is conceivable to save a log. Here, in the safety control device, a safety-related task activated from a safety-related application and a non-safety-related task activated from a non-safety-related application are executed in parallel.

このような調査において、十分な調査を可能とするためには、全てのタスク(安全関連系タスク及び非安全関連系タスク)のそれぞれでログを保存しておくことが好ましい。しかしながら、そのようにした場合には、タスクの並列実行状況によっては、期待するログが保存されなくなってしまう場合がある。   In such a survey, in order to enable a sufficient survey, it is preferable to save a log for each of all tasks (safety related tasks and non-safety related tasks). However, in such a case, the expected log may not be saved depending on the parallel execution status of the task.

具体的には、上述したような調査が必要となる主なケースとして、安全制御装置において異常が検出された場合が考えられる。ここで、安全制御装置における異常の検出は、主に、機能安全の確保に関する処理を実行する安全関連系タスクで行われることになる。しがたって、非安全関連系タスクが採取するログよりも、安全関連系タスクが採取する異常に関するログの方が、保存すべき優先度は高い。   Specifically, a case where an abnormality is detected in the safety control device can be considered as a main case that requires the above-described investigation. Here, the detection of an abnormality in the safety control device is mainly performed by a safety-related task that executes processing related to ensuring functional safety. Therefore, the log to be saved is higher in the log related to the abnormality collected by the safety related task than the log collected by the non-safety related task.

その一方で、異常検出時には、安全制御装置において各タスクを制御するマイクロコントローラをリセットして、安全制御装置の復旧を行う場合もある。この場合、ウォッチドッグタイマーに対する信号を停止させることで、一定時間の経過後に、マイクロコントローラをリセットさせることが考えられる。これによれば、この一定時間が経過するまでに、ログを採取することも可能となる。   On the other hand, when an abnormality is detected, the microcontroller that controls each task in the safety control device may be reset to restore the safety control device. In this case, it is conceivable to reset the microcontroller after a certain time has elapsed by stopping the signal to the watchdog timer. According to this, it is also possible to collect a log before the certain time elapses.

しかしながら、タスクの並列実行状況によっては、マイクロコントローラがリセットされるまでの一定時間の間に非安全関連系タスクが動作してしまい、非安全関連系タスクによってログの保存は行われるが、優先度の高いログを保存する安全関連系タスクの動作時間がなくなってしまい、安全関連系タスクによるログの保存が間に合わなくなってしまう場合がある。それに対して、マイクロコントローラをリセットするまでの時間を長くすることで、非安全関連系タスクの動作後においても、安全関連系タスクによるログの保存を間に合わせることもできる。しかしながら、そのようにしてしまうと、安全制御装置を復旧するまでの時間が長くなってしまい、運用上好ましくない。   However, depending on the parallel execution status of the task, the non-safety related task operates for a certain time until the microcontroller is reset, and the log is saved by the non-safety related task. In some cases, the operation time of the safety-related task that saves a high log is lost, and the saving of the log by the safety-related task is not in time. On the other hand, by lengthening the time until the microcontroller is reset, it is possible to save the log by the safety related task even after the operation of the non-safety related task. However, if this is done, it takes a long time to restore the safety control device, which is not preferable for operation.

これは、上述したケースに限られず、データを保存するタスクと、そのデータよりも保存する優先度の高いデータを保存するタスクとが動作するシステムであれば、同様のことが言える。   This is not limited to the case described above, and the same can be said for any system in which a task for storing data and a task for storing data having a higher priority than that data operate.

本発明は、上述した知見に基づいてなされたものであって、特定のタスクのデータを優先して保存することができる情報処理装置及びデータ格納方法を提供することを目的とする。   The present invention has been made based on the above-described knowledge, and an object thereof is to provide an information processing apparatus and a data storage method capable of preferentially storing data of a specific task.

本発明の第1の態様にかかる情報処理装置は、第1のデータと、前記第1のデータよりも格納する優先度の高い第2のデータとが格納される記憶部と、前記記憶部に前記第1のデータを格納する第1のタスクと、前記記憶部に前記第2のデータを格納する第2のタスクとをスケジューリングして実行するタスク実行部と、前記第1のタスクからのデータ格納要求に応じて、前記第1のタスクに代わって前記記憶部に前記第1のデータを格納するとともに、前記第2のタスクからのデータ格納要求に応じて、前記第2のタスクに代わって前記記憶部に前記第2のデータを格納するデータ格納制御と、を備え、前記データ格納制御部は、前記第2のデータを格納したときに、前記第2のタスクからのデータ格納要求がある場合には、前記第1のタスクからのデータ格納要求がある場合であっても、前記第2のタスクからのデータ格納要求に応じて、前記記憶部に前記第2のデータを格納するものである。   An information processing apparatus according to a first aspect of the present invention includes: a storage unit that stores first data and second data that has higher priority than the first data; and the storage unit A task execution unit that schedules and executes a first task that stores the first data and a second task that stores the second data in the storage unit, and data from the first task In response to a storage request, the first data is stored in the storage unit in place of the first task, and in response to a data storage request from the second task, in place of the second task. Data storage control for storing the second data in the storage unit, and the data storage control unit receives a data storage request from the second task when storing the second data In the case, the first tag Even when there is a data storage request from the click, depending on the data storage request from the second task, and stores the second data in the storage unit.

本発明の第2の態様にかかるは、第1のデータと、前記第1のデータよりも格納する優先度の高い第2のデータとが格納される記憶部に前記第1のデータを格納する第1のタスクと、前記記憶部に前記第2のデータを格納する第2のタスクとをスケジューリングして実行開始する実行開始ステップと、前記第1のタスクからのデータ格納要求に応じて、前記第1のタスクに代わって前記記憶部に前記第1のデータを格納する第1のデータ格納ステップと、前記第2のタスクからのデータ格納要求に応じて、前記第2のタスクに代わって前記記憶部に前記第2のデータを格納する第2のデータ格納ステップと、を備え、前記第2のデータ格納ステップでは、前記第2のデータを格納したときに、前記第2のタスクからのデータ格納要求がある場合には、前記第1のタスクからのデータ格納要求がある場合であっても、前記第2のタスクからのデータ格納要求に応じて、前記記憶部に前記第2のデータを格納するものである。   According to a second aspect of the present invention, the first data is stored in a storage unit that stores the first data and the second data having a higher priority than the first data. In response to a data storage request from the first task, an execution start step for scheduling and starting execution of the first task and the second task for storing the second data in the storage unit, In response to a data storage request from the second task, the first data storing step of storing the first data in the storage unit instead of the first task, the second task instead of the second task A second data storage step for storing the second data in a storage unit, and in the second data storage step, data from the second task is stored when the second data is stored. When there is a storage request Includes storing the second data in the storage unit in response to a data storage request from the second task even when there is a data storage request from the first task. .

上述した本発明の各態様によれば、特定のタスクのデータを優先して保存することができる情報処理装置及びデータ格納方法を提供することができる。   According to each aspect of the present invention described above, it is possible to provide an information processing apparatus and a data storage method capable of preferentially storing data of a specific task.

発明の実施の形態にかかる安全制御装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the safety control apparatus concerning embodiment of invention. 発明の実施の形態におけるタイム・パーティショニングの概念を説明するための図である。It is a figure for demonstrating the concept of the time partitioning in embodiment of invention. 発明の実施の形態におけるリソース・パーティショニングの概念を説明するための概念図である。It is a conceptual diagram for demonstrating the concept of the resource partitioning in embodiment of invention. 発明の実施の形態におけるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler and task in embodiment of invention. スケジューリングパターンの具体例を示す図である。It is a figure which shows the specific example of a scheduling pattern. スケジューリングパターンの具体例を示す図である。It is a figure which shows the specific example of a scheduling pattern. 発明の実施の形態にかかる安全関連系タスク及び非安全関連と、データWrite用タスクとの関係を示す図である。It is a figure which shows the relationship between the safety related type | system | group task concerning embodiment of invention, non-safety related, and the task for data Write. 発明の実施の形態にかかるパーティションスケジューラの処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the partition scheduler concerning embodiment of invention. 発明の実施の形態にかかるログ格納の処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of log storage concerning embodiment of invention. 発明の実施の形態にかかるログ格納の処理手順による具体的な処理例を示すシーケンス図である。It is a sequence diagram which shows the specific process example by the process procedure of the log storage concerning embodiment of invention. 発明の実施の形態にかかるログ格納の処理手順による具体的な処理例を示すシーケンス図である。It is a sequence diagram which shows the specific process example by the process procedure of the log storage concerning embodiment of invention. その他の実施の形態にかかるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler concerning other embodiment, and a task. その他の実施の形態にかかるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler concerning other embodiment, and a task.

以下では、本発明を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。各図面において、同一要素には同一の符号が付されており、説明の明確化のため、必要に応じて重複説明は省略される。   Hereinafter, specific embodiments to which the present invention is applied will be described in detail with reference to the drawings. In the drawings, the same elements are denoted by the same reference numerals, and redundant description is omitted as necessary for the sake of clarity.

<発明の実施の形態>
本実施の形態にかかる安全制御装置1は、サービスロボットや運輸機器等に搭載されて機能安全確保のための安全制御を実行する。安全制御装置1は、安全関連アプリケーションと非安全関連アプリケーションを同一のコンピュータシステムで実行するよう構成される。図1は、本実施の形態にかかる安全制御装置1の構成例を示すブロック図である。
<Embodiment of the Invention>
The safety control device 1 according to the present embodiment is mounted on a service robot, a transportation device, or the like, and executes safety control for ensuring functional safety. The safety control device 1 is configured to execute a safety-related application and a non-safety-related application on the same computer system. FIG. 1 is a block diagram illustrating a configuration example of the safety control device 1 according to the present embodiment.

プロセッサ10は、プログラム(命令ストリーム)の取得、命令のデコード、命令のデコード結果に応じた演算処理を行う。なお、図1では、1つのプロセッサ10のみを示しているが、安全制御装置1は、複数のプロセッサ10を有するマルチプロセッサ構成であってもよい。また、プロセッサ10は、マルチコアプロセッサでもよい。プロセッサ10は、システムプログラムとしてのオペレーティングシステム(OS)100を実行することによりマルチプログラミング環境を提供する。マルチプログラミング環境とは、複数のプログラムを定期的に切り替えて実行したり、あるイベントの発生に応じて実行するプログラムを切り替えたりすることによって、複数のプログラムがあたかも並列実行されているような環境を意味する。   The processor 10 performs calculation processing according to acquisition of a program (instruction stream), instruction decoding, and instruction decoding result. Although only one processor 10 is shown in FIG. 1, the safety control device 1 may have a multiprocessor configuration having a plurality of processors 10. The processor 10 may be a multi-core processor. The processor 10 provides a multiprogramming environment by executing an operating system (OS) 100 as a system program. A multi-programming environment is an environment in which multiple programs are executed in parallel by periodically switching and executing multiple programs, or by switching the programs to be executed in response to the occurrence of a certain event. means.

マルチプログラミングは、マルチプロセス、マルチスレッド、マルチタスク等と呼ばれる場合もある。プロセス、スレッド及びタスクは、マルチプログラミング環境で並列実行されるプログラム単位を意味する。本実施の形態のプロセッサ10が具備するマルチプログラミング環境は、マルチプロセス環境でもよいし、マルチスレッド環境でもよい。   Multiprogramming is sometimes called multiprocess, multithread, multitask, and the like. A process, a thread, and a task mean a program unit that is executed in parallel in a multiprogramming environment. The multi-programming environment included in the processor 10 of the present embodiment may be a multi-process environment or a multi-thread environment.

実行用メモリ11は、プロセッサ10によるプログラム実行のために使用されるメモリである。実行用メモリ11には、不揮発性メモリ13からロードされたプログラム(OS100及びアプリケーション101〜105等)、プロセッサ10の入出力データ等が記憶される。なお、プロセッサ10は、プログラムを不揮発性メモリ13から実行用メモリ11にロードすることなく、これらのプログラムを不揮発性メモリ13から直接実行してもよい。   The execution memory 11 is a memory used for program execution by the processor 10. The execution memory 11 stores programs loaded from the nonvolatile memory 13 (OS 100 and applications 101 to 105, etc.), input / output data of the processor 10, and the like. The processor 10 may directly execute these programs from the nonvolatile memory 13 without loading the programs from the nonvolatile memory 13 to the execution memory 11.

具体的には、実行用メモリ11は、SRAM(Static Random Access Memory)、DRAM(Dynamic Random Access Memory)等のランダムアクセス可能な揮発性メモリとすればよい。図1の実行用メモリ11は、論理的な構成単位を示している。すなわち、実行用メモリ11は、例えば、複数のSRAMデバイスの組み合わせ、複数のDRAMデバイスの組み合わせ、又はSRAMデバイスとDRAMデバイスの組み合わせでもよい。   Specifically, the execution memory 11 may be a random accessible volatile memory such as SRAM (Static Random Access Memory) or DRAM (Dynamic Random Access Memory). The execution memory 11 in FIG. 1 represents a logical unit. That is, the execution memory 11 may be, for example, a combination of a plurality of SRAM devices, a combination of a plurality of DRAM devices, or a combination of an SRAM device and a DRAM device.

I/Oポート12は、外部デバイスとの間のデータ送受信に使用される。例えば、安全制御装置1がサービスロボットに搭載される場合であれば、外部デバイスは、各種センサ及びサービスロボットを動作させるアクチュエータ等である。この場合、各種センサは、例えば、サービスロボット周囲の障害物を計測可能な視覚センサ、サービスロボットの姿勢を検知するための姿勢センサ、及びサービスロボットのアクチュエータの状態を検知するための回転センタ等のサービスロボットの内外の状態を検出するセンサを含む。   The I / O port 12 is used for data transmission / reception with an external device. For example, when the safety control device 1 is mounted on a service robot, the external device is various sensors and actuators that operate the service robot. In this case, the various sensors include, for example, a visual sensor capable of measuring obstacles around the service robot, a posture sensor for detecting the posture of the service robot, and a rotation center for detecting the state of the actuator of the service robot. It includes a sensor that detects the internal and external status of the service robot.

不揮発性メモリ13は、電力の供給を受けることなく、実行用メモリ11に比べて安定的に記憶内容を維持することが可能なメモリデバイスである。例えば、不揮発性メモリ13は、ROM(Read Only Memory)、フラッシュメモリ、ハードディスクドライブ若しくは光ディスクドライブ、又はこれらの組み合わせである。不揮発性メモリ13は、OS100及びアプリケーション101〜105を格納する。なお、不揮発性メモリ13の少なくとも一部は安全制御装置1から取り外し可能に構成されてもよい。例えば、アプリケーション101〜103が格納されたメモリを取り外し可能としてもよい。また、不揮発性メモリ13の少なくとも一部は、安全制御装置1の外部に配置されてもよい。   The non-volatile memory 13 is a memory device capable of maintaining stored contents more stably than the execution memory 11 without receiving power supply. For example, the nonvolatile memory 13 is a ROM (Read Only Memory), a flash memory, a hard disk drive or an optical disk drive, or a combination thereof. The nonvolatile memory 13 stores the OS 100 and the applications 101 to 105. Note that at least a part of the nonvolatile memory 13 may be configured to be removable from the safety control device 1. For example, the memory storing the applications 101 to 103 may be removable. Further, at least a part of the nonvolatile memory 13 may be disposed outside the safety control device 1.

EEPROM(Electrically Erasable Programmable Read-Only Memory)14は、電力の供給を受けることなく、実行用メモリ11に比べて安定的に記憶内容を維持することが可能なメモリデバイスである。EEPROM14は、アプリケーション101〜103によって、データWrite用アプリケーション104、105を介してログが格納される。EEPROM14は、安全関連アプリケーション101、103(安全関連系タスク)のログが格納される領域と、非安全関連アプリケーション102(非安全関連系タスク)のログが格納される領域とを含む。なお、アプリケーション101〜103によって、ログが格納される記憶装置として、EEPROM14以外に、フラッシュメモリ等のその他の不揮発性メモリを使用するようにしてもよい。また、本実施の形態では、EEPROM14にログが格納される場合について例示するが、EEPROM14に格納されるデータは、ログに限られない。   An EEPROM (Electrically Erasable Programmable Read-Only Memory) 14 is a memory device capable of maintaining stored contents more stably than the execution memory 11 without receiving power supply. In the EEPROM 14, logs are stored by the applications 101 to 103 through the data write applications 104 and 105. The EEPROM 14 includes an area in which logs of safety-related applications 101 and 103 (safety-related tasks) are stored and an area in which logs of non-safety-related applications 102 (non-safety-related tasks) are stored. Note that the applications 101 to 103 may use other nonvolatile memories such as a flash memory in addition to the EEPROM 14 as a storage device for storing logs. In the present embodiment, the case where a log is stored in the EEPROM 14 is illustrated, but the data stored in the EEPROM 14 is not limited to the log.

OS100は、プロセッサ10によって実行されることにより、プロセッサ10及び実行用メモリ11及び不揮発性メモリ13等のハードウェア資源を利用して、タスクスケジューリングを含むタスク管理、割り込み管理、時間管理、資源管理、タスク間同期およびタスク間通信機構の提供等を行う。   The OS 100 is executed by the processor 10 to use task resources including task scheduling, interrupt management, time management, resource management using hardware resources such as the processor 10, the execution memory 11, and the nonvolatile memory 13. Provides inter-task synchronization and inter-task communication mechanism.

さらに、機能安全の確保に関連する安全監視アプリケーション101及び安全制御アプリケーション103の通常制御アプリケーション102からの独立性を高めるため、OS100は、ハードウェア資源を、時間的および空間的に保護する機能を有する。ここで、ハードウェア資源とは、プロセッサ10、実行用メモリ11、I/Oポート12を含む。   Further, in order to increase the independence of the safety monitoring application 101 and the safety control application 103 related to ensuring functional safety from the normal control application 102, the OS 100 has a function of protecting hardware resources temporally and spatially. . Here, the hardware resources include the processor 10, the execution memory 11, and the I / O port 12.

このうち、時間的な保護は、プロセッサ10の実行時間という時間的な資源をパーティショニングすることにより行う。具体的に述べると、時間的な保護は、プロセッサ10の実行時間をパーティショニングし、各パーティション(タイムパーティションと呼ぶ)にタスク(プロセス又はスレッド)を割り当てることにより行う。OS100のスケジューリング機能(パーティションスケジューラ21)は、各タイムパーティション(以下、TPと略称する場合がある。)に割り当てられたタスクに対して、プロセッサ10の実行時間を含む資源の利用を保証する。   Of these, temporal protection is performed by partitioning a temporal resource called the execution time of the processor 10. Specifically, temporal protection is performed by partitioning the execution time of the processor 10 and assigning a task (process or thread) to each partition (referred to as a time partition). The scheduling function (partition scheduler 21) of the OS 100 guarantees the use of resources including the execution time of the processor 10 for tasks assigned to each time partition (hereinafter sometimes referred to as TP).

図2は、タイム・パーティショニングに関する概念図である。図2の例では、予め定められた1サイクル時間を3つのTP1、TP2及びTP3に分割する例を示している。例えば、1サイクル時間を100Tickとした場合、このうち前半の20TickがTP1、中間の30TickがTP2、後半の50TickがTP3と規定される。   FIG. 2 is a conceptual diagram related to time partitioning. In the example of FIG. 2, an example in which a predetermined cycle time is divided into three TP1, TP2, and TP3 is shown. For example, when one cycle time is 100 Tick, the first 20 Tick is defined as TP1, the middle 30 Tick is defined as TP2, and the second 50 Tick is defined as TP3.

また、図2の例では、第1アプリケーション(APL1)〜第4アプリケーション(APL4)が、TP1〜TP3のいずれかに割り当てられている。OS100のスケジューリング機能(パーティションスケジューラ21)は、時間の経過に応じて、TP1〜TP3のいずれをアクティブにするかを選択・決定する。そして、アクティブなTPに割り当てられているアプリケーションが、プロセッサ10で実行される。   In the example of FIG. 2, the first application (APL1) to the fourth application (APL4) are assigned to any one of TP1 to TP3. The scheduling function (partition scheduler 21) of the OS 100 selects / determines which of TP1 to TP3 is activated as time elapses. Then, the application assigned to the active TP is executed by the processor 10.

一方、空間的な保護は、実行用メモリ11及びI/Oポート12を含む固定的な資源をパーティショニングし、各パーティション(リソースパーティションと呼ぶ)にタスクを割り当てることにより行う。OS100のスケジューリング機能(パーティションスケジューラ21)は、予め割り当てられたリソースパーティション(以下、RPと略称する場合がある。)を超えてタスクが他のリソースにアクセスすることを禁止する。   On the other hand, spatial protection is performed by partitioning fixed resources including the execution memory 11 and the I / O port 12 and assigning tasks to each partition (referred to as a resource partition). The scheduling function (partition scheduler 21) of the OS 100 prohibits a task from accessing other resources beyond a pre-assigned resource partition (hereinafter sometimes referred to as RP).

図3は、リソース・パーティショニングに関する概念図である。図3の例では、2つのRP(RP1及びRP2)を示している。RP1には、実行用メモリ11及び不揮発性メモリ13の一部(A領域)と、I/Oポート12の一部(ポートA)が割り当てられている。また、RP2には、実行用メモリ11及び不揮発性メモリ13の他の一部(B領域)と、I/Oポート12の他の一部(ポートB)が割り当てられている。RP1からはRP2に割り当てられたリソースへのアクセスが禁止され、RP2からはRP1に割り当てられたリソースへのアクセスが禁止される。   FIG. 3 is a conceptual diagram related to resource partitioning. In the example of FIG. 3, two RPs (RP1 and RP2) are shown. A part of the execution memory 11 and the nonvolatile memory 13 (A area) and a part of the I / O port 12 (port A) are allocated to RP1. Further, another part (B area) of the execution memory 11 and the nonvolatile memory 13 and another part (port B) of the I / O port 12 are allocated to RP2. Access from RP1 to the resource assigned to RP2 is prohibited, and access from RP2 to the resource assigned to RP1 is prohibited.

なお、全てのリソースがいずれかのRPに排他的に割り当てられる必要はない。つまり、複数のRPによって共有されるリソースがあってもよい。例えば、サービスロボットの安全制御を行う場合、アクチュエータには、通常制御アプリケーション102及び安全制御アプリケーション103の双方からアクセスできる必要がある。よって、通常制御アプリケーション102が属するRPと安全制御アプリケーション103が属するRPによって、アクチュエータを制御するためのI/Oポートを共有するとよい。   Note that not all resources need to be exclusively assigned to any RP. That is, there may be a resource shared by a plurality of RPs. For example, when performing safety control of a service robot, the actuator needs to be accessible from both the normal control application 102 and the safety control application 103. Therefore, the I / O port for controlling the actuator may be shared by the RP to which the normal control application 102 belongs and the RP to which the safety control application 103 belongs.

図1に戻り説明を続ける。アプリケーション101〜105は、OS100及びプロセッサ10によって提供されるマルチプログラミング環境で実行される。このうち、安全監視アプリケーション101は、通常制御アプリケーション102の実行状況の監視と、安全制御アプリケーション103の実行状況の監視と、I/Oポート12への入出力データの監視と、をプロセッサ10に実行させるための命令コードを含む。さらに、安全監視アプリケーション101は、パーティションスケジューラ21への結果通知をプロセッサ10に実行させるための命令コードを含む。さらに、安全関連アプリケーション101は、ログの生成と、データWrite用アプリケーション105に対するログのEEPROM14への格納の要求と、をプロセッサ10に実行させるための命令コードを含む。つまり、安全監視アプリケーション101は、安全関連アプリケーションである。   Returning to FIG. The applications 101 to 105 are executed in a multiprogramming environment provided by the OS 100 and the processor 10. Among these, the safety monitoring application 101 executes the processor 10 to monitor the execution status of the normal control application 102, monitor the execution status of the safety control application 103, and monitor input / output data to the I / O port 12. Instruction code to make it Further, the safety monitoring application 101 includes an instruction code for causing the processor 10 to execute a result notification to the partition scheduler 21. Further, the safety-related application 101 includes an instruction code for causing the processor 10 to execute log generation and a request for storing the log in the EEPROM 14 for the data write application 105. That is, the safety monitoring application 101 is a safety related application.

また、通常制御アプリケーション102は、サービスロボット等の制御対象に通常の機能・動作を行わせるための制御手順をプロセッサ10に実行させるための命令コードを含む。さらに、通常制御アプリケーション102は、パーティションスケジューラ21への結果通知をプロセッサ10に実行させるための命令コードを含む。さらに、通常制御アプリケーション102は、ログの生成と、データWrite用アプリケーション106に対するログのEEPROM14への格納の要求と、をプロセッサ10に実行させるための命令コードを含む。つまり、通常制御アプリケーション102は、非安全関連アプリケーションである。   Further, the normal control application 102 includes an instruction code for causing the processor 10 to execute a control procedure for causing a control target such as a service robot to perform a normal function / operation. Further, the normal control application 102 includes an instruction code for causing the processor 10 to execute a result notification to the partition scheduler 21. Further, the normal control application 102 includes an instruction code for causing the processor 10 to execute generation of a log and a request for storing the log in the EEPROM 14 to the data write application 106. That is, the normal control application 102 is a non-safety related application.

また、安全制御アプリケーション103は、何らかの異常が検出された場合に対応して、機能安全を確保するために定められた制御手順をプロセッサ10に実行させるための命令コードを含む。さらに、安全制御アプリケーション103は、パーティションスケジューラ21への結果通知をプロセッサ10に実行させるための命令コードを含む。さらに、安全制御アプリケーション103は、ログの生成と、データWrite用アプリケーション105に対するログのEEPROM14への格納の要求と、をプロセッサ10に実行させるための命令コードを含む。つまり、安全制御アプリケーション103は、安全関連アプリケーションである。   Further, the safety control application 103 includes an instruction code for causing the processor 10 to execute a control procedure determined to ensure functional safety in response to a case where some abnormality is detected. Further, the safety control application 103 includes an instruction code for causing the processor 10 to execute a result notification to the partition scheduler 21. Further, the safety control application 103 includes an instruction code for causing the processor 10 to execute generation of a log and a request for storing the log in the EEPROM 14 for the data write application 105. That is, the safety control application 103 is a safety-related application.

また、データWrite用アプリケーション105は、安全関連アプリケーション101、103からの要求に応じたログのEEPROM14への格納をプロセッサ10に実行させるための命令コードを含む。   The data write application 105 includes an instruction code for causing the processor 10 to store a log in the EEPROM 14 in response to a request from the safety-related applications 101 and 103.

また、データWrite用アプリケーション106は、非安全関連アプリケーション102からの要求に応じたログのEEPROM14への格納をプロセッサ10に実行させるための命令コードを含む。   Further, the data write application 106 includes an instruction code for causing the processor 10 to store a log in the EEPROM 14 in response to a request from the non-safety related application 102.

リセット回路15は、OS100からの信号に基づき、マイクロコントローラ20のリセットを行う。パーティションスケジューラ21からリセット回路15に定期的に送信信号を送信するようにし、リセット回路15は、所定の時間の間、パーティションスケジューラ21からの送信信号が途絶えた場合に、マイクロコントローラ20をリセットする。すなわち、リセット回路15は、ウォッチドッグタイマーとして機能する。例えば、パーティションスケジューラ21は、後述するように、1Tickごとに動作するタイミングでリセット回路15に送信信号を送信する。そして、パーティションスケジューラ21は、OS100で異常を検知した場合、又は、アプリケーション101〜103のいずれかから異常を示す結果通知を受けた場合に、リセット回路15への送信信号の送信を停止する。これによって、所定の時間の経過後に、リセット回路15がマイクロコントローラ20をリセットする。   The reset circuit 15 resets the microcontroller 20 based on a signal from the OS 100. A transmission signal is periodically transmitted from the partition scheduler 21 to the reset circuit 15, and the reset circuit 15 resets the microcontroller 20 when the transmission signal from the partition scheduler 21 is interrupted for a predetermined time. That is, the reset circuit 15 functions as a watch dog timer. For example, as will be described later, the partition scheduler 21 transmits a transmission signal to the reset circuit 15 at a timing of operating every 1 tick. When the partition scheduler 21 detects an abnormality in the OS 100 or receives a result notification indicating an abnormality from any of the applications 101 to 103, the partition scheduler 21 stops transmission of a transmission signal to the reset circuit 15. Thus, the reset circuit 15 resets the microcontroller 20 after a predetermined time has elapsed.

また、OS100で異常を検知した場合、又は、アプリケーション101〜105のいずれかから異常を示す結果通知を受けた場合に、パーティションスケジューラ21がリセット回路15にリセット信号を送信するようにして、それに応じて、リセット回路15がマイクロコントローラ20をリセットするようにしてもよい。このようにすることで、マイクロコントローラ20に不具合が発生した場合に、マイクロコントローラ20をリセットして復旧することができる。   Further, when an abnormality is detected by the OS 100 or when a result notification indicating an abnormality is received from any of the applications 101 to 105, the partition scheduler 21 transmits a reset signal to the reset circuit 15, and accordingly Thus, the reset circuit 15 may reset the microcontroller 20. By doing in this way, when a malfunction occurs in the microcontroller 20, the microcontroller 20 can be reset and recovered.

続いて以下では、パーティションスケジューラ21と、アプリケーション101〜105の起動により生成されるタスクと、の関係について、図4を用いて説明する。図4は、OS100によって提供されるマルチプログラミング環境で起動される、パーティションスケジューラ21とタスク24、26、28、29、30との関係を示す図である。   Subsequently, the relationship between the partition scheduler 21 and the tasks generated by the activation of the applications 101 to 105 will be described with reference to FIG. FIG. 4 is a diagram showing the relationship between the partition scheduler 21 and tasks 24, 26, 28, 29, and 30 that are activated in the multiprogramming environment provided by the OS 100.

マイクロコントローラ20は、プロセッサ10、実行用メモリ11、I/Oポート12、不揮発性メモリ13等を含む。なお、図4では、マイクロコントローラ20の外部にリセット回路15を備える構成を例示しているが、マイクロコントローラ20の内部にリセット回路15を含む構成としてもよい。   The microcontroller 20 includes a processor 10, an execution memory 11, an I / O port 12, a nonvolatile memory 13, and the like. 4 illustrates a configuration in which the reset circuit 15 is provided outside the microcontroller 20, but a configuration in which the reset circuit 15 is included in the microcontroller 20 may be employed.

マイクロコントローラ20には、外部のクロック源からのクロック信号が供給され、プロセッサ10等は、このクロック信号に基づく所定のタイマー周期で動作する。本実施の形態では、所定のタイマー周期を、1Tickであるとして説明する。このため、プロセッサ10によりOS100が実行されることで、パーティションスケジューラ21が1Tickごとに動作すると共に、各TPにおいて、タスクスケジューラ23、25、27およびタスク(安全監視タスク24、通常制御タスク26、安全制御タスク28、データWrite用タスク29、30)が1Tickごとに動作する。   The microcontroller 20 is supplied with a clock signal from an external clock source, and the processor 10 and the like operate at a predetermined timer cycle based on this clock signal. In the present embodiment, the predetermined timer cycle is described as 1 Tick. For this reason, when the processor 10 executes the OS 100, the partition scheduler 21 operates every 1 Tick, and at each TP, the task schedulers 23, 25, 27 and tasks (safety monitoring task 24, normal control task 26, safety The control task 28 and the data write tasks 29 and 30) operate every 1 tick.

パーティションスケジューラ21は、1Tickごとに動作し、TPの切り替え(パーティション・スケジューリング)を行う。パーティションスケジューラ21は、次の1Tickの間にTP1〜TP3のいずれをアクティブにするかを選択・決定する。さらに、パーティションスケジューラ21は、選択したTPに関するタスクスケジューラの動作を開始させる。   The partition scheduler 21 operates every 1 tick and performs TP switching (partition scheduling). The partition scheduler 21 selects and determines which of TP1 to TP3 is activated during the next 1 Tick. Furthermore, the partition scheduler 21 starts the operation of the task scheduler related to the selected TP.

パーティションスケジューラ21によるパーティション・スケジューリングについて具体的に述べると、パーティションスケジューラ21は、スケジューリングテーブル22を参照し、TPの設定を定めたスケジューリングパターンに従って、パーティション・スケジューリングを行う。   More specifically, partition scheduling by the partition scheduler 21 refers to the scheduling table 22 and performs partition scheduling according to a scheduling pattern that defines TP settings.

スケジューリングテーブル22は、TPの切り替え順序およびタイミングを規定したスケジューリングパターンを保持している。スケジューリングテーブル22は、例えば、実行用メモリ11に予め格納されている。なお、スケジューリングテーブル22は、少なくとも2つの異なるスケジューリングパターンを保持している。1つは、安全監視タスク24による異常検知が行われていない場合(つまり通常時)に適用されるスケジューリングパターンである。もう1つは、安全監視タスク24によって異常が検知された場合に適用されるスケジューリングパターンである。以下では、通常時に適用されるスケジューリングパターンを"通常制御スケジューリングパターン"と呼ぶ。また、異常検知時に適用されるスケジューリングパターンを"安全制御スケジューリングパターン"と呼ぶ。   The scheduling table 22 holds a scheduling pattern that defines the TP switching order and timing. For example, the scheduling table 22 is stored in advance in the execution memory 11. The scheduling table 22 holds at least two different scheduling patterns. One is a scheduling pattern that is applied when abnormality detection by the safety monitoring task 24 is not performed (that is, during normal time). The other is a scheduling pattern applied when an abnormality is detected by the safety monitoring task 24. Hereinafter, the scheduling pattern applied in the normal time is referred to as “normal control scheduling pattern”. A scheduling pattern applied at the time of detecting an abnormality is called a “safe control scheduling pattern”.

図5Aは、通常制御スケジューリングパターンの具体例を示している。図5Aでは、通常制御タスク26が属するTP2が1サイクル時間の前半(T1)に割り当てられている。また、安全監視タスク24が属するTP1が1サイクル時間の後半(T2)に割り当てられている。図5Aのスケジューリングパターンによれば、通常制御タスク26と安全監視タスク24が繰り返しスケジューリングされる。   FIG. 5A shows a specific example of the normal control scheduling pattern. In FIG. 5A, TP2 to which the normal control task 26 belongs is assigned to the first half (T1) of one cycle time. In addition, TP1 to which the safety monitoring task 24 belongs is assigned to the second half (T2) of one cycle time. According to the scheduling pattern of FIG. 5A, the normal control task 26 and the safety monitoring task 24 are repeatedly scheduled.

図5Bは、安全制御スケジューリングパターンの具体例を示している。図5Bでは、安全制御タスク28が属するTP3が1サイクル時間の前半(T3)に割り当てられている。また、安全監視タスク24が属するTP1が1サイクル時間の後半(T4)に割り当てられている。図5Bのスケジューリングパターンによれば、安全制御タスク28と安全監視タスク24が繰り返しスケジューリングされる。   FIG. 5B shows a specific example of the safety control scheduling pattern. In FIG. 5B, TP3 to which the safety control task 28 belongs is assigned to the first half (T3) of one cycle time. In addition, TP1 to which the safety monitoring task 24 belongs is assigned to the second half (T4) of one cycle time. According to the scheduling pattern of FIG. 5B, the safety control task 28 and the safety monitoring task 24 are repeatedly scheduled.

図4に戻り説明を続ける。タスクスケジューラ23、25、27は、それぞれが属するTP内でのタスクのスケジューリングを行う。各TP内でのタスクのスケジューリングには、一般的な優先度ベースのスケジューリングを適用すればよい。なお、図4では、TP1は3つのタスクを含み、TP2及びTP3はそれぞれ1つのタスクのみを含むものとして図示しているが、それ以外のタスクが含まれるようにしてもよい。例えば、通常制御用のTP2内には、通常制御タスクA及び通常制御タスクBの2つのタスクが含まれていてもよい。   Returning to FIG. The task schedulers 23, 25, and 27 perform task scheduling in the TP to which each belongs. For scheduling tasks in each TP, general priority-based scheduling may be applied. In FIG. 4, TP1 is illustrated as including three tasks, and TP2 and TP3 are illustrated as including only one task, but other tasks may be included. For example, the normal control task A and the normal control task B may be included in the normal control TP2.

安全監視タスク24は、安全監視アプリケーション101の起動によって生成されるタスクである。図4の例では、安全監視タスク24は、TP1及びRP1に割り当てられている。安全監視タスク24は、非安全関連アプリケーションである通常制御タスク26の実行状況の監視と、安全関連アプリケーションである安全制御タスク28の実行状況の監視と、I/Oポート12の入出力データを監視する。さらに、安全監視タスク24は、タスクの実行状況を、パーティションスケジューラ21へ通知する。さらに、安全監視タスク24は、自身の処理に応じたログを生成して、生成したログのEEPROM14への格納をデータWrite用タスク29に要求する。安全監視タスク24は、自身が属するRP1に割り当てられた実行用メモリ11のリソースを使用しながら、自身の処理を実行するために必要な演算等を行う。   The safety monitoring task 24 is a task generated when the safety monitoring application 101 is activated. In the example of FIG. 4, the safety monitoring task 24 is assigned to TP1 and RP1. The safety monitoring task 24 monitors the execution status of the normal control task 26 that is a non-safety related application, monitors the execution status of the safety control task 28 that is a safety related application, and monitors input / output data of the I / O port 12. To do. Furthermore, the safety monitoring task 24 notifies the partition scheduler 21 of the task execution status. Further, the safety monitoring task 24 generates a log corresponding to its own process, and requests the data write task 29 to store the generated log in the EEPROM 14. The safety monitoring task 24 performs calculations necessary for executing its own processing while using the resources of the execution memory 11 assigned to the RP1 to which the safety monitoring task 24 belongs.

通常制御タスク26は、通常制御アプリケーション102の起動によって生成されるタスクである。図4の例では、通常制御タスク26は、TP2及びRP2に割り当てられている。通常制御タスク26は、サービスロボット等の制御対象に通常の機能・動作を行わせるための制御を行う。さらに、通常制御タスク26は、タスクの実行状況を、パーティションスケジューラ21へ通知する。さらに、通常制御タスク26は、自身の処理に応じたログを生成して、生成したログのEEPROM14への格納をデータWrite用タスク30に要求する。通常制御タスク26は、自身が属するRP2に割り当てられた実行用メモリ11のリソースを使用しながら、自身の処理を実行するために必要な演算等を行う。   The normal control task 26 is a task generated when the normal control application 102 is activated. In the example of FIG. 4, the normal control task 26 is assigned to TP2 and RP2. The normal control task 26 performs control for causing a control target such as a service robot to perform a normal function / operation. Further, the normal control task 26 notifies the partition scheduler 21 of the task execution status. Further, the normal control task 26 generates a log corresponding to its own process, and requests the data write task 30 to store the generated log in the EEPROM 14. The normal control task 26 performs calculations necessary for executing its own processing while using the resources of the execution memory 11 assigned to the RP 2 to which the normal control task 26 belongs.

安全制御タスク28は、安全制御アプリケーション103の起動によって生成されるタスクである。図4の例では、安全制御タスク28は、TP3及びRP3に割り当てられている。安全制御タスク28は、何らかの異常が検出された場合に対応して、機能安全を確保するために定められた制御を行う。さらに、安全制御タスク28は、タスクの実行状況を、パーティションスケジューラ21へ通知する。さらに、安全制御タスク28は、自身の処理に応じたログを生成して、生成したログのEEPROM14への格納をデータWrite用タスク29に要求する。安全制御タスク28は、自身が属するRP3に割り当てられた実行用メモリ11のリソースを使用しながら、自身の処理を実行するために必要な演算等を行う。   The safety control task 28 is a task generated when the safety control application 103 is activated. In the example of FIG. 4, the safety control task 28 is assigned to TP3 and RP3. The safety control task 28 performs control determined to ensure functional safety in response to any abnormality being detected. Further, the safety control task 28 notifies the partition scheduler 21 of the task execution status. Further, the safety control task 28 generates a log corresponding to its own processing, and requests the data write task 29 to store the generated log in the EEPROM 14. The safety control task 28 performs calculations necessary for executing its own processing while using the resources of the execution memory 11 assigned to the RP 3 to which the safety control task 28 belongs.

なお、各タスクからパーティションスケジューラ21へと結果を通知する具体的な構成としては、様々な手法を採用することができる。例えば、タスクがOS100のシステムコール(サービスコール)を呼び出し、OS100を介して、パーティションスケジューラ21に結果を通知することができる。また、例えば、タスクの実行状況に関するフラグを実行用メモリ11に格納するものとして、タスクがその実行状況に応じてフラグの値を設定し、パーティションスケジューラ21がフラグの設定値に応じてタスクの実行状況を判断することもできる。   Various methods can be adopted as a specific configuration for notifying the result from each task to the partition scheduler 21. For example, a task can call a system call (service call) of the OS 100 and notify the partition scheduler 21 of the result via the OS 100. Also, for example, assuming that a flag related to the task execution status is stored in the execution memory 11, the task sets a flag value according to the execution status, and the partition scheduler 21 executes the task according to the flag set value. The situation can also be judged.

上述したように、パーティションスケジューラ21が1Tickごとに動作し、TP1〜TP3のいずれをアクティブにするかを選択・決定する。さらに、パーティションスケジューラ21が、選択したTPに関するタスクスケジューラの動作を開始させる。そして、タスクスケジューラ23、25、27が動作を開始することでタスクのスケジューリングが行われ、プロセッサ10が、タスクスケジューラ23、25、27によりスケジューリングされた順序に従って、TP内でのタスクを実行していく。これによって、アクティブなTPに割り当てられているアプリケーションが、プロセッサ10で実行される。   As described above, the partition scheduler 21 operates every 1 Tick, and selects and determines which of TP1 to TP3 is activated. Further, the partition scheduler 21 starts the operation of the task scheduler related to the selected TP. Then, task scheduling is performed by the task schedulers 23, 25, and 27 starting operations, and the processor 10 executes the tasks in the TP according to the order scheduled by the task schedulers 23, 25, and 27. Go. As a result, the application assigned to the active TP is executed by the processor 10.

データWrite用タスク29は、安全関連系タスク24、28からの要求に応じて、安全関連系タスク24、28が生成したログをEEPROM14に格納する。図4の例では、データWrite用タスク29は、TP1及びRP1に割り当てられている。データWrite用タスク29は、自身が属するRP1に割り当てられた実行用メモリ11のリソースを使用しながら、自身の処理を実行するために必要な演算等を行う。   The data write task 29 stores the logs generated by the safety-related tasks 24 and 28 in the EEPROM 14 in response to requests from the safety-related tasks 24 and 28. In the example of FIG. 4, the data write task 29 is assigned to TP1 and RP1. The data write task 29 performs calculations necessary for executing its own processing while using the resources of the execution memory 11 assigned to the RP1 to which the data write belongs.

データWrite用タスク30は、非安全関連系タスク26からの要求に応じて、非安全関連系タスク26が生成したログをEEPROM14に格納する。図4の例では、データWrite用タスク30は、TP1及びRP1に割り当てられている。データWrite用タスク29は、自身が属するRP1に割り当てられた実行用メモリ11のリソースを使用しながら、自身の処理を実行するために必要な演算等を行う。   The data write task 30 stores the log generated by the non-safety related task 26 in the EEPROM 14 in response to a request from the non-safety related task 26. In the example of FIG. 4, the data write task 30 is assigned to TP1 and RP1. The data write task 29 performs calculations necessary for executing its own processing while using the resources of the execution memory 11 assigned to the RP1 to which the data write belongs.

ここで、データWrite用タスク29、30が割り当てられるTP及びRPは、図4に例示した場合に限られない。例えば、安全関連のTP1、TP3に限られず、非安全関連のTP2に属するようにしてもよく、データWrite用タスク29、30のみが属するデータWrite用のTPを用意して、それに属するようにしてもよい。なお、常にログの保存を可能とするためには、図5A及び図5Bで例示するTP1のように、通常制御スケジューリングパターン及び安全制御スケジューリングパターンのいずれのスケジューリングパターンにおいても、アクティブとなるTPで動作するようにすることが好ましい。   Here, the TP and RP to which the data write tasks 29 and 30 are assigned are not limited to the case illustrated in FIG. For example, it is not limited to safety-related TP1 and TP3, but may belong to non-safety-related TP2, and a data write TP to which only the data write tasks 29 and 30 belong is prepared and belong to it. Also good. In order to always allow log storage, the TP1 that is active in both the normal control scheduling pattern and the safety control scheduling pattern, such as TP1 illustrated in FIGS. 5A and 5B, operates. It is preferable to do so.

ここで、各タスク24、26、28は、ログとして、それぞれの処理に応じた内容のデータを生成する。安全監視タスク24は、例えば、上述したような監視における監視内容等を示すデータをログとして生成する。すなわち、監視の結果、何らかの異常が検出された場合には、安全監視タスク24は、その異常原因に関するデータをログとして生成することになる。具体的には、安全監視タスク24は、ログとして、I/Oポート12を介して各種センサから取得したセンサ値及びセンサ値に基づいて算出した値等を生成する。例えば、通常制御タスク26又は安全制御タスク28からI/Oポート12を介して制御対象に対して出力された出力データ値、視覚センサから取得した画像データ、視覚センサから取得した画像データに基づいて算出した障害物までの距離、姿勢センサから取得した制御対象の姿勢を示す値、回転センサから取得した制御対象のアクチュエータの状態を示す値、及び、制御対象又はマイクロコントローラ20における回路の電流値等を示すデータである。また、通常制御タスク26及び安全制御タスク28のそれぞれは、例えば、制御対象に対する出力データの計算内容等を示すデータをログとして生成する。   Here, each of the tasks 24, 26, and 28 generates data having contents corresponding to each process as a log. The safety monitoring task 24 generates, as a log, data indicating the monitoring contents in the monitoring as described above, for example. That is, if any abnormality is detected as a result of monitoring, the safety monitoring task 24 generates data relating to the cause of the abnormality as a log. Specifically, the safety monitoring task 24 generates, as a log, a sensor value acquired from various sensors via the I / O port 12 and a value calculated based on the sensor value. For example, based on the output data value output to the control target from the normal control task 26 or the safety control task 28 via the I / O port 12, the image data acquired from the visual sensor, and the image data acquired from the visual sensor. The calculated distance to the obstacle, the value indicating the attitude of the controlled object acquired from the attitude sensor, the value indicating the state of the controlled actuator acquired from the rotation sensor, the current value of the circuit in the controlled object or the microcontroller 20, etc. It is data which shows. In addition, each of the normal control task 26 and the safety control task 28 generates, as a log, data indicating, for example, calculation contents of output data for the control target.

ここで、主に、ログに基づいた安全制御装置1の動作・制御状況の調査は、安全制御装置1において何らかの異常が検出された場合に、その異常原因を特定するために行われる。すなわち、安全監視タスク24によって採取されるログは、他のログと比較してEEPROM14に保存する優先度は高い。このように、安全関連系タスク24、28は、異常の検出及び検出した異常に応じた処理等の機能安全を確保するための処理を実行するタスクとなる。そのため、安全関連系タスク24、28が採取するログは、異常原因により強く関連したログとなるため、非安全関連系タスク26が採取するログと比較して、EEPROM14に保存する優先度は高くなる。   Here, the investigation of the operation / control state of the safety control device 1 based on the log is mainly performed to identify the cause of the abnormality when any abnormality is detected in the safety control device 1. That is, the log collected by the safety monitoring task 24 has a higher priority to be stored in the EEPROM 14 than the other logs. As described above, the safety-related tasks 24 and 28 are tasks for executing processing for ensuring functional safety such as detection of abnormality and processing according to the detected abnormality. For this reason, the logs collected by the safety-related tasks 24 and 28 are logs that are more strongly related to the cause of the abnormality, and therefore, the priority stored in the EEPROM 14 is higher than the logs collected by the non-safety-related tasks 26. .

そこで、本実施の形態では、非安全関連系タスクのログを保存するデータWrite用タスク30よりも、安全関連系タスクのログを保存するデータWrite用タスク29によるログの保存を優先的に行うことで、重要なログがより多く採取されるようにする。   Therefore, in this embodiment, the data write task 29 for storing the safety-related task log has priority to save the log over the data write task 30 for storing the non-safety-related task log. So that more important logs are collected.

続いて、図6を参照して、発明の実施の形態にかかる安全関連系タスク24、28及び非安全関連系タスク26と、データWrite用タスク29、30との関係について説明する。図6は、発明の実施の形態にかかる安全関連系タスク24、28及び非安全関連系タスク26と、データWrite用タスク29、30との関係を示す図である。   Next, the relationship between the safety-related tasks 24 and 28 and the non-safety-related tasks 26 and the data write tasks 29 and 30 according to the embodiment of the invention will be described with reference to FIG. FIG. 6 is a diagram showing the relationship between the safety-related tasks 24 and 28 and the non-safety-related tasks 26 and the data write tasks 29 and 30 according to the embodiment of the invention.

上述したように、OS100は、OS100上で動作するタスクに対してタスク間通信機能を提供する。具体的には、OS100は、OS100上で動作するタスクに対して、タスク間通信を行うためのシステムコールを提供する。   As described above, the OS 100 provides an inter-task communication function for tasks that run on the OS 100. Specifically, the OS 100 provides a system call for performing inter-task communication for a task operating on the OS 100.

安全関連系タスク24、28は、自身が生成したログをEEPROM14に格納する場合には、ログの格納を要求するログ格納要求データを、タスク間通信によってデータWrite用タスク29に送信する。これは、安全関連系タスクが、ログ格納要求データを引数として指定して、OS100によって提供されるシステムコールを呼び出すことによって行われる。なお、ログ格納要求データには、安全関連系タスクが生成したログと、そのログを格納するEEPROM14のアドレスを示すデータとが含まれる。   When storing the log generated by itself in the EEPROM 14, the safety-related tasks 24 and 28 transmit log storage request data for requesting log storage to the data write task 29 by inter-task communication. This is performed by a safety-related task specifying a log storage request data as an argument and calling a system call provided by the OS 100. The log storage request data includes a log generated by the safety-related task and data indicating the address of the EEPROM 14 that stores the log.

システムコールの呼び出しによって動作するOS100のルーチンは、安全関連系タスクによって指定されたログ格納要求データを、リクエスト用のデータキュー(DTQ)に格納する。すなわち、データキューは、「メッセージキュー」として機能する。なお、データキューは、実行用メモリ11の一部領域を利用して実現される。   The OS 100 routine that operates by calling a system call stores log storage request data specified by a safety-related task in a data queue (DTQ) for requests. That is, the data queue functions as a “message queue”. The data queue is realized by using a partial area of the execution memory 11.

データWrite用タスク29は、安全関連系タスクから送信されたログ格納要求データを、タスク間通信によって受信する。これは、データWrite用タスク29が、OS100によって提供されるシステムコールを呼び出すことによって行われる。システムコールの呼び出しによって動作するOS100のルーチンは、リクエスト用のデータキューに格納されたログ格納要求データを読み出して、データWrite用タスク29に受け渡す。具体的には、OS100のルーチンは、システムコールの戻り値として、ログ格納要求データを呼び出し元のデータWrite用タスク29に受け渡す。   The data write task 29 receives the log storage request data transmitted from the safety-related task by inter-task communication. This is performed when the data write task 29 calls a system call provided by the OS 100. The OS 100 routine that operates by calling the system call reads the log storage request data stored in the request data queue and passes it to the data write task 29. Specifically, the OS 100 routine transfers the log storage request data to the caller data write task 29 as a return value of the system call.

データWrite用タスク29は、タスク間通信によって受信したログ格納要求データに含まれるログをEEPROM14に格納する。なお、データWrite用タスク29は、そのログ格納要求データが示すEEPROM14のアドレスにログを格納する。そして、データWrite用タスク29は、EEPROM14へのログの格納結果を通知する結果通知データを、タスク間通信によってログの格納の要求元の安全関連系タスクに送信する。これは、上述と同様に、データWrite用タスク29が、結果通知データを引数として、OS100によって提供されるシステムコールを呼び出すことによって行われる。システムコールの呼び出しによって動作するOS100のルーチンは、データWrite用タスク29によって指定された結果通知データを、レスポンス用のデータキューに格納する。   The data write task 29 stores the log included in the log storage request data received by inter-task communication in the EEPROM 14. The data write task 29 stores the log at the address of the EEPROM 14 indicated by the log storage request data. Then, the data write task 29 transmits the result notification data for notifying the log storage result to the EEPROM 14 to the safety-related task that is the log storage request source by inter-task communication. As described above, this is performed by the data write task 29 calling a system call provided by the OS 100 using the result notification data as an argument. The OS 100 routine that operates by calling a system call stores the result notification data designated by the data write task 29 in the response data queue.

安全関連系タスクは、データWrite用タスク29から送信された結果通知データを、タスク間通信によって受信する。これは、上述と同様に、安全関連系タスクが、OS100によって提供されるシステムコールを呼び出すことによって行われる。システムコールの呼び出しによって動作するOS100のルーチンは、レスポンス用のデータキューに格納された結果通知データを読み出して、安全関連系タスクに受け渡す。具体的には、OS100のルーチンは、システムコールの戻り値として、結果通知データを安全関連系タスクに受け渡す。   The safety-related task receives the result notification data transmitted from the data write task 29 by inter-task communication. This is performed by a safety-related task calling a system call provided by the OS 100 as described above. The OS 100 routine that operates by calling a system call reads out the result notification data stored in the response data queue and passes it to the safety-related task. Specifically, the OS 100 routine transfers the result notification data to the safety-related task as a return value of the system call.

なお、非安全関連系タスクからデータWrite用タスク30に対して、ログの格納を要求する場合も、同様にしてタスク間通信によって行われるため、説明を省略する。   Note that when the non-safety related task requests the data write task 30 to store the log, it is performed by inter-task communication in the same manner, and thus the description thereof is omitted.

続いて以下では、パーティションスケジューラ21によるパーティション・スケジューリングについて、図7を用いて説明する。図7は、発明の実施の形態1にかかるパーティションスケジューラ21の処理手順の具体例を示すフローチャートである。   Next, partition scheduling by the partition scheduler 21 will be described with reference to FIG. FIG. 7 is a flowchart showing a specific example of the processing procedure of the partition scheduler 21 according to the first embodiment of the invention.

なお、図7では、通常制御スケジューリングパターン(例えば図5A)または安全制御スケジューリングパターン(例えば図5B)に従って、スケジューリングを実行する場合を例に説明する。すなわち、TP2またはTP3に続く次のTPはTP1であり、かつ、TP2での異常がTP1で検知された場合に、TP1からの結果を受けて次に選択・決定されるTPはTP3である場合を例に説明する。   In FIG. 7, a case where scheduling is executed according to a normal control scheduling pattern (for example, FIG. 5A) or a safety control scheduling pattern (for example, FIG. 5B) will be described as an example. That is, when the next TP following TP2 or TP3 is TP1, and when an abnormality in TP2 is detected in TP1, the next TP selected and determined based on the result from TP1 is TP3 Will be described as an example.

OS100は、1Tick経過するごとに(S11)、パーティションスケジューラ21を起動する(S12)。パーティションスケジューラ21は、スケジューリングパターンを参照して、TPの切り替えタイミングか否かを判定する(S13)。   The OS 100 starts the partition scheduler 21 every time one tick elapses (S11) (S12). The partition scheduler 21 refers to the scheduling pattern and determines whether or not it is TP switching timing (S13).

TPの切り替えタイミングでないと判定した場合(S13でNo)、パーティションスケジューラ21は、同一のTPXについての動作を継続させる。このため、TPの切り替えタイミングとなるまでの間、S11〜S13、S15、S16の処理が繰り返される。ここで、変数XはTPの番号を示し、Xは1〜3のうちのいずれかの値となる。すなわち、通常制御スケジューリングパターンに従ってパーティション・スケジューリングを実施している場合は、安全制御用のTP3を除いた、TP2及びTP1のいずれかを動作させる。   If it is determined that it is not the TP switching timing (No in S13), the partition scheduler 21 continues the operation for the same TPX. For this reason, the processes of S11 to S13, S15, and S16 are repeated until the TP switching timing is reached. Here, the variable X indicates the number of TP, and X is any one of 1 to 3. That is, when partition scheduling is performed according to the normal control scheduling pattern, either TP2 or TP1 except for TP3 for safety control is operated.

一方、TPの切り替えタイミングであると判定した場合(S13でYes)、パーティションスケジューラ21は、TPの切り替えを実行する(S14)。このように、パーティションスケジューラ21は、次にアクティブにするTPを変更する(S13でYes)場合には、さらに、切り替え前のTPに属するタスクからの通知結果に応じて、切り替え前のTPが正常であったか否かを判断する。判断の結果、切り替え前のTPが異常であった場合、パーティションスケジューラ21は、次の1Tickの間にアクティブにするTPXを、安全制御スケジューリングパターンに従って、TP1及びTP3のいずれかから選択・決定する。判断の結果、正常であった場合、パーティションスケジューラ21は、次の1Tickの間にアクティブにするTPXを、通常制御スケジューリングパターンに従って、TP1及びTP2のいずれかを選択・決定する。   On the other hand, when it is determined that it is TP switching timing (Yes in S13), the partition scheduler 21 executes TP switching (S14). As described above, when the partition scheduler 21 changes the TP to be activated next (Yes in S13), the partition TP before switching is normal according to the notification result from the task belonging to the TP before switching. It is determined whether or not. If the TP before switching is abnormal as a result of the determination, the partition scheduler 21 selects and determines the TPX to be activated during the next 1 Tick from either TP1 or TP3 according to the safety control scheduling pattern. As a result of the determination, if it is normal, the partition scheduler 21 selects and determines one of TP1 and TP2 in accordance with the normal control scheduling pattern for TPX to be activated during the next 1 Tick.

パーティションスケジューラ21は、現在アクティブになっているTPXのタスクスケジューラを動作させる(S15)。S15で動作を開始したTPXのタスクスケジューラは、TPX内のタスクを優先度に応じて実行する(S16)。   The partition scheduler 21 operates the task scheduler of the currently active TPX (S15). The task scheduler of TPX that started the operation in S15 executes the task in TPX according to the priority (S16).

そして、1Tickが経過すると(S11)、パーティションスケジューラ21が、再びTPのスケジューリングを開始する(S12)。すなわち、パーティションスケジューラ21は、スケジューリングパターンに従って、次の1Tickの間にいずれのTPをアクティブにするかを選択・決定する。   When 1 Tick elapses (S11), the partition scheduler 21 starts TP scheduling again (S12). That is, the partition scheduler 21 selects and determines which TP is to be activated during the next 1 Tick according to the scheduling pattern.

図7で示した処理に関して、パーティション・スケジューリングの具体例を説明する。まず、図5Aに例示した通常制御スケジューリングパターンに従って、S15においてTP2がアクティブの状態からスケジューリングを開始した場合を説明する。この場合、S15ではTPX=TP2として開始し、続くS16、S11〜S13にかけてもTPX=TP2のままである。そして、S13でNoが続く限り、TPX=TP2の状態が維持される。S13でYesとなり、S14でTP2からTP1へと変更された場合、続くS15〜S16、S11〜S13にかけてTP1のままである。そして、S13でNoが続く限り、TPX=TP1の状態が維持される。TP1がアクティブのときに、S16で、TP2に関する実行状況(データ入出力等)が正常であると判定されていた場合には、次のS14では、TPX=TP2となる(つまり、TP2から開始する通常制御スケジューリングパターンが継続される。)。一方で、S16で、TP2に関する実行状況(データ入出力等)が異常であると判定されていた場合には、次のS14で、TPX=TP3となる(つまり、TP3から開始する安全制御スケジューリングパターンに切り替わる。)。   A specific example of partition scheduling will be described with respect to the processing shown in FIG. First, according to the normal control scheduling pattern illustrated in FIG. 5A, the case where scheduling is started from the active state of TP2 in S15 will be described. In this case, TPX = TP2 is started in S15, and TPX = TP2 remains even in subsequent S16 and S11 to S13. And as long as No continues in S13, the state of TPX = TP2 is maintained. If S13 is Yes and TP2 is changed to TP1 in S14, TP1 remains in S15 to S16 and S11 to S13. As long as No continues in S13, the state of TPX = TP1 is maintained. When it is determined in S16 that the execution status (data input / output, etc.) related to TP2 is normal when TP1 is active, TPX = TP2 in the next S14 (that is, start from TP2). Normal control scheduling pattern continues.) On the other hand, if it is determined in S16 that the execution status (data input / output, etc.) relating to TP2 is abnormal, TPX = TP3 (that is, a safety control scheduling pattern starting from TP3) in the next S14. Switch to.)

また、図5Bに例示した安全制御スケジューリングパターンに従って、S15においてTP3がアクティブの状態からスケジューリングを開始した場合を説明する。この場合、S15ではTPX=TP3として開始し、続くS16、S11〜S13にかけてもTPX=TP3のままである。そして、S13でNoが続く限り、TPX=TP3の状態が維持される。S13でYesとなり、S14でTP3からTP1へと変更された場合、続くS15〜S16、S11〜S13にかけてTP1のままである。そして、S13でNoが続く限り、TPX=TP1の状態が維持される。TP1がアクティブのときに、S16で、TP3に関する実行状況(データ入出力等)が正常であると判定されていた場合には、次のS14では、TPX=TP2とする(つまり、TP2から開始する通常制御スケジューリングパターンに切り替わる。)。一方で、S16で、TP3に関する実行状況(データ入出力等)に異常があると判定されていた場合には、次のS14で、TPX=TP3となる(つまり、TP3から開始する安全制御スケジューリングパターンが継続される。)。   Further, a case will be described in which scheduling is started from the active state of TP3 in S15 according to the safety control scheduling pattern illustrated in FIG. 5B. In this case, TPX = TP3 is started in S15, and TPX = TP3 remains even in subsequent S16 and S11 to S13. And as long as No continues in S13, the state of TPX = TP3 is maintained. If the answer is Yes in S13 and the TP3 is changed to TP1 in S14, TP1 remains as it is in subsequent S15 to S16 and S11 to S13. As long as No continues in S13, the state of TPX = TP1 is maintained. When it is determined in S16 that the execution status (data input / output, etc.) relating to TP3 is normal when TP1 is active, TPX = TP2 is set in the next S14 (that is, starting from TP2). Switch to normal control scheduling pattern.) On the other hand, if it is determined in S16 that there is an abnormality in the execution status (data input / output, etc.) related to TP3, TPX = TP3 (that is, a safety control scheduling pattern starting from TP3) in the next S14. Will continue.)

なお、上述の例では、スケジューリングパターンとして、3つのTP(安全監視用のTP1、通常制御用のTP2、安全制御用のTP3)のみを組み合わせた場合を例に説明したが、TP2のような通常制御用パーティションや、TP3のような安全制御用パーティションについては、それぞれ複数個存在するものとしてもよい。例えば、2つの通常制御用のTP2及びTP4と、安全監視用のTP1と、2つの安全制御用のTP3及びTP5と、が存在し、これら5つのTP(TP1〜TP5)を組み合わせてスケジューリングパターンを構成してもよい。この場合、S14では、パーティションスケジューラ21が、TPXに関する実行状況(データ入出力等)の異常状態の種類を判定し、その異常種類に応じて、安全制御用のTP3またはTP5のいずれかを選択すればよい。また、S14では、通常制御用のTP2またはTP4のいずれかを選択すればよい。   In the above-described example, a case where only three TPs (safety monitoring TP1, normal control TP2 and safety control TP3) are combined as a scheduling pattern has been described as an example. There may be a plurality of control partitions and safety control partitions such as TP3. For example, there are two TP2 and TP4 for normal control, TP1 for safety monitoring, and two TP3 and TP5 for safety control, and these five TPs (TP1 to TP5) are combined to form a scheduling pattern. It may be configured. In this case, in S14, the partition scheduler 21 determines the type of the abnormal state of the execution status (data input / output, etc.) related to TPX, and selects either TP3 or TP5 for safety control according to the abnormal type. That's fine. In S14, either TP2 or TP4 for normal control may be selected.

上述したように、本実施の形態では、OS100は、安全監視用のTP1からの通知、または、各TPからの通知に応じて、次にアクティブとするパーティションを選択・決定するパーティションスケジューラ21を備えている。パーティションスケジューラ21は、各TPにおいて実行されるタスクとは独立して、所定のタイマー周期で動作する。   As described above, in this embodiment, the OS 100 includes the partition scheduler 21 that selects and determines the partition to be activated next in response to a notification from the TP1 for safety monitoring or a notification from each TP. ing. The partition scheduler 21 operates at a predetermined timer period independently of the tasks executed in each TP.

独立に動作するパーティションスケジューラ21が、全てのTPから結果通知を受ける構成とすることで、パーティションスケジューラ21は、全てのTPに関する状況を一元的に把握することができる。このため、例えば、安全監視用のTP1からの結果通知に応じて、パーティションスケジューラ21が次のパーティションを決定・選択しようとする場合には、パーティションスケジューラ21は、各TPの状況を考慮した上で、正常状態にあるTPのみから次のパーティションを決定・選択することもできる。これによれば、より正確なパーティション・スケジューリングを実現することができるという効果を奏する。   With the configuration in which the partition scheduler 21 that operates independently receives the result notification from all TPs, the partition scheduler 21 can centrally grasp the situation regarding all TPs. Therefore, for example, when the partition scheduler 21 decides and selects the next partition in response to the result notification from the safety monitoring TP1, the partition scheduler 21 considers the situation of each TP. The next partition can be determined and selected only from the TP in the normal state. According to this, there is an effect that more accurate partition scheduling can be realized.

続いて、図8を参照して、本実施の形態にかかるログ格納の処理手順について説明する。図8は、本実施の形態にかかるログ格納の処理手順を示すフローチャートである。   Next, a log storage processing procedure according to this embodiment will be described with reference to FIG. FIG. 8 is a flowchart showing a log storage processing procedure according to the present embodiment.

安全関連系タスクが、EEPROM14へのログの格納を、データWrite用タスク29に対して要求しているか否かを判定する(S21)。ここで、本実施の形態では、安全関連系タスクがEEPROM14へのログの格納を要求しているか否かが判定されるケースとして、2つのケースが存在する。   It is determined whether or not the safety related task requests the data write task 29 to store the log in the EEPROM 14 (S21). Here, in the present embodiment, there are two cases where it is determined whether or not the safety-related task requests the storage of the log in the EEPROM 14.

1つ目のケースは、データWrite用タスク29が、OS100が提供するシステムコールを呼び出すことによって、スリープして待ち状態となっているときに、OS100によって判定されるケースである。このシステムコールは、呼び出し元のタスクをスリープさせるとともに、呼び出し元のタスクに対するデータがリクエスト用のデータキューに格納されたときに、呼び出し元のタスクを起床させて、実行状態に遷移させる。   The first case is a case in which the data write task 29 is determined by the OS 100 when the data write task 29 is in a sleep state waiting by calling a system call provided by the OS 100. This system call causes the caller task to sleep, and when the data for the caller task is stored in the request data queue, the caller task is woken up and transitioned to the execution state.

したがって、安全関連系タスクがEEPROM14へのログの格納をデータWrite用タスク29に要求している場合(S21:Yes)には、OS100は、タスクスケジューラ23によって、データWrite用タスク29を起床させて、実行状態に遷移させる。実行状態に遷移して動作を開始したデータWrite用タスク29は、上述したログ格納要求データを受信するシステムコールを呼び出して、ログ格納要求データを取得する(S24)。そして、データWrite用タスク29は、取得したログ格納要求データに基づいて、安全関連系タスクのログを格納する処理(S26〜S30)を行う。一方、安全関連系タスクがEEPROM14へのログの格納をデータWrite用タスク29に要求していない場合(S21:No)、OS100は、データWrite用タスク29の待ち状態を継続させるとともに、非安全関連系タスクがEEPROM14へのログの格納を、データWrite用タスク30に対して要求しているか否かを判定する(S22)。   Therefore, when the safety-related task requests the data write task 29 to store the log in the EEPROM 14 (S21: Yes), the OS 100 causes the task scheduler 23 to wake up the data write task 29. , Transition to the execution state. The data write task 29 that has started operation by transitioning to the execution state calls the system call for receiving the log storage request data described above, and acquires the log storage request data (S24). Then, the data write task 29 performs processing (S26 to S30) for storing the log of the safety-related task based on the acquired log storage request data. On the other hand, when the safety-related task does not request the data write task 29 to store the log in the EEPROM 14 (S21: No), the OS 100 continues the wait state of the data write task 29 and the non-safety related task. It is determined whether or not the system task requests the data write task 30 to store the log in the EEPROM 14 (S22).

2つ目のケースは、データWrite用タスク29が、実行状態となって動作しており、OS100が提供するシステムコールを呼び出すことによって判定を行うケースである。この判定は、例えば、データWrite用タスク29が、上述したログ格納要求データを受信するシステムコールを呼び出すことによって行う。データWrite用タスク29は、リクエスト用のデータキューにログ格納要求データが格納されており、システムコールの呼び出しによって、そのログ格納要求データを取得することができた場合には、安全関連系タスクがEEPROM14へのログの格納を要求していると判定する(S21:Yes、S24)。一方、データWrite用タスク29は、リクエスト用のデータキューにログ格納要求データが格納されておらず、システムコールの呼び出しによって、ログ格納要求データを取得することができなかった場合には、安全関連系タスクがEEPROM14へのログの格納を要求していないと判定する(S21:No)。すなわち、2つ目のケースでは、データWrite用タスク29が、ポーリングによって、安全関連系タスクがログの格納を要求しているか否かを判定する。   The second case is a case where the data write task 29 is operating in an execution state, and a determination is made by calling a system call provided by the OS 100. This determination is performed, for example, when the data write task 29 calls a system call that receives the log storage request data described above. The data write task 29 stores the log storage request data in the request data queue, and if the log storage request data can be obtained by calling a system call, the safety related task is It is determined that log storage in the EEPROM 14 is requested (S21: Yes, S24). On the other hand, if the log write request data is not stored in the request data queue and the log write request data cannot be obtained by calling the system call, the data write task 29 is safety related. It is determined that the system task is not requesting storage of the log in the EEPROM 14 (S21: No). That is, in the second case, the data write task 29 determines whether or not the safety-related task requests log storage by polling.

安全関連系タスクがEEPROM14へのログの格納を要求している場合(S21:Yes)には、データWrite用タスク29は、取得したログ格納要求データに基づいて、安全関連系タスクのログを格納する処理(S26〜S30)を行う。一方、安全関連系タスクがEEPROM14へのログの格納を要求していない場合(S21:No)、上述したスリープするシステムコールを呼び出して、その実行を終了する。これによって、OS100に制御が移る。そして、OS100は、非安全関連系タスクがEEPROM14へのログの格納を、データWrite用タスク30に対して要求しているか否かを判定する(S22)。   When the safety-related task is requesting storage of the log in the EEPROM 14 (S21: Yes), the data write task 29 stores the log of the safety-related task based on the acquired log storage request data. The process (S26-S30) to perform is performed. On the other hand, if the safety-related task does not request storage of the log in the EEPROM 14 (S21: No), the system call to sleep described above is called and the execution is terminated. As a result, control is transferred to the OS 100. Then, the OS 100 determines whether or not the non-safety related task requests the data write task 30 to store the log in the EEPROM 14 (S22).

ここで、非安全関連系タスクがEEPROM14へのログの格納を要求しているか否かが判定されるケースは、データWrite用タスク30が、上述したスリープするシステムコールを呼び出すことによって、待ち状態となっているときに、OS100によって判定されるケースのみである。   Here, in a case where it is determined whether or not the non-safety related task requests the storage of the log in the EEPROM 14, the data write task 30 calls the above-described sleep system call to set the waiting state. This is only the case when it is determined by the OS 100.

そして、非安全関連系タスクがEEPROM14へのログの格納をデータWrite用タスク30に要求している場合(S22:Yes)には、OS100は、タスクスケジューラ23によって、データWrite用タスク30を起床させて、実行状態に遷移させる。実行状態に遷移して動作を開始したデータWrite用タスク30は、上述したログ格納要求データを受信するシステムコールを呼び出して、ログ格納要求データを取得する(S25)。そして、データWrite用タスク30は、取得したログ格納要求データに基づいて、非安全関連系タスクのログを格納する処理(S26〜S30)を行う。一方、非安全関連系タスクがEEPROM14へのログの格納をデータWrite用タスク30に要求していない場合(S22:No)、OS100は、データWrite用タスク30の待ち状態を継続させる。   When the non-safety related task requests the data write task 30 to store the log in the EEPROM 14 (S22: Yes), the OS 100 wakes up the data write task 30 by the task scheduler 23. Transition to the execution state. The data write task 30 that has started the operation after transitioning to the execution state calls the system call for receiving the log storage request data described above, and acquires the log storage request data (S25). Then, the data write task 30 performs processing (S26 to S30) for storing the log of the non-safety related task based on the acquired log storage request data. On the other hand, when the non-safety related task does not request the data write task 30 to store the log in the EEPROM 14 (S22: No), the OS 100 continues the waiting state of the data write task 30.

このようにして、データWrite用タスク29又はデータWrite用タスク30に対して、ログの格納が要求されるまで、待ち合わせが行われる(S23)。この後も、S21及びS22が繰り返され、ログの格納の要求に応じて、ログを格納する処理(S26〜S30)を行うといった処理手順が繰り返される。   In this way, the data write task 29 or the data write task 30 is waited until log storage is requested (S23). Thereafter, S21 and S22 are repeated, and the processing procedure of performing log storing processing (S26 to S30) is repeated in response to a log storage request.

また、上述したように、先に安全関連系タスクからのログの格納要求を判定し、次に非安全関連系タスクからのログの格納要求が判定されるようにしている。これによれば、安全関連系のログと非安全関連系のログの保存が同時に要求されている場合であっても、優先度の高い安全関連系のログを優先してEEPROM14に格納することができる。これは、データWrite用タスク29を実行する優先度を、データWrite用タスク30よりも高くしておくことで、TP1においてデータWrite用タスク30よりもデータWrite用タスク29が先にスケジューリングされるようにすることで実現する。   Further, as described above, a log storage request from a safety-related task is first determined, and then a log storage request from a non-safety-related task is determined. According to this, even when the safety-related log and the non-safety-related log are requested to be stored at the same time, the safety-related log having a high priority can be preferentially stored in the EEPROM 14. it can. This is because the data write task 29 is scheduled earlier than the data write task 30 in TP1 by setting the priority for executing the data write task 29 higher than the data write task 30. It is realized by making.

ログの格納が要求されたデータWrite用タスクは、ログ格納要求データで指定されるログを格納するアドレスが、許容範囲内か否かを判定する(S26)。具体的には、データWrite用タスクは、指定されたアドレスが、EEPROM14の有効アドレスに収まっているか否かを判定する。さらに、ログの格納が要求されたデータWrite用タスクが、データWrite用タスク30である場合は、指定されたアドレスが、EEPROM14の安全関連系タスク用の領域を指定していないか否かを判定する。   The data write task requested to store the log determines whether the address storing the log specified by the log storage request data is within an allowable range (S26). Specifically, the data write task determines whether or not the designated address falls within the effective address of the EEPROM 14. Further, when the data write task for which log storage is requested is the data write task 30, it is determined whether or not the designated address designates a safety-related task area in the EEPROM 14. To do.

すなわち、ログの格納が要求されたデータWrite用タスクが、データWrite用タスク29であるときは、指定されたアドレスが、EEPROM14の有効アドレスに収まっている場合には、アドレスが許容範囲内であると判定する(S27:Yes)。一方、指定されたアドレスが、EEPROM14の有効アドレスに収まっていない場合には、アドレスが許容範囲内でないと判定する(S27:No)。   That is, when the data write task for which log storage is requested is the data write task 29, the address is within the allowable range if the specified address is within the effective address of the EEPROM 14. (S27: Yes). On the other hand, when the designated address does not fit in the effective address of the EEPROM 14, it is determined that the address is not within the allowable range (S27: No).

また、ログの格納が要求されたデータWrite用タスクが、データWrite用タスク30であるときは、指定されたアドレスが、EEPROM14の有効アドレスに収まっており、かつ、EEPROM14の安全関連系タスク用の領域でない場合(又はEEPROM14の非安全関連系タスク用の領域である場合)には、アドレスが許容範囲内であると判定する(S27:Yes)。一方、指定されたアドレスが、EEPROM14の有効アドレスに収まっていない場合、又は、EEPROM14の安全関連系タスク用の領域である場合(又はEEPROM14の非安全関連系タスク用の領域でない場合)には、アドレスが許容範囲内でないと判定する(S27:No)。   When the data write task for which log storage is requested is the data write task 30, the designated address is within the effective address of the EEPROM 14, and for the safety related task of the EEPROM 14. If it is not an area (or if it is an area for a non-safety related task in the EEPROM 14), it is determined that the address is within an allowable range (S27: Yes). On the other hand, when the designated address does not fit in the effective address of the EEPROM 14, or when it is an area for a safety related system task of the EEPROM 14 (or when it is not an area for a non-safety related system task of the EEPROM 14), It is determined that the address is not within the allowable range (S27: No).

アドレスが許容範囲内でないと判定した場合(S27:No)、データWrite用タスクは、EEPROM14へのログの格納は行わずに、異常を通知する結果通知データを、タスク間通信によって、要求元のタスクに対して送信する(S30)。   When it is determined that the address is not within the allowable range (S27: No), the data write task does not store the log in the EEPROM 14, and the result notification data for notifying the abnormality is transmitted by inter-task communication. It is transmitted to the task (S30).

このようにすることで、安全関連系タスク用の領域に格納された、優先度の高い安全関連系タスクのログが、非安全関連系タスクのログで上書きされないようにすることができる。また、これによれば、低コストかつ省スペースで、非安全関連系タスクのログに対する、安全関連系タスクのログの独立性を保証することができる。例えば、安全関連系タスクのログと非安全関連系タスクのログのそれぞれが格納される2つEEPROMと、それぞれのEEPROMに対するデータの格納を処理する2つの処理ルーチン(例えば、ドライバ等)を設けることで、独立性を保証する方法も考えられる。しかしながら、この場合は、2つのEEPROMと、2つの処理ルーチンとを実装する必要があるため、コストが高くなってしまうという問題がある。また、2つのEEPROMを実装するために、実装スペースも消費してしまうという問題もある。それに対して、本実施形態によれば、1つのEEPROM14のみであっても、優先度の高い安全関連系タスクのログの上書きを防止することができる。そのため、低コストかつ省スペースで、ログの独立性を保証することができる。   By doing so, it is possible to prevent the log of the safety-related task having a high priority stored in the area for the safety-related task from being overwritten with the log of the non-safety-related task. Further, according to this, the independence of the safety-related task log with respect to the non-safety-related task log can be ensured at low cost and in a small space. For example, two EEPROMs for storing safety-related task logs and non-safety-related task logs, and two processing routines (for example, drivers) for processing data storage for the respective EEPROMs are provided. A method of guaranteeing independence is also conceivable. However, in this case, since it is necessary to mount two EEPROMs and two processing routines, there is a problem that the cost is increased. Moreover, since two EEPROMs are mounted, there is also a problem that a mounting space is consumed. On the other hand, according to this embodiment, even if only one EEPROM 14 is used, it is possible to prevent overwriting of a log of a safety-related task having a high priority. Therefore, log independence can be ensured at low cost and space saving.

なお、上述した説明では、ログの格納が要求されたデータWrite用タスクが、データWrite用タスク29である場合は、指定されたアドレスが、EEPROM14の非安全関連系タスク用の領域を指定していないか否かは判定していない。これよれば、非安全関連系タスクよりも、安全関連系タスクの方が、ログの優先度は高いことから、安全関連系タスク用の領域にログを格納する余裕がなくなった場合に、非安全関連系タスク用の領域にも、安全関連系タスクのログを格納可能となる。   In the above description, when the data write task for which log storage is requested is the data write task 29, the specified address specifies the area for the non-safety related task in the EEPROM 14. It is not determined whether or not there is. According to this, safety-related tasks have higher priority than non-safety-related tasks, so if there is no room for storing logs in the area for safety-related tasks, it is not safe. It is also possible to store safety-related task logs in the related task area.

また、逆に、ログの格納が要求されたデータWrite用タスクが、データWrite用タスク29である場合であっても、データWrite用タスク30と同様に、指定されたアドレスが、EEPROM14の非安全関連系タスク用の領域を指定していないか否かも判定するようにしてもよい。そのようにすることで、安全関連系タスクのログと、非安全関連系タスクのログとで、より高い独立性を保証するようにしてもよい。   Conversely, even when the data write task for which log storage is requested is the data write task 29, the designated address is insecure in the EEPROM 14, as with the data write task 30. It may also be determined whether or not a related task area is designated. By doing so, higher independence may be ensured between the safety-related task log and the non-safety-related task log.

データWrite用タスクから異常を通知する結果通知データを受信したタスクは、異常の通知に応じた処理を実行する。例えば、マイクロコントローラ20をリセットすることによって、復旧を試みるようにしてもよい。具体的には、結果通知データを受信したタスクは、パーティションスケジューラ21に異常を示す結果通知を通知する。そして、パーティションスケジューラ21は、通知に応じて、上述したように、リセット回路15への送信信号の送信を停止して、リセット回路15によってマイクロコントローラ20をリセットさせるようにする。   The task that has received the result notification data for notifying the abnormality from the data write task executes processing according to the abnormality notification. For example, recovery may be attempted by resetting the microcontroller 20. Specifically, the task that has received the result notification data notifies the partition scheduler 21 of a result notification indicating an abnormality. In response to the notification, the partition scheduler 21 stops the transmission of the transmission signal to the reset circuit 15 and causes the reset circuit 15 to reset the microcontroller 20 as described above.

また、このときに、マイクロコントローラ20をリセットする前に、パーティションスケジューラ21は、制御対象の安全を担保するために、制御対象を停止させるようにしてもよい。具体的には、図5Aに示す通常制御スケジューリングパターンに従って動作している場合、パーティションスケジューラ21は、スケジューリングパターンを、図5Bに示す安全制御スケジューリングパターンに切り替える。また、パーティションスケジューラ21は、次の動作タイミングで、TPを強制的にTP3に切り替えるようにしてもよい。そして、TP3へ切り替えた後は、例えば、安全制御タスク28によって制御対象を停止させる。また、パーティションスケジューラ21は、タスクの実行状況が異常である旨の通知を安全制御タスク28から通知された場合、パーティションスケジューラ21自身が、制御対象を停止させるように制御するようにしてもよい。   At this time, before resetting the microcontroller 20, the partition scheduler 21 may stop the control target in order to ensure the safety of the control target. Specifically, when operating according to the normal control scheduling pattern shown in FIG. 5A, the partition scheduler 21 switches the scheduling pattern to the safe control scheduling pattern shown in FIG. 5B. Further, the partition scheduler 21 may forcibly switch TP to TP3 at the next operation timing. Then, after switching to TP3, for example, the control target is stopped by the safety control task 28. Further, the partition scheduler 21 may control the partition scheduler 21 to stop the control target when notified from the safety control task 28 that the task execution status is abnormal.

アドレスが許容範囲内であると判定した場合(S27:Yes)、データWrite用タスクは、ログ格納要求データに含まれるログを、EEPROM14に格納する(S28)。データWrite用タスクは、成功を通知する結果通知データを、タスク間通信によって、要求元のタスクに対して送信する(S29)。   If it is determined that the address is within the allowable range (S27: Yes), the data write task stores the log included in the log storage request data in the EEPROM 14 (S28). The data write task transmits result notification data for notification of success to the requesting task through inter-task communication (S29).

このとき、ログの格納が要求されたデータWrite用タスクが、データWrite用タスク29である場合、データWrite用タスク29は、上述したようにポーリングによって、安全関連系タスクがログの格納を要求しているか否かを判定する(S21)。一方、ログの格納が要求されたデータWrite用タスクが、データWrite用タスク30である場合は、データWrite用タスク30は、上述したように、上述したスリープするシステムコールを呼び出すことによって、待ち状態に遷移する。これによって、OS100によって、安全関連系タスクがログの格納を要求しているか否かが判定される(S21)。   At this time, if the data write task for which log storage is requested is the data write task 29, the data write task 29 requests the log storage by the safety-related task by polling as described above. It is determined whether or not (S21). On the other hand, if the data write task for which log storage is requested is the data write task 30, the data write task 30 waits by calling the sleep system call described above as described above. Transition to. As a result, the OS 100 determines whether or not the safety-related task is requesting log storage (S21).

なお、以上の説明では、EEPROM14にログを格納する場合について例示したが、安全関連系タスク又は非安全関連系タスクがEEPROM14に格納されたデータを読み出す場合についても、同様にして処理を行うようにしてもよい。この場合、安全関連系タスク及び非安全関連系タスクからは、読み出すログが格納されたアドレスが指定された、ログの読み出しを要求するログ読み出しデータを、タスク間通信によって、データWrite用タスク29、30に送信することになる。そして、ログ格納要求データに代えて、ログ読み出しデータに対して、上述した処理が行われることになる。また、データWrite用タスク29、30は、S28ではログの格納に代えて、ログ読み出しデータで指定されるアドレスからログを読み出し、読み出したログを結果通知データに含めて、タスク間通信によって、要求元のタスクに対して送信することになる(S29)。   In the above description, the case where the log is stored in the EEPROM 14 is exemplified. However, when the safety-related task or the non-safety-related task reads the data stored in the EEPROM 14, the same processing is performed. May be. In this case, from the safety-related task and the non-safety-related task, the log write data requesting to read the log, in which the address where the log to be read is stored, is specified by the task 29 for data write by inter-task communication. 30 will be transmitted. Then, the processing described above is performed on the log read data instead of the log storage request data. In addition, the data write tasks 29 and 30 read the log from the address specified by the log read data instead of storing the log in S28, include the read log in the result notification data, and request it by inter-task communication. It is transmitted to the original task (S29).

続いて、図9を参照して、本実施の形態にかかるログ格納の処理手順の具体例について説明する。図9は、図8を参照して説明した、本実施の形態にかかるログ格納の処理手順による具体的な処理例を示すシーケンス図である。   Next, a specific example of the log storage processing procedure according to the present embodiment will be described with reference to FIG. FIG. 9 is a sequence diagram illustrating a specific processing example according to the log storage processing procedure according to the present embodiment described with reference to FIG. 8.

まず、データWrite用タスク29は、実行状態であり、ミューテックスをロックしており(S41)、データWrite用タスク30は、実行可能状態であるものとする。データWrite用タスク29は、ポーリングによって、データキューからのログ格納要求データを受信できるか否かを確認する(S42)。   First, the data write task 29 is in an execution state, the mutex is locked (S41), and the data write task 30 is in an executable state. The data write task 29 checks whether or not the log storage request data from the data queue can be received by polling (S42).

データWrite用タスク29は、ログ格納要求データを受信できなかった場合(S43:No)、ミューテックスをアンロックし(S44)、ログ格納要求データを待ち合わせるために待ち状態に遷移する(S45)。一方、データWrite用タスク29は、ログ格納要求データを受信できた場合(S43:Yes)、EEPROM制御処理を実行する(S49)。すなわち、ログをEEPROM14に格納する(S26〜S29)。そして、データWrite用タスク29は、再び、ポーリングによって、データキューからのログ格納要求データを受信できるか否かを確認する(S42)。これによって、安全関連系タスクからのログの格納要求がある場合には、それに応じた安全関連系タスクのログの格納を優先的に連続して実行することができる。   When the log write request data 29 cannot be received (S43: No), the data write task 29 unlocks the mutex (S44) and transitions to a wait state to wait for the log storage request data (S45). On the other hand, if the data write task 29 has received the log storage request data (S43: Yes), it executes the EEPROM control process (S49). That is, the log is stored in the EEPROM 14 (S26 to S29). Then, the data write task 29 confirms again whether or not the log storage request data from the data queue can be received by polling (S42). As a result, when there is a log storage request from the safety-related task, the storage of the safety-related task log corresponding to the request can be preferentially and continuously executed.

データWrite用タスク29が待ち状態に遷移した後(S45)、タスクスケジューラ23は、実行可能状態のデータWrite用タスク30を実行状態に遷移させる。ここで、データWrite用タスク30は、例えば、ログの格納を終了した状態であるものとする。データWrite用タスク30は、ログ格納要求データを待ち合わせるために待ち状態に遷移する(S46)。   After the data write task 29 transitions to the wait state (S45), the task scheduler 23 transitions the executable data write task 30 to the execution state. Here, it is assumed that the data write task 30 is in a state where storage of the log is finished, for example. The data write task 30 shifts to a wait state to wait for log storage request data (S46).

タスクスケジューラ23は、安全関連系タスクによって、データWrite用タスク29に対するログ格納要求データがリクエスト用のデータキューに格納されたとき、データWrite用タスク29を実行状態に遷移させる。実行状態に遷移したデータWrite用タスク29は、データキューからログ格納要求データを受信する(S47)。データWrite用タスク29は、ミューテックスをロックして(S48)、EEPROM制御処理を実行する(S49)。そして、データWrite用タスク29は、再び、データキューからのログ格納要求データを受信できるか否かを確認する(S42)。   When the log storage request data for the data write task 29 is stored in the request data queue by the safety related task, the task scheduler 23 shifts the data write task 29 to the execution state. The data write task 29 transitioned to the execution state receives the log storage request data from the data queue (S47). The data write task 29 locks the mutex (S48) and executes the EEPROM control process (S49). Then, the data write task 29 confirms again whether or not the log storage request data from the data queue can be received (S42).

一方、データWrite用タスク29が待ち状態に遷移した後に、データWrite用タスク30に対するログ格納要求データがリクエスト用のデータキューに格納されたとき、タスクスケジューラ23は、データWrite用タスク30を実行状態に遷移させる。実行状態に遷移したデータWrite用タスク30は、データキューからログ格納要求データを受信する(S50)。データWrite用タスク30は、ミューテックスをロックして(S51)、EEPROM制御処理を実行する(S52)。そして、データWrite用タスク29は、ミューテックスをアンロックして(S53)、ログ格納要求データを待ち合わせるために待ち状態に遷移する(S46)。   On the other hand, when the log storage request data for the data write task 30 is stored in the request data queue after the data write task 29 transitions to the wait state, the task scheduler 23 executes the data write task 30. Transition to. The data write task 30 that has transitioned to the execution state receives log storage request data from the data queue (S50). The data write task 30 locks the mutex (S51) and executes the EEPROM control process (S52). Then, the data write task 29 unlocks the mutex (S53), and transitions to a wait state to wait for log storage request data (S46).

続いて、図10を参照して、本実施の形態にかかるログ格納の処理手順の具体例について説明する。図10は、図8を参照して説明した、本実施の形態にかかるログ格納の処理手順による具体的な処理例を示すシーケンス図である。図10では、図9を参照して説明した処理例とは、異なる例について説明する。   Next, a specific example of the log storage processing procedure according to the present embodiment will be described with reference to FIG. FIG. 10 is a sequence diagram illustrating a specific processing example according to the log storage processing procedure according to the present embodiment described with reference to FIG. 8. In FIG. 10, an example different from the processing example described with reference to FIG. 9 will be described.

まず、データWrite用タスク29とデータWrite用タスク30のそれぞれは、待ち状態であるものとする。データWrite用タスク29に対するログ格納要求データがリクエスト用のデータキューに格納されたとき、タスクスケジューラ23は、データWrite用タスク29を実行状態に遷移させる。実行状態に遷移したデータWrite用タスク29は、データキューからログ格納要求データを受信する(S61)。データWrite用タスク29は、ミューテックスをロックして、EEPROM制御処理を開始する(S63)。   First, it is assumed that each of the data write task 29 and the data write task 30 is in a waiting state. When the log storage request data for the data write task 29 is stored in the request data queue, the task scheduler 23 changes the data write task 29 to the execution state. The data write task 29 transitioned to the execution state receives the log storage request data from the data queue (S61). The data write task 29 locks the mutex and starts the EEPROM control process (S63).

ここで、図10に示す例では、データWrite用タスク29がシステムコールを呼び出す等のディスパッチの契機となる処理を行って、ディスパッチが発生したものとする。また、このときに、データWrite用タスク30に対するログ格納要求データがリクエスト用のデータキューに格納されているものとする。この場合、タスクスケジューラ23は、データWrite用タスク29を実行可能状態に遷移させるとともに(S64)、データWrite用タスク30を実行状態に遷移させる。   Here, in the example shown in FIG. 10, it is assumed that the dispatch has occurred by performing processing that triggers dispatch such as the data write task 29 calling a system call. At this time, it is assumed that log storage request data for the data write task 30 is stored in the request data queue. In this case, the task scheduler 23 shifts the data write task 29 to an executable state (S64), and shifts the data write task 30 to an execution state.

実行状態に遷移したデータWrite用タスク30は、データキューからログ格納要求データを受信する(S65)。データWrite用タスク30は、受信したログ格納要求に応じたEEPROM制御処理を実施するために、ミューテックスをロックする(S66)。しかしながら、すでにデータWrite用タスク29によってミューテックスがロックされているため(S62)、データWrite用タスク30は、ロック待ちとなる。そのため、タスクスケジューラ23は、データWrite用タスク30を待ち状態に遷移させる(S67)。   The data write task 30 transitioned to the execution state receives the log storage request data from the data queue (S65). The data write task 30 locks the mutex in order to execute the EEPROM control process according to the received log storage request (S66). However, since the mutex is already locked by the data write task 29 (S62), the data write task 30 waits for lock. For this reason, the task scheduler 23 shifts the data write task 30 to a waiting state (S67).

それによって、タスクスケジューラ23は、再び、実行可能状態となっている、データWrite用タスク29を実行状態に遷移させる(S67)。実行可能状態となったデータWrite用タスク29は、先ほど中断されたEEPROM制御処理を継続する。そして、データWrite用タスク29は、EEPROM制御処理を終了したとき(S68)、ポーリングによって、データキューからログ格納要求データを受信できるか否かを確認する(S69)。   As a result, the task scheduler 23 again transitions the data write task 29 that is in the executable state to the execution state (S67). The data write task 29 in the executable state continues the EEPROM control process that was previously interrupted. Then, when the data write task 29 finishes the EEPROM control process (S68), it checks whether or not the log storage request data can be received from the data queue by polling (S69).

データWrite用タスク29は、ログ格納要求データを受信できた場合(S70:Yes)、EEPROM制御処理を実行する(S71)。これ以降は、図9を参照して説明したS49以降の処理と同様であるため、説明を省略する。   If the data write task 29 has received the log storage request data (S70: Yes), it executes the EEPROM control process (S71). The subsequent processing is the same as the processing after S49 described with reference to FIG.

一方、データWrite用タスク29は、ログ格納要求データを受信できなかった場合(S70:No)、ミューテックスをアンロックし(S72)、ログ格納要求データを待ち合わせるために待ち状態に遷移する(S73)。   On the other hand, if the log write request data 29 cannot be received (S70: No), the data write task 29 unlocks the mutex (S72), and transitions to a wait state to wait for the log storage request data (S73). .

データWrite用タスク29が待ち状態に遷移した後は(S45)、データWrite用タスク29によってミューテックスがアンロックされているため(S72)、タスクスケジューラ23は、待ち状態のデータWrite用タスク30を実行状態に遷移させる。データWrite用タスク30は、ミューテックスをロックして(S74)、EEPROM制御処理を実行する(S75)。そして、データWrite用タスク30は、ミューテックスをアンロックして(S76)、ログ格納要求データを待ち合わせるために待ち状態に遷移する(S77)。   After the data write task 29 transits to the wait state (S45), the mutex is unlocked by the data write task 29 (S72), so the task scheduler 23 executes the wait data write task 30 Transition to a state. The data write task 30 locks the mutex (S74) and executes the EEPROM control process (S75). Then, the data write task 30 unlocks the mutex (S76), and transitions to a wait state to wait for log storage request data (S77).

上述した説明によれば、データWrite用タスク29が、EEPROM14にログを格納する前に、EEPROM14をロックし、EEPROM14にログを格納した後に、EEPROM14をアンロックするようにしている。これによれば、安全関連系のログの格納処理中に、データWrite用タスク29からデータWrite用タスク30へのディスパッチが発生したとしても、安全関連系のログの格納を優先することができる。すなわち、安全関連系のログの保存中に、非安全関連系のログの保存要求があったとしても、安全関連系のログを優先して保存することができる。   According to the above description, the data write task 29 locks the EEPROM 14 before storing the log in the EEPROM 14, and unlocks the EEPROM 14 after storing the log in the EEPROM 14. According to this, even when a dispatch from the data write task 29 to the data write task 30 occurs during the storage process of the safety related log, priority can be given to the storage of the safety related log. That is, even if there is a request to save a non-safety-related log while saving a safety-related log, the safety-related log can be preferentially saved.

ここで、各タスク24、26、28からのデータWrite用タスク29、30に対して保存を要求するログのサイズが、タスク間通信によって1回で送信可能なサイズを超えている場合には、各タスク24、26、28は、ログを分割して、複数のログ格納要求データに分けて送信する。以下、そのときの処理について、図9及び図10を参照して説明する。   Here, when the size of the log requesting storage to the data write tasks 29 and 30 from each task 24, 26 and 28 exceeds the size that can be transmitted at one time by inter-task communication, Each task 24, 26, 28 divides the log and transmits it by dividing it into a plurality of log storage request data. Hereinafter, the process at that time will be described with reference to FIGS.

この場合、データWrite用タスク30は、S50において、複数のログ格納要求データを受信する。これは、上述したログ格納要求データを受信するシステムコールを連続して呼び出すことによって行う。ここで、ログ格納要求データを受信する回数は、最初のログ格納要求データに、ログを何分割して送信したのかを示す情報を含めておくことによって特定可能とする。そして、データWrite用タスク30は、最後のログ格納要求データを受信したときに、ミューテックスをロックする(S51)。そして、受信した複数のログ格納要求データのそれぞれに含まれるログを結合して1つのログとして、EEPROM制御処理(S52)を行う。   In this case, the data write task 30 receives a plurality of log storage request data in S50. This is performed by continuously calling system calls for receiving the log storage request data described above. Here, the number of times log storage request data is received can be specified by including in the first log storage request data information indicating how many times the log has been transmitted. Then, the data write task 30 locks the mutex when receiving the last log storage request data (S51). Then, EEPROM control processing (S52) is performed by combining the logs included in each of the received plurality of log storage request data as one log.

それに対して、安全関連系タスクのログが分割される場合には、データWrite用タスク29は、最初のログ格納要求データを受信したときに(S47)、ミューテックスをロック(S48)して、後続するログ格納要求データを受信する。そして、データWrite用タスク29も、受信した複数のログ格納要求データのそれぞれに含まれるログを結合して1つのログとして、EEPROM制御処理(S49)を行う。   On the other hand, when the log of the safety-related task is divided, the data write task 29 locks the mutex (S48) when the first log storage request data is received (S48), and the subsequent Log storage request data to be received. The data write task 29 also performs the EEPROM control process (S49) by combining the logs included in each of the received plurality of log storage request data as one log.

このようにすることで、データWrite用タスク29が、全てのログ格納要求データを受信するまでに、データWrite用タスク30へのディスパッチが発生してしまった場合であっても、図10に示すように、データWrite用タスク30は、ミューテックスのロック待ちとなり、再び、データWrite用タスク29に制御が戻ることになる。すなわち、安全関連系のログの保存中に、非安全関連系のログの保存要求があったとしても、安全関連系のログを優先して保存することができる。   By doing so, even if dispatch to the data write task 30 occurs before the data write task 29 receives all the log storage request data, it is shown in FIG. As described above, the data write task 30 waits for the mutex to be locked, and the control returns to the data write task 29 again. That is, even if there is a request to save a non-safety-related log while saving a safety-related log, the safety-related log can be preferentially saved.

また、データWrite用タスク30が、全てのログ格納要求データを受信するまでに、データWrite用タスク29へのディスパッチが発生してしまった場合は、データWrite用タスク30によって、まだミューテックスはロックされていない。そのため、データWrite用タスク29は、ミューテックスをロックして、ログの保存を行うことができる。すなわち、これによれば、非安全関連系のログの保存処理中に、安全関連系のログの保存要求があった場合であっても、安全関連系のログを優先して保存することが可能となる。   Also, if dispatch to the data write task 29 occurs before the data write task 30 receives all the log storage request data, the mutex is still locked by the data write task 30. Not. Therefore, the data write task 29 can lock the mutex and save the log. In other words, according to this, even when there is a request to save a safety-related log during the process of saving a non-safety-related log, it is possible to preferentially save the safety-related log. It becomes.

なお、上述した説明では、EEPROM14のロックをかける機構として、ミューテックスを用いた場合について例示したが、これに限られない。EEPROM14のロックをかける機構として、ミューテックス、セマフォ、又はスピンロック等の任意のロック機構を用いてよい。   In the above description, the case where a mutex is used as the mechanism for locking the EEPROM 14 is exemplified, but the present invention is not limited to this. As a mechanism for locking the EEPROM 14, an arbitrary lock mechanism such as a mutex, a semaphore, or a spin lock may be used.

以上に説明したように、本実施の形態では、安全関連系のタスクのログを格納したときに、安全関連系のタスクからのデータ格納要求がある場合には、非安全関連系のタスクからのデータ格納要求がある場合であっても、安全関連系のタスクからのデータ格納要求に応じて、EEPROM14に安全関連系のタスクのログを格納するようにしている。これによれば、優先度の高い安全関連系のタスクのログを優先的にEEPROM14に格納することができる。すなわち、特定のタスクのデータを優先して保存することができる。   As described above, in the present embodiment, when a safety-related task log is stored and there is a data storage request from a safety-related task, the non-safety-related task Even when there is a data storage request, a log of the safety-related task is stored in the EEPROM 14 in response to the data storage request from the safety-related task. According to this, it is possible to preferentially store a safety-related task log having a high priority in the EEPROM 14. That is, data of a specific task can be preferentially saved.

ここで、安全関連系のタスクから送信されたデータと非安全関連系のタスクから送信されたデータの両方がデータキューに格納されている場合には、先に送信されたデータが、先に受信されることになる。データキューにおいては、優先度の高い安全関連系のタスクからのデータを先に受信するという待ち合わせの仕方をすることはできない。それに対して、本実施の形態では、データの優先度に応じて別々のデータWrite用タスクを用意して、優先度の高いデータを保存するデータWrite用タスクを優先的に動作させるようにしている。   Here, if both data sent from safety-related tasks and data sent from non-safety-related tasks are stored in the data queue, the data sent first will be received first. Will be. In the data queue, it is not possible to wait for data received from safety-related tasks with high priority first. On the other hand, in the present embodiment, different data write tasks are prepared according to the priority of data, and the data write task for storing high priority data is preferentially operated. .

これによれば、データキュー(タスク間通信)及びマルチタスクの仕組みを利用して、低コストで、優先度の高い安全関連系のタスクのデータを優先して保存することが可能となる。   According to this, it is possible to preferentially store safety-related task data with high priority at a low cost by using a data queue (intertask communication) and a multitask mechanism.

<発明の他の実施の形態>
本実施の形態では、TPのそれぞれに属するタスクが、それぞれ安全監視タスク24、通常制御タスク26、及び安全制御タスク28である場合について例示したが、タスクの種類は、これに限られない。安全監視タスク24、通常制御タスク26及び安全制御タスク28に限られず、その他の制御対象の制御に関する任意の処理を実行するタスクを有するようにしてもよい。
<Other embodiments of the invention>
In the present embodiment, the case where the tasks belonging to each of the TPs are the safety monitoring task 24, the normal control task 26, and the safety control task 28, respectively, is illustrated, but the types of tasks are not limited thereto. The present invention is not limited to the safety monitoring task 24, the normal control task 26, and the safety control task 28, and may have a task for executing an arbitrary process related to control of other control targets.

例えば、図11に示すようなタスク31〜33を有するようにしてもよい。なお、この場合、安全制御装置は、アプリケーション101〜103に代えて、タスク31〜33に対応するアプリケーションを有する必要があるが、その点は自明であるため図示及び説明を省略する。また、図11では、データWrite用タスク29、30の図示は省略している。   For example, you may make it have the tasks 31-33 as shown in FIG. In this case, the safety control device needs to have an application corresponding to the tasks 31 to 33 in place of the applications 101 to 103. However, since this point is obvious, illustration and description are omitted. In FIG. 11, the data write tasks 29 and 30 are not shown.

監視制御タスク31は、制御対象を制御する。具体的には、監視制御タスク31は、通常制御タスク32及び安全制御タスク33からの指令値に基づいて、制御対象のアクチュエータを制御する。通常制御タスク32は、制御対象に通常の機能・動作を行わせるための制御計算を行う。具体的には、通常制御タスク32は、通常制御におけるアクチュエータの制御計算をして、アクチュエータの指令値を算出する。通常制御タスク32は、算出した指令値を監視制御タスク31に出力する。安全制御タスク33は、機能安全を確保するために定められた制御計算を行う。具体的には、安全制御タスク33は、安全制御におけるアクチュエータの制御計算をして、アクチュエータの指令値を算出する。安全制御タスク33は、算出した指令値を監視制御タスク31に出力する。監視制御タスク31は、通常制御タスク32又は安全制御タスク33から出力された指令値に基づいてアクチュエータを制御する。   The supervisory control task 31 controls the control target. Specifically, the supervisory control task 31 controls the actuator to be controlled based on command values from the normal control task 32 and the safety control task 33. The normal control task 32 performs a control calculation for causing the control target to perform a normal function / operation. Specifically, the normal control task 32 calculates an actuator command value by performing control calculation of the actuator in normal control. The normal control task 32 outputs the calculated command value to the monitoring control task 31. The safety control task 33 performs a control calculation determined to ensure functional safety. Specifically, the safety control task 33 performs actuator control calculation in safety control to calculate an actuator command value. The safety control task 33 outputs the calculated command value to the monitoring control task 31. The supervisory control task 31 controls the actuator based on the command value output from the normal control task 32 or the safety control task 33.

さらに、監視制御タスク31は、制御対象のセンサから、センサ値を取得する。監視制御タスク31は、取得したセンサ値を通常制御タスク32及び安全制御タスク33に出力する。通常制御タスク32及び安全制御タスク33のそれぞれは、監視制御タスク31から出力されたセンサ値に基づいて、アクチュエータの制御計算を行うようにしてもよい。なお、各タスク31〜33間での指令値及びセンサ値の受け渡しは、タスク間通信で行ってもよく、実行用メモリ11に設けられた、各タスク31〜33で共有してアクセス可能な領域である共有メモリを介して行うようにしてもよい。   Furthermore, the monitoring control task 31 acquires a sensor value from the sensor to be controlled. The monitoring control task 31 outputs the acquired sensor value to the normal control task 32 and the safety control task 33. Each of the normal control task 32 and the safety control task 33 may perform actuator control calculation based on the sensor value output from the monitoring control task 31. The command value and the sensor value between the tasks 31 to 33 may be exchanged by inter-task communication, and an area provided in the execution memory 11 that can be shared and accessed by the tasks 31 to 33. Alternatively, this may be performed via a shared memory.

図11の例では、監視制御タスク31及び安全制御タスク33は、制御対象の監視や、機能安全を確保するために定められた制御計算等のように、制御対象の機能安全の確保に関する処理を実行するタスクとなる。それに対して、通常制御タスク32は、その他の制御対象の制御に関する処理を実行するタスクとなる。そのため、監視制御タスク31及び安全制御タスク33は、安全関連系タスクとなり、通常制御タスク32は、非安全関連系タスクとなる。   In the example of FIG. 11, the monitoring control task 31 and the safety control task 33 perform processing related to ensuring the functional safety of the controlled object, such as monitoring of the controlled object and control calculation determined to ensure functional safety. A task to be executed. On the other hand, the normal control task 32 is a task that executes processing related to control of other control targets. Therefore, the supervisory control task 31 and the safety control task 33 are safety-related tasks, and the normal control task 32 is a non-safety-related task.

また、その他に、例えば、図12に示すようなタスク34〜36を有するようにしてもよい。なお、この場合、安全制御装置は、アプリケーション101〜103に代えて、タスク34〜36に対応するアプリケーションを有する必要があるが、その点は自明であるため図示及び説明を省略する。また、図12では、データWrite用タスク29、30の図示は省略している。   In addition, for example, you may make it have the tasks 34-36 as shown in FIG. In this case, the safety control device needs to have applications corresponding to the tasks 34 to 36 instead of the applications 101 to 103. However, since this point is obvious, illustration and description are omitted. In FIG. 12, the illustration of the data write tasks 29 and 30 is omitted.

監視タスク34は、制御対象のセンサから、センサ値を取得する。このセンサには、上述したように制御対象の姿勢を検知するための姿勢センサを含む。ここで説明する例では、制御対象として、人が搭乗することができる走行装置に適用した場合について説明する。この場合、監視タスク34、搭乗者による重心移動を姿勢センサにより検知することができる。監視タスク34は、取得したセンサ値をHMI(Human Machine Interface)タスク36に出力する。   The monitoring task 34 acquires a sensor value from the sensor to be controlled. This sensor includes a posture sensor for detecting the posture of the control target as described above. The example demonstrated here demonstrates the case where it applies to the traveling apparatus which a person can board as a control object. In this case, the movement of the center of gravity by the monitoring task 34 and the passenger can be detected by the posture sensor. The monitoring task 34 outputs the acquired sensor value to an HMI (Human Machine Interface) task 36.

HMIタスク36は、監視タスク34から出力されたセンサ値に基づいて、制御対象のアクチュエータの制御計算をして、アクチュエータの指令値を算出する。HMIタスク36は、算出した指令値を制御タスク35に出力する。制御タスク35は、HMIタスク36から出力された指令値に基づいて、アクチュエータを制御する。なお、各タスク34〜36間での指令値及びセンサ値の受け渡しは、タスク間通信で行ってもよく、実行用メモリ11に設けられた、各タスク34〜36で共有してアクセス可能な領域である共有メモリを介して行うようにしてもよい。   Based on the sensor value output from the monitoring task 34, the HMI task 36 performs control calculation of the actuator to be controlled, and calculates an actuator command value. The HMI task 36 outputs the calculated command value to the control task 35. The control task 35 controls the actuator based on the command value output from the HMI task 36. The command value and the sensor value between the tasks 34 to 36 may be exchanged by inter-task communication, and an area provided in the execution memory 11 that can be shared and accessed by the tasks 34 to 36. Alternatively, this may be performed via a shared memory.

図12の例では、監視タスク34、HMIタスク36及び制御タスク35によって、制御対象の監視、それに応じた制御計算、制御計算結果に基づいた制御対象の制御を行うことで、状況によっては制御対象の機能安全の確保に関する処理を実行する。そのため、監視タスク34、HMIタスク36及び制御タスク35のそれぞれは、安全関連系タスクとなる。この場合には、TP1〜TP3以外のTP(図示せず)に属する、その他の制御対象の制御に関する処理を実行するタスクが、非安全関連系タスクとなる。   In the example of FIG. 12, the monitoring task 34, the HMI task 36, and the control task 35 monitor the control target, perform control calculation according to the control target, and control the control target based on the control calculation result. Execute processing related to ensuring functional safety. Therefore, each of the monitoring task 34, the HMI task 36, and the control task 35 is a safety-related task. In this case, a task that executes processing related to control of another control target belonging to a TP (not shown) other than TP1 to TP3 is a non-safety related task.

ここで、図12において説明した構成によれば、搭乗者の操作に応じて制御対象が制御されるというHMIを実現することができる。例えば、搭乗者が重心を前後に移動させることで制御対象が前後後退を行い、搭乗者が重心を左右に移動させることで制御対象が左右旋回を行うといった制御が可能となる。これについては、実施の形態及び図11によって説明した例についても同様のことが言える。具体的には、安全監視タスク24又は監視制御タスク31が取得したセンサ値に応じて、通常制御タスク26及び安全制御タスク28、もしくは、通常制御タスク32及び安全制御タスク33が同様の制御をすることで、HMIを実現することが可能である。   Here, according to the configuration described with reference to FIG. 12, it is possible to realize an HMI in which a control target is controlled in accordance with a passenger's operation. For example, it is possible to perform control such that the control object moves back and forth when the passenger moves the center of gravity back and forth, and the control object turns left and right when the passenger moves the center of gravity left and right. The same can be said for the example described in the embodiment and FIG. Specifically, the normal control task 26 and the safety control task 28, or the normal control task 32 and the safety control task 33 perform the same control according to the sensor value acquired by the safety monitoring task 24 or the monitoring control task 31. Thus, HMI can be realized.

なお、走行装置として、例えば、立ち乗り方の同軸二輪車とすることもできる。その場合は、アクチュエータを制御することで、車輪が回転動作をすることになる。また、安全制御装置自体も制御対象に搭載される構成としてもよい。   In addition, as a traveling apparatus, it can also be set as the coaxial two-wheeled vehicle of standing up riding. In this case, the wheel rotates by controlling the actuator. Further, the safety control device itself may be mounted on the control target.

さらに、本発明は上述した実施の形態のみに限定されるものではなく、既に述べた本発明の要旨を逸脱しない範囲において種々の変更が可能であることは勿論である。   Furthermore, the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the gist of the present invention described above.

本実施の形態では、OSが、TP1〜TP3を有する場合について例示したが、TPの種類及び数は、これに限られない。スケジューリングパターンについても、本実施の形態に例示したものに限られない。   In the present embodiment, the case where the OS has TP1 to TP3 is illustrated, but the type and number of TPs are not limited to this. The scheduling pattern is not limited to that exemplified in the present embodiment.

本実施の形態では、タスクの数が5つである場合について例示したが、タスクの数は、これに限られない。例えば、本実施の形態では、TPがTP1〜TP3の3つである場合について例示したが、TPの数を3つ以外の数とし、それぞれのTPが任意の数のタスクを有するようにしてもよい。   In the present embodiment, the case where the number of tasks is five is exemplified, but the number of tasks is not limited to this. For example, in the present embodiment, the case where there are three TPs, TP1 to TP3, is exemplified, but the number of TPs may be other than three and each TP may have an arbitrary number of tasks. Good.

本実施の形態では、タイム・パーティショニングを採用したマルチタスクOSについて例示したが、これに限られない。タイム・パーティショニングを採用していないマルチタスクOSに適用することもできる。   In the present embodiment, the multitask OS adopting time partitioning is exemplified, but the present invention is not limited to this. The present invention can also be applied to a multitasking OS that does not employ time partitioning.

本実施の形態では、ログを格納する非安全関連系のタスクと、そのログよりも格納する優先度の高いログを格納する安全関連系のタスクとを実行する場合について例示したが、これに限られない。データを格納するタスクと、そのデータよりも優先度の高いデータを格納するタスクとを実行する情報処理装置であれば、同様にして適用することが可能である。すなわち、本実施の形態において対象となるデータは、ログに限られない。また、異なる優先度のデータを格納するタスク同士であれば、その分類は、安全関連系と非安全関連系とに限られることはない。   In this embodiment, the case of executing a non-safety related task storing a log and a safety related task storing a log having a higher priority than the log is illustrated, but the present invention is not limited thereto. I can't. Any information processing apparatus that executes a task for storing data and a task for storing data having a higher priority than the data can be applied in the same manner. That is, the target data in this embodiment is not limited to a log. Further, as long as tasks store data of different priorities, the classification is not limited to safety-related systems and non-safety-related systems.

1 安全制御装置
10 プロセッサ
11 実行用メモリ
12 I/Oポート
13 不揮発性メモリ
14 EEPROM
15 リセット回路
20 マイクロコントローラ
21 パーティションスケジューラ
22 スケジューリングテーブル
23、25、27 タスクスケジューラ
24 安全監視タスク
26、32 通常制御タスク
28、33 安全制御タスク
29、30 データWrite用タスク
31 監視制御タスク
34 監視タスク
35 制御タスク
36 HMIタスク
100 オペレーティングシステム
101 安全監視アプリケーション
102 通常制御アプリケーション
103 安全制御アプリケーション
104、105 データWrite用アプリケーション
1 Safety Control Device 10 Processor 11 Execution Memory 12 I / O Port 13 Nonvolatile Memory 14 EEPROM
15 Reset Circuit 20 Microcontroller 21 Partition Scheduler 22 Scheduling Tables 23, 25, 27 Task Scheduler 24 Safety Monitoring Tasks 26, 32 Normal Control Tasks 28, 33 Safety Control Tasks 29, 30 Data Write Task 31 Monitoring Control Task 34 Monitoring Task 35 Control task 36 HMI task 100 Operating system 101 Safety monitoring application 102 Normal control application 103 Safety control application 104, 105 Data Write application

Claims (10)

第1のデータと、前記第1のデータよりも格納する優先度の高い第2のデータとが格納される記憶部と、
前記記憶部に前記第1のデータを格納する第1のタスクと、前記記憶部に前記第2のデータを格納する第2のタスクとをスケジューリングして実行するタスク実行部と、
前記第1のタスクからのデータ格納要求に応じて、前記第1のタスクに代わって前記記憶部に前記第1のデータを格納するとともに、前記第2のタスクからのデータ格納要求に応じて、前記第2のタスクに代わって前記記憶部に前記第2のデータを格納するデータ格納制御と、を備え、
前記データ格納制御部は、前記第2のデータを格納したときに、前記第2のタスクからのデータ格納要求がある場合には、前記第1のタスクからのデータ格納要求がある場合であっても、前記第2のタスクからのデータ格納要求に応じて、前記記憶部に前記第2のデータを格納する、
情報処理装置。
A storage unit for storing first data and second data having higher priority than the first data;
A task execution unit that schedules and executes a first task that stores the first data in the storage unit and a second task that stores the second data in the storage unit;
In response to a data storage request from the first task, the first data is stored in the storage unit instead of the first task, and in response to a data storage request from the second task, Data storage control for storing the second data in the storage unit instead of the second task,
The data storage control unit, when storing the second data, when there is a data storage request from the second task, there is a data storage request from the first task, In response to a data storage request from the second task, the second data is stored in the storage unit.
Information processing device.
前記タスク実行部は、さらに、前記第1のタスクに代わって前記記憶部に前記第1のデータを格納する第1のデータ書き込みタスクと、前記第2のタスクからのデータ格納要求に応じて、前記第2のタスクに代わって前記記憶部に前記第2のデータを格納する第2のデータ書き込みタスクとをスケジューリングして実行することで、前記データ格納制御部として機能し、
前記第1のデータ書き込みタスクは、前記記憶部に前記第1のデータを格納したときに、前記第1のタスクからのデータ格納要求があるか否かに関わらず、待ち状態に遷移し、
前記第2のデータ書き込みタスクは、前記記憶部に前記第2のデータを格納したときに、前記第2のタスクからのデータ格納要求がある場合には、待ち状態に遷移せずに、当該データ格納要求に応じて、前記記憶部に前記第2のデータを格納する、
請求項1に記載の情報処理装置。
The task execution unit further includes a first data write task for storing the first data in the storage unit instead of the first task, and a data storage request from the second task, The second data writing task for storing the second data in the storage unit instead of the second task is scheduled and executed, thereby functioning as the data storage control unit,
When the first data write task stores the first data in the storage unit, regardless of whether there is a data storage request from the first task, the first data write task transitions to a wait state,
When the second data write task stores the second data in the storage unit and there is a data storage request from the second task, the second data write task does not transition to a wait state, In response to a storage request, the second data is stored in the storage unit.
The information processing apparatus according to claim 1.
前記データ格納要求は、メッセージキューを介して送信され、
前記第2のデータ書き込みタスクは、前記記憶部に前記第2のデータを格納したときに、前記メッセージキューから前記第2のタスクからのデータ格納要求を受信可能な場合に、待ち状態に遷移せずに、当該データ格納要求に応じて、前記記憶部に前記第2のデータを格納する、
請求項2に記載の情報処理装置。
The data storage request is transmitted via a message queue,
When the second data write task stores the second data in the storage unit and can receive a data storage request from the second task from the message queue, the second data write task shifts to a wait state. Without storing the second data in the storage unit in response to the data storage request,
The information processing apparatus according to claim 2.
前記第2のデータ書き込みタスクは、前記第1のデータ書き込みタスクよりも優先度が高い、
請求項2又は3に記載の情報処理装置。
The second data write task has a higher priority than the first data write task;
The information processing apparatus according to claim 2 or 3.
前記第1のデータ書き込みタスクは、前記記憶部に前記第1のデータを格納する前に前記記憶部をロックし、前記第1のデータを格納したときに、前記第1のタスクからのデータ格納要求があるか否かに関わらず、前記記憶部をアンロックし、
前記第2のデータ書き込みタスクは、前記記憶部に前記第2のデータを格納する前に前記記憶部をロックし、前記第2のデータを格納したときに、前記第2のタスクからのデータ格納要求がない場合に、前記記憶部をアンロックする、
請求項2乃至4のいずれか1項に記載の情報処理装置。
The first data write task locks the storage unit before storing the first data in the storage unit, and stores the data from the first task when the first data is stored. Regardless of whether there is a request, the storage unit is unlocked,
The second data write task locks the storage unit before storing the second data in the storage unit, and stores the data from the second task when the second data is stored. Unlocking the storage when there is no request;
The information processing apparatus according to any one of claims 2 to 4.
前記データ格納要求は、前記第1のタスク又は前記第2のタスクが、前記第1のデータ書き込みタスク又は前記第2のデータ書き込みタスクに対して、その格納を要求する第1のデータ又は第2のデータが含まれ、
前記第1のタスク及び前記第2のタスクのそれぞれは、1つの前記データ格納要求に前記第1のデータ又は前記第2のデータを含めることができない場合は、当該第1のデータ又は当該第2のデータを複数の前記データ格納要求に分けて送信し、
前記第1のデータ書き込みタスクは、前記複数のデータ格納要求のうち、最後のデータ格納要求を受信したときに、記記憶部をロックし、
前記第2のデータ書き込みタスクは、前記複数のデータ格納要求のうち、最初のデータ格納要求を受信したときに、記記憶部をロックする、
請求項5に記載の情報処理装置。
In the data storage request, the first task or the second task requests the first data write task or the second data write task to store the first data or the second data. Contains data,
When each of the first task and the second task cannot include the first data or the second data in one data storage request, the first data or the second task Are divided into a plurality of the data storage requests and transmitted,
The first data write task locks the storage unit when receiving the last data storage request among the plurality of data storage requests,
The second data write task locks the storage unit when receiving a first data storage request among the plurality of data storage requests.
The information processing apparatus according to claim 5.
前記タスク実行部は、前記第1のタスク、前記第2のタスク、前記第1のデータ書き込みタスク、及び、前記第2のデータ書き込みタスクがいずれかに含まれる複数のタイムパーティションのスケジューリング内容を示すスケジューリング情報に従って、前記第1のタスク、前記第2のタスク、前記第1のデータ書き込みタスク、及び、前記第2のデータ書き込みタスクをスケジューリングして実行し、
前記第1のデータ書き込みタスク及び前記第2のデータ書き込みタスクは、少なくとも同一のタイムパーティションに含まれる、
請求項2乃至6のいずれか1項に記載の情報処理装置。
The task execution unit indicates scheduling contents of a plurality of time partitions including any of the first task, the second task, the first data write task, and the second data write task. Scheduling and executing the first task, the second task, the first data write task, and the second data write task according to scheduling information;
The first data write task and the second data write task are included in at least the same time partition;
The information processing apparatus according to claim 2.
前記記憶部は、前記第1のデータが格納される領域と、前記第2のデータが格納される領域と、を含み、
前記データ格納要求は、前記記憶部において、前記第1のデータ又は前記第2のデータを格納するアドレスを示す情報が含まれ、
前記データ格納制御部は、前記第1のタスクからのデータ格納要求で示されるアドレスが、前記第2のデータが格納される領域に含まれる場合には、当該第1のデータ格納要求に応じた前記第1のデータの格納を抑止する、
請求項1乃至7のいずれか1項に記載の情報処理装置。
The storage unit includes an area in which the first data is stored and an area in which the second data is stored,
The data storage request includes information indicating an address for storing the first data or the second data in the storage unit,
The data storage control unit responds to the first data storage request when the address indicated by the data storage request from the first task is included in the area where the second data is stored. Deter storage of the first data;
The information processing apparatus according to any one of claims 1 to 7.
前記情報処理装置は、制御対象を制御する制御装置であって、
前記第2のタスクは、前記情報処理装置において検出した異常に関するログを前記第2のデータとして格納し、
前記第1のタスクは、その他の前記制御対象の制御に関する処理を実行するとともに、当該処理に関するログを前記第1のデータとして格納する、
請求項1乃至8のいずれか1項に記載の情報処理装置。
The information processing apparatus is a control apparatus that controls a control target,
The second task stores a log relating to an abnormality detected in the information processing apparatus as the second data,
The first task executes processing related to control of the other control target, and stores a log related to the processing as the first data.
The information processing apparatus according to any one of claims 1 to 8.
第1のデータと、前記第1のデータよりも格納する優先度の高い第2のデータとが格納される記憶部に前記第1のデータを格納する第1のタスクと、前記記憶部に前記第2のデータを格納する第2のタスクとをスケジューリングして実行開始する実行開始ステップと、
前記第1のタスクからのデータ格納要求に応じて、前記第1のタスクに代わって前記記憶部に前記第1のデータを格納する第1のデータ格納ステップと、
前記第2のタスクからのデータ格納要求に応じて、前記第2のタスクに代わって前記記憶部に前記第2のデータを格納する第2のデータ格納ステップと、を備え、
前記第2のデータ格納ステップでは、前記第2のデータを格納したときに、前記第2のタスクからのデータ格納要求がある場合には、前記第1のタスクからのデータ格納要求がある場合であっても、前記第2のタスクからのデータ格納要求に応じて、前記記憶部に前記第2のデータを格納する、
データ格納方法。
A first task for storing the first data in a storage unit storing first data and second data having a higher priority than the first data; and An execution start step for scheduling and starting execution of a second task for storing second data;
A first data storage step of storing the first data in the storage unit in place of the first task in response to a data storage request from the first task;
A second data storage step of storing the second data in the storage unit in place of the second task in response to a data storage request from the second task,
In the second data storage step, when there is a data storage request from the second task when the second data is stored, there is a data storage request from the first task. Even if there is, the second data is stored in the storage unit in response to a data storage request from the second task.
Data storage method.
JP2012015460A 2012-01-27 2012-01-27 Information processing apparatus and data storage method Expired - Fee Related JP5849731B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012015460A JP5849731B2 (en) 2012-01-27 2012-01-27 Information processing apparatus and data storage method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012015460A JP5849731B2 (en) 2012-01-27 2012-01-27 Information processing apparatus and data storage method

Publications (2)

Publication Number Publication Date
JP2013156744A true JP2013156744A (en) 2013-08-15
JP5849731B2 JP5849731B2 (en) 2016-02-03

Family

ID=49051880

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012015460A Expired - Fee Related JP5849731B2 (en) 2012-01-27 2012-01-27 Information processing apparatus and data storage method

Country Status (1)

Country Link
JP (1) JP5849731B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017102647A (en) * 2015-12-01 2017-06-08 富士通株式会社 Information processing apparatus, information processing program, and information processing method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004078401A (en) * 2002-08-13 2004-03-11 Hitachi Information Systems Ltd Log output management integrating system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004078401A (en) * 2002-08-13 2004-03-11 Hitachi Information Systems Ltd Log output management integrating system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JPN6015014435; 角田裕,他3名: 'ログの重要度に基づく優先キューイングと集約による無線リンクを考慮したログ転送の効率化' 電子情報通信学会技術研究報告 第109巻,第190号, 20090903, pp.19-24, 社団法人電子情報通信学会 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017102647A (en) * 2015-12-01 2017-06-08 富士通株式会社 Information processing apparatus, information processing program, and information processing method

Also Published As

Publication number Publication date
JP5849731B2 (en) 2016-02-03

Similar Documents

Publication Publication Date Title
JP5446447B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
US8706265B2 (en) Safety controller and safety control method
US8756606B2 (en) Safety controller and safety control method in which time partitions are scheduled according to a scheduling pattern
JP5321686B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5136693B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5240402B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5834935B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5621857B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5664530B2 (en) Operation check method of control device and memory protection device
JP5633501B2 (en) Control apparatus and control method
JP2013140476A (en) Information processing device, access authority giving method, program generation device, and method therefor
JP5849731B2 (en) Information processing apparatus and data storage method
JP5906584B2 (en) Control apparatus and control method
JP5845902B2 (en) Information processing apparatus and memory access management method
JP6004057B2 (en) Information processing apparatus and DMA controller operation check method
JP5811865B2 (en) Control device and program execution method
JP5853716B2 (en) Information processing apparatus and task control method
JP5803689B2 (en) Information processing apparatus and DMA controller operation check method
JP5699910B2 (en) Control apparatus and control method
JP2013109392A (en) Information processing device and operation confirmation method of memory management device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140821

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150318

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150414

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150513

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: 20151104

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151117

R151 Written notification of patent or utility model registration

Ref document number: 5849731

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees