WO2017206889A1 - 传感器调用函数的关闭方法、装置、存储介质及电子设备 - Google Patents

传感器调用函数的关闭方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2017206889A1
WO2017206889A1 PCT/CN2017/086513 CN2017086513W WO2017206889A1 WO 2017206889 A1 WO2017206889 A1 WO 2017206889A1 CN 2017086513 W CN2017086513 W CN 2017086513W WO 2017206889 A1 WO2017206889 A1 WO 2017206889A1
Authority
WO
WIPO (PCT)
Prior art keywords
function
sensor
time
time period
pressure value
Prior art date
Application number
PCT/CN2017/086513
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 WO2017206889A1 publication Critical patent/WO2017206889A1/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
    • 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/329Power saving characterised by the action undertaken by task scheduling

Definitions

  • the present invention relates to the field of electronic devices, and in particular, to a method, device, storage medium and electronic device for shutting down a sensor call function.
  • mobile phones are the most commonly used and most important electronic devices for most users.
  • the various sensor devices in mobile phones provide a hardware foundation for the diversified functions of applications.
  • the embodiment of the invention provides a method, a device, a storage medium and an electronic device for closing a sensor calling function, which can reduce the standby power consumption of the electronic device.
  • an embodiment of the present invention provides a method for shutting down a sensor call function, including the following steps:
  • the sensor calling function in the function set is closed in order from the low level to the high level in the function level.
  • the embodiment of the present invention further provides a device for shutting down a sensor call function, including:
  • a grading module configured to set a function level for a plurality of sensor calling functions in the function set according to a predetermined parameter
  • An acquiring module configured to acquire a correspondence between a pressure value of the pressing operation and a time during a duration of the pressing operation when the pressing interface detects a pressing operation
  • a generating module configured to generate a corresponding relationship between the closing speed and the time according to the correspondence between the pressure value and the time;
  • And closing a module configured to close the sensor calling function in the function set in a sequence from a low level to a high level according to a function level according to the correspondence between the closing speed and the time.
  • an embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute a shutdown method of the sensor call function.
  • an embodiment of the present invention further provides an electronic device, including a processor, a memory, the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is configured to execute The following steps:
  • the sensor calling function in the function set is closed in order from the low level to the high level in the function level.
  • FIG. 1 is a flowchart of a method for shutting down a sensor calling function according to an embodiment of the present invention.
  • FIG. 2 is a flow chart of a step in the flow chart shown in FIG. 1.
  • FIG. 3 is another flowchart of a method for shutting down a sensor call function according to an embodiment of the present invention.
  • FIG. 4 is a flow chart of a step in the flow chart shown in FIG.
  • FIG. 5 is a structural diagram of a device for turning off a sensor call function according to an embodiment of the present invention.
  • Figure 6 is a structural diagram of a module in the structural diagram shown in Figure 5.
  • FIG. 7 is a structural diagram of an electronic device according to an embodiment of the present invention.
  • FIG. 8 is another structural diagram of an electronic device according to an embodiment of the present invention.
  • non-standard sensor usage methods such as holding the sensor call function during standby, are not released, resulting in the system being unable to sleep, the sensor device continuously consuming power, and significantly increasing the standby power consumption of the electronic device.
  • Embodiments of the present invention provide a method for shutting down a sensor call function, including the following steps:
  • the sensor calling function in the function set is closed in order from the low level to the high level in the function level.
  • the step of generating a correspondence between the closing speed and the time according to the correspondence between the pressure value and the time comprises:
  • the step of closing the sensor calling function in the function set in order from the low level to the high level according to the function level according to the correspondence between the closing speed and the time comprises:
  • the operations of closing the sensor calling function in the function set are sequentially performed in each second time period until the pressing operation ends; and the order from the low level to the high level according to the function level is performed. Turn off the sensor call function.
  • the generating a closing speed according to the correspondence between the pressure value and time also include:
  • the pressing operation ends or the average pressure value in the first time period is less than a threshold, it is determined that the pressing operation is an erroneous operation.
  • the step of generating a correspondence between the closing speed and the time according to the correspondence between the pressure value and the time further includes:
  • the pressing operation ends or the average pressure value in the first time period is less than a threshold, it is determined that the pressing operation is an erroneous operation.
  • the function setting function level of multiple sensor calls within the collection also include the following steps:
  • the identifier list is displayed according to the function set, and each identifier in the identifier list corresponds to one of the sensor calling functions.
  • the step of closing the sensor calling function in the function set in order from the low level to the high level according to the function level according to the correspondence between the closing speed and the time further comprises:
  • the identifier corresponding to the sensor call function is marked.
  • the step of setting a function level for a plurality of sensor calling functions within a function set according to a predetermined parameter comprises:
  • the function level is set for multiple sensor call functions based on the frequency of use of the sensor call function.
  • the step of setting a function level for a plurality of sensor calling functions within a function set according to a predetermined parameter comprises:
  • a function level is set for a plurality of sensor calling functions according to a power consumption value of the sensor corresponding to the sensor calling function.
  • FIG. 1 is a flowchart of a method for shutting down a sensor calling function according to an embodiment of the present invention.
  • the method for closing the sensor calling function is mainly applied to the mobile device.
  • the method for closing the sensor calling function in this embodiment includes the following steps:
  • the predetermined parameter may be a common degree of the sensor calling function, that is, the sensor call The frequency of use of the function, the higher the frequency of use, the higher the priority of the sensor calling function.
  • the predetermined parameter may also be a power consumption value of a normal operation of the sensor corresponding to the sensor calling function, and the lower the power consumption value, the higher the corresponding priority.
  • the manipulation interface is used for the user to press on the touch, and automatically pops up when the mobile terminal device detects that its power consumption value exceeds a predetermined value or the power is lower than a predetermined value. Since the pressure sensor reports a pressing pressure value every time interval, the pressure value detected by the mobile terminal device is a discrete set of a plurality of pressing pressure values. For example, in the embodiment, the pressure sensor is not spaced. A pressure value is reported for 500ms or 600ms. The corresponding relationship between the pressure value and the time is that each pressure value uploaded by the pressure sensor and the time point at which the pressure value is detected can be recorded by the following list:
  • the step S103 includes the following sub-steps:
  • the starting time of the pressing operation is 500 ms, and the first time period is 1 s, that is, the average pressure value in the first first time period is (F1+F2)/2; the second The average pressure value in the first time period is (F3+F4)/2; the average pressure value in the third first time period is (F5+F6)/2; the average pressure in the fourth first time period The value is (F7+F8)/2; the average pressure value in the fifth first time period is (F9+F10)/2.
  • the value, k is a coefficient of positive correlation, b is a constant, and the setting of b and k can be obtained by multiple experiments to obtain an optimum value.
  • step S103 in the first time period of the first pressing operation, if the pressing operation ends or the average pressure value in the first time period is less than a threshold, determining that the pressing operation is Misoperation.
  • the sensor calling function in the function set is closed in a sequence from a low level to a high level according to a function level.
  • step S104 when the calling function is turned off, when the end of the pressing operation is detected, the closing operation is immediately stopped.
  • the step S104 may include: performing an operation of closing the sensor calling function in the function set in turn for each second time period according to a corresponding closing speed of each second time period until the pressing operation End; and when the sensor call function is turned off, in order from low to high.
  • N is a natural number greater than one.
  • a pressure value is acquired every 500 ms, and the closing speed within the next 500 ms is acquired according to the pressure. For example, if the pressure value is 20 N, the two sensor calling functions are turned off within the next 500 ms. When a pressure value of 40 N is detected, the four sensor calling functions are turned off within 500 ms after the pressure value is acquired.
  • the present invention employs hierarchical grading of a plurality of sensor calling functions according to predetermined parameters to generate a function set; when the pressing interface detects the pressing operation, the corresponding relationship between the pressure value of the pressing operation and the time is acquired in real time during the duration of the pressing operation; and the corresponding relationship between the closing speed and the time is generated according to the correspondence between the pressure value and the time
  • the sensor calling function in the function set is turned off in order from low level to high level, the effect of reducing power consumption is realized, and since the closing speed of the sensor calling function is based on the pressure value
  • the corresponding relationship of time is generated, and the speed of closing the sensor calling function can be modulated by controlling the magnitude of the pressure value, thereby having the effect of convenient operation.
  • the function can be turned off. In the process, the sensor call function with low priority is first turned off to ensure the normal use of the mobile communication device.
  • FIG. 3 is another flowchart of a method for shutting down a sensor calling function according to an embodiment of the present invention.
  • the method for closing the sensor calling function in this embodiment includes the following steps:
  • the predetermined parameter may be a common degree of the sensor calling function, that is, a frequency of use of the sensor calling function, and a higher frequency of use of the sensor calling function has a higher priority.
  • the predetermined parameter may also be a power consumption value of a normal operation of the sensor corresponding to the sensor calling function, and the lower the power consumption value, the higher the corresponding priority.
  • the trigger signal may be generated when the terminal device detects that its own power consumption is too high or the power is below a predetermined value.
  • the manipulation interface is used for the user to press on the touch, and automatically pops up when the mobile terminal device detects that its power consumption value exceeds a predetermined value or the power is lower than a predetermined value. Since the pressure sensor reports a pressing pressure value every time interval, the pressure value detected by the mobile terminal device is a discrete set of a plurality of pressing pressure values. For example, in the embodiment, the pressure sensor is not spaced. A pressure value is reported for 500ms or 600ms. The corresponding relationship between the pressure value and the time is that each pressure value uploaded by the pressure sensor and the time point at which the pressure value is detected can be recorded by the following list:
  • the step S203 includes the following sub-steps:
  • the starting time of the pressing operation is 500 ms, and the first time period is 1 s, that is, the average pressure value in the first first time period is (F1+F2)/2;
  • the average pressure value in the second first time period is (F3+F4)/2;
  • the average pressure value in the third first time period is (F5+F6)/2;
  • the fourth first time The average pressure value in the segment is (F7+F8)/2;
  • the average pressure value in the fifth first time period is (F9+F10)/2.
  • S2042 Acquire a closing speed of the second time period corresponding to the first time period according to the average pressure value, where a starting point of the second time period is delayed from the starting point of the first time period by the first time period, and The second time period is equal to the duration of the first time period.
  • the sensor calling function in the function set is closed in a sequence from a low level to a high level in a function level, and each of the sensor calling functions is closed, corresponding to the sensor calling function.
  • the logo is marked.
  • step S205 when the calling function is turned off, when the end of the pressing operation is detected, the closing operation is immediately stopped.
  • the step 205 may include: performing an operation of closing the sensor calling function in the function set in turn for each second time period according to a corresponding closing speed of each second time period until the pressing operation End; and when the sensor call function is turned off, in order from low to high.
  • N is a natural number greater than one.
  • a pressure value is acquired every 500 ms, and the closing speed within the next 500 ms is acquired according to the pressure. For example, if the pressure value is 20 N, the two sensor calling functions are turned off within the next 500 ms. When a pressure value of 40 N is detected, the four sensor calling functions are turned off within 500 ms after the pressure value is acquired.
  • the color change of the identifier of the closed sensor calling function may be adopted, thereby facilitating user identification.
  • this embodiment adds a pop-up identification list and marks a corresponding identifier in the identification list every time a sensor calling function is closed, thereby facilitating the intuitive observation of the speed and progress of the sensor calling function, which is beneficial to improve the user. Experience.
  • the invention also provides a device for closing a sensor calling function, comprising:
  • a grading module configured to set a function level for a plurality of sensor calling functions in the function set according to a predetermined parameter
  • An acquiring module configured to acquire a correspondence between a pressure value of the pressing operation and a time during a duration of the pressing operation when the pressing interface detects a pressing operation
  • a generating module configured to generate a corresponding relationship between the closing speed and the time according to the correspondence between the pressure value and the time;
  • And closing a module configured to close the sensor calling function in the function set in a sequence from a low level to a high level according to a function level according to the correspondence between the closing speed and the time.
  • the generating module comprises:
  • a first acquiring unit configured to acquire, according to a time point when the pressing operation is detected, an average pressure value in the first time period every first time period
  • a second acquiring unit configured to acquire, according to the average pressure value, a closing speed of the second time period corresponding to the first time period, where a starting point of the second time period is delayed relative to a starting point of the first time period
  • the first time period, and the second time period is equal to the duration of the first time period.
  • the shutdown module is configured to perform an operation of closing a sensor calling function in the function set in sequence for each second time period according to a corresponding closing speed of each second time period until the second pressing The operation ends; and the sensor call function is turned off in order from the low level to the high level according to the function level.
  • the ranking module is configured to set a function level for a plurality of sensor call functions based on a frequency of use of the sensor call function.
  • the grading module is configured to set a function level for the plurality of sensor calling functions according to a power consumption value of the sensor corresponding to the sensor calling function.
  • FIG. 5 is a structural diagram of a device for shutting down a sensor call function according to an embodiment of the present invention.
  • the device for closing the sensor calling function in this embodiment includes a grading module 301, an obtaining module 302, a generating module 303, and a closing module 304.
  • the ranking module 301 is configured to set a function level for a plurality of sensor calling functions within the function set according to predetermined parameters.
  • the grading module 301 is configured to set a function level to the plurality of sensor calling functions according to the frequency of use of the sensor calling function; or, to set a function level for the plurality of sensor calling functions according to the power consumption value of the sensor corresponding to the sensor calling function.
  • the obtaining module 302 is configured to acquire a correspondence between the pressure value of the pressing operation and the time during the duration of the pressing operation when the pressing interface detects the pressing operation.
  • the generating module 303 generates a correspondence relationship between the closing speed and the time according to the correspondence between the pressure value and the time.
  • the generating module 303 includes a first acquiring unit 3031 and a second acquiring unit 3032.
  • the first obtaining unit 3031 is configured to acquire an average pressure value in the first time period every first time period by using a time point at which the pressing operation is detected as a starting point; and the second obtaining unit 3032 is configured to use the average pressure according to the average pressure
  • the value obtains a closing speed of the second time period corresponding to the first time period, and the starting point of the second time period is delayed from the starting point of the first time period by the first time period, and the second time period is The duration of a period of time is equal.
  • the closing module 304 is configured to close the sensor calling function in the function set in a sequence from a low level to a high level according to a function level according to the correspondence between the closing speed and time.
  • the closing module 304 is specifically configured to perform, according to the corresponding closing speed of each second time period, the operation of closing the sensor calling function in the function set in sequence for each second time period until the end of the pressing operation; and according to the function level
  • the sensor call function is turned off in order from low to high.
  • the present invention employs a plurality of sensor calling functions according to predetermined parameters to generate a function set; when the pressing interface detects the pressing operation, the pressure value and time of the pressing operation are acquired in real time during the duration of the pressing operation. Corresponding relationship; generating a correspondence relationship between the closing speed and the time according to the correspondence between the pressure value and the time; according to the correspondence between the closing speed and the time, the sensor calling function in the function set is closed in order from low level to high level, The effect of reducing the power consumption, and because the closing speed of the sensor calling function is generated according to the corresponding relationship between the pressure value and the time, the speed of closing the sensor calling function can be modulated by controlling the magnitude of the pressure value, thereby having the effect of convenient operation. Further, since the plurality of sensor calling functions are classified according to predetermined parameters, the sensor calling function with low priority can be turned off first during the closing process, thereby ensuring the normal use of the mobile communication device as much as possible.
  • the embodiment of the invention further provides an electronic device, which may be a device such as a smart phone or a tablet computer.
  • the electronic device 400 includes a processor 401 and a memory 402.
  • the processor 401 is electrically connected to the memory 402.
  • the processor 401 is a control center of the electronic device 400, which connects various parts of the entire electronic device using various interfaces and lines, executes the electronic by running or loading an application stored in the memory 402, and calling data stored in the memory 402.
  • the various functions and processing data of the device enable overall monitoring of the electronic device.
  • the processor 401 in the electronic device 400 loads the instructions corresponding to the process of one or more applications into the memory 402 according to the following steps, and is stored and stored in the memory 402 by the processor 401.
  • the application thus implementing various functions:
  • the sensor calling function in the function set is closed in the order of the function level from low to high.
  • the processor 401 performs the following steps: taking a time point at which the pressing operation is detected as a starting point, acquiring an average pressure value in the first time period every first time period; acquiring and calculating according to the average pressure value The closing time of the second time period corresponding to the first time period, the starting point of the second time period is delayed by a first time period relative to the starting point of the first time period, and the second time period is equal to the time length of the first time period.
  • the processor 401 further performs the steps of: performing, according to the corresponding shutdown speed of each second time period, the operation of the sensor calling function in the closed function set in each second time period until the pressing The operation ends; and the sensor call function is turned off in order from the low level to the advanced level at the function level.
  • the processor 401 performs the following steps. : Judging that the pressing operation is an erroneous operation.
  • the processor 401 before the pressing operation is detected by the manipulation interface, before the pressure value of the pressing operation is acquired in real time for the duration of the pressing operation, the processor 401 further performs the following steps: when the trigger signal is detected, A list of identifiers is displayed according to the function set, and each identifier in the identifier list corresponds to a sensor calling function.
  • the processor 401 each time a sensor call function is closed, the processor 401 also performs the step of marking the identity corresponding to the sensor call function.
  • processor 401 also performs the step of setting a function level for a plurality of sensor call functions based on the frequency of use of the sensor call function.
  • the processor 401 also performs the step of setting a function level for the plurality of sensor call functions based on the power consumption value of the sensor corresponding to the sensor call function.
  • Memory 402 can be used to store applications and data.
  • the application stored in the memory 402 contains instructions that are executable in the processor.
  • Applications can form various functional modules.
  • the processor 401 executes various functional applications and data processing by running an application stored in the memory 402.
  • the electronic device 400 further includes: a display screen 403, control Circuit 404, RF circuit 405, input unit 406, audio circuit 407, sensor 408, and power supply 409.
  • the processor 401 is electrically connected to the display screen 403, the control circuit 404, the radio frequency circuit 405, the input unit 406, the audio circuit 407, the sensor 408, and the power source 409, respectively.
  • the display screen 403 can be used to display information entered by the user or information provided to the user as well as various graphical user interfaces of the electronic device, which can be composed of images, text, icons, video, and any combination thereof.
  • the display screen 403 can be used as the manipulation interface in the embodiment of the present invention.
  • the control circuit 404 is electrically connected to the display screen 403 for controlling the display screen 403 to display information.
  • the radio frequency circuit 405 is configured to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices through wireless communication, and to transmit and receive signals with network devices or other electronic devices.
  • the input unit 406 can be configured to receive input digits, character information, or user characteristic information (eg, fingerprints), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function controls.
  • the input unit 406 can include a fingerprint identification module.
  • the audio circuit 407 can provide an audio interface between the user and the electronic device through a speaker and a microphone.
  • Sensor 408 is used to collect external environmental information.
  • Sensor 408 can include ambient brightness sensors, acceleration sensors, light sensors, motion sensors, and other sensors.
  • the light sensor can include an ambient light sensor and a proximity sensor.
  • the ambient light sensor can adjust the brightness of the display panel according to the brightness of the ambient light
  • the proximity sensor can turn off the display panel and/or the backlight when the terminal moves to the ear.
  • the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
  • the terminal can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, no longer Narration.
  • Power source 409 is used to power various components of electronic device 400.
  • the power supply 409 can be logically coupled to the processor 401 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
  • the electronic device 400 may further include a camera, a Bluetooth module, and the like, and details are not described herein.
  • the electronic device uses a plurality of sensor calling functions according to predetermined parameters to classify a function set; when the pressing interface detects the pressing operation, the pressure of the pressing operation is obtained in real time during the duration of the pressing operation. a correspondence between the value and the time; generating a correspondence relationship between the closing speed and the time according to the correspondence between the pressure value and the time; and closing the sensor calling function in the function set in order from the low level to the high level according to the correspondence between the closing speed and the time.
  • the effect of reducing power consumption is realized, and since the closing speed of the sensor calling function is generated according to the correspondence relationship between the pressure value and the time, the speed of closing the sensor calling function can be modulated by controlling the magnitude of the pressure value, thereby having convenient operation.
  • the effect is further that, since the plurality of sensor calling functions are classified according to predetermined parameters, the sensor calling function with low priority can be turned off first during the closing process, thereby ensuring the normal use of the electronic device as much as possible.
  • the embodiment of the invention further provides a storage medium, wherein the storage medium stores a plurality of instructions, the instructions being adapted to be loaded by a processor to perform the method for closing the sensor calling function described in any of the above embodiments.
  • the storage medium may include: a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
  • the one or more operations may constitute computer readable instructions stored on one or more computer readable media that, when executed by an electronic device, cause the computing device to perform the operations.
  • the order in which some or all of the operations are described should not be construed as implying that the operations must be sequential. Those skilled in the art will appreciate alternative rankings that have the benefit of this specification. Moreover, it should be understood that not all operations must be present in every embodiment provided herein.
  • the word "preferred” as used herein is intended to serve as an example, instance, or illustration. Any aspect or design described as “preferred” by the text is not necessarily to be construed as being more advantageous than other aspects or designs. Instead, the use of the word “preferred” is intended to present a concept in a specific manner.
  • the term “or” as used in this application is intended to mean an “or” or “an” That is, unless otherwise specified or clear from the context, "X employs A or B” means naturally including any one of the permutations. That is, if X uses A; X uses B; Or X uses both A and B, then "X uses A or B" is satisfied in any of the foregoing examples.
  • Each functional unit in the embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

传感器调用函数的关闭方法,包括:根据预定参数对函数集合内的多个传感器调用函数设置函数级别(S101),在操控界面检测到按压操作时,在该次按压操作的持续时间内实时获取按压操作的压力值与时间的对应关系(S102),根据压力值与时间的对应关系生成关闭速度与时间的对应关系(S103),根据关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数(S104)。还提供传感器调用函数的关闭装置、存储介质及电子设备。

Description

传感器调用函数的关闭方法、装置、存储介质及电子设备
本申请要求于2016年05月31日提交中国专利局、申请号为201610379852.5、发明名称为“传感器调用函数的关闭方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及电子设备领域,特别是涉及一种传感器调用函数的关闭方法、装置、存储介质及电子设备。
背景技术
目前,手机已经是目前绝大多数用户最常用最重要的电子设备,手机中各种各样的传感器设备为应用的多元化功能提供了硬件基础。
发明内容
本发明实施例提供了一种传感器调用函数的关闭方法、装置、存储介质及电子设备,可以减少电子设备的待机功耗。
第一方面,本发明实施例提供一种传感器调用函数的关闭方法,包括以下步骤:
根据预定参数对函数集合内的多个传感器调用函数设置函数级别;
在所述操控界面检测到按压操作时,在所述按压操作的持续时间内获取所述按压操作的压力值与时间的对应关系;
根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系;
根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。
第二方面,本发明实施例还提供了一种传感器调用函数的关闭装置,包括:
分级模块,用于根据预定参数对函数集合内的多个传感器调用函数设置函数级别;
获取模块,用于在所述操控界面检测到按压操作时,在所述按压操作的持续时间内获取所述按压操作的压力值与时间的对应关系;
生成模块,用于根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系;
关闭模块,用于根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。
第三方面,本发明实施例还提供了一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述传感器调用函数的关闭方法。
第四方面,本发明实施例还提供了一种电子设备,包括处理器、存储器,所述处理器与所述存储器电性连接,所述存储器用于存储指令和数据;所述处理器用于执行以下步骤:
根据预定参数对函数集合内的多个传感器调用函数设置函数级别;
在所述操控界面检测到按压操作时,在所述按压操作的持续时间内获取所述按压操作的压力值与时间的对应关系;
根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系;
根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。
附图说明
图1为本发明实施例提供的传感器调用函数的关闭方法一种流程图。
图2为图1所示流程图中一步骤的流程图。
图3为本发明实施例提供的传感器调用函数的关闭方法的另一种流程图。
图4为图3所示流程图中一步骤的流程图。
图5为本发明实施例提供的传感器调用函数的关闭装置的一种结构图。
图6为图5所示结构图中一模块的结构图。
图7为本发明实施例提供的电子设备的一种结构图。
图8为本发明实施例提供的电子设备的另一种结构图。
具体实施方式
请参照图式,其中相同的组件符号代表相同的组件,本发明的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本发明具体实施例,其不应被视为限制本发明未在此详述的其它具体实施例。
在以下的说明中,本发明的具体实施例将参考由一部或多部计算机所执行之作业的步骤及符号来说明,除非另有述明。因此,其将可了解到这些步骤及 操作,其中有数次提到为由计算机执行,包括了由代表了以一结构化型式中的数据之电子信号的计算机处理单元所操纵。此操纵转换该数据或将其维持在该计算机之内存系统中的位置处,其可重新配置或另外以本领域技术人员所熟知的方式来改变该计算机之运作。该数据所维持的数据结构为该内存之实体位置,其具有由该数据格式所定义的特定特性。但是,本发明原理以上述文字来说明,其并不代表为一种限制,本领域技术人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。
实际应用中,不规范的传感器使用方法,例如在待机期间仍持有传感器调用函数不释放,导致系统无法休眠、传感器设备持续耗电,明显增大电子设备的待机功耗。
本发明实施例提供一种传感器调用函数的关闭方法,包括以下步骤:
根据预定参数对函数集合内的多个传感器调用函数设置函数级别;
在所述操控界面检测到按压操作时,在所述按压操作的持续时间内获取所述按压操作的压力值与时间的对应关系;
根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系;
根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。
在一些实施例中,所述根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系的步骤包括:
以检测到所述按压操作的时间点作为起点,每隔第一时间段获取在所述第一时间段内的平均压力值;
根据所述平均压力值获取与所述第一时间段对应的第二时间段的关闭速度,所述第二时间段的起点相对所述第一时间段的起点延时所述第一时间段,且所述第二时间段与所述第一时间段的时长相等。
在一些实施例中,所述根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数的步骤包括:
根据每一第二时间段的对应关闭速度,依次在每一第二时间段执行关闭所述函数集合中的传感器调用函数的操作直至所述按压操作结束;且按照函数级别从低级到高级的顺序关闭所述传感器调用函数。
在一些实施例中,所述根据所述压力值与时间的对应关系生成关闭速度与 时间的对应关系的步骤还包括:
在所述按压操作的第一个所述第一时间段内,若所述按压操作结束或者在所述第一时间段内的平均压力值小于一阈值时,判断所述按压操作为误操作。
在一些实施例中,其中,所述根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系的步骤还包括:
在所述按压操作的第一个所述第一时间段内,若所述按压操作结束或者在所述第一时间段内的平均压力值小于一阈值时,判断所述按压操作为误操作。
在一些实施例中,在所述操控界面检测到按压操作时,在所述按压操作的持续时间内实时获取按压操作的压力值与时间的对应关系的步骤之前,在所述根据预定参数对函数集合内的多个传感器调用函数设置函数级别的步骤之后还包括以下步骤:
检测到触发信号时,根据所述函数集合显示标识列表,所述标识列表中每个标识分别对应一所述传感器调用函数。
在一些实施例中,所述根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数的步骤还包括:
每关闭一个所述传感器调用函数,对与所述传感器调用函数对应的标识进行标记。
在一些实施例中,所述根据预定参数对函数集合内的多个传感器调用函数设置函数级别的步骤包括:
根据传感器调用函数的使用频率对多个传感器调用函数设置函数级别。
在一些实施例中,所述根据预定参数对函数集合内的多个传感器调用函数设置函数级别的步骤包括:
根据所述传感器调用函数对应的传感器的功耗值对多个传感器调用函数进行设置函数级别。
在一优选实施例中,提供了一种传感器调用函数的关闭方法。请参照图1,图1为本发明实施例提供的传感器调用函数的关闭方法的一种流程图。所述传感器调用函数的关闭方法主要应用于移动设备中,本实施例的传感器调用函数的关闭方法包括以下步骤:
S101,根据预定参数对函数集合内的多个传感器调用函数设置函数级别。
其中,该预定参数可以是传感器调用函数的常用程度也即是该传感器调用 函数的使用频率,使用频率越高的传感器调用函数的优先级别越高。该预定参数还可以是传感器调用函数所对应的传感器的正常运行的功耗值,功耗值越低,对应的优先级越高。
S102,在操控界面检测到按压操作时,在该次按压操作的持续时间内实时获取按压操作的压力值与时间的对应关系。
其中,该操控界面用于供用户在上触摸按压,其在该移动终端设备检测到自身的功耗值超过预定值或者电量低于预定值时自动弹出。由于压力传感器每间隔一定时间才会上报一次按压压力值,因此实质上该移动终端设备检测到的压力值是多个按压压力值构成的离散集合,例如,在本实施例中,压力传感器没间隔500ms或600ms上报一个压力值,该压力值与时间的对应关系是具有该压力传感器上传的每一压力值,以及检测到该压力值的时间点,其可以通过如下列表的形式记录:
时间点 压力值
500ms F1
1000ms F2
1500ms F3
...... ......
3000ms F6
3500ms F7
4000ms F8
4500ms F9
5000ms F10
当然,还可以坐标图的形式记录,横轴代表时间,纵轴代表压力值。
S103,根据压力值与时间的对应关系生成关闭速度与时间的对应关系。
在一些实施方式中,根据压力值与时间的对应关系生成关闭速度与时间的对应关系时,压力值越高,关闭速度越高。并且,由于压力值的上传具有一定延时,因此,当前时间点的关闭速度是与预定时间段之前的压力值对应,例如,本实施例中该预定时间段为500ms。参考图2,在一些实施例中,该步骤S103包括以下子步骤:
S1031,以检测到该按压操作的时间点作为起点,每隔第一时间段获取在 该第一时间段内的平均压力值。
例如,在该步骤S1031中,该按压操作起点时间为500ms,该第一时间段为1s,也即第一个第一时间段内的平均压力值为(F1+F2)/2;第二个第一时间段内的平均压力值为(F3+F4)/2;第三个第一时间段内的平均压力值为(F5+F6)/2;第四个第一时间段内的平均压力值为(F7+F8)/2;该第五个第一时间段内的平均压力值为(F9+F10)/2。
S1032,根据所述平均压力值获取与该第一时间段对应的第二时间段的关闭速度,第二时间段的起点相对该第一时间段的起点延时所述第一时间段,且第二时间段与第一时间段的时长相等。
在步骤S1032中,具体地,第一时间段的平均压力值与对应的第二时间段的关闭速度呈正相关,例如,该关闭速度=kF-b,其中,F为该时间段内的平均压力值,k为正相关的系数,b为常数,该b和k的设置可以通过多次试验得出,以取一个最佳值。
在步骤S103中,在该次按压操作的第一个所述第一时间段内,若该按压操作结束或者在该第一时间段内的平均压力值小于一阈值时,判断该次按压操作为误操作。
S104,根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。
在该步骤S104中,在关闭调用函数时,当检测到按压操作结束时,立刻停止关闭操作。在一些实施方式中,该步骤S104可以包括:根据每一第二时间段的对应关闭速度,依次在每一第二时间段执行关闭所述函数集合中的传感器调用函数的操作直至该次按压操作结束;且在关闭所述传感器调用函数时,按照从低级到高级的顺序。
在一些实施例中,还可以采用每获取到一个压力值,就在接下来以对应的速度关闭N个传感器调用函数,其中N为大于1的自然数。在本实施例中,即为每隔500ms采集到一个压力值,根据该压力获取下一个500ms内的关闭速度,例如该压力值为20牛,则在下一个500ms内关闭2个传感器调用函数,如果又检测到一压力值为40牛,则在获取到该压力值后的一个500ms内关闭4个传感器调用函数。
由上可知,本发明采用根据预定参数将多个传感器调用函数分级,以生成 函数集合;在操控界面检测到按压操作时,在该次按压操作的持续时间内实时获取按压操作的压力值与时间的对应关系;根据压力值与时间的对应关系生成关闭速度与时间的对应关系;根据关闭速度与时间的对应关系,以从低级到高级的顺序关闭所述函数集合中的传感器调用函数,从实现降低功耗的效果,并且由于该传感器调用函数的关闭速度是根据压力值与时间的对应关系生成的,可以通过控制压力值的大小来调制关闭传感器调用函数的速度,从而具有操作便捷的效果,进一步地,由于该多个传感器调用函数根据预定参数进行了分级,可以在关闭过程中先关闭优先级低的传感器调用函数,从而尽量保证该移动通信设备的正常使用。
在一优选实施例中,请参照图3,图3为本发明实施例提供的传感器调用函数的关闭方法的另一种流程图。其中,本实施例中的传感器调用函数的关闭方法包括以下步骤:
S201,根据预定参数对函数集合内的多个传感器调用函数设置函数级别。
其中,该预定参数可以是传感器调用函数的常用程度也即是该传感器调用函数的使用频率,使用频率越高的传感器调用函数的优先级别越高。该预定参数还可以是传感器调用函数所对应的传感器的正常运行的功耗值,功耗值越低,对应的优先级越高。
S202,检测到触发信号时,根据所述函数集合显示对应的标识列表,该标识列表中每个标识分别对应一所述传感器调用函数。
在一些实施方式中,该触发信号可以由该终端设备检测到自身功耗过高或电量低于预定值时产生。
S203,在操控界面检测到按压操作时,在该次按压操作的持续时间内实时获取按压操作的压力值与时间的对应关系。
其中,该操控界面用于供用户在上触摸按压,其在该移动终端设备检测到自身的功耗值超过预定值或者电量低于预定值时自动弹出。由于压力传感器每间隔一定时间才会上报一次按压压力值,因此实质上该移动终端设备检测到的压力值是多个按压压力值构成的离散集合,例如,在本实施例中,压力传感器没间隔500ms或600ms上报一个压力值,该压力值与时间的对应关系是具有该压力传感器上传的每一压力值,以及检测到该压力值的时间点,其可以通过如下列表的形式记录:
时间点 压力值
500ms F1
1000ms F2
1500ms F3
...... ......
3000ms F6
3500ms F7
4000ms F8
4500ms F9
5000ms F10
当然,还可以坐标图的形式记录,横轴代表时间,纵轴代表压力值。
S204,根据压力值与时间的对应关系生成关闭速度与时间的对应关系。
在一些实施例中,根据压力值与时间的对应关系生成关闭速度与时间的对应关系时,压力值越高,关闭速度越高。并且,由于压力值的上传具有一定延时,因此,当前时间点的关闭速度是与预定时间段之前的压力值对应,例如,本实施例中该预定时间段为500ms。参考图4,在一些实施例中,该步骤S203包括以下子步骤:
S2041,以检测到该按压操作的时间点作为起点,每隔第一时间段获取在该第一时间段内的平均压力值。
例如,在该步骤S1031中,该按压操作起点时间为500ms,该第一时间段为1s,也即是该第一个第一时间段内的平均压力值为(F1+F2)/2;该第二个第一时间段内的平均压力值为(F3+F4)/2;该第三个第一时间段内的平均压力值为(F5+F6)/2;该第四个第一时间段内的平均压力值为(F7+F8)/2;该第五个第一时间段内的平均压力值为(F9+F10)/2。
S2042,根据所述平均压力值获取与该第一时间段对应的第二时间段的关闭速度,该第二时间段的起点相对该第一时间段的起点延时所述第一时间段,且该第二时间段与第一时间段的时长相等。
在该步骤S2042中,具体地,第一时间段的平均压力值与对应的第二时间段的关闭速度呈正相关,例如,该关闭速度=kF-b,其中,F为该时间段内的平均压力值,k为正相关的系数,b为常数,该b和k的设置可以通过多次试 验得出,以取一个最佳值。
S205,根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数,并每关闭一个所述传感器调用函数,对与该传感器调用函数对应的标识进行标记。
在该步骤S205中,在关闭调用函数时,当检测到按压操作结束时,立刻停止关闭操作。在一些实施方式中,该步骤205可以包括:根据每一第二时间段的对应关闭速度,依次在每一第二时间段执行关闭所述函数集合中的传感器调用函数的操作直至该次按压操作结束;且在关闭所述传感器调用函数时,按照从低级到高级的顺序。
在一些实施例中,还可以采用每获取到一个压力值,就在接下来以对应的速度关闭N个传感器调用函数,其中N为大于1的自然数。在本实施例中,即为每隔500ms采集到一个压力值,根据该压力获取下一个500ms内的关闭速度,例如该压力值为20牛,则在下一个500ms内关闭2个传感器调用函数,如果又检测到一压力值为40牛,则在获取到该压力值后的一个500ms内关闭4个传感器调用函数。并且,每关闭一个传感器调用函数,对与该传感器调用函数对应的标识进行标记时,可以采用对该关闭了的传感器调用函数的标识的进行颜色变化,从而便于用户识别。
由上可知,本实施例增加了弹出标识列表以及每关闭一个传感器调用函数将标识列表里对应的标识标记出,从而便于用于直观的观察其关闭传感器调用函数的速度以及进度,有利于提高用户体验。
本发明还提供了一种传感器调用函数的关闭装置,包括:
分级模块,用于根据预定参数对函数集合内的多个传感器调用函数设置函数级别;
获取模块,用于在所述操控界面检测到按压操作时,在所述按压操作的持续时间内获取所述按压操作的压力值与时间的对应关系;
生成模块,用于根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系;
关闭模块,用于根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。
在一些实施例中,所述生成模块包括:
第一获取单元,用于以检测到所述按压操作的时间点作为起点,每隔第一时间段获取在所述第一时间段内的平均压力值;
第二获取单元,用于根据所述平均压力值获取与所述第一时间段对应的第二时间段的关闭速度,所述第二时间段的起点相对所述第一时间段的起点延时所述第一时间段,且所述第二时间段与第一时间段的时长相等。
在一些实施例中,所述关闭模块用于根据每一第二时间段的对应关闭速度,依次在每一第二时间段执行关闭所述函数集合中的传感器调用函数的操作直至所述次按压操作结束;且按照函数级别从低级到高级的顺序关闭所述传感器调用函数。
在一些实施例中,所述分级模块用于根据传感器调用函数的使用频率对多个传感器调用函数设置函数级别。
在一些实施例中,所述分级模块用于根据所述传感器调用函数对应的传感器的功耗值对多个传感器调用函数进行设置函数级别。
在一优选实施例中,提供了一种传感器调用函数的关闭装置。请参照图5,图5为本发明实施例提供的传感器调用函数的关闭装置的一种结构图。其中,本实施例中的传感器调用函数的关闭装置包括分级模块301、获取模块302、生成模块303以及关闭模块304。
分级模块301用于根据预定参数对函数集合内的多个传感器调用函数设置函数级别。分级模块301用于根据传感器调用函数的使用频率对多个传感器调用函数设置函数级别;或者,用于根据所述传感器调用函数对应的传感器的功耗值对多个传感器调用函数进行设置函数级别。
获取模块302用于在所述操控界面检测到按压操作时,在该次按压操作的持续时间内获取按压操作的压力值与时间的对应关系。
生成模块303于根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系。其中,参考图6,该生成模块303包括:第一获取单元3031以及第二获取单元3032。第一获取单元3031用于以检测到该按压操作的时间点作为起点,每隔第一时间段获取在该第一时间段内的平均压力值;第二获取单元3032用于根据所述平均压力值获取与该第一时间段对应的第二时间段的关闭速度,该第二时间段的起点相对该第一时间段的起点延时所述第一时间段,且该第二时间段与第一时间段的时长相等。
关闭模块304用于根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。关闭模块304具体用于根据每一第二时间段的对应关闭速度,依次在每一第二时间段执行关闭所述函数集合中的传感器调用函数的操作直至该次按压操作结束;且按照函数级别从低级到高级的顺序关闭所述传感器调用函数。
由上可知,本发明采用根据预定参数将多个传感器调用函数分级,以生成函数集合;在操控界面检测到按压操作时,在该次按压操作的持续时间内实时获取按压操作的压力值与时间的对应关系;根据压力值与时间的对应关系生成关闭速度与时间的对应关系;根据关闭速度与时间的对应关系,以从低级到高级的顺序关闭所述函数集合中的传感器调用函数,从实现降低功耗的效果,并且由于该传感器调用函数的关闭速度是根据压力值与时间的对应关系生成的,可以通过控制压力值的大小来调制关闭传感器调用函数的速度,从而具有操作便捷的效果,进一步地,由于该多个传感器调用函数根据预定参数进行了分级,可以在关闭过程中先关闭优先级低的传感器调用函数,从而尽量保证该移动通信设备的正常使用。
本发明实施例还提供一种电子设备,该电子设备可以是智能手机、平板电脑等设备。如图7所示,电子设备400包括处理器401、存储器402。其中,处理器401与存储器402电性连接。
处理器401是电子设备400的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器402内的应用程序,以及调用存储在存储器402内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。
在本实施例中,电子设备400中的处理器401会按照如下的步骤,将一个或一个以上的应用程序的进程对应的指令加载到存储器402中,并由处理器401来运行存储在存储器402中的应用程序,从而实现各种功能:
根据预定参数对函数集合内的多个传感器调用函数设置函数级别;
在操控界面检测到按压操作时,在按压操作的持续时间内获取按压操作的压力值与时间的对应关系;
根据压力值与时间的对应关系生成关闭速度与时间的对应关系;
根据关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭函数集合中的传感器调用函数。
在一些实施例中,处理器401执行以下步骤:以检测到该按压操作的时间点作为起点,每隔第一时间段获取在该第一时间段内的平均压力值;根据平均压力值获取与第一时间段对应的第二时间段的关闭速度,第二时间段的起点相对第一时间段的起点延时第一时间段,且第二时间段与所述第一时间段的时长相等。
在一些实施例中,处理器401还执行以下步骤:根据每一第二时间段的对应关闭速度,依次在每一第二时间段执行关闭函数集合中的传感器调用函数的操作直至该所述按压操作结束;且按照函数级别从低级到高级的顺序关闭传感器调用函数。
在一些实施例中,在按压操作的第一个第一时间段内,若所述按压操作结束或者在所述第一时间段内的平均压力值小于一阈值时,处理器401还执行以下步骤:判断按压操作为误操作。
在一些实施例中,在操控界面检测到按压操作时,在按压操作的持续时间内实时获取按压操作的压力值与时间的对应关系前,处理器401还执行以下步骤:检测到触发信号时,根据函数集合显示标识列表,标识列表中每个标识分别对应一传感器调用函数。
在一些实施例中,每关闭一个传感器调用函数,处理器401还执行以下步骤:对与该传感器调用函数对应的标识进行标记。
在一些实施例中,处理器401还执行以下步骤:根据传感器调用函数的使用频率对多个传感器调用函数设置函数级别。
在一些实施例中,处理器401还执行以下步骤:根据传感器调用函数对应的传感器的功耗值对多个传感器调用函数进行设置函数级别。
存储器402可用于存储应用程序和数据。存储器402存储的应用程序中包含有可在处理器中执行的指令。应用程序可以组成各种功能模块。处理器401通过运行存储在存储器402的应用程序,从而执行各种功能应用以及数据处理。
在一些实施例中,如图8所示,电子设备400还包括:显示屏403、控制 电路404、射频电路405、输入单元406、音频电路407、传感器408以及电源409。其中,处理器401分别与显示屏403、控制电路404、射频电路405、输入单元406、音频电路407、传感器408以及电源409电性连接。
显示屏403可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种图形用户接口,这些图形用户接口可以由图像、文本、图标、视频和其任意组合来构成。其中,该显示屏403可以作为本发明实施例中的操控界面。
控制电路404与显示屏403电性连接,用于控制显示屏403显示信息。
射频电路405用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。
输入单元406可用于接收输入的数字、字符信息或用户特征信息(例如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。其中,输入单元406可以包括指纹识别模组。
音频电路407可通过扬声器、传声器提供用户与电子设备之间的音频接口。
传感器408用于采集外部环境信息。传感器408可以包括环境亮度传感器、加速度传感器、光传感器、运动传感器、以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器。比如,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在终端移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
电源409用于给电子设备400的各个部件供电。在一些实施例中,电源409可以通过电源管理系统与处理器401逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
尽管图8中未示出,电子设备400还可以包括摄像头、蓝牙模块等,在此不再赘述。
本发明实施例提供的电子设备,采用根据预定参数将多个传感器调用函数分级,以生成函数集合;在操控界面检测到按压操作时,在该次按压操作的持续时间内实时获取按压操作的压力值与时间的对应关系;根据压力值与时间的对应关系生成关闭速度与时间的对应关系;根据关闭速度与时间的对应关系,以从低级到高级的顺序关闭所述函数集合中的传感器调用函数,从实现降低功耗的效果,并且由于该传感器调用函数的关闭速度是根据压力值与时间的对应关系生成的,可以通过控制压力值的大小来调制关闭传感器调用函数的速度,从而具有操作便捷的效果,进一步地,由于该多个传感器调用函数根据预定参数进行了分级,可以在关闭过程中先关闭优先级低的传感器调用函数,从而尽量保证电子设备的正常使用。
本发明实施例还提供一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述任一实施例所述的传感器调用函数的关闭方法。
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,如存储在终端的存储器中,并被该终端内的至少一个处理器执行,在执行过程中可包括如信息发布方法的实施例的流程。其中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。
本文提供了实施例的各种操作。在一个实施例中,所述的一个或多个操作可以构成一个或多个计算机可读介质上存储的计算机可读指令,其在被电子设备执行时将使得计算设备执行所述操作。描述一些或所有操作的顺序不应当被解释为暗示这些操作必需是顺序相关的。本领域技术人员将理解具有本说明书的益处的可替代的排序。而且,应当理解,不是所有操作必需在本文所提供的每个实施例中存在。
而且,本文所使用的词语“优选的”意指用作实例、示例或例证。奉文描述为“优选的”任意方面或设计不必被解释为比其他方面或设计更有利。相反,词语“优选的”的使用旨在以具体方式提出概念。如本申请中所使用的术语“或”旨在意指包含的“或”而非排除的“或”。即,除非另外指定或从上下文中清楚,“X使用A或B”意指自然包括排列的任意一个。即,如果X使用A;X使用B; 或X使用A和B二者,则“X使用A或B”在前述任一示例中得到满足。
而且,尽管已经相对于一个或多个实现方式示出并描述了本公开,但是本领域技术人员基于对本说明书和附图的阅读和理解将会想到等价变型和修改。本公开包括所有这样的修改和变型,并且仅由所附权利要求的范围限制。特别地关于由上述组件(例如元件、资源等)执行的各种功能,用于描述这样的组件的术语旨在对应于执行所述组件的指定功能(例如其在功能上是等价的)的任意组件(除非另外指示),即使在结构上与执行本文所示的本公开的示范性实现方式中的功能的公开结构不等同。此外,尽管本公开的特定特征已经相对于若干实现方式中的仅一个被公开,但是这种特征可以与如可以对给定或特定应用而言是期望和有利的其他实现方式的一个或多个其他特征组合。而且,就术语“包括”、“具有”、“含有”或其变形被用在具体实施方式或权利要求中而言,这样的术语旨在以与术语“包含”相似的方式包括。
本发明实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。上述提到的存储介质可以是只读存储器,磁盘或光盘等。上述的各装置或系统,可以执行相应方法实施例中的方法。
综上所述,虽然本发明已以优选实施例揭露如上,但上述优选实施例并非用以限制本发明,本领域的普通技术人员,在不脱离本发明的精神和范围内,均可作各种更动与润饰,因此本发明的保护范围以权利要求界定的范围为准。

Claims (20)

  1. 一种传感器调用函数的关闭方法,其中,包括以下步骤:
    根据预定参数对函数集合内的多个传感器调用函数设置函数级别;
    在所述操控界面检测到按压操作时,在所述按压操作的持续时间内获取所述按压操作的压力值与时间的对应关系;
    根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系;
    根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。
  2. 根据权利要求1所述的传感器调用函数的关闭方法,其中,所述根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系的步骤包括:
    以检测到所述按压操作的时间点作为起点,每隔第一时间段获取在所述第一时间段内的平均压力值;
    根据所述平均压力值获取与所述第一时间段对应的第二时间段的关闭速度,所述第二时间段的起点相对所述第一时间段的起点延时所述第一时间段,且所述第二时间段与所述第一时间段的时长相等。
  3. 根据权利要求2所述的传感器调用函数的关闭方法,其中,所述根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数的步骤包括:
    根据每一第二时间段的对应关闭速度,依次在每一第二时间段执行关闭所述函数集合中的传感器调用函数的操作直至所述按压操作结束;且按照函数级别从低级到高级的顺序关闭所述传感器调用函数。
  4. 根据权利要求2所述的传感器调用函数的关闭方法,其中,所述根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系的步骤还包括:
    在所述按压操作的第一个所述第一时间段内,若所述按压操作结束或者在所述第一时间段内的平均压力值小于一阈值时,判断所述按压操作为误操作。
  5. 根据权利要求3所述的传感器调用函数的关闭方法,其中,所述根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系的步骤还包括:
    在所述按压操作的第一个所述第一时间段内,若所述按压操作结束或者在所述第一时间段内的平均压力值小于一阈值时,判断所述按压操作为误操作。
  6. 根据权利要求4所述的传感器调用函数的关闭方法,其中,在所述操 控界面检测到按压操作时,在所述按压操作的持续时间内实时获取按压操作的压力值与时间的对应关系的步骤之前,在所述根据预定参数对函数集合内的多个传感器调用函数设置函数级别的步骤之后还包括以下步骤:
    检测到触发信号时,根据所述函数集合显示标识列表,所述标识列表中每个标识分别对应一所述传感器调用函数。
  7. 根据权利要求6所述的传感器函数的关闭方法,其中,所述根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数的步骤还包括:
    每关闭一个所述传感器调用函数,对与所述传感器调用函数对应的标识进行标记。
  8. 根据权利要求1所述的传感器调用函数的关闭方法,其中,所述根据预定参数对函数集合内的多个传感器调用函数设置函数级别的步骤包括:
    根据传感器调用函数的使用频率对多个传感器调用函数设置函数级别。
  9. 根据权利要求1所述的传感器调用函数的关闭方法,其中,所述根据预定参数对函数集合内的多个传感器调用函数设置函数级别的步骤包括:
    根据所述传感器调用函数对应的传感器的功耗值对多个传感器调用函数进行设置函数级别。
  10. 一种传感器调用函数的关闭装置,其中,包括:
    分级模块,用于根据预定参数对函数集合内的多个传感器调用函数设置函数级别;
    获取模块,用于在所述操控界面检测到按压操作时,在所述按压操作的持续时间内获取所述按压操作的压力值与时间的对应关系;
    生成模块,用于根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系;
    关闭模块,用于根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。
  11. 根据权利要求10所述的传感器调用函数的关闭装置,其中,所述生成模块包括:
    第一获取单元,用于以检测到所述按压操作的时间点作为起点,每隔第一时间段获取在所述第一时间段内的平均压力值;
    第二获取单元,用于根据所述平均压力值获取与所述第一时间段对应的第二时间段的关闭速度,所述第二时间段的起点相对所述第一时间段的起点延时所述第一时间段,且所述第二时间段与第一时间段的时长相等。
  12. 根据权利要求10所述的传感器调用函数的关闭装置,其中,所述关闭模块用于根据每一第二时间段的对应关闭速度,依次在每一第二时间段执行关闭所述函数集合中的传感器调用函数的操作直至所述次按压操作结束;且按照函数级别从低级到高级的顺序关闭所述传感器调用函数。
  13. 根据权利要求10所述的传感器调用函数的关闭装置,其中,所述分级模块用于根据传感器调用函数的使用频率对多个传感器调用函数设置函数级别。
  14. 根据权利要求10所述的传感器调用函数的关闭装置,其中,所述分级模块用于根据所述传感器调用函数对应的传感器的功耗值对多个传感器调用函数进行设置函数级别。
  15. 一种存储介质,其中,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如权利要求1-9中任一项所述的传感器调用函数的关闭方法。
  16. 一种电子设备,其中,包括处理器、存储器,所述处理器与所述存储器电性连接,所述存储器用于存储指令和数据;所述处理器用于执行以下步骤:
    根据预定参数对函数集合内的多个传感器调用函数设置函数级别;
    在所述操控界面检测到按压操作时,在所述按压操作的持续时间内获取所述按压操作的压力值与时间的对应关系;
    根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系;
    根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数。
  17. 根据权利要求16所述的电子设备,其中,所述根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系的步骤包括:
    以检测到所述按压操作的时间点作为起点,每隔第一时间段获取在所述第一时间段内的平均压力值;
    根据所述平均压力值获取与所述第一时间段对应的第二时间段的关闭速度,所述第二时间段的起点相对所述第一时间段的起点延时所述第一时间段, 且所述第二时间段与所述第一时间段的时长相等。
  18. 根据权利要求17所述的传感器调用函数的关闭方法,其中,所述根据所述关闭速度与时间的对应关系,按函数级别从低级到高级的顺序关闭所述函数集合中的传感器调用函数的步骤包括:
    根据每一第二时间段的对应关闭速度,依次在每一第二时间段执行关闭所述函数集合中的传感器调用函数的操作直至所述按压操作结束;且按照函数级别从低级到高级的顺序关闭所述传感器调用函数。
  19. 根据权利要求17所述的传感器调用函数的关闭方法,其中,所述根据所述压力值与时间的对应关系生成关闭速度与时间的对应关系的步骤还包括:
    在所述按压操作的第一个所述第一时间段内,若所述按压操作结束或者在所述第一时间段内的平均压力值小于一阈值时,判断所述按压操作为误操作。
  20. 根据权利要求16所述的传感器调用函数的关闭方法,其中,所述根据预定参数对函数集合内的多个传感器调用函数设置函数级别的步骤包括:
    根据传感器调用函数的使用频率对多个传感器调用函数设置函数级别;或者,根据所述传感器调用函数对应的传感器的功耗值对多个传感器调用函数进行设置函数级别。
PCT/CN2017/086513 2016-05-31 2017-05-31 传感器调用函数的关闭方法、装置、存储介质及电子设备 WO2017206889A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610379852.5A CN106095049B (zh) 2016-05-31 2016-05-31 传感器调用函数的关闭方法及装置
CN201610379852.5 2016-05-31

Publications (1)

Publication Number Publication Date
WO2017206889A1 true WO2017206889A1 (zh) 2017-12-07

Family

ID=57230622

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/086513 WO2017206889A1 (zh) 2016-05-31 2017-05-31 传感器调用函数的关闭方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN106095049B (zh)
WO (1) WO2017206889A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110290453B (zh) * 2019-06-28 2022-03-18 Oppo广东移动通信有限公司 无线播放设备的延时测试方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050278557A1 (en) * 2004-06-11 2005-12-15 Lenovo (Singapore) Pte. Ltd. Portable electronic apparatus having an openable lid, program product and method of controlling portable electronic apparatus
CN104866069A (zh) * 2015-06-12 2015-08-26 广东小天才科技有限公司 一种自动清理后台应用程序的方法及装置
CN105278370A (zh) * 2015-09-30 2016-01-27 小米科技有限责任公司 节电模式开启方法及装置
CN105302274A (zh) * 2015-09-22 2016-02-03 广东欧珀移动通信有限公司 一种传感器控制方法及装置
CN106095487A (zh) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 一种应用程序的关闭方法和装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090098914A1 (en) * 2007-10-15 2009-04-16 Research In Motion Limited Method and system for enabling or disabling features based on a battery level threshold
CN102929382A (zh) * 2012-10-24 2013-02-13 惠州Tcl移动通信有限公司 降低电子设备功耗的方法及电子设备
CN105094618A (zh) * 2015-08-25 2015-11-25 努比亚技术有限公司 管理后台应用程序的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050278557A1 (en) * 2004-06-11 2005-12-15 Lenovo (Singapore) Pte. Ltd. Portable electronic apparatus having an openable lid, program product and method of controlling portable electronic apparatus
CN104866069A (zh) * 2015-06-12 2015-08-26 广东小天才科技有限公司 一种自动清理后台应用程序的方法及装置
CN105302274A (zh) * 2015-09-22 2016-02-03 广东欧珀移动通信有限公司 一种传感器控制方法及装置
CN105278370A (zh) * 2015-09-30 2016-01-27 小米科技有限责任公司 节电模式开启方法及装置
CN106095487A (zh) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 一种应用程序的关闭方法和装置

Also Published As

Publication number Publication date
CN106095049A (zh) 2016-11-09
CN106095049B (zh) 2018-12-11

Similar Documents

Publication Publication Date Title
CN108845853B (zh) 一种应用程序启动方法及移动终端
US20150310637A1 (en) Interface adjustment method, apparatus, and terminal
CN107613146B (zh) 一种音量调整方法、装置及移动终端
CN108391008B (zh) 一种消息提醒方法及移动终端
WO2018166204A1 (zh) 一种控制指纹识别模组的方法、移动终端及存储介质
CN104965642B (zh) 下拉列表生成方法及装置
CN107733016B (zh) 一种移动终端充电控制方法及移动终端
WO2016173453A1 (zh) 活体鉴别方法、信息生成方法和终端
CN111212242B (zh) 曝光方法和电子设备
CN109272917B (zh) 屏幕亮度调节方法、装置、存储介质及电子设备
CN109976611B (zh) 终端设备的控制方法及终端设备
CN108388403B (zh) 一种处理消息的方法及终端
WO2019085749A1 (zh) 应用程序管控方法、装置、介质及电子设备
WO2019024641A1 (zh) 数据同步方法、装置、存储介质以及电子设备
CN110703972B (zh) 一种文件控制方法及电子设备
WO2019062317A1 (zh) 应用程序管控方法及电子设备
CN110874128B (zh) 可视化数据处理方法和电子设备
CN109714476B (zh) 数据处理方法、装置、移动终端及存储介质
CN109639370B (zh) 近场通信天线检测方法、装置、移动终端及存储介质
CN107341094B (zh) 启动项耗时的测量方法及装置
CN108628534B (zh) 一种字符展示方法及移动终端
CN107943549B (zh) 一种应用程序的处理方法及终端
CN106454953B (zh) 流量控制方法、装置及终端
US11150913B2 (en) Method, device, and terminal for accelerating startup of application
WO2017206889A1 (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: 17805834

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17805834

Country of ref document: EP

Kind code of ref document: A1