JP2010170320A - Program and control device - Google Patents

Program and control device Download PDF

Info

Publication number
JP2010170320A
JP2010170320A JP2009012055A JP2009012055A JP2010170320A JP 2010170320 A JP2010170320 A JP 2010170320A JP 2009012055 A JP2009012055 A JP 2009012055A JP 2009012055 A JP2009012055 A JP 2009012055A JP 2010170320 A JP2010170320 A JP 2010170320A
Authority
JP
Japan
Prior art keywords
time
processing unit
real
interrupt
time slot
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2009012055A
Other languages
Japanese (ja)
Other versions
JP4985662B2 (en
Inventor
Yosuke Sato
洋介 佐藤
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 JP2009012055A priority Critical patent/JP4985662B2/en
Publication of JP2010170320A publication Critical patent/JP2010170320A/en
Application granted granted Critical
Publication of JP4985662B2 publication Critical patent/JP4985662B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a program causing a CPU to execute in parallel a task that needs to be real-time and a task that does not, while avoiding the delay of a process realized by a task that does not need to be real-time enough to be able to respond to input from the outside within a predetermined period of time. <P>SOLUTION: A scheduler 111 performs scheduling for first and second VMs (Virtual Machine programs), which are tasks that need to be real-time, and a third VM which is a task that does not need to be real-time. The scheduler 111 causes the CPU to execute the VMs in parallel by allocating time slots to the first to third VMs at predetermined timings; if the first or second VM finishes the process without consuming the entire time slot allocated to it, the remaining time of the time slot is allocated to the third VM 140. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、CPUに、複数の処理単位を並行して実行させるプログラム等に関する。 The present invention relates to a program for causing a CPU to execute a plurality of processing units in parallel.

車両には多くのECUが搭載されており、これらのECUは、車内LAN等を介して通信を行い、互いに連携して処理を行う。今後、車両の高機能化、高性能化に伴い、より多くのECUが車両に搭載されると考えられている。   Many ECUs are mounted on a vehicle, and these ECUs communicate via an in-vehicle LAN or the like and perform processing in cooperation with each other. In the future, it is considered that more ECUs will be mounted on vehicles as the functions and performance of vehicles increase.

しかしながら、車両内部は限られた空間であるため、無制限にECUの数を増やすことはできない。また、ECUの数を増加させると、車内LANの通信負荷が増加するため、各ECUの処理に対する悪影響が生じるおそれがある。さらに、ECUの数の増加により車両の重量が増加してしまうため、燃費の悪化が懸念される。このように、車両に搭載可能なECUの数には限りがあると共に、ECUの数の増加による様々なデメリットが存在する。このような問題の対策として、複数のECUを一つに統合するという方法が実施されている。複数のECUを一つに統合する際には、ECUの小型化やコスト低減の観点から、統合前のECUのマイコンにて行われていた処理を1台のマイコンで実施することが望ましい。このためには、統合前のECUのマイコンに搭載されているプログラムを一つに統合し、新たなプログラムを作成しなければならない。   However, since the interior of the vehicle is a limited space, the number of ECUs cannot be increased without limitation. Further, when the number of ECUs is increased, the communication load of the in-vehicle LAN increases, which may adversely affect the processing of each ECU. Furthermore, since the weight of the vehicle increases due to the increase in the number of ECUs, there is a concern about deterioration in fuel consumption. Thus, the number of ECUs that can be mounted on the vehicle is limited, and there are various disadvantages due to the increase in the number of ECUs. As a countermeasure against such a problem, a method of integrating a plurality of ECUs into one has been implemented. When integrating a plurality of ECUs into one, it is desirable to carry out the processing performed by the microcomputer of the ECU before the integration with a single microcomputer from the viewpoint of miniaturization of the ECU and cost reduction. For this purpose, the programs installed in the microcomputer of the ECU before integration must be integrated into one and a new program must be created.

ここで、非特許文献1には、複数のECUに搭載されているプログラムを統合し、一つのプログラムとする際に用いることができる保護機能付RTOSについて記載されている。この保護機能付RTOSでは、統合前のECUのプログラム(Virtual Machine Program、略してVMとも記載する)である第一のVMと、第二のVMと、第三のVMとに対し、例えば、図2の(a)に記載のVMスケジューリングテーブルに基づきタイムスロットを割り当て、各VMを並行して実行させていると考えられる。この保護機能付RTOSを用いることにより、プログラムを大きく変更することなく、複数のECUに搭載されているプログラムの統合を行うことができる。   Here, Non-Patent Document 1 describes an RTOS with a protection function that can be used when programs installed in a plurality of ECUs are integrated into a single program. In this RTOS with a protection function, for example, the first VM, the second VM, and the third VM, which are ECU programs (Virtual Machine Program, abbreviated as VM for short) before integration, It is considered that time slots are allocated based on the VM scheduling table described in (a) of 2 and each VM is executed in parallel. By using this RTOS with a protection function, it is possible to integrate programs installed in a plurality of ECUs without greatly changing the program.

ところで、車両には、例えば、エンジン制御ECUや、エアバック制御ECUが搭載されているが、このようなECUでは、安全上の観点から、外部からの入力に対して所定の時間内に応答を行うというリアルタイム性が要求される。これに対し、例えば、オーディオ制御ECU等においては、エンジン制御ECU等に比べると、リアルタイム性の必要性は低いといえる。このため、エンジン制御ECU等とオーディオ制御ECUとを一つに統合する場合には、少なくともエンジン制御ECU等に対応するVMのリアルタイム性を確保する必要がある。したがって、例えば、上述した保護機能RTOSを用いる場合であれば、エンジン制御ECU等に対応するVMに対しては、オーディオ制御ECU等に対応するVMよりも優先的に、タイムスロットの割り当て周期や、タイムスロットの長さ等を設定する必要がある。しかしながら、このようにしてタイムスロットの設定を行なうと、オーディオ制御ECU等に対応するVMが十分に実行されなくなってしまうおそれがある。このため、例えば、オーディオ制御ECU等に対応するVMにて動画表示処理を行う場合であれば、滑らかな動画表示ができなくなってしまうといった具合に、このVMによる処理が停滞してしまうおそれがある。   By the way, for example, an engine control ECU and an air bag control ECU are mounted on the vehicle. However, from the viewpoint of safety, such an ECU responds to an external input within a predetermined time. Real-time performance is required. On the other hand, for example, in audio control ECUs, it can be said that the need for real-time performance is low compared to engine control ECUs. For this reason, when integrating the engine control ECU and the audio control ECU into one, it is necessary to ensure the real-time property of the VM corresponding to at least the engine control ECU and the like. Therefore, for example, in the case of using the protection function RTOS described above, the time slot allocation cycle is given priority over the VM corresponding to the engine control ECU or the like over the VM corresponding to the audio control ECU or the like. It is necessary to set the length of the time slot. However, if the time slot is set in this way, the VM corresponding to the audio control ECU or the like may not be sufficiently executed. For this reason, for example, if the moving image display process is performed in the VM corresponding to the audio control ECU or the like, the process by the VM may be stagnant, for example, the smooth moving image display cannot be performed. .

ここで、特許文献1には、異なる優先度を有するスレッドを時分割処理するシステムにおけるスケジューリング方法が記載されている。特許文献1に記載の方法では、各スレッドに対してタイムスロットデータを対応付け、このタイムスロットデータに対してスケジューリングを行なう。つまり、タイムスロットデータに処理時間が割り当てられると、このタイムスロットデータに対応するスレッドが実行されるのである。そして、例えば、スレッドAが、このスレッドAよりも優先度がより低いスレッドBにおける所定の処理の終了を待つ必要が生じた場合には、スレッドAに対応するタイムスロットデータAをスレッドBに対応付けることにより、スレッドAの優先度をスレッドBに承継する。そして、スレッドBにおける所定の処理が終了すると、タイムスロットデータAは、再びスレッドAに対応付けられる。   Here, Patent Document 1 describes a scheduling method in a system that performs time-sharing processing of threads having different priorities. In the method described in Patent Document 1, time slot data is associated with each thread, and scheduling is performed on the time slot data. That is, when a processing time is assigned to time slot data, a thread corresponding to the time slot data is executed. For example, when it becomes necessary for the thread A to wait for completion of predetermined processing in the thread B having a lower priority than the thread A, the time slot data A corresponding to the thread A is associated with the thread B. As a result, the priority of the thread A is inherited to the thread B. When predetermined processing in the thread B is completed, the time slot data A is associated with the thread A again.

[平成21年1月6日検索]、インターネット<URL:http://www.toppers.jp/docs/ipaward10-presen.pdf>[Search January 6, 2009], Internet <URL: http://www.toppers.jp/docs/ipaward10-presen.pdf>

特開2000−20323号公報JP 2000-20323 A

特許文献1に記載の方法によれば、スレッドの優先度を変更する際に生じるオーバーヘッドを抑えることができ、スレッドに割り当てられたCPUの処理時間を有効に利用することができる。しかしながら、特許文献1に記載の方法を保護機能RTOSに適用したとしても、上述したような、リアルタイム性の必要性が低いVMによる処理が停滞しまうおそれがあるという問題を解決することはできない。   According to the method described in Patent Document 1, the overhead that occurs when changing the priority of a thread can be suppressed, and the processing time of the CPU assigned to the thread can be used effectively. However, even if the method described in Patent Document 1 is applied to the protection function RTOS, it is not possible to solve the above-described problem that processing by a VM having low real-time property may be stagnant.

本願発明は上記課題を解決するためになされたものであり、リアルタイム性が要求される処理単位と、リアルタイム性が要求されない処理単位とを並行してCPUに実行させるプログラムに関する発明である。本願発明は、リアルタイム性が要求されない処理単位により実現される処理の停滞を抑えつつ、これらの処理単位をCPUに並行して実行させることが可能なプログラムを提供することを目的とする。   The present invention has been made to solve the above problems, and is an invention relating to a program for causing a CPU to execute in parallel a processing unit that requires real-time processing and a processing unit that does not require real-time processing. It is an object of the present invention to provide a program capable of causing a CPU to execute these processing units in parallel while suppressing stagnation of processing realized by processing units that do not require real-time performance.

上記課題を解決するためのなされた請求項1に記載の基本プログラムは、複数の処理単位のうちのいずれかに対して予め設定されたタイミングでタイムスロットを割り当てることにより、これらの処理単位をCPUに並行して実行させる。尚、処理単位にタイムスロットを割り当てるとは、例えば、CPUにタイムスロットが示す時間にわたって処理単位を実行させることであっても良い。また、処理単位には、外部からの入力に対し予め設定された時間内での応答が可能であるという性質であるリアルタイム性が要求されるリアルタイム処理単位と、リアルタイム性が要求されない非リアルタイム処理単位とが存在し、非リアルタイム処理単位は、いずれかのリアルタイム処理単位に対応付けられている。また、基本プログラムは、処理単位に対してタイムスロットを割り当てるタイミングを示すデータであるタイムスロットデータを有している。また、基本プログラムは、タイムスロットデータに基づき、リアルタイム処理単位にタイムスロットを割り当てる第一のステップを有している。   The basic program according to claim 1, which is for solving the above-described problem, assigns a time slot to any one of a plurality of processing units at a preset timing, thereby assigning these processing units to a CPU. To run in parallel. Note that assigning a time slot to a processing unit may be, for example, causing the CPU to execute a processing unit over the time indicated by the time slot. In addition, the processing unit is a real-time processing unit that requires real-time processing that is capable of responding to external input within a preset time, and a non-real-time processing unit that does not require real-time processing. And a non-real-time processing unit is associated with one of the real-time processing units. Further, the basic program has time slot data which is data indicating timing for assigning time slots to the processing units. The basic program has a first step of assigning time slots to real-time processing units based on the time slot data.

ここで、リアルタイム処理単位は、外部からの入力に対し予め設定された時間内に応答することが要求されるが、例えば、この外部からの入力が無い場合等には、リアルタイム処理単位は、タイムスロットを割り当てられてもこのタイムスロットが示す時間にわたって処理を継続する必要が無いといったことが想定される。つまり、タイムスロットが割り当てられたリアルタイム処理単位は、タイムスロットを使い切ることなく処理を終了するという場合が想定されるのである。   Here, the real-time processing unit is required to respond to an external input within a preset time. For example, when there is no external input, the real-time processing unit is a time Even if a slot is allocated, it is assumed that it is not necessary to continue the process for the time indicated by this time slot. That is, it is assumed that the real-time processing unit to which the time slot is allocated ends the processing without using up the time slot.

そこで、この基本プログラムは、第一のステップにて割り当てられたタイムスロットを使い切ることなくリアルタイム処理単位が終了した場合には、該リアルタイム処理単位に替えて、該リアルタイム処理単位に対応付けられている非リアルタイム処理単位に、該タイムスロットの残り時間を割り当てる第二のステップをさらに有している。   Therefore, this basic program is associated with the real-time processing unit instead of the real-time processing unit when the real-time processing unit is completed without using up the time slot allocated in the first step. The method further includes a second step of assigning the remaining time of the time slot to the non-real time processing unit.

このような構成を有することにより、タイムスロットを使い切ることなくリアルタイム処理単位の実行を終了した場合に、余った時間を、非リアルタイム処理単位に割り当てることができる。したがって、この基本プログラムは、非リアルタイム処理単位により実現される処理の停滞を抑えつつ、リアルタイム処理単位と非リアルタイム処理単位とをCPUに並行して実行させることができる。   By having such a configuration, when the execution of the real-time processing unit is completed without using up the time slot, the surplus time can be allocated to the non-real-time processing unit. Therefore, the basic program can cause the CPU to execute the real-time processing unit and the non-real-time processing unit in parallel while suppressing the stagnation of processing realized by the non-real-time processing unit.

また、タイムスロットを使い切ることなくリアルタイム処理単位の実行を終了した場合に、次のようにして、余った時間を非リアルタイム処理単位に割り当てても良い。   Further, when the execution of the real-time processing unit is completed without using up the time slot, the remaining time may be allocated to the non-real-time processing unit as follows.

すなわち、請求項2に記載されているように、リアルタイム処理単位は、複数の非リアルタイム処理単位に対応付けられており、該リアルタイム処理単位に対応する非リアルタイム処理単位には、優先順位が設定されており、第二のステップにおいて、リアルタイム処理単位に対応する非リアルタイム処理単位のうち、優先順位の高い非リアルタイム処理単位から順にタイムスロットの残り時間を割り当てても良い。   That is, as described in claim 2, a real-time processing unit is associated with a plurality of non-real-time processing units, and priorities are set for the non-real-time processing units corresponding to the real-time processing units. In the second step, among the non-real time processing units corresponding to the real time processing units, the remaining times of the time slots may be allocated in order from the non-real time processing units with the highest priority.

このような構成を有する場合であっても、非リアルタイム処理単位により実現される処理の停滞を抑えつつ、リアルタイム処理単位と非リアルタイム処理単位をCPUに並行して実行させることができる。   Even with such a configuration, it is possible to cause the CPU to execute the real-time processing unit and the non-real-time processing unit in parallel while suppressing the stagnation of processing realized by the non-real-time processing unit.

また、既に述べたように、複数のECUを一つに統合するということが望まれているが、このような場合には、複数のECUの制御プログラムを一つに統合し、新たなプログラムを作成しなければならない。そこで、処理単位とは、次のようなソフトウェアであっても良い。   In addition, as described above, it is desired to integrate a plurality of ECUs into one. In such a case, a control program for a plurality of ECUs is integrated into one, and a new program is installed. Must be created. Therefore, the processing unit may be the following software.

すなわち、請求項3に記載されているように、処理単位のうちの少なくとも一つは、プログラムが搭載される装置とは異なる他の装置の制御プログラムに基づく処理単位であるVM(Virtual Machine Programの略)であっても良い。   That is, as described in claim 3, at least one of the processing units is a VM (Virtual Machine Program) that is a processing unit based on a control program of another device different from the device on which the program is installed. Abbreviation).

