• 沒有找到結果。

Class-Based Scheduling Algorithm

Scheduling Algorithm for Scheduled Automatic Power Save Delivery

3.3 Class-Based Scheduling Algorithm

In real applications, it is likely that there are only a few possible periods to schedule TSs.

Therefore, one can partition TSs into classes such that two TSs are in the same class if and only if they have identical periods of schedule. Assume that there are C classes, called Class 1, Class 2, ..., and Class C . Let pi represent the period of Class i and ni the number of TSs in Class i. If ni = 0, then Class i is considered not exist. For ease of description, we assume that ni > 0 for all i, 1 ≤ i ≤ C. The notations and their definitions used in this section can also be referred in Table 3.2.

Consider Class i and let e1, e2, ..., and eni be the TSs in the class. A TS, say, e1, is selected as the representative of Class i. Let Xi = {xi,m}m=−∞ be a sequence of period pi such that xi,m= pi× m for all m. We shall use the representative TS as reference within the class and, therefore, assign Xi as the scheduled instants of TS e1. Let oi,s be the intra-class offset of TS eswith respect to TS e1. As a result, the scheduled instants for TS esis Xi+oi,s. Let

Xi,s= Xi+ oi,s (3.20)

and

Xi =

1≤s≤ni

Xi,s. (3.21)

Assume that a new TS in Class j is to be scheduled. The impact of Xi to the new TS can be analyzed as follows.

Let Y = {ym}m=−∞ be a periodic sequence of period pj with ym = pj × m for all m.

According to the results presented in the previous section, we need to construct a scheduling matrix of size ni× Gi,j, where Gi,j = gcd(pi, pj). The sth row of the scheduling matrix is [ d(Xi, Y + 0) d(Xi, Y + 1) ... d(Xi, Y + Gi,j − 1) ] circularly shifted to the right by oi,s positions. By taking the minimum element in each column, we obtain

R(Xi, Y ) = [ d(Xi, Y + 0) d(Xi, Y + 1) ... d(Xi, Y + Gi,j− 1) ]. (3.22)

Note that the optimal SST of the new TS cannot be determined solely by R(Xi, Y ) because there are still TSs in other classes.

Assume that R(Xi, Y ), 1 ≤ i ≤ C, are obtained. We shall use the representative TS of Class 1 as reference of the overall system. Let

X =

1≤i≤CXi. (3.23)

Further, let Oi, 1 ≤ i ≤ C, be the inter-class offset of the Class i representative TS with respect to the Class 1 representative TS. To determine the optimal SST of the new TS, we construct a global scheduling matrix M of size C × GLj ,where

GLj = lcm{G1,j, G2,j, ..., GC,j}. (3.24)

The ith row of M is R(Xi, Y ) repeated for GLj/Gi,j times and then circularly shifted to the right by Oi positions. By taking the minimum element of each column, we obtain

R(X, Y ) = [ d(X, Y + 0) d(X, Y + 1) ... d(X, Y + GLj− 1) ]. (3.25)

Finally, the optimal scheduled instants of the new TS is given by Y + k, where k satisfies

k = arg max

0≤k≤GLj−1d(X, Y + k). (3.26)

If the new TS is considered as the (n + 1)th TS of Class j, then we update the intra-class offset

oj,nj+1 = k− Oj. (3.27)

3.3.1 Suggested Implementation Method

To reduce online scheduling complexity, we allocate C pairs of arrays for each class. Again, consider Class i . Denote the kth element of the jth pair of arrays by , Ai,j[k] and , Bi,j[k], 0 ≤ k ≤ Gi,j− 1. The array Ai,j stores [ d(Xi, Y + 0) d(Xi, Y + 1) ... d(Xi, Y + Gi,j− 1) ] for Y = {ym}m=−∞ with ym = pj× m for all m. Note that Ai,j represents the impact of the

