JP2006146789A - Electronic controller, its control method, and program - Google Patents

Electronic controller, its control method, and program Download PDF

Info

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
Application number
JP2004339109A
Other languages
Japanese (ja)
Inventor
Shigeo Kato
滋郎 加藤
Yoichi Fukatsu
洋一 深津
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2004339109A priority Critical patent/JP2006146789A/en
Publication of JP2006146789A publication Critical patent/JP2006146789A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To keep a processing sequence of events for improving a maintenance property when the type/number of events is changed. <P>SOLUTION: An input processing routine 112 checks whether a corresponding event is inputted or not (Figure (a)), and queues the event in an event queue IQ of a simplified OS 121 when the event is inputted (Figure (a)-2). The simplified OS 121 checks the event queue IQ, and when the event is queued, refers to an event table matching the event to call a group of user functions in an application unit corresponding to the event for sequentially performing them (Figure (b)-1). <P>COPYRIGHT: (C)2006,JPO&NCIPI

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にアドレスが登録されているアプリケーションユニットのユーザ関数群を呼び出して逐次実行する。
特開2002−202891
Here, the event flag method employed in the conventional electronic control apparatus will be briefly described with reference to FIG. Now, it is assumed that the input processing routine A has cleared the corresponding event flags in the event flag strings E0 to En because no event is detected. On the other hand, since the input processing routine B has detected an event, it is assumed that a corresponding event flag in the event flag sequence E0 to En is set. For example, when the ignition switch is switched from OFF to ON, the event flag E5 has a value “0” for the ignition switch OFF event.
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.
JP 2002-202891 A

このようなイベントフラグ方式を採用している従来の電子制御装置では、イベントフラグと、それに対応するイベントテーブルとの関連をアプリケーションフェーズの簡易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.

課題を解決するための手段および発明の効果Means for Solving the Problems and Effects of the Invention

請求項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 claim 10 is based on an input processing manager for checking an external event from an input device, an input processing routine for queuing the external event in an event queue, and an event input by the input processing routine. An input arbitration manager that determines whether or not input arbitration of an external event queued in the event queue is necessary, and an input arbitration routine that executes input arbitration when the input arbitration manager determines that input arbitration is necessary An external event handler that dequeues an external event queued in the event queue and executes a user function group of the application unit corresponding to the external event, and a user function group of the application unit corresponding to the timer process Timer processing An internal event handler that dequeues an internal event queued in the event queue by execution of the user function group of the application unit corresponding to the timer process and executes the user function group of the application unit corresponding to the internal event A sequential processing handler that sequentially executes a user function group of an application unit corresponding to the sequential processing, and an output arbitration manager that determines whether it is necessary to arbitrate the output of the processing result of the user function group to an output device; An output arbitration routine for arbitrating an output determined to require output arbitration by the output arbitration manager, and an output for executing output to an output device by an output processing routine based on an output arbitration result by the output arbitration manager Including a processing manager And butterflies. According to the program of claim 10, the order relationship between the event generation order and the event processing order is maintained by the first-out first-out method, and the subsequent event is executed before the previous event to obtain the processing result. Inconsistency is prevented in advance, and external event input arbitration and processing result output arbitration are performed, thereby reversing the processing order between external events and the output order of processing results. Can be prevented. 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. It is possible to easily realize the electronic control device.

入力フェーズで入力装置からのイベントをイベントキューにキューイングし、アプリケーションフェーズでイベントキューにキューイングされたイベントをデキューして該イベントに対応するアプリケーションユニットのユーザ関数群を実行することにより、イベントの発生順序とイベントの処理順序との間の順序関係を保つ。 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 body system 100 including a body ECU 10 that is an electronic control apparatus according to the first embodiment of the present invention. The body system 100 includes a body ECU 10 connected to an in-vehicle LAN (Local Area Network) 50 corresponding to a network, and a communication target ECU 20 that can communicate with the body ECU 10 via the in-vehicle LAN 50.

ボデー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 body ECU 10 and the communication target ECU 20 are a computer system including a CPU (Central Processing Unit) 11, a ROM 12, a RAM (Random Access Memory) 13, an I / O (Input / Output) port 14, a timer 15, and the like. An input device 30, an output device 40, and an in-vehicle LAN 50 are connected to the O port 14.

通信対象ECU20は、入力装置30の状態を読み取ってパケットを生成し、車内LAN50を介してボデーECU10へ送信する。また、通信対象ECU20は、車内LAN50を介して入力されるボデーECU10からのパケットの制御情報に基づいて出力装置40を制御する。通信対象ECU20は、例えば、ドライバ側のドア(D席ドア)に設置されたECUであるD席ドアECU20a,補助席側のドア(P席ドア)に設置されたECUであるP席ドアECU20b,インスツルメントパネル(インパネ)に設置されたECUであるインパネECU20c等である。 The communication target ECU 20 reads the state of the input device 30 to generate a packet, and transmits the packet to the body ECU 10 via the in-vehicle LAN 50. The communication target ECU 20 controls the output device 40 based on packet control information from the body ECU 10 input via the in-vehicle LAN 50. The communication target ECU 20 includes, for example, a D seat door ECU 20a that is an ECU installed on a driver side door (D seat door), a P seat door ECU 20b that is an ECU installed on an auxiliary seat side door (P seat door), An instrument panel ECU 20c, which is an ECU installed on the instrument panel (instrument panel).

D席ドアECU20aには、入力装置30としてD席ドアコントロールスイッチ30a等が接続されており、出力装置40としてD席ドアロックモータ40a,D席パワーウインドウモータ(図示せず)等が接続されている。 The D seat door ECU 20a is connected to a D seat door control switch 30a and the like as an input device 30, and is connected to a D seat door lock motor 40a and a D seat power window motor (not shown) as an output device 40. Yes.

P席ドアECU20bには、入力装置30としてP席ドアコントロールスイッチ30b等が接続され、出力装置40としてP席ドアロックモータ40b,P席パワーウインドウモータ(図示せず)等が接続されている。 The P seat door ECU 20b is connected with a P seat door control switch 30b and the like as the input device 30, and is connected with a P seat door lock motor 40b and a P seat power window motor (not shown) as the output device 40.

