5D Library › 企业瓶颈诊断、产品线自蚕食审计与自动化改造回报边界 · English

第一章 四个团队的排队网络与瓶颈

把一家公司写成排队网络

一家做内容获客的公司,每一笔生意都要依次经过四个团队:内容制作、投流获客、转化成交、履约交付。每个团队都像一个排队站:工作到达,排队,被处理,再流向下一站。转化之后,有两成的潜在客户需要回到投流重新触达,五成成交并进入履约,三成离开;履约中有一成需要返工。

杰克逊证明,当每一站的服务时间是指数分布、外部到达是泊松流时,整个网络的稳态分布可以拆成各站独立的乘积 (Jackson 1957, 1963)。先解流量方程 λj=λ0j+∑iλiPij\lambda_j = \lambda_{0j} + \sum_i \lambda_i P_{ij},得到每一站的到达率;第 ii 站有 cic_i 名员工、每人每天处理 μi\mu_i 件,就按一个 M/M/c 队列计算它的在制品。全网的平均交付周期由利特尔定律 L=λWL = \lambda W 得出 (Little 1961)。

推导

# Chapter 1. p01: An open Jackson network of four teams and its bottleneck.
# Each job is one customer journey: content -> acquisition -> conversion ->
# fulfilment. After conversion 20% go back to acquisition (retargeting),
# 50% go on to fulfilment and 30% leave unsold; 10% of fulfilment is
# reworked. Station i has c[i] servers of rate mu[i] jobs/day (M/M/c).
# Jackson's theorem: each station behaves as an independent M/M/c queue
# with the arrival rate solved from the traffic equations.
from math import factorial

NAMES = ("content", "acquisition", "conversion", "fulfilment")
ROUTE = ((0, 1.0, 0, 0), (0, 0, 1.0, 0), (0, 0.2, 0, 0.5), (0, 0, 0, 0.1))
BASE = {"c": (2, 1, 3, 2), "mu": (14.0, 40.0, 10.0, 12.0)}

def visits():
    v = [0.0] * 4
    for _ in range(500):
        v = [(1.0 if j == 0 else 0.0) + sum(v[i] * ROUTE[i][j]
                                            for i in range(4))
             for j in range(4)]
    return v

def mmc_L(lam, c, mu):
    rho = lam / (c * mu)
    if rho >= 1:
        return float("inf")
    a = lam / mu
    s = sum(a ** k / factorial(k) for k in range(c))
    top = a ** c / (factorial(c) * (1 - rho))
    pw = top / (s + top)                    # Erlang C: P(wait)
    return pw * rho / (1 - rho) + a         # queue + in service

def network(lam0, c, mu):
    v = visits()
    rho = [lam0 * v[i] / (c[i] * mu[i]) for i in range(4)]
    L = [mmc_L(lam0 * v[i], c[i], mu[i]) for i in range(4)]
    cap = min(c[i] * mu[i] / v[i] for i in range(4))
    return rho, L, sum(L) / lam0, cap

if __name__ == "__main__":
    lam0 = 20.0
    v = visits()
    print("   visit ratios: " + ", ".join(
        "{} {:.3f}".format(n[:4], x) for n, x in zip(NAMES, v)))
    cases = (("base", BASE["c"], BASE["mu"]),
             ("content automated (mu x2)", BASE["c"], (28.0, 40, 10, 12)),
             ("one more closer", (2, 1, 4, 2), BASE["mu"]))
    for name, c, mu in cases:
        rho, L, W, cap = network(lam0, c, mu)
        print("   {}:".format(name))
        print("     utilisation " + " ".join("{:.3f}".format(r)
                                             for r in rho))
        print("     WIP {:.2f} jobs, lead time {:.3f} days".format(
            sum(L), W))
        print("     throughput {:.1f}/day; max sustainable {:.1f}/day".format(
            lam0, cap))
#    visit ratios: cont 1.000, acqu 1.250, conv 1.250, fulf 0.694
#    base:
#      utilisation 0.714 0.625 0.833 0.579
#      WIP 12.33 jobs, lead time 0.617 days
#      throughput 20.0/day; max sustainable 24.0/day
#    content automated (mu x2):
#      utilisation 0.357 0.625 0.833 0.579
#      WIP 10.24 jobs, lead time 0.512 days
#      throughput 20.0/day; max sustainable 24.0/day
#    one more closer:
#      utilisation 0.714 0.625 0.625 0.579
#      WIP 9.36 jobs, lead time 0.468 days
#      throughput 20.0/day; max sustainable 28.0/day

在示意参数下,每天进入 20 件工作。四个团队的负荷分别是 0.714、0.625、0.833 与 0.579;转化团队负荷最高,是瓶颈。全网在制品 12.33 件,平均交付周期 0.617 天。

吞吐量由瓶颈决定

开放网络的吞吐量等于到达率,只要每一站都稳定。网络能承受的最大到达率是 λ0max=min⁡iciμi/vi\lambda_0^{\max} = \min_i c_i \mu_i / v_i,其中 viv_i 是一件工作平均到访第 ii 站的次数(访问比)。这里转化与投流的访问比都是 1.250,履约是 0.694。

把内容团队的产能翻倍(自动化),内容的负荷从 0.714 降到 0.357,在制品降到 10.24 件,交付周期降到 0.512 天;但最大可持续吞吐量仍是每天 24.0 件,一件也没有增加。给转化团队增加一名成交顾问,最大吞吐量升到每天 28.0 件,在制品降到 9.36 件,交付周期降到 0.468 天。约束理论的第一条主张由此成立:非瓶颈的改善不会增加系统的产出上限 (Goldratt and Cox 1984)。

