📚 A-Level WJEC Computer Science: Concept Clarifications | A-Level WJEC 计算机:概念辨析
In A-Level Computer Science, understanding subtle distinctions between related concepts is crucial for success in both examinations and practical programming. This article clarifies some of the most commonly confused topics in the WJEC specification, from system architecture to networking and data management.
在 A-Level 计算机科学中,理解相关概念之间的细微差别对于考试和实践编程都至关重要。本文澄清了 WJEC 考纲中一些最容易混淆的主题,涵盖系统架构、网络和数据管理等方面。
1. Compiler vs Interpreter | 编译器与解释器
A compiler translates a high-level language program into machine code all at once, producing an executable file. Once compiled, the program can be run repeatedly without further translation, leading to faster execution. In contrast, an interpreter translates and executes the source code line by line each time the program is run, without generating a separate executable file.
编译器一次性将高级语言程序翻译为机器码,产生可执行文件。编译后,程序可直接重复运行而无需再次翻译,因此执行速度更快。相反,解释器在每次运行程序时逐行翻译并执行源代码,不会生成独立的可执行文件。
Compilers typically report all syntax errors after the entire analysis phase, allowing the programmer to fix multiple issues at once. Interpreters stop at the first error, which can simplify debugging for small scripts but may be less efficient for large projects. Compilers are commonly used for languages like C and C++, while interpreters are associated with Python and JavaScript (though modern implementations often use just-in-time compilation).
编译器通常在整个分析阶段后报告所有语法错误,从而使程序员能够一次性修复多个问题。解释器在遇到第一个错误时停止,这对于小型脚本的调试可能更简便,但对于大型项目效率较低。编译器常用于 C 和 C++ 等语言,而解释器则与 Python 和 JavaScript 相关(尽管现代实现常采用即时编译)。
2. RAM vs ROM | 随机存取存储器与只读存储器
Random Access Memory (RAM) is a volatile storage that holds data and instructions currently being used by the CPU. When the computer is turned off, all contents of RAM are lost. Read-Only Memory (ROM) is non-volatile and retains its data without power. ROM typically stores firmware, such as the BIOS or bootloader, which is essential for starting the computer.
随机存取存储器(RAM)是易失性存储器,用于存放 CPU 当前正在使用的数据和指令。计算机关机后,RAM 中的所有内容都会丢失。只读存储器(ROM)是非易失性的,断电后仍能保留数据。ROM 通常存储固件,如 BIOS 或引导加载程序,这些对启动计算机至关重要。
RAM is designed for fast read and write operations, enabling the system to multitask efficiently. ROM is read-only under normal operation and cannot be easily rewritten; some types like EEPROM can be reprogrammed but with limited speed and endurance. The capacity of RAM is much larger than ROM in a typical system, as it must accommodate the operating system and applications during runtime.
RAM 设计用于快速读写操作,使系统能高效地执行多任务。ROM 在正常操作下只能读取,不易被重写;某些类型如 EEPROM 可重编程,但速度和耐用性有限。在典型系统中,RAM 的容量远大于 ROM,因为它必须在运行时容纳操作系统和应用程序。
3. TCP vs UDP | 传输控制协议与用户数据报协议
Transmission Control Protocol (TCP) is a connection-oriented transport-layer protocol that guarantees reliable, ordered delivery of data. It establishes a connection via a three-way handshake and uses acknowledgements, timeouts, and retransmissions to ensure data integrity. User Datagram Protocol (UDP) is connectionless and does not provide reliability or ordering; it simply sends datagrams without guaranteeing arrival.
传输控制协议(TCP)是一种面向连接的传输层协议,可保证可靠、有序的数据交付。它通过三次握手建立连接,并使用确认、超时和重传来确保数据完整性。用户数据报协议(UDP)是无连接的,不提供可靠性或排序保障;它只是发送数据报而不保证到达。
TCP is suitable for applications where data accuracy is critical, such as web browsing (HTTP/HTTPS), email (SMTP), and file transfers (FTP). UDP is preferred for real-time services where speed outweighs reliability, such as video streaming, online gaming, and Voice over IP (VoIP). TCP headers are 20 bytes (minimum) compared to UDP’s 8 bytes, making UDP more lightweight and faster.
TCP 适用于数据准确性至关重要的应用,如网页浏览(HTTP/HTTPS)、电子邮件(SMTP)和文件传输(FTP)。UDP 更适合速度优先于可靠性的实时服务,如视频流、在线游戏和网络电话(VoIP)。TCP 头部至少 20 字节,而 UDP 头部仅 8 字节,因此 UDP 更轻量且更快。
4. LAN vs WAN | 局域网与广域网
A Local Area Network (LAN) spans a small geographical area, such as a single building or campus. It is typically privately owned and offers high data transfer rates, often using Ethernet or Wi-Fi technologies. A Wide Area Network (WAN) connects multiple LANs over large distances, sometimes across countries or continents, using leased telecommunication lines or satellite links.
局域网(LAN)覆盖较小地理区域,如单一建筑或校园。它通常为私有,并提供高数据传输速率,常使用以太网或 Wi-Fi 技术。广域网(WAN)通过租赁的电信线路或卫星链路,将多个局域网连接起来,覆盖远程距离,甚至跨国或跨洲。
LANs are characterized by low latency and minimal transmission errors, making them ideal for sharing resources like printers and files within an organization. WANs, such as the Internet, experience higher latency and require complex routing protocols. The equipment and management of a WAN are more expensive and often involve third-party service providers.
局域网的特点是低延迟和极少的传输错误,非常适合组织内共享打印机和文件等资源。广域网(如互联网)则有较高延迟,并需要复杂的路由协议。广域网的设备和管理成本更高,且常涉及第三方服务提供商。
5. Stack vs Queue | 栈与队列
A stack is a Last In, First Out (LIFO) data structure. Elements are added (pushed) and removed (popped) only from the top. This behaviour is analogous to a stack of plates; the last plate placed on top is the first one taken off. A queue is a First In, First Out (FIFO) structure where elements are added at the rear (enqueue) and removed from the front (dequeue), like a line of people waiting.
栈是一种后进先出(LIFO)的数据结构。元素的添加(压入)和删除(弹出)都只在栈顶进行。这类似于一叠盘子:最后放上去的盘子最先被取走。队列是一种先进先出(FIFO)的结构,元素在队尾加入(入队),在队头删除(出队),如同人们排队等候。
Stacks are heavily used in program execution, for example, to manage function calls (call stack), to handle recursion, and to evaluate expressions. Queues are essential in scheduling algorithms, keyboard buffers, and print spoolers where processing must follow the order of arrival. Both structures can be implemented using arrays or linked lists.
栈广泛用于程序执行,例如管理函数调用(调用栈)、处理递归和表达式求值。队列在调度算法、键盘缓冲区和打印后台处理中必不可少,这些场景下必须按到达顺序处理。两种结构都可以用数组或链表实现。
6. Symmetric vs Asymmetric Encryption | 对称加密与非对称加密
Symmetric encryption uses a single secret key for both encryption and decryption. The sender and receiver must both possess this key, which must be kept confidential. Common symmetric algorithms include AES and DES. Asymmetric encryption, also called public-key cryptography, employs a key pair: a public key for encryption and a private key for decryption.
对称加密使用同一个秘密密钥进行加密和解密。发送方和接收方都必须拥有此密钥,且密钥必须保密。常见的对称算法有 AES 和 DES。非对称加密,也称为公钥密码学,使用一对密钥:公钥用于加密,私钥用于解密。
Symmetric encryption is fast and efficient for bulk data transfer but suffers from the key distribution problem—how to securely share the secret key. Asymmetric encryption solves this by allowing the public key to be distributed openly, but it is computationally slower. In practice, hybrid systems (e.g., TLS) use asymmetric encryption to exchange a symmetric session key.
对称加密速度快,适用于大量数据传输,但面临密钥分发问题——如何安全地共享秘密密钥。非对称加密通过公开分发公钥解决了该问题,但计算速度较慢。实践中,混合系统(如 TLS)使用非对称加密来交换对称会话密钥。
7. Primary Key vs Foreign Key | 主键与外键
A primary key is a column (or combination of columns) in a relational database table that uniquely identifies each record. It must contain unique values and cannot be NULL. A foreign key is a column in one table that references the primary key of another table, establishing a link between the two tables and enforcing referential integrity.
主键是关系数据库表中唯一标识每条记录的一列(或多列)。它必须包含唯一值,且不能为 NULL。外键是一张表中引用另一张表主键的一列,建立了两表之间的链接,并强制实施参照完整性。
The primary key guarantees entity integrity; every row must have a distinct identifier. The foreign key ensures that values in the referencing column match an existing primary key value in the referenced table, or can be NULL if allowed. For example, in an ‘Orders’ table, the ‘CustomerID’ could be a foreign key referencing the ‘Customers’ table’s primary key.
主键保证实体完整性;每行都必须有一个独特的标识符。外键确保引用列中的值与所引用表中现有的主键值匹配,或可为 NULL(如果允许)。例如,在 ‘Orders’ 表中,’CustomerID’ 可以作为外键,引用 ‘Customers’ 表的主键。
8. Lossy vs Lossless Compression | 有损压缩与无损压缩
Lossless compression reduces file size without any loss of information; the original data can be perfectly reconstructed from the compressed version. This is essential for text, executable files, and some image formats like PNG. Lossy compression achieves higher compression ratios by permanently discarding some data, which is acceptable for audio, video, and photographs where minor loss of fidelity is often imperceptible.
无损压缩在不丢失任何信息的情况下缩小文件体积;可以从压缩版本中完美地重建原始数据。这对文本、可执行文件以及某些图像格式(如 PNG)至关重要。有损压缩通过永久丢弃某些数据来获得更高的压缩比,这适用于音频、视频和照片,其中微小的保真度损失通常难以察觉。
Run-length encoding and Huffman coding are examples of lossless techniques. JPEG and MP3 are
Published by TutorHao | A-Level Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导