AUTOSAR SWC详解

2023-12-20 18:31
文章标签 详解 autosar swc

本文主要是介绍AUTOSAR SWC详解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

温馨提示:关注公众号“嵌入式软件实战派”回复“AUTOSAR”获得整个AUTOSAR实战教程。


1. SWC原理特点

只要了解过AUTOSAR的都知道,AUTOSAR分四层:Application、RTE、BSW和MCAL

而SWC一般位于AUTOSAR架构的Application层(不完全是,但可以暂且这么认为,看完以下内容就会大概理解了)。

SWC即Software Component缩写。

也许有很多人会疑惑,到底什么是SWC,里面包含什么?

对于这个问题,首先要了解下什么是Component。

Component这个概念很广泛,有时候概念会模糊或者容易混淆。例如Module和Component的概念混淆。

这里先从UML规范角度来看看。

OMG UML 规范(UML Superstructure Specification, v2.1.1, p.148)指出:

Component表示系统的模块化部分,它封装了其内容,并且其表现形式在其环境中是可替换的。

Component根据提供的和所需的接口定义其行为。 因此,Component作为一种类型,其一致性由这些提供和必需的接口定义(包括它们的静态和动态语义)。

一个Component可以由多个类或组件拼凑而成。随着较小的Component组合在一起以创建更大的组件,最终系统可以在Component图中以构建块样式进行建模。

回到AUTOSAR上来,AUTOSAR上的Component有以下特点和属性

在DavinciDeveloper上面,可以看到Component有好几类。

至少在其Object Browser界面上可以看到有Application ComponentTypes和Service component Types

而ApplicationComponent Types里面又分Application、SensorActuator……

下面我做了个汇总:

以上这个图是根据Davinci Developer的配置情况做的分类。

其实,AUTOSAR官方的Component的模型关系,也许会让你更清晰其结构关系,如下

下面参考官方文档里面的解释,做个Component的名词解释汇总:

Component

Description

AtomicSwComponentType

An atomic software  component is atomic in the sense that it cannot be further decomposed and  distributed across multiple ECUs.

ParameterSwComponentType

The  ParameterSwComponentType defines parameters and characteristic values  accessible via provided Ports. The provided values are the same for all  connected SwComponentPrototypes

CompositionSwComponentType

A  CompositionSwComponentType aggregates SwComponentPrototypes (that in turn are  typed by SwComponentTypes) as well as SwConnectors for primarily connecting  SwComponentPrototypes among each others and towards the surface of the  CompositionSwComponentType. By this means hierarchical structures of software-components  can be created.

ApplicationSwComponentType

The  ApplicationSwComponentType is used to represent the application software.

NvBlockSwComponentType

The  NvBlockSwComponentType defines non volatile data which data can be shared between  SwComponentPrototypes. The non volatile data of the NvBlockSwComponentType  are accessible via provided and required ports.

ComplexDeviceDriverSwComponentType

The  ComplexDeviceDriverSwComponentType is a special AtomicSwComponentType that  has direct access to hardware on an ECU and which is therefore linked to a  specific ECU or specific hardware. The ComplexDeviceDriverSwComponentType  introduces the possibility to link from the software representation to its  hardware description provided by the ECU Resource Template.

ServiceSwComponentType

ServiceSwComponentType  is used for configuring services for a given ECU. Instances of this class are  only to be created in ECU Configuration phase for the specific purpose of the  service configuration.

EcuAbstractionSwComponentType

The ECUAbstraction  is a special AtomicSwComponentType that resides between a software-component  that wants to access ECU periphery and the Microcontroller Abstraction. The  EcuAbstractionSwComponentType introduces the possibility to link from the  software representation to its hardware description provided by the ECU  Resource Template.

SensorActuatorSwComponentType

The  SensorActuatorSwComponentType introduces the possibility to link from the  software representation of a sensor/actuator to its hardware description  provided by the ECU Resource Template.

ServiceProxySwComponentType

This class provides the ability to express a software-component which  provides access to an internal service for remote ECUs. It acts as a proxy  for the service providing access to the service.

An important use case is the request of vehicle mode switches: Such  requests can be communicated via sender-receiver interfaces across ECU  boundaries, but the mode manager being responsible to perform the mode  switches is an AUTOSAR Service which is located in the Basic Software and is  not visible in the VFB view. To handle this situation, a  ServiceProxySwComponentType will act as proxy for the mode manager. It will  have R-Ports to be connected with the mode requestors on VFB level and  Service-Ports to be connected with the local mode manager at ECU integration  time.

Apart from the semantics, a ServiceProxySwComponentType has these  specific properties:

* A prototype of it can be mapped to more than one ECUs in the system  description.

* Exactly one additional instance of it will be created in the  ECU-Extract per ECU to which the prototype has been mapped.

* For remote communication, it can have only R-Ports with  sender-receiver interfaces and 1:n semantics.

* There shall be no connectors between two prototypes of any  ServiceProxySwComponentType.

如果不想看这些英文描述,可以直接看下面这个简化版的(适合初学了解)

SWC

描述/用途

Parameter  SWC/Calibration

此SWC用于将(其所在的ECU)的Calibration参数共享给外部设备。与Application SWC或SensorActuator SWC不同,这些SWC没有任何内部行为。

Composition SWC

这个SWC是在系统配置期间单一ECU里面的SWC的集合。这种SWC有助于抽象和标准化AUTOSAR目标的软件开发。

