25
1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information Science Linköpings universitet

1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Embed Size (px)

Citation preview

Page 1: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

1 of 25June 4, 2002

Portable Automotive Electronic Modelsusing Standard XML Technologies

Syed Zia Akbar ZaidiDepartment of Computer and Information Science

Linköpings universitet

Page 2: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

2 of 25June 4, 2002

Contributions

Defined a simple architecture definition language (ADL) Used to model the automotive electronic systems

XML representation: models portable among manufacturers and

suppliers

Identified the constraints of the automotive electronic field Types of requirements

Modelling and representation of automotive electronic

requirements using XML technologies Xlinkit, XQuery, CommonRules

Case study representing a vehicle cruise controller Modeled using our ADL

The requirements placed on the cruise controller have been

modelled using xlinkit, XQuery and CommonRules

Page 3: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

3 of 25June 4, 2002

Outline

Automotive Electronics The Industry Generic Architectures The Cruise Controller

Modelling AE using XML The Merits of XML The Cruise Controller Model The Cruise Controller

Requirements Modelling Requirements on the Cruise Controller XML Technologies Xlinkit, XQuery, CommonRules

Conclusions and Future Work

Page 4: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

4 of 25June 4, 2002

Embedded Systems

1%

99%

General purpose systems Embedded systems

Microprocessor market shares in 1999

1%

99%

General purpose systems Embedded systems

Microprocessor market shares in 1999

Automotive Electronic Systems

Complex distributed embedded systems that have important requirements safety cost, and performance.

Responsible for controlling the functionality of a vehicle.

Page 5: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

5 of 25June 4, 2002

Automotive Industry: Interoperability

XML

Car makersSuppliers

Page 6: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

6 of 25June 4, 2002

An ADL is a language that provides features for modeling a hardware and software system’s conceptual architecture.

In other way, it is a high-level description of the overall interconnection structure of an architecture.

It provides formal modeling notations for architectural elements, such as components, connectors.

It also provides development tools that operate on architectural specifications, such as configuration and constraints.

It reduces cost of development.

ADLs: Software: ACME,Rapide, C2, Darwin,

MetaH, SADL, UinCon, Wright, xArch, …

Hardware: MoML, ISDL, Valen-C,

MIMOLA, LISA, nML, ARC, Axys, RADL,

Target, MDES, EPRESSION, …

What is an ADL?

Page 7: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

7 of 25June 4, 2002

ADL Exchange: The Merit of XML

XML highly suited for ADLs“The Merit of XML as an Architecture Description Metalanguage”, Steve Pruitt

et al.

Representation

Analysis

Traceability

Views

Collaboration

Repository

<!-- Example in MOML --><?xml version="1.0" standalone="no"?><!DOCTYPE model PUBLIC "…" "http://…"><model name="top" class="path name"> <entity name="source" class="path name"> <port name="output"/> </entity> <entity name="sink" class="path name"> <port name="input"/> </entity> <relation name="r1" class="path name"/> <link port="source.output" relation="r1"/> <link port="sink.input" relation="r1"/></model>

Page 8: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

8 of 25June 4, 2002

AE: Generic Architecture

Comm. ControllerCPU, Memory, I/O

Bios, DriversComm. LayerMiddleware

OS

ApplicationsInterface

Comm. ControllerCPU, Memory, I/O

Bios, Drivers

Middleware OS

ApplicationsInterface

Gateway

Comm. ControllerCPU, Memory, I/O

Bios, DriversComm. LayerMiddleware

OS

ApplicationsInterface

Comm. ControllerCPU, Memory, I/O

Bios, Drivers

Middleware OS

ApplicationsInterface

Gateway

Page 9: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

9 of 25June 4, 2002

Cruise Controller Vehicle cruise controller. Modelled with a CPG of

32 processes and two conditions. Mapped on 5 nodes:

CEM, ABS, ETM, ECM, TCM.

Schedule:

Process Start WCET Resource PR1 0 0 P6 PR2 0 12 P1 PR28 0 12 P2 ARC2 12 1 B1 PR3 13 7 P2.. .. ..

Page 10: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

10 of 25June 4, 2002

XML Model for Cruise Controller architecture.xml

<NODE Name="CEM" Id="P1"><Processor Name="AMD"><P_Type>I</P_Type></Processor>  <Memory unit="KB">128</Memory>

</NODE> behaviour.xml

<PROCESS Name="PR3" Id="PR3"><WCET unit="ms">7</WCET><Memory unit="KB">2</Memory>

</PROCESS><ARC Name="ARC3" Id="ARC3">

<Src>PR3</Src><Dest>PR4</Dest><Delay unit="ms">0</Delay></ARC>

mapping.xml<MAP Resource="P1">

<Process>PR1</Process><Process>PR2</Process><Process>PR30</Process></MAP>

