DEENESPTFRRUARHIKOZHNL

结构体 ara::diag::CounterBased

[SWS_DM_00538] Upstream: RS_Diag_04068

struct CounterBased {...};

Represents the parameters for counter-based debouncing.

Header-Datei#include "ara/diag/monitor_types.h"
Forwarding-Header#include "ara/diag/diag_fwd.h"
Scopenamespace ara::diag

用户指南人工智能生成

配置用于监控器基于计数器的去抖动的阈值、步长和跳跃值。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 60957358c6ec 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

配置用于监控器基于计数器的去抖动的阈值、步长和跳跃值。

结构体 ara::diag::CounterBased 定义了诊断事件基于计数器的去抖动的阈值、步长和跳跃参数 [SWS_DM_00538]。它由应用程序实例化并传递给 ara::diag::Monitor 的构造函数,以确定故障和正常判定的标准 [SWS_DM_00549]。若 Diagnostic Extract(DEXT)中未存储具优先级的去抖数据,Diagnostic Management 将使用这些参数进行计数器更新。

上下文

结构体 ara::diag::CounterBased 表示根据 AUTOSAR Adaptive Platform 规范 SWS Diagnostics §7.3.4.1.5.1 “Counter-based debouncing” 进行诊断事件基于计数器的去抖动的配置参数 [SWS_DM_00538]。在诊断子系统内部,它用于在应用的监控器实现与 Diagnostic Management(DM)之间交换去抖参数。

交互主要通过四个接口伙伴进行:

CounterBasedContext Application Diagnostic Application CounterBased ara::diag::CounterBased Application->CounterBased konfiguriert Monitor ara::diag::Monitor Application->Monitor erzeugt CounterBased->Monitor uebergibt Parameter DM 诊断管理 Monitor->DM meldet Aktionen DEXT DEXT Konfiguration DEXT->DM konfiguriert vorrangig

上下文图:应用程序、监控器、CounterBased、Diagnostic Management 与 DEXT 的交互。来源:[SWS_DM_00538]、[SWS_DM_00549]、[SWS_DM_01099]、[SWS_DM_01101]。

生命周期

作为 C++ 数据结构(struct)SWS Diagnostics §8.41.2 “Struct: CounterBased”,CounterBased 由应用的软件组件在栈或堆上作为纯值容器创建。其生命周期通常局限于创建 ara::diag::Monitor 之前的配置和初始化阶段。

在定义属性后,该结构体按值传递给 Monitor 的构造函数 [SWS_DM_00549]。结构体本身不保持内部动态状态,也没有状态机;持续的计数器管理完全由 Diagnostic Management 负责。由于 CounterBased 被设计为被动数据结构且不具备内部同步机制,按推断在传递给监控器之前应在线程局部或同步进行配置。

使用路径

典型用法分为去抖参数的定义、传递给监控器以及运行时的计数器评估:

  1. 应用程序创建 CounterBased 的实例并设置限值:用于故障判定的 failedThreshold [SWS_DM_00621] 以及用于正常检测的 passedThreshold [SWS_DM_00622]。
  2. 步长通过针对报告故障状态的 failedStepsize [SWS_DM_00623] 和针对正常报告的 passedStepsize [SWS_DM_00624] 来定义。
  3. 可选择配置跳跃式调整:通过 useJumpToFailed [SWS_DM_00627] 和 failedJumpValue [SWS_DM_00625] 激活跳跃到最小故障值。类似地,useJumpToPassed [SWS_DM_00628] 和 passedJumpValue [SWS_DM_00626] 控制向正常状态方向的跳跃。
  4. 填充后的结构体被传递给 Monitor 的构造函数 [SWS_DM_00549]。如果没有 DEXT 定义,DM 将使用这些值 [SWS_DM_01101]。
  5. 在运行时,监控功能通过 ReportMonitorAction 报告监控器动作 SWS Diagnostics §7.3.4.1.5.1 “Internal debounce counter incrementation”。在 kPrefailed 时,DM 检查可能的跳跃条件 [SWS_DM_00022],并将计数器递增 failedStepsize [SWS_DM_00875]。
  6. 当计数器达到 failedThreshold 时,DM 将该事件归类为 kFinallyDefective [SWS_DM_00024]。使用 passedStepsize [SWS_DM_00876] 的正常报告亦同理。
