当前位置:首页>鸿蒙APP>鸿蒙 ArkTS 分布式设备管理实战:从发现设备到跨端协同全攻略

鸿蒙 ArkTS 分布式设备管理实战:从发现设备到跨端协同全攻略

  • 2026-05-22 00:49:48
鸿蒙 ArkTS 分布式设备管理实战:从发现设备到跨端协同全攻略

鸿蒙 ArkTS 分布式设备管理实战:从发现设备到跨端协同全攻略

前言

2026 年,鸿蒙 NEXT 的分布式能力已经成为中高端应用的标配。想象一下:手机扫码、平板预览、手表震动——三个设备无缝接力完成一个任务。这种「设备合体」体验,正是分布式设备管理带来的革命。

但很多开发者在实际项目中遇到这些问题:

  • 设备发现失败,DiscoveryAgent 怎么配都不生效
  • 跨设备调用报 401/116 错误,不知道哪里配错了
  • 想做一个"手机控制电视"的 demo,却不知道从哪下手

今天这篇文章,用一个智能家居控制中枢的完整实战,带你彻底搞懂鸿蒙的分布式设备管理。


一、分布式架构核心概念

1.1 设备管理三层架构

鸿蒙的分布式设备管理分为三层:

层级
组件
职责
设备发现层
DeviceManager
发现周围可信设备
分布式数据层
DistributedData
跨设备数据同步
分布式任务层
DistributedSchedule
跨设备任务流转

本文聚焦设备发现层,这是所有分布式能力的基础。

1.2 设备类型与权限体系

// 设备类型枚举enum DeviceType {  DEVICE_TYPE_PHONE = 0x00,      // 手机  DEVICE_TYPE_TABLET = 0x01,      // 平板  DEVICE_TYPE_TV = 0x02,          // 智慧屏  DEVICE_TYPE_Wearable = 0x06,    // 智能手表  DEVICE_TYPE_CAR = 0x09,         // 车机  DEVICE_TYPE_OTHER = 0xFF        // 其他设备}// 设备可信状态enum TrustDeviceFlag {  FLAG_DEFAULT = 0,        // 仅同华为账号设备  FLAG_ABILITY = 1,        // 同应用设备  FLAG_ALL = 2             // 所有设备}

关键点:分布式能力需要设备间建立信任关系。同华为账号自动信任,同应用通过 bindTarget 建立临时信任。


二、项目实战:智能家居控制中枢

2.1 项目结构

entry/src/main/ets/├── entryability/   └── EntryAbility.ets          // 应用入口├── pages/   └── Index.ets                 // 主控制页面├── model/   ├── DeviceManager.ts          // 设备管理封装   ├── HomeDevice.ets            // 家居设备数据模型   └── RemoteService.ets          // 跨设备服务调用└── utils/    └── Logger.ts                 // 日志工具

2.2 权限配置

首先在 module.json5 中声明权限:

{  "module": {    "requestPermissions": [      {        "name": "ohos.permission.DISTRIBUTED_DEVICE_INFO_ACCESS",        "reason": "string:network_reason"      }    ]  }}

2.3 家居设备数据模型

// HomeDevice.ets - 智能家居设备模型// 支持空调、灯、窗帘、门锁四类设备// 设备类型export enum DeviceCategory {  AC = 'air_conditioner',  LIGHT = 'light',  CURTAIN = 'curtain',  LOCK = 'smart_lock'}// 设备状态export interface DeviceState {  onlineboolean;  powerOn?: boolean;      // 空调/灯  temperature?: number;   // 空调温度 (16-30°C)  brightness?: number;    // 灯光亮度 (0-100)  curtainLevel?: number;  // 窗帘开度 (0-100)  locked?: boolean;       // 门锁状态}// 家居设备export class HomeDevice {  deviceIdstring;  deviceNamestring;  deviceTypeDeviceCategory;  stateDeviceState;  constructor(    deviceIdstring,    deviceNamestring,    deviceTypeDeviceCategory,    stateDeviceState  ) {    this.deviceId = deviceId;    this.deviceName = deviceName;    this.deviceType = deviceType;    this.state = state;  }  // 获取设备图标  getIcon(): ResourceStr {    switch (this.deviceType) {      case DeviceCategory.AC:        return r('app.media.ic_light');      case DeviceCategory.CURTAIN:        return r('app.media.ic_locked') : r('app.media.ic_device');    }  }}