schedule.xml<SLOT Id="PR1"><Start unit="ms">0</Start><Duration unit="ms">0</Duration>

  <Resource>P6</Resource></SLOT>

<SLOT Id="PR2">  <Start unit="ms">0</Start><Duration unit="ms">12</Duration><Resource>P1</Resource></SLOT>

Page 11: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

11 of 25June 4, 2002

Requirements Engineering

RE is the branch of systems engineering concerned with

the real-world goals and constraints on systems the relationship of these factors to precise specifications of

systems behavior, and to their evolution over time and across system families.

RE Activities: eliciting requirements modeling and analyzing requirements communicating requirements agreeing requirements evolving requirements

Page 12: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

12 of 25June 4, 2002

Requirements on the Cruise Controller Requirements on the model

The model should be consistent Every process should be mapped to one and only one node Every sensor/actuator should be connected

The schedule should be correct The schedule should respect the precedence constraints No two slots in the schedule should overlap

Cruise Controller Timing requirements

The CC should execute within 100 ms Resource requirements

The sum of processes’ memory on a nodeshould not exceed that node's capacity

Should be expressed using XML Technologies

Page 13: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

13 of 25June 4, 2002

XQuery: An XML Query Language

W3C standard http://www.w3.org/TR/xquery Derived from Quilt

Jonathan Robie, Don Chamberlin, and Daniela Florescu Based on XML-QL

Relevant W3C documents XML Query Requirements XML Query Use Cases XQuery 1.0: An XML Query Language XQuery 1.0 and XPath 2.0 Data Model XQuery 1.0 Formal Semantics XML Syntax for XQuery 1.0 (XQueryX)

Page 14: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

14 of 25June 4, 2002

XQuery To find all process names and connected sensors for

processes whose worst case execution time > 10ms & memory size < 20MB.

<Behavioral_Model>{for $b in document(“Behavior.xml”)//Processwhere $b/WCET > 10 and $b/Memory < 20return

<Process Name = {$b/Name}>{$b/Sensor

}</Process>}</Behavioral Model>

Overview Path expressions: XPath Conditional expressions FLWR (“flower”) expressions

Page 15: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

15 of 25June 4, 2002

XPath

Behavioral_Model

Process

Name WCET Memory Sensor

PR2 12 ms 10 KB CC

W3C Standard http://www.w3.org/TR/xpath

Example 1:Behavioral_Model/Process/Name

Example 2: Behavioral_Model/Process/Name [../WCET = 12]

Tree Construction

Page 16: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

16 of 25June 4, 2002

FLWR (“FLOWER”) Expression “Flower” expressions

FOR ... LET... FOR... LET...WHERE...RETURN...

FOR/LET Clauses

WHERE Clause

RETURN Clause

List of tuples

Filtered list of tuples

Instance of XQuery data model

•Example: find all Processes with WCET > 14

FOR $x IN document("behavior.xml")

// Process

WHERE $x/WCET > 14

RETURN $x/@Id

Result:

<Process>PR6</Process>

<Process>PR8</Process>

<Process>PR31</Process>

Page 17: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

17 of 25June 4, 2002

If-Then-Else

<results>{

let $a := document("data/schedule.xml")//SLOT,

$b := max(for $c in document("data/schedule.xml")//SLOT/Start

return int(string-value($c))),

$d := $a[Start = $b], $e := $a[Start = $b]/Start,

$f := $a[Start = $b]/Duration, $g := $b+$f

return

<SLOT Id={$d/@Id}>{

$e,

$f}

{<WCET> {$g}</WCET>,

if ($g>100)

then

<Fault> Time Lapsed </Fault>

else "WCET ok"

}</SLOT>}</results>

• The CC should execute within 100 ms.

Page 18: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

18 of 25June 4, 2002

Resource Requirement Queryfor $map in document("data/sweb/mapping.xml")//MAP,

$nod in document("data/sweb/architecture.xml")//:NODE[@Id = $map/@Resource]

let $proc := document("data/sweb/behaviour.xml")//PROCESS[@Id = $map/Process]

return

<processor

Name={$nod/@Name}

Id={$nod/@Id}

HasMemory={$nod/Memory/text(),$nod/Memory/@unit}

MemoryUsedByScheduledProcesses={sum($proc/Memory),$nod/Memory/@unit}>

{

for $process in $proc

return

<process Name={$process/@Name}

Id={$process/@Id}

Memory={$process/Memory/text(),$process/Memory/@unit} />

sortby(int(substring-before(@Memory,"K")))

}

</processor>

sortby(int(substring-after(@Id,"P")))

Page 19: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

19 of 25June 4, 2002

Resource Requirements Result

query result:check_resource_consistency.xml

<?xml version="1.0" ?><quip:result xmlns:quip="http://.."> <processor Name="CEM" Id="P1" HasMemory="128KB"