インパネECU20cには、出力装置40としてブザー40c,ランプ40d等が接続されている。 A buzzer 40c, a lamp 40d and the like are connected to the instrument panel ECU 20c as the output device 40.

ボデーECU10は、通信対象ECU20から車内LAN50に送信されるパケットを所定時間毎に受信して、I/Oポート14を介して取り込み、取り込んだパケットの内容に応じたアプリケーションユニットを起動して、出力装置40の制御が必要な場合には、制御対象の通信対象ECU20への制御指示を含むパケットを生成して送信する制御処理を行う。 The body ECU 10 receives packets transmitted from the communication target ECU 20 to the in-vehicle LAN 50 at predetermined time intervals, captures them via the I / O port 14, activates an application unit corresponding to the contents of the captured packets, and outputs them. When control of the device 40 is necessary, a control process for generating and transmitting a packet including a control instruction to the communication target ECU 20 to be controlled is performed.

図1は、本発明の実施例1に係る電子制御装置であるボデーECU10の制御プログラムの構成を示すブロック図である。この制御プログラムは、システムフェーズの処理プログラム群と、入力フェーズの処理プログラム群と、アプリケーションフェーズの処理プログラム群と、出力フェーズの処理プログラム群とから、その主要部が構成されている。 FIG. 1 is a block diagram showing a configuration of a control program of a body ECU 10 that is an electronic control apparatus according to Embodiment 1 of the present invention. This control program is composed of a system phase processing program group, an input phase processing program group, an application phase processing program group, and an output phase processing program group.

システムフェーズの処理プログラム群は、ボデーECU10のシステムを初期化するシステム初期化ルーチン101と、アイドルタスクを管理するアイドルタスクマネージャ102と、アイドルタスク用のユーザ定義103と、CPU11を監視するCPU監視マネージャ104と、タイマ割込みを受け付けるシステムマネージャ105と、タイマ割込みから抜けるスリープマネージャ106とから構成されている。 The system phase processing program group includes a system initialization routine 101 that initializes the system of the body ECU 10, an idle task manager 102 that manages idle tasks, a user definition 103 for idle tasks, and a CPU monitoring manager that monitors the CPU 11. 104, a system manager 105 that accepts a timer interrupt, and a sleep manager 106 that exits from the timer interrupt.

入力フェーズの処理プログラム群は、入力装置30からの外部イベントを入力処理ルーチン112によりイベントキューIQにキューイングする入力処理マネージャ111と、外部イベント対応に設けられた複数(図示は1つ)の入力処理ルーチン112と、入力処理ルーチン112によって入力された外部イベントを入力調停ルーチン114により入力調停する入力調停マネージャ113と、外部イベント対応に設けられた複数(図示は1つ)の入力調停ルーチン114とから構成されている。 The input phase processing program group includes an input processing manager 111 that queues an external event from the input device 30 to the event queue IQ by the input processing routine 112, and a plurality of (one in the figure) inputs provided for the external event. A processing routine 112; an input arbitration manager 113 that arbitrates an external event input by the input processing routine 112 by an input arbitration routine 114; and a plurality (one in the figure) of input arbitration routines 114 provided for external events; It is composed of

アプリケーションフェーズの処理プログラム群は、イベントキュー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 simple OS 121 having an event queue IQ (see FIG. 3), and a user function group 123 of an application unit corresponding to the external event by dequeuing an external event queued in the event queue IQ. An external event handler 122 to execute, a user function group 123 of an application unit corresponding to an external event, a timer processing handler 124 to execute a user function group 125 of an application unit corresponding to timer processing, and an application unit corresponding to timer processing The internal event queued in the event queue IQ by the execution of the user function group 125 and the user function group 125 of the application unit corresponding to the timer process is dequeued and the internal event The internal event handler 126 that executes the user function group 127 of the application unit corresponding to the above, the user function group 127 of the application unit corresponding to the internal event, and the user function group 129 of the application unit corresponding to the sequential processing are sequentially executed. The processing handler 128 includes a user function group 129 of an application unit corresponding to sequential processing.

外部イベントに対応するアプリケーションユニットのユーザ関数群123,タイマ処理に対応するアプリケーションユニットのユーザ関数群125,内部イベントに対応するアプリケーションユニットのユーザ関数群127,および逐次処理に対応するアプリケーションユニットのユーザ関数群129は、複数のユーザ関数で構成されており、各アプリケーションユニットのユーザ関数群はI/Oポート14への入出力処理を直接行わないように構成されている。すなわち、入力は、入力フェーズで入力処理ルーチン112および入力調停ルーチン114によってRAM13上の入力データ格納領域を媒介にして行い、出力は、出力フェーズで出力調停ルーチン132および出力処理ルーチン134によってRAM13上の処理結果格納領域を媒介にして行う。 User function group 123 of application units corresponding to external events, user function group 125 of application units corresponding to timer processing, user functions group 127 of application units corresponding to internal events, and user functions of application units corresponding to sequential processing The group 129 includes a plurality of user functions, and the user function group of each application unit is configured not to directly perform input / output processing to the I / O port 14. That is, the input is performed via the input data storage area on the RAM 13 by the input processing routine 112 and the input arbitration routine 114 in the input phase, and the output is performed on the RAM 13 by the output arbitration routine 132 and the output processing routine 134 in the output phase. This is done through the processing result storage area.

