JP2008276674A - Electronic computer capable of specifying execution time of task, and program for electronic computer - Google Patents

Electronic computer capable of specifying execution time of task, and program for electronic computer Download PDF

Info

Publication number
JP2008276674A
JP2008276674A JP2007122195A JP2007122195A JP2008276674A JP 2008276674 A JP2008276674 A JP 2008276674A JP 2007122195 A JP2007122195 A JP 2007122195A JP 2007122195 A JP2007122195 A JP 2007122195A JP 2008276674 A JP2008276674 A JP 2008276674A
Authority
JP
Japan
Prior art keywords
task
execution
time
storage medium
cpu
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.)
Withdrawn
Application number
JP2007122195A
Other languages
Japanese (ja)
Inventor
Daisuke Tokumochi
大輔 徳持
Takahiko Mori
貴彦 森
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 JP2007122195A priority Critical patent/JP2008276674A/en
Priority to US12/149,685 priority patent/US20080282248A1/en
Priority to DE102008022302A priority patent/DE102008022302A1/en
Publication of JP2008276674A publication Critical patent/JP2008276674A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3419Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/865Monitoring of software

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To surely specify an execution time of a task, even when the execution time of the task is very short, and to prevent an error from being generated in calculation of the execution time by other processing, in a technique for specifying the execution time of the task. <P>SOLUTION: The task assigned preliminarily is collated with the task to start an execution, a time when started is recorded when starting the execution task, when those are consistent each other, and a difference between a time when finished and the time when started is recorded as the execution time, when finishing the execution task. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、複数のタスクのうちからCPUが実行する対象のタスクを切り替えることができると共に、タスクの実行時間を特定することのできる電子計算装置、および当該電子計算装置用のプログラムに関する。   The present invention relates to an electronic computing device that can switch a task to be executed by a CPU from among a plurality of tasks and that can specify an execution time of the task, and a program for the electronic computing device.

従来、複数のタスクのうちから実行する対象のタスクを切り替えるCPUにおける、タスクの実行時間を特定する技術が種々知られている。タスクの実行時間を特定する方法としては、例えば、タスクの実行開始時にRAMの所定のフラグを1にし、タスクの実行終了時に当該フラグを0にする処理を、タスクの実行がある度に繰り返し、そのフラグの変化を、外部の装置であるRAMモニタで定期的にチェックする方法がある。このような方法を用いれば、ある期間におけるRAMが1であった期間の割合から、CPUのタスク実行率、すなわちCPUの利用率を特定することができる。   Conventionally, various techniques for specifying task execution time in a CPU that switches a target task to be executed from among a plurality of tasks are known. As a method for specifying the task execution time, for example, a process of setting a predetermined flag in the RAM at the start of task execution and setting the flag to 0 at the end of task execution is repeated each time the task is executed, There is a method of periodically checking the change of the flag with a RAM monitor which is an external device. By using such a method, the task execution rate of the CPU, that is, the usage rate of the CPU can be specified from the ratio of the period in which the RAM is 1 in a certain period.

また、タスクの実行時間を特定する方法として、特許文献1、2に記載されているようなものがある。この方法では、CPUが、通常のタスクが実行されていない時間にアイドルタスクを実行し、そのアイドルタスク中で定期的にカウンタ値を増加させるようになっている。これによって、ある期間内におけるカウンタの増加量から、当該期間において通常のタスクが実行されていない時間の比率を算出することができ、さらにこれに基づいて、通常のタスクが実行されている時間の比率を算出することができる。
特開平5−40651号公報 特許第3376096号公報
Further, methods for specifying the task execution time include those described in Patent Documents 1 and 2. In this method, the CPU executes an idle task at a time when a normal task is not executed, and periodically increases the counter value in the idle task. As a result, the ratio of the time during which the normal task is not executed in the period can be calculated from the increment of the counter within a certain period. The ratio can be calculated.
JP-A-5-40651 Japanese Patent No. 3376096

しかし、上述のようなRAMモニタを用いる方法では、タスクの実行開始から実行終了までの時間が、RAMモニタのチェック間隔よりも短くなると、そのタスクの実行があったことを検出できなくなり、結果として、タスクの実行時間の算出結果が不正確なものになってしまう。   However, in the method using the RAM monitor as described above, if the time from the start of execution of the task to the end of execution becomes shorter than the check interval of the RAM monitor, it cannot be detected that the task has been executed, and as a result The calculation result of the task execution time will be inaccurate.

また、アイドルタスク中にカウンタ値を増加させる方法では、アイドルタスク中に他の処理(例えば記憶媒体の診断処理)を行うと、その処理によってカウンタ値を増加させる処理の実行タイミングに影響が及び、結果としてカウンタ値の増加レートが一定でなくなってしまう可能性がある。カウンタ値の増加レートが一定でなくなれば、タスクの実行時間の算出結果が不正確なものになってしまう。   Further, in the method of increasing the counter value during the idle task, if other processing (for example, storage medium diagnosis processing) is performed during the idle task, the execution timing of the processing for increasing the counter value is affected by the processing, As a result, the increment rate of the counter value may not be constant. If the increment rate of the counter value is not constant, the calculation result of the task execution time becomes inaccurate.

本発明は上記点に鑑み、複数のタスクのうちから実行する対象のタスクを切り替えるCPUにおける、タスクの実行時間を特定する技術において、タスクの実行時間が非常に短い場合でも確実に当該タスクの実行時間を特定することができるようにし、また、上述したようなしくみで他の処理によって実行時間の計算に狂いが生じることがないようにすることを目的とする。   In view of the above points, the present invention is a technology for specifying a task execution time in a CPU that switches a target task to be executed from among a plurality of tasks. Even when the task execution time is very short, the task is reliably executed. The purpose is to allow the time to be specified, and to prevent the execution time from being distorted by other processes in the above-described manner.

上記目的を達成するための本発明の第1の特徴は、記憶媒体およびCPUを備え、記憶媒体に記録されている複数のタスクのうちからCPUが実行する対象のタスクを切り替える電子計算装置についてのものである。この本発明の第1の特徴において、CPUは、複数のタスクのうち1つのタスク(以下、実行タスクという)の実行を開始するとき、実行タスクが記憶媒体に記録された指定タスクであるか否かを判定し、その判定結果が肯定的であることに基づいて、当該実行タスクの実行開始時に、その開始時の時刻を、当該実行タスクの実行開始時刻として、記憶媒体に記録する。さらに、当該実行タスクの実行終了時に、その終了時の時刻と、記憶媒体に記録された当該実行タスクの実行開始時刻との差を、当該実行タスクの実行時間として記憶媒体に記録する。   In order to achieve the above object, a first feature of the present invention relates to an electronic computer that includes a storage medium and a CPU and switches a task to be executed by the CPU from a plurality of tasks recorded in the storage medium. Is. In the first feature of the present invention, when the CPU starts execution of one of a plurality of tasks (hereinafter referred to as an execution task), whether or not the execution task is a designated task recorded in the storage medium. When the execution result of the execution task is started, the time at the start is recorded in the storage medium as the execution start time of the execution task. Further, at the end of execution of the execution task, the difference between the end time and the execution start time of the execution task recorded in the storage medium is recorded in the storage medium as the execution time of the execution task.

