CN110688225A - Sensor management method and device, storage medium and electronic device - Google Patents

Sensor management method and device, storage medium and electronic device Download PDF

Info

Publication number
CN110688225A
CN110688225A CN201910916292.6A CN201910916292A CN110688225A CN 110688225 A CN110688225 A CN 110688225A CN 201910916292 A CN201910916292 A CN 201910916292A CN 110688225 A CN110688225 A CN 110688225A
Authority
CN
China
Prior art keywords
application
sensor
application program
terminal
managing
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.)
Pending
Application number
CN201910916292.6A
Other languages
Chinese (zh)
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.)
Meizu Technology Co Ltd
Original Assignee
Meizu Technology 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 Meizu Technology Co Ltd filed Critical Meizu Technology Co Ltd
Priority to CN201910916292.6A priority Critical patent/CN110688225A/en
Publication of CN110688225A publication Critical patent/CN110688225A/en
Pending legal-status Critical Current

Links

Images

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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention relates to a sensor management method and device, a storage medium and an electronic device. Wherein, the method comprises the following steps: the method and the device for managing the sensor resources of the application program solve the technical problem that the sensor resources of the application program in the related technology are abnormally occupied by acquiring the application attribute of the application program in the terminal and managing the sensor resources of the application program according to the application attribute of the application program.

Description

