当前位置:首页>Linux>字节跳动笔试重点题:嵌入式Linux下的I2C设备驱动与温湿度传感器数据读取

字节跳动笔试重点题:嵌入式Linux下的I2C设备驱动与温湿度传感器数据读取

  • 2026-03-23 20:14:48
字节跳动笔试重点题:嵌入式Linux下的I2C设备驱动与温湿度传感器数据读取

大家好,我是一个爱分享的牛马程序员,工作中碰到,加上自己理解,很高兴给大家分享。

-begin-

题目:在嵌入式Linux系统中,编写一个I2C设备驱动及应用程序,实现以下功能:

1.驱动层:支持I2C温湿度传感器(假设型号为SHT30,I2C地址0x44),实现设备探测、初始化及数据读取函数;
2.应用层:通过设备文件(如/dev/sht30)读取传感器数据,打印温度(℃)和湿度(%RH);
3.驱动需支持动态加载,且能正确处理I2C通信错误。

详细分析过程

一、核心考点拆解

本题是字节跳动嵌入式Linux岗位笔试的重点题,主要考察:

I2C驱动框架(i2c_driver结构体、probe/remove函数);
I2C设备通信(i2c_transfer发送命令、读取数据);
字符设备接口(file_operations实现read方法,向应用层返回数据);
传感器数据解析(根据SHT30数据格式转换温度和湿度值)。

二、关键设计思路

4.驱动层设计
I2C驱动注册:定义i2c_driver结构体,指定支持的设备ID(SHT30的I2C地址0x44),实现probe(设备探测成功时初始化)和remove(设备移除时清理)函数;
传感器初始化:在probe函数中,通过i2c_transfer发送SHT30初始化命令(如软复位),确保传感器进入正常工作模式;
数据读取逻辑:实现read方法,向传感器发送“读取数据”命令,接收6字节响应(温度高8位、温度低8位、温度校验位、湿度高8位、湿度低8位、湿度校验位);
错误处理:对i2c_transfer返回值判断,通信失败时返回错误码(如-EIO)。
5.应用层设计
打开/dev/sht30设备文件,调用read函数读取数据(缓冲区至少8字节,存储温度和湿度的浮点值);
解析读取到的温度和湿度,格式化打印(保留2位小数);
处理read返回的错误(如设备未就绪时重试)。
6.数据解析
SHT30温度计算公式:温度(℃) = (温度原始值 / 65535.0) * 175.0 - 45.0
湿度计算公式:湿度(%RH) = (湿度原始值 / 65535.0) * 100.0
原始值由接收的2字节数据拼接而成(高8位<<8 | 低8位)。

三、代码实现

1. 驱动代码(sht30_drv.c)

#include <linux/init.h>

#include <linux/module.h>

#include <linux/i2c.h>

#include <linux/fs.h>

#include <linux/cdev.h>

#include <linux/uaccess.h>

#include <linux/device.h>

#define SHT30_ADDR 0x44        // SHT30 I2C地址

#define DEV_NAME "sht30"       // 设备名

#define DEV_COUNT 1            // 设备数量

// 命令定义

#define SHT30_SOFT_RESET 0x30A2  // 软复位命令

#define SHT30_READ_DATA 0x2400   // 读取数据命令

// 设备结构体

struct sht30_dev {

   struct i2c_client *client;  // I2C客户端

   struct cdev cdev;           // 字符设备

   dev_t devno;                // 设备号

   struct class *class;        // 设备类

};

static struct sht30_dev *sht30_device;

// SHT30发送命令

static int sht30_send_cmd(struct i2c_client *client, uint16_t cmd) {

   uint8_t buf[2] = {cmd >> 8, cmd & 0xFF};  // 命令分高8位和低8位

   struct i2c_msg msg = {

       .addr = client->addr,

       .flags = 0,  // 写操作

       .len = 2,

       .buf = buf

   };

   return i2c_transfer(client->adapter, &msg, 1);  // 发送1条消息

}

// 读取温湿度数据

