1. 范围
本规范适用于离散制造业生产追溯系统的数据库设计,涵盖产品标识、工序记录、设备关联、物料批次等核心实体。
2. 实体关系
- Product: product_serial (PK), order_id, material_batch, created_at
- ProcessStep: step_id (PK), product_serial (FK), device_id, operator_id, start_time, end_time, parameters (JSON)
- Device: device_id (PK), device_name, device_type, ip_address
3. 索引建议
对 product_serial、start_time 建立复合索引,加速正向追溯查询。

