当前位置:首页>python>解放双手!用Python自动化实现50台华为交换机配置备份

解放双手!用Python自动化实现50台华为交换机配置备份

  • 2026-06-29 17:33:55
解放双手!用Python自动化实现50台华为交换机配置备份

一、为什么需要自动化备份?

如果你是一名网络工程师,正在管理几十台甚至上百台华为交换机,那么你一定对这样的场景不陌生:每到月底要做配置备份,就得一台一台地登录设备,一遍又一遍地输入display current-configuration,再把输出复制粘贴到本地文件。这种“人肉运维”模式,在网络规模小的时候还能应付,一旦设备数量上来,效率低下不说,还容易因为手误敲错命令引发故障。

传统手动备份的痛点非常明显:

  • 时间成本高:按每台设备5分钟计算,50台设备需要4个多小时
  • 人为错误多:手工操作易出现命令错误、漏备份等问题
  • 版本管理难:备份文件命名不规范,难以追踪历史变更

Python自动化方案能把备份时间从小时级缩短到分钟级,彻底解放你的双手。

二、技术选型:Paramiko vs Netmiko

实现SSH连接华为交换机,主要有两种Python库可选:

Paramiko 是Python的基础SSH库,功能强大但需要手动处理很多底层细节,比如交互式shell的建立、命令输出的读取等。

Netmiko 则是专门为网络设备自动化而生的库,它封装了SSH连接、会话保持、命令执行、输出解析等一系列繁琐的底层操作。对于华为交换机,Netmiko已经内置了完善的驱动支持,代码更简洁、更稳定。

对于50台交换机的批量备份场景,强烈推荐使用Netmiko。本文的示例代码也将基于Netmiko来实现。

三、环境准备

3.1 安装Python和Netmiko

首先需要一台安装了Python的电脑,Windows、macOS或Linux都可以。建议使用Python 3.7或更高版本。

安装Netmiko库:

pip install netmiko

如果安装速度慢,可以使用国内镜像源:

pip install netmiko -i https://pypi.tuna.tsinghua.edu.cn/simple

3.2 交换机端准备

在开始编写脚本之前,需要确保交换机满足以下条件:

  • 管理电脑与交换机网络可达(能ping通)
  • 交换机已开启SSH服务(华为交换机上用 stelnet server enable 命令开启)
  • 拥有一个具有足够权限的SSH账号(至少要有display权限)

安全建议:单独为自动化脚本创建一个专用账号,并赋予固定权限,避免使用管理员账号。

3.3 准备设备清单

创建一个 devices.txt 文件,每行一个IP地址:

192.168.1.101
192.168.1.102
192.168.1.103
...(共50台)

四、单台交换机备份——基础篇

先从连接单台交换机开始,这是批量备份的基础。

from netmiko import ConnectHandler
import datetime
import os

# 交换机连接参数
device = {
'device_type''huawei',
'host''192.168.1.101',
'username''admin',
'password''Admin@123',
'port'22,
'timeout'60,          # 连接超时时间
'session_timeout'60,  # 会话超时时间
}

defbackup_single_device(device_params):
"""备份单台华为交换机配置"""
try:
# 建立SSH连接
        connection = ConnectHandler(**device_params)

# 关闭分页显示,确保能获取完整配置
        connection.send_command('screen-length 0 temporary')

# 执行备份命令
        output = connection.send_command('display current-configuration')

# 生成带时间戳的文件名
        timestamp = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')
        filename = f"backup_{device_params['host']}_{timestamp}.txt"