このように、あらかじめ指定されたタスクと、実行を開始するタスクとを照合し、それらが合致したときに、当該実行タスクの開始時刻と終了時刻との差を実行時間として記録することで、所望のタスクの実行時間を特定することができる。そして、このような方法を用いることで、タスクの実行時間が非常に短い場合であっても、確実にその実行時間を特定することができ、また、上述したようなしくみで他の処理によって実行時間の計算に狂いが生じることがない。   In this way, a task specified in advance and a task to start execution are collated, and when they match, the difference between the start time and end time of the execution task is recorded as an execution time. The execution time of the task can be specified. By using such a method, even when the task execution time is very short, the execution time can be reliably specified, and the execution can be performed by other processes with the above-described mechanism. There is no error in the calculation of time.

また、本発明の第2の特徴は、記憶媒体およびCPUを備え、記憶媒体に記録されている、第1のグループに属する複数の第1グループタスクおよび第2のグループに属する複数の第2グループタスクのうちから、CPUが実行する対象のタスクを切り替える電子計算装置についてのものである。そして、このCPUは、第1グループタスクのどれも実行していないときは必ず第2グループタスクのいずれかを実行している。   The second feature of the present invention is that a storage medium and a CPU are provided, and a plurality of first group tasks belonging to the first group and a plurality of second groups belonging to the second group are recorded on the storage medium. The present invention relates to an electronic computing device that switches a task to be executed by a CPU from among tasks. The CPU always executes one of the second group tasks when none of the first group tasks are executed.

さらにこのCPUは、所定の計測期間内における第2グループタスクの実行のそれぞれにおいて、実行対象となる第2グループタスク(以下、実行タスクという)の実行開始時に、その開始時の時刻を、当該実行タスクの実行開始時刻として、記憶媒体に記録し、また、当該実行タスクの実行終了時に、その終了時の時刻と、記憶媒体に記録された当該実行タスクの実行開始時刻との差を、当該実行タスクの実行時間として算出する。また、CPUは、計測期間内において算出した当該実行タスクの実行時間の総和を計測期間から減算した結果を、複数の第1グループタスクの実行時間として、記憶媒体に記録する。   Further, the CPU executes the execution time of the second group task to be executed (hereinafter referred to as an execution task) in the execution of the second group task within a predetermined measurement period. The task execution start time is recorded on the storage medium, and at the end of execution of the execution task, the difference between the end time and the execution start time of the execution task recorded on the storage medium is Calculated as task execution time. Further, the CPU records the result of subtracting the total execution time of the execution tasks calculated within the measurement period from the measurement period as the execution times of the plurality of first group tasks in the storage medium.

このように、CPUの実行対象となるタスクが、第1のグループと第2のグループに分けられており、かつ、第1のグループのタスクが実行されていない間は、必ず第2のグループのタスクが実行されているようになっている場合、ある計測期間内において、第2のグループに属するタスクのそれぞれについて実行時間を計測し、それら計測結果の総和を計測期間から減算した値を、第1グループタスクの実行時間として特定することができる。   As described above, the tasks to be executed by the CPU are divided into the first group and the second group, and the task of the second group is always performed while the task of the first group is not executed. When a task is being executed, the execution time is measured for each task belonging to the second group within a certain measurement period, and the value obtained by subtracting the sum of the measurement results from the measurement period is It can be specified as the execution time of one group task.

また、個々の第2グループタスクについては、当該実行タスクの開始時刻と終了時刻との差を実行時間として特定することで、当該タスクの実行時間を特定することができる。このような方法を用いることで、タスクの実行時間が非常に短い場合であっても、確実にその実行時間を特定することができ、また、上述したようなしくみで他の処理によって実行時間の計算に狂いが生じることがない。   For each second group task, the execution time of the task can be specified by specifying the difference between the start time and the end time of the execution task as the execution time. By using such a method, even if the task execution time is very short, the execution time can be specified reliably, and the execution time of the task can be determined by other processes with the above-described mechanism. There will be no error in the calculation.

また、本発明の第2の特徴においては、第2のグループに属するタスクのそれぞれは、当該電子計算装置のハードウェアおよびオペレーティングシステムを直接制御するプラットフォームタスクであって、第1のグループに属するタスクのそれぞれは、当該電子計算装置のハードウェアおよびオペレーティングシステムを、プラットフォームタスクを介して利用するアプリケーションタスクであってもよい。このようになっていることで、アプリケーションタスクによるCPU利用率を知りたいという一般的なニーズに対応することができる。   Further, in the second feature of the present invention, each of the tasks belonging to the second group is a platform task for directly controlling the hardware and operating system of the electronic computing device, and belongs to the first group. Each may be an application task that uses the hardware and operating system of the electronic computing device via a platform task. In this way, it is possible to meet the general need to know the CPU usage rate by the application task.

また、計測期間内において算出された実行タスクの実行時間の総和を計測期間から減算した結果を、アプリケーションタスクの実行時間として記憶媒体に記録する機能は、プラットフォームタスクとして実現されていてもよい。このようになっていることで、アプリケーションタスクの実行時間の計算機能をプラットフォームの一部として設計することができるので、アプリケーションタスクの設計者が、アプリケーションタスクの実行時間算出のためのプログラムを作成する必要がなくなる。   Further, the function of recording the result of subtracting the total execution time of execution tasks calculated within the measurement period from the measurement period in the storage medium as the execution time of the application task may be realized as a platform task. In this way, the application task execution time calculation function can be designed as part of the platform, so the application task designer creates a program for calculating the application task execution time. There is no need.

また、本発明の第1および第2の特徴は、プログラムとしても実現することができる。   The first and second features of the present invention can also be realized as a program.

以下、本発明の一実施形態について説明する。図1に、本実施形態に係るECU1の構成およびRAMモニタ2との接続関係を示す。ECU1は、車両に搭載され、車両の挙動等を制御するための電子制御装置である。例えば、ECU1は、エンジンECUであってもよい。   Hereinafter, an embodiment of the present invention will be described. FIG. 1 shows the configuration of the ECU 1 and the connection relationship with the RAM monitor 2 according to this embodiment. The ECU 1 is an electronic control device that is mounted on a vehicle and controls the behavior of the vehicle. For example, the ECU 1 may be an engine ECU.

