JP2006146789A - Electronic controller, its control method, and program - Google Patents
Electronic controller, its control method, and program Download PDFInfo
- Publication number
- JP2006146789A JP2006146789A JP2004339109A JP2004339109A JP2006146789A JP 2006146789 A JP2006146789 A JP 2006146789A JP 2004339109 A JP2004339109 A JP 2004339109A JP 2004339109 A JP2004339109 A JP 2004339109A JP 2006146789 A JP2006146789 A JP 2006146789A
- Authority
- JP
- Japan
- Prior art keywords
- event
- output
- input
- processing
- user function
- 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
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は電子制御装置およびその制御方法ならびにプログラムに関し、特に車両等に搭載されて制御を行う電子制御装置およびその制御方法ならびにプログラムに関する。 The present invention relates to an electronic control device, a control method thereof, and a program, and more particularly to an electronic control device mounted on a vehicle or the like for performing control, a control method thereof, and a program.
従来から、メモリに記憶された制御プログラムに従って、例えば所定時間毎に各種センサ等の状態をイベントとして入力し、そのイベントに応じて制御対象(出力装置)を制御するか否かを判定し、制御すると判定された場合にはその制御対象を制御するための出力を行う電子制御装置が知られている。電子制御装置(ECU(Electronic Control Unit))は、製品(ボデーECU,照合ECU,ドアECU,…)や、その車種,グレード,仕向け地等によって、扱うイベントの種類や数も異なる。例えば、車両のボデー系システムのボデーECUは車両の人による操作に関するイベントを扱うので、そのイベントの特徴としては、種類が多く(〜100以上)、発生頻度が低いことがあげられる。 Conventionally, according to a control program stored in a memory, for example, the state of various sensors is input as an event every predetermined time, and it is determined whether to control a control target (output device) according to the event, and control Then, when it is determined, an electronic control device that performs output for controlling the control target is known. Electronic control units (ECUs) vary in the types and number of events that are handled depending on the product (body ECU, verification ECU, door ECU,...), Vehicle type, grade, destination, and the like. For example, the body ECU of the vehicle body system handles an event related to an operation by a person of the vehicle, and as a feature of the event, there are many types (˜100 or more) and a low occurrence frequency.
このような電子制御装置の制御プログラムは、制御対象や制御目的等に応じた所定の機能単位毎にユーザ関数を作成し、イベントに対応するアプリケーションユニットのユーザ関数群をイベントテーブルに登録し、発生したイベントに対応するアプリケーションユニットのユーザ関数群を実行するように構成すること、すなわち複数のユーザ関数を順次実行するスケジューリング方式(シンプルスケジューリング)で実行することで、複数の制御対象の制御または1つの制御対象の複数の制御を1つの電子制御装置で実現していた。 Such a control program for an electronic control device generates a user function for each predetermined functional unit according to a control target, a control purpose, etc., registers a user function group of an application unit corresponding to an event in an event table, and generates It is configured to execute the user function group of the application unit corresponding to the event, that is, by executing with a scheduling method (simple scheduling) that sequentially executes a plurality of user functions, it is possible to control a plurality of control targets or one A plurality of controls to be controlled are realized by a single electronic control unit.
しかしながら、このような電子制御装置では、それぞれのアプリケーションユニットで入力→判断→出力の処理を行っているため、次のような問題があった。すなわち、複数のアプリケーションユニットが同一の入力装置から入力を行ったり、複数のアプリケーションユニットが同一の出力装置に対して出力を行ったりする場合、先に実行されたアプリケーションユニットでの処理と後に実行されたアプリケーションユニットでの処理とにおいて、入力装置から入力したデータが変化してしまい処理結果に矛盾が生じたり、先に実行したアプリケーションユニットによる処理と後に実行したアプリケーションユニットによる処理とで異なるデータを出力してしまい、出力装置が誤動作する可能性があった。そのため、各処理の結果に矛盾が起きないように各アプリケーションユニットによる処理において調停を行う必要があり、その調停のために各アプリケーションユニット間でデータを受け渡しする必要がある。この結果、各アプリケーションユニット間に依存関係が生じてしまい、システムの複雑さが増すにつれて制御プログラムの設計保守等が困難となるといった問題があった。 However, such an electronic control device has the following problems because each application unit performs input → judgment → output processing. That is, when a plurality of application units input from the same input device, or a plurality of application units output to the same output device, the processing is executed after the processing in the previously executed application unit. The data input from the input device changes in the processing performed by the new application unit, resulting in inconsistencies in the processing results, or output of data that differs between the processing executed by the application unit executed earlier and the processing executed by the application unit executed later. As a result, the output device may malfunction. Therefore, it is necessary to perform arbitration in the processing by each application unit so that no contradiction occurs in the result of each processing, and it is necessary to exchange data between the application units for the arbitration. As a result, there is a problem that a dependency relationship is generated between the application units, and the design maintenance of the control program becomes difficult as the complexity of the system increases.
また、このような電子制御装置では、各アプリケーションユニットの処理において入出力を行っていたため、同一の入出力装置に対して複数のアプリケーションユニットによる処理で入出力を行っており、制御プログラムの入出力コードの重複による無駄が生じるといった問題もあった。 In such an electronic control device, since input / output is performed in the processing of each application unit, input / output is performed by processing by a plurality of application units to the same input / output device. There was also a problem of waste due to code duplication.
そこで、本願出願人は、イベントフラグ方式を採用することにより、アプリケーションユニットのモジュール性(独立性)を高めてアプリケーションユニットの自由度を向上させることができ、信頼性を確保することができる電子制御装置をすでに提案した(例えば、特許文献1参照)。 Therefore, the applicant of the present application adopts an event flag method, thereby improving the modularity (independence) of the application unit and improving the degree of freedom of the application unit, and electronic control that can ensure reliability. An apparatus has already been proposed (see, for example, Patent Document 1).
ここで、図5を用いて、従来の電子制御装置で採用されているイベントフラグ方式について簡単に説明する。いま、入力処理ルーチンAは、イベントが検出されないので、イベントフラグ列E0〜Enの該当するイベントフラグをクリアしたとする。一方、入力処理ルーチンBは、イベントを検出したので、イベントフラグ列E0〜Enの該当するイベントフラグを立てたとする。例えば、イグニッションスイッチのOFFからONの場合、イグニッションスイッチOFFイベントはイベントフラグE5が値“0”
、イグニッションスイッチONイベントはイベントフラグE5が値“1”であるとする。次に、簡易OS(Operating
System)は、イベントフラグ列E0〜Enに値“1”のイベントフラグがあるかどうかを走査することによりイベントがあるかどうかを検出し、イベントがあれば、イベントに対応するイベントテーブルT5にアドレスが登録されているアプリケーションユニットのユーザ関数群を呼び出して逐次実行する。
In the ignition switch ON event, the event flag E5 is assumed to have a value “1”. Next, a simple OS (Operating
System) detects whether or not there is an event by scanning whether or not there is an event flag having a value “1” in the event flag string E0 to En, and if there is an event, addresses the event table T5 corresponding to the event. Calls the user function group of the application unit in which is registered and executes it sequentially.
このようなイベントフラグ方式を採用している従来の電子制御装置では、イベントフラグと、それに対応するイベントテーブルとの関連をアプリケーションフェーズの簡易OSが管理しているため、扱うイベントの種類や数が変われば、簡易OSを変更しなければならなかった。特に、扱うイベントの数が多く、かつ、そのバリエーションが非常に多いボデー系システムでは、イベントの実行順序がイベントフラグ列E0〜Enの走査順序に応じて変化するおそれがあり、イベントの管理が煩雑になりやすく、簡易OSの開発工数の増大を招くという問題点があった。 In a conventional electronic control apparatus that employs such an event flag method, since the simple OS in the application phase manages the relationship between the event flag and the corresponding event table, the types and number of events handled are limited. If it changed, the simple OS had to be changed. In particular, in a body system with a large number of events to be handled and a large number of variations thereof, the event execution order may change according to the scan order of the event flag strings E0 to En, and event management is complicated. There is a problem in that the number of steps for developing a simple OS is increased.
また、従来の電子制御装置では、制御プログラムを、入力フェーズと、アプリケーションフェーズと、出力フェーズとに分けるとともに、制御プログラムを所定時間毎に実行し、かつ制御処理が前記所定時間内に実行を完了するように制御する。このとき、入力フェーズのための複数の入力処理ルーチンは順次実行する一方、アプリケーションフェーズでは、入力フェーズで入力された外部イベントに対応するアプリケーションユニットのユーザ関数群のみを実行する。そして、出力フェーズでは、アプリケーションフェーズでのユーザ関数群の実行によって生成された処理結果に基づいて出力を行う出力処理ルーチンを順次実行する。すなわち、入力フェーズおよび出力フェーズは、順次呼び出しを行うスケジューリング方式(シンプルスケジューリング)で実行し、アプリケーションフェーズは、イベントの発生時に該イベントに対応するアプリケーションユニットのユーザ関数群を実行する(イベントドリブン方式)。したがって、発生したイベントに対応するアプリケーションユニットのユーザ関数群のみが実行されるため、処理の不要なアプリケーションユニットのユーザ関数群は実行されることがなくなり、電子制御装置の処理の負荷を軽減することができるという利点がある。具体的には、制御処理を前記所定時間内に確実に完了させることが可能になる。 In the conventional electronic control device, the control program is divided into an input phase, an application phase, and an output phase, and the control program is executed every predetermined time, and the control processing is completed within the predetermined time. Control to do. At this time, a plurality of input processing routines for the input phase are sequentially executed, while in the application phase, only the user function group of the application unit corresponding to the external event input in the input phase is executed. In the output phase, an output processing routine for performing output based on the processing result generated by executing the user function group in the application phase is sequentially executed. That is, the input phase and the output phase are executed by a scheduling method (simple scheduling) for sequentially calling, and the application phase executes a user function group of an application unit corresponding to the event when the event occurs (event driven method) . Therefore, since only the user function group of the application unit corresponding to the event that has occurred is executed, the user function group of the application unit that does not need to be processed is not executed, and the processing load of the electronic control device is reduced. There is an advantage that can be. Specifically, the control process can be reliably completed within the predetermined time.
また、従来の電子制御装置によれば、アプリケーションフェーズでは、アプリケーションユニットのユーザ関数群が入力装置および出力装置への入出力は行わないように構成する。したがって、アプリケーションユニットは、入出力の前後の依存関係を考慮することなく作成することが可能となり、信頼性が向上する。また、アプリケーションユニットは、独立したユーザ関数群として、例えば機能単位のユーザ関数の追加や削除を容易に行うことができる。さらに、従来のようにそれぞれのアプリケーションユニットのユーザ関数群内に入出力コードを記述して入出力を行う場合に比べ、制御プログラムのサイズを小さくすることが可能となり、電子制御装置のROM(Read Only Memory)等のメモリ容量を削減することができる。 Further, according to the conventional electronic control device, in the application phase, the user function group of the application unit is configured not to input / output to the input device and the output device. Therefore, the application unit can be created without considering the dependency before and after the input / output, and the reliability is improved. Further, the application unit can easily add or delete user functions in units of functions as independent user function groups, for example. Furthermore, the size of the control program can be reduced compared with the conventional case where input / output code is written in the user function group of each application unit and input / output is performed. Memory capacity such as “Only Memory” can be reduced.
このような従来の電子制御装置では、制御プログラムを所定時間毎に実行し、かつ制御処理が前記所定時間内に実行を完了するように制御していたので、入力フェーズ,アプリケーションフェーズ,および出力フェーズの各フェーズで入力データや出力結果の矛盾が生じないように、1つのイベントに対応するアプリケーションユニットのユーザ関数群の処理結果を他のユーザ関数の実行時に利用する場合には、次の周回での他のユーザ関数の実行時まで該処理結果を利用しないようにしていた。このため、処理結果の利用までに最大で所定時間のタイムスリットが生じ、この間にタイマ処理等が発生して上記処理結果が変更されてしまった場合には、処理結果の利用に矛盾が生じるおそれがあった。 In such a conventional electronic control apparatus, the control program is executed at predetermined time intervals, and the control process is controlled to complete the execution within the predetermined time period. Therefore, the input phase, application phase, and output phase are controlled. When using the processing result of the user function group of the application unit corresponding to one event when executing other user functions so that inconsistency of input data and output results does not occur in each phase of The processing result is not used until another user function is executed. For this reason, when a time slit of a predetermined time occurs at the maximum before the use of the processing result and a timer process or the like occurs during this time and the above processing result is changed, there is a risk of inconsistency in the use of the processing result. was there.
本発明の第1の目的は、上述の点に鑑み、イベントキュー方式を採用することにより、イベントの発生順序とイベントの処理順序との間の順序関係を保ち、簡易OSの開発工数の増大を抑えることができるようにした電子制御装置を提供することにある。 In view of the above points, the first object of the present invention is to employ an event queue method to maintain the order relationship between the event generation order and the event processing order, and to increase the development man-hours for a simple OS. An object of the present invention is to provide an electronic control device that can be suppressed.
本発明の第2の目的は、外部イベント,タイマ処理および内部イベントの順で処理することにより、外部イベントとタイマ処理との処理順序の逆転を抑えることができるとともに、内部イベントも同一周回で処理することができ、処理結果の利用までのタイムスリットが生じることがないようにした電子制御装置の制御方法を提供することにある。 The second object of the present invention is to process the external event, the timer process, and the internal event in this order, thereby suppressing the reversal of the processing order between the external event and the timer process, and processing the internal event in the same cycle. Another object of the present invention is to provide a method for controlling an electronic control device that does not cause a time slit until the processing result is used.
本発明の第3の目的は、電子制御装置をイベントキュー方式で動作させることができるプログラムを提供することにある。 A third object of the present invention is to provide a program capable of operating an electronic control device in an event queue system.
請求項1に記載の電子制御装置は、入力装置からイベントを入力する入力フェーズと、前記イベントに対応するアプリケーションユニットのユーザ関数群を実行するアプリケーションフェーズと、前記ユーザ関数群の処理結果に基づいて出力装置への出力を制御する出力フェーズとからなる制御処理を繰り返し行う電子制御装置であって、入力フェーズで入力装置からのイベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャ手段と、アプリケーションフェーズで前記イベントキューにキューイングされたイベントをデキューして該イベントに対応するアプリケーションユニットのユーザ関数群を実行するイベントハンドラ手段とを有することを特徴とする。請求項1に記載の電子制御装置によれば、イベントをイベントキューにキューイングするようにしたので、先出し先出し方式によりイベントの発生順序とイベントの処理順序との間の順序関係が保たれ、後のイベントが前のイベントの前に実行されて処理結果に矛盾が生じることが未然に防止される。 The electronic control device according to claim 1 is based on an input phase for inputting an event from an input device, an application phase for executing a user function group of an application unit corresponding to the event, and a processing result of the user function group. An electronic control device that repeatedly performs control processing consisting of an output phase that controls output to the output device, and an input processing manager means for queuing an event from the input device to an event queue by an input processing routine in the input phase; And event handler means for dequeuing an event queued in the event queue in an application phase and executing a user function group of an application unit corresponding to the event. According to the electronic control device of the first aspect, since the event is queued in the event queue, the order relation between the event generation order and the event processing order is maintained by the first-out first-out method. It is possible to prevent inconsistency in the processing result by executing the previous event before the previous event.
請求項2に記載の電子制御装置は、入力装置から外部イベントを入力する入力フェーズと、前記外部イベントに対応するアプリケーションユニットのユーザ関数群を実行するアプリケーションフェーズと、前記ユーザ関数群の処理結果に基づいて出力装置への出力を制御する出力フェーズとからなる制御処理を繰り返し行う電子制御装置であって、入力フェーズで入力装置からの外部イベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャ手段と、入力フェーズで前記入力処理ルーチンによって入力された外部イベントを入力調停ルーチンにより入力調停する入力調停マネージャ手段と、アプリケーションフェーズで前記イベントキューにキューイングされた外部イベントをデキューして該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する外部イベントハンドラ手段と、アプリケーションフェーズでタイマ処理に対応するアプリケーションユニットのユーザ関数群を実行するタイマ処理ハンドラ手段と、アプリケーションフェーズで前記タイマ処理に対応するアプリケーションユニットのユーザ関数群の実行により前記イベントキューにキューイングされた内部イベントをデキューして該内部イベントに対応するアプリケーションユニットのユーザ関数群を実行する内部イベントハンドラ手段と、アプリケーションフェーズで逐次処理に対応するアプリケーションユニットのユーザ関数群を逐次実行する逐次処理ハンドラ手段と、出力フェーズで前記ユーザ関数群の処理結果の出力装置への出力を出力調停ルーチンにより調停する出力調停マネージャ手段と、出力フェーズで前記出力調停ルーチンによる出力調停結果に基づいて出力処理ルーチンにより出力装置への出力を行う出力処理マネージャ手段とを有することを特徴とする。請求項2に記載の電子制御装置によれば、イベントをイベントキューにキューイングするようにしたので、先出し先出し方式によりイベントの発生順序とイベントの処理順序との間の順序関係が保たれ、後のイベントが前のイベントの前に実行されて処理結果に矛盾が生じることが未然に防止されるとともに、外部イベントの入力調停および処理結果の出力調停を行うようにしたことにより、外部イベント間の処理順序の逆転,および処理結果の出力順序の逆転を未然に防止できる。加えて、入力装置や出力装置がネットワークを介してデータを伝達するための電子制御装置である場合には、ネットワークによるデータの入出力の遅延を調停することができ、制御プログラムの設計を容易にすることができる。 The electronic control device according to claim 2 includes an input phase for inputting an external event from an input device, an application phase for executing a user function group of an application unit corresponding to the external event, and a processing result of the user function group. An input control manager that repeatedly performs control processing consisting of an output phase for controlling output to an output device based on it, and queues an external event from the input device in an event queue by an input processing routine in the input phase Means, input arbitration manager means for arbitrating an external event input by the input processing routine in the input phase by an input arbitration routine, and dequeuing the external event queued in the event queue in the application phase In External event handler means for executing a user function group of the corresponding application unit, timer processing handler means for executing a user function group of the application unit corresponding to timer processing in the application phase, and an application corresponding to the timer processing in the application phase Internal event handler means for dequeuing internal events queued in the event queue by execution of the user function group of the unit and executing the user function group of the application unit corresponding to the internal event, and corresponding to sequential processing in the application phase A sequential processing handler means for sequentially executing the user function group of the application unit to be output, and an output to the output arbitration routine to output the processing result of the user function group to the output device in the output phase Output arbitration manager means for arbitrating Ri, and having an output processing manager means for outputting to the output device by the output routine based on the output arbitration result of said output arbitration routine at the output phase. According to the second aspect of the present invention, since the event is queued in the event queue, the order relationship between the event generation order and the event processing order is maintained by the first-out first-out method. Event is executed before the previous event to prevent inconsistency in the processing results, and external event input arbitration and processing result output arbitration are performed. It is possible to prevent the processing order from being reversed and the processing result output order from being reversed. In addition, when the input device or output device is an electronic control device for transmitting data via a network, the delay of data input / output by the network can be arbitrated, and the control program can be designed easily. can do.
請求項3に記載の電子制御装置は、前記外部イベントハンドラ手段,前記タイマ処理ハンドラ手段,前記内部イベントハンドラ手段,および逐次処理ハンドラ手段を順次実行する簡易OS手段を備えることを特徴とする。請求項3に記載の電子制御装置によれば、外部イベント,タイマ処理,および内部イベントの順序でアプリケーションユニットのユーザ関数群が実行されるので、外部イベントとタイマ処理との処理順序の逆転を防止でき、かつ内部イベントも同一周回で処理することができる。このため、処理結果の利用までの最大で所定時間のタイムスリットが生じることがなくなり、処理結果の利用に矛盾が生じることがなくなる。 According to a third aspect of the present invention, there is provided an electronic control device comprising a simplified OS means for sequentially executing the external event handler means, the timer processing handler means, the internal event handler means, and the sequential processing handler means. According to the electronic control device of the third aspect, since the user function group of the application unit is executed in the order of the external event, the timer process, and the internal event, the reversal of the process order between the external event and the timer process is prevented. And internal events can be processed in the same lap. For this reason, a time slit for a predetermined time at most until the use of the processing result does not occur, and there is no contradiction in the use of the processing result.
請求項4に記載の電子制御装置は、前記制御処理は、所定時間毎に実行し、該制御処理は前記所定時間内に完了することを特徴とする。請求項4に記載の電子制御装置によれば、制御処理は繰り返し実行することとなるが、所定時間毎に周期的に制御処理を実行し、その所定時間内に処理が完了することで、例えばリアルタイムOSのような複雑な処理を、極力省いた低コストで信頼性の高い電子制御装置とすることができる。 The electronic control device according to claim 4 is characterized in that the control process is executed at predetermined time intervals, and the control process is completed within the predetermined time period. According to the electronic control device of the fourth aspect, the control process is repeatedly executed. By executing the control process periodically at predetermined time intervals and completing the process within the predetermined time period, for example, A complicated process such as a real-time OS can be reduced to a low cost and highly reliable electronic control device.
請求項5に記載の電子制御装置は、イベント毎に当該イベントに対応するアプリケーションユニットのユーザ関数群のアドレスを格納するイベントテーブルと、イベントに対応するイベントテーブルへのポインタを先入れ先出し方式で蓄積するイベントキューと、イベントを検出したときに該イベントに対応するイベントテーブルへのポインタを前記イベントキューにキューイングする入力処理手段と、前記イベントキューにイベントがキューイングされている場合に前記イベントキューから該イベントに対応するイベントテーブルへのポインタをデキューし、該ポインタが指すイベントテーブルを参照して該イベントに対応するアプリケーションユニットのユーザ関数群を呼び出すイベントハンドラ手段とを有することを特徴とする。請求項5に記載の電子制御装置によれば、簡易OSはイベントキューにキューイングされたイベントに対応するイベントテーブルに格納されたユーザ関数群を呼び出せばよいので、従来のイベントフラグとそれに対応する関数群との整合を管理する必要がなくなり、簡易OSの開発工数が軽減される。 The electronic control device according to claim 5, wherein an event table storing an address of a user function group of an application unit corresponding to the event for each event and an event for storing a pointer to the event table corresponding to the event in a first-in first-out manner A queue, input processing means for queuing a pointer to the event table corresponding to the event when the event is detected, and the event queue when the event is queued to the event queue. Event handler means for dequeuing a pointer to an event table corresponding to an event and calling a user function group of an application unit corresponding to the event with reference to the event table pointed to by the pointer. According to the electronic control device of the fifth aspect, since the simple OS only has to call the user function group stored in the event table corresponding to the event queued in the event queue, the conventional event flag and the corresponding event flag are associated therewith. It is not necessary to manage the consistency with the function group, and the development man-hour for the simple OS is reduced.
請求項6に記載の電子制御装置は、イベント毎に当該イベントに対応するアプリケーションユニットのユーザ関数群のアドレスを格納するイベントテーブルと、イベントに対応するイベントテーブルへのポインタを先入れ先出し方式で蓄積するイベントキューと、入力装置からの外部イベントを入力処理ルーチンにより前記イベントキューにキューイングする入力処理マネージャ手段と、前記入力処理ルーチンによって入力された外部イベントを入力調停ルーチンにより入力調停する入力調停マネージャ手段と、前記イベントキューにキューイングされた外部イベントをデキューして該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する外部イベントハンドラ手段と、タイマ処理に対応するアプリケーションユニットのユーザ関数群を実行するタイマ処理ハンドラ手段と、前記タイマ処理に対応するアプリケーションユニットのユーザ関数群の実行によりイベントキューにキューイングされた内部イベントをデキューして該内部イベントに対応するアプリケーションユニットのユーザ関数群を実行する内部イベントハンドラ手段と、逐次処理に対応するアプリケーションユニットのユーザ関数群を逐次実行する逐次処理ハンドラ手段と、前記ユーザ関数群の処理結果の出力装置への出力を出力調停ルーチンにより調停する出力調停マネージャ手段と、前記出力調停ルーチンによる出力調停結果に基づいて出力処理ルーチンにより出力装置への出力を行う出力処理マネージャ手段とを有することを特徴とする。請求項6に記載の電子制御装置によれば、イベントをイベントキューにキューイングするようにしたので、先出し先出し方式によりイベントの発生順序とイベントの処理順序との間の順序関係が保たれ、後のイベントが前のイベントの前に実行されて処理結果に矛盾が生じることが未然に防止されるとともに、外部イベントの入力調停および処理結果の出力調停を行うようにしたことにより、外部イベント間の処理順序の逆転,および処理結果の出力順序の逆転を未然に防止できる。加えて、入力装置や出力装置がネットワークを介してデータを伝達するための電子制御装置である場合には、ネットワークによるデータの入出力の遅延を調停することができ、制御プログラムの設計を容易にすることができる。 The electronic control device according to claim 6, wherein for each event, an event table storing an address of a user function group of an application unit corresponding to the event, and an event storing a pointer to the event table corresponding to the event in a first-in first-out manner An input processing manager for queuing an external event from the input device to the event queue by an input processing routine; and an input arbitration manager for input arbitrating an external event input by the input processing routine by an input arbitration routine; External event handler means for dequeuing an external event queued in the event queue and executing a user function group of an application unit corresponding to the external event, and an application unit corresponding to timer processing Timer processing handler means for executing the user function group of the application unit, and an internal event queued in the event queue by execution of the user function group of the application unit corresponding to the timer process to dequeue the internal event of the application unit corresponding to the internal event An internal event handler means for executing the user function group, a sequential processing handler means for sequentially executing the user function group of the application unit corresponding to the sequential processing, and an output arbitration routine for outputting the processing result of the user function group to the output device Output arbitration manager means for arbitrating according to the above, and output processing manager means for performing output to the output device by the output processing routine based on the output arbitration result by the output arbitration routine. According to the electronic control device of the sixth aspect, since the event is queued in the event queue, the order relation between the event generation order and the event processing order is maintained by the first-out first-out method, and Event is executed before the previous event to prevent inconsistency in the processing results, and external event input arbitration and processing result output arbitration are performed. It is possible to prevent the processing order from being reversed and the processing result output order from being reversed. In addition, when the input device or output device is an electronic control device for transmitting data via a network, the delay of data input / output by the network can be arbitrated, and the control program can be designed easily. can do.
一方、請求項7に記載の電子制御装置の制御方法は、入力装置からイベントを入力する入力フェーズと、前記イベントに対応するアプリケーションユニットのユーザ関数群を実行するアプリケーションフェーズと、前記ユーザ関数群の処理結果に基づいて出力装置への出力を制御する出力フェーズとからなる制御処理を繰り返し行う電子制御装置の制御方法であって、入力装置からのイベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャを実行する工程と、前記イベントキューに外部イベントがキューイングされているかどうかをチェックし、外部イベントが前記イベントキューにキューイングされている場合に外部イベントハンドラにより該外部イベントを前記イベントキューからデキューして該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する工程とを含むことを特徴とする。請求項7に記載の電子制御装置の制御方法によれば、イベントをイベントキューにキューイングするようにしたので、先出し先出し方式によりイベントの発生順序とイベントの処理順序との間の順序関係が保たれ、後のイベントが前のイベントの前に実行されて処理結果に矛盾が生じることが未然に防止される。 On the other hand, the control method of the electronic control device according to claim 7 includes: an input phase for inputting an event from an input device; an application phase for executing a user function group of an application unit corresponding to the event; and the user function group An electronic control device control method for repeatedly performing a control process comprising an output phase for controlling output to an output device based on a processing result, wherein input from an input device is queued in an event queue by an input processing routine Executing a processing manager and checking whether an external event is queued in the event queue; if an external event is queued in the event queue, the external event handler sends the external event to the event queue. Dequeue from the outside Characterized in that it comprises a step of executing a user function group of application units corresponding to the vent. According to the control method of the electronic control device according to the seventh aspect, since the event is queued in the event queue, the order relationship between the event generation order and the event processing order is maintained by the first-out first-out method. Therefore, it is possible to prevent a subsequent event from being executed before a previous event and causing inconsistencies in processing results.
請求項8に記載の電子制御装置の制御方法は、入力装置から外部イベントを入力する入力フェーズと、前記外部イベントに対応するアプリケーションユニットのユーザ関数群を実行するアプリケーションフェーズと、前記ユーザ関数群の処理結果に基づいて出力装置への出力を制御する出力フェーズとからなる制御処理を繰り返し行う電子制御装置の制御方法であって、入力装置からの外部イベントをチェックし、外部イベントがある場合に外部イベントに対応する入力処理ルーチンにより該外部イベントをイベントキューにキューイングする入力処理マネージャを実行する工程と、前記入力処理ルーチンによって入力されたイベントの入力調停の必要がある場合に入力調停ルーチンにより入力調停を行う入力調停マネージャを実行する工程と、前記イベントキューから外部イベントをデキューして外部イベントハンドラにより該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する工程と、タイマ処理ハンドラにより起動時刻を経過したタイマ処理に対応するアプリケーションユニットのユーザ関数群を実行する工程と、前記タイマ処理に対応するアプリケーションユニットのユーザ関数群の実行によって前記イベントキューにキューイングされている内部イベントをデキューして内部イベントハンドラにより該内部イベントに対応するアプリケーションユニットのユーザ関数群を実行する工程と、逐次処理ハンドラにより逐次処理に対応するアプリケーションユニットのユーザ関数群を実行する工程と、前記ユーザ関数群の処理結果の出力装置への出力を出力調停ルーチンにより調停する出力調停マネージャを実行する工程と、前記出力調停ルーチンの出力調停結果に基づいて出力処理ルーチンにより出力装置への出力を行う出力処理マネージャを実行する工程とを含むことを特徴とする。請求項8に記載の電子制御装置の制御方法によれば、イベントをイベントキューにキューイングするようにしたので、先出し先出し方式によりイベントの発生順序とイベントの処理順序との間の順序関係が保たれ、後のイベントが前のイベントの前に実行されて処理結果に矛盾が生じることが未然に防止されるとともに、外部イベントの入力調停および処理結果の出力調停を行うようにしたことにより、外部イベント間の処理順序の逆転,および処理結果の出力順序の逆転を未然に防止できる。加えて、入力装置や出力装置がネットワークを介してデータを伝達するための電子制御装置である場合には、ネットワークによるデータの入出力の遅延を調停することができ、制御プログラムの設計を容易にすることができる。 The control method of the electronic control device according to claim 8, wherein an input phase for inputting an external event from an input device, an application phase for executing a user function group of an application unit corresponding to the external event, and the user function group An electronic control device control method that repeatedly performs control processing consisting of an output phase that controls output to an output device based on a processing result, and checks an external event from the input device, and externally if there is an external event An input processing routine for queuing the external event in the event queue by the input processing routine corresponding to the event, and input by the input arbitration routine when there is a need for input arbitration of the event input by the input processing routine Process of executing input arbitration manager that performs arbitration A step of dequeuing an external event from the event queue and executing a user function group of an application unit corresponding to the external event by an external event handler; and an application unit corresponding to a timer process whose activation time has elapsed by a timer processing handler An application that dequeues an internal event queued in the event queue by executing a user function group and executing a user function group of an application unit corresponding to the timer process, and responds to the internal event by an internal event handler A step of executing the user function group of the unit, a step of executing the user function group of the application unit corresponding to the sequential processing by the sequential processing handler, and outputting the processing result of the user function group to the output device A step of executing an output arbitration manager for arbitrating by an output arbitration routine; and a step of executing an output processing manager for performing output to an output device by an output processing routine based on an output arbitration result of the output arbitration routine. And According to the control method of the electronic control device according to the eighth aspect, since the event is queued in the event queue, the order relation between the event generation order and the event processing order is maintained by the first-out first-out method. Therefore, it is possible to prevent the inconsistency in the processing result by executing the subsequent event before the previous event, and by adjusting the input of the external event and the output of the processing result, It is possible to prevent inversion of processing order between events and inversion of processing result output order. In addition, when the input device or output device is an electronic control device for transmitting data via a network, the delay of data input / output by the network can be arbitrated, and the control program can be designed easily. can do.
他方、請求項9に記載のプログラムは、入力装置からのイベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャと、前記イベントキューにイベントがキューイングされているかどうかをチェックする簡易OSと、前記イベントキューにイベントがキューイングされている場合に該外部イベントをデキューして該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する外部イベントハンドラとを含むことを特徴とする。請求項9に記載のプログラムによれば、イベントをイベントキューにキューイングするようにしたので、先出し先出し方式によりイベントの発生順序とイベントの処理順序との間の順序関係が保たれ、後のイベントが前のイベントの前に実行されて処理結果に矛盾が生じることが未然に防止される電子制御装置を容易に実現することができる。 On the other hand, the program according to claim 9 includes an input processing manager that queues an event from an input device in an event queue by an input processing routine, and a simple OS that checks whether an event is queued in the event queue; And an external event handler that dequeues the external event and executes a user function group of the application unit corresponding to the external event when an event is queued in the event queue. According to the program of claim 9, since the event is queued in the event queue, the order relation between the event generation order and the event processing order is maintained by the first-out first-out method, and the subsequent event It is possible to easily realize an electronic control device that is executed before the previous event and prevents inconsistency in processing results.
請求項10に記載のプログラムは、入力装置からの外部イベントをチェックする入力処理マネージャと、該外部イベントをイベントキューにキューイングする入力処理ルーチンと、前記入力処理ルーチンによって入力されたイベントに基づいて前記イベントキューにキューイングされた外部イベントの入力調停が必要かどうかを判断する入力調停マネージャと、前記入力調停マネージャにより入力調停が必要であると判断された場合に入力調停を実行する入力調停ルーチンと、前記イベントキューにキューイングされた外部イベントをデキューして該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する外部イベントハンドラと、タイマ処理に対応するアプリケーションユニットのユーザ関数群を実行するタイマ処理ハンドラと、前記タイマ処理に対応するアプリケーションユニットのユーザ関数群の実行によりイベントキューにキューイングされた内部イベントをデキューして該内部イベントに対応するアプリケーションユニットのユーザ関数群を実行する内部イベントハンドラと、逐次処理に対応するアプリケーションユニットのユーザ関数群を逐次実行する逐次処理ハンドラと、前記ユーザ関数群の処理結果の出力装置への出力を出力調停する必要があるかどうかを判断する出力調停マネージャと、前記出力調停マネージャにより出力調停が必要であると判断された出力を調停する出力調停ルーチンと、、前記出力調停マネージャによる出力調停結果に基づいて出力処理ルーチンにより出力装置への出力を実行する出力処理マネージャとを含むことを特徴とする。請求項10に記載のプログラムによれば、先出し先出し方式によりイベントの発生順序とイベントの処理順序との間の順序関係が保たれ、後のイベントが前のイベントの前に実行されて処理結果に矛盾が生じることが未然に防止されるとともに、外部イベントの入力調停および処理結果の出力調停を行うようにしたことにより、外部イベント間の処理順序の逆転,および処理結果の出力順序の逆転を未然に防止できる。加えて、入力装置や出力装置がネットワークを介してデータを伝達するための電子制御装置である場合には、ネットワークによるデータの入出力の遅延を調停することができ、制御プログラムの設計を容易にする電子制御装置を容易に実現することができる。
The program according to
入力フェーズで入力装置からのイベントをイベントキューにキューイングし、アプリケーションフェーズでイベントキューにキューイングされたイベントをデキューして該イベントに対応するアプリケーションユニットのユーザ関数群を実行することにより、イベントの発生順序とイベントの処理順序との間の順序関係を保つ。 By queuing the event from the input device in the event queue in the input phase, dequeuing the event queued in the event queue in the application phase, and executing the user function group of the application unit corresponding to the event, Maintain the order relationship between the order of occurrence and the order of event processing.
以下、本発明の実施例について図面を用いて説明する。 Embodiments of the present invention will be described below with reference to the drawings.
図2は、本発明の実施例1に係る電子制御装置であるボデーECU10を備えたボデー系システム100を示すブロック図である。このボデー系システム100は、ネットワークに相当する車内LAN(Local Area Network)50に接続されたボデーECU10と、ボデーECU10と車内LAN50を介して通信可能な通信対象ECU20とを備える。
FIG. 2 is a block diagram showing a
ボデーECU10および通信対象ECU20は、CPU (Central Processing Unit) 11,ROM12,RAM(Random Access Memory) 13,I/O (Input/Output) ポート14,タイマ15等を備えたコンピュータシステムであり、I/Oポート14には入力装置30,出力装置40および車内LAN50が接続されている。
The
通信対象ECU20は、入力装置30の状態を読み取ってパケットを生成し、車内LAN50を介してボデーECU10へ送信する。また、通信対象ECU20は、車内LAN50を介して入力されるボデーECU10からのパケットの制御情報に基づいて出力装置40を制御する。通信対象ECU20は、例えば、ドライバ側のドア(D席ドア)に設置されたECUであるD席ドアECU20a,補助席側のドア(P席ドア)に設置されたECUであるP席ドアECU20b,インスツルメントパネル(インパネ)に設置されたECUであるインパネECU20c等である。
The
D席ドアECU20aには、入力装置30としてD席ドアコントロールスイッチ30a等が接続されており、出力装置40としてD席ドアロックモータ40a,D席パワーウインドウモータ(図示せず)等が接続されている。
The D
P席ドアECU20bには、入力装置30としてP席ドアコントロールスイッチ30b等が接続され、出力装置40としてP席ドアロックモータ40b,P席パワーウインドウモータ(図示せず)等が接続されている。
The P
インパネECU20cには、出力装置40としてブザー40c,ランプ40d等が接続されている。
A
ボデーECU10は、通信対象ECU20から車内LAN50に送信されるパケットを所定時間毎に受信して、I/Oポート14を介して取り込み、取り込んだパケットの内容に応じたアプリケーションユニットを起動して、出力装置40の制御が必要な場合には、制御対象の通信対象ECU20への制御指示を含むパケットを生成して送信する制御処理を行う。
The
図1は、本発明の実施例1に係る電子制御装置であるボデーECU10の制御プログラムの構成を示すブロック図である。この制御プログラムは、システムフェーズの処理プログラム群と、入力フェーズの処理プログラム群と、アプリケーションフェーズの処理プログラム群と、出力フェーズの処理プログラム群とから、その主要部が構成されている。
FIG. 1 is a block diagram showing a configuration of a control program of a
システムフェーズの処理プログラム群は、ボデーECU10のシステムを初期化するシステム初期化ルーチン101と、アイドルタスクを管理するアイドルタスクマネージャ102と、アイドルタスク用のユーザ定義103と、CPU11を監視するCPU監視マネージャ104と、タイマ割込みを受け付けるシステムマネージャ105と、タイマ割込みから抜けるスリープマネージャ106とから構成されている。
The system phase processing program group includes a
入力フェーズの処理プログラム群は、入力装置30からの外部イベントを入力処理ルーチン112によりイベントキューIQにキューイングする入力処理マネージャ111と、外部イベント対応に設けられた複数(図示は1つ)の入力処理ルーチン112と、入力処理ルーチン112によって入力された外部イベントを入力調停ルーチン114により入力調停する入力調停マネージャ113と、外部イベント対応に設けられた複数(図示は1つ)の入力調停ルーチン114とから構成されている。
The input phase processing program group includes an
アプリケーションフェーズの処理プログラム群は、イベントキューIQ(図3参照)を備える簡易OS121と、イベントキューIQにキューイングされた外部イベントをデキューして該外部イベントに対応するアプリケーションユニットのユーザ関数群123を実行する外部イベントハンドラ122と、外部イベントに対応するアプリケーションユニットのユーザ関数群123と、タイマ処理に対応するアプリケーションユニットのユーザ関数群125を実行するタイマ処理ハンドラ124と、タイマ処理に対応するアプリケーションユニットのユーザ関数群125と、タイマ処理に対応するアプリケーションユニットのユーザ関数群125の実行によりイベントキューIQにキューイングされた内部イベントをデキューして該内部イベントに対応するアプリケーションユニットのユーザ関数群127を実行する内部イベントハンドラ126と、内部イベントに対応するアプリケーションユニットのユーザ関数群127と、逐次処理に対応するアプリケーションユニットのユーザ関数群129を逐次実行する逐次処理ハンドラ128と、逐次処理に対応するアプリケーションユニットのユーザ関数群129とから構成されている。
The application phase processing program group includes a
外部イベントに対応するアプリケーションユニットのユーザ関数群123,タイマ処理に対応するアプリケーションユニットのユーザ関数群125,内部イベントに対応するアプリケーションユニットのユーザ関数群127,および逐次処理に対応するアプリケーションユニットのユーザ関数群129は、複数のユーザ関数で構成されており、各アプリケーションユニットのユーザ関数群はI/Oポート14への入出力処理を直接行わないように構成されている。すなわち、入力は、入力フェーズで入力処理ルーチン112および入力調停ルーチン114によってRAM13上の入力データ格納領域を媒介にして行い、出力は、出力フェーズで出力調停ルーチン132および出力処理ルーチン134によってRAM13上の処理結果格納領域を媒介にして行う。
また、各アプリケーションユニットのユーザ関数群間のデータの受け渡しは、直接的には行わないように構成されている。すなわち、例えば、先に実行されるアプリケーションユニットのユーザ関数群と後に実行されるアプリケーションユニットのユーザ関数群とがある場合に、先に実行されるアプリケーションユニットのユーザ関数群を実行した結果のデータ(処理結果)は、後で実行されるアプリケーションユニットのユーザ関数群では使用しないように構成する。つまり、先に実行されるアプリケーションユニットのユーザ関数群は、処理結果をRAM13上の処理結果格納領域に記憶するが、その処理結果は後で実行されるアプリケーションユニットのユーザ関数群からは直接的には参照しない。後で実行されるアプリケーションユニットのユーザ関数群が先に実行されるアプリケーションユニットのユーザ関数群の処理結果を必要とする場合には、予め入力調停ルーチン114により処理結果格納領域に格納された処理結果を、入力データ格納領域にコピーするようにする。そして、イベントキューIQから取り出されたイベントに応じてユーザ関数が起動された際に入力データ格納領域から処理結果を参照する。したがって、たとえ先に実行されるアプリケーションユニットのユーザ関数群の直後に後に実行されるアプリケーションユニットのユーザ関数群を実行する場合であっても、後で実行されるアプリケーションユニットのユーザ関数群は処理結果格納領域ではなく、入力データ格納領域を参照して処理に利用するため、同周回(直前)の先に実行されるアプリケーションユニットのユーザ関数群の処理結果ではなく、前周回のタイマ割込み時の先に実行されるアプリケーションユニットのユーザ関数群の処理結果を利用して処理を行う。
Further, data is not directly transferred between user function groups of each application unit. That is, for example, when there is a user function group of an application unit to be executed first and a user function group of an application unit to be executed later, data of a result of executing the user function group of the application unit executed first ( The processing result) is configured not to be used in the user function group of the application unit to be executed later. That is, the user function group of the application unit executed first stores the processing result in the processing result storage area on the
また、いずれのアプリケーションユニットのユーザ関数群を実行するかは、外部イベントハンドラ122,タイマ処理ハンドラ124,内部イベントハンドラ126および逐次処理ハンドラ128によって決定される。この決定処理は、予め各アプリケーションユニットのユーザ関数群がどのイベントが発生した際に実行されるかを登録するイベントテーブルT0〜Tn(図3参照)に基づいて行う。イベントテーブルT0〜Tnには、イベントに対応するアプリケーションユニットのユーザ関数群のアドレスが登録(記憶)されており、入力処理ルーチン112によってイベントがイベントキューIQにキューイングされた場合(イベントが発生した場合)には、イベントに対応するアプリケーションユニットのユーザ関数群のアドレスを呼び出して、そのユーザ関数群に制御を移行する。なお、1つのイベントに対して複数のユーザ関数がイベントテーブルT0〜Tnで対応付けられている場合には、そのイベントに対応するアプリケーションユニットのユーザ関数同士は、順次実行するようにする。すなわち、1つのイベントに対応するアプリケーションユニットのユーザ関数群が、ユーザ関数U1,ユーザ関数U2,ユーザ関数U3,…,ユーザ関数Uxからなる場合には、ユーザ関数U1が終了したならば、ユーザ関数U2へ制御を移行し、ユーザ関数U2が終了したならば、ユーザ関数U3に制御を移行するというようにユーザ関数を順次実行する。
Which application unit user function group is to be executed is determined by the
出力フェーズの処理プログラム群は、各アプリケーションユニットのユーザ関数群の処理結果の出力装置40への出力を出力調停ルーチン132により調停する出力調停マネージャ131と、複数(図示は1つ)の出力調停ルーチン132と、出力調停ルーチン132による出力調停結果に基づいて出力処理ルーチン134により出力装置40への出力を行う出力処理マネージャ133と、複数(図示は1つ)の出力処理ルーチン134とから構成されている。
The output phase processing program group includes an
図3を参照すると、本実施例1に係る電子制御装置で採用されているイベントキュー方式は、イベントフラグ方式(図5参照)の欠点を改善するために、アプリケーションフェーズの簡易OS121が管理していたイベントの種類およびイベントテーブルT0〜Tnを入力フェーズの各入力処理ルーチン112に持たせる。図3では、入力処理ルーチンAはスイッチAONイベントテーブルT0およびスイッチAOFFイベントテーブルT1を持ち、入力処理ルーチンBはスイッチBONイベントテーブルT2およびスイッチBOFFイベントテーブルT3を持つ。一方、アプリケーションフェーズの簡易OS121には、イベントキューIQが備えられている。各入力処理ルーチン112は、外部イベントを検出した場合、その外部イベントに対応するイベントテーブルT0〜Tnへのポインタ(アドレス)をイベントキューIQに登録する。簡易OS121は、定期的に(周回毎に)イベントキューIQをチェックして、イベントキューIQにイベントがキューイングされていれば、イベントキューIQから先入れ先出し方式でイベントに対応するイベントテーブルT0〜Tnへのポインタ(アドレス)をデキューし、そのポインタが指すイベントテーブルT0〜Tnを参照してイベントに対応するアプリケーションユニットのユーザ関数群を呼び出す。
Referring to FIG. 3, the event queue method employed in the electronic control apparatus according to the first embodiment is managed by the
図4は、アプリケーションフェーズにおける処理を表すフローチャートである。 FIG. 4 is a flowchart showing processing in the application phase.
次に、このように構成された本実施例1に係る電子制御装置であるボデーECU10の動作について、図1ないし図4を参照しながら説明する。
Next, the operation of the
ボデーECU10では、電源が投入されると、図1に示すように、システムフェーズでシステム初期化ルーチン101が、I/Oポート14やRAM13等のシステム初期化処理を行う。次に、アイドルタスクマネージャ102が起動され、アイドルタスク用のユーザ定義103を実行する。続いて、CPU11の状態を監視するCPU監視マネージャ104が実行される。そして、アイドルタスクマネージャ102に制御が戻る。このようにアイドルタスクマネージャ102,ユーザ定義103,およびCPU監視マネージャ104がループして実行される。
In the
そして、タイマ15から所定時間、例えば5ms毎にCPU11にタイマ割込みがかかるので、このタイマ割込みによって、システムマネージャ105へ制御が移行される。
Since a timer interrupt is applied to the CPU 11 from the
システムマネージャ105は、割込みタスクを起動して、入力処理マネージャ111,入力調停マネージャ113,簡易OS121,出力調停マネージャ131,および出力処理マネージャ133をシンプルスケジュール方式で順次実行する。
The
まず、入力処理マネージャ111は、I/Oポート14から入力される外部イベントをチェックする。具体的には、各入力処理ルーチン112を順次起動して、各入力処理ルーチン112に対応する外部イベントが入力されているかどうかをチェックする(図3(a)参照)。外部イベントがなければ、入力処理ルーチン112は何もしない(図3(a)−1参照)。例えば、D席ドアECU20aから車内LAN50を介して入力される外部イベントを検出する。外部イベントがあれば、入力処理ルーチン112は、図1中の破線矢印で示すように、簡易OS121のイベントキューIQに外部イベントをキューイングする(図3(a)−2参照)。全ての入力処理ルーチン112について処理を終了すると、入力処理マネージャ111は、入力調停マネージャ113に制御を移行する。
First, the
イベントキュー方式を採用することにより、外部イベントの種類や数が変わっても、アプリケーションフェーズでの処理に変更の影響が及ばない。また、ボデーECU10の外部イベントは入力によって種類や数が決定するので、入力処理ルーチン112にイベントテーブルT0〜Tnを持たせることは変更単位と一致しているので、保守が容易となる。ここで、例えば、ドアが閉まっている時のボタン操作でドアをロックする制御において、複数のイベント、すなわちボタン操作とドア開とが同時に発生した場合を考える。入力処理マネージャ111が、先にボタン操作を検知し、次にドア開を検知した場合、入力処理ルーチン112が、これらの外部イベントをイベントキューIQにキューイングせずに通知してしまうとドアをロックしてしまう(誤動作)。一方、入力処理ルーチン112が、外部イベントをイベントキューIQにキューイングして、ドアの変化も検知した後にボタン操作イベントが通知されると、ドアが開いている時のボタン操作と認識してドアをロックしない(正常動作)。
By adopting the event queue method, even if the type and number of external events change, the processing in the application phase is not affected. Further, since the type and number of external events of the
入力調停マネージャ113は、入力処理マネージャ111から制御が移行されると、入力処理マネージャ111でI/Oポート14から入力した外部イベントを総合して入力調停を行う。詳しくは、入力調停マネージャ113は、入力調停ルーチン114を起動させ、入力処理マネージャ111によって入力された外部イベントの入力データに基づいてイベントキューIQにキューイングされた外部イベントを入力調停する。例えば、入力調停マネージャ113は、外部イベントAの入力データと外部イベントBの入力データとがともに値“1”の場合に、入力調停結果として外部イベントCを発生するというような入力調停を行う。このような入力調停が行われると、外部イベントCをイベントキューIQにキューイングすることにより、アプリケーションフェーズおいて、外部イベントCの発生時に実行すべき外部イベントに対応するアプリケーションユニットのユーザ関数群123を実行させることができる。このような仕組みを利用することにより、外部イベントの組み合わせに応じた外部イベントに対応するアプリケーションユニットのユーザ関数群123を実行させることができ、アプリケーションユニット内で入力データに矛盾がないか等をチェックする必要がなくなる場合がある。したがって、制御プログラムの作成が容易になり、モジュール性も高くなって信頼性が向上する。入力調停マネージャ113は、各入力調停ルーチン114を順次実行し、すべての入力調停ルーチン114の実行が終了すると、アプリケーションフェーズの簡易OS121に制御を移行する。
When control is transferred from the
アプリケーションフェーズの簡易OS121は、入力調停マネージャ113から制御が移行されると、イベントキューIQに外部イベント(イベントテーブルT0〜Tnへのポインタ)がキューイングされているかどうかをチェックする(ステップS101)。イベントキューIQに外部イベントがキューイングされていなければ(ステップS101でノー)、簡易OS121は、外部イベントハンドラ122を起動することなく、ステップS104に制御を移す。イベントキューIQに外部イベントがキューイングされていれば(ステップS101でイエス)、簡易OS121は、外部イベントハンドラ122を起動する。
When the control is transferred from the
外部イベントハンドラ122は、イベントキューIQから先入れ先出し方式で外部イベントをデキューして(ステップS102)、イベントテーブルへのポインタが指すイベントテーブルを参照して、外部イベントに対応するアプリケーションユニットのユーザ関数群123を呼び出して逐次実行する(ステップS103)。図3の例をとると、簡易OS121がイベントキューIQをチェックし(図3(b)参照)、イベントキューIQにポインタがキューイングされていれば、外部イベントハンドラ122は、ポインタが指すスイッチBONイベントテーブルT2を参照して外部イベントに対応するアプリケーションユニットのユーザ関数群(B1,B2,B3)を呼び出して順次実行する(図3(b)−1参照)。イベントキューIQにキューイングされているすべての外部イベントについてステップS102およびS103を繰り返し、ステップS101でイベントキューIQに外部イベントがキューイングされていなくなれば(ステップS101でノー)、外部イベントハンドラ122は、処理を終了して、簡易OS121に制御を戻す。
The
簡易OS121は、外部イベントハンドラ122から制御が戻ると、起動時刻を経過したタイマ処理があるかどうかをチェックし(ステップS104)、起動時刻を経過したタイマ処理がなければ(ステップS104でノー)、タイマ処理ハンドラ124を起動することなく、ステップS106に制御を移す。タイマ処理があれば(ステップS104でイエス)、簡易OS121は、タイマ処理ハンドラ124を起動する。ここで、外部イベントとタイマ処理との処理順序を考えると、タイマ処理は純粋にソフトウェア内部の処理であるのに対し、外部イベントは電子制御装置の外で発生して観測可能であるので、外部イベントを先に処理する。外部イベントハンドラ122の処理完了後に、タイマ処理ハンドラ124を起動することにより、外部イベントとタイマ処理との処理順序の逆転を抑えることができる。例えば、前周回の出力イベントでキャンセルされるべきものが、タイマ処理によって動いてしまうことを抑えるために、外部イベントを先に処理する。
When the control returns from the
タイマ処理ハンドラ124は、起動時刻を経過したタイマ処理に対応するアプリケーションユニットのユーザ関数群125を呼び出して逐次実行する(ステップS105)。なお、タイマ処理に対応するアプリケーションユニットのユーザ関数群125の実行の過程で、新たなイベント(以下、内部イベントという)が発生すると、ユーザ関数群125は、内部イベントを簡易OS121のイベントキューIQにキューイングする(図1中の破線矢印を参照)。そして、すべての起動時刻を経過したタイマ処理に対応するアプリケーションユニットのユーザ関数群125の実行が完了すると、タイマ処理ハンドラ124は、処理を終了して、簡易OS121に制御を戻す。
The
簡易OS121は、タイマ処理ハンドラ124から制御が戻ると、イベントキューIQに内部イベントがキューイングされているかどうかをチェックし(ステップS106)、内部イベントがキューイングされていなければ(ステップS106でノー)、内部イベントハンドラ126を起動することなく、ステップS109に制御を移す。イベントキューIQに内部イベントがキューイングされていれば(ステップS106でイエス)、簡易OS121は、内部イベントハンドラ126を起動する。
When the control returns from the
このように、タイマ処理に対応するアプリケーションユニットのユーザ関数群125を実行することによって発生する内部イベントがあるので、タイマ処理ハンドラ124によるタイマ処理に対応するアプリケーションユニットのユーザ関数群125の実行後に、内部イベントハンドラ126により内部イベントに対応するアプリケーションユニットのユーザ関数群127を実行する。このため、処理順序は、外部イベント→タイマ処理→内部イベントの順になる。
As described above, since there is an internal event generated by executing the
内部イベントハンドラ126は、イベントキューIQから先入れ先出し方式で内部イベントをデキューし(ステップS107)、該内部イベントのポインタを辿ってイベントテーブルT0〜Tnを参照し、イベントテーブルT0〜Tnに登録されている内部イベントに対応するアプリケーションユニットのユーザ関数群127を呼び出して逐次実行する(ステップS108)。そして、すべての内部イベントに対応するアプリケーションユニットのユーザ関数群127の実行が完了すると、内部イベントハンドラ126は、処理を終了して、簡易OS121に制御を戻す。
The
簡易OS121は、内部イベントハンドラ126から制御が戻ると、逐次処理があるかどうかをチェックし(ステップS109)、逐次処理がなければ(ステップS109でノー)、逐次処理ハンドラ128を起動することなく、処理を終了する。逐次処理があれば(ステップS109でイエス)、簡易OS121は、逐次処理ハンドラ129を起動する。
When the control returns from the
逐次処理ハンドラ128は、逐次処理に対応するアプリケーションユニットのユーザ関数群129を呼び出して逐次実行する(ステップS110)。そして、すべての逐次処理に対応するアプリケーションユニットのユーザ関数群129の実行が完了すると、逐次処理ハンドラ128は、処理を終了して、簡易OS121に制御を戻す。
The
なお、従来からの逐次処理に対応するアプリケーションユニットのユーザ関数群129と、イベントドリブン型の外部イベントに対応するアプリケーションユニットのユーザ関数群123および内部イベントに対応するアプリケーションユニットのユーザ関数群127との間では、状態の不整合なく共存が可能である。たとえば、ドアが開いている時にボタン操作があったならば出力装置40に警報を出す(ブザー40cを鳴らす,ランプ40dを点滅する等)というような従来からの逐次処理に対応するアプリケーションユニットのユーザ関数群129が共存している場合、外部イベントをイベントキューIQにキューイングしないで処理してしまうと、ドアがロックされてしまう。一方、従来からの逐次処理に対応するアプリケーションユニットのユーザ関数群129は、イベントで動作しないので、定期処理の時点では、ドア開時のボタン操作としてブザー40cを鳴らしてしまう。この場合、これら2つの制御は矛盾した動作(ロックを出力しているのにブザー40cを鳴らす)になってしまう。したがって、外部イベントの処理は、全ての入力データが確定した後に実行しなければならない。
It should be noted that the
簡易OS121は、逐次処理ハンドラ128から制御が戻ると、アプリケーションフェーズを終了して、出力フェーズの出力調停マネージャ131に制御を渡す。
When the control returns from the
出力調停マネージャ131は、簡易OS121から制御を渡されると、アプリケーションフェーズにおいて処理結果格納領域に記憶された処理結果に基づき出力処理ルーチン134によって出力を行うか否かを調停する。例えば、複数のユーザ関数が同一の出力対象に対する異なる出力指示を処理結果格納領域に格納していた場合、いずれの処理結果を反映させて出力するかを調停する。この際、出力調停の結果として新たな外部イベントが発生する場合には、出力調停マネージャ131は、この外部イベントを簡易OS121のイベントキューIQにキューイングする(図1中の破線矢印を参照)。ただし、この外部イベントの実行が次の周回のアプリケーションフェーズになることはいうまでもない。このような出力調停により、アプリケーションフェーズの各アプリケーションユニットのユーザ関数群では、I/Oポート14の詳細な構成を意識することなく、処理結果を処理結果格納領域に出力するだけでよくなる。また、各アプリケーションユニットのユーザ関数群同士が処理結果の内容に矛盾がないかを判定する必要がなくなり、制御プログラムの作成が容易になり、モジュール性も高くなって信頼性も向上する。すべての出力調停ルーチン132の実行を完了すると、出力調停マネージャ131は、出力処理マネージャ133に制御を渡す。
When the control is passed from the
出力処理マネージャ133は、出力調停マネージャ131から制御を渡されると、出力調停ルーチン132による調停結果に基づいて処理結果格納領域の処理結果をI/Oポート14への出力する出力処理ルーチン134を順次実行する。すべての出力処理ルーチン134の実行が終了すると、出力処理マネージャ133は、システムフェーズのスリープマネージャ101へ制御を移行する。
When the
これにより、スリープマネージャ106を通じてタイマ割込みタスクから復帰し、システムフェーズのアイドルタスクマネージャ102,ユーザ定義103,およびCPU監視マネージャ104からなるアイドルループに制御が戻る。
Thus, the timer interrupt task is returned through the
このように、タイマ割込みタスクを、入力フェーズ,アプリケーションフェーズおよび出力フェーズに分け、アプリケーションユニットのユーザ関数群間でデータの受け渡しを直接的に行わないようにすることで、各アプリケーションユニットの独立性が高まり、機能単位であるユーザ関数の追加および削除が容易にできるようになる。なお、このタイマ割込みタスクによる入力フェーズ,アプリケーションフェーズおよび出力フェーズの処理は、タイマ割込みの間隔である5msよりも短時間で処理が終了するように構成されている。 In this way, the timer interrupt task is divided into an input phase, an application phase, and an output phase, and data is not directly exchanged between user function groups of the application unit. As a result, user functions that are functional units can be easily added and deleted. Note that the processing of the input phase, application phase, and output phase by the timer interrupt task is configured to be completed in a shorter time than the timer interrupt interval of 5 ms.
本実施例1に係る電子制御装置では、タイマ割込みタスクを、入力処理マネージャ111,入力調停マネージャ113,簡易OS121,出力調停マネージャ131,および出力処理マネージャ133の各処理に分割し、各処理において、データの同期をとる。すなわち、ある時間で確定したデータを次の処理へ受け渡し、それ以後は変化させない。例えば、入力処理マネージャ111でスイッチの状態がONと確定した後は、次の周回の入力フェーズを実行するまでは、たとえ同スイッチの入力の状態がOFFになっていたとしてもスイッチの状態はONとして処理を行う。同様に、入力調停マネージャ113で入力調停したイベントは、次の周回の入力調停マネージャ113の処理まで変化させない。また、アプリケーションフェーズで確定した処理結果は、次の周回のアプリケーションフェーズまで変化させない。そして、出力調停マネージャ131によって出力調停した処理結果は、次の周回の出力調停マネージャ131の処理まで変化させない。したがって、各処理の終了時点でデータが確定(同期)する。そして、各処理中に前段の処理で生成したデータは変化しないので、例えば変化前のデータに基づく処理と変化後のデータに基づいて処理とを行ってしまうような処理矛盾を避けることができ、安全設計も容易にできる。また、人の操作する装置系に対する制御を行う場合には、人と制御対象(機械)との処理時間(認識時間)の差を上述した調停や同期によって、調整することができる。また、車内LAN50を媒介とする遅延等によるデータの到着のずれ等の影響もこれらの機構により抑えることができる。
In the electronic control apparatus according to the first embodiment, the timer interrupt task is divided into processes of the
例えば、D席ドアコントロールスイッチ30aと入力装置30としての図示しないスマートキー(電波等を使用し、ドアを施錠・解錠するシステム)との双方から異なる指示がほぼ同時に連続して入力された場合、D席ドアコントロールスイッチ30aの状態に基づきD席ドアECU20aが全席ドア施錠の指示を出す一方、スマートキーが全席ドア解錠の指示を車内LAN50を介してボデーECU10に出力したとき、ボデーECU10は、入力処理ルーチン112によってI/Oポート14からこれらの外部イベントを取り込む。そして、入力調停ルーチン114によって、いずれか1つの外部イベントを優先して実行するように入力調停する。例えば、D席ドアコントロールスイッチ30aからの外部イベントを優先するように入力調停する。そして、全席ドア施錠の指示が入力された旨の外部イベントをイベントキューIQにキューイングし、アプリケーションフェーズの簡易OS121へ制御を移行する。よって、アプリケーションフェーズにおいて、この外部イベントに対応するアプリケーションユニットのユーザ関数群123に実行が移される。例えば、ユーザ関数U1の処理によって、全席ドア施錠の指示が処理結果格納領域に書き込まれる。一方、このとき、他の入力装置30からの外部イベントによって、例えばユーザ関数U2が実行され、その処理結果としてD席ドア解錠の指示が処理結果格納領域に書き込まれていたとする。この場合、出力調停マネージャ13による出力調停ルーチン132の実行によって出力調停を行い、全席ドア施錠の処理結果の出力を優先して、出力処理マネージャ133に制御を渡す。出力処理マネージャ133は、出力処理ルーチン134を実行することによって、出力装置40の接続された各ドアECUに対してドア施錠の指示を出力する。こうして、極めて短い時間にドアが解錠→施錠または施錠→解錠することを防止することができる。すなわち、複数の矛盾する入力データや処理結果を調停することができ、安全で信頼性の高い制御を実現することができる。
For example, when different instructions are input from both the D seat
ところで、本実施例1では、入力フェーズでは入力処理ルーチン112および入力調停ルーチン114をシンプルスケジューリング方式で逐次実行し、出力フェーズでは出力調停ルーチン132および出力処理ルーチン134をシンプルスケジューリング方式で逐次実行する。一方、アプリケーションフェーズでは、どのアプリケーションユニットが実行されるかは、外部イベントおよび内部イベントの有無を判断して決定する。
By the way, in the first embodiment, the
このような構成とすることで、発生しない外部イベントに対応するアプリケーションユニットのユーザ関数群123は、外部イベントが発生しない間は実行されないことになる。同様に、発生しない内部イベントに対応するアプリケーションユニットのユーザ関数群127は、内部イベントが発生しない間は実行されないことになる。したがって、実行されないアプリケーションユニットのユーザ関数群用の処理結果格納領域は、その間更新されない。このため、外部のノイズ等によって処理結果格納領域の処理結果(データ)が書き換えられた場合(いわゆるRAM化け)には、出力調停ルーチン132および出力処理ルーチン134によって誤った出力がなされてしまう場合がある。このような状況は、処理結果格納領域が長時間更新されなければされないほど発生する可能性が高くなる。特に、制御の誤りによって人に対して悪影響を与える可能性のある車両等のシステムを制御する場合には、このようなことが起こらないように、RAM13の値を所定時間毎に更新することが望ましい。
With such a configuration, the
そこで、アプリケーションフェーズにおいて、一定時間以上起動されていない外部イベントに対応するアプリケーションユニットのユーザ関数群123および内部イベントに対応するアプリケーションユニットのユーザ関数群127を順次起動して、各アプリケーションユニットのユーザ関数群用の処理結果格納領域を更新する。この一定時間は、タイマ割込み間隔(所定時間)よりも長い間隔で、かつ処理結果格納領域の処理結果(データ)が外部ノイズ等によって変化してしまってもシステムの制御に支障をきたさない時間とする。すなわち、ボデー系システム100(図2参照)においては、RAM化けによって、例えば図示しないパワーウィンドウの閉制御のように、本来閉じてはいけない状態で閉じる指示が出力される状況が想定される。このような異常な制御が続く時間が50ms程度であれば人に対して悪影響を及ぼさない。したがって、例えば40msの間、起動されていない外部イベントに対応するアプリケーションユニットのユーザ関数群123および内部イベントに対応するアプリケーションユニットのユーザ関数群127から順次実行するようにする。例えば、ユーザ関数U2,ユーザ関数U3およびユーザ関数U4が、40msの間実行されていなければ、ユーザ関数U2を実行し、ユーザ関数U3を実行し、ユーザ関数U4を実行する。そして、外部イベントに対応するアプリケーションユニットのユーザ関数群123および内部イベントに対応するアプリケーションユニットのユーザ関数群127を実行する前述の処理を行う。このような構成を採ることで、RAM化けが起きても、信頼性や安全性を確保することができる。
Therefore, in the application phase, the
ところで、上記実施例1では、電子制御装置として主としてボデーECU10を例にとって説明したが、照合ECU,エンジンECU等のその他の電子制御装置の場合も本発明が同様に適用できることはいうまでもない。
In the first embodiment, the
以上、本発明の実施例を説明したが、これはあくまでも例示にすぎず、本発明はこれに限定されるものではなく、特許請求の範囲の趣旨を逸脱しない限りにおいて、当業者の知識に基づく種々の変更が可能である。 As mentioned above, although the Example of this invention was described, this is only an illustration, this invention is not limited to this, Based on the knowledge of those skilled in the art, unless it deviates from the meaning of a claim Various changes are possible.
10 ボデーECU
11 CPU
12 ROM
13 RAM
14 I/Oポート
15 タイマ
20 通信対象ECU
20a D席ドアECU
20b P席ドアECU
20c インパネECU
30 入力装置
30a D席ドアコントロールスイッチ
30b P席ドアコントロールスイッチ
40 出力装置
40a D席ドアロックモータ
40b P席ドアロックモータ
40c ブザー
40d ランプ
50 車内LAN
100 ボデー系システム
101 システム初期化ルーチン
102 アイドルタスクマネージャ
103 ユーザ定義
104 CPU監視マネージャ
105 システムマネージャ
106 スリープマネージャ
111 入力処理マネージャ
112 入力処理ルーチン
113 入力調停マネージャ
114 入力調停ルーチン
121 簡易OS
122 外部イベントハンドラ
123 外部イベントに対応するアプリケーションユニットのユーザ関数群
124 タイマ処理ハンドラ
125 タイマ処理に対応するアプリケーションユニットのユーザ関数群
126 内部イベントハンドラ
127 内部イベントに対応するアプリケーションユニットのユーザ関数群
128 逐次処理ハンドラ
129 逐次処理に対応するアプリケーションユニットのユーザ関数
131 出力調停マネージャ
132 出力調停ルーチン
133 出力処理マネージャ
134 出力処理ルーチン
IQ イベントキュー
T0〜Tn イベントテーブル
10 Body ECU
11 CPU
12 ROM
13 RAM
14 I / O ports
15
20a D seat door ECU
20b P seat door ECU
20c Instrument panel ECU
30
100
122
Claims (10)
入力フェーズで入力装置からのイベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャ手段と、
アプリケーションフェーズで前記イベントキューにキューイングされたイベントをデキューして該イベントに対応するアプリケーションユニットのユーザ関数群を実行するイベントハンドラ手段と
を有することを特徴とする電子制御装置。 An input phase for inputting an event from the input device, an application phase for executing a user function group of an application unit corresponding to the event, and an output phase for controlling output to the output device based on a processing result of the user function group An electronic control device that repeatedly performs control processing consisting of:
An input processing manager means for queuing an event from the input device in the input phase to an event queue by an input processing routine;
An electronic control device comprising: event handler means for dequeuing an event queued in the event queue in an application phase and executing a user function group of an application unit corresponding to the event.
入力フェーズで入力装置からの外部イベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャ手段と、
入力フェーズで前記入力処理ルーチンによって入力された外部イベントを入力調停ルーチンにより入力調停する入力調停マネージャ手段と、
アプリケーションフェーズで前記イベントキューにキューイングされた外部イベントをデキューして該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する外部イベントハンドラ手段と、
アプリケーションフェーズでタイマ処理に対応するアプリケーションユニットのユーザ関数群を実行するタイマ処理ハンドラ手段と、
アプリケーションフェーズで前記タイマ処理に対応するアプリケーションユニットのユーザ関数群の実行により前記イベントキューにキューイングされた内部イベントをデキューして該内部イベントに対応するアプリケーションユニットのユーザ関数群を実行する内部イベントハンドラ手段と、
アプリケーションフェーズで逐次処理に対応するアプリケーションユニットのユーザ関数群を逐次実行する逐次処理ハンドラ手段と、
出力フェーズで前記ユーザ関数群の処理結果の出力装置への出力を出力調停ルーチンにより調停する出力調停マネージャ手段と、
出力フェーズで前記出力調停ルーチンによる出力調停結果に基づいて出力処理ルーチンにより出力装置への出力を行う出力処理マネージャ手段と
を有することを特徴とする電子制御装置。 An input phase for inputting an external event from the input device, an application phase for executing a user function group of an application unit corresponding to the external event, and an output for controlling output to the output device based on a processing result of the user function group An electronic control device that repeatedly performs control processing consisting of phases,
An input processing manager means for queuing an external event from an input device in an input phase to an event queue by an input processing routine;
Input arbitration manager means for performing input arbitration by an input arbitration routine for an external event input by the input processing routine in an input phase;
An external event handler means for dequeuing an external event queued in the event queue in an application phase and executing a user function group of an application unit corresponding to the external event;
Timer processing handler means for executing a user function group of an application unit corresponding to timer processing in the application phase;
An internal event handler that dequeues an internal event queued in the event queue by execution of a user function group of the application unit corresponding to the timer processing in an application phase and executes the user function group of the application unit corresponding to the internal event Means,
Sequential processing handler means for sequentially executing user functions of application units corresponding to sequential processing in the application phase;
Output arbitration manager means for arbitrating the output to the output device of the processing result of the user function group in an output phase by an output arbitration routine;
An electronic control device comprising: an output processing manager means for performing output to an output device by an output processing routine based on an output arbitration result by the output arbitration routine in an output phase.
イベントに対応するイベントテーブルへのポインタを先入れ先出し方式で蓄積するイベントキューと、
イベントを検出したときに該イベントに対応するイベントテーブルへのポインタを前記イベントキューにキューイングする入力処理手段と、
前記イベントキューからイベントに対応するイベントテーブルへのポインタをデキューし、該ポインタが指すイベントテーブルを参照して該イベントに対応するアプリケーションユニットのユーザ関数群を呼び出すイベントハンドラ手段と
を有することを特徴とする電子制御装置。 An event table that stores the address of the user function group of the application unit corresponding to the event for each event,
An event queue that stores pointers to the event table corresponding to the events in a first-in first-out manner,
Input processing means for queuing a pointer to the event table corresponding to the event when the event is detected;
And event handler means for dequeuing a pointer from the event queue to an event table corresponding to the event and calling a user function group of the application unit corresponding to the event with reference to the event table pointed to by the pointer Electronic control device.
イベントに対応するイベントテーブルへのポインタを先入れ先出し方式で蓄積するイベントキューと、
入力装置からの外部イベントを入力処理ルーチンにより前記イベントキューにキューイングする入力処理マネージャ手段と、
前記入力処理ルーチンによって入力された外部イベントを入力調停ルーチンにより入力調停する入力調停マネージャ手段と、
前記イベントキューにキューイングされた外部イベントをデキューして該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する外部イベントハンドラ手段と、
タイマ処理に対応するアプリケーションユニットのユーザ関数群を実行するタイマ処理ハンドラ手段と、
前記タイマ処理に対応するアプリケーションユニットのユーザ関数群の実行によりイベントキューにキューイングされた内部イベントをデキューして該内部イベントに対応するアプリケーションユニットのユーザ関数群を実行する内部イベントハンドラ手段と、
逐次処理に対応するアプリケーションユニットのユーザ関数群を実行する逐次処理ハンドラ手段と、
前記ユーザ関数群の処理結果の出力装置への出力を出力調停ルーチンにより調停する出力調停マネージャ手段と、
前記出力調停ルーチンによる出力調停結果に基づいて出力処理ルーチンにより出力装置への出力を行う出力処理マネージャ手段と
を有することを特徴とする電子制御装置。 An event table that stores the address of the user function group of the application unit corresponding to the event for each event,
An event queue that stores pointers to the event table corresponding to the events in a first-in first-out manner,
Input processing manager means for queuing an external event from the input device to the event queue by an input processing routine;
Input mediation manager means for mediating an external event input by the input processing routine by an input mediation routine;
External event handler means for dequeuing an external event queued in the event queue and executing a user function group of an application unit corresponding to the external event;
Timer processing handler means for executing a user function group of an application unit corresponding to timer processing;
An internal event handler means for dequeuing an internal event queued in an event queue by execution of a user function group of the application unit corresponding to the timer processing and executing a user function group of the application unit corresponding to the internal event;
Sequential processing handler means for executing a user function group of an application unit corresponding to sequential processing;
Output arbitration manager means for arbitrating the output to the output device of the processing result of the user function group by an output arbitration routine;
An electronic control device comprising: output processing manager means for performing output to an output device by an output processing routine based on an output arbitration result by the output arbitration routine.
入力装置からのイベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャを実行する工程と、
前記イベントキューからイベントをデキューしてイベントハンドラにより該イベントに対応するアプリケーションユニットのユーザ関数群を実行する工程と
を含むことを特徴とする電子制御装置の制御方法。 An input phase for inputting an event from the input device, an application phase for executing a user function group of an application unit corresponding to the event, and an output phase for controlling output to the output device based on a processing result of the user function group A control method for an electronic control device that repeatedly performs control processing consisting of:
Executing an input processing manager that queues events from the input device to an event queue by an input processing routine;
And a step of dequeuing the event from the event queue and executing a user function group of the application unit corresponding to the event by an event handler.
入力装置からの外部イベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャを実行する工程と、
前記入力処理ルーチンによって入力された外部イベントを入力調停ルーチンにより入力調停する入力調停マネージャを実行する工程と、
前記イベントキューから外部イベントをデキューして外部イベントハンドラにより該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する工程と、
タイマ処理ハンドラにより起動時刻を経過したタイマ処理に対応するアプリケーションユニットのユーザ関数群を実行する工程と、
前記タイマ処理に対応するアプリケーションユニットのユーザ関数群の実行によって前記イベントキューにキューイングされている内部イベントをデキューして内部イベントハンドラにより該内部イベントに対応するアプリケーションユニットのユーザ関数群を実行する工程と、
逐次処理ハンドラにより逐次処理に対応するアプリケーションユニットのユーザ関数群を実行する工程と、
前記ユーザ関数群の処理結果の出力装置への出力を出力調停ルーチンにより調停する出力調停マネージャを実行する工程と、
前記出力調停ルーチンの出力調停結果に基づいて出力処理ルーチンにより出力装置への出力を行う出力処理マネージャを実行する工程と
を含むことを特徴とする電子制御装置の制御方法。 An input phase for inputting an external event from the input device, an application phase for executing a user function group of an application unit corresponding to the external event, and an output for controlling output to the output device based on a processing result of the user function group A control method for an electronic control device that repeatedly performs control processing consisting of phases,
Executing an input processing manager for queuing an external event from an input device to an event queue by an input processing routine;
Executing an input arbitration manager that arbitrates an external event input by the input processing routine by an input arbitration routine; and
Dequeuing an external event from the event queue and executing a user function group of an application unit corresponding to the external event by an external event handler;
Executing a user function group of an application unit corresponding to a timer process whose start time has elapsed by a timer process handler;
A step of dequeuing an internal event queued in the event queue by execution of a user function group of the application unit corresponding to the timer process, and executing a user function group of the application unit corresponding to the internal event by an internal event handler When,
Executing a user function group of application units corresponding to sequential processing by a sequential processing handler;
Executing an output arbitration manager that arbitrates the output to the output device of the processing result of the user function group by an output arbitration routine;
And a step of executing an output processing manager for performing output to the output device by the output processing routine based on the output arbitration result of the output arbitration routine.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004339109A JP2006146789A (en) | 2004-11-24 | 2004-11-24 | Electronic controller, its control method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004339109A JP2006146789A (en) | 2004-11-24 | 2004-11-24 | Electronic controller, its control method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006146789A true JP2006146789A (en) | 2006-06-08 |
Family
ID=36626370
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004339109A Pending JP2006146789A (en) | 2004-11-24 | 2004-11-24 | Electronic controller, its control method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006146789A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008146480A (en) * | 2006-12-12 | 2008-06-26 | Denso Corp | Object oriented vehicle control system and program loading support system |
JP2011203948A (en) * | 2010-03-25 | 2011-10-13 | Toshiba Corp | Plant monitoring control system and plant monitoring control method |
JP2014526750A (en) * | 2011-09-15 | 2014-10-06 | オラクル・インターナショナル・コーポレイション | System and method for supporting a server-side event model in a distributed data grid |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05127925A (en) * | 1991-11-05 | 1993-05-25 | Fujitsu Ltd | Event management processor |
JPH0660038A (en) * | 1992-08-11 | 1994-03-04 | Fuji Xerox Co Ltd | Event control method |
JPH06149599A (en) * | 1992-11-12 | 1994-05-27 | Mitsubishi Electric Corp | Computer system |
JPH11296384A (en) * | 1998-04-07 | 1999-10-29 | Hitachi Ltd | Event processing translation system and its device in event driven os |
JP2002202891A (en) * | 2000-12-28 | 2002-07-19 | Denso Corp | Electronic controller and recording medium |
-
2004
- 2004-11-24 JP JP2004339109A patent/JP2006146789A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05127925A (en) * | 1991-11-05 | 1993-05-25 | Fujitsu Ltd | Event management processor |
JPH0660038A (en) * | 1992-08-11 | 1994-03-04 | Fuji Xerox Co Ltd | Event control method |
JPH06149599A (en) * | 1992-11-12 | 1994-05-27 | Mitsubishi Electric Corp | Computer system |
JPH11296384A (en) * | 1998-04-07 | 1999-10-29 | Hitachi Ltd | Event processing translation system and its device in event driven os |
JP2002202891A (en) * | 2000-12-28 | 2002-07-19 | Denso Corp | Electronic controller and recording medium |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008146480A (en) * | 2006-12-12 | 2008-06-26 | Denso Corp | Object oriented vehicle control system and program loading support system |
JP4618240B2 (en) * | 2006-12-12 | 2011-01-26 | 株式会社デンソー | Object-oriented vehicle control system and program loading support system |
JP2011203948A (en) * | 2010-03-25 | 2011-10-13 | Toshiba Corp | Plant monitoring control system and plant monitoring control method |
JP2014526750A (en) * | 2011-09-15 | 2014-10-06 | オラクル・インターナショナル・コーポレイション | System and method for supporting a server-side event model in a distributed data grid |
US9602339B2 (en) | 2011-09-15 | 2017-03-21 | Oracle International Corporation | System and method for supporting a server-side event model in a distributed data grid |
US9621409B2 (en) | 2011-09-15 | 2017-04-11 | Oracle International Corporation | System and method for handling storage events in a distributed data grid |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Potop-Butucaru et al. | Concurrency in synchronous systems | |
KR970016979A (en) | Queuing system and method of tasks in a multiprocessing system | |
US9785587B2 (en) | Method for executing, within a multitasking onboard system, an application timed according to a plurality of different time domains including interruption management | |
CN108700633A (en) | For safety and the ultrafast master clock observation circuit of secure automobile application | |
Teper et al. | End-to-end timing analysis in ROS2 | |
Gerber et al. | CCSR: A calculus for communicating shared resources | |
JP2006146789A (en) | Electronic controller, its control method, and program | |
JP4427899B2 (en) | Electronic control device and recording medium | |
Holmes et al. | Aspects of synchronisation | |
Cadoret et al. | Deterministic implementation of periodic-delayed communications and experimentation in aadl | |
Fischmeister et al. | A verifiable language for programming real-time communication schedules | |
Beyer et al. | Towards the formal verification of lower system layers in automotive systems | |
US5774738A (en) | State machines | |
Miśkowicz | Latency characteristics of event-driven task scheduler embedded in Neuron Chip | |
Philipps et al. | Formal verification of statecharts with instantaneous chain reactions | |
Garrido et al. | Arinc-653 inter-partition communications and the ravenscar profile | |
Eloranta et al. | A pattern language for distributed machine control systems | |
Georgiev et al. | Some Analysis of the Timing Parameters in Real-time Embedded Systems | |
EP3968572A1 (en) | A method for providing log entries | |
Pinisetty et al. | Compositional runtime enforcement revisited | |
Sierszecki et al. | A run-time environment supporting real-time execution of embedded control applications | |
Kurshan et al. | Modelling asynchrony with a synchronous model | |
Chatain et al. | Natural specifications yield decidability for distributed synthesis of asynchronous systems | |
Chen et al. | Research on client/server communication mechanism in autosar system | |
Martin | Software architectures for OSEK/VDX applications using MATRIX/sub X//sup TM/and AutoCode/sup TM |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20070213 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20081219 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090109 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090309 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20100402 |