当前位置:首页>Linux>用 AI 生成 Linux 驱动代码:效率提升 300% 的实战技巧

用 AI 生成 Linux 驱动代码:效率提升 300% 的实战技巧

  • 2026-04-19 11:23:54
用 AI 生成 Linux 驱动代码:效率提升 300% 的实战技巧

文章关键词:AI 代码生成、Linux 驱动、GitHub Copilot、提示词工程、效率提升


从一周到一天,传统 Linux 驱动开发:

  • 阅读芯片手册:2天
  • 编写代码:3天
  • 调试测试:2天
  • 总计:1周

AI 辅助驱动开发:

  • AI 生成代码:2小时
  • 人工审查修改:4小时
  • 调试测试:1天
  • 总计:1.5天 效率提升:300%+

本文将分享实战技巧,教你如何用 AI 高效生成 Linux 驱动代码。


一、AI 驱动开发的核心方法论

1.1 不是替代,是增强

错误认知: AI 能一次性写出完美驱动

正确认知: AI 生成框架,人工完善细节

工作流程:

芯片手册 → AI生成初稿 → 人工审查 → 修改完善 → 测试验证   ↓           ↓           ↓          ↓          ↓ 2天         2小时        2小时      2小时      1天

1.2 提示词工程(Prompt Engineering)

好的提示词 = 上下文 + 约束 + 示例

模板结构

【角色】你是一个经验丰富的 Linux 驱动工程师

【任务】为 [芯片型号] 编写 [驱动类型] 驱动

【硬件信息】

  • 芯片型号: XXX
  • 接口类型: I2C/SPI/USB
  • 寄存器地址: 0xXX
  • 主要功能: [功能描述]

【要求】

  • 使用 Linux 内核[版本]API
  • 包含 [功能列表]
  • 错误处理完善
  • 符合内核编码规范

【输出格式】 完整的 C 代码,包含注释


二、实战案例:I2C 传感器驱动

2.1 芯片信息

BMP280 温度/压力传感器

  • I2C 地址:0x76
  • 寄存器:
    • ID 寄存器:0xD0(值应为0x58)
    • 控制寄存器:0xF4
    • 数据寄存器:0xF7(压力),0xFA(温度)
  • 校准参数:0x88开始,24字节

2.2 提示词设计

【角色】你是 Linux 内核驱动专家,熟悉 I2C 子系统和硬件传感器驱动开发

【任务】编写 BMP280 温度压力传感器的 I2C 驱动

【硬件规格】

  • I2C地址:0x76
  • 芯片ID寄存器:0xD0,预期值 0x58
  • 校准数据寄存器:0x88,长度 24 字节
  • 温度数据寄存器:0xFA,3 字节
  • 压力数据寄存器:0xF7,3 字节
  • 控制寄存器:0xF4

【功能要求】

  1. 实现 probe 函数,读取芯片 ID 并验证
  2. 读取校准数据并保存
  3. 实现温度读取函数,返回摄氏度
  4. 实现压力读取函数,返回帕斯卡
  5. 实现sysfs接口,用户空间可读取数据
  6. 包含温度补偿算法(使用校准数据)

【技术要求】

  • 使用 regmap API
  • 使用标准的 Linux 驱动框架
  • 包含错误处理
  • 代码符合内核编码规范
  • 添加详细的中文注释

【输出】完整的驱动代码,包含 Makefile 和测试程序

2.3 AI 生成代码