ECU1は、タイマ10、RAM11、ROM12、CPU13等を有している。タイマ10は、時刻の経過を計測する。CPU13は、ROM12からプログラムを読み出して実行し、その実行の際にRAM11を作業領域として各種演算を行う。また、CPU13は、その演算の際に、図示しないセンサ(例えば車速センサ、アクセル開度センサ)から車両内の情報を取得してもよいし、図示しないアクチュエータ(例えばインジェクタ、アンチロックブレーキ装置)を制御するようになっていてもよい。RAMモニタ2は、必要なときにECU1に接続されることで、RAM11の記憶内容を読み取ることができる装置である。   The ECU 1 includes a timer 10, a RAM 11, a ROM 12, a CPU 13, and the like. The timer 10 measures the passage of time. The CPU 13 reads the program from the ROM 12 and executes it, and performs various calculations using the RAM 11 as a work area during the execution. Further, the CPU 13 may acquire information in the vehicle from a sensor (not shown) (for example, a vehicle speed sensor or an accelerator opening sensor) during the calculation, or an actuator (for example, an injector or an antilock brake device) (not shown). You may come to control. The RAM monitor 2 is a device that can read the stored contents of the RAM 11 when connected to the ECU 1 when necessary.

ここで、CPU13が実行するプログラムについて説明する。ROM12に記録されているプログラムは、リアルタイムオペレーティングシステム(以下、RTOSという)用のプログラム、プラットフォーム用のプログラム、およびアプリケーション用のプログラムを含んでいる。図2に、アプリケーション31、プラットフォーム32、RTOS33の階層構造を、ハードウェア34との関係で概念的に示す。RTOS33は、ECU1のハードウェア(RAM、ROM、図示しないI/O等)34を直接制御するシステムである。RTOS33としては、例えば、OSEK(登録商標)仕様のものを用いてもよい。プラットフォーム32は、当該ハードウェア34およびRTOS33を直接制御するシステムである。   Here, a program executed by the CPU 13 will be described. The programs recorded in the ROM 12 include a program for a real-time operating system (hereinafter referred to as RTOS), a platform program, and an application program. FIG. 2 conceptually shows the hierarchical structure of the application 31, platform 32, and RTOS 33 in relation to the hardware 34. The RTOS 33 is a system that directly controls the hardware (RAM, ROM, I / O not shown) 34 of the ECU 1. As the RTOS 33, for example, an OSEK (registered trademark) specification may be used. The platform 32 is a system that directly controls the hardware 34 and the RTOS 33.

アプリケーション31は、ECU1の各種機能(例えばエンジン制御、オートクルーズ制御、レーンキープ制御等)を実現するためのシステムであり、この目的のために、プラットフォーム32を介して当該ハードウェア34およびRTOS33を利用する。このような階層構造の存在により、アプリケーションは、RTOS33およびハードウェア34の機能を直接利用する必要がなくなる。したがって、プラットフォーム32とアプリケーション31との間のインターフェースを共通化しておけば、プラットフォーム32がECU毎のRTOS33およびハードウェア34の違いを吸収するので、異なる種類のECUに同じアプリケーション31を使用することができる。すなわち、アプリケーション31の再配置が可能となる。   The application 31 is a system for realizing various functions of the ECU 1 (for example, engine control, auto-cruise control, lane keep control, etc.). For this purpose, the hardware 34 and the RTOS 33 are used via the platform 32. To do. The existence of such a hierarchical structure eliminates the need for an application to directly use the functions of the RTOS 33 and the hardware 34. Therefore, if the interface between the platform 32 and the application 31 is made common, the platform 32 absorbs the difference between the RTOS 33 and the hardware 34 for each ECU. Therefore, the same application 31 may be used for different types of ECUs. it can. That is, the application 31 can be rearranged.

また、ROM中のプログラムは、タスクというプログラム単位に分かれており、CPU13は、それら複数のタスクのうち一時期に1つのタスクの実行を行うようになっている。そしてCPU13は、あらかじめ定められたタスク間の優先順等に基づいて、実行する対象のタスクを順次切り替えていく。この実行タスクの切り替え機能を、タスクスケジューリング機能という。タスクスケジューリング機能は、RTOS33によって実現される。   The programs in the ROM are divided into program units called tasks, and the CPU 13 executes one task at a time among the plurality of tasks. Then, the CPU 13 sequentially switches the tasks to be executed based on a predetermined priority order among tasks. This execution task switching function is called a task scheduling function. The task scheduling function is realized by the RTOS 33.

図3に、CPU13が実行する各種タスクの実行順序の一例を示す。この例においては、計測タスク、PFタスク1、APタスク1、2、…n、PFタスク2等を、CPU13が実行している。そして、これら各タスクには、この順に高い優先度が割り当てられている。例えば、他に実行するプログラムがないときに実行されるアイドルタスクであるPFタスク2の実行タイミング53中に、APタスク2の実行タイミング63が来ると、CPU13はPFタスク2の実行を終了し、APタスク2の実行を開始する。   FIG. 3 shows an example of the execution order of various tasks executed by the CPU 13. In this example, the CPU 13 executes a measurement task, a PF task 1, an AP task 1, 2,... N, a PF task 2, and the like. Each of these tasks is assigned a higher priority in this order. For example, when the execution timing 63 of the AP task 2 comes during the execution timing 53 of the PF task 2, which is an idle task executed when there is no other program to be executed, the CPU 13 ends the execution of the PF task 2, The execution of AP task 2 is started.

なお、APタスク(第1のグループに属する第1グループタスクの一例に相当する)とは、アプリケーションのプログラムの単位となるタスクをいい、PFタスク(第2のグループに属する第2グループタスクの一例に相当する)は、プラットフォームのプログラムの単位となるタスクをいう。どのAPタスクよりもどのPFタスクよりも優先度の高い計測タスクは、タイマ割り込みによって所定の周期Tc(例えば1ms)で実行される。   The AP task (corresponding to an example of a first group task belonging to the first group) refers to a task that is a unit of an application program, and is a PF task (an example of a second group task belonging to the second group). Corresponds to a task that is a unit of the platform program. A measurement task having a higher priority than any PF task over any AP task is executed at a predetermined cycle Tc (for example, 1 ms) by a timer interrupt.

なお、RTOSの提供する機能によって、CPU13は、各タスクの実行開始時にタスク開始フック関数を実行し、各タスクの終了時にタスク終了フック関数を実行するようになっている。図4および図5に、それぞれタスク開始フック関数100およびタスク終了フック関数200の処理内容を、フローチャートで示す。   Note that the function provided by the RTOS allows the CPU 13 to execute a task start hook function at the start of execution of each task and to execute the task end hook function at the end of each task. 4 and 5 are flowcharts showing the processing contents of the task start hook function 100 and the task end hook function 200, respectively.

タスク開始フック関数100の実行において、CPU13は、まずステップ110で、開始するタスクのタスクIDを取得する。タスクIDとは、各タスクを識別するために、各タスクにあらかじめ(設計時に)割り当てられたコードである。このタスクIDの内容によって、対応するタスクがAPタスクであるかPFタスクであるかを判別することができるようになっている。タスクIDの取得方法は周知であるので、ここではその詳細についての説明は行わない。   In the execution of the task start hook function 100, the CPU 13 first acquires the task ID of the task to be started in step 110. The task ID is a code assigned to each task in advance (at the time of design) in order to identify each task. Based on the content of this task ID, it can be determined whether the corresponding task is an AP task or a PF task. Since the task ID acquisition method is well known, the details thereof will not be described here.

