跳到主要内容

计算机系统与网络

AP 计算机科学原理 · 第 4 主题

训练
本章视频课 打开视频页面
7:47

Computer Systems and Networks

People call it the cloud. It is not a cloud. This box sits in somebody's home: a router, taking data from your phone and passing it on. This plug is the other…

英文讲解 · 内嵌中英文字幕

4.1

互联网

大纲
Enduring UnderstandingLearning ObjectiveEssential Knowledge

CSN-1
Computer systems and networks facilitate the transfer of data.

CSN-1.A
Explain how computing devices work together in a network. [Skill 5.A]

  • CSN-1.A.1 A computing device is a physical artifact that can run a program. Some examples include computers, tablets, servers, routers, and smart sensors.
  • CSN-1.A.2 A computing system is a group of computing devices and programs working together for a common purpose.
  • CSN-1.A.3 A computer network is a group of interconnected computing devices capable of sending or receiving data.
  • CSN-1.A.4 A computer network is a type of computing system.
  • CSN-1.A.5 A path between two computing devices on a computer network (a sender and a receiver) is a sequence of directly connected computing devices that begins at the sender and ends at the receiver.
  • CSN-1.A.6 Routing is the process of finding a path from sender to receiver.
  • CSN-1.A.7 The bandwidth of a computer network is the maximum amount of data that can be sent in a fixed amount of time.
  • CSN-1.A.8 Bandwidth is usually measured in bits per second.

CSN-1.B
Explain how the Internet works. [Skill 5.A]

  • CSN-1.B.1 The Internet is a computer network consisting of interconnected networks that use standardized, open (nonproprietary) communication protocols.
  • CSN-1.B.2 Access to the Internet depends on the ability to connect a computing device to an Internet-connected device.
  • CSN-1.B.3 A protocol is an agreed-upon set of rules that specify the behavior of a system.
  • CSN-1.B.4 The protocols used in the Internet are open, which allows users to easily connect additional computing devices to the Internet.
  • CSN-1.B.5 Routing on the Internet is usually dynamic; it is not specified in advance.
  • CSN-1.B.6 The scalability of a system is the capacity for the system to change in size and scale to meet new demands.
  • CSN-1.B.7 The Internet was designed to be scalable.

CSN-1.C
Explain how data are sent through the Internet via packets. [Skill 5.A]

  • CSN-1.C.1 Information is passed through the Internet as a data stream. Data streams contain chunks of data, which are encapsulated in packets.
  • CSN-1.C.2 Packets contain a chunk of data and metadata used for routing the packet between the origin and the destination on the Internet, as well as for data reassembly.
  • CSN-1.C.3 Packets may arrive at the destination in order, out of order, or not at all.
  • CSN-1.C.4 IP, TCP, and UDP are common protocols used on the Internet.

CSN-1.D
Describe the differences between the Internet and the World Wide Web. [Skill 5.A]

  • CSN-1.D.1 The World Wide Web is a system of linked pages, programs, and files.
  • CSN-1.D.2 HTTP is a protocol used by the World Wide Web.
  • CSN-1.D.3 The World Wide Web uses the Internet.

来源:美国大学理事会 AP 课程与考试说明

互联网(Internet)是一个网络的全球网络。数据作为数据包(packets)传播——被分开发送并在目的地重新组装的小块。两个思想使它在规模上起作用:

互联网是全世界的网络;万维网是运行在它上面的一个服务
互联网是全世界的网络;万维网是运行在它上面的一个服务
  • 协议(protocols)是通信的约定规则。IP(网际协议,Internet Protocol)寻址和路由数据包;TCP 按顺序重新组装它们并重新请求丢失的;HTTP 携带网页;DNS 把一个像 example.com 的名字翻译成一个 IP 地址。
  • 冗余(redundancy)和路由:两点之间有许多可能的路径,所以若一条路径失败,数据包走另一条。这使互联网容错(fault-tolerant)。

互联网被设计为开放(open)和可扩展(scalable)——建立在任何人都能使用的标准上,所以随着数十亿设备加入它继续工作。带宽(bandwidth)是一个连接每秒能携带的数据量。

探索

How data crosses the Internet in packets

The Internet breaks a message into numbered packets, each addressed and routed independently (often by different paths), then reassembled at the destination. That design makes it fault-tolerant — if one route fails, packets take another.

词汇表 训练
英文 中文 拼音
Internet/ˈɪntənet/ 互联网 hù lián wǎng
packets/ˈpækɪts/ 数据包 shù jù bāo
Protocols/ˈprəʊtəkɒlz/ 协议 xié yì
Redundancy/rɪˈdʌndənsi/ 冗余 rǒng yú
fault-tolerant/fɒlt ˈtɒlərənt/ 容错 róng cuò
Bandwidth/ˈbændwɪdθ/ 带宽 dài kuān
4.2

容错

大纲
Enduring UnderstandingLearning ObjectiveEssential Knowledge

CSN-1
Computer systems and networks facilitate the transfer of data.

CSN-1.E
For fault-tolerant systems, like the Internet:
a. Describe the benefits of fault tolerance. [Skill 1.D]
b. Explain how a given system is fault-tolerant. [Skill 5.A]
c. Identify vulnerabilities to failure in a system. [Skill 1.D]

  • CSN-1.E.1 The Internet has been engineered to be fault-tolerant, with abstractions for routing and transmitting data.
  • CSN-1.E.2 Redundancy is the inclusion of extra components that can be used to mitigate failure of a system if other components fail.
  • CSN-1.E.3 One way to accomplish network redundancy is by having more than one path between any two connected devices.
  • CSN-1.E.4 If a particular device or connection on the Internet fails, subsequent data will be sent via a different route, if possible.
  • CSN-1.E.5 When a system can support failures and still continue to function, it is called fault-tolerant. This is important because elements of complex systems fail at unexpected times, often in groups, and fault tolerance allows users to continue to use the network.
  • CSN-1.E.6 Redundancy within a system often requires additional resources but can provide the benefit of fault tolerance.
  • CSN-1.E.7 The redundancy of routing options between two points increases the reliability of the Internet and helps it scale to more devices and more people.

