关于「泊松到达下的溢出:桶深只平移漏桶队列的尾巴」,《私域速率整形》给出的定量结论是什么?
结论:看负载 0.60 的三行。纯漏桶时,每分钟结束仍有消息排队的概率是 0.048635,平均排队 0.0921 条,平均多等 0.01535 分钟;桶深 10 时排队概率降到 0.000008;桶深 20 时,六位小数里已看不到。负载 0.80 时,漏桶的排队概率是 0.281302,平均多等 0.10983 分钟;桶深 10 降到 0.004549,桶深 20 降到 0.000061。负载 0.90 时,漏桶的排队概率是 0.553500,平均排队 3.1012 条;桶深 10 时 0.074575;桶深 20 时 0.009397,平均多等 0.00558 分钟,不到半秒。
数据口径:示意计划每分钟平均 10.0 条,攒批猛发仍被拒收 420 条,接上桶深 20 的令牌桶后为零。 书中参数为示意,平台数字注明文档与查阅日期;全部计算由书中程序生成,程序不读写文件、不联网;本书是非个人化经营建议,不是法律或合规意见,任何线上发送节奏的改动须由主事者人工复核放行。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.000008, 0.000061, 0.004549, 0.00558, 0.009397, 0.01535
| r = 10 per minute; Poisson load lam per minute | |||||
| lam | load | b | P(queue at minute end) | mean queue | wait (min) |
| 6 | 0.60 | 0 | 0.048635 | 0.0921 | 0.01535 |
| 6 | 0.60 | 10 | 0.000008 | 0.0000 | 0.00000 |
| 6 | 0.60 | 20 | 0.000000 | 0.0000 | 0.00000 |
| 8 | 0.80 | 0 | 0.281302 | 0.8786 | 0.10983 |
| 8 | 0.80 | 10 | 0.004549 | 0.0130 | 0.00162 |
| 8 | 0.80 | 20 | 0.000061 | 0.0002 | 0.00002 |
| 9 | 0.90 | 0 | 0.553500 | 3.1012 | 0.34458 |
| 9 | 0.90 | 10 | 0.074575 | 0.3986 | 0.04429 |
| 9 | 0.90 | 20 | 0.009397 | 0.0502 | 0.00558 |
查看完整验算程序
# Chapter 3. p31: Poisson arrivals through a token bucket, solved exactly.
# Model: event-driven messages (order notices, replies to customers who
# wrote first) arrive as Poisson(lam) per minute. The shaper adds
# r = 10 tokens a minute to a bucket of depth b. State s at the end of a
# minute = backlog - tokens, from -b upwards; next minute
# s' = max(s + A - r, -b). Put u = s + b: then u' = max(u + A - r, 0),
# the queue of a pure leaky bucket, whatever b is. So the backlog of a
# bucket of depth b is max(u - b, 0): one stationary law serves every
# depth. Law of u by iteration on 0 to 220. Mean wait beyond the arrival
# minute follows from Little's law: mean backlog / lam. Token-bucket
# arrival curves as in Le Boudec and Thiran, LNCS 2050.
import math
R, TOP = 10, 220
def poisson(lam, kmax=45):
return [math.exp(-lam + k * math.log(lam) - math.lgamma(k + 1))
for k in range(kmax)]
def leaky_law(lam, iters=6000):
pa = poisson(lam)
pi = [1.0] + [0.0] * TOP
for _ in range(iters):
bins = [[] for _ in range(TOP + 1)]
for u, w in enumerate(pi):
if w < 1e-300:
continue
for a, p in enumerate(pa):
bins[min(max(u + a - R, 0), TOP)].append(w * p)
new = [math.fsum(t) for t in bins]
gap = max(abs(x - y) for x, y in zip(new, pi))
pi = new
if gap < 1e-15:
break
return pi
def at_depth(pi, b, lam):
p_wait = math.fsum(pi[b + 1:])
backlog = math.fsum((u - b) * w for u, w in enumerate(pi) if u > b)
return p_wait, backlog, backlog / lam
if __name__ == "__main__":
print("r = %d per minute; Poisson load lam per minute" % R)
print("lam load b P(queue at minute end) mean queue wait (min)")
for lam in (6, 8, 9):
pi = leaky_law(lam)
for b in (0, 10, 20):
pw, bl, wt = at_depth(pi, b, lam)
print("%3d %4.2f %2d %22.6f %10.4f %10.5f"
% (lam, lam / R, b, pw, bl, wt))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《私域通道防封号速率控制论、令牌桶限流与平台公示上限内的同意制触达吞吐母典》第 3 章「泊松到达下的溢出:桶深只平移漏桶队列的尾巴」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-271 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026271,
author = {Fan, Yafu},
title = {Rate Control for Private Messaging Channels without Account Bans: Token-Bucket Shaping, Platform-Published Limits and Consent-Based Reach Throughput},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}