1# 热管理服务 2 3- [简介](#section0056945901) 4- [目录](#section0056945902) 5- [配置说明](#section0056945903) 6- [相关仓](#section0056945904) 7 8## 简介<a name="section0056945901"></a> 9 10热管理服务提供设备温度管理控制能力,保障整机热安全及热体验。 11 12**图 1** 热管理服务架构图<br> 13 14 15**热管理服务模块功能说明**: 16 171. 温控管理中心(Thermal Manager):提供对应用及其他子系统的温控查询及回调接口。 182. 温控核心服务(Thermal Service):提供温度检测、档位仲裁及动作下发等温控核心功能,附配置文件。 193. 内核连接模块(Thermal HDI):提供温度驱动信息上报及驱动指令下发等功能,附配置文件。 204. 非运行态温控模块(Thermal Protector):提供非运行态时的简化温控服务,附配置文件。 21 22## 目录<a name="section0056945902"></a> 23``` 24/base/powermgr/thermal_manager 25├── application # Native应用 26│ ├── init # Init配置 27│ └── protector # Thermal Protector代码 28├── figures # 架构图 29├── frameworks # Framework层 30│ ├── napi # NAPI层 31│ └── native # Native层 32├── interface # 接口层 33│ └── inner_api # 内部接口 34├── sa_profile # SA配置文件 35├── services # Thermal Service代码 36│ ├── native # Native层 37│ └── zidl # Zidl层 38├── test # 测试代码 39│ ├── fuzztest # Fuzz 测试 40│ ├── unittest # 单元测试 41│ ├── systemtest # 系统测试 42│ └── utils # 测试工具 43└── utils # 工具和通用层 44``` 45 46## 配置说明<a name="section0056945903"></a> 47**thermal_service_config.xml** 48配置示例: 49 50``` 51<?xml version="1.0" encoding="UTF-8"?> 52<thermal version="0.99" product="ipx"> 53 <base> 54 <item tag="temperature_query_enum" value="soc,battery,shell,ambient"/> 55 </base> 56 <level> 57 <sensor_cluster name="warm_base" sensor="shell"> 58 <item level="1" threshold="35000" threshold_clr="33000"/> 59 <item level="2" threshold="37000" threshold_clr="35000"/> 60 <item level="3" threshold="40000" threshold_clr="38000"/> 61 </sensor_cluster> 62 <sensor_cluster name="warm_safe" sensor="battery,pa"> 63 <item level="1" threshold="48000,60000" threshold_clr="45000,55000"/> 64 </sensor_cluster> 65 </level> 66 <state> 67 <item name="screen"/> 68 <item name="charge"/> 69 </state> 70 <action> 71 <item name="cpu"/> 72 <item name="current"/> 73 <item name="shut_down" param="100"/> 74 <item name="thermal_level" strict="1"/> 75 </action> 76 <policy> 77 <config name="warm_base" level="1"> 78 <cpu screen="1">2800000</cpu> 79 <cpu screen="0">2400000</cpu> 80 <current charge="1">1500</current> 81 <thermal_level>3</thermal_level> 82 </config> 83 <config name="warm_base" level="2"> 84 <cpu screen="1">2200000</cpu> 85 <cpu screen="0">1800000</cpu> 86 <current charge="1">1200</current> 87 <thermal_level>4</thermal_level> 88 </config> 89 <config name="warm_base" level="3"> 90 <cpu screen="1">1600000</cpu> 91 <cpu screen="0">1200000</cpu> 92 <current charge="1">1000</current> 93 <thermal_level>5</thermal_level> 94 </config> 95 <config name="warm_safe" level="1"> 96 <shut_down>1</shut_down> 97 </config> 98 </policy> 99</thermal> 100``` 101``` 102thermal # 根目录,version为版本号;product为产品名 103├── base # base目录,配置基本参数 104│ └── item # item目录,tag为配置标签,value为配置值 105├── level # level目录,配置温度档位信息 106│ └── sensor_cluster # sensor_cluster目录,表示一个sensor集合,name为集合名,sensor为传感器名 107│ └── item # item目录,配置具体档位信息,level为等级,threshold为触发温度,xxx_clr为回退温度 108├── state # state目录,配置状态机,name为状态机名称 109├── action # action目录,配置动作,name为加载动作名称,param为加载参数,strict为仲裁方案 110└── policy # policy目录,配置档位对应的动作 111 └── config # config目录,配置对应档位的动作,name对应sensor_cluster的name,level对应其item中的level 112 └── <action_name> # 标签值对应动作的动作值,属性中可以配置state条件及对应的值 113``` 114 115 116## 相关仓<a name="section0056945904"></a> 117[电源管理子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E7%94%B5%E6%BA%90%E7%AE%A1%E7%90%86%E5%AD%90%E7%B3%BB%E7%BB%9F.md) 118 119[powermgr_power_manager](https://gitee.com/openharmony/powermgr_power_manager) 120 121[powermgr_display_manager](https://gitee.com/openharmony/powermgr_display_manager) 122 123[powermgr_battery_manager](https://gitee.com/openharmony/powermgr_battery_manager) 124 125**powermgr_thermal_manager** 126 127[powermgr_battery_statistics](https://gitee.com/openharmony/powermgr_battery_statistics) 128 129[powermgr_battery_lite](https://gitee.com/openharmony/powermgr_battery_lite) 130 131[powermgr_powermgr_lite](https://gitee.com/openharmony/powermgr_powermgr_lite) 132