Alive Supervision

       看门狗(Watchdog)是计算机系统中的一个硬件或软件机制,用于监视系统是否按预期运行。如果系统发生故障或停止响应,看门狗会采取措施,如重置系统或引发其他恢复操作,以试图恢复系统到正常状态。WdgM是指某款芯片或系统中实现看门狗监控的模块。看门狗(Watchdog)是计算机系统中的一个硬件或软件机制,用于监视系统是否按预期运行。如果系统发生故障或停止响应,看门狗会采取措施,如重置系统或引发其他恢复操作,以试图恢复系统到正常状态。WdgM是指某款芯片或系统中实现看门狗监控的模块。

WdgM一共支持三种形式的看门狗监控方式,分别是AliveSpuervision 、Deadline Supervision、 Logical Supervision,本文主要介绍AliveSpuervision的工作原理。

Aliveness monitors the frequency of hits of checkpoints. For example, the algorithm could expect a sensor to report its measurements on a regular basis, and a certain task needs to process this data periodically. If a task stops reporting (alive sign is lost or too infrequent) or starts reporting too often, then the aliveness of that task is violated.

Aliveness监控检查点命中的频率。例如,该算法可以期望传感器定期报告其测量结果,并且某个任务需要定期处理这些数据。如果一个任务停止报告(活信号丢失或太不频繁)或开始报告太频繁,那么该任务的活性就被违反了。

Alive supervision is associated with one checkpoint in a supervised entity. If you need to monitor only the frequency with which a task is called, you can define a supervised entity that contains only one checkpoint with the corresponding aliveness parameters.

动态监督与被监督实体中的一个检查点相关联。如果你只需要监控一个任务被调用的频率,你可以定义一个只包含一个检查点的被监督实体,并带有相应的活度参数。

Irregular calls of the WdgM main function or the omission of calls of WdgM_CheckPointReached () would most likely result in aliveness violation. When alive supervision for a checkpoint is activated, then that checkpoint must be regularly called for the entire period during which the supervised entity is active, otherwise aliveness violation will be detected. In the first supervision cycle, the alive counter evaluationbesuppressedbytheparameter WdgMFirstCycleAliveCounterReset.

不规则调用WdgM主函数或遗漏调用WdgM_CheckPointReached()很可能导致活动性违规。当激活检查点的活监督时,则必须在被监督实体活动的整个期间定期调用该检查点,否则将检测到活性违规。在第一个监管周期中,对计数进行评估是抑制通过的参数WdgMFirstCycleAliveCounterReset.

It is important to consider which aliveness parameters are better for a specific situation.The example below shows how to choose the appropriate alive supervision parameters:

重要的是要考虑哪种活度参数更适合特定的情况.下面的例子展示了如何选择合适的活体监督参数:

WdgMExpectedAliveIndications:

Defines how many alive indications (checkpoint reached calls) are expected within one supervision reference cycle.定义在一个监督参考周期内预期有多少次打卡(检查点到达的调用)。

WdgMSupervisionReferenceCycle:

Defines the supervision reference cycle length as a number of supervision           cycles(WdgMSupervisionCycle).将监管参考周期长度定义为监管周期的个数.

WdgMMinMargin :
Defines the lower tolerance of expected alive indications.定义打卡次数的下限.
WdgMMaxMargin :
Defines the upper tolerance of expected alive indications.定义打卡次数的上限.
Hence, the allowed number of indications is in the range
[WdgMExpectedAliveIndications - WdgMMinMargin,WdgMExpectedAliveIndications + WdgMMaxMargin]
因此,允许的数量在范围内[wdgmexpectedaliveIndications- WdgMMinMargin,wdgmexpectedaliveindication + WdgMMaxMargin]
In contrast to the deadline and program flow reference cycle the alive supervision cycle begins with the WdgM startup. The alive supervision in the very first cycle can be influenced by the parameter WdgMFirstCycleAliveCounterReset. This is because each alive counter is evaluated once per supervision reference cycle. This means that the supervision reference cycle is processed from the system startup on and during the status OK and FAILED of the corresponding supervised entity. If the supervised entity is in the status EXPIRED, then the supervision reference cycle is not needed anymore. If the supervised entity is in the status DEACTIVATED, then the supervision reference cycle is frozen. It is restarted if the supervised entity is activated again.
与截止日期和程序流程参考周期相反,动态监督周期从WdgM启动开始。第一个周期中的动态监督会受到参数WdgMFirstCycleAliveCounterReset的影响。这是因为每个动态计数器在每个监督引用周期中都会求值一次。这意味着监督参考周期从系统启动时开始处理,并在相应被监督实体的OK和FAILED状态期间处理。如果被监管实体处于EXPIRED状态,则不再需要监管参考周期。如果被监管实体处于DEACTIVATED状态,则监管参考周期被冻结。如果被监管实体再次激活,则重新启动。
There are several ways for monitoring the task given in the example above. Below, one
variant is given:
有几种方法可以监视上面示例中给出的任务。下面给出了一种变体:
Set
> WdgMExpectedAliveIndications=1
> WdgMSupervisionReferenceCycle=1
> WdgMMinMargin=1
> WdgMMaxMargin=0
This means the WdgM should expect 1 or 0 (WdgMExpectedAliveIndications WdgMMinMargin) occurrences within one supervised reference cycle, which is fixed to 20ms (which is one WdgM supervision cycle).这意味着WdgM应该期望在一个监督参考周期内出现1或0,该周期固定为20ms(这是一个WdgM监督周期)。
                 A task being monitored during one WdgM supervision cycle (20ms)
However, if the task stops being executed it will not be detected, because zero alive indications per supervised reference cycle are tolerated. Therefore, this choice of setting aliveness parameters is not very good.然而,如果任务停止执行,它将不会被检测到,因为每个监督引用周期的零活指示是可以容忍的。因此,这种设置活度参数的选择并不是很好。
second variant:
> WdgMExpectedAliveIndications=2
> WdgMSupervisionReferenceCycle=2
> WdgMMinMargin=1
> WdgMMaxMargin=0
This means the WdgM should expect 1 or 2 alive indications within one supervisedreference cycle, which is fixed to 40ms (and which is two WdgM supervision cycles).这意味着WdgM在一个监督下应该有1或2个动态参考周期,固定为40ms(这是两个WdgM监督周期)。
              A task being monitored during two WdgM supervision cycles (40ms) 
This configuration solves the problem of detecting the disappearance of the task. However, the reaction time for error detection doubles from 20 to 40ms.此配置解决了检测任务消失的问题。但是,错误检测的反应时间从20毫秒增加到40ms。
A third variant would be to set the supervision reference cycle to the least common multiple of the WdgM supervision cycle and the task period. In the example given above this would be 60ms (three WdgM supervision cycles). In this case, we expect exactly 2 alive indications. Hence, the minimum and maximum margins are both 0.第三种变体是将监督参考周期设置为WdgM监督周期和任务周期的最小公倍数。在上面给出的例子中,这将是60ms(三个WdgM监督周期)。在这种情况下,我们期望正好有2个动态周期。因此,最小和最大边际都是0。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值