static int sht30_read_data(struct i2c_client *client, float *temp, float *hum) {

   uint8_t data[6];  // 存储接收的6字节数据

   struct i2c_msg msg = {

       .addr = client->addr,

       .flags = I2C_M_RD,  // 读操作

       .len = 6,

       .buf = data

   };

   int ret;

   // 发送读取命令

   ret = sht30_send_cmd(client, SHT30_READ_DATA);

   if (ret != 1) {  // i2c_transfer成功返回消息数

       dev_err(&client->dev, "send read cmd failed: %d\n", ret);

       return -EIO;

   }

   // 等待传感器准备数据(约10ms)

   msleep(10);

   // 读取数据

   ret = i2c_transfer(client->adapter, &msg, 1);

   if (ret != 1) {

       dev_err(&client->dev, "read data failed: %d\n", ret);

       return -EIO;

   }

   // 解析温度(前2字节)

   uint16_t temp_raw = (data[0] << 8) | data[1];

   *temp = (temp_raw / 65535.0f) * 175.0f - 45.0f;

   // 解析湿度(中间2字节,跳过第3字节校验位)

   uint16_t hum_raw = (data[3] << 8) | data[4];

   *hum = (hum_raw / 65535.0f) * 100.0f;

   return 0;

}

// 字符设备read方法

static ssize_t sht30_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos) {

   struct sht30_dev *dev = filp->private_data;

   float temp, hum;

   char kernel_buf[32];  // 存储格式化后的字符串

   int ret;

   // 读取传感器数据

   ret = sht30_read_data(dev->client, &temp, &hum);

   if (ret) {

       return ret;

   }

   // 格式化数据(温度+湿度)

   snprintf(kernel_buf, sizeof(kernel_buf), "%.2f,%.2f\n", temp, hum);

   // 拷贝到用户空间

   if (copy_to_user(buf, kernel_buf, strlen(kernel_buf)) != 0) {

       return -EFAULT;

   }

   return strlen(kernel_buf);

}

// 文件操作结构体

static const struct file_operations sht30_fops = {

   .owner = THIS_MODULE,

   .read = sht30_read,

};

// 设备探测函数

static int sht30_probe(struct i2c_client *client, const struct i2c_device_id *id) {

   int ret;

   // 分配设备结构体内存

   sht30_device = devm_kzalloc(&client->dev, sizeof(struct sht30_dev), GFP_KERNEL);

   if (!sht30_device) {

       return -ENOMEM;

   }

   // 初始化设备结构体

   sht30_device->client = client;

   i2c_set_clientdata(client, sht30_device);

   // 申请设备号

   ret = alloc_chrdev_region(&sht30_device->devno, 0, DEV_COUNT, DEV_NAME);

   if (ret) {

       dev_err(&client->dev, "alloc chrdev failed: %d\n", ret);

       return ret;

   }

   // 初始化字符设备

   cdev_init(&sht30_device->cdev, &sht30_fops);

   sht30_device->cdev.owner = THIS_MODULE;

   ret = cdev_add(&sht30_device->cdev, sht30_device->devno, DEV_COUNT);

   if (ret) {

       dev_err(&client->dev, "cdev add failed: %d\n", ret);

       unregister_chrdev_region(sht30_device->devno, DEV_COUNT);

       return ret;

   }

   // 创建设备类

   sht30_device->class = class_create(THIS_MODULE, DEV_NAME);

   if (IS_ERR(sht30_device->class)) {

       dev_err(&client->dev, "class create failed\n");

       cdev_del(&sht30_device->cdev);

       unregister_chrdev_region(sht30_device->devno, DEV_COUNT);

       return PTR_ERR(sht30_device->class);

   }

   // 创建设备节点

   device_create(sht30_device->class, &client->dev, sht30_device->devno, NULL, DEV_NAME);

   // 传感器软复位

   ret = sht30_send_cmd(client, SHT30_SOFT_RESET);

   if (ret != 1) {

       dev_err(&client->dev, "soft reset failed: %d\n", ret);

       // 此处简化处理,实际应清理资源

   }

   msleep(10);  // 复位后等待稳定

   dev_info(&client->dev, "sht30 probe success\n");

   return 0;

}

// 设备移除函数

static int sht30_remove(struct i2c_client *client) {

   struct sht30_dev *dev = i2c_get_clientdata(client);

   // 销毁设备节点

   device_destroy(dev->class, dev->devno);

   // 销毁设备类

   class_destroy(dev->class);

   // 移除字符设备

   cdev_del(&dev->cdev);

   // 释放设备号

   unregister_chrdev_region(dev->devno, DEV_COUNT);

   dev_info(&client->dev, "sht30 remove success\n");

   return 0;

}

// 支持的设备ID表

static const struct i2c_device_id sht30_id[] = {

   {DEV_NAME, 0},

   {}

};

