JP2021089531A - Electronic control device - Google Patents
Electronic control device Download PDFInfo
- Publication number
- JP2021089531A JP2021089531A JP2019219056A JP2019219056A JP2021089531A JP 2021089531 A JP2021089531 A JP 2021089531A JP 2019219056 A JP2019219056 A JP 2019219056A JP 2019219056 A JP2019219056 A JP 2019219056A JP 2021089531 A JP2021089531 A JP 2021089531A
- Authority
- JP
- Japan
- Prior art keywords
- data
- cpu
- data area
- electronic control
- control device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Memory System (AREA)
Abstract
Description
本発明は、電子制御装置に関するものである。 The present invention relates to an electronic control device.
従来、車両には、電子化された車両制御機器を操作する複数の電子制御装置(以下、ECU(Electronic Control Unit)と示す場合がある)が備えられる。各ECU間は、車載LAN(Local Area Network)によって双方向通信可能に接続される。 Conventionally, a vehicle is provided with a plurality of electronic control devices (hereinafter, may be referred to as an ECU (Electronic Control Unit)) for operating an electronic vehicle control device. The ECUs are connected to each other via an in-vehicle LAN (Local Area Network) so that bidirectional communication is possible.
センサから取得したデータを演算するために、ECUには、複数のCPU(Central Processing Unit)を搭載するマルチコアマイクロコントローラ(以下、マイコンと略記する場合がある)が設けられる。マイコンでは、共有メモリに保存されるデータを各CPU間で共有して使用する場合がある。共有メモリは、デュアルポートRAM(Random Access Memory)等である。 In order to calculate the data acquired from the sensor, the ECU is provided with a multi-core microcontroller (hereinafter, may be abbreviated as a microcomputer) equipped with a plurality of CPUs (Central Processing Units). In the microcomputer, the data stored in the shared memory may be shared and used between the CPUs. The shared memory is a dual port RAM (Random Access Memory) or the like.
共有メモリへのデータの書き込みまたは、共有メモリからデータを読みだす際に、共有メモリでは、競合が発生する場合が考えられる。これにより、データの競合を回避するための技術が求められる。 When writing data to or reading data from shared memory, contention may occur in shared memory. As a result, a technique for avoiding data races is required.
特許文献1の技術では、共用メモリが複数のブロックに分割される。各ブロックの状態は、ポインタによって個別に示される。記憶装置は、ポインタによって、各ブロックの状態を更新用や参照用に切り換える。記憶装置は、更新中のブロックと参照中のブロックとを別領域に用意することができる。
In the technique of
記憶装置は、ポインタの更新中にポインタメモリの排他をする。ポインタは共用メモリとは別の領域に記憶されるので、記憶装置は、共用メモリの更新処理または参照処理の間には、排他が必要ない。記憶装置は、更新処理の間に参照処理が待機する必要がなく、参照処理の間に更新処理が待機する必要がない。これにより、記憶装置は、待機時間を最小限に抑制することができる。 The storage device excludes the pointer memory while updating the pointer. Since the pointer is stored in an area separate from the shared memory, the storage device does not need to be exclusive between the shared memory update process or the reference process. The storage device does not need to wait for the reference process during the update process, and does not need to wait for the update process during the reference process. As a result, the storage device can minimize the waiting time.
特許文献1では、更新処理または参照処理が実行された場合には、ブロックの状態を切り換える。しかしながら、ポインタの更新や参照に排他制御を使用しており、新しくポインタにアクセスするCPUには、待ち時間が発生する。リアルタイム性が求められる車両制御では、排他制御による待ち時間を低減することが求められる。
In
本発明は、上記のような課題を解決するためのものであり、複数のCPUがそれぞれ実行する処理の待ち時間を低減可能な電子制御装置を提供することを目的とする。 The present invention is for solving the above-mentioned problems, and an object of the present invention is to provide an electronic control device capable of reducing the waiting time for processing executed by a plurality of CPUs.
車両を制御する電子制御装置は、複数のCPU(Central Processing Unit)と、複数のCPUで共有される共有メモリとを含み、共有メモリは、複数のCPUのうち第1CPUによりデータが保存される第1データ領域と、複数のCPUのうち第2CPUによってデータが保存される第2データ領域を備え、さらに第1データ領域および第2データ領域に保存されるデータの競合を抑制する制御部を備え、複数のCPUは、第1ないし第2のデータ領域にデータを保存する更新処理と、第1ないし第2のデータ領域からデータを参照する参照処理と、更新処理から参照処理に順に実行する処理構成を備え、制御部は、第1CPUが第1データ領域に第1データを保存した場合には、第1データが保存されてから第1CPUによって参照処理が実行されるまでの期間、第2CPUが第1データ領域に保存することを抑制する抑制値を第1データ領域に設定する抑制値設定部と、参照処理において、第1CPUによって第1データ領域から第1データが参照された場合には、第1データ領域に保存された抑制値を解放値に変更する解放値設定部と、を備え、第2CPUが第1データ領域に第2データを保存する処理を実行したとき第1データ領域に抑制値が設定されていた場合、第2CPUは第2データ領域に第2データを保存し、第2データ領域を参照したとき第2データ領域の値を第1データ領域に複写する同期処理を実行する。 The electronic control device that controls the vehicle includes a plurality of CPUs (Central Processing Units) and a shared memory shared by the plurality of CPUs, and the shared memory is a first CPU among the plurality of CPUs in which data is stored. It includes one data area, a second data area in which data is stored by the second CPU among a plurality of CPUs, and a control unit that suppresses conflict of data stored in the first data area and the second data area. The plurality of CPUs have a processing configuration in which an update process for saving data in the first to second data areas, a reference process for referencing data from the first to second data areas, and a process configuration for executing the update process to the reference process in order. When the first CPU saves the first data in the first data area, the control unit uses the second CPU for a period from when the first data is saved until the reference process is executed by the first CPU. In the suppression value setting unit that sets the suppression value for suppressing storage in the 1 data area in the first data area, and when the first data is referred to by the first CPU in the reference processing, the first data is referenced. A release value setting unit that changes the suppression value saved in one data area to a release value is provided, and when the second CPU executes a process of saving the second data in the first data area, the suppression value is stored in the first data area. If is set, the second CPU stores the second data in the second data area, and executes a synchronization process of copying the value of the second data area to the first data area when the second data area is referred to.
本発明によると、複数のCPUがそれぞれ実行する処理の待ち時間を低減することができる。 According to the present invention, it is possible to reduce the waiting time for processing executed by each of the plurality of CPUs.
本実施形態は、複数の(例えば2つの)CPUがそれぞれ実行する処理の待ち時間を低減可能なECUに関するものである。 The present embodiment relates to an ECU capable of reducing the waiting time for processing executed by a plurality of (for example, two) CPUs.
図1は、車両制御処理の説明図である。車両には、例えば、車載センサ1と、ECU2と、アクチュエータ3とが設けられる。なお、車両には、複数のECU2が設けられてもよい。車載センサ1とECU2とアクチュエータ3とは、車内LANによって双方向通信可能に接続される。
FIG. 1 is an explanatory diagram of vehicle control processing. The vehicle is provided with, for example, an in-
車載センサ1は、例えば、エンジンの回転数を検出するエンジン回転センサ等である。なお、車載センサ1は、エンジン回転センサに限られない。車載センサ1は、ECU2にセンサ情報を送信する。センサ情報は、例えば、スイッチ入力、エンジン回転数または吸入空気量等を示す。
The in-
ECU2は、センサ情報に基づいて、エンジン、トランスミッションまたはインバータ等を制御する。ECU2は、例えば、入力回路4とマイコン5とドライバIC(Integrated Circuit)6とを備える。
The ECU 2 controls an engine, a transmission, an inverter, or the like based on sensor information. The ECU 2 includes, for example, an
入力回路4は、デジタル入力信号やアナログ入力信号を、マイコン5に入力できる信号レベルまたはデジタル値に変換する。入力回路4は、例えば、入力バッファまたはADコンバータ等から構成される。
The
マイコン5は、図2に示すように、第1CPU52(1)と第2CPU52(2)とを備えるマルチコアマイコンである。マイコン5は、各種の入力信号またはパラメータ値等を入力回路4から取得する。マイコン5は、入力回路4から取得した情報を元にアクチュエータ3の制御量を演算する。マイコン5は、ドライバIC6への出力信号を生成する。
As shown in FIG. 2, the
ドライバIC6は、マイコン5の出力信号からアクチュエータ3の制御信号を生成する。なお、ドライバIC6は、例えば、電圧増幅、ON/OFF出力、パルス出力またはPWM(Pulse Width Modulation)出力等を生成してもよい。
The driver IC 6 generates a control signal for the
アクチュエータ3は、例えば、ソレノイドバルブ、モータまたはリレー等の部品である。アクチュエータ3は、例えば、燃料噴射装置や点火装置等を駆動させる。
The
図2は、マイコン5の説明図である。マイコン5は、例えば、共有メモリ51と、第1CPU52(1)と、第2CPU52(2)と、「制御部」の一例としてのデータバッファ制御部53と、判定値保存部54とを備える。なお、特に区別しない場合には、第1CPU52(1)と第2CPU52(2)とは、CPU52と示す場合がある。
FIG. 2 is an explanatory diagram of the
共有メモリ51は、各CPU52に共有して使用される。共有メモリ51には、例えば、「第1データ領域」の一例としての第1データバッファ511(1)と「第2データ領域」の一例としての第2データバッファ511(2)とが備えられる。なお、第1データバッファ511(1)と第2データバッファ511(2)とは、特に区別しない場合には、データバッファ511と示す場合がある。
The shared
データバッファ511には、例えば、アクチュエータ3の制御に必要な制御値が保存される。制御値には、車載センサ1から送信されたセンサ情報が含まれる。データバッファ511に保存される制御値は、各CPU52から更新および参照される。
In the
各CPU52は、第1判定値541(1)と第2判定値541(2)とに基づいて、データバッファ511のデータを更新および参照する。なお、第1判定値541(1)および第2判定値541(2)は、特に区別しない場合には、判定値541と示す場合がある。
Each
第1CPU52(1)は、所定の周期で、更新処理と参照処理とを含む所定の処理を実行する。第2CPU52(2)は、「所定の信号」の一例としてのイベントトリガによって、所定の処理を実行する。 The first CPU 52 (1) executes a predetermined process including an update process and a reference process at a predetermined cycle. The second CPU 52 (2) executes a predetermined process by an event trigger as an example of the “predetermined signal”.
判定値541は、各CPU52がデータバッファ511にデータを保存できるかを判定する。各判定値541は、例えば、判定値保存部54に保存される。第1判定値541(1)は、第1データバッファ511(1)に対応して設定される。第2判定値541(2)は、第2データバッファ511(2)に対応して設定される。
The
判定値541は、例えば、「0」と「1」とで示されるフラグによって、保存可能かどうかを示してもよい。CPU52は、判定値541が「0」を示すデータバッファ511にデータを保存してもよい。CPU52は、判定値541が「1」を示すデータバッファ511にデータを保存することを抑制される。
The
すなわち、第1判定値541(1)が「0」を示す場合には、CPU52は、例えば、第1データバッファ511(1)にデータを保存してもよい。第1判定値541(1)が「1」を示す場合には、CPU52は、例えば、第1データバッファ511(1)にデータを保存することを抑制される。
That is, when the first determination value 541 (1) indicates "0", the
データバッファ制御部53は、判定値541を設定する。データバッファ制御部53は、例えば、抑制値設定部531と解放値設定部532とを備える。
The data
抑制値設定部531は、CPU52によってデータバッファ511が更新された場合に、判定値541を「1」に設定する。例えば、抑制値設定部531は、CPU52が第1データバッファ511(1)を更新した場合には、第1判定値541(1)を「抑制値」の一例としての「1」に設定する。
The suppression
解放値設定部532は、CPU52によってデータバッファ511が参照された場合には、判定値541を「0」に設定する。例えば、CPU52が第1データバッファ511(1)を参照した場合には、解放値設定部532は、第1判定値541(1)を「解放値」の一例としての「0」に設定する。
The release
さらに、解放値設定部532は、後述する同期処理(S45、図7参照)が実行される場合には、複製元のデータバッファ511に対応する判定値541を「0」に設定する。例えば、同期処理(S45)によって第2データバッファ511(2)のデータが第1データバッファ511(1)に複製される場合には、解放値設定部532は、第2データバッファ511(2)に対応する第2判定値541(2)を「0」に設定する。
Further, the release
図3は、ECU2のハードウェア構成図である。ECU2は、例えば、二つのCPU52と、記憶部55と、メモリ50と、入力回路4と、ドライバIC6と、各機能4,6,50,52,55を双方向通信可能に接続するデータ伝送路56とを備える。
FIG. 3 is a hardware configuration diagram of the
記憶部55には、例えば、データバッファ制御部53のプログラムが保存される。記憶部55には、例えば、判定値保存部54のデータベースが保存される。メモリ50は、例えば、RAM等の揮発性記憶媒体である。
For example, the program of the data
以下、図5以降に示すマイコン5の処理(S1〜S5)について、図4を参照しながら説明する。図4は、マイコン5の処理のシーケンス図である。図4には、例えば、第1CPU52(1)が第2CPU52(2)よりも早く更新処理(S3)を実行する場合について示される。
Hereinafter, the processing (S1 to S5) of the
図5は、CPU52の流れ図である。CPU52は、処理(S2〜S5)を実行するかを判定する(S1)。第1CPU52(1)は、所定の周期で処理(S2〜S5)を実行する。第2CPU52(2)は、外部から取得したイベント信号に基づいて、処理(S2〜S5)を実行する。
FIG. 5 is a flow chart of the
CPU52は、入力回路4によって車載センサ1からセンサ情報を取得する(S2)。第1CPU52(1)は、例えば、センサ情報のデータ「AA」を取得する。第2CPU52(2)は、例えば、センサ情報のデータ「BB」を取得する。CPU52は、データバッファ更新処理(S3)をする。
The
図6は、データバッファ更新処理(S3)の流れ図である。CPU52は、第1データバッファ511(1)に対応する第1判定値541(1)を取得し、データを保存できるかを判定する(S31)。
FIG. 6 is a flow chart of the data buffer update process (S3). The
第1判定値541(1)が「0」の場合(S31:Yes)には、CPU52は、第1データバッファ511(1)にデータを保存する(S32)。例えば、第1CPU52(1)は、第1判定値541(1)が「0」であるため、第1データバッファ511(1)にデータ「AA」を保存する。抑制値設定部531は、第1判定値541(1)を「1」に設定する(S33)。
When the first determination value 541 (1) is "0" (S31: Yes), the
第1判定値541(1)が「1」の場合(S31:No)には、CPU52は、第2データバッファ511(2)にデータを保存する(S34)。例えば、第2CPU52(2)は、第1判定値541(1)が「1」であるため、第2データバッファ511(2)にデータ「BB」を保存する。
When the first determination value 541 (1) is "1" (S31: No), the
抑制値設定部531は、第2判定値541(2)を「1」に設定する(S35)。CPU52は、処理(S33)または処理(S35)が終了後に、データバッファ更新処理(S3)を終了する。なお、CPU52は、データバッファ更新処理(S3)を終了に、ヘッダ部分またはフッタ部分の負荷データを更新または参照する演算処理が実行されてもよい。
The suppression
図5に戻り、CPU52は、データバッファ参照処理(S4)を実行する。図7は、データバッファ参照処理(S4)の流れ図である。各CPU52は、第1データバッファ511(1)を参照する(S401)。各CPU52は、共有メモリに保存されるデータを参照する際には、第2データバッファ511(2)ではなく、第1データバッファ511(1)を参照する。
Returning to FIG. 5, the
すなわち、第1データバッファ511(1)は、参照用として使用されるメモリの領域である。第2データバッファ511(2)は、第1データバッファ511(1)の更新が抑制されている場合に一時的に保存されるメモリの領域である。 That is, the first data buffer 511 (1) is an area of memory used for reference. The second data buffer 511 (2) is an area of memory that is temporarily stored when the update of the first data buffer 511 (1) is suppressed.
各CPU52は、第1データバッファ511(1)または第2データバッファ511(2)をデータの更新先として選択できるが、データの参照先として第1データバッファ511(1)を選択する。
Each
CPU52は、第1判定値541(1)が「0」であるかを判定する(S42)。第1判定値541(1)が「0」である場合(S42:Yes)には、CPU52は、データバッファ参照処理(S4)を終了する。
The
第1判定値541(1)が「1」である場合(S42:No)には、解放値設定部532は、第1判定値541(1)を「0」に設定する(S43)。例えば、第1CPU52(1)が第1データバッファ511(1)のデータ「AA」を参照することにより、解放値設定部532は、第1判定値541(1)を「0」に設定する。
When the first determination value 541 (1) is "1" (S42: No), the release
各CPU52は、第2判定値541(2)が「0」であるかを判定する(S44)。第2判定値541(2)が「0」である場合(S44:Yes)には、ECU2は、データバッファ参照処理(S4)を終了する。
Each
第2判定値541(2)が「1」である場合(S44:No)には、各CPU52は、第2データバッファ511(2)のデータを第1データバッファ511(1)に複製する(S45)。例えば、第2判定値541(2)が「1」であるため、第1CPU52(1)は、データ「BB」を第1データバッファ511(1)に複製する。
When the second determination value 541 (2) is "1" (S44: No), each
解放値設定部532は、第2判定値541(2)を「0」に設定する(S46)。ECU2は、データバッファ参照処理(S4)を終了する。図5に戻り、CPU52は、参照したデータを用いて、ドライバIC6に制御値を出力する(S6)。
The release
図8は、共有データのE2E(End−to−End)保護の説明図である。共有メモリ51内の複数のデータバッファ511に保存される共有データが、自動車用機能安全規格(ISO 26262)に規定されたASIL(Automotive Safety Integrity Level)レベルの通信データである場合には、ECU2は、規定された故障検出率を満たすことが求められる。
FIG. 8 is an explanatory diagram of E2E (End-to-End) protection of shared data. When the shared data stored in the plurality of
通信データを保護するためのE2E保護機能としては、例えば、巡回冗長検査(CRC:Cyclic Redundancy Check)などが含まれる。ECU2には、データ送信部7とデータ受信部8とが含まれる。データ送信部7は、共有メモリ51(1)と、通信データ57と、CRC演算部58(1)と、誤り検出符号59(1)とを備える。
The E2E protection function for protecting communication data includes, for example, a cyclic redundancy check (CRC) and the like. The
共有メモリ51(1)には、通信データ57が保存される。通信データ57は、データ受信部8に送信されるとともに、CRC演算部58(1)に入力される。
CRC演算部58(1)は、通信データ57に対する誤り検出符号59(1)を算出する。誤り検出符号59(1)は、通信データ57に付加され、データ受信部8に送信される。
The CRC calculation unit 58 (1) calculates the error detection code 59 (1) for the
データ受信部8は、共有メモリ51(2)と、通信データ57と、CRC演算部58(2)と、誤り検出符号59(1)と、誤り検出符号59(2)と、符号比較部60と、データ処理部61とを備える。通信データ57は、データ送信部7から送信されてきたデータであり、データ処理部61とCRC演算部58(2)に入力される。
The
誤り検出符号59(1)は、通信データ57に付加されて、データ送信部7から送信されてきた符号であり、符号比較部60に入力される。CRC演算部58(2)は、通信データ57に対する誤り検出符号59(2)を算出する。誤り検出符号59(2)は、符号比較部60に入力される。
The error detection code 59 (1) is a code added to the
符号比較部60は、誤り検出符号59(1)と誤り検出符号59(2)とを比較し、その符号比較結果をデータ処理部61に入力する。データ処理部61は、符号比較部60からの符号比較結果を参照する。
The
データ処理部61は、問題がない場合には、通信データ57を共有メモリ51(2)に保存する。データ処理部61は、問題がある場合には、通信データ57の代わりに固定データを共有メモリ51(2)に保存する。これにより、データ送信部7とデータ受信部8との間でデータを保護することができる。
If there is no problem, the
図4に戻り、第1CPU52(1)が更新した値を第1CPU52(1)が参照するより前に第2CPU52(2)が上書き更新した場合には、第1CPU52(1)は、更新した値と異なる値を参照することになる。これにより、CPU52には、データの競合を回避することが求められる。
Returning to FIG. 4, when the second CPU 52 (2) overwrites and updates the value updated by the first CPU 52 (1) before the first CPU 52 (1) refers to it, the first CPU 52 (1) has the updated value. You will refer to different values. As a result, the
データの競合を回避するための方法として、排他制御が知られている。排他制御は、共有データにアクセスするタイミングが同時に発生しないことを実現する。排他制御は、例えば、セマフォ等が用いられる。 Exclusive control is known as a method for avoiding data races. Exclusive control realizes that the timing of accessing shared data does not occur at the same time. For exclusive control, for example, a semaphore or the like is used.
CPU52は、共有データにアクセスする前にセマフォの取得を行う。CPU52は、セマフォの取得に成功した場合に、データの更新または参照を実行する。CPU52は、データの更新または参照の終了後にセマフォを解放する。セマフォを取得したCPUまたはタスクは、セマフォの解放をすることができる。
The
例えば、所定のCPU52がセマフォを取得しているとき、他のCPU52がセマフォを取得しようとすると、セマフォが解放されるまで待ち状態となる。所定のCPU52によってセマフォが解放されると、他のCPU52における1つのCPU52がセマフォを取得する。マルチコア間のセマフォは、例えば、複数のCPU52が同時にセマフォを取得することができないハードウェアにより実現される。
For example, when a
しかしながら、所定のCPU52がセマフォを取得している場合には、他のCPU52の処理が停止する。車両を制御する処理には、車両の安全を確保するためにリアルタイム性が求められる。これにより、セマフォによる排他制御では、処理待ちのCPU52がリアルタイム性を発揮することが困難である場合が考えられる。
However, when the
さらに、車載センサ1から送信されるセンサ情報は、自動運転等の技術の発展に従って、容量が増大する。マイコン5には、リアルタイム性を発揮するために、センサ情報を処理するための時間を確保することが求められる。これにより、マイコン5には、CPU52の負荷を低減させることが求められる。
Further, the capacity of the sensor information transmitted from the vehicle-mounted
以上に示すECU2は、データバッファ制御部53を備えることによって、データバッファ511の判定値541に基づいてデータの競合を回避することができる。これにより、各CPU52は、データバッファ511に保存したデータを正確に参照することができる。
By providing the data
参照処理(S4)は、同期処理(S45)を実行することによって、各データバッファ511間でデータの一貫性を図ることができる。これにより、各CPU52は、正確なデータを参照することができる。
In the reference process (S4), data consistency can be achieved between the data buffers 511 by executing the synchronous process (S45). As a result, each
各CPU52は、第1データバッファ511(1)からデータを参照するように設定されることにより、更新処理にてデータを保存したCPU52を特定しなくてもよい。これにより、CPU52の特定処理を削減できるため、CPU52の負荷率を低減させることができる。
By setting each
なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、ある実施例の構成に他の実施例の構成を加えることも可能である。 The present invention is not limited to the above-described examples, and includes various modifications. For example, the above-described embodiment has been described in detail in order to explain the present invention in an easy-to-understand manner, and is not necessarily limited to the one including all the described configurations. It is possible to replace a part of the configuration of one embodiment with the configuration of another embodiment, and it is also possible to add the configuration of another embodiment to the configuration of one embodiment.
各実施例の構成の一部について、他の構成の追加・削除・置換をすることが可能である。上記の各構成、機能、処理部、処理手段等は、それらの一部または全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。 It is possible to add / delete / replace other configurations with respect to a part of the configurations of each embodiment. Each of the above configurations, functions, processing units, processing means, etc. may be realized by hardware by designing a part or all of them by, for example, an integrated circuit. Each of the above configurations, functions, and the like may be realized by software by the processor interpreting and executing a program that realizes each function.
本発明は、以下に示す電子制御方法を含むことができる。第1CPUが共有メモリ内の第1データ領域に第1データを保存した場合には、前記第1データが保存されてから前記第1CPUによって参照されるまでに、第2CPUが前記第1データ領域に第2データを保存することを抑制し、前記第1CPUによって前記第1データ領域から前記第1データが参照された場合には、前記第1データ領域を前記第1CPUから解放する電子制御方法。 The present invention can include the electronic control methods shown below. When the first CPU stores the first data in the first data area in the shared memory, the second CPU is stored in the first data area from the time when the first data is saved until it is referenced by the first CPU. An electronic control method for suppressing storage of second data and releasing the first data area from the first CPU when the first data is referenced from the first data area by the first CPU.
本発明は、以下に示すコンピュータプログラムを含むことができる。コンピュータを電子制御装置として機能させるためのコンピュータプログラムは、コンピュータ上に、第1CPUが共有メモリ内の第1データ領域に第1データを保存した場合には、前記第1データが保存されてから前記第1CPUによって参照されるまでに、第2CPUが前記第1データ領域に第2データを保存することを抑制させる機能と、前記第1CPUによって前記第1データ領域から前記第1データが参照された場合には、前記第1データ領域を前記第1CPUから解放する機能とを実現する。 The present invention can include the computer programs shown below. When the first CPU stores the first data in the first data area in the shared memory on the computer, the computer program for operating the computer as an electronic control device is described after the first data is saved. A function of suppressing the second CPU from storing the second data in the first data area before being referred by the first CPU, and a case where the first data is referred to from the first data area by the first CPU. To realize the function of releasing the first data area from the first CPU.
1・・・車載センサ,2・・・電子制御装置,3・・・アクチュエータ,4・・・入力回路,5・・・マイコン,50・・・メモリ,51・・・共有メモリ,511(1)・・・第1データバッファ,511(2)・・・第2データバッファ,52(1)・・・第1CPU,52(2)・・・第2CPU,53・・・制御部,531・・・抑制値設定部,532・・・解放値設定部,54・・・判定値保存部,541(1)・・・第1判定値,541(2)・・・第2判定値,6・・・ドライバIC 1 ... In-vehicle sensor, 2 ... Electronic control device, 3 ... Actuator, 4 ... Input circuit, 5 ... Microcomputer, 50 ... Memory, 51 ... Shared memory, 511 (1) ) ... 1st data buffer, 511 (2) ... 2nd data buffer, 52 (1) ... 1st CPU, 52 (2) ... 2nd CPU, 53 ... Control unit, 531. .. Suppression value setting unit, 532 ... Release value setting unit, 54 ... Judgment value storage unit, 541 (1) ... 1st judgment value, 541 (2) ... 2nd judgment value, 6・ ・ ・ Driver IC
Claims (8)
前記電子制御装置は、
複数のCPU(Central Processing Unit)と、前記複数のCPUで共有される共有メモリとを含み、前記共有メモリは、前記複数のCPUのうち第1CPUによりデータが保存される第1データ領域と、前記複数のCPUのうち第2CPUによってデータが保存される第2データ領域を備え、
さらに前記第1データ領域および前記第2データ領域に保存されるデータの競合を抑制する制御部
を備え、
前記複数のCPUは、第1ないし第2のデータ領域にデータを保存する更新処理と、第1ないし第2のデータ領域からデータを参照する参照処理と、更新処理から参照処理に順に実行する処理構成を備え、
前記制御部は、
第1CPUが第1データ領域に第1データを保存した場合には、前記第1データが保存されてから前記第1CPUによって前記参照処理が実行されるまでの期間、第2CPUが第1データ領域に保存することを抑制する抑制値を第1データ領域に設定する抑制値設定部と、
前記参照処理において、第1CPUによって第1データ領域から第1データが参照された場合には、第1データ領域に保存された抑制値を解放値に変更する解放値設定部と、
を備え、
第2CPUが第1データ領域に第2データを保存する処理を実行したとき第1データ領域に抑制値が設定されていた場合、第2CPUは第2データ領域に第2データを保存し、第2データ領域を参照したとき第2データ領域の値を第1データ領域に複写する同期処理を実行すること、
を特徴とする電子制御装置。 An electronic control device that controls a vehicle
The electronic control device is
A plurality of CPUs (Central Processing Units) and a shared memory shared by the plurality of CPUs are included, and the shared memory includes a first data area in which data is stored by the first CPU among the plurality of CPUs, and the said. A second data area in which data is stored by the second CPU among a plurality of CPUs is provided.
Further, it is provided with a control unit that suppresses conflict of data stored in the first data area and the second data area.
The plurality of CPUs execute an update process for storing data in the first to second data areas, a reference process for referencing data from the first to second data areas, and a process for sequentially executing the update process to the reference process. With composition,
The control unit
When the first CPU stores the first data in the first data area, the second CPU is stored in the first data area during the period from when the first data is saved until the reference process is executed by the first CPU. A suppression value setting unit that sets the suppression value that suppresses saving in the first data area,
In the reference process, when the first data is referenced from the first data area by the first CPU, the release value setting unit that changes the suppression value stored in the first data area to the release value, and the release value setting unit.
With
If the suppression value is set in the first data area when the second CPU executes the process of storing the second data in the first data area, the second CPU stores the second data in the second data area and the second To execute a synchronization process that copies the value of the second data area to the first data area when the data area is referenced.
An electronic control device characterized by.
請求項1に記載の電子制御装置。 The electronic control device according to claim 1, wherein in the update process, when the suppression value is set in the first data area, the second CPU stores the second data in the second data area.
請求項2に記載の電子制御装置。 The electronic control device according to claim 2, wherein the suppression value setting unit sets the suppression value in the second data area when the second CPU stores the second data in the second data area.
請求項3に記載の電子制御装置。 The release value setting unit according to claim 3 sets the release value in the second data area when the second data stored in the second data area is stored in the first data area. The electronic control device described.
請求項1に記載の電子制御装置。 The electronic control device according to claim 1, wherein the first CPU executes the predetermined process at a predetermined cycle.
請求項1に記載の電子制御装置。 The electronic control device according to claim 1, wherein the second CPU executes the predetermined process by a predetermined signal.
請求項1に記載の電子制御装置。 The electronic control device according to claim 1, wherein the data stored in the shared memory is a control value used for controlling an in-vehicle device.
請求項1に記載の電子制御装置。 The electronic control device according to claim 1, further comprising an automobile security unit that protects data based on a predetermined automobile safety standard.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019219056A JP2021089531A (en) | 2019-12-03 | 2019-12-03 | Electronic control device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019219056A JP2021089531A (en) | 2019-12-03 | 2019-12-03 | Electronic control device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2021089531A true JP2021089531A (en) | 2021-06-10 |
Family
ID=76220320
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019219056A Pending JP2021089531A (en) | 2019-12-03 | 2019-12-03 | Electronic control device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2021089531A (en) |
-
2019
- 2019-12-03 JP JP2019219056A patent/JP2021089531A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1703391B1 (en) | Vehicle control software and vehicle control apparatus | |
US7650274B2 (en) | Microcomputer logic development system | |
CN108351840B (en) | Vehicle control device | |
JP6011379B2 (en) | Tamper detection system, electronic control unit | |
US20170277566A1 (en) | Software component assigning system for vehicle | |
JP2014230140A (en) | Repeating device | |
US20120185876A1 (en) | Control device, control method, and computer readable medium | |
EP3920020A1 (en) | Electronic control device and program update method | |
WO2011102207A1 (en) | Embedded control device | |
EP1712424B1 (en) | Vehicle control apparatus | |
US20220063646A1 (en) | Onboard device, information generating method, non-transitory storage medium, and vehicle | |
JP2021089531A (en) | Electronic control device | |
KR101601074B1 (en) | ECU Updating Apparatus, ECU Updating Method and ECU Updating Network using the same | |
JP2004220326A (en) | Control software structure and controller using the structure | |
JP3827565B2 (en) | Microcomputer logic development equipment | |
US20210065478A1 (en) | Electronic control unit and non-transitory computer readable medium storing session establishment program | |
JP6183251B2 (en) | Electronic control unit | |
JP6865707B2 (en) | Vehicle control device | |
JP5978873B2 (en) | Electronic control unit | |
EP3428799B1 (en) | Data access device and access error notification method | |
US20240020245A1 (en) | Electronic control device | |
JP2019212032A (en) | Electronic control device with multi-core microcomputer | |
JP2023009818A (en) | Electronic control device for vehicle and control method by electronic control device for vehicle | |
JP2002202891A (en) | Electronic controller and recording medium | |
WO2024087234A1 (en) | Method and apparatus for updating software, and intelligent device |