Visual Modeling and Simulation of AUTOSAR Application Layer Models Using Modelica

Abstraction

As automotive electronic architectures grow increasingly complex and software development costs escalate, AUTOSAR plays a critical role in standardizing and enhancing the reusability of automotive controllers. However, existing AUTOSAR application layer modeling tools, such as the Simulink AUTOSAR Blockset, primarily adopt causal modeling paradigms, which constrain flexibility in capturing intricate system interactions. Additionally, their proprietary nature limits model accessibility, hindering cross-platform collaboration and multi-domain integration. Modelica, an object-oriented, equation-based modeling language, is particularly well-suited for multi-domain simulations due to its acausal modeling capabilities and strong support for component reuse.
This paper proposes a Modelica-based visual modeling approach for AUTOSAR application layer models. Specifically, it establishes encapsulation rules for representing AUTOSAR constructs in Modelica and develops an open-source AUTOSAR model library, facilitating industry collaboration and accelerating rapid prototyping. A formal mathematical representation of AUTOSAR models is introduced to enhance both expressiveness and verifiability. Furthermore, a structured visual modeling methodology is presented to lower the development barrier for AUTOSAR application layer modeling. Comparative analysis with Simulink’s AUTOSAR Blockset demonstrates that the proposed approach successfully integrates Modelica’s multidomain modeling capabilities into the AUTOSAR workflow while ensuring simulation consistency with Simulink.
To the best of our knowledge, this work represents the first integration of AUTOSAR within Modelica’s multi-domain simulation framework. Compared to Simulink, Modelica’s acausal modeling paradigm enables more flexible system representations, its open ecosystem supports cross-platform collaboration, and its multi-domain integration enhances interoperability. Beyond the automotive domain, the proposed approach can also be applied to controller design in other industries, further demonstrating its potential for cross-disciplinary adoption.

Introduction

AUTOSAR现有的是用Simulink,缺点是依赖因果建模和闭源。本文的贡献:

  • 提出了基于Modelica的AUTOSAR开源库;
  • 建立了AUTOSAR的形式化数学表示,以及用于AUTOSAR应用层建模的结构可视化建模规则,增强了表达性和可验证性;
  • 用Modelica体系和Simulink AUTOSAR Blockset进行仿真对比。

AUTOSAR Standard

AUTOSAR主要包含三个组件:a layered architecture, methodology, application interfaces.

AUTOSAR layered architecture 将汽车软件分为四层:ASW application Software Layer, RTE Runtime Environment, BSW Basic Software Layer, Microcontroller。ASW的核心是SWC,它封装特定的功能并通过标准化接口与其他组件或外部系统交互。本文主要关注的就是ASW的可视化建模,特别是SWC的表示方面。

Tools for AUTOSAR

介绍了几款商业软件,但是主要在将Simulink。此外,IBM 的 Rational Rhapsody 通过基于 UML/SysML 的设计和自动代码生成来支持 AUTOSAR 建模。而 Dassault Systemes 的 SCADE Suite 和 SCADE Architect 为 AUTOSAR 框架内基于模型的设计、验证和集成提供了全面的工具。

ARTop是一个基于 Eclipse 的框架,有助于定制 AUTOSAR 工具开发。 Arctic Core 为嵌入式系统提供基础软件模块和运行时环境配置。 openAUTOSAR 源自 Arctic Core,提供改进的模块支持并更严格地遵守 AUTOSAR 标准。

Modelica

不多赘述。

Motivation

Modelica比Simulink好的两个理由:开源生态,非因果建模。

Proposed Framework

本文提出的框架

Encapsulation of the AUTOSAR Model Library

Formal Representation of AUTOSAR Model

Visual Modeling Rules for application layer AUTOSAR

Implementation

Development Environment

MWORKS Sysplorer

AUTOSAR Library

展示了大致的代码结构

Visual Modeling Implementation

Case Study and Evaluation

使用的是Matlab Simulink中的一个Swc_Expfcns_Example作展示,是一个汽车前照灯的仿真模型。

  • 使用本文的工具建立一个一样的模型,跑仿真。Simulink每次仿真的时间都差不多,但是Modelica的第一次仿真因为要编译,时间较长,但是编译完的模型(仅修改数值的情况下)仿真速度就很快了。
  • Modelica还支持跨领域仿真,外接其他非因果模块做更丰富的仿真。

Threats and future work

当前的一个限制是没能扩展到RTE和BSW的支持。

Conclusion

本文介绍了一种基于 Modelica 的 AUTOSAR 应用层模型可视化建模和仿真方法。具体来说,它建立了在 Modelica 中表示 AUTOSAR 构造的封装规则,并开发了开源 AUTOSAR 模型库,促进行业协作并加速快速原型设计。还提供了 AUTOSAR 模型的正式数学表示,以增强表达性和可验证性。此外,提出了一种结构化可视化建模方法来降低AUTOSAR应用层建模的开发复杂性。

该方法的可行性通过可公开访问的 AUTOSAR 库以及与 Simulink 的 AUTOSAR Blockset 的比较仿真得到验证,展示了功能等效性和跨域集成能力。虽然当前的实现侧重于经典平台应用层的部分建模,但未来的工作将扩展对较低 AUTOSAR 层(例如 RTE 和 BSW)的支持,改进形式语义以增强建模的严谨性,并集成代码生成功能以支持部署到符合 AUTOSAR 的 ECU。

个人总结:哈工大的学生完成的文章,应该是Modelica走向AUTOSAR的第一个工作,想法很新颖,工作的思路也比较清晰简单,有一定的试验性和开创性。本文建立了一个AUTOSAR的形式化数学表示,这部分可以参考一下。其余的工作思路很清晰简洁。