DEENESPTFRRUARHIKOZHNL

命名空间 apext::tsync

用户指南人工智能生成

提供用于保障时间同步安全性的 Freshness Value Management 接口和容器。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 81e51095e95c 来源 未决问题(3)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

提供用于保障时间同步安全性的 Freshness Value Management 接口和容器。

命名空间 apext::tsync 为 Adaptive 时间同步的 Freshness Value Management 提供接口和数据容器。通过接口 FVM,新鲜度值被封装在 FVContainer 实例中,以防止时间报文遭受重放攻击。如果在初始化期间发生不可恢复的错误,或者值暂时不可用,则通过 TsyncFvmErrorDomain 的错误代码进行映射 [SWS_TS_14202]。标准化错误对象的实例化通过 MakeErrorCode 以异常安全且线程安全的方式进行 [SWS_TS_14213]。

上下文

命名空间 apext::tsync 代表 AUTOSAR Adaptive 时间同步(ara::tsync)的平台特定扩展。其核心任务是 Freshness Value Management(FVM),它提供确保时间信息新鲜度的机制,以防止时间同步网络中的重放攻击和过时状态。核心组件包括接口 FVM、数据容器 FVContainer、错误域 TsyncFvmErrorDomain 以及异常类 TsyncFvmException。

类 FVContainer 通过管理其以位为单位的长度以及字节向量形式的值本身,封装了一个新鲜度值。接口 FVM 用作 ara::tsync 的功能桥梁。FVM 可能用作抽象接口,ara::tsync 的时间同步实例通过该接口获取或验证当前的新鲜度值。 问题 Q-f92f53d92ec347e5 (未决)错误域 TsyncFvmErrorDomain 及关联的辅助函数确保了标准化的错误报告 [SWS_TS_14212]。

ara_tsync ara::tsync FVM apext::tsync::FVM ara_tsync->FVM 使用 FVContainer apext::tsync::FVContainer FVM->FVContainer 生成 / 填充 TsyncFvmErrorDomain apext::tsync::TsyncFvmErrorDomain FVM->TsyncFvmErrorDomain referenziert

上下文图:命名空间 apext::tsync 的组件及其与 ara::tsync 的交互。来源:[SWS_TS_14202]、[SWS_TS_14212]。

生命周期

命名空间 apext::tsync 中组件的生命周期分为初始化、运行和终止阶段。对于初始化阶段,枚举 TsyncFvmErrc 定义了错误值 kFVInitializeFailed(= 2),该值被指定为不可恢复错误(unrecoverable error),表示无法使用 Freshness Value Manager [SWS_TS_14202]。错误 kFVInitializeFailed 可能表明在检索 Freshness Value 之前必须完成 FVM 的初始化阶段,其失败将导致无法进一步使用。 问题 Q-d9c097d736bae053 (未决)

在运行期间,FVContainer 实例具有临时生命周期:它们根据需要被实例化,填充向量和位长度,并传递给同步协议实例。相比之下,错误域对象 TsyncFvmErrorDomain 在整个进程运行期间具有静态生命周期。函数 GetTsyncFvmErrorDomain() 返回对全局实例对象的引用 [SWS_TS_14212]。GetTsyncFvmErrorDomain() 以及工厂函数 MakeErrorCode() 均被声明为 constexpr 和 noexcept,并被指定为异常安全且线程安全 [SWS_TS_14212]、[SWS_TS_14213]。这允许在没有同步锁的情况下并发进行错误生成和查询。

使用路径

与时间同步交互的典型使用路径包括新鲜度值的提供和评估:

  1. 来自 ara::tsync 的组件通过接口 FVM 请求当前的新鲜度值,以保障时间报文的安全。
  2. 成功确定值后,FVM 会创建或填充 FVContainer 的实例(包含该值的位长度和字节向量),并将其返回给调用方。
  3. 如果新鲜度值在运行时暂时无法提供,FVM 会报告可恢复错误 kFVNotAvailable [SWS_TS_14202]。为此,通过 MakeErrorCode() 创建带有特定于供应商的附加数据的相应 ara::core::ErrorCode 对象 [SWS_TS_14213]。
  4. 调用组件评估结果并决定是否进行重试或采取替代措施。
