当前位置: 首页 > wzjs >正文

遵义网站建设网帮你网络运营培训

遵义网站建设网帮你,网络运营培训,公司建站后还要录入网页吗,企业的做网站OpenHarmony子系统开发 - 热管理(二) 三、热检测定制开发指导 概述 简介 OpenHarmony默认提供了热检测的特性。设备在运行过程中会产生热量,如CPU发热、电池发热等,此时器件会通过相应的温度传感器,将其温度进行实时…

OpenHarmony子系统开发 - 热管理(二)


三、热检测定制开发指导

概述

简介

OpenHarmony默认提供了热检测的特性。设备在运行过程中会产生热量,如CPU发热、电池发热等,此时器件会通过相应的温度传感器,将其温度进行实时上报。热检测特性是实时检测器件的温度,为热管理模块提供温度输入。但是在不同产品中,对不同器件进行热检测的规格是不同的,针对此种情况,OpenHarmony提供了热检测的定制方式,产品定制开发者可根据产品的设计规格来定制这些特性。

约束与限制

产品定制的配置路径,需要根据配置策略决定。本开发指导中的定制路径以/vendor进行举例,请开发者根据具体的产品配置策略,修改定制路径。

开发指导

搭建环境

设备要求:

标准系统开发板,如DAYU200/Hi3516DV300开源套件。

环境要求:

Linux调测环境,相关要求和配置可参考《快速入门》。

开发步骤