representative TS e1 to a new TS of Class j. The array Bi,j stores R(Xi, Y ) and represents the impact of all TSs in Class i to a new TS of Class j. When a new TS in Class j is to be scheduled, the arrays Bi,j, 1 ≤ i ≤ C, are used to construct the global scheduling matrix M as illustrated in Fig. 3.4. All we need to do is taking the minimum of each column and then find the maximum among the minima. The complexity is only C × GLj comparisons. After the new TS is scheduled, we need to update Bj,l[k] , 1 ≤ l ≤ C and, 0 ≤ k ≤ Gj,l − 1, as

Bj,l[k] = min{Bj,l[k], Aj,l[k − oj,nj+1]} (3.28)

because the impact of TSs in Class j to a new TS of every class is changed. Here, the index k − oj,nj+1 is performed modulo Gi,j. The complexity of the update process is PC

l=1Gj,l

comparisons, which is upper bounded by C × pj comparisons.

When a TS in Class i finishes, we need to update Bi,j[k], 1 ≤ j ≤ C and , 0 ≤ k ≤ Gi,j−1, as follows. Remove the finished TS so that the updated ni, denoted by n0i, becomes ni − 1.

Construct a scheduling matrix of size n0i× Gi,j such that the mthrow is Ai,j circularly shifted to the right by oi,m positions. The content of Bi,j[k] is updated as the minimum of the kth column. Of course, a new representative TS is selected before the update process if the finished one was originally the representative TS of Class i. The complexity of the update process is n0i×PC

j=1Gi,j comparisons.

Again, we break a tie based on column sum of the global scheduling matrix which requires 2(C − 1) additions and one comparison. Note that one can pre-compute Ai,j[k], 1 ≤ i, j ≤ C and , 0 ≤ k ≤ Gi,j− 1. The initial content of Bi,j[k] is set to a sufficiently large value for all j and k if there is no Class i TS, i.e., ni = 0.

Once the STA has negotiated with the AP a power saving delivery service according to the S-APSD mechanism, it should automatically switch to the Awake state at designated scheduled time every SI unless any further notification. Therefore, the signaling load is saved effectively when compared with legacy power save mode. The start of its established service, i.e., the SST, can be easily found by the AP according to the repetition pattern of

×

Figure 3.4: The illustration of constructing a global scheduling matrix.

the established periodic schedules and the current time since the notion of sequence can be extended to both directions of the time line as shown in our basic idea. Since the service delivered every SI, the delay for the starting of the established service is upper bounded by the value of its SI, rather than the period of the total repetition pattern of different periodic service schedules.

Example 3.2. Assume that C = 2, n1 = 2, n2 = 1, p1 = 6, p2 = 9, and a new TS in Class 2 is to be scheduled. Based on the assumptions, we have G1,1 = 6, G1,2 = 3, G2,1 = 3, and G2,2 = 9. Besides, the contents of Ai,j[k] are given by A1,1 = [0 1 2 3 2 1], A1,2 = [0 1 1]; and A2,1 = [0 1 1], A2,2 = [0 1 2 3 4 4 3 2 1]. Let e1 and e2 represent the TSs in Class 1 with e1 being the representative. Also, let f1 be the representative TS in Class 2. Assume that TS e1 was scheduled first, followed by TS f1, and then TS e2. As a result, when the new TS f2 is to be scheduled, we have O2 = 1 (which is randomly selected from 1 and 2) and o1,2 = 3

(which is randomly selected among 2, 3, and 5). At this moment, the contents of Bi,j[k] are given by B1,1 = [0 1 1 0 1 1], B1,2 = [0 1 1]; and B2,1 = [0 1 1], B2,2 = [0 1 2 3 4 4 3 2 1].

The global scheduling matrix M =

· 0 1 1 0 1 1 0 1 1 1 0 1 2 3 4 4 3 2

¸ .

Therefore, the value of k can be chosen as 2, 4, 5, 7, or 8. We select k = 5 because it has maximum column sum. Then we compute o2,2 = k − O2 = 4 and update B2,1 = [0 0 1], B2,2 = [0 1 2 1 0 1 2 2 1].