**3.1 Combination**

Combination entails combining messages into a larger packet to solve the problem of protocol overhead during communication. **Figure 2** illustrates how such combination reduces traffic. Combining meter messages on smart grids is efficient because each piece of data generated by a meter have a size of only a few bytes.

**Figure 2.**

*Concept underlying the combination procedure.*

Concentrators combine messages that have been sent by meters in a specified period, after which they compact the messages.

**Figure 3** illustrates the operating procedures of a typical combination algorithm. Specifically, the concentrators receive meter messages, place the messages into a combination queue, combine the messages in the queue once some predetermined quantity of messages have been accumulated, and finally compact the messages into a package [17]. This method enables solving the protocol overhead problem. The data compaction scheme is detailed as follows.

### **3.2 Compaction**

Compaction reduces the size of headers in large-scale AMI architecture, which is very helpful for reducing data volume. Messages can be compacted through either full compaction (FC) or loose compaction (LC) [17].

#### *3.2.1 Full compaction*

**Figure 4** illustrates the operating procedures of an FC algorithm. Specifically, any piece of data received from the meter is stored in *Qc*, and the usage in the

*Data Compression Strategies for Use in Advanced Metering Infrastructure Networks DOI: http://dx.doi.org/10.5772/intechopen.94974*

**Figure 3.** *Combination procedure.*

current period is calculated by determining the difference between the message in the current period and the message in the last period; this process is performed until *Qc* is empty. Subsequently, before the usage data are stored in *Qt*, the calculated value should be normalized; this can specifically be achieved by multiplying the value by 10<sup>3</sup> to convert any floating-point number into an integer. Once all messages are in *Qt*, the concentrators can start calculating the sum of all values in *Qt*. Once the FC procedure is complete, the concentrators obtain the total usage from the meter data, which helps power suppliers monitor the usage of an area to optimize power delivery.

To illustrate the FC procedure, **Table 1** lists some energy usage values in an area. First, all values are input into *Qc*. Second, the difference between the previous usage and current usage is calculated for each period. Third, the values obtained from these calculations (212.880, 323.769, 388.112, 46.115, and 610.762 in this example)


#### **Table 1.**

*Example meter data from an area.*

are input into *Qt*. Finally, these values in *Qt* are summed to indicate the net difference in energy usage (1581.638 in this example).

#### *3.2.2 Loose compaction*

LC differs from FC in that LC is recoverable, whereas FC is not. **Figure 5** illustrates operating procedures of an LC algorithm. First, the concentrators obtain meter data by dequeuing *Qc* and subtracting the meter value for the current period from the meter value for the previous period. Second, similar to second step of the FC algorithm, the value obtained in the first step is multiplied by 10<sup>3</sup> for normalization and subsequently input into *Qt*. Third, LC sorts values in *Qt* in descending order. Fourth, the positive difference between a value and its lower-valued neighbor is computed and then input into *Ql*; the initial, lowest value in *Qt* thus remains unchanged. For example, if ½ � *a*, *b*,*c*, *d* is input into *Qt*, then ½ � *a*,ð Þ *b* � *a* ,ð Þ *c* � *b* ,ð Þ *d* � *c* is input into *Ql*. Finally, the values returned by the LC algorithm constitute the compacted data.

To illustrate the LC procedure, consider the values in **Table 1**. First, the LC algorithm takes the difference between past and present usages and inputs these differences into *Qc*. In this example, these differences can be listed as follows: [212.880, 323.769, 388.112, 46.115, 610.762]. This list is then sorted in descending order as [46.112, 212.880, 323.769, 388.112, 610.762] and input into *Qt*. The LC algorithm then dequeues each piece of data from *Qt* and calculates the positive difference between a value and its lower-valued neighbor. The list of such

**Figure 5.** *LC flow.*

*Data Compression Strategies for Use in Advanced Metering Infrastructure Networks DOI: http://dx.doi.org/10.5772/intechopen.94974*

differences is as follows: [46.112, 166.768, 110.889, 64.343, 222.650]. This list is input into *Ql* and returned.

After compacting the data, the concentrators send the data to the MDMS. When the MDMS receives the data, it executes the LC recovery (LCR) algorithm to extract the raw data. **Figure 6** illustrates the LCR algorithm, which is the reverse of the LC algorithm. First, the LCR algorithm inputs the received data into *Ql*; the algorithm then recovers those values prior to subtraction from a lower-valued neighbor. These recovered values are then input into *Qt*. Second, the LCR algorithm denormalizes each value in *Qt* and adds to it the value of the usage in the previous period. Finally, the MDMS outputs all values into *Qc* and returns them.

Consider the values for the example presented in **Table 1**. First, the LCR algorithm recovers the compacted data; specifically, the MDMS inputs [46.112, 166.768, 110.889, 64.343, 222.650] into *Ql*. Subsequently, the LCR algorithm recovers the

**Figure 6.** *LC recovery procedure.*

**Figure 7.** *FC and LC analysis.*

values prior to subtraction from a lower-valued neighbor; specifically, the MDMS obtains [46.112, 212.880, 323.769, 388.112, 610.762] and inputs this list into *Qt*. Finally, the LCR algorithm denormalizes the data by multiplying each value by 103; specifically, the MDMS obtains the list of raw data [46.112, 212.880, 323.769, 388.112, 610.762].

#### *3.2.3 Result analysis*

First of all, all of messages sent from meters were encoded in ASCII. FC and LC compaction performance are provided in this section. The **Figure 7** shows the compression ratio of the FC and LC method. The vertical scale label present the total bytes used before compaction and the horizontal scale label is the number of meter messages compacted when compaction. As the **Figure 7** shows, FC has better performance than LC. However, FC does not support recovery, so it can achieve the highly compaction ratio. On the contrary, LC is the trade-off algorithm when recovery function is required and have demand of compression. If the system only need the sum of the energy usage, then FC would be the proper way for compressing the data.

#### **4. Compression technologies**

The choice of compression algorithm has become a critical issue because most IoT devices have hardware limitations, particularly in their low-power-consumption microprocessors. The best compression algorithm provides the best compression ratio given the hardware specifications of an IoT device [18, 19]. This section discusses two well-known approaches to data compression [20].

### **4.1 Lempel–Ziv–Markov chain algorithm**

The Lempel–Ziv–Markov chain algorithm (LZMA) is a member of the LZfamily, and it is based on the LZ77 algorithm, which uses a dictionary-based scheme. The LZMA yields excellent compression ratios without being demanding on hardware, making it suited to IoT environments by virtue of its exclusive dictionary structure [19].

#### **4.2 Prediction by partial matching**

Prediction by partial matching (PPM) can predict a subsequent pattern using present or previous symbols. Moreover, PPM can be used with a Markov model to construct a compression algorithm. For example, the RAR algorithm, developed by Eugene Roshal and Alexander Roshal, uses PPM and the Lempel–Ziv–Storer– Szymanski algorithm to achieve impressive compression [20].

#### **5. Conclusions**

Smart grids will be key infrastructure considering the rapid developments in IoT technology. This chapter presents data compression techniques, such as combination and compaction, developed for reducing the communication data load in a smart grid. These techniques not only reduce the frequency between instances of transmission but also considerably reduce data volume. Moreover, FC and LC can
