auto-account-machine/browser-automation-ts/analyze-clustering.js
2025-11-27 10:34:59 +08:00

91 lines
3.6 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 聚类分析 - 找出成功案例的"家族"模式
*/
// 70张成功卡号
const fullCards = [
// 原始16张
'6228367545055812', '6228367548774419', '6228367546781457', '6228367542738949',
'6228367542602400', '6228367548575105', '6228367546496080', '6228367540057649',
'6228367549574719', '6228367548435128', '6228367542797374', '6228367545956423',
'6228367547237848', '6228367540385107', '6228367544252006', '6228367547562054',
// 今天54张
'6228367541130577', '6228367540744030', '6228367549888788', '6228367549131205',
'6228367541450744', '6228367547238010', '6228367547300364', '6228367540814288',
'6228367546042579', '6228367546361755', '6228367542443235', '6228367543564435',
'6228367548400627', '6228367544445204', '6228367542653734', '6228367549976732',
'6228367540810302', '6228367540707201', '6228367545237808', '6228367544322734',
'6228367541880148', '6228367549130520', '6228367547863197', '6228367541210049',
'6228367549031561', '6228367542464926', '6228367542487000', '6228367545452860',
'6228367548491592', '6228367545022853', '6228367545864858', '6228367544742832',
'6228367540023658', '6228367547416988', '6228367547093159', '6228367549198576',
'6228367548160064', '6228367546223252', '6228367544873785', '6228367541299976',
'6228367542940032', '6228367546998937', '6228367545800241', '6228367543770784',
'6228367545976843', '6228367547542551', '6228367543917914', '6228367545657930',
'6228367586381796', '6228367544322809', '6228367549131254', '6228367543917146',
'6228367546998903', '6228367545864460'
];
console.log('=== 聚类分析:找出成功案例的家族 ===\n');
// 提取BIN13位前缀
const binGroups = {};
fullCards.forEach(card => {
const bin = card.slice(0, 13);
if (!binGroups[bin]) {
binGroups[bin] = [];
}
binGroups[bin].push(card);
});
// 按数量排序
const sortedBins = Object.entries(binGroups)
.sort((a, b) => b[1].length - a[1].length);
console.log('=== BIN家族分布前10个 ===\n');
sortedBins.slice(0, 10).forEach(([bin, cards], i) => {
console.log(`${i + 1}. BIN: ${bin} (${cards.length}张)`);
cards.forEach(card => {
const last3 = card.slice(-4, -1);
console.log(` ${card} -> 后3位: ${last3}`);
});
console.log();
});
// 分析每个BIN家族的后3位模式
console.log('=== 每个BIN家族的后3位规律 ===\n');
sortedBins.slice(0, 10).forEach(([bin, cards]) => {
if (cards.length < 2) return;
console.log(`BIN: ${bin} (${cards.length}张)`);
const last3s = cards.map(c => c.slice(-4, -1));
// 统计每位的分布
const pos1 = {}, pos2 = {};
last3s.forEach(l3 => {
pos1[l3[0]] = (pos1[l3[0]] || 0) + 1;
pos2[l3[1]] = (pos2[l3[1]] || 0) + 1;
});
console.log(' 百位分布:', Object.entries(pos1).sort((a, b) => b[1] - a[1]).map(([d, c]) => `${d}:${c}`).join(', '));
console.log(' 十位分布:', Object.entries(pos2).sort((a, b) => b[1] - a[1]).map(([d, c]) => `${d}:${c}`).join(', '));
console.log();
});
// 找出"热门BIN"成功率高的BIN
console.log('=== 热门BIN推荐成功案例>=2张===\n');
const hotBins = sortedBins.filter(([_, cards]) => cards.length >= 2);
console.log(`共找到 ${hotBins.length} 个热门BIN\n`);
hotBins.forEach(([bin, cards]) => {
const last3s = cards.map(c => c.slice(-4, -1));
console.log(`${bin}: ${last3s.join(', ')}`);
});
// 生成配置建议
console.log('\n=== 优化建议 ===\n');
console.log(`1. 优先使用热门BIN${hotBins.length}个),它们的成功率更高`);
console.log(`2. 对于热门BIN可以直接从已知成功的后3位变异生成`);
console.log(`3. 冷门BIN只有1张成功可以降低权重或跳过`);