また、各アプリケーションユニットのユーザ関数群間のデータの受け渡しは、直接的には行わないように構成されている。すなわち、例えば、先に実行されるアプリケーションユニットのユーザ関数群と後に実行されるアプリケーションユニットのユーザ関数群とがある場合に、先に実行されるアプリケーションユニットのユーザ関数群を実行した結果のデータ(処理結果)は、後で実行されるアプリケーションユニットのユーザ関数群では使用しないように構成する。つまり、先に実行されるアプリケーションユニットのユーザ関数群は、処理結果を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 RAM 13, but the processing result is directly from the user function group of the application unit executed later. Is not referenced. When the user function group of the application unit to be executed later requires the processing result of the user function group of the application unit to be executed first, the processing result stored in the processing result storage area by the input arbitration routine 114 in advance Is copied to the input data storage area. Then, when the user function is activated according to the event extracted from the event queue IQ, the processing result is referred to from the input data storage area. Therefore, even when a user function group of an application unit to be executed later is executed immediately after a user function group of an application unit to be executed first, the user function group of the application unit executed later is a processing result. Since the input data storage area is referenced instead of the storage area and used for processing, it is not the processing result of the user function group of the application unit executed before the same cycle (immediately before), but the destination at the time of the timer interrupt of the previous cycle The processing is performed using the processing result of the user function group of the application unit to be executed.

また、いずれのアプリケーションユニットのユーザ関数群を実行するかは、外部イベントハンドラ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 external event handler 122, the timer processing handler 124, the internal event handler 126, and the sequential processing handler 128. This determination process is performed based on event tables T0 to Tn (see FIG. 3) that register in advance which event is executed when the user function group of each application unit is generated. In the event table T0 to Tn, the address of the user function group of the application unit corresponding to the event is registered (stored), and the event is queued in the event queue IQ by the input processing routine 112 (the event has occurred). In the case), the address of the user function group of the application unit corresponding to the event is called, and control is transferred to the user function group. When a plurality of user functions are associated with one event in the event tables T0 to Tn, the user functions of the application units corresponding to the event are sequentially executed. That is, when the user function group of the application unit corresponding to one event includes the user function U1, the user function U2, the user function U3,..., The user function Ux, if the user function U1 is terminated, the user function When the control is transferred to U2 and the user function U2 is completed, the user functions are sequentially executed so that the control is transferred to the user function U3.

出力フェーズの処理プログラム群は、各アプリケーションユニットのユーザ関数群の処理結果の出力装置40への出力を出力調停ルーチン132により調停する出力調停マネージャ131と、複数(図示は1つ)の出力調停ルーチン132と、出力調停ルーチン132による出力調停結果に基づいて出力処理ルーチン134により出力装置40への出力を行う出力処理マネージャ133と、複数(図示は1つ)の出力処理ルーチン134とから構成されている。 The output phase processing program group includes an output arbitration manager 131 that arbitrates the output of the processing result of the user function group of each application unit to the output device 40 by the output arbitration routine 132, and a plurality (one in the figure) of output arbitration routines. 132, an output processing manager 133 that outputs to the output device 40 by the output processing routine 134 based on the output arbitration result by the output arbitration routine 132, and a plurality (one in the figure) of output processing routines 134. Yes.

図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 simple OS 121 in the application phase in order to improve the disadvantage of the event flag method (see FIG. 5). The event types and event tables T0 to Tn are assigned to the input processing routines 112 in the input phase. In FIG. 3, the input processing routine A has a switch AON event table T0 and a switch AOFF event table T1, and the input processing routine B has a switch BON event table T2 and a switch BOFF event table T3. On the other hand, the simple OS 121 in the application phase includes an event queue IQ. When each input processing routine 112 detects an external event, it registers a pointer (address) to the event table T0 to Tn corresponding to the external event in the event queue IQ. The simple OS 121 checks the event queue IQ periodically (every lap), and if an event is queued in the event queue IQ, the event queue IQ moves to the event table T0 to Tn corresponding to the event in a first-in first-out manner. Is dequeued, and the user function group of the application unit corresponding to the event is called with reference to the event tables T0 to Tn pointed to by the pointer.

図4は、アプリケーションフェーズにおける処理を表すフローチャートである。 FIG. 4 is a flowchart showing processing in the application phase.

次に、このように構成された本実施例1に係る電子制御装置であるボデーECU10の動作について、図1ないし図4を参照しながら説明する。 Next, the operation of the body ECU 10 that is the electronic control apparatus according to the first embodiment configured as described above will be described with reference to FIGS. 1 to 4.

ボデーECU10では、電源が投入されると、図1に示すように、システムフェーズでシステム初期化ルーチン101が、I/Oポート14やRAM13等のシステム初期化処理を行う。次に、アイドルタスクマネージャ102が起動され、アイドルタスク用のユーザ定義103を実行する。続いて、CPU11の状態を監視するCPU監視マネージャ104が実行される。そして、アイドルタスクマネージャ102に制御が戻る。このようにアイドルタスクマネージャ102,ユーザ定義103,およびCPU監視マネージャ104がループして実行される。 In the body ECU 10, when the power is turned on, as shown in FIG. 1, the system initialization routine 101 performs system initialization processing such as the I / O port 14 and the RAM 13 in the system phase. Next, the idle task manager 102 is activated to execute the user definition 103 for the idle task. Subsequently, the CPU monitoring manager 104 that monitors the state of the CPU 11 is executed. Then, control returns to the idle task manager 102. In this way, the idle task manager 102, the user definition 103, and the CPU monitoring manager 104 are executed in a loop.

そして、タイマ15から所定時間、例えば5ms毎にCPU11にタイマ割込みがかかるので、このタイマ割込みによって、システムマネージャ105へ制御が移行される。 Since a timer interrupt is applied to the CPU 11 from the timer 15 every predetermined time, for example, every 5 ms, control is transferred to the system manager 105 by this timer interrupt.

システムマネージャ105は、割込みタスクを起動して、入力処理マネージャ111,入力調停マネージャ113,簡易OS121,出力調停マネージャ131,および出力処理マネージャ133をシンプルスケジュール方式で順次実行する。 The system manager 105 activates the interrupt task and sequentially executes the input processing manager 111, the input arbitration manager 113, the simple OS 121, the output arbitration manager 131, and the output processing manager 133 in a simple schedule system.

