WO2020038088A1 - 相机应用的占用控制方法和装置 - Google Patents

相机应用的占用控制方法和装置 Download PDF

Info

Publication number
WO2020038088A1
WO2020038088A1 PCT/CN2019/091808 CN2019091808W WO2020038088A1 WO 2020038088 A1 WO2020038088 A1 WO 2020038088A1 CN 2019091808 W CN2019091808 W CN 2019091808W WO 2020038088 A1 WO2020038088 A1 WO 2020038088A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
camera
terminal device
data request
time
Prior art date
Application number
PCT/CN2019/091808
Other languages
English (en)
French (fr)
Inventor
刘黎
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to EP19852477.9A priority Critical patent/EP3825852B1/en
Publication of WO2020038088A1 publication Critical patent/WO2020038088A1/zh
Priority to US17/161,174 priority patent/US11419055B2/en

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • H04W52/0264Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by selectively disabling software applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/52Details of telephonic subscriber devices including functional features of a camera

Definitions

  • the present disclosure relates to the technical field of terminal device control, and in particular, to a occupancy control method and device for camera applications.
  • terminal devices such as smartphones
  • the types and functions of applications in terminal devices have become more diverse.
  • the functions that rely on camera applications have also been developed, such as live streaming functions and video chat functions that rely on camera applications. Wait.
  • the present disclosure aims to solve, at least to a certain extent, a technical problem in a related art that a camera device is turned on in an unneeded situation or an increase in power consumption of a terminal device caused by requested camera data.
  • a first object of the present disclosure is to provide a camera application occupancy control method, including the following steps: when the camera application is occupied by a first application running in the foreground, if it is determined that the terminal device is at a preset first In the operating state, it is detected whether the first application sends a camera data request message; if it is detected that the first application sends the camera data request message, it sends a delayed shutdown message to the camera application for a first time delay And detect whether the state of the terminal device is switched from the first operation state to the second operation state within the first time period; if it is not switched to the second operation state, and the first application is detected Continue to send the camera data request message, then detect whether the first application enables a function related to the camera data request, and if not, control the first application to release the occupation of the camera application.
  • an embodiment of the second aspect of the present disclosure provides a camera application occupancy control device, including: a first detection module, configured to determine that a terminal device is in a state where a camera application is occupied by a first application running in the foreground.
  • a preset first operating state detecting whether the first application sends a camera data request message; and a sending module is configured to send to the camera application when it is detected that the first application sends the camera data request message Delay the shutdown message for the first duration; a second detection module for detecting whether the state of the terminal device is switched from the first operation state to the second operation state within the first duration; a third detection A module configured to detect whether the first application enables a function related to the camera data request when the first application continues to send the camera data request message when it is not switched to the second operation state
  • a control module configured to control the first application to release the occupation of the camera application when the first application is not started.
  • an embodiment of the third aspect of the present disclosure provides a terminal device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program At this time, the occupancy control method of the camera application according to the foregoing embodiment is implemented.
  • an embodiment of the fourth aspect of the present disclosure proposes a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements occupation of a camera application as described in the previous embodiment. Control Method.
  • the camera application When the camera application is occupied by the first application running in the foreground, if it is determined that the terminal device is in a preset first operating state, detecting whether the first application sends a camera data request message, and if it is detected that the first application sends a camera data request message, Send a delayed shutdown message to the camera application for a first time delay, and detect whether the state of the terminal device is switched from the first operation state to the second operation state within the first time period, and further, if it is not switched to the second operation state And if it is detected that the first application continues to send the camera data request message, it is detected whether the first application enables a function related to the camera data request, and if not, the first application is controlled to release the occupation of the camera application. Therefore, according to the usage situation of the camera application when the camera application is occupied by the application, unnecessary occupation is optimized, the power consumption of the terminal device is reduced, and the endurance of the terminal device is improved.
  • FIG. 1 is a schematic flowchart of a camera application occupation control method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of another occupancy control method for a camera application according to an embodiment of the present disclosure
  • FIG. 3-1 is a schematic flowchart of another camera application occupation control method according to an embodiment of the present disclosure.
  • 3-2 is a schematic flowchart of another occupancy control method for a camera application according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of an occupation control device for a camera application according to an embodiment of the present disclosure.
  • the occupancy control method and device of a camera application are described below with reference to the drawings.
  • applications that rely on camera functions to provide functional services.
  • the camera application When the camera application is occupied, if the home button is exited and mounted in the background by triggering the home button, or the power button is turned off directly on the application interface of the occupied camera, there may be two In this case, one type is that the camera application has not been closed and has been requesting data from the camera device in the background; the other type does not request camera data but does not close the camera device.
  • the power consumption of the terminal device increases and decreases.
  • the endurance of the terminal equipment In the occupancy control method of a camera application provided in the present disclosure, unnecessary occupancy conditions are accurately screened and optimized according to specific conditions when the camera application is occupied, thereby reducing power consumption of the terminal device, Improved endurance of terminal equipment.
  • FIG. 1 is a schematic flowchart of a camera application occupation control method according to an embodiment of the present disclosure. As shown in Figure 1, the method includes the following steps:
  • Step 101 When the camera application is occupied by the first application running in the foreground, if it is determined that the terminal device is in a preset first operating state, it is detected whether the first application sends a camera data request message.
  • the camera application when the camera application is occupied by a first application running in the foreground of the current terminal device, in order to determine a specific usage situation when the current first application occupies the camera application, it is determined whether the terminal device is in a preset first operating state, where The preset first operation state corresponds to the first application that occupies the camera application, and an unnecessary occupancy operation state may occur.
  • the preset first operation state corresponds to the first application that occupies the camera application, and an unnecessary occupancy operation state may occur.
  • the first application In order to detect whether the first application is currently using the camera application for functional services in the first operation state, It is detected whether the first application sends a camera data request message.
  • the first application sends a camera data request, it means that the current first application is requesting camera data and does not idle the corresponding process after calling the camera application. At this time, it is necessary to further determine that the first application requests the camera After the data, whether to provide functional services.
  • different steps for detecting whether the first application sends a camera data request message include:
  • Step 201 After acquiring the camera data request query instruction sent by the first application, determine a first occupation time and a first application identifier of the camera data request query instruction.
  • the first occupation time can be obtained by querying the current system time.
  • Step 202 Obtain the application identification information and corresponding occupancy time that have been recorded in the data request interface, and obtain a second occupancy time that most recently matches the first application identifier.
  • the first application occupation time of the camera application and the first application identifier are recorded in a data request interface corresponding to the camera application. In order to further detect whether the first application will call the camera application to idle the corresponding process according to the record.
  • the application identification information and corresponding occupation time recorded in the data request interface are acquired, and the application identification information and corresponding occupation time recorded before the camera data request query instruction is acquired.
  • Step 203 It is detected whether a time difference between the first occupation time and the second occupation time is within a second preset time range.
  • the second preset time range is calibrated based on a large amount of experimental data, and may be 500 ms.
  • the first occupation time of the current sending camera data request query instruction is compared to the second time of sending the camera data request query instruction at the nearest time from the current time. Occupation time has a large time difference. If the first application will call the camera application and the corresponding process is not idle, the first occupation time of the camera data request query instruction is currently sent, compared to the camera data request query instruction that is closest to the current time. The time difference of the second occupied time is smaller.
  • the first application by detecting whether the time difference between the first occupation time and the second occupation time is within a second preset time range, it is determined whether the first application sends a camera data request, that is, when the first occupation time The time difference between the time and the second occupied time is within the second preset time range, and it is determined to send a camera data request message for the first application, otherwise, even if the first application sends a camera data request message, it is relative to the last time the camera was sent. If the data request message has a longer time interval, it is considered that the camera data request message has not been received.
  • Step 102 If it is detected that the first application sends a camera data request message, send a delayed shutdown message to the camera application for a first time delay, and detect whether the state of the terminal device is switched from the first operation state to the first time The second operating state.
  • the first duration is calibrated based on a large amount of experimental data, and may be 1 minute.
  • the first application sends a camera data request message
  • the camera application is sent a delay shutdown message with a delay of the first duration.
  • the camera application will not be closed.
  • the state of the terminal device is switched from the first operation state to the second operation state. It can be understood that, in the second operation state, the occupation of the camera application by the first application is a necessary occupation, and does not belong to the optimization. Power consumption of power terminal equipment.
  • the above first time period should be shorter than the default shutdown time of the camera application set by the terminal device system, wherein the default shutdown time corresponds to the camera application within the default shutdown time. If no camera data is requested, the duration of the direct shutdown.
  • step 103 if it is not switched to the second operation state and it is detected that the first application continues to send camera data request messages, it is detected whether the first application enables a function related to the camera data request, and if it is not enabled, the first application is controlled to release. Occupation of camera applications.
  • the functions related to the camera data request include the functions of audio playback, audio recording, and floating box player during video chat and live broadcast operations.
  • Camera data needs to be used for video chat and live broadcast operations.
  • the first application does not switch to the second operation state within the first time period, and it is detected that the first application is still continuing to send the camera data request message, it is detected whether the first application is enabled for the camera data request message. Function to determine whether the current first application requests the camera application data from the camera application for function services. If not, the first application is controlled to release the occupation of the camera application to optimize the power consumption of the terminal device.
  • a white list application may also be set.
  • the applications in the white list application do not participate in the optimization processing of the embodiment of the present disclosure, that is, Before controlling the first application to release the occupation of the camera application, it is also necessary to determine that the first application does not belong to a preset white list application.
  • the first application if it is detected that the first application is switched to the second operation state, it indicates that the first application currently requests camera data for performing a functional service. At this time, the delay of the first duration sent before the migration is closed. Message to control the camera application to provide functional services for the first application normally.
  • the first application if it is detected that the first application does not send a camera data request message, it indicates that the first application idles the corresponding process after calling the camera application. At this time, it is also necessary to determine whether other applications call the camera application. , That is, sending a delayed shutdown message to the camera application for a second duration, according to a large amount of experimental data, the second duration is greater than the first duration, for example, the first duration is one minute and the second duration is two minutes.
  • Other applications call the camera application to provide more redundant time to avoid the loss of power consumption caused by the camera application being repeatedly opened and closed. In the second period, the camera application is not closed. In the second period, it is detected whether the terminal device has a second The application opens the camera application. If not, the camera application is closed. If so, the second time-delayed shutdown message sent before the transplantation is transplanted, and the camera application normally provides functional services for the second application.
  • user prompts may be provided for related operations, and when prompted for certain operations, an active confirmation operation by the user may be obtained.
  • the camera application occupation release prompt message is also sent to the user in a preset notification manner, such as a short message notification, a pop-up notification, or the like.
  • the prompt message provides controls and the like for receiving the user's confirmation operation, and the camera application is released only after receiving the user's confirmation operation for the prompt message.
  • the user may also be prompted with pop-up notifications, text message notifications, voice notifications, and other notifications that the power consumption has been optimized. For example, the user is prompted.
  • the first application has released the occupation of the camera application and the like.
  • the first operation state and the second operation state respectively correspond to the first application occupying the camera application, and an operation state in which unnecessary occupation may occur may occur, that is, a state that belongs to the power optimization range, and it is basically impossible There will be an operating state of unnecessary occupancy, that is, a state that is not in the scope of power consumption optimization.
  • an operating state of unnecessary occupancy that is, a state that is not in the scope of power consumption optimization.
  • the first duration is one minute and the second duration is two minutes.
  • the first operation state of the terminal device is the operation state where the first application is switched from the foreground to the background when the screen is bright
  • the second operation state corresponds to the state where the first application is switched from the background to the foreground when the screen is bright. status.
  • the first application sends a camera data request, it sends a one-minute delayed shutdown message to control the camera application to not close within one minute, and detects whether the state of the terminal device is switched from background to foreground operation within one minute.
  • the foreground operation considers that the first application is using the camera application to provide functional services, thereby clearing the delayed shutdown message sent and controlling the camera application to perform normal function providing services.
  • the first application requests camera data for functional services, detects whether the first application continues to send camera data request messages after one minute, and if it continues to send, detects whether the first application is in progress Live or video chat is equivalent to camera data request related functions. If there is, the camera application will not be closed. If not, the first application will be controlled to release the camera application, the first application will be forcibly stopped using the camera application, and the user will be prompted to optimize. For the power consumption of the terminal device, the unnecessary application of the first application to the camera application is cleared.
  • a two-minute delayed shutdown message is sent to detect whether the second application running in the foreground has the behavior of opening the camera application within two minutes, and if so, Remove the two-minute delayed shutdown message sent before to control the camera application to normally provide functional services for the second application. At this time, overwrite or release the occupation of the camera application by the first application. If the second application does not have When the camera application is opened, a prompt message is sent to the user asking whether to optimize the abnormality that the first application occupies the camera application. If the user confirms the optimization, the first application occupies the camera application.
  • the first operation state of the terminal device corresponds to the screen-off state
  • the second operation state corresponds to the terminal device switching from the screen-off state to the screen-on state
  • the first application when the first application occupies the camera application, it is determined whether the terminal device is off the screen. If the screen is off, it is detected whether the first application sends a camera data request message to confirm whether the first application occupies the camera application. Idle, if the first application sends a camera data request, it indicates that the process that the first application occupies the camera application is not idle. At this time, in order to further determine whether the first application is using the camera application to provide functional services, send a delayed first to the camera application. The time-delay closes the message and detects whether the state of the terminal device switches from the off-screen state to the bright screen state within one minute. If the state of the terminal device switches from the off-screen state to the bright screen state, the first application is considered to be Use the camera application to provide functional services, thereby clearing the one-minute delay message sent before and controlling the camera application to provide functional services normally.
  • the state of the terminal device is not switched from the off-screen state to the bright screen state within one minute, it is further determined whether the first application is using the camera application to provide functional services. If the first application is detected to continue sending camera data request messages after one minute , It is detected whether the first application is performing live broadcast or video chat is equivalent to the function related to the camera data request. If there is, the camera application is not closed. If not, the first application is controlled to release the occupation of the camera application, and the first application is forcibly stopped using the camera. And remind the user that the power consumption of the terminal device has been optimized, and the unnecessary application of the first application to the camera application has been removed.
  • a two-minute delayed shutdown message is sent to detect whether the terminal device is on the screen within two minutes, and whether the second application running in the foreground after the screen is on is It has the action of opening the camera application. If there is, it removes the two-minute delay closing message sent before, to control the camera application to provide functional services for the second application normally. At this time, the camera application occupation by the first application is overwritten or released. If the second application does not have the behavior of opening the camera application within two minutes, a prompt message is sent to the user to ask whether to optimize the abnormality of the camera application occupied by the first application, and if the user confirms the optimization, release the camera application occupation by the first application.
  • the camera application occupancy control method when the camera application is occupied by the first application running in the foreground, if it is determined that the terminal device is in a preset first operating state, it is detected whether the first application sends camera data Request message, if it is detected that the first application sends a camera data request message, it sends a delay shutdown message to the camera application for a first time delay, and detects whether the state of the terminal device is switched from the first operation state to the first time The second operation state, and further, if there is no switch to the second operation state, and it is detected that the first application continues to send camera data request messages, it is detected whether the first application enables a function related to the camera data request, and if not, the control is controlled
  • the first application releases the occupation of the camera application. Therefore, according to the usage situation of the camera application when the camera application is occupied by the application, unnecessary occupation is optimized, the power consumption of the terminal device is reduced, and the endurance of the terminal device is improved.
  • FIG. 4 is a schematic structural diagram of a camera application occupation control device according to an embodiment of the present disclosure. As shown in FIG. 4, the device includes: The first detection module 10, the sending module 20, the second detection module 30, the third detection module 40, and the control module 50. Among them,
  • the first detection module 10 is configured to detect whether the first application sends a camera data request message if it is determined that the terminal device is in a preset first operating state when the camera application is occupied by the first application running in the foreground.
  • the sending module 20 is configured to send a delayed shutdown message to the camera application for a first time delay when detecting that the first application sends a camera data request message.
  • the second detection module 30 is configured to detect whether the state of the terminal device is switched from the first operation state to the second operation state within the first time period.
  • the third detection module 40 is configured to detect whether the first application enables a function related to the camera data request when the first application continues to send a camera data request message when it is not switched to the second operation state.
  • the control module 50 is configured to control the first application to release the occupation of the camera application when the first application is not started.
  • determining that the terminal device is in the preset first operation state includes: determining that the first application is switched from running in the foreground to running in the background when the terminal device is in a bright screen state.
  • the second detection module 30 is specifically configured to detect whether the first application is switched from the background to the foreground to run in the first duration.
  • determining that the terminal device is in a preset first operation state includes: determining that the terminal device is in a screen-off state.
  • the second detection module 30 is specifically configured to detect whether the terminal device switches from the screen-off state to the screen-on state within the first preset time.
  • the first detection module 10 is specifically configured to: after acquiring the camera data request query instruction sent by the first application, determine the first occupation time and the first application of the camera data request query instruction obtained. Identification; obtain the application identification information and corresponding occupancy time that have been recorded in the data request interface, obtain the second occupancy time that last matched the first application identifier; and check whether the time difference between the first occupancy time and the second occupancy time is within Within the second preset time range.
  • the apparatus further includes: a determining module, configured to determine that the first application does not belong to a preset white list application.
  • the device further includes: a release prompt module, configured to send a camera application occupation release prompt message to the user in a preset notification manner; and receive a confirmation operation for the prompt message.
  • a release prompt module configured to send a camera application occupation release prompt message to the user in a preset notification manner; and receive a confirmation operation for the prompt message.
  • the apparatus further includes: a processing module configured to send a delay shutdown message of a second duration to the camera application if it is detected that the first application has not sent a camera data request message; Within two hours, detect whether the terminal device has a second application to open the camera application, and if not, close the camera application.
  • the device further includes: a migration module, configured to switch the first time delay shutdown message sent before migration to control the camera application to normally provide functions for the first application if it is switched to the second operation state. service.
  • a migration module configured to switch the first time delay shutdown message sent before migration to control the camera application to normally provide functions for the first application if it is switched to the second operation state. service.
  • the apparatus further includes: an optimization prompting module, configured to prompt the user with prompt information that the power consumption has been optimized in a preset notification manner.
  • the camera application occupancy control device detects whether the first application sends camera data if it is determined that the terminal device is in a preset first operating state when the camera application is occupied by the first application running in the foreground.
  • Request message if it is detected that the first application sends a camera data request message, it sends a delay shutdown message to the camera application for a first time delay, and detects whether the state of the terminal device is switched from the first operation state to the first time
  • the second operation state and further, if there is no switch to the second operation state, and it is detected that the first application continues to send camera data request messages, it is detected whether the first application enables a function related to the camera data request, and if not, the control is controlled
  • the first application releases the occupation of the camera application. Therefore, according to the usage situation of the camera application when the camera application is occupied by the application, unnecessary occupation is optimized, the power consumption of the terminal device is reduced, and the endurance of the terminal device is improved.
  • the present disclosure also proposes a terminal device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • the processor executes the computer program, the implementation is implemented as The occupancy control method of the camera application described in the foregoing embodiment.
  • the present disclosure also proposes a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements a occupancy control method for a camera application as proposed by the foregoing embodiments of the present disclosure.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as “first” and “second” may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "a plurality” is at least two, for example, two, three, etc., unless it is specifically and specifically defined otherwise.
  • any process or method description in a flowchart or otherwise described herein can be understood as representing a module, fragment, or portion of code that includes one or more executable instructions for implementing steps of a custom logic function or process
  • the scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present disclosure belong.
  • Logic and / or steps represented in a flowchart or otherwise described herein, for example, a sequenced list of executable instructions that may be considered to implement a logical function, may be embodied in any computer-readable medium, For use by, or in combination with, an instruction execution system, device, or device (such as a computer-based system, a system that includes a processor, or another system that can fetch instructions from and execute instructions) Or equipment.
  • an instruction execution system, device, or device such as a computer-based system, a system that includes a processor, or another system that can fetch instructions from and execute instructions
  • a "computer-readable medium” may be any device that can contain, store, communicate, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
  • computer-readable media include the following: electrical connections (electronic devices) with one or more wirings, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disk read-only memory (CDROM).
  • the computer-readable medium may even be paper or other suitable medium on which the program can be printed, because, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or other suitable Processing to obtain the program electronically and then store it in computer memory.
  • portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
  • multiple steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.
  • Discrete logic circuits with logic gates for implementing logic functions on data signals Logic circuits, ASICs with suitable combinational logic gate circuits, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
  • a person of ordinary skill in the art can understand that all or part of the steps carried by the methods in the foregoing embodiments can be implemented by a program instructing related hardware.
  • the program can be stored in a computer-readable storage medium.
  • the program is When executed, one or a combination of the steps of the method embodiment is included.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing module, or each unit may exist separately physically, or two or more units may be integrated into one module.
  • the above integrated modules may be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
  • the aforementioned storage medium may be a read-only memory, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Human Computer Interaction (AREA)
  • Studio Devices (AREA)
  • Telephone Function (AREA)

