The embodiment of the present invention provides an optimization method and a terminal for the power consumption of an application program. The method includes: determining the preset moving speed and the preset position change of the user corresponding to the service type of the application program according to the service type of the application program, so as to make the displacement change of the user reach the preset position change amount whenever the displacement change of the user reaches the preset position change amount. When the user's position information is acquired once, the preset position time required to acquire the position information is determined, and the interval time of each enabled positioning is calculated according to the preset position time, the preset moving speed and the preset position change amount, and the interval time of each enabled positioning is calculated according to the interval time and the preset position time. The user's positioning actions are intermittently controlled to optimize the power consumption of the application program. The terminal executes the above method. The method and terminal provided by the embodiment of the invention can optimize the power consumption consumed by the application program.
【技术实现步骤摘要】
一种应用程序消耗电量的优化方法及终端
本专利技术实施例涉及应用程序优化控制
,具体涉及一种应用程序消耗电量的优化方法及终端。
技术介绍
随着手机的广泛应用,基于手机开发的应用程序,即APP也被众多用户广泛使用,一些应用程序应用定位功能,实时获取用户的位置信息,但是,定位功能对手机电量消耗很大。对于应用程序的业务类型,例如打车服务、送外卖服务等,需要持续获取用户(提供服务的司机、外卖骑士等)的位置信息,以对用户行走路线进行监督,例如防止司机没去接乘客但却完成了订单、防止外卖骑士没有把用餐送到乘客手中却确认完成了送达任务等。现有技术通常持续开启手机的定位功能,专利技术人经过调研发现:虽然,间歇性定位单次执行电量消耗会多一些,但是从一段时间来看,持续定位会让App处于忙碌状态,间歇性定位会更省电。但是,间歇性定位的参数,例如间歇时长、定位时长等目前尚没有合理的确定方法,导致应用程序消耗的电量过多,还需要进一步优化。因此,如何避免上述缺陷,能够优化应用程序消耗的电量,成为亟须解决的问题。
技术实现思路
针对现有技术存在的问题,本专利技术实施例提供一种应用程序消耗电量的优化方法及终端。第一方面,本专利技术实施例提供一种应用程序消耗电量的优化方法,所述方法包括:根据应用程序的业务类型,确定与所述业务类型对应用户的预设移动速度和预设位置变化量;以使每当所述用户的位移变化达到所述预设位置变化量时,获取一次所述用户的位置信息;确定获取所述位置信息所需要的预设定位时间;并根据所述预设定位时间、所述预设移动速度和所述预设位置变化量,计算每次启用定位的间隔时间;根据所述间隔时间 ...
【技术保护点】
1.一种应用程序消耗电量的优化方法,其特征在于,包括:根据应用程序的业务类型,确定与所述业务类型对应用户的预设移动速度和预设位置变化量;以使每当所述用户的位移变化达到所述预设位置变化量时,获取一次所述用户的位置信息;确定获取所述位置信息所需要的预设定位时间;并根据所述预设定位时间、所述预设移动速度和所述预设位置变化量,计算每次启用定位的间隔时间;根据所述间隔时间和所述预设定位时间,对所述用户的定位动作进行间歇性控制,以优化所述应用程序消耗的电量。
【技术特征摘要】
1.一种应用程序消耗电量的优化方法,其特征在于,包括:根据应用程序的业务类型,确定与所述业务类型对应用户的预设移动速度和预设位置变化量;以使每当所述用户的位移变化达到所述预设位置变化量时,获取一次所述用户的位置信息;确定获取所述位置信息所需要的预设定位时间;并根据所述预设定位时间、所述预设移动速度和所述预设位置变化量,计算每次启用定位的间隔时间;根据所述间隔时间和所述预设定位时间,对所述用户的定位动作进行间歇性控制,以优化所述应用程序消耗的电量。2.根据权利要求1所述的方法,其特征在于,所述并根据所述预设定位时间、所述预设移动速度和所述预设位置变化量,计算每次启用定位的间隔时间,包括:根据如下公式计算所述间隔时间:所述间隔时间=所述预设定位时间+所述预设位置变化量/所述预设移动速度。3.根据权利要求1或2所述的方法,其特征在于,所述根据所述间隔时间和所述预设定位时间,对所述用户的定位动作进行间歇性控制,包括:根据所述间隔时间和所述预设定位时间,计算定位等待时间;启动所述定位动作,并开启对所述定位动作的第一计时;待所述第一计时达到所述预设定位时间,开启对定位等待的第二计时;待所述第二计时达到所述定位等待时间,继续启动所述定位动作,并重复执行。4.根据权利要求1或3所述的方法,其特征在于,所述确定获取所述位置信息所需要的预设定位时间,包括:获取多个待选定位时间;获取所述待选定位时间的总数量;若小于等于预设阈值的目标待选定位时间的数量与所述总数量的比值大于预设比例,则将所述目标待选定位时间的平均值作为所述预设定位时间。5.根据权利要求4所述的方法,其特征在于,所述获取多个待选定位时间,包括:获取通过初始定位得到的初始位置信息以及获取时刻;所述获取时刻是所述初始定位的完成时刻;比较当前位置和所述初始位置信息,...
【专利技术属性】
技术研发人员:黄辉,潘德东,
申请(专利权)人:北京顺丰同城科技有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。