まず、入力処理マネージャ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 input processing manager 111 checks an external event input from the I / O port 14. Specifically, each input processing routine 112 is sequentially activated to check whether an external event corresponding to each input processing routine 112 is input (see FIG. 3A). If there is no external event, the input processing routine 112 does nothing (see FIG. 3A-1). For example, an external event input from the D seat door ECU 20a via the in-vehicle LAN 50 is detected. If there is an external event, the input processing routine 112 queues the external event in the event queue IQ of the simple OS 121 as shown by the broken line arrow in FIG. 1 (see FIG. 3A-2). When the processing is completed for all the input processing routines 112, the input processing manager 111 shifts the control to the input arbitration manager 113.

イベントキュー方式を採用することにより、外部イベントの種類や数が変わっても、アプリケーションフェーズでの処理に変更の影響が及ばない。また、ボデー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 body ECU 10 are determined by input, the provision of the event tables T0 to Tn in the input processing routine 112 coincides with the change unit, so that maintenance becomes easy. Here, for example, in the control for locking the door by the button operation when the door is closed, consider a case where a plurality of events, that is, button operation and door opening occur simultaneously. When the input processing manager 111 detects the button operation first and then detects the opening of the door, the input processing routine 112 notifies the external queue without queuing these external events to the event queue IQ. It locks (malfunction). On the other hand, when the button processing event is notified after the input processing routine 112 queues an external event to the event queue IQ and also detects a change in the door, the input processing routine 112 recognizes the button operation when the door is open and the door. Is not locked (normal operation).

入力調停マネージャ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 input processing manager 111, the input arbitration manager 113 performs input arbitration by comprehensively inputting external events input from the I / O port 14 by the input processing manager 111. Specifically, the input arbitration manager 113 activates the input arbitration routine 114 and performs input arbitration of the external event queued in the event queue IQ based on the input data of the external event input by the input processing manager 111. For example, when the input data of the external event A and the input data of the external event B are both “1”, the input arbitration manager 113 performs input arbitration such that the external event C is generated as an input arbitration result. When such input arbitration is performed, by queuing the external event C to the event queue IQ, the user function group 123 of the application unit corresponding to the external event to be executed when the external event C occurs in the application phase. Can be executed. By using such a mechanism, it is possible to execute the user function group 123 of the application unit corresponding to the external event according to the combination of the external events, and check whether there is a contradiction in the input data in the application unit, etc. There is no need to do this. Therefore, the creation of the control program is facilitated, the modularity is improved, and the reliability is improved. The input arbitration manager 113 sequentially executes each input arbitration routine 114, and when the execution of all the input arbitration routines 114 is completed, the control is transferred to the simple OS 121 in the application phase.

アプリケーションフェーズの簡易OS121は、入力調停マネージャ113から制御が移行されると、イベントキューIQに外部イベント(イベントテーブルT0〜Tnへのポインタ)がキューイングされているかどうかをチェックする(ステップS101)。イベントキューIQに外部イベントがキューイングされていなければ(ステップS101でノー)、簡易OS121は、外部イベントハンドラ122を起動することなく、ステップS104に制御を移す。イベントキューIQに外部イベントがキューイングされていれば(ステップS101でイエス)、簡易OS121は、外部イベントハンドラ122を起動する。 When the control is transferred from the input arbitration manager 113, the simple OS 121 in the application phase checks whether an external event (pointer to the event table T0 to Tn) is queued in the event queue IQ (step S101). If no external event is queued in the event queue IQ (NO in step S101), the simple OS 121 shifts control to step S104 without activating the external event handler 122. If an external event is queued in the event queue IQ (Yes in Step S101), the simple OS 121 activates the external event handler 122.

外部イベントハンドラ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 external event handler 122 dequeues the external event from the event queue IQ by a first-in first-out method (step S102), refers to the event table pointed to by the pointer to the event table, and refers to the user function group 123 of the application unit corresponding to the external event. Are sequentially executed (step S103). In the example of FIG. 3, the simple OS 121 checks the event queue IQ (see FIG. 3B), and if the pointer is queued in the event queue IQ, the external event handler 122 indicates the switch BON pointed to by the pointer. The user function group (B1, B2, B3) of the application unit corresponding to the external event is called with reference to the event table T2 and sequentially executed (see FIG. 3B-1). Steps S102 and S103 are repeated for all external events queued in the event queue IQ. If no external event is queued in the event queue IQ in step S101 (No in step S101), the external event handler 122 The process is terminated and control is returned to the simple OS 121.

簡易OS121は、外部イベントハンドラ122から制御が戻ると、起動時刻を経過したタイマ処理があるかどうかをチェックし(ステップS104)、起動時刻を経過したタイマ処理がなければ(ステップS104でノー)、タイマ処理ハンドラ124を起動することなく、ステップS106に制御を移す。タイマ処理があれば(ステップS104でイエス)、簡易OS121は、タイマ処理ハンドラ124を起動する。ここで、外部イベントとタイマ処理との処理順序を考えると、タイマ処理は純粋にソフトウェア内部の処理であるのに対し、外部イベントは電子制御装置の外で発生して観測可能であるので、外部イベントを先に処理する。外部イベントハンドラ122の処理完了後に、タイマ処理ハンドラ124を起動することにより、外部イベントとタイマ処理との処理順序の逆転を抑えることができる。例えば、前周回の出力イベントでキャンセルされるべきものが、タイマ処理によって動いてしまうことを抑えるために、外部イベントを先に処理する。 When the control returns from the external event handler 122, the simple OS 121 checks whether there is a timer process whose start time has passed (step S104), and if there is no timer process whose start time has passed (No in step S104), Control is transferred to step S106 without activating the timer processing handler 124. If timer processing is present (Yes in step S104), the simple OS 121 activates the timer processing handler 124. Here, considering the processing order of external events and timer processing, timer processing is purely software internal processing, whereas external events occur outside the electronic control unit and can be observed. Process the event first. By starting the timer processing handler 124 after the processing of the external event handler 122 is completed, it is possible to suppress reversal of the processing order between the external event and the timer processing. For example, the external event is processed first in order to prevent the event that should be canceled by the output event of the previous round from moving due to the timer process.

