Camera resource allocation method, mobile terminal and computer-readable storage medium

By determining the camera resource release status in the mobile terminal and using a delayed call method, the abnormal problem caused by the face unlock function and camera applications competing for resources is solved, and the stability and user experience of the terminal are improved.

CN109976918BActive Publication Date: 2024-09-20NUBIA TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN201910291783.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-09
Publication Date
2024-09-20
Estimated Expiration
2039-04-09

AI Technical Summary

Technical Problem

In mobile terminals, the face unlock function competes with camera applications for camera resources, causing application abnormalities.

Method used

When the screen is on, determine whether the camera resources have been released, and use delayed calling to call resources to avoid resource competition; determine the delay time by preset delay table and resource release time, and ensure that the camera resources have been released before proceeding. Image acquisition.

Benefits of technology

It improves the operational stability of mobile terminals, avoids abnormal resource competition between the face unlock function and camera applications, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109976918B
    Figure CN109976918B
Patent Text Reader

Abstract

The present invention discloses a method for allocating camera resources, a mobile terminal and a computer-readable storage medium, the method comprising: when calling camera resources to run camera applications in a screen-on state, if a screen-off instruction is received, executing a corresponding screen-off operation, and releasing the camera resources after the screen is off; when a screen-on instruction is received, lighting the display screen according to the screen-on instruction, and judging whether the camera resources have been released; if the camera resources have not been released, calling the camera resources for image acquisition after waiting for a first delay time, so as to make a face unlocking judgment according to the image acquisition result. The present invention uses a delayed call method to call resources, avoiding the situation where the face unlocking function and the camera application have resource competition resulting in application abnormality, which is conducive to improving the stability of the mobile terminal operation and improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of terminal technology, and in particular to a camera resource allocation method, a mobile terminal and a computer-readable storage medium. Background Art

[0002] With the continuous development of terminal technology, current mobile terminals are generally equipped with cameras. With the help of the camera, the terminal can realize further other functions, such as face unlocking function, system photo taking function, code scanning payment function, etc., so as to provide users with a better use experience.

[0003] Among them, when the user uses the system camera function or scan payment function of the mobile terminal, if the user triggers the screen-off command through the power button, the camera application corresponding to the system camera function or scan code payment function will release the camera resources after the terminal screen is turned off; however, if the camera application has not had time to release the camera resources, the user triggers the screen-on command through the power button to turn on the face unlocking function, the face unlocking function will compete with the camera application for camera resources, which will lead to abnormalities such as application unresponsiveness. Summary of the invention

[0004] The main purpose of the present invention is to propose a camera resource allocation method, a mobile terminal and a computer-readable storage medium, aiming to solve the technical problem that the face unlocking function competes with other camera functions for camera resources, resulting in application abnormalities.

[0005] To achieve the above object, an embodiment of the present invention provides a method for allocating camera resources, the method comprising:

[0006] When the camera resource is called to run a camera application in the screen-on state, if a screen-off instruction is received, the corresponding screen-off operation is executed, and the camera resource is released after the screen is off;

[0007] When receiving a screen-on instruction, lighting up the display screen according to the screen-on instruction, and determining whether the camera resources have been released;

[0008] If the camera resources have not been released, the camera resources are called to perform image acquisition after waiting for the first delay time, so as to perform face unlocking determination based on the image acquisition result.

[0009] Optionally, if the camera resource has not been released, the step of calling the camera resource to perform image acquisition after waiting for a first delay time, and performing face unlocking determination according to the image acquisition result includes:

[0010] If the camera resources have not been released, querying a preset delay table to determine a first delay time corresponding to the camera application;

[0011] After waiting for the first delay time corresponding to the camera application, the camera resource is called to collect images, so as to make a face unlocking judgment according to the image collection result.

[0012] Optionally, when calling the camera resource to run the camera application in the screen-on state, if a screen-off instruction is received, a corresponding screen-off operation is performed, and before the step of releasing the camera resource after the screen is off, the step further includes:

[0013] Querying an application document corresponding to the camera application to determine, according to the application document, a resource release time required for the camera application to release the camera resource;

[0014] A corresponding first delay time is acquired according to the resource release time consumption, and the first delay time is recorded in the preset delay table, wherein the first delay time is greater than or equal to the resource release time consumption.

[0015] Optionally, if the camera resource has not been released, the step of calling the camera resource for image acquisition after waiting for a first delay time to perform face unlocking determination according to the image acquisition result further includes:

[0016] Detect whether there is abnormal camera resource competition among the camera applications;

[0017] If there is abnormal competition for camera resources among the camera applications, the first delay time is extended.

[0018] Optionally, if the camera resource has not been released, the step of calling the camera resource for image acquisition after waiting for a first delay time to perform face unlocking determination according to the image acquisition result further includes:

[0019] When unlocking is determined according to the image acquisition result, releasing the camera resources;

[0020] Determine the activity interface to be displayed after unlocking, and determine whether the camera resources need to be called to display the activity interface;

[0021] If displaying the activity interface requires calling the camera resource, calling the camera resource to display the activity interface after waiting for a second delay time.

