Construction a Real-Time Component for Developing Embedded Real-Time Systems

A real-time component for developing embedded real-time systems is constructed by defined real-time contracts which ingrate with component-based techniques. Taking into account the real-time non-functional requirements, the defined real-time contracts are assigned to both static specification (components) and dynamic specification (state machine and sequence diagram). Based on the enhanced specification, it is useful and easier to design embedded and real-time systems.


Introduction
The correctness of a real-time system does not only depend on the logical result of its computations, but also on the time at which these results are generated [9]. The properties of a real-time system have strong implications on the requirements, for instance, strict timing constraints, concurrency, high reliability and, application-specific design. These display non-functional characteristics. Real-time systems are also known as reactive systems consisting of several components which are designed to interact with one another and with the systems' environments. The output of one component can be used as the input to another one. In addition, real-time systems often work in embedded ways and most embedded systems have real-time processing needs. A real-time system is typically constructed of a number of resources (e.g., processors) and a number of concurrent tasks. They are designed to fulfill a number of timing constraints. If a resource is shared by a number of concurrent tasks, a scheduler is needed. Currently, component-based techniques appear to be an interesting approach in developing embedded and real-time systems on aspects of rapid development times, the ability to re-use existing components, and the ability to compose sophisticated software [1] [3], but the component-based techniques are originally not suitable to develop embedded and real-time systems due to they do not address issues such as timeliness, non-functional and predictability properties. Therefore, it is useful and significance with combination of real-time contracts [2][6] and component-based techniques for meeting the nonfunctional requirements of embedded and real-time systems. The paper is organized as follows, section 2 constructs a real-time component for real-time tasks, the behavior specification of the real-time component is addressed in section 3, and section 4 concludes the real-time component.  It denotes that the start time must be less than the finish time, respective of its deadline. The finish time must be less or equal to a specified upper-bound time. D i ≤ P i : this constraint assumes that the upper-bound time (i.e., the deadline D) is always less or equal to the periodic activation rate P of the component. = S i + P i : this constraint defines the next activation time of the periodic component, which is computed by adding the start-time S and the constant period P.

Aperiodic component
Aperiodic component activations are not regular in comparison to periodic components. They execute predefined actions in response to the occurrence of aperiodic, asynchronous events(see Fig. 1 (c,d)).  k+1 where S i , k denotes the k th activation time of component i, and S i , k+1 its (k + 1) th activation time. The constraint above means that the (k+1) th activation time is greater than the k th one of the aperiodic component's real-time operation. Furthermore, the real-time operation's maximum response time is defined to be between the activation times S i , k and S i , k+1 . Sporadic component has been introduced in order to specify sporadic activities. It acts as active component and possesses an independent thread of control. A sporadic component executes sporadic activities with a predefined minimum arrival time (T min ). Its activation is triggered by the occurrence of an event, whose arrival time is known for a sporadic component in contrast to aperiodic components.

Sporadic Component
Sporadic component has been build in order to specify sporadic activities (see Fig. 1.(e,f)). It acts as active component and possesses an independent thread of control.   k+1 where S i , 1 ≥0, and T min is the (minimum) arrival time.

Behaviour Specification
As mentioned above, the behaviour of the real-time component is described by provided and required behaviour typically captured as communication on the component's provided and required interfaces. As shown in Fig. 2, the real-time component state machine consists of states, events and transitions [8].
State depicts an active component satisfies some condition, performs some activity, or waits for some event. When a state is entered as result of a transition, it becomes active. Any state may optionally have one each of entry, exit, and do activities. Event dispatch an event to its destination active component. An event expression is defined by transition rules which determine the pre-conditions and consequences of state changes. Each event carries an identifier of the active component that will receive the event. Transition is a relation between two states indicating that a component in the first state will perform certain specified actions, and enter the second state when a specified event occurs and the specified conditions are satisfied. A transition rule is a Boolean equation, composed of event variables. When such an expression is satisfied, a transition from one state to another is enabled and system reconfiguration is to be performed. Action and Activity are atomic computations that change the states of active components. They are considered as the fundamental units of behaviour specification.

Component Sequence Diagram
A real-time component sequence diagrams (see Fig.3) are used to specify interactions among components that exchange messages within an interaction arranged in a time sequence. A sequence diagram focuses on each basic component, and the messages they exchange to accomplish some desired behaviour. It is typically used to show components interaction in a single scenario, and makes it easy to see the order in which activities occur.   Fig. 3, the vertical axis of a sequence diagram represents time, whereas the horizontal axis represents components participating in the interaction. Sequence diagrams consist of the elements: •Com_n representing components that may participate within interactions; •Lifeline representing the existence of a component over a certain interval of time; •Activation representing the time during which a component is performing an operation, and •Message representing communication between components. At each component box a vertical line is drawn, referred to as a lifeline. Activation depicts a period when the component is executing (e.g., an operation of the component is executed), for which the lifeline is generally shown as a double solid line. Labelled horizontal arrows represent messages. Only source and destination of messages are relevant. Time increases from the top to the bottom. A sequence diagram provides a means to sketch possible sequences of action a system can go through. Some additional constraints were added in the component in state machine. Constraints, such as guard and pre-or post-conditions, etc., may be used for states and possibly transitions [5] [7].

Conclusion
Extensions of component-based design with static and dynamic specification possibilities for developing embedded and real-time systems are presented. Static specifications are extended by defining a real-time task component, which deals with real-time contracts for modelling nonfunctional requirements. State machines and sequence diagrams are used to express the behaviour of systems or of parts of them. To describe non-functional requirements, state machine are extended by defining timing and probability constructs, and sequence diagrams are enriched by some constraints which are contained in the specification of structure and behaviour. We represent them as additional constraints, and attach them to certain locations on the lifelines of component in a sequence diagram. The extension of the static and dynamic specifications aims to provide a means that enable to express real-time constraints.