こうすることにより、複数のECUの制御プログラムを一つに統合した場合に、リアルタイム性が要求されないVMの処理の停滞を抑えつつ、CPUに複数のVMを並行して実行させることができる。   In this way, when the control programs of a plurality of ECUs are integrated into one, it is possible to cause the CPU to execute a plurality of VMs in parallel while suppressing the stagnation of VM processing that does not require real-time performance.

また、処理単位をVMとした場合には、本プログラムを実行するCPUの周辺デバイスに対し、次のようにして指示を行っても良い。   When the processing unit is VM, an instruction may be given to the peripheral device of the CPU that executes this program as follows.

すなわち、請求項4に記載されているように、VMは、他の装置におけるCPUの周辺デバイスであって、基本プログラムが搭載される装置におけるCPUにおける周辺デバイスである自装置の周辺デバイスと同一の用途にて用いられる周辺デバイスである他の装置の周辺デバイスを制御するための処理を有しており、自装置の周辺デバイスには、他の装置の周辺デバイスとは異なる形式で指示を行う必要があっても良い。そして、基本プログラムは、それぞれのVMから、他の装置の周辺デバイスへの指示と同様の形式で、自装置の周辺デバイスに対しての指示を受け付ける第三のステップと、第三のステップにて受け付けた指示を、自装置の周辺デバイスに対応する形式に変換し、該自装置の周辺デバイスに対しての制御を行う第四のステップとをさらに有していても良い。   That is, as described in claim 4, the VM is a peripheral device of the CPU in another apparatus, and is the same as the peripheral device of the own apparatus that is a peripheral device in the CPU in the apparatus in which the basic program is installed. It has processing to control peripheral devices of other devices that are peripheral devices used in the application, and it is necessary to give instructions to the peripheral devices of its own device in a format different from the peripheral devices of other devices There may be. Then, the basic program is in the third step and the third step for receiving an instruction for the peripheral device of its own device from each VM in the same format as the instruction for the peripheral device of the other device. It may further include a fourth step of converting the received instruction into a format corresponding to the peripheral device of the own device and controlling the peripheral device of the own device.

このような構成を有することにより、VMは、統合前のECUにおけるCPUの周辺デバイスに対応する形式で、統合後のECUにおけるCPUの周辺デバイスに対して指示を行うことができる。このため、統合前のECUにおける制御プログラムにおいてCPUの周辺デバイスに対する指示を行う部位の構成を変更することなく、この制御プログラムに基づきVMを作成することができる。つまり、複数のECUの制御プログラムを一つに統合する際の変更規模の増加を抑えることができるのである。   By having such a configuration, the VM can instruct the peripheral device of the CPU in the ECU after integration in a format corresponding to the peripheral device of the CPU in the ECU before integration. For this reason, a VM can be created based on this control program without changing the configuration of the part that gives instructions to the peripheral devices of the CPU in the control program in the ECU before integration. That is, it is possible to suppress an increase in the change scale when integrating the control programs of a plurality of ECUs into one.

また、VMに対し、CPUの周辺デバイスから受け取ったデータを次のようにして提供しても良い。   Further, the data received from the peripheral device of the CPU may be provided to the VM as follows.

すなわち、請求項5に記載されているように、基本プログラムは、自装置の周辺デバイスから提供されるデータを取得する第五のステップと、第五のステップにて自装置の周辺デバイスから取得したデータを、該自装置の周辺デバイスに対応する他の装置の周辺デバイスを制御する処理を有する前記VMに対し、該他の装置の周辺デバイスに対応する形式で提供する第六のステップとをさらに有していても良い。   That is, as described in claim 5, the basic program is acquired from the peripheral device of the own device in the fifth step of acquiring data provided from the peripheral device of the own device and the fifth step. A sixth step of providing data in a format corresponding to the peripheral device of the other device to the VM having processing for controlling the peripheral device of the other device corresponding to the peripheral device of the own device; You may have.

このような構成を有することにより、VMは、統合前のECUにおけるCPUの周辺デバイスに対応する形式で、統合後のECUにおけるCPUの周辺デバイスからデータを受け取ることができる。このため、統合前のECUにおける制御プログラムにおいてCPUの周辺デバイスからデータを受け取る部位の構成を変更することなく、この制御プログラムに基づきVMを作成することができる。つまり、複数のECUの制御プログラムを一つに統合する際の変更規模の増加を抑えることができるのである。   By having such a configuration, the VM can receive data from the peripheral device of the CPU in the ECU after integration in a format corresponding to the peripheral device of the CPU in the ECU before integration. Therefore, a VM can be created based on this control program without changing the configuration of the part that receives data from peripheral devices of the CPU in the control program in the ECU before integration. That is, it is possible to suppress an increase in the change scale when integrating the control programs of a plurality of ECUs into one.

また、統合前のECUにおける制御プログラムには、割込み処理が用いられている場合がある。例えば、処理単位が、このような制御プログラムに基づくVMである場合には、プログラムは、次のようなステップをさらに有していても良い。   In some cases, interrupt processing is used in the control program in the ECU before integration. For example, when the processing unit is a VM based on such a control program, the program may further include the following steps.

すなわち、請求項6に記載されているように、処理単位として、所定の割込みに対応する割込み処理を有している割込み対応処理単位が存在し、基本プログラムは、割込み対応処理単位に対し、タイムスロット、または、タイムスロットの残り時間が割り当てられている間に、該割込み対応処理単位に対応する所定の割込みが発生すると、該所定の割込みに対応する割込み処理を実行する第七のステップをさらに有していても良い。   That is, as described in claim 6, there is an interrupt processing unit having an interrupt process corresponding to a predetermined interrupt as a processing unit, and the basic program executes a time for the interrupt processing unit. When a predetermined interrupt corresponding to the interrupt corresponding processing unit occurs while the remaining time of the slot or time slot is allocated, a seventh step of executing an interrupt processing corresponding to the predetermined interrupt is further performed. You may have.

このような構成を有することにより、処理単位が有している割込み処理を、確実に実行することができる。したがって、例えば、統合前のECUにおける制御プログラムに割込み処理が用いられている場合であっても、この割込み処理が流用されたVMを処理単位とすることができる。このため、複数のECUの制御プログラムを一つに統合する際の変更規模の増加を抑えることができる。   By having such a configuration, it is possible to reliably execute the interrupt processing that the processing unit has. Therefore, for example, even when interrupt processing is used in the control program in the ECU before integration, the VM in which this interrupt processing is diverted can be used as a processing unit. For this reason, the increase in the change scale at the time of integrating the control programs of a plurality of ECUs into one can be suppressed.

また、割込み処理は、割込み要求が発生した後、速やかに実行されるべきである。   The interrupt process should be executed promptly after an interrupt request is generated.

そこで、請求項7に記載の基本プログラムは、所定の割込みが発生した後、該所定の割込みに対応する割込み対応処理単位に対してタイムスロット、または、タイムスロットの残り時間が割り当てられると、該所定の割込みに対応する割込み処理を実行する第八のステップをさらに有する。   Therefore, the basic program according to claim 7 is configured such that, after a predetermined interrupt occurs, the time slot or the remaining time of the time slot is assigned to the interrupt corresponding processing unit corresponding to the predetermined interrupt. It further has an eighth step of executing an interrupt process corresponding to the predetermined interrupt.

こうすることにより、先に発生した割込み要求に対応する割込み処理を速やかに実行することができる。   By doing so, the interrupt process corresponding to the previously generated interrupt request can be promptly executed.

また、次のようにして割込み処理が実行されても良い。   Further, the interrupt process may be executed as follows.

すなわち、請求項8に記載されているように、第一のステップにおいてタイムスロットが割り当てられるリアルタイム処理単位をメインの処理単位とすると共に、第二のステップにおいて、該第一のステップにてメインの処理単位に割り当てられたタイムスロットの残り時間が割り当てられる非リアルタイム処理単位をサブの処理単位としても良い。そして、基本プログラムは、メインの処理単位が割込み対応処理単位である場合において、サブの処理単位にタイムスロットの残り時間が割り当てられている間に、該メインの処理単位に対応する所定の割込みが発生すると、第七のステップに先立ち、該メインの処理単位である割込み対応処理単位が有する割込み処理を実行する第九のステップをさらに有していても良い。   That is, as described in claim 8, the real-time processing unit to which the time slot is assigned in the first step is set as the main processing unit, and in the second step, the main processing unit is set in the first step. A non-real-time processing unit to which the remaining time of the time slot allocated to the processing unit is allocated may be used as a sub processing unit. Then, when the main processing unit is an interrupt handling processing unit, the basic program generates a predetermined interrupt corresponding to the main processing unit while the remaining time slot time is allocated to the sub processing unit. When the error occurs, it may further include a ninth step for executing an interrupt process included in the interrupt handling processing unit which is the main processing unit, prior to the seventh step.

こうすることにより、サブの処理単位にタイムスロットが割り当てられている間に、対応するメインの処理単位についての割込み要求が発生した場合には、優先的にこのメインの処理単位における対応する割込み処理を実行することができる。したがって、メインの処理単位を、サブの処理単位に対してより優先的に実行することができ、メインの処理単位に要求されるリアルタイム性を、より確実なものとすることができる。   In this way, when an interrupt request for the corresponding main processing unit is generated while a time slot is assigned to the sub processing unit, the corresponding interrupt processing in this main processing unit is preferentially performed. Can be executed. Therefore, the main processing unit can be executed with higher priority than the sub processing unit, and the real-time property required for the main processing unit can be made more reliable.

ところで、請求項1から請求項8に記載の基本プログラムに従い処理を行うコンピュータを備える制御装置を構成しても良い。   By the way, you may comprise a control apparatus provided with the computer which performs a process according to the basic program of Claims 1-8.

こうすることにより、制御装置は、非リアルタイム処理単位により実現される処理の停滞を抑えつつ、リアルタイム処理単位と非リアルタイム処理単位とをCPUに並行して実行させることができる。   By doing so, the control device can cause the CPU to execute the real-time processing unit and the non-real-time processing unit in parallel while suppressing the stagnation of processing realized by the non-real-time processing unit.

統合ECU、及び、統合制御プログラムの構成を示すブロック図である。It is a block diagram which shows the structure of integrated ECU and an integrated control program. VMスケジューリングテーブル、及び、スケジュールパラメータテーブルを示す表である。It is a table | surface which shows a VM scheduling table and a schedule parameter table. タイムスロット管理テーブルを示す表である。It is a table | surface which shows a time slot management table. タイムスロット割当処理のフローチャートである。It is a flowchart of a time slot allocation process. サブのタスク開始処理のフローチャートである。It is a flowchart of a sub task start process. 割込み発生処理のフローチャートである。It is a flowchart of an interrupt generation process. タイムスロット1〜3の利用状況についての説明図である。It is explanatory drawing about the utilization condition of time slots 1-3. 割込み処理の実行状況についての説明図である。It is explanatory drawing about the execution condition of an interruption process. 仮想デバイス等の構成を示すブロック図である。It is a block diagram which shows the structure of a virtual device etc. CANを介してのデータ送信が行なわれる際の仮想デバイス等の動作についてのシーケンス図である。It is a sequence diagram about operation | movement of a virtual device etc. at the time of data transmission via CAN. CANを介してのデータ受信が行なわれる際の仮想デバイス等の動作についてのシーケンス図である。It is a sequence diagram about operation | movement of a virtual device etc. at the time of data reception via CAN.

以下、本発明の実施形態について図面を用いて説明する。尚、本発明の実施の形態は、下記の実施形態に何ら限定されることはなく、本発明の技術的範囲に属する限り種々の形態を採りうる。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. The embodiments of the present invention are not limited to the following embodiments, and various forms can be adopted as long as they belong to the technical scope of the present invention.

