Real-Time Systems. Design Principles for Distributed Embedded Applications. Herman Kopetz. Second Edition (811374), страница 37
Текст из файла (страница 37)
The time of the state observation refers to the point in realtime when the RT entity was sampled (observed). Every reading of a state observation is self-contained because it carries an absolute value. Many control algorithmsrequire a sequence of equidistant state observations, a service provided by periodictime-triggered readings.The semantics of state observations matches well with the semantics of the statemessages introduced in Sect.
4.3.4. A new reading of a state observation replacesthe previous readings because clients are normally interested in the most recentvalue of a state variable.5.2.4Event ObservationAn event is an occurrence (a state change) that happens at an instant. Because anobservation is also an event, it is not possible to observe an event in the controlledT1Fig. 5.3 Indirectmeasurement of an RT entityT2T3temperature T5.3 Real-Time Images and Real-Time ObjectsFig. 5.4 Observation of anevent115controlled objectevent occurencepoint of observation ofthe event occurencereal-timeobject directly.
It is only possible to observe the consequences of the controlledobject’s event (Fig. 5.4), i.e., the subsequent state. An observation is an eventobservation if it contains the change in value between the old and the new states.The instant of the event observation denotes the best estimate of the instant of theoccurrence of this event. Normally, this is the time of the L-event of the new state.There are a number of problems with event observations:1. Where do we get the precise time of the event occurrence? If the event observation is event-triggered, then, the time of event occurrence is assumed to be therising edge of the interrupt signal.
Any delayed response to this interrupt signalwill cause an error in the timestamp of the event observation. If the eventobservation is time-triggered, then, the time of event occurrence can be at anypoint within the sampling interval.2. Since the value of an event observation contains the difference between theold state and the new state (and not the absolute state), the loss or duplication ofa single event observation causes the loss of state synchronization between thestate of the observer and the state of the receiver. From the point of view ofreliability, event observations are more fragile than state observations.3.
An event observation is only sent if the RT entity changes its value. The latencyfor the detection of a failure (e.g., a crash) of the observer node cannot bebounded because the receiver assumes that the RT entity has not changed itsvalue if no new event message arrives.On the other hand, event observations are more data-efficient than state observations in the case where the RT entity does not change frequently.5.35.3.1Real-Time Images and Real-Time ObjectsReal-Time ImagesA real-time (RT) image is a current picture of an RT entity. An RT image is valid ata given instant if it is an accurate representation of the corresponding RT entity,both in the value and the time domains. The notion of temporal accuracy of an RTimage will be discussed in detail in the next section.
While an observation records afact that remains valid forever (a statement about an RT entity that has beenobserved at a particular instant), the validity of an RT image is time-dependent1165 Temporal Relationsand thus invalidated by the progression of real-time. RT images can be constructedfrom up-to-date state observations or from up-to-date event observations. They canalso be estimated by a technique called state estimation that will be discussed inSect. 5.4.3. RT images are stored either inside the computer system or in theenvironment (e.g., in an actuator).5.3.2Real-Time ObjectsA real-time (RT) object is a container within a node of the distributed computersystem that holds an RT image or an RT entity [Kop90]. A real-time clock with aspecified granularity is associated with every RT object.
Whenever this object clockticks, a temporal control signal is relayed to the object to activate an objectprocedure [Kim94].Distributed RT Objects. In a distributed system, an RT object can be replicated insuch a manner that every local site has its own version of the RT object to providethe specified service to the local site. The quality of service of a distributed RTobject must conform to some specified consistency constraints.Example: A good example of a distributed RT object is global time; every node has a localclock object that provides a synchronized time service with a specified precision P (qualityof service attribute of the internal clock synchronization). Whenever a process reads itslocal clock, it is guaranteed that a process running on another node that reads its local clockat the same instant will get a time value that differs by at most one tick.Example: Another example of a distributed RT object is a membership service in adistributed system.
A membership service generates consistent information about thestate (operational or failed) of all nodes of the system at agreed instants (membershippoints). The length and the jitter of the interval between a membership point and the instantwhen the consistent membership information is known at the other nodes are quality ofservice parameters of the membership service. A responsive membership service has asmall maximum delay between the instant of a relevant state change of a node (failure orjoin), and the instant at which all other nodes have been informed in a consistent manner ofthis state change.5.4Temporal AccuracyTemporal accuracy denotes the temporal relationship between an RT entity and itsassociated RT image. Because an RT image is stored in an RT object, the temporalaccuracy can also be viewed as a relation between an RT entity and an RT object.5.4.1DefinitionThe temporal accuracy of an RT image is defined by referring to the recent historyof observations of the related RT entity.
A recent history RHi at time ti is an ordered5.4 Temporal Accuracy117set of instants {ti,ti 1,ti 2, . . ., ti k}, where the length of the recent history,dacc ¼ z(ti ) z(ti k), is called the temporal accuracy interval or the temporalaccuracy dacc (z(e) is the timestamp of event e generated by the reference clock z;see Sect. 3.1.2). Assume that the RT entity has been observed at every instant of therecent history. An RT image is temporally accurate at the present time ti if9 tj 2 RHi : Value ðRT image at ti Þ ¼ Value ðRT entity at tj ÞThe current value of a temporally accurate RT image is a member of the set ofobservations in the recent history of the corresponding RT entity. Because thetransmission of an observation message from the observing node to the receivingnode takes some amount of time, the RT image lags behind the RT entity (seeFig.
5.5).Example: Let us assume, that the temporal accuracy interval of a temperature measurement is 1 min. An RT-image is temporally accurate if the value contained in the RT imagehas been observed at most a minute ago, i.e., it is still in the recent history of thecorresponding RT-entity.Temporal Accuracy Interval. The size of the admissible temporal accuracy intervaldacc is determined by the dynamics of the RT entity in the controlled object. Thedelay between the observation of the RT entity and the use of the RT image causesan error(t) of the RT image that can be approximated by the product of the gradientof the value v of the RT entity multiplied by the length of the interval between theinstant of observation and the instant of its use (see also Fig.
1.6):errorðtÞ ¼dvðtÞðzðtuse Þ zðtobs ÞÞdtIf a temporally valid RT image is used, the worst-case error,error ¼dvðtÞdacc ;max8tdtvalueis given by the product of the maximum gradient and the temporal accuracy dacc. Ina balanced design, this worst-case error caused by the temporal delay is in the sameorder of magnitude as the worst-case measurement error in the value domain and istypically a fraction of a percentage point of the full range of the measured variable.Fig. 5.5 Time lag betweenRT entity and RT imagetemporal accuracy intervalreal-time1185 Temporal RelationsIf the RT entity changes its value quickly, a short accuracy interval must bemaintained.
Let us call tuse the instant when the result of a computation using an RTimage is applied to the environment. For the result to be accurate, it must be basedon a temporally accurate RT image, i.e.:zðtobs Þbzðtuse Þbðzðtobs Þ þ dacc Þwhere dacc is the accuracy interval of the RT image. If this important condition istransformed, it follows that:ðzðtuse Þ zðtobs ÞÞbdacc :Phase-Aligned Transaction. Consider the case of an RT transaction consisting ofthe following phase synchronized tasks: the computational task at the sender(observing node) with a worst-case execution time WCETsend, the message transmission with a worst-case communication delay WCCOM, and the computationaltask at receiver (actuator node) with a worst-case execution time WCETrec (Fig.
5.6,see also Fig. 3.9). Such a transaction is called a phase-aligned transaction.In such a transaction, the worst-case difference between the point of observationand the point of use,ðtuse tobs Þ ¼ WCETsend þ WCCOM þ WCETrec ;is given by the sum of the worst-case execution time of the sending task, the worstcase communication delay, and the worst-case execution time of the receiving taskthat uses the data in the output of a setpoint to the actuator in the controlled object.If the temporal accuracy dacc that is required by the dynamics of the applicationis smaller than this sum, the application of a new technique, state estimation, isinevitable in solving the temporal accuracy problem. The technique of state estimation is discussed in Sect.