Patricia López Martínez, Laura Barros and José M. Drake Grupo de Computadores y Tiempo Real Universidad de Cantabria, Spain 15th International Conference on Reliable Software Funded by the European Union’s FP7 under contracts AdaEurope 2010 FP7/NoE/214373 and IST-004527, and by the Spanish Government under grant TIN2008-06766-C03-03 Valencia, June 2010
Objective: Component-based real-time applications Component-based approaches Application: Assembly of components Component Opaqueness (usage of metadata) Execution Platform Real-time systems Reactive model of real-time systems: Applications conceived as a set of concurrent end-to-end flow transactions Timing requirements defined as temporal constraints in the transaction Real-Time System 2 Valencia, June 2010 P. López, L. Barros and J.M.Drake
Real-time design In traditional systems: The designer can define and control: The number of threads The assignment of activities to the threads The synchronization mechanisms The scheduling parameters and policies A real-time model is usually used: To obtain the correct scheduling parameters assignment or to certify the fulfilment of the timing requirements It is formulated at the same time as the code is elaborated In a component-based system: The code of the components is opaque The deployment plan is the only way to configure the application The real-time model must be obtained from metadata provided by the components Reactive Specification of the application - • Implementations selection Deployment • Nodes assignment plan • Instances Business configuration Repository • Scheduling Configuration Application Designer 3 Valencia, June 2010 P. López, L. Barros and J.M.Drake
Real-time Component-Based Design Process Application Specification (functionality + timing <<RT-D&C>> Platform description requirements) <<RT-D&C>> Deployment plan <<RT-D&C>> RT-Scheduling Assembly configuration Description parameters Executable (application) Assembler code Executor Planner <<MAST>> <<RT-D&C>> Application Workload Repository RT-Model description Repository Timing metadata associated to the components and the deployment plan to configure the application schedulability in an opaque way => RT-D&C The components must provide temporal behaviour models => CBS-MAST The component technology must provide mechanisms to control the application scheduling (also in an opaque way) => RT-CCM 4 Valencia, June 2010 P. López, L. Barros and J.M.Drake
RT-CCM: Real-Time Container Component Model Component Framework Component Model LwCCM CIF Connectors CCM + + Mechanisms to guarantee Predictable communication (+ RT Extensions) predictable temporal behaviour mechanisms RT-CCM (PIM) RT-D&C : CBS-MAST Ada Real-Time extension of the “Deployment and Configuration of Component-Based Applications” 2005 specification of the OMG Real-Time Modeling Methodology Metadata Specification Ada-CCM 5 Valencia, June 2010 P. López, L. Barros and J.M.Drake
Application example: ScadaDemo Physical magnitudes ScadaDemo Monitor External Enviroment Logger Keyboard Application specification D = samplingPeriod T= samplingPeriod Register value Read for statistics magnitudes D = loggingPeriod T= loggingPeriod Gather and Store data pack data D = displayPeriod T= displayPeriod Refresh monitored Read last data value Process Command 6 Valencia, June 2010 P. López, L. Barros and J.M.Drake
ScadaDemo architecture and deployment host::MaRTEOS_Processor [scada] [db] DBChangeEvent ScadaManager manager::ScadaManager alarmEvent Logger alarmHandler 1..n displayPeriod:Float [scada] DisplayTrans engine::ScadaEngine ScadaEngine regPort CommandTrans logPort samplingPeriod:Float 1..n scadaPort Logging 1 loggingPeriod:Float register::Logger [io] SamplingTrans controlPort IOCard LoggingTrans ScadaControl sensorA::IOCard adqPort 1..n analogPort cardID:String AnalogIO sensorB::IOCard <<interface>> DBChangeEvent <<interface>> handEvent() <<interface>> … ScadaControl <<interface>> AnalogIO supervise() cancel() Logging read() getLastLoggedData() write() log() getBufferedData() … … … 7 Valencia, June 2010 P. López, L. Barros and J.M.Drake
Concurrency in an RT-CCM component The business code of an RT-CCM component may <<active>> be concurrently executed by multiple threads: manager:AdaScadaManager Created by the component itself To attend external events or execute internal activities keyboardTh displayTh Ex: loggingTh and samplingTh Coming from external components that invoke its ScadaControl services: <<active>> Ex: keyboardTh and displayTh engine:AdaScadaEngine dataMtx Synchronization mechanisms are required to guarantee mutual exclusive access to shared resources: loggingTh samplingTh Ex: dataMtx AnalogIO Logging Suitable values of the scheduling parameters of threads and synchronization mechanisms obtained from the real-time design 8 Valencia, June 2010 P. López, L. Barros and J.M.Drake
Concurrency support in RT-CCM In RT-CCM, the container is responsible of creating and managing: Threads => Activation Ports and ThreadingService Two types of activation ports: PeriodicActivation port OneShotActivation port Synchronization mechanisms > Synchronization ports + SynchronizationService Two types of mechanisms: Mutex ConditionVariable Executor Context AdaScadaEngine AnalogIO (business passive code) ScadaControl Logging dataMtx samplingTh loggingTh AdaScadaEngine PeriodicActivation Mutex (container) Synchronization Threading Service Service Execution platform 9 Valencia, June 2010 P. López, L. Barros and J.M.Drake
Scheduling parameters assignment in RT-CCM Component A Oper A Oper C Component C Client component Component B Oper B Transaction Model OperA OperA OperA OperC OperC Trigger OperB OperB (part 1) (part 3) (part 2) (part2) (part1) 10 Valencia, June 2010 P. López, L. Barros and J.M.Drake
Scheduling Support in RT-CCM A Transaction_Defined policy is managed in RT- CCM by connectors through StimulusId engine manager register SchedulingService loggingTh.update buildMagn Mssgs log stimID=22 prty=8 stimID=20 handleEvent stimID=21 prty=20 prty=8 <<connector>> Logging Logging register Instance engine engineToregister Reactive model log Scheduling Service Prioridad stimulusId OutputId inputId Execution platform 20 20 20 21 21 8 80 90 22 8 11 Valencia, June 2010 P. López, L. Barros and J.M.Drake
Real-Time model of a RT-CCM Component <<cbsMast>> <<cbsMast>> AdaScadaEngine:Software_Component dataMtx :Shared_Resource <<Decl_Param_List>> samplingThPeriod:Time_Interval <<Decl_Param_List>> samplingThPrty :Priority <<cbsMast>> <<Decl_Param_List>> loggingThPeriod:Time_Interval controlPort :Provided_Port <<Decl_Param_List>> loggingThPrty:Priority operList <<cbsMast>> <<Decl_Param_List>> dataMtxCeiling;Priority=31 getBufferedData :Simple_Operation sharedResources = dataMtx <<cbsMast>> getLastLoggedData :Simple_Operation <<cbsMast>> <<cbsMast>> LoggingTrans :Transaction SamplingTrans :Transaction <<cbsMast>> <<cbsMast>> loggingTh :Scheduling_Server samplingTh :Scheduling_Server scheduler = HOST .scheduler priority = samplingThPrty <<Decl_Param_List>> loggingDeadline:Time_Interval LoggingTrans <<hardGlobalDeadline>> loggingTh deadline= loggingDeadline <<activity>> <<periodicEvent>> <<activity>> Logging loggingTrigger BuidMagnitudeMssgs endLogging {usage= logPort .log} e2 {usage=buildMagnMssg} {period = loggingThPeriod } 12 Valencia, June 2010 P. López, L. Barros and J.M.Drake
RT-CCM Component Development Process Offered rt-operation SCADA ScadaControl - getLastLoggedData Specifier functionality - getBufferedData controlPort (reusable) [scada] ScadaEngine RT-D&C samplingPeriod:Float <<ComponentInterfaceDescription>> loggingPeriod:Float ScadaEngine.ccd.xml SamplingTrans LoggingTrans adqPort 1..n logPort 1 Developer Required rt-operation Required rt-operation - log - read Logging AnalogIO CBS-MAST RT-D&C <<ComponentImplementationDescription>> <<SoftwareComponent>> [scada] AdaScadaEngine.cid.xml AdaScadaEngine.rtm.xml AdaScadaEngine::ScadaEngine AdaScadaEngine.a <rt>samplingThPeriod:Float = samplingPeriod <rt>loggingThPeriod:Float = loggingPeriod <rt>samplingThPrty:Priority <rt>loggingThPrty:Priority <rt>dataMtxCeiling:Priority Packager samplingTh loggingTh dataMtx RT-D&C Component Mutex <<ComponentPackageDescription>> PeriodicActivation package ScadaEngine.pcd.xml 13 Valencia, June 2010 P. López, L. Barros and J.M.Drake
Recommend
More recommend