三、设备管理核心封装

3.1 设备发现服务

// DeviceManager.ts - 分布式设备管理封装import deviceManager from '@ohos.distributedDeviceManager';import bundle from '@ohos.bundle.bundleManager';import hilog from '@ohos.hilog';// 日志域 IDconst DOMAIN_ID = 0xFF00;const TAG = 'DeviceManagerService';export class DeviceManagerService {  private dmInstance: deviceManager.DeviceManager | null = null;  private deviceList: deviceManager.DeviceBasicInfo[] = [];  private stateCallback: ((devices: deviceManager.DeviceBasicInfo[]) => void) | null = null;  // 初始化设备管理实例  async init(): Promise<void> {    try {      // 获取本地设备的 bundleName(用于匿名设备管理)      const bundleName = await bundle.getBundleNameForUid(AppStorage.get('uid') || 1000);      // 创建设备管理实例      this.dmInstance = deviceManager.createDeviceManager(bundleName);      hilog.info(DOMAIN_IDTAG'DeviceManager initialized successfully');      // 注册设备状态监听      this.registerDeviceStateCallback();    } catch (err) {      hilog.error(DOMAIN_IDTAG`Init failed: {(err as Error).message}`);    }  }  // 注册设备状态变化回调  private registerDeviceStateCallback(): void {    if (!this.dmInstancereturn;    // 定义设备状态变化回调    const callback: deviceManager.DeviceStateCallback = {      onDeviceOnline(device: deviceManager.DeviceBasicInfo) => {        hilog.info(DOMAIN_IDTAG`Device online: {device.deviceName}`);        this.refreshDeviceList();      },      onDeviceChanged(device: deviceManager.DeviceBasicInfo) => {        hilog.info(DOMAIN_IDTAG`Device changed: {device.deviceName}`);      }    };    // 注册回调(使用匿名设备管理实例的参数)    this.dmInstance.registerDeviceStateCallback('local', callback, (err) => {      if (err) {        hilog.error(DOMAIN_IDTAG`Register callback failed: {err}`);          reject(new Error(`获取设备列表失败: {this.deviceList.length} devices`);        resolve(this.deviceList);      });    });  }  // 获取本地设备信息  getLocalDeviceInfo(): deviceManager.DeviceBasicInfo | null {    if (!this.dmInstancereturn null;    try {      const localInfo = this.dmInstance.getLocalDeviceInfoSync();      hilog.info(DOMAIN_IDTAG`Local device: {err}`);      return null;    }  }  // 获取指定设备信息  getDeviceInfo(deviceIdstring): deviceManager.DeviceBasicInfo | null {    if (!this.dmInstancereturn null;    try {      return this.dmInstance.getDeviceInfoSync(deviceId);    } catch (err) {      hilog.error(DOMAIN_IDTAG`Get device info failed: {err}`);        }      });      this.dmInstance.release();      this.dmInstance = null;      hilog.info(DOMAIN_IDTAG'DeviceManager released');    }  }}// 单例导出export const deviceManagerService = new DeviceManagerService();

四、跨设备服务调用

4.1 分布式调度服务