初始化与基于计数器的消抖ApplicationCounterBased监视器诊断管理Use Case: 参数配置和 Monitor 创建设置阈值、步长和跳跃值Monitor(specifier, notifier, counterBased)altDEXT-Parameter vorhandenDEXT-Werte nutzen (CounterBased ignoriert)不存在 DEXT 参数CounterBased-Werte verwendenUse Case: Laufzeit-EntprellungReportMonitorAction(kPrefailed)Ereignisstatus aktualisierenoptuseJumpToFailed == true && Zaehler < failedJumpValue将计数器设置为 failedJumpValueZaehler um failedStepsize inkrementierenoptZaehler >= failedThreshold将计数器限制为 failedThresholdStatus kFinallyDefective setzen

时序图:从参数配置和监控器初始化到计数器判定的流程。来源:[SWS_DM_00549]、[SWS_DM_00875]、[SWS_DM_00022]、[SWS_DM_00024]。

错误场景

在使用 CounterBased 时,必须注意若干边界条件和优先级规则:

  • DEXT 优先级冲突:如果 DEXT 中存在去抖参数,DM 将完全忽略在 CounterBased 中定义的参数 [SWS_DM_01099]。当应用程序开发人员在静态 DEXT 值处于活动状态时仍期望通过构造函数进行动态参数修改,便会导致错误配置。
  • 缺少 DEXT 值:如果 DEXT 中未提供任何规范,DM 则强制依赖于构造函数提供有效的 CounterBased 实例 [SWS_DM_01101]。
  • 超过阈值:如果内部去抖计数器因累加 failedStepsize 而超过阈值 failedThreshold,DM 会将计数器精确重置为该阈值并判定故障 [SWS_DM_00024]、[SWS_DM_00875]。
  • 条件跳跃逻辑:如果设置了 useJumpToFailed,则仅当递增前的计数器值严格小于 failedJumpValue 时,才会执行向 failedJumpValue 的跳跃 [SWS_DM_00022]。对于 useJumpToPassed 同样,计数器必须大于 passedJumpValue [SWS_DM_00023]。

本指南基于 AUTOSAR Adaptive Platform R25-11 规范,并总结了对基于计数器的去抖动的要求。

成员图

类图

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

G nara__diag__CounterBased25 «struct» CounterBased + failedJumpValue + failedStepsize + failedThreshold + passedJumpValue + passedStepsize + passedThreshold + useJumpToFailed + useJumpToPassed

详细视图

请在大纲中选择一个条目。

常量

failed to jump value

std::int16_t failedJumpValue;

Stepsize per pre-failed report.

std::uint16_t failedStepsize;

Threshold until qualified failed.

std::int16_t failedThreshold;

passed to jump value

std::int16_t passedJumpValue;

Stepsize per pre-passed report.

std::uint16_t passedStepsize;

Threshold until qualified passed.

std::int16_t passedThreshold;

is jump supported

bool useJumpToFailed;

is jump supported

bool useJumpToPassed;

常量 / 变量文档

变量 failedJumpValue [SWS_DM_00625] Upstream: RS_Diag_04068

std::int16_t failedJumpValue;

failed to jump value

Header-Datei#include "ara/diag/monitor_types.h"
Scopestruct ara::diag::CounterBased
SymbolfailedJumpValue
Typstd::int16_t

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