タイマ処理ハンドラ124は、起動時刻を経過したタイマ処理に対応するアプリケーションユニットのユーザ関数群125を呼び出して逐次実行する(ステップS105)。なお、タイマ処理に対応するアプリケーションユニットのユーザ関数群125の実行の過程で、新たなイベント(以下、内部イベントという)が発生すると、ユーザ関数群125は、内部イベントを簡易OS121のイベントキューIQにキューイングする(図1中の破線矢印を参照)。そして、すべての起動時刻を経過したタイマ処理に対応するアプリケーションユニットのユーザ関数群125の実行が完了すると、タイマ処理ハンドラ124は、処理を終了して、簡易OS121に制御を戻す。 The timer process handler 124 calls and sequentially executes the user function group 125 of the application unit corresponding to the timer process whose start time has elapsed (step S105). When a new event (hereinafter referred to as an internal event) occurs during the execution of the user function group 125 of the application unit corresponding to the timer process, the user function group 125 sends the internal event to the event queue IQ of the simple OS 121. Cueing (see dashed arrow in FIG. 1). When the execution of the user function group 125 of the application unit corresponding to the timer process for which all the activation times have elapsed is completed, the timer process handler 124 ends the process and returns control to the simple OS 121.

簡易OS121は、タイマ処理ハンドラ124から制御が戻ると、イベントキューIQに内部イベントがキューイングされているかどうかをチェックし(ステップS106)、内部イベントがキューイングされていなければ(ステップS106でノー)、内部イベントハンドラ126を起動することなく、ステップS109に制御を移す。イベントキューIQに内部イベントがキューイングされていれば(ステップS106でイエス)、簡易OS121は、内部イベントハンドラ126を起動する。 When the control returns from the timer processing handler 124, the simple OS 121 checks whether or not an internal event is queued in the event queue IQ (step S106), and if no internal event is queued (No in step S106). Then, control is transferred to step S109 without activating the internal event handler 126. If an internal event is queued in the event queue IQ (Yes in step S106), the simple OS 121 activates the internal event handler 126.

このように、タイマ処理に対応するアプリケーションユニットのユーザ関数群125を実行することによって発生する内部イベントがあるので、タイマ処理ハンドラ124によるタイマ処理に対応するアプリケーションユニットのユーザ関数群125の実行後に、内部イベントハンドラ126により内部イベントに対応するアプリケーションユニットのユーザ関数群127を実行する。このため、処理順序は、外部イベント→タイマ処理→内部イベントの順になる。 As described above, since there is an internal event generated by executing the user function group 125 of the application unit corresponding to the timer process, after execution of the user function group 125 of the application unit corresponding to the timer process by the timer process handler 124, The user function group 127 of the application unit corresponding to the internal event is executed by the internal event handler 126. For this reason, the processing order is the order of external event → timer processing → internal event.

内部イベントハンドラ126は、イベントキューIQから先入れ先出し方式で内部イベントをデキューし(ステップS107)、該内部イベントのポインタを辿ってイベントテーブルT0〜Tnを参照し、イベントテーブルT0〜Tnに登録されている内部イベントに対応するアプリケーションユニットのユーザ関数群127を呼び出して逐次実行する(ステップS108)。そして、すべての内部イベントに対応するアプリケーションユニットのユーザ関数群127の実行が完了すると、内部イベントハンドラ126は、処理を終了して、簡易OS121に制御を戻す。 The internal event handler 126 dequeues the internal event from the event queue IQ by a first-in first-out method (step S107), traces the pointer of the internal event, refers to the event table T0 to Tn, and is registered in the event table T0 to Tn. The user function group 127 of the application unit corresponding to the internal event is called and sequentially executed (step S108). When the execution of the user function group 127 of the application unit corresponding to all the internal events is completed, the internal event handler 126 ends the process and returns control to the simple OS 121.

簡易OS121は、内部イベントハンドラ126から制御が戻ると、逐次処理があるかどうかをチェックし(ステップS109)、逐次処理がなければ(ステップS109でノー)、逐次処理ハンドラ128を起動することなく、処理を終了する。逐次処理があれば(ステップS109でイエス)、簡易OS121は、逐次処理ハンドラ129を起動する。 When the control returns from the internal event handler 126, the simplified OS 121 checks whether there is sequential processing (step S109). If there is no sequential processing (No in step S109), the simple OS 121 does not start the sequential processing handler 128. The process ends. If there is sequential processing (Yes in step S109), the simple OS 121 activates the sequential processing handler 129.

逐次処理ハンドラ128は、逐次処理に対応するアプリケーションユニットのユーザ関数群129を呼び出して逐次実行する(ステップS110)。そして、すべての逐次処理に対応するアプリケーションユニットのユーザ関数群129の実行が完了すると、逐次処理ハンドラ128は、処理を終了して、簡易OS121に制御を戻す。 The sequential processing handler 128 calls and sequentially executes the user function group 129 of the application unit corresponding to the sequential processing (step S110). When the execution of the user function group 129 of the application unit corresponding to all the sequential processes is completed, the sequential process handler 128 ends the process and returns control to the simple OS 121.

なお、従来からの逐次処理に対応するアプリケーションユニットのユーザ関数群129と、イベントドリブン型の外部イベントに対応するアプリケーションユニットのユーザ関数群123および内部イベントに対応するアプリケーションユニットのユーザ関数群127との間では、状態の不整合なく共存が可能である。たとえば、ドアが開いている時にボタン操作があったならば出力装置40に警報を出す(ブザー40cを鳴らす,ランプ40dを点滅する等)というような従来からの逐次処理に対応するアプリケーションユニットのユーザ関数群129が共存している場合、外部イベントをイベントキューIQにキューイングしないで処理してしまうと、ドアがロックされてしまう。一方、従来からの逐次処理に対応するアプリケーションユニットのユーザ関数群129は、イベントで動作しないので、定期処理の時点では、ドア開時のボタン操作としてブザー40cを鳴らしてしまう。この場合、これら2つの制御は矛盾した動作(ロックを出力しているのにブザー40cを鳴らす)になってしまう。したがって、外部イベントの処理は、全ての入力データが確定した後に実行しなければならない。 It should be noted that the user function group 129 of the application unit corresponding to the conventional sequential processing, the user function group 123 of the application unit corresponding to the event-driven external event, and the user function group 127 of the application unit corresponding to the internal event Coexistence is possible without inconsistency between the two. For example, a user of an application unit corresponding to a conventional sequential process such as issuing an alarm to the output device 40 if there is a button operation while the door is open (ringing the buzzer 40c, blinking the lamp 40d, etc.) When the function group 129 coexists, if the external event is processed without being queued in the event queue IQ, the door is locked. On the other hand, since the user function group 129 of the application unit corresponding to the conventional sequential processing does not operate by an event, the buzzer 40c is sounded as a button operation when the door is opened at the time of the regular processing. In this case, these two controls are inconsistent operations (the buzzer 40c is sounded even though the lock is output). Therefore, the processing of the external event must be executed after all input data has been determined.