/* * BMP280温度压力传感器驱动 * 使用regmap API访问I2C接口 */#include <linux/module.h>#include <linux/i2c.h>#include <linux/regmap.h>#include <linux/sysfs.h>/* 寄存器定义 */#define BMP280_REG_ID                0xD0#define BMP280_REG_RESET        0xE0#define BMP280_REG_STATUS        0xF3#define BMP280_REG_CTRL_MEAS        0xF4#define BMP280_REG_CONFIG        0xF5#define BMP280_REG_PRESS_MSB        0xF7#define BMP280_REG_TEMP_MSB        0xFA#define BMP280_REG_CALIB        0x88#define BMP280_CHIP_ID                0x58/* 校准数据结构 */struct bmp280_calib {        u16 dig_T1;        s16 dig_T2, dig_T3;        u16 dig_P1;        s16 dig_P2, dig_P3, dig_P4, dig_P5;        s16 dig_P6, dig_P7, dig_P8, dig_P9;};/* 设备数据结构 */struct bmp280_data {        struct i2c_client *client;        struct regmap *regmap;        struct bmp280_calib calib;        s32 t_fine;};/* * 读取校准数据 * 从0x88寄存器读取24字节校准参数 */static int bmp280_read_calib(struct bmp280_data *data){        u8 calib_raw[24];        int ret;        ret = regmap_bulk_read(data->regmap, BMP280_REG_CALIB,                                calib_raw, sizeof(calib_raw));if (ret < 0)return ret;        /* 解析校准数据(小端格式) */        data->calib.dig_T1 = (calib_raw[1] << 8) | calib_raw[0];        data->calib.dig_T2 = (calib_raw[3] << 8) | calib_raw[2];        data->calib.dig_T3 = (calib_raw[5] << 8) | calib_raw[4];        data->calib.dig_P1 = (calib_raw[7] << 8) | calib_raw[6];        data->calib.dig_P2 = (calib_raw[9] << 8) | calib_raw[8];        data->calib.dig_P3 = (calib_raw[11] << 8) | calib_raw[10];        data->calib.dig_P4 = (calib_raw[13] << 8) | calib_raw[12];        data->calib.dig_P5 = (calib_raw[15] << 8) | calib_raw[14];        data->calib.dig_P6 = (calib_raw[17] << 8) | calib_raw[16];        data->calib.dig_P7 = (calib_raw[19] << 8) | calib_raw[18];        data->calib.dig_P8 = (calib_raw[21] << 8) | calib_raw[20];        data->calib.dig_P9 = (calib_raw[23] << 8) | calib_raw[22];return 0;}/* * 温度补偿计算 * 使用BMP280官方算法 */static s32 bmp280_compensate_temp(struct bmp280_data *data, s32 adc_T){        s32 var1, var2, T;        var1 = ((((adc_T >> 3) - ((s32)data->calib.dig_T1 << 1))) *                 ((s32)data->calib.dig_T2)) >> 11;        var2 = (((((adc_T >> 4) - ((s32)data->calib.dig_T1)) *                   ((adc_T >> 4) - ((s32)data->calib.dig_T1))) >> 12) *                 ((s32)data->calib.dig_T3)) >> 14;        data->t_fine = var1 + var2;        T = (data->t_fine * 5 + 128) >> 8;return T;  /* 返回0.01°C单位 */}/* * 读取温度 * 返回摄氏度(带一位小数) */static int bmp280_read_temp(struct bmp280_data *data, int *temp){        u8 tmp[3];        s32 adc_T, compensated;        int ret;        /* 读取原始温度数据(20位) */        ret = regmap_bulk_read(data->regmap, BMP280_REG_TEMP_MSB, tmp, 3);if (ret < 0)return ret;        adc_T = (tmp[0] << 12) | (tmp[1] << 4) | (tmp[2] >> 4);        /* 温度补偿 */        compensated = bmp280_compensate_temp(data, adc_T);        /* 转换为摄氏度(带一位小数) */        *temp = compensated / 10;return 0;}/* * 压力补偿计算(简化版) */static u32 bmp280_compensate_press(struct bmp280_data *data, s32 adc_P){        s64 var1, var2, p;        var1 = ((s64)data->t_fine) - 128000;        var2 = var1 * var1 * (s64)data->calib.dig_P6;        var2 = var2 + ((var1 * (s64)data->calib.dig_P5) << 17);        var2 = var2 + (((s64)data->calib.dig_P4) << 35);        var1 = ((var1 * var1 * (s64)data->calib.dig_P3) >> 8) +               ((var1 * (s64)data->calib.dig_P2) << 12);        var1 = (((((s64)1) << 47) + var1)) * ((s64)data->calib.dig_P1) >> 33;if (var1 == 0)return 0;        p = 1048576 - adc_P;        p = (((p << 31) - var2) * 3125) / var1;        var1 = (((s64)data->calib.dig_P9) * (p >> 13) * (p >> 13)) >> 25;        var2 = (((s64)data->calib.dig_P8) * p) >> 19;        p = ((p + var1 + var2) >> 8) + (((s64)data->calib.dig_P7) << 4);return (u32)p;}/* * 读取压力 * 返回帕斯卡 */static int bmp280_read_press(struct bmp280_data *data, u32 *press){        u8 tmp[3];        s32 adc_P;        u32 compensated;        int ret;        ret = regmap_bulk_read(data->regmap, BMP280_REG_PRESS_MSB, tmp, 3);if (ret < 0)return ret;        adc_P = (tmp[0] << 12) | (tmp[1] << 4) | (tmp[2] >> 4);        compensated = bmp280_compensate_press(data, adc_P);        /* 转换为Pa */        *press = compensated / 256;return 0;}/* * sysfs接口:读取温度 */static ssize_t temp_show(struct device *dev,                          struct device_attribute *attr, char *buf){        struct bmp280_data *data = dev_get_drvdata(dev);        int temp, ret;        ret = bmp280_read_temp(data, &temp);if (ret < 0)return ret;return sprintf(buf, "%d.%d\n", temp / 10, abs(temp % 10));}static DEVICE_ATTR(temp, S_IRUGO, temp_show, NULL);/* * sysfs接口:读取压力 */static ssize_t press_show(struct device *dev,                          struct device_attribute *attr, char *buf){        struct bmp280_data *data = dev_get_drvdata(dev);        u32 press;        int ret;        ret = bmp280_read_press(data, &press);if (ret < 0)return ret;return sprintf(buf, "%u\n", press);}static DEVICE_ATTR(press, S_IRUGO, press_show, NULL);static struct attribute *bmp280_attrs[] = {        &dev_attr_temp.attr,        &dev_attr_press.attr,        NULL,};static struct attribute_group bmp280_attr_group = {        .attrs = bmp280_attrs,};/* * 设备探测函数 */static int bmp280_probe(struct i2c_client *client){        struct bmp280_data *data;        unsigned int chip_id;        int ret;        data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);if (!data)return -ENOMEM;        data->client = client;        i2c_set_clientdata(client, data);        /* 初始化regmap */        data->regmap = devm_regmap_init_i2c(client, &bmp280_regmap_config);if (IS_ERR(data->regmap))return PTR_ERR(data->regmap);        /* 读取并验证芯片ID */        ret = regmap_read(data->regmap, BMP280_REG_ID, &chip_id);if (ret < 0)return ret;if (chip_id != BMP280_CHIP_ID) {                dev_err(&client->dev, "Invalid chip ID: 0x%x\n", chip_id);return -ENODEV;        }        /* 读取校准数据 */        ret = bmp280_read_calib(data);if (ret < 0)return ret;        /* 配置测量模式 */        ret = regmap_write(data->regmap, BMP280_REG_CTRL_MEAS, 0x27);if (ret < 0)return ret;        /* 创建sysfs接口 */        ret = sysfs_create_group(&client->dev.kobj, &bmp280_attr_group);if (ret < 0)return ret;        dev_info(&client->dev, "BMP280 sensor initialized\n");return 0;}/* * 设备移除函数 */static void bmp280_remove(struct i2c_client *client){        sysfs_remove_group(&client->dev.kobj, &bmp280_attr_group);}/* regmap配置 */static const struct regmap_config bmp280_regmap_config = {        .reg_bits = 8,        .val_bits = 8,};/* 设备ID表 */static const struct i2c_device_id bmp280_id[] = {        { "bmp280", 0 },        { }};MODULE_DEVICE_TABLE(i2c, bmp280_id);/* 驱动结构体 */static struct i2c_driver bmp280_driver = {        .driver = {                .name        = "bmp280",        },        .probe                = bmp280_probe,        .remove                = bmp280_remove,        .id_table        = bmp280_id,};module_i2c_driver(bmp280_driver);MODULE_AUTHOR("Your Name");MODULE_DESCRIPTION("BMP280 temperature and pressure sensor driver");MODULE_LICENSE("GPL");