MemoryUsedByScheduledProcesses="20KB"> <process Name="PR1" Id="PR1" Memory="1KB" /> <process Name="PR31" Id="PR31" Memory="4KB" /> <process Name="PR30" Id="PR30" Memory="5KB" /> <process Name="PR2" Id="PR2" Memory="10KB" /> </processor> <processor Name="ABS" Id="P2" HasMemory="256KB"

MemoryUsedByScheduledProcesses="25KB"> <process Name="PR32" Id="PR32" Memory="1KB" /> <process Name="PR27" Id="PR27" Memory="2KB" /> <process Name="PR3" Id="PR3" Memory="2KB" /> <process Name="PR4" Id="PR4" Memory="5KB" /> <process Name="PR29" Id="PR29" Memory="7KB" /> <process Name="PR28" Id="PR28" Memory="8KB" /> </processor>…</quip:result> 

Page 20: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

20 of 25June 4, 2002

XQuery Software QuiP

http://www.softwareag.com/developer/downloads/default.htm

Software AG Windows and Linux on x86

Features Latest W3C syntax Graphical user interface.

Kweelt http://kweelt.sourceforge.net/ Open Source

Runs on all Java platforms Problems

Older syntax, from previous W3C requirements. No graphical user interface.

Page 21: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

21 of 25June 4, 2002

xLinkit

Xlinkit is a lightweight application service which provides rule-based link generation and checks the consistency of distributed documents and web content.

xLinkit is specially designed to validate complex documents Semantics: first order logic

Document Set

LinksLink

GenerationDocunments

Rule Language

XML

Rule Set

Rule Engine Architecture

XLink

Rules

Page 22: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

22 of 25June 4, 2002

Query Construction

<consistencyruleset> <globalset id="schedule" xpath="/SCHEDULE/SLOT" /> <globalset id="process_behaviour" xpath="/BEHAVIOURAL_MODEL/PROCESS" /> <globalset id="arc_behaviour" xpath="/BEHAVIOURAL_MODEL/ARC" /> <consistencyrule id="r1"> <forall var="a" in="$schedule"> <or> <exists var="p" in="$process_behaviour"> <and><equal op1="$a/@Id" op2="$p/@Id" /> <equal op1="$a/Duration/text()" op2="$p/WCET/text()" /></and> </exists> <exists var="c" in="$arc_behaviour"> <and><equal op1="$a/@Id" op2="$c/@Id" /> <equal op1="$a/Duration/text()" op2="$c/Delay/text()" /></and> </exists> </or> </forall> </consistencyrule></consistencyruleset>

<DocumentSet name=”CruiseCtrl"> <DocFile href=”schedule.xml"/> <DocFile href=”behavior.xml"/> </DocumentSet>

<RuleSet name="ScheduleRule"> <RuleFile href=“rule4.xml” xpath="/consistencyruleset/ consistencyrule"/></RuleSet>

Page 23: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

23 of 25June 4, 2002

Xlinkit Results

<xlinkit:ConsistencyLink ruleid="http://www.ida.liu.se/rule.xml#/ consistencyruleset/consistencyrule[1]">

<xlinkit:State>consistent</xlinkit:State>

<xlinkit:Locator xlink:href="http://www.ida.liu.se/Schedule.xml#/SLOT[1]"/> <xlinkit:Locator xlink:href="http://www.ida.liu.se/Behavior.xml#/PROCESS[3]"/></xlinkit:ConsistencyLink>

<xlinkit:ConsistencyLink ruleid="http://www.ida.liu.se/rule.xml#/ consistencyruleset/consistencyrule[1]">

<xlinkit:State>inconsistent</xlinkit:State>

<xlinkit:Locator xlink:href="http://www.ida.liu.se/Schedule.xml#/SLOT[3]"/> <xlinkit:Locator xlink:href="http://www.ida.liu.se/Behavior.xml#/PROCESS[15]"/></xlinkit:ConsistencyLink>

Page 24: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

24 of 25June 4, 2002

Discussion

XML technologies Current technologies

Xlinkit: first order logic + path expressions XQuery: relational databases + path expressions CommonRules: logic programming

Semantic Web DAML+OIL RuleML

Page 25: 1 of 25 June 4, 2002 Portable Automotive Electronic Models using Standard XML Technologies Syed Zia Akbar Zaidi Department of Computer and Information

Portable Automotive Electronic Models using Standard XML TechnologiesSyed Zia Akbar Zaidi

25 of 25June 4, 2002

Conclusions and Future Work

Simple architecture ADL with an XML representation Modelled the cruise controller using this ADL

Automotive electronic requirements Modelling and representation of requirements using XML

technologies Xlinkit, XQuery, CommonRules

Requirements on the cruise controller Modelled using xlinkit, XQuery and CommonRules

Future work: What is the advantage of using the SemanticWeb technologies?

DAML+OIL instead of XML for the ADL representation

RuleML instead of CommonRules