1.1 VFB中的概念——Component

在这里插入图片描述

参考文档:AUTOSAR_EXP_VFB.pdf
文档中位置:3 Overall mechanisms and concepts(p.12~p.45)

1. VFB概念

  • VFB:Virtual Functional Bus 虚拟功能总线
  • 个人理解:一种在上层系统设计功能时,虚拟化出来的、无视通讯类型的功能交互时的虚拟介质;换个说法就是,后续实现时,Autosar架构基本上可以满足任意功能之间的通讯,把设计精力全部集中在功能设计上吧,这就是Autosar能带给你的便利!
  • 这里我一定不会照文翻译VFB能干啥,比如:支持组件通讯、访问标准服务、响应模式切换等等的,对于初学者一听就懵逼,对于老手都是废话;附一张文中截图,喜欢就读一下好了:
  • Communication to other components in the system
  • Communication to sensors and actuators in the system (see Chapter 6, Interaction with hardware)
  • Access to standardized services, such as reading to or writing from non-volatile ram (see Chapter 7, AUTOSAR Services)
  • Responding to mode-changes, such as changes in the power-status of the local ECU (see Chapter 8, Mode Management)
  • Interacting with calibration and measurement systems (see Chapter 10)
  • 必须要指出:个人认为,VFB虽然是Autosar提出的一个概念,但这个东西也是Autosar的精髓,用过Autosar的人都知道,VFB在控制器中的实例就是RTE(CP)、ara::com(AP),在软件开发中,我们又把它们称为:Middleware中间件,源于网络拓扑结构中的中介软件,用以实现ECU内部以及不同ECU之间的通讯交换,也就是说,这种思路不是Autosar原创的,Autosar只是力求做到业界统一,如果大家同样都在一个标准下进行实现,不论是供应商的开发控制器、软件模块,还是自主开发的软件功能,都可以顺利的集成在一个或多个ECU上,这就是Autosar搞个VFB最有意义的目的之一。所以,思维模式是重要的,实现方式是多样的,理解VFB的设计初衷比记住什么是VFB更重要!

2. Component 组件

Autosar文档喜欢循序渐进的描述一个东西,所以在描述组件概念时,就分开与好几个部分进行描述,在此我把要点总结在一起。

2.1 VFB中的Component

Component是VFB层面设计时的核心结构元素,说的直白一点,每个VFB-Level上表示的框框的单位都是Component。就比如p.17页插图:
在这里插入图片描述
组件间的交互点是port端口,在后面端口部分详细说明

2.2 Type of Component 组件类型

  • Atomic Component:不能再拆分为两个及以上组件的一种组件,叫做原子组件,用白话讲就是最小单位的组件
  • Composition Component:复合组件,我更喜欢称之为部件型组件,原子型组件不难理解,而复合组件多用于高层次的抽象,也就是说,将多个原子组件框到一起,实现某个系统层面的功能,如下图所示,这个座椅加热功能由:HMI的开关解析→加热控制→座椅加热执行器控制 三个部分组成,分别划分到了三个ASWC中,然后三个ASWC封装到一个CSWC中,在系统层面就描述了一个座椅加热功能,其实现则是由三个ASWC来实现。

在机械里,同样有组件和部件的概念:

  • 组件:在电子或机械设备中组装在一起形成一个功能单元的一组零件或元件为组件
  • 部件:为完成同一使命在结构上组合在一起的、一套协同工作的零件为部件。如这个部件需要若干个组件、合件和零件组成

说白了:组件居多体现自身价值,部件则是团队合作,是使用组件最终要达到的目标的体现

p.30座椅加热的复合组件示例

2.3 Kind of Component 组件种类

注意原文用词:
Kind:指性质相同,而且特征很相似,足以归为一类的人或东西。
Type:指客观界限比较清楚,有相同本质特点的同类事物,或指大致相似的同类事物。

|Autosar划分的组件类型|

Ⅰ. Application software component 应用软件组件:

The Application Software Component is an Atomic Software Component that implements (part of) an application. It can use all AUTOSAR communication mechanisms and services. The Application Software Component interacts with sensors or actuators through a Sensor-Actuator Software Component.

  • 用来实现部分应用功能。可以使用autosar的所有通讯机制和服务,与传感器、执行器交互需要通过一个Sensor-Actuator软件组件
  • 是应用软件开发工程师最常用的一类软件组件

Ⅱ. Sensor-actuator software component 传感器-执行器软件组件:

The Sensor-Actuator Software Component is an Atomic Software Component that handles the specifics of a sensor and/or actuator. It directly interacts with the ECU-Abstraction (this is illustrated by a port called “IO”). See Chapter 6, Interaction with hardware.

  • 用来处理指定的传感器或执行器。直接与ECU抽象层交互
  • 一般在处理一些传感器、执行器的输入输出时,配合IO硬件抽象层使用,这样的传感器、执行器一般都至少有硬线控制信号直接与ECU相连,而非仅仅使用网络通讯

Ⅲ. Parameter software component 形参软件组件:

A Parameter Software Component provides parameter values. These can be fixed data, const or variable. This Software Component allows for data access to either fixed data or calibration data. See chapter 10.

  • 提供参数值,可以是固定的数据、常数、或变量。这个软件组件允许固定数据、标定数据的访问
  • 一种在标定、测量时常用的组件

Ⅳ. Composition software component 复合软件组件:

A Composition Software Component encapsulates a collaboration of Software Components, thereby hiding detail and allowing the creation of higher abstraction levels. Through delegation connectors a composition software component explicitly specifies, which ports of the internal components are visible from the outside. Composition Software Components are a specialized type of Software Components, e.g. they can be part of further Composition Software Components.

  • 一种封装了软件组件的组合,隐藏细节,给予创建高抽象层级。通过授权连接器,复合软件组件鲜明的指出哪些内部组件的端口在外部可见。复合软件组件是一个特殊类型的软件组件,例如他们可以是另一个复合软件组件的一部分
  • 复合软件组件还可以再打包,多层复合,这种逐层展开的方式,在需求分析和功能架构设计时,是很常用的,如果使用Autosar方法论进行软件开发,在VFB View使用复合软件组件做前期分析,后期再优化内部组件,对功能架构设计大有裨益

Ⅴ. Service Proxy software component 代理服务软件组件:

The Service Proxy SW Component is responsible for distribution of modes throughout the system. Once deployed each ECU should have a copy of every instance of this software component type. However at the VFB level only one is necessary.

  • 用于分配整个(整车)系统的模式。部署后,每个 ECU 应具有此软件组件类型的每个实例的副本。但是,在 VFB 级别,只需要一个。
  • 关于代理服务是在后面服务介绍时具体讲的 [p.71](7.2.3 Distribution of Requests to Remote Services),在这里做一下简单介绍,代理服务顾名思义,就是一个ECU上的请求被多个ECU服务响应时,并不允许该组件与远程的ECU服务直接通讯,这样就没办法请求到远程ECU,这种请款怎么办?搞一个代理服务的组件放到各个需要请求的控制器里,让代理服务去请求该ECU的服务,而请求则直接发给各个控制器的代理服务即可,需要注意的是在VFB View上没有分具体哪个控制器时,只需要表示一个代理服务即可,在分配到多个控制器时,哪个控制器可能被请求,就要分配一个控制器,可以参考下图示例,图片来自VFB官方文档的p.72页。

在这里插入图片描述
Ⅵ. Service software component 服务软件组件:

A Service Software Component provides standardized services through standardized interfaces. To provide these services, this component may interact directly with certain other basic-software modules (this is represented by the double arrow). See Chapter 7.

  • 通过标准接口提供标准服务,为了提供这些服务,这个组件可能直接与其他指定的BSW模型进行交互
  • 这个服务组件目前尚未使用到,后续有使用经验再补充

Ⅶ. ECU abstraction software component 控制器抽象层软件组件:

The ECU-Abstraction Software Component provides access to the ECU’s specific IO capabilities. These services are typically provided through client-server PPorts and are used by the sensor- actuator software components. The ECU-abstraction may directly interact with certain other basic- software modules (this is represented by the double arrow). See Chapter 6, Interaction with hardware.

  • ECU抽象软件组件提供ECU定义IO的访问,这个服务通常通过C-S端口提供,被Sensor-Actuator组件使用。这个组件可能直接与其他指定的BSW模型进行交互
  • 这个组件就是上面提到的与Sensor-actuator software component配合使用,用于硬线通讯的控制器、执行器控制的组件,需要注意的是,有人认为RTE下面都是底层了,就没有软件组件的概念了,这么理解是不对的,IO硬件抽象软件组件和复杂驱动,都是软件组件

Ⅷ. Complex driver software component 复杂驱动软件组件:

The Complex Driver Software Component generalizes the “ECU- abstraction component”. It can define ports to interact with other components in specific ways and can also interact directly with other basic-software modules. The purpose of the Complex Driver Software Component is described further in Section 6.5 Complex Driver.

  • 复杂驱动软件组件普遍化ECU抽象组件,它可以定义端口与其他组件以指定的方式交互,并且也可以直接与其他BSW模块进行交互
  • 实际上,RTE下面这两种component就是处理杂七杂八的传感器执行器的,有些硬线就是单纯的模拟、开关信号,但有些执行器的驱动需要单独写,比如带震颤控制的电磁阀、发动机喷油器控制这类的,Autosar并没给提供啥通用的、标准的模块来配置使用,为了保证可扩展性,就留着复杂驱动让你自己想怎么写怎么写,基于这种便利,很多知名供应商将以前的应用软件直接挪到了复杂驱动里,号称复合Autosar架构(当然谁敢说不符合),迅速将非Autosar软件转变成Autosar软件,好比换了个包装又大卖了一笔…

Ⅸ. NV Block software component 非易失存储软件组件:

The NV Block Software Component allows SWC-S access to non volatile data. Specifically this block allows for the modeling of the NV data at the VFB level. It is the responsibility of the NV Block to map individual NV data elements to NV Blocks and to interact with the NV Manager in the BSW. The behavior of this component is to be generated based on the port services in the RTE.

  • NV软件组件允许SWC(们)访问非易失存储数据。具体地,这个块允许在VFB层级对NV数据进行模型化。NV块的责任是映射独立的NV数据元素到NV块,并与NV manager在BSW中进行交互。这个组件的这个行为的生成基于RTE中的端口服务
  • 这个组件也没什么应用经验,后续补充

3. 总结

  • VFB思维模式很重要,概念上知道是什么就好了
  • Component的类型、种类都比较容易记忆,关键是知道什么种类的组件干什么用,在实际配置时不要用错就好了
  • 掌握各个种类Component的用途,有助于日后软件架构的优化

>> “Autosar标准学习专栏“总目录

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Monkey_Young

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值