规则引擎架构 v2.0
核心思路
基于模板 + 提示词构成规则引擎,驱动 6 大能力:
识别 → 创建 → 修复 → 优化 → 比对 → 内容生成
标准化层 (Normalization Layer)
解决 SCSAI 各类型字段命名不一致的问题:
// 所有业务类型的"身份字段"统一视为 item_number
// Project 的 project_number → 映射为 item_number
// ECR/ECN 的 title → 映射为 name
| 通用字段 | Part | Project | ECR | Vendor |
|---------|------|---------|-----|--------|
| item_number | item_number | project_number | item_number | (name) |
| name | name | name | title | name |
| description | description | description | description | description |
| state | state | state | state | state |
6 大引擎
┌─────────────┐
│ 规则模板 │
│ (SQLite DB) │
└──────┬──────┘
┌───────────────┼───────────────┐
│ │ │
┌─────▼─────┐ ┌─────▼─────┐ ┌─────▼─────┐
│ 识别引擎 │ │ 创建引擎 │ │ 修复引擎 │
│ Recognize │ │ Create │ │ Repair │
└───────────┘ └───────────┘ └───────────┘
┌───────────┐ ┌───────────┐ ┌───────────┐
│ 优化引擎 │ │ 比对引擎 │ │ 内容引擎 │
│ Optimize │ │ Compare │ │ Content │
└───────────┘ └───────────┘ └───────────┘
┌───────────┐
│ 权限引擎 │
│ Perms │
└───────────┘
数据流
原始数据 (来自 SCSAI/Excel/LLM)
→ 识别引擎 (推断对象类型)
→ 修复引擎 (按模板修复)
→ 创建引擎 (生成 AML) / 优化引擎 (标准化)
→ 比对引擎 (验证结果)
→ 完成
权限集成
从 Reference Doc 提取用户/角色/权限定义,存储为 sciot_permissions 表,在创建/修复时自动应用。
BossAgents