CN105975344B - Control method and device for preventing excessive occupancy of sensor by application - Google Patents

Control method and device for preventing excessive occupancy of sensor by application Download PDF

Info

Publication number
CN105975344B
CN105975344B CN201610307710.8A CN201610307710A CN105975344B CN 105975344 B CN105975344 B CN 105975344B CN 201610307710 A CN201610307710 A CN 201610307710A CN 105975344 B CN105975344 B CN 105975344B
Authority
CN
China
Prior art keywords
application
sensor
state
list
basic state
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201610307710.8A
Other languages
Chinese (zh)
Other versions
CN105975344A (en
Inventor
刘立伟
乜聚科
张建春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610307710.8A priority Critical patent/CN105975344B/en
Publication of CN105975344A publication Critical patent/CN105975344A/en
Application granted granted Critical
Publication of CN105975344B publication Critical patent/CN105975344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Abstract

the disclosure relates to a control method and a control device for preventing an application over-occupancy sensor, wherein the method comprises the following steps: acquiring a sensor list in use by an application; acquiring the current basic state of the application; and when the current basic state of the application is switched from the front-end display to the background, the in-use sensors contained in the sensor list are forbidden. The beneficial effect of this disclosure does: when the basic state of the application is changed, the sensors used by the application are partially released or reserved, the utilization rate of system resources is reduced, the heating of equipment is reduced, and the system fluency and the user experience are improved.

Description

Control method and device for preventing excessive occupancy of sensor by application
Technical Field
The present disclosure relates to the field of mobile terminal technologies, and in particular, to a control method and a control device for preventing an application from excessively occupying a sensor.
background
Mobile terminals, such as mobile phones, are becoming more powerful, wherein downloaded apps (applications) enable users to realize social interaction, shopping, games, etc., when various applications are opened, the system generally calls the applications located on the front-end display to maximize system and hardware resources, and for applications located on the background, the system generally directly terminates the applications.
in the related art, the application in the background can maintain the state of the application through a "locking" technology, so that the application in the background can be used more quickly when the application is converted to the front-end display, however, in this case, for the application already in the background, whether the application is in the locked state or not, the application in the background occupies certain system resources, especially when the application in the background calls a sensor (i.e., a sensor) (for example, a racing game application occupies a gravity sensor, an orientation sensor, a virtual sensor, and the like), which causes the application to unreasonably occupy the sensor, and causes the power consumption of the mobile terminal to be much higher than the conventional level.
in actual use, for some background application or background applications needing to be temporarily saved, the background application still occupies or calls the sensor (or the sensor driver) for many times when the background application is in a back-ground state.
BRIEF SUMMARY OF THE PRESENT DISCLOSURE
In order to overcome the problems in the related art, the present disclosure provides a method and an apparatus for controlling an application occupancy sensor, so as to avoid resource consumption caused by occupancy of the sensor when the application is converted to a background.
according to a first aspect of the embodiments of the present disclosure, a control method using an occupancy sensor is provided, which includes:
A control method for preventing the application of an over-occupancy sensor, the method comprising:
Acquiring a sensor list in use by an application;
acquiring the current basic state of the application;
and when the current basic state of the application is switched from the front-end display to the background, the in-use sensors contained in the sensor list are forbidden.
The method comprises the steps of obtaining a sensor list occupied by an application program in use and a basic state of the application, releasing the occupied sensor when the basic state of the application program is changed, and enabling the application program not to occupy system resources in the background when a plurality of applications are opened according to user operation in the same time, so that the utilization rate of equipment resources is reduced, the smoothness degree of the system is improved, and the user experience is improved.
According to another implementation object of the present disclosure, the prohibiting the in-use sensor included in the sensor list when the current basic state of the application is switched from the front-end display to the background further includes:
Acquiring a preset application white list;
detecting whether the application is in the application white list;
When the application exists in the application white list and the current basic state of the application is switched from the front-end display to the background, reserving the sensors needing to be released from the sensor list according to the policy control of the application white list.
The application white list can be set according to the system policy, when the application in the white list is changed to the basic state, the state that the current application occupies the sensor is maintained, for example, the application with high use frequency of the user can be used immediately when the application state is recovered, the user cannot be opened again due to the release of the sensor, and the use efficiency of the user is ensured.
According to another implementation object of the present disclosure, the prohibiting a sensor being used by the application from the sensor list when the current basic state of the application is switched from a front-end display to a background further includes:
detecting whether the basic state of the application is restored to the front-end display from the background;
when the application is restored to the front-end display from the background, the forbidden sensors in the sensor list of the application are restored.
According to the specific conversion of a certain basic state, when the application is converted from the background to the front-end display, the forbidden sensors in the sensor list of the application are recovered, so that the application is recovered to be normally used.
According to another implementation object of the present disclosure, before the acquiring the list of sensors occupied by the application, the method includes:
acquiring sensor agent settings of a user about an application;
When acquiring a sensor list occupied by an application, the method comprises the following steps:
Acquiring a sensor list occupied by an application and a sensor list forbidden by the application;
When the current basic state of the application is switched from the front-end display to the background, releasing the sensor occupied by the application from the sensor list, including:
When the current basic state of the application is switched, releasing the sensor in use by the application from the sensor list, and/or releasing the forbidden sensor list.
When the sensor agent is used, a third party such as cloud control sets each sensor running in the terminal equipment, and according to the sensor agent setting, when the basic state of the application is changed, the content in the agent setting is synchronously changed correspondingly.
According to another implementation object of the present disclosure, when the sensor occupied by the application is released from the sensor list when the current basic state of the application is switched from a front-end display to a background, the method further includes:
detecting whether a second state after the basic state of the application is switched is in a locked state;
when the second state is in a locked state, keeping a sensor occupancy state in a sensor list of the application;
releasing a sensor in the sensor list when the second state is not in a locked state.
According to the setting of the terminal equipment system and the self-selection of the user, the second state which is converted into the background can be locked through the background setting when the application is converted, so that each application in the list can be selectively released to the occupied sensor, the choice of the user is enriched, and the user experience is improved.
according to another implementation object of the present disclosure, when the current basic state of the application is switched from the front-end display to the background, the method further includes:
And when the application is detected to be converted from the current basic state to the second state which is a call state, keeping the sensor state occupied by the application.
when the current application of the user is interrupted by the call state, the basic state transition of the current application can be judged not to be user operation, so that the intelligent degree of releasing the application to release the occupied sensor can be improved, and the user experience is improved.
in a second aspect, the present disclosure also provides a control device for preventing the application of an over-occupancy sensor, the device comprising:
The first acquisition module is used for acquiring a sensor list occupied by an application;
the second acquisition module is used for acquiring the current basic state of the application;
And the releasing module is used for releasing the sensor occupied by the application from the sensor list when the current basic state of the application is switched.
in the above control device, the releasing module further includes:
the third acquisition module is used for acquiring an application white list preset by a user in the terminal;
A first detection module, configured to detect whether the application is in the application white list;
and the policy module is used for reserving the sensors which need to be released from the sensor list according to the policy control of the application white list when the application exists in the application white list and the current basic state of the application is switched.
The control device described above further includes:
A second detection module, configured to detect whether the application is restored to the basic state;
And the recovery module is used for recovering the sensors in the sensor list occupied by the application when the application is recovered to the basic state.
The control device described above further includes:
the fourth acquisition module is used for acquiring the sensor agent setting of the user about the application;
A fifth obtaining module, configured to obtain a sensor list occupied by an application and a sensor list in which the application is disabled;
And the release/disable module is used for releasing the sensors occupied by the application from the sensor list and/or releasing the disabled sensor list when the current basic state of the application is switched.
in the above control device, the releasing module further includes:
the third detection module is used for detecting whether the second state after the basic state of the application is switched is in a locking state; when the second state is in a locked state, keeping a sensor occupancy state in a sensor list of the application; releasing a sensor in the sensor list when the second state is not in a locked state.
In the above control apparatus, the releasing module includes:
And the fourth detection module is used for keeping the sensor state occupied by the application when the current basic state of the application is converted into the second state which is a call state.
according to a second aspect of the embodiments of the present disclosure, there is provided a control device using an occupancy sensor, the specific technical solution of which includes:
the technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: according to the method and the device, the sensor list in use by the application is obtained, so that when the basic state of the application changes, for example, when the application is changed from a front-end display state to a background state, all or part of sensors contained in the sensor list of the application are released or reserved, the utilization rate of system resources is reduced, the more applications are opened by a user, the more obvious the reduction of the utilization rate of the system resources is, the heat of equipment is reduced, and the smoothness of the system and the user experience are improved.
it is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
drawings
the accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a control method for preventing the application of an over-occupancy sensor, according to an exemplary embodiment.
FIG. 2 is a diagram illustrating steps in pre-setting a white list of applications, according to an example embodiment.
FIG. 3 is a partial step diagram shown in accordance with an exemplary embodiment.
FIG. 4 is a partial step diagram shown in accordance with an exemplary embodiment.
FIG. 5 is a block diagram of an apparatus for preventing over-occupancy of a sensor application, according to an example embodiment.
FIG. 6 is a block diagram illustrating a release module composition in accordance with an exemplary embodiment.
fig. 7 is a block diagram of an apparatus shown in accordance with an example embodiment.
FIG. 8 is a block diagram illustrating a terminal in which a device employing an over-occupancy sensor is located, according to an example embodiment.
Detailed Description
reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the steps are depicted in the flowchart as a sequential process, many of the steps can be performed in parallel, concurrently, or simultaneously. Further, the order of the steps may be rearranged, the process may be terminated when its operations are completed, and other steps not included in the drawings may be included. The processing may correspond to methods, functions, procedures, subroutines, and the like.
the present disclosure relates to a control method for preventing an application from excessively occupying a sensor, which is mainly applied to a terminal device scene capable of running various types of application programs, and the basic idea is as follows: when the change of the basic state of the application is detected, for example, the change from the front-end display to the background or the change from the background to the front-end display, the occupation state of each sensor occupied in the sensor list of the application is changed, the sensors occupied by the sensors are selectively released or reserved, the occupation of the sensors by the application in the background is reduced, the application is effectively controlled to occupy the sensors randomly, and the defects of meaningless system resource occupation, hardware power consumption and the like caused by the use of the sensors in the background are avoided.
The present exemplary embodiment may be applicable to a case where the intelligent terminal capable of running various types of applications performs intelligent release or retention of sensors, and the method may be performed by a control module in the intelligent terminal, wherein the apparatus may be implemented by software and/or hardware, and may be generally integrated in a mobile terminal, or controlled by a central control module in the terminal, as shown in fig. 1, and the method includes the following steps:
in step 110, a list of sensors being used by an application is obtained;
When the application is operated, various types of sensors provided in the system, such as a G-sensor (gravity sensor), an F-sensor (pressure sensor), a distance sensor, a light sensor, a three-axis gyroscope, an electronic compass, and a future heat sensor, a temperature sensor, a humidity sensor, an ultraviolet sensor and the like, can be called according to the openness degree of the system, and the sensors which can be allocated can be called at will under the condition of no user setting.
The sensor list may include all the sensors that can be called by the application, or only the sensors that are in use by the application, and the various sensors in the sensor list may be displayed in different manners, for example, the list in use is displayed with a certain brightness, and the sensors that are not in use and can be called by the application are displayed in a gray scale display manner that can be distinguished from the display with a certain brightness.
In step 120, obtaining the current basic state of the application;
According to the system running mechanism, two most common states of the application are selected in the exemplary embodiment of the disclosure, including a front-end display state and a background state, and the two states can be switched at will.
the background also comprises a pause state, a waiting stop state and the like of the application, and the two states can be switched randomly.
For the basic state of the application, it may be determined by whether the application is in contact with a widget provided by the system, for example, in the case that the application of the exemplary embodiment of the present disclosure is running in an android operating system, it may be determined by the contact between the application and the widget whether the application is in a front-end display state, when the application is in contact with the widget, the application is in the front-end display state, and when the application is disconnected from the widget, the application is in a background state.
Of course, the determination of the basic state of the application may also be identified by an identifier in a file of the application, and when the application is in a different basic state, the state information of the application may be read from a running file of the application, which is not limited in this disclosure.
In step 130, when the current basic state of the application is switched from the front-end display to the background, the in-use sensor included in the sensor list is prohibited.
It can be set by the system that after each application is clicked to run, the running basic state is determined, for example, the application just clicked to run, the basic state of the application is a front-end display, and then the user performs another series of touch operations that can be executed on the basic state.
When the application changes from the current basic state to another second different basic state, for example, the application switches from the front-end display to the background, the connection between the application and each sensor contained in the sensor list of the application is cut off.
the connection between the application and the sensor in the background basic state is cut off, so that the application releases all occupied sensors or selectively releases and retains the sensors which are possibly used by the application according to a policy and a white list mechanism.
when detecting that the basic state of the application has changed, the sensors in the sensor list obtained in step 110 are disabled functionally, i.e. the connection with the application is cut off, so that the application no longer occupies one or all of the sensors.
Generally, the simplest and feasible scheme is to disable the in-use sensors contained in the acquired sensor list when detecting that the basic state of the application changes, so as to release the system resources and clear up excessive redundant occupation in the system.
when a user needs to fully or partially reserve a sensor occupied by an application in the background, the application in the white list may be protected by applying the white list, specifically, as shown in fig. 2, the method may be performed in the following manner:
In step 210, a preset application white list is obtained;
The application white list includes: the sensors occupied (in use) by the applications contained in the application white list remain occupied when the application base state changes.
so that applications in the application white list can retain the sensor settings at the user's discretion, while applications not in the application white list directly perform step 130.
In the case of more applications installed in the system, the number of applications in the application white list may be increased accordingly, for example, when the number of all applications in the system is detected to be 100, the number of applications that can be added in the application white list may be 10, and when the number of applications installed in the system reaches 200, the number of applications that can be added in the application white list may be increased accordingly by a certain number, for example, 15, and the number of applications included in the application white list and the increasing ratio to the number of all applications in the system may be selected by the user.
The application white list may protect applications located within the application white list such that when a basic state of an application changes, a choice is provided for the disabling and retention of sensors occupied by the application.
in step 220, detecting whether the application is in the application white list;
When the application is clicked to run, the theme name of the application can be compared with each application contained in the application white list to detect whether the application is in the application white list or not, and whether the application needs to be prohibited and kept by the sensor when the basic state is changed or not is detected.
in step 230, when the application exists in the application white list and when the current basic state of the application is switched from the front-end display to the background, the sensors needing to be released from the sensor list are reserved according to the policy control of the application white list.
When the clicked running application is in the application white list, when the change of the basic state of the application from front-end display to background switching is detected, the application is enabled to keep a certain sensor or a plurality of sensors according to the policy control of the application white list.
The policy control of the application white list includes prohibition, enabling and retention of sensors of the applications in the white list, wherein the sensors in use by all the applications in the white list can be controlled in a unified manner, and part or all of the sensors in use by one of the applications can be controlled in an adjustment manner.
The application can be protected by applying the white list, so that each application can forbid and reserve occupied sensors according to the user setting-application white list when the basic state changes, and the user experience is further improved.
In the process of step 130, the basic state of the application is changed, as shown in fig. 3, which further includes the following situations:
in step 140, detecting whether the basic state of the application is restored to the front-end display from the background;
In the step, the change of the basic state of the application is restored to the front-end display from the background, whether the application is in the background state or not can be judged according to the contact between the application and the window connector, when the contact between the application and the window connector is not kept, the application is in the background state, otherwise, the application is in the front-end display state.
in step 150, when the application is restored from the background to the front-end display, the forbidden sensors in the sensor list of the application are restored.
When it is detected that the basic state of the application is restored from the background to the front-end display, establishing a connection between the application and each sensor included in the sensor list corresponding to the application acquired in step 110, and restoring the application and the prohibited sensor in each sensor list.
when the application is in the application white list, no operation is executed on the sensors reserved by the established strategies in the application white list, and a recovery operation is carried out on the forbidden sensors.
In another implementation scenario of the exemplary embodiment of the present disclosure, it may also be determined whether the application needs to disable the used sensor according to whether the application is in a locked state when switching to the background, and the feasible steps include:
In step 310, detecting whether a second state after the switching of the basic state of the application is in a locked state;
when the basic state of the application is changed, whether the switched second state of the application, which is generally a background state, contains a "locked" flag is detected, and when the application has the flag in the background, it can be determined that the application is in the locked state in the second state.
In step 320, when the second state is in a locked state, keeping a sensor occupancy state in a sensor list of the application;
For a locked application, the sensors used by the application may be maintained regardless of whether it belongs to the application white list.
In step 330, when the second state is not in the locked state, the sensors in the sensor list are released.
For the application which is not in the locked state, whether the application belongs to an application white list or not is detected again, and partial or all sensors in the sensor list of the application are determined to be released according to whether the application belongs to the white list or not.
in another implementation scenario of the exemplary embodiment of the present disclosure, in an application running process, when a terminal receives an incoming call, an application is switched from a front-end display state to a background display state, and at this time, a call state is used as the front-end display state, and in this case, a sensor used by the application is maintained, so that after the call is ended, the application can be quickly restored from the background to the front-end display state, and the sensor occupied by the application can be maintained by enabling the application to be in a suspended or locked state, or temporarily adding the application to an application white list.
By the method in the step, the application needing to be reserved and the sensor occupied by the application are further selected when the basic state of the application is switched, and user experience is further improved.
As shown in fig. 4, in another exemplary embodiment of the present disclosure, a method for managing a sensor and a sensor list through a sensor agent layer of a terminal is provided, where a sensor occupied by an application may be prohibited and/or recovered through the sensor agent layer of a terminal system, and the sensor list may be prohibited or recovered, the method including:
In step 410, obtaining sensor agent settings of a user with respect to an application;
The sensor agent layer of the terminal system manages the application of the sensor, for example, the application can be prohibited from using one of the sensors, and the application can be recovered from using one of the sensors after the prohibition.
the part of the content can be set by default of the system or can be set by the sensor agent formed by modifying the sensor agent layer by the user.
When acquiring a sensor list occupied by an application, the method comprises the following steps:
in step 420, acquiring a sensor list occupied by an application and a sensor list with the application disabled;
when the sensors in use by the application are managed by the sensor agent device, the sensors which can be used by the application and the sensors which can not be used by the application are set in the sensor agent layer, and the sensors which can be used by the application and the sensors which can not be used by the application are respectively listed, so that an occupied sensor list and a forbidden sensor list are respectively formed.
the sensors which can be used by the application and the forbidden sensors are respectively listed, so that the management of each sensor can be classified by the sensor agent layer, and the management of the sensors is more convenient.
when the current basic state of the application is switched from the front-end display to the background, releasing the sensor occupied by the application from the sensor list, including:
In step 430, when the current basic state of the application is switched, the sensor in use by the application is released from the sensor list, and/or the forbidden sensor list is released.
and detecting the basic state change condition of the application again, wherein the application is switched from the front-end display to the background and from the background to the front-end display, and the occupied sensor list or the sensors contained in the forbidden sensor list can be forbidden or the recovery is released through the sensor agent layer.
through the sensor agent setting, the used sensor can be released when the application is switched from the front-end display to the background in one-time completion, or the forbidden sensor can be recovered when the application is recovered from the background to the front-end display, and when more background applications are available, the sensor management efficiency can be improved.
Fig. 5 is a schematic structural diagram of an apparatus for preventing an over-occupancy sensor from being applied according to an exemplary embodiment of the present disclosure, which may be implemented by software and/or hardware and is generally integrated in a mobile terminal. As shown in fig. 5, the present embodiment may provide an apparatus for preventing an over-occupancy sensor from being applied based on the above embodiments, which mainly includes a first obtaining module 510, a second obtaining module 520, and a releasing module 530.
A first obtaining module 510 configured to obtain a sensor list occupied by an application;
A second obtaining module 520 configured to obtain a current basic state of the application;
a releasing module 530 configured to release the sensor occupied by the application from the sensor list when the current basic state of the application is switched;
A second detection module 540 configured to detect whether the application is restored to the basic state;
a recovery module 550 configured to recover sensors in the list of sensors occupied by the application when the application recovers to the base state.
The first obtaining module 510 and the second obtaining module 520 are in communication connection with the releasing module 530, the releasing module 530 receives the sensor list and the basic state of the application and releases the sensors in the sensor list when the basic state changes, and the second detecting module 540 and the recovering module 550 are in communication connection with at least the releasing module 530 to detect the action of the releasing module 530.
In another implementation scenario of the exemplary embodiment of the present disclosure, as shown in fig. 6, the releasing module 530 further includes:
a third obtaining module 531, configured to obtain an application white list preset by a user in the terminal;
A first detection module 532, configured to detect whether the application is in the application white list;
a policy module 533, configured to, when the application exists in the application white list and when the current basic state of the application is switched, reserve the sensor that needs to be released from the sensor list according to policy control of the application white list;
a third detecting module 534, configured to detect whether the second state after the switching of the basic state of the application is in the locked state; when the second state is in a locked state, keeping a sensor occupancy state in a sensor list of the application; releasing a sensor in the sensor list when the second state is not in a locked state;
a fourth detecting module 535, configured to detect that the application is converted from the current basic state to the second state, which is a call state, and maintain the sensor state occupied by the application.
in another implementation scenario of the exemplary embodiment of the present disclosure, as shown in fig. 7, the method further includes:
a fourth obtaining module 710, configured to obtain sensor agent settings of the user regarding the application;
A fifth obtaining module 720, configured to obtain a sensor list occupied by an application and a sensor list in which the application is disabled;
A releasing/disabling module 730, configured to release the sensor occupied by the application from the sensor list and/or release the disabled sensor list when the current basic state of the application is switched.
the device for preventing the over-occupancy sensor from being applied provided in the above embodiments may perform the method for preventing the over-occupancy sensor from being applied provided in any embodiment of the present disclosure, and have corresponding functional modules and advantageous effects for performing the method.
Fig. 8 is a block diagram illustrating an apparatus 800 for preventing the application of an over-occupancy sensor, according to an example embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 8, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
the processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
the audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
the sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of the components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also detect a change in position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and temperature switching of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
the communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the particular embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.

Claims (8)

1. a control method for preventing the application of an over-occupancy sensor, the method comprising:
Acquiring a sensor list in use by an application;
acquiring the current basic state of the application;
When the current basic state of the application is switched from the front-end display to the background, the sensors which are in use and contained in the sensor list are forbidden;
when the current basic state of the application is switched from the front-end display to the background, the method for inhibiting the in-use sensor contained in the sensor list comprises the following steps:
acquiring a preset application white list;
Detecting whether the application is in the application white list;
when the application exists in the application white list and the current basic state of the application is switched from front-end display to background, reserving the sensors needing to be released from the sensor list according to the policy control of the application white list;
When the current basic state of the application is switched from the front-end display to the background, the method further comprises the following steps:
and when the application is detected to be converted from the current basic state to the second state which is a call state, keeping the sensor state occupied by the application.
2. The control method according to claim 1, wherein the prohibiting the sensor in use by the application from the sensor list when the current basic state of the application is switched from a front-end display to a background comprises:
Detecting whether the basic state of the application is restored to the front-end display from the background;
when the application is restored to the front-end display from the background, the forbidden sensors in the sensor list of the application are restored.
3. the control method according to claim 1, characterized in that the method comprises:
before the sensor list occupied by the application is obtained, obtaining sensor agent settings of a user about the application;
when acquiring a sensor list occupied by an application, the method comprises the following steps:
Acquiring a sensor list occupied by an application and a sensor list forbidden by the application;
When the current basic state of the application is switched from the front-end display to the background, releasing the sensor occupied by the application from the sensor list, including:
When the current basic state of the application is switched, releasing the sensor in use by the application from the sensor list, and/or releasing the forbidden sensor list.
4. The control method according to claim 1, wherein when the sensor occupied by the application is released from the sensor list when the current basic state of the application is switched from a front-end display to a background, the method further comprises:
Detecting whether a second state after the basic state of the application is switched is in a locked state;
when the second state is in a locked state, keeping a sensor occupancy state in a sensor list of the application;
releasing a sensor in the sensor list when the second state is not in a locked state.
5. a control device for preventing the use of an over-occupancy sensor, the device comprising:
The first acquisition module is used for acquiring a sensor list occupied by an application;
The second acquisition module is used for acquiring the current basic state of the application;
the release module is used for releasing the sensor occupied by the application from the sensor list when the current basic state of the application is switched;
The release module further comprises:
the third acquisition module is used for acquiring an application white list preset by a user in the terminal;
a first detection module, configured to detect whether the application is in the application white list;
The policy module is used for reserving the sensors which need to be released from the sensor list according to the policy control of the application white list when the application exists in the application white list and the current basic state of the application is switched;
the release module includes:
And the fourth detection module is used for keeping the sensor state occupied by the application when the current basic state of the application is converted into the second state which is a call state.
6. The control device according to claim 5, characterized by further comprising:
A second detection module, configured to detect whether the application is restored to the basic state;
and the recovery module is used for recovering the sensors in the sensor list occupied by the application when the application is recovered to the basic state.
7. the control device according to claim 5, characterized by further comprising:
The fourth acquisition module is used for acquiring the sensor agent setting of the user about the application;
A fifth obtaining module, configured to obtain a sensor list occupied by an application and a sensor list in which the application is disabled;
and the release/disable module is used for releasing the sensors occupied by the application from the sensor list and/or releasing the disabled sensor list when the current basic state of the application is switched.
8. the control device of claim 5, wherein the release module further comprises:
the third detection module is used for detecting whether the second state after the basic state of the application is switched is in a locking state; when the second state is in a locked state, keeping a sensor occupancy state in a sensor list of the application; releasing a sensor in the sensor list when the second state is not in a locked state.
CN201610307710.8A 2016-05-10 2016-05-10 Control method and device for preventing excessive occupancy of sensor by application Active CN105975344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610307710.8A CN105975344B (en) 2016-05-10 2016-05-10 Control method and device for preventing excessive occupancy of sensor by application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610307710.8A CN105975344B (en) 2016-05-10 2016-05-10 Control method and device for preventing excessive occupancy of sensor by application

Publications (2)

Publication Number Publication Date
CN105975344A CN105975344A (en) 2016-09-28
CN105975344B true CN105975344B (en) 2019-12-13

Family

ID=56992085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610307710.8A Active CN105975344B (en) 2016-05-10 2016-05-10 Control method and device for preventing excessive occupancy of sensor by application

Country Status (1)

Country Link
CN (1) CN105975344B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107797645B (en) * 2017-10-12 2020-12-04 北京小米移动软件有限公司 Resource control method and device
WO2020102982A1 (en) * 2018-11-20 2020-05-28 深圳市欢太科技有限公司 Call processing method, computer readable storage medium, and electronic device
CN110109528B (en) * 2019-03-29 2021-10-22 努比亚技术有限公司 Application program control method, mobile terminal and computer readable storage medium
CN110688225A (en) * 2019-09-26 2020-01-14 珠海市魅族科技有限公司 Sensor management method and device, storage medium and electronic device
CN112929482B (en) * 2019-11-21 2022-02-18 深圳市万普拉斯科技有限公司 Sensor operation control method and device, computer equipment and storage medium
CN111371949A (en) * 2020-02-28 2020-07-03 Oppo广东移动通信有限公司 Application program switching method and device, storage medium and touch terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2013100570A4 (en) * 2012-05-25 2013-05-30 Apple Inc. Operating geographic location systems
CN103235687A (en) * 2013-04-02 2013-08-07 广东欧珀移动通信有限公司 Method and device for setting on state of sensor, and mobile equipment
CN103257894A (en) * 2012-02-20 2013-08-21 联想(北京)有限公司 Program management method and electronic terminal
CN105468426A (en) * 2016-01-05 2016-04-06 珠海市魅族科技有限公司 Application freezing method and terminal
CN105511970A (en) * 2015-12-11 2016-04-20 北京元心科技有限公司 Intelligent terminal and sensor control method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104298549B (en) * 2014-09-30 2018-03-30 北京金山安全软件有限公司 Method and device for cleaning application programs in mobile terminal and mobile terminal
CN105117295A (en) * 2015-09-18 2015-12-02 北京金山安全软件有限公司 Memory resource release method and device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103257894A (en) * 2012-02-20 2013-08-21 联想(北京)有限公司 Program management method and electronic terminal
AU2013100570A4 (en) * 2012-05-25 2013-05-30 Apple Inc. Operating geographic location systems
CN103235687A (en) * 2013-04-02 2013-08-07 广东欧珀移动通信有限公司 Method and device for setting on state of sensor, and mobile equipment
CN105511970A (en) * 2015-12-11 2016-04-20 北京元心科技有限公司 Intelligent terminal and sensor control method thereof
CN105468426A (en) * 2016-01-05 2016-04-06 珠海市魅族科技有限公司 Application freezing method and terminal

Also Published As

Publication number Publication date
CN105975344A (en) 2016-09-28

Similar Documents

Publication Publication Date Title
CN105975344B (en) Control method and device for preventing excessive occupancy of sensor by application
CN106961526B (en) Notification message display method and device and electronic equipment
EP3188066B1 (en) A method and an apparatus for managing an application
CN110995929B (en) Terminal control method, device, terminal and storage medium
EP3151117B1 (en) Method and device for delaying information broadcasting
EP3086539B1 (en) Method and device for deleting smart scene
EP3110188A1 (en) Method and device for accessing operator network
EP3200116B1 (en) Method and apparatus for acquiring information via a virtual identity module from lost or stolen terminal
EP3163411A1 (en) Method, device and apparatus for application switching
EP3136793A1 (en) Method and apparatus for awakening electronic device
EP3046212B1 (en) Method and apparatus for controlling charging of terminal device
US10425403B2 (en) Method and device for accessing smart camera
EP3136699A1 (en) Method and device for connecting external equipment
EP3893495B1 (en) Method for selecting images based on continuous shooting and electronic device
CN106357934B (en) Screen locking control method and device
EP3322227B1 (en) Methods and apparatuses for controlling wireless connection, computer program and recording medium
CN112217990B (en) Task scheduling method, task scheduling device and storage medium
CN109451840B (en) Cell residence method and device and user equipment
US9723639B2 (en) Communication method and terminal
CN106170141B (en) Mobile terminal network switching method and device
CN107371222B (en) Virtual card disabling method and device
CN109922203B (en) Terminal, screen off method and device
CN112423092A (en) Video recording method and video recording device
CN107422954B (en) Lock screen prolonging method and device
CN106774902B (en) Application locking method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant