Other Application Of Real Time Systems
OTHER REAL-TIME APPLICATIONS: This section describes the characteristics and requirements of two most common real-time applications. They are real-time databases and multimedia applications.
1. Real-Time Databases
The term real-time database systems refers to a diverse spectrum of information systems, ranging from stock price quotation systems, to track records databases, to real-time file systems. Table 1–1 lists several examples [Lock96]. What distinguish these databases from nonrealtime databases is the perishable nature of the data maintained by them. Specifically, a real-time database contains data objects, called image objects, that represent real-world objects. The attributes of an image object are those of the represented realworld object. For example, an air traffic control database contains image objects that represent aircraft in the coverage area. The attributes of such an image object include the position and heading of the aircraft. The values of these attributes are updated periodically based on the measured values of the actual position and heading provided by the radar system. Without this update, the stored position and heading will deviate more and more from the actual position and heading. In this sense, the quality of stored data degrades. This is why we say that real-time data are perishable. In contrast, an underlying assumption of nonreal-time databases (e.g., a payroll database) is that in the absence of updates the data contained in them remain good (i.e., the database remains in some consistent state satisfying all the data integrity constraints of the database).
a. Absolute Temporal Consistency. The temporal quality of real-time data is often quantified by parameters such as age and temporal dispersion. The age of a data object measures how up-to-date the information provided by the object is. There are many formal definitions of age. Intuitively, the age of an image object at any time is the length of time since the instant of the last update, that is, when its value is made equal to that of the real-world object it represents.11 The age of a data object whose value is computed from the values of other objects is equal to the oldest of the ages of those objects. A set of data objects is said to be absolutely (temporally) consistent if the maximum age of the objects in the set is no greater than a certain threshold. The column labeled “Abs. Cons.” in Table 1–1 lists the typical threshold values that define absolute consistency for different applications. As an example, “aircraft mission” listed in the table refers to the kind of database used to support combat missions of military aircraft. A fighter jet and the targets it tracks move at supersonic speeds. Hence the information on where they are must be less than 50 milliseconds old. On the other hand, an air traffic control system monitors commercial aircraft at subsonic speeds; this is why the absolute temporal consistency threshold for air traffic control is much larger.
b. Relative Temporal Consistency. A set of data objects is said to be relatively consistent if the maximum difference in ages of the objects in the set is no greater than the relative consistency threshold used by the application. The column labeled “Rel. Cons.” in Table 1–1 gives typical values of this threshold. For some applications the absolute age of data may not be as important as the differences in their ages. An example is a planning system that correlates traffic densities along a highway with the flow rates of vehicles entering and exiting the highway. The system does not require the most up-to-date flow rates at all interchanges and hence can tolerate a relatively large age (e.g., two minutes). However, if the difference in the ages of flow rates is large (e.g., one minute), the flow rates no longer give a valid snapshot of the traffic scenario and can lead the system to wrong conclusions.
c. Consistency Models. Concurrency control mechanisms, such as two-phase locking, have traditionally been used to ensure the serializability of read and update transactions and maintain data integrity of nonreal-time databases. These mechanisms often make it more difficult for updates to complete in time. Late updates may cause the data to become temporally inconsistent. Yet temporal consistency of real-time data is often as important as, or even more important than, data integrity. For this reason, several weaker consistency models have been proposed (e.g., [KoSp]). Concurrency control mechanisms required to maintain a weaker sense of consistency tend to improve the timeliness of updates and reads.
As an example, we may only require update transactions to be executed in some serializable order. Read-only transactions are not required to be serializable. Some applications may require some stronger consistency (e.g., all real-only transactions perceive the same serialization order of update transactions) while others are satisfied with view consistency (e.g., each read-only transaction perceives some serialization order of update transactions). Usually, the more relaxed the serialization requirement, the more flexibility the system has in interleaving the read and write operations from different transactions, and the easier it is to schedule the transactions and have them complete in time.
2. Multimedia Applications
Finally, let us look at one of the most frequently encountered real-time applications: multimedia. A multimedia application may process, store, transmit, and display any number of video streams, audio streams, images, graphics, and text. A video stream is a sequence of data frames which encodes a video. An audio stream encodes a voice, sound, or music. Without compression, the storage space and transmission bandwidth required by a video are enormous. (As an example, we consider a small 100 × 100-pixel, 30-frames/second color video. The intensity and color of each pixel is given by the sample values of a luminance and two chrominance signal components,12 respectively, at the location of the pixel. If uncompressed, the video requires a transmission bandwidth of 2.7 Mbits per second when the value of each component at each pixel is encoded with 3 bits.) Therefore, a video stream, as well as the associated audio stream, is invariably compressed as soon as it is captured.
MPEG Compression/Decompression. A video compression standard is MPEG-2 [ISO94]. The standard makes use of three techniques. They are motion compensation for reducing temporal redundancy, discrete cosine transform for reducing spatial redundancy, and entropy encoding for reducing the number of bits required to encode all the information. Depending on the application, the compressed bit rate ranges from 1.5 Mbits/sec to 35Mbits/sec. As you will see from the description below, the achievable compression ratio depends on the content of the video.
Motion Estimation. The first step of compression is motion analysis and estimation. Because consecutive video frames are not independent, significant compression can be achieved by exploiting interframe dependency. This is the rationale behind the motion estimation step. The motion-compensation techniques used in this step assume that most small pieces of the image in the current frame can be obtained either by translating in space corresponding small pieces of the image in some previous frame or by interpolating some small pieces in some previous and subsequent frames. For this reason, each image is divided into 16 × 16-pixel square pieces; they are called major blocks. The luminance component of each major block consists of four 8 × 8 pixel blocks. Each of the chrominance components has only a quarter of this resolution. Hence, each chrominance component of a major block is an 8 × 8 pixel block.