[構成の説明]
(1)統合ECUの構成について
図1の(a)は、本実施形態における統合ECU10の構成を示すブロック図である。この統合ECU10は、第一のECUと、第二のECUと、第三のECUという三つのECUが統合されたものであり、この三つのECUが有していた機能を全て有している。また、統合ECU10は、CPU11と、ROM12と、RAM13と、CANコントローラ14とを有しており、これらの部位は内部バス15で接続されている。尚、統合ECU10は、これらの部位以外にも、第一〜第三のECUが備えている部位に対応する部位を有している。
[Description of configuration]
(1) About structure of integrated ECU Fig.1 (a) is a block diagram which shows the structure of integrated ECU10 in this embodiment. The integrated ECU 10 is obtained by integrating three ECUs, ie, a first ECU, a second ECU, and a third ECU, and has all the functions of the three ECUs. The integrated ECU 10 includes a CPU 11, a ROM 12, a RAM 13, and a CAN controller 14, and these parts are connected by an internal bus 15. The integrated ECU 10 has a part corresponding to the part provided in the first to third ECUs in addition to these parts.

CPU11は、ROM12に記憶されているプログラムや、RAM13にロードされたプログラムに従い統合ECU10の制御や各種演算を行う部位である。尚、統合前の三つのECUにそれぞれ搭載されていたCPUで実行されていた全ての処理は、このCPU11で実行される。   The CPU 11 is a part that controls the integrated ECU 10 and performs various calculations in accordance with a program stored in the ROM 12 and a program loaded in the RAM 13. All processes executed by the CPUs mounted on the three ECUs before integration are executed by the CPU 11.

ROM12は、各種のプログラムやデータが記憶されている周知のROMである。   The ROM 12 is a well-known ROM that stores various programs and data.

RAM13は、CPU11から直接アクセスされるメインメモリ等として利用される記憶装置である。このRAM13には、ROM12等から、各種プログラムやデータがロードされる。   The RAM 13 is a storage device used as a main memory or the like that is directly accessed from the CPU 11. Various programs and data are loaded into the RAM 13 from the ROM 12 or the like.

CANコントローラ14は、CAN20を介して他のECUと通信を行うための部位である。   The CAN controller 14 is a part for communicating with other ECUs via the CAN 20.

(2)統合制御プログラムの構成について
また、図1の(b)は、統合ECU10に搭載されている統合制御プログラム100の構成を示すブロック図である。統合制御プログラム100は、ROM12に記憶されている。統合制御プログラム100は、保護機能付きRTOS110と、第一のVM120と、第二のVM130と、第三のVM140と、仮想デバイス150とを有している。尚、VMとは、Virtual Machine Programの略である。
(2) Configuration of Integrated Control Program Further, FIG. 1B is a block diagram showing a configuration of the integrated control program 100 mounted on the integrated ECU 10. The integrated control program 100 is stored in the ROM 12. The integrated control program 100 includes an RTOS 110 with a protection function, a first VM 120, a second VM 130, a third VM 140, and a virtual device 150. Note that VM is an abbreviation of Virtual Machine Program.

保護機能付きRTOS110は、第一〜第三のVMや、仮想デバイス150といったタスクのスケジューリングを行なうプログラムである。このスケジューリングは、スケジューラ111により行なわれる。スケジューリングの詳細に関しては後述する。また、保護機能付きRTOS110は、各タスクに対応するメモリ領域や、自身に対応するメモリ領域の保護を行なう。   The RTOS 110 with protection function is a program for scheduling tasks such as the first to third VMs and the virtual device 150. This scheduling is performed by the scheduler 111. Details of scheduling will be described later. Further, the RTOS 110 with a protection function protects a memory area corresponding to each task and a memory area corresponding to itself.

また、第一のVM120,第二のVM130,第三のVM140は、保護機能付きRTOS110によるスケジューリングの対象となるタスクである。これらのVMは、それぞれ、統合前のECUである第一のECU,第二のECU,第三のECUの制御プログラムの一部を変更して作成されたプログラムである。尚、第一のECU及び第二のECUは、外部からの入力に対して所定の時間内に応答を行うというリアルタイム性が要求されるECUであるため、第一のVM120及び第二のVM130により実現される処理には、リアルタイム性が要求される。また、これらのECUでは、AUTOSARやOSEK(登録商標)に準拠したリアルタイムOSがそれぞれ用いられている。このため、第一のVM120,第二のVM130は、それぞれ、AUTOSAR,OSEKに準拠したリアルタイムOSを有している。尚、第一のVM120に用いられているリアルタイムOSをAUTOSAR121、第二のVM130に用いられているリアルタイムOSをOSEK131と記載する。一方、第三のECUはリアルタイム性が要求されないECUであり、第三のVM140により実現される処理にはリアルタイム性は要求されない。また、このECUでは、OSとしてLinuxが用いられており、第三のVM140はLinux141を有している。   The first VM 120, the second VM 130, and the third VM 140 are tasks that are targets of scheduling by the RTOS 110 with a protection function. Each of these VMs is a program created by changing a part of the control program of the first ECU, the second ECU, and the third ECU, which are the ECUs before integration. Note that the first ECU and the second ECU are ECUs that require real-time response in response to an input from the outside within a predetermined time, so that the first VM 120 and the second VM 130 Realization is required for the realized processing. In these ECUs, real-time OSs conforming to AUTOSAR and OSEK (registered trademark) are used. For this reason, the first VM 120 and the second VM 130 have real-time OSs conforming to AUTOSAR and OSEK, respectively. The real-time OS used for the first VM 120 is referred to as AUTOSAR 121, and the real-time OS used for the second VM 130 is referred to as OSEK 131. On the other hand, the third ECU is an ECU that does not require real-time performance, and the processing realized by the third VM 140 does not require real-time performance. In this ECU, Linux is used as the OS, and the third VM 140 has a Linux 141.

また、第一〜第三のVMでは、統合前のECUのプログラムで用いられていた割込みハンドラに対応する割込み処理が用いられており、保護機能付きRTOS110は、周辺デバイスから割込み要求が発生すると、対応する上記割込み処理を実行する。   In the first to third VMs, the interrupt processing corresponding to the interrupt handler used in the ECU program before the integration is used, and when the RTOS 110 with protection function generates an interrupt request from a peripheral device, The corresponding interrupt process is executed.

また、仮想デバイス150は、第一〜第三のVMと、統合ECU10におけるCPU11の周辺デバイスへとのI/Fとなるタスクである。   The virtual device 150 is a task that is an I / F to the first to third VMs and peripheral devices of the CPU 11 in the integrated ECU 10.

[動作の説明]
統合制御プログラム100は、第一〜第三のECUの機能を、統合ECU10にて実現するためのプログラムである。統合制御プログラム100では、保護機能付きRTOS110が第一〜第三のVMのスケジューリングを行い、第一〜第三のVMをCPU11に並行して実行させることにより、第一〜第三のECUの機能を実現している。ここでは、保護機能付きRTOS110の動作について説明する。
[Description of operation]
The integrated control program 100 is a program for realizing the functions of the first to third ECUs in the integrated ECU 10. In the integrated control program 100, the RTOS 110 with a protection function performs scheduling of the first to third VMs, and causes the CPU 11 to execute the first to third VMs in parallel, whereby the functions of the first to third ECUs are performed. Is realized. Here, the operation of the RTOS 110 with protection function will be described.

(1)タイムスロットについて
保護機能付きRTOS110のスケジューラ111は、第一〜第三のVMと、仮想デバイス150とをタスクとしており、これらのタスクに対し、タイムスロット1〜10を順次割り当てる。また、タイムスロット10の割り当てが行なわれた後は、再度、タイムスロット1〜10の割り当てが順次行なわれる。そして、タスクにいずれかのタイムスロットが割り当てられると、CPU11は、このタイムスロット分の処理時間にわたって、このタスクを実行する。尚、本実施形態では、タイムスロット1〜10は全て100μsの長さであるが、各タイムスロットの長さは、この時間に限定されるものではない。また、例えば、割り当てるタスクに応じてタイムスロットの長さを変更しても良いし、条件に応じて異なる長さのタイムスロットが用いられても良い。また、タイムスロットの長さとして、例えば、100μs〜120μsといった具合に、一定の時間幅を持った時間が設定されていても良い。そして、例えば、所定の条件やタスクの状態等に応じて、この時間幅の範囲内でCPUの実行時間を変動させても良い。
(1) Time Slot The scheduler 111 of the protection function RTOS 110 uses the first to third VMs and the virtual device 150 as tasks, and sequentially assigns time slots 1 to 10 to these tasks. In addition, after the time slot 10 is assigned, the time slots 1 to 10 are sequentially assigned again. When any time slot is assigned to the task, the CPU 11 executes this task over the processing time corresponding to the time slot. In this embodiment, the time slots 1 to 10 are all 100 μs long, but the length of each time slot is not limited to this time. For example, the length of the time slot may be changed according to the task to be assigned, or a time slot having a different length may be used according to the condition. Further, as the length of the time slot, for example, a time having a certain time width may be set such as 100 μs to 120 μs. Then, for example, the CPU execution time may be varied within the range of this time width in accordance with predetermined conditions, task states, and the like.

尚、タスクにタイムスロットを割り当てるということを、タスクに対し、タイムスロットが示す時間にわたってCPUの実行権を付与すると言い換えることもできるということを、念のため付言しておく。   It should be noted that assigning a time slot to a task can be rephrased as giving the execution right of the CPU to the task over the time indicated by the time slot.

(2)第一〜第三のVMのスケジューリングについて
次に、第一〜第三のVMのスケジューリングについて説明する。図2の(a)には、タイムスロット1〜10をどのVMに割り当てるかを示すVMスケジューリングテーブルが記載されている。VMスケジューリングテーブルは、タイムスロット1は第一のVM120に、タイムスロット2は第二のVM130に、タイムスロット3は第三のVM140に、タイムスロット4は第三のVM140に、タイムスロット5は第三のVM140に、タイムスロット6は第一のVM120に、タイムスロット7は第二のVM130に、タイムスロット8は第三のVM140に、それぞれ割り当てられることを示している。また、タイムスロット9,10に関しては、第一〜第三のVMに割り当てられないことを示している。スケジューラ111は、VMスケジューリングテーブルが示すようにタイムスロット1〜10を第一〜第三のVMに割り当て、CPU11に、第一〜第三のVMを並行して実行させる。
(2) First to Third VM Scheduling Next, first to third VM scheduling will be described. FIG. 2A shows a VM scheduling table indicating to which VM the time slots 1 to 10 are allocated. The VM scheduling table shows that time slot 1 is the first VM 120, time slot 2 is the second VM 130, time slot 3 is the third VM 140, time slot 4 is the third VM 140, and time slot 5 is the first It is shown that the time slot 6 is assigned to the first VM 120, the time slot 7 is assigned to the second VM 130, and the time slot 8 is assigned to the third VM 140. Further, the time slots 9 and 10 are not assigned to the first to third VMs. As shown in the VM scheduling table, the scheduler 111 assigns the time slots 1 to 10 to the first to third VMs, and causes the CPU 11 to execute the first to third VMs in parallel.

また、図2の(b)には、第一〜第三のVMのサービス周期等を示すスケジューリングパラメータテーブルが記載されている。スケジューリングパラメータテーブルは、「VM」,「最短サービス周期」,「最長連続走行時間」,「サービス周期許容誤差」という項目を有している。   In FIG. 2B, a scheduling parameter table indicating service periods of the first to third VMs is described. The scheduling parameter table has items of “VM”, “shortest service cycle”, “longest continuous running time”, and “service cycle allowable error”.

「VM」は、第一〜第三のVMのうちのいずれかを示す項目である。   “VM” is an item indicating one of the first to third VMs.

また、「最短サービス周期」は、VMに対してタイムスロットが割り当てられる時間間隔を示している。   The “shortest service period” indicates a time interval in which a time slot is assigned to a VM.

また、「最長連続走行時間」は、VMの最長の連続実行時間を示している。   The “longest continuous running time” indicates the longest continuous execution time of the VM.

また、「サービス周期許容誤差」とは、「最短サービス周期」の誤差として許容される時間を示している。   The “service period allowable error” indicates a time allowed as an error of the “shortest service period”.

保護機能付きRTOS110は、スケジューラ111による第一〜第三のVMについてのスケジューリングについて、スケジューリングパラメータテーブルに基づき異常判定を行うという機能を有している。この機能について具体的に説明する。保護機能付きRTOS110は、各VMについて、対応する「最短サービス周期」が示す時間に「サービス周期許容誤差」が示す時間を加えた時間を閾値とする。そして、リアルタイム性が要求されるVMに関して、このVMにタイムスロットが割り当てられた後、上記閾値に相当する時間が経過しても新たにタイムスロットが割り当てられない場合には、異常が発生したものとみなす。また、保護機能付きRTOS110は、各VMについて、タイムスロットが割り当てられた後、対応する「最長連続走行時間」を経過した後もCPU11による実行が継続されている場合には、異常が発生したものとみなす。   The RTOS 110 with a protection function has a function of performing abnormality determination on the first to third VM scheduling by the scheduler 111 based on the scheduling parameter table. This function will be specifically described. For each VM, the RTOS 110 with a protection function uses, as a threshold, a time obtained by adding the time indicated by the “service cycle allowable error” to the time indicated by the corresponding “shortest service cycle”. For a VM that requires real-time performance, if a new time slot is not assigned after a time corresponding to the above threshold has elapsed after a time slot has been assigned to this VM, an abnormality has occurred. It is considered. In addition, the RTOS 110 with a protection function has an abnormality if the execution by the CPU 11 continues after the corresponding “longest continuous running time” has elapsed after the time slot is assigned to each VM. It is considered.

