当前位置:首页>python>Python pymoo多目标优化完全指南

Python pymoo多目标优化完全指南

  • 2026-02-02 18:13:06
Python pymoo多目标优化完全指南

Python pymoo多目标优化完全指南:从理论到实践

1. 引言:多目标优化的意义与pymoo的价值

在多目标优化问题中,我们经常面临相互冲突的目标——例如在产品设计中同时追求低成本高性能,或在机器学习模型中平衡准确率计算效率。传统的单目标优化方法无法有效处理这种权衡关系,而多目标优化则提供了一组帕累托最优解,让决策者可以根据偏好选择最适合的解决方案。

pymoo是一个功能强大的Python多目标优化框架,它提供了:

  • 多种经典和现代优化算法(NSGA-II、NSGA-III、MOEA/D等)
  • 统一且直观的API设计
  • 丰富的可视化工具
  • 约束处理能力
  • 并行计算支持

2. pymoo核心功能详解与NSGA-II实战

2.1 问题定义与建模

在pymoo中定义优化问题需要明确目标函数、变量边界和约束条件。

import numpy as npfrom pymoo.core.problem import ElementwiseProblemclassMyMultiObjectiveProblem(ElementwiseProblem):"""    自定义多目标优化问题示例:    目标1: 最小化 f1 = x²    目标2: 最小化 f2 = (x-2)²    变量范围: x ∈ [-5, 5]    """def__init__(self):        super().__init__(            n_var=1,          # 变量个数            n_obj=2,          # 目标个数            n_constr=0,       # 约束个数            xl=np.array([-5]), # 变量下界            xu=np.array([5])   # 变量上界        )def_evaluate(self, x, out, *args, **kwargs):# 计算目标函数值        f1 = x[0] ** 2        f2 = (x[0] - 2) ** 2# 存储计算结果        out["F"] = np.array([f1, f2])# 创建问题实例problem = MyMultiObjectiveProblem()

代码解释

  • n_var: 定义决策变量的维度
  • n_obj: 目标函数的数量
  • xlxu: 定义变量的边界约束
  • _evaluate: 核心方法,计算给定解的目标值

2.2 NSGA-II算法配置与执行

NSGA-II(非支配排序遗传算法II)是pymoo中最常用的多目标优化算法。

from pymoo.algorithms.moo.nsga2 import NSGA2from pymoo.optimize import minimizefrom pymoo.operators.crossover.sbx import SBXfrom pymoo.operators.mutation.pm import PMfrom pymoo.operators.sampling.rnd import FloatRandomSampling# 配置NSGA-II算法参数algorithm = NSGA2(    pop_size=100,                    # 种群大小    n_offsprings=100,               # 后代数量    sampling=FloatRandomSampling(), # 采样策略    crossover=SBX(        prob=0.9,                   # 交叉概率        eta=15# 分布指数    ),    mutation=PM(        prob=0.1,                   # 变异概率        eta=20# 分布指数    ),    eliminate_duplicates=True# 消除重复个体)# 执行优化res = minimize(    problem,    algorithm,    ('n_gen'100),                # 最大迭代次数    seed=1,                        # 随机种子    verbose=True,                  # 显示进度    save_history=True# 保存历史数据)print(f"最优解数量: {len(res.X)}")print(f"计算时间: {res.exec_time:.2f}秒")

参数详解

  • pop_size: 较大的种群有助于探索,但会增加计算成本
  • crossovermutation: 遗传算子,控制解的空间探索
  • n_gen: 迭代次数,需要权衡计算资源与收敛性

2.3 结果分析与可视化

pymoo提供了丰富的可视化工具来分析优化结果。

import matplotlib.pyplot as pltfrom pymoo.visualization.scatter import Scatter# 绘制帕累托前沿plot = Scatter(title="帕累托前沿", labels=["目标1 (f1)""目标2 (f2)"])plot.add(res.F, color="red", s=30, label="最优解")plot.show()# 分析解的分布print("\n=== 解集分析 ===")print(f"目标值范围:")print(f"f1: [{res.F[:, 0].min():.3f}{res.F[:, 0].max():.3f}]")print(f"f2: [{res.F[:, 1].min():.3f}{res.F[:, 1].max():.3f}]")# 绘制收敛历史if hasattr(res, 'history'):    plt.figure(figsize=(104))# 提取每一代的最佳目标值    n_evals = []  # 函数评估次数    best_f1 = []  # 最佳f1值    best_f2 = []  # 最佳f2值for entry in res.history:        n_evals.append(entry.evaluator.n_eval)        F = entry.pop.get("F")        best_f1.append(F[:, 0].min())        best_f2.append(F[:, 1].min())    plt.subplot(121)    plt.plot(n_evals, best_f1, 'b-', linewidth=2)    plt.xlabel('函数评估次数')    plt.ylabel('最佳 f1 值')    plt.title('目标1收敛曲线')    plt.grid(True, alpha=0.3)    plt.subplot(122)    plt.plot(n_evals, best_f2, 'r-', linewidth=2)    plt.xlabel('函数评估次数')    plt.ylabel('最佳 f2 值')    plt.title('目标2收敛曲线')    plt.grid(True, alpha=0.3)    plt.tight_layout()    plt.show()

2.4 约束处理示例

现实优化问题通常包含各种约束条件。

classConstrainedProblem(ElementwiseProblem):"""带约束的多目标优化问题"""def__init__(self):        super().__init__(            n_var=2,            n_obj=2,            n_constr=2,            xl=np.array([-5-5]),            xu=np.array([55])        )def_evaluate(self, x, out, *args, **kwargs):# 目标函数        f1 = x[0]**2 + x[1]**2        f2 = (x[0]-1)**2 + x[1]**2# 约束条件 (需要满足 g <= 0)        g1 = x[0] + x[1] - 1# x1 + x2 <= 1        g2 = x[0]**2 + x[1]**2 - 2# x1² + x2² <= 2        out["F"] = [f1, f2]        out["G"] = [g1, g2]# 执行带约束的优化problem_constrained = ConstrainedProblem()res_constrained = minimize(    problem_constrained,    NSGA2(pop_size=50),    ('n_gen'50),    seed=1,    verbose=False)# 检查约束违反情况from pymoo.constraints.as_penalty import ConstraintsAsPenalty# 将约束转化为惩罚项problem_penalty = ConstraintsAsPenalty(problem_constrained, penalty=100.0)

2.5 多目标决策与解决方案选择

获得帕累托前沿后,需要选择最终实施方案。

from pymoo.decomposition.asf import ASFfrom pymoo.mcdm.high_tradeoff import HighTradeoffPoints# 方法1: 使用标量化函数选择折中解weights = np.array([0.50.5])  # 两个目标同等重要decomp = ASF()i = decomp.do(res.F, 1/weights).argmin()best_compromise = res.X[i]print(f"\n折中解: x = {best_compromise[0]:.3f}, "f"f1 = {res.F[i, 0]:.3f}, f2 = {res.F[i, 1]:.3f}")# 方法2: 自动识别高权衡区域try:    tradeoff = HighTradeoffPoints()    tradeoff_solutions = tradeoff.do(res.F)    print(f"\n高权衡解数量: {len(tradeoff_solutions)}")except:    print("高权衡点计算需要更多解")# 方法3: 基于特定需求筛选# 例如:选择f1 < 1的所有解mask = res.F[:, 0] < 1.0filtered_solutions = res.X[mask]print(f"\n满足 f1 < 1 的解数量: {len(filtered_solutions)}")

2.6 高级功能:并行计算与性能优化

对于计算密集型目标函数,pymoo支持并行计算。

from pymoo.core.problem import StarmapParallelizationfrom multiprocessing.pool import ThreadPool# 设置并行计算n_threads = 4pool = ThreadPool(n_threads)runner = StarmapParallelization(pool.starmap)classParallelProblem(MyMultiObjectiveProblem):def__init__(self):        super().__init__()        self.runner = runner# 执行并行优化problem_parallel = ParallelProblem()res_parallel = minimize(    problem_parallel,    NSGA2(pop_size=100),    ('n_gen'50),    seed=1,    verbose=True)# 清理线程池pool.close()

3. 实战案例:工程优化问题

让我们通过一个实际的工程优化问题来巩固所学知识。

classWeldedBeamProblem(ElementwiseProblem):"""    焊接梁设计优化问题(经典工程优化案例)    目标:同时最小化制造成本和最大挠度    变量:h(厚度), l(长度), t(高度), b(宽度)    约束:应力、挠度、几何约束等    """def__init__(self):        super().__init__(            n_var=4,            n_obj=2,            n_constr=5,            xl=np.array([0.1253.00.1250.125]),            xu=np.array([5.015.05.05.0])        )        self.P = 6000# 载荷 (lb)        self.L = 14# 梁长度 (in)        self.E = 30e6# 弹性模量 (psi)        self.G = 12e6# 剪切模量 (psi)def_evaluate(self, x, out, *args, **kwargs):        h, l, t, b = x[0], x[1], x[2], x[3]# 目标1: 最小化成本 (材料 + 制造)        cost = 1.10471 * h**2 * l + 0.04811 * t * b * (14.0 + l)# 目标2: 最小化挠度        delta = (4 * self.P * self.L**3) / (self.E * t**3 * b)# 约束条件# 1. 剪切应力约束        tau_prime = self.P / (np.sqrt(2) * h * l)        M = self.P * (self.L + l/2)        J = np.sqrt(2) * h * l * (l**2/12 + (h+t)**2/4)        tau_biprime = M * (l/2) / J        tau = np.sqrt(tau_prime**2 + 2*tau_prime*tau_biprime*l/(2*np.sqrt(l**2/4 + (h+t)**2/4)) + tau_biprime**2)        g1 = tau - 13600# 最大允许剪切应力# 2. 正应力约束        sigma = 6 * self.P * self.L / (t**2 * b)        g2 = sigma - 30000# 最大允许正应力# 3. 屈曲约束        P_c = (4.013 * self.E * np.sqrt(t**2 * b**6 / 36) / self.L**2) * (1 - t/(2*self.L)*np.sqrt(self.E/(4*self.G)))        g3 = self.P - P_c# 4. 几何约束        g4 = h - b        g5 = 0.125 - h        out["F"] = [cost, delta]        out["G"] = [g1, g2, g3, g4, g5]# 执行优化problem_welded = WeldedBeamProblem()algorithm = NSGA2(pop_size=50, eliminate_duplicates=True)res_welded = minimize(    problem_welded,    algorithm,    ('n_gen'100),    seed=42,    verbose=True)# 可视化结果fig, (ax1, ax2) = plt.subplots(12, figsize=(125))ax1.scatter(res_welded.F[:, 0], res_welded.F[:, 1], c='blue', alpha=0.6)ax1.set_xlabel('成本 ($)')ax1.set_ylabel('挠度 (in)')ax1.set_title('焊接梁设计帕累托前沿')ax1.grid(True, alpha=0.3)# 选择一个折中解进行分析i = np.argmin(res_welded.F[:, 0] + res_welded.F[:, 1])best_design = res_welded.X[i]ax2.bar(['厚度(h)''长度(l)''高度(t)''宽度(b)'], best_design)ax2.set_ylabel('尺寸 (in)')ax2.set_title(f'最优设计参数\n成本=${res_welded.F[i, 0]:.2f}, 挠度={res_welded.F[i, 1]:.4f}in')plt.tight_layout()plt.show()

4. 总结与最佳实践

4.1 pymoo核心优势总结

  1. 算法丰富性:提供NSGA-II、NSGA-III、MOEA/D等多种成熟算法
  2. 易用性:清晰的API设计和丰富的文档
  3. 可扩展性:支持自定义问题、算法和算子
  4. 可视化能力:内置强大的结果分析工具
  5. 工程实用性:支持约束处理、并行计算等实际需求

4.2 使用建议与最佳实践

  1. 问题建模阶段

    • 仔细定义决策变量和目标函数
    • 合理设置变量边界以减少搜索空间
    • 优先使用无约束形式,必要时添加约束
  2. 算法配置阶段

    # 推荐的基础配置algorithm = NSGA2(    pop_size=100,        # 中小问题: 50-100,大问题: 100-300    n_offsprings=100,    crossover=SBX(prob=0.9, eta=15),    mutation=PM(prob=0.1, eta=20),    eliminate_duplicates=True)
  3. 执行与监控

    • 设置合适的终止条件(n_genn_evals
    • 使用verbose=True监控进度
    • 保存历史数据用于后续分析
  4. 结果分析

    • 检查帕累托前沿的分布和多样性
    • 验证约束满足情况
    • 使用多种决策方法选择最终解

4.3 常见问题与解决方案

问题
可能原因
解决方案
收敛缓慢
种群大小不足
增加pop_size
解集多样性差
遗传算子参数不当
调整交叉/变异概率
约束违反严重
惩罚系数太小
增加约束惩罚项
计算时间过长
目标函数复杂
启用并行计算

4.4 进阶学习方向

  1. 算法扩展:学习NSGA-III用于三目标及以上问题
  2. 性能评估:使用GD、IGD、HV等指标量化算法性能
  3. 超参数调优:使用实验设计方法优化算法参数
  4. 现实应用:将pymoo应用于机器学习超参数优化、金融投资组合等实际问题

通过本指南,您应该已经掌握了使用pymoo进行多目标优化的核心技能。pymoo的强大功能结合Python的易用性,使其成为解决复杂多目标决策问题的理想工具。无论是学术研究还是工程实践,这套工具都能帮助您在多个冲突目标中找到最佳平衡点。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 02:54:38 HTTP/2.0 GET : https://f.mffb.com.cn/a/466984.html
  2. 运行时间 : 0.175888s [ 吞吐率:5.69req/s ] 内存消耗:4,467.65kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=c8325c96e57e9aa4c4f68786c4b7d0a4
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001128s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001040s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000351s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000303s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000540s ]
  6. SELECT * FROM `set` [ RunTime:0.000199s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000647s ]
  8. SELECT * FROM `article` WHERE `id` = 466984 LIMIT 1 [ RunTime:0.000804s ]
  9. UPDATE `article` SET `lasttime` = 1770490478 WHERE `id` = 466984 [ RunTime:0.008956s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000383s ]
  11. SELECT * FROM `article` WHERE `id` < 466984 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000731s ]
  12. SELECT * FROM `article` WHERE `id` > 466984 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000460s ]
  13. SELECT * FROM `article` WHERE `id` < 466984 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001816s ]
  14. SELECT * FROM `article` WHERE `id` < 466984 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002127s ]
  15. SELECT * FROM `article` WHERE `id` < 466984 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001177s ]
0.177560s