続いてステップ120で、取得したタスクIDがPFタスクを示しているかAPタスクを示しているかを判定する。PFタスクを示していると判定した場合、続いてステップ130で、タイマ10からの出力信号に基づいて現在時刻を取得し、その現在時刻を変数Spfとして、RAM11に記録し、その後タスク開始フック関数100の実行を終了する。   In step 120, it is determined whether the acquired task ID indicates a PF task or an AP task. If it is determined that the PF task is indicated, then in step 130, the current time is acquired based on the output signal from the timer 10, the current time is recorded in the RAM 11 as the variable Spf, and then the task start hook function 100 execution is terminated.

ステップ120でAPタスクを示していると判定した場合、続いてステップ140で、実行開始したタスク(以下、実行タスクという)が、実行時間計測対象のタスク(以下、指定タスクという)として指定されているか否かを判定する。この判定は、具体的には、ステップ110で取得したタスクIDが、あらかじめRAM11、ROM12、図示しない不揮発性書き込み可能記憶媒体等に記録されている1つまたは複数の指定タスクIDの1つに一致しているか否かによって決まる。指定タスクIDは、RAMモニタ2等の外部の装置を用いて作業者が随時RAM11に記録できるようになっていてもよい。   If it is determined in step 120 that an AP task is indicated, then in step 140, the task that has started execution (hereinafter referred to as an execution task) is designated as a task whose execution time is to be measured (hereinafter referred to as a specified task). It is determined whether or not. Specifically, this determination is made by assigning the task ID acquired in step 110 to one of one or a plurality of designated task IDs recorded in advance in the RAM 11, ROM 12, non-illustrated nonvolatile writable storage medium, or the like. It depends on whether you are doing it. The designated task ID may be recorded in the RAM 11 as needed by an operator using an external device such as the RAM monitor 2.

実行タスクが指定タスクの1つでない場合、タスク開始フック関数100の実行を終了し、指定タスクの1つである場合、続いてステップ150で、タイマ10からの出力信号に基づいて現在時刻を取得し、その現在時刻を変数Sappとして、RAM11に記録し、その後タスク開始フック関数100の実行を終了する。   If the execution task is not one of the designated tasks, the execution of the task start hook function 100 is terminated. If it is one of the designated tasks, then in step 150, the current time is obtained based on the output signal from the timer 10 Then, the current time is recorded in the RAM 11 as a variable Sapp, and then the execution of the task start hook function 100 is terminated.

このように、CPU13は、タスクの実行開始時に、当該タスクがPFタスクであるか指定タスクであれば、その開始時の時刻を、APタスクの実行開始時刻またはPFタスクの実行開始時刻として、RAM11に記録する。   As described above, when the task is started, if the task is a PF task or a designated task, the CPU 13 sets the start time as the AP task execution start time or the PF task execution start time. To record.

タスク終了フック関数200の実行において、CPU13は、まずステップ210で、終了するタスクのタスクIDを取得する。続いてステップ220で、取得したタスクIDがPFタスクを示しているかAPタスクを示しているかを判定し、PFタスクを示していると判定した場合続いてステップ230を実行し、APタスクを示していると判定した場合続いてステップ250を実行する。   In executing the task end hook function 200, the CPU 13 first acquires the task ID of the task to be ended in step 210. In step 220, it is determined whether the acquired task ID indicates a PF task or an AP task. If it is determined that the acquired task ID indicates a PF task, then step 230 is executed to indicate the AP task. If it is determined that there is, then step 250 is executed.

ステップ230では、現在時刻Eをタイマ10から取得し、続いてステップ240で、変数Tpfの値に、現在時刻Eから変数Spfの値を減算した結果を加算する。現在時刻Eから変数Spfの値を減算した結果は、実行を終了しようとしているタスクの開始時から現在(すなわち実行終了時)までの時間である。換言すれば、この減算値は、今回の実行タスクの実行時間である。変数Tpfは、後述するように、計測タスクの実行時にゼロにリセットされる。したがって、変数Tpfは、最後に計測タスクが実行されてから現在までのPFタスクの総実行時間を表している。ステップ240の後、タスク終了フック関数200の実行は終了する。   In step 230, the current time E is acquired from the timer 10, and in step 240, the result of subtracting the value of the variable Spf from the current time E is added to the value of the variable Tpf. The result of subtracting the value of the variable Spf from the current time E is the time from the start of the task whose execution is to be ended to the present (ie, at the end of execution). In other words, this subtraction value is the execution time of the current execution task. The variable Tpf is reset to zero when the measurement task is executed, as will be described later. Therefore, the variable Tpf represents the total execution time of the PF task from the last execution of the measurement task to the present. After step 240, execution of the task end hook function 200 ends.

ステップ250では、終了しようとしているタスクが指定タスクの1つであるか否かを判定し、指定タスクの1つでなければタスク終了フック関数200の実行を終了し、指定タスクの1つであれば続いてステップ260を実行する。ステップ260では、現在時刻Eをタイマ10から取得し、続いてステップ270で、変数Tappの値に、現在時刻Eから変数Sappの値を減算した結果を加算する。現在時刻Eから変数Sappの値を減算した結果は、実行を終了しようとしているタスクの開始時から現在(すなわち実行終了時)までの時間である。換言すれば、この減算値は、今回の実行タスクの実行時間である。変数Tappは、後述するように、計測タスクの実行時にゼロにリセットされる。したがって、変数Tappは、最後に計測タスクが実行されてから現在までのすべての指定タスクの総実行時間を表している。ステップ270の後、タスク終了フック関数200の実行は終了する。   In step 250, it is determined whether or not the task to be terminated is one of the designated tasks. If it is not one of the designated tasks, the execution of the task termination hook function 200 is terminated. Then, step 260 is executed. In step 260, the current time E is obtained from the timer 10, and then in step 270, the value obtained by subtracting the value of the variable Sapp from the current time E is added to the value of the variable Tapp. The result of subtracting the value of the variable Sapp from the current time E is the time from the start of the task whose execution is to be ended to the present (that is, at the end of execution). In other words, this subtraction value is the execution time of the current execution task. The variable Tapp is reset to zero when the measurement task is executed, as will be described later. Therefore, the variable Tapp represents the total execution time of all designated tasks from the last execution of the measurement task to the present. After step 270, execution of the task end hook function 200 ends.

このように、CPU13は、タスクの実行終了時に、当該タスクがPFタスクであるか指定タスクであれば、その終了時の時刻と、RAM11に記録された当該タスクの実行開始時刻との差を、当該タスクの今回の実行時間として特定し、特定した実行時間を、変数Tpfまたは変数Tappに加算する。その結果、次の計測タスクの実行タイミングの直前には、変数Tpfには、期間Tcの間に実行されたすべてのPFタスクの総実行時間が記録されており、また、変数Tappには、期間Tcの間に実行されたすべての指定APタスクの総実行時間が記録されていることになる。例えば、図3において、APタスク1およびAPタスクnが指定タスクになっている場合、実行時間61、65、66の総和が、計測タスクの実行タイミング41から42までの期間Tcにおける指定タスクの総実行時間Tappとなり、また、実行時間62、67の総和が、計測タスクの実行タイミング42から43までの期間Tcにおける指定タスクの総実行時間Tappとなる。   In this way, at the end of execution of the task, if the task is a PF task or a designated task, the CPU 13 determines the difference between the end time and the execution start time of the task recorded in the RAM 11. The current execution time of the task is specified, and the specified execution time is added to the variable Tpf or the variable Tapp. As a result, immediately before the execution timing of the next measurement task, the total execution time of all the PF tasks executed during the period Tc is recorded in the variable Tpf, and the variable Tapp includes the period The total execution time of all designated AP tasks executed during Tc is recorded. For example, in FIG. 3, when AP task 1 and AP task n are designated tasks, the sum of the execution times 61, 65, 66 is the total of the designated tasks in the period Tc from the measurement task execution timings 41 to 42. The execution time Tapp is set, and the sum of the execution times 62 and 67 is the total execution time Tapp of the designated task in the period Tc from the execution timing 42 to 43 of the measurement task.

ここで、計測タスクの詳細について説明する。図6に、計測タスク300のフローチャートを示す。CPU13は、この計測タスク300の実行において、まずステップ310で、指定APタスクによるCPU利用時間を計算するか、あるいは、全APタスクによるCPU利用時間を計算するかについての判定を行う。   Here, the details of the measurement task will be described. FIG. 6 shows a flowchart of the measurement task 300. In the execution of the measurement task 300, the CPU 13 first determines in step 310 whether to calculate the CPU usage time by the designated AP task or to calculate the CPU usage time by all AP tasks.

この判定は、あらかじめRAM11、ROM12、または図示しない書き込み可能不揮発性記憶媒体に記録された設定値に基づいて実行する。ここで、設定値は、ECU1の製造時に決定されていてもよいし、RAMモニタ2等の外部の装置を用いて作業者が随時RAM11に記録できるようになっていてもよい。   This determination is executed based on a setting value recorded in advance in the RAM 11, the ROM 12, or a writable nonvolatile storage medium (not shown). Here, the set value may be determined at the time of manufacture of the ECU 1, or may be recorded in the RAM 11 as needed by an operator using an external device such as the RAM monitor 2.

全APタスクによるCPU利用時間を計算する場合、続いてステップ320で、変数Tpf_aveに、変数Tpfと変数Tpf´の平均値を代入する。ここで、Tpf´は、後述する通り、前々回から前回の計測タスク300の実行タイミングまでの間に実行されたPFタスクの総実行時間である。変数Tpfは、今回から前回の計測タスク300の実行タイミングまでの間に実行されたPFタスクの総実行時間であるので、変数Tpf_aveは、直近の連続する2つの期間TcにおけるPFタスクの総実行時間の平均値である。この処理は、期間Tc毎に変化する総実行時間に対するフィルタリング処理の一種である。   When calculating the CPU usage time by all AP tasks, subsequently, in step 320, the average value of the variable Tpf and the variable Tpf ′ is substituted into the variable Tpf_ave. Here, as will be described later, Tpf ′ is the total execution time of the PF task executed between the last time and the execution timing of the previous measurement task 300. Since the variable Tpf is the total execution time of the PF task executed from this time to the execution timing of the previous measurement task 300, the variable Tpf_ave is the total execution time of the PF task in the two most recent consecutive periods Tc. Is the average value. This process is a kind of filtering process for the total execution time that changes every period Tc.

さらにステップ330で、期間Tcから変数Tpf_aveを減算した結果を、変数Upfに代入する。この変数Upfの値は、期間Tc内で、PFタスクが実行されていない時間である。本実施形態においては、他のタスクが実行されていないときには必ずPF2タスクが実行されるので、PFタスクが実行されていない時間とは、PFタスク以外のタスクが実行されている時間と同じである。したがって、変数Upfは、実質的にすべてのAPタスクの期間Tc内における総実行時間である。   In step 330, the result of subtracting the variable Tpf_ave from the period Tc is substituted into the variable Upf. The value of this variable Upf is the time during which the PF task is not executed within the period Tc. In this embodiment, the PF2 task is always executed when no other task is executed. Therefore, the time when the PF task is not executed is the same as the time when a task other than the PF task is executed. . Therefore, the variable Upf is the total execution time within the period Tc of substantially all AP tasks.

続いて、次の期間Tcのための処理として、ステップ340で変数Tpf´に現在のTpfの値を代入し、さらにステップ350で、Tpfをゼロにリセットする。このようになっていることで、次回の計測タスク300において、変数Tpf´が、当該計測タスク300の実行時から見て直前となる期間TcにおけるPFタスクの総実行時間として用いられる。ステップ350の後、計測タスク300の実行が終了する。このようなステップ320〜350の処理によって、直近の2つの期間TcにおけるすべてのAPタスクの実行時間の平均を算出することができる。そして、この実行時間を期間Tcで除算すれば、直近の2つの期間TcにおけるすべてのAPタスクによるCPU利用率を特定することができる。   Subsequently, as a process for the next period Tc, the current Tpf value is substituted into the variable Tpf ′ at step 340, and Tpf is reset to zero at step 350. In this way, in the next measurement task 300, the variable Tpf ′ is used as the total execution time of the PF task in the period Tc immediately before the measurement task 300 is executed. After step 350, execution of the measurement task 300 ends. Through the processing in steps 320 to 350 as described above, the average of the execution times of all AP tasks in the two most recent periods Tc can be calculated. Then, by dividing this execution time by the period Tc, it is possible to specify the CPU utilization rate by all AP tasks in the two most recent periods Tc.

指定APタスクのみによるCPU利用時間を計算する場合、続いてステップ360で、変数Tapp_aveに、変数Tappと変数Tapp´の平均値を代入する。ここで、Tapp´は、後述する通り、前々回から前回の計測タスク300の実行タイミングまでの間に実行された指定APタスクの総実行時間である。変数Tappは、今回から前回の計測タスク300の実行タイミングまでの間に実行された指定APタスクの総実行時間であるので、変数Tapp_aveは、直近の連続する2つの期間Tcにおける指定APタスクの総実行時間である。この処理は、期間Tc毎に変化する総実行時間に対するフィルタリング処理の一種である。   When calculating the CPU usage time by only the designated AP task, in step 360, the average value of the variable Tapp and the variable Tap 'is substituted for the variable Tap_ave. Here, Tap 'is the total execution time of the designated AP task executed between the previous time and the execution timing of the previous measurement task 300, as will be described later. Since the variable Tapp is the total execution time of the designated AP task executed from this time to the execution timing of the previous measurement task 300, the variable Tap_ave is the total of the designated AP tasks in the two most recent consecutive periods Tc. Execution time. This process is a kind of filtering process for the total execution time that changes every period Tc.

続いて、次の期間Tcのための処理として、ステップ370で変数Tapp´に現在の変数Tappの値を代入し、さらにステップ380で、変数Tappをゼロにリセットする。このようになっていることで、次回の計測タスク300において、変数Tapp´が、当該計測タスク300の実行時から見て直前となる期間TcにおけるPFタスクの総実行時間として用いられる。ステップ380の後、計測タスク300の実行が終了する。このようなステップ360〜380の処理によって、直近の2つの期間TcにおけるすべてのAPタスクの実行時間の平均を算出することができる。そして、この実行時間を期間Tcで除算すれば、直近の2つの期間Tcにおけるすべての指定APタスクによるCPU利用率を特定することができる。   Subsequently, as a process for the next period Tc, the value of the current variable Tapp is substituted into the variable Tapp ′ at Step 370, and the variable Tapp is reset to zero at Step 380. As a result, in the next measurement task 300, the variable Tapp ′ is used as the total execution time of the PF task in the period Tc immediately before the measurement task 300 is executed. After step 380, execution of measurement task 300 ends. Through the processes in steps 360 to 380, the average of the execution times of all AP tasks in the two most recent periods Tc can be calculated. Then, by dividing this execution time by the period Tc, it is possible to specify the CPU utilization rate by all the designated AP tasks in the two most recent periods Tc.

以上のように、個々のタスクについて、当該タスクの開始時刻と終了時刻との差を実行時間として特定することで、当該タスクの実行時間を特定することができる。このような方法を用いることで、タスクの実行時間が非常に短い場合であっても、確実にその実行時間を特定することができ、また、アイドルタスクの一部として実行される他の処理によって実行時間の計算に狂いが生じることがない。   As described above, for each task, the execution time of the task can be specified by specifying the difference between the start time and the end time of the task as the execution time. By using such a method, even if the task execution time is very short, the execution time can be reliably specified, and it can be determined by other processes executed as part of the idle task. There is no error in the calculation of execution time.

このように、あらかじめ指定されたAPタスクのタスクIDと、実行を開始するAPタスクのタスクIDとを照合し、それらが合致したときに、当該APタスクの開始時刻と終了時刻との差を実行時間として記録することで、所望のタスクの実行時間を特定することができる。   In this way, the task ID of the AP task designated in advance is collated with the task ID of the AP task to start execution, and when they match, the difference between the start time and end time of the AP task is executed. By recording the time, the execution time of the desired task can be specified.

また、各期間Tcについて算出された全APタスクまたは全指定APタスクの総実行時間には、それより過去の複数の期間Tcにおける算出結果を用いたフィルタリング処理が施される。フィルタリング処理が施されない場合には、図7に示すように、算出値71〜76の値の、異なる期間Tc間のばらつきが大きいので、それら算出値71〜76に基づいて作成される波形77の形状も変化が激しい。   Further, the total execution time of all AP tasks or all designated AP tasks calculated for each period Tc is subjected to a filtering process using calculation results in a plurality of periods Tc in the past. When the filtering process is not performed, as shown in FIG. 7, since the variation of the calculated values 71 to 76 is large between the different periods Tc, the waveform 77 created based on the calculated values 71 to 76 is displayed. The shape is also changing drastically.

しかし、フィルタリングが施されると、図8に示すように、算出値81〜86の値の、異なる期間Tc間のばらつきが抑えられるので、それら算出値81〜86に基づいて作成される波形77の形状も変化が緩やかである。したがって、作業者は、フィルタリングを施した結果のデータをRAMモニタ2を用いて取得した場合は、改めて算出結果の平均化等の作業を行う必要がなくなる。   However, when filtering is performed, as shown in FIG. 8, variations in the calculated values 81 to 86 between the different periods Tc are suppressed, so that the waveform 77 created based on the calculated values 81 to 86 is used. The shape of the change is slow. Therefore, when the data obtained as a result of filtering is acquired by using the RAM monitor 2, the operator does not need to perform work such as averaging of the calculation results again.

また、計測タスクがプラットフォームタスクとして実現されているので、アプリケーションタスクの設計者が、アプリケーションタスクの実行時間算出のためのプログラムを作成する必要がなくなる。したがって、アプリケーションの設計内容によらず、タスクの処理負荷の計測が可能となる。   Further, since the measurement task is realized as a platform task, the designer of the application task does not need to create a program for calculating the execution time of the application task. Therefore, the task processing load can be measured regardless of the design contents of the application.

なお、上記実施形態においては、ECU1が電子計算装置の一例に相当し、RAM11、ROM12、およびCPU13中のレジスタが記憶媒体の一例に相当する。また、CPU13が、タスク開始フック関数100のステップ140を実行することで判定手段の一例として機能し、ステップ150を実行することで開始時記録手段の一例として機能し、タスク終了フック関数200のステップ270を実行することで終了時記録手段の一例として機能し、また、タスク開始フック関数100のステップ130およびタスク終了フック関数200のステップ240を実行することで開始終了時算出手段の一例として機能し、計測タスク300のステップ320、33、340、350を実行することで計測結果記録手段の一例として機能する。   In the above embodiment, the ECU 1 corresponds to an example of an electronic computer, and the RAM 11, the ROM 12, and the registers in the CPU 13 correspond to an example of a storage medium. The CPU 13 functions as an example of a determination unit by executing step 140 of the task start hook function 100, and functions as an example of a start time recording unit by executing step 150. Executing 270 functions as an example of an end time recording unit, and executing step 130 of the task start hook function 100 and step 240 of the task end hook function 200 functions as an example of a start / end time calculating unit. By executing steps 320, 33, 340, and 350 of the measurement task 300, it functions as an example of a measurement result recording unit.

(他の実施形態)
以上、本発明の実施形態について説明したが、本発明の範囲は、上記実施形態のみに限定されるものではなく、本発明の各発明特定事項の機能を実現し得る種々の形態を包含するものである。
(Other embodiments)
As mentioned above, although embodiment of this invention was described, the scope of the present invention is not limited only to the said embodiment, The various form which can implement | achieve the function of each invention specific matter of this invention is included. It is.

例えば、上記の実施形態においては、ECU1は車両に搭載されるECUとなっているが、本発明の電子計算装置は、車両に搭載されるものでなくともよい。   For example, in the above-described embodiment, the ECU 1 is an ECU mounted on the vehicle, but the electronic calculation device of the present invention may not be mounted on the vehicle.

また、上記の実施形態においては、PFタスクの総実行時間に、計測タスクの実行時間を含めるようになっていてもよいし、含めないようになっていてもよい。期間TCにおける計測タスクの実行時間は、期間TCに比べて十分短いので、どちらの場合においても、アプリケーションタスクの実行時間の計測には大きな影響を及ぼさない。   In the embodiment described above, the execution time of the measurement task may be included in the total execution time of the PF task, or may not be included. Since the execution time of the measurement task in the period TC is sufficiently shorter than that in the period TC, in either case, the measurement of the execution time of the application task is not greatly affected.

また、APタスクとPFタスクの間の優先度の関係は、図3のようなものに限らず、どのようになっていてもよい。   Further, the priority relationship between the AP task and the PF task is not limited to that shown in FIG. 3 and may be any method.