Sensor management method and device, storage medium and electronic device
Technical Field
The invention relates to the technical field of electronic information, in particular to a sensor management method and device, a storage medium and an electronic device.
Background
In the process of using the sensor in the terminal, many application programs only apply for the sensor resource, and the sensor resource is not released after the application programs are used, so that the abnormal condition that the sensor resource is still occupied in the process that the user does not use the application programs is avoided. After the exception of the sensor of the application use system occurs, the exception is either released or killed directly. If the terminal is abnormally released, the endurance time of the terminal is reduced; if the user directly kills the application process, the application process loses the thread or a main interface appears when the application process is opened, and the user experience is influenced.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a sensor management method and device, a storage medium and an electronic device, which are used for at least solving the technical problem of abnormal occupation of sensor resources in the related technology.
According to an aspect of an embodiment of the present invention, there is provided a sensor management method including: acquiring application attributes of application programs in a terminal; and managing the sensor resources of the application program according to the application attributes.
Further, the application attribute of the application program in the terminal is obtained as follows: counting the behavior records of the application program in the terminal using the sensor; determining application attributes of the application from the usage sensor behavior record.
Further, the managing the sensor resource of the application program according to the application attribute comprises: and under the condition that the terminal is in a screen-off state, hosting the sensor resource of the application program according to the application attribute.
Further, the managing the sensor resource of the application program according to the application attribute comprises: and under the condition that the application program is positioned in the background, managing the sensor resources of the application program according to the application attribute.
Further, in a case that the application program is located in the background, managing the sensor resource of the application program according to the application attribute includes: and under the condition that the duration of the application program in the background is greater than or equal to a preset duration threshold, hosting the sensor resource of the application program according to the application attribute.
According to another aspect of the embodiments of the present invention, there is also provided a sensor management apparatus, including: the terminal comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring the application attribute of an application program in the terminal; and the management unit is used for managing the sensor resources of the application program according to the application attributes.
Further, the management unit includes: and the hosting module is used for hosting the sensor resources of the application program according to the application attributes under the condition that the terminal is in the screen-off state.
According to another aspect of the embodiments of the present invention, there is also provided a terminal, including: the acquisition module is used for acquiring the application attribute of the application program in the terminal; and the management module is used for managing the sensor resources of the application program according to the application attributes.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program, wherein the program executes the sensor management method as described above.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the sensor management method as described above through the computer program.
In the embodiment of the invention, the sensor resources of the application program are managed according to the application attributes of the application program by acquiring the application attributes of the application program in the terminal, so that the aim of flexibly managing the sensor resources occupied by the application program is fulfilled, the technical effect of managing the matched sensor resources aiming at different application programs is realized, and the technical problem of abnormal occupation of the application sensor resources in the related technology is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic diagram of an alternative sensor management method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of an alternative sensor management apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an alternative terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
Example 1
According to an embodiment of the present invention, there is provided a sensor management method, as shown in fig. 1, including:
s102, acquiring application attributes of application programs in the terminal;
and S104, managing the sensor resources of the application program according to the application attributes.
The method is mainly applied to a terminal comprising a sensor, wherein the sensor in the terminal comprises but is not limited to an acceleration sensor, a gravity sensor, a gyroscope and the like. The terminal includes, but is not limited to, a mobile phone, a PC, a tablet computer, etc.
In a specific application scenario, a usage record of a sensor resource called in a usage process of an application program in a terminal can be acquired, and an application attribute of the application program is determined according to the usage record of the sensor resource and a preset rule. Further, preferably, the application properties of the application program may be set according to an instruction of the user. For example, the real-time communication application and the map navigation application all call the GPS sensor of the terminal when the foreground runs or switches to the background run, and the application attributes of the map navigation application are divided into a white list according to the application type. When the real-time communication application is switched to the background operation, the occupation of the GPS sensor resource is kept, but actually, no relevant processing is carried out, and the occupation of the GPS sensor resource is required to be removed when the real-time communication application is switched to the background, so that the real-time communication application is divided into general applications. And for some applications, if the GPS sensor resource is illegally occupied without authorization of a terminal or a user, the applications are determined as a blacklist.
In an actual application scene, aiming at an application program in a white list, the application program is allowed to occupy sensor resources no matter in a foreground or a background in the running process; the general application allows the application to occupy the sensor resources during foreground operation, and releases the occupied sensor resources when the application is switched to background operation; and for the application program located in the blacklist, the application program is prohibited from calling the sensor resource.
In the above, the application attributes of the application programs are divided by taking the GPS sensor as an example, the application attributes of the application programs in the terminal are classified into a white list, a general application, and a black list, and the application programs are managed in a targeted manner based on the three types of application attributes. The above classification and classification are only examples, and do not limit the present embodiment in any way.
It should be noted that, according to the embodiment, the application attribute of the application program in the terminal is obtained, and the sensor resource of the application program is managed according to the application attribute of the application program, so that the purpose of flexibly managing the sensor resource occupied by the application program is achieved, thereby achieving the technical effect of performing matched sensor resource management on different application programs, and further solving the technical problem of abnormal occupation of the application sensor resource in the related art.
Optionally, in this embodiment, the application attribute of the application program in the terminal is obtained as follows: counting sensor behavior records used by an application program in the terminal; application attributes of the application are determined from the usage sensor behavior record.
In a specific application scene, counting sensor behavior records used by an application program in a terminal, acquiring the sensor behavior records used by the application program occupying sensor resources in the running process, and determining the application attribute of the application program according to the application program type of the application program. The application types of the application include, but are not limited to: navigation class, social class, game class, etc. Application attributes of an application are determined based on the application type and usage sensor behavior records of the application.
For example, when the map navigation application runs in the foreground or switches to the background, the GPS sensor of the terminal is always called, and the application attribute of the map navigation application is divided into a white list according to the type of the application.
Optionally, in this embodiment, managing the sensor resource of the application according to the application attribute includes but is not limited to: and under the condition that the terminal is in a screen-off state, hosting the sensor resource of the application program according to the application attribute.
Specifically, the real-time communication applications and the map navigation applications are still used, wherein the map navigation applications are white list applications, and the real-time communication applications are general applications. And under the condition that the terminal is in a screen-off state, keeping the occupation of the map navigation application on the GPS sensor resource, removing the occupation of the real-time communication application on the sensor resource, and hosting the sensor resource. By hosting the sensor resources of the application program according to the application attributes in the screen-off state, the sensor resources can be flexibly managed based on the application program type.
Optionally, in this embodiment, managing the sensor resource of the application according to the application attribute includes but is not limited to: and under the condition that the application program is positioned in the background, managing the sensor resources of the application program according to the application attributes.
Specifically, the real-time communication applications and the map navigation applications are still used, wherein the map navigation applications are white list applications, and the real-time communication applications are general applications. Under the condition that the map navigation application program is switched to operate in the background, the occupation of the map navigation application program on the GPS sensor resource is kept; and under the condition that the real-time communication application program is switched to run in the background, the real-time communication application program releases the occupation of the sensor resources, and the sensor resources are managed. The sensor resources of the application program are managed according to the state and the application attribute of the application program, and the sensor resources can be flexibly managed based on the type of the application program.
Optionally, in this embodiment, in the case that the application is located in the background, managing the sensor resource of the application according to the application attribute includes but is not limited to: and under the condition that the duration of the application program in the background is greater than or equal to a preset duration threshold, hosting the sensor resources of the application program according to the application attributes.
In an actual application process, for example, an application attribute of a real-time communication application is a general application, and when the communication application runs in the background, functions of the application need to continuously occupy sensor resources for a period of time. In order to avoid long-term occupation of the sensor resources by the application programs, a preset duration threshold is set, and the sensor resources occupied by the application programs are managed under the condition that the duration of the application programs in the background is greater than or equal to the preset duration threshold.
According to the embodiment, the application attribute of the application program in the terminal is acquired, the sensor resource of the application program is managed according to the application attribute of the application program, and the purpose of flexibly managing the sensor resource occupied by the application program is achieved, so that the technical effect of carrying out matched sensor resource management on different application programs is achieved, and the technical problem of abnormal occupation of the application sensor resource in the related technology is solved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
According to an embodiment of the present invention, there is also provided a sensor management apparatus for implementing the above sensor management method, as shown in fig. 2, the apparatus including:
1) an obtaining unit 20, configured to obtain an application attribute of an application program in a terminal;
2) and the management unit 22 is configured to manage the sensor resource of the application program according to the application attribute.
Optionally, in this embodiment, the management unit 22 includes:
1) and the hosting module is used for hosting the sensor resources of the application program according to the application attributes under the condition that the terminal is in the screen-off state.
Optionally, the specific example in this embodiment may refer to the example described in embodiment 1 above, and this embodiment is not described again here.
Example 3
According to an embodiment of the present invention, there is also provided a terminal for implementing the sensor management method, as shown in fig. 3, the terminal includes:
1) an obtaining module 30, configured to obtain an application attribute of an application program in a terminal;
2) and the management module 32 is configured to manage the sensor resource of the application program according to the application attribute.
Optionally, the specific example in this embodiment may refer to the example described in embodiment 1 above, and this embodiment is not described again here.
Example 4
Embodiments of the present invention also provide a storage medium including a stored program, wherein the program executes the sensor management method as described above when running.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
s1, acquiring the application attribute of the application program in the terminal;
and S2, managing the sensor resource of the application program according to the application attribute.
Optionally, the storage medium is further configured to store program codes for executing the steps included in the method in embodiment 1, which is not described in detail in this embodiment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Optionally, the specific example in this embodiment may refer to the example described in embodiment 1 above, and this embodiment is not described again here.
Example 5
Embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the sensor management method as described above through the computer program.
Optionally, in this embodiment, the memory is configured to store program code for performing the following steps:
s1, acquiring the application attribute of the application program in the terminal;
and S2, managing the sensor resource of the application program according to the application attribute.
Optionally, the specific example in this embodiment may refer to the example described in embodiment 1 above, and this embodiment is not described again here.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A sensor management method, comprising:
acquiring application attributes of application programs in a terminal;
and managing the sensor resources of the application program according to the application attributes.
2. The method according to claim 1, wherein the application attribute of the application program in the terminal is obtained by:
counting the behavior records of the application program in the terminal using the sensor;
determining application attributes of the application from the usage sensor behavior record.
3. The method of claim 1, wherein managing sensor resources of the application according to the application attributes comprises:
and under the condition that the terminal is in a screen-off state, hosting the sensor resource of the application program according to the application attribute.
4. The method of claim 1, wherein managing sensor resources of the application according to the application attributes comprises:
and under the condition that the application program is positioned in the background, managing the sensor resources of the application program according to the application attribute.
5. The method of claim 4, wherein managing sensor resources of the application according to the application attribute while the application is in the background comprises:
and under the condition that the duration of the application program in the background is greater than or equal to a preset duration threshold, hosting the sensor resource of the application program according to the application attribute.
6. A sensor management device, comprising:
the terminal comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring the application attribute of an application program in the terminal;
and the management unit is used for managing the sensor resources of the application program according to the application attributes.
7. The apparatus of claim 6, wherein the management unit comprises:
and the hosting module is used for hosting the sensor resources of the application program according to the application attributes under the condition that the terminal is in the screen-off state.
8. A terminal, comprising:
the acquisition module is used for acquiring the application attribute of the application program in the terminal;
and the management module is used for managing the sensor resources of the application program according to the application attributes.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program executes the sensor management method of any one of claims 1 to 5.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the sensor management method of any one of claims 1 to 8 by the computer program.
CN201910916292.6A 2019-09-26 2019-09-26 Sensor management method and device, storage medium and electronic device Pending CN110688225A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910916292.6A CN110688225A (en) 2019-09-26 2019-09-26 Sensor management method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910916292.6A CN110688225A (en) 2019-09-26 2019-09-26 Sensor management method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN110688225A true CN110688225A (en) 2020-01-14

