JP5594416B1 - Electronic control unit - Google Patents
Electronic control unit Download PDFInfo
- Publication number
- JP5594416B1 JP5594416B1 JP2013187517A JP2013187517A JP5594416B1 JP 5594416 B1 JP5594416 B1 JP 5594416B1 JP 2013187517 A JP2013187517 A JP 2013187517A JP 2013187517 A JP2013187517 A JP 2013187517A JP 5594416 B1 JP5594416 B1 JP 5594416B1
- Authority
- JP
- Japan
- Prior art keywords
- time
- task
- partition
- cycle
- length
- 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.)
- Active
Links
Images
Abstract
【課題】 この発明は、タスクの実行時間が変化する場合に、時間パーティションの長さをタスクの実行時間に対応して設定し、時間パーティション内の空き時間を減らすことを目的とする。
【解決手段】 本発明に係る電子制御装置201は、非安全関連アプリケーションプログラム210と、安全関連アプリケーションプログラム211、212との、両アプリケーションプログラムに含まれる各タスクの実行に割り当てられる時間パーティションをアプリケーションプログラム毎に設定するOS213が、記憶部206に格納されたタスク実行時間決定情報208に基づき、タスクの実行時間に対応した時間パーティションの長さを導出する変換部214により導出された時間パーティションの長さに従って、アプリケーションプログラムに時間パーティションを設定するものである。
【選択図】 図1PROBLEM TO BE SOLVED: To reduce the free time in a time partition by setting the length of the time partition corresponding to the task execution time when the task execution time changes.
An electronic control unit 201 according to the present invention uses a time partition allocated to the execution of each task included in both application programs of a non-safety-related application program 210 and safety-related application programs 211 and 212 as an application program. The time partition length derived by the conversion unit 214 that the OS 213 set for each time derives the length of the time partition corresponding to the task execution time based on the task execution time determination information 208 stored in the storage unit 206. To set the time partition in the application program.
[Selection] Figure 1
Description
本発明は、時間パーティションを用いて、アプリケーションプログラムに含まれるタスクの実行を制御する電子制御装置に関する。 The present invention relates to an electronic control device that controls execution of a task included in an application program using a time partition.
自動車や船舶には、エンジンの点火時期やステアリングモータの制御を行うための電子制御装置(Electronic Control Unit:以下、ECU)が搭載されている。制御の高度化に伴い、ECUに実装されるアプリケーションソフトウェア(以下、アプリケーションS/W)の複雑化が進んでいる。さらに近年、ECUの機能安全規格ISO26262への対応が求められるようになってきている。機能安全規格ISO26262は、何らかの異常が発生した場合にも、安全を確保するための機能を備え、安全性を確保することを目的として定められたものである。 An automobile or a ship is equipped with an electronic control unit (hereinafter referred to as ECU) for controlling the ignition timing of the engine and the steering motor. With the advancement of control, application software (hereinafter referred to as application S / W) implemented in the ECU is becoming more complicated. In recent years, it has been demanded that the ECU conform to the functional safety standard ISO26262. The functional safety standard ISO 26262 has a function for ensuring safety even when some abnormality occurs, and is defined for the purpose of ensuring safety.
従来、ECUの複雑なアプリケーションS/Wを、機能安全規格を満たしながら効率よく開発するために、アプリケーションS/Wを、安全関連S/Wコンポーネントと、非安全関連S/Wコンポーネントの2種類のS/Wコンポーネントに分ける方法がある。
安全関連S/Wコンポーネントとは、機能安全規格が求める手法を実装した安全監視や安全制御を行うS/W部分のことである。さらに安全関連S/Wコンポーネントは、安全要求に応じて異なる安全度水準を持つ複数のS/Wコンポーネントに分割される場合もある。一方、非安全関連S/Wコンポーネントとは、自動車や船舶の通常制御を行うS/W部分のことである。
Conventionally, in order to efficiently develop a complex application S / W of an ECU while satisfying the functional safety standard, the application S / W is divided into two types of safety-related S / W components and non-safety-related S / W components. There is a method of dividing into S / W components.
The safety-related S / W component is an S / W portion that performs safety monitoring and safety control in which a method required by the functional safety standard is implemented. Further, the safety-related S / W component may be divided into a plurality of S / W components having different safety levels according to safety requirements. On the other hand, the non-safety-related S / W component is an S / W portion that performs normal control of automobiles and ships.
このように各S/Wコンポーネントを分けて、互いの独立性を保証することにより、通常制御を行うS/Wコンポーネントを機能安全規格の適用対象から除外した非安全関連S/Wコンポーネントとし、既存のS/Wを流用することができる。また、安全関連S/Wコンポーネントを安全度水準毎に分割することによって、各S/Wコンポーネントに、各安全度水準に適した安全手法を適用することができる。このように、S/Wコンポーネントをその内容に応じて分けることによって、S/Wコンポーネントを効率良く開発することができる。 By separating each S / W component in this way and ensuring its independence, the S / W component that performs normal control is defined as a non-safety-related S / W component that is excluded from the application of functional safety standards. S / W can be diverted. Further, by dividing the safety-related S / W component for each safety level, a safety technique suitable for each safety level can be applied to each S / W component. In this way, the S / W component can be efficiently developed by dividing the S / W component according to its contents.
同一マイクロコントローラ上に複数のS/Wコンポーネントを実装する場合、実行時間を複数に区切る時間パーティションと実行領域を複数に区切る空間パーティションを用いることで、これらS/Wコンポーネント間の独立性を保証することができる。ここでは、時間パーティションを用いたS/Wコンポーネント間の独立について図13を用いて説明する。図13は、背景技術にかかる、S/Wコンポーネントのタスクに対する時間パーティションの割り当てを示すタイムチャートである。この時間パーティションには、各S/Wコンポーネントにおける実行単位である、タスクが割り当てられる。タスクは、1つのS/Wコンポーネントに1つ以上存在し、異なるS/Wコンポーネントのタスクは異なる時間パーティションに割り当てる必要がある。同じS/Wコンポーネントのタスクは、複数の時間パーティションへ割り当ててもよい。 When a plurality of S / W components are mounted on the same microcontroller, independence between these S / W components is ensured by using a time partition that divides the execution time into a plurality of times and a spatial partition that divides the execution region into a plurality of areas. be able to. Here, independence between S / W components using a time partition will be described with reference to FIG. FIG. 13 is a time chart showing allocation of time partitions to S / W component tasks according to the background art. A task, which is an execution unit in each S / W component, is assigned to this time partition. One or more tasks exist in one S / W component, and tasks of different S / W components need to be assigned to different time partitions. Tasks with the same S / W component may be assigned to multiple time partitions.
図13では、非安全関連S/Wコンポーネントのタスクaとタスクb、安全関連S/Wコンポーネント1のタスクc、別の安全関連S/Wコンポーネント2のタスクdが、それぞれ時間パーティション1〜3に割り当てられている。
それぞれの時間パーティションには、開始時間と終了時間が設定され、その間の時間内においてのみ、時間パーティション内に割り当てられたタスクは実行される。これにより、例えば非安全関連S/Wコンポーネントのタスクbを実行中にエラーが発生し、タスクbが暴走しても、時間パーティションの区切りでハードウェアの機能を利用して強制的にタスクbの動作を終了させることができ、時間パーティション2や時間パーティション3に割り当てられた安全関連S/Wコンポーネントのタスクcやタスクdの動作に影響しないことを保証できる。よって各タスクがCPUの処理時間において混在することがなく、各S/Wコンポーネントが独立しているといえる。
In FIG. 13, task a and task b of the non-safety-related S / W component, task c of the safety-related S /
Each time partition is set with a start time and an end time, and tasks assigned in the time partition are executed only within the time between them. As a result, for example, even if an error occurs during execution of task b of the non-safety-related S / W component and task b runs away, the task b is forced to use the hardware function at the time partition break. The operation can be terminated, and it can be ensured that the operations of the task c and task d of the safety-related S / W component assigned to the
時間パーティションを用いたタスクの実行を制御する方法として、例えば特許文献1では、固定長の安全関連時間パーティションと固定長の非安全関連時間パーティションから構成される通常制御スケジュールを、一定周期のサイクルで繰り返す方法が提案されている。各時間パーティションの長さは、正常時にはタスクの実行を確実に完了できるように、タスクの最悪実行時間以上に設定しておく必要があり、いずれのサイクルにおいてもその必要があるため、時間パーティションに設定される各サイクル共通の固定長は必然的に長くなってしまう。そのため、最悪実行時間までかからずにタスクが完了した場合は、時間パーティション内に不要な空き時間が生じてしまう。空き時間とは、時間パーティション内において、タスクの実行が完了してからその時間パーティションの終了時間までの、プロセッサが実行するタスクが他に存在しない時間のことを言う。
異常が検知された場合に通常制御スケジュールから安全制御スケジュールに切り替わることで、1サイクルにおける時間パーティションの編成が変更されるが、通常制御スケジュール時と同様に、時間パーティションの固定長は、全サイクルにおけるタスクの最悪実行時間のうち最も長い時間に合わせて設定されるため、時間パーティション内に不要な空き時間が生じることがあることに変わりはない。(特許文献1の図5参照)
As a method for controlling the execution of a task using a time partition, for example, in
By switching from the normal control schedule to the safety control schedule when an abnormality is detected, the organization of the time partition in one cycle is changed. As with the normal control schedule, the fixed length of the time partition is Since it is set in accordance with the longest time of the worst execution time of the task, unnecessary free time may be generated in the time partition. (See FIG. 5 of Patent Document 1)
そこで、特許文献2では、各時間パーティションの長さは固定長であるものの、同一時間パーティション内に同一S/Wコンポーネントに属する複数のタスクを割り当てることによって、1つのタスクが終了しても、同一時間パーティション内で別のタスクを実行するようにし、この時間パーティションの空き時間を減らす方法が提案されている。(特許文献2の図15参照)
Therefore, in
上記の特許文献1、2のようなECUの制御では、周期的に実行されるタスクのサイクル番号や、車両の状態を示す入力情報や、以前の演算結果などによって、タスクの実行時間が変化する場合がある。
例えばECU起動直後において、他のECUは自身の起動を完了するまでは情報を送信しないため、他のECUからの情報を用いて演算するタスクはすぐに演算処理を終了することで実行時間が短くなったり、逆に初期化処理などを行うために実行時間が長くなったりする。また、例えば電波を送信して前方車両を検出することを目的として、様々な周波数を送信するようなレーダECUでは、偶数サイクルと奇数サイクルで異なる周波数を用いるために実行時間が変化する場合がある。特許文献1はこの変化に対応できず、その解決策として特許文献2が提案されていた。
In the control of the ECU as in the
For example, immediately after the ECU is started, other ECUs do not transmit information until their own startup is completed. Therefore, a task that is calculated using information from other ECUs immediately ends the calculation process, thereby shortening the execution time. Or, on the contrary, the execution time becomes longer due to initialization processing. For example, a radar ECU that transmits various frequencies for the purpose of detecting a vehicle ahead by transmitting radio waves may change the execution time because different frequencies are used in even cycles and odd cycles. .
しかし、ある時間パーティションに割り当てられるタスクが1つしかなく、このタスクの実行時間が前述のように変化する場合においては、同一時間パーティション内に複数のタスクを必要とする特許文献2の方法は適用できず、空き時間を減らすことはできない。
また、ある時間パーティションに割り当てられたタスクが複数あり、それらタスクの実行時間の総和が変化する場合に特許文献2の方法を適用しても、時間パーティションの長さが充分長く設定されていた場合、時間パーティション内のすべてのタスクを実行してもなお、空き時間が生じる恐れがある。
いずれにおいても、タスクの実行時間が変化する一方で、時間パーティションが固定長であるため、時間パーティション内の不要な空き時間が生じるという問題がある。
However, when there is only one task assigned to a certain time partition and the execution time of this task changes as described above, the method of
Also, when there are multiple tasks assigned to a certain time partition and the total time of those tasks changes, even if the method of
In any case, there is a problem that unnecessary execution time in the time partition is generated because the time partition has a fixed length while the task execution time changes.
本発明は、上記の課題を解決するためになされたものであり、タスクの実行時間が変化する場合に、周期的に実行されるタスクのサイクル番号や、車両の状態を示す入力情報、以前の演算結果などのタスクの実行時間が決まるための情報に基づき、時間パーティションの長さをタスクの実行時間に対応して設定することにより、時間パーティション内の空き時間を減らすことを目的としている。 The present invention has been made to solve the above problems, and when the execution time of the task changes, the cycle number of the task that is periodically executed, the input information indicating the state of the vehicle, the previous The purpose is to reduce the free time in the time partition by setting the length of the time partition corresponding to the execution time of the task based on information for determining the execution time of the task such as the calculation result.
本発明に係る電子制御装置は、演算処理手段と、通常時における制御対象の制御の実行に関連する非安全関連アプリケーションプログラムと、制御対象の異常監視又は異常時における制御対象の制御の実行に関連する安全関連アプリケーションプログラムの、少なくとも2種のアプリケーションプログラムと、アプリケーションプログラムに含まれるタスクの実行に割り当てられる時間パーティションをアプリケーションプログラム毎に設定するシステムプログラムと、タスクの実行時間が決まるためのタスク実行時間決定情報が格納される記憶部と、タスク実行時間決定情報に基づき、タスクの実行時間に対応した時間パーティションの長さを導出する変換部と、を備え、システムプログラムは、変換部により導出された時間パーティションの長さに従ってアプリケーションプログラムに時間パーティションを設定し、演算処理手段は、システムプログラムに設定された時間パーティションに従ってタスクを実行するものである。 The electronic control device according to the present invention relates to arithmetic processing means, a non-safety related application program related to execution of control of the control target at normal time, and monitoring of control target abnormality or execution of control of control target at the time of abnormality At least two types of safety-related application programs to be executed, a system program for setting a time partition allocated for execution of tasks included in the application program for each application program, and task execution time for determining task execution time A storage unit that stores the determination information; and a conversion unit that derives the length of the time partition corresponding to the task execution time based on the task execution time determination information. The system program is derived by the conversion unit Time party The set time partition to the application program according to the length, the processing means is for performing a task according to the configured time partition system program.
本発明に係る電子制御装置によれば、タスクの実行時間が変化する場合に、周期的に実行されるタスクのサイクル番号や、車両の状態を示す入力情報、以前の演算結果などのタスクの実行時間が決まるための情報に基づき、時間パーティションの長さをタスクの実行時間に対応して設定することにより、時間パーティション内の空き時間を減らすことができる。 According to the electronic control device of the present invention, when the execution time of the task changes, the execution of the task such as the cycle number of the periodically executed task, the input information indicating the state of the vehicle, the previous calculation result, etc. By setting the length of the time partition corresponding to the task execution time based on the information for determining the time, the free time in the time partition can be reduced.
以下、本発明の実施の形態について図面を参照しながら説明する。なお、図中における同等または対応する要素については同番号を付す。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In addition, the same number is attached | subjected about the equivalent or corresponding element in a figure.
実施の形態1.
以下に、本発明の実施の形態1に係る車載のレーダECU201について説明する。レーダECU201は、電波を送受信し、送受信した電波の周波数の差から、前方車両を検出し、自車との距離や相対速度を算出する機能を備える。ここでは電子制御装置として車載のレーダECU201を採用したが、これに限らず、船舶や飛行機、ロボット等の各種電子制御装置を採用できる。
The on-
図1は本発明の実施の形態1に係るレーダECUの構成図である。レーダECU201は、演算処理を行うプロセッサ202、送信アンテナ203と受信アンテナ204、送信アンテナ203と受信アンテナ204を制御する送受信ドライバ205、読み込みと書き込みが可能な揮発メモリ(以下、RAM) 206、読み込み専用の不揮発メモリ(以下、ROM)207を備える。
FIG. 1 is a configuration diagram of a radar ECU according to
プロセッサ202は、ROM207に格納されたアプリケーションプログラムを実行する。送信アンテナ203と受信アンテナ204は、電波の送受信を行う。送受信ドライバ205は、プロセッサ202でのアプリケーションプログラムの実行によって設定される電波の送信タイミングや送信周波数に従って、送信アンテナ203から電波を送信し、受信アンテナ204から受信した電波の周波数(測定データ)をRAM206へ格納する。RAM206には、サイクル番号情報208と、送受信ドライバ205からの測定データ209が格納される。ROM207には、信号処理プログラム210、安全監視プログラム211、ECU管理プログラム212、オペレーティングシステムプログラム(OS)213、変換テーブルA214、が格納されている。
The
ここで、プロセッサ202、RAM206はそれぞれ特許請求の範囲に記載の、演算処理手段、記憶部に相当する。ROM207に格納される信号処理プログラム210、安全監視プログラム211およびECU管理プログラム212はいずれもアプリケーションプログラムの1つであり、OS213はシステムプログラムである。
Here, the
信号処理プログラム210は、送信アンテナ203からの電波の送信タイミングを設定したり、受信アンテナ204を用いて取得した測定データ209を基に、前方車両と自車との距離や相対速度を演算したりするアプリケーションプログラムであり、通常時における制御対象の制御の実行に関連する非安全関連アプリケーションプログラムである。
信号処理プログラム210のタスクは、定期的に測定と演算を行うために、一定周期で実行開始する必要がある。また、送信アンテナ203から送信する電波の周波数帯域は、偶数サイクルと奇数サイクルで異なるように設定するものとする。
The
The task of the
偶数サイクルでは、近距離の測定を目的とした周波数帯域の電波を送信し、奇数サイクルでは、遠距離(広範囲)の測定を目的とした周波数帯域の電波を送信する。さらに、近距離の測定結果の精度を上げるため、測定する周波数のサンプリング数を、遠距離よりも多くとる。したがって、サンプリング数が多い偶数サイクルでは、信号処理プログラム210におけるタスクの実行時間が奇数サイクルよりも長くなる。
In the even cycle, radio waves in a frequency band intended for short-distance measurement are transmitted, and in the odd cycle, radio waves in a frequency band intended for long-range (wide range) measurement are transmitted. Furthermore, in order to increase the accuracy of the measurement result at a short distance, the sampling frequency of the frequency to be measured is larger than that at a long distance. Therefore, in an even cycle with a large number of samplings, the task execution time in the
安全監視プログラム211は、送受信ドライバ205の動作状態や、信号処理プログラム210の実行を監視するアプリケーションプログラムであり、各サイクルで実行する必要がある。この安全監視プログラム211は、安全関連アプリケーションプログラムの1つである。
The
ECU管理プログラム212は、安全監視プログラム211の実行結果に基づき、レーダECU201をスリープさせたり、シャットダウンさせたりするアプリケーションプログラムである。ECU管理プログラム212は、2サイクルに1回、実行する必要がある。このECU管理プログラム212も、安全関連アプリケーションプログラムの1つである。
The
ここでは説明を簡単にするために、プロセッサ202に実行される信号処理プログラム210、安全監視プログラム211、ECU管理プログラム212には、それぞれ1つのタスクが含まれているものとする。ただし、これらのアプリケーションプログラムにはそれぞれ複数のタスクが含まれることも当然ある。
Here, to simplify the description, it is assumed that the
OS213は、サイクル番号情報208を用いて変換テーブルA214を参照し、信号処理プログラム210、安全監視プログラム211、ECU管理プログラム212を割り当てる各時間パーティションの開始時間と終了時間を設定する。サイクル番号情報208は、OS213が、信号処理プログラム210の開始前に1ずつインクリメントするサイクルカウンタ(図示しない)によって情報が更新される。前述のように、信号処理プログラム210は一定周期で実行を開始する必要があり、安全監視プログラム211、ECU管理プログラム212の実行時間も考慮して、1サイクルは50ms周期とする。
The
変換テーブルA214は、サイクル番号情報208に対して、信号処理プログラム210、安全監視プログラム211及びECU管理プログラム212における時間パーティションの長さの対応関係を示すものである。この変換テーブルA214を図2に示す。
サイクル番号情報208が偶数である場合、信号処理プログラム210のタスク、安全監視プログラム211のタスク、ECU管理プログラム212のタスクが割り当てられる時間パーティションの長さは、それぞれ、45ms、5ms、0msである。すなわち、ECU管理プログラム212は偶数サイクルでは実行されない。
一方、サイクル番号情報208が奇数である場合、信号処理プログラム210のタスク、安全監視プログラム211のタスク、ECU管理プログラム212のタスクが割り当てられる時間パーティションの長さは、それぞれ、40ms、5ms、5msである。
The conversion table A214 indicates the correspondence relationship between the lengths of the time partitions in the
When the
On the other hand, when the
前述の通り、信号処理プログラム210のタスクの実行時間は、偶数サイクルの方が奇数サイクルよりも長くなるため、時間パーティションの長さも、偶数サイクルでは奇数サイクルより5ms長く設定している。すなわちここでは、偶数サイクルにおける信号処理プログラム210の最悪実行時間に若干余裕を持たせて45ms、奇数サイクルにおけるそれを40msとしている。なお、これらの時間パーティションの長さは、各アプリケーションプログラム(信号処理プログラム210、安全監視プログラム211、ECU管理プログラム212)の処理ステップ数から見積もったり、実測したりして、あらかじめ設定されるものである。
As described above, since the task execution time of the
時間パーティションの割り当て方法を、プロセッサ202が演算を処理する時間、すなわち演算処理時間を時間軸とした、図3のタイムチャートを用いて説明する。
例えばサイクル番号情報208が2のとき、サイクル番号情報208が偶数であるため、変換テーブルA214において、「信号処理プログラム210の時間パーティションの長さが45ms、安全監視プログラム211の時間パーティションの長さが5ms、ECU管理プログラム212には時間パーティションの割り当てなし」がOS213に参照される。OS213はこの情報に従って、演算処理時間が100ms〜150msの間に各アプリケーションプログラムの時間パーティションを割り当てる。プロセッサ202は、OS213が設定した時間パーティションに従って、100〜145msの間に信号処理プログラム210のタスクが、145ms〜150msの間に安全監視プログラム211のタスクが、それぞれ実行されるように、各タスクの起動と終了を行う。
A time partition allocation method will be described with reference to the time chart of FIG. 3, in which the time for which the
For example, when the
またサイクル番号情報208が3のとき、サイクル番号情報208が奇数であるため、変換テーブルA214において、「信号処理プログラム210の時間パーティションの長さが40ms、安全監視プログラム211とECU管理プログラム212の時間パーティションの長さがそれぞれ5ms」がOS213に参照される。OS213はこの情報に従って、演算処理時間が150ms〜200msの間に各アプリケーションプログラムの時間パーティションを割り当てる。プロセッサ202は、OS213が設定した時間パーティションに従って、150〜190msの間に信号処理プログラム210のタスクが、190ms〜195msの間に安全監視プログラム211のタスクが、195ms〜200msの間にECU管理プログラム212のタスクが、それぞれ実行されるように、各タスクの起動と終了を行う。
When the
OS213が上記時間パーティションを設定することにかかる実行時間は、図3のタイムチャートには明示していないが、各サイクルの境界において、次サイクルの各時間パーティションの開始時間と終了時間の設定を周期的に実行しているものである。ただし、この時間パーティションの設定は、例えば各時間パーティションの境界ごとに次の時間パーティションを設定するものでもよい。
なお、ここではOS213は絶対時間を参照して時間パーティションの開始時間と終了時間を設定しているが、サイクル開始時からの相対時間で設定するものであってもよい。
Although the execution time required for the
Here, the
時間パーティションを割り当てられた上で実行される、信号処理プログラム210のタスクの実行時間の例を図3の下部に示す。サイクル番号情報208が0、1、2、3でのタスクの実行時間は、それぞれ43ms、36ms、44ms、38msである。このようにタスクの実行時間はサイクル番号情報が偶数時に45ms以下、奇数時には40ms以下に決まるものである。このタスクの実行時間に対応して設定された各時間パーティションでの空き時間は、2ms、4ms、1ms、2msとなっている。ここで、各タスクは各時間パーティションの開始と同時に実行を開始している。
An example of the execution time of the task of the
ここで参考例として、本発明を適用せず、特許文献1の制御にあるような、いずれのサイクルにおいても時間パーティションの長さが固定であった場合の、時間パーティションの割り当て方法のタイムチャートを図4に示す。本発明の構成との比較のため、信号処理プログラム210の各サイクルにおけるタスクの実行時間は図3と同じであるとする。信号処理プログラム210のタスクが割り当てられる時間パーティションの長さは、どのサイクルでもタスク実行完了できるよう、偶数サイクルにおける最悪実行時間にあわせて設定するため、45msとする。安全監視プログラム211とECU管理プログラム212のタスクが割り当てられる時間パーティションの長さは5msである。したがって、1サイクルの長さは55msとなる。
Here, as a reference example, a time chart of a time partition allocation method when the length of the time partition is fixed in any cycle as in the control of
その結果、信号処理プログラム210のタスクが実行される時間パーティションの空き時間は、2ms、9ms、1ms、7msとなっており、図3と比較すると、空き時間が増加してしまうことがわかる。さらに、ECU管理プログラム212のタスクは、2サイクルに1回実行すればよいため、いずれのサイクルにおいても時間パーティションが割り当てられているものの、偶数サイクルでは実行されない。そのため、この不必要に設けられた時間パーティションの長さ(擬似的空き時間)も追加すると、各サイクルでの空き時間と擬似的空き時間の総和は、7ms、9ms、6ms、7msとなり、図3と比較すると、サイクル番号情報208が0〜4での空き時間の総和に対して3倍以上(2+4+1+2=9ms、7+9+6+7=29ms)になり、プロセッサ202の使用効率が低下していることがわかる。
As a result, the free time of the time partition in which the task of the
以上のように、この実施の形態1に記載された電子制御装置201は、演算処理手段202と、通常時における制御対象の制御の実行に関連する非安全関連アプリケーションプログラム210と、制御対象の異常監視又は異常時における制御対象の制御の実行に関連する安全関連アプリケーションプログラム211、212の、少なくとも2種のアプリケーションプログラムと、これらアプリケーションプログラムに含まれるタスクの実行に割り当てられる時間パーティションを、いずれのアプリケーションプログラムにも設定するシステムプログラム213と、タスクの実行時間が決まるためのタスク実行時間決定情報208が格納される記憶部206と、タスク実行時間決定情報208に基づき、タスクの実行時間に対応した時間パーティションの長さを導出する変換部214とを備える。ここで、システムプログラム213は、変換部214に導出された時間パーティションの長さに従ってアプリケーションプログラムに時間パーティションを設定するものであり、演算処理手段202は、システムプログラム213を実行することによって、時間パーティション内に割り当てられたタスクを実行するものである。
この構成により、アプリケーションプログラム(信号処理プログラム210、安全監視プログラム211、ECU管理プログラム212)間の独立性を保ちながら、各時間パーティション内の不要な空き時間を減らすことができる。
As described above, the
With this configuration, unnecessary free time in each time partition can be reduced while maintaining independence among application programs (
以上の効果を有する構成に加えて、本発明では、演算処理手段202による演算処理時間の1サイクルには、複数の時間パーティションが含まれ、変換部214は、複数の時間パーティションの長さを導出する変換テーブルAからなっており、複数の時間パーティションのうち、少なくとも1つの時間パーティションについて、タスク実行時間決定情報208に基づき、タスクの実行時間に対応した時間パーティションの長さを導出している。さらに、システムプログラム213は所定の周期でサイクル内の時間パーティションを設定している。
この構成により、例えば信号処理プログラム210のタスクを一定周期で実行開始する必要がある場合等に対応が容易となり、1サイクルをまとめて時間パーティション設定することが可能なため設定回数を減らし、さらに所定の周期での設定であるため、制御が複雑になることがない。また、予め設定された変換テーブルであるため、時間パーティションの設定に要する時間が短く、その設定が複雑になることがない。
In addition to the configuration having the above effects, in the present invention, one cycle of calculation processing time by the
With this configuration, for example, when it is necessary to start execution of a task of the
また、演算処理時間の1サイクルに従って、周期的にインクリメントされるサイクルカウンタを備え、タスク実行時間決定情報208は、サイクルカウンタの値に基づくものである。
この構成により、偶奇数周期やスタートアップ時におけるタスクの処理内容が変化することでタスクの実行時間が変化する場合に、この実行時間の変化に適応して、各時間パーティション内の不要な空き時間を減らすことができる。
In addition, a cycle counter that is periodically incremented according to one cycle of the arithmetic processing time is provided, and the task execution
With this configuration, if the task execution time changes due to even odd cycles or changes in task processing at startup, the unused free time in each time partition is adjusted to accommodate this change in execution time. Can be reduced.
さらにまた、それぞれのサイクルには対応するアプリケーションプログラム(信号処理プログラム210)の時間パーティションが含まれ、この時間パーティションの長さがサイクルによって異なり、この対応する時間パーティションの長さの長短の差を利用して、対応する時間パーティションとは異なるアプリケーションプログラム(ECU管理プログラム212)の時間パーティションがサイクル内に含まれている。
この構成により、1サイクルの長さを短縮しつつ、1サイクル内で実行できるタスク数を増加することができる。具体的には、信号処理プログラム210の時間パーティションの長さが短い奇数サイクルでは、短くなった分、すなわち、対応する時間パーティションの長さの長短の差を利用して、ECU管理プログラム212の時間パーティションを加えることができ、プロセッサ202の使用効率を向上させることができる。そのうえ、1サイクルの時間が参考例の図4よりも短くなるため、信号処理プログラム210の実行頻度を増やすことができる。レーダECU201においては、所定のサイクル周期で前方車両と自車との距離や相対速度の算出を行っているため、その算出頻度が増え、きめ細かい制御が可能になる。
Furthermore, each cycle includes a time partition of the corresponding application program (signal processing program 210). The length of the time partition varies depending on the cycle, and the difference between the lengths of the corresponding time partitions is used. Thus, a time partition of an application program (ECU management program 212) different from the corresponding time partition is included in the cycle.
With this configuration, the number of tasks that can be executed in one cycle can be increased while shortening the length of one cycle. Specifically, in the odd cycle in which the length of the time partition of the
また、本実施の形態1では、1サイクルごとの所定周期で、変換部に導出された時間パーティションの長さに従ってアプリケーションプログラムに時間パーティションを設定したがこれに限らず、不定期で、または特定のサイクル番号のみを、変換部を用いた本発明の設定方法によって設定するものであってもよい。この具体例については実施の形態2に後述する。また、本実施の形態1では、1サイクル内において信号処理プログラム210のみの時間パーティションの長さを可変としたが、1サイクル内において複数のアプリケーションプログラムの時間パーティションの長さを可変とするものでもよく、安全関連アプリケーションプログラムの時間パーティションの長さも可変にできる。さらに、時間パーティション内に複数のタスクがあり、それらタスクの実行時間の総和に対応して時間パーティションの長さを導出するものでもよい。
In the first embodiment, the time partition is set in the application program according to the length of the time partition derived to the conversion unit at a predetermined cycle for each cycle. However, the present invention is not limited to this. Only the cycle number may be set by the setting method of the present invention using the conversion unit. A specific example will be described later in the second embodiment. In the first embodiment, the length of the time partition of only the
さらにまた、変換部で導出される時間パーティションの長さは絶対量に限らず、基本的な時間パーティションの長さに対する相対的な変化量であってもよい。例えば、1サイクルにおける各時間パーティションとその長さの編成を定めた基本テーブルを用意し、特定のサイクル番号の場合に、基本テーブルで定めた時間パーティションの長さに対する変化量を変換部で導出し、この変化量(相対量)と基本テーブルにおける時間パーティションの長さ(絶対量)から得られる特定のサイクル番号における時間パーティションの長さ(絶対量)に従って、アプリケーションプログラムに時間パーティションを設定するものであってもよい。 Furthermore, the length of the time partition derived by the conversion unit is not limited to the absolute amount, and may be a relative change amount with respect to the length of the basic time partition. For example, a basic table that defines the organization of each time partition and its length in one cycle is prepared. In the case of a specific cycle number, the conversion unit derives the amount of change with respect to the time partition length defined in the basic table. The time partition is set in the application program according to the time partition length (absolute amount) at a specific cycle number obtained from this change amount (relative amount) and the time partition length (absolute amount) in the basic table. There may be.
また、サイクル番号情報を偶数と奇数の2つに分類して信号処理プログラム210の時間パーティションの長さを長い方と短い方にそれぞれ設定したが、例えばサイクル番号情報を3つ以上に分類することに対応して、時間パーティションの長さを3つ以上に異ならせて設定してもよい。また、レーダECU201による制御開始直後であるサイクル番号情報208が小さい数字の場合に、初期化処理実行のために時間パーティションの長さを長く設定するものであっても良い。
In addition, the cycle number information is classified into even and odd numbers, and the time partition length of the
本実施の形態1では、記憶部に格納されるタスク実行時間決定情報であるサイクル番号情報0、1、2・・・を用いてシステムプログラムが偶数、奇数を判断し、変換部を参照して時間パーティションを設定しているが、変換部が偶数、奇数を判断したり、時間パーティションの長さを算出したりするものであってもよく、記憶部はサイクル番号情報から得られる偶数、奇数といった二次情報を格納するものでもよい。
In the first embodiment, the system program uses the
なお、タスク実行時間決定情報によってタスクの実行時間が決まるとは、例えば43msや36msというように一点に決まるものに限らず、上記で説明した45ms以下や40ms以下のように、ある幅をもって決まるものでもよく、この決定によって時間パーティションの空き時間が減少するものであればよい。 The task execution time determined by the task execution time determination information is not limited to one point such as 43 ms or 36 ms, but is determined with a certain width such as 45 ms or less or 40 ms or less as described above. However, it is sufficient if the free time of the time partition is reduced by this determination.
次に、図1に示したレーダECUを用いて、信号処理プログラム210のタスク実行中にエラーが発生し、割り当てられた時間パーティション内でタスクが完了しない場合について、図5を用いて説明する。図5は、本実施の形態1にかかる、エラー発生時における時間パーティションの割り当てを示すタイムチャートである。図5の下部には信号処理プログラム210のタスクの実行時間も記している。
サイクル番号情報208が1となるサイクルにおいて、すなわち、信号処理プログラム210の時間パーティションの長さが40msの場合において、信号処理プログラム210のタスクの実行時間が36msの時点で、エラーが発生し、タスクの実行が完了しないとする。このとき、エラー発生から4ms後には、信号処理プログラム210の時間パーティションが強制的に終了する。信号処理プログラム210の後に割り当てられていた安全監視プログラム211がすぐさま実行されることによって信号処理プログラム210のタスクが完了していないことが検出され、エラーが発生していると判断される。
Next, a case where an error occurs during task execution of the
In the cycle in which the
この図5の状況に対して、本発明を適用していない場合として、図4に記載した参考例においてエラーが発生した場合について、参考例として図6を用いて説明する。図6は、参考例にかかる、エラー発生時における時間パーティションの割り当てを示すタイムチャートである。図6の下部には信号処理プログラム210のタスクの実行時間も記している。
各信号処理プログラム210の時間パーティションの長さはいずれも45msに設定されている。エラー発生時点は、図5と同じ36msとすると、信号処理プログラム210の時間パーティションの長さが図5よりも長い分、エラー発生から9ms後に、信号処理プログラム210の時間パーティションが強制的に終了する。その後に割り当てられていた安全監視プログラム211が実行することによってエラーが発生しているとようやく判断される。
With respect to the situation of FIG. 5, a case where an error occurs in the reference example shown in FIG. 4 as a case where the present invention is not applied will be described with reference to FIG. FIG. 6 is a time chart showing time partition allocation when an error occurs according to the reference example. The task execution time of the
The length of the time partition of each
このように図5と図6を比較することで分かるように、図5では本発明を適用することによって、アプリケーションプログラムに含まれるタスクの実行時間に対応させて時間パーティションの長さを設定できるため、時間パーティション内でエラーが発生した場合に、エラーを検出するまでの時間が短くなり、その結果、エラーに対して早く処理を開始できる。 As can be seen by comparing FIG. 5 and FIG. 6, the time partition length can be set in accordance with the task execution time included in the application program in FIG. 5 by applying the present invention. When an error occurs in the time partition, the time until the error is detected is shortened, and as a result, the processing can be started early with respect to the error.
実施の形態2.
次に、本発明の実施の形態2に関して、以下に図を用いて説明する。実施の形態1と同様なものについては説明を省略し、実施の形態1と異なる点、新たな点について詳述する。図7は、実施の形態2に係るレーダECUの構成図である。
Next, a second embodiment of the present invention will be described with reference to the drawings. The description of the same components as those in the first embodiment will be omitted, and differences and new points from the first embodiment will be described in detail. FIG. 7 is a configuration diagram of the radar ECU according to the second embodiment.
本実施の形態2に係るレーダECU801は、実施の形態1で説明した機能に加えて、次の2つの機能を備える。1つ目は、レーダECU801が他のECU(図示せず)とCAN(Controller Area Network)を介して接続しており、他のECUから測定停止シグナルを受信した場合に、送受信ドライバ205の設定を変更して、送信アンテナ203や受信アンテナ204での電波の送受信と、測定データ209を用いた演算の実行を停止するようにした後、レーダECU801を消費電力の低いスリープ状態へ移行する機能である。2つ目は、自車前方の遠距離の測定時に物体が検出されなかった場合、次の遠距離の測定時には受信した電波のサンプリング数を下げて、演算処理にかかる時間を短くする機能である。
The
レーダECU801は、CAN通信コントローラ802を備える。CAN通信コントローラ802は、他のECUと通信プロトコルCANに従ってメッセージの送受信を行う。なお、通信プロトコルはCANに限定されるものではなく、FlexRayやLINなど、他の通信プロトコルであってもよい。このCAN通信コントローラ802は、外部装置から情報を受け取る情報入力手段の一具体例である。
The
RAM803には、サイクル番号情報208と測定データ209に加えて、スリープフラグ804とデータ数減少フラグ805が格納される。
スリープフラグ804は、ECU管理プログラム808によってセットあるいはクリアされる。セットされている場合には、次のECU管理プログラム808のタスク実行時に、レーダECU801がスリープ状態へ移行することを示している。
データ数減少フラグ805は、信号処理プログラム807によってセットあるいはクリアされる。セットされている場合には、次の奇数サイクルにおいて、信号処理プログラム807におけるサンプリング数を減らすことを示す。
The
The
The data number reduction flag 805 is set or cleared by the
スリープフラグ804のセットの有無、およびデータ減少フラグ805のセットの有無が、特許請求の範囲に記載のタスク実行時間決定情報であり、ここではサイクル番号情報208と合わせて、3種類のタスク実行時間決定情報が利用されている。このスリープフラグ804、データ数減少フラグ805及びサイクル番号情報208に対して優先度をつけ、この優先度に従って参照する変換テーブルを決定している。
Whether or not the
ROM806には、信号処理プログラム807、安全監視プログラム211、ECU管理プログラム808、変換テーブルA214、オペレーティングシステム(OS)809に加えて、変換テーブルB810と変換テーブルC811が格納されている。
In addition to the
信号処理プログラム807は、各サイクルの最初に、スリープフラグ804がセットされているか確認し、セットされている場合には、送受信ドライバ205の設定を変更して、電波の送受信を停止し、測定データ209を用いた演算の実行は行わない。
また、信号処理プログラム807は、遠距離の測定データ209を用いた演算結果により、自車前方に物体を検出しなかった場合には、RAM803のデータ数減少フラグ805をセットする。
また、遠距離の測定データ209を用いた演算を行う奇数サイクルの最初に、データ数減少フラグ805がセットされているか確認し、セットされている場合には、サンプリング数を下げるように送受信ドライバ205を設定するとともに、減少したサンプリング数に対応する演算処理を実行する。
The
Further, the
In addition, at the beginning of an odd cycle in which the calculation using the long-
ECU管理プログラム808は、CAN通信コントローラ802から測定停止シグナルを受信すると、スリープフラグ804をセットする。また、スリープフラグ804をセットした後、次にECU管理プログラム808が実行される2サイクル経過後に消費電力を下げるためにプロセッサ202の動作を停止し、レーダECU801をスリープさせる。スリープフラグ804がセットされてから、スリープに入るまでに、他のアプリケーションプログラム(信号処理プログラム807、安全監視プログラム211)は、スリープに向けた終了処理などを行うことができる。
When the
変換テーブルB810は、スリープフラグ804がセットされている場合の、信号処理プログラム807における時間パーティションの長さを示すものである。この変換テーブルB810を図8に示す。このとき、信号処理プログラム807は、送信アンテナ203や受信アンテナ204からの電波の送受信を停止するため、送受信ドライバ205の設定変更のみを行い、測定データ209を用いた演算は行わない。したがって実行時間が短くなることから、信号処理プログラム807に割り当てられる時間パーティションの長さは15msとなり、変換テーブルA214と比較すると、割り当てられる時間パーティションの長さが短くなっている。
The
変換テーブルC811は、データ数減少フラグ805がセットされている場合の、信号処理プログラム807におけるサイクル番号情報が奇数時の時間パーティションの長さを示すものである。この変換テーブルC811を図9に示す。このとき、信号処理プログラム807に割り当てられる時間パーティションの長さは30msである。データ数が減少しており、信号処理プログラム807の実行時間は短くなることから、変換テーブルA214と比較すると、割り当てられる時間パーティションの長さが短くなっている。
The conversion table C811 indicates the length of the time partition when the cycle number information in the
続いて、本実施の形態2に係るOS809が、信号処理プログラム807のタスクに割り当てられる時間パーティションの長さを設定する際の動作を、図10のフローチャートを用いて説明する。
Next, the operation when the OS 809 according to the second embodiment sets the length of the time partition allocated to the task of the
OS809は、信号処理プログラム807のタスクに割り当てられる時間パーティションの設定を開始すると、まずステップS1101において、スリープフラグ804を参照する。スリープフラグ804がセットされている場合にはステップS1105に進み、セットされていない場合にはステップS1102に進む。
When starting the setting of the time partition assigned to the task of the
ステップS1102に進んだ場合には、OS809はサイクル番号情報208を参照する。そしてサイクル番号情報208が偶数である場合にはステップS1106へ進み、奇数の場合にはステップS1103に進む。
When the processing proceeds to step S1102, the OS 809 refers to the
ステップS1103に進んだ場合には、OS809はさらにデータ数減少フラグ805を参照する。そしてデータ数減少フラグ805がセットされている場合にはステップS1107に進み、セットされていない場合にはステップS1104に進む。ステップS1104に進んだ場合には、変換テーブルA214を参照し、時間パーティションの長さを40msに設定して、信号処理プログラム807に対する時間パーティションの長さの設定処理を終了する。
When the processing proceeds to step S1103, the OS 809 refers to the data number reduction flag 805. If the data number reduction flag 805 is set, the process proceeds to step S1107. If not set, the process proceeds to step S1104. If the process proceeds to step S1104, the conversion table A214 is referred to, the time partition length is set to 40 ms, and the time partition length setting process for the
一方、ステップS1101においてスリープフラグ804がセットされており、ステップS1105に進んだ場合には、変換テーブルB810を参照し、時間パーティションの長さを15msに設定して、信号処理プログラム807に対する時間パーティションの長さの設定処理を終了する。
On the other hand, if the
また、ステップS1102においてサイクル番号情報208が偶数であり、ステップS1106に進んだ場合には、変換テーブルA214を参照し、時間パーティションの長さを45msに設定して、信号処理プログラム807に対する時間パーティションの長さの設定処理を終了する。
When the
ステップS1103においてデータ数減少フラグ805がセットされており、ステップS1107に進んだ場合には、変換テーブルC811を参照し、時間パーティションの長さを30msに設定して、信号処理プログラム807に対する時間パーティションの長さの設定処理を終了する。
When the data number reduction flag 805 is set in step S1103 and the process proceeds to step S1107, the conversion table C811 is referred to, the time partition length is set to 30 ms, and the time partition for the
このように、OS809は右記の各タスク実行時間決定情報を、スリープフラグ804、サイクル番号情報208、データ数減少フラグ805の順に高い優先度をつけて、参照する変換テーブルを決定し、時間パーティションの長さを設定する。
In this way, the OS 809 assigns each task execution time determination information on the right to the sleep table 804, the
次に、図11に示すタイムチャートを用いて、他のECUから測定停止シグナルを受信したときの、図10のフローチャートによるOS809の一連の処理を説明する。図11は、スリープフラグセット時の、時間パーティションの割り当てを示すタイムチャートである。 Next, a series of processes of the OS 809 according to the flowchart of FIG. 10 when a measurement stop signal is received from another ECU will be described using the time chart shown in FIG. FIG. 11 is a time chart showing time partition allocation when the sleep flag is set.
サイクル番号情報208が1のときにおいて、ECU管理プログラム808のタスク実行時に、ECU管理プログラム808が、CAN通信コントローラ802から測定停止シグナルを受信し、スリープフラグ804をセットしたとする。次に、OS809はECU管理プログラム808の時間パーティションを終了し、サイクル番号情報208を2にインクリメントするとともに、次の信号処理プログラム807の時間パーティションの設定を開始する。
Assume that when the
そしてステップS1101において、スリープフラグ804がセットされているか確認する。ここで、ECU管理プログラム808によって既にセットされているため、ステップS1105に進む。次に変換テーブルB810を参照し、信号処理プログラム807の時間パーティションの長さを15msに設定して処理を終了する。サイクル番号情報208が偶数のため、安全監視プログラム211時間パーティションの長さは5msに設定され、ECU管理プログラムの時間パーティションは設定されない。
In step S1101, it is confirmed whether the
続いて信号処理プログラム807のタスクが起動すると、送受信ドライバ205の設定を変更して、電波の送受信を停止する。測定データ209を用いた演算の実行は行わないため、実行時間が短くなり、15ms以内に処理を終了する。
その結果、実施の形態1において図4の参考例で示した、時間パーティションの長さが45msで固定された状態で停止処理を行う場合と比較すると、信号処理プログラム807の時間パーティションにおける不要な空き時間は30ms短縮できることがわかる。
Subsequently, when the task of the
As a result, compared with the case where the stop process is performed in the state where the length of the time partition is fixed at 45 ms as shown in the reference example of FIG. 4 in the first embodiment, unnecessary empty space in the time partition of the
次のサイクル番号情報208が3のときにおいて、信号処理プログラム807におけるレーダECU801のスリープに向けた動作も、タスクの実行時間が短くなるため、信号処理プログラム807の時間パーティションの長さを15msに設定する。安全監視プログラム211、ECU管理プログラム808の時間パーティションの長さは、サイクル番号情報208が奇数のため、いずれも5msに設定される。この設定された時間パーティション内で各タスクが実行することで、図4に示した参考例に比べて30ms以上時間を短縮して、レーダECU801をスリープ状態にすることが可能となる。
When the next
このように、本実施の形態2における上記の発明は、他のECUから受信したシグナル情報に基づいて、信号処理プログラム807のタスクを実行する時間パーティションの長さを変更している。すなわち、タスク実行時間決定情報(スリープフラグ804のセットの有無)は、情報入力手段が外部装置から受け取る情報に基づくものであり、このタスク実行時間決定情報に基づきタスクの実行時間に対応した時間パーティションの長さが導出される。
このことにより、外部装置からの車両状態情報などに応じてタスクの処理内容が変化することでタスクの実行時間が変化する場合にも対応して、アプリケーションプログラム(信号処理プログラム807、安全監視プログラム211、ECU管理プログラム808)間の独立性を保ちながら、時間パーティション内の不要な空き時間を減らすことができる。
As described above, the above-described invention according to the second embodiment changes the length of the time partition for executing the task of the
As a result, the application program (
また、同時にデータ数減少フラグ805がセットされている場合であっても、スリープフラグ804の状態を優先的に確認することにより、信号処理プログラム807のタスクの実行時間に適した時間パーティションを設定している。すなわち、複数の種類のタスク実行時間決定情報がそれぞれ優先度を持ち、優先度に応じて、変換部において時間パーティションの長さの導出に利用されるタスク実行時間決定情報を決定している。
そのため、複数種のタスク実行時間決定情報から、時間パーティション内の不要な空き時間を減らす量や実行されるタスクの緊急度合等に応じて、空き時間を適切に減らすことができる。
Even if the data count reduction flag 805 is set at the same time, a time partition suitable for the task execution time of the
Therefore, the idle time can be appropriately reduced according to the amount of reduction in unnecessary idle time in the time partition, the urgency level of the task to be executed, and the like from the plural types of task execution time determination information.
次に、図12に示すタイムチャートを用いて、自車前方の遠距離の測定時に物体が検出されなかったときの、図10のフローチャートによるOS809の一連の処理を説明する。このとき、他のECUから測定停止シグナルは受信せず、スリープフラグ804はセットされていないものとする。図12は、データ数減少フラグセット時の、時間パーティションの割り当てを示すタイムチャートである。
Next, a series of processing of the OS 809 according to the flowchart of FIG. 10 when an object is not detected when measuring a long distance ahead of the host vehicle will be described using the time chart shown in FIG. At this time, it is assumed that a measurement stop signal is not received from another ECU and the
サイクル番号情報208が1のときにおいて、信号処理プログラム807のタスクでは、遠距離用の電波の送受信と演算処理を実行する。ここで、自車遠方に物体が検出されなかったため、信号処理プログラム807はデータ数減少フラグ805をセットする。その後、サイクル番号情報208が2、3にインクリメントされる度に、OS809は、次の信号処理プログラム807の時間パーティションの設定を開始し、ステップS1101において、スリープフラグ804がセットされているか確認する。スリープフラグ804はセットされていないため、ステップS1102に進み、サイクル番号情報208を参照する。そしてサイクル番号情報208が奇数の3となったとき、ステップS1103に進む。
なお、奇数サイクルにおける、自車前方の遠距離の測定時に物体が検出されなかったという演算結果が、特許請求の範囲における、以前のタスクの実行結果に相当する。
When the
In addition, the calculation result that an object was not detected at the time of measuring a long distance ahead of the host vehicle in an odd cycle corresponds to the execution result of the previous task in the claims.
ステップS1103において、OS809はデータ数減少フラグ805がセットされているか確認する。データ数減少フラグ805はサイクル番号情報208が1のときにセットしているため、ステップS1107に進み、OS809は変換テーブルC811を参照し、信号処理プログラム807の時間パーティションの長さを30msに設定して処理を終了する。安全監視プログラム211、ECU管理プログラム808の時間パーティションの長さは、実施の形態1と同様に、サイクル番号情報208が奇数のため、いずれも5msに設定される。
In step S1103, the OS 809 checks whether the data number reduction flag 805 is set. Since the data number reduction flag 805 is set when the
続いて信号処理プログラム807のタスクが起動すると、送受信ドライバ205の設定を変更して、測定サンプリング数を下げ、その分減少した測定データ209に対して演算処理を実行する。減少した分、実行時間が短くなり、30ms以内に処理を終了する。
その結果、図4で示した、時間パーティションの長さが45msで固定されている参考例と比較すると、信号処理プログラム807の時間パーティションの不要な空き時間は15ms短縮できることがわかる。
Subsequently, when the task of the
As a result, as compared with the reference example shown in FIG. 4 in which the length of the time partition is fixed at 45 ms, it can be seen that the unnecessary free time of the time partition of the
このように、本実施の形態2におけるもう1つの発明は、以前のタスクの実行結果として、奇数サイクルにおいて、自車前方の遠距離の測定時に物体が検出されなかった場合、データ数減少フラグ805がセットされ、次の奇数サイクルにおいて、信号処理プログラム807のタスクを実行する時間パーティションの長さを変更している。すなわち、タスク実行時間決定情報(データ数減少フラグ805のセットの有無)は、以前のタスクの実行結果に基づくものであり、このタスク実行時間決定情報に基づきタスクの実行時間に対応した時間パーティションの長さが導出される。
このことにより、以前のタスクの実行結果に応じてタスクの内容が変化することでタスクの実行時間が変化する場合にも対応して、アプリケーションプログラム(信号処理プログラム807、安全監視プログラム211、ECU管理プログラム808)間の独立性を保ちながら、時間パーティション内の不要な空き時間を減らすことができる。
As described above, another invention according to the second embodiment is that, as an execution result of the previous task, if no object is detected during long distance measurement in front of the host vehicle in the odd cycle, the data number reduction flag 805 Is set, and the length of the time partition for executing the task of the
As a result, the application program (
なお、図11や図12のタイムチャートでは、信号処理プログラム807の時間パーティションが短くなった分、同じサイクル内で処理を実行しない時間が増加している。ここには実施の形態1に示したように、他の時間パーティションを割り当てて、他のアプリケーションプログラムのタスクを実行するようにしても良いため、時間パーティションの割り当ての自由度が向上する。
In the time charts of FIGS. 11 and 12, the time during which processing is not executed in the same cycle increases as the time partition of the
また、本実施の形態2では、外部装置からの入力情報として、ネットワークを介して受信した情報を用いたが、本発明はこれに限定されるものではない。例えば、レーダECU801に直接接続されたセンサからの情報を用いて、時間パーティションの長さを変更するものであってもよい。
In the second embodiment, information received via a network is used as input information from an external device, but the present invention is not limited to this. For example, the length of the time partition may be changed using information from a sensor directly connected to the
以上に説明した実施の形態1、2の構成、動作に限定されることはなく、本発明の範囲内にある限り、別な構成、動作へ変更を加えて実施してもよい。
The present invention is not limited to the configurations and operations of
201、801 レーダECU
202 プロセッサ
206、803 RAM
208 サイクル番号情報
210、807 信号処理プログラム
211 安全監視プログラム
212、808 ECU管理プログラム
213、809 オペレーティングシステムプログラム(OS)
214 変換テーブルA
802 CAN通信コントローラ
804 スリープフラグ
805 データ数減少フラグ
810 変換テーブルB
811 変換テーブルC
201, 801 Radar ECU
202
208
214 Conversion table A
802
811 Conversion table C
Claims (7)
通常時における制御対象の制御の実行に関連する非安全関連アプリケーションプログラムと、前記制御対象の異常監視又は異常時における前記制御対象の制御の実行に関連する安全関連アプリケーションプログラムの、少なくとも2種のアプリケーションプログラムと、
前記アプリケーションプログラムに含まれるタスクの実行に割り当てられる時間パーティションを前記アプリケーションプログラム毎に設定するシステムプログラムと、
前記タスクの実行時間が決まるためのタスク実行時間決定情報が格納される記憶部と、
前記タスク実行時間決定情報に基づき、前記タスクの実行時間に対応した時間パーティションの長さを導出する変換部と、
を備え、
前記システムプログラムは、前記変換部により導出された前記時間パーティションの長さに従って前記アプリケーションプログラムに前記時間パーティションを設定し、
前記演算処理手段は、前記システムプログラムに設定された前記時間パーティションに従って前記タスクを実行する
ことを特徴とする電子制御装置。 Arithmetic processing means;
At least two types of applications, that is, a non-safety related application program related to execution of control of the controlled object at normal time and a safety related application program related to execution of control of the controlled object at the time of abnormality monitoring of the controlled object Program and
A system program that sets, for each application program, a time partition that is allocated to the execution of tasks included in the application program;
A storage unit for storing task execution time determination information for determining the execution time of the task;
Based on the task execution time determination information, a conversion unit for deriving the length of the time partition corresponding to the execution time of the task;
With
The system program sets the time partition in the application program according to the length of the time partition derived by the conversion unit,
The electronic control device, wherein the arithmetic processing means executes the task according to the time partition set in the system program.
前記変換部は、前記複数の時間パーティションの長さを導出する変換テーブルを有すると共に、前記複数の時間パーティションのうち、少なくとも1つの前記時間パーティションについて、前記タスク実行時間決定情報に基づき、前記タスクの実行時間に対応した前記時間パーティションの長さを導出し、
前記システムプログラムは所定の周期で前記サイクル内の前記時間パーティションを設定する
ことを特徴とする請求項1に記載の電子制御装置。 One cycle of the calculation processing time by the calculation processing means includes a plurality of the time partitions,
The conversion unit has a conversion table for deriving the lengths of the plurality of time partitions, and at least one of the plurality of time partitions is based on the task execution time determination information for the task. Deriving the length of the time partition corresponding to the execution time,
The electronic control apparatus according to claim 1, wherein the system program sets the time partition in the cycle at a predetermined period.
前記1サイクルに従って、周期的にインクリメントされるサイクルカウンタを備え、
前記タスク実行時間決定情報は、前記サイクルカウンタの値に基づくものである
ことを特徴とする請求項1又は2に記載の電子制御装置。 One cycle of the calculation processing time by the calculation processing means includes a plurality of the time partitions,
A cycle counter that is periodically incremented according to the one cycle;
The electronic control device according to claim 1, wherein the task execution time determination information is based on a value of the cycle counter.
前記対応する時間パーティションの長さが前記サイクルによって異なり、前記対応する時間パーティションの長さの長短の差を利用して、前記対応する時間パーティションとは異なる前記時間パーティションが前記サイクル内に含まれる
ことを特徴とする請求項2又は3に記載の電子制御装置。 Each said cycle contains a corresponding time partition,
The length of the corresponding time partition varies depending on the cycle, and the time partition different from the corresponding time partition is included in the cycle by using the difference in length between the corresponding time partitions. The electronic control device according to claim 2 or 3.
前記タスク実行時間決定情報は、前記情報入力手段で受け取る情報に基づくものである
ことを特徴とする請求項1乃至4のいずれかに記載の電子制御装置。 Comprising an information input means for receiving information from an external device;
The electronic control device according to claim 1, wherein the task execution time determination information is based on information received by the information input unit.
ことを特徴とする請求項1乃至5のいずれかに記載の電子制御装置。 6. The electronic control device according to claim 1, wherein the task execution time determination information is based on a previous execution result of the task.
前記優先度に応じて、前記変換部において前記時間パーティションの長さの導出に利用される前記タスク実行時間決定情報が決定する
ことを特徴とする請求項1乃至6のいずれかに記載の電子制御装置。 Each type of task execution time determination information has a priority,
7. The electronic control according to claim 1, wherein the task execution time determination information used for deriving the length of the time partition is determined in the conversion unit according to the priority. apparatus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013187517A JP5594416B1 (en) | 2013-09-10 | 2013-09-10 | Electronic control unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013187517A JP5594416B1 (en) | 2013-09-10 | 2013-09-10 | Electronic control unit |
Publications (2)
Publication Number | Publication Date |
---|---|
JP5594416B1 true JP5594416B1 (en) | 2014-09-24 |
JP2015054550A JP2015054550A (en) | 2015-03-23 |
Family
ID=51702079
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013187517A Active JP5594416B1 (en) | 2013-09-10 | 2013-09-10 | Electronic control unit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5594416B1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6424797B2 (en) * | 2015-11-02 | 2018-11-21 | 株式会社デンソー | In-vehicle device |
-
2013
- 2013-09-10 JP JP2013187517A patent/JP5594416B1/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015054550A (en) | 2015-03-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8417990B2 (en) | Multi-core processing system for vehicle control or an internal combustion engine controller | |
US11416293B2 (en) | Control unit having a scheduler for scheduling a plurality of virtual machines, and methods for scheduling a plurality of virtual machines | |
JP5671388B2 (en) | Communication system and communication apparatus | |
US20110022809A1 (en) | Consolidated electronic control unit and relay program implemented in the same | |
JP5829890B2 (en) | Semiconductor data processing apparatus, time trigger communication system, and communication system | |
US10503544B2 (en) | Efficient mapping from task graphs to dynamic system platforms | |
US10764372B2 (en) | Vehicular communication device | |
CN110990034A (en) | ECU upgrading method and system, electronic equipment and storage medium | |
EP3037303A1 (en) | Vehicle control device | |
US11115232B2 (en) | Method and device for operating a control unit | |
JP5533789B2 (en) | In-vehicle electronic control unit | |
JP4985662B2 (en) | Program and control device | |
JP5594416B1 (en) | Electronic control unit | |
US9128757B2 (en) | Method and lightweight mechanism for mixed-critical applications | |
JP5595571B1 (en) | Control device | |
CN116521266A (en) | Management method and device for vehicle-mounted application starting configuration, vehicle and storage medium | |
JP6243266B2 (en) | Electronic control device and memory diagnostic method | |
KR102097386B1 (en) | Method for synchronizing communication clocks and apparatus thereof | |
CN109062702B (en) | Computing resource allocation method, related device and readable storage medium | |
US20080126497A1 (en) | Controller Apparatus with Shared Expansion Connection and Method for the same | |
WO2023195384A1 (en) | Vehicle-mounted control device, control method, and control program | |
JP6009518B2 (en) | Electronic control unit | |
US10403350B2 (en) | Control unit having radio interference avoiding function | |
CN103514126A (en) | Method, system and device for receiving data | |
JP6168847B2 (en) | Multi-core system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
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: 20140708 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140721 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5594416 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |