Task monitoring system and task monitoring program
The task monitoring system addresses the challenge of monitoring short-period tasks by using execution status-based management variables, ensuring reliable detection and response to abnormalities in computers with multiple timers.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2026-03-06
AI Technical Summary
Conventional monitoring systems for computers with multiple tasks of different periodic timers fail to reliably monitor tasks with shorter periods and higher priority, as they focus on the longest timer and cannot reset the system when shorter tasks are not executed correctly.
A task monitoring system that uses management variables for each task, varying based on execution status, allowing individual monitoring of tasks regardless of period or priority, with a comparator circuit and open collector circuit to determine normal or abnormal execution.
Enables reliable monitoring of tasks with short periodic timers by varying control variables, providing efficient detection of abnormalities and enabling system resets or alerts when tasks are not executed correctly.
Smart Images

Figure 0007825268000004 
Figure 0007825268000005 
Figure 0007825268000006
Abstract
Description
[Technical Field]
[0001] The present invention relates to a task monitoring system and a task monitoring program for monitoring whether each task is being executed correctly and without abnormalities in a computer that executes multiple tasks each having its own periodic timer, and is particularly suitable for embedded microcomputers. [Background technology]
[0002] Conventionally, computers (including microcomputers that integrate functions such as calculation, storage, and input / output into a small number of integrated circuits; hereinafter simply referred to as "computers") that execute tasks with multiple different periodic timers have been equipped with software or hardware monitoring systems to monitor whether each of the tasks is being executed properly and without abnormalities, making it possible to identify abnormalities and take measures to return the system to a normal state.
[0003] As a conventional example of such a monitoring system, a monitoring system using a hardware watchdog timer (hereinafter referred to as "WDT") has long been known.
[0004] This WDT-based monitoring system determines whether the system is continuing to operate normally by connecting the computer and WDT internally or externally, and by suppressing the occurrence of traps and resets when a signal (watchdog signal) from the computer, which is generated within a specified period upon completion of a specific task, is input to the WDT within the timeout period.If the watchdog signal is not input after the timeout period has elapsed, the system will determine that an abnormality has occurred in the computer and send a reset signal to reset the computer, preventing abnormal computer operation.
[0005] Incidentally, in the case of a monitoring system using the conventional WDT, for example, as shown in the example of FIG. 5, when three types of tasks each having a different period timer (for example, 1 ms, 5 ms, and 10 ms) are executed by an interrupt with a higher priority in order of the shortest execution period, a typical system monitors by outputting a single watchdog signal tailored to the task executed with the longest period timer (10 ms) for the minimum time (not including execution error) as shown in FIG. 6, using an internal WDT monitoring system as shown in FIG. 7 or an external WDT monitoring system as shown in FIG. 8.
[0006] In other words, because conventional WDT-based monitoring systems focus only on the timer with the longest period, when operations are executed using interrupts with higher priority in order of shortest period timer, even if a task executed with a timer with a shorter period than the task executed with the longest period timer is not executed during the specified number of interrupt processing executions, a signal from the computer (watchdog signal) is input to the WDT within the timeout period, so the WDT cannot reset the computer and may not be able to prevent abnormal operation of a task executed with a short period timer.
[0007] A WDT monitoring system that estimates the interrupt priority of periodic timers and the maximum execution time considered for each periodic timer, monitors whether the overall maximum execution time exceeds a threshold with a margin, and can reliably reset the computer is disclosed, for example, in Japanese Patent Laid-Open Publication No. 51-052256 (Patent Document 1).
[0008] Furthermore, a method for preventing program runaway is disclosed, for example, in Japanese Patent Application Laid-Open No. 62-298844 (Patent Document 2), in which identification information of a modularized program is stored when the program is executed, and the program is terminated abnormally if the information is determined to be inconsistent (abnormal).
[0009] However, both of these methods focus on and monitor module processing, which is a collection of periodic timers and programs that have the lowest execution priority and which may result in long periodic tasks. As a result, there is a problem in that it is not possible to confirm whether tasks executed by timers with higher execution priority and shorter periods are being executed individually each time. [Prior art documents] [Patent documents]
[0010] [Patent Document 1] Japanese Patent Application Publication No. 51-052256 [Patent Document 2] Japanese Patent Application Publication No. 62-298844 Summary of the Invention [Problem to be solved by the invention]
[0011] The present invention aims to provide a monitoring system that, in a computer that executes multiple tasks with different periodic timers, enables reliable monitoring of tasks executed with short periodic timers using a method different from conventional monitoring systems. [Means for solving the problem]
[0012] The task monitoring system of the present invention, which has been made to solve the above problems, comprises a computer that executes multiple tasks, each having its own periodic timer, and a monitoring means provided inside or outside the computer, and is a monitoring system for confirming that each of the tasks is being executed without any abnormalities, wherein the monitoring means has a management variable for each task that varies depending on the execution status of the task, and monitors the task based on the value of the management variable.
[0013] According to the present invention, it is possible to provide a monitoring system in a computer having multiple tasks with individual periodic timers, which is capable of monitoring each task individually, regardless of the length of the period or the priority of the task, rather than managing the tasks based on time as in the conventional method.
[0014] In particular, when the control variable is set to an initial value and then varies for each task by being decremented when the task is executed and incremented when the task is completed, by varying the control variable at the timing of task execution and completion, it is possible to monitor whether each task is being executed and completed normally based on the value of the control variable.
[0015] Furthermore, when all the tasks are monitored using a control variable sum, which is the sum of the control variables, it is possible to monitor all the tasks more efficiently than when using individual control variables.
[0016] Furthermore, if the computer is equipped with a DAC (digital-analog converter), the monitoring means is equipped with a comparator circuit and an open collector circuit, the DAC (digital-analog converter) converts the control variable into an analog voltage and outputs it as a judgment signal, the comparator circuit compares the judgment signal with a threshold value to judge whether it is normal or abnormal, and the open collector circuit outputs the judgment result, the output judgment result can be used, for example, by an external hardware check mechanism to reset the computer, stop an actuator, or notify of an error.
[0017] Furthermore, in a task monitoring program for a computer that executes multiple tasks each having its own periodic timer, to confirm that each of the tasks is being executed without abnormalities, the program includes the steps of: setting an initial value of a control variable that is prepared for each task and that varies depending on the execution status of each task; varying the control variable for each task by decrementing it during execution and incrementing it at the end; comparing the control variable with a threshold value, or by comparing the sum of the control variables, which is the total value of the control variables, with a threshold value, to determine whether the execution of the task related to the control variable or all tasks is normal or abnormal; and outputting the results of the determination. This allows task monitoring to be performed on a program executed by a computer. [Effects of the Invention]
[0018] According to the present invention, in a computer that executes multiple tasks each having its own periodic timer, it is possible to reliably monitor tasks executed with short periodic timers by using a management variable that varies depending on the execution status of each task. [Brief explanation of the drawings]
[0019] [Figure 1] In a preferred embodiment of the task monitoring system of the present invention, an execution schedule showing the case where all tasks in a computer that executes multiple tasks each having an individual periodic timer are executed normally. [Figure 2] FIG. 2 is an explanatory diagram showing the control of management variables of each task in the embodiment shown in FIG. [Figure 3] FIG. 3 is an explanatory diagram showing an example of detecting an abnormality and whether each task is executed and completed normally in the control of the management variables shown in FIG. 2. [Figure 4] 2 is a hardware interface circuit for processing the control variables as signals in the embodiment shown in FIG. 1; [Figure 5]An execution schedule that shows the execution of multiple tasks under the shortest ideal conditions in a computer that executes multiple tasks each having its own periodic timer. [Figure 6] This is an execution schedule showing an example of WDT monitoring of the longest execution time in a computer that executes multiple tasks with individual periodic timers in a task monitoring system using a conventional WDT. [Figure 7] FIG. 1 is an explanatory diagram of an external WDT monitoring method in a task monitoring system using a conventional WDT. [Figure 8] FIG. 1 is an explanatory diagram of an internal WDT monitoring method in a task monitoring system using a conventional WDT. DETAILED DESCRIPTION OF THE INVENTION
[0020] Preferred embodiments of the present invention will be described below with reference to the drawings.
[0021] FIG. 1 shows an execution schedule for a computer that executes tasks each having its own individual and mutually different periodic timer (for example, three periods of 1 ms, 5 ms, and 10 ms) in a preferred embodiment of the task monitoring system of the present invention, where all tasks are executed normally. In this embodiment, the execution status of each task is managed by a variable-based management method that does not rely on time management, and it is confirmed that each task is being executed without any abnormalities. The fact that the execution status of each task is variable in this way is a feature of the present invention.
[0022] Table 1 below shows the execution status of each task in this embodiment, expressed as a management variable (2 bits, 4-value management), and its status. In Figure 1, the management variable for the task with a periodic timer of 1 ms is A, the management variable for the task with a periodic timer of 5 ms is B, and the management variable for the task with a periodic timer of 10 ms is C.
[0023] [Table 1]
[0024] In this embodiment, as shown in FIG. 1, the start and end of one control cycle are monitored for each task of a different cycle timer using the management variables shown in Table 1.
[0025] In more detail, as shown in Figure 2, the initial value of the control variable is first set to 2 (10), and then the control variable for each task is decremented (-1) when the task is executed and incremented (+1) when the task is completed.
[0026] In this case, in a task of a specific periodic timer, the time between the execution of the task and the execution of the next task is based on the periodic timer (black arrow), and the time between the execution of the task and the end of the task is not specifically defined.
[0027] In this way, the control variables A, B, and C each take on four values: 0, 1, 2, and 3, with the normal value being 1 or 2 (see Table 1 above).When a task is being executed normally, the values of the control variables A, B, and C will fluctuate between 1 and 2 due to a decrement (-1) when the task is executed and an increment (+1) when the task ends.
[0028] That is, in this embodiment, when the values of the control variables A, B, and C are 1 or 2, it can be determined that the execution status of the task corresponding to each control variable is normal.
[0029] Conversely, as shown in Figure 3, for each task, a decrement (-1) is made when the task is executed and an increment (+1) is made when the task ends (for the n-1th task, the nth task, and so on). If the n-1th task does not end or the next nth task is not executed, the addition or subtraction will cause the control variable to fall outside the normal value range and become 0 or 3, so an abnormal task execution can be confirmed by the value of the control variable.
[0030] Furthermore, by using the sum of the control variables X, which is the sum of the control variables A, B, and C for each of the three types of tasks shown in this embodiment, it is possible to check whether each task is being executed and completed normally.
[0031] We will explain how to determine whether the execution status of each task is normal or abnormal using the control variables A, B, and C and the sum of the control variables X. Table 2 below shows the relationship between the values of the control variables A, B, and C and the sum of the control variables X.
[0032] [Table 2]
[0033] As such, the control variables A, B, and C each take on four values: 0, 1, 2, and 3, with the normal value being 1 or 2 (see Table 1 above). Therefore, when the sum of these values is taken as the control variable sum X, if the value is between 3 and 6, it falls within the normal range, and the execution status of each task can be determined to be normal.
[0034] However, if the control variable sum X is outside the normal range of 3 to 6, that is, if the control variable sum X is 0 to 2 or 7 to 9, it is an abnormal value, and the execution status of each task can be determined to be abnormal.
[0035] In this embodiment, the control variables are shown for four states, but by increasing the number of state bit digits to other states, it becomes possible to set more precise thresholds, thereby strengthening or mitigating abnormality detection.
[0036] The results of the judgment of the execution status of each task using the control variable or the sum of the control variables are output, so that, for example, if the judgment result is abnormal, it is possible to reset the computer, stop the actuator, or notify an error.
[0037] Furthermore, Figure 4 shows a hardware interface circuit (analog monitoring circuit) for performing external monitoring using the control variables of each task in the embodiment shown in Figure 1 as signals, and has a comparator circuit (COMP) that processes signals output from a DAC (digital-to-analog converter, hereinafter simply referred to as "DAC") provided in the computer, a latch circuit (self-holding circuit), and an open collector circuit.
[0038] First, the control variable used in the embodiment shown in FIG. 1 is converted into an analog voltage by the DAC and output as a judgment signal.
[0039] Table 3 below shows the correlation between the digital value and the analog voltage value when the control variable sum X, which is the total value of the control variables A, B, and C for the three types of tasks in the embodiment shown in Fig. 1, is output as an analog voltage of 0 to 5 V by the DAC as a judgment signal. Note that the DAC can use the control variable sum X as it is, as 5 V × control variable sum X ÷ MAX value.
[0040] [Table 3]
[0041] Next, the analog voltage value that is the outputted determination signal is compared with a threshold value by a comparator circuit (COMP) to determine whether it is normal or abnormal.
[0042] As shown in Table 3, in this embodiment, an upper threshold and a lower threshold are set, and the range between the upper threshold and the lower threshold is considered to be the normal range, and values above the upper threshold and below the lower threshold are considered to be abnormal values.
[0043] As specific numerical values, 3.61V is applied as the upper threshold and 1.39V as the lower threshold, and each threshold is set to the midpoint between the normal range and the abnormal value, but this is not limited to this.
[0044] At this time, by inputting the result of the determination output from the comparator circuit (COMP) to a latch circuit (self-holding circuit), the abnormal state can be maintained until an abnormal state release signal is input.
[0045] The judgment result output from the comparator circuit is output to the outside by the open collector circuit, and monitoring can be performed using a hardware check mechanism, such as a reset operation using a computer reset circuit, a stop operation using a stop circuit of an actuator drive circuit, or an alert using a warning indicator light.
[0046] In the present invention, the number of tasks and the number of individual periodic timers are not limited to three as shown in this embodiment, but may be any number.
[0047] The task monitoring system of the present invention can also be realized as a task monitoring program executed on a computer.
[0048] In other words, the task monitoring program of the present invention is a task monitoring program for confirming that each of a plurality of tasks, each having its own periodic timer, is being executed without abnormalities in a computer that executes the tasks, and executes the following steps: setting an initial value of a control variable that is prepared for each task and varies depending on the execution status of each task; varying the control variable for each task by decrementing it during execution and incrementing it at the end; comparing the control variable with a threshold value, or by comparing the sum of the control variables, which is the total value of the control variables, with a threshold value, to determine whether the execution of the task related to the control variable or all tasks is normal or abnormal; and outputting the result of the determination.
[0049] As described above, according to the present invention, in a computer that executes multiple tasks each having its own periodic timer, by using a management variable that varies depending on the execution status of each task, it is possible to reliably monitor tasks that are executed with a short periodic timer.
Claims
1. A monitoring system comprising a computer that executes a plurality of tasks, each having a periodic timer, and a monitoring means provided inside or outside the computer, for confirming that each of the tasks is being executed without an error, the monitoring means has a control variable for each task that varies depending on the execution state of the task, and monitors the task based on the value of the control variable; A task monitoring system characterized in that the management variable is set to an initial value and then varies for each task by being decremented when the task is executed and incremented when the task is completed.
2. the computer is equipped with a DAC (digital-to-analog converter); the monitoring means includes a comparator circuit and an open collector circuit; The task monitoring system according to claim 1, characterized in that the DAC (digital-analog converter) converts the management variable into an analog voltage and outputs it as a judgment signal, the comparator circuit compares the judgment signal with a threshold value to determine whether it is normal or abnormal, and the open collector circuit outputs the result of the judgment.
3. 1. A task monitoring program for verifying that each task is being executed normally in a computer that executes a plurality of tasks each having an individual periodic timer, the program comprising: setting an initial value of a management variable that is prepared for each task and that varies depending on the execution state of each task; fluctuating the control variable by decrementing it when the task is executed and incrementing it when the task is completed; a step of comparing the control variable with a threshold value to determine whether execution of a task related to the control variable is normal or abnormal; outputting the result of the determination; A task monitoring program that executes the above steps.
Citation Information
Patent Citations
Maikurokonpyuutano puroguramukanshihoshiki
JP1976052256A
Program runaway prevention system
JP1987298844A
Controller for automatic machine
JP2009271833A