(3)タスクのスケジューリングについて
スケジューラ111によるタスクのスケジューリングについて説明する。上述したように、タイムスロット1〜10は、順次、第一〜第三のVMのいずれかに割り当てられる。しかし、仮想デバイス150に関しても、処理時間を確保する必要があり、仮想デバイス150に対してもタイムスロットを割り当てることができる。また、タイムスロットを割り当てられた第一のVM120または第二のVM130は、所定の条件が成立すると、自発的に処理を終了する。このため、第一のVM120または第二のVM130に関しては、割り当てられたタイムスロットを全て使い切ることなく、処理が終了してしまう場合がある。このようなケースを想定して、タイムスロット1〜10に対し、メインのタスクとサブのタスクとを対応付けておくことができる。そして、スケジューラ111は、メインのタスクがタイムスロットを使い切ることなく終了した場合には、サブのタスクに対しタイムスロットの残り時間を割り当てるのである。
(3) Task Scheduling Task scheduling by the scheduler 111 will be described. As described above, the time slots 1 to 10 are sequentially assigned to any of the first to third VMs. However, it is necessary to secure a processing time for the virtual device 150, and a time slot can be assigned to the virtual device 150. Further, the first VM 120 or the second VM 130 to which the time slot is assigned spontaneously ends the process when a predetermined condition is satisfied. For this reason, with respect to the first VM 120 or the second VM 130, the processing may end without using up all the assigned time slots. Assuming such a case, the main task and the sub task can be associated with the time slots 1 to 10. Then, when the main task ends without using up the time slot, the scheduler 111 assigns the remaining time of the time slot to the sub task.

尚、図2の(a)に記載のVMスケジューリングテーブルは、タイムスロット1〜10に対し、メインのタスクとして登録されているVMを示している。   Note that the VM scheduling table shown in FIG. 2A shows VMs registered as main tasks for the time slots 1 to 10.

(3−1)タイムスロット管理テーブルについて
図3には、タイムスロット1〜10に対応付けられているメインのタスクとサブのタスクを示すタイムスロット管理テーブルの一例が記載されている。タイムスロット管理テーブルは、タイムスロット1,6には、メインのタスクとして第一のVM120が、サブのタスクとして第三のVM140が対応付けられていることを示している。また、タイムスロット2,7には、メインのタスクとして第二のVM130が、サブのタスクとして第三のVM140が対応付けられていることを示している。また、タイムスロット3〜5、8には、メインのタスクとして第三のVM140が対応付けられており、サブのタスクに関しては対応付けがなされていないことを示している。また、タイムスロット9には、メインのタスクとして仮想デバイス150が対応付けられており、サブのタスクに関しては対応付けがなされていないことを示している。また、タイムスロット10には、メインのタスク及びサブのタスクに関して、対応付けがなされていないことを示している。スケジューラ111は、タイムスロット管理テーブルに基づき、各タスクのスケジューリングを行なう。
(3-1) Time Slot Management Table FIG. 3 shows an example of a time slot management table showing main tasks and sub tasks associated with the time slots 1 to 10. The time slot management table indicates that time slots 1 and 6 are associated with the first VM 120 as the main task and the third VM 140 as the sub task. Further, the time slots 2 and 7 indicate that the second VM 130 is associated with the main task and the third VM 140 is associated with the sub task. Further, the time slots 3 to 5 and 8 are associated with the third VM 140 as the main task, and the sub-tasks are not associated with each other. In addition, the virtual device 150 is associated with the time slot 9 as the main task, and the sub-task is not associated. The time slot 10 indicates that the main task and the sub task are not associated with each other. The scheduler 111 schedules each task based on the time slot management table.

(3−2)タイムスロット割当処理について
スケジューラ111によるタスクのスケジューリングについて、さらに詳しく説明する。スケジューラ111は、各タイムスロットに相当する時間(100μs)が経過する度に、タイムスロット割当処理を実行する。ここでは、タイムスロット割当処理について、図4に記載のフローチャートを用いて説明する。
(3-2) Time Slot Assignment Processing Task scheduling by the scheduler 111 will be described in more detail. The scheduler 111 executes time slot allocation processing every time (100 μs) corresponding to each time slot elapses. Here, the time slot allocation process will be described with reference to the flowchart shown in FIG.

S205では、スケジューラ111は、CPUの実行権が付与されているタスク、つまり、動作中のタスクの有無についてチェックし、動作中のタスクが有る場合には(S205:Yes)、このタスクを停止させる(S210)。   In S205, the scheduler 111 checks whether or not there is a task to which the CPU execution right is granted, that is, an operating task, and if there is an operating task (S205: Yes), stops the task. (S210).

続いて、スケジューラ111は、タイムスロット管理テーブルに基づき、タスクへの割り当てを行なうタイムスロットを特定する(S215)。尚、スケジューラ111は、番号の若いタイムスロットから順に対応するタスクへの割り当てを行い、タイムスロット10についての割り当てを行なった後は、再度、タイムスロット1から順に割り当てを行なう。   Subsequently, the scheduler 111 specifies a time slot to be assigned to a task based on the time slot management table (S215). Note that the scheduler 111 assigns the tasks corresponding to the corresponding time slots in order from the smallest time slot. After assigning the time slot 10, the scheduler 111 again assigns the tasks starting from the time slot 1.

そして、スケジューラ111は、タイムスロット管理テーブルに基づき、特定したタイムスロットを割り当てるメインのタスクの有無を判定する(S220)。そして、タイムスロット1〜9のように、タイムスロットを割り当てるメインのタスクが有る場合には(S220:Yes)、スケジューラ111は、このメインのタスクにタイムスロットを割り当てる(S225)。また、タイムスロット10のように、タイムスロットを割り当てるメインのタスクが無い場合には(S220:No)、タイムスロットの割り当てを行うことなく本処理を終了する。   Then, the scheduler 111 determines the presence / absence of a main task to which the specified time slot is assigned based on the time slot management table (S220). If there is a main task to assign a time slot, such as time slots 1 to 9 (S220: Yes), the scheduler 111 assigns a time slot to this main task (S225). If there is no main task to assign a time slot as in the time slot 10 (S220: No), the present process is terminated without assigning the time slot.

続いて、スケジューラ111は、タイムスロットを割り当てたメインのタスクがVMである場合(S230:Yes)、このVMに対応する割込み要求フラグがセットされているか否かを判定する(S235)。そして、このVMに対応する割込み要求フラグがセットされている場合(S235:Yes)、スケジューラ111は、CPU11に、このVMにおける、この割込み要求フラグに対応する割込み処理を実行させる(S240)。そして、この割込み処理の実行が終了すると、スケジューラ111は、上記割込み要求フラグをクリアし、本処理を終了する。そして、以後、タイムスロットが割り当てられたVMにおける、割込み処理以外の他の処理が実行される。   Subsequently, when the main task to which the time slot is allocated is a VM (S230: Yes), the scheduler 111 determines whether or not an interrupt request flag corresponding to this VM is set (S235). If the interrupt request flag corresponding to this VM is set (S235: Yes), the scheduler 111 causes the CPU 11 to execute an interrupt process corresponding to this interrupt request flag in this VM (S240). Then, when the execution of this interrupt process is completed, the scheduler 111 clears the interrupt request flag and ends this process. Thereafter, processing other than the interrupt processing is executed in the VM to which the time slot is assigned.

また、タイムスロットを割り当てたメインのタスクがVMでない場合や(S230:No)、このVMに対応する割込み要求フラグがセットされていない場合(S235:No)には、スケジューラ111は、本処理を終了する。そして、以後、タイムスロットが割り当てられたタスクが実行される。   If the main task to which the time slot is assigned is not a VM (S230: No), or if an interrupt request flag corresponding to this VM is not set (S235: No), the scheduler 111 performs this process. finish. Thereafter, the task to which the time slot is assigned is executed.

尚、割込み処理とは、VMに対応する統合前のECUの制御プログラムにて用いられていた割込みハンドラに相当するサブルーチンであり、周辺デバイスからの割込み要求に応じてCPU11から直接コールされる割込みハンドラとは異なる処理であることを念のため付言しておく。   The interrupt processing is a subroutine corresponding to an interrupt handler used in the control program of the ECU before integration corresponding to the VM, and is an interrupt handler that is directly called from the CPU 11 in response to an interrupt request from a peripheral device. Note that this is a different process.

(3−3)サブのタスク開始処理について
また、上述したように、第一のVM120及び第二のVM130は、自発的に終了する場合があるが、タイムスロットを割り当てられたメインのタスクが自発的に終了すると、スケジューラ111は、サブのタスク開始処理を実行する。ここでは、サブのタスク開始処理について、図5に記載のフローチャートを用いて説明する。
(3-3) Sub-task start processing As described above, the first VM 120 and the second VM 130 may end spontaneously, but the main task to which the time slot is assigned is spontaneous. When the process ends, the scheduler 111 executes a sub task start process. Here, the sub task start processing will be described with reference to the flowchart shown in FIG.

S305では、スケジューラ111は、タイムスロット管理テーブルに基づき、終了したメインのタスクに対応するタイムスロットに、サブのタスクが登録されているか判定する。タイムスロット1,2,6,7のように、サブのタスクが登録されている場合には(S305:Yes)、S310に処理を移行する。また、サブのタスクが登録されていない場合には(S305:No)、本処理を終了する。   In S305, the scheduler 111 determines whether a sub task is registered in the time slot corresponding to the finished main task based on the time slot management table. When sub-tasks are registered as in time slots 1, 2, 6, and 7 (S305: Yes), the process proceeds to S310. If no sub task is registered (S305: No), this process is terminated.

S310では、スケジューラ111は、サブのタスクにタイムスロットの残り時間を割り当て、S315に処理を移行する。   In S310, the scheduler 111 assigns the remaining time of the time slot to the sub task, and shifts the processing to S315.

続いて、スケジューラ111は、タイムスロットを割り当てたサブのタスクがVMである場合(S315:Yes)、このVMに対応する割込み要求フラグがセットされているか否かを判定する(S320)。そして、このVMに対応する割込み要求フラグがセットされている場合(S320:Yes)、スケジューラ111は、CPU11に、このVMにおける、この割込み要求フラグに対応する割込み処理を実行させる(S325)。そして、この割込み処理の実行が終了すると、スケジューラ111は、上記割込み要求フラグをクリアし、本処理を終了する。そして、以後、タイムスロットが割り当てられたVMにおける、割込み処理以外の他の処理が実行される。   Subsequently, when the sub task to which the time slot is assigned is a VM (S315: Yes), the scheduler 111 determines whether or not an interrupt request flag corresponding to this VM is set (S320). If the interrupt request flag corresponding to this VM is set (S320: Yes), the scheduler 111 causes the CPU 11 to execute an interrupt process corresponding to this interrupt request flag in this VM (S325). Then, when the execution of this interrupt process is completed, the scheduler 111 clears the interrupt request flag and ends this process. Thereafter, processing other than the interrupt processing is executed in the VM to which the time slot is assigned.

また、タイムスロットを割り当てたサブのタスクがVMでない場合や(S315:No)、このVMに対応する割込み要求フラグがセットされていない場合(S320:No)には、スケジューラ111は、本処理を終了する。そして、以後、タイムスロットが割り当てられたタスクが実行される。   In addition, when the sub task to which the time slot is assigned is not a VM (S315: No), or when the interrupt request flag corresponding to this VM is not set (S320: No), the scheduler 111 performs this process. finish. Thereafter, the task to which the time slot is assigned is executed.

(3−4)割込み発生処理について
既に述べたが、統合ECU10は、第一〜第三のECUを統合したECUであり、第一〜第三のECUが備える機能を有している。また、第一〜第三のVMは、それぞれ、第一〜第三のECUのプログラムの一部を変更して作成されたプログラムである。そして、第一〜第三のECUのプログラムでは、周辺デバイスからの割込み要求が発生した際にCPUから直接コールされる割込みハンドラが用いられているが、第一〜第三のVMでは、この割込みハンドラに対応するサブルーチンが用いられている。
(3-4) Interrupt Generation Processing As already described, the integrated ECU 10 is an ECU that integrates the first to third ECUs, and has the functions of the first to third ECUs. The first to third VMs are programs created by changing a part of the programs of the first to third ECUs. The first to third ECU programs use an interrupt handler that is called directly from the CPU when an interrupt request from a peripheral device is generated. The first to third VMs use this interrupt handler. A subroutine corresponding to the handler is used.

統合ECU10では、周辺デバイスからCPU11に対して割込み要求が発生すると、割込みハンドラが実行される。この割込みハンドラでは、発生した割込み要求がどのVMに対応するものであるか特定し、対応するVMに対しての割込み要求フラグをセットすることにより、対応するVMに対して割込み要求を通知する。ここでは、周辺デバイスからの割込み要求が発生し、対応するVMに対しての割込み要求の通知がなされた直後にスケジューラ111が行なう処理である割込み発生処理について、図6に記載のフローチャートを用いて説明する。尚、周辺デバイスからCPU11に対して割込み要求が発生した際に統合制御プログラム100にて行われる処理については、後述する。   In the integrated ECU 10, when an interrupt request is generated from the peripheral device to the CPU 11, an interrupt handler is executed. This interrupt handler specifies which VM the generated interrupt request corresponds to, and sets an interrupt request flag for the corresponding VM to notify the corresponding VM of the interrupt request. Here, an interrupt generation process, which is a process performed by the scheduler 111 immediately after an interrupt request from a peripheral device is generated and an interrupt request is notified to the corresponding VM, is described with reference to the flowchart shown in FIG. explain. The processing performed in the integrated control program 100 when an interrupt request is generated from the peripheral device to the CPU 11 will be described later.