[0022] Optionally, when calling the camera resource to run the camera application in the screen-on state, if a screen-off instruction is received, a corresponding screen-off operation is executed, and after the step of releasing the camera resource after the screen is off, the method further includes:

[0023] The duration of screen off is counted, and when the duration of screen off is greater than a preset duration, the camera application is closed.

[0024] Optionally, when calling the camera resource to run the camera application in the screen-on state, if a screen-off instruction is received, a corresponding screen-off operation is executed, and after the step of releasing the camera resource after the screen is off, the method further includes:

[0025] Detecting the current remaining power, and determining whether the current remaining power is less than a preset power threshold;

[0026] If the current remaining power is less than the preset power threshold, the step of counting the duration of the screen being off is executed, and when the duration of the screen being off is greater than the preset duration, the camera application is closed.

[0027] Optionally, the step of counting the duration of screen off and closing the camera application when the duration of screen off is greater than a preset duration includes:

[0028] Count the duration of screen off and obtain the running priority of the camera application;

[0029] The preset duration corresponding to the camera application is determined according to the running priority, and when the screen-off duration is longer than the preset duration corresponding to the camera application, the camera application is closed.

[0030] In addition, to achieve the above objectives, an embodiment of the present invention also provides a mobile terminal, which also includes a processor, a memory, and a camera resource allocation program stored in the memory and run on the processor, wherein when the camera resource allocation program is executed by the processor, the steps of the camera resource allocation method as described above are implemented.

[0031] In addition, to achieve the above objectives, an embodiment of the present invention also provides a computer-readable storage medium, on which a camera resource allocation program is stored. When the camera resource allocation program is executed by a processor, the steps of the camera resource allocation method as described above are implemented.

[0032] The mobile terminal of the embodiment of the present invention starts to release the camera resources when the screen is turned off, so that the camera resources can be called by other applications (or functions); at the same time, considering that the release of camera resources takes a certain amount of time, when the camera resources need to be called, it is first determined whether the camera resources have been released. If not, the resource call is made by delayed calling, thereby avoiding the situation where resource competition between the face unlocking function and camera applications causes application abnormalities, which is beneficial to improving the stability of the mobile terminal operation and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present invention;

[0034] Figure 2 A communication network system architecture diagram of a mobile terminal in an embodiment of the present invention;

[0035] Figure 3 It is a flowchart of a first embodiment of a method for allocating camera resources of the present invention;

[0036] Figure 4 for Figure 3 If the camera resources are not released completely, calling the camera resources to collect images after waiting for a first delay time, and performing face unlocking determination according to the image collection result;

[0037] Figure 5 It is a flowchart of a second embodiment of the method for allocating camera resources of the present invention;

[0038] Figure 6 It is a flowchart of a third embodiment of the method for allocating camera resources of the present invention;

[0039] Figure 7 4 is a flow chart of a fourth embodiment of a method for allocating camera resources according to the present invention.

[0040] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0041] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0042] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.

[0043] The camera resource allocation method in the embodiment of the present invention is applied to a mobile terminal, which can be implemented in various forms. For example, the mobile terminal involved in the present invention can include devices such as mobile phones, tablet computers, and handheld computers.

[0044] The following description will be made by taking a mobile phone as an example. It will be understood by those skilled in the art that, in addition to components specifically used for mobile purposes, the configuration according to the embodiments of the present invention can also be applied to other types of mobile terminals.

[0045] See also Figure 1 , Figure 1 To implement the mobile terminal hardware structure diagram of each embodiment of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, A / V (audio / video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art can understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation on the mobile terminal. The mobile terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0046] Combine the following Figure 1 The following is a detailed introduction to the various components of the mobile terminal:

[0047] The radio frequency unit 101 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving the downlink information of the base station, it is sent to the processor 110 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 101 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 101 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution), etc.

[0048] WiFi is a short-range wireless transmission technology. Mobile terminals can help users send and receive emails, browse web pages, and access streaming media through WiFi module 102. It provides users with wireless broadband Internet access. Figure 1 The WiFi module 102 is shown, but it is understandable that it is not an essential component of the mobile terminal and can be omitted as needed without changing the essence of the invention.

[0049] The audio output unit 103 can convert the audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, etc. Moreover, the audio output unit 103 can also provide audio output related to a specific function performed by the mobile terminal 100 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, etc.

[0050] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processor (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 106. The image frame processed by the graphics processor 1041 can be stored in the memory 109 (or other storage medium) or sent via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a telephone call mode, a recording mode, a voice recognition mode, and other operating modes, and can process such sound into audio data. The processed audio (voice) data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 can implement various types of noise elimination (or suppression) algorithms to eliminate (or suppress) noise or interference generated in the process of receiving and sending audio signals.

[0051] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the terminal posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured on the mobile phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0052] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0053] The user input unit 107 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1071 or near the touch panel 1071 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 110, and can receive and execute the command sent by the processor 110. In addition, the touch panel 1071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, etc., which are not specifically limited here.