簡易OS121は、逐次処理ハンドラ128から制御が戻ると、アプリケーションフェーズを終了して、出力フェーズの出力調停マネージャ131に制御を渡す。 When the control returns from the sequential processing handler 128, the simplified OS 121 ends the application phase and passes control to the output arbitration manager 131 in the output phase.

出力調停マネージャ131は、簡易OS121から制御を渡されると、アプリケーションフェーズにおいて処理結果格納領域に記憶された処理結果に基づき出力処理ルーチン134によって出力を行うか否かを調停する。例えば、複数のユーザ関数が同一の出力対象に対する異なる出力指示を処理結果格納領域に格納していた場合、いずれの処理結果を反映させて出力するかを調停する。この際、出力調停の結果として新たな外部イベントが発生する場合には、出力調停マネージャ131は、この外部イベントを簡易OS121のイベントキューIQにキューイングする(図1中の破線矢印を参照)。ただし、この外部イベントの実行が次の周回のアプリケーションフェーズになることはいうまでもない。このような出力調停により、アプリケーションフェーズの各アプリケーションユニットのユーザ関数群では、I/Oポート14の詳細な構成を意識することなく、処理結果を処理結果格納領域に出力するだけでよくなる。また、各アプリケーションユニットのユーザ関数群同士が処理結果の内容に矛盾がないかを判定する必要がなくなり、制御プログラムの作成が容易になり、モジュール性も高くなって信頼性も向上する。すべての出力調停ルーチン132の実行を完了すると、出力調停マネージャ131は、出力処理マネージャ133に制御を渡す。 When the control is passed from the simple OS 121, the output arbitration manager 131 arbitrates whether to perform output by the output processing routine 134 based on the processing result stored in the processing result storage area in the application phase. For example, when a plurality of user functions store different output instructions for the same output target in the processing result storage area, it arbitrates which processing result is reflected and output. At this time, if a new external event occurs as a result of output arbitration, the output arbitration manager 131 queues this external event in the event queue IQ of the simple OS 121 (see the broken line arrow in FIG. 1). However, it goes without saying that the execution of this external event becomes the next round of application phase. By such output arbitration, the user function group of each application unit in the application phase need only output the processing result to the processing result storage area without being aware of the detailed configuration of the I / O port 14. In addition, it is not necessary to determine whether there is a contradiction in the contents of the processing results between the user function groups of each application unit, making it easy to create a control program, improving modularity, and improving reliability. When the execution of all the output arbitration routines 132 is completed, the output arbitration manager 131 passes control to the output processing manager 133.

出力処理マネージャ133は、出力調停マネージャ131から制御を渡されると、出力調停ルーチン132による調停結果に基づいて処理結果格納領域の処理結果をI/Oポート14への出力する出力処理ルーチン134を順次実行する。すべての出力処理ルーチン134の実行が終了すると、出力処理マネージャ133は、システムフェーズのスリープマネージャ101へ制御を移行する。 When the output processing manager 133 receives control from the output arbitration manager 131, the output processing manager 133 sequentially outputs an output processing routine 134 that outputs the processing result in the processing result storage area to the I / O port 14 based on the arbitration result by the output arbitration routine 132. Execute. When the execution of all output processing routines 134 is completed, the output processing manager 133 shifts control to the sleep manager 101 in the system phase.

これにより、スリープマネージャ106を通じてタイマ割込みタスクから復帰し、システムフェーズのアイドルタスクマネージャ102,ユーザ定義103,およびCPU監視マネージャ104からなるアイドルループに制御が戻る。 Thus, the timer interrupt task is returned through the sleep manager 106, and control is returned to the idle loop including the idle task manager 102, the user definition 103, and the CPU monitoring manager 104 in the system phase.

このように、タイマ割込みタスクを、入力フェーズ,アプリケーションフェーズおよび出力フェーズに分け、アプリケーションユニットのユーザ関数群間でデータの受け渡しを直接的に行わないようにすることで、各アプリケーションユニットの独立性が高まり、機能単位であるユーザ関数の追加および削除が容易にできるようになる。なお、このタイマ割込みタスクによる入力フェーズ,アプリケーションフェーズおよび出力フェーズの処理は、タイマ割込みの間隔である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 input processing manager 111, the input arbitration manager 113, the simple OS 121, the output arbitration manager 131, and the output processing manager 133. Synchronize data. That is, data determined in a certain time is transferred to the next process and is not changed thereafter. For example, after the input processing manager 111 determines that the switch state is ON, the switch state is ON even if the input state of the switch is OFF until the next round input phase is executed. Process as follows. Similarly, the event that has undergone input arbitration by the input arbitration manager 113 is not changed until the processing of the next round of input arbitration manager 113. In addition, the processing result determined in the application phase is not changed until the next application phase. Then, the processing result of the output arbitration by the output arbitration manager 131 is not changed until the process of the next round of output arbitration manager 131. Therefore, data is determined (synchronized) at the end of each process. And, since the data generated in the previous process does not change during each process, for example, it is possible to avoid a process contradiction that performs a process based on the data before the change and a process based on the data after the change, Safety design is also easy. Further, when control is performed on an apparatus system operated by a person, a difference in processing time (recognition time) between a person and a controlled object (machine) can be adjusted by the above-described arbitration or synchronization. In addition, the influence of a deviation in the arrival of data due to a delay or the like through the in-vehicle LAN 50 can be suppressed by these mechanisms.

