• No results found

Predictive Model

In document n-Dimensional Prediction of RT-SOA QoS (Page 108-112)

4.2 Initial Framework

4.2.3 Predictive Model

The utilisation and availability observations allow for a model to be constructed that represents the µS’s performance with respect to the resources with which it is provided. This model can be

defined in two stages with respect to structure and response-time prediction.

Model Structure

The model M exists as an |R| + 1 dimensional model which accounts for each of the resource types in addition to the dimension of time. M is therefore a kQ

∀r∈Rdr matrix. If k = 10,

dr1= 3, and dr2 = 4 the model would be a 10 × 3 × 4 matrix. Each point in the matrix is itself a

6-tuple capturing all the elements of the utilisation, forecast, and predictive models:

∀m ∈ M, Mj = m, m = ht∨, tµ, Tj, Uj, Fj, Iji (4.16)

Where T stores all the recorded response-times observed by the µS: Tj(s) = {Tj(s), RTT} and

Uj is the utilisation model discussed in the previous section. I acts as the indicator function,

as used by Zibin Zheng et al. [146] as a significance weighting, and is defined as a measure of the density or number of execution instances that ran under a given availability constraint:

∀j, Ij = |MTj| (4.17)

Response-Time Prediction

This model structure can then be used to predict the response-times of µSs as they are deployed based on the current availability of resources. The resource availability is mapped onto the coor- dinates j which is used to index the model. For the prediction the first two parts of the 6-tuple can be used to give either a nominal tµor pessimistic prediction t∨:

RTT[A(h(sn)](sn) =

D

mtµ, mt∨ E

(4.18) The nominal prediction mtµ can be calculated as an iterative mean of response-times using the same form as Eqn. 4.12. The pessimistic prediction provides the observed WCET and is therefore more appropriate for hard real-time systems.

Once execution has started the time-to-finish T T F for the µS instance can be estimated using the execution progress p :

T T F [A(h(sn)](sn) =  1 −p k  mx (4.19)

Where x is either of the response-time predictions t∨or tµ. p is then estimated by comparing the observed and expected resource utilisation at time t:

p(sn)t= max ( p(sn)t−1, min ( ∀r ∈ R : 1 k $ k ·Pt x=0[[Ω(sn)j,r,x]]0..1 F (s)j,r %)) (4.20) Where the observed utilised resources Ω are totalled and compared against the forecast resources F . This comparison is against each resource type and the worst case provide the estimate of the execution progress. Therefore the estimation pessimistically chooses the worst-case scenario by choosing the resource dimension with minimum observed utilisation compared to the forecast utilisation. Within the min function k rounds those values to the nearest multiple of k . This assumes that the work done by the µS is non-decreasing as time progresses .

Initial and Sparse Model Prediction

The model so far facilitates the estimation of response-times and remaining computation time of µSs using previous µS execution data under the currently observed resource availabilities. There are however two situations where the current model is not sufficient:

1. Initial-case where the model is empty with no execution information about the µS. 2. Sparse-case where there is information about execution performance under a subset of

resource availability configurations.

In the first instance the prediction must be based on WCETs provided by the µS developer. This however may be provided in three forms:

1. Response-time purely as a nominal value.

2. WCET with a utilisation model or resource requirement.

3. Response-time with or without resource utilisation information but alongside a host speci- fication.

Where resource utilisation information is provided this can be used in conjunction with traditional real-time systems techniques to estimate the WCET:

RTT[A(h(sn))] = * Uµ provided A(h(sn)) ,U ∨ provided A(h(sn)) + (4.21)

However if resource utilisation data is not available it must be assumed for the worst-case instance that the µS utilised 100% of the host’s resources for its execution duration. Additionally unless a host specification is provided it must be assumed that the response-time, and if provided utilisation information, is relative to the most powerful available host of the available hosts H . If, however, a host specification is provided this can be used as a normalising factor for the provided information. In the instance where the model is sparsely populated, where µS execution has occurred under other resource configurations than those currently observed, an estimate can be inferred from the existing data. Specifically by considering the distance from the current configuration j and existing data points within the model an inverse distance measure can be calculated D−1 :

D−1= 1

dist(i, j) (4.22) Where dist(a, b) can use any distance measure such as Euclidean or Manhattan distances between points a and b within the model space specified by the dimensions of r and size dr. This can

be used in combination with the indicator function I to assign greater significance to those configurations i that are closest to j and have more historical data.

RTT[A(h(sn))](sn) =

P

i6=j(I(s)j·M(s)µj·D −1(i,j))

P

i6=j(I(s)j·D−1(i,j)) ,

P

i6=j(I(s)j·M(s)∨j·D −1(i,j))

P

i6=j(I(s)j·D−1(i,j))



(4.23)

Complete Model

The resulting complete model can therefore be expressed as a conditional statement: RTT[A(h(sn))] =              (Eqn. 4.21) MT ≡ ∅

β1· (Eqn. 4.23) + β2· (Eqn. 4.21) MTj ≡ ∅, ∃i : MTi 6= ∅

γ1· (Eqn. 4.18) + γ2· (Eqn. 4.23) + γ3· (Eqn. 4.21) MTj 6= ∅

(4.24) Where the cases represent the initial and empty, sparsely-populated, and probabilistic models respectively. This statement allows for the three methods to be combined utilising the weight factors β and γ where β1 + β2 = 1 and γ1+ γ2 + γ3 = 1. Overall this method provides the

Figure 4.5: Example from Figure 3.13 where the deadline miss is identified by the frame- work prior to the event.

used to identify during execution whether a deadline D is likely to be missed given the current resource availability.

The next section demonstrates how this framework for predicting the response-time of a µS can be used and evaluates its effectiveness with respect to schedulability, scalability, and efficiency.

In document n-Dimensional Prediction of RT-SOA QoS (Page 108-112)