S405では、スケジューラ111は、第一〜第三のVMのうちのいずれかに対してタイムスロットが割り当てられているか判定する。そして、いずれかのVMにタイムスロットが割り当てられている場合には(S405:Yes)、S410に処理を移行し、いずれのVMにもタイムスロットが割り当てられていない場合には(S405:No)、本処理を終了する。尚、現在タイムスロットが割り当てられているVMのことを、実行中のVMとも記載する。   In S405, the scheduler 111 determines whether a time slot is assigned to any of the first to third VMs. If a time slot is assigned to any VM (S405: Yes), the process proceeds to S410, and if no time slot is assigned to any VM (S405: No). This process is terminated. Note that the VM to which the current time slot is allocated is also referred to as the VM being executed.

S410では、スケジューラ111は、実行中のVMは、タイムスロット管理テーブルにサブのタスクとして登録されているか判定する(尚、以後、タイムスロット管理テーブルにメインのタスクとして登録されているVMをメインのVMとも記載し、サブのタスクとして登録されているVMをサブのVMとも記載する)。そして、実行中のVMがサブのタスクとして登録されている場合には(S410:Yes)、発生した割込み要求が、実行中のサブのVMに対応するメインのVMに対応しているか判定する(S415)。発生した割込み要求がこのメインのVMに対応している場合には(S415:Yes)、スケジューラ111は、S420に処理を移行する。また、実行中のVMがサブのタスクでない場合や(S410:No)、発生した割込み要求が上記メインのVMに対応していない場合には(S415:No)、スケジューラ111は、S435に処理を移行する。   In S410, the scheduler 111 determines whether the running VM is registered as a sub task in the time slot management table (hereinafter, the VM registered as the main task in the time slot management table is the main task). VM is also described, and a VM registered as a sub task is also described as a sub VM). If the executing VM is registered as a sub task (S410: Yes), it is determined whether the generated interrupt request corresponds to the main VM corresponding to the executing sub VM ( S415). When the generated interrupt request corresponds to the main VM (S415: Yes), the scheduler 111 shifts the process to S420. If the VM being executed is not a sub task (S410: No), or if the generated interrupt request does not correspond to the main VM (S415: No), the scheduler 111 performs the process in S435. Transition.

S420では、スケジューラ111は、実行中のサブのVMに替えて、このサブのVMに対応するメインのVMにタイムスロットの残り時間を割り当て、このメインのVMにおける、発生した割込み要求に対応する割込み処理を実行する(S425)。そして、この割込み処理の実行が終了すると、対応する割込み要求フラグをクリアし、メインのVMに替えて、このメインのVMに対応するサブのVMにタイムスロットの残り時間を割り当てる(S430)。そして、S435に処理を移行する。   In S420, the scheduler 111 assigns the remaining time of the time slot to the main VM corresponding to this sub VM instead of the sub VM being executed, and the interrupt corresponding to the generated interrupt request in this main VM. The process is executed (S425). When the execution of the interrupt processing is completed, the corresponding interrupt request flag is cleared, and the remaining time of the time slot is assigned to the sub VM corresponding to the main VM instead of the main VM (S430). Then, the process proceeds to S435.

S435では、スケジューラ111は、発生した割込み要求が、実行中のVMに対応しているか判定する。発生した割込み要求が実行中のVMに対応している場合(S435:Yes)、実行中のVMにおける対応する割込み処理を実行する(S440)。そして、この割込み処理の実行が終了すると、対応する割込み要求フラグをクリアし、本処理を終了する。発生した割込みが実行中のVMに対応していない場合(S435:No)、本処理を終了する。   In S435, the scheduler 111 determines whether the generated interrupt request corresponds to the VM being executed. If the generated interrupt request corresponds to the VM being executed (S435: Yes), the corresponding interrupt processing in the VM being executed is executed (S440). When the execution of this interrupt process is completed, the corresponding interrupt request flag is cleared, and this process ends. If the generated interrupt does not correspond to the VM being executed (S435: No), this process ends.

(4)タイムスロットの利用状況について
次に、上述したタイムスロット割当処理やサブのタスク開始処理によりタイムスロットの割り当てを行った場合のタイムスロットの利用状況について説明する。尚、スケジューラ111は、図3に記載のタイムスロット管理テーブルに従いタイムスロットの割り当てを行うものとする。また、ここでは、わかりやすく説明するため、タイムスロット1〜3の利用状況については、図7に記載の説明図を用いて特に詳しく説明する。
(4) Time Slot Usage Status Next, the time slot usage status when time slot allocation is performed by the above-described time slot allocation processing or sub task start processing will be described. The scheduler 111 assigns time slots according to the time slot management table shown in FIG. Further, here, for easy understanding, the usage situation of the time slots 1 to 3 will be described in detail with reference to the explanatory diagram shown in FIG.

図7に記載されているように、タイムスロット1は、最初、メインのタスクである第一のVM120に割り当てられる。そして、タイムスロット1が割り当てられた後、100μsが経過する前に第一のVM120が自発的に停止すると、タイムスロット1の残り時間がサブのタスクである第三のVM140に割り当てられる。尚、第一のVM120が自発的に停止しなかった場合には、第三のVM140へのタイムスロット1の残り時間の割り当ては行なわれず、タイムスロット1は、全て、第一のVM120により消費される。   As described in FIG. 7, time slot 1 is initially assigned to the first VM 120, which is the main task. Then, after the time slot 1 is assigned, if the first VM 120 is voluntarily stopped before 100 μs elapses, the remaining time of the time slot 1 is assigned to the third VM 140 that is a sub task. If the first VM 120 does not stop spontaneously, the remaining time of the time slot 1 is not allocated to the third VM 140, and all the time slots 1 are consumed by the first VM 120. The

タイムスロット1が全て消費されると(換言すれば、タイムスロット1が第一のVM120に割り当てられた後100μsが経過すると)、タイムスロット2についての割り当てが行なわれる。タイムスロット2は、最初、メインのタスクである第二のVM130に割り当てられる。そして、タイムスロット2が割り当てられた後、100μsが経過する前に第二のVM130が自発的に停止すると、タイムスロット2の残り時間がサブのタスクである第三のVM140に割り当てられる。尚、第二のVM130が自発的に停止しなかった場合には、第三のVM140へのタイムスロット2の残り時間の割り当ては行なわれず、タイムスロット2は、全て、第二のVM130により消費される。   When time slot 1 is all consumed (in other words, 100 μs has elapsed after time slot 1 is assigned to first VM 120), assignment for time slot 2 is performed. Time slot 2 is initially assigned to the second VM 130 which is the main task. Then, after the time slot 2 is assigned, if the second VM 130 is voluntarily stopped before 100 μs elapses, the remaining time of the time slot 2 is assigned to the third VM 140 which is a sub task. If the second VM 130 does not stop spontaneously, the remaining time of the time slot 2 is not allocated to the third VM 140, and all the time slots 2 are consumed by the second VM 130. The

タイムスロット2が全て消費されると(換言すれば、タイムスロット2が第二のVM130に割り当てられた後100μsが経過すると)、タイムスロット3についての割り当てが行なわれる。タイムスロット3は、メインのタスクである第三のVM140に割り当てられる。第三のVM140は、自発的に停止することはないため、タイムスロット3は、全て第三のVM140により消費される。   When time slot 2 is all consumed (in other words, 100 μs has elapsed after time slot 2 has been assigned to second VM 130), assignment for time slot 3 is performed. Time slot 3 is assigned to the third VM 140 which is the main task. Since the third VM 140 does not stop spontaneously, all the time slots 3 are consumed by the third VM 140.

そして、タイムスロット4〜8に関しても、同様にして対応するタスクへの割り当てが行なわれる。   Similarly, time slots 4 to 8 are assigned to corresponding tasks.

尚、タイムスロット9に関しては、後述する仮想デバイス150に割り当てられ、この仮想デバイス150により全て消費される。   The time slot 9 is assigned to a virtual device 150 to be described later, and is all consumed by the virtual device 150.

また、タイムスロット管理テーブルにおいて、タイムスロット10に対応するタスクは登録されていないため、タイムスロット10の割り当てを行なうタイミングが到来しても、タイムスロット10の割り当ては行なわれない(つまり、どのタスクも実行されない)。そして、タイムスロット10の割り当てを行なうタイミングが到来した後、タイムスロット10に相当する時間(100μs)が経過すると、再度、タイムスロット1の割り当てが行なわれる。   In addition, since the task corresponding to the time slot 10 is not registered in the time slot management table, the time slot 10 is not assigned even when the timing for assigning the time slot 10 comes (that is, which task Is also not executed). Then, after the timing for assigning the time slot 10 arrives, the time slot 1 is assigned again when the time corresponding to the time slot 10 (100 μs) has elapsed.

(5)割込み処理の実行状況について
次に、割込み処理の実行状況について、図8に記載の説明図を用いて説明する。尚、スケジューラ111は、図3に記載のタイムスロット管理テーブルに従いタイムスロットの割り当てを行うものとする。また、この説明では、例としてA割込み,B割込み,C割込みが発生するものとしているが、A割込み,B割込みに関しては、第一〜第三のVMがそれぞれ対応する割込み処理を有しており、C割込みに関しては、第二,第三のVMがそれぞれ対応する割込み処理を有している。
(5) Execution Status of Interrupt Processing Next, the execution status of interrupt processing will be described with reference to the explanatory diagram shown in FIG. The scheduler 111 assigns time slots according to the time slot management table shown in FIG. In this description, an A interrupt, a B interrupt, and a C interrupt are generated as an example. However, for the A interrupt and the B interrupt, the first to third VMs have corresponding interrupt processes. As for the C interrupt, the second and third VMs have corresponding interrupt processing.

タイムスロット10に対応する期間においてA割込みが発生し、タイムスロット1がメインのタスクである第一のVM120に割り当てられると、最初に第一のVM120におけるA割込みに対応する割込み処理が実行され、次に、この割込み処理以外の他の処理が実行される。そして、第一のVM120が終了し、タイムスロット1の残り時間がサブのタスクである第三のVM140に割り当てられると、最初に第三のVM140におけるA割込みに対応する割込み処理が実行され、次に、この割込み処理以外の他の処理が実行される。   When an A interrupt occurs in the period corresponding to the time slot 10 and the time slot 1 is assigned to the first VM 120 as the main task, an interrupt process corresponding to the A interrupt in the first VM 120 is first executed. Next, processing other than this interrupt processing is executed. When the first VM 120 is finished and the remaining time of time slot 1 is assigned to the third VM 140, which is a sub task, interrupt processing corresponding to the A interrupt in the third VM 140 is executed first, and then In addition, processing other than this interrupt processing is executed.

続いてタイムスロット2がメインのタスクである第二のVM130に割り当てられると、最初に第二のVM130におけるA割込みに対応する割込み処理が実行され、次に、この割込み処理以外の他の処理が実行される。この割込み処理の実行によりA割込みに対応する割込み処理は全て実行済となり、A割込みに対応する割込み要求フラグは全てクリアされる。   Subsequently, when time slot 2 is assigned to the second VM 130, which is the main task, interrupt processing corresponding to the A interrupt in the second VM 130 is first executed, and then other processing than this interrupt processing is performed. Executed. By executing this interrupt process, all interrupt processes corresponding to the A interrupt have been executed, and all interrupt request flags corresponding to the A interrupt are cleared.

また、タイムスロット2がメインのタスクである第二のVM130に割り当てられている間にB割込みが発生すると、第二のVM130におけるB割込みに対応する割込み処理が実行される。この割込み処理が終了すると、第二のVM130におけるこの割込み処理以外の他の処理が実行される。そして、第二のVM130の実行が終了し、タイムスロット2の残り時間がサブのタスクである第三のVM140に割り当てられると、最初に第三のVM140におけるB割込みに対応する割込み処理が実行され、次に、この割込み処理以外の他の処理が実行される。   If a B interrupt occurs while time slot 2 is assigned to the second VM 130 as the main task, an interrupt process corresponding to the B interrupt in the second VM 130 is executed. When this interrupt processing is completed, processing other than this interrupt processing in the second VM 130 is executed. When the execution of the second VM 130 is finished and the remaining time of the time slot 2 is allocated to the third VM 140, which is a sub task, the interrupt process corresponding to the B interrupt in the third VM 140 is first executed. Next, processing other than this interrupt processing is executed.

続いてタイムスロット3〜5は、それぞれ、第三のVM140に割り当てられる。尚、第三のVM140はB割込みに対応している。しかし、第三のVM140におけるB割込みに対応する割込み処理はタイムスロット2が割り当てられている間に既に実行されたため、タイムスロット3〜5が第三のVM140に割り当てられている間に、この割込み処理が実行されることはない。   Subsequently, time slots 3 to 5 are assigned to the third VM 140, respectively. The third VM 140 corresponds to the B interrupt. However, since the interrupt process corresponding to the B interrupt in the third VM 140 has already been executed while the time slot 2 is allocated, this interrupt is performed while the time slots 3 to 5 are allocated to the third VM 140. Processing is never executed.

そして、タイムスロット6がメインのタスクである第一のVM120に割り当てられると、最初に第一のVM120におけるB割込みに対応する割込み処理が実行され、次に、この割込み処理以外の他の処理が実行される。この割込み処理の実行により、B割込みに対応する割込み処理は全て実行済となり、B割込みに対応する割込み要求フラグは全てクリアされる。そして、第一のVM120が終了すると、タイムスロット6の残り時間がサブのタスクである第三のVM140に割り当てられる。   Then, when the time slot 6 is assigned to the first VM 120 which is the main task, an interrupt process corresponding to the B interrupt in the first VM 120 is first executed, and then other processes other than this interrupt process are performed. Executed. By executing this interrupt process, all the interrupt processes corresponding to the B interrupt have been executed, and all the interrupt request flags corresponding to the B interrupt are cleared. When the first VM 120 ends, the remaining time of the time slot 6 is assigned to the third VM 140 that is a sub task.

