← 返回资讯屏轩教育 · 行业资讯

Year 12 AQA Computer Science: Case Study Practical Exercise | Year 12 AQA 计算机科学:案例分析实战演练

2026-07-22 13:24 · 本文部分内容由AI辅助创作

📚 Year 12 AQA Computer Science: Case Study Practical Exercise | Year 12 AQA 计算机科学:案例分析实战演练

Case studies are an integral part of the AQA A-level Computer Science exam, requiring you to apply theoretical knowledge to realistic scenarios. This exercise will guide you through a typical case study, demonstrating how to analyse requirements, choose appropriate data structures, design algorithms and evaluate solutions.

案例研究是AQA A-level计算机科学考试的重要组成部分,要求你将理论知识应用到实际场景中。本练习将引导你完成一个典型的案例研究,展示如何分析需求、选择合适的数据结构、设计算法并评估解决方案。


1. Case Introduction: University Library Self‑Service System | 案例介绍:大学图书馆自助系统

A large university library plans to replace its legacy barcode‑based borrowing kiosks with a modern self‑service system. The new system must support RFID‑tagged items, allow students to borrow and return books without staff assistance, handle online reservations, calculate overdue fines automatically and provide search functionality across multiple device types.

一所大型大学图书馆计划用现代化的自助系统替换基于条形码的旧借阅终端。新系统必须支持RFID标签物品,允许学生无需工作人员即可借还图书,处理在线预约,自动计算逾期罚款,并提供跨多种设备类型的搜索功能。

Your task as a software analyst is to produce a full design proposal covering data structures, database schema, key algorithms and security considerations. You will also need to justify your design decisions and suggest testing strategies.

作为软件分析师,你的任务是提供一份完整的设计方案,涵盖数据结构、数据库模式、关键算法和安全考量。你还需要论证设计决策并提出测试策略。


2. Requirements Analysis | 需求分析

The functional requirements include: borrowers can scan their student ID and book RFID to complete a loan; the system must enforce a maximum loan period of 21 days; students can place a hold on a currently borrowed item; automatic fine calculation at £0.50 per day per overdue item; and real‑time search of the library catalogue by title, author or ISBN.

功能性需求包括:借阅者可以扫描学生证和图书RFID完成借阅;系统必须强制执行最长21天的借期;学生可以对当前被借出的物品进行预约;对每件逾期物品按每天0.50英镑自动计算罚款;按书名、作者或ISBN实时搜索图书馆目录。

Non‑functional requirements are equally important. The system must handle up to 500 concurrent users on campus, respond to scan‑based operations within 2 seconds, protect personal data in compliance with GDPR, and be accessible via kiosks, web browsers and a mobile app.

非功能性需求同样重要。系统必须能够处理多达500名校园内的并发用户,对扫描类操作在2秒内响应,根据GDPR保护个人数据,并可通过自助终端、网页浏览器和移动应用程序访问。


3. System Design Overview | 系统设计概览

A client‑server architecture is appropriate here. A centralised server hosts the library database and business logic, while clients (kiosks, web browsers, mobile apps) communicate via a REST API over HTTPS. This separation allows independent scaling of the front‑end and back‑end, and simplifies maintenance.

此处采用客户端‑服务器架构是合适的。中央服务器托管图书馆数据库和业务逻辑,而客户端(自助终端、网页浏览器、移动应用)通过HTTPS上的REST API进行通信。这种分离允许前端和后端独立扩展,并简化维护。

The back‑end could be built using Python with Flask or Django, while a PostgreSQL database stores persistent data. For real‑time search, an in‑memory index using Redis can drastically improve response times for catalogue queries.

后端可以使用Python搭配Flask或Django构建,而PostgreSQL数据库存储持久数据。对于实时搜索,使用Redis的内存索引可以极大提高目录查询的响应速度。


4. Data Structure Choices for In‑Memory Operations | 内存操作的数据结构选择

For the book catalogue search, a hash table (dictionary) keyed by ISBN provides O(1) average lookup time, allowing instant retrieval of book details. To support prefix‑based author search, a trie (prefix tree) can be constructed, reducing search complexity to O(L) where L is the length of the typed prefix.

对于图书目录搜索,以ISBN为键的哈希表(字典)提供平均O(1)的查找时间,可即时检索图书详细信息。为了支持基于前缀的作者搜索,可以构建一个Trie(前缀树),将搜索复杂度降低为O(L),其中L是输入前缀的长度。

A double‑ended queue (deque) is useful for managing reservation lists. When a book is returned, the system removes the first student from the reservation deque and notifies them. This guarantees first‑come, first‑served fairness with O(1) enqueue and dequeue operations.

双端队列(deque)可用于管理预约列表。当一本书被归还时,系统从预约双端队列中移除第一个学生并通知他们。这保证了先到先得的公平性,入队和出队操作均为O(1)。

For fine calculation, a priority queue (min‑heap) can store overdue loans keyed by due date, enabling the system to efficiently extract the most overdue items for daily batch processing.

对于罚款计算,优先队列(最小堆)可以按键为到期日存储逾期借阅记录,使系统能够高效地提取最逾期的物品,用于每日批处理。


5. Algorithm Design: Loan Processing and Fine Calculation | 算法设计:借阅处理与罚款计算

alidate student membership status; check if the book is reserved; if yes, deny loan to non‑reserving student; otherwise, set due date = current date + 21 days, update book status to “on loan”, and push student into the loan record.

核心借阅算法可表述如下:接收学生证和图书RFID;验证学生会员身份;检查图书是否被预约;若是,拒绝非预约学生借阅;否则,设置到期日 = 当前日期 + 21天,将图书状态更新为“已借出”,并将学生添加到借阅记录中。

