个人博客:无奈何杨(wnhyang)
个人语雀:wnhyang
共享语雀:在线知识共享
Github:wnhyang - Overview
背景
一天,小明在风控管理台查看事件数据时,发现一笔决策结果为“拒绝”❌的交易事件,小明点开事件详情发现其触发了一条“24小时内向不同陌生账户转账超过30w”的规则,规则设置的处置方式是“拒绝”❌。小明通过策略规则却查不到那条“24小时内向不同陌生账户转账超过30w”的规则,经确认原来是这条规则在此交易触发后一段时间内被修改了,已经不知道当时是如何配置的!?
这该怎么办?
我们要知道风控等其他系统都需要对于配置实时生效,所以使用了规则引擎,规则引擎具有实时生效优雅热刷新的特性,但也因此,如果规则设置有问题而没有回滚/溯源/复现的机制,将是很大的问题!!!
所以本质上就是要在规则引擎应用之上打造完善的版本控制,能够对规则历史进行溯源。
事件记录
之前的文章风控系统建设,指标策略规则流程设计,LiteFlow隐式子流程,构造EL和Chain,提到了最终存储在es中大概有哪些数据。以下仅供参考,有部分还没做。
这里再次梳理一下:
1、基础数据,保留所有事件字段。
2、事件处理流程,也就是输入的数据经历了哪些流程和组件处理!
3、策略集结果,包括策略集、策略、规则的所有决策结果。还要加上特殊配置的策略执行流程。
4、指标数据,本次事件计算的所有指标数据。
{
"result": {
"name": "手机登录策略",
"code": "phone_login",
"disposalName": "通过",
"disposalCode": "pass",
"policyResults": [
{
"name": "手机登录最坏",
"code": "phone_login_worst",
"mode": "worst",
"disposalName": "通过",
"disposalCode": "pass",
"ruleResults": [
{
"name": "测试规则03",
"code": "352452",
"disposalName": "通过",
"disposalCode": "pass",
"score": 0
}
],
"mockRuleResults": [
]
},
{
"name": "手机登录顺序",
"code": "phone_login_order",
"mode": "order",
"disposalName": "通过",
"disposalCode": "pass",
"ruleResults": [
],
"mockRuleResults": [
]
}
]
},
"zbs": [{"id":"1","name":"24小时交易金额之和","type":"sum","version":0,"value":"1413.07938"},{"id":"3","name":"选必于","type":"sum","version":0,"value":"436864.3324399999"},{"id":"4","name":"24小时交易金额大于10万求和","type":"sum","version":0,"value":"1413.07938"},{"id":"5","name":"规支才公照还","type":"ass","version":0,"value":"1.0"},{"id":"6","name":"且者矿","type":"max","version":0,"value":"988.56238"},{"id":"7","name":"北在文地","type":"min","version":0,"value":"424.517"},{"id":"8","name":"看活历地许","type":"avg","version":0,"value":"706.53969"},{"id":"9","name":"情性特问写养八","type":"sum","version":0,"value":"1413.07938"},{"id":"10","name":"其断子把酸","type":"count","version":0,"value":"2.0"}],
"fields": {
"N_S_ipCity": "南昌市",
"N_S_lonAndLat": "98.63974,12.4825",
"N_S_payerType": "关在那边员",
"N_S_idCardCity": "未知",
"N_S_payeeIDNumber": "640000198102131788",
"N_S_ipProvince": "江西省",
"N_S_payeeIDCountryRegion": "US",
"N_F_transAmount": 424.517,
"N_S_payerAddress": "其它区 山西省 承德市",
"N_S_seqId": "c678bfbfb4c544eaaeb52373702a0aca",
"N_S_payeePhoneNumber": "18643006812",
"N_S_transSerialNo": "809bbad3-1c81-4b59-9e42-fa0b028d1448",
"N_S_payerAccount": "1234567890",
"N_S_payeeAccount": "1234567880",
"N_S_ip": "106.230.80.158",
"N_S_policyCode": "phone_login_worst",
"N_S_payeeType": "济常准属适",
"N_S_payerIDNumber": "420000199805245558",
"N_S_payeeBankName": "ABC Bank",
"N_S_phoneNumberProvince": "未知",
"N_S_ipIsp": "电信",
"N_S_payerIDCountryRegion": "US",
"N_D_transTime": "2013-06-21 16:30:09",
"N_S_phoneNumberCity": "成都",
"N_S_phoneNumberIsp": "中国电信",
"N_S_payeeAddress": "- 福建省 抚州市",
"N_S_payeeRiskRating": "HIGH",
"N_S_policySetCode": "phone_login",
"N_S_payerBankName": "XYZ Bank",
"N_S_idCardDistrict": "未知",
"N_S_appName": "phone",
"N_S_idCardProvince": "湖北省",
"N_S_ipCountry": "中国",
"N_S_payeeName": "范明",
"N_S_payerName": "石娜",
"N_S_payerPhoneNumber": "18123341918",
"N_S_payerRiskRating": "HIGH"
}
}
以下仅是示例,表示一笔事件要记录当时处理流程,示例是线性简单的流程,但实际上怎么样,不知道呢
标签:版本控制,name,version,控系统,规则,主表,type,id,溯源 From: https://www.cnblogs.com/wnhyang/p/18386520