続いてタイムスロット7は、メインのタスクである第二のVM130に割り当てられる。その後、第二のVM130が終了すると、タイムスロット7の残り時間がサブのタスクである第三のVM140に割り当てられる。サブのタスクである第三のVM140を実行中にC割込みが発生すると、第三のVM140に替えて、メインのタスクである第二のVM130にタイムスロットの残り時間が割り当てられ、第二のVM130におけるC割込みに対応する割込み処理が実行される。そして、この割込み処理の実行が終了すると、タイムスロット7の残り時間が再び第三のVM140に割り当てられ、第三のVM140におけるC割込みに対応する割込み処理が実行される。この割込み処理の実行により、C割込みに対応する割込み処理は全て実行済となり、C割込みに対応する割込み要求フラグは全てクリアされる。C割込みに対応する割込み処理が終了すると、第三のVM140における他の処理が実行される。   Subsequently, the time slot 7 is assigned to the second VM 130 which is the main task. Thereafter, when the second VM 130 ends, the remaining time of the time slot 7 is allocated to the third VM 140 which is a sub task. When a C interrupt occurs during execution of the third VM 140, which is a sub task, the remaining time of the time slot is allocated to the second VM 130, which is the main task, instead of the third VM 140, and the second VM 130 is assigned. Interrupt processing corresponding to the C interrupt in is executed. When the execution of this interrupt processing is completed, the remaining time of the time slot 7 is assigned again to the third VM 140, and the interrupt processing corresponding to the C interrupt in the third VM 140 is executed. By executing this interrupt process, all the interrupt processes corresponding to the C interrupt have been executed, and all the interrupt request flags corresponding to the C interrupt are cleared. When the interrupt process corresponding to the C interrupt is completed, another process in the third VM 140 is executed.

そして、タイムスロット8は、メインのタスクである第三のVM130に割り当てられ、タイムスロット9,10に関しては、第一〜第三のVMへの割り当ては行なわれない。また、タイムスロット1は、再び第一のVM120に割り当てられる。   The time slot 8 is assigned to the third VM 130 as the main task, and the time slots 9 and 10 are not assigned to the first to third VMs. Time slot 1 is again assigned to the first VM 120.

(6)仮想デバイスについて
次に、スケジューラ111におけるタスクの一つである仮想デバイス150について説明する。上述したように、この仮想デバイス150は、第一〜第三のVMと、統合ECU10におけるCPU11の周辺デバイスへとのI/Fとなる部位である。また、この仮想デバイス150は、図3に記載のタイムスロット管理テーブルでは、タイムスロット9に対応するメインのタスクとして設定されている。ここでは、一例として、仮想デバイス150におけるCANコントローラ14に対応する機能について説明する。
(6) Virtual Device Next, the virtual device 150 which is one of the tasks in the scheduler 111 will be described. As described above, the virtual device 150 is a part that is an I / F to the first to third VMs and peripheral devices of the CPU 11 in the integrated ECU 10. The virtual device 150 is set as a main task corresponding to the time slot 9 in the time slot management table shown in FIG. Here, as an example, a function corresponding to the CAN controller 14 in the virtual device 150 will be described.

第一のECU及び第二のECUはCANによる通信機能を有している。これらのECUのプログラムは、CANによる通信を制御するためのCANドライバを有しており、このCANドライバでは、統合前のECUにおけるCANコントローラを制御するためのレジスタへのIOアクセスが行われる。第一のVM120,第二のVM130は、統合前のプログラムにおけるCANドライバを流用した第一のCANドライバ122,第二のCANドライバ132をそれぞれ有している。仮想デバイス150は、第一のCANドライバ122や第二のCANドライバ132からCANコントローラ14への指令を受け付け、このCANコントローラ14を制御する機能を有している。   The first ECU and the second ECU have a CAN communication function. These ECU programs have a CAN driver for controlling communication by CAN. In this CAN driver, IO access to a register for controlling the CAN controller in the ECU before integration is performed. The first VM 120 and the second VM 130 respectively have a first CAN driver 122 and a second CAN driver 132 that use the CAN driver in the program before integration. The virtual device 150 has a function of receiving commands from the first CAN driver 122 and the second CAN driver 132 to the CAN controller 14 and controlling the CAN controller 14.

図9に記載のブロック図には仮想デバイス150の構成が記載されているが、仮想デバイス150は、第一の仮想CANドライバ151と、第二の仮想CANドライバ152と、デバイス調停機構153とを有している。   Although the configuration of the virtual device 150 is described in the block diagram illustrated in FIG. 9, the virtual device 150 includes a first virtual CAN driver 151, a second virtual CAN driver 152, and a device arbitration mechanism 153. Have.

第一の仮想CANドライバ151は、第一のVM120がCAN20による他のECUとの通信を行う際に、第一のCANドライバ122から、CANコントローラ14への指令を受け付ける部位である。   The first virtual CAN driver 151 is a part that receives a command from the first CAN driver 122 to the CAN controller 14 when the first VM 120 communicates with another ECU by the CAN 20.

また、第二の仮想CANドライバ152は、第二のVM130がCAN20による他のECUとの通信を行う際に、第二のCANドライバ132から、CANコントローラ14への指令を受け付ける部位である。   The second virtual CAN driver 152 is a part that receives a command from the second CAN driver 132 to the CAN controller 14 when the second VM 130 communicates with another ECU by the CAN 20.

また、デバイス調停機構153は、第一のCANドライバ122や第二のCANドライバ132からの指令に従い、CANコントローラ14を制御する部位である。   The device arbitration mechanism 153 is a part that controls the CAN controller 14 in accordance with commands from the first CAN driver 122 and the second CAN driver 132.

(6−2)データ送信処理について
次に、第一のVM120または第二のVM130が、CAN20を介して接続されている他のECUにデータを送信する場合の動作について、図10に記載のシーケンス図を用いて説明する。
(6-2) Data Transmission Processing Next, the sequence shown in FIG. 10 will be described for the operation when the first VM 120 or the second VM 130 transmits data to another ECU connected via the CAN 20. This will be described with reference to the drawings.

第一のVM120では、CAN20を介してデータ送信を行う場合には、第一のCANドライバ122がコールされる(S505)。   In the first VM 120, when data transmission is performed via the CAN 20, the first CAN driver 122 is called (S505).

第一のCANドライバ122は、第一のECUにおけるCPUの周辺デバイスであるCANコントローラに対応する形式で、CAN20を介しての送信要求と送信データの設定を行なう。このとき、第一のCANドライバ122から、仮想デバイス150における第一の仮想CANドライバ151がサブルーチンとしてコールされる(S510)。そして、第一の仮想CANドライバ151が、第一のECUにおけるCANコントローラに対応する形式でCAN20を介しての送信要求等を受け付けるのである。   The first CAN driver 122 sets a transmission request and transmission data via the CAN 20 in a format corresponding to a CAN controller that is a peripheral device of the CPU in the first ECU. At this time, the first virtual CAN driver 151 in the virtual device 150 is called as a subroutine from the first CAN driver 122 (S510). Then, the first virtual CAN driver 151 accepts a transmission request or the like via the CAN 20 in a format corresponding to the CAN controller in the first ECU.

このようにしてCAN20を介しての送信要求等を受け付けることにより、第一のECUにおけるプログラムを流用して第一のCANドライバ122とする際の変更規模を抑えることが可能となる。また、このとき、第一の仮想CANドライバ151は、例えば、第一のECUにおけるCANコントローラと同様にして、第一のCANドライバ122に対して応答を行っても良い。こうすることにより、第一のCANドライバ122は、第一のECUと同一の形式でCAN20を介してのデータ送信を行うことが可能となる。したがって、第一のECUにおけるプログラムを流用して第一のCANドライバ122とする際の変更規模をより抑えることが可能となる。   By accepting a transmission request or the like via the CAN 20 in this way, it is possible to suppress a change scale when the program in the first ECU is used as the first CAN driver 122. At this time, the first virtual CAN driver 151 may make a response to the first CAN driver 122 in the same manner as the CAN controller in the first ECU, for example. By doing so, the first CAN driver 122 can transmit data via the CAN 20 in the same format as the first ECU. Therefore, it is possible to further suppress the change scale when the program in the first ECU is used as the first CAN driver 122.

そして、第一の仮想CANドライバ151では、デバイス調停機構153に属するサブルーチンがコールされ(S515)、このサブルーチンにて、第一のCANドライバ122から受け付けた送信データがバッファされる。   Then, in the first virtual CAN driver 151, a subroutine belonging to the device arbitration mechanism 153 is called (S515), and transmission data received from the first CAN driver 122 is buffered in this subroutine.

第二のVM130においても、同様にしてCAN20を介してのデータ送信要求が行なわれる。第二のVM130では、CAN20を介してのデータ送信を行う場合には、第二のCANドライバ132がコールされる(S520)。   In the second VM 130, a data transmission request is similarly made via the CAN 20. In the second VM 130, when data transmission is performed via the CAN 20, the second CAN driver 132 is called (S520).

第二のCANドライバ132は、第二のECUにおけるCANコントローラに対応する形式で、CAN20を介しての送信要求と送信データの設定を行なう。このとき、第二のCANドライバ132から、仮想デバイス150における第二の仮想CANドライバ152がサブルーチンとしてコールされる(S525)。そして、第二の仮想CANドライバ152が、第二のECUにおけるCANコントローラに対応する形式でCAN20を介しての送信要求等を受け付けるのである。また、このとき、第二の仮想CANドライバ152は、例えば、第二のECUにおけるCANコントローラと同様にして、第二のCANドライバ132に対して応答を行っても良い。   The second CAN driver 132 sets a transmission request and transmission data via the CAN 20 in a format corresponding to the CAN controller in the second ECU. At this time, the second virtual CAN driver 152 in the virtual device 150 is called as a subroutine from the second CAN driver 132 (S525). Then, the second virtual CAN driver 152 accepts a transmission request or the like via the CAN 20 in a format corresponding to the CAN controller in the second ECU. At this time, for example, the second virtual CAN driver 152 may respond to the second CAN driver 132 in the same manner as the CAN controller in the second ECU.

そして、第二の仮想CANドライバ152では、デバイス調停機構153に属するサブルーチンがコールされ(S530)、このサブルーチンにて、第二のCANドライバ132から受け付けた送信データがバッファされる。   Then, the second virtual CAN driver 152 calls a subroutine belonging to the device arbitration mechanism 153 (S530), and the transmission data received from the second CAN driver 132 is buffered in this subroutine.

次に、タイムスロット9が仮想デバイス150に割り当てられ、仮想デバイス150の実行が開始されると、デバイス調停機構に属するサブルーチンがコールされる(S535)。このサブルーチンは、CANコントローラ14に対し、このCANコントローラ14に対応する形式で、第一のCANドライバ122等から受け取った送信データの送信を指示する。具体的には、CANコントローラ14にIOアクセスを行い(S540)、バッファされている送信データをCANコントローラ14の送信バッファにセットし、送信を指示する。   Next, when the time slot 9 is assigned to the virtual device 150 and the execution of the virtual device 150 is started, a subroutine belonging to the device arbitration mechanism is called (S535). This subroutine instructs the CAN controller 14 to transmit the transmission data received from the first CAN driver 122 or the like in a format corresponding to the CAN controller 14. Specifically, IO access is performed to the CAN controller 14 (S540), the buffered transmission data is set in the transmission buffer of the CAN controller 14, and transmission is instructed.

(6−2)データ受信時の動作について
次に、統合ECU10がCAN20を介して接続されている他のECUからデータを受信する場合の仮想デバイス150等の動作について、図11に記載のシーケンス図を用いて説明する。
(6-2) Operation at the time of data reception Next, an operation of the virtual device 150 and the like when the integrated ECU 10 receives data from another ECU connected via the CAN 20 is a sequence diagram shown in FIG. Will be described.

統合ECU10がCAN20を介して他のECUからデータを受信すると、CANコントローラ14は、CPU11に対して割込み要求を通知し(S605)、この割込み要求に対応する割込みハンドラ(以後、CAN受信割込みハンドラとも記載)がコールされる(S610)。尚、このCAN受信割込みハンドラは、仮想デバイス150におけるデバイス調停機構153に属するものである。   When the integrated ECU 10 receives data from another ECU via the CAN 20, the CAN controller 14 notifies the CPU 11 of an interrupt request (S605), and an interrupt handler corresponding to this interrupt request (hereinafter referred to as a CAN reception interrupt handler). (Description) is called (S610). This CAN reception interrupt handler belongs to the device arbitration mechanism 153 in the virtual device 150.

このCAN受信割込みハンドラでは、CANコントローラ14から受信データが取得される。そして、受信データが第一のVM120宛のデータである場合には、第一のCANドライバ122に属するサブルーチンがコールされる(S615)。このサブルーチンでは、第一のVM120に対してのCAN受信割込み要求フラグがセットされ、第一のECUにおけるCANコントローラと同様の形式で、第一のVM120に対してのデータ受信の通知や、受信データのバッファが行なわれる。また、受信したデータが第二のVM130宛のデータである場合にも同様に、第二のCANドライバ132に属するサブルーチンがコールされる(S620)。このサブルーチンでも、第二のVM130に対してのCAN受信割込み要求フラグがセットされ、第二のECUにおけるCANコントローラと同様の形式で、第二のVM130に対してのデータ受信の通知や、受信データのバッファが行なわれる。   In this CAN reception interrupt handler, reception data is acquired from the CAN controller 14. When the received data is data addressed to the first VM 120, a subroutine belonging to the first CAN driver 122 is called (S615). In this subroutine, the CAN reception interrupt request flag for the first VM 120 is set, and in the same format as the CAN controller in the first ECU, notification of data reception to the first VM 120 and received data Is buffered. Similarly, when the received data is data addressed to the second VM 130, a subroutine belonging to the second CAN driver 132 is called (S620). Even in this subroutine, the CAN reception interrupt request flag for the second VM 130 is set, and in the same format as the CAN controller in the second ECU, the data reception notification to the second VM 130 and the received data Is buffered.