2.4 人工完善要点

AI 生成的代码需要检查:

  1. 寄存器地址 ✅ 正确
  2. 算法实现 ✅ 需要验证补偿公式
  3. 错误处理 ⚠️ 需要补充更多错误检查
  4. 并发安全 ⚠️ 需要加锁保护
  5. 电源管理 ❌ 需要添加 suspend/resume

修改后的关键部分:

/* 添加互斥锁保护 */struct bmp280_data {    struct i2c_client *client;    struct regmap *regmap;    struct bmp280_calib calib;    s32 t_fine;    struct mutex lock;  // 添加锁};/* 读取时加锁 */static int bmp280_read_temp(struct bmp280_data *data, int *temp){    int ret;    mutex_lock(&data->lock);    ret = __bmp280_read_temp(data, temp);    mutex_unlock(&data->lock);return ret;}

三、效率提升技巧

3.1 提示词模板库

模板1:字符设备驱动

为 [设备名] 编写 Linux 字符设备驱动

功能: [功能列表]

接口: [read/write/ioctl/mmap]

缓冲区: [大小]

并发: [支持并发数]

模板2:平台设备驱动

为 [芯片型号] 编写平台设备驱动

资源: [内存地址/中断号]

功能: [功能描述]

电源管理: [是否需要]

模板3:总线设备驱动

为 [总线类型] 设备 [芯片型号] 编写驱动

协议: [I2C/SPI/USB]

寄存器: [关键寄存器列表]

功能: [功能描述]

3.2 迭代优化流程

第1轮: 生成框架    ↓ 检查框架完整性第2轮: 补充功能    ↓ 检查功能正确性第3轮: 添加错误处理    ↓ 检查健壮性第4轮: 优化性能    ↓ 检查性能指标第5轮: 添加注释文档    ↓ 最终审查发布

3.3 常见错误及修正


四、效率对比数据

4.1 实际项目统计

4.2 时间分配对比

传统开发:

  • 查资料: 30%
  • 写代码: 40%
  • 调试: 30%

AI辅助开发:

  • 写提示词: 10%
  • AI生成: 10%
  • 审查修改: 30%
  • 调试: 50% 关键: 调试时间不变,但写代码时间大幅减少

五、最佳实践总结

5.1 DO(要做)

✅ 提供详细的硬件规格

✅ 明确功能需求

✅ 分步骤生成复杂驱动

✅ 人工审查所有代码

✅ 充分测试验证

✅ 添加详细注释

5.2 DON'T(不要做)

❌ 直接复制 AI 代码到生产环境

❌ 不做审查直接使用

❌ 忽视错误处理

❌ 忽略并发安全

❌ 不做性能测试


六、进阶技巧

6.1 批量生成框架

场景: 需要为 10 个类似传感器写驱动

方法:

  1. 为第一个写详细提示词
  2. AI生成完整驱动
  3. 人工审查完善,作为模板
  4. 修改提示词中的芯片型号和寄存器
  5. 批量生成其余 9 个
  6. 统一审查修改

效率: 10 个驱动从 1 个月缩短到 1 周

6.2 代码审查清单

□ 框架完整性

□ 错误处理完善

□ 内存安全

□ 并发安全

□ 电源管理

□ 性能优化

□ 编码规范

□ 注释文档


七、总结

7.1 核心观点

AI 是强大的助手,但不是万能的。

它能帮你:

✅ 快速生成代码框架

✅ 减少重复劳动

✅ 加速学习过程

它不能替代你:

❌ 理解硬件原理

❌ 保证代码正确

❌ 承担工程责任

7.2 效率提升公式

效率提升 = (人工写代码时间 - AI生成时间) / 调试时间

传统: (5天 - 0天) / 2天 = 2.5倍

AI辅助: (1天 - 0天) / 2天 = 0.5倍 → 但总时间从7天降到3天

实际效率提升:200-300%

7.3 行动建议

立即开始:

  1. 选择 GitHub Copilot 或 claude opus 4.6
  2. 从简单驱动开始尝试
  3. 建立自己的提示词模板库
  4. 总结经验,持续优化

记住: 工具再强大,也替代不了你的专业判断和工程经验。


作者简介:GitHub Copilot 重度用户,用 AI 辅助开发了 20+ Linux 驱动,20+ 嵌入式 skills。相信 AI 是效率倍增器,不是替代品。

互动话题:你用 AI 生成过驱动代码吗?效率提升多少?欢迎大家加群一起分享 AI 经验。

群满后,可以在公众号后台加博主微信拉进群。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-19 21:14:10 HTTP/2.0 GET : https://f.mffb.com.cn/a/485112.html
  2. 运行时间 : 0.185406s [ 吞吐率:5.39req/s ] 内存消耗:4,647.09kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=d2c1f2be1926f640d93c897834dca0d3
  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.000973s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001531s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000724s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000692s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001376s ]
  6. SELECT * FROM `set` [ RunTime:0.004694s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001465s ]
  8. SELECT * FROM `article` WHERE `id` = 485112 LIMIT 1 [ RunTime:0.005946s ]
  9. UPDATE `article` SET `lasttime` = 1776604450 WHERE `id` = 485112 [ RunTime:0.002137s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000640s ]
  11. SELECT * FROM `article` WHERE `id` < 485112 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000978s ]
  12. SELECT * FROM `article` WHERE `id` > 485112 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001732s ]
  13. SELECT * FROM `article` WHERE `id` < 485112 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.004926s ]
  14. SELECT * FROM `article` WHERE `id` < 485112 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.024143s ]
  15. SELECT * FROM `article` WHERE `id` < 485112 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.011391s ]
0.189171s