SCSAI PLM Rule Template System - Complete Summary
System Overview
This system automatically analyzes and extracts from 7,706 AML files in the SCIOT directory, constructing a complete SCSAI PLM rule template and prompt system.
Industry Validation: The system has been validated with 10GB of real process data in the high-end/machinery industry (high-end equipment customer, zero data leakage, 7×24h stable operation) and is being replicated in the phosphorus chemical industry. The BOM/process/equipment/quality management models for high-end/machinery are highly isomorphic to those in phosphorus chemicals, allowing direct reuse of the underlying object models.
Data Scale
AML File Statistics
| Type | Count |
|---|---|
| Total Files | 7,706 |
| ItemType (Object Class) | 469 |
| Method (Method) | 2,228 |
| Form (Form) | 725 |
| RelationshipType (Relationship Type) | 492 |
| List (List) | 428 |
| UserMessage (User Message) | 465 |
| SQL | 112 |
| Report (Report) | 132 |
| Permission (Permission) | 215 |
| Sequence (Sequence) | 128 |
| Life Cycle Map (Life Cycle) | 96 |
| Workflow Map (Workflow) | 32 |
Generated Data
| Type | Count |
|---|---|
| ItemType Templates | 298 |
| Attribute Rules | 3,489 |
| Prompts | 298 |
| Business Systems | 5 |
| Business System Prompts | 3 |
Core Business Systems
1. Project Management
- ItemType Count: 21
- Core Objects: Project, Activity2, Activity, Task
- Function: Project planning, WBS breakdown, task assignment, Gantt chart, resource management
- Key attributes:
- Project: name, description, date_start_sched, date_due_sched, status, project_manager
- Activity2: name, duration, percent_complete, assigned_to, source_id, cpi, spi
2. Change Management
- ItemType count: 56
- Core objects: ECR, ECN, Change Controlled Item, Affected Item, Express ECO
- Function: Engineering change request, change notice, express change, affected item management
- Process: ECR creation → Affected item identification → Approval → ECN creation → Implementation
3. Part Management
- ItemType count: 15
- Core objects: Part, CAD, Manufacturer Part, Vendor Part, BOM
- Function: Part, BOM, CAD model, manufacturer, supplier management
4. Document Management
- ItemType count: 15
- Core objects: Document, File, Document Book
- Function: Technical documentation, drawings, file management
5. Quality Management
- ItemType count: 11
- Core objects: NCR, Quality Corrective Action, Quality Issue
- Function: Non-conformance, corrective action, quality issue management
Database table structure
Core tables
- sciot_item_types - Basic information of object classes
- sciot_properties - Property Definitions
- sciot_relationships - Relationship Types
- sciot_rules - Auto-generated Rules
- sciot_templates - Auto-generated Templates
- sciot_prompts - Auto-generated Prompts
Business System Tables
- sciot_business_systems - Business System Definitions
- sciot_business_objects - Business System Objects
- sciot_business_prompts - Business System Prompts
Extension Tables
- sciot_item_types_full - Full Item Type Information
- sciot_properties_full - Full Property Information
- sciot_methods_full - Method Information
- sciot_forms_full - Form Information
- sciot_form_fields - Form Fields
- sciot_itemtype_associations - Item Type Associations
API Endpoints
Auto-generated Data API
| Endpoint | Function |
|---|---|
| GET /api/aml/auto-all | Get all auto-generated data statistics |
| GET /api/aml/auto-index | Get ItemType index list |
| GET /api/aml/auto-template/:name | Get template for specified item type |
| GET /api/aml/auto-rules/:name | Get rules for specified item type |
| GET /api/aml/auto-prompt/:name | Get prompts for specified item type |
| GET /api/aml/auto-full/:name | Get full data (rules + template + prompts) |
| POST /api/aml/rebuild-auto | Regenerate rules and templates from AML |
Business System API
| Endpoint | Function |
|---|---|
| GET /api/aml/business-systems | Get business system list |
| GET /api/aml/business-system/:id | Get business system details |
| GET /api/aml/business-prompt/:id | Get business system prompt |
Generated Files
Rule Template Files
- generated/sciot-rules-auto.json - 3489 rules
- generated/sciot-templates-auto.json - 298 templates
- generated/sciot-prompts-auto.json - 298 prompts
- generated/sciot-index-auto.json - Index
Business System Files
- generated/project_management_template.json - Project management template
- generated/change_management_template.json - Change management template
- generated/business_system_prompts.json - Business system prompts
Analysis Scripts
- aml_analyzer_v2.py - AML analyzer
- analyze_core_systems.py - Core business system analyzer
- generate_business_prompts.py - Business prompt generator
- scan_all_aml.py - AML file scanner
- comprehensive_aml_analyzer.py - Comprehensive AML analyzer
Data Flow
SCIOT目录 (7706 AML文件)
↓
aml_analyzer_v2.py (自动分析)
↓
sciot_import.db (规则模板表 + 业务系统表)
↓
API端点 (随时取出)
↓
组装大模型输入 → LLMGenerate → 按规则模板组装AML → 写入SCSAI
业务系统提示词示例
项目管理提示词
你是SCSAI PLM系统的项目管理专家助手...
核心对象类型:
1. Project (项目) - 项目基本信息、时间计划、资源分配
2. Activity2 (WBS任务) - 任务、里程碑、摘要任务
3. Activity (工作流活动) - 审批活动
业务规则:
- 日期格式必须为 YYYY-MM-DD
- 百分比字段必须为 0-100 的整数
- 里程碑任务的工期应为0
- 父任务的完成百分比由子任务自动计算
AML创建模板:
[完整的AML模板代码]
变更管理提示词
你是SCSAI PLM系统的变更管理专家助手...
核心对象类型:
1. ECR (工程变更请求)
2. ECN (工程变更通知)
3. Affected Item (受影响项)
变更流程规则:
1. ECR必须先创建并审批通过,才能创建ECN
2. ECN必须关联到已批准的ECR
3. 受影响项必须在ECR阶段识别
4. 变更实施前必须完成影响分析
使用方式
1. 查询对象类模板
const response = await fetch('/api/aml/auto-full/Project');
const data = await response.json();
// data包含: template, rules, prompt, summary
2. 查询业务系统提示词
const response = await fetch('/api/aml/business-prompt/project_management');
const prompt = await response.json();
// 使用prompt.system_prompt作为LLM系统提示词
3. 重新生成数据
const response = await fetch('/api/aml/rebuild-auto', {method: 'POST'});
系统特点
- 全自动分析 - 从7706个AML文件自动提取元数据
- 业务系统级 - 不仅分析单个对象类,还构建完整业务系统
- 完整关联 - 包含ItemType + Properties + Methods + Forms + Relationships
- 规则驱动 - 自动生成3489条数据验证和业务规则
- 提示词系统 - 为每个业务系统生成专业的LLM提示词
- AML模板 - 提供可直接使用的AML创建模板
- 数据库存储 - 所有数据存入数据库,随时可取
- API接口 - 提供完整的REST API供前端调用
后续优化方向
- 添加更多业务系统(需求管理、供应商管理等)
- 完善Method和Form的关联分析
- 添加Workflow和LifeCycle的详细分析
- 生成更复杂的业务场景模板
- 添加权限和访问控制分析
- 优化提示词以支持更多LLM模型
生成时间: 2024年
Data Source: SCIOT directory (7706 AML files)
System Version: v2.0
BossAgents