# Cloud Computing Based on Computational Characteristics for Disaster Monitoring
## 3 Cloud Computing Model for Disaster Monitoring
### Application of MapReduce for Disaster-Monitoring Model
3:functionMapper(key1, value1)
4:for all item\(\in\)functionsdo
5:F(i+1) = G[F(i), C];
6:endfor
7:key2 = f(key1);value2 = serialize(metadata, F(i+1));
8:output(key2, value2);
9:endfunction
10:functionReducer(key3, value3)
11:deserialize values3 into metadata and F(i);
12:for all item\(\in\)f(i)do
13:// aggregation algorithm;
14:F(i+1) = R[F(i+1)];
15:endfor
16:key4 = key3; value4 = serialize(metadata, F(i+1));
17:output(key4, value4);
18:endfunction
19:functionIterativeCalculation ()
20:{
21:Mapper();
22:Reducer();
23:if F(i+1) meets condition then break;
24:endif
25:}
26:endfunction
```  
**Algorithm 2**The cloud computing model for Iterative Calculation  
Used mainly for the statistical information application of remote-sensing parameters, \(\mathrm{F(i)}=\mathrm{G[s(x,y)]}\) is used to represent the computing model of statistical analysis. According to its characteristic analysis, statistical analysis is performed in the Reduce operation. If necessary, a statistical analysis can be performed internally on each data block in the Map, and then statistical analysis between the data blocks is performed in the Reduce operation. Based on MapReduce, the cloud computing model for such disaster-monitoring model applications is expressed as Algorithm 3. ```
0: the serialized remote sensing data. 0: Intermediate results for the next job input. 1:functionMapper(key1, value1)
2:deserializevalues1 into metadata and s(x, y);
3:for allitemes(x, y)do
4:F(i) = Gitem];
5:endfor
6:key2 = f(key1); value2 = serialize(metadata, F(i));
7:output(key2, value2);
8:endfunction
10:functionReducer(key3, value3)
11:deserializevalues3 into metadata and F(i);
12:for allitemeF(i)do
13://aggregation algorithm;
14:F(j) = G[item];
15:endfor
16:key4 = key3; value4 = serialize(metadata, F(j));
17:output(key4,value4);
18:endfunction
```  
**Algorithm 3**The cloud computing model for Statistical Analysis  
(4) Neighborhood Operation  
This algorithm is used mainly for neighborhood calculations where the data has spatial dependence. The processing of each point in the image needs to depend on all the data in the surrounding neighborhood window, and the spatial information needs to be adjusted accordingly after processing. The computing model of neighborhood calculation is represented by \(\mathrm{F(x,y)}=\mathrm{G[s(x,y)]}\). According to the analysis of the characteristics of the neighborhood calculation, in the Map operation the neighborhood operation is first performed internally for each data block. If it is still necessary to continue processing between the data blocks, i.e., after the internal processing of the data block, it is necessary to perform global information processing, which needs to be done in the Reduce operation; otherwise, Reduce processing is not required. MapReduce's cloud computing model for this type of disaster-monitoring model is expressed as Algorithm 4. (5) Frequency Domain Operation  
This type of algorithm is mainly used for algorithms that perform frequency domain analysis or processing on images. The whole calculation process is divided into three steps. First, the time domain data is transformed into the frequency domain data as \(\mathrm{F(s)}=\mathrm{G[f(t)]}\), and then the frequency domain data is processed by the filter or the time-frequency window function \(W(s)\), and finally it is inversely transformed into time domain data as \(f(t)=G^{-1}[F(s)]\). ```
1:the serialized remote sensing data. 2:Intermediate results for the next job input. 3:functionMapper(key1, value1)
4:deserialize values1 into metadata and s(x,y);
5:forallitem\(\in\)s(x,y)do
6:F(x,y)=G[item];
7:endfor
8:recalculation(metadata)\(\rightarrow\)newMetas;
9:key2 = f(key1); value2 =serialize(newMetas, F(i));
10:output(key2, value2);
11:endfunction
```  
**Algorithm 4**The cloud computing model for Neighborhood Operation  
According to the analysis of its characteristics, since the frequency domain calculation is usually for a whole image, each image data needs to be input as one data block and transferred in parallel between the image data.