例えば、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 door control switch 30a and a smart key (not shown) as the input device 30 (system that locks and unlocks the door using radio waves, etc.) almost simultaneously. When the D-seat door ECU 20a issues an instruction to lock all the seat doors based on the state of the D-seat door control switch 30a, while the smart key outputs an instruction to unlock the all-seat door to the body ECU 10 via the in-vehicle LAN 50, the body ECU 10 These external events are captured from the I / O port 14 by the input processing routine 112. Then, the input arbitration routine 114 performs input arbitration so that any one external event is preferentially executed. For example, input arbitration is performed so that an external event from the D-seat door control switch 30a is given priority. Then, an external event indicating that an instruction for locking all seat doors has been input is queued in the event queue IQ, and control is transferred to the simplified OS 121 in the application phase. Therefore, in the application phase, execution is transferred to the user function group 123 of the application unit corresponding to this external event. For example, an instruction to lock all seat doors is written in the processing result storage area by the process of the user function U1. On the other hand, it is assumed that at this time, for example, the user function U2 is executed by an external event from another input device 30, and a D seat door unlocking instruction is written in the processing result storage area as the processing result. In this case, output arbitration is performed by the execution of the output arbitration routine 132 by the output arbitration manager 13, and control is passed to the output processing manager 133 with priority given to the output of the processing result of all-seat door locking. The output processing manager 133 executes the output processing routine 134 to output a door locking instruction to each door ECU to which the output device 40 is connected. In this way, it is possible to prevent the door from being unlocked → locked or locked → unlocked in a very short time. That is, a plurality of contradictory input data and processing results can be arbitrated, and safe and highly reliable control can be realized.

ところで、本実施例1では、入力フェーズでは入力処理ルーチン112および入力調停ルーチン114をシンプルスケジューリング方式で逐次実行し、出力フェーズでは出力調停ルーチン132および出力処理ルーチン134をシンプルスケジューリング方式で逐次実行する。一方、アプリケーションフェーズでは、どのアプリケーションユニットが実行されるかは、外部イベントおよび内部イベントの有無を判断して決定する。 By the way, in the first embodiment, the input processing routine 112 and the input arbitration routine 114 are sequentially executed by the simple scheduling method in the input phase, and the output arbitration routine 132 and the output processing routine 134 are sequentially executed by the simple scheduling method in the output phase. On the other hand, in the application phase, which application unit is executed is determined by determining the presence or absence of an external event and an internal event.

このような構成とすることで、発生しない外部イベントに対応するアプリケーションユニットのユーザ関数群123は、外部イベントが発生しない間は実行されないことになる。同様に、発生しない内部イベントに対応するアプリケーションユニットのユーザ関数群127は、内部イベントが発生しない間は実行されないことになる。したがって、実行されないアプリケーションユニットのユーザ関数群用の処理結果格納領域は、その間更新されない。このため、外部のノイズ等によって処理結果格納領域の処理結果(データ)が書き換えられた場合(いわゆるRAM化け)には、出力調停ルーチン132および出力処理ルーチン134によって誤った出力がなされてしまう場合がある。このような状況は、処理結果格納領域が長時間更新されなければされないほど発生する可能性が高くなる。特に、制御の誤りによって人に対して悪影響を与える可能性のある車両等のシステムを制御する場合には、このようなことが起こらないように、RAM13の値を所定時間毎に更新することが望ましい。 With such a configuration, the user function group 123 of the application unit corresponding to the external event that does not occur is not executed while the external event does not occur. Similarly, the user function group 127 of the application unit corresponding to the internal event that does not occur is not executed while the internal event does not occur. Therefore, the processing result storage area for the user function group of the application unit that is not executed is not updated during that time. For this reason, when the processing result (data) in the processing result storage area is rewritten due to external noise or the like (so-called RAM corruption), erroneous output may be made by the output arbitration routine 132 and the output processing routine 134. is there. Such a situation is more likely to occur as the processing result storage area has to be updated for a long time. In particular, when controlling a system such as a vehicle that may adversely affect people due to a control error, the value of the RAM 13 may be updated every predetermined time so that this does not occur. desirable.

そこで、アプリケーションフェーズにおいて、一定時間以上起動されていない外部イベントに対応するアプリケーションユニットのユーザ関数群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 user function group 123 of the application unit corresponding to the external event that has not been activated for a certain period of time and the user function group 127 of the application unit corresponding to the internal event are sequentially activated, and the user function of each application unit is activated. Update the processing result storage area for the group. This fixed time is an interval longer than the timer interrupt interval (predetermined time), and a time that does not hinder system control even if the processing result (data) in the processing result storage area changes due to external noise or the like. To do. That is, in the body system 100 (see FIG. 2), it is assumed that the instruction to close in a state where it should not be closed is output due to the garbled RAM, for example, power window closing control (not shown). If the time during which such abnormal control continues is about 50 ms, it does not adversely affect humans. Therefore, for example, for 40 ms, the user function group 123 of the application unit corresponding to the external event that has not been activated and the user function group 127 of the application unit corresponding to the internal event are sequentially executed. For example, if the user function U2, the user function U3, and the user function U4 are not executed for 40 ms, the user function U2 is executed, the user function U3 is executed, and the user function U4 is executed. Then, the above-described processing for executing the user function group 123 of the application unit corresponding to the external event and the user function group 127 of the application unit corresponding to the internal event is performed. By adopting such a configuration, reliability and safety can be ensured even if RAM corruption occurs.

ところで、上記実施例1では、電子制御装置として主としてボデーECU10を例にとって説明したが、照合ECU,エンジンECU等のその他の電子制御装置の場合も本発明が同様に適用できることはいうまでもない。 In the first embodiment, the body ECU 10 is mainly described as an example of the electronic control device. However, it goes without saying that the present invention can be similarly applied to other electronic control devices such as a verification ECU and an engine ECU.

