feat(#70): 炉层杂质预警特征工程(声明式FeatureSpec引擎,PRD 5.3 ③)

新增 templates/ti-cl4/impurity-forecast:声明式特征工程引擎,特征以
FeatureSpec 描述(EMA/RollingStd/RateOfChange 等 7 算子),换行业只改模板配置
features.template.yaml,引擎零改动(PRD 5.3:特征工程层跨行业差异落在
FeatureSpec,不落代码)。

- features.py:FeatureSpec 声明 + 校验 + 7 算子 + 时序对齐 + 阈值 breach + 零依赖 YAML 解析
- config/features.template.yaml:炉温/氯气/炉压/炉层 9 条特征(对齐点位字典 point_id)
- tests/test_features.py:24 项单测(校验/算子/对齐/breach/配置/端到端提前量)全通过
- _sanity_check.py:冒烟脚本(配置加载 + transform + breach 可观测)

验收:一期阈值+无监督上线,提前量信号可观测(PRD 提前≥30min、误报率≤8%口径)。
This commit is contained in:
2026-08-05 01:59:42 +08:00
parent f5d2294ee4
commit 42d206e503
7 changed files with 1148 additions and 0 deletions
@@ -0,0 +1,73 @@
# iAOP-Template-Ti 一期 · 炉层杂质预警特征工程模板资产(Issue #70 / PRD 5.3 ③)
#
# 换行业只改本配置,特征引擎(features.py)零改动(PRD 5.3:特征工程层
# 跨行业差异落在 FeatureSpec,不落代码)。
#
# 测点对齐 templates/ti-cl4/point-dict/point_dict.default.csv 的 point_id:
# CLF-01.TEMP 炉温 CLF-01.PRES 炉压
# CLF-01.CL2 氯气流量 CLF-01.CO CO含量
# CLF-01.CO2 CO₂含量 CLF-01.BED 炉层状态
#
# 验收口径(PRD 5.3 ③ / 表验收):炉层杂质预警提前 ≥ 30min,误报率 ≤ 8%。
# 一期阈值 + 无监督上线;阈值参考工艺规范(沸腾氯化炉温 850±50℃,超 900℃
# 触发降流减料),3 个月后转监督再调参。
template: ti-cl4
version: 1.0.0
description: 炉层杂质预警特征工程(声明式 FeatureSpec,PRD 5.3 ③)
specs:
# ---- 炉温:原始 + 平滑 + 变化率(趋势预警) -------------------------
- name: 炉温_raw
kind: raw
point: CLF-01.TEMP
unit: ℃
threshold: 900.0 # 工艺上限:超 900℃ 触发降流减料(SOP-CL-001)
- name: 炉温_ema5
kind: ema
point: CLF-01.TEMP
unit: ℃
params: {alpha: 0.2}
threshold: 900.0 # 平滑后更稳,避免毛刺误报
- name: 炉温_rate10
kind: rate_of_change
point: CLF-01.TEMP
unit: "1/min"
params: {window: 10}
threshold: 0.05 # 5%/10min 急升趋势,提前量信号
# ---- 氯气流量:波动度(流态化异常先兆) ------------------------------
- name: 氯气流量_raw
kind: raw
point: CLF-01.CL2
unit: m³/h
- name: 氯气流量_std10
kind: rolling_std
point: CLF-01.CL2
unit: m³/h
params: {window: 10}
threshold: 8.0 # 滚动标准差越界 → 供料不稳
# ---- 炉压:变化率(压力异常是炉层状态恶化强信号) --------------------
- name: 炉压_raw
kind: raw
point: CLF-01.PRES
unit: kPa
- name: 炉压_rate10
kind: rate_of_change
point: CLF-01.PRES
unit: "1/min"
params: {window: 10}
threshold: 0.08 # 8%/10min 压力急变
# ---- 炉层状态:原始值 + 滚动均值(杂质富集表征) ---------------------
- name: 炉层状态_raw
kind: raw
point: CLF-01.BED
unit: "%"
threshold: 85.0
- name: 炉层状态_mean10
kind: rolling_mean
point: CLF-01.BED
unit: "%"
params: {window: 10}
threshold: 85.0