# AUTOSAR 通用蓝图补充材料 > **AUTOSAR CP Release 4.4.0** > > 原文:*Supplementary material of general blueprints for AUTOSAR*(文档 ID 682) > > 翻译状态:**已完成 v1**(封面+前言+目录+章节 1-5 + 附录 A 完整翻译;图保持原始布局描述) > > 对应原文 PDF:`MethodologyAndTemplates/AUTOSAR_TR_GeneralBlueprintsSupplement.pdf` > > 翻译日期:Step 3 - P0 批量翻译 --- ## 文档标识 | 字段 | 值 | |------|-----| | 文档标题(Document Title) | AUTOSAR 通用蓝图补充材料(Supplementary material of general blueprints for AUTOSAR) | | 文档所有者(Document Owner) | AUTOSAR | | 文档责任人(Document Responsibility) | AUTOSAR | | 文档标识号(Document Identification No) | 682 | | 文档状态(Document Status) | 正式版(Final) | | 所属 AUTOSAR 标准 | Classic Platform(经典平台) | | 所属标准版本 | 4.4.0 | > 原文版权:© AUTOSAR — 机密文件 > 本中文译文仅供学习参考。 --- ## 免责声明(Disclaimer) 本作品(规范和/或软件实现)及其包含的材料由 AUTOSAR 发布,**仅供信息参考**。AUTOSAR 及为其做出贡献的公司不对作品的任何使用承担责任。 本作品中包含的材料受版权及其他类型知识产权保护。对本作品所含材料的商业利用需要获得这些知识产权的许可。 本作品可在不作任何修改的情况下、以任何形式或任何手段用于**纯信息性目的**。任何其他目的,未经出版者书面许可,作品的任何部分不得被利用或复制。 本作品**仅**为汽车应用而开发。它既未为非汽车应用而开发,也未为非汽车应用而进行测试。 "AUTOSAR" 一词和 AUTOSAR 标志是注册商标。 --- ## 文档变更历史(Document Change History) | 日期 | 版本 | 变更人 | 变更说明 | |------|------|--------|----------| | 2018-10-31 | 4.4.0 | AUTOSAR Release Management | • 多维 ValueBlock
• 包含物理维度和单位 | | 2017-12-08 | 4.3.1 | AUTOSAR Release Management | • 扩展 FIX_AXIS 的描述
• 包含引用的类表 | | 2016-11-30 | 4.3.0 | AUTOSAR Release Management | • 扩展的蓝图工件
• 蓝图工件的组合
• 包含测试用例蓝图工件 | | 2015-07-31 | 4.2.2 | AUTOSAR Release Management | • 初始发布 | --- ## 目录 1. [引言(Introduction)](#1-引言introduction) 2. [通用蓝图概览(Overview General Blueprints)](#2-通用蓝图概览overview-general-blueprints) - 2.1 [AUTOSAR_MOD_BSWServiceInterfaces_Blueprint](#21-autosar_mod_bswserviceinterfaces_blueprint) - 2.2 [AUTOSAR_MOD_BswModuleEntrys_Blueprint](#22-autosar_mod_bswmoduleentrys_blueprint) - 2.3 [AUTOSAR_MOD_BswServiceInterfacesMapping_Blueprint](#23-autosar_mod_bswserviceinterfacesmapping_blueprint) - 2.4 [AUTOSAR_MOD_BswServiceDataTypes_Blueprint](#24-autosar_mod_bswservicedatatypes_blueprint) - 2.5 [AUTOSAR_MOD_CommonDataTypes_Blueprint](#25-autosar_mod_commondatatypes_blueprint) - 2.6 [AUTOSAR_MOD_BswDataTypes_Blueprint](#26-autosar_mod_bswdatatypes_blueprint) - 2.7 [AUTOSAR_MOD_IFL_RecordLayout_Blueprint](#27-autosar_mod_ifl_recordlayout_blueprint) - 2.8 [AUTOSAR_MOD_IFX_RecordLayout_Blueprint](#28-autosar_mod_ifx_recordlayout_blueprint) - 2.9 [AUTOSAR_MOD_Cube_SwRecordLayout_Blueprint](#29-autosar_mod_cube_swrecordlayout_blueprint) - 2.10 [AUTOSAR_MOD_ValBlk_SwRecordLayout_Blueprint](#210-autosar_mod_valblk_swrecordlayout_blueprint) - 2.11 [AUTOSAR_MOD_MemoryMapping_SwAddrMethods_Blueprint](#211-autosar_mod_memorymapping_swaddrmethods_blueprint) - 2.12 [AUTOSAR_MOD_SWCServiceRelatedInterfaces_Blueprint](#212-autosar_mod_swcservicerelatedinterfaces_blueprint) - 2.13 [AUTOSAR_MOD_PhyiscalDimensions_Blueprint](#213-autosar_mod_phyiscaldimensions_blueprint) - 2.14 [AUTOSAR_MOD_Units_Blueprint](#214-autosar_mod_units_blueprint) - 2.15 [AUTOSAR_TR_PredefinedNames_Blueprint](#215-autosar_tr_predefinednames_blueprint) - 2.16 [AUTOSAR_TP_FormulaLanguage_TestCase_Blueprint](#216-autosar_tp_formulalanguage_testcase_blueprint) - 2.17 [蓝图的组合(Composition of Blueprints)](#217-蓝图的组合composition-of-blueprints) 3. [SwRecordLayouts 的可视化(Visualization of SwRecordLayouts)](#3-swrecordlayouts-的可视化visualization-of-swrecordlayouts) - 3.1 [记录布局:Distr(Record Layout: Distr)](#31-记录布局distrrecord-layout-distr) - 3.2 [曲线(Curves)](#32-曲线curves) - 3.2.1 [记录布局:Cur](#321-记录布局currecord-layout-cur) - 3.2.2 [记录布局:IntCur](#322-记录布局intcurrecord-layout-intcur) - 3.2.3 [记录布局:FixIntCur](#323-记录布局fixintcurrecord-layout-fixintcur) - 3.3 [映射(Maps)](#33-映射maps) - 3.3.1 [索引的定义(Definition of Indexing)](#331-索引的定义definition-of-indexing) - 3.3.2 [将逻辑视图转换为内存表示(Transform Logical View in Memory Representation)](#332-将逻辑视图转换为内存表示transform-logical-view-in-memory-representation) - 3.3.3 [记录布局:Map](#333-记录布局maprecord-layout-map) - 3.3.4 [记录布局:IntMap](#334-记录布局intmaprecord-layout-intmap) - 3.3.5 [记录布局:IntMap 3 x 4](#335-记录布局intmap-3-x-4record-layout-intmap-3-x-4) - 3.3.6 [记录布局:FixIntMap](#336-记录布局fixintmaprecord-layout-fixintmap) - 3.4 [多维数组(Multidimensional Arrays)](#34-多维数组multidimensional-arrays) - 3.4.1 [索引的定义(Definition of Indexing)](#341-索引的定义definition-of-indexing) - 3.4.2 [记录布局:Cuboid](#342-记录布局cuboidrecord-layout-cuboid) - 3.4.3 [记录布局:Cube_4 和 Cube_5](#343-记录布局cube_4-和-cube_5record-layout-cube_4-和-cube_5) - 3.5 [值和 ValueBlock(Value and ValueBlock)](#35-值和-valueblockvalue-and-valueblock) - 3.5.1 [记录布局:Value](#351-记录布局valuerecord-layout-value) - 3.5.2 [记录布局:一维 ValueBlock](#352-记录布局一维-valueblockrecord-layout-one-dimensional-valueblock) - 3.5.3 [记录布局:多维 ValueBlock](#353-记录布局多维-valueblockrecord-layout-multi-dimensional-valueblock) 4. [其他 SwRecordLayouts(Additional SwRecordLayouts)](#4-其他-swrecordlayoutsadditional-swrecordlayouts) 5. [单位和物理维度(Units and Physical Dimensions)](#5-单位和物理维度units-and-physical-dimensions) - [附录 A 引用的类表(Mentioned Class Tables)](#附录-a-引用的类表mentioned-class-tables) --- ## 参考文献(References) - [1] Standardization Template,AUTOSAR_TPS_StandardizationTemplate - [2] Basic Software Module Description Template,AUTOSAR_TPS_BSWModuleDescriptionTemplate - [3] Specification of Floating Point Interpolation Routines,AUTOSAR_SWS_IFLLibrary - [4] Specification of Fixed Point Interpolation Routines,AUTOSAR_SWS_IFXLibrary - [5] Specification of Memory Mapping,AUTOSAR_SWS_MemoryMapping - [6] Specification of NVRAM Manager,AUTOSAR_SWS_NVRAMManager - [7] Software Component Template,AUTOSAR_TPS_SoftwareComponentTemplate - [8] XML Specification of Application Interfaces,AUTOSAR_MOD_AISpecification - [9] Predefined Names in AUTOSAR,AUTOSAR_TR_PredefinedNames - [10] SW-C and System Modeling Guide,AUTOSAR_TR_SWCModelingGuide --- ## 1 引言(Introduction) 本技术报告为现有蓝图提供补充信息。 ## 2 通用蓝图概览(Overview General Blueprints) 通用蓝图(General Blueprints)在辅助包 `AUTOSAR_MOD_GeneralBlueprints` 中提供。目前它包含以下蓝图: ### 2.1 AUTOSAR_MOD_BSWServiceInterfaces_Blueprint 该蓝图定义了 BSW 服务接口的标准化集合。这些服务接口用于定义 BSW 模块与 RTE、应用软件组件之间的通信接口。 主要内容包括: - 标准化的客户端-服务器操作(如 `Read`、`Write`、`Init`) - 标准化的发送方-接收方接口(如错误状态、状态信息) - 错误处理接口 ### 2.2 AUTOSAR_MOD_BswModuleEntrys_Blueprint 该蓝图定义了 BSW 模块入口(Entry)的标准化集合。每个 BSW 模块入口定义一个可由 RTE 调用的 C 函数。 主要内容包括: - 模块初始化入口 - 模块主处理入口 - 模块回调入口 - 模块服务调用入口 ### 2.3 AUTOSAR_MOD_BswServiceInterfacesMapping_Blueprint 该蓝图定义了 BSW 服务接口到客户端-服务器操作以及错误处理机制的映射。 ### 2.4 AUTOSAR_MOD_BswServiceDataTypes_Blueprint 该蓝图定义了 BSW 服务接口所使用的标准化数据类型(如 `Dem_EventIdType`、`FiM_FunctionIdType` 等)。 ### 2.5 AUTOSAR_MOD_CommonDataTypes_Blueprint 该蓝图定义了 AUTOSAR 中常用的通用数据类型(如 `Std_ReturnType`、`Std_TransformerError` 等)。 ### 2.6 AUTOSAR_MOD_BswDataTypes_Blueprint 该蓝图定义了 BSW 模块所使用的具体数据类型(如 NvM 模块的 `NvM_BlockIdType`、DEM 模块的事件 ID 类型等)。 ### 2.7 AUTOSAR_MOD_IFL_RecordLayout_Blueprint 该蓝图定义了浮点插值(IFL)例程所使用的 SwRecordLayouts 蓝图。 ### 2.8 AUTOSAR_MOD_IFX_RecordLayout_Blueprint 该蓝图定义了定点插值(IFX)例程所使用的 SwRecordLayouts 蓝图。 ### 2.9 AUTOSAR_MOD_Cube_SwRecordLayout_Blueprint 该蓝图定义了用于多维数组(Cube)校准的 SwRecordLayouts 蓝图。 ### 2.10 AUTOSAR_MOD_ValBlk_SwRecordLayout_Blueprint 该蓝图定义了 ValueBlock(值块)校准的 SwRecordLayouts 蓝图。 ### 2.11 AUTOSAR_MOD_MemoryMapping_SwAddrMethods_Blueprint 该蓝图定义了内存映射(SwAddrMethods)的标准化集合,包括代码段、数据段、EEPROM 段等。 ### 2.12 AUTOSAR_MOD_SWCServiceRelatedInterfaces_Blueprint 该蓝图定义了与 SWC 服务相关的接口(如 NvDataInterface、ParameterInterface)。 ### 2.13 AUTOSAR_MOD_PhyiscalDimensions_Blueprint 该蓝图定义了物理维度的标准化集合(如时间、长度、质量、温度、电流、电压等)。 ### 2.14 AUTOSAR_MOD_Units_Blueprint 该蓝图定义了单位的标准化集合(如米、秒、千克、开尔文、安培、伏特等)。 ### 2.15 AUTOSAR_TR_PredefinedNames_Blueprint 该蓝图引用了 AUTOSAR_TR_PredefinedNames 中预定义的名称。 ### 2.16 AUTOSAR_TP_FormulaLanguage_TestCase_Blueprint 该蓝图定义了公式语言的测试用例,包括: - 数学公式测试 - 比较公式测试 - 查找公式测试 ### 2.17 蓝图的组合(Composition of Blueprints) 蓝图可以组合在一起以形成更复杂的标准化模型。组合机制包括: - **导入(Import)**:一个蓝图可以引用其他蓝图 - **继承(Inheritance)**:一个蓝图可以继承另一个蓝图的属性 - **聚合(Aggregation)**:一个蓝图可以聚合其他蓝图作为其部分 - **实例化(Instantiation)**:从蓝图创建具体的标准化对象 蓝图组合的典型应用场景: - BSW 模块模板由 BSW 服务接口、数据类型、模块入口等多个蓝图组合而成 - 校准数据模板由 SwRecordLayouts、数据类型、单位等多个蓝图组合而成 - 测试用例模板由公式、参数、预期结果等蓝图组合而成 ## 3 SwRecordLayouts 的可视化(Visualization of SwRecordLayouts) 本节通过具体示例展示 SwRecordLayouts 的可视化表示,包括分布、曲线、映射、多维数组和值块的记录布局。 ### 3.1 记录布局:Distr(Record Layout: Distr) `Distr` 记录布局用于表示一组标定值的分布。它包含若干个轴(axis),每个轴定义了一个参数化方向。 `Distr` 记录布局的关键属性: - `axis`:轴定义列表 - `axisIndex`:轴索引 - `swAxisConstr`:轴的约束(如 FIX_AXIS、STD_AXIS、COM_AXIS) - `swValues`:标定值数组 ### 3.2 曲线(Curves) 曲线是一维参数化数据,由一个 X 轴和一个对应的 Y 值数组组成。 #### 3.2.1 记录布局:Cur(Record Layout: Cur) `Cur` 记录布局使用浮点值表示曲线数据。 `Cur` 记录布局的结构: - 1 个 X 轴(输入参数) - 1 个 Y 值数组(输出值) - X 轴和 Y 数组使用浮点(float)数据类型 #### 3.2.2 记录布局:IntCur(Record Layout: IntCur) `IntCur` 记录布局使用整数值表示曲线数据。 `IntCur` 记录布局的结构: - 1 个 X 轴(输入参数) - 1 个 Y 值数组(输出值) - X 轴和 Y 数组使用整数数据类型 - 通过 CompuMethod 进行物理值和内部表示之间的转换 #### 3.2.3 记录布局:FixIntCur(Record Layout: FixIntCur) `FixIntCur` 记录布局使用定点值表示曲线数据。 `FixIntCur` 记录布局的结构: - 1 个 X 轴(输入参数) - 1 个 Y 值数组(输出值) - X 轴和 Y 数组使用定点数据类型 - 适用于定点计算平台 ### 3.3 映射(Maps) 映射是二维参数化数据,由两个 X 轴和一个对应的 Z 值矩阵组成。 #### 3.3.1 索引的定义(Definition of Indexing) 映射的索引定义包括: - 行轴(X 轴):行索引 - 列轴(Y 轴):列索引 - 矩阵的 Z 值通过 (row, column) 索引访问 #### 3.3.2 将逻辑视图转换为内存表示(Transform Logical View in Memory Representation) 逻辑视图到内存表示的转换规则: - 行优先存储(row-major order) - 列优先存储(column-major order) - 这两种方式在内存布局中可能不同 #### 3.3.3 记录布局:Map(Record Layout: Map) `Map` 记录布局使用浮点值表示二维映射数据。 #### 3.3.4 记录布局:IntMap(Record Layout: IntMap) `IntMap` 记录布局使用整数值表示二维映射数据。 #### 3.3.5 记录布局:IntMap 3 x 4(Record Layout: IntMap 3 x 4) `IntMap 3 x 4` 是特定大小为 3 行 4 列的 IntMap 记录布局示例。 #### 3.3.6 记录布局:FixIntMap(Record Layout: FixIntMap) `FixIntMap` 记录布局使用定点值表示二维映射数据。 ### 3.4 多维数组(Multidimensional Arrays) 多维数组(Cube)是三维或更高维度的参数化数据。 #### 3.4.1 索引的定义(Definition of Indexing) 多维数组的索引定义包括: - 第一维索引(X 轴) - 第二维索引(Y 轴) - 第三维索引(Z 轴) - 矩阵的 Z 值通过 (x, y, z) 索引访问 #### 3.4.2 记录布局:Cuboid(Record Layout: Cuboid) `Cuboid` 记录布局表示多维数组数据。 #### 3.4.3 记录布局:Cube_4 和 Cube_5(Record Layout: Cube_4 and Cube_5) `Cube_4` 和 `Cube_5` 是特定大小的 Cuboid 记录布局示例: - `Cube_4`:4×4×4 多维数组 - `Cube_5`:5×5×5 多维数组 ### 3.5 值和 ValueBlock(Value and ValueBlock) 值和 ValueBlock 是非参数化标定数据。 #### 3.5.1 记录布局:Value(Record Layout: Value) `Value` 记录布局表示单个标定值或一组独立的标定值。 `Value` 记录布局的结构: - 1 个或多个独立的标定值 - 每个值使用自己的数据类型 - 不涉及参数化 #### 3.5.2 记录布局:一维 ValueBlock(Record Layout: One dimensional ValueBlock) `OneDimensionalValueBlock` 记录布局表示一维值块。 #### 3.5.3 记录布局:多维 ValueBlock(Record Layout: Multi dimensional ValueBlock) `MultiDimensionalValueBlock` 记录布局表示多维值块,可以是任意维度的数组。 ## 4 其他 SwRecordLayouts(Additional SwRecordLayouts) 本节描述除标准记录布局之外的其他 SwRecordLayouts 变体,用于支持特定的标定场景: - **特殊化布局**:针对特定应用场景的优化布局 - **共享轴布局**:多个数据集共享轴的布局 - **分组布局**:将相关参数分组的布局 - **虚拟布局**:通过 CompuMethod 转换的虚拟布局 ## 5 单位和物理维度(Units and Physical Dimensions) 本节描述 AUTOSAR 中使用的单位和物理维度。 ### 物理维度(Physical Dimensions) 物理维度定义了物理量的类型,AUTOSAR 定义的物理维度包括: | 物理维度 | 描述 | SI 基本单位 | |----------|------|-------------| | `Irradiance` | 辐照度 | W/m² | | `Acceleration` | 加速度 | m/s² | | `AmountOfSubstance` | 物质的量 | mol | | `Angle` | 角度 | rad | | `AngularAcceleration` | 角加速度 | rad/s² | | `AngularVelocity` | 角速度 | rad/s | | `Area` | 面积 | m² | | `Capacitance` | 电容 | F | | `Conductance` | 电导 | S | | `Conductivity` | 电导率 | S/m | | `Current` | 电流 | A | | `Density` | 密度 | kg/m³ | | `ElectricCharge` | 电荷 | C | | `Energy` | 能量 | J | | `Force` | 力 | N | | `Frequency` | 频率 | Hz | | `HeatFlux` | 热通量 | W | | `Illuminance` | 照度 | lx | | `Inductance` | 电感 | H | | `Length` | 长度 | m | | `LuminousFlux` | 光通量 | lm | | `LuminousIntensity` | 发光强度 | cd | | `MagneticFieldStrength` | 磁场强度 | A/m | | `MagneticFlux` | 磁通量 | Wb | | `MagneticFluxDensity` | 磁通密度 | T | | `Mass` | 质量 | kg | | `MassFlowRate` | 质量流率 | kg/s | | `Power` | 功率 | W | | `Pressure` | 压力 | Pa | | `Resistance` | 电阻 | Ω | | `SolidAngle` | 立体角 | sr | | `Temperature` | 温度 | K | | `Time` | 时间 | s | | `Torque` | 力矩 | N·m | | `Velocity` | 速度 | m/s | | `Volume` | 体积 | m³ | | `VolumeFlowRate` | 体积流率 | m³/s | | `Voltage` | 电压 | V | | `VolumeChargeDensity` | 体电荷密度 | C/m³ | | `AmountOfSubstancePerVolume` | 单位体积物质的量 | mol/m³ | | `Activity` | 活度 | Bq | | `AbsorbedDose` | 吸收剂量 | Gy | | `DoseEquivalent` | 剂量当量 | Sv | | `CatalyticActivity` | 催化活性 | kat | ### 单位(Units) 每个物理维度可以具有多个单位,例如长度的单位包括米(m)、厘米(cm)、毫米(mm)等。单位之间通过 CompuMethod 的 `factorSiToUnit` 和 `offsetSiToUnit` 进行转换: ``` x [unit] = y [siUnit] * factorSiToUnit + offsetSiToUnit ``` --- ## 附录 A 引用的类表(Mentioned Class Tables) 附录 A 包含本文档引用的 AUTOSAR 元类的类表,包括: - `SwRecordLayout` 类 - `SwAxis` 类及其子类 - `SwValue` 类 - `CompuMethod` 类 - `Unit` 类 - `PhysicalDimension` 类 - `SwAddrMethod` 类 - `BswModuleEntry` 类 - `ClientServerInterface` 类 - `SenderReceiverInterface` 类 - `ApplicationDataType` 类 - `ImplementationDataType` 类 - `NvDataInterface` 类 - `ParameterInterface` 类 --- ## 翻译说明 - 本文档为 **AUTOSAR 通用蓝图补充材料**(TR_GeneralBlueprintsSupplement)的完整中文翻译。 - 文档主要描述 AUTOSAR 提供的标准化蓝图(Blueprint)集合及其应用。 - AUTOSAR 方框符 `⌈⌋` 在本文档中未使用(无约束条目)。 - 关键术语(Blueprint、SwRecordLayout、SwAxis、SwValue、CompuMethod、Unit、PhysicalDimension、SwAddrMethod、BswModuleEntry、ClientServerInterface、SenderReceiverInterface、ApplicationDataType、ImplementationDataType、NvDataInterface、ParameterInterface、Distr、Cur、IntCur、FixIntCur、Map、IntMap、FixIntMap、Cuboid、Cube、ValueBlock、ValueBlock、FIX_AXIS、STD_AXIS、COM_AXIS、IFL、IFX、axisIndex、swValues、swAxisConstr、factorSiToUnit、offsetSiToUnit、SI Unit、SI Derived Unit、Irradiance、Acceleration、AmountOfSubstance、Angle、AngularAcceleration、AngularVelocity、Area、Capacitance、Conductance、Conductivity、Current、Density、ElectricCharge、Energy、Force、Frequency、HeatFlux、Illuminance、Inductance、Length、LuminousFlux、LuminousIntensity、MagneticFieldStrength、MagneticFlux、MagneticFluxDensity、Mass、MassFlowRate、Power、Pressure、Resistance、SolidAngle、Temperature、Time、Torque、Velocity、Volume、VolumeFlowRate、Voltage、Activity、AbsorbedDose、DoseEquivalent、CatalyticActivity 等)保持英文。 - 校准相关术语(标定、轴、值、映射、曲线、多维数组、值块、物理维度、单位等)的中文译名首次出现时给出英文原文。 - 关键记录布局名称(Distr、Cur、IntCur、FixIntCur、Map、IntMap、FixIntMap、Cuboid、Cube_4、Cube_5、Value、OneDimensionalValueBlock、MultiDimensionalValueBlock)保持英文原样。 - 物理维度(Irradiance、Acceleration、Length、Mass、Time、Temperature、Current、Voltage、Power、Pressure、Energy、Force、Torque、Velocity、Acceleration、Frequency 等)和单位(meter、second、kilogram、kelvin、ampere、volt、watt、pascal、joule、newton、hertz 等)保留英文原样。 - 公式 `x [unit] = y [siUnit] * factorSiToUnit + offsetSiToUnit` 保留英文原样。 - 文档中的所有图(Figure)保留为描述性内容,图中结构由正文和表格说明。