来源:美国大学理事会 AP 课程与考试说明

一个系统是容错(fault-tolerant)的,若它即使在它的一部分失败时也继续工作。互联网通过冗余(redundant)连接实现这个:因为数据包能沿多条路径路由,一个路由器或电缆的失败不停止通信——流量只是重新路由。容错花费额外的资源(冗余的路径)但大大改善可靠性(reliability)。一条没有备份的单一路径不是容错的。

数据包交换按独立的路由发送数据包,所以网络容忍一个失败的链路
数据包交换按独立的路由发送数据包,所以网络容忍一个失败的链路
词汇表 训练
英文 中文 拼音
reliability/rɪˌlaɪəˈbɪlɪti/ 可靠性 kě kào xìng
4.3

并行与分布式计算

大纲
Enduring UnderstandingLearning ObjectiveEssential Knowledge

CSN-2
Parallel and distributed computing leverage multiple computers to more quickly solve complex problems or process large data sets.

CSN-2.A
For sequential, parallel, and distributed computing:
a. Compare problem solutions. [Skill 1.D]
b. Determine the efficiency of solutions. [Skill 1.D]

  • CSN-2.A.1 Sequential computing is a computational model in which operations are performed in order one at a time.
  • CSN-2.A.2 Parallel computing is a computational model where the program is broken into multiple smaller sequential computing operations, some of which are performed simultaneously.
  • CSN-2.A.3 Distributed computing is a computational model in which multiple devices are used to run a program.
  • CSN-2.A.4 Comparing efficiency of solutions can be done by comparing the time it takes them to perform the same task.
  • CSN-2.A.5 A sequential solution takes as long as the sum of all of its steps.
  • CSN-2.A.6 A parallel computing solution takes as long as its sequential tasks plus the longest of its parallel tasks.
  • CSN-2.A.7 The "speedup" of a parallel solution is measured in the time it took to complete the task sequentially divided by the time it took to complete the task when done in parallel.

CSN-2.B
Describe benefits and challenges of parallel and distributed computing. [Skill 1.D]

  • CSN-2.B.1 Parallel computing consists of a parallel portion and a sequential portion.
  • CSN-2.B.2 Solutions that use parallel computing can scale more effectively than solutions that use sequential computing.
  • CSN-2.B.3 Distributed computing allows problems to be solved that could not be solved on a single computer because of either the processing time or storage needs involved.
  • CSN-2.B.4 Distributed computing allows much larger problems to be solved quicker than they could be solved using a single computer.
  • CSN-2.B.5 When increasing the use of parallel computing in a solution, the efficiency of the solution is still limited by the sequential portion. This means that at some point, adding parallel portions will no longer meaningfully increase efficiency.

来源:美国大学理事会 AP 课程与考试说明

  • 顺序计算(sequential computing)一次运行一个操作。
  • 并行计算(parallel computing)把一个任务分成同时在多个处理器上运行的部分,更快地完成。
  • 分布式计算(distributed computing)使用由一个网络连接的许多计算机来处理一个问题——对于对单台机器太大的问题至关重要。
并行计算:许多处理器同时工作
并行计算:许多处理器同时工作

一个并行解决方案的加速比(speedup)是顺序时间除以并行时间。加速比是有限的:必须按顺序运行的部分不能通过添加处理器加速,所以把处理器加倍很少使速度加倍。

Worked example. 一个任务有一个必须按顺序运行的部分,取 $40$ 秒,加一个在一个处理器上取 $60$ 秒的可并行部分——所以在单个处理器上整个任务取 $40+60=100$ 秒。把并行部分分散到 $3$ 个处理器上它取 $\tfrac{60}{3}=20$ 秒,所以总并行时间是 $40+20=60$ 秒而加速比是 $\tfrac{100}{60}\approx1.67$。这 $40$ 秒的顺序部分是一个下限:即使有无穷多个处理器任务也从不能在 $40$ 秒以下完成。

考试技能: 给定一个任务顺序和并行部分的时间,能够计算总并行时间和加速比。

词汇表 训练
英文 中文 拼音
Sequential computing/siːˈkwenʃl kəmˈpjuːtɪŋ/ 顺序计算 shùn xù jì suàn
Parallel computing/ˈpærəlel kəmˈpjuːtɪŋ/ 并行计算 bìng xíng jì suàn
Distributed computing/ˈdɪstrɪbjuːtɪd kəmˈpjuːtɪŋ/ 分布式计算 fēn bù shì jì suàn
speedup/ˈspiːdʌp/ 加速比 jiā sù bǐ
4.3

考试技巧

  • 描述数据如何在一个冗余的、容错的独立路由器网络上以数据包传播。
  • 知道协议(IP、TCP、HTTP)是约定的规则,以及开放的标准让不同的系统互操作。
  • 解释可扩展性以及互联网如何在没有中央控制的情况下增长。
  • 对比带宽(速率)与延迟(latency)(时延),并描述 DNS 名字到地址的查找。
  • 用平实的措辞讨论数字鸿沟(digital divide)和安全基础(加密、身份验证)。

本主题的互动课程

逐步学习,并即时检测练习。

AP 计算机科学原理历年真题

AP 计算机科学原理的更多主题

登录或创建账号

IGCSE, A-Level & AP