DEENESPTFRRUARHIKOZHNL

类 apext::phm::WatchdogInterface

[SWS_PHM_01257] Upstream: RS_PHM_00101

class WatchdogInterface {...};

class for interface to hardware watchdog Note: class WatchdogInterface although identifiable in code as an interface, it is a PlatformExtension - i.e. no modelled interface - nothing to do here

Header-Datei#include "apext/phm/watchdog_interface.h"
Forwarding-Header#include "apext/phm/phm_fwd.h"
Scopenamespace apext::phm

用户指南人工智能生成

将硬件看门狗控制和错误响应连接到 Platform Health Management。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: ead3ce845973 来源 未决问题(3)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

将硬件看门狗控制和错误响应连接到 Platform Health Management。

类 apext::phm::WatchdogInterface 作为平台扩展,构成了 Platform Health Management 与物理硬件看门狗之间的接口。PHM 在正常操作期间通过 AliveNotification() 周期性地通知该接口,而在未收到通知时,该接口必须自主触发看门狗响应 [SWS_PHM_01255]。在发生严重系统错误时,PHM 还可以通过 FireWatchdogReaction() 直接强制硬件看门狗执行错误响应 [SWS_PHM_01256]。作为核心边界条件,这两个方法都被指定为线程安全,但不是异常安全的。

上下文

C++ 类 apext::phm::WatchdogInterface 在 AUTOSAR Adaptive 的 Platform Health Management(PHM)中代表物理硬件看门狗的接口。作为平台扩展(PlatformExtension),它并不映射建模的 AUTOSAR 端口接口,而是作为 PHM 服务与底层硬件之间的特定于供应商的桥梁。PHM 监控进程和平台组件的执行。为了可靠地防范 PHM 本身发生故障或阻塞,WatchdogInterface 连接了外部或内部硬件监控。PHM 通过方法 AliveNotification() 周期性地向接口 [SWS_PHM_01255] 报告其功能正常。如果发生严重系统错误,PHM 可以通过函数 FireWatchdogReaction() 有针对性地请求硬件端错误响应 [SWS_PHM_01256]。

WatchdogKontext PHM PHM WatchdogInterface WatchdogInterface PHM->WatchdogInterface AliveNotification() / FireWatchdogReaction() HardwareWatchdog HardwareWatchdog WatchdogInterface->HardwareWatchdog Triggerung / Watchdog-Reaktion

上下文图:WatchdogInterface 在 PHM 和硬件看门狗之间的集成。来源:[SWS_PHM_01255]、[SWS_PHM_01256]

生命周期

由于 apext::phm::WatchdogInterface 用作平台扩展,接口实现的实例化及其与硬件驱动程序的连接大概率在 PHM 服务的初始化期间特定于平台地执行。 问题 Q-c2235d5c87e0a675 (未决)该实例的生命周期通常与 PHM 的运行时间绑定,因此在平台运行期间不打算进行具有多次创建或销毁的动态生命周期。关于并发性,两个接口函数 AliveNotification() 和 FireWatchdogReaction() 都被显式声明为线程安全(thread-safe)[SWS_PHM_01255]、[SWS_PHM_01256]。这使得 PHM 能够从不同的内部工作线程并行地向看门狗接口传递保活信号和错误报告,而无需调用方进行同步。

使用路径

PHM 与接口之间的典型交互分为常规监控周期和错误升级:

  • 周期性保活报告:PHM 在配置的周期时间内重复调用 AliveNotification() [SWS_PHM_01255]。该周期时间不必与硬件的实际触发周期一致;实现可能会在内部对用于控制物理看门狗的间隔进行缓冲或缩放 [SWS_PHM_01255]。 问题 Q-a6c08f102f09c8c1 (未决)
  • 硬件触发:在收到定期报告时,WatchdogInterface 确保按时服务硬件看门狗单元。
  • 针对性错误指示:如果 PHM 在受监控的实体中检测到不可恢复的状态(unrecoverable),它会立即调用 FireWatchdogReaction() [SWS_PHM_01256]。
周期性监控及看门狗响应触发PHMWatchdogInterfaceHardware-WatchdogUse Case: 常规监控周期loopKonfigurierte ZykluszeitAliveNotification()Hardware-Watchdog bedienenUse Case: FehlerfallaltPHM fordert Fehlerreaktion anFireWatchdogReaction()触发看门狗响应存活报告缺失(超时)Timeout erkennen触发看门狗响应

时序图:定期保活信号传输和触发看门狗响应。来源:[SWS_PHM_01255]、[SWS_PHM_01256]

错误场景

该接口支持两种互补的机制来处理系统故障:

一方面,未收到通知的被动情况会导致系统反应:如果 PHM 未在配置的时间段内通过 AliveNotification() 进行报告,则 WatchdogInterface 有义务自主启动看门狗响应 [SWS_PHM_01255]。从而通过硬件可靠地拦截 PHM 服务本身的崩溃或死锁。

另一方面,存在主动错误路径:通过显式调用 FireWatchdogReaction() 触发看门狗的已定义错误响应 [SWS_PHM_01256]。在这两种情况下,系统级的最终影响通常可能包括硬件复位或转换到安全状态。 问题 Q-817baa072cc94a19 (未决)

