**3.2 Real-time data**

In [Kuo, Mok], relative sensor transaction and trigger who used to update the derived object are discuss in detail, this chapter studies only concurrency control related users transaction, similar with [Liu, Son]. User transactions T have the following attributes:


In active real-time database, temporal data have lots of features; this section give only related properties which presented algorithm in this chapter. First of all, according to [Son] this article introduces the concept of the data-deadline.

**Definition1.** Data-deadline of transaction T is the minimum data time validity which transaction T access to the temporal data objects at time t, denote it as dd (T) <sup>t</sup> ,

$$\mathbf{dd}\_{\mathfrak{t}}(\mathbf{T}) = \min\_{\chi\_{\mathfrak{e}} \boxtimes\_{\mathfrak{s}\_{\mathfrak{t}}^{\simeq}(\mathbf{T})}} \mathbf{avi}\_{\mathfrak{e}}(\mathbf{X})$$

The temporal relationship between temporal data and transaction is presented by datadeadline. The data-deadline increased the difficulty of transaction scheduling and concurrent control, because no achieving deadline to the transactions may restart or abort due to the data deadline. Example 1 shows that the data-deadline of transactions influences the concurrent control.

**Example 1.** Transaction T1: w1(x)r1(y); T2:w2(y)r2(z).

180 Real-Time Systems, Architecture, Scheduling, and Application

The basic objects update the database by the sensor and reflect specific entity in the real environment. Derived objects are composed by the new derived data from basic object and others. In Active real-time database, it can trigger transactions according to ECA rules when basic object is updated by sensor. Triggered transactions may update the status from the basic derived objects. In this chapter, the basic object take need scheduling strategy, until transactions need call, it was called by sensor. Transactions T call temporal data X at time t,

Active real-time database system had sensor transaction, which are used to update basic objects, only writing transaction; triggered updating transaction, which are updated and triggered transaction by the basic objects, and used to update derived object; user transaction, which have user transactions of the deadline. When transaction satisfies only

3. The data that transaction read is temporal consistent, and the data still effective when

In [Kuo, Mok], relative sensor transaction and trigger who used to update the derived object are discuss in detail, this chapter studies only concurrency control related users transaction,



In active real-time database, temporal data have lots of features; this section give only related properties which presented algorithm in this chapter. First of all, according to [Son]

similar with [Liu, Son]. User transactions T have the following attributes:




2. the basic objects and derived objects

absolute validity for the start time is t.

1. Transaction is consistent logically. 2. Transaction satisfies the deadline.

the transaction read it commits.


t; to nto L (T) L (T) L (T) tt t = + ;


this article introduces the concept of the data-deadline.


**3.2 Real-time data** 

time t;


the following conditions in system, it commits successfully:

The deadline of transaction T1 is t7, and its estimated time of completion is t6. The deadline of transaction T2 is t8; and its estimated time of completion is t6. The validity of temporal data z is [t4, t6].

As shown in Fig. 1, transaction T2 enter into validation phase at time t5, according to literature [Lindstrom, Wang], WS(Tv)∩RS(Ta)={y}≠Ø, transactions execution sequence is T1→T2, T2 will delay to submit. If transaction T1 submits after t6, transaction T2 will die for the temporal data z exceed deadline.

Fig. 1. Execution of Transactions

Do not consider real-time of data, we will succeed scheduling T1, T2 , according to the traditional optimistic method[Lindstrom]; But it increases the real-time nature of data, transaction T2 will die because it can't satisfy data-deadline. Example1 shows the temporal characteristics of the data influence the concurrency control, while the existing concurrency control method is no consideration to the conflict which access temporal data.

In addition to data-deadline, there is another important characteristic is the stability of the data. Real-time data has different rate of change, some change frequently and others not. If |avie (X) -avib (X) | < k , we denoted temporal data as changeful, otherwise stable. According to the different time limit of transactions, the value k dynamic changes along with the transaction access to temporal data, it will be discussed in detail in the next section.

Real-Time Concurrency Control Protocol Based on Accessing Temporal Data 183

Before transaction access each temporal data, we call CHECKING Algorithm to ensure the effectiveness of temporal data. At the same time, through dynamically adjusting value k, we

If | avie (X) -avib (X) | < k , we denoted temporal data as changeful, otherwise stable. Value k denoted the length of absolute validity; it changed dynamically along with the transaction access to temporal data, and the smaller the k value is shows the more unstable temporal data is. If temporal data which transaction access the next is more changeful than the current, | avie (Xi) -avib (Xi) |<k , we restart to check whether the data can submit before the deadline, if it can satisfy the temporal consistency, value k will be changed the absolute valid length of temporal data. So CHECKING Algorithm check the consistency of

**Theorem1.** CHECKING Algorithm can ensure the consistency of transaction scheduling

**Prove.** Induce the number of temporal data n(T) which transaction T need access, When n(T)=1, proposition was established obviously, otherwise transaction will abort. Supposed n(T)=m, proposition was established. When n(T)=m+1, it can be divided into two cases:

1. When | avie (Xi) -avib (Xi) | ≥ k , it must satisfy the consistency of temporal data. Supposed that transaction T access temporal data Xi at time t, according to the need of

2. When| avie (Xi) -avib (Xi) |<k , the length of the absolute valid which transaction read the next temporal data is less than k. Showing the accessing data is changeful, and compute the value dd (T) <sup>t</sup> , on the basis of Lemma1, it satisfies temporal consistency of

data. Proposition was established. Sum up(1), (2), the proposition is established.

**5. Real-Time concurrency control protocol based on accessing temporal data** 

The concurrency control mechanism in the database must guarantee the consistency of the database; serializability is one correctness standard of concurrency control in the database.

complete, all the data can satisfy the time limit proposition was established.

e t avi (X ) dd (T) ≥ . Supposed n(T)=m,

e t avi (X ) C (T) ≥ . So before transactions

**Lemma1**. CHECKING Algorithm can ensure the consistency of variable temporal data.

j j e b

k k |avi (X ) avi (X )|

each of variable data to ensure transaction to submit correctly.

the scheduling strategy, avib (Xi) = t, so <sup>i</sup>

proposition was established, dd (T) C (T) t t ≥ , so <sup>i</sup>

= − ;}

to 12 m i RS (T) {X ,X ...X } {X } <sup>t</sup> = − ; if(| avie (Xi) -avib (Xi) |<k) then if dd (T) C (T) t t < then Abort(T);

make the variable data consistency.

i

j 1

=

else

to L (T) N 1 <sup>t</sup> = − ;

i=i+1;

temporal data.

**(RTCC-DD)** 

}
