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

相关文章

QT6中绘制UI的两种方法详解与示例代码

《QT6中绘制UI的两种方法详解与示例代码》Qt6提供了两种主要的UI绘制技术:​​QML(QtMeta-ObjectLanguage)​​和​​C++Widgets​​,这两种技术各有优势,适用于不... 目录一、QML 技术详解1.1 QML 简介1.2 QML 的核心概念1.3 QML 示例:简单按钮

一文详解PostgreSQL复制参数

《一文详解PostgreSQL复制参数》PostgreSQL作为一款功能强大的开源关系型数据库,其复制功能对于构建高可用性系统至关重要,本文给大家详细介绍了PostgreSQL的复制参数,需要的朋友可... 目录一、复制参数基础概念二、核心复制参数深度解析1. max_wal_seChina编程nders:WAL

Nginx路由匹配规则及优先级详解

《Nginx路由匹配规则及优先级详解》Nginx作为一个高性能的Web服务器和反向代理服务器,广泛用于负载均衡、请求转发等场景,在配置Nginx时,路由匹配规则是非常重要的概念,本文将详细介绍Ngin... 目录引言一、 Nginx的路由匹配规则概述二、 Nginx的路由匹配规则类型2.1 精确匹配(=)2

一文详解如何查看本地MySQL的安装路径

《一文详解如何查看本地MySQL的安装路径》本地安装MySQL对于初学者或者开发人员来说是一项基础技能,但在安装过程中可能会遇到各种问题,:本文主要介绍如何查看本地MySQL安装路径的相关资料,需... 目录1. 如何查看本地mysql的安装路径1.1. 方法1:通过查询本地服务1.2. 方法2:通过MyS

Mysql数据库中数据的操作CRUD详解

《Mysql数据库中数据的操作CRUD详解》:本文主要介绍Mysql数据库中数据的操作(CRUD),详细描述对Mysql数据库中数据的操作(CRUD),包括插入、修改、删除数据,还有查询数据,包括... 目录一、插入数据(insert)1.插入数据的语法2.注意事项二、修改数据(update)1.语法2.有

SQL Server中的PIVOT与UNPIVOT用法具体示例详解

《SQLServer中的PIVOT与UNPIVOT用法具体示例详解》这篇文章主要给大家介绍了关于SQLServer中的PIVOT与UNPIVOT用法的具体示例,SQLServer中PIVOT和U... 目录引言一、PIVOT:将行转换为列核心作用语法结构实战示例二、UNPIVOT:将列编程转换为行核心作用语

Python logging模块使用示例详解

《Pythonlogging模块使用示例详解》Python的logging模块是一个灵活且强大的日志记录工具,广泛应用于应用程序的调试、运行监控和问题排查,下面给大家介绍Pythonlogging模... 目录一、为什么使用 logging 模块?二、核心组件三、日志级别四、基本使用步骤五、快速配置(bas

C#特性(Attributes)和反射(Reflection)详解

《C#特性(Attributes)和反射(Reflection)详解》:本文主要介绍C#特性(Attributes)和反射(Reflection),具有很好的参考价值,希望对大家有所帮助,如有错误... 目录特性特性的定义概念目的反射定义概念目的反射的主要功能包括使用反射的基本步骤特性和反射的关系总结特性

详解如何在SpringBoot控制器中处理用户数据

《详解如何在SpringBoot控制器中处理用户数据》在SpringBoot应用开发中,控制器(Controller)扮演着至关重要的角色,它负责接收用户请求、处理数据并返回响应,本文将深入浅出地讲解... 目录一、获取请求参数1.1 获取查询参数1.2 获取路径参数二、处理表单提交2.1 处理表单数据三、

PyQt6中QMainWindow组件的使用详解

《PyQt6中QMainWindow组件的使用详解》QMainWindow是PyQt6中用于构建桌面应用程序的基础组件,本文主要介绍了PyQt6中QMainWindow组件的使用,具有一定的参考价值,... 目录1. QMainWindow 组php件概述2. 使用 QMainWindow3. QMainW