[0054] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of the touch event. Then, the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Figure 1 In the figure, the touch panel 1071 and the display panel 1061 are used as two independent components to implement the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to implement the input and output functions of the mobile terminal, which is not limited here.

[0055] The interface unit 108 serves as an interface through which at least one external device can be connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.

[0056] The memory 109 can be used to store software programs and various data. The memory 109 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 109 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0057] The processor 110 is the control center of the mobile terminal. It uses various interfaces and lines to connect various parts of the entire mobile terminal. It executes various functions of the mobile terminal and processes data by running or executing the message display program and / or module stored in the memory 109, and calling the data stored in the memory 109, so as to monitor the mobile terminal as a whole. The processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 110.

[0058] The mobile terminal 100 may also include a power supply 111 (such as a battery) for supplying power to various components. Preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.

[0059] although Figure 1 Not shown, the mobile terminal 100 may further include a Bluetooth module, etc., which will not be described in detail here.

[0060] To facilitate understanding of the embodiments of the present invention, the communication network system based on which the mobile terminal of the present invention receives a new message is described below.

[0061] See also Figure 2 , Figure 2 This is a communication network system architecture diagram of a mobile terminal in an embodiment of the present invention. The communication network system is an LTE system of universal mobile communication technology. The LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203 and an operator's IP service 204, which are sequentially connected for communication.

[0062] Specifically, UE201 may be the above-mentioned mobile terminal 100, which will not be described in detail here.

[0063] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 , etc. Among them, eNodeB 2021 can be connected to other eNodeBs 2022 through a backhaul (eg, an X2 interface), and eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 can provide UE 201 with access to EPC 203 .

[0064] EPC203 may include MME (Mobility Management Entity) 2031, HSS (Home Subscriber Server) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, PGW (PDN Gate Way) 2035 and PCRF (Policy and Charging Rules Function) 2036, etc. Among them, MME2031 is a control node that processes signaling between UE201 and EPC203, and provides bearer and connection management. HSS2032 is used to provide some registers to manage functions such as home location register (not shown in the figure), and save some user-specific information such as service features and data rates. All user data can be sent through SGW2034, PGW2035 can provide IP address allocation and other functions for UE 201, PCRF2036 is the policy and charging control policy decision point for service data flow and IP bearer resources, which selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).

[0065] The IP service 204 may include the Internet, an intranet, an IMS (IP Multimedia Subsystem) or other IP services.

[0066] Although the above introduction takes the LTE system as an example, those skilled in the art should know that the present invention is not only applicable to the LTE system, but also to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA and future new network systems, etc., which are not limited here.

[0067] Based on the hardware structure of the mobile terminal and the communication network system, various embodiments of the method for allocating camera resources of the present invention are proposed.

[0068] Reference Figure 3 , Figure 3 It is a flowchart diagram of the first embodiment of the method for allocating camera resources of the present invention.

[0069] In this embodiment, the method for allocating camera resources includes:

[0070] Step S10, when calling the camera resource to run the camera application in the screen-on state, if a screen-off instruction is received, the corresponding screen-off operation is executed, and the camera resource is released after the screen is off;

[0071] With the continuous development of terminal technology, current mobile terminals are generally equipped with cameras. With the help of this camera, the mobile terminal can realize further other functions, such as face unlocking function, system photo function, code scanning payment function, etc., so as to provide users with a better user experience. Among them, when the user uses the system photo function or scan payment function of the mobile terminal, if the user triggers the screen off command through the power button, the camera application corresponding to the system photo function or code scanning payment function will release the camera resources after the terminal turns off the screen; however, if the camera application has not had time to release the camera resources, the user triggers the screen on command through the power button to turn on the face unlocking function, then the face unlocking function will compete with the camera application for camera resources, which will lead to abnormalities such as no response of the application. In this regard, this embodiment proposes a method for allocating camera resources, which solves the application abnormality problem caused by the competition of camera resources between face unlocking and other camera functions by delaying the call of camera resources, which is conducive to improving the stability of mobile terminal operation and improving user experience.

[0072] The mobile terminal in this embodiment is described by taking an Android phone as an example. The user's phone includes a camera; of course, in practice, the phone's camera may include a front camera and a rear camera, but it is worth noting that due to the influence of factors such as the system encoder or the driver, the phone can generally only use the front camera or only use the rear camera to take pictures (collect images) at the same time. With the help of this camera resource, the phone is also provided with a face unlocking function: when the phone turns on the display screen in the off-screen state, it can collect images through the camera (camera resource) and perform face recognition on the collected image; if a face image matching the preset user image is identified in the collected image, the display screen is unlocked, and the user can operate the phone by touching the phone display screen; and if a matching face image is not identified in the collected image, the display screen will remain locked, and the user cannot operate the phone by touching the phone display screen. In addition, other camera applications are also installed in the phone, which refers to applications that can realize certain functions through camera resources, including system applications and third-party applications; for example, system photo applications, scan code payment applications (applications that scan QR codes through camera resources to realize payment functions), etc.

[0073] In this embodiment, when the mobile phone calls the camera resources to run the camera application in the screen-on state, the user can see the image captured by the camera on the mobile phone display screen. For example, when the mobile phone takes a photo through the front camera, the user can see the image captured by the front camera on the mobile phone display screen. At this time, the user can trigger the screen-off command by pressing the power button (of course, the screen-off command can also be triggered by other methods); when the mobile phone receives the screen-off command, it will perform the corresponding screen-off operation according to the screen-off command; and after the screen is turned off, the mobile phone will control the camera application that originally called the camera resources to release the camera resources, so that the camera resources can be applied for by other applications (or functions). It is worth noting that the release time of the camera resources can be later than the screen-off time, for example, the camera resources can be released 100 milliseconds after the screen is turned off; and after the screen is turned off, the display screen of the mobile phone will be in a locked state (screen-off lock), and the user cannot operate the mobile phone by touching the display screen of the mobile phone.

[0074] Step S20, when receiving the screen light up instruction, lighting up the display screen according to the screen light up instruction, and determining whether the camera resources have been released;

[0075] In this embodiment, when the mobile phone is in the screen-off state, the user can press the power button again, and the screen will be lit. When the mobile phone receives the screen-on command, it will light up the display screen according to the screen-on command; at this time, since the mobile phone changes from the screen-off state to the screen-on state, the face unlocking function will be automatically started. Before confirming to unlock, the display screen of the mobile phone is still in a locked state (screen-on lock). Although the user can see the lock screen wallpaper (or lock screen interface) displayed on the display screen, the mobile phone cannot be operated by touching the display screen. In this embodiment, in order to realize the face unlocking function, the mobile phone needs to call the camera resources for image acquisition to perform subsequent face recognition and other operations. However, in practice, it takes time for applications (or functions) to release resources, and the process of releasing camera resources by camera applications in step S10 also takes a certain amount of time to complete; if the face unlock function applies for camera resources before the camera resources are fully released, the face unlock function will compete with the camera application for resources, and because the face unlock function has higher camera resource usage rights than other applications, the face unlock function will seize the camera resources that have not been fully released by the camera application, causing the camera application to release resources abnormally, which in turn causes abnormal situations such as no response from the camera application. Based on the above reasons, when the face unlock function needs to be enabled, this embodiment first determines whether the camera resources have been fully released; if the camera resources have been fully released, the mobile phone can allocate the camera resources to the face unlock function to call the camera resources for image acquisition, and determine the face result based on the image acquisition; if the camera resources have not been fully released, then proceed to step S30.

[0076] Furthermore, in this embodiment, the judgment of whether the camera resource has been released can be performed through the driver interface. Specifically, a camera resource usage detection program can be set in the driver of the camera resource, and the calling state and release state of the camera resource can be detected in real time through the usage detection program; at the same time, the driver also provides a state query interface, through which it can be known whether the current camera resource has been called and whether it has been released. Of course, in practice, the judgment of the release state of the camera resource can also be achieved through other methods.

[0077] Step S30: If the camera resources have not been released, the camera resources are called to collect images after waiting for a first delay time, so as to make a face unlocking decision based on the image collection result.

[0078] In this embodiment, when the mobile phone lights up the display screen according to the screen-on instruction, if it is determined that the camera resources have not been released, the mobile phone will wait (delay) for a period of time before calling the camera resources to realize the face unlocking function, where the waiting (delay) time can be called the first delay time; for example, the mobile phone lights up the screen at 9:00:00, at this time, because the camera resources have not been released, the mobile phone waits for 0.5 seconds before calling the camera resources to realize the face unlocking function, that is, the camera resources are called at 9:00:0.5. Since the mobile phone will call the camera resources for image acquisition after waiting for a period of time, a certain amount of time is reserved for the release of camera resources, which can avoid the situation of calling the camera resources that have not been released to a certain extent, thereby avoiding the situation of resource competition between the face unlocking function and camera applications. Of course, in practice, the first delay time can be set according to the actual situation; in addition, for different camera applications, different first delay times can be set respectively, so that the actual waiting time can be dynamically adjusted according to the specific usage. After waiting for the first delay time, the mobile phone can call the camera resources to capture images, and perform face recognition and face unlocking on the captured images; if a face image matching the preset user image is recognized in the captured image, the display screen is unlocked, and the user can operate the phone by touching the phone display screen; if no matching face image is recognized in the captured image, the display screen will remain locked, and the user cannot operate the phone by touching the phone display screen.

[0079] Further, see Figure 4 , Figure 4 for Figure 3 If the camera resources are not released completely, the camera resources are called to acquire images after waiting for a first delay time, so as to perform face unlocking judgment according to the image acquisition result.

[0080] In this embodiment, step S30 includes:

[0081] Step S31, if the camera resources have not been released, querying a preset delay table to determine a first delay time corresponding to the camera application;