# 保存到本地
with open(filename, 'w', encoding='utf-8'as f:
            f.write(output)

        connection.disconnect()
        print(f"✅ {device_params['host']} 备份成功: {filename}")
returnTrue

except Exception as e:
        print(f"❌ {device_params['host']} 备份失败: {e}")
returnFalse

# 执行备份
if __name__ == '__main__':
    backup_single_device(device)

五、批量备份50台交换机——进阶篇

5.1 从文件读取设备列表

defread_devices_from_file(file_path):
"""从文本文件读取设备IP列表"""
    devices = []
with open(file_path, 'r'as f:
for line in f:
            ip = line.strip()
if ip andnot ip.startswith('#'):  # 跳过空行和注释行
                devices.append({
'device_type''huawei',
'host': ip,
'username''admin',
'password''Admin@123',
'port'22,
'timeout'60,
'session_timeout'60,
                })
return devices

5.2 批量备份(串行方式)

defbatch_backup_serial(devices, backup_dir='backups'):
"""串行批量备份(适合设备数量较少时)"""
# 创建备份目录
ifnot os.path.exists(backup_dir):
        os.makedirs(backup_dir)

    success_count = 0
    fail_count = 0
    fail_list = []

for device in devices:
        host = device['host']
try:
            connection = ConnectHandler(**device)
            connection.send_command('screen-length 0 temporary')
            output = connection.send_command('display current-configuration')

            timestamp = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')
            filename = os.path.join(backup_dir, f"{host}_{timestamp}.txt")

with open(filename, 'w', encoding='utf-8'as f:
                f.write(output)

            connection.disconnect()
            print(f"✅ {host} 备份成功")
            success_count += 1

except Exception as e:
            print(f"❌ {host} 备份失败: {e}")
            fail_count += 1
            fail_list.append(host)

# 输出统计结果
    print(f"\n📊 备份完成!成功: {success_count}台,失败: {fail_count}台")
if fail_list:
        print(f"失败设备: {fail_list}")

return success_count, fail_count, fail_list

注意:串行方式备份50台设备,每台假设需要30秒,总共需要约25分钟。如果对时间有更高要求,可以考虑并发方式。

六、并发批量备份——高级篇

对于50台交换机,使用并发可以大幅提升效率。但需要特别注意:并发数不宜过大,否则可能对网络和设备造成压力。建议并发数控制在5-10之间。

6.1 使用线程池实现并发备份

from concurrent.futures import ThreadPoolExecutor, as_completed
import threading

# 线程安全的计数器
classBackupCounter:
def__init__(self):
        self.success = 0
        self.fail = 0
        self.lock = threading.Lock()
        self.fail_list = []

defadd_success(self):
with self.lock:
            self.success += 1

defadd_fail(self, host):
with self.lock:
            self.fail += 1
            self.fail_list.append(host)

defbackup_one_device(device, backup_dir, counter):
"""备份单台设备(供线程池调用)"""
    host = device['host']
try:
        connection = ConnectHandler(**device)
        connection.send_command('screen-length 0 temporary')
        output = connection.send_command('display current-configuration')

        timestamp = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')
        filename = os.path.join(backup_dir, f"{host}_{timestamp}.txt")

with open(filename, 'w', encoding='utf-8'as f:
            f.write(output)

        connection.disconnect()
        print(f"✅ {host} 备份成功")
        counter.add_success()
returnTrue

except Exception as e:
        print(f"❌ {host} 备份失败: {e}")
        counter.add_fail(host)
returnFalse

defbatch_backup_concurrent(devices, backup_dir='backups', max_workers=5):
"""并发批量备份"""
# 创建备份目录
ifnot os.path.exists(backup_dir):
        os.makedirs(backup_dir)

    counter = BackupCounter()

# 使用线程池并发执行
with ThreadPoolExecutor(max_workers=max_workers) as executor:
        futures = {
            executor.submit(backup_one_device, device, backup_dir, counter): device
for device in devices
        }

# 等待所有任务完成
for future in as_completed(futures):
try:
                future.result()
except Exception as e:
                device = futures[future]
                print(f"⚠️ {device['host']} 任务异常: {e}")

# 输出统计结果
    print(f"\n📊 并发备份完成!成功: {counter.success}台,失败: {counter.fail}台")
if counter.fail_list:
        print(f"失败设备: {counter.fail_list}")

return counter.success, counter.fail, counter.fail_list

6.2 并发数的选择

  • max_workers=5:适合50台设备的场景,既提升了效率,又不会对网络造成过大压力
  • 备份50台设备,并发数为5时,理论上只需要串行时间的1/5,约5-8分钟即可完成

七、完整脚本示例

将以上模块整合成一个完整的脚本:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
华为交换机配置自动备份脚本
支持批量读取设备列表、并发备份、日志记录
"""


from netmiko import ConnectHandler
import datetime
import os
import sys
from concurrent.futures import ThreadPoolExecutor, as_completed
import threading
import logging

# 配置日志
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(levelname)s - %(message)s',
    handlers=[
        logging.FileHandler('backup.log'),
        logging.StreamHandler()
    ]
)
logger = logging.getLogger(__name__)

# ============ 配置区 ============
BACKUP_DIR = 'backups'# 备份文件存放目录
DEVICE_FILE = 'devices.txt'# 设备IP列表文件
MAX_WORKERS = 5# 并发数
USERNAME = 'admin'# SSH用户名
PASSWORD = 'Admin@123'# SSH密码
# ================================

classBackupCounter:
def__init__(self):
        self.success = 0
        self.fail = 0
        self.lock = threading.Lock()
        self.fail_list = []

defadd_success(self):
with self.lock:
            self.success += 1

defadd_fail(self, host):
with self.lock:
            self.fail += 1
            self.fail_list.append(host)

defread_devices(file_path):
"""读取设备列表"""
    devices = []
ifnot os.path.exists(file_path):
        logger.error(f"设备文件不存在: {file_path}")
return devices

with open(file_path, 'r'as f:
for line in f:
            ip = line.strip()
if ip andnot ip.startswith('#'):
                devices.append({
'device_type''huawei',
'host': ip,
'username': USERNAME,
'password': PASSWORD,
'port'22,
'timeout'60,
'session_timeout'60,
                })

    logger.info(f"读取到 {len(devices)} 台设备")
return devices

defbackup_device(device, backup_dir, counter):
"""备份单台设备"""
    host = device['host']
try:
        logger.info(f"开始备份 {host}")
        connection = ConnectHandler(**device)
        connection.send_command('screen-length 0 temporary')
        output = connection.send_command('display current-configuration')

        timestamp = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')
        filename = os.path.join(backup_dir, f"{host}_{timestamp}.txt")

with open(filename, 'w', encoding='utf-8'as f:
            f.write(output)

        connection.disconnect()
        logger.info(f"✅ {host} 备份成功")
        counter.add_success()
returnTrue

except Exception as e:
        logger.error(f"❌ {host} 备份失败: {e}")
        counter.add_fail(host)
returnFalse

defmain():
"""主函数"""
# 创建备份目录
ifnot os.path.exists(BACKUP_DIR):
        os.makedirs(BACKUP_DIR)
        logger.info(f"创建备份目录: {BACKUP_DIR}")

# 读取设备列表
    devices = read_devices(DEVICE_FILE)
ifnot devices:
        logger.error("没有可用的设备,程序退出")
        sys.exit(1)

    logger.info(f"开始批量备份,共 {len(devices)} 台设备,并发数: {MAX_WORKERS}")
    start_time = datetime.datetime.now()

    counter = BackupCounter()

# 并发执行备份
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
        futures = {
            executor.submit(backup_device, device, BACKUP_DIR, counter): device
for device in devices
        }
for future in as_completed(futures):
try:
                future.result()
except Exception as e:
                device = futures[future]
                logger.error(f"⚠️ {device['host']} 任务异常: {e}")

# 统计结果
    elapsed = (datetime.datetime.now() - start_time).total_seconds()
    logger.info(f"\n{'='*50}")
    logger.info(f"📊 备份完成!")
    logger.info(f"   总设备数: {len(devices)} 台")
    logger.info(f"   成功: {counter.success} 台")
    logger.info(f"   失败: {counter.fail} 台")
if counter.fail_list:
        logger.info(f"   失败设备: {', '.join(counter.fail_list)}")
    logger.info(f"   耗时: {elapsed:.2f} 秒")
    logger.info(f"{'='*50}")

if __name__ == '__main__':
    main()

八、部署为定时任务

备份应该定期执行,而不是只在需要时手动运行。

Windows系统——任务计划程序

  1. 打开“任务计划程序”
  2. 创建基本任务,设置触发器为每天凌晨1点
  3. 操作选择“启动程序”,填入:
    • 程序:python.exe
    • 参数:脚本的完整路径

Linux系统——Cron定时任务

在终端执行 crontab -e,添加以下行:

# 每天凌晨1点执行备份
0 1 * * * /usr/bin/python3 /path/to/backup_script.py >> /var/log/backup.log 2>&1

九、注意事项与最佳实践

9.1 安全建议

  • 不要将密码明文写在脚本中:建议使用环境变量或加密的配置文件存储敏感信息
  • 使用专用账号:为自动化脚本创建独立的SSH账号,权限最小化
  • 定期更换密码:配合企业的密码管理策略

9.2 网络与性能

  • 控制并发数:建议并发数不超过10,避免对交换机CPU造成过大压力
  • 设置合理的超时时间:Netmiko默认连接超时只有10秒,建议调整为60秒以上
  • 先测试后上线:建议先用1-2台测试交换机验证脚本,确认无误后再批量执行

9.3 备份文件管理

  • 建议使用版本控制:将备份目录纳入Git管理,便于追踪配置变更历史
  • 定期清理旧备份:避免备份文件无限增长占用磁盘空间
  • 备份文件命名规范:建议格式为 {IP}_{日期时间}.txt,便于检索

十、总结

通过Python + Netmiko的组合,50台华为交换机的配置备份可以从4个多小时的手工劳动,缩短到几分钟的自动化执行。本文提供的脚本已经包含了从设备读取、并发备份到日志记录和错误处理的完整功能,你可以直接复制使用,并根据实际环境调整配置参数。

自动化运维的价值不仅在于节省时间,更在于消除人为失误实现标准化操作建立可追溯的配置变更历史。当你把双手从重复的CLI操作中解放出来,就能把更多精力投入到更有价值的网络设计和优化工作中去。

添加小编微信

备注来源:岗位+昵称(例如:网络工程师+猪八戒)

网络工程师必备的10款利器  没有的抓紧备上

2026-06-23

常用的100个网络端口整理,请收藏~

2026-06-18

网络工程师  未来的发展方向有哪些?你认可吗

2026-06-17

除了本职工作以外,网络工程师还得靠什么赚的钱?

2026-06-16

网络工程师讲故事

2026-06-15

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 05:22:23 HTTP/2.0 GET : https://f.mffb.com.cn/a/501409.html
  2. 运行时间 : 0.397978s [ 吞吐率:2.51req/s ] 内存消耗:4,657.33kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=890467145239fdcc1a39962b26e53025
  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.000659s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000781s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.003999s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.006575s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000569s ]
  6. SELECT * FROM `set` [ RunTime:0.000214s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000627s ]
  8. SELECT * FROM `article` WHERE `id` = 501409 LIMIT 1 [ RunTime:0.010861s ]
  9. UPDATE `article` SET `lasttime` = 1783027343 WHERE `id` = 501409 [ RunTime:0.046847s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.014710s ]
  11. SELECT * FROM `article` WHERE `id` < 501409 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.010703s ]
  12. SELECT * FROM `article` WHERE `id` > 501409 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.010567s ]
  13. SELECT * FROM `article` WHERE `id` < 501409 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.052261s ]
  14. SELECT * FROM `article` WHERE `id` < 501409 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.026202s ]
  15. SELECT * FROM `article` WHERE `id` < 501409 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.044890s ]
0.402641s