MODULE_DEVICE_TABLE(i2c, sht30_id);

// I2C驱动结构体

static struct i2c_driver sht30_driver = {

   .driver = {

       .name = DEV_NAME,

       .owner = THIS_MODULE,

   },

   .probe = sht30_probe,

   .remove = sht30_remove,

   .id_table = sht30_id,

};

module_i2c_driver(sht30_driver);

MODULE_LICENSE("GPL");

MODULE_AUTHOR("牛马程序员");

MODULE_DESCRIPTION("SHT30 I2C Temperature and Humidity Sensor Driver");

2. 应用层代码(sht30_app.c)

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <unistd.h>

#include <fcntl.h>

#define DEV_PATH "/dev/sht30"  // 设备文件路径

int main() {

   int fd;

   char buf[32];

   float temp, hum;

   int ret;

   // 打开设备文件

   fd = open(DEV_PATH, O_RDONLY);

   if (fd == -1) {

       perror("open failed");

       return -1;

   }

   printf("开始读取温湿度数据(按Ctrl+C退出)...\n");

   while (1) {

       // 读取数据

       ret = read(fd, buf, sizeof(buf) - 1);

       if (ret <= 0) {

           perror("read failed");

           sleep(1);

           continue;

       }

       buf[ret] = '\0';

       // 解析温度和湿度(格式:"temp,hum")

       if (sscanf(buf, "%f,%f", &temp, &hum) != 2) {

           printf("数据解析失败: %s\n", buf);

           sleep(1);

           continue;

       }

       // 打印结果

       printf("温度: %.2f℃, 湿度: %.2f%%RH\n", temp, hum);

       sleep(2);  // 每2秒读取一次

   }

   close(fd);

   return 0;

}

四、代码解析与考点总结

7.驱动层核心
i2c_driver结构体是I2C驱动的核心,probe函数在设备匹配时被调用,完成初始化(申请设备号、创建设备节点等);
i2c_transfer是I2C通信的关键函数,通过i2c_msg结构体描述消息(地址、读写标志、长度、数据),支持多消息传输;
字符设备接口file_operationsread方法实现数据读取,将传感器数据格式化后通过copy_to_user拷贝到用户空间。
8.数据解析要点
SHT30返回的原始数据为16位无符号整数,需按公式转换为实际物理量;
通信时需注意命令和数据的字节序(SHT30使用大端模式,与多数嵌入式系统一致)。
9.易错点
I2C地址需确认(SHT30可能有0x44或0x45,取决于硬件引脚);
i2c_transfer返回值为成功传输的消息数,而非字节数,需判断是否等于发送的消息数;
传感器操作后需预留足够的延迟时间(如复位后等待10ms),否则读取数据可能失败。
10.字节跳动考点延伸:面试中可能追问“如何实现I2C设备的多实例支持?”——需在probe函数中为每个设备分配独立结构体,使用devno区分;或问“如何处理I2C总线错误(如断线)?”——可在read方法中增加重试机制,超过次数后返回错误。

I2C是嵌入式系统中常用的低速通信总线,字节跳动等大厂重视对设备驱动框架和硬件交互细节的掌握,本题覆盖了从驱动注册到数据解析的全流程,对理解外设驱动开发具有重要意义。

-end-

如果文章对你有提升,帮忙点赞,分享,关注。十分感谢

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 14:46:01 HTTP/2.0 GET : https://f.mffb.com.cn/a/482249.html
  2. 运行时间 : 0.129920s [ 吞吐率:7.70req/s ] 内存消耗:4,684.72kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=367d2c6100e157f7ed658536a22caebe
  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.000638s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000811s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000325s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000285s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000495s ]
  6. SELECT * FROM `set` [ RunTime:0.000201s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000599s ]
  8. SELECT * FROM `article` WHERE `id` = 482249 LIMIT 1 [ RunTime:0.001546s ]
  9. UPDATE `article` SET `lasttime` = 1774593962 WHERE `id` = 482249 [ RunTime:0.019083s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000887s ]
  11. SELECT * FROM `article` WHERE `id` < 482249 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001242s ]
  12. SELECT * FROM `article` WHERE `id` > 482249 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001079s ]
  13. SELECT * FROM `article` WHERE `id` < 482249 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002091s ]
  14. SELECT * FROM `article` WHERE `id` < 482249 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001963s ]
  15. SELECT * FROM `article` WHERE `id` < 482249 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.015869s ]
0.133453s