当前位置:首页>python>科研小白开箱即用的多目标优化方法——Python灰色关联分析

科研小白开箱即用的多目标优化方法——Python灰色关联分析

  • 2026-07-04 02:37:22
科研小白开箱即用的多目标优化方法——Python灰色关联分析
多指标方案优选、工艺参数优化、综合评价……灰色关联分析(GRA)都能轻松搞定。本文不仅讲清楚原理,还附上一份可直接运行的Python代码,内含顶刊风格图表,帮你一键完成计算与可视化。

一、什么是灰色关联分析?

灰色关联分析(Grey Relational Analysis, GRA)是灰色系统理论中的一种多因素决策方法。它的核心思想是:通过比较各方案与“理想最优方案”在几何形状上的相似程度,来判断方案的优劣。关联度越大,方案越优。

适用场景

  • 农业试验中不同处理组合的综合评价

  • 工艺参数(温度、时间、浓度等)的多指标优化

  • 供应商选择、项目评估等小样本决策问题

优点

  • 对样本量要求低(≥3即可)

  • 不要求数据服从特定分布

  • 计算过程透明,可解释性强


二、代码功能速览

下面这份完整的Python代码实现以下功能:

  1. 读取Excel数据,按处理组合分组求均值

  2. 执行完整的灰色关联分析(标准化→参考序列→关联系数→关联度→排名)

  3. 所有中间计算过程导出到Excel(6张工作表)

  4. 生成4张专业图表(排名柱状图、交互热力图、指标箱线图、关联系数热图)

  5. 图表样式可定制:热力图改为绿色渐变,箱线图改为双色渐变+缺口箱体

代码保存路径:E:\DataAnalysis\GRA(自动创建)


三、完整代码与逐段解读

🧩 0. 导入所需库

import osimport numpy as npimport pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsfrom matplotlib.colors import LinearSegmentedColormap
  • os:创建文件夹

  • numpypandas:数据处理

  • matplotlibseaborn:绘图

  • LinearSegmentedColormap:自定义渐变色


🗂️ 1. 路径设置

input_path = r"E:\DataAnalysis\Data.xlsx"save_dir = r"E:\DataAnalysis\GRA"os.makedirs(save_dir, exist_ok=True)os.makedirs(os.path.join(save_dir, "plots"), exist_ok=True)
指定输入Excel路径和输出文件夹,自动创建目录。你需要修改 input_path 为自己的文件路径

🎨 2. 自定义配色方案

代码中定义了三种渐变色,用于不同图表:

# --- 粉色系渐变(薄雾粉→晶石紫)---pink_palette = [    "#F9EDF4",  # 薄雾粉    "#EDC9DD",  # 樱花粉    "#E0A5C7",  # 蔷薇粉    "#D180B1",  # 胭脂粉    "#C15B9B",  # 浆果紫    "#B02F86"   # 晶石紫]custom_pink_cmap = LinearSegmentedColormap.from_list("custom_pink", pink_palette, N=256)# --- 绿色系单色渐变(森林绿→晨雾白绿)---green_palette = [    "#D4E7CF",  # 晨雾白绿    "#B8D8B0",  # 薄荷雾绿    "#9CC891",  # 嫩苗绿    "#7FB873",  # 新叶绿    "#61A855"   # 森林绿]custom_green_cmap = LinearSegmentedColormap.from_list("custom_green", green_palette, N=256)# --- 双色渐变(森林绿→浆果红)---dual_palette = [    "#61A855",  # 森林绿    "#7FB873",  # 新叶绿    "#9CC891",  # 嫩苗绿    "#B8D8B0",  # 薄荷雾绿    "#D4E7CF",  # 晨雾白绿    "#FFD6D4",  # 贝壳粉    "#FFBAB8",  # 蜜桃粉    "#FE9E9D",  # 珊瑚粉    "#F98082",  # 草莓红    "#F36069"   # 浆果红]custom_dual_cmap = LinearSegmentedColormap.from_list("custom_dual", dual_palette, N=256)
可以根据需要修改这些十六进制颜色值,调出专属配色。

⚙️ 3. 全局绘图风格设置

plt.rcParams.update({    "font.family": ["Arial""SimHei"],    "font.size"10,    "axes.titlesize"12,    "axes.labelsize"11,    "xtick.labelsize"9,    "ytick.labelsize"9,    "legend.fontsize"9,    "figure.dpi"300,    "savefig.dpi"600,    "savefig.bbox""tight",    "axes.spines.top"False,    "axes.spines.right"False,    "grid.alpha"0.3,    "grid.linestyle""--",    "axes.unicode_minus"False})
  • 中英文字体兼容(Arial + SimHei)

  • 高分辨率输出(600 dpi),符合期刊要求

  • 去掉顶部和右侧边框,网格线半透明虚线,更现代


📥 4. 读取数据