Family

ID=69110221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910916292.6A Pending CN110688225A (en) 2019-09-26 2019-09-26 Sensor management method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN110688225A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975344A (en) * 2016-05-10 2016-09-28 北京小米移动软件有限公司 Control method and device preventing application from excessively using sensor
CN106055078A (en) * 2016-05-31 2016-10-26 广东欧珀移动通信有限公司 Sensor processing method and device of mobile terminal and mobile terminal
CN109874165A (en) * 2019-03-29 2019-06-11 努比亚技术有限公司 A kind of timely method, wearable device and storage medium for closing wearable device sensor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975344A (en) * 2016-05-10 2016-09-28 北京小米移动软件有限公司 Control method and device preventing application from excessively using sensor
CN106055078A (en) * 2016-05-31 2016-10-26 广东欧珀移动通信有限公司 Sensor processing method and device of mobile terminal and mobile terminal
CN109874165A (en) * 2019-03-29 2019-06-11 努比亚技术有限公司 A kind of timely method, wearable device and storage medium for closing wearable device sensor

Similar Documents

Publication Publication Date Title
CN109711168B (en) Behavior-based service identification method, behavior-based service identification device, behavior-based service identification equipment and readable storage medium
CN109558748B (en) Data processing method and device, electronic equipment and storage medium
US20230376453A1 (en) Method and system for applying data retention policies in a computing platform
US20170099292A1 (en) Systems and Methods for Access Permission Revocation and Reinstatement
US20200257749A1 (en) Method and a device for friend recommendation
CN106022101B (en) application management method and terminal
CN104836781A (en) Method distinguishing identities of access users, and device
CN110895524B (en) Composite overdue method, device, server and storage medium of full-load redis time key
CN106685894B (en) Risk identification method, device and system
CN109889487B (en) Processing method and device for external equipment access terminal
CN109815702A (en) Safety detection method, device and the equipment of software action
CN110740088A (en) Method, device, terminal and medium for recommending and adding social resources
CN112528320A (en) IOS-based screen recording prevention method and device, electronic equipment and storage medium
CN108270753B (en) Method and device for logging out user account
CN108241515B (en) Application shortcut establishing method and terminal
CN107633080B (en) User task processing method and device
US9154515B1 (en) Systems and methods identifying and reacting to potentially malicious activity
CN109165135B (en) Data management method, computer readable storage medium and terminal equipment
CN110688225A (en) Sensor management method and device, storage medium and electronic device
CN114036564A (en) Construction method of private data derivative graph
CN112989323B (en) Process detection method, device, terminal and storage medium
CN110891097B (en) Cross-device user identification method and device
CN112791387A (en) Data processing method, device and medium based on mouse and keyboard
CN106169044B (en) Method and device for protecting thread data and electronic equipment
CN109800580A (en) The authority control method and device of system process, storage medium, computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200114