[0082] In this embodiment, when the mobile phone lights up the display screen according to the screen-on instruction, if it is determined that the camera resources have not been released, the mobile phone will wait (delay) for a period of time before calling the camera resources to realize the face unlocking function, where the waiting (delay) time can be called the first delay time. Since the mobile phone will call the camera resources for image acquisition after waiting for a period of time, a certain time is reserved for the release of camera resources, which can avoid the situation of calling the camera resources that have not been released to a certain extent, thereby avoiding the situation of resource competition between the face unlocking function and the camera application. It is worth noting that for different camera applications, the time consumption of releasing camera resources may be different, so the first delay time can also be set according to the different camera applications; for the convenience of recording, a preset delay table can be pre-set in the mobile phone of this embodiment, and the preset delay table records the first delay times corresponding to multiple different camera applications. Specifically, when the mobile phone lights up the display screen according to the screen-on instruction, if it is determined that the camera resources have not been released, the mobile phone will query the preset delay table and determine the first delay time corresponding to the camera application according to the preset delay table. For example, the preset delay table records the full path names of activities of multiple different camera applications and their corresponding first delay times. When the screen of the mobile phone is turned off, the onWindowChanged method in StatusBar.java of the system application SystemUI can be used to obtain and record the full path name of the activity of the camera application that called the camera resources just before the screen was turned off. When the mobile phone turns on the display screen according to the screen-on instruction, if it is determined that the camera resources have not been released yet, the preset delay table will be queried according to the recorded full path name of the activity to determine the first delay time corresponding to the camera application that called the camera resources just before.

[0083] It is worth noting that the first delay time in this embodiment can be set by the user and recorded in the preset delay table, or the developer of the camera application or other personnel can determine the resource release time required for the camera application to release the camera resources through testing, and then record it in the relevant application document. The mobile phone records the corresponding first delay time in the preset delay table according to the application document, so that the first delay time is more in line with the actual use of the camera application. Specifically, when the developer of the camera application sets the camera application on the network for download, the corresponding application document can also be set on the network. The application document includes the resource release time required for the camera application to release the camera resources. Of course, the application document can also include other content, such as the version number and version description of the camera application. When a mobile phone installs a camera application, it can query the application document corresponding to the camera application from the network to determine the resource release time required for the camera application to release camera resources from the application document; when determining the resource release time, the mobile phone can obtain the corresponding first delay time according to the resource release time, and record the first delay time in a preset delay table; wherein the first delay time is greater than or equal to the resource release time to ensure that the waiting (delay) time is not less than the resource release time. For example, if the resource release time of the scan-and-pay application is 0.4 seconds, the first delay time of the scan-and-pay application can be determined to be 0.5 seconds. Of course, in actual applications, the specific conversion relationship between the first delay time and the resource release time can be defined and set according to actual conditions.

[0084] Step S32: After waiting for a first delay time corresponding to the camera application, the camera resource is called to acquire an image, so as to make a face unlocking determination based on the image acquisition result.

[0085] In this embodiment, when determining the first delay time corresponding to the camera application, the mobile phone will wait for the first delay time before calling the camera resources for image acquisition, that is, delaying the start of face unlocking. For example, the postDelay method of the system's Handler class is used to delay the start of face unlocking, thereby reserving a certain time for the release of camera resources. To a certain extent, it can avoid the situation of calling camera resources that have not been released.

[0086] In this embodiment, when the mobile terminal calls the camera resources to run the camera application in the screen-on state, if the screen-off instruction is received, the corresponding screen-off operation is performed, and the camera resources are released after the screen is off; when the screen-on instruction is received, the display screen is lit according to the screen-on instruction, and it is determined whether the camera resources have been released; if the camera resources have not been released, the camera resources are called for image acquisition after waiting for the first delay time, so as to make a face unlocking judgment based on the image acquisition result. In the above manner, the mobile terminal of this embodiment starts to release the camera resources when the screen is off, so that the camera resources can be called by other applications (or functions); at the same time, considering that the release of camera resources takes a certain amount of time, when the camera resource call is needed, it is first determined whether the camera resource has been released. If it has not been released, the resource call is performed by delaying the call, thereby avoiding the situation where the face unlocking function and the camera application have resource competition and cause application abnormality, which is conducive to improving the stability of the mobile terminal operation and improving the user experience.

[0087] Based on the above Figure 3 The illustrated embodiment provides a second embodiment of the method for allocating camera resources of the present invention.

[0088] Reference Figure 5 , Figure 5 It is a flowchart diagram of the second embodiment of the method for allocating camera resources of the present invention.

[0089] In this embodiment, after step S30, the following steps are further included:

[0090] Step S40, detecting whether there is abnormal camera resource competition among the camera applications;

[0091] The first delay time set and used in the above step S30 may not necessarily match the time it takes for the camera application to actually release the camera resources. For example, after waiting for the first delay time, the camera resources may not be released completely. At this time, resource conflicts may still occur when the call is made, resulting in application abnormalities. Secondly, with the long-term use of the mobile phone, the internal performance of the mobile phone may degrade to a certain extent, and the time it takes to release the camera resources will also increase. At this time, the first delay time may not match the time it takes for the camera application to actually release the camera resources. Considering the above problems, in this embodiment, the first delay time can also be dynamically adjusted according to the actual operating status of the mobile phone. Specifically, after the mobile phone calls the camera resources for image acquisition (face unlocking), it will detect whether the camera application that originally called the camera resources has camera resource competition anomalies, such as whether there are abnormal situations such as no response to the application or forced exit of the application due to forced resource preemption. If this exception exists, it can be considered that when the mobile phone calls the camera resources for image acquisition (face unlocking), the camera resources have not been released completely, that is, the camera resources are preempted from the related processes of the camera application. In other words, it can be considered that the currently set first delay time does not match the time it takes for the camera application to actually release the camera resources, which leads to the exception, and step S50 is entered at this time; if this exception does not exist, it can be considered that when the mobile phone calls the camera resources for image acquisition (face unlocking), the camera resources have been released completely. In other words, it can be considered that the currently set first delay time matches the time it takes for the camera application to actually release the camera resources.

[0092] Step S50: if there is abnormal contention for camera resources among the camera applications, extend the first delay time.

[0093] In this embodiment, if there is an abnormality in camera resource competition in camera applications, it can be considered that when the mobile phone calls the camera resources for image acquisition (face unlocking), the camera resources are not fully released, that is, the camera resources are seized from the relevant processes of the camera applications. In other words, it can be considered that the currently set first delay time does not match the time it takes for the camera application to actually release the camera resources, which leads to the abnormality. In this regard, the mobile phone can adjust the first delay time and delay the first delay time. For example, if the original first delay time is 0.5 seconds, it can be extended to 0.7 seconds, so as to make the adjusted first delay time match the time it takes for the camera application to actually release the camera resources, and avoid the subsequent abnormality in camera resource competition. Of course, in specific applications, the specific extension rule of the first delay time (extended time value) can be set according to actual conditions.

[0094] Through the above method, the first delay time can be dynamically adjusted, so that the setting of the first delay time can be more in line with the actual operation of the mobile phone, which is beneficial to improving the stability of the operation of the mobile phone.

[0095] Based on the above Figure 3 The illustrated embodiment provides a third embodiment of the method for allocating camera resources of the present invention.

[0096] Reference Figure 6 , Figure 6 It is a flowchart diagram of a third embodiment of the method for allocating camera resources of the present invention.

[0097] In this embodiment, after step S30, the following steps are further included:

[0098] Step S60, when it is determined to be unlocked according to the image acquisition result, releasing the camera resources;

[0099] In this embodiment, after the mobile phone captures images through the camera (camera resources) and performs face recognition on the captured images, if a face image matching the preset user image is recognized in the captured image, it can be determined to unlock the display screen; at the same time, the mobile phone will also control the face unlocking function to release the camera resources, so that the camera resources can be applied for by other applications (or functions).

[0100] Step S70, determining the activity interface to be displayed after unlocking, and determining whether displaying the activity interface requires calling the camera resource;

[0101] In this embodiment, when the mobile phone releases the camera resources, it will also determine the activity interface that needs to be displayed after unlocking, and at the same time determine whether the display of the activity interface needs to call the camera resources. It is worth noting that, in general, the activity interface displayed by the mobile phone after the screen is unlocked is the same as the activity interface displayed before the last screen is turned off. If the activity interface displayed before the last screen is turned off needs to call the camera resources, the activity interface to be displayed after the screen is unlocked also needs to call the camera resources, such as the scan code interface of the scan payment application; of course, in some cases, the mobile phone may have the situation of turning off the screen to kill the process (or turning off the screen to close the application), that is, during the screen-off process, the mobile phone may exit certain interfaces, automatically close certain running programs, etc. If the mobile phone exits the activity interface displayed before the screen is turned off in the screen-off state, or the mobile phone automatically closes certain running programs in the screen-off state, then the mobile phone needs to determine the activity interface that needs to be displayed after unlocking according to the specific settings of the mobile phone when the screen is unlocked, such as the desktop homepage, the main page of a certain application, etc., and determine whether the activity interface needs to call the camera resources. If displaying the activity interface does not require calling camera resources, the mobile phone can directly hide the lock screen interface and display the activity interface; if displaying the activity secret requires calling camera resources, enter step S80.

[0102] Step S80: If displaying the activity interface requires calling the camera resource, calling the camera resource to display the activity interface after waiting for a second delay time.

[0103] In this embodiment, if it is determined that the display of the active interface requires the call of camera resources, the mobile phone will wait (delay) for a period of time before calling the camera resources to display the active interface, wherein the waiting (delay) time can be referred to as the second delay time. This is because it is considered that the face unlocking function also requires a certain amount of time to release the camera resources. If the face unlocking function does not release the camera resources completely before calling the resources, since the face unlocking function has a higher camera resource usage permission than other applications, the mobile phone cannot allocate the camera resources to the active interface (or the program or application to which the active interface belongs), that is, the active interface (or the program or application to which the active interface belongs) cannot apply for the camera resources, which will cause the active interface to display abnormally (or the program or application to which the active interface belongs cannot run abnormally). In this regard, when it is determined that the active interface needs to call the camera resources, this embodiment waits for a period of time before calling, reserving a certain amount of time for the release of the camera resources, which can avoid the situation of calling the camera resources that have not been released to a certain extent, thereby avoiding the situation of resource competition between the face unlocking function and camera applications. It is worth noting that during the waiting period, the mobile phone can keep displaying the lock screen interface on the display screen, and then hide the lock screen interface and display the active interface when the camera is called, so that the display screen will not appear white or dark screen while waiting, which is beneficial to improving the user experience.