day and penalty not yet fully paid. For each such loan, it calculates days overdue = today – due date, multiplies by £ ates the student’s fine balance. The union of all fine records can be stored in a separate “fines” table linked to students.

罚款计算作为每夜定时任务运行。它检索所有到期日早于今天且未完全支付罚款的借阅记录。对于每条记录,计算逾期天数 = 今天 – 到期日,乘以0.50英镑,并更新学生的罚款余额。所有罚款记录可以存储在一个与学生关联的单独“fines”表中。


广告 / Sponsored

6. Database Design | 数据库设计

A relational database model is best suited to this transactional system. Below is a simplified schema for the core entities.

关系数据库模型最适合此事务系统。以下是核心实体的简化模式。

Table (表) Key Fields (关键字段) Notes (说明)
Student student_id (PK), name, email, password_hash, fine_balance Stores registered students
Book isbn (PK), title, author, status, rfid_tag Each book copy has unique RFID
Loan loan_id (PK), student_id (FK), isbn (FK), loan_date, due_date, return_date Tracks borrowing history
Reservation reservation_id (PK), student_id (FK), isbn (FK), request_date, position Queue position managed logically
Fine fine_id (PK), student_id (FK), loan_id (FK), amount, issued_date, paid Audit of all penalty charges

All foreign key relationships ensure referential integrity. Password hashes are stored using a salted SHA‑ ; never in plain text. Indexes on student_id, isbn and due_date speed up frequent queries.

所有外键关系确保了参照完整性。密码哈希使用加盐的SHA‑256算法存储,绝不使用明文。在student_id、isbn和due_date上建立的索引可加速频繁查询。


7. User Interface Prototyping | 用户界面原型设计

The self‑service kiosk should present a touch‑friendly interface with large buttons: “Borrow”, “Return”, “Search Catalogue”, “My Account”. After scanning an ID card, the student’s current loans and fines are displayed. The search interface accepts partial input and shows instant suggestions using AJAX calls to the back‑end.

自助服务终端应呈现触屏友好的界面,具有大型按钮:“借阅”、“还书”、“目录搜索”、“我的账户”。扫描学生证后,将显示该学生当前的借阅和罚款。搜索界面接受部分输入,并通过AJAX调用后端显示即时建议。

For the web and mobile versions, a responsive design using HTML5, CSS and JavaScript frameworks (such as React) ensures consistency. Accessibility features like high‑contrast modes and screen‑reader compatibility must be built in from the start.

对于网页和移动版本,使用HTML5、CSS和JavaScript框架(如React)的响应式设计可确保一致性。从一开始就必须内置无障碍功能,如高对比度模式和屏幕阅读器兼容性。


8. Security and Authentication | 安全与身份验证

All communication between clients and the server uses TLS encryption. Student authentication is handled via JSON Web Tokens (JWT): after login, a signed token is issued and must be included in the Authorization header of every subsequent request. Tokens expire after 15 minutes of inactivity to reduce risk.

客户端与服务器之间的所有通信均使用TLS加密。学生身份验证通过JSON Web Tokens(JWT)处理:登录后,签发签名令牌,后续每个请求必须在Authorization头中包含该令牌。令牌在15分钟不活动后过期,以降低风险。

Input validation is critical to prevent SQL injection and cross‑site scripting. Parameterised queries must be used for all database interactions. Additionally, role‑based access control restricts librarian functions (e.g., adding new books) to authorised staff only.

输入验证对于防止SQL注入和跨站脚本至关重要。所有数据库交互必须使用参数化查询。此外,基于角色的访问控制将图书管理员功能(如添加新书)限制为仅授权工作人员可用。


9. Testing and Evaluation Strategy | 测试与评估策略

A comprehensive test plan covers unit tests for individual functions (e.g., fine computation), integration tests for API endpoints, and system tests simulating concurrent borrowers. Boundary tests should verify the 21‑day loan limit and zero‑fine cases. Stress tests confirm the system handles 500 simultaneous kiosk sessions.

全面的测试计划涵盖针对个别函数(如罚款计算)的单元测试、针对API端点的集成测试,以及模拟并发借阅者的系统测试。边界测试应验证21天借阅限制和零罚款情况。压力测试确认系统可处理500个并发终端会话。

Usability testing with real students will uncover interface flaws early. Feedback loops should be built into the development cycle, allowing iterative refinement of the user experience before final deployment.

与真实学生进行的可用性测试可以及早发现界面缺陷。应在开发周期中建立反馈循环,以便在最终部署之前迭代优化用户体验。


10. Case Summary and Exam Tips | 案例总结与考试技巧

This practical exercise demonstrates how to break down a complex case study into manageable design areas: requirements, architecture, data structures, database, interface, security and testing. In the AQA exam, you will be expected to justify each choice with clear reasoning linked to the scenario.

本实践练习演示了如何将一个复杂的案例研究分解为可管理的设计领域:需求、架构、数据结构、数据库、界面、安全性和测试。在AQA考试中,你将被要求用与场景相关的清晰推理来论证每个选择。

When answering case‑study questions, always refer back to the specific context. Avoid generic answers. Use correct technical vocabulary (e.g., “hash table for O(1) lookup”) and, where appropriate, sketch diagrammatic representations in your answer booklet. Practice with different scenarios to build confidence.

在回答案例分析问题时,始终要回顾具体情境。避免使用通用的答案。使用正确的技术术语(例如“哈希表实现O(1)查找”),并在适当的情况下在答题册中画出图示。通过不同的场景进行练习以建立信心。


Published by TutorHao | Computer Science Revision Series | aleveler.com

广告 / Sponsored
英国原版CGP教辅 New GCSE Computer Science AQA Exam Practice Workb…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao