Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M....
-
Upload
tabitha-booker -
Category
Documents
-
view
217 -
download
1
Transcript of Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M....
![Page 1: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/1.jpg)
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: 王滋農
![Page 2: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/2.jpg)
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
![Page 3: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/3.jpg)
2. Outline
• LZW compression• LZW for Sensor Nodes (S-LZW)• S-LZW with Mini-Cache (S-LZW-MC)
![Page 4: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/4.jpg)
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
![Page 5: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/5.jpg)
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
![Page 6: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/6.jpg)
3.1 LZW example (3/4)
• Compressing the string: BABAABAAA
ENCODER OUTPUT STRING TABLE
output code
representing codeword string
66 B 256 BA
65 A 257 AB
256 BA 258 BAA
257 AB 259 ABA
65 A 260 AA
260 AA
![Page 7: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/7.jpg)
3.1 LZW example (4/4)
• Uncompressed String: aaabbbbbbaabaabaNumber of bits = Total number of characters * 8
= 16 * 8 = 128 bits
• Compressed string (codewords): <97><256><98><258><259><257><261>Number of bits = Total Number of codewords * 12
= 7 * 12 = 84 bits
![Page 8: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/8.jpg)
Outline
• LZW compression• LZW for Sensor Nodes(S-LZW)• S-LZW with Mini-Cache (S-LZW-MC)
![Page 9: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/9.jpg)
3.2 S-LZW introduction (1/5)
• Never deliver 100% of data to others
- dictionary size
- data size
![Page 10: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/10.jpg)
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
![Page 11: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/11.jpg)
3.2 S-LZW algorithm (3/5)
![Page 12: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/12.jpg)
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
![Page 13: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/13.jpg)
SENSOR DATA – N BYTES GENERATED OVER TIME
…528 B Block (2 Flash Pages)
COMP. ALGORITHM
COMP. ALGORITHM
COMP. ALGORITHM
Compressed Data
Compressed Data
Compressed Data
… … …
………
528 B Block (2 Flash Pages)
528 B Block (2 Flash Pages)
3.2 S-LZW algorithm (5/5)
![Page 14: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/14.jpg)
Outline
• LZW compression• LZW for Sensor Nodes(S-LZW)• S-LZW with Mini-Cache (S-LZW-MC)
![Page 15: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/15.jpg)
3.3 S-LZW-MC introduction (1/3)
• A variant of S-LZW• Data acquiring over short intervals
![Page 16: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/16.jpg)
3.3 S-LZW-MC flow chart (2/3)
Flow chart of S-LZW-MC
![Page 17: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/17.jpg)
3.3 S-LZW-MC example (3/3)
• Hit => Saves multiple bits: (Log2N)+1 Bit
• Miss => Costs just 1 extra escape bit: (9+1)
![Page 18: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/18.jpg)
4. Novelty
• Proposing novel approaches tailored to the unique trade-offs and constraints of sensors
![Page 19: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/19.jpg)
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
![Page 20: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/20.jpg)
6. Weakness
• This paper doesn’t clearly describe how to solve the problem when the dictionary fills
• Not the optimum compression ratio
![Page 21: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/21.jpg)
Thank you
![Page 22: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/22.jpg)
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.
![Page 23: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/23.jpg)
Appendix
![Page 24: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/24.jpg)
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.
![Page 25: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/25.jpg)
LZW Decompression Algorithm
1 Initialize table with single character strings2 OLD = first input code3 output translation of OLD4 WHILE not end of input stream5 NEW = next input code6 IF NEW is not in the string table7 S = translation of OLD8 S = S + C9 ELSE10 S = translation of NEW11 output S12 C = first character of S13 OLD + C to the string table14 OLD = NEW15 END WHILE
![Page 26: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/26.jpg)
Example 2: LZW Decompression 1
Example 2: Use LZW to decompress the output sequence of
Example 1:
<66><65><256><257><65><260>.
![Page 27: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/27.jpg)
Example 2: LZW Decompression Step 1
<66><65><256><257><65><260> Old = 65 S = A
New = 66 C = A
ENCODER OUTPUT STRING TABLE
string codeword string
B
A 256 BA
![Page 28: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/28.jpg)
Example 2: LZW Decompression Step 2
<66><65><256><257><65><260> Old = 256 S = BANew = 256 C =
BENCODER OUTPUT STRING TABLE
string codeword string
B
A 256 BA
BA 257 AB
![Page 29: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/29.jpg)
Example 2: LZW Decompression Step 3
<66><65><256><257><65><260> Old = 257 S = ABNew = 257 C =
AENCODER OUTPUT STRING TABLE
string codeword string
B
A 256 BA
BA 257 AB
AB 258 BAA
![Page 30: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/30.jpg)
Example 2: LZW Decompression Step 4
<66><65><256><257><65><260> Old = 65 S = ANew = 65 C = A
ENCODER OUTPUT STRING TABLE
string codeword string
B
A 256 BA
BA 257 AB
AB 258 BAA
A 259 ABA
![Page 31: Data Compression Algorithms for Energy-Constrained Devices in Delay Tolerant Networks Christopher M. Sadler and Margaret Martonosi In: Proc. of the 4th.](https://reader035.fdocuments.in/reader035/viewer/2022062407/56649db25503460f94aa1448/html5/thumbnails/31.jpg)
Example 2: LZW Decompression Step 5
<66><65><256><257><65><260> Old = 260 S = AANew = 260 C =
AENCODER OUTPUT STRING TABLE
string codeword string
B
A 256 BA
BA 257 AB
AB 258 BAA
A 259 ABA
AA 260 AA