关于「自购返佣与「邀请好友解锁」」,《零人工站群、支付防欺诈与现金流排队》给出的定量结论是什么?

结论:第二章的关联图显示,设备与支付账户能识别多数作弊团伙,加入 IP 子网则把 4692 个账户连成一片、误拦 0.817 的陌生人推荐;「邀请 3 人解锁」让自购者以 67.50 拿到标价 299 的二级。

数据口径:第四章用排队论与模拟显示,突发到达把单个工作进程的 T99 推到数十秒;平均负载 0.80 时,突发需要 4 个工作进程,或 3 个加限流(拒绝 0.0005 的请求)。 书中以标注框区分证据、16 段可运行的 Python 程序、史料与假说。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.817, 4692

   edges               rings  honest  honest   largest
                      blocked blocked strangers component
   dev                  0.487   0.019    0.000         8
   dev+pay              0.779   0.047    0.000         8
   dev+pay+net          0.995   0.820    0.817      4692
Reading: device and payment edges catch most rings and
block only family referrals among honest users; careful
rings slip through. Adding the shared-subnet edge seems to
catch almost every ring, but only because it glues thousands
of strangers behind carrier NAT into one component: it
blocks most honest referrals between strangers too.
查看完整验算程序
# Chapter 2. [p03] Blocking self-referral with an association graph.
# 5,000 honest users and 40 fraud rings of 3-8 accounts. Every account
# has a device fingerprint, a payment account and an IP /24 subnet.
# Honest: 6% share a device with a family member, 10% share a payment
# account; subnets come from 300 mobile carrier-NAT blocks (Zipf
# weights), so strangers often share one. Rings: members share one
# device with chance 0.6, one payment account with chance 0.7, one
# subnet with chance 0.9; a careful ring (chance 0.2) shares nothing.
# Honest users make 3,000 referrals (30% within the family); each ring
# leader refers all members. Union-find joins accounts linked by the
# chosen edge types; a referral is blocked when both ends share a
# component. Reported: rings' referrals blocked, honest ones blocked
# (all, and to strangers only), and the largest component.
import random

class DSU:
    def __init__(self, n):
        self.p = list(range(n))
    def find(self, x):
        while self.p[x] != x:
            self.p[x] = self.p[self.p[x]]
            x = self.p[x]
        return x
    def union(self, a, b):
        self.p[self.find(a)] = self.find(b)

def world(rng):
    acc, fam = [], []
    w = [1 / (i + 1) for i in range(300)]
    for i in range(5000):
        acc.append({"dev": ("d", i), "pay": ("p", i),
                    "net": ("n", rng.choices(range(300), w)[0])})
        fam.append(i)
    for i in range(0, 5000, 2):
        if rng.random() < 0.06:
            acc[i + 1]["dev"] = acc[i]["dev"]
        if rng.random() < 0.10:
            acc[i + 1]["pay"] = acc[i]["pay"]
        fam[i + 1] = i
    rings = []
    for r in range(40):
        size = rng.randint(3, 8)
        careful = rng.random() < 0.2
        base = len(acc)
        net = ("n", rng.choices(range(300), w)[0])
        for j in range(size):
            a = {"dev": ("rd", r, j), "pay": ("rp", r, j),
                 "net": ("n", rng.choices(range(300), w)[0])}
            if not careful:
                if rng.random() < 0.6:
                    a["dev"] = ("rd", r, 0)
                if rng.random() < 0.7:
                    a["pay"] = ("rp", r, 0)
                if rng.random() < 0.9:
                    a["net"] = net
            acc.append(a)
        rings.append([(base, base + j) for j in range(1, size)])
    refs = []
    for _ in range(3000):
        i = rng.randrange(5000)
        if rng.random() < 0.3:
            j = i + 1 if i % 2 == 0 else i - 1
            refs.append((i, j, True))
        else:
            refs.append((i, rng.randrange(5000), False))
    return acc, refs, [x for r in rings for x in r]

def evaluate(acc, refs, ring_refs, kinds):
    d = DSU(len(acc))
    first = {}
    for i, a in enumerate(acc):
        for k in kinds:
            key = a[k]
            if key in first:
                d.union(i, first[key])
            else:
                first[key] = i
    same = lambda x, y: d.find(x) == d.find(y)
    caught = sum(same(a, b) for a, b in ring_refs) / len(ring_refs)
    hon = sum(same(a, b) for a, b, _ in refs) / len(refs)
    strangers = [(a, b) for a, b, f in refs if not f]
    hs = sum(same(a, b) for a, b in strangers) / len(strangers)
    sizes = {}
    for i in range(len(acc)):
        r = d.find(i)
        sizes[r] = sizes.get(r, 0) + 1
    return caught, hon, hs, max(sizes.values())

if __name__ == "__main__":
    rng = random.Random(75003)
    acc, refs, ring_refs = world(rng)
    print("   edges               rings  honest  honest   largest")
    print("                      blocked blocked strangers component")
    for kinds in (("dev",), ("dev", "pay"), ("dev", "pay", "net")):
        c, h, hs, big = evaluate(acc, refs, ring_refs, kinds)
        print("   {:18s} {:7.3f} {:7.3f} {:8.3f} {:9d}".format(
            "+".join(kinds), c, h, hs, big))
    print("\nReading: device and payment edges catch most rings and")
    print("block only family referrals among honest users; careful")
    print("rings slip through. Adding the shared-subnet edge seems to")
    print("catch almost every ring, but only because it glues thousands")
    print("of strangers behind carrier NAT into one component: it")
    print("blocks most honest referrals between strangers too.")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《零人工多站点容错架构、支付防欺诈状态机与被动现金流排队论》第 2 章「自购返佣与「邀请好友解锁」」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090201

DOI: 10.5281/zenodo.24090201 · 阅读本章所在专著 · 5DL-B-075 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026075,
  author    = {Fan, Yafu},
  title     = {Zero-Touch Multi-Site Fault Tolerance, Payment Anti-Fraud State Machines and Passive Cashflow Queuing},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.24090201},
  url       = {https://doi.org/10.5281/zenodo.24090201}
}

本书其他章节结论