[効果]
本実施形態の統合制御プログラム100におけるスケジューラ111では、タイムスロット1,6に対応付けて、リアルタイム性が要求される第一のVM120がメインのタスクとして登録されていると共に、リアルタイム性が要求されない第三のVM140がサブのタスクとして登録されている。また、タイムスロット2,7に対応付けて、リアルタイム性が要求される第二のVM130がメインのタスクとして登録されていると共に、第三のVM140がサブのタスクとして登録されている。そして、メインのタスクとして登録されている第一のVM120或いは第二のVM130が、自身に割り当てられたタイムスロットを全て消費することなく処理を終了した場合には、サブのタスクである第三のVM140に、このタイムスロットの残り時間が割り当てられる(S310)。したがって、スケジューラ111によれば、リアルタイム性が要求されない第三のVM140により実現される処理の停滞を抑えつつ、第一〜第三のVMをCPUに並行して実行させることができる。
[effect]
In the scheduler 111 in the integrated control program 100 of the present embodiment, the first VM 120 that requires real-time property is registered as the main task in association with the time slots 1 and 6, and real-time property is not required. Three VMs 140 are registered as sub tasks. In association with the time slots 2 and 7, the second VM 130 requiring real-time performance is registered as a main task, and the third VM 140 is registered as a sub task. When the first VM 120 or the second VM 130 registered as the main task finishes the processing without consuming all the time slots allocated to itself, the third task which is the sub task The remaining time of this time slot is allocated to the VM 140 (S310). Therefore, according to the scheduler 111, the first to third VMs can be executed in parallel with the CPU while suppressing the stagnation of processing realized by the third VM 140 that does not require real-time performance.

また、スケジューラ111では、実行中のVMに対応する割込み要求が発生した場合には、このVMにおける、発生した割込み要求に対応する割込み処理が実行される(S440)。したがって、VMが有している割込み処理を確実に実行することができる。このため、統合前のECUの制御プログラムに割込みハンドラが用いられている場合であっても、この割込みハンドラが流用されたVMを処理単位とすることができる。このため、複数のECUの制御プログラムを一つに統合する際の変更規模の増加を抑えることができる。   Further, when an interrupt request corresponding to the VM being executed is generated, the scheduler 111 executes an interrupt process corresponding to the generated interrupt request in this VM (S440). Therefore, the interrupt process possessed by the VM can be reliably executed. For this reason, even if an interrupt handler is used in the control program of the ECU before integration, the VM in which this interrupt handler is diverted can be used as a processing unit. For this reason, the increase in the change scale at the time of integrating the control program of several ECU into one can be suppressed.

尚、この割込み処理の実行に関しては、例外が存在する。具体的には、サブのVMを実行中に、このサブのVMに対応するメインのVMに対しての割込み要求が発生した場合には、サブのVMの実行を中断し、メインのVMにおける、上記割込み要求に対応する割込み処理が実行される(S425)。そして、この割込み要求がサブのVMに対応している場合には、メインのVMにおける割込み処理が終了した後に、サブのVMにおける割込み処理が実行されるのである(S440)。このため、優先的にメインのVMにおける割込み処理を実行することができる。したがって、メインのVMをサブのVMに対してより優先的に実行することができ、メインのVMのリアルタイム性をより確実なものとすることができる。   There is an exception regarding the execution of this interrupt processing. Specifically, when an interrupt request for the main VM corresponding to the sub VM occurs during execution of the sub VM, the execution of the sub VM is interrupted, and the main VM Interrupt processing corresponding to the interrupt request is executed (S425). If this interrupt request corresponds to the sub VM, the interrupt process in the sub VM is executed after the interrupt process in the main VM is completed (S440). For this reason, it is possible to preferentially execute interrupt processing in the main VM. Therefore, the main VM can be preferentially executed with respect to the sub VM, and the real-time property of the main VM can be further ensured.

また、スケジューラ111では、割込み要求が発生した状態で、この割込み要求に対応するVMにタイムスロットが割り当てられると、最初に、このVMにおける、この割込み要求に対応する割込み処理が実行される(S240,S325)。したがって、発生した割込み要求に対応する割込み処理を速やかに実行することができる。   In addition, when a time slot is allocated to the VM corresponding to the interrupt request in the state where the interrupt request is generated, the scheduler 111 first executes an interrupt process corresponding to the interrupt request in the VM (S240). , S325). Therefore, the interrupt process corresponding to the generated interrupt request can be promptly executed.

また、本実施形態の統合制御プログラム100では、仮想デバイス150は、第一のVM120から、統合前のECUである第一のECUと同様の形式でCANコントローラ14への指示を受け付ける第一の仮想CANドライバ151を有していると共に、第二のVM130から、統合前のECUである第二のECUと同様の形式でCANコントローラ14への指示を受け付ける第二の仮想CANドライバ152を有している。また、統合制御プログラム100では、第一のVM120に対し、第一のECUと同様の形式で、CANコントローラ14が受信したデータの提供が行なわれると共に、第二のVM130に対し、第二のECUと同様の形式で、CANコントローラ14が受信したデータの提供が行なわれる。このため、第一のECUの制御プログラムに基づき第一のVM120を作成する際、第一のECUの制御プログラムにおけるCANドライバを流用することが可能となる。また、同様にして、第二のECUの制御プログラムに基づき第二のVM130を作成する際、第二のECUの制御プログラムにおけるCANドライバを流用することが可能となる。つまり、第一のECUの制御プログラムや第二のECUの制御プログラムを統合する際の変更規模の増加を抑えることができるのである。   Further, in the integrated control program 100 of the present embodiment, the virtual device 150 receives the instruction from the first VM 120 in the same format as the first ECU, which is the ECU before integration, to the CAN controller 14. It has a CAN driver 151 and a second virtual CAN driver 152 that receives instructions from the second VM 130 to the CAN controller 14 in the same format as the second ECU that is the ECU before integration. Yes. In the integrated control program 100, the data received by the CAN controller 14 is provided to the first VM 120 in the same format as the first ECU, and the second ECU 130 is provided to the second VM 130. The data received by the CAN controller 14 is provided in the same format. For this reason, when creating the first VM 120 based on the control program of the first ECU, the CAN driver in the control program of the first ECU can be diverted. Similarly, when the second VM 130 is created based on the control program of the second ECU, the CAN driver in the control program of the second ECU can be used. That is, it is possible to suppress an increase in change scale when the control program for the first ECU and the control program for the second ECU are integrated.

[他の実施形態]
(1)本実施形態では、第一〜第三のVMと、仮想デバイス150とがスケジューラ111の四つがタスクとして登録されているが、スケジューラ111に登録されるタスクの数は四つに限定されるものではない。また、本実施形態では、仮想デバイス150は、メインのタスクとしてタイムスロット9に割り当てられているが、サブのタスクとしてタイムスロットに割り当てられていても良い。また、VM等に替えて、例えば、外部装置を制御するためのアプリケーション等をタスクとしても良い。このような構成を有する場合であっても、同様の効果を得ることができる。
[Other Embodiments]
(1) In this embodiment, the first to third VMs and the virtual device 150 have four schedulers 111 registered as tasks, but the number of tasks registered in the scheduler 111 is limited to four. It is not something. In this embodiment, the virtual device 150 is assigned to the time slot 9 as a main task, but may be assigned to a time slot as a sub task. Further, instead of a VM or the like, for example, an application or the like for controlling an external device may be used as a task. Even if it has such a structure, the same effect can be acquired.

(2)本実施形態のスケジューラ111では、一つのタイムスロットに対し、第一〜第三のVMのうちのいずれか一つがサブのタスクとして登録されている。しかし、一つのタイムスロットに対し、第一〜第三のVM、或いは仮想デバイス150のうちの複数をサブのタスクとして登録可能とし、この複数のVM等に優先順位を設定しても良い。そして、メインのタスクの実行が終了すると、サブのタスクとして登録されている複数のVM等のうち、優先順位の高いVM等から順に、タイムスロットの残り時間を割り当てても良い。このような構成を有する場合であっても、リアルタイム性が要求されないタスクにより実現される処理の停滞を抑えつつ、リアルタイム性が要求されるタスクとリアルタイム性が要求されないタスクをCPUに並行して実行させることができる。   (2) In the scheduler 111 of this embodiment, one of the first to third VMs is registered as a sub task for one time slot. However, a plurality of the first to third VMs or the virtual device 150 may be registered as sub tasks for one time slot, and priority may be set for the plurality of VMs. When the execution of the main task is completed, the remaining time of the time slot may be allocated in order from the VM with the highest priority among the VMs registered as sub tasks. Even in such a configuration, a task that requires real-time performance and a task that does not require real-time performance are executed in parallel with the CPU while suppressing stagnation of processing realized by tasks that do not require real-time performance. Can be made.

[特許請求の範囲との対応]
上記実施形態の説明で用いた用語と、特許請求の範囲の記載に用いた用語との対応を示す。
[Correspondence with Claims]
The correspondence between the terms used in the description of the above embodiment and the terms used in the description of the claims is shown.

保護機能付きRTOS110及び仮想デバイス150が基本プログラムに相当する。また、保護機能付きRTOS110によるスケジューリングの対象となるタスクが処理単位に相当する。また、第一のVM120,第二のVM130が、それぞれ、リアルタイム処理単位に相当し、第三のVM140が非リアルタイム処理単位に相当する。また、第一のVM120,第二のVM130,第三のVM140が、それぞれ、割込み対応処理単位に相当する。また、タイムスロット管理テーブルがタイムスロットデータに相当する。   The RTOS 110 with protection function and the virtual device 150 correspond to a basic program. Further, a task to be scheduled by the RTOS 110 with protection function corresponds to a processing unit. The first VM 120 and the second VM 130 each correspond to a real-time processing unit, and the third VM 140 corresponds to a non-real-time processing unit. Further, the first VM 120, the second VM 130, and the third VM 140 each correspond to an interrupt processing unit. The time slot management table corresponds to time slot data.

また、統合ECU10が制御装置に相当し、第一〜第三のECUが、それぞれ、他の装置に相当する。また、統合ECU10におけるCANコントローラ14が自装置の周辺デバイスに、第一,第二のECUにおけるCANコントローラが、それぞれ、他の装置の周辺デバイスに相当する。   The integrated ECU 10 corresponds to a control device, and the first to third ECUs correspond to other devices, respectively. Further, the CAN controller 14 in the integrated ECU 10 corresponds to a peripheral device of the own apparatus, and the CAN controllers in the first and second ECUs correspond to peripheral devices of other apparatuses, respectively.

また、タイムスロット割当処理におけるS225が第一のステップに、S240が第八のステップにそれぞれ相当する。また、サブのタスク開始処理におけるS310が第二のステップに、S325が第八のステップにそれぞれ相当する。また、割込み発生処理のS440が第七のステップに、S425が第九のステップにそれぞれ相当する。   In the time slot allocation process, S225 corresponds to the first step, and S240 corresponds to the eighth step. In the sub task start process, S310 corresponds to the second step, and S325 corresponds to the eighth step. Further, S440 of the interrupt generation process corresponds to the seventh step, and S425 corresponds to the ninth step.

また、図10に記載のシーケンス図におけるS510及びS515,S525及びS530が、それぞれ、第三のステップに相当し、S535が第四のステップに相当する。また、図11に記載のシーケンス図におけるS610が第五のステップに相当し、S615,S620が、それぞれ、第六のステップに相当する。   Further, S510, S515, S525, and S530 in the sequence diagram shown in FIG. 10 correspond to the third step, and S535 corresponds to the fourth step. Further, S610 in the sequence diagram shown in FIG. 11 corresponds to the fifth step, and S615 and S620 each correspond to the sixth step.

10…統合ECU、11…CPU、12…ROM、13…RAM、14…CANコントローラ、15…内部バス、20…CAN、100…統合制御プログラム、110…保護機能付きRTOS、111…スケジューラ、120…第一のVM、121…AUTOSAR、122…第一のCANドライバ、130…第二のVM、131…OSEK、132…第二のCANドライバ、140…第三のVM、141…Linux、150…仮想デバイス、151…第一の仮想CANドライバ、152…第二の仮想CANドライバ、153…デバイス調停機構。 DESCRIPTION OF SYMBOLS 10 ... Integrated ECU, 11 ... CPU, 12 ... ROM, 13 ... RAM, 14 ... CAN controller, 15 ... Internal bus, 20 ... CAN, 100 ... Integrated control program, 110 ... RTOS with protection function, 111 ... Scheduler, 120 ... 1st VM, 121 ... AUTOSAR, 122 ... 1st CAN driver, 130 ... 2nd VM, 131 ... OSEK, 132 ... 2nd CAN driver, 140 ... 3rd VM, 141 ... Linux, 150 ... virtual Device 151... First virtual CAN driver 152. Second virtual CAN driver 153.

Claims (9)