本発明の実施形態に係るECU1の構成およびRAMモニタ2との接続関係を示すブロック図である。1 is a block diagram showing a configuration of an ECU 1 and a connection relationship with a RAM monitor 2 according to an embodiment of the present invention. CPU13が実行するソフトウェアの階層分けを示す図である。It is a figure which shows the hierarchical division of the software which CPU13 performs. CPU13における種々のタスクの実行順序の一例を示すタイミング図である。It is a timing diagram which shows an example of the execution order of the various tasks in CPU13. タスク開始フック関数100のフローチャートである。4 is a flowchart of a task start hook function 100. タスク終了フック関数200のフローチャートである。5 is a flowchart of a task end hook function 200. 計測タスク300のフローチャートである。5 is a flowchart of a measurement task 300. フィルタリングが施されない場合の総実行時間の変化波形77を示す図である。It is a figure which shows the change waveform 77 of the total execution time when filtering is not performed. フィルタリングが施される場合の総実行時間の変化波形77を示す図である。It is a figure which shows the change waveform 77 of the total execution time in case filtering is performed.

符号の説明Explanation of symbols

1…ECU、2…RAMモニタ、10…タイマ、11…RAM、12…ROM、
13…CPU、31…アプリケーション、32…プラットフォーム、33…RTOS、
34…ハードウェア、41〜43…計測タスク、51〜55…PFタスク、
61〜67…APタスク、71〜76、81〜86…算出値、77、87…波形、
100…タスク開始フック関数、200…タスク終了フック関数、
300…計測タスク。
1 ... ECU, 2 ... RAM monitor, 10 ... timer, 11 ... RAM, 12 ... ROM,
13 ... CPU, 31 ... application, 32 ... platform, 33 ... RTOS,
34 ... Hardware, 41-43 ... Measurement task, 51-55 ... PF task,
61-67 ... AP task, 71-76, 81-86 ... calculated value, 77, 87 ... waveform,
100: Task start hook function, 200: Task end hook function,
300: Measurement task.

Claims (6)

記憶媒体およびCPUを備え、前記記憶媒体に記録されている複数のタスクのうちから前記CPUが実行する対象のタスクを切り替える電子計算装置であって、
前記CPUは:
前記複数のタスクのうち1つのタスク(以下、実行タスクという)の実行を開始するとき、前記実行タスクが前記記憶媒体に記録された指定タスクであるか否かを判定する判定手段(140)と、
前記第1判定手段の判定結果が肯定的であることに基づいて、前記実行タスクの実行開始時に、その開始時の時刻を、前記実行タスクの実行開始時刻として、前記記憶媒体に記録する開始時記録手段(150)と、
前記実行タスクの実行終了時に、その終了時の時刻と、前記記憶媒体に記録された前記実行タスクの実行開始時刻との差を、前記実行タスクの実行時間として前記記憶媒体に記録する終了時記録手段(270)と、
を有していることを特徴とする電子計算装置。
An electronic computing device comprising a storage medium and a CPU, and switching a task to be executed by the CPU from a plurality of tasks recorded in the storage medium,
The CPU is:
Determining means (140) for determining whether or not the execution task is a designated task recorded in the storage medium when starting execution of one of the plurality of tasks (hereinafter referred to as an execution task); ,
When the execution result of the execution task is started based on the determination result of the first determination means being positive, the start time is recorded in the storage medium as the execution start time of the execution task. Recording means (150);
At the end of execution of the execution task, a recording at the end of recording the difference between the time at the end of the execution task and the execution start time of the execution task recorded on the storage medium as the execution time of the execution task Means (270);
An electronic computing device characterized by comprising:
記憶媒体およびCPUを備え、前記記憶媒体に記録されている、第1のグループに属する複数の第1グループタスクおよび第2のグループに属する複数の第2グループタスクのうちから、前記CPUが実行する対象のタスクを切り替える電子計算装置であって、
前記CPUは、前記複数の第1グループタスクのどれも実行していないときは必ず前記複数の第2グループタスクのいずれかを実行しており、
前記CPUは:
所定の計測期間内における前記第2グループタスクの実行のそれぞれにおいて、実行対象となる第2グループタスク(以下、実行タスクという)の実行開始時に、その開始時の時刻を、前記実行タスクの実行開始時刻として、前記記憶媒体に記録し、また、前記実行タスクの実行終了時に、その終了時の時刻と、前記記憶媒体に記録された前記実行タスクの実行開始時刻との差を、前記実行タスクの実行時間として算出する開始終了時算出手段と、
前記計測期間内において前記開始終了時算出手段が算出した前記実行タスクの実行時間の総和を前記計測期間から減算した結果を、前記複数の第1グループタスクの実行時間として、前記記憶媒体に記録する計測結果記録手段と、
を有することを特徴とする電子計算装置。
A CPU having a storage medium and a CPU, and executed by the CPU from among a plurality of first group tasks belonging to a first group and a plurality of second group tasks belonging to a second group recorded in the storage medium An electronic computing device for switching a target task,
The CPU always executes one of the plurality of second group tasks when none of the plurality of first group tasks is executed,
The CPU is:
In each execution of the second group task within a predetermined measurement period, when the execution of the second group task (hereinafter referred to as an execution task) to be executed starts, the time at the start is used to start the execution of the execution task. The time is recorded in the storage medium, and at the end of execution of the execution task, the difference between the end time and the execution start time of the execution task recorded in the storage medium is Start / end time calculating means for calculating as execution time;
The result obtained by subtracting the total execution time of the execution tasks calculated by the start / end time calculation means within the measurement period from the measurement period is recorded in the storage medium as the execution time of the plurality of first group tasks. A measurement result recording means;
An electronic computing device comprising:
前記第2のグループに属するタスクのそれぞれは、当該電子計算装置のハードウェアおよびオペレーティングシステムを直接制御するプラットフォームタスクであって、前記第1のグループに属するタスクのそれぞれは、当該電子計算装置のハードウェアおよびオペレーティングシステムを、前記プラットフォームタスクを介して利用するアプリケーションタスクであることを特徴とする請求項2に記載の電子計算装置。 Each of the tasks belonging to the second group is a platform task for directly controlling the hardware and operating system of the electronic computing device, and each of the tasks belonging to the first group is a hardware task of the electronic computing device. The electronic computing device according to claim 2, wherein the electronic computing device is an application task that uses a hardware and an operating system via the platform task. 前記計測結果記録手段は、前記プラットフォームタスクに属することを特徴とする請求項3に記載の電子計算装置。 The electronic calculation apparatus according to claim 3, wherein the measurement result recording unit belongs to the platform task. 記憶媒体およびCPUを備え、前記記憶媒体に記録されている複数のタスクのうちから前記CPUが実行する対象のタスクを切り替える電子計算装置に用いるプログラムであって、
前記複数のタスクのうち1つのタスク(以下、実行タスクという)の実行を開始するとき、前記実行タスクが前記記憶媒体に記録された指定タスクであるか否かを判定する判定手段、
前記第1判定手段の判定結果が肯定的であることに基づいて、前記実行タスクの実行開始時に、その開始時の時刻を、前記実行タスクの実行開始時刻として、前記記憶媒体に記録する開始時記録手段、および、
前記実行タスクの実行終了時に、その終了時の時刻と、前記記憶媒体に記録された前記実行タスクの実行開始時刻との差を、前記実行タスクの実行時間として前記記憶媒体に記録する終了時記録手段として、前記CPUを機能させるプログラム。
A program comprising a storage medium and a CPU, and used for an electronic computing device that switches a task to be executed by the CPU from a plurality of tasks recorded on the storage medium,
Determining means for determining whether or not the execution task is a designated task recorded in the storage medium when starting execution of one of the plurality of tasks (hereinafter referred to as an execution task);
When the execution result of the execution task starts based on the determination result of the first determination means being affirmative, the start time is recorded in the storage medium as the execution start time of the execution task. Recording means, and
At the end of execution of the execution task, a recording at the end of recording the difference between the time at the end of the execution task and the execution start time of the execution task recorded on the storage medium as the execution time of the execution task As a means, a program for causing the CPU to function.
記憶媒体およびCPUを備え、前記記憶媒体に記録されている、第1のグループに属する複数の第1グループタスクおよび第2のグループに属する複数の第2グループタスクのうちから、前記CPUが実行する対象のタスクを切り替え、前記CPUに、前記複数の第1グループタスクのどれも実行していないときは必ず前記複数の第2グループタスクのいずれかを実行させる電子計算装置、に用いるプログラムであって、
所定の計測期間内における前記第2グループタスクの実行のそれぞれにおいて、実行対象となる第2グループタスク(以下、実行タスクという)の実行開始時に、その開始時の時刻を、前記実行タスクの実行開始時刻として、前記記憶媒体に記録し、また、前記実行タスクの実行終了時に、その終了時の時刻と、前記記憶媒体に記録された前記実行タスクの実行開始時刻との差を、前記実行タスクの実行時間として算出する開始終了時算出手段、および、
前記計測期間内において前記開始終了時算出手段が算出した前記実行タスクの実行時間の総和を前記計測期間から減算した結果を、前記複数の第1グループタスクの実行時間として、前記記憶媒体に記録する計測結果記録手段、として、前記CPUを機能させるプログラム。
A CPU having a storage medium and a CPU, and executed by the CPU from among a plurality of first group tasks belonging to a first group and a plurality of second group tasks belonging to a second group recorded in the storage medium A program used for an electronic computing device that switches a target task and causes the CPU to execute any one of the plurality of second group tasks whenever any of the plurality of first group tasks is not executed. ,
In each execution of the second group task within a predetermined measurement period, when the execution of the second group task (hereinafter referred to as an execution task) to be executed starts, the time at the start is used to start the execution of the execution task. The time is recorded in the storage medium, and at the end of execution of the execution task, the difference between the end time and the execution start time of the execution task recorded in the storage medium is Start / end time calculating means for calculating the execution time; and
The result obtained by subtracting the total execution time of the execution tasks calculated by the start / end time calculation means within the measurement period from the measurement period is recorded in the storage medium as the execution time of the plurality of first group tasks. A program that causes the CPU to function as measurement result recording means.
JP2007122195A 2007-05-07 2007-05-07 Electronic computer capable of specifying execution time of task, and program for electronic computer Withdrawn JP2008276674A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2007122195A JP2008276674A (en) 2007-05-07 2007-05-07 Electronic computer capable of specifying execution time of task, and program for electronic computer
US12/149,685 US20080282248A1 (en) 2007-05-07 2008-05-06 Electronic computing device capable of specifying execution time of task, and program therefor
DE102008022302A DE102008022302A1 (en) 2007-05-07 2008-05-06 Electronic computing device for determining an execution time of a task and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007122195A JP2008276674A (en) 2007-05-07 2007-05-07 Electronic computer capable of specifying execution time of task, and program for electronic computer