// RemoteService.ts - 跨设备服务调用import distributedSchedule from '@ohos.distributedSchedule';import deviceManager from '@ohos.distributedDeviceManager';import hilog from '@ohos.hilog';const DOMAIN_ID = 0xFF01;const TAG = 'RemoteService';// 调用选项interface StartOptions {  deviceIdstring;  bundleNamestring;  abilityNamestring;  wantParams?: Record<stringObject>;}// 跨设备调用结果interface RemoteCallResult {  successboolean;  data?: Record<stringObject>;  error?: string;}export class RemoteService {  private dmService: deviceManager.DeviceManager | null = null;  // 启动远程 Ability  async startRemoteAbility(optionsStartOptions): Promise<boolean> {    const { deviceId, bundleName, abilityName, wantParams } = options;    try {      // 构造 Want      const want = {        deviceId: deviceId,        bundleName: bundleName,        abilityName: abilityName,        parameters: wantParams || {}      };      // 启动远程 Ability      const result = await distributedSchedule.startAbility(want);      hilog.info(DOMAIN_IDTAG`Start remote ability success: {JSON.stringify(err)}`);      // 常见错误码处理      const errCode = (err as Error).message;      if (errCode.includes('401')) {        throw new Error('设备未授权,请先在目标设备确认配对请求');      } else if (errCode.includes('116')) {        throw new Error('设备不在线,无法建立连接');      }      throw err;    }  }  // 跨设备数据传递(通过 AppStorage + 分布式数据)  async sendDataToDevice(    deviceIdstring,    keystring,    dataObject  ): Promise<boolean> {    try {      // 存储到 AppStorage(跨设备自动同步)      AppStorage.setOrCreate(key, data);      // 通过 Want 参数传递(同步方式)      const want = {        deviceId: deviceId,        parameters: {          'remote_data_key': key,          'remote_data_value': data        }      };      hilog.info(DOMAIN_IDTAG`Data sent to device: {err}`);      return false;    }  }  // 获取在线设备  async getOnlineDevices(): Promise<deviceManager.DeviceBasicInfo[]> {    return new Promise((resolve) => {      // 从设备管理服务获取列表      const devices = this.dmService?.getTrustedDeviceListSync('local') || [];      const online = devices.filter(d => d.networkStatus === 1); // networkStatus=1 表示在线      resolve(online);    });  }}export const remoteService = new RemoteService();

五、完整控制页面实战

5.1 主控制页面

// Index.ets - 智能家居控制中枢主页面import deviceManager from '@ohos.distributedDeviceManager';import { deviceManagerService } from '../model/DeviceManager';import { HomeDeviceDeviceCategoryDeviceState } from '../model/HomeDevice';import Logger from '../utils/Logger';const TAG = 'HomeControlPage';@Entry@Componentstruct HomeControlPage {  @State deviceListHomeDevice[] = [];  @State selectedDeviceHomeDevice | null = null;  @State isLoadingboolean = false;  @State localDeviceNamestring = '';  // 控制器  private dmServiceDeviceManagerService = deviceManagerService;  async aboutToAppear() {    // 初始化设备管理    try {      await this.dmService.init();      // 获取本地设备名称      const localInfo = this.dmService.getLocalDeviceInfo();      this.localDeviceName = localInfo?.deviceName || '本设备';    } catch (err) {      Logger.error(TAG`Init failed: {err}`);        this.isLoading = false;      });  }  // 构建设备列表(模拟数据)  private buildMockDevices(onlineDevices: deviceManager.DeviceBasicInfo[]): HomeDevice[] {    const devicesHomeDevice[] = [];    // 添加真实在线设备    onlineDevices.forEach((device, index) => {      const types = [        DeviceCategory.AC,        DeviceCategory.LIGHT,        DeviceCategory.CURTAIN      ];      devices.push(new HomeDevice(        device.deviceId,        device.deviceName,        types[index % 3],        { onlinetruepowerOnfalsetemperature26brightness50curtainLevel0 }      ));    });    // 如果没有设备,添加模拟设备用于演示    if (devices.length === 0) {      devices.push(        new HomeDevice('local-ac''客厅空调'DeviceCategory.AC, {          onlinetruepowerOntruetemperature24        }),        new HomeDevice('local-light''卧室灯'DeviceCategory.LIGHT, {          onlinetruepowerOntruebrightness80        }),        new HomeDevice('local-curtain''阳台窗帘'DeviceCategory.CURTAIN, {          onlinetruecurtainLevel50        })      );    }    return devices;  }  // 控制设备  async controlDevice(deviceHomeDeviceactionstringvalue?: number) {    const deviceId = device.deviceId;    try {      switch (device.deviceType) {        case DeviceCategory.AC:          if (action === 'toggle') {            device.state.powerOn = !device.state.powerOn;          } else if (action === 'temp' && value !== undefined) {            device.state.temperature = value;          }          break;        case DeviceCategory.LIGHT:          if (action === 'toggle') {            device.state.powerOn = !device.state.powerOn;          } else if (action === 'brightness' && value !== undefined) {            device.state.brightness = value;          }          break;        case DeviceCategory.CURTAIN:          if (action === 'level' && value !== undefined) {            device.state.curtainLevel = value;          }          break;      }      // 触发 UI 更新      this.deviceList = [...this.deviceList];      // 发送到远程设备(如果是远程设备)      if (deviceId !== 'local') {        await remoteService.sendDataToDevice(deviceId, 'control_action', {          action,          value,          timestampDate.now()        });      }      Logger.info(TAG`Device {action}`);    } catch (err) {      Logger.error(TAG`Control failed: {device.state.temperature || 26}°`)            .fontSize(16)            .fontWeight(FontWeight.Bold)            .width(50)            .textAlign(TextAlign.Center)          Text('+')            .fontSize(20)            .padding(8)            .background('#E0E0E0')            .borderRadius(8)            .onClick(() => this.controlDevice(device, 'temp'Math.min(30, (device.state.temperature || 26) + 1)))        }      } else if (device.deviceType === DeviceCategory.LIGHT) {        Slider({          value: device.state.brightness || 50,          min0,          max100,          styleSliderStyle.OutSet        })          .width(120)          .onValueChange((val) => this.controlDevice(device, 'brightness'Math.floor(val)))      } else if (device.deviceType === DeviceCategory.CURTAIN) {        Slider({          value: device.state.curtainLevel || 0,          min0,          max100,          styleSliderStyle.OutSet        })          .width(120)          .onValueChange((val) => this.controlDevice(device, 'level'Math.floor(val)))      }    }    .width('100%')    .padding(16)    .background('#FFFFFF')    .borderRadius(12)    .shadow({      radius8,      color'#20000000',      offsetX2,      offsetY2    })  }  // 获取状态文本  private getStatusText(deviceHomeDevice): string {    if (!device.state.onlinereturn '离线';    switch (device.deviceType) {      case DeviceCategory.AC:        return device.state.powerOn ? `运行中 {device.state.brightness}%` : '已关闭';      case DeviceCategory.CURTAIN:        return `开度 ${device.state.curtainLevel}%`;      default:        return '正常';    }  }}