注

两种收益要分开算。 非瓶颈的自动化并非毫无用处:它缩短了交付周期(在本例中从 0.617 天到 0.512 天)。但如果投资的理由是「多做生意」,它在这个网络中的回报是零。

封顶在制品:闭合网络

许多团队用在制品上限控制流量(CONWIP):手上最多同时处理 NN 件,完成一件才放入一件。这是一个闭合网络。把每个团队合并成一个速率为 ciμic_i \mu_i 的服务台,第 ii 站的服务需求是 Di=vi/(ciμi)D_i = v_i/(c_i\mu_i),用精确的均值分析算出吞吐量 X(N)X(N) (Reiser and Lavenberg 1980)。

推导

# Chapter 1. p02: A closed network (a cap of N jobs in progress, CONWIP).
# Each team is pooled into one server of rate c*mu; the service demand
# of station i is D_i = v_i / (c_i mu_i) days per job. Exact mean value
# analysis (Reiser-Lavenberg) gives throughput X(N); it can never exceed
# 1 / max D_i, whatever is done at the other stations.
import importlib.util

def load(name):
    spec = importlib.util.spec_from_file_location(name, name + ".py")
    m = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(m)
    return m

p01 = load("p01_jackson_open")

def demands(c, mu):
    v = p01.visits()
    return [v[i] / (c[i] * mu[i]) for i in range(4)]

def mva(D, nmax):
    q = [0.0] * len(D)
    out = []
    for n in range(1, nmax + 1):
        r = [D[i] * (1 + q[i]) for i in range(len(D))]
        x = n / sum(r)
        q = [x * ri for ri in r]
        out.append((n, x, sum(r)))
    return out

CASES = (("base", (2, 1, 3, 2), (14.0, 40.0, 10.0, 12.0)),
         ("content x2", (2, 1, 3, 2), (28.0, 40.0, 10.0, 12.0)),
         ("+1 closer", (2, 1, 4, 2), (14.0, 40.0, 10.0, 12.0)))

if __name__ == "__main__":
    print("   jobs in   throughput per day (lead time, days)")
    print("   progress  " + "  ".join("{:>17}".format(n)
                                    for n, _, _ in CASES))
    rows = {name: mva(demands(c, mu), 40) for name, c, mu in CASES}
    for n in (2, 5, 10, 20, 40):
        cells = []
        for name, _, _ in CASES:
            _, x, r = rows[name][n - 1]
            cells.append("{:>8.2f} ({:5.3f})".format(x, r))
        print("   {:8d}  ".format(n) + "  ".join(cells))
    for name, c, mu in CASES:
        D = demands(c, mu)
        print("   {:<10} bound 1/max D = {:.1f} per day".format(
            name, 1 / max(D)))
#    jobs in   throughput per day (lead time, days)
#    progress               base         content x2          +1 closer
#           2     11.58 (0.173)     13.16 (0.152)     12.57 (0.159)
#           5     17.88 (0.280)     19.69 (0.254)     19.57 (0.256)
#          10     21.57 (0.464)     22.87 (0.437)     23.93 (0.418)
#          20     23.51 (0.851)     23.92 (0.836)     26.69 (0.749)
#          40     23.98 (1.668)     24.00 (1.667)     27.84 (1.437)
#    base       bound 1/max D = 24.0 per day
#    content x2 bound 1/max D = 24.0 per day
#    +1 closer  bound 1/max D = 28.0 per day

无论 NN 多大,吞吐量都不能超过 1/max⁡iDi1/\max_i D_i:原方案与内容翻倍方案的上限都是每天 24.0 件,增加顾问的方案是 28.0 件。在制品上限很低时情况不同:N=2N = 2 时,内容翻倍的吞吐量是 13.16 件,高于增加顾问的 12.57 件,也高于原方案的 11.58 件,因为此时每一站的速度都直接决定周转。在制品放宽到 40 件时,三者分别是 23.98、24.00 与 27.84 件。

闭合网络的吞吐量随在制品上限的变化:原方案、内容产能翻倍与增加一名顾问(p02)。虚线为两个上限。

小结

在示意的四团队网络中,转化团队(负荷 0.833)是瓶颈。把内容团队自动化可以缩短交付周期,但最大吞吐量仍是每天 24.0 件;只有瓶颈的扩容能把它提高到 28.0 件。只有在制品被压得很低时,非瓶颈的速度才直接影响产出。

参考文献

Goldratt, Eliyahu M., and Jeff Cox. 1984. The Goal: A Process of Ongoing Improvement. North River Press.
Jackson, James R. 1957. “Networks of Waiting Lines.” Operations Research 5 (4): 518–21.
Jackson, James R. 1963. “Jobshop-like Queueing Systems.” Management Science 10 (1): 131–42.
Little, John D. C. 1961. “A Proof for the Queuing Formula: L = λW.” Operations Research 9 (3): 383–87.
Reiser, Martin, and Stephen S. Lavenberg. 1980. “Mean-Value Analysis of Closed Multichain Queuing Networks.” Journal of the ACM 27 (2): 313–22.

Fan, Y. (2026). Enterprise Bottleneck Diagnostics, SKU Cannibalization Audits and Automation Return Bounds: Theory-of-Constraints Queueing Networks, Margin Dilution Matrices and Value-Based Advisory Pricing [企业瓶颈诊断、产品线自蚕食审计与自动化改造回报边界] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090217 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).