docs: complete documentation system (250+ files)
- System architecture and design documentation - Business module docs (ASL/AIA/PKB/RVW/DC/SSA/ST) - ASL module complete design (quality assurance, tech selection) - Platform layer and common capabilities docs - Development standards and API specifications - Deployment and operations guides - Project management and milestone tracking - Architecture implementation reports - Documentation templates and guides
This commit is contained in:
202
docs/03-业务模块/ASL-AI智能文献/02-技术设计/01-数据库设计.md
Normal file
202
docs/03-业务模块/ASL-AI智能文献/02-技术设计/01-数据库设计.md
Normal file
@@ -0,0 +1,202 @@
|
||||
# AI智能文献模块 - 数据库设计
|
||||
|
||||
> **文档版本:** v1.0
|
||||
> **创建日期:** 2025-10-29
|
||||
> **维护者:** AI智能文献开发团队
|
||||
> **最后更新:** 2025-10-29
|
||||
|
||||
---
|
||||
|
||||
## 📋 文档说明
|
||||
|
||||
本文档描述AI智能文献模块的数据库设计,包括数据表结构、关系设计、索引设计等。
|
||||
|
||||
---
|
||||
|
||||
## 🗄️ 核心数据表
|
||||
|
||||
### 1. 文献筛选项目表 (literature_screening_projects)
|
||||
|
||||
```sql
|
||||
CREATE TABLE literature_screening_projects (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
user_id UUID NOT NULL REFERENCES users(id),
|
||||
project_name VARCHAR(255) NOT NULL,
|
||||
protocol_id UUID, -- 研究方案ID(未来关联)
|
||||
|
||||
-- PICO标准
|
||||
pico_criteria JSONB, -- PICO结构化数据
|
||||
|
||||
-- 筛选标准
|
||||
inclusion_criteria TEXT,
|
||||
exclusion_criteria TEXT,
|
||||
|
||||
-- 状态
|
||||
status VARCHAR(50) DEFAULT 'draft', -- draft, screening, completed
|
||||
|
||||
-- 筛选配置
|
||||
screening_config JSONB, -- 筛选配置(双模型选择等)
|
||||
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
```
|
||||
|
||||
### 2. 文献条目表 (literature_items)
|
||||
|
||||
```sql
|
||||
CREATE TABLE literature_items (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
project_id UUID NOT NULL REFERENCES literature_screening_projects(id) ON DELETE CASCADE,
|
||||
|
||||
-- 文献基本信息
|
||||
pmid VARCHAR(50),
|
||||
title TEXT,
|
||||
authors TEXT,
|
||||
journal VARCHAR(255),
|
||||
publication_year INTEGER,
|
||||
doi VARCHAR(255),
|
||||
abstract TEXT,
|
||||
|
||||
-- 文件信息
|
||||
full_text_file_path VARCHAR(500),
|
||||
full_text_status VARCHAR(50), -- not_required, pending, downloaded, uploaded, failed
|
||||
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
UNIQUE(project_id, pmid)
|
||||
);
|
||||
```
|
||||
|
||||
### 3. 标题摘要初筛结果表 (title_abstract_screening_results)
|
||||
|
||||
```sql
|
||||
CREATE TABLE title_abstract_screening_results (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
project_id UUID NOT NULL REFERENCES literature_screening_projects(id) ON DELETE CASCADE,
|
||||
literature_item_id UUID NOT NULL REFERENCES literature_items(id) ON DELETE CASCADE,
|
||||
|
||||
-- DS模型判断
|
||||
ds_p_judgment VARCHAR(10), -- ✓, ✗, ?
|
||||
ds_i_judgment VARCHAR(10),
|
||||
ds_c_judgment VARCHAR(10),
|
||||
ds_s_judgment VARCHAR(10),
|
||||
ds_conclusion VARCHAR(20), -- include, exclude
|
||||
|
||||
-- DS模型证据
|
||||
ds_p_evidence TEXT,
|
||||
ds_i_evidence TEXT,
|
||||
ds_c_evidence TEXT,
|
||||
ds_s_evidence TEXT,
|
||||
|
||||
-- Q3模型判断
|
||||
q3_p_judgment VARCHAR(10),
|
||||
q3_i_judgment VARCHAR(10),
|
||||
q3_c_judgment VARCHAR(10),
|
||||
q3_s_judgment VARCHAR(10),
|
||||
q3_conclusion VARCHAR(20),
|
||||
|
||||
-- Q3模型证据
|
||||
q3_p_evidence TEXT,
|
||||
q3_i_evidence TEXT,
|
||||
q3_c_evidence TEXT,
|
||||
q3_s_evidence TEXT,
|
||||
|
||||
-- 冲突状态
|
||||
conflict_status VARCHAR(20) DEFAULT 'none', -- none, conflict, resolved
|
||||
|
||||
-- 最终决策
|
||||
final_decision VARCHAR(20), -- include, exclude, pending
|
||||
final_decision_by UUID REFERENCES users(id),
|
||||
final_decision_at TIMESTAMP,
|
||||
exclusion_reason TEXT,
|
||||
|
||||
-- AI处理状态
|
||||
ai_processing_status VARCHAR(50) DEFAULT 'pending', -- pending, processing, completed, failed
|
||||
ai_processed_at TIMESTAMP,
|
||||
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
UNIQUE(project_id, literature_item_id)
|
||||
);
|
||||
```
|
||||
|
||||
### 4. 筛选任务表 (screening_tasks)
|
||||
|
||||
```sql
|
||||
CREATE TABLE screening_tasks (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
project_id UUID NOT NULL REFERENCES literature_screening_projects(id) ON DELETE CASCADE,
|
||||
|
||||
task_type VARCHAR(50) NOT NULL, -- title_abstract, full_text
|
||||
status VARCHAR(50) DEFAULT 'pending', -- pending, running, completed, failed
|
||||
|
||||
total_items INTEGER,
|
||||
processed_items INTEGER DEFAULT 0,
|
||||
success_items INTEGER DEFAULT 0,
|
||||
failed_items INTEGER DEFAULT 0,
|
||||
|
||||
started_at TIMESTAMP,
|
||||
completed_at TIMESTAMP,
|
||||
error_message TEXT,
|
||||
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📊 数据关系图
|
||||
|
||||
```
|
||||
literature_screening_projects (1) ──< (N) literature_items
|
||||
literature_screening_projects (1) ──< (N) title_abstract_screening_results
|
||||
literature_items (1) ──< (1) title_abstract_screening_results
|
||||
literature_screening_projects (1) ──< (N) screening_tasks
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔍 索引设计
|
||||
|
||||
```sql
|
||||
-- 文献条目表索引
|
||||
CREATE INDEX idx_literature_items_project_id ON literature_items(project_id);
|
||||
CREATE INDEX idx_literature_items_pmid ON literature_items(pmid);
|
||||
|
||||
-- 筛选结果表索引
|
||||
CREATE INDEX idx_screening_results_project_id ON title_abstract_screening_results(project_id);
|
||||
CREATE INDEX idx_screening_results_item_id ON title_abstract_screening_results(literature_item_id);
|
||||
CREATE INDEX idx_screening_results_conflict ON title_abstract_screening_results(conflict_status);
|
||||
CREATE INDEX idx_screening_results_decision ON title_abstract_screening_results(final_decision);
|
||||
|
||||
-- 任务表索引
|
||||
CREATE INDEX idx_screening_tasks_project_id ON screening_tasks(project_id);
|
||||
CREATE INDEX idx_screening_tasks_status ON screening_tasks(status);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⏳ 待完善内容
|
||||
|
||||
后续将补充:
|
||||
- 全文复筛相关表结构
|
||||
- 数据提取相关表结构
|
||||
- 数据迁移方案
|
||||
- 数据字典
|
||||
|
||||
---
|
||||
|
||||
**文档版本:** v1.0
|
||||
**最后更新:** 2025-10-29
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user