📚 Data Storage and File Compression | 数据存储与文件压缩
All digital data, from text messages to videos, must be stored as sequences of binary digits. Storage capacity and access speed affect how quickly programs run, how many files a device can hold, and how efficiently data can be sent over a network. File compression reduces the number of bits needed to represent data, making storage and transmission cheaper and faster.
从短信到视频,所有数字数据都必须以二进制数字序列存储。存储容量和访问速度会影响程序运行速度、设备能保存多少文件以及数据在网络中的传输效率。文件压缩可减少表示数据所需的位数,使存储和传输更便宜、更快。
1. Why Data Storage Matters | 数据存储为何重要
Computers store every file as a pattern of 0s and 1s called binary. The amount of data a device can hold depends on its storage capacity, measured in bytes. Larger storage allows more applications, media and documents, while faster storage reduces loading times and improves system performance.
计算机将每个文件存储为由 0 和 1 组成的二进制模式。设备能保存的数据量取决于以字节为单位的存储容量。更大的存储空间可以容纳更多应用程序、媒体和文档,而更快的存储可以缩短加载时间并提高系统性能。
As files become larger, storing and sharing them becomes more difficult. File compression helps to reduce file size so that data occupies less space on a disk and travels more quickly across a network. This is why compression is important in email attachments, cloud storage and media streaming.
随着文件变大,存储和共享文件变得更加困难。文件压缩有助于减小文件大小,使数据占用更少的磁盘空间,并能更快地在网络中传输。这就是压缩在电子邮件附件、云存储和媒体流中非常重要的原因。
2. Bits, Bytes and Storage Units | 位、字节与存储单位
A bit is the smallest unit of data and can have only one of two values: 0 or 1. Eight bits form one byte, which is enough to represent one character in many text encoding systems. Storage units are based on powers of 2 because computers use the binary number system.
位是最小的数据单位,只能取 0 或 1 两个值之一。8 个位组成一个字节,在许多文本编码系统中足以表示一个字符。存储单位基于 2 的幂,因为计算机使用二进制数制。
| Unit | Symbol | Value in bytes | Typical use |
|---|---|---|---|
| bit | b | 1/8 byte | single binary digit |
| nibble | – | 4 bits = 1/2 byte | half a byte |
| byte | B | 8 bits | one character |
| kilobyte | KB | 2¹⁰ B = 1024 B | short text file |
| megabyte | MB | 2²⁰ B = 1,048,576 B | high-quality photo |
| gigabyte | GB | 2³⁰ B = 1,073,741,824 B | video file |
| terabyte | TB | 2⁴⁰ B = 1,099,511,627,776 B | hard drive |
| petabyte | PB | 2⁵⁰ B = 1,125,899,906,842,624 B | data centre |
When converting between units, multiply when moving to a smaller unit and divide when moving to a larger unit. In many Cambridge IGCSE problems, 1 KB is taken as 1024 B unless the question states otherwise.
在单位之间转换时,向较小单位转换用乘法,向较大单位转换用除法。在许多剑桥 IGCSE 考题中,除非题目另有说明,否则 1 KB 取 1024 B。
3. Binary Data Representation | 二进制数据表示
Text, images and sound must be converted into binary before they can be stored. Text is commonly encoded with ASCII or Unicode, where each character is assigned a binary number. Images are stored as a grid of pixels, and each pixel has a binary colour value determined by the colour depth.
文本、图像和声音在存储之前必须转换为二进制。文本通常使用 ASCII 或 Unicode 编码,每个字符都被分配一个二进制数。图像以像素网格的形式存储,每个像素具有由颜色深度决定的二进制颜色值。
Sound is sampled at regular intervals. The sample rate is the number of samples taken per second, measured in hertz, and the bit depth is the number of bits used for each sample. Higher sample rates and bit depths give better quality but create larger files.
声音按固定间隔采样。采样率是每秒采集的样本数,单位为赫兹;位深是每个样本使用的位数。采样率和位深越高,音质越好,但生成的文件也越大。
4. Calculating File Sizes | 文件大小计算
Text file size can be estimated by multiplying the number of characters by the number of bits used per character. For example, 1000 characters using 8-bit ASCII require 8000 bits, which is 1000 bytes.
文本文件大小可以通过字符数乘以每个字符使用的位数来估算。例如,使用 8 位 ASCII 的 1000 个字符需要 8000 bit,即 1000 byte。
sound file size (bits) = sample rate (Hz) × bit depth × duration (s) × number of channels
For stereo sound there are two channels, so the result is multiplied by 2. Image file size is calculated as resolution width × height × colour depth. These calculations explain why high-quality media files are large and why compression is so useful.
立体声有两个声道,因此结果要乘以 2。图像文件大小的计算公式为水平分辨率 × 垂直分辨率 × 颜色深度。这些计算解释了为什么高质量媒体文件很大,以及为什么压缩如此有用。
5. Storage Media and Devices | 存储介质与设备
Primary storage, such as RAM, holds data currently in use and is volatile, meaning its contents are lost when power is switched off. Secondary storage keeps data permanently and includes magnetic hard disk drives, optical discs such as CD, DVD and Blu-ray, and solid-state drives using flash memory.
主存储器(如 RAM)保存当前正在使用的数据,具有易失性,即断电后内容会丢失。辅助存储器永久保存数据,包括磁性硬盘驱动器、CD、DVD 和蓝光等光盘,以及使用闪存的固态硬盘。
Magnetic storage offers high capacity at low cost but has moving parts. Optical storage is portable and cheap but slower with less capacity. Solid-state storage is fast, durable and silent, but more expensive per gigabyte.
磁性存储容量高、成本低,但有活动部件。光存储便携、便宜,但速度较慢、容量较小。固态存储速度快、耐用且安静,但每 GB 的成本较高。
6. What Is File Compression? | 什么是文件压缩
File compression reduces the number of bits required to store or transmit a file. It works by removing redundancy or by discarding data that is less important. Compressed files take up less space and download faster, but they must be decompressed before normal use.
文件压缩可减少存储或传输文件所需的位数。它通过去除冗余或丢弃不太重要的数据来实现。压缩文件占用空间更少、下载更快,但在正常使用前必须先解压。
Compression can be applied to a single file or to a group of files inside an archive. Many operating systems can create and extract compressed folders automatically. Online services also compress data before sending it over the internet to reduce bandwidth use.
压缩可以应用于单个文件或存档中的一组文件。许多操作系统可以自动创建和解压压缩文件夹。在线服务在通过互联网发送数据之前也会进行压缩,以减少带宽使用。
7. Lossless Compression | 无损压缩
Lossless compression reduces file size without losing any data, so the original file can be exactly reconstructed. It removes repeated patterns and redundancy rather than meaningful information. Common lossless formats include ZIP for general files, PNG for images, and FLAC for audio.
无损压缩在不丢失任何数据的情况下减小文件大小,因此原始文件可以被完全重建。它去除的是重复模式和冗余,而不是有意义的信息。常见的无损格式包括用于一般文件的 ZIP、用于图像的 PNG 和用于音频的 FLAC。
A simple lossless method is run-length encoding. For example, the sequence AAAAA BBBBB can be stored as 5A 5B rather than ten separate characters. This is effective when data has many repeated values.
一种简单的无损方法是游程编码。例如,序列 AAAAA BBBBB 可以存储为 5A 5B,而不是十个单独的字符。当数据存在许多重复值时,这种方法非常有效。
Lossless compression is essential for text files, spreadsheets, programs and any data where losing a single bit could change the meaning. It guarantees that the decompressed file is identical to the original.
无损压缩对文本文件、电子表格、程序以及任何丢失一个位都可能改变含义的数据至关重要。它保证解压后的文件与原始文件完全相同。
8. Lossy Compression | 有损压缩
Lossy compression reduces file size by removing data that is considered non-essential or less noticeable to human senses. The original file cannot be perfectly reconstructed, but the quality may still be acceptable. It is widely used for multimedia because it can achieve much smaller files than lossless methods.
有损压缩通过去除对人类感官不必要或不太明显的数据来减小文件大小。原始文件无法完美重建,但质量可能
Published by TutorHao | IGCSE Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导