1. 文档目的
本文档用于定义新一代课程内核的持久化边界。
本文件强调的不是“把所有表一次性定死”,而是先明确四类核心持久化对象:
- 课程资产
- 运行快照
- 任务与审计日志
- 资源资产
2. 持久化原则
- 课程资产与运行状态分离
- 任务日志与业务实体分离
- 资源资产与课程实体解耦
- 服务端持有权威课程资产
- 第一阶段围绕课程主干优先,不让平台分发需求反向主导表结构
3. 数据域划分
3.1 课程资产域
stage_artifactsstage_unitsstage_scenesstage_practice_plans
3.2 运行状态域
runtime_snapshotslearning_progressquiz_attempts
3.3 诊断与补救域
gap_profilesremediation_course_plans
3.4 能力专题域
problem_solving_patternscapability_unitscomposite_knowledge_chains
3.5 资源域
asset_registryasset_bindings
3.6 任务与审计域
generation_jobsstage_execution_logsjob_events
4. 课程资产域
4.1 stage_artifacts
课程资产聚合根主表。
| 字段 | 说明 |
|---|---|
id | Stage ID |
title | 课程标题 |
subject | 学科 |
school_stage | 学段 |
grade_level | 年级 |
learning_session_mode | 三条主线入口 |
course_strategy | 课程生产策略对象,建议 jsonb |
lesson_intent | 教学任务对象,建议 jsonb |
assembly_mode | 装配方式 |
artifact_status | 资产状态 |
protocol_version | 协议版本 |
metadata | 扩展字段 |
created_at / updated_at | 时间戳 |
4.2 stage_units
| 字段 | 说明 |
|---|---|
id | Unit ID |
stage_id | 所属 Stage |
title | Unit 标题 |
unit_order | 顺序 |
unit_type | chapter_unit / review_unit / remediation_unit / capability_unit |
assembly_mode | 装配方式 |
knowledge_point_ids | 知识点集合,建议 jsonb |
teaching_objectives | 教学目标,建议 jsonb |
practice_plan_id | 训练计划引用 |
metadata | 扩展字段 |
4.3 stage_scenes
| 字段 | 说明 |
|---|---|
id | Scene ID |
stage_id | 所属 Stage |
unit_id | 所属 Unit |
scene_order | 顺序 |
scene_type | slide / quiz / interactive / pbl |
scene_pattern | 教学意图模式 |
title | 标题 |
content | Scene 内容,建议 jsonb |
checkpoint_refs | 检查点引用,建议 jsonb |
estimated_duration_sec | 预估时长 |
metadata | 扩展字段 |
4.4 stage_practice_plans
| 字段 | 说明 |
|---|---|
id | PracticePlan ID |
stage_id | 所属 Stage |
unit_id | 所属 Unit |
training_blocks | 训练块,建议 jsonb |
assessment_focus | 检查重点,建议 jsonb |
mastery_checkpoints | 掌握检查点,建议 jsonb |
feedback_loop | 回挂摘要,建议 jsonb |
metadata | 扩展字段 |
5. 运行状态域
5.1 runtime_snapshots
保存课堂运行快照。
| 字段 | 说明 |
|---|---|
id | 快照 ID |
stage_id | 课程 ID |
session_id | 运行会话 ID |
current_unit_id | 当前 Unit |
current_scene_id | 当前 Scene |
action_cursor | 当前动作游标 |
runtime_state | idle / playing / paused / live |
snapshot_payload | 快照内容,建议 jsonb |
updated_at | 更新时间 |
5.2 learning_progress
保存学习进度与结果摘要。
| 字段 | 说明 |
|---|---|
id | 进度记录 ID |
learner_id | 学习者 ID |
stage_id | 课程 ID |
completed_unit_ids | 已完成 Unit,建议 jsonb |
completed_scene_ids | 已完成 Scene,建议 jsonb |
mastery_summary | 掌握摘要,建议 jsonb |
updated_at | 更新时间 |
5.3 quiz_attempts
保存课中小测与检查点作答。
| 字段 | 说明 |
|---|---|
id | 作答 ID |
learner_id | 学习者 ID |
stage_id | 课程 ID |
unit_id | Unit ID |
scene_id | Scene ID |
answers | 答案,建议 jsonb |
score | 得分 |
feedback | 反馈,建议 jsonb |
submitted_at | 提交时间 |
6. 诊断与补救域
6.1 gap_profiles
| 字段 | 说明 |
|---|---|
id | 画像 ID |
learner_id | 学生 ID |
stage_id | 可选来源课程 ID |
gap_types | 主类,建议 jsonb |
gap_traits | 特征,建议 jsonb |
evidence_sources | 证据来源,建议 jsonb |
decision_hints | 默认建议,建议 jsonb |
priority_level | 优先级 |
metadata | 扩展字段 |
6.2 remediation_course_plans
| 字段 | 说明 |
|---|---|
id | 计划 ID |
gap_profile_id | 来源画像 |
remediation_mode | rollback / recompose / hybrid |
target_knowledge_points | 目标知识点,建议 jsonb |
backfill_units | 回退单元,建议 jsonb |
bridge_units | 过渡单元,建议 jsonb |
practice_blocks | 训练块,建议 jsonb |
exit_criteria | 退出条件,建议 jsonb |
feedback_loop | 回挂摘要,建议 jsonb |
7. 能力专题域
7.1 problem_solving_patterns
建议以结构化 jsonb 存储五层协议。
核心字段:
| 字段 | 说明 |
|---|---|
id | 模式 ID |
subject | 学科 |
name | 名称 |
pattern_type | 模式类型 |
status | 状态 |
definition | 五层结构定义,建议 jsonb |
version | 版本 |
7.2 capability_units
| 字段 | 说明 |
|---|---|
id | 能力单元 ID |
stage_id | 所属 Stage |
title | 标题 |
pattern_refs | 关联模式,建议 jsonb |
knowledge_chain_refs | 关联知识链,建议 jsonb |
target_capability | 目标能力 |
coverage_scope | 覆盖范围,建议 jsonb |
error_focus | 错误聚焦,建议 jsonb |
mastery_checkpoint_plan | 检查点规划,建议 jsonb |
7.3 composite_knowledge_chains
| 字段 | 说明 |
|---|---|
id | 知识链 ID |
subject | 学科 |
title | 标题 |
knowledge_point_ids | 知识点集合,建议 jsonb |
dependency_edges | 依赖边,建议 jsonb |
bridge_concepts | 桥接概念,建议 jsonb |
8. 资源域
8.1 asset_registry
统一资源表。
| 字段 | 说明 |
|---|---|
id | 资源 ID |
asset_type | image / video / audio / file / export |
mime_type | MIME |
storage_key | 对象存储 Key |
public_url | 访问 URL |
source | 来源 |
prompt | 生成 Prompt,可选 |
metadata | 扩展字段 |
created_at | 创建时间 |
8.2 asset_bindings
保存资源和课程资产绑定关系。
| 字段 | 说明 |
|---|---|
id | 绑定 ID |
stage_id | 课程 ID |
unit_id | 可选 Unit ID |
scene_id | 可选 Scene ID |
asset_id | 资源 ID |
binding_type | 绑定类型 |
element_ref | 页面元素引用,可选 |
9. 任务与审计域
9.1 generation_jobs
| 字段 | 说明 |
|---|---|
job_id | 任务 ID |
stage_id | 结果课程 ID,可选 |
status | 任务状态 |
step | 当前阶段 |
progress | 进度 |
input_snapshot | 输入快照,建议 jsonb |
result_summary | 结果摘要,建议 jsonb |
error_payload | 错误信息,建议 jsonb |
created_at / updated_at | 时间戳 |
9.2 stage_execution_logs
保存阶段执行日志。
| 字段 | 说明 |
|---|---|
id | 日志 ID |
job_id | 任务 ID |
step | 执行阶段 |
event_type | 事件类型 |
payload | 日志内容,建议 jsonb |
created_at | 时间 |
9.3 job_events
保存任务级事件流,便于追踪和重放。
10. 当前后置事项
以下内容当前可以保留为后置章节或后续扩展,不应反向主导主表设计:
- 平台分发
- 家长 / 学生绑定
- 组织权限
- 校级共享规则
这些能力不是无效,而是不应先于课程资产主干。
11. 结论
当前存储设计应围绕以下四类核心对象展开:
StageArtifact及其Unit / Scene / PracticePlanRuntimeSnapshot / LearningProgress / QuizAttemptsGapProfile / RemediationCoursePlan / ProblemSolvingPattern / CapabilityUnitGenerationJob / StageExecutionLog / AssetRegistry
只要这四类边界清晰,后续数据库和对象存储实现就不会被平台外壳需求牵偏。