WO2023093230A1 - 传感器管控方法、设备及存储介质 - Google Patents

传感器管控方法、设备及存储介质 Download PDF

Info

Publication number
WO2023093230A1
WO2023093230A1 PCT/CN2022/119240 CN2022119240W WO2023093230A1 WO 2023093230 A1 WO2023093230 A1 WO 2023093230A1 CN 2022119240 W CN2022119240 W CN 2022119240W WO 2023093230 A1 WO2023093230 A1 WO 2023093230A1
Authority
WO
WIPO (PCT)
Prior art keywords
sensor
application
listener
unfrozen
control method
Prior art date
Application number
PCT/CN2022/119240
Other languages
English (en)
French (fr)
Inventor
李亮
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023093230A1 publication Critical patent/WO2023093230A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3287Power saving characterised by the action undertaken by switching off individual functional units in the computer system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present disclosure relates to the technical field of terminal equipment, and in particular, to a sensor management and control method, equipment, and storage medium.
  • Embodiments of the present disclosure provide a sensor management and control method, device, and storage medium.
  • an embodiment of the present disclosure provides a sensor control method, including: when the application to be frozen is registered with a sensor data listener, delete the sensor data listener, and the application to be frozen Freezing; and, modifying the number of listener registrations of the sensor to which the sensory data listener belongs, and closing the sensor when the modified number of listener registrations reaches a preset threshold.
  • an embodiment of the present disclosure further provides a terminal device, the terminal device includes a processor, a memory, a computer program stored on the memory and executable by the processor, and a computer program for implementing the processor A data bus connected to and communicating with the memory, wherein when the computer program is executed by the processor, the steps of any one of the sensor control methods provided in the present disclosure are implemented.
  • an embodiment of the present disclosure further provides a storage medium for computer-readable storage, the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors , so as to realize the steps of any sensor-controlled method provided in the present disclosure.
  • FIG. 1 is a schematic structural diagram of a terminal device provided by an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of a sensor control method provided by an embodiment of the present disclosure
  • FIG. 3 is another schematic flowchart of a sensor control method provided by an embodiment of the present disclosure
  • FIG. 4 is another schematic flowchart of the sensor management and control method provided by an embodiment of the present disclosure.
  • Fig. 5 is a schematic structural block diagram of another terminal device provided by an embodiment of the present disclosure.
  • the improvement of battery life will be a problem that manufacturers need to optimize, and the main purpose of improving battery life is to reduce the power consumption of applications.
  • the sensor in the terminal device collects sensory data and distributes the sensory data to each application program to achieve the purpose of each application program receiving sensory data.
  • the sensor is still collecting sensor data, resulting in a lot of unnecessary power consumption. Therefore, how to reasonably control the sensor to reduce the power consumption of the terminal device is an urgent problem to be solved.
  • Embodiments of the present disclosure provide a sensor management and control method, device, and storage medium.
  • the sensor control method can be applied to terminal devices, and the mobile terminals can be electronic devices such as mobile phones, tablet computers, notebook computers, desktop computers, personal digital assistants, and wearable devices.
  • the sensor in the terminal device collects sensory data and distributes the sensory data to each application program to achieve the purpose of each application program receiving sensory data.
  • the application program is frozen, there is no need to use the sensory data.
  • the sensor is still collecting sensor data, resulting in a lot of unnecessary power consumption.
  • the embodiment of the present disclosure provides a sensor management and control method, by deleting the sensor data listener when the application program to be frozen is registered with a sensor data listener, and freezing the application program to be frozen; modify The number of listener registrations of the sensor to which the sensory data listener belongs, and when the modified number of listener registrations reaches the preset threshold, the sensor is closed.
  • FIG. 1 is a schematic structural diagram of a terminal device provided by an embodiment of the present disclosure.
  • the terminal device 100 includes an input unit 110 , freezing service unit 120 , sensor server unit 130 and sensor unit 140 .
  • the input unit 110 is an application program in the terminal device 100, for example, the input unit 110 includes an application program 1, an application program 2, an application program 3, an application program 4 and an application program 5, and the freezing service unit 120 is to determine whether the application program Freeze or unfreeze the unit, delete the sensor data listener registered by the application when the application is frozen, and re-register the sensor data listener for the unfrozen application when the application is unfrozen.
  • the sensor server unit 130 is used to receive the sensor data listener input by the application program in the input unit 110, and send the sensor data corresponding to the sensor data monitor to the application program.
  • the sensor unit 140 is a sensor in the terminal device 100, For example, the sensor includes sensors such as an acceleration sensor, an angular velocity sensor, a speed sensor, a temperature sensor, and a humidity sensor.
  • FIG. 1 is only used to explain the sensor management and control method provided by the embodiment of the present disclosure. However, it does not constitute a limitation on the terminal equipment applied to the sensor management and control method provided by the embodiments of the present disclosure.
  • FIG. 2 is a schematic flowchart of a sensor management and control method provided by an embodiment of the present disclosure.
  • the sensor control method includes steps S101 to S102.
  • Step S101 if the application to be frozen is registered with a sensor data listener, delete the sensor data listener, and freeze the application to be frozen.
  • the type of the application program when determining that the type of the application program is the first type, obtain the identification bit of the application program, if the identification bit of the application program is the first identification bit, and the identification bit of the application program is the first identification bit If the duration is greater than or equal to the preset duration, the application is the application to be frozen; when the type of the application is determined to be the second type, the application is the application to be frozen; when the type of the application is determined to be the third type , the application is not a pending application.
  • the first type, the second type, the third type, the preset duration and the identification bit can be set according to actual conditions, which are not specifically limited in this embodiment. Whether the application program is an application program to be unfrozen can be accurately determined according to the type of the application program.
  • the application program when it is determined that the application program is an application program to be frozen, it is determined whether the application program to be frozen is registered with a sensor data listener; , freeze the application to be frozen; when it is determined that the application to be frozen has a registered sensor data listener, save the application information of the application to be frozen to the preset record list, and delete the sensor data monitor device.
  • the preset record link list is a preset record list, and the establishment of the preset record link list can be set according to actual conditions, which is not specifically limited in this embodiment.
  • application programs to be unfrozen 1, application programs to be unfreezed, application programs to be unfreezed 3, application programs to be unfrozen 4, and application programs to be unfrozen 5, wherein the application program 1 to be unfreezed, the application program to be unfreezed 3
  • the unfreezing application 4 is registered with a sensor data listener, and the application information of the unfreezing application 1, the application information of the unfreezing application 3 and the application information of the unfreezing application 4 are stored in the preset record linked list, And delete the registered sensor data listener of application 1, application 3 and application 4 to be thawed, application 1 to be thawed, application 2 to be thawed, application 3 to be thawed, application 4 and the application program 5 to be unfrozen are frozen.
  • Step S102 modifying the number of registered listeners of the sensor to which the sensory data listener belongs, and closing the sensor when the modified registered number of listeners reaches a preset threshold.
  • the senor is a sensing device in the terminal device, and the sensor can be set according to the actual situation, which is not specifically limited in this embodiment, for example, the sensor can be an acceleration sensor, an angular velocity sensor, a speed sensor, a temperature sensor and a humidity sensor, etc. sensor.
  • the listener registration number of the sensor to which the sensory data listener belongs is subtracted by one to obtain the modified listener registration number of the sensor.
  • the number of listener registrations of the sensor is updated to facilitate the management and control of the sensor.
  • the application program to be defrosted is registered with an acceleration sensor listener, and the acceleration sensor listener is deleted.
  • the number of registrations is 5 minus 1, and the number of listener registrations registered by the acceleration sensor is 4.
  • the preset threshold may be set according to actual conditions, which is not specifically limited in this embodiment, for example, the preset threshold may be set to 0.
  • the preset threshold may be set to 0.
  • the preset threshold is 0, the application to be frozen is registered with sensory data listener 1 and sensory data listener 2, and the sensor 1 to which sensory data listener 1 belongs has registered listener registration numbers of 3.
  • the number of registered listeners registered by sensor 2 to which sensor data listener 2 belongs is 1, and the number of registered listeners registered by sensor 1 and registered by sensor 2 is reduced by one, and the modified sensor 1 has The registered listener registration number is 2, the modified sensor 2 registered listener registration number is 0, the sensor 1 registered listener registration number is 2 is not equal to the preset threshold 0, the sensor 2 registered listener When the registration number is 0, it is equal to the preset threshold value of 0, the control sensor 1 continues to operate, and the control sensor 2 is turned off.
  • the method further includes step S103.
  • Step S103 if the number of registered monitors is greater than the preset threshold, turn on the sensor again.
  • the application to be thawed When the application to be thawed is thawed, it is determined whether the application information of the application to be thawed is stored in the preset record linked list; data listener. Modifying the number of listener registrations of the sensor to which the sensory data listener belongs, and turning on the sensor again when the modified number of listener registrations is greater than the preset threshold. When the modified number of listener registrations is greater than the preset threshold, turning on the sensor again can not only reduce the power consumption caused by the operation of the sensor, but also provide the sensing data in time when the sensing data is needed.
  • the method of registering the sensor data listener for the application program to be unfrozen may be: determining the sensor data required by the application program to be unfreezed; determining the sensor that collects the sensor data, and registering the sensor corresponding sensor data listener. By determining the sensing data required by the application to be unfrozen, the sensing data listener that the application to be unfreeze needs to register can be quickly known according to the sensing data.
  • the method of determining the sensing data required by the application to be unfrozen may be: obtaining a preset mapping relationship table between the application program to be unfrozen and the sensing data; Sensory data required by the program.
  • the mapping relationship table is established in advance according to the application program to be unfrozen and the sensing data, and the establishment of the mapping relationship table may be established according to actual conditions, which is not specifically limited in this embodiment.
  • the sensing data required by the application program to be unfrozen can be quickly determined through the should relationship table.
  • the application information of the application to be unfrozen exists in the preset record linked list, and the sensing data required by the application to be unfrozen is queried from the mapping relationship table as acceleration sensing data, Make sure that it is the acceleration sensor that collects the acceleration sensor data.
  • the current registration number of the acceleration sensor listener is 0, and add 1 to the registration number of the listener.
  • the registration number of the acceleration sensor listener is 1.
  • the registration number of the acceleration sensor listener is 1 and is greater than the preset threshold 0, and the acceleration sensor continues to be turned on.
  • the terminal device when the terminal device is in the sleep mode, all sensors in the terminal device are turned off until the terminal device is in the working mode. When the terminal device is in the sleep mode, each sensor in the terminal device is turned off, which can reduce the power consumption of the terminal device.
  • step S201 freeze or unfreeze the application program
  • step S202 determine whether the application program needs to be frozen or unfreeze
  • step S203 when the application program needs to be frozen, there is sensing data in the application program
  • step S204 modify the number of listener registrations of the sensor to which the sensing data listener belongs
  • step S205 determine whether the modified listener registration number is is the preset threshold
  • step S206 when the modified listener registration number is the preset threshold, turn off the sensor
  • step S207 when the modified listener registration number is not the preset threshold, continue to run the sensor
  • step S208 when the application The program needs to be unfrozen, determine whether there is application program information of the application program to be unfrozen in the preset record linked list
  • step S209 when it is determined that there is application program information of the application program to be unfrozen in the preset record linked list, register sensing data
  • the application to be frozen when the application to be frozen is registered with a sensor data listener, delete the sensor data listener, and freeze the application to be frozen; modify the The number of listener registrations, and when the modified number of listener registrations reaches the preset threshold, the sensor is turned off.
  • the sensor data listener registered by the application to be frozen By deleting the sensor data listener registered by the application to be frozen, modifying the number of sensor listener registrations of the sensor data listener, and closing the sensor when the number of sensor data listener registrations reaches the preset threshold, it can reduce the impact caused by the operation of the sensor Power consumption, reducing the power consumption of terminal equipment.
  • FIG. 5 is a schematic structural block diagram of another terminal device provided by an embodiment of the present disclosure.
  • the terminal device 300 includes a processor 301 and a memory 302, and the processor 301 and the memory 302 are connected through a bus 303, such as an I2C (Inter-integrated Circuit) bus.
  • a bus 303 such as an I2C (Inter-integrated Circuit) bus.
  • the processor 301 is used to provide computing and control capabilities to support the operation of the entire terminal device.
  • the processor 301 can be a central processing unit (Central Processing Unit, CPU), and the processor 301 can also be other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC) ), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 302 can be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a U disk, or a mobile hard disk.
  • FIG. 5 is only a block diagram of a partial structure related to the disclosed solution, and does not constitute a limitation on the terminal device to which the disclosed solution is applied.
  • the terminal device may include More or fewer components are shown in the figures, or certain components are combined, or have different component arrangements.
  • the processor is configured to run a computer program stored in the memory, and implement any one of the sensor management and control methods provided by the embodiments of the present disclosure when executing the computer program.
  • the processor is configured to run a computer program stored in the memory, and implement the following steps when executing the computer program: in the case that the application program to be frozen is registered with a sensor data listener, delete the the sensor data listener, and freeze the application to be frozen; and modify the number of listener registrations of the sensor to which the sensor data listener belongs, and when the modified number of listener registrations is a preset threshold, Turn off the sensor.
  • the processor is further configured to: turn on the sensor again when the number of listener registrations is greater than the preset threshold.
  • the processor when the processor deletes the sensor data listener when the sensor data listener is registered in the application program to be frozen, it is used to: If there is a sensory data listener, save the application information of the application to be frozen in a preset record linked list, and delete the sensory data listener.
  • the processor when the processor realizes modifying the number of listener registrations of the sensor to which the sensory data listener belongs, it is used to realize: the number of listener registrations of the sensor to which the sensory data listener belongs Subtract one to get the modified listener registration number of the sensor.
  • the processor is further configured to: when the application to be unfrozen is unfrozen, determine whether the application information of the application to be unfrozen is saved in the preset record linked list; and when determining the preset record The application information of the application to be unfrozen exists in the linked list, and a sensing data listener is registered for the application to be unfreeze.
  • the processor when the processor registers a sensor data listener for the application to be unfrozen when it is determined that the application information of the application to be unfrozen exists in the preset record linked list, The method is used to: determine the sensing data required by the application program to be unfrozen; and determine the sensor for collecting the sensing data, and register the sensor data listener corresponding to the sensor for the application program to be unfrozen.
  • the processor when the processor implements the determination of the sensor data required by the application program to be unfrozen, it is configured to: obtain a preset mapping relationship between the application program to be unfreeze and the sensor data table; and querying the sensing data required by the application program to be unfrozen from the mapping relationship table.
  • the processor is further configured to: when the terminal device is in the sleep mode, turn off each sensor in the terminal device until the terminal device is in the working mode.
  • An embodiment of the present disclosure also provides a storage medium for computer-readable storage, the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following: The steps of any sensor control method provided in the present disclosure.
  • the storage medium may be an internal storage unit of the terminal device described in the foregoing embodiments, such as a hard disk or a memory of the terminal device.
  • the storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk equipped on the terminal device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, Flash card (Flash Card), etc.
  • the functional modules/units in the system, and the device can be implemented as software, firmware, hardware, and an appropriate combination thereof.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components. Components cooperate to execute.
  • Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit .
  • Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
  • computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Power Sources (AREA)
  • Telephone Function (AREA)

Abstract

本公开实施例提供一种传感器管控方法、设备及存储介质,属于终端设备技术领域。该方法包括:在待冻结应用程序注册有传感数据监听器的情况下,删除所述传感数据监听器,并对所述待冻结应用程序进行冻结;修改所述传感数据监听器所属传感器的监听器注册数,并在修改后的监听器注册数为预设阈值的情况下,关闭所述传感器。

Description

传感器管控方法、设备及存储介质
相关申请的交叉引用
本公开要求享有2021年11月24日提交的名称为“传感器管控方法、设备及存储介质”的中国专利申请CN202111406357.6的优先权,其全部内容通过引用并入本公开中。
技术领域
本公开涉及终端设备技术领域,尤其涉及一种传感器管控方法、设备及存储介质。
背景技术
随着终端设备高速发展,人们日常生活中对终端设备的依赖也日益增强,终端设备的中央处理器(central processing unit,CPU)性能不断提升,外设不断增加,随之而来就是终端设备功耗越来越大,因此,功耗续航已经成为用户最关注的终端设备性能之一。
发明内容
本公开实施例在于提供一种传感器管控方法、设备及存储介质。
第一方面,本公开实施例提供一种传感器管控方法,包括:在待冻结应用程序注册有传感数据监听器的情况下,删除所述传感数据监听器,并对所述待冻结应用程序进行冻结;以及,修改所述传感数据监听器所属传感器的监听器注册数,并在修改后的监听器注册数为预设阈值情况下,关闭所述传感器。
第二方面,本公开实施例还提供一种终端设备,所述终端设备包括处理器、存储器、存储在所述存储器上并可被所述处理器执行的计算机程序以及用于实现所述处理器和所述存储器之间的连接通信的数据总线,其中所述计算机程序被所述处理器执行时,实现如本公开说明书提供的任一项传感器管控方法的步骤。
第三方面,本公开实施例还提供一种存储介质,用于计算机可读存储,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如本公开说明书提供的任一项传感器管控的方法的步骤。
附图说明
图1是本公开实施例提供的一种终端设备的结构示意图;
图2为本公开实施例提供的一种传感器管控方法的流程示意图;
图3为本公开实施例提供的传感器管控方法的另一流程示意图;
图4为本公开实施例提供的传感器管控方法的又一流程示意图;以及
图5为本公开实施例提供的另一种终端设备的结构示意性框图。
具体实施方式
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
应当理解,在本公开说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本公开。如在本公开说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
目前以及未来较长时间,续航能力提升将是各厂商需要优化的问题,而提升续航能力主要是降低应用程序的功耗。例如,终端设备中的传感器采集传感数据,并将传感数据分发给各个应用程序,以达到各个应用程序接收传感数据的目的,但是,当应用程序冻结时就不需要使用传感数据,而传感器还在采集传感器数据,导致产生了很多不必要的功耗,因此,如何合理对传感器进行管控,以降低终端设备的功耗是目前亟待解决的问题。
本公开实施例提供一种传感器管控方法、设备及存储介质。其中,该传感器管控方法可应用于终端设备中,该移动终端可以是手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等电子设备。
下面结合附图,对本公开的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
随着终端设备高速发展,人们日常生活中对终端设备的依赖也日益增强,终端设备的中央处理器(central processing unit,CPU)性能不断提升,外设不断增加,随之而来就是终端设备功耗越来越大,因此,功耗续航已经成为用户最关注的终端设备性能之一,目前以及未来较长时间,续航能力提升将是各厂商需要优化的问题,而提升续航能力主要是降低应用程序的功耗。例如,终端设备中的传感器采集传感数据,并将传感数据分发给各个应用程序,以达到各个应用程序接收传感数据的目的,但是,当应用程序冻结时就不需要使用传感数据,而传感器还在采集传感器数据,导致产生了很多不必要的功耗。
为解决上述问题,本公开实施例提供了一种传感器管控方法,通过在待冻结应用程序 注册有传感数据监听器的情况下,删除传感数据监听器,并对待冻结应用程序进行冻结;修改传感数据监听器所属传感器的监听器注册数,并在修改后的监听器注册数为预设阈值时,关闭传感器。通过删除待冻结应用程序注册的传感数据监听器,修改传感数据监听器传感器的监听器注册数,在感数据监听器注册数为预设阈值时将传感器关闭,能够减少传感器运行带来的功耗,减少了终端设备的功耗。
可以理解的是,该传感器管控方法可以应用于终端设备中,请参阅图1,图1是本公开实施例提供的一种终端设备的结构示意图,如图1所示,终端设备100包括输入单元110、冻结服务单元120、传感器服务器单元130和传感器单元140。其中,输入单元110为终端设备100中的应用程序,例如,输入单元110包括应用程序1、应用程序2、应用程序3、应用程序4和、应用程序5,冻结服务单元120是确定应用程序是否冻结或者解冻的单元,并在应用程序冻结时删除应用程序已注册的传感数据监听器,以及在应用程序解冻时,为解冻的应用程序重新注册传感数据监听器。传感器服务器单元130用于接收输入单元110中的应用程序输入的传感数据监听器,并将传感数据监听器对应的传感数据发送给应用程序,传感器单元140为终端设备100中的传感器,例如,该传感器包括加速度传感器、角速度传感器、速度传感器、温度传感器和湿度传感器等传感器。
以下,将结合图1中的结构对本公开实施例提供的传感器管控方法进行详细介绍,需知,图1中的结构仅用于解释本公开实施例提供的传感器管控方法。但并不构成对本公开实施例提供的传感器管控方法应用的终端设备限定。
请参照图2,图2为本公开实施例提供的一种传感器管控方法的流程示意图。
如图2所示,该传感器管控方法包括步骤S101至步骤S102。
步骤S101、在待冻结应用程序注册有传感数据监听器的情况下,删除所述传感数据监听器,并对所述待冻结应用程序进行冻结。
获取应用程序的类型,在确定应用程序的类型为第一类型时,获取该应用程序的标识位,若应用程序的标识位为第一标识位,且应用程序的标识位为第一标识位的时长大于或等于预设时长,则该应用程序为待冻结应用程序;在确定应用程序的类型为第二类型时,该应用程序为待冻结应用程序,在确定应用程序的类型为第三类型时,该应用程序不是待冻结应用程序。其中,该第一类型、第二类型、第三类型、预设时长和标识位可以根据实际情况进行设置,本实施例对此不做具体限定。根据应用程序的所属的类型能够准确的确定应用程序是否为待解冻应用程序。
在一实施例中,在确定应用程序为待冻结应用程序的情况下,确定该待冻结应用程序是否注册有传感数据监听器,当确定待冻结应用程序未注册传感数据监听器的情况下,对该待冻结应用程序进行冻结;当确定待冻结应用程序有注册传感数据监听器的情况下,将 待冻结应用程序的应用程序信息保存至预设记录链表中,并删除传感数据监听器。其中,该预设记录链表为预先设置的记录表,该预设记录链表的建立可以根据实际情况进行设置,本实施例对此不做具体限定。通过将待冻结应用程序的应用程序信息保存至预设记录链表,便于已冻结应用程序解冻时重新注册传感数据监听器。
示例性的,存在待解冻应用程序1、待解冻应用程序2、待解冻应用程序3、待解冻应用程序4和待解冻应用程序5,其中,待解冻应用程序1、待解冻应用程序3和待解冻应用程序4注册有传感数据监听器,将待解冻应用程序1的应用程序信息、待解冻应用程序3的应用程序信息和待解冻应用程序4的应用程序信息保存至预设记录链表中,并删除待解冻应用程序1、待解冻应用程序3和待解冻应用程序4已注册的传感数据监听器,对待解冻应用程序1、待解冻应用程序2、待解冻应用程序3、待解冻应用程序4和待解冻应用程序5进行冻结。
步骤S102、修改所述传感数据监听器所属传感器的监听器注册数,并在修改后的监听器注册数为预设阈值时,关闭所述传感器。
其中,传感器为终端设备中传感设备,传感器可以根据实际情况进行设置,本实施例对此不做具体限定,例如,该传感器可以为加速度传感器、角速度传感器、速度传感器、温度传感器和湿度传感器等传感器。
在一实施例中,当删除传感器数据监听器删除之后,对传感数据监听器所属传感器的监听器注册数减一,得到传感器修改后的监听器注册数。通过将传感数据监听器所属传感器的监听器注册数减一,以更新传感器的监听器注册数,便于对传感器进行管控。
示例性的,待解冻应用程序注册有加速度传感器监听器,将该加速度传感器监听器删除,加速度传感器监听器对应的加速度传感器已注册的监听器注册数为5个,对加速度传感器已注册的监听器注册数为5减1,得到加速度传感器已注册的监听器注册数为4个。
在一实施例中,确定修改后的传感器的监听器注册数是否为预设阈值,当确定修改后的监听器注册数为预设阈值的情况下,关闭传感器,当确定修改后的监听器注册数不为预设阈值的情况下,继续运行传感器。其中,该预设阈值可以根据实际情况进行设置,本实施例对此不做具体限定,例如,该预设阈值可以设为0。当确定修改后的监听器注册数为预设阈值时,关闭传感器,能够减少不必要的功耗。
示例性的,预设阈值为0,待冻结应用程序注册有传感数据监听器1和传感数据监听器2,传感数据监听器1所属的传感器1已注册的监听器注册数为3,传感数据监听器2所属的传感器2已注册的监听器注册数为1,对传感器1已注册的监听器注册数和传感器2已注册的监听器注册数均减一,修改后的传感器1已注册的监听器注册数为2,修改后的传感器2已注册的监听器注册数为0,传感器1已注册的监听器注册数为2是不等于预设阈 值0,传感器2已注册的监听器注册数为0等于预设阈值0,控制传感器1继续运行,控制传感器2关闭。
在一实施例中,如图3所示,所述方法还包括步骤S103。
步骤S103、在所述监听器注册数大于所述预设阈值的情况下,再次开启所述传感器。
在待解冻应用程序解冻时,确定预设记录链表中是否保存待解冻应用程序的应用程序信息;当确定预设记录链表中存在待解冻应用程序的应用程序信息,为待解冻应用程序注册传感数据监听器。修改传感数据监听器所属传感器的监听器注册数,在修改后的监听器注册数大于所述预设阈值的情况下,再次开启所述传感器。当修改后的监听器注册数大于所述预设阈值的情况下,再次开启所述传感器,既能够减少传感器运行带来的功耗,又能够在需要传感数据时及时提供传感数据。
在一实施例中,对待解冻应用程序注册传感数据监听器的方式可以为:确定待解冻应用程序所需的传感数据;确定采集传感数据的传感器,并为待解冻应用程序注册传感器对应的传感数据监听器。通过确定待解冻应用程序所需的传感数据,根据传感数据能够快速的知晓待解冻应用程序需要注册的传感数据监听器。
在一实施例中,确定待解冻应用程序所需的传感数据的方式可以为:获取预设的待解冻应用程序与传感数据之间的映射关系表;从映射关系表查询到待解冻应用程序所需的传感数据。其中,该映射关系表是预先根据待解冻应用程序和传感数据建立的,该映射关系表的建立可以根据实际情况进行建立,本实施例对此不做具体限定。通过该应该关系表能够快速的确定待解冻应用程序所需的传感数据。
示例性的,待解冻应用程序解冻,预设记录链表中存在该待解冻应用程序的应用程序信息,从该映射关系表中查询到待解冻应用程序所需的传感数据为加速度传感数据,确定采集加速度传感数据的是加速度传感器,对该待解冻应用程序注册加速度传感器对应的传感数据监听器,当前加速度传感器监听器注册数为0,对该监听器注册数加1,得到修改后加速度传感器监听器注册数为1,修改后加速度传感器监听器注册数为1大于预设阈值0,继续开启该加速度传感器。
在一实施例中,在终端设备处于睡眠模式时,关闭终端设备中各传感器,直至终端设备处于工作模式。当终端设备处于睡眠模型关闭终端设备中各传感器,能够减少终端设备的功耗。
示例性的,如图4所示,步骤S201、对应用程序进行冻结或者解冻检测,步骤S202、判断应用程序需要冻结还是解冻,步骤S203、当应用程序需要冻结,在该应用程序有传感数据监听器的情况下,删除传感数据监听器,并对待冻结应用程序进行冻结,步骤S204、修改传感数据监听器所属传感器的监听器注册数,步骤S205、判断修改后的监听器注册数 是否为预设阈值,步骤S206、当修改后的监听器注册数为预设阈值,关闭传感器;步骤S207、当修改后的监听器注册数不为预设阈值,继续运行传感器;步骤S208、当应用程序需要解冻,确定预设记录链表中是否存在待解冻应用程序的应用程序信息,步骤S209、当确定预设记录链表中存在待解冻应用程序的应用程序信息,为待解冻应用程序注册传感数据监听器;步骤S210、当确定预设记录链表中不存在待解冻应用程序的应用程序信息,不为待解冻应用程序注册传感数据监听器;步骤S211、判断修改后的监听器注册数是否大于所述预设阈值,步骤S212、当修改后的监听器注册数大于所述预设阈值,再次开启传感器;步骤S213、当修改后的监听器注册数小于或等于所述预设阈值,不开启传感器。
上述实施例中的传感器管控方法,通过在待冻结应用程序注册有传感数据监听器的情况下,删除传感数据监听器,并对待冻结应用程序进行冻结;修改传感数据监听器所属传感器的监听器注册数,并在修改后的监听器注册数为预设阈值时,关闭传感器。通过删除待冻结应用程序注册的传感数据监听器,修改传感数据监听器传感器的监听器注册数,在感数据监听器注册数为预设阈值时将传感器关闭,能够减少传感器运行带来的功耗,减少了终端设备的功耗。
请参阅图5,图5为本公开实施例提供的另一种终端设备的结构示意性框图。
如图5所示,终端设备300包括处理器301和存储器302,处理器301和存储器302通过总线303连接,该总线比如为I2C(Inter-integrated Circuit)总线。
处理器301用于提供计算和控制能力,支撑整个终端设备的运行。处理器301可以是中央处理单元(Central Processing Unit,CPU),该处理器301还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器302可以是Flash芯片、只读存储器(ROM,Read-Only Memory)磁盘、光盘、U盘或移动硬盘等。
本领域技术人员可以理解,图5中示出的结构,仅仅是与本公开方案相关的部分结构的框图,并不构成对本公开方案所应用于其上的终端设备的限定,终端设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器用于运行存储在存储器中的计算机程序,并在执行所述计算机程序时实现本公开实施例提供的任意一种所述的传感器管控方法。
在一实施方式中,所述处理器用于运行存储在存储器中的计算机程序,并在执行所述计算机程序时实现如下步骤:在待冻结应用程序注册有传感数据监听器的情况下,删除所 述传感数据监听器,并对所述待冻结应用程序进行冻结;以及修改所述传感数据监听器所属传感器的监听器注册数,并在修改后的监听器注册数为预设阈值时,关闭所述传感器。
在一实施例中,所述处理器在实现关闭所述传感器之后,还用于实现:在所述监听器注册数大于所述预设阈值的情况下,再次开启所述传感器。
在一实施例中,所述处理器在实现所述在待冻结应用程序注册有传感数据监听器的情况下,删除所述传感数据监听器时,用于实现:在待冻结应用程序注册有传感数据监听器的情况下,将所述待冻结应用程序的应用程序信息保存至预设记录链表中,并删除所述传感数据监听器。
在一实施例中,所述处理器在实现所述修改所述传感数据监听器所属传感器的监听器注册数时,用于实现:对所述传感数据监听器所属传感器的监听器注册数减一,得到所述传感器修改后的监听器注册数。
在一实施例中,所述处理器还用于实现:在待解冻应用程序解冻时,确定预设记录链表中是否保存所述待解冻应用程序的应用程序信息;以及当确定所述预设记录链表中存在所述待解冻应用程序的应用程序信息,为所述待解冻应用程序注册传感数据监听器。
在一实施例中,所述处理器在实现所述当确定所述预设记录链表中存在所述待解冻应用程序的应用程序信息,为所述待解冻应用程序注册传感数据监听器时,用于实现:确定所述待解冻应用程序所需的传感数据;以及确定采集所述传感数据的传感器,并为所述待解冻应用程序注册所述传感器对应的传感数据监听器。
在一实施例中,所述处理器在实现所述确定所述待解冻应用程序所需的传感数据时,用于实现:获取预设的待解冻应用程序与传感数据之间的映射关系表;以及从所述映射关系表查询到所述待解冻应用程序所需的传感数据。
在一实施例中,所述处理器在实现还用于实现:在终端设备处于睡眠模式时,关闭所述终端设备中各传感器,直至所述终端设备处于工作模式。
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的终端设备的具体工作过程,可以参考前述传感器管控方法实施例中的对应过程,在此不再赘述。
本公开实施例还提供一种存储介质,用于计算机可读存储,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如本公开说明书提供的任一项传感器管控的方法的步骤。
其中,所述存储介质可以是前述实施例所述的终端设备的内部存储单元,例如所述终端设备的硬盘或内存。所述存储介质也可以是所述终端设备的外部存储设备,例如所述终端设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
应当理解,在本公开说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本公开实施例序号仅仅为了描述,不代表实施例的优劣。以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以权利要求的保护范围为准。

Claims (10)

  1. 一种传感器管控方法,包括:
    在待冻结应用程序注册有传感数据监听器的情况下,删除所述传感数据监听器,并对所述待冻结应用程序进行冻结;以及
    修改所述传感数据监听器所属传感器的监听器注册数,并在修改后的监听器注册数为预设阈值的情况下,关闭所述传感器。
  2. 根据权利要求1所述的传感器管控方法,其中,在关闭所述传感器之后,还包括:
    在所述监听器注册数大于所述预设阈值的情况下,再次开启所述传感器。
  3. 根据权利要求1所述的传感器管控方法,其中,所述在待冻结应用程序注册有传感数据监听器的情况下,删除所述传感数据监听器,包括:
    在待冻结应用程序注册有传感数据监听器的情况下,将所述待冻结应用程序的应用程序信息保存至预设记录链表中,并删除所述传感数据监听器。
  4. 根据权利要求1所述的传感器管控方法,其中,所述修改所述传感数据监听器所属传感器的监听器注册数,包括:
    对所述传感数据监听器所属传感器的监听器注册数减一,得到所述传感器修改后的监听器注册数。
  5. 根据权利要求1所述的传感器管控方法,还包括:
    在待解冻应用程序解冻情况下,确定预设记录链表中是否保存所述待解冻应用程序的应用程序信息;
    当确定所述预设记录链表中存在所述待解冻应用程序的应用程序信息,为所述待解冻应用程序注册传感数据监听器。
  6. 根据权利要求5所述的传感器管控方法,其中,所述当确定所述预设记录链表中存在所述待解冻应用程序的应用程序信息,为所述待解冻应用程序注册传感数据监听器,包括:
    确定所述待解冻应用程序所需的传感数据;
    确定采集所述传感数据的传感器,并为所述待解冻应用程序注册所述传感器对应的传感数据监听器。
  7. 根据权利要求6所述的传感器管控方法,其中,所述确定所述待解冻应用程序所需的传感数据,包括:
    获取预设的待解冻应用程序与传感数据之间的映射关系表;以及
    从所述映射关系表查询到所述待解冻应用程序所需的传感数据。
  8. 根据权利要求1-7中任一项所述的传感器管控方法,还包括:
    在终端设备处于睡眠模式的情况下,关闭所述终端设备中各传感器,直至所述终端设备处于工作模式。
  9. 一种终端设备,包括处理器、存储器、存储在所述存储器上并可被所述处理器执行的计算机程序以及用于实现所述处理器和所述存储器之间的连接通信的数据总线,其中所述计算机程序被所述处理器执行时,实现如权利要求1至8中任一项所述的传感器管控方法的步骤。
  10. 一种存储介质,用于计算机可读存储,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现权利要求1至8中任一项所述的传感器管控方法的步骤。
PCT/CN2022/119240 2021-11-24 2022-09-16 传感器管控方法、设备及存储介质 WO2023093230A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111406357.6A CN116166112A (zh) 2021-11-24 2021-11-24 传感器管控方法、设备及存储介质
CN202111406357.6 2021-11-24

Publications (1)

Publication Number Publication Date
WO2023093230A1 true WO2023093230A1 (zh) 2023-06-01

Family

ID=86420545

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/119240 WO2023093230A1 (zh) 2021-11-24 2022-09-16 传感器管控方法、设备及存储介质

Country Status (2)

Country Link
CN (1) CN116166112A (zh)
WO (1) WO2023093230A1 (zh)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677460A (zh) * 2015-12-28 2016-06-15 小米科技有限责任公司 应用程序处理方法以及装置
CN112445586A (zh) * 2019-08-29 2021-03-05 中兴通讯股份有限公司 应用管理方法、装置、终端和可读存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677460A (zh) * 2015-12-28 2016-06-15 小米科技有限责任公司 应用程序处理方法以及装置
CN112445586A (zh) * 2019-08-29 2021-03-05 中兴通讯股份有限公司 应用管理方法、装置、终端和可读存储介质
US20220244985A1 (en) * 2019-08-29 2022-08-04 Zte Corporation Application management method and device, terminal and readable storage medium