Atomic SWC

这个是相对Composition SWC而言的,是单个不再拆解的SWC,也算是个抽象的概念。

Application SWC

一般只包含应用程序的SWC

SensorActuator SWC

专门处理和sensor/actuator相关的SWC

Nvblock SWC

这种SWC是用于访问NVRAM或Memory的

Complex Device Driver  SWC

用于开发CDD(Complex Device  Driver)或者AUTOSAR标准不支持或未定义的一些组件

ECU Abstraction SWC

这类SWC通过直接与特定的 BSW 模块交互来提供对 I/O 的访问。严格来说其他 SWC 不能用于访问 I/O,只能使用这个。

Service SWC

这类SWC为BSW模块提供AUTOSAR指定的服务。

Service Proxy SWC

这种SWC充当代理,为一个或多个remote ECU提供内部服务。它的主要用途是在整个系统中分发车辆的模式信息。可以简单理解为跨ECU用的。

以上不同类型的Component type的实际应用场景,后续根据具体情况再做详细解释或使用指导。

2. SWC配置实践

通过上面的解释,我相信你对SWC大概的内容应该有个大致的了解了,那么,这些SWC在AUTOSAR实际开发中应该怎么配置呢?

对初学者,这个会让人不知从何下手,有个详细的教程步骤会让你少走很多弯路。

下面将配置几个SWC的过程步骤和注意事项写在这给大家参考吧。
(以下内容,请关注公众号阅读)

 

这篇关于AUTOSAR SWC详解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/517037

相关文章

Qt spdlog日志模块的使用详解

《Qtspdlog日志模块的使用详解》在Qt应用程序开发中,良好的日志系统至关重要,本文将介绍如何使用spdlog1.5.0创建满足以下要求的日志系统,感兴趣的朋友一起看看吧... 目录版本摘要例子logmanager.cpp文件main.cpp文件版本spdlog版本:1.5.0采用1.5.0版本主要

Linux ls命令操作详解

《Linuxls命令操作详解》通过ls命令,我们可以查看指定目录下的文件和子目录,并结合不同的选项获取详细的文件信息,如权限、大小、修改时间等,:本文主要介绍Linuxls命令详解,需要的朋友可... 目录1. 命令简介2. 命令的基本语法和用法2.1 语法格式2.2 使用示例2.2.1 列出当前目录下的文

MySQL中的交叉连接、自然连接和内连接查询详解

《MySQL中的交叉连接、自然连接和内连接查询详解》:本文主要介绍MySQL中的交叉连接、自然连接和内连接查询,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、引入二、交php叉连接(cross join)三、自然连接(naturalandroid join)四

Go 语言中的select语句详解及工作原理

《Go语言中的select语句详解及工作原理》在Go语言中,select语句是用于处理多个通道(channel)操作的一种控制结构,它类似于switch语句,本文给大家介绍Go语言中的select语... 目录Go 语言中的 select 是做什么的基本功能语法工作原理示例示例 1:监听多个通道示例 2:带

mysql的基础语句和外键查询及其语句详解(推荐)

《mysql的基础语句和外键查询及其语句详解(推荐)》:本文主要介绍mysql的基础语句和外键查询及其语句详解(推荐),本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋... 目录一、mysql 基础语句1. 数据库操作 创建数据库2. 表操作 创建表3. CRUD 操作二、外键

Spring Boot项目部署命令java -jar的各种参数及作用详解

《SpringBoot项目部署命令java-jar的各种参数及作用详解》:本文主要介绍SpringBoot项目部署命令java-jar的各种参数及作用的相关资料,包括设置内存大小、垃圾回收... 目录前言一、基础命令结构二、常见的 Java 命令参数1. 设置内存大小2. 配置垃圾回收器3. 配置线程栈大小

鸿蒙中@State的原理使用详解(HarmonyOS 5)

《鸿蒙中@State的原理使用详解(HarmonyOS5)》@State是HarmonyOSArkTS框架中用于管理组件状态的核心装饰器,其核心作用是实现数据驱动UI的响应式编程模式,本文给大家介绍... 目录一、@State在鸿蒙中是做什么的?二、@Spythontate的基本原理1. 依赖关系的收集2.

Redis实现延迟任务的三种方法详解

《Redis实现延迟任务的三种方法详解》延迟任务(DelayedTask)是指在未来的某个时间点,执行相应的任务,本文为大家整理了三种常见的实现方法,感兴趣的小伙伴可以参考一下... 目录1.前言2.Redis如何实现延迟任务3.代码实现3.1. 过期键通知事件实现3.2. 使用ZSet实现延迟任务3.3

C语言函数递归实际应用举例详解

《C语言函数递归实际应用举例详解》程序调用自身的编程技巧称为递归,递归做为一种算法在程序设计语言中广泛应用,:本文主要介绍C语言函数递归实际应用举例的相关资料,文中通过代码介绍的非常详细,需要的朋... 目录前言一、递归的概念与思想二、递归的限制条件 三、递归的实际应用举例(一)求 n 的阶乘(二)顺序打印

Python Faker库基本用法详解

《PythonFaker库基本用法详解》Faker是一个非常强大的库,适用于生成各种类型的伪随机数据,可以帮助开发者在测试、数据生成、或其他需要随机数据的场景中提高效率,本文给大家介绍PythonF... 目录安装基本用法主要功能示例代码语言和地区生成多条假数据自定义字段小结Faker 是一个 python