本文以DAYU200为例介绍热检测的定制方法。

  1. 在产品目录(/vendor/hihope/rk3568)下创建thermal文件夹。

  2. 参考默认热检测的配置文件夹创建目标文件夹,并安装到//vendor/hihope/rk3568/thermal,文件格式如下:

    profile
    ├── BUILD.gn
    ├── thermal_hdi_config.xml
    
  3. 参考默认热检测的配置文件夹中的thermal_hdi_config.xml编写定制的thermal_hdi_config.xml。包含热检测配置说明及定制后的热检测配置如下:

    表1 热检测配置说明

    节点名称配置项名称配置项描述值的类型
    itemtag获取真实节点或模拟节点温度值标志位的名称string
    itemvalue为1时获取模拟节点温度值,为0时获取真实节点温度值int
    groupname真实节点组(actual)或模拟节点组(sim)的名称string
    groupinterval轮询时间间隔(默认单位为ms)int
    thermal_zonetypethermal zone名称string
    thermal_zonepath获取真实节点thermal zone温度值的路径string
    thermal_nodetypethermal node名称string
    thermal_nodepath获取模拟节点thermal node温度值的路径string
    <base><item tag="sim_tz" value="0"/>
    </base><polling><group name="actual" interval="30000"><thermal_zone type="soc-thermal" path="sys/class/thermal/thermal_zone0/temp"/><thermal_zone type="gpu-thermal" path="sys/class/thermal/thermal_zone0/temp"/></group><group name="sim" interval="30000"><thermal_node type="soc" path="data/service/el0/thermal/sensor/soc/temp"/><thermal_node type="cpu" path="data/service/el0/thermal/sensor/cpu/temp"/><thermal_node type="ap" path="data/service/el0/thermal/sensor/ap/temp"/><thermal_node type="pa" path="data/service/el0/thermal/sensor/pa/temp"/><thermal_node type="ambient" path="data/service/el0/thermal/sensor/ambient/temp"/><thermal_node type="charger" path="data/service/el0/thermal/sensor/charger/temp"/><thermal_node type="battery" path="data/service/el0/thermal/sensor/battery/temp"/><thermal_node type="shell" path="data/service/el0/thermal/sensor/shell/temp"/></group>
    </polling>
    

    获取真实节点温度的路径参考热日志文档中获取thermal zone温度的路径,获取模拟节点温度的路径参考热检测的默认配置。

  4. 参考默认热检测配置文件夹中的BUILD.gn编写BUILD.gn文件,将thermal_hdi_config.xml打包到//vendor/etc/thermal_config/hdf目录下:

    import("//build/ohos.gni")ohos_prebuilt_etc("thermal_hdf_config") {source = "thermal_hdi_config.xml"relative_install_dir = "thermal_config/hdf"install_images = [ chipset_base_dir ]       # 安装到vendor目录下的必要配置part_name = "product_rk3568"                # part_name暂定为product_rk3568,以实现后续编译,产品定制根据需要自行修改
    }
    
  5. 将编译目标添加到ohos.build的"module_list"中,例如:

    {"parts": {"product_rk3568": {"module_list": ["//vendor/hihope/rk3568/default_app_config:default_app_config","//vendor/hihope/rk3568/image_conf:custom_image_conf","//vendor/hihope/rk3568/preinstall-config:preinstall-config","//vendor/hihope/rk3568/resourceschedule:resourceschedule","//vendor/hihope/rk3568/etc:product_etc_conf","//vendor/hihope/rk3568/thermal/profile:thermal_hdf_config", // 添加thermal_hdf_config的编译]}},"subsystem": "product_hihope"
    }
    

    “//vendor/hihope/rk3568/thermal/”为文件夹路径,“profile”为创建的文件夹名字,“thermal_hdf_config”为编译目标。

  6. 参考《快速入门》编译定制版本,编译命令如下:

    ./build.sh --product-name rk3568 --ccache
    
  7. 将定制版本烧录到DAYU200开发板中。

调测验证

  1. 开机后,进入shell命令行:

    hdc shell
    
  2. 获取thermal zone的热检测结果:

    hidumper -s 3303 -a -t
    

    成功获取thermal zone的热检测结果如下,其中Temperature的默认温度单位为0.001摄氏度:

    -------------------------------[ability]-----------------------------------------------------------------ThermalService---------------------------------
    ······(省略其他,只显示定制后的热检测结果)
    Type: gpu-thermal
    Temperature: 35555
    Type: soc-thermal
    Temperature: 35000
    ······
    

参考

开发过程中可参考的配置文件路径:默认热检测的配置源码路径

打包路径:/vendor/etc/thermal_config/hdf


四、热等级定制开发指导

概述

简介

OpenHarmony默认提供了热等级的特性。不同的硬件设备发热量和所能承受的最大温度都不相同,因此需要根据不同器件的温度,来定义系统的热等级标准,从而清晰的表明当前设备的发热状态,给热策略提供输入。但是器件在不同温度下对应的热等级在不同的产品上规格是不同的,产品希望根据产品的设计规格来定制此特性。OpenHarmony提供了热等级的定制方式,产品定制开发者可根据产品的设计规格来定制这些特性。

约束与限制

产品定制的配置路径,需要根据配置策略决定。本开发指导中的定制路径以/vendor进行举例,请开发者根据具体的产品配置策略,修改定制路径。

开发指导

搭建环境

设备要求:

标准系统开发板,如DAYU200/Hi3516DV300开源套件。

环境要求:

Linux调测环境,相关要求和配置可参考《快速入门》。

开发步骤

本文以DAYU200为例介绍热等级的定制方法。

  1. 在产品目录(/vendor/hihope/rk3568)下创建thermal文件夹。

  2. 参考默认热等级的配置文件夹创建目标文件夹,并安装到//vendor/hihope/rk3568/thermal,文件格式如下:

    profile
    ├── BUILD.gn
    ├── thermal_service_config.xml
    
  3. 参考默认热等级的配置文件夹中的thermal_service_config.xml编写定制的thermal_service_config.xml。包含热等级配置说明及定制后的热等级配置如下:

    表1 base配置说明

    配置项配置项描述配置项参数配置项参数描述参数类型参数取值范围
    tag="history_temp_count"历史上报温度次数标签的名称value历史上报温度次数int>0
    tag="temperature_query_enum"获取温度的设备列表的标签名称value要获取温度的设备列表enumsoc,battery,shell,cpu,charger,ambient,ap,pa

    表2 sensor_cluster配置说明

    配置项名称配置项描述数据类型取值范围
    name传感器集合名称string
    sensor集合内的传感器stringsoc,battery,shell,cpu,charger,ambient,ap,pa
    aux_sensor集合内的辅助传感器stringsoc,battery,shell,cpu,charger,ambient,ap,pa

    表3 item配置说明

    配置项名称配置项描述数据类型取值范围
    level各传感器集合下定义的热等级int>0
    threshold集合内每个传感器达到对应热等级的温度阈值(默认单位0.001摄氏度,开发者可定制)int根据产品定制
    threshold_clr集合内每个传感器回退到上一热等级的温度阈值int根据产品定制
    temp_rise_rate温度升高频率double根据产品定制
    <thermal version="0.01" product="lya">
    <base><item tag="history_temp_count" value="10"/><item tag="temperature_query_enum" value="soc,battery,shell,cpu,charger,ambient,ap,pa"/>
    </base><level><sensor_cluster name="base_safe" sensor="battery,charger,cpu,soc"><item level="1" threshold="42000,40000,30000,40000" threshold_clr="38000,36000,28000,38000"/><item level="2" threshold="43000,41000,32000,42000" threshold_clr="41000,39000,30000,40000"/><item level="3" threshold="46000,44000,34000,44000" threshold_clr="44000,42000,32000,42000"/><item level="4" threshold="48000,46000,36000,46000" threshold_clr="46000,44000,34000,44000"/></sensor_cluster>
    </level>
    
  4. 参考默认热等级配置文件夹中的BUILD.gn编写BUILD.gn文件,将thermal_service_config.xml打包到/vendor/etc/thermal_config目录下:

    import("//build/ohos.gni")                      # 引用build/ohos.gniohos_prebuilt_etc("thermal_service_config") {source = "thermal_service_config.xml"relative_install_dir = "thermal_config"install_images = [ chipset_base_dir ]       # 安装到vendor目录下的必要配置part_name = "product_rk3568"                # part_name暂定为product_rk3568,以实现后续编译,产品定制根据需要自行修改
    }
    
  5. 将编译目标添加到ohos.build的"module_list"中,例如:

    {"parts": {"product_rk3568": {"module_list": ["//vendor/hihope/rk3568/default_app_config:default_app_config","//vendor/hihope/rk3568/image_conf:custom_image_conf","//vendor/hihope/rk3568/preinstall-config:preinstall-config","//vendor/hihope/rk3568/resourceschedule:resourceschedule","//vendor/hihope/rk3568/etc:product_etc_conf","//vendor/hihope/rk3568/thermal/profile:thermal_service_config", // 添加thermal_service_config的编译]}},"subsystem": "product_hihope"
    }
    

    “//vendor/hihope/rk3568/thermal/”为文件夹路径,“profile”为创建的文件夹名字,“thermal_service_config”为编译目标。

  6. 参考《快速入门》编译定制版本,编译命令如下:

    ./build.sh --product-name rk3568 --ccache
    
  7. 将定制版本烧录到DAYU200开发板中。

调测验证

  1. 开机后,进入shell命令行:

    hdc shell
    
  2. 进入data/service/el0/thermal/sensor/soc/路径:

    cd data/service/el0/thermal/sensor/soc
    
  3. 修改soc的温度:

    echo 42000 > temp
    
  4. 获取当前热等级信息:

    hidumper -s 3303 -a -l
    

    成功获取热等级信息如下:

    -------------------------------[ability]-----------------------------------------------------------------ThermalService---------------------------------
    name: base_safe	level: 2
    name: cold_safe	level: 0
    name: high_safe	level: 0
    name: warm_5G	level: 0
    name: warm_safe	level: 1
    

参考

开发过程中可参考的配置文件路径:默认热等级源码路径

打包路径:/vendor/etc/thermal_config/hdf

http://www.dtcms.com/wzjs/565730.html

相关文章:

  • 淄博网站建设高端企业提供家居企业网站建设
  • 企业网站设计解决方案做搬家网站的素材
  • 建设网站的模板pc端网站开发工具
  • 网站关键词密这么稀释网站qq访客采集系统_访客qq获取系统源码网站客户qq抓取代码
  • 温州网站建设报价如果做微商需不需要开个网站。
  • 制作网站代码批量网站建设合作协议
  • 建设的招标网站管理公司网站设计
  • 宁波网站制作流程网站宣传软文
  • 浙江王氏生态建设网站怎么做自动发卡的网站
  • 屏蔽ip地址访问网站做sgs认证公司网站
  • 网站包装推广之网络营销案例品牌型网站的特点
  • 有没有做网站的博士专业个人做网站有什么用
  • 做效果图挣钱网站网页制作面试自我介绍
  • 信用中国 网站谁建设的电商哪个岗位最吃香
  • 做网站最好的工具wordpress更新一直下载失败
  • 宁波江北建设局网站容桂手机网站建设
  • dw网站怎么做点击图片放大公司做网站要多少钱
  • 服装购物商城网站建设企业名称注册查询
  • 下载素材的网站开发者模式一直开着有危害吗
  • 沈阳哪里有教做网站的电商产品开发流程
  • 网站登录系统内部错误网站建设公司做销售好不好?
  • 交流网站建设项目背景行业网站做不下去
  • 账号交易网站数据库应该怎么做学室内设计需要什么学历
  • 沈阳鹊起网站建设公司网站建设的书 推荐
  • 网站搭建平台多少钱本地网站asp iis
  • 免费三网合一网站系统wordpress手机端顶部导航
  • 个人备案域名可以做企业网站吗宁波网络营销公司
  • 网站建设模版一家专业做导购的网站
  • 大气金融投资企业网站模板建设工程施工合同属于
  • 沈阳大熊网站建设制作重庆工厂网站建设