**4. Description of agent learning model**

Because of the difference resources which *CC*, *CN*, and the network provided in *DNE*, their types must be considered. These types are described as follows:

**Definition.10.Cache node type (CNT)** can be defined by RSV (rcpu, rmem, rdisk, rnet) of the cache node. According to the real conditions of each CN in DNE, the CN types can be divided into the cache node type set CTS= {CT1, CT2,...,CTct}.

**Definition.11.Network type (NT)** is defined as *NT* (*B*, *PRT*), where *B* denotes as the network bandwidth of *CC*; *PRT* indicates network protocols of *CC*. According to the real condition of networks, network types can be divided into the network type set *NTS*= {*NT1*, *NT2*,...,*NTnt*}.

The agent rules are described as follows:

Research and Implementation of Parallel Cache Model Through Grid Memory 143

Suppose that there are p cache nodes CN1, CN2 … CNp, and their memory storage ability are Ma1, Ma2 … Map, their computing ability are Ca1, Ca2 … Cap; so, the total memory storage

cache files {CF1, CF2 … CFm} in PCMGM and their segment lengths are {Segl1,Segl2 … Seglm}.

*Asl* 

**Average cache ability** of cache node is Ac= *Tc* / *p* , and Ac denotes that the average

**Average computing ability demand of cache agent** is Ada that can be determined by the

**Average cache agent ability** of cache node is Aca= / *Tca p* , and Aca denotes that the total

**Hot segment threshold** is a constant H in PCMGM, and if the duplication width of a segment is more than H, we call it as the hot segment. The file which includes the hot

According to the parameters described in Section 5.1, we can construct the cache demand

1

, and Tca denotes that the total numbers of cache

*i i p Ca* 

, and Tc denotes that the total numbers of

; and, there are m

, and the total computing ability is Gcc=

*i*

)/*m*;

1

*i m Segl*

numbers of DSEG can be stored by one cache node memory at one moment;

*Ada* 

numbers of cache agents can be supported by one cache node at one moment;

matrix, which is the total cache needing of all cache files, and as followings:

6. If *dr.w*<*Y1* and *dr.life*>*MaxLife* then *dr.sta*=*"Castoff"*; //Castoff rule

For designing the allocation methods, we introduce some parameters firstly.

If Y2< dr.w < MaxWeight then dr.sta="Stable"; //Stable rule If dr.w >= MaxWeight then dr.sta="Static"; //Static rule If Y1<dr.w<Y2 then dr.sta="Trainable"; //Trainable rule

If MinWeight <dr.w<Y1 then dr.sta="Naive".

*i*

**Total cache ability** of Grid memory is Tc= *Gmc*

DSEG can be stored by grid memories at one moment;

agent can be supported by PCMGM at one moment;

**5. Cache allocation methods** 

1

The parameters are as follows:

RDV of all cache nodes.

**Total cache agent ability** is Tca= *Gcc*

segment is called as the hot file.

1. For CFi ( 1≤i≤m ) do

**5.2 Construction for cache demand matrix** 

{Calculate the duplication width vector

Average segment length is Asl= (

*i p Ma*

**5.1 Parameters** 

ability is Gmc=


The state graph of rules is presented in figure 3.

Fig. 3. The state graph of rules

The dynamic knowledge is the set of all the dynamic rules in *GMG*. The static knowledge is the set of all static rules. The basic knowledge can be earned by passive learning. To adapt the variety of cache resources, the dynamic rules must be generated at the start of the cache and revised during the caching process. Therefore, reinforcement learning can be adopted in the revising mechanism. Resources utilization for cache is very important reinforcement factors.

Suppose that *Y1* is the *castoff threshold*, and *Y2* is the *mature threshold*; *Q (urt)* denotes as the *reinforcement function,* and *Q(urt)* >0.*urt* indicates resources utilization rate; *MaxWeight* is the maximum of the rule weight, and *MinWeight* is the minimum of the rule weight, and let *MinWeight<Y1<Y2< MaxWeight*; *MaxLife* be the maximum of life value. The revising process is as follows:


```
If dr.w<MinWeight then dr.w=MinWeight;
```
6. If *dr.w*<*Y1* and *dr.life*>*MaxLife* then *dr.sta*=*"Castoff"*; //Castoff rule If Y2< dr.w < MaxWeight then dr.sta="Stable"; //Stable rule If dr.w >= MaxWeight then dr.sta="Static"; //Static rule If Y1<dr.w<Y2 then dr.sta="Trainable"; //Trainable rule If MinWeight <dr.w<Y1 then dr.sta="Naive".