Also Published As

Publication number Publication date
CN116166112A (zh) 2023-05-26

Similar Documents

Publication Publication Date Title
US8065540B2 (en) Power control for information handling system having shared resources
KR102148948B1 (ko) 전자 장치의 멀티 태스킹 방법 및 그 전자 장치
US20150127965A1 (en) Method of controlling power supply for fingerprint sensor, fingerprint processing device, and electronic device performing the same
US8255595B2 (en) Enabling access to peripheral resources at a processor
US10470133B2 (en) Electronic device and method for controlling application and component
CN112703714B (zh) 应用程序处理方法和装置、计算机设备、计算机可读存储介质
WO2015081700A1 (zh) 一种上报传感器数据的方法和终端
CN110018901B (zh) 内存回收方法、装置、计算机设备和计算机可读存储介质
US20160169956A1 (en) Electronic device and method of determining abnormality of electronic device connecting unit
US20140082346A1 (en) Method and System for Managing Basic Input/Output System (BIOS) Configuration Data of BIOS
CN107045383B (zh) 通过监视移动应用的活动来延长电池寿命的系统和方法
US20150066424A1 (en) Electronic device and method for measuring position change
US20160156214A1 (en) Method for charging control and an electronic device thereof
WO2020103017A1 (zh) 一种开机流程控制方法、开机流程控制装置及终端设备
CN109408465A (zh) 文件归属信息记录方法、装置、存储介质及终端
WO2019128573A1 (zh) 信息处理方法、装置、计算机设备和计算机可读存储介质
CN110018905B (zh) 信息处理方法、装置、计算机设备和计算机可读存储介质
WO2023093230A1 (zh) 传感器管控方法、设备及存储介质
US20160292994A1 (en) Suppress and Resume Notifications Based on Motion
WO2019128586A1 (zh) 应用程序处理方法、电子设备、计算机可读存储介质
US8250038B2 (en) System and method for data backup in communication devices
WO2021037111A1 (zh) 应用管理方法、装置、终端和可读存储介质
US11243597B2 (en) Microprocessor power logging at a sub-process level
US11163589B2 (en) Class unloading method and electronic device
CN110045812B (zh) 信息处理方法、装置、计算机设备和计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22897316

Country of ref document: EP

Kind code of ref document: A1