Record
AUTOSAR/AP/record/SWS_DM_00625
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00625@rel:R25-11#5792309b
Content hash
5792309b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00625
Status: valid/unmigrated Version: rel:R25-11#dce9c004 Versionshistorie & Revisions (1 transition, 7 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_DM_00625@rel:R25-11#dce9c004
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#3d8ec9702026-09-30
  • R20-11rel:R20-11#f08528012026-10-14
  • R21-11rel:R21-11#3d8d66772026-10-14
  • R22-11rel:R22-11#4e10bb362026-10-14
  • R23-11rel:R23-11#dce9c0042026-10-14
  • R24-11rel:R24-11#dce9c0042026-10-14
  • R25-11rel:R25-11#dce9c0042026-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

变量 failedStepsize [SWS_DM_00623] Upstream: RS_Diag_04068

std::uint16_t failedStepsize;

Stepsize per pre-failed report.

Header-Datei#include "ara/diag/monitor_types.h"
Scopestruct ara::diag::CounterBased
SymbolfailedStepsize
Typstd::uint16_t

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

Record
AUTOSAR/AP/record/SWS_DM_00623
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00623@rel:R25-11#3ad064d0
Content hash
3ad064d0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00623
Status: valid/unmigrated Version: rel:R25-11#dafec4f4 Versionshistorie & Revisions (1 transition, 7 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_DM_00623@rel:R25-11#dafec4f4
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#d4a093e42026-09-30
  • R20-11rel:R20-11#d8c07df52026-10-14
  • R21-11rel:R21-11#00dbada62026-10-14
  • R22-11rel:R22-11#ad00343e2026-10-14
  • R23-11rel:R23-11#dafec4f42026-10-14
  • R24-11rel:R24-11#dafec4f42026-10-14
  • R25-11rel:R25-11#dafec4f42026-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

变量 failedThreshold [SWS_DM_00621] Upstream: RS_Diag_04068

std::int16_t failedThreshold;

Threshold until qualified failed.

Header-Datei#include "ara/diag/monitor_types.h"
Scopestruct ara::diag::CounterBased
SymbolfailedThreshold
Typstd::int16_t

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

Record
AUTOSAR/AP/record/SWS_DM_00621
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00621@rel:R25-11#67a8bfab
Content hash
67a8bfab
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00621
Status: valid/unmigrated Version: rel:R25-11#08353fef Versionshistorie & Revisions (1 transition, 7 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_DM_00621@rel:R25-11#08353fef
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#c3037cc02026-09-30
  • R20-11rel:R20-11#25e7cfaa2026-10-14
  • R21-11rel:R21-11#196f4ac32026-10-14
  • R22-11rel:R22-11#6af287f12026-10-14
  • R23-11rel:R23-11#08353fef2026-10-14
  • R24-11rel:R24-11#08353fef2026-10-14
  • R25-11rel:R25-11#08353fef2026-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

变量 passedJumpValue [SWS_DM_00626] Upstream: RS_Diag_04068

std::int16_t passedJumpValue;

passed to jump value

Header-Datei#include "ara/diag/monitor_types.h"
Scopestruct ara::diag::CounterBased
SymbolpassedJumpValue
Typstd::int16_t

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

Record
AUTOSAR/AP/record/SWS_DM_00626
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00626@rel:R25-11#b0e333e7
Content hash
b0e333e7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00626
Status: valid/unmigrated Version: rel:R25-11#ced89aeb Versionshistorie & Revisions (1 transition, 7 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_DM_00626@rel:R25-11#ced89aeb
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#48fa9fd72026-09-30
  • R20-11rel:R20-11#bca12a352026-10-14
  • R21-11rel:R21-11#ffcfafd22026-10-14
  • R22-11rel:R22-11#06c86bc12026-10-14
  • R23-11rel:R23-11#ced89aeb2026-10-14
  • R24-11rel:R24-11#ced89aeb2026-10-14
  • R25-11rel:R25-11#ced89aeb2026-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

变量 passedStepsize [SWS_DM_00624] Upstream: RS_Diag_04068

std::uint16_t passedStepsize;

Stepsize per pre-passed report.

Header-Datei#include "ara/diag/monitor_types.h"
Scopestruct ara::diag::CounterBased
SymbolpassedStepsize
Typstd::uint16_t

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