六、常见问题与避坑指南

问题
原因
解决方案
设备发现为空
未在同一华为账号或未开启多设备协同
确保设备登录同一华为账号,在设置中开启"多设备协同"
报 401 错误
设备间未建立信任关系
调用 bindTarget 配对,或在设备信任列表中添加
报 116 错误
目标设备离线
检查目标设备网络连接状态
状态监听无回调
匿名设备管理实例参数错误
第一个参数传入空字符串或本地 bundleName
跨设备数据不同步
未使用分布式数据管理
使用 DistributedData 替代 AppStorage

核心坑点

  1. 设备 ID 混淆
    :本地设备 ID 与远程设备 ID 格式不同,跨设备调用必须使用远程设备 ID
  2. 权限时机
    :设备管理权限需要在 Ability 启动后获取,不能在 UIAbility 构造器中调用
  3. 释放时机
    :应用退出时必须调用 release() 释放资源,否则可能导致内存泄漏
  4. 网络切换
    :设备网络切换(如 Wi-Fi → 移动数据)可能导致分布式连接断开

七、总结

今天我们通过一个智能家居控制中枢的实战项目,系统学习了鸿蒙 ArkTS 的分布式设备管理:

  1. 设备发现
    :使用 DeviceManager 发现周围可信设备
  2. 状态监听
    :注册回调实时感知设备上下线
  3. 跨设备调用
    :通过 distributedSchedule 启动远程 Ability
  4. 数据传递
    :AppStorage + Want 参数实现跨设备数据同步

分布式能力是鸿蒙区别于其他移动端开发框架的核心竞争力。掌握这套设备管理 API,你就能开发出真正的"设备合体"应用——手机、平板、手表、车机,无缝协同。


延伸阅读

  • 鸿蒙官方文档:分布式设备管理开发指南
  • 进阶主题:分布式数据管理(DistributedData)、分布式文件服务、分布式任务调度

如果觉得这篇文章有帮助,欢迎点赞、收藏!有任何问题欢迎在评论区留言交流。

最新文章

随机文章

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