以上、本発明の実施例を説明したが、これはあくまでも例示にすぎず、本発明はこれに限定されるものではなく、特許請求の範囲の趣旨を逸脱しない限りにおいて、当業者の知識に基づく種々の変更が可能である。 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.

本発明の実施例1に係る電子制御装置における動作を説明する説明図。Explanatory drawing explaining the operation | movement in the electronic controller which concerns on Example 1 of this invention. ボデー系システムの構成を示すブロック図。The block diagram which shows the structure of a body type | system | group system. 本実施例1に係る電子制御装置におけるイベントキュー方式を説明する図。FIG. 3 is a diagram for explaining an event queue method in the electronic control apparatus according to the first embodiment. 図1中のアプリケーションフェーズにおける処理を表すフローチャート。The flowchart showing the process in the application phase in FIG. 従来の電子制御装置におけるイベントフラグ方式を説明する図。The figure explaining the event flag system in the conventional electronic control unit.

符号の説明Explanation of symbols

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 timer 20 communication target ECU
20a D seat door ECU
20b P seat door ECU
20c Instrument panel ECU
30 Input device 30a D seat door control switch 30b P seat door control switch 40 Output device 40a D seat door lock motor 40b P seat door lock motor 40c Buzzer 40d Lamp 50 Car interior LAN
100 Body System 101 System Initialization Routine 102 Idle Task Manager 103 User Definition 104 CPU Monitoring Manager 105 System Manager 106 Sleep Manager 111 Input Processing Manager 112 Input Processing Routine 113 Input Arbitration Manager 114 Input Arbitration Routine 121 Simple OS
122 External event handler 123 User unit group of application unit corresponding to external event 124 Timer processing handler 125 User function group of application unit corresponding to timer processing 126 Internal event handler 127 User function group of application unit corresponding to internal event 128 Sequential Processing handler 129 User function 131 of application unit corresponding to sequential processing Output arbitration manager 132 Output arbitration routine 133 Output processing manager 134 Output processing routine IQ Event queue T0 to Tn Event table

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.
前記外部イベントハンドラ手段,前記タイマ処理ハンドラ手段,前記内部イベントハンドラ手段,および前記逐次処理ハンドラ手段を順次実行する簡易OS手段を備えることを特徴とする請求項2に記載の電子制御装置。 3. The electronic control apparatus according to claim 2, further comprising a simplified OS unit that sequentially executes the external event handler unit, the timer processing handler unit, the internal event handler unit, and the sequential processing handler unit. 前記制御処理は、所定時間毎に実行し、該制御処理は前記所定時間内に完了することを特徴とする請求項1ないし3のいずれかに記載の電子制御装置。 The electronic control apparatus according to claim 1, wherein the control process is executed every predetermined time, and the control process is completed within the predetermined time. イベント毎に当該イベントに対応するアプリケーションユニットのユーザ関数群のアドレスを格納するイベントテーブルと、
イベントに対応するイベントテーブルへのポインタを先入れ先出し方式で蓄積するイベントキューと、
イベントを検出したときに該イベントに対応するイベントテーブルへのポインタを前記イベントキューにキューイングする入力処理手段と、
前記イベントキューからイベントに対応するイベントテーブルへのポインタをデキューし、該ポインタが指すイベントテーブルを参照して該イベントに対応するアプリケーションユニットのユーザ関数群を呼び出すイベントハンドラ手段と
を有することを特徴とする電子制御装置。
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.
入力装置からのイベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャと、前記イベントキューにイベントがキューイングされているかどうかをチェックする簡易OSと、前記イベントキューにイベントがキューイングされている場合に該イベントをデキューして該イベントに対応するアプリケーションユニットのユーザ関数群を実行するイベントハンドラとを含むことを特徴とするプログラム。 An input processing manager that queues an event from an input device to an event queue by an input processing routine, a simple OS that checks whether an event is queued in the event queue, and an event that is queued in the event queue And an event handler that dequeues the event and executes a user function group of the application unit corresponding to the event. 入力装置からの外部イベントを入力処理ルーチンによりイベントキューにキューイングする入力処理マネージャと、前記入力処理ルーチンによって入力された外部イベントを入力調停ルーチンにより入力調停する入力調停マネージャと、前記イベントキューにキューイングされた外部イベントをデキューして該外部イベントに対応するアプリケーションユニットのユーザ関数群を実行する外部イベントハンドラと、タイマ処理に対応するアプリケーションユニットのユーザ関数群を実行するタイマ処理ハンドラと、前記タイマ処理に対応するアプリケーションユニットのユーザ関数群の実行によりイベントキューにキューイングされた内部イベントをデキューして該内部イベントに対応するアプリケーションユニットのユーザ関数群を実行する内部イベントハンドラと、逐次処理に対応するアプリケーションユニットのユーザ関数群を実行する逐次処理ハンドラと、前記ユーザ関数群の処理結果の出力装置への出力を出力調停ルーチンにより調停する出力調停マネージャと、前記出力調停ルーチンによる出力調停結果に基づいて出力処理ルーチンにより出力装置への出力を行う出力処理マネージャとを含むことを特徴とするプログラム。 An input processing manager that queues an external event from the input device to an event queue by an input processing routine, an input arbitration manager that inputs an external event input by the input processing routine by an input arbitration routine, and a queue to the event queue An external event handler that dequeues an external event that has been processed and executes a user function group of an application unit corresponding to the external event, a timer processing handler that executes a user function group of an application unit corresponding to timer processing, and the timer The internal function queued in the event queue by the execution of the user function group of the application unit corresponding to the process is dequeued, and the user function group of the application unit corresponding to the internal event is executed. An internal event handler, a sequential processing handler that executes a user function group of an application unit corresponding to sequential processing, an output arbitration manager that arbitrates output to the output device of the processing result of the user function group by an output arbitration routine, and An output processing manager that outputs to an output device by an output processing routine based on an output arbitration result by an output arbitration routine.
JP2004339109A 2004-11-24 2004-11-24 Electronic controller, its control method, and program Pending JP2006146789A (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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