[0104] Through the above method, after the screen of the mobile terminal in this embodiment is unlocked, if the displayed active interface needs to call the camera resources, the resource call can be performed in a delayed call manner, reserving a certain time for the release of the camera resources. To a certain extent, it can avoid the situation of calling the camera resources that have not been released, thereby avoiding the resource competition between the face unlocking function and camera applications, which is beneficial to improving the stability of the mobile terminal operation and improving the user experience.

[0105] Based on the above Figure 3 , Figure 5 or Figure 6 The embodiment shown in any of the accompanying drawings provides a fourth embodiment of the method for allocating camera resources of the present invention.

[0106] Reference Figure 7 , Figure 7 4 is a flow chart of a fourth embodiment of a method for allocating camera resources according to the present invention.

[0107] In this embodiment, after step S10, the following steps are further included:

[0108] Step S90, counting the duration of screen off, and closing the camera application when the duration of screen off is greater than a preset duration.

[0109] In this embodiment, considering that camera applications are generally high-power applications, if camera applications are kept running in the background for a long time, the power consumption of the mobile phone will be accelerated; in this regard, this embodiment can provide a function of automatically closing camera applications, thereby reducing the power consumption of the mobile phone. Specifically, after the screen is turned off, the mobile phone will count the duration of the screen off and compare the duration of the screen off with the preset duration, where the preset duration can be set according to the actual situation, for example, set to 3 minutes; when the duration of the screen off is less than or equal to the preset duration, the mobile phone can maintain the current operating state unchanged; when the duration of the screen off is greater than the preset duration, it can be considered that the duration of the screen off is long, and the high-power camera application has been running in the background without being operated by the user, which accelerates the power consumption of the mobile phone. At this time, the mobile phone can automatically turn off the camera application. In the above manner, the power consumption of the mobile phone can be reduced, which is conducive to extending the battery life of the mobile phone and improving the user experience.

[0110] Furthermore, the function of automatically shutting down camera applications to reduce energy consumption in this embodiment can be automatically triggered when the mobile phone is turned on; or it can be triggered only when certain conditions are met, such as when the power of the mobile phone is less than a certain threshold. Specifically, in this embodiment, after the screen is turned off, the mobile phone will detect the current remaining power, and then compare the remaining power with a preset power threshold, wherein the preset power threshold can be set according to actual conditions, for example, set to 40%; when the remaining power is greater than or equal to the preset power threshold, the mobile phone can maintain the current operating state unchanged; when the remaining power is less than the preset power threshold, it can be considered that the power of the mobile phone is low, and it is necessary to reduce energy consumption in a certain way to improve battery life. At this time, the mobile phone automatically triggers the above-mentioned function of automatically shutting down camera applications, that is, executing the content of step S60 (counting the duration of the screen off, and shutting down the camera application when the duration of the screen off is greater than the preset duration). In the above manner, the function of automatically shutting down camera applications can be triggered (or started) only when the power of the mobile phone is low, which ensures to a certain extent that the process of reducing energy consumption will not excessively affect the normal use of the user's mobile phone, which is conducive to improving the user's experience.

[0111] Furthermore, in this embodiment, when triggering the automatic closing of camera applications, different camera applications can be set with the same preset duration value; or different preset duration values ​​can be set for different camera applications to adapt to the usage needs and habits of different users and realize the personalized configuration of mobile phone functions. Specifically, for different camera applications, corresponding running priorities can be set, where different running priorities correspond to different preset durations; for example, the running priorities include high priority, medium priority, and low priority, and the preset duration corresponding to the high priority is 4 minutes, the preset duration corresponding to the medium priority is 3 minutes, and the preset duration corresponding to the low priority is 2 minutes. When the mobile phone counts the duration of screen off, it will also obtain the corresponding running priority of the camera application, for example, the scan payment application is a high priority and the system photo application is a low priority. When determining the running priority level of the camera application, the preset duration corresponding to the camera application can be determined, for example, the preset duration corresponding to the scan payment application is 4 minutes, and the preset duration corresponding to the system photo application is 2 minutes. Then the duration of screen off can be compared with the preset duration corresponding to the camera application; if the duration of screen off is less than the preset duration corresponding to the camera application, the current running state of the mobile phone can be kept unchanged; if the duration of screen off is greater than the preset duration corresponding to the camera application, the camera application is closed; for example, if the duration of screen off is 3 minutes, if the camera application is a scan-and-pay application (the corresponding preset duration is 4 minutes), the current running state of the mobile phone can be kept unchanged, and if the camera application is a system photo application (the corresponding preset duration is 2 minutes), the system photo application can be closed. By setting different preset duration values ​​for different camera applications to meet the usage needs and habits of different users, personalized configuration of mobile phone functions is achieved, which is conducive to improving the user experience.