df = pd.read_excel(input_path, sheet_name="Sheet1")df_mean = df.groupby(["Treatment""Factor1""Factor2"]).mean().reset_index()indicators = [col for col in df_mean.columns if col not in ["Treatment""Factor1""Factor2"]]data_matrix = df_mean[indicators].valuestreatments = df_mean["Treatment"].valuesT = df_mean["Factor1"].valuesW = df_mean["Factor2"].values

假设Excel包含以下列:

  • Treatment:处理组合名称(如“T1W2”)

  • Factor1 和 Factor2:两个实验因素

  • 其余列均为测量指标(Ind1, Ind2, …)

代码先按三个分组变量求均值(若没有重复测量,均值即原值),然后提取指标矩阵和标签。


🧮 5. 灰色关联分析核心函数

def gray_relation_analysis(data, rho=0.5):    data_norm = (data - data.min(axis=0)) / (data.max(axis=0- data.min(axis=0+ 1e-8)    ref = data_norm.max(axis=0)    diff = np.abs(data_norm - ref)    min_diff = diff.min()    max_diff = diff.max()    gamma = (min_diff + rho * max_diff) / (diff + rho * max_diff)    grade = gamma.mean(axis=1)    return data_norm, ref, diff, gamma, grade

参数解释

  • rho:分辨系数,通常取0.5,用于调节关联系数之间的差异。

  • 标准化方法:极差归一化,使各指标范围变为[0,1]。

  • 参考序列:取每个指标归一化后的最大值(若指标越小越好,可将max改为min)。

  • 关联系数:公式为 (min_diff + ρ·max_diff) / (diff + ρ·max_diff),反映每个方案每个指标与最优值的接近程度。

  • 关联度:每个方案所有指标关联系数的算术平均值。

调用函数,并按照关联度降序排序:

data_norm, ref_seq, diff_matrix, gamma_matrix, gray_grade = gray_relation_analysis(data_matrix)rank_idx = np.argsort(gray_grade)[::-1]sorted_treat = treatments[rank_idx]sorted_grade = gray_grade[rank_idx]sorted_T = T[rank_idx]sorted_W = W[rank_idx]

📎 6. 导出完整计算过程到Excel

with pd.ExcelWriter(os.path.join(save_dir, "GRA_计算全过程.xlsx"), engine="openpyxl"as writer:    df_mean.to_excel(writer, sheet_name="1_原始均值数据", index=False)    pd.DataFrame(data_norm, columns=indicators, index=treatments).to_excel(writer, sheet_name="2_标准化数据")    pd.DataFrame(ref_seq, index=indicators, columns=["最优参考序列"]).to_excel(writer, sheet_name="3_参考序列")    pd.DataFrame(diff_matrix, columns=indicators, index=treatments).to_excel(writer, sheet_name="4_差异矩阵")    pd.DataFrame(gamma_matrix, columns=indicators, index=treatments).to_excel(writer, sheet_name="5_关联系数矩阵")    result_df = pd.DataFrame({        "排名"range(1len(sorted_treat)+1),        "处理组合": sorted_treat,        "Factor1(T)": sorted_T,        "Factor2(W)": sorted_W,        "灰色关联度": np.round(sorted_grade, 4)    })    result_df.to_excel(writer, sheet_name="6_关联度最终排名", index=False)
一张Excel内包含6个工作表,从原始数据到最终排名一目了然,方便论文附录或同行复核。

📊 7. 绘图(重点:样式定制)

图1:关联度排名柱状图

plt.figure(figsize=(106))bar_colors = sns.color_palette(pink_palette, n_colors=len(sorted_treat))bars = plt.barh(sorted_treat[::-1], sorted_grade[::-1], color=bar_colors[::-1], height=0.7, edgecolor="white", linewidth=0.5)plt.barh(sorted_treat[0], sorted_grade[0], color="#61A855", height=0.7, label=f'最优组合:{sorted_treat[0]}')plt.xlabel("灰色关联度", fontweight="bold")plt.ylabel("处理组合", fontweight="bold")plt.title("各处理组合灰色关联度排名", fontweight="bold", pad=12)plt.xlim(left=np.min(sorted_grade)*0.9, right=np.max(sorted_grade)*1.05)plt.grid(axis='x')plt.legend(frameon=False)plt.tight_layout()plt.savefig(os.path.join(save_dir, "plots""01_关联度排名柱状图.png"))plt.close()

图2:T×W交互热力图

heat_data = pd.DataFrame({"T": T, "W": W, "灰色关联度": gray_grade})heat_pivot = heat_data.pivot_table(index="T", columns="W", values="灰色关联度", aggfunc="mean")plt.figure(figsize=(86))# 仅修改cmap为绿色系单色渐变,其余参数完全不变ax = sns.heatmap(heat_pivot, annot=True, cmap=custom_green_cmap, fmt=".4f",                  linewidths=0.8, linecolor="white", cbar_kws={"label""灰色关联度"})plt.title("T×W处理组合关联度热力图", fontweight="bold", pad=12)ax.set_xlabel("Factor2 (W)", fontweight="bold")ax.set_ylabel("Factor1 (T)", fontweight="bold")plt.tight_layout()plt.savefig(os.path.join(save_dir, "plots""02_TW交互热力图.png"))plt.close()

图3:各指标关联系数箱线图

plt.figure(figsize=(126))# 核心修改:# 1. palette改为双色渐变# 2. notch=True 开启顶刊流行的缺口箱体(展示中位数置信区间,更专业美观)# 3. 优化箱体线条、宽度、异常值样式,提升质感sns.boxplot(    data=gamma_matrix,    palette=dual_palette,    notch=True,          # 缺口箱体    linewidth=1.2,       # 箱体描边加粗    width=0.7,           # 箱体宽度优化    fliersize=4,         # 异常值点大小    flierprops={        "marker""o",        "markerfacecolor""#B02F86",        "markeredgecolor""white",        "alpha"0.8    })plt.xticks(ticks=range(len(indicators)), labels=[f"Ind{i+1}" for i in range(len(indicators))], rotation=45)plt.xlabel("测量指标", fontweight="bold")plt.ylabel("关联系数", fontweight="bold")plt.title("各指标关联系数分布", fontweight="bold", pad=12)plt.tight_layout()plt.savefig(os.path.join(save_dir, "plots""03_指标关联系数箱线图.png"))plt.close()

图4:关联系数矩阵热图

plt.figure(figsize=(148))gamma_df = pd.DataFrame(gamma_matrix, index=treatments, columns=[f"Ind{i+1}" for i in range(len(indicators))])ax = sns.heatmap(gamma_df, annot=True, cmap=custom_pink_cmap, fmt=".3f",                  linewidths=0.5, linecolor="white", cbar_kws={"label""关联系数"})plt.title("关联系数矩阵热图", fontweight="bold", pad=12)ax.set_xlabel("测量指标", fontweight="bold")ax.set_ylabel("处理组合", fontweight="bold")plt.tight_layout()plt.savefig(os.path.join(save_dir, "plots""04_关联系数矩阵热图.png"))plt.close()

📢 8. 控制台输出结果

print("="*60)print("✅ 灰色关联分析完成!所有文件已自动保存")print(f"📂 文件保存路径:{save_dir}")print("="*60)print(f"🏆 最优处理组合:{sorted_treat[0]}")print(f"📊 最优组合关联度:{round(sorted_grade[0], 4)}")print("="*60)print("📋 关联度前5名组合:")for i in range(5):    print(f"第{i+1}名:{sorted_treat[i]} | 关联度:{round(sorted_grade[i], 4)}")print("="*60)print("🖼️ 图表调整说明:")print("  1. 02_TW交互热力图 → 森林绿单色渐变")print("  2. 03_指标关联系数箱线图 → 双色渐变+顶刊流行缺口箱体")print("="*60)

三、总结

  • ✅ 开箱即用:只需准备一张Excel表,修改路径即可运行

  • ✅ 过程透明:所有中间结果导出到Excel,便于核查

  • ✅ 图表精美:顶刊风格配色、缺口箱体、高分辨率输出

  • ✅ 高度可定制:颜色、分辨系数、指标方向均可轻松修改

无论你是科研人员、数据分析师,还是学生,这套代码都能帮助你快速完成多指标方案优选任务。

赶快用你的代码和数据试试吧! 🚀


如果你觉得有帮助的话,欢迎点赞、收藏、转发!有任何问题或改进建议,也欢迎在评论区交流。

内容包含AI辅助创作,如有侵权,请联系删除。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 12:29:29 HTTP/2.0 GET : https://f.mffb.com.cn/a/488325.html
  2. 运行时间 : 0.137210s [ 吞吐率:7.29req/s ] 内存消耗:5,012.45kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=0eea92599a9280e7d877672081c82701
  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.000380s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000602s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000281s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000293s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000576s ]
  6. SELECT * FROM `set` [ RunTime:0.000269s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000664s ]
  8. SELECT * FROM `article` WHERE `id` = 488325 LIMIT 1 [ RunTime:0.002852s ]
  9. UPDATE `article` SET `lasttime` = 1783139369 WHERE `id` = 488325 [ RunTime:0.001837s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000402s ]
  11. SELECT * FROM `article` WHERE `id` < 488325 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000678s ]
  12. SELECT * FROM `article` WHERE `id` > 488325 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.005804s ]
  13. SELECT * FROM `article` WHERE `id` < 488325 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.014635s ]
  14. SELECT * FROM `article` WHERE `id` < 488325 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.026010s ]
  15. SELECT * FROM `article` WHERE `id` < 488325 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.010112s ]
0.138862s