Publications (1)

Publication Number Publication Date
JP2008276674A true JP2008276674A (en) 2008-11-13

Family

ID=39829638

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007122195A Withdrawn JP2008276674A (en) 2007-05-07 2007-05-07 Electronic computer capable of specifying execution time of task, and program for electronic computer

Country Status (3)

Country Link
US (1) US20080282248A1 (en)
JP (1) JP2008276674A (en)
DE (1) DE102008022302A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10843704B2 (en) 2017-03-20 2020-11-24 Hyundai Motor Company Vehicle and control method thereof

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010033436A (en) * 2008-07-30 2010-02-12 Autonetworks Technologies Ltd Control apparatus, control method, and computer program
US20160103708A1 (en) * 2014-10-09 2016-04-14 Profoundis Labs Pvt Ltd System and method for task execution in data processing
KR102085899B1 (en) * 2018-12-10 2020-03-06 현대오트론 주식회사 Operating Monitoring Method For CPU Of Vehicle ECU, And Monitoring Unit

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0540651A (en) 1991-08-06 1993-02-19 Nec Corp Analyzer for computer system load
JP3376096B2 (en) 1994-05-30 2003-02-10 昭和電工株式会社 Soft injection molded article of thermoplastic olefin resin composition

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10843704B2 (en) 2017-03-20 2020-11-24 Hyundai Motor Company Vehicle and control method thereof

Also Published As

Publication number Publication date
DE102008022302A1 (en) 2008-11-13
US20080282248A1 (en) 2008-11-13

Similar Documents

Publication Publication Date Title
JP5069325B2 (en) Task execution control device and program
JP4770602B2 (en) Electronics
JP2793993B2 (en) Program runaway detection method in microcomputer
US20040039935A1 (en) Method and device for measuring the execution time of a real task in a real time system
JP2008513900A (en) Method for processing a computer program on a computer system
JP2002278779A (en) Processing performing device and program
JP7282195B2 (en) Machine learning-based anomaly detection for embedded software applications
JP4515701B2 (en) VEHICLE CONTROL PROGRAM AND VEHICLE CONTROL DEVICE
JP2008276674A (en) Electronic computer capable of specifying execution time of task, and program for electronic computer
US10162324B2 (en) Method for manipulating a control program of a control device
US20120246650A1 (en) Method for processing information and activities in a control and/or regulating system with the aid of a multi-core processor
KR102410940B1 (en) Method and system for ECU execution time monitoring and fault finding
JP3376906B2 (en) Computer load factor measurement system
WO2022262786A1 (en) Method and apparatus for correcting opening degree of accelerator pedal, device, program, medium, controller, and vehicle
JP2024005967A (en) Fraudulent signal detection device, vehicle, and fraudulent signal detection method
JP7435182B2 (en) electronic control unit
US20020152256A1 (en) Method and device for reconstructing the process sequence of a control program
JP6522550B2 (en) Electronic control unit
JP3389745B2 (en) Apparatus and method for measuring program performance
JP2005100017A (en) Processor simulator, interruption delay count program and simulation method of processor
JP2004318672A (en) Processor
CN113312167B (en) Service control method and device, electronic equipment and computer readable medium
CN111858272B (en) Method and device for judging program execution delay and terminal equipment
JPH08137703A (en) Task switching device
US7417571B2 (en) Method for providing a correlation

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20100803