複数の処理単位のうちのいずれかに対して予め設定されたタイミングでタイムスロットを割り当てることにより、これらの前記処理単位をCPUに並行して実行させる基本プログラムであって、
前記処理単位として、外部からの入力に対し予め設定された時間内での応答が可能であるという性質であるリアルタイム性が要求されるリアルタイム処理単位と、前記リアルタイム性が要求されない非リアルタイム処理単位とが存在し、前記非リアルタイム処理単位は、いずれかの前記リアルタイム処理単位に対応付けられており、
前記基本プログラムは、前記処理単位に対して前記タイムスロットを割り当てるタイミングを示すデータであるタイムスロットデータを有しており、
前記基本プログラムは、
前記タイムスロットデータに基づき、前記リアルタイム処理単位に前記タイムスロットを割り当てる第一のステップと、
前記第一のステップにて割り当てられた前記タイムスロットを使い切ることなく、前記リアルタイム処理単位が終了した場合には、該リアルタイム処理単位に替えて、該リアルタイム処理単位に対応付けられている前記非リアルタイム処理単位に、該タイムスロットの残り時間を割り当てる第二のステップと、
を有すること、
を特徴とする基本プログラム。
A basic program for causing a CPU to execute these processing units in parallel by assigning time slots at a preset timing to any of a plurality of processing units,
As the processing unit, a real-time processing unit that requires a real-time property that is capable of responding to an external input within a preset time, and a non-real-time processing unit that does not require the real-time property, And the non-real-time processing unit is associated with any of the real-time processing units,
The basic program has time slot data which is data indicating timing for assigning the time slot to the processing unit,
The basic program is
A first step of assigning the time slot to the real-time processing unit based on the time slot data;
When the real-time processing unit is completed without using up the time slot allocated in the first step, the non-real-time associated with the real-time processing unit is replaced with the real-time processing unit. A second step of assigning the remaining time of the time slot to a processing unit;
Having
Basic program characterized by
請求項1に記載の基本プログラムにおいて、
前記リアルタイム処理単位は、複数の前記非リアルタイム処理単位に対応付けられており、該リアルタイム処理単位に対応する前記非リアルタイム処理単位には、優先順位が設定されており、
前記第二のステップにおいて、前記リアルタイム処理単位に対応する前記非リアルタイム処理単位のうち、優先順位の高い前記非リアルタイム処理単位から順に前記タイムスロットの残り時間を割り当てること、
を特徴とする基本プログラム。
In the basic program according to claim 1,
The real-time processing unit is associated with a plurality of the non-real-time processing units, and a priority order is set for the non-real-time processing units corresponding to the real-time processing units.
In the second step, among the non-real-time processing units corresponding to the real-time processing unit, allocating the remaining time of the time slot in order from the non-real-time processing unit having a higher priority,
Basic program characterized by
請求項1または請求項2に記載の基本プログラムにおいて、
前記処理単位のうちの少なくとも一つは、前記基本プログラムが搭載される装置とは異なる他の装置の制御プログラムに基づく処理単位であるVM(Virtual Machine Programの略)であること、
を特徴とする基本プログラム。
In the basic program according to claim 1 or 2,
At least one of the processing units is a VM (abbreviation of Virtual Machine Program) which is a processing unit based on a control program of another device different from the device on which the basic program is installed.
Basic program characterized by
請求項3に記載の基本プログラムにおいて、
前記VMは、前記他の装置におけるCPUの周辺デバイスであって、前記基本プログラムが搭載される装置におけるCPUにおける周辺デバイスである自装置の周辺デバイスと同一の用途にて用いられる周辺デバイスである他の装置の周辺デバイスを制御するための処理を有しており、
前記自装置の周辺デバイスには、前記他の装置の周辺デバイスとは異なる形式で指示を行う必要があり、
前記基本プログラムは、
それぞれの前記VMから、前記他の装置の周辺デバイスへの指示と同様の形式で、前記自装置の周辺デバイスに対しての指示を受け付ける第三のステップと、
前記第三のステップにて受け付けた指示を、前記自装置の周辺デバイスに対応する形式に変換し、該自装置の周辺デバイスに対しての制御を行う第四のステップと、
をさらに有すること、
を特徴とする基本プログラム。
In the basic program according to claim 3,
The VM is a peripheral device of the CPU in the other device, and is a peripheral device used in the same application as the peripheral device of the own device that is a peripheral device in the CPU in the device in which the basic program is installed. A process for controlling peripheral devices of the apparatus of
It is necessary to give instructions to the peripheral device of the own device in a format different from the peripheral device of the other device,
The basic program is
A third step of receiving an instruction to the peripheral device of the own apparatus from each VM in a format similar to an instruction to the peripheral device of the other apparatus;
A fourth step of converting the instruction received in the third step into a format corresponding to the peripheral device of the own device, and controlling the peripheral device of the own device;
Further having
Basic program characterized by
請求項4に記載の基本プログラムにおいて、
前記基本プログラムは、
前記自装置の周辺デバイスから提供されるデータを取得する第五のステップと、
前記第五のステップにて取得したデータを、該自装置の周辺デバイスに対応する前記他の装置の周辺デバイスを制御する処理を有する前記VMに対し、該他の装置の周辺デバイスに対応する形式で提供する第六のステップと、
をさらに有すること、
を特徴とする基本プログラム。
In the basic program according to claim 4,
The basic program is
A fifth step of acquiring data provided from a peripheral device of the device;
A format corresponding to the peripheral device of the other apparatus with respect to the VM having the process of controlling the peripheral device of the other apparatus corresponding to the peripheral device of the own apparatus with respect to the data acquired in the fifth step The sixth step to provide in,
Further having
Basic program characterized by
請求項1から請求項5のいずれかに記載の基本プログラムにおいて、
前記処理単位として、所定の割込みに対応する割込み処理を有している割込み対応処理単位が存在し、
前記基本プログラムは、前記割込み対応処理単位に対し、前記タイムスロット、または、前記タイムスロットの残り時間が割り当てられている間に、該割込み対応処理単位に対応する前記所定の割込みが発生すると、該所定の割込みに対応する前記割込み処理を実行する第七のステップをさらに有すること、
を特徴とする基本プログラム。
In the basic program according to any one of claims 1 to 5,
As the processing unit, there is an interrupt processing unit having an interrupt processing corresponding to a predetermined interrupt,
When the predetermined interrupt corresponding to the interrupt corresponding processing unit is generated while the time slot or the remaining time of the time slot is allocated to the interrupt corresponding processing unit, Further comprising a seventh step of executing the interrupt processing corresponding to a predetermined interrupt;
Basic program characterized by
請求項6に記載の基本プログラムにおいて、
前記所定の割込みが発生した後、該所定の割込みに対応する前記割込み対応処理単位に対して前記タイムスロット、または、前記タイムスロットの残り時間が割り当てられると、該所定の割込みに対応する前記割込み処理を実行する第八のステップをさらに有すること、
を特徴とする基本プログラム。
In the basic program according to claim 6,
After the predetermined interrupt occurs, when the time slot or the remaining time of the time slot is allocated to the interrupt corresponding processing unit corresponding to the predetermined interrupt, the interrupt corresponding to the predetermined interrupt Further comprising an eighth step of performing the process;
Basic program characterized by
請求項6または請求項7に記載の基本プログラムにおいて、
前記第一のステップにおいて前記タイムスロットが割り当てられる前記リアルタイム処理単位をメインの処理単位とすると共に、前記第二のステップにおいて、該第一のステップにて前記メインの処理単位に割り当てられた前記タイムスロットの残り時間が割り当てられる前記非リアルタイム処理単位をサブの処理単位とし、
前記基本プログラムは、前記メインの処理単位が前記割込み対応処理単位である場合において、前記サブの処理単位に前記タイムスロットの残り時間が割り当てられている間に、該メインの処理単位に対応する前記所定の割込みが発生すると、前記第七のステップに先立ち、該メインの処理単位である前記割込み対応処理単位が有する前記割込み処理を実行する第九のステップをさらに有すること、
を特徴とする基本プログラム。
In the basic program according to claim 6 or 7,
The real-time processing unit to which the time slot is allocated in the first step is set as a main processing unit, and in the second step, the time allocated to the main processing unit in the first step. The non-real-time processing unit to which the remaining time of the slot is assigned is a sub-processing unit,
In the case where the main processing unit is the interrupt handling processing unit, the basic program corresponds to the main processing unit while the remaining time of the time slot is allocated to the sub processing unit. When a predetermined interrupt occurs, prior to the seventh step, further comprising a ninth step of executing the interrupt processing included in the interrupt corresponding processing unit which is the main processing unit,
Basic program characterized by
請求項1から請求項8のいずれかに記載の基本プログラムに従い処理を行うコンピュータを備える制御装置。   A control apparatus provided with the computer which performs a process according to the basic program in any one of Claims 1-8.
JP2009012055A 2009-01-22 2009-01-22 Program and control device Active JP4985662B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009012055A JP4985662B2 (en) 2009-01-22 2009-01-22 Program and control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009012055A JP4985662B2 (en) 2009-01-22 2009-01-22 Program and control device

Publications (2)

Publication Number Publication Date
JP2010170320A true JP2010170320A (en) 2010-08-05
JP4985662B2 JP4985662B2 (en) 2012-07-25

Family

ID=42702419

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009012055A Active JP4985662B2 (en) 2009-01-22 2009-01-22 Program and control device

Country Status (1)

Country Link
JP (1) JP4985662B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8595746B2 (en) 2009-11-09 2013-11-26 Denso Corporation Method and apparatus for scheduling tasks to control hardware devices
WO2020261519A1 (en) * 2019-06-27 2020-12-30 三菱電機株式会社 Electronic control unit and program
US10897426B2 (en) 2013-09-30 2021-01-19 Mitsubishi Electric Corporation Reception apparatus and communication apparatus
WO2022102383A1 (en) * 2020-11-13 2022-05-19 住友電装株式会社 Onboard ecu, program, and information processing method
WO2022196322A1 (en) * 2021-03-18 2022-09-22 株式会社オートネットワーク技術研究所 In-vehicle apparatus, information processing method, and computer program
WO2024070015A1 (en) * 2022-09-27 2024-04-04 日立Astemo株式会社 Electronic control device, vehicle control system, and task control method

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107656855B (en) * 2016-07-26 2020-06-30 佛山市顺德区顺达电脑厂有限公司 System and method for reminding user of misplacing CPU

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000330806A (en) * 1999-05-21 2000-11-30 Hitachi Ltd Computer system
JP2003271399A (en) * 2002-01-09 2003-09-26 Matsushita Electric Ind Co Ltd Processor and program executing method
JP2007509387A (en) * 2003-09-30 2007-04-12 ジャルナ エスアー operating system
JP2007109109A (en) * 2005-10-14 2007-04-26 Matsushita Electric Ind Co Ltd Medium processor
JP2008262419A (en) * 2007-04-12 2008-10-30 Toyota Motor Corp Information processor, operating system selection method and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000330806A (en) * 1999-05-21 2000-11-30 Hitachi Ltd Computer system
JP2003271399A (en) * 2002-01-09 2003-09-26 Matsushita Electric Ind Co Ltd Processor and program executing method
JP2007509387A (en) * 2003-09-30 2007-04-12 ジャルナ エスアー operating system
JP2007109109A (en) * 2005-10-14 2007-04-26 Matsushita Electric Ind Co Ltd Medium processor
JP2008262419A (en) * 2007-04-12 2008-10-30 Toyota Motor Corp Information processor, operating system selection method and program

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8595746B2 (en) 2009-11-09 2013-11-26 Denso Corporation Method and apparatus for scheduling tasks to control hardware devices
US10897426B2 (en) 2013-09-30 2021-01-19 Mitsubishi Electric Corporation Reception apparatus and communication apparatus
WO2020261519A1 (en) * 2019-06-27 2020-12-30 三菱電機株式会社 Electronic control unit and program
JPWO2020261519A1 (en) * 2019-06-27 2021-11-18 三菱電機株式会社 Electronic control unit and program
WO2022102383A1 (en) * 2020-11-13 2022-05-19 住友電装株式会社 Onboard ecu, program, and information processing method
JP7468308B2 (en) 2020-11-13 2024-04-16 住友電装株式会社 On-vehicle ECU, program, and information processing method
WO2022196322A1 (en) * 2021-03-18 2022-09-22 株式会社オートネットワーク技術研究所 In-vehicle apparatus, information processing method, and computer program
WO2024070015A1 (en) * 2022-09-27 2024-04-04 日立Astemo株式会社 Electronic control device, vehicle control system, and task control method

Also Published As

Publication number Publication date
JP4985662B2 (en) 2012-07-25

Similar Documents

Publication Publication Date Title
JP4985662B2 (en) Program and control device
JP2011028559A (en) Relay program and electronic control device
JP5324934B2 (en) Information processing apparatus and information processing method
US9858115B2 (en) Task scheduling method for dispatching tasks based on computing power of different processor cores in heterogeneous multi-core processor system and related non-transitory computer readable medium
CN101452404B (en) Task scheduling apparatus and method for embedded operating system
Masrur et al. VM-based real-time services for automotive control applications
US11416293B2 (en) Control unit having a scheduler for scheduling a plurality of virtual machines, and methods for scheduling a plurality of virtual machines
US20150121387A1 (en) Task scheduling method for dispatching tasks based on computing power of different processor cores in heterogeneous multi-core system and related non-transitory computer readable medium
JPH0659906A (en) Method for controlling execution of parallel
CN101414270A (en) Method for implementing assist nuclear task dynamic PRI scheduling with hardware assistant
US9367349B2 (en) Multi-core system and scheduling method
Negrean et al. Response-time analysis for non-preemptive scheduling in multi-core systems with shared resources
US10853133B2 (en) Method and apparatus for scheduling tasks to a cyclic schedule
JP2013003724A (en) In-vehicle electronic control unit
JP5726006B2 (en) Task and resource scheduling apparatus and method, and control apparatus
EP3121716A1 (en) Method and apparatus for hosting a multitasking guest on a host system
CN111831406A (en) Multi-task scheduling method and device based on vehicle-mounted embedded system
CN112817762A (en) Dispatching system based on adaptive automobile open system architecture standard and dispatching method thereof
JP2011170619A (en) Multithread processor
Munk et al. Position paper: Real-time task migration on many-core processors
US8095695B2 (en) Control apparatus for process input-output device
JP2013152636A (en) Information processing device and task scheduling method
JP5447666B2 (en) Multiprocessor system and scheduling method
JP2005327007A (en) Integrated computer control program, recording medium for recording its program and integrated system
Dasari et al. Applying Reservation-based Scheduling to a μC-based Hypervisor: An industrial case study

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100603

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110826

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110906

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111031

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120403

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120416

R151 Written notification of patent or utility model registration

Ref document number: 4985662

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150511

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250