Record
AUTOSAR/AP/record/SWS_DM_00624
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00624@rel:R25-11#ee343a07
Content hash
ee343a07
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00624
Status: valid/unmigrated Version: rel:R25-11#9a3eeb83 Versionshistorie & Revisions (1 transition, 7 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_DM_00624@rel:R25-11#9a3eeb83
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#fe1d69922026-09-30
  • R20-11rel:R20-11#1453700f2026-10-14
  • R21-11rel:R21-11#c63f63342026-10-14
  • R22-11rel:R22-11#4d2e11a52026-10-14
  • R23-11rel:R23-11#9a3eeb832026-10-14
  • R24-11rel:R24-11#9a3eeb832026-10-14
  • R25-11rel:R25-11#9a3eeb832026-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

变量 passedThreshold [SWS_DM_00622] Upstream: RS_Diag_04068

std::int16_t passedThreshold;

Threshold until qualified passed.

Header-Datei#include "ara/diag/monitor_types.h"
Scopestruct ara::diag::CounterBased
SymbolpassedThreshold
Typstd::int16_t

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

Record
AUTOSAR/AP/record/SWS_DM_00622
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00622@rel:R25-11#9e0cecc0
Content hash
9e0cecc0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00622
Status: valid/unmigrated Version: rel:R25-11#24f4cdaa Versionshistorie & Revisions (1 transition, 7 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_DM_00622@rel:R25-11#24f4cdaa
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#ce4c070e2026-09-30
  • R20-11rel:R20-11#a6d5e9c72026-10-14
  • R21-11rel:R21-11#72e5c6f22026-10-14
  • R22-11rel:R22-11#8565f7cc2026-10-14
  • R23-11rel:R23-11#24f4cdaa2026-10-14
  • R24-11rel:R24-11#24f4cdaa2026-10-14
  • R25-11rel:R25-11#24f4cdaa2026-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

变量 useJumpToFailed [SWS_DM_00627] Upstream: RS_Diag_04068

bool useJumpToFailed;

is jump supported

Header-Datei#include "ara/diag/monitor_types.h"
Scopestruct ara::diag::CounterBased
SymboluseJumpToFailed
Typbool

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

Record
AUTOSAR/AP/record/SWS_DM_00627
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00627@rel:R25-11#1aad89ca
Content hash
1aad89ca
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00627
Status: valid/unmigrated Version: rel:R25-11#3b6a9b1e Versionshistorie & Revisions (1 transition, 7 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_DM_00627@rel:R25-11#3b6a9b1e
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#4e142f5c2026-09-30
  • R20-11rel:R20-11#500659252026-10-14
  • R21-11rel:R21-11#b0c513c82026-10-14
  • R22-11rel:R22-11#fa011c9a2026-10-14
  • R23-11rel:R23-11#3b6a9b1e2026-10-14
  • R24-11rel:R24-11#3b6a9b1e2026-10-14
  • R25-11rel:R25-11#3b6a9b1e2026-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

变量 useJumpToPassed [SWS_DM_00628] Upstream: RS_Diag_04068

bool useJumpToPassed;

is jump supported

Header-Datei#include "ara/diag/monitor_types.h"
Scopestruct ara::diag::CounterBased
SymboluseJumpToPassed
Typbool

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

Record
AUTOSAR/AP/record/SWS_DM_00628
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00628@rel:R25-11#e473c3ab
Content hash
e473c3ab
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00628
Status: valid/unmigrated Version: rel:R25-11#6b5a1179 Versionshistorie & Revisions (1 transition, 7 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_DM_00628@rel:R25-11#6b5a1179
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#2b7444452026-09-30
  • R20-11rel:R20-11#a21e0a812026-10-14
  • R21-11rel:R21-11#fac6d4792026-10-14
  • R22-11rel:R22-11#a2c3b6d22026-10-14
  • R23-11rel:R23-11#6b5a11792026-10-14
  • R24-11rel:R24-11#6b5a11792026-10-14
  • R25-11rel:R25-11#6b5a11792026-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