修复 P0:根因判定、退服率口径、影响评估与告警关联量化
- 根因判定改为三级(衍生关系/时间窗/疑似)并带置信度;小区退服告警 ±2 分钟匹配; 衍生告警按父告警归类;优先选随业务恢复清除的告警;时间窗按历史流水 95% 分位数标定 - 退服率按日历统计周期计算;站点数分母支持站名关键字;重复退服率除以全部站点; 月均按统计周期自然月数;导出与看板同一口径 - 影响评估新增受影响用户·小时与 500 米邻站覆盖补偿 - 新增告警—退服关联量化(支持度/置信度/提升度)及 /api/association,根因页展示 - 新增 tests/(扰动数据集留出检验、指标口径检验)与 bench.py;旧库启动时自动迁移 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f8d1ccc526
commit
e9616af34d
10 files changed
+869
-119
No files matched your search
@@ -9,7 +9,8 @@ const BENCH_COLUMNS = [
|
||||
{key: 'scene', title: '场景'}, {key: 'sites', title: '站点数'}, {key: 'count', title: '退服次数'},
|
||||
{key: 'total_h', title: '累计时长(h)'}, {key: 'avg_min', title: '平均时长(min)'}, {key: 'outage_rate', title: '退服率(%)'},
|
||||
{key: 'availability', title: '可用率(%)'}, {key: 'long_ratio', title: '超长占比(%)'}, {key: 'repeat_rate', title: '重复退服率(%)'},
|
||||
{key: 'users', title: '受影响用户', render: num}, {key: 'loss_gb', title: '业务损失(GB)', render: num},
|
||||
{key: 'users', title: '受影响用户', render: num}, {key: 'user_h', title: '用户·小时', render: num},
|
||||
{key: 'loss_gb', title: '业务损失(GB)', render: num},
|
||||
];
|
||||
|
||||
/** 场景柱状图配置:最大的场景用强调色标出 */
|
||||
@@ -24,14 +25,15 @@ export default function Impact() {
|
||||
const {filters} = useApp();
|
||||
const {data} = useFetch('/api/dashboard', filters);
|
||||
if (!data) return html`<${Loading}/>`;
|
||||
const {kpi: k, bench} = data;
|
||||
const {kpi: k, bench, period} = data;
|
||||
|
||||
return html`
|
||||
<div className="grid">
|
||||
<${Section} title="影响评估">
|
||||
<${Section} title="影响评估" hint=${`统计周期 ${period.days} 天(${period.months} 个月)· ${num(k.sites)} 个站`}>
|
||||
<div className="kpis">
|
||||
<${Kpi} title="受影响用户" value=${num(k.users)} unit="人次" sub="小区数 × 单小区在线用户 × 忙闲时系数"/>
|
||||
<${Kpi} title="业务损失" value=${num(k.loss_gb)} unit="GB" sub="小区话务 × 退服时长"/>
|
||||
<${Kpi} title="受影响用户" value=${num(k.users)} unit="人次" sub="小区数 × 单小区在线用户 × 忙闲时 × 覆盖补偿"/>
|
||||
<${Kpi} title="受影响用户·小时" value=${num(k.user_h)} unit="人·h" sub="受影响用户 × 退服时长"/>
|
||||
<${Kpi} title="业务损失" value=${num(k.loss_gb)} unit="GB" sub="小区话务 × 忙闲时 × 覆盖补偿 × 退服时长"/>
|
||||
<${Kpi} title="退服率" value=${fixed(k.outage_rate)} unit="%"/>
|
||||
<${Kpi} title="网络可用率" value=${fixed(k.availability)} unit="%"/>
|
||||
<${Kpi} title="平均退服时长" value=${k.avg_min} unit="min"/>
|
||||
@@ -42,8 +44,15 @@ export default function Impact() {
|
||||
<${Section} span=${6} title="分场景退服率" hint="单位:%">
|
||||
<${EChart} option=${sceneBar(bench, bench.map(x => x.outage_rate))}/>
|
||||
</${Section}>
|
||||
<${Section} span=${6} title="分场景受影响用户" hint="单位:万人次">
|
||||
<${EChart} option=${sceneBar(bench, bench.map(x => +(x.users / 1e4).toFixed(1)))}/>
|
||||
<${Section} span=${6} title="分场景受影响用户·小时" hint="单位:万人·h">
|
||||
<${EChart} option=${sceneBar(bench, bench.map(x => +(x.user_h / 1e4).toFixed(1)))}/>
|
||||
</${Section}>
|
||||
<${Section} title="口径说明">
|
||||
<div className="note">
|
||||
退服率 = 总退服时长 ÷(站点数 × 统计周期);统计周期取顶栏的月份 / 日期范围,未筛选时为全部流水首日至末日。
|
||||
重复退服率 = 高频重复站点数 ÷ 站点数。“月均”按统计周期的自然月数计算。
|
||||
覆盖补偿:站点 500 米内每有一个邻站,受影响用户与话务损失下降 10%(室分站 5%),最低保留 40%。
|
||||
</div>
|
||||
</${Section}>
|
||||
<${Section} title="通信场景运维考核指标横向对标">
|
||||
<${DataTable} rowKey="scene" columns=${BENCH_COLUMNS} rows=${bench}/>
|
||||
|
||||
@@ -7,11 +7,23 @@ import {Cause, LevelTag, Loading, Section, Select, StatusTag} from '../component
|
||||
|
||||
const PAGE_SIZE = 15;
|
||||
|
||||
const WINDOW_COLUMNS = [
|
||||
{key: 'priority', title: '优先级'}, {key: 'category', title: '告警类别', render: v => html`<${Cause} value=${v}/>`},
|
||||
{key: 'default_min', title: '默认'}, {key: 'window_min', title: '当前'}, {key: 'samples', title: '标定样本', render: num},
|
||||
{key: 'source', title: '来源'},
|
||||
];
|
||||
const ASSOC_COLUMNS = [
|
||||
{key: 'category', title: '告警类别', render: v => html`<${Cause} value=${v}/>`}, {key: 'window_min', title: '窗口(分)'},
|
||||
{key: 'alarms', title: '告警数', render: num}, {key: 'hits', title: '其后退服', render: num},
|
||||
{key: 'support', title: '支持度(%)'}, {key: 'confidence', title: '置信度(%)'}, {key: 'lift', title: '提升度'},
|
||||
];
|
||||
|
||||
export default function RootCause() {
|
||||
const {filters, isAdmin} = useApp();
|
||||
const toast = useToast();
|
||||
const {data: confusion} = useFetch('/api/confusion', filters);
|
||||
const {data: stats} = useFetch('/api/stats', {...filters, dim: 'root_cause'});
|
||||
const {data: assoc, reload: reloadAssoc} = useFetch('/api/association', filters);
|
||||
const [lastRun, setLastRun] = useState(null);
|
||||
const [running, setRunning] = useState(false);
|
||||
|
||||
@@ -20,6 +32,7 @@ export default function RootCause() {
|
||||
try {
|
||||
const r = await api('/api/analyze', {method: 'POST'});
|
||||
setLastRun(r);
|
||||
reloadAssoc();
|
||||
toast({message: `全量分析完成:${num(r.n)} 条,耗时 ${r.elapsed}s,准确率 ${r.acc}%`, tone: 'success'});
|
||||
} catch (e) {
|
||||
toast({message: e.message, tone: 'error'});
|
||||
@@ -27,7 +40,7 @@ export default function RootCause() {
|
||||
setRunning(false);
|
||||
};
|
||||
|
||||
if (!confusion || !stats) return html`<${Loading}/>`;
|
||||
if (!confusion || !stats || !assoc) return html`<${Loading}/>`;
|
||||
|
||||
// 交叉矩阵:matrix[i][j] = 上报原因 i、系统判定 j 的条数;对角线 i === j 为判定一致
|
||||
const {causes, matrix} = confusion;
|
||||
@@ -75,19 +88,32 @@ export default function RootCause() {
|
||||
<div className="grid">
|
||||
<${Section} span=${5} title="根因判定规则" extra=${runButton}>
|
||||
<div className="note">
|
||||
<b>第一级 · 告警衍生关系</b>:“小区退服”告警若带 parent_alarm_id,直接取父告警类别作为根因。<br/>
|
||||
<b>第二级 · 时间窗关联</b>:回溯同站在退服前仍未清除的告警,按优先级取首个命中:<br/>
|
||||
① 割接施工 30 分钟 ② 电源故障 300 分钟(考虑蓄电池后备)③ 机房环境 180 分钟(考虑过热保护延时)<br/>
|
||||
④ 传输中断 15 分钟 ⑤ 天馈故障 30 分钟 ⑥ 设备硬件 15 分钟<br/>
|
||||
停电衍生的传输告警因优先级归为电源故障;均未命中判为“其他”,派单现场核查。
|
||||
<b>预处理 · 衍生告警归并</b>:带父告警的告警按父告警类别计(停电引起的传输告警归为电源故障)。<br/>
|
||||
<b>第一级 · 衍生关系(置信度高)</b>:与退服开始相差 ≤ 2 分钟的“小区退服”告警带父告警时,取父告警类别。<br/>
|
||||
<b>第二级 · 时间窗(置信度中)</b>:同站在退服时仍未清除、提前量在该类时间窗内的告警。<br/>
|
||||
<b>第三级 · 疑似(置信度低)</b>:时间窗放宽到 3 倍才命中,提示人工复核。<br/>
|
||||
多条命中时依次比较:级别 → 是否随业务恢复清除(±15 分钟)→ 规则优先级 → 时间早。
|
||||
时间窗在每次全量分析时按已闭环流水的提前量 95% 分位数重新标定(不小于默认值);均未命中判为“其他”。
|
||||
</div>
|
||||
<div className="chips">
|
||||
<div className="chip"><span>参与校验</span>${num(total)} 条</div>
|
||||
<div className="chip" data-tone="green"><span>判定准确率</span>${total ? (hit / total * 100).toFixed(2) : 0}%</div>
|
||||
${confusion.by_confidence.map(c => html`
|
||||
<div className="chip" key=${c.level}><span>置信度${c.level}</span>${num(c.n)} 条 / ${c.acc}%</div>`)}
|
||||
<div className="chip"><span>上次分析</span>${lastRun ? `${num(lastRun.n)} 条 / ${lastRun.elapsed}s` : '—'}</div>
|
||||
</div>
|
||||
</${Section}>
|
||||
<${Section} span=${7} title="上报原因 × 系统判定根因 交叉矩阵" hint="对角线为判定一致"><${EChart} option=${matrixChart}/></${Section}>
|
||||
<${Section} span=${5} title="时间窗标定" hint="单位:分钟">
|
||||
<${DataTable} rowKey="category" columns=${WINDOW_COLUMNS} rows=${assoc.windows}/>
|
||||
</${Section}>
|
||||
<${Section} span=${7} title="告警 → 退服 关联强度" hint="提升度 > 1 表示该类告警出现后退服概率高于随机">
|
||||
<${DataTable} rowKey="category" columns=${ASSOC_COLUMNS} rows=${assoc.rows}/>
|
||||
<div className="note">
|
||||
支持度 = 开始前 W 分钟内有该类告警的退服 ÷ 退服总数;置信度 = 其后 W 分钟内发生退服的告警 ÷ 该类告警总数;
|
||||
提升度 = 置信度 ÷ 随机一个 W 分钟窗口内遇到退服的概率(W 为该类时间窗)。
|
||||
</div>
|
||||
</${Section}>
|
||||
<${Section} title="根因维度统计" hint="柱高为平均退服时长(分钟)"><${EChart} height=${260} option=${causeChart}/></${Section}>
|
||||
<${AdviceList}/>
|
||||
</div>`;
|
||||
@@ -108,7 +134,8 @@ function AdviceList() {
|
||||
const columns = [
|
||||
{key: 'ne_id', title: '基站编号'}, {key: 'site_name', title: '基站名称'}, {key: 'scene', title: '场景'},
|
||||
{key: 'start_time', title: '退服开始'}, {key: 'duration_min', title: '时长(分)'},
|
||||
{key: 'root_cause', title: '根因', render: v => html`<${Cause} value=${v}/>`}, {key: 'evidence', title: '关联告警证据'},
|
||||
{key: 'root_cause', title: '根因', render: v => html`<${Cause} value=${v}/>`}, {key: 'confidence', title: '置信度'},
|
||||
{key: 'evidence', title: '关联告警证据'},
|
||||
{key: 'level', title: '分级', render: v => html`<${LevelTag} value=${v}/>`},
|
||||
{key: 'status', title: '状态', render: v => html`<${StatusTag} value=${v}/>`},
|
||||
{key: 'advice', title: '处置建议', wrap: true},
|
||||
|
||||
Reference in new issue
Block a user