[0112] In addition, an embodiment of the present invention further provides a mobile terminal.

[0113] The mobile terminal of an embodiment of the present invention includes a processor, a memory, and a camera resource allocation program stored in the memory and executable on the processor, wherein when the camera resource allocation program is executed by the processor, the steps of the camera resource allocation method as described above are implemented.

[0114] Among them, the method implemented when the camera resource allocation program is executed can refer to the various embodiments of the camera resource allocation method of the present invention, and will not be repeated here.

[0115] In addition, an embodiment of the present invention further provides a computer-readable storage medium.

[0116] The computer-readable storage medium of the present invention stores a camera resource allocation program, and when the camera resource allocation program is executed by a processor, the steps of the camera resource allocation method described above are implemented.

[0117] Among them, the method implemented when the camera resource allocation program is executed can refer to the various embodiments of the camera resource allocation method of the present invention, and will not be repeated here.

[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0119] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for allocating camera resources, characterized in that: The camera resource allocation method includes: When the camera resource is called to run a camera application in the screen-on state, if a screen-off instruction is received, the corresponding screen-off operation is executed, and the camera resource is released after the screen is off; When receiving a screen-lighting instruction, lighting up the display screen according to the screen-lighting instruction, and determining whether the camera resources have been released; If the camera resource has not been released, calling the camera resource to collect images after waiting for a first delay time, so as to make a face unlocking determination according to the image collection result; If the camera resource is not released completely, the method further includes: calling the camera resource for image acquisition after waiting for a first delay time to perform face unlocking determination according to the image acquisition result; Detect whether there is abnormal camera resource competition among the camera applications; If there is abnormal competition for camera resources among the camera applications, the first delay time is extended.

2. The method for allocating camera resources as claimed in claim 1, characterized in that: If the camera resource is not released completely, the step of calling the camera resource to collect images after waiting for a first delay time, and making a face unlocking determination based on the image collection result includes: If the camera resources have not been released, querying a preset delay table to determine a first delay time corresponding to the camera application; After waiting for the first delay time corresponding to the camera application, the camera resource is called to collect images, so as to make a face unlocking judgment according to the image collection result.

3. The method for allocating camera resources as claimed in claim 2, characterized in that: When the camera resource is called to run the camera application in the screen-on state, if a screen-off instruction is received, a corresponding screen-off operation is performed, and before the step of releasing the camera resource after the screen is off, the method further includes: Querying an application document corresponding to the camera application to determine, according to the application document, a resource release time required for the camera application to release the camera resource; A corresponding first delay time is acquired according to the resource release time consumption, and the first delay time is recorded in the preset delay table, wherein the first delay time is greater than or equal to the resource release time consumption.

4. The method for allocating camera resources as claimed in claim 1, characterized in that: If the camera resource is not released completely, the method further includes: calling the camera resource for image acquisition after waiting for a first delay time to perform face unlocking determination according to the image acquisition result; When unlocking is determined according to the image acquisition result, releasing the camera resources; Determine the activity interface to be displayed after unlocking, and determine whether the camera resources need to be called to display the activity interface; If displaying the activity interface requires calling the camera resource, calling the camera resource to display the activity interface after waiting for a second delay time.

5. The method for allocating camera resources according to any one of claims 1 to 4, characterized in that: When the camera resource is called to run the camera application in the screen-on state, if a screen-off instruction is received, a corresponding screen-off operation is executed, and after the step of releasing the camera resource after the screen is off, the method further includes: The duration of screen off is counted, and when the duration of screen off is greater than a preset duration, the camera application is closed.

6. The method for allocating camera resources as claimed in claim 5, characterized in that: When the camera resource is called to run the camera application in the screen-on state, if a screen-off instruction is received, a corresponding screen-off operation is executed, and after the step of releasing the camera resource after the screen is off, the method further includes: Detecting the current remaining power, and determining whether the current remaining power is less than a preset power threshold; If the current remaining power is less than the preset power threshold, the step of counting the duration of the screen being off is executed, and when the duration of the screen being off is greater than the preset duration, the camera application is closed.

7. The method for allocating camera resources as claimed in claim 5, characterized in that: The step of counting the duration of screen off and closing the camera application when the duration of screen off is greater than a preset duration includes: Count the duration of screen off and obtain the running priority of the camera application; The preset duration corresponding to the camera application is determined according to the running priority, and when the screen-off duration is longer than the preset duration corresponding to the camera application, the camera application is closed.

8. A mobile terminal, characterized in that: The mobile terminal also includes a processor, a memory, and a camera resource allocation program stored in the memory and executable on the processor, wherein when the camera resource allocation program is executed by the processor, the steps of the camera resource allocation method as described in any one of claims 1 to 7 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a camera resource allocation program, and when the camera resource allocation program is executed by a processor, the steps of the camera resource allocation method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Catalytic dehydrohalogenation process

    EP0002021A1

  • Camera distribution method and system for Android system

    CN105068945A

  • Occupancy control method and device for camera application

    CN109144728A

  • Camera module control method and device

    CN109246361A

  • Method for controlling camera system, electronic device, and storage medium

    US20160241784A1