关于代码中的错误行为,两个成员函数均被指定为非异常安全(not exception safe)[SWS_PHM_01255]、[SWS_PHM_01256]。因此,调用组件不能依赖任何异常处理保证,并且接口的实现不得发出未处理的 C++ 异常。

本指南总结了符合 AUTOSAR Adaptive R25-11 的 apext::phm::WatchdogInterface 规范。

UML 类图

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G napext__phm__WatchdogInterface47 WatchdogInterface + AliveNotification() + FireWatchdogReaction()

方法

Called cyclically by PHM in configurable cycle time. Note: This time might differ from the cycle time of triggering the "real" hardware watchdog. If PHM does not report aliveness in configured time, WatchdogInterface shall initiate watchdog reaction

void AliveNotification ();

Interface to fire an error reaction of the Watchdog.

void FireWatchdogReaction ();

方法文档

函数 AliveNotification [SWS_PHM_01255] Upstream: RS_PHM_00101, RS_PHM_09240

void AliveNotification ();

Called cyclically by PHM in configurable cycle time. Note: This time might differ from the cycle time of triggering the "real" hardware watchdog. If PHM does not report aliveness in configured time, WatchdogInterface shall initiate watchdog reaction

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: cb75c45d42c3 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

来自头文件 apext/phm/watchdog_interface.h 的函数 AliveNotification 属于类 apext::phm::WatchdogInterface,用于 Platform Health Management(PHM)的周期性存活监控 [SWS_PHM_01255]。该接口具有签名 void AliveNotification(),不接受任何参数,也不返回任何值 [SWS_PHM_01255]。

调用上下文和时间行为

PHM 在可配置的周期时间内周期性调用 AliveNotification [SWS_PHM_01255]。该调用频率在逻辑上与实际物理硬件看门狗的触发解耦,因此 PHM 的配置周期可以不同于硬件看门狗的触发时间 [SWS_PHM_01255]。

故障反应和失效场景

如果 PHM 未在其配置的时间间隔内成功报告其存活状态,WatchdogInterface 将被指示发起看门狗反应 [SWS_PHM_01255]。未定义特定的错误码。解释:由于该接口被归类为非异常安全,意外的错误状态可能会作为 C++ 异常传播到调用方上下文中 [SWS_PHM_01255]。 问题 Q-a9e59a992db9913f (未决)

并发与异常安全性

该函数被规范定义为线程安全的(thread-safe),因此允许并发访问,但被视为非异常安全的(not exception safe)[SWS_PHM_01255]。

该文本由 AI 创建,总结了 AUTOSAR Adaptive R25-11 的规范状态。

Header-Datei#include "apext/phm/watchdog_interface.h"
Scopeclass apext::phm::WatchdogInterface
Exception-Sicherheitnot exception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
None

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PHM_01255
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PHM_01255@rel:R25-11#39d8dcf4
Content hash
39d8dcf4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_PlatformHealthManagement.pdf#nameddest=SWS_PHM_01255
Status: valid/unmigrated Version: rel:R25-11#3204f230 Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PHM_01255@rel:R25-11#3204f230
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#756ef89a2026-09-30
  • R24-11rel:R24-11#b0affe0c2026-10-14
  • R25-11rel:R25-11#3204f2302026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 FireWatchdogReaction [SWS_PHM_01256] Upstream: RS_PHM_00101

void FireWatchdogReaction ();

Interface to fire an error reaction of the Watchdog.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 28a89e0724c4 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 FireWatchdogReaction 用作 Platform Health Management(PHM)模块内的专用接口,以有针对性地触发看门狗的故障反应 [SWS_PHM_01256]。它分配在类 apext::phm::WatchdogInterface 的作用域内,并通过头文件 apext/phm/watchdog_interface.h 提供 [SWS_PHM_01256]。

使用时应注意以下几个方面:

  • 调用和接口:凭借签名 void FireWatchdogReaction ();,该函数不接受任何传递参数,且不返回任何值 [SWS_PHM_01256]。该调用直接触发看门狗的故障反应。
  • 并发性:该操作被规范定义为 thread-safe [SWS_PHM_01256]。因此,可以从多个线程并发调用它,而无需额外的外部同步。
  • 异常安全性与错误处理:该函数声明为 not exception safe [SWS_PHM_01256]。解释:由于不保证异常安全性,在发生错误时出现的异常可能会直接传播到调用方,因此调用方应对可能的异常做好准备。 问题 Q-f53d689332369cd7 (未决)

因此,该函数提供了一个标准化的访问点,以便在发生严重错误时主动干预看门狗的行为并启动已定义的保护措施 [SWS_PHM_01256]。

该文本由 AI 生成。它基于 AUTOSAR Adaptive R25-11。

Header-Datei#include "apext/phm/watchdog_interface.h"
Scopeclass apext::phm::WatchdogInterface
Exception-Sicherheitnot exception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
None

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PHM_01256
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PHM_01256@rel:R25-11#21b60dc1
Content hash
21b60dc1
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_PlatformHealthManagement.pdf#nameddest=SWS_PHM_01256
Status: valid/unmigrated Version: rel:R25-11#9d382947 Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PHM_01256@rel:R25-11#9d382947
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#8b20aac12026-09-30
  • R24-11rel:R24-11#e80c13872026-10-14
  • R25-11rel:R25-11#9d3829472026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill