Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.

Similar presentations


Presentation on theme: "Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th."— Presentation transcript:

1 Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th ACM Conference on Embedded Networked Sensor Systems (SenSys), 2006. Reporter: 王滋農

2 1. Motivation Previous algorithms of compressing acquired data in sensor systems - application-specific algorithms - off-the-shelf algorithms → Not for resource-constrained sensor nodes Standard compression algorithms are aimed at saving storage not energy

3 2. Outline LZW compression LZW for Sensor Nodes (S-LZW) S-LZW with Mini-Cache (S-LZW-MC)

4 3.1 LZW introduction (1/4) The LZW Compression Algorithm is a dictionary-based algorithm, which always tries to output short codes for strings that are already present in it's dictionary LZW compression uses a code table, with 4096 (12 bits) as a common choice for the number of table entries Codes 0-255 (ASCII code 8 bits) in the code table are always assigned to represent single bytes from the input file When encoding begins the code table contains only the first 256 entries, with the remainder of the table being blanks Compression is achieved by using codes 256 through 4095 to represent sequences of bytes As the encoding continues, LZW identifies repeated sequences in the data, and adds them to the code table

5 3.1 LZW algorithm (2/4) Initialize table with single character strings P = first input character Codeword = 256 WHILE not end of input stream C = next input character IF P + C is in the string table P = P + C ELSE output the code for P add P + C to the string table Codeword++ P = C END IF END WHILE output code for P

6 3.1 LZW example (3/4) Compressing the string: BABAABAAA STRING TABLEENCODER OUTPUT stringcodewordrepresentingoutput code BA256B66 AB257A65 BAA258BA256 ABA259AB257 AA260A65 AA260

7 3.1 LZW example (4/4) Uncompressed String: aaabbbbbbaabaaba Number of bits = Total number of characters * 8 = 16 * 8 = 128 bits Compressed string (codewords): Number of bits = Total Number of codewords * 12 = 7 * 12 = 84 bits

8 Outline LZW compression LZW for Sensor Nodes(S-LZW) S-LZW with Mini-Cache (S-LZW-MC)

9 3.2 S-LZW introduction (1/5) Never deliver 100% of data to others - dictionary size - data size

10 3.2 S-LZW algorithm (2/5) Dictionary size - Experimented with 512, 768, 1024 & Unlimited. - Block sizes of 1, 2, 4 & 10 Flash pages. S ‐ LZW uses 512 entry dictionary and 4 pages or less

11 3.2 S-LZW algorithm (3/5)

12 3.2 S-LZW algorithm (4/5) Data Size – Evaluated 1, 2 & 4 flash page sizes. – Compressed either 2 pages in one block or two individual one ‐ page blocks. – Also, 4 pages in either one block or two individual two page blocks. – Compression ratio benefits while using a block of 2 pages. SS, GDI, ZNet & Calgeo improvements – 25.5%, 12.9%, 4.6%, 3.3%. – Compute times benefit while using a block of 2 pages. SS, GDI, ZNet & Calgeo improvements – 24.5%, 1.7%, 5.3%, 1.1% S ‐ LZW compresses data in block of 528 Bytes (2 Pages) → SS (SensorScope): indoor environmental monitoring → ZNet (ZebraNet): a combination GPS data and debugging data → GDI (Great Duck Island):Habitat and environmental monitoring data → Calgeo (Calgary Corpus): seismic data

13 SENSOR DATA – N BYTES GENERATED OVER TIME … 528 B Block (2 Flash Pages) COMP. ALGORITHM Compressed Data …… … … … … 528 B Block (2 Flash Pages) 3.2 S-LZW algorithm (5/5)

14 Outline LZW compression LZW for Sensor Nodes(S-LZW) S-LZW with Mini-Cache (S-LZW-MC)

15 3.3 S-LZW-MC introduction (1/3) A variant of S-LZW Data acquiring over short intervals

16 3.3 S-LZW-MC flow chart (2/3) Flow chart of S-LZW-MC

17 3.3 S-LZW-MC example (3/3) Hit => Saves multiple bits: (Log 2 N)+1 Bit Miss => Costs just 1 extra escape bit: (9+1)

18 4. Novelty Proposing novel approaches tailored to the unique trade-offs and constraints of sensors

19 5. Strength An efficient and lossless data compression algorithms on the source node The compression algorithms are suitable for static and mobile sensor network and applicable to a wide range of applications

20 6. Weakness This paper doesn’t clearly describe how to solve the problem when the dictionary fills Not the optimum compression ratio

21 Thank you

22  What happens when the dictionary gets too large (i.e., when all the 4096 locations have been used)?  Here are some options usually implemented:  Simply forget about adding any more entries and use the table as is.  Throw the dictionary away when it reaches a certain size.  Throw the dictionary away when it is no longer effective at compression.  Clear entries 256-4095 and start building the dictionary again.  Some clever schemes rebuild a string table from the last N input characters.

23 Appendix

24 LZW Decompression  The LZW decompressor creates the same string table during decompression.  It starts with the first 256 table entries initialized to single characters.  The string table is updated for each character in the input stream, except the first one.  Decoding achieved by reading codes and translating them through the code table being built.

25 LZW Decompression Algorithm 1 Initialize table with single character strings 2 OLD = first input code 3 output translation of OLD 4 WHILE not end of input stream 5 NEW = next input code 6 IF NEW is not in the string table 7 S = translation of OLD 8 S = S + C 9 ELSE 10 S = translation of NEW 11 output S 12 C = first character of S 13 OLD + C to the string table 14 OLD = NEW 15 END WHILE

26 Example 2: LZW Decompression 1 Example 2: Use LZW to decompress the output sequence of Example 1:.

27 Example 2: LZW Decompression Step 1 Old = 65 S = A New = 66 C = A STRING TABLEENCODER OUTPUT stringcodewordstring B BA256A

28 Example 2: LZW Decompression Step 2 Old = 256 S = BA New = 256 C = B STRING TABLEENCODER OUTPUT stringcodewordstring B BA256A AB257BA

29 Example 2: LZW Decompression Step 3 Old = 257 S = AB New = 257 C = A STRING TABLEENCODER OUTPUT stringcodewordstring B BA256A AB257BA BAA258AB

30 Example 2: LZW Decompression Step 4 Old = 65 S = A New = 65 C = A STRING TABLEENCODER OUTPUT stringcodewordstring B BA256A AB257BA BAA258AB ABA259A

31 Example 2: LZW Decompression Step 5 Old = 260 S = AA New = 260 C = A STRING TABLEENCODER OUTPUT stringcodewordstring B BA256A AB257BA BAA258AB ABA259A AA260AA


Download ppt "Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th."

Similar presentations


Ads by Google