Abstract

本公开提出一种相机应用的占用控制方法和装置,其中,方法包括:当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测第一应用是否发送相机数据请求消息;若检测到,则向相机应用发送延时第一时长的延时关闭消息,并检测在第一时长内终端设备的状态是否由第一操作状态切换至第二操作状态;若没有切换至第二操作状态,且检测到第一应用继续发送相机数据请求消息,则检测第一应用是否开启与相机数据请求相关的功能,若没有开启,则控制第一应用释放对相机应用的占用。由此,根据应用占用相机应用时,对相机应用的使用情况,对不必要的占用进行优化,降低了终端设备的功耗,提高了终端设备的续航能力。

Description

相机应用的占用控制方法和装置
相关申请的交叉引用
本公开要求OPPO广东移动通信有限公司于2018年8月22日提交的、申请名称为“相机应用的占用控制方法和装置”的、中国专利申请号“201810962589.1”的优先权。
技术领域
本公开涉及终端设备控制技术领域,尤其涉及一种相机应用的占用控制方法和装置。
背景技术
随着智能手机等终端设备的普及,终端设备中应用程序的种类和功能越发多样化,其中,依托于相机应用的功能也得到了发展,比如,依赖于相机应用进行的直播功能、视频聊天功能等。
公开内容
本公开旨在至少在一定程度上解决相关技术中相机设备在非需要的情况开启或者被请求相机数据导致的终端设备功耗增加的技术问题。
为达上述目的,本公开的第一个目的在于提出一种相机应用的占用控制方法,包括以下步骤:当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测所述第一应用是否发送相机数据请求消息;若检测到所述第一应用发送所述相机数据请求消息,则向所述相机应用发送延时第一时长的延时关闭消息,并检测在所述第一时长内所述终端设备的状态是否由所述第一操作状态切换至第二操作状态;若没有切换至所述第二操作状态,且检测到所述第一应用继续发送所述相机数据请求消息,则检测所述第一应用是否开启与所述相机数据请求相关的功能,若没有开启,则控制所述第一应用释放对所述相机应用的占用。
为达上述目的,本公开第二方面实施例提出了一种相机应用的占用控制装置,包括:第一检测模块,用于当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测所述第一应用是否发送相机数据请求消息;发送模块,用于在检测到所述第一应用发送所述相机数据请求消息时,向所述相机应用发送延时第一时长的延时关闭消息;第二检测模块,用于检测在所述第一时长内所述终端设备的状态是否由所述第一操作状态切换至第二操作状态;第三检测模块,用于在没有切换至所述第二操作状态, 且检测到所述第一应用继续发送所述相机数据请求消息时,检测所述第一应用是否开启与所述相机数据请求相关的功能;控制模块,用于在没有开启时,控制所述第一应用释放对所述相机应用的占用。
为达上述目的,本公开第三方面实施例提出了一种终端设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如前述实施例所述的相机应用的占用控制方法。
为达上述目的,本公开第四方面实施例提出了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如前述实施例所述的相机应用的占用控制方法。
本公开提供的及技术方案,至少具有如下有益技术效果:
当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测第一应用是否发送相机数据请求消息,若检测到第一应用发送相机数据请求消息,则向相机应用发送延时第一时长的延时关闭消息,并检测在第一时长内终端设备的状态是否由第一操作状态切换至第二操作状态,进而,若没有切换至第二操作状态,且检测到第一应用继续发送相机数据请求消息,则检测第一应用是否开启与相机数据请求相关的功能,若没有开启,则控制第一应用释放对相机应用的占用。由此,根据应用占用相机应用时,对相机应用的使用情况,对不必要的占用进行优化,降低了终端设备的功耗,提高了终端设备的续航能力。
本公开附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本公开的实践了解到。
附图说明
本公开上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:
图1为本公开实施例所提供的一种相机应用的占用控制方法的流程示意图;
图2为本公开实施例所提供的另一种相机应用的占用控制方法的流程示意图;
图3-1为本公开实施例所提供的又一种相机应用的占用控制方法的流程示意图;
图3-2为本公开实施例所提供的再一种相机应用的占用控制方法的流程示意图;以及
图4是根据本公开一个实施例的相机应用的占用控制装置的结构示意图。
具体实施方式
下面详细描述本公开的实施例,所述实施例的示例在附图中示出,其中自始至终相同 或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本公开,而不能理解为对本公开的限制。
下面参考附图描述本公开实施例的相机应用的占用控制方法和装置。相关技术中,依赖于到相机应用提供功能服务的应用,在占用相机应用时,如果通过触发home键退出挂载在后台,或者,在占用相机的应用界面直接触发电源键灭屏,可能存在两种情况,一类是相机应用没有关闭,并且一直在后台向相机设备请求数据;另一类为不请求相机数据,但也不关闭相机设备,由此,导致了终端设备功耗的增加,降低了终端设备的续航能力。在本公开中提供的相机应用的占用控制方法中,根据相机应用被占用时的具体情况,准确筛选出不必要的占用情况,并进行优化,由此,减小了对终端设备的功耗,提高了终端设备的续航能力。
图1为本公开实施例所提供的一种相机应用的占用控制方法的流程示意图。如图1所示,该方法包括以下步骤:
步骤101,当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测第一应用是否发送相机数据请求消息。
具体地,当相机应用被当前终端设备前台运行的第一应用占用时,为了判断当前第一应用占用该相机应用时的具体使用情况,确定终端设备的是否处于预设的第一操作状态,其中,预设的第一操作状态对应于占用相机应用的第一应用,可能会出现不必要占用情况的操作状态,为了检测当前第一应用在第一操作状态下是否正在利用相机应用进行功能服务,检测第一应用是否发送相机数据请求消息。
容易理解的是,如果第一应用发送相机数据请求,则表示当前第一应用调在请求相机数据,并没有将调用相机应用后对对应的进程闲置,此时,需要进一步判断第一应用请求相机数据后,是否为了提供功能服务。
需要说明的是,根据应用场景的不同,检测第一应用是否发送相机数据请求消息的方式不同,示例如下:
作为一种可能的实现方式,如图2所示,检测第一应用是否发送相机数据请求消息的方式不同的步骤包括:
步骤201,在获取到第一应用发送的相机数据请求查询指令后,确定获取到相机数据请求查询指令的第一占用时间和第一应用标识。
其中,第一占用时间可以通过查询当前系统时刻获取。
步骤202,获取数据请求接口中已经记录的应用标识信息和对应的占用时间,获取最近一次与第一应用标识匹配的第二占用时间。
应当理解的是,在实际执行过程中,当相机应用被调用时,会执行相机数据请求的接 口,并在该接口中记录相机数据请求的应用标识和请求时间,其中,应用标识包括应用调用相机应用的进程ID或者应用程序包名称等能唯一标识应用程序的标识信息。
在本公开的实施例中,在第一应用向相机应用发送相机数据请求消息时,在与相机应用对应的数据请求接口中记录第一应用占用相机应用的第一占用时间和第一应用标识,以便于根据该记录进一步检测第一应用是否将调用相机应用对对应的进程闲置。
具体地,在获取到相机数据请求查询指令后,获取数据请求接口中记录的应用标识信息和对应的占用时间,获取在获取到相机数据请求查询指令之前记录的应用标识信息和对应的占用时间中,距离当前获取到相机数据请求查询指令的时刻最近一次与第一应用标识匹配的第二占用时间,即获取在获取到相机数据请求查询指令之前,最后一次记录的第一应用发送相机数据请求消息的时间。
步骤203,检测第一占用时间与第二占用时间的时间差值是否在第二预设时间范围内。
其中,第二预设时间范是根据大量实验数据标定的,可以为500ms等。
应当理解的是,如果第一应用将调用相机应用对对应的进程闲置,则当前发送相机数据请求查询指令的第一占用时间,相较于距离当前时刻最近时刻发送相机数据请求查询指令的第二占用时间的时间差较大,如果第一应用将调用相机应用对对应的进程没有闲置,则当前发送相机数据请求查询指令的第一占用时间,相较于距离当前时刻最近时刻发送相机数据请求查询指令的第二占用时间的时间差较小。
在本公开的实施例中通过检测第一占用时间与第二占用时间的时间差值是否在第二预设时间范围内,确定第一应用是否发送相机数据请求,也就是说,当第一占用时间与第二占用时间的时间差值在第二预设时间范围内,在确定为第一应用发送相机数据请求消息,否则,即使第一应用发送相机数据请求消息,但是相对于上次发送相机数据请求消息时间间隔较长,则认为没有接收到该相机数据请求消息。
步骤102,若检测到第一应用发送相机数据请求消息,则向相机应用发送延时第一时长的延时关闭消息,并检测在第一时长内终端设备的状态是否由第一操作状态切换至第二操作状态。
其中,第一时长是根据大量实验数据标定的,可以为1分钟等。
具体地,如果检测到第一应用发送相机数据请求消息,则表明第一应用并没有在调用相机应用后对对应的进程闲置,此时,向相机应用发送延时第一时长的延时关闭消息,在该第一时长内,相机应用不会被关闭,应当理解的是,在该第一时长内,可以进一步判断当前第一应用是否正在利用相机应用进行功能服务,需要检测在第一时长内终端设备的状态是否由第一操作状态切换至第二操作状态,其中,可以理解的是,在第二操作状态下,第一应用对相机应用的占用都是必要的占用,不属于可被优化功终端设备功耗的情况。
需要强调的是,为了确保能够优化终端设备的功耗,上述第一时长应该小于终端设备系统设定的相机应用默认的关闭时长,其中,默认的关闭时长对应于相机应用在该默认关闭时长内如果没有被请求相机数据,则直接关闭的时长。
步骤103,若没有切换至第二操作状态,且检测到第一应用继续发送相机数据请求消息,则检测第一应用是否开启与相机数据请求相关的功能,若没有开启,则控制第一应用释放对相机应用的占用。
其中,与相机数据请求相关的功能包括进行视频聊天、直播类操作时进行的音频播放、音频录音、悬浮框播放器的功能等,在进行视频聊天以及直播类操作时,需要利用相机数据。
具体地,如果在第一时长内,第一应用没有切换至第二操作状态,且检测到第一应用仍然在继续发送相机数据请求消息,则检测第一应用是否开启与相机数据请求消息相关的功能,以判断当前第一应用向相机应用请求相机应用数据是否用于功能服务,若没有开启,则控制第一应用释放对相机应用的占用,以对终端设备的功耗进行优化。
当然,考虑到用户个性化需求,可能会要求某些第一应用始终占用相机应用,此时,还可以设置白名单应用,该白名单应用中的应用不参与本公开实施例的优化处理,即在控制第一应用释放对相机应用的占用之前,还需确定第一应用不属于预设的白名单应用。
在本公开的一个实施例中,如果检测到第一应用切换至第二操作状态,则表明当前第一应用请求相机数据用于进行功能服务,此时,移植之前发送的第一时长的延迟关闭消息,控制相机应用正常为第一应用提供功能服务。
在本公开的一个实施例中,如果检测到第一应用没有发送相机数据请求消息,则表明第一应用在调用相机应用后对对应的进程闲置,此时,还需要判断其他应用是否调用相机应用,即向相机应用发送延时第二时长的延时关闭消息,其中,根据大量实验数据研究,第二时长大于第一时长,比如,第一时长为一分钟,第二时长为两分钟,以为其他应用调用相机应用提供更多的冗余时间,避免相机应用反复开启关闭导致的功耗损失,在第二时长内,相机应用不关闭,在第二时长内,检测终端设备中是否具有第二应用打开相机应用,如果没有,则关闭相机应用,如果有,则移植之前发送的第二时长的延时关闭消息,相机应用正常为第二应用提供功能服务。
在实际执行中,为了满足用户的个性化需求,在上述实施例中,可以对相关操作进行用户提示,其中,在进行某些操作的提示时,可获取用户的主动确认操作。
在本公开的一个实施例中,在控制第一应用释放对相机应用的占用之前,还以预设的通知方式,比如以短信通知、弹窗通知等方式,向用户发送相机应用占用释放提示消息,其中,该提示消息中提供与接收用户确认操作的控件等,接收到用户针对该提示消息的确 认操作后,才释放相机应用。
在本公开一个实施例中,当对第一应用释放对相机应用的占用后,还可以以弹窗通知、短信通知、语音通知等方式向用户提示功耗已经优化的提示信息,比如,提示用户第一应用已经解除对相机应用的占用等。
基于以上描述可知,第一操作状态和第二操作状态分别对应于占用相机应用的第一应用,可能会出现不必要占用情况的操作状态,即属于功耗优化范围的状态,和,基本不可能会出现不必要占用情况的操作状态,即不属于功耗优化范围的状态,为了本领域的技术人员更加清楚,下面分别在不同的应用场景下,结合上述两种操作状态进行相机应用占用控制方法的描述。
其中,在以下应用场景中,第一时长为一分钟,第二时长为两分钟。
场景一:
在该场景下,终端设备的第一操作状态为亮屏状态下第一应用由前台切换至后台的操作状态,第二操作状态对应于亮屏状态下,第一应用由后台切换至前台运行的状态。
具体地,如图3-1所示,在终端设备亮屏时,若检测到占用相机应用的第一应用由前台切换至后台运行,则为了确定第一应用是否对占用相机应用的进程闲置,检测第一应用是否发送相机数据请求。
如果第一应用发送相机数据请求,则发送一个一分钟的延时关闭消息,控制相机应用在一分钟内不关闭,检测在一分钟内终端设备的状态是否由后台切换至前台运行,如果切换至前台运行则认为第一应用在使用相机应用提供功能服务,从而清除发送的延时关闭消息,控制相机应用进行正常的功能提供服务。
如果没有切换至前台运行则进一步判断第一应用请求相机数据是否是为了进行功能服务,检测第一应用在一分钟后是否继续发送相机数据请求消息,若继续发送,则检测第一应用是否在进行直播或者视频聊天等于相机数据请求相关的功能,如果有则不关闭相机应用,如果没有则控制第一应用释放对所述相机应用的占用,强制停止第一应用使用相机应用,并提示用户已经优化对终端设备的功耗,将第一应用对相机应用的不必要占用进行了清除。
在该实施例中,如果第一应用没有发送相机数据请求,则发送一个两分钟的延时关闭消息,在两分钟内检测当前前台运行的第二应用是否具有打开相机应用的行为,如果有则移除之前发送的两分钟的延时关闭消息,控制相机应用正常为第二应用提供功能服务,此时,覆盖掉或释放第一应用对相机应用的占用,如果两分钟内第二应用不具有打开相机应用的行为,则向用户发送提示消息询问是否优化第一应用占用相机应用的异常,如果用户确认优化,则释放第一应用对相机应用的占用。
场景二:
在该场景下,终端设备的第一操作状态对应于灭屏状态,第二操作状态对应于终端设备由灭屏状态切换为亮屏状态。
如图3-2所示,当第一应用占用相机应用时,确定终端设备是否灭屏,如果灭屏则检测第一应用是否发送相机数据请求消息,以确认第一应用占用相机应用的进程是否闲置,如果第一应用发送相机数据请求,则表明第一应用占用相机应用的进程没有闲置,此时,为了进一步判断第一应用是否在使用相机应用提供功能服务,向相机应用发送延时第一时长的延时关闭消息,并检测在一分钟内终端设备的状态是否由灭屏状态切换至亮屏状态,如果终端设备的状态是否由灭屏状态切换至亮屏状态,则认为第一应用在使用相机应用提供功能服务,从而,清除之前发送的一分钟的延时消息,控制相机应用正常提供功能服务。
如果在一分钟内终端设备的状态没有由灭屏状态切换至亮屏状态,则进一步判断第一应用是否在使用相机应用提供功能服务,一分钟后若检测到第一应用继续发送相机数据请求消息,则检测第一应用是否在进行直播或者视频聊天等于相机数据请求相关的功能,如果有则不关闭相机应用,如果没有则控制第一应用释放对相机应用的占用,强制停止第一应用使用相机应用,并提示用户已经优化对终端设备的功耗,将第一应用对相机应用的不必要占用进行了清除。
在该实施例中,如果第一应用没有发送相机数据请求,则发送一个两分钟的延时关闭消息,在两分钟内检测终端设备是否亮屏,并且在亮屏后前台运行的第二应用是否具有打开相机应用的行为,如果有则移除之前发送的两分钟的延时关闭消息,控制相机应用正常为第二应用提供功能服务,此时,覆盖掉或释放第一应用对相机应用的占用,如果两分钟内第二应用不具有打开相机应用的行为,则向用户发送提示消息询问是否优化第一应用占用相机应用的异常,如果用户确认优化,则释放第一应用对相机应用的占用。
综上,本公开实施例的相机应用的占用控制方法,当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测第一应用是否发送相机数据请求消息,若检测到第一应用发送相机数据请求消息,则向相机应用发送延时第一时长的延时关闭消息,并检测在第一时长内终端设备的状态是否由第一操作状态切换至第二操作状态,进而,若没有切换至第二操作状态,且检测到第一应用继续发送相机数据请求消息,则检测第一应用是否开启与相机数据请求相关的功能,若没有开启,则控制第一应用释放对相机应用的占用。由此,根据应用占用相机应用时,对相机应用的使用情况,对不必要的占用进行优化,降低了终端设备的功耗,提高了终端设备的续航能力。
为了实现上述实施例,本公开还提出了一种相机应用的占用控制装置,图4是根据本公开一个实施例的相机应用的占用控制装置的结构示意图,如图4所示,该装置包括:第 一检测模块10、发送模块20、第二检测模块30、第三检测模块40和控制模块50,其中,
第一检测模块10,用于当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测第一应用是否发送相机数据请求消息。
发送模块20,用于在检测到第一应用发送相机数据请求消息时,向相机应用发送延时第一时长的延时关闭消息。
第二检测模块30,用于检测在第一时长内终端设备的状态是否由第一操作状态切换至第二操作状态。
第三检测模块40,用于在没有切换至第二操作状态,且检测到第一应用继续发送相机数据请求消息时,检测第一应用是否开启与相机数据请求相关的功能。
控制模块50,用于在没有开启时,控制第一应用释放对相机应用的占用。
在本公开的一个实施例中,确定终端设备处于预设的第一操作状态包括:当终端设备处于亮屏状态时,确定第一应用从前台运行切换到后台运行。第二检测模块30具体用于:检测在第一时长内第一应用是否由后台切换至前台运行。
在本公开的一个实施例中,确定终端设备处于预设的第一操作状态包括:确定终端设备处于灭屏状态。第二检测模块30具体用于:检测在第一预设时间内终端设备是否由灭屏状态切换为亮屏状态。
在本公开的一个实施例中,第一检测模块10具体用于:在获取到第一应用发送的相机数据请求查询指令后,确定获取到相机数据请求查询指令的第一占用时间和第一应用标识;获取数据请求接口中已经记录的应用标识信息和对应的占用时间,获取最近一次与第一应用标识匹配的第二占用时间;检测第一占用时间与第二占用时间的时间差值是否在第二预设时间范围内。
在本公开的一个实施例中,该装置还包括:确定模块,用于确定第一应用不属于预设的白名单应用。
在本公开的一个实施例中,该装置还包括:释放提示模块,用于以预设的通知方式向用户发送相机应用占用释放提示消息;接收针对提示消息的确认操作。
在本公开的一个实施例中,该装置还包括:处理模块,用于如果检测到第一应用没有发送相机数据请求消息,则向相机应用发送延时第二时长的延时关闭消息;在第二时长内,检测终端设备中是否具有第二应用打开相机应用,如果没有,则关闭相机应用。
在本公开的一个实施例中,该装置还包括:移植模块,用于若切换至第二操作状态,则移植之前发送的第一时长的延迟关闭消息,控制相机应用正常为第一应用提供功能服务。
在本公开的一个实施例中,该装置还包括:优化提示模块,用于以预设的通知方式向用户提示功耗已经优化的提示信息。
需要说明的是,前述对相机应用的占用控制方法实施例的解释说明也适用于该实施例的相机应用的占用控制装置,此处不再赘述。
综上,本公开实施例的相机应用的占用控制装置,当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测第一应用是否发送相机数据请求消息,若检测到第一应用发送相机数据请求消息,则向相机应用发送延时第一时长的延时关闭消息,并检测在第一时长内终端设备的状态是否由第一操作状态切换至第二操作状态,进而,若没有切换至第二操作状态,且检测到第一应用继续发送相机数据请求消息,则检测第一应用是否开启与相机数据请求相关的功能,若没有开启,则控制第一应用释放对相机应用的占用。由此,根据应用占用相机应用时,对相机应用的使用情况,对不必要的占用进行优化,降低了终端设备的功耗,提高了终端设备的续航能力。
为了实现上述实施例,本公开还提出一种终端设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如前述实施例描述的相机应用的占用控制方法。
为了实现上述实施例,本公开还提出一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本公开前述实施例提出的相机应用的占用控制方法。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本公开的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本公开的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本公开的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本公开的实施例所属技术领域的技术人员所理解。
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实 现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。
应当理解,本公开的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。如,如果用硬件来实现和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本公开各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本公开的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本公开的限制,本领域的普通技术人员在本公开的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (20)

  1. 一种相机应用的占用控制方法,其特征在于,包括以下步骤:
    当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测所述第一应用是否发送相机数据请求消息;
    若检测到所述第一应用发送所述相机数据请求消息,则向所述相机应用发送延时第一时长的延时关闭消息,并检测在所述第一时长内所述终端设备的状态是否由所述第一操作状态切换至第二操作状态;
    若没有切换至所述第二操作状态,且检测到所述第一应用继续发送所述相机数据请求消息,则检测所述第一应用是否开启与所述相机数据请求相关的功能,若没有开启,则控制所述第一应用释放对所述相机应用的占用。
  2. 如权利要求1所述的方法,其特征在于,所述确定终端设备处于预设的第一操作状态,包括:
    当所述终端设备处于亮屏状态时,确定所述第一应用从所述前台运行切换到后台运行;
    所述检测在所述第一时长内所述终端设备的状态是否由所述第一操作状态切换至第二操作状态,包括:
    检测在所述第一时长内所述第一应用是否由后台切换至前台运行。
  3. 如权利要求1所述的方法,其特征在于,所述确定终端设备处于预设的第一操作状态,包括:
    确定所述终端设备处于灭屏状态;
    所述检测在第一预设时间内所述终端设备的状态是否由所述第一操作状态切换至第二操作状态,包括:
    检测在所述第一预设时间内所述终端设备是否由所述灭屏状态切换为亮屏状态。
  4. 如权利要求1-3任一项所述的方法,其特征在于,所述检测所述第一应用是否发送相机数据请求消息,包括:
    在获取到所述第一应用发送的相机数据请求查询指令后,确定获取到所述相机数据请求查询指令的第一占用时间和所述第一应用标识;
    获取数据请求接口中已经记录的应用标识信息和对应的占用时间,获取最近一次与所述第一应用标识匹配的第二占用时间;
    检测所述第一占用时间与所述第二占用时间的时间差值是否在第二预设时间范围内。
  5. 如权利要求1-4任一项所述的方法,其特征在于,在所述控制所述第一应用释放对所述相机应用的占用之前,还包括:
    确定所述第一应用不属于预设的白名单应用。
  6. 如权利要求1-5任一项所述的方法,其特征在于,在所述控制所述第一应用释放对所述相机应用的占用之前,还包括:
    以预设的通知方式向用户发送相机应用占用释放提示消息;
    接收针对所述提示消息的确认操作。
  7. 如权利要求1-6任一项所述的方法,其特征在于,在所述检测所述第一应用是否发送相机数据请求消息之后,还包括:
    如果检测到所述第一应用没有发送所述相机数据请求消息,则向所述相机应用发送延时第二时长的延时关闭消息;
    在所述第二时长内,检测所述终端设备中是否具有第二应用打开所述相机应用,如果没有,则关闭所述相机应用。
  8. 如权利要求1-7任一项所述的方法,其特征在于,在检测在所述第一时长内所述终端设备的状态是否由所述第一操作状态切换至第二操作状态之后,还包括:
    若切换至所述第二操作状态,则移植之前发送的第一时长的延迟关闭消息,控制所述相机应用正常为第一应用提供功能服务。
  9. 如权利要求1-8任一项所述的方法,其特征在于,在所述控制所述第一应用释放对所述相机应用的占用之后,还包括:
    以预设的通知方式向用户提示功耗已经优化的提示信息。
  10. 一种相机应用的占用控制装置,其特征在于,包括:
    第一检测模块,用于当相机应用被前台运行的第一应用占用时,若确定终端设备处于预设的第一操作状态,则检测所述第一应用是否发送相机数据请求消息;
    发送模块,用于在检测到所述第一应用发送所述相机数据请求消息时,向所述相机应用发送延时第一时长的延时关闭消息;
    第二检测模块,用于检测在所述第一时长内所述终端设备的状态是否由所述第一操作状态切换至第二操作状态;
    第三检测模块,用于在没有切换至所述第二操作状态,且检测到所述第一应用继续发送所述相机数据请求消息时,检测所述第一应用是否开启与所述相机数据请求相关的功能;
    控制模块,用于在没有开启时,控制所述第一应用释放对所述相机应用的占用。
  11. 如权利要求10所述的装置,其特征在于,所述确定终端设备处于预设的第一操作状态,包括:
    当所述终端设备处于亮屏状态时,确定所述第一应用从所述前台运行切换到后台运行;
    所述第二检测模块具体用于:
    检测在所述第一时长内所述第一应用是否由后台切换至前台运行。
  12. 如权利要求10所述的装置,其特征在于,所述确定终端设备处于预设的第一操作状态,包括:
    确定所述终端设备处于灭屏状态;
    所述第二检测模块具体用于:
    检测在所述第一预设时间内所述终端设备是否由所述灭屏状态切换为亮屏状态。
  13. 如权利要求10-12任一项所述的装置,其特征在于,所述第一检测模块具体用于:
    在获取到所述第一应用发送的相机数据请求查询指令后,确定获取到所述相机数据请求查询指令的第一占用时间和所述第一应用标识;
    获取数据请求接口中已经记录的应用标识信息和对应的占用时间,获取最近一次与所述第一应用标识匹配的第二占用时间;
    检测所述第一占用时间与所述第二占用时间的时间差值是否在第二预设时间范围内。
  14. 如权利要求10-13任一项所述的装置,其特征在于,还包括:
    确定模块,用于确定所述第一应用不属于预设的白名单应用。
  15. 如权利要求10-14任一项所述的装置,其特征在于,还包括:
    释放提示模块,用于以预设的通知方式向用户发送相机应用占用释放提示消息;
    接收针对所述提示消息的确认操作。
  16. 如权利要求10-15任一项所述的装置,其特征在于,还包括:
    处理模块,用于如果检测到所述第一应用没有发送所述相机数据请求消息,则向所述相机应用发送延时第二时长的延时关闭消息;
    在所述第二时长内,检测所述终端设备中是否具有第二应用打开所述相机应用,如果没有,则关闭所述相机应用。
  17. 如权利要求10-16任一项所述的装置,其特征在于,还包括:
    移植模块,用于若切换至所述第二操作状态,则移植之前发送的第一时长的延迟关闭消息,控制所述相机应用正常为第一应用提供功能服务。
  18. 如权利要求10-17任一项所述的装置,其特征在于,还包括:
    优化提示模块,用于以预设的通知方式向用户提示功耗已经优化的提示信息。
  19. 一种终端设备,其特征在于,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如权利要求1-9中任一所述的相机应用的占用控制方法。
  20. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-9中任一所述的相机应用的占用控制方法。
