A | B | |
1 | =file("数据脱敏验证表.txt").import@t() | /导入文本数据 |
2 | =A1.run(mobile=13800013800) | /电话号码数据替换 |
A | B | |
1 | =file("数据脱敏验证表.txt").import@t() | /导入文本数据 |
2 | =A1.run(address="******") | /地址隐藏式无效化 |
3 | =A1.run(address=left(address,3)+"******") | /地址截断无效化 |
A | B | C | |
1 | =file("姓氏.txt").import@it() | =file("名字.txt").import@it() | /引入外部姓名字典表,用于随机生成姓名信息 |
2 | =file("数据脱敏验证表.txt").import@t() | /导入文本数据 | |
3 | =A2.run(name=A1(rand(A1.len())+1)+B1(rand(B1.len())+1)) | /姓名随机化 |
A | B | ||
1 | =file("数据脱敏验证表.txt").import@t() | /导入文本数据 | |
2 | =A1.run(operatetime=string(operatetime,"yyyy-MM-dd HH:00:00")) | /日期的偏移和取整 |
A | B | ||
1 | =file("数据脱敏验证表.txt").import@t() | /导入文本数据 | |
2 | =A1.run(idnumber=left(string(idnumber),6)+"********"+ right(string(idnumber),4)) | /身份证号掩码屏蔽 |
A | B | ||
1 | =file("数据脱敏验证表.txt").import@t() | /导入文本数据 | |
2 | =A1.run(contractno="RAQA"+string(year(now()))+ mid(string(contractno),9,4)+string(#,"#000000000")) | /合同编号灵活编码 |
A | B | C | |
1 | =file("姓氏.txt").import@it() | =file("名字.txt").import@it() | /引入外部姓名字典表,用于随机组合生成姓名信息 |
2 | =file("数据脱敏验证表.txt").cursor@t() | /导入大数据量文本数据 | |
3 | =A2.run(contractno="RAQA"+string(year(now()))+mid(string(contractno),9,4)+string(#,"#000000000"),name=A1(rand(A1.len())+1) +B1(rand(B1.len())+1),address=left(address,3)+"******",mobile=13800013800,idnumber=left(string(idnumber),6)+"********"+right(string(idnumber),4),operatetime=string(operatetime,"yyyy-MM-dd HH:00:00")) | /按照脱敏规则进行数据表脱敏 | |
4 | >file("脱敏数据结果表.txt").export@at(A3) | /直接导出到文本文件 |
A | B | C | |
1 | =file("姓氏.txt").import@it() | =file("名字.txt").import@it() | /引入外部姓名字典表,用于随机组合生成姓名信息 |
2 | =file("数据脱敏验证表.txt").cursor@t() | /导入大数据量文本数据 | |
3 | =A2.run(contractno="RAQA"+string(year(now()))+mid(string(contractno),9,4)+string(#,"#000000000"),name=A1(rand(A1.len())+1) +B1(rand(B1.len())+1),address=left(address,3)+"******",mobile=13800013800,idnumber=left(string(idnumber),6)+"********"+right(string(idnumber),4),operatetime=string(operatetime,"yyyy-MM-dd HH:00:00")) | /按照脱敏规则进行数据表脱敏 | |
4 | =connect("MySQL") | /连接 MySQL 数据源 | |
5 | >A4.update(A3,personinfo,code,contractno,name,address, mobile,idnumber,operatetime;code) | /执行 update 更新,直接导出到数据库中 | |
6 | >A4.close() | /关闭数据库连接 |
A | B | ||
1 | 同上 | /引入外部姓名字典表,用于随机组合生成姓名信息 | |
2 | =connect("MySQL") | /连接 MySQL 数据源 | |
3 | =A2.cursor("select * from personinfo_copy") | /游标读取 MySQL 中 personinfo_copy 表待脱敏数据 | |
4 | 同上 A3 单元格 | /按照脱敏规则进行数据表脱敏 | |
5 | >A2.update(A4,personinfo_copy_test,code,contractno, name,address,mobile,idnumber,operatetime;code) | /执行 update 更新,直接将脱敏数据导出到数据库的 personinfo_copy_test 表中 | |
6 | >A2.close() | /关闭数据库连接 |
A | B | ||
1 | 同上 | /引入外部姓名字典表,用于随机组合生成姓名信息 | |
2 | 同上 | /连接 MySQL 数据源 | |
3 | 同上 | /游标读取 MySQL 中 personinfo_copy 表待脱敏数据 | |
4 | 同上 A4 单元格 | /按照脱敏规则进行数据表脱敏 | |
5 | >file("脱敏数据结果表.txt").export@at(A4) | /直接导出到文本文件 | |
6 | >A2.close() | /关闭数据库连接 |
A | B | C | D | |
1 | =file("姓氏.txt").import@it() | =file("名字.txt").import@it() | /引入外部姓名字典表,用于随机组合生成姓名信息 | |
2 | func | /调用配置文件中的数据脱敏规则进行数据脱敏 | ||
3 | =file("数据脱敏规则配置.ini").property(A2(2)) | |||
4 | if type=="type2" | =eval(B3,"A1","A1","B1","B1") | /特殊规则的动态解析替换 "?" 值 | |
5 | =eval(B3,A2(1)) | /通用规则的动态解析替换 "?" 值 | ||
6 | return ${B3} | |||
7 | =file("数据脱敏验证表.txt").cursor@t() | |||
8 | if type!=0 | = | ||
9 | =A7.run(contractno=func(A2,[contractno,"type1"]),name=func(A2,[name,"type2"]),address=func(A2,[address,"type3"]), mobile=func(A2,[mobile,"type4"]),idnumber=func(A2,[idnumber,"type5"]),operatetime=func(A2,[operatetime,"type6"])) | /按照脱敏规则进行数据表脱敏 | ||
10 | return if(type!=0,B9,A7) | /说明:参数 type 控制是否对数据进行脱敏 (0: 不脱敏) |
欢迎光临 168大数据 (http://www.bi168.cn/) | Powered by Discuz! X3.2 |