通过 FVM 获取新鲜度值ara::tsyncapext::tsync::FVMapext::tsync::FVContainer请求新鲜度值alt值可用使用位长和向量填充实例传递 FVContainerkFVNotAvailableMakeErrorCode(kFVNotAvailable)返回 ara::core::ErrorCode

时序图:新鲜度值的检索以及可能错误状态的处理。来源:[SWS_TS_14202]、[SWS_TS_14213]。

错误场景

apext::tsync 中的错误处理基于 ara::core::ErrorDomain 和 ara::core::ErrorCode 的架构。TsyncFvmErrorDomain 的错误代码列在枚举 TsyncFvmErrc 中,其基础类型为 ara::core::ErrorDomain::CodeType [SWS_TS_14202]:

  • kFVNotAvailable(= 1):可恢复错误(recoverable error),指示 Freshness Value 当前不可用 [SWS_TS_14202]。调用方可以重新发起请求或跳过当前处理周期。
  • kFVInitializeFailed(= 2):不可恢复错误(unrecoverable error),表示无法初始化或使用 Freshness Value Manager [SWS_TS_14202]。这会导致依赖的时间同步服务中止。

具体错误对象的创建通过辅助函数 MakeErrorCode(TsyncFvmErrc code, ara::core::ErrorDomain::SupportDataType data) 进行,该函数接收枚举项和特定于供应商的附加数据 [SWS_TS_14213]。声明位于头文件 apext/tsync/fvm_error_domain.h 中,而前向声明可通过 apext/tsync/tsync_fwd.h 获取 [SWS_TS_14202]。对于基于异常的错误路径,该命名空间提供了类 TsyncFvmException。当 TsyncFvmErrorDomain 的错误在异常上下文中报告而非通过 ara::core::ErrorCode 报告时,TsyncFvmException 大概率会被抛出。 问题 Q-a779e133b471f03d (未决)

本指南基于 AUTOSAR R25-11 中针对命名空间 apext::tsync 的规范,由自动化工具生成。

主题图

类图

Abgerundete Rahmen = Namespace- bzw. Klassen-Scopes; hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); graue Boxen = namespace-fremde bzw. externe Basisklassen. Klicken öffnet die jeweilige Klassen- bzw. cppreference-Seite.

G cluster_ns apext::tsync napext__tsync__FVContainer «struct» FVContainer napext__tsync__FVM FVM napext__tsync__TsyncFvmErrorDomain TsyncFvmErrorDomain next_ara__core__ErrorDomain ara::core::ErrorDomain napext__tsync__TsyncFvmErrorDomain->next_ara__core__ErrorDomain napext__tsync__TsyncFvmException TsyncFvmException next_ara__core__Exception ara::core::Exception napext__tsync__TsyncFvmException->next_ara__core__Exception

详细视图

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

类

A freshness value container to hold the length of freshness value in bits and the freshness value itself as vector.

FVM 类

A freshness value management interface for ara::tsync.

Defines a class representing the Freshness Value Manager error domain.

继承自 ara::core::ErrorDomain

Defines a class for exceptions to be thrown by the Freshness Value Manager.

继承自 ara::core::Exception

函数

Returns a reference to the global apext::tsync::TsyncFvmErrorDomain object.

constexpr const ara::core::ErrorDomain & GetTsyncFvmErrorDomain () noexcept;

Creates an instance of ara::core::ErrorCode.

constexpr ara::core::ErrorCode MakeErrorCode (TsyncFvmErrc code, ara::core::ErrorDomain::SupportDataType data) noexcept;

类型与常量

The enumeration class defines the error codes for the apext::tsync:: TsyncFvmErrorDomain.

enum class TsyncFvmErrc : ara::core::ErrorDomain::CodeType {...};

枚举

枚举 TsyncFvmErrc [SWS_TS_14202] Upstream: RS_TS_20072 原文尚未导入

enum class TsyncFvmErrc :            ara::core::ErrorDomain::CodeType {...};

The enumeration class defines the error codes for the apext::tsync:: TsyncFvmErrorDomain.

Header-Datei#include "apext/tsync/fvm_error_domain.h"
Forwarding-Header#include "apext/tsync/tsync_fwd.h"
Scopenamespace apext::tsync
SymbolTsyncFvmErrc
Basistypara::core::ErrorDomain::CodeType

Werte

EnumeratorBeschreibung
kFVNotAvailable=1 Recoverable Error meaning the Freshness Value is not available.
kFVInitializeFailed=2 Unrecoverable Error meaning the Freshness Value Manager could not be used.
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: cad092cfe90e 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用与错误语义

枚举 TsyncFvmErrc 根据 [SWS_TS_14202] 为错误域 apext::tsync::TsyncFvmErrorDomain 定义特定错误码。在域内部,该枚举还通过类型别名 apext::tsync::TsyncFvmErrorDomain::Errc 提供 [SWS_TS_14206]。该枚举区分 Freshness Value Manager (FVM) 的两种核心错误状态:

  • kFVNotAvailable (= 1):当所需的新鲜度值不可用时,指示可恢复错误(Recoverable Error)[SWS_TS_14202]。该错误码尤其在通过 apext::tsync::FVM::GetTxFreshness 查询发送新鲜度值时出现 [SWS_TS_14199]。
  • kFVInitializeFailed (= 2):当 Freshness Value Manager 处于未就绪状态且发生故障时,指示不可恢复错误(Unrecoverable Error)[SWS_TS_14202]。它在初始化失败时由 apext::tsync::FVM::Initialize 发出信号 [SWS_TS_14200]。

交互与错误处理

为了进行错误处理,枚举项与厂商特定附加数据一起通过辅助函数 apext::tsync::MakeErrorCode 转换为 ara::core::ErrorCode 对象 [SWS_TS_14213]。FVM 的函数如 Initialize [SWS_TS_14200]、GetTxFreshness [SWS_TS_14199] 和 GetRxFreshness [SWS_TS_14198] 将结果或错误状态封装在 ara::core::Result 中。应用程序和 TimeSync 组件对该 Result 对象进行求值,以区分单个新鲜度值的可恢复故障与 FVM 的严重初始化错误。

该使用说明基于 AUTOSAR 有效负载 R25-11 自动生成。

实现者指南即将推出(复杂度 I1)

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

Record
AUTOSAR/AP/record/SWS_TS_14202
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_14202@rel:R25-11#6c63ae8c
Content hash
6c63ae8c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_14202
Status: valid/unmigrated Version: rel:R25-11#b5e36b38 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_TS_14202@rel:R25-11#b5e36b38
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#e69ca41d2026-09-30
  • R24-11rel:R24-11#5774fd892026-10-14
  • R25-11rel:R25-11#b5e36b382026-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

自由函数文档

函数 GetTsyncFvmErrorDomain [SWS_TS_14212] Upstream: RS_TS_20072 原文尚未导入

constexpr const ara::core::ErrorDomain & GetTsyncFvmErrorDomain () noexcept;

Returns a reference to the global apext::tsync::TsyncFvmErrorDomain object.

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

命名空间 apext::tsync 中的函数 GetTsyncFvmErrorDomain 提供对全局错误域对象 apext::tsync::TsyncFvmErrorDomain 的引用 [SWS_TS_14212]。使用时需包含头文件 apext/tsync/fvm_error_domain.h [SWS_TS_14212]。

使用

该调用为同步调用,且不带传入参数。该函数返回类型为 const ara::core::ErrorDomain& 的常量引用作为返回值,指向错误域的实例 [SWS_TS_14212]。通过声明为 constexpr,在编译时即可完成对该全局对象的访问 [SWS_TS_14212]。

错误处理与异常安全性

该函数被声明为 noexcept 并被指定为异常安全(exception safe)[SWS_TS_14212]。由于它仅返回一个现有引用,因此不会抛出异常,也不会生成错误码。

并发性与限制

该接口被定义为线程安全(thread-safe)[SWS_TS_14212]。它可以由多个线程并发调用,无需额外的同步机制。对于调用不存在限制性的顺序条件。

相互作用

Interpretation:所引用的错误域对象可能用于在 AUTOSAR Adaptive 错误处理模型中通过 ara::core::ErrorCode 唯一标识和比对 Freshness Value Management(FVM)的模块特异性错误。 问题 Q-2d0a2b5481f500bd (未决)

本使用说明由 AI 根据规范 SWS_TS_14212 生成。

Header-Datei#include "apext/tsync/fvm_error_domain.h"
Scopenamespace apext::tsync
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
const ara::core::ErrorDomain &A reference to the global apext::tsync:: TsyncFvmErrorDomain object.

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

Record
AUTOSAR/AP/record/SWS_TS_14212
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_14212@rel:R25-11#5560669b
Content hash
5560669b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_14212
Status: valid/unmigrated Version: rel:R25-11#fd40d130 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_TS_14212@rel:R25-11#fd40d130
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#a77cf1b62026-09-30
  • R24-11rel:R24-11#2b0ce1082026-10-14
  • R25-11rel:R25-11#fd40d1302026-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

函数 MakeErrorCode [SWS_TS_14213] Upstream: RS_TS_20072 原文尚未导入

constexpr ara::core::ErrorCode MakeErrorCode (TsyncFvmErrc code, ara::core::ErrorDomain::SupportDataType data) noexcept;

Creates an instance of ara::core::ErrorCode.

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

函数MakeErrorCode用于针对命名空间apext::tsync中 FVM 错误域的错误情况同步创建ara::core::ErrorCode对象[SWS_TS_14213]。它在头文件apext/tsync/fvm_error_domain.h中声明[SWS_TS_14213]。作为参数,它接受类型为TsyncFvmErrc的错误代码code以及类型为ara::core::ErrorDomain::SupportDataType的供应商特定随附数据data,并返回相应初始化的ara::core::ErrorCode对象[SWS_TS_14213]。

在执行安全性方面,该函数被定义为noexcept且具备异常安全性(“exception safe”),从而保证调用不会触发 C++ 异常[SWS_TS_14213]。此外,它被指定为线程安全(“thread-safe”),可以在无需外部同步的情况下并发执行[SWS_TS_14213]。由于constexpr签名,如果实参在编译时已确定,推测该函数可能也可以在编译时表达式中求值[SWS_TS_14213]。 问题 Q-dbd77b45638ef338 (未决)

在模块上下文中,该函数构成了标准命名空间ara::tsync中MakeErrorCode的对应项[SWS_TS_00910]。虽然标准函数通过头文件ara/tsync/tsync_error_domain.h使用ara::tsync::TsyncErrc [SWS_TS_00910],但该变体允许为扩展的时间同步功能对TsyncFvmErrc进行特定的错误封装[SWS_TS_14213]。

本使用说明是基于规范数据自动生成的。

实现者指南即将推出(复杂度 I1)

Header-Datei#include "apext/tsync/fvm_error_domain.h"
Scopenamespace apext::tsync
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
codeThe error to throw.
dataVendor defined data associated with the error.

Rückgabewert

TypBeschreibung
ara::core::ErrorCodeAn ara::core::ErrorCode object.

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

Record
AUTOSAR/AP/record/SWS_TS_14213
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_14213@rel:R25-11#0b11dbc0
Content hash
0b11dbc0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_14213
Status: valid/unmigrated Version: rel:R25-11#791565c2 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_TS_14213@rel:R25-11#791565c2
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#544bf7aa2026-09-30
  • R24-11rel:R24-11#c95efae82026-10-14
  • R25-11rel:R25-11#791565c22026-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