PCT/CN2019/091808 2018-08-22 2019-06-19 相机应用的占用控制方法和装置 WO2020038088A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19852477.9A EP3825852B1 (en) 2018-08-22 2019-06-19 Occupation control method and apparatus for camera application
US17/161,174 US11419055B2 (en) 2018-08-22 2021-01-28 Occupation control method for camera application based on operating state of device and camera data requests

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810962589.1 2018-08-22
CN201810962589.1A CN109144728B (zh) 2018-08-22 2018-08-22 相机应用的占用控制方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/161,174 Continuation US11419055B2 (en) 2018-08-22 2021-01-28 Occupation control method for camera application based on operating state of device and camera data requests

Publications (1)

Publication Number Publication Date
WO2020038088A1 true WO2020038088A1 (zh) 2020-02-27

Family

ID=64791118

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/091808 WO2020038088A1 (zh) 2018-08-22 2019-06-19 相机应用的占用控制方法和装置

Country Status (4)

Country Link
US (1) US11419055B2 (zh)
EP (1) EP3825852B1 (zh)
CN (1) CN109144728B (zh)
WO (1) WO2020038088A1 (zh)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144728B (zh) * 2018-08-22 2020-11-06 Oppo广东移动通信有限公司 相机应用的占用控制方法和装置
CN109976918A (zh) * 2019-04-09 2019-07-05 努比亚技术有限公司 摄像头资源的调配方法、移动终端及计算机可读存储介质
CN110290353A (zh) * 2019-06-28 2019-09-27 Oppo广东移动通信有限公司 监控方法及装置、电子设备以及存储介质
CN110290352A (zh) * 2019-06-28 2019-09-27 Oppo广东移动通信有限公司 监控方法及装置、电子设备以及存储介质
CN112929493B (zh) * 2019-07-05 2022-07-12 Oppo广东移动通信有限公司 滑块控制方法及相关产品
CN110602359B (zh) * 2019-09-02 2022-01-18 Oppo广东移动通信有限公司 图像处理方法、图像处理器、拍摄装置和电子设备
CN112363836A (zh) * 2020-11-12 2021-02-12 四川长虹电器股份有限公司 一种Android系统相机资源管控的方法
CN113359992A (zh) * 2021-06-15 2021-09-07 读书郎教育科技有限公司 一种解决手势识别应用占用相机的方法
CN113489898B (zh) * 2021-06-29 2023-10-31 广州小鹏汽车科技有限公司 摄像头的调用方法、装置、交通工具和存储介质
CN113434222B (zh) * 2021-06-30 2023-06-09 青岛海尔科技有限公司 应用程序的控制方法、装置、存储介质及电子装置
CN113596328B (zh) * 2021-07-23 2023-02-24 北京字节跳动网络技术有限公司 摄像头调用方法、装置和电子设备
CN113518183B (zh) * 2021-07-23 2023-06-27 北京字节跳动网络技术有限公司 摄像头调用方法、装置和电子设备
CN114363514B (zh) * 2021-12-29 2024-03-12 上海创功通讯技术有限公司 一种相机应用控制方法及装置、存储介质
WO2023212847A1 (en) * 2022-05-05 2023-11-09 Qualcomm Incorporated Power control for an image sensor

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000165419A (ja) * 1998-11-30 2000-06-16 Nec Corp ネットワーク代理応答サーバ、ネットワークシステム及びこのネットワークシステムの消費電力低減方法
CN107861603A (zh) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 功耗控制方法及设备
CN107967178A (zh) * 2017-12-06 2018-04-27 广东欧珀移动通信有限公司 资源配置方法及相关产品
CN109144728A (zh) * 2018-08-22 2019-01-04 Oppo广东移动通信有限公司 相机应用的占用控制方法和装置

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6002436A (en) * 1997-08-28 1999-12-14 Flashpoint Technology, Inc. Method and system for auto wake-up for time lapse image capture in an image capture unit
CN101179654B (zh) * 2006-11-10 2010-07-21 北京华旗资讯数码科技有限公司 基于嵌入式系统的摄像装置的图像采集方法
US10356579B2 (en) * 2013-03-15 2019-07-16 The Nielsen Company (Us), Llc Methods and apparatus to credit usage of mobile devices
CN103257939B (zh) * 2013-04-02 2016-08-10 小米科技有限责任公司 一种获取图像的方法、装置及设备
CN104038698A (zh) * 2014-06-25 2014-09-10 深圳市中兴移动通信有限公司 后台拍摄方法和拍摄装置
CN105282832A (zh) * 2014-07-09 2016-01-27 中兴通讯股份有限公司 一种终端节电方法及装置
CN105338177B (zh) * 2015-09-30 2018-10-19 小米科技有限责任公司 信息延迟广播方法及装置
CN106060275A (zh) 2016-07-28 2016-10-26 青岛海信移动通信技术股份有限公司 一种手机相机的控制方法和控制装置
CN112882804A (zh) * 2016-08-17 2021-06-01 华为技术有限公司 一种启动应用的方法及装置
CN106371737A (zh) 2016-08-17 2017-02-01 努比亚技术有限公司 一种应用程序的关闭方法及系统
KR20190097193A (ko) * 2016-12-24 2019-08-20 후아웨이 테크놀러지 컴퍼니 리미티드 카메라 제어 방법 및 단말
CN107329559B (zh) * 2017-06-30 2021-04-16 宇龙计算机通信科技(深圳)有限公司 一种应用程序控制方法、装置、终端和存储介质
CN107704152A (zh) 2017-09-30 2018-02-16 努比亚技术有限公司 一种相机应用显示方法、设备及计算机可读存储介质
CN107797645B (zh) * 2017-10-12 2020-12-04 北京小米移动软件有限公司 资源控制方法及装置
CN107707768B (zh) * 2017-10-27 2021-04-09 Oppo广东移动通信有限公司 运行游戏应用的处理方法以及相关产品
CN107765834B (zh) * 2017-10-31 2020-05-12 Oppo广东移动通信有限公司 应用管理方法、装置、存储介质及电子设备
CN108052196A (zh) 2017-12-29 2018-05-18 北京元心科技有限公司 功耗控制方法、装置及终端设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000165419A (ja) * 1998-11-30 2000-06-16 Nec Corp ネットワーク代理応答サーバ、ネットワークシステム及びこのネットワークシステムの消費電力低減方法
CN107861603A (zh) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 功耗控制方法及设备
CN107967178A (zh) * 2017-12-06 2018-04-27 广东欧珀移动通信有限公司 资源配置方法及相关产品
CN109144728A (zh) * 2018-08-22 2019-01-04 Oppo广东移动通信有限公司 相机应用的占用控制方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3825852A4 *

Also Published As

Publication number Publication date
CN109144728A (zh) 2019-01-04
US11419055B2 (en) 2022-08-16
EP3825852A4 (en) 2021-09-22
EP3825852A1 (en) 2021-05-26
EP3825852B1 (en) 2024-03-06
CN109144728B (zh) 2020-11-06
US20210153130A1 (en) 2021-05-20

Similar Documents

Publication Publication Date Title
WO2020038088A1 (zh) 相机应用的占用控制方法和装置
US20070198682A1 (en) Method and system for seamless media handover across devices
US8196141B2 (en) Method and system for playing dynamic content
BR102012005742A2 (pt) dispositivo de processamento de dados, dispositivo receptor,e, mÉtodos para operar um dispositivo de processamento de dados e um dispositivo receptor,e, software de computador
JP6707124B2 (ja) 音声呼中のシステムコールを処理する方法、システム、及び装置
WO2018176741A1 (zh) 语音业务处理方法、装置及终端
CN106453892A (zh) 基于亮度动态调节的Android屏幕常亮与节能控制方法及系统
WO2020029807A1 (zh) 语音通话控制方法、装置、移动终端及存储介质
WO2022111407A1 (zh) 小区切换方法及装置
CN108184254A (zh) 网络连接控制方法、装置及设备
CN104904310A (zh) 分体式移动终端和通信事件的交互处理方法
CN106454550A (zh) 内容接收装置及内容接收装置的连接的变换方法
CN104917996A (zh) 视频通话切换方法和系统
CN103731457A (zh) 一种业务处理方法和终端
CN108712280B (zh) 一种网络功能的管理方法、装置、存储介质及智能终端
CN110177172A (zh) 终端防沉迷方法、装置、终端及计算机可读存储介质
WO2011131098A1 (zh) 一种设备调度方法、装置及系统
EP4201045B1 (en) Real-time and file-based audio data processing
WO2021057858A1 (zh) 即时通讯应用来电接听方法、移动终端和计算机存储介质
CN107368177B (zh) 一种用于智能设备的省电方法及省电装置
EP3932045B1 (fr) Procédés et interfaces de gestion d'une interface utilisateur d'un terminal de communication d'une communication en cours, et de contrôle de l'interface utilisateur
WO2023246181A1 (zh) 系统切换方法、终端设备及存储介质
CN111163233B (zh) 一种转接录音分割控制方法、系统及存储介质
EP2191628B1 (fr) Concentrateur automatique de sources pour système multimédia
US10237387B2 (en) Incoming call recording method and device for multi-channel terminal

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: 19852477

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019852477

Country of ref document: EP

Effective date: 20210219