审计与检查场景
快速处理审计数据,保护隐私,输出审计结论
场景描述
审计团队需要处理交易明细、客户清单、操作日志等大量数据。通常流程:
- 获取原始交易数据(包含敏感字段)
- 保护个人信息(脱敏)
- 修正数据异常和缺失
- 按审计维度分组统计
- 生成审计检查口径
处理方案
步骤 1:脱敏敏感字段
[
{
"type": "mask",
"preset": "name",
"field": "customer_name",
"keepFirst": 1
},
{
"type": "mask",
"preset": "idcard",
"field": "id_number"
},
{
"type": "mask",
"preset": "phone",
"field": "phone_number"
}
]
步骤 2:清洗和规范化
[
{
"type": "normalize",
"field": "transaction_date",
"mode": "date"
},
{
"type": "normalize",
"field": "amount",
"mode": "number"
},
{
"type": "fillMissing",
"field": "transaction_type",
"strategy": "default",
"defaultValue": "unknown"
}
]
步骤 3:计算审计指标
[
{
"type": "compute",
"targetField": "is_large_amount",
"formula": "IF(amount > 100000, 'yes', 'no')"
},
{
"type": "compute",
"targetField": "transaction_month",
"formula": "DATE_FORMAT(transaction_date, 'YYYY-MM')"
}
]
步骤 4:聚合检查结果
{
"type": "aggregate",
"groupBy": ["transaction_month", "is_large_amount"],
"targets": [
{ "field": "customer_id", "agg": "count", "outputField": "transaction_count" },
{ "field": "amount", "agg": "sum", "outputField": "total_amount" },
{ "field": "amount", "agg": "avg", "outputField": "avg_amount" },
{ "field": "amount", "agg": "max", "outputField": "max_amount" }
]
}
关键指标
| 指标 | 用途 | 生成方式 |
|---|---|---|
| 交易笔数 | 核实交易总量 | COUNT(transaction_id) |
| 交易总额 | 核实金额合计 | SUM(amount) |
| 平均交易额 | 判断异常 | AVG(amount) |
| 超大交易笔数 | 风险控制 | COUNT(IF amount > threshold) |
最佳实践
- ✅ 先脱敏,再分享或导出数据
- ✅ 规范化日期和数字格式,确保准确
- ✅ 使用多维度分组(如日期 + 金额等级)
- ⚠️ 避免在聚合前删除原始数据,留作对账