RT笔记一:RT System vs. Embedded System

 

RT System vs. Embedded System

- ffxz at fayfayspace.org

Real-Time System,实时系统。
Embedded System,嵌入式系统。

这两者有什么不同呢?从学术方面来说,这两者的定义都不是非常严格的,具有一定的相对性,但两者所关注的方面还是有很大区别的:
嵌入式系统,先看一个英文版本的定义[*1]:
A general definition of embedded systems is: embedded systems are computing systems with tightly coupled hardware and software integration, that are designed to perform a dedicated function. The word embedded reflects the fact that these systems are usually an integral part of a larger system, known as the embedding system. Multiple embedded systems can coexist in an embedding system.

也就是说,嵌入式系统是具备一定或很强的目的性,包括硬件上和软件上的。例如常见的嵌入式系统,电视用的机顶盒,网络中的路由器等,它们都是为了一专用目的而设计的,从硬件资源上来讲,为了完成这一专有功能,嵌入式系统提供有限的资源,一般是恰到好处,在成本上满足一定的要求。从电子产品的角度来说,嵌入式系统最终也会由一些电路板,芯片来实现,所以大体来说,它又具备一定的计算单元的。总的来说,嵌入式系统提倡的是为了一个专用目的,其功能够用就好。


实时系统,则主要强调一个时间上的概念。英文上则是[*2]
deadline
n.
最终期限

看看它的英文定义:
Real-time systems are defined as those systems in which the overall correctness of the system depends on both the functional correctness and the timing correctness. The timing cor-rectness is at least as important as the functional correctness.

实时系统非常强调在一个给定的时间内正确的完成任务,关键词有两个:正确地完成和在给定的时间内完成,而且两者的重要性基本上等同的。而针对于在给定的时间内功能性的要求可以划分出常说的两类实时系统。

可以先看一个简单的图:


对于输入的信号、事件,实时系统应该能够在规定的时间内得到正确的响应,而不管这些事件是单一事件、多重事件还是同步信号或异步信号。对于一个具体的例子,可以考虑考虑子弹射向玻璃杯的问题:
一颗子弹从20米处射出,射向一个玻璃杯。假设子弹的速度是v米/秒,那么经过t1=20/v秒后,子弹将击碎玻璃杯。而有一系统在看见子弹射出后,将把玻璃杯拿走,假设这整个过程将持续t2秒的事件。如果t2 < t1,那么这个系统可以看成是一个实时系统。

和嵌入式系统类似,嵌入式系统上也存在一定的计算单元,对系统的环境、里面的应用有所预计,这也就是很多实时系统所说的确定性:对一个给定事件,在一给定的事件t内做出响应。对多个事件、多个输入的响应的确定性构成了整个实时系统的确定性。

嵌入式系统的应用领域十分广泛,并不是其所针对的专用功能都要求实时性的,只有当系统中对任务有严格时间限定时,才有系统的实时性问题。例如,对打印机这样一个嵌入式应用系统,人们并没有严格的时间限定,只有一个"尽可能快的"期望要求,因此,这样的系统称不上是实时系统。

硬实时系统和软实时系统
如上所述,实时系统是非常强调两点的:时间和功能的正确性。判断一个实时系统的正确性也是这样的,在给定的时间内正确的完成相应的任务。但也会有这种系统,在偶尔的情况下也会在给定时间之外正确的完成任务,这种系统通常称为软实时系统。看看各自的英文定义:
A hard real-time system is a real-time system that must meet its deadlines with a near-zero degree of flexibility. The deadlines must be met, or catastrophes occur. The cost of such catastrophe is extremely high and can involve human lives. The computation results obtained after the deadline have either a zero-level of usefulness or have a high rate of depreciation as time moves further from the missed deadline before the system produces a response.

A soft real-time system is a real-time system that must meet its deadlines but with a degree of flexibility. The deadlines can contain varying levels of tolerance, average timing deadlines, and even statistical distribution of response times with different degrees of acceptability. In a soft real-time system, a missed deadline does not result in system failure, but costs can rise in proportion to the delay, depending on the application.

通俗的来说,硬实时系统严格限定在给定的时间内完成任务,否则可能就导致灾难的发生,例如导弹的拦截。而软实时系统,可以允许一定的偏差,但是随着时间的偏移,整个系统的正确性也随之下降,例如一个DVD播放系统可以看成一个软实时系统,可以允许它偶尔的画面或声音延迟。
从效用上,实时系统可以看成:
软实时系统随着给定时间t的推移,效用迅速的走向零值。
非实时系统随着给定时间t的推移,效用缓慢的下降。
硬实时系统在给定时间t之后,马上变为零值。


[*1]大部份的英文定义来自 Real-Time Concepts for Embedded Systems, Qing Li
[*2]也想全部弄个中文的,可惜RT这个词本来就来源于国外呢,连操作系统都没几个中国的!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值