Camera control method, terminal device and storage medium

By judging the screen status and posture changes in the terminal device and rationally managing the use of the front camera, the camera conflict between the eye movement service and the smart code recognition service is solved, ensuring the continuity of the service and user experience.

CN118555330APending Publication Date: 2024-08-27HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310216825.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

There is a camera call conflict between the eye tracking service and the smart code recognition service in the terminal device, causing the service to be suddenly interrupted and affecting the user experience.

Method used

By determining the screen status and posture change information of the terminal device, it is determined whether the front camera resources need to be stopped or released to avoid conflicts and ensure the reasonable allocation and use of cameras. The specific method includes stopping the smart code recognition service when it is detected that the smart code recognition service pre-calls the front camera, and after the eye movement service releases the resources, allowing the smart code recognition service to call the camera to ensure the smoothness of the eye movement calibration process and code scanning operations. Continuity.

Benefits of technology

It effectively solves the camera calling conflict between the eye tracking service and the smart code recognition service, avoids service interruption, and improves user experience and operational fluency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555330A
    Figure CN118555330A
Patent Text Reader

Abstract

The embodiment of the invention provides a camera control method, terminal equipment and a storage medium. The camera control method comprises the following steps: determining a screen state of the terminal equipment; if it is determined that the screen state represents that the terminal equipment is in a screen-on unlocking state, posture change information and a screen direction of the terminal equipment are determined; if it is determined that the numerical value represented by the posture change information is larger than or equal to a preset change threshold value and the screen direction is the direction except the first direction, the calling condition of a front camera of the terminal device is determined, and if the front camera is in a target service calling state, the intelligent code recognition service is stopped. And after the target service releases the resources of the front camera, the intelligent code identification service calls the front camera to acquire the image and identifies the two-dimensional code information in the image. The problem that the service is suddenly interrupted due to camera calling conflicts of the eye movement service and the intelligent code recognition service is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a camera control method, a terminal device, and a storage medium. Background Art

[0002] With the development of terminal technology, terminal devices have become important tools in people's lives. Terminal devices provide users with a variety of functions. Among them, the smart perception service can provide users with a variety of perception services, such as air gesture service, smart code scanning service, face AO service, eye movement service, staring at the screen service, staring at the ringtone reduction service, etc. Among them, the eye movement service can call up the eye movement auxiliary function through the smart perception service when the terminal device receives a text message / push notification, call the front camera of the terminal device to obtain the image, and calculate the coordinates of the human eye gaze point through the eye movement recognition algorithm. Based on the coordinates of the human eye gaze point, it is determined whether the user is staring at the banner notification area, and the gaze duration is calculated. When it is determined that the user is staring at the banner notification area and the gaze duration exceeds the gaze threshold, the content of the banner notification area is expanded, collapsed, exited, or entered into the application. The smart code recognition service can call the front camera of the terminal device to obtain the image when the terminal device is in the unlocked state of the screen, and detects that the user flips the phone, that is, the user has a wrist flip action, and displays the application interface corresponding to the QR code information by identifying the QR code information in the image.

[0003] From this, it can be seen that when the eye movement service and the smart code recognition service are started at the same time, there will be a camera call conflict. One of the services will occupy camera resources, causing the other service to be suddenly interrupted. Summary of the invention

[0004] The embodiments of the present application provide a camera control method, a terminal device, and a storage medium, which can resolve the camera call conflict between the eye movement service and the smart code recognition service.

[0005] In a first aspect, an embodiment of the present application provides a camera control method, the method comprising:

[0006] Determine the screen status of the terminal device; if it is determined that the screen status indicates that the terminal device is in a bright-screen unlocked state, determine the posture change information and screen direction of the terminal device; if it is determined that the value represented by the posture change information is greater than or equal to a preset change threshold, and the screen direction is a direction other than the first direction, determine the calling status of the front camera of the terminal device, and if the front camera is in a target service calling state, stop the smart code recognition service, and after the target service releases the resources of the front camera, the smart code recognition service calls the front camera to obtain an image and identifies the two-dimensional code information in the image; wherein, the first direction is the positive direction of the z-axis of the world coordinate system.

[0007] Here, the target service is an eye movement service. The front camera may be a front RGB camera and / or a front TOF camera.

[0008] In this way, when the posture of the terminal device detects that the smart code recognition service pre-calls the front camera, if it is determined that the pre-called front camera is occupied by the eye movement service, the smart code recognition service will be stopped from calling the pre-called front camera, and the eye movement service will be notified. When the eye movement service releases the front camera resources, the smart code recognition service will call the front camera again, thereby solving the camera call conflict between the eye movement service and the smart code recognition service, causing the service to be suddenly interrupted, affecting the user experience.

[0009] In a possible implementation, determining the calling status of the front camera includes: determining whether the front camera is in the first working mode of the target service. Accordingly, the above method also includes:

[0010] Stop the Smart Code Recognition service and return a stop notification to the Smart Code Recognition service;

[0011] The eye movement calibration process is executed until the eye movement calibration process is completed, and then the resources of the front camera are released.

[0012] Here, the first working mode of the target service is the calibration mode of the eye movement service. In this working mode, the eye movement service will call the RGB camera and the tof camera in the front camera of the mobile phone at the same time.

[0013] In some embodiments, when the eye movement calibration process is completed, the process corresponding to the eye movement service will release the resources of the front camera. At this time, the time interval from the triggering moment of the user's wrist flip action can be further determined. If the time interval is less than the first interval length, then when the eye movement service releases the resources of the front camera, the smart code recognition service calls the front camera to capture images and recognize the QR code information in the image.

[0014] That is, only when the time interval between the eye movement service releasing the resources of the front camera and the triggering moment of the user's wrist flipping action is less than the first interval duration, the smart code recognition service will obtain the permission to call the front camera after the eye movement calibration process is completed. This can avoid the situation where the code scanning interface is suddenly displayed a long time after the user flips his wrist.

[0015] In this way, if it is determined that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist flip, the smart code recognition service will pre-enable the front camera to capture images and recognize the QR code. At this time, it is determined whether the pre-called camera is called by the eye movement calibration process of the eye movement service. If the pre-called camera is called by the calibration process of the eye movement service, the current eye movement calibration process is maintained, which can avoid the interruption of the eye movement calibration process and the failure of the eye movement calibration process, thereby solving the conflict in the use of cameras between the eye movement service and the smart code scanning service.

[0016] In a possible implementation, determining the calling status of the front camera includes: determining whether the front camera is in the first working mode of the target service. Accordingly, the method further includes: canceling the eye movement calibration process to release the resources of the front camera.

[0017] In this way, when it is determined that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist flipping action, the smart code recognition service pre-enables the front camera to capture images and recognize QR codes. At this time, it is determined whether the pre-called camera is called by the eye movement calibration process of the eye movement service. If the pre-called camera is called by the calibration process of the eye movement service, the eye movement calibration process is canceled to release the resources of the front RGB camera. If the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image. It can respond to the user's wrist flipping action and complete the code scanning service, thereby resolving the camera usage conflict between the eye movement service and the smart code scanning service.

[0018] In a possible implementation, determining the calling status of the front camera includes: determining whether the front camera is in the second working mode of the target service. Accordingly, the above method also includes:

[0019] Stop the Smart Code Recognition service and return a stop notification to the Smart Code Recognition service;

[0020] The eye tracking process is executed until the eye tracking process is completed, and then the resources of the front camera are released.

[0021] Here, the first working mode of the target service is the tracking mode of the eye movement service. In this working mode, the eye movement service will call the RGB camera or the tof camera in the front camera of the mobile phone. Therefore, it can be further determined whether the front camera called by the eye movement service is the front RGB camera.

[0022] In some embodiments, when the eye tracking process is completed, the process corresponding to the eye movement service will release the resources of the front RGB camera. At this time, the time interval from the triggering moment of the user's wrist flipping action can be further determined. If the time interval is less than the first interval length, then when the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image.

[0023] That is, only when the time interval between the eye tracking service releasing the resources of the front RGB camera and the triggering moment of the user's wrist flipping action is less than the first interval duration, the smart code recognition service will obtain the permission to call the front RGB camera after the eye tracking process is completed. This can avoid the situation where the code scanning interface is suddenly displayed a long time after the user flips his wrist.

[0024] In this way, if it is determined that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist flip, the smart code recognition service will pre-enable the front camera to capture images and recognize the QR code. At this time, it is determined whether the pre-called camera is called by the eye tracking process of the eye movement service. If the pre-called camera is called by the tracking process of the eye movement service, the current eye tracking process is maintained, which can avoid the interruption of the user's viewing push process, thereby resolving the camera usage conflict between the eye movement service and the smart code scanning service.

[0025] In a possible implementation, determining the calling status of the front camera includes: determining whether the front camera is in the second working mode of the target service. Accordingly, the above method also includes:

[0026] Cancel the eye tracking process to release the resources of the front camera.

[0027] In this way, when it is determined that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist-turning action, the smart code recognition service pre-enables the front camera to capture images and recognize QR codes. At this time, it is determined whether the pre-called camera is called by the eye tracking process of the eye movement service. If the pre-called camera is called by the calibration process of the eye movement service, the eye tracking process is canceled to release the resources of the front RGB camera. If the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image. It can respond to the user's wrist-turning action and complete the code scanning service, thereby resolving the camera usage conflict between the eye movement service and the smart code scanning service.

[0028] In a possible implementation, the method further includes:

[0029] When the smart code recognition service calls the pre-call camera, if the target service trigger timing is detected, the target service will not be started.

[0030] In some embodiments, after detecting the triggering opportunity of the eye movement service, the usage of the camera to be called by the eye movement service can be further determined. If the camera to be called is a tof camera, and the camera being used by the smart code recognition service is an RGB camera, it can be determined that there is no camera call conflict between the two services, and the smart code recognition process and the eye movement tracking process can be executed normally.

[0031] In this way, when it is determined that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist flipping action, the smart code recognition service pre-starts the front camera to capture images and recognize QR codes. At this time, it is determined whether the pre-called camera is called by the eye movement service. If the pre-called camera is not called by the eye movement service, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image. If the smart code recognition service calls the pre-called camera and detects the triggering time of the eye movement service, the eye movement service will not be started, and the code scanning service can continue to be completed, thereby resolving the camera usage conflict between the eye movement service and the smart code scanning service.

[0032] In a possible implementation, determining the posture change information of the terminal device includes: obtaining acceleration change data collected by an acceleration sensor in the terminal device within a preset period of time, and / or obtaining angle change data collected by a gyroscope sensor in the terminal device within the preset period of time. The posture change information is determined based on the acceleration change data and / or the angle change data.

[0033] In this way, the acceleration sensor and the gyroscope sensor can be used to accurately determine the posture change data of the terminal device in a short period of time; based on the posture change data, the posture change information of the terminal device can be obtained.

[0034] In a possible implementation, determining the screen direction of the terminal device includes: acquiring angle data collected by a gyroscope sensor in the terminal device at a current moment; and determining the screen direction of the terminal device according to the angle data.

[0035] In this way, the gyroscope sensor can be used to accurately determine whether the screen direction of the terminal device is facing upward at the current moment.

[0036] In a possible implementation, before determining the posture change information and screen direction of the terminal device, it also includes: determining the proximity light information of the terminal device; if it is determined that the numerical value represented by the proximity light information is greater than or equal to, then determining that the terminal device is in a state where the proximity light is not blocked.

[0037] In this way, according to the proximity light information of the terminal device, it is determined whether the proximity light is not blocked; based on the proximity light not blocked state, the distance between the terminal device and the QR code is moderate. Too close distance will easily lead to code scanning failure. Based on this condition, the success rate of code scanning can be improved. In addition, it can avoid starting scanning when the user turns the unlocked phone upside down on the table, thereby further reducing power consumption.

[0038] In one possible implementation, determining the calling status of the front camera of the terminal device includes: acquiring camera information of a pre-called camera; and determining the usage status of the pre-called camera according to the camera information of the pre-called camera.

[0039] Since the process of the smart code scanning service and the process of the eye movement service to open or close the camera are controlled by the smart perception module, for example, when the smart code scanning service pre-calls a camera, the smart perception module sends a request to open the camera, so that the camera module of the hal layer is called to open the camera for it; when other application processes pre-close the camera, the smart perception module sends a request to close the camera, so that the camera module of the hal layer is called to close the camera for it. Therefore, the smart perception module is able to perceive the usage of the camera to be called by the process of the smart code scanning service and the process of the eye movement service.

[0040] After obtaining the camera information of the pre-called camera, the usage of the pre-called camera can be queried through the smart perception module. The usage of the pre-called camera may include whether the pre-called camera has been turned on, and if the pre-called camera has been turned on, which service the process that turned on the camera belongs to.

[0041] In this way, the usage of the pre-called camera can be quickly determined.

[0042] In a second aspect, an embodiment of the present application provides a terminal device, including:

[0043] A first determining unit, used to determine a screen state of a terminal device;

[0044] A second determining unit is configured to determine the posture change information and screen direction of the terminal device if it is determined that the screen state represents that the terminal device is in a screen-on and unlocked state;

[0045] a third determining unit, configured to determine the calling status of the front camera of the terminal device if it is determined that the value represented by the posture change information is greater than or equal to a preset change threshold and the screen direction is a direction other than the first direction;

[0046] A control unit, used for stopping the smart code recognition service if the front camera is in a target service calling state; after the target service releases the resources of the front camera, the smart code recognition service calls the front camera to acquire an image and identifies the two-dimensional code information in the image; wherein the first direction is the positive direction of the z-axis of the world coordinate system.

[0047] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any method of the first aspect when executing the computer program.

[0048] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method of any one of the above-mentioned first aspects is implemented.

[0049] In a fifth aspect, an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement any of the above methods of the first aspect. The chip system can be a single chip, or a chip module composed of multiple chips.

[0050] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any of the above methods in the first aspect.

[0051] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A schematic diagram showing an application scenario of the eye movement service in an embodiment of the present application is shown;

[0053] Figure 2 A schematic diagram showing an application scenario of the smart code recognition service of an embodiment of the present application is shown;

[0054] Figure 3 shows a schematic structural diagram of a mobile phone 100;

[0055] Figure 4 A software structure block diagram of the mobile phone 100 according to an embodiment of the present application;

[0056] Figure 5 A schematic diagram of a display interface during the startup process of the intelligent perception service provided in an embodiment of the present application is shown;

[0057] Figure 6A schematic diagram of the architecture of the intelligent sensing service in the embodiment of the present application is shown;

[0058] Figure 7 A schematic diagram of the architecture of the eye movement service in the embodiment of the present application is shown;

[0059] Figure 8 A schematic diagram of a display interface during the execution of a calibration process for an eye movement service provided in an embodiment of the present application;

[0060] Fig. 9 A flowchart of a camera control method provided in an embodiment of the present application;

[0061] Fig.10 A schematic diagram of an interface of a camera control method provided in an embodiment of the present application;

[0062] Fig.11 A schematic diagram of an interface of another camera control method provided in an embodiment of the present application;

[0063] Fig.12 A flowchart of another camera control method provided in an embodiment of the present application;

[0064] Fig.13 A schematic diagram of an interface of another camera control method provided in an embodiment of the present application;

[0065] Fig.14 A flowchart of another camera control method provided in an embodiment of the present application;

[0066] Fig.15 A schematic diagram of an interface of another camera control method provided in an embodiment of the present application;

[0067] Fig.16 A schematic diagram of an interface of another camera control method provided in an embodiment of the present application;

[0068] Fig.17 A flowchart of another camera control method provided in an embodiment of the present application;

[0069] Fig.18 A schematic diagram of an interface of another camera control method provided in an embodiment of the present application;

[0070] Fig.19 A flowchart of another camera control method provided in an embodiment of the present application;

[0071] Fig. 20 A schematic diagram of an interface of another camera control method provided in an embodiment of the present application;

[0072] Fig.21A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0073] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0074] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0075] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.

[0076] With the development of terminal technology, terminal devices have become an important tool in people's lives. Terminal devices provide users with a variety of functions. Among them, the smart perception service can provide users with a variety of perception services, such as air gesture services, smart code scanning services, face AO services, eye movement services, staring at the screen without turning off services, staring at the ringtone reduction services, etc. It should be noted that the smart perception service is an always on (AO) service. When the AO service takes effect, it can detect whether the user is looking at the mobile phone screen and perform specified actions based on the detection results. For example, in one scenario, when it is determined that the user is looking at the mobile phone screen, keep the screen in a bright state, etc.

[0077] Among them, the eye movement service can activate the eye movement assistance function through the intelligent perception service when the terminal device receives a text message / push notification, call the front camera of the terminal device to obtain the image, and calculate the coordinates of the human eye's gaze point through the eye movement recognition algorithm. Based on the coordinates of the human eye's gaze point, it can determine whether the user is looking at the banner notification area and calculate the gaze duration. When it is determined that the user is looking at the banner notification area and the gaze duration exceeds the gaze threshold, the content of the banner notification area is expanded, collapsed, exited, or entered into the application accordingly. By looking at the content of the expanded notification information, the content can be previewed without manual interaction or entering the application, saving user operation steps and improving convenience.

[0078] For example, see Figure 1 , Figure 1 Schematic diagram of an application scenario of the eye movement service in the embodiment of the present application. Take the scenario where the intelligent perception service detects a message push when the user is watching a video as an example. Figure 1 As shown in (a) of FIG. 1 , the terminal device displays a playback interface 10 of the video application. Figure 1 As shown in (b) in FIG. 1 , while the user is watching a video, the terminal device receives a text message and displays a text message reminder in the banner notification area 11. At this time, the smart perception service starts the eye movement service, and then displays the following Figure 1 The interface shown in (c) in the figure is that the gaze prompt point 12 is displayed in the banner notification area 11 to prompt the user to gaze at the gaze prompt point 12. At the same time, the front camera is called in the background to obtain an image, and the eye movement recognition algorithm is used to determine whether the user is gazing at the gaze prompt point 12 and the gaze duration is determined. When it is determined that the user is gazing at the gaze prompt point 12 and the gaze duration is greater than the gaze threshold, the following is displayed: Figure 1 The display interface shown in (d) in FIG. 1 shows the expanded text message content. When the terminal device displays the text message content on the top of the display interface, it can also display the gaze prompt point 12 (such as Figure 1 As shown in (e) in FIG. 1 , if the user looks at the gaze prompt point 12, the display interface of the terminal device jumps to the following Figure 1 The display interface shown in (f) jumps to the application interface of the SMS application and displays the relevant content of the SMS in the application interface of the SMS application.

[0079] It should be noted that Figure 1This is only an example of an application scenario for eye movement services. In some embodiments, the eye movement recognition algorithm can also perform different operations according to the different gaze positions and gaze durations of the user. For example, when the gaze duration is greater than the first threshold and less than the second threshold, the text message content is expanded, and when the gaze duration is greater than the second threshold, the text message application is jumped to. Alternatively, when the user gazes at the first preset area of ​​the banner notification area and the gaze duration is greater than the gaze threshold, the text message content is expanded, and when the user gazes at the second preset area of ​​the banner notification area and the gaze duration is greater than the gaze threshold, the text message application is jumped to. The above-mentioned first threshold, second threshold and gaze threshold can be set according to actual applications, and this application does not impose specific restrictions on this.

[0080] It should be noted that when the eye tracking service calls the front camera of the terminal device to obtain an image, it may call the front RGB camera and / or the tof camera.

[0081] Specifically, if the eye movement service is in the calibration mode, the eye movement service will call the RGB camera and tof camera in the front camera of the mobile phone at the same time; if the eye movement service is in the tracking mode, the eye movement service will determine whether to call the front RGB camera in the front camera of the mobile phone to obtain the image or the front tof camera in the front camera of the mobile phone to obtain the image according to the brightness of the ambient light.

[0082] When the terminal device is in the unlocked state with the screen on, and it detects that the user is flipping the phone, that is, the user is turning the wrist, the smart code recognition service can call the front camera of the terminal device to acquire an image, and display the application interface corresponding to the QR code information by identifying the QR code information in the image.

[0083] For example, Figure 2 A schematic diagram of an application scenario of the smart code recognition service of an embodiment of the present application is shown. Figure 2 As shown in Figure (a) in FIG. 1 , the user holds the terminal device 100, and the terminal device 100 is in a bright screen unlocked state. Figure 2 As shown in Figure (b), the user flips the terminal device 100, that is, the user turns his wrist; the terminal device 100 calls the front camera of the terminal device to obtain the image on the desktop and recognizes the QR code information in the image.

[0084] Generally speaking, the front camera called by the smart code recognition service is the RGB camera in the front camera.

[0085] It can be seen from the above that both the above-mentioned eye movement service and the above-mentioned smart code recognition service need to call the front camera of the terminal device to obtain images. When one of the services is effective and the front camera has been turned on, and the terminal device detects that another service pre-calls the front camera, there will be a conflict in the use of the camera. In order to solve the above problem, the embodiment of the present application provides a method for controlling the camera. When the posture of the terminal device detects that the smart code recognition service pre-calls the front camera, when it is determined that the pre-called front camera is occupied by the eye movement service, the smart code recognition service is first stopped from calling the pre-called front camera, and the eye movement service is notified. When the eye movement service releases the front camera resources, the smart code recognition service calls the front camera again, thereby solving the camera call conflict between the eye movement service and the smart code recognition service, causing the service to be suddenly interrupted, affecting the user experience.

[0086] Before the method provided in the embodiment of the present application is introduced in detail, the execution subject involved in the embodiment of the present application is briefly introduced. The method provided in the embodiment of the present application can be executed by a terminal device, and the terminal device is configured with a front camera, and the number of front cameras can be one or more. In some embodiments, the front camera has a camera (Bayer Camera) that outputs RGB format images and / or a tof camera. In some embodiments, the terminal device can also be configured with one or more rear cameras, which is not limited by the embodiment of the present application. In addition, one or more applications can be installed in the terminal device, and each of the one or more applications can open the camera configured in the terminal device to capture images through the camera. Exemplarily, the one or more applications may include a camera, a payment application software, and the like. For example, if the application is a payment application software, the user can open the front camera through the payment application software to scan the code for payment. In addition, the terminal device supports the intelligent perception (AO) service.

[0087] The above-mentioned terminal equipment may also be referred to as terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal equipment may be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal equipment, an augmented reality (AR) terminal equipment, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the terminal equipment.

[0088] The terminal device 100 has a function of displaying an interface and a function of acquiring an image.

[0089] In order to better understand the embodiment of the present application, the structure of the terminal device in the embodiment of the present application is introduced below:

[0090] Figure 3The structure diagram of the terminal device 100 is shown. The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0091] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0092] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0093] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0094] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0095] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuits sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0096] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0097] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0098] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0099] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0100] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0101] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0102] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0103] Video codecs are used to compress or decompress digital videos. The terminal device 100 may support one or more video codecs. Thus, the terminal device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0104] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0105] The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0106] Gyro sensor 180B is used to collect angle change data. Gyro sensor 180B is used to collect angle data.

[0107] The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in all directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device and applied to applications such as horizontal and vertical screen switching and pedometers.

[0108] The acceleration change data is collected based on the acceleration sensor 180E. The terminal device determines the posture change information of the terminal device based on the acceleration change data collected by the acceleration sensor 180E.

[0109] The terminal device determines the screen direction based on the angle data collected by the gyro sensor 180B.

[0110] The terminal device determines the posture change information of the terminal device based on the angle change data collected by the gyroscope sensor 180B. Alternatively, the terminal device determines the posture change information of the terminal device based on the acceleration change data collected by the acceleration sensor 180E. Alternatively, the terminal device determines the posture change information of the terminal device based on the angle change data collected by the gyroscope sensor 180B and the acceleration change data collected by the acceleration sensor 180E.

[0111] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 100 emits infrared light outward through the light emitting diode. The terminal device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100. The terminal device 100 can use the proximity light sensor 180G to detect that the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, and pocket mode automatically unlocks and locks the screen.

[0112] The proximity light sensor 180G collects proximity light data. The terminal device determines proximity light information based on the proximity light data collected by the light sensor 180G.

[0113] The ambient light sensor 180L is used to sense the ambient light brightness. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in a pocket to prevent accidental touch.

[0114] The ambient light sensor 180L collects ambient light data. The terminal device determines ambient light information based on the ambient light data collected by the ambient light sensor 180L.

[0115] The software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal device 100.

[0116] Figure 4 This is a software structure block diagram of the terminal device 100 according to an embodiment of the present application.

[0117] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer, application framework layer, system layer, and kernel layer.

[0118] The application layer can include a series of application packages.

[0119] like Figure 4 As shown, the application package may include applications such as smart perception, camera, calendar, phone, map, phone, music, settings, mailbox, video, short message, etc.

[0120] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0121] like Figure 4 As shown, the application framework layer may include an intelligent perception module, a camera service module, a window manager, a content provider, a resource manager, a view system, a notification manager, and the like.

[0122] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc.

[0123] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0124] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0125] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0126] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.

[0127] The system layer includes system libraries, Android runtime, and core libraries.

[0128] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0129] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0130] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0131] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0132] exist Figure 4 On the basis of, the above system architecture can also include a hardware abstraction layer (HAL layer). The HAL layer includes AOservice and AP camera HAL layer service.

[0133] The following is an example of the workflow of the software and hardware of the terminal device 100 in conjunction with the eye movement service scenario.

[0134] When the smart perception application senses a new SMS or message push, it calls up the smart perception module and AOservice to start the eye movement detection process. The smart perception module requests to start the camera, calls the interface of the application framework layer through the camera service module, starts the camera application, and then starts the camera driver by calling the kernel layer to capture static images or videos through camera 193. Camera 193 passes the collected image back to the eye movement recognition algorithm in the smart perception module, and then identifies whether the user is looking at the banner notification area. If it is determined that the user is looking at the banner notification area and the gaze duration exceeds the preset threshold, the content of the SMS or message push is expanded.

[0135] After introducing the execution subject involved in the embodiment of the present application, the application scenario involved in the embodiment of the present application is briefly introduced. Here, the terminal device is a mobile phone as an example for explanation.

[0136] It should be noted that the “at…” in the embodiments of the present application may be the instant when a certain situation occurs, or may be a period of time after the occurrence of a certain situation, and the embodiments of the present application do not specifically limit this.

[0137] In one scenario, when a user is watching a video on a mobile phone, the mobile phone receives a new text message and displays the folded content of the text message in the banner display area of ​​the mobile phone display interface. At this time, if the user wants to view the detailed content of the text message, he needs to click on the banner display area. When the mobile phone detects that the user clicks on the banner display area, it will expand the detailed content of the text message. If the user wants to jump to the text message application, he needs to click on the banner display area again. When the mobile phone detects that the user clicks on the banner display area, the mobile phone will jump to the display interface of the text message application. That is, when the user uses the mobile phone, a series of operations are required before the new text message / message push can be viewed, and the triggering process takes a certain amount of time.

[0138] In another scenario, when a user needs to use a mobile phone to scan a QR code, the user triggers the mobile phone application or applet, and then the mobile phone triggers the QR code recognition function based on the entrance of the application or applet triggered by the user. Then, the mobile phone can call the camera to obtain the image, and then the mobile phone recognizes the acquired image and performs QR code recognition. That is, in the process of scanning the QR code with a mobile phone, the user needs to perform a series of operations on the terminal device to trigger the terminal device to scan the QR code; the triggering process takes a certain amount of time, resulting in low efficiency of QR code recognition.

[0139] In response to the problems raised in the above two scenarios, an AO service (i.e., the above-mentioned smart perception service) is proposed. When the AO service is effective, it can detect the posture change information and screen direction of the mobile phone or detect whether the user is looking at the displayed SMS push (i.e., detect whether the user is looking at the gaze prompt point in the banner display area), and perform specified operations based on the detection results. For example, in the first scenario above, when it is detected that the mobile phone has received a new SMS, the gaze prompt point is displayed in the banner display area where the SMS prompt is displayed, and the front camera is called to capture the face image. Based on the face image captured by the camera, it is detected whether the user is looking at the gaze prompt point in the above-mentioned banner display area. When it is determined that the user is looking at the gaze prompt point in the banner display area, the detailed content of the SMS is directly expanded. For another example, in the second scenario above, when it is detected that the mobile phone is in the unlocked state of the screen on, and it is determined that the user has flipped the mobile phone based on the posture change information and screen direction of the mobile phone, the front camera of the terminal device is directly called to capture the image and recognize the QR code.

[0140] In one embodiment, the user can manually enable the smart sensing service in the mobile phone. Figure 5 When the user wants to turn on the smart sensing service in the mobile phone, he can select the settings application in the mobile phone, such as Figure 5 In response to the user's triggering operation on the phone's settings application, the phone opens the settings page, which is as shown in (a). Figure 5 The setting page provides an "Accessibility" option. The user clicks on the "Accessibility" option. In response to the user clicking on the "Accessibility" option, the mobile phone opens the Accessibility page, as shown in (b). Figure 5 The accessibility page includes an “intelligent perception” option, and the user can select the “intelligent perception” option. In response to the user selecting the “intelligent perception” option, the mobile phone opens the intelligent perception page, such as Figure 5 As shown in (d), the smart perception page includes a "Smart Code Recognition" item and a "Smart Eye Movement" item, where the "Smart Code Recognition" item corresponds to a switch for turning on or off the smart code recognition service, and the "Smart Eye Movement" item corresponds to a switch for turning on or off the eye movement service.

[0141] For example, taking "Smart Code Recognition" as an example, when the user wants to turn on the Smart Code Recognition service, he can manually slide the switch corresponding to the "Smart Code Recognition" item to the right, such as Figure 5 In response to the user sliding the switch corresponding to the "Smart Code Recognition" item to the right, the mobile phone starts the Smart Code Recognition service.

[0142] For example, taking "Smart Eye Movement" as an example, when the user wants to turn on the eye movement service, he can manually slide the switch corresponding to the "Smart Eye Movement" item to the right, such as Figure 5As shown in (d) in FIG. 1 , in response to the user sliding the switch corresponding to the “Smart Eye Movement” item to the right, the mobile phone turns on the eye movement service.

[0143] In one embodiment, when the user does not need to use the smart perception service, Figure 5 In the setting page shown in (d) of FIG. 1 , the smart perception service is turned off. For example, when the user wants to turn off the smart code recognition service, the switch corresponding to the "Smart Code Recognition" item is manually slid to the left. In response to the user's operation of sliding the switch corresponding to the "Smart Code Recognition" item to the left, the mobile phone turns off the smart code recognition service. In addition, when the user wants to turn off the eye movement service, the switch corresponding to the "Smart Eye Movement" item is manually slid to the left. In response to the user's operation of sliding the switch corresponding to the "Smart Eye Movement" item to the left, the mobile phone turns off the eye movement service.

[0144] It should be noted that the above is only explained by taking the example of manually turning on the smart perception service by the user. In another embodiment, the mobile phone can also automatically start the smart perception service when it detects that the preset conditions are currently met. The preset conditions can be set according to actual needs. For example, the mobile phone automatically turns on the smart perception service after detecting that the user turns on the phone and unlocks the screen. Furthermore, when the mobile phone automatically turns on the smart perception service, the switch corresponding to the above-mentioned "Smart Code Recognition" item is controlled to be in the on state, and the switch corresponding to the above-mentioned "Smart Eye Movement" item is controlled to be in the on state. In this way, when the user does not want to turn on the smart perception service, he can enter the smart perception page based on the above-mentioned setting path (i.e., Settings-Accessibility-Smart Perception) to manually turn off the smart code recognition service and eye movement service in the smart perception page.

[0145] The camera usage conflicts involved in the embodiments of the present application include two scenarios: one scenario is: the eye movement service has turned on the front camera, and the smart code recognition service pre-calls the front camera; the other scenario is: the smart code recognition service has turned on the front camera, and the eye movement service pre-calls the front camera.

[0146] It should be noted that when the above-mentioned smart code recognition service calls the front camera, it generally calls the RGB camera in the front camera to obtain the QR code image.

[0147] When the eye tracking service calls the front camera, it will distinguish the situations and determine which one or several cameras in the front camera need to be called to obtain the face image. Specifically, if the eye tracking service is in the calibration mode, the eye tracking service will call the RGB camera and the tof camera in the front camera of the mobile phone at the same time; if the eye tracking service is in the tracking mode, the eye tracking service will determine whether to call the RGB camera in the front camera of the mobile phone to obtain the image or the tof camera in the front camera of the mobile phone to obtain the image according to the brightness of the ambient light.

[0148] Exemplarily, the eye movement service determines the front camera to be called according to the brightness of the ambient light. Specifically, if the brightness value of the ambient light is greater than the brightness threshold, the RGB camera in the front camera is called to obtain the face image. If the brightness value of the ambient light is not greater than the brightness threshold, the tof camera in the front camera is called to obtain the face image. The brightness threshold can be set according to application requirements, and this application does not limit this.

[0149] For example, see Figure 6 , Figure 6 The following is a schematic diagram showing the architecture of the intelligent sensing service in the embodiment of the present application. Figure 6 As shown, the application layer and the framework layer are deployed in the terminal device; the terminal device is provided with a hardware layer, and the hardware includes a camera and a sensor. The camera includes a front camera (front RGB camera and front tof camera), and the sensor includes an ambient light sensor, a proximity light sensor, a gyroscope sensor, and an acceleration sensor.

[0150] Among them, at least one application (Application, referred to as APP) and smart perception application are deployed in the application layer; among them, the smart perception application provides air gesture service, smart code recognition service, face AO service, eye movement service, gaze without turning off service, gaze to reduce the volume of incoming calls service, etc. The smart perception service provides each service with a corresponding perception fence, that is, a gesture fence is provided for the air gesture service, a smart code recognition fence is provided for the smart code recognition service, a face fence is provided for the face AO service, an eye movement fence is provided for the eye movement service, and a human eye gaze fence is provided for the gaze without turning off service and the gaze to reduce the volume of incoming calls service.

[0151] Two channels for calling the camera are deployed in the framework layer, one of which is the Sensor hub channel and the other is the AP (Application Processor) channel. The gesture algorithm corresponding to the air gesture service, the smart code recognition algorithm corresponding to the smart code recognition service, and the face presence or absence algorithm of the face AO service are all used to call the camera through the above-mentioned Sensor hub channel; the eye gaze algorithm of the gaze without turning off the screen service, the eye gaze to reduce the incoming call volume service, and the eye movement algorithm of the eye movement service are used to call the camera through the above-mentioned AP channel.

[0152] Here, the above framework layer cannot be understood as the Framework layer, but can be understood as the part connecting the Framework layer and the hardware layer, that is, the above two paths are located between the Framework layer and the hardware layer.

[0153] pass Figure 6The software architecture provided can obtain the posture information of the mobile phone through the sensor. The smart code recognition service uses the sensor hub to call the front camera to collect the QR code image.

[0154] Figure 7 A schematic diagram of the system architecture of the eye movement service provided by an embodiment of the present application is shown, in which an application layer, a framework layer, a hardware abstraction layer, and a kernel layer are deployed in a terminal device; and the terminal device is provided with a hardware layer, the hardware includes a camera, the camera includes a front camera, and the front camera includes a front RGB camera and a front tof camera.

[0155] Among them, at least one application (Application, referred to as APP) is deployed in the application layer, such as a setting application, a notification application, a banner notification application, and a swing framework.

[0156] Camera services and intelligent perception services are deployed in the framework layer.

[0157] The hardware abstraction layer deploys AO service, smart perception TA, smart perception CA, algorithm module and APcamera HAL layer service. The algorithm module includes eye movement recognition algorithm, eye movement calibration algorithm, image processing algorithm, secure image encryption algorithm, eye movement calibration data and face detection and landmark extraction algorithm. Among them, AO service includes the above-mentioned smart perception CA, camera control and smart perception HAL.

[0158] The kernel and camera driver are deployed in the kernel layer.

[0159] like Figure 7 The software architecture provided is that users can call up the calibration mode of the eye movement service through the settings application of the application layer to start the eye movement calibration process. The smart perception service initializes the AO service, smart perception TA, smart perception CA, camera and various algorithms, notifies the camera service of the framework layer through the AO service, calls the front RGB camera and the front tof camera to collect images simultaneously through the APcamera HAL layer service of the hardware abstraction layer, and the kernel and camera driver of the kernel layer. The collected images are transmitted to the smart perception CA for image processing and secure image encryption, and then the encrypted images are passed to the smart perception TA. The smart perception TA calls the eye movement recognition algorithm and the eye movement calibration algorithm engine to perform eye movement recognition and eye movement calibration operations, and the calibration results are returned to the settings application so that the settings application can start the calibration of the next point. The calibration data can be stored in the algorithm module for use when using the eye movement function.

[0160] Here, see Figure 8 , the following will be combined Figure 8 The calibration process of the eye tracking service is illustrated as follows:

[0161] When the user wants to enter the user's eye movement calibration data, the user can start the entry calibration function through the settings application to perform the eye movement calibration process. The user can enter the smart perception page through the phone's settings application-accessibility-smart perception path, click the eye movement service in the smart perception page, and enter the eye movement service setting interface. The eye movement service setting interface is as follows Figure 8 The eye movement service setting interface may include a function introduction data entry control 81, and the function introduction may display relevant introductions about the eye movement service. When the user clicks the data entry control 81, the eye movement calibration process is started in response to the user's click operation. At this time, the display interface of the mobile phone displays a display interface for entering eye movement data, such as Figure 8 As shown in (b) in the figure, after the countdown ends, the user's eye movement calibration data begins to be recorded. At this time, the mobile phone displays Figure 8 The interface shown in (c) in the figure, that is, the first gaze prompt point 82 is displayed in the display interface, prompting the user to gaze at the gaze prompt point 82, and the front RGB camera and the front tof camera of the mobile phone are started to collect images, and then the images are transmitted to the smart perception CA for image processing and encryption, and then the encrypted images are sent to the smart perception TA, and the coordinate values ​​of the human eye gaze points of the images collected by the RGB camera and the images collected by the tof are respectively identified, and the difference calibration between the actual gaze position and the expected gaze position of the first gaze prompt point 82 is recorded, and then the calibration result is returned to the setting application to start the eye movement calibration process of the second gaze prompt point 82. At this time, the display interface of the mobile phone displays the prompt message "The first gaze point calibration is successful, please gaze at the point displayed on the screen", and the second gaze prompt point 83 is displayed in the display interface. The display interface is as shown in FIG. Figure 8 Repeat the above steps until the eye movement calibration data of all gaze cue points are entered, and the display interface jumps to the following figure: Figure 8 The display interface shown in (e) in the figure prompts the user that the eye movement data entry has been completed.

[0162] It should be noted that during the eye movement data entry process, the number of gaze prompt points can be set according to actual applications, and this application does not make specific requirements for this.

[0163] For example, Figure 8 As shown in (b) in the figure, the gaze cue points are displayed at 5 different positions on the screen, and the eye movement data verification process is completed point by point. After the eye movement calibration of the 5 gaze cue points is completed, the input operation is ended.

[0164] Among them, for each gaze prompt point, after the calibration is completed, the first parameter and the second parameter corresponding to the point are fed back. The first parameter can be the point position information (xpixel, ypixel) or the point order (or identification index, such as "H", "O", "N", "S" and "R"); the second parameter can be an enumeration value of the calibration result, such as 0 for successful calibration and 1 for failed calibration, which is calculated by the algorithm module during the eye movement calibration process and transmitted to the upper system application for display prompts; at the same time, the eye movement calibration data of the user corresponding to each calibration point is recorded and saved, and the eye movement calibration data may include calibration data such as the user's eye movement habits, facial features, eyeball position and eye distance. Exemplarily, in the process of calibrating each calibration point, prompt information of upward, downward, left or right can also be given based on the position difference between the identified gaze point and the calibration point, so as to achieve faster and more accurate calibration while improving the user's experience during the calibration process; it is calculated by the algorithm module during the eye movement calibration process and transmitted to the upper system application for display prompts.

[0165] Please refer again Figure 7 ,When the eye movement data entry is completed, when the banner notification application of the application layer detects a new SMS push, that is, the eye movement service is in tracking mode, the mobile phone will call the smart perception service through the swing framework, start the eye movement auxiliary operation process, detect the ambient light value through the ambient light sensor, call AOservice, smart perception TA (TrustedApplication), smart perception CA (ClientApplication), camera and various algorithms through the smart perception service, notify the camera service of the framework layer through the AO service, call the front RGB camera or the front tof camera to collect images (determined according to the ambient light value) through the AP camera HAL layer service of the hardware abstraction layer, and the camera driver of the kernel layer, and transmit the collected images to the smart perception CA, perform image processing and secure image encryption, and then pass the encrypted image to the smart perception TA, which calls the eye movement recognition algorithm engine to perform eye movement recognition and returns the recognition result to the banner notification application. The banner notification application performs corresponding actions according to the recognition result. For example, if the recognition result is that the user is looking and the gaze duration exceeds the preset threshold, the details of the new SMS will be expanded. For example, if the recognition result is that the user has not looked at the notification within a preset time, the banner notification application is closed, or the new SMS notification is hidden to display a drop-down page, etc. For example, if the recognition result is that the user looks at the details of the new SMS, the user is redirected to the SMS application.

[0166] Combination Figure 6 to Figure 7It can be seen that the channels for the smart code recognition service and the eye movement service to call the camera belong to two different channels, that is, the smart code recognition service outputs the image through the sensor hub channel, and the eye movement service outputs the image through the AP channel (through the APcamera HAL layer service). Therefore, when both need to open the front camera (the front RGB camera or the front tof camera in the front camera), a call conflict will occur. The specific conflict scenarios of the eye movement service and the smart code recognition service may include the following scenarios: 1. When the eye movement service is in calibration mode, the user flips the phone to scan the code. Since the front RGB camera is occupied by the eye movement service, the code scanning fails; 2. When the eye movement service is in tracking mode, and the eye movement service uses the front RGB camera to obtain the image, the front camera is occupied by the eye movement service, which will also cause the code scanning to fail; 3. When the user flips the phone to scan the code, the eye movement service is called up. At this time, the eye movement service will seize the use right of the front RGB camera, which will also cause the code scanning to fail. Next, the camera control method provided in the embodiments of the present application under these three conflict scenarios is introduced respectively.

[0167] First, the camera control method in the first conflict scenario is introduced. Fig. 9 A flowchart of a camera control method provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the method may include:

[0168] S901. Determine the screen status of the terminal device. If it is determined that the screen status indicates that the terminal device is in a bright screen unlocked state, execute subsequent steps.

[0169] Exemplarily, the execution subject of this embodiment is a terminal device, or a processor in the terminal device, or a device disposed in the terminal device, or the terminal device, which is not limited. This embodiment is introduced with the execution subject being the terminal device.

[0170] In one possible implementation, the terminal device can determine the screen status during the running of the first application. The first application can be any application, including a desktop application. For example, the first application can be a video application, that is, the first terminal device is playing a video, or it can also be a reading application, etc.

[0171] The terminal device intermittently obtains the screen status of the terminal device based on the application (app) level; the terminal device determines whether the terminal device is in a bright screen unlocked state based on the screen status. In one example, the terminal device can obtain screen parameters through a software interface; since the screen parameters indicate that the terminal device is in a black screen state, a bright screen ununlocked state, or a bright screen unlocked state, the terminal device can obtain the screen status based on the obtained screen parameters.

[0172] If the terminal device determines that the screen state indicates that the terminal device is in a bright screen unlocked state, the subsequent steps are executed; otherwise, step S901 is executed again after a preset interval. Thus, when the terminal device determines that the terminal device is in a black screen state or a bright screen unlocked state, the terminal device will not trigger the front camera to capture images, thus avoiding meaningless triggering actions; the terminal device will only execute subsequent actions when it determines that the terminal device is in a bright screen unlocked state, and retrieve the front camera to capture images based on the subsequent judgment process.

[0173] S902, determining the posture change information and screen direction of the terminal device; if it is determined that the value represented by the posture change information is greater than or equal to a preset change threshold, and the screen direction is a direction other than the first direction, executing subsequent steps.

[0174] The first direction is the positive direction of the z-axis of the world coordinate system.

[0175] In one example, "determining the posture change information of the terminal device" in step S902 includes: obtaining acceleration change data collected by an acceleration sensor in the terminal device within a preset time period, and / or obtaining angle change data collected by a gyroscope sensor in the terminal device within a preset time period; determining the posture change information based on the acceleration change data and / or the angle change data.

[0176] In one example, "determining the screen direction of the terminal device" in step S902 includes: obtaining angle data collected by a gyroscope sensor in the terminal device at the current moment; and determining the screen direction of the terminal device according to the angle data.

[0177] Exemplarily, after step S901, the terminal device acquires posture change information and screen direction of the terminal device, wherein the posture change information includes: acceleration change data and / or angle change data.

[0178] The terminal device is provided with an acceleration sensor and a gyroscope sensor. The acceleration sensor in the terminal device collects acceleration change data within a preset time period, and the gyroscope sensor in the terminal device collects angle change data within a preset time period; wherein the preset time period is a time period before the current moment. The terminal device determines the posture change information of the terminal device based on the acceleration change data and / or the angle change data. In one example, the terminal device performs posture calculation based on the acceleration change data and / or the angle change data to obtain the posture change information of the terminal device, wherein the posture change information represents the posture change angle of the terminal device, or the posture change information represents the rotation change angle of the terminal device.

[0179] Furthermore, the gyroscope sensor in the terminal device collects angle data at the current moment; the terminal device can directly determine the screen direction of the terminal device according to the angle indicated by the angle data. In one example, the gyroscope sensor collects xyz axis data at the current moment; the terminal device obtains the xyz axis data collected by the gyroscope sensor, and then the terminal device determines the screen direction of the terminal device according to the xyz axis data, whether it is not facing the positive direction of the z axis of the world coordinate system, that is, whether the screen direction of the terminal device is not facing upward.

[0180] Among them, in this embodiment, the "upward" direction of the screen of the terminal device refers to that the screen of the terminal device faces the "positive direction of the z-axis of the world coordinate system"; the first direction refers to the positive direction of the z-axis of the world coordinate system.

[0181] The “downward” direction of the screen of the terminal device refers to that the screen of the terminal device faces the “negative direction of the z-axis of the world coordinate system”; the second direction refers to the negative direction of the z-axis of the world coordinate system.

[0182] Based on the above principle, the terminal device determines that the terminal device has flipped over according to the value represented by the obtained posture change information, which is greater than or equal to the preset change threshold; it can be seen that the user holding the terminal device flips the wrist to flip the screen of the terminal device. In addition, the terminal device determines that the screen direction is a direction other than the first direction, and then determines that the screen direction of the terminal device is not facing upward. Then, the terminal device determines to execute the subsequent steps.

[0183] Therefore, in this embodiment, when the terminal device determines that the terminal device is turned over and the screen direction of the terminal device is not facing upward, the smart code recognition service needs to call the front camera to capture images. Specifically, the front RGB camera can be called to capture images.

[0184] In one example, the posture change information acquired by the terminal device includes: acceleration change data and angle change data. And the device acquires the angle data at the current moment.

[0185] At this time, if the terminal device determines that the screen direction is other directions except the first direction, and the first direction is the positive direction of the z-axis of the world coordinate system, it can be known that the screen direction is not facing upward at this time, then execute the subsequent steps; otherwise, execute step S901 again.

[0186] Then, if the terminal device determines that the value represented by the acceleration change data is greater than or equal to the preset change threshold corresponding to the acceleration change data, and if the terminal device determines that the value represented by the angle change data is greater than or equal to the preset change threshold corresponding to the angle change data; thus, the terminal device determines that the user holding the terminal device has a wrist turning action, then the subsequent steps are executed; otherwise, step S901 is executed again.

[0187] If the terminal device determines that the screen is not facing upward and the user holding the terminal device has a wrist-turning motion, the terminal device determines that the front camera of the terminal device needs to be called.

[0188] Alternatively, in one example, the posture change information acquired by the terminal device includes: acceleration change data and angle data.

[0189] At this time, if the terminal device determines that the screen direction is other directions except the first direction, and the first direction is the positive direction of the z-axis of the world coordinate system, it can be known that the screen direction is not facing upward at this time, then execute the subsequent steps; otherwise, execute step S901 again.

[0190] Then, if the terminal device determines that the value represented by the acceleration change data is greater than or equal to the preset change threshold corresponding to the acceleration change data, and thus the terminal device determines that the user holding the terminal device has a wrist turning action, then the subsequent steps are executed; otherwise, step S901 is executed again.

[0191] If the terminal device determines that the screen is not facing upward and the user holding the terminal device has a wrist-turning motion, the terminal device determines that the front camera of the terminal device needs to be called.

[0192] Alternatively, in one example, the posture change information acquired by the terminal device includes: angle change data and angle data.

[0193] At this time, if the terminal device determines that the screen direction is other directions except the first direction, and the first direction is the positive direction of the z-axis of the world coordinate system, it can be known that the screen direction is not facing upward at this time, then execute the subsequent steps; otherwise, execute step S901 again after a preset time interval.

[0194] Then, if the terminal device determines that the value represented by the angle change data is greater than or equal to the preset change threshold corresponding to the angle change data; thus, the terminal device determines that the user holding the terminal device has a wrist turning action, then executes subsequent steps; otherwise, execute step S901 again after a preset time interval.

[0195] If the terminal device determines that the screen is not facing upward and the user holding the terminal device has a wrist-turning motion, the terminal device determines that the front camera of the terminal device needs to be called.

[0196] Among them, the terminal device obtains the angle data at the current moment based on the gyroscope sensor at the sensorhub level of the SEE environment. The terminal device obtains the acceleration change data within a preset time period based on the acceleration sensor at the sensorhub level of the SEE environment. The terminal device obtains the angle change data within a preset time period based on the gyroscope sensor at the sensorhub level of the SEE environment.

[0197] In some embodiments of the present application, the camera control method may further include the following conditions when determining that the smart code recognition service needs to call the front camera of the terminal device:

[0198] Condition 1: The approaching light is not blocked.

[0199] Determine the proximity light information of the terminal device; if it is determined that the value represented by the proximity light information is greater than or equal to the proximity light threshold, it is determined that the terminal device is in a state where the proximity light is not blocked.

[0200] In one example, a proximity light sensor is provided in the terminal device, and the proximity light sensor can obtain the proximity light data of the terminal device. The terminal device obtains the proximity light data collected by the proximity light sensor at the sensorhub level of the service execution environment (SEE); then, the terminal device obtains the proximity light information based on the proximity light data at the current moment, and the proximity light information represents the proximity light value of the terminal device at the current moment; if the terminal device determines that the value represented by the proximity light information is greater than or equal to the proximity light threshold, it is determined that the terminal device is in a state where the proximity light is not blocked; if the terminal device determines that the value represented by the proximity light information is less than the proximity light threshold, it is determined that the terminal device is in a state where the proximity light is blocked.

[0201] Based on the "proximity light is not blocked", the distance between the terminal device and the QR code is moderate. If the distance is too close, it is easy to cause the code scanning to fail. Based on this condition, the success rate of code scanning can be improved.

[0202] The above proximity light threshold can be set according to actual applications, and this application does not impose any limitation on this.

[0203] Condition 2: The terminal device enters the preset position.

[0204] Determine the current location information of the terminal device; if it is determined that the current location information indicates that the terminal device is within a preset geographic fence, determine that the terminal device has entered a preset location.

[0205] Condition 3: The value represented by the ambient light information is greater than or equal to the ambient light threshold.

[0206] The terminal device may also determine ambient light information of the terminal device.

[0207] In one example, an ambient light sensor is provided in the terminal device, and the ambient light sensor can obtain the ambient light data of the terminal device. The terminal device obtains the ambient light data collected by the ambient light sensor at the sensorhub level of the Service Execution Environment (SEE); then, the terminal device obtains the ambient light information based on the ambient light data at the current moment, and the ambient light information represents the brightness value of the ambient light of the terminal device at the current moment.

[0208] Then, the terminal device determines whether the value represented by the ambient light information is greater than or equal to the ambient light threshold. If the terminal device determines that the value represented by the ambient light information is greater than or equal to the ambient light threshold, it is determined that the environment in which the terminal device is located is not a relatively dark environment, which can ensure that the front camera of the terminal device can capture a clear image.

[0209] The above ambient light threshold can be set according to actual application, and this application does not limit this. For example, the above ambient light threshold is set to 10 lux.

[0210] The terminal device determines whether the value of the ambient light information representation of the terminal device is greater than or equal to the third preset threshold value; then, when it is determined that the value of the ambient light information representation is greater than or equal to the third preset threshold value, the subsequent process is executed to retrieve the image captured by the front camera and identify the QR code in the image. Only when the value of the ambient light information representation is greater than or equal to the third preset threshold value can it be ensured that the environment in which the terminal device is located is not a relatively dark environment, and the front camera of the terminal device can capture a clear image.

[0211] It should be noted that the above conditions 1 to 3 are non-essential conditions, that is, the user holding the terminal device performs a wrist-turning action. Furthermore, according to the method provided by this embodiment, if it is determined that the terminal device is in a bright screen unlocked state, the proximity light is not blocked (non-essential condition), the screen direction is not upward, there is a wrist-turning action, the terminal device is within the preset geographic fence (non-essential condition), and the value of the ambient light information representation is greater than or equal to the third preset threshold (non-essential condition), the front camera is turned on to capture images and recognize the QR code.

[0212] S903. The intelligent perception module obtains the camera information of the pre-called camera.

[0213] In one embodiment of the present application, the above-mentioned smart code recognition service only stores the camera information of the camera that can implement the smart code recognition service, for example, only stores the front RGB camera information, that is, the smart code recognition service directly obtains the stored camera information and uses the obtained camera information as the camera information of the pre-called camera.

[0214] Exemplarily, when the terminal device determines that the RGB front camera of the terminal device needs to be called, the camera information of the pre-called camera obtained is the camera information of the RGB front camera.

[0215] It is understandable that, in some embodiments, the terminal device may also capture the QR code image by calling the rear camera or the front TOF camera of the terminal device, and this application does not impose any specific restrictions on this.

[0216] S904: Determine usage of the pre-called camera according to camera information of the pre-called camera.

[0217] Since the process of the smart code scanning service and the process of the eye movement service to open or close the camera are controlled by the smart perception module, for example, when the smart code scanning service pre-calls a camera, the smart perception module sends a request to open the camera, so that the camera module of the hal layer is called to open the camera for it; when other application processes pre-close the camera, the smart perception module sends a request to close the camera, so that the camera module of the hal layer is called to close the camera for it. Therefore, the smart perception module is able to perceive the usage of the camera to be called by the process of the smart code scanning service and the process of the eye movement service.

[0218] After obtaining the camera information of the pre-called camera, the usage of the pre-called camera can be queried through the smart perception module. The usage of the pre-called camera may include whether the pre-called camera has been turned on, and if the pre-called camera has been turned on, which service the process that turned on the camera belongs to.

[0219] S905. Determine whether the pre-called camera is in the calling state of the eye movement service according to the usage of the pre-called camera. If so, execute the subsequent steps; otherwise, the smart code recognition service calls the pre-called camera.

[0220] If the pre-called camera has been opened by the process to which the eye movement service belongs, it can be determined that the pre-called camera is in a calling state of the eye movement service.

[0221] For example, taking the above-mentioned pre-called camera as the front RGB camera as an example, if the terminal device is executing the eye movement calibration process at this time, the eye movement service calls the front RGB camera and the front tof camera, then it can be determined that the pre-called camera is in the calling state of the eye movement service.

[0222] As an example, when the user is recording eye movement data, that is, the terminal device is performing an eye movement calibration process, in order to enable the user to complete the recording operation, at this time, the terminal device performs the following steps:

[0223] S906. The smart perception module stops the smart code recognition service function and returns a stop notification to the smart code recognition service.

[0224] In the embodiment of the present application, the above-mentioned smart perception module stops the smart code recognition service function, which can end the current smart code recognition service or suspend the smart code recognition service.

[0225] S907: The eye movement service continues to execute the eye movement calibration process until the eye movement calibration process is completed, and then releases the resources of the front RGB camera.

[0226] In an example of the present application, in order to avoid affecting the entry of the eye movement calibration process, the smart perception module stops the smart code recognition service function, and the smart perception module returns a stop notification to the smart code recognition service.

[0227] S908. When the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image.

[0228] Exemplarily, after the above steps, the terminal device calls the front camera of the terminal device to acquire an image, and after acquiring the image, the terminal device identifies the QR code information in the image.

[0229] S908 is an optional step, that is, the smart perception module can interrupt the process corresponding to the smart code recognition service to call the front RGB camera, and return a notification of the failure to call the camera to the smart code recognition service, and then end the above smart code recognition service, that is, it does not respond to the operation of flipping the phone when the terminal device is in the unlocked state of the screen. The smart perception module can also respond to the operation of the smart code recognition service to call the front RGB camera when the eye movement service releases the resources of the front RGB camera, call the front RGB camera to capture images, and recognize the QR code information in the image.

[0230] After step S907 or S908, the terminal device may execute from step S901 again.

[0231] For example, Fig.10 A schematic diagram of an interface of a camera control method provided in an embodiment of the present application, such as Fig.10 As shown in (a) in the figure, the terminal device is running the settings application and inputting the eye movement calibration data through the smart eye movement service in the smart perception item; at this time, the screen direction of the terminal device is upward (up refers to the positive direction of the z-axis of the world coordinate system). Fig.10As shown in (b), the user holding the terminal device turns his wrist, and the user turns the screen of the terminal device downward (down refers to the negative direction of the z-axis of the world coordinate system). Furthermore, the terminal device determines that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist-turning action according to the method provided in the embodiment of the present application, and the smart code recognition service sends a call request to the camera service module to call the front RGB camera. Since the terminal device is in the calibration mode of the eye movement service (that is, the terminal device is executing the eye movement calibration process), the front RGB camera of the terminal device is occupied by the process corresponding to the eye movement service at this time. In order to avoid interruption of eye movement data entry, the smart perception module stops the smart code recognition service function at this time, and returns a stop notification to the smart code recognition service, while the eye movement service continues to execute the eye movement calibration process until the eye movement calibration process is completed, and the resources of the above-mentioned front RGB camera are released. At this time, the terminal device still displays the display interface of the smart eye movement service for entering eye movement calibration data. The display interface is as shown in FIG. Fig.10 as shown in (c).

[0232] For example, see Fig.11 , Fig.11 Another interface diagram of a camera control method provided in an embodiment of the present application is shown in FIG. Fig.11 As shown in (a) in the figure, the terminal device is running the settings application and inputting the eye movement calibration data through the smart eye movement service in the smart perception item; at this time, the screen direction of the terminal device is upward (up refers to the positive direction of the z-axis of the world coordinate system). Fig.11 As shown in (b), the user holding the terminal device turns his wrist, and the user turns the screen of the terminal device downward (down refers to the negative direction of the z-axis of the world coordinate system). Furthermore, the terminal device determines that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist-turning action according to the method provided in the embodiment of the present application, and the smart code recognition service sends a call request to the camera service module to call the front RGB camera. Since the terminal device is in the calibration mode of the eye movement service (that is, the terminal device is executing the eye movement calibration process), the front RGB camera of the terminal device is occupied by the process corresponding to the eye movement service at this time. In order to avoid interruption of eye movement data entry, the smart perception module stops the smart code recognition service function at this time, and returns a stop notification to the smart code recognition service, while the eye movement service continues to execute the eye movement calibration process until the eye movement calibration process is completed, and the resources of the above-mentioned front RGB camera are released. At this time, the terminal device still displays the display interface of the smart eye movement service for entering eye movement calibration data. The display interface is as shown in FIG. Fig.11When the eye movement calibration process is completed, the process corresponding to the eye movement service will release the resources of the front RGB camera, and the smart perception module will notify the smart code recognition service. After the eye movement calibration process is completed, the smart code recognition service can immediately call the front RGB camera to collect images to obtain the QR code image and display the code scanning interface (such as Fig.11 As shown in (d) in the figure), the QR code information in the image is recognized by the background, and then after the image recognizes the QR code information, the display is as follows Fig.11 In the interface shown in (e), the terminal device directly calls up the interface corresponding to the QR code information, for example, displaying the transfer interface of application A.

[0233] Fig.11 Figure (e) shown is only an example of the interface corresponding to the QR code information. The interface of the application corresponding to the QR code information may include: the interface of the WeChat application, such as the WeChat payment interface, the interface of the WeChat applet (such as the health code interface, the ordering interface, etc.), the interface of the Alipay application, such as the Alipay payment interface, the interface of the Alipay applet (such as the health code interface, the ordering interface, etc.), the interface of the conference application, the interface for connecting to wifi, the courier pickup interface, and so on.

[0234] In some embodiments, when the eye movement calibration process is completed, the process corresponding to the eye movement service will release the resources of the front RGB camera. At this time, the time interval from the triggering moment of the user's wrist flipping action can be further determined. If the time interval is less than the first interval length, then when the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image.

[0235] That is, only when the time interval between the eye movement service releasing the resources of the front RGB camera and the triggering moment of the user's wrist flipping action is less than the first interval duration, the smart code recognition service will obtain the permission to call the front RGB camera after the eye movement calibration process is completed. This can avoid the situation where the code scanning interface is suddenly displayed a long time after the user flips his wrist.

[0236] In this embodiment, if it is determined that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist flipping action, the smart code recognition service pre-enables the front camera to capture images and recognize the QR code. At this time, it is determined whether the pre-called camera is called by the eye movement calibration process of the eye movement service. If the pre-called camera is called by the calibration process of the eye movement service, the current eye movement calibration process is maintained, which can avoid the interruption of the eye movement calibration process and the failure of the eye movement calibration process, thereby solving the conflict in the use of cameras between the eye movement service and the smart code scanning service.

[0237] Fig.12A flowchart of another camera control method provided in an embodiment of the present application. Fig.12 As shown, the method may include:

[0238] S1201. Determine the screen status of the terminal device. If it is determined that the screen status indicates that the terminal device is in a bright screen unlocked state, execute subsequent steps.

[0239] Exemplarily, the execution subject of this embodiment is a terminal device, or a processor in the terminal device, or a device disposed in the terminal device, which is not limited. This embodiment is introduced with the execution subject being a terminal device.

[0240] S1202, determining the posture change information and screen direction of the terminal device; if it is determined that the value represented by the posture change information is greater than or equal to a preset change threshold, and the screen direction is a direction other than the first direction, executing subsequent steps.

[0241] The first direction is the positive direction of the z-axis of the world coordinate system.

[0242] S1203. The intelligent perception module obtains the camera information of the pre-called camera.

[0243] S1204. Determine usage of the pre-called camera according to camera information of the pre-called camera.

[0244] S1205. Determine whether the pre-called camera is in the calling state of the eye movement service according to the usage of the pre-called camera. If so, execute the subsequent steps; otherwise, the smart code recognition service calls the pre-called camera.

[0245] The above S1201 to S1205 can refer to the introduction of S901 to S905, which will not be elaborated here.

[0246] For example, taking the above-mentioned pre-called camera as the front RGB camera as an example, if the terminal device is executing the eye movement calibration process at this time, the eye movement service calls the front RGB camera and the front tof camera, then it can be determined that the pre-called camera is in the calling state of the eye movement service.

[0247] As an example, when the user is recording eye movement data, that is, the terminal device is performing an eye movement calibration process, in order to respond to the user's wrist flip operation and avoid the failure of the smart code recognition due to the inability to call the front RGB camera, the terminal device performs the following steps:

[0248] S1206: The eye movement service cancels the eye movement calibration process and releases resources of the front RGB camera.

[0249] In an embodiment of the present application, when the smart perception module receives a request from the smart code recognition service to call the front RGB camera, it can notify the eye movement service to cancel the eye movement calibration process, that is, the terminal device stops the eye movement service. At this time, the process corresponding to the eye movement service will release the hardware resources it occupies, including the front camera resources it calls, such as the front RGB camera and the front tof camera.

[0250] S1207: When the eye-tracking service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image.

[0251] After step S1207, the terminal device may execute from step S1201 again.

[0252] For example, Fig.13 A schematic diagram of an interface of a camera control method provided in an embodiment of the present application, such as Fig.13 As shown in (a) in the figure, the terminal device is running the settings application and inputting the eye movement calibration data through the smart eye movement service in the smart perception item; at this time, the screen direction of the terminal device is upward (up refers to the positive direction of the z-axis of the world coordinate system). Fig.13 As shown in (b), the user holding the terminal device turns his wrist, and the user turns the screen of the terminal device downward (downward refers to the negative direction of the z-axis of the world coordinate system). Then, according to the method provided in the embodiment of the present application, the terminal device determines that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist turn, then the smart code recognition service sends a call request to the camera service module to call the front RGB camera. Since the terminal device is in the calibration mode of the eye movement service (that is, the terminal device is executing the eye movement calibration process), the front RGB camera of the terminal device has been occupied by the process corresponding to the eye movement service. In order to respond to the wrist flipping action, the smart perception module will notify the eye movement service to cancel the eye movement calibration process after receiving the front RGB camera call request of the smart code recognition service. That is, the terminal device stops the eye movement service. At this time, the process corresponding to the eye movement service will release the hardware resources it occupies, including the front camera resources it calls, such as the front RGB camera and the front tof camera. The smart perception module notifies the smart code recognition service, and the smart code recognition service can immediately call the front RGB camera to collect images when the eye movement service releases the front RGB camera resources to obtain the QR code image and display the code scanning interface (such as Fig.13 As shown in (c) in the figure), the QR code information in the image is recognized by the background, and then after the image recognizes the QR code information, the display is as follows Fig.13 In the interface shown in (d), the terminal device directly calls up the interface corresponding to the QR code information, for example, displaying the transfer interface of application A.

[0253] This embodiment is different from the first embodiment. When it is determined that the terminal device is in a bright screen unlocked state, the screen direction is not facing upward, and there is a wrist flipping action, the smart code recognition service pre-enables the front camera to capture images and recognize QR codes. At this time, it is determined whether the pre-called camera is called by the eye movement calibration process of the eye movement service. If the pre-called camera is called by the calibration process of the eye movement service, the eye movement calibration process is canceled to release the resources of the front RGB camera. If the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image. It can respond to the user's wrist flipping action and complete the code scanning service, thereby resolving the camera usage conflict between the eye movement service and the smart code scanning service.

[0254] This article introduces the camera control method for the second conflict scenario. Fig.14 A flowchart of another camera control method provided in an embodiment of the present application. Fig.14 As shown, the method may include:

[0255] S1401. Determine the screen status of the terminal device. If it is determined that the screen status indicates that the terminal device is in a bright screen unlocked state, execute subsequent steps.

[0256] S1402, determining the posture change information and screen direction of the terminal device; if it is determined that the value represented by the posture change information is greater than or equal to a preset change threshold, and the screen direction is a direction other than the first direction, executing subsequent steps.

[0257] S1403. The intelligent perception module obtains the camera information of the pre-called camera.

[0258] S1404. Determine usage of the pre-called camera according to camera information of the pre-called camera.

[0259] The above S1401 to S1404 can refer to the introduction of S901 to S904, which will not be elaborated here.

[0260] S1405. Determine whether the pre-called camera is in the calling state of the eye movement service according to the usage of the pre-called camera. If so, execute the subsequent steps; otherwise, the smart code recognition service calls the pre-called camera.

[0261] If the pre-called camera has been opened by the process to which the eye movement service belongs, it can be determined that the pre-called camera is in a calling state of the eye movement service.

[0262] For example, taking the above-mentioned pre-called camera as the front RGB camera as an example, if the terminal device is executing the eye tracking process at this time, that is, it is in the tracking mode of the eye movement service, at this time, the eye movement service may call the front RGB camera, or it may call the front tof camera. When the eye movement service calls the front RGB camera, it is determined that the pre-called camera is in the calling state of the eye movement service.

[0263] As an example, when a user is viewing a new message push through the eye tracking service, in order to ensure that the user's action of viewing the new message is not interrupted, at this time, the terminal device performs the following steps:

[0264] S1406. The smart perception module stops the smart code recognition service and returns a stop notification to the smart code recognition service.

[0265] S1407: The eye tracking service continues to execute the eye tracking process until the eye tracking process is completed, and then releases the resources of the front RGB camera.

[0266] In an example of the present application, in order to ensure that the action that affects the user's viewing of new messages is not interrupted, the smart perception module directly stops the smart code recognition service. At this time, the smart perception module can return a stop notification to the smart code recognition service to end or suspend the smart code recognition service.

[0267] S1408. When the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image.

[0268] Exemplarily, after the above steps, the terminal device calls the front camera of the terminal device to acquire an image, and after acquiring the image, the terminal device identifies the QR code information in the image.

[0269] S1408 is an optional step, that is, the smart perception module can interrupt the process corresponding to the smart code recognition service to call the front RGB camera, and return a notification of the failure to call the camera to the smart code recognition service, and then end the above smart code recognition service, that is, it does not respond to the operation of flipping the phone when the terminal device is in the unlocked state of the screen. Alternatively, the smart perception module can also respond to the operation of the smart code recognition service to call the front RGB camera when the eye movement service releases the resources of the front RGB camera, call the front RGB camera to capture images, and recognize the QR code information in the image.

[0270] After step S1407 or S1408, the terminal device may execute from step S1401 again.

[0271] For example, Fig.15 A schematic diagram of an interface of a camera control method provided in an embodiment of the present application, such as Fig.15 As shown in (a) in the figure, the terminal device is running a video application. When the video application is running, the terminal device receives a new SMS push, displays the new SMS notification in the banner notification area, starts the eye tracking process, and displays the gaze prompt point. In this case, the screen direction of the terminal device is upward (up refers to the positive direction of the z-axis of the world coordinate system). Fig.15 As shown in (b), the user holding the terminal device turns his wrist, and the user turns the screen of the terminal device downward (down refers to the negative direction of the z-axis of the world coordinate system). Furthermore, according to the method provided in the embodiment of the present application, the terminal device determines that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist-turning action, then the smart code recognition service sends a call request to the camera service module to call the front RGB camera. Since the terminal device is in the tracking mode of the eye movement service (that is, the terminal device is executing the eye movement tracking process), and the camera occupied by the process corresponding to the eye movement service is the front RGB camera, in order to avoid interrupting the process of viewing text messages, the smart perception module stops the smart code recognition service function and returns a stop notification to the smart code recognition service, while the eye movement service continues to execute the eye movement tracking process until the eye movement tracking process is completed, and the resources of the above-mentioned front RGB camera are released. At this time, the terminal device still displays the display interface of the smart eye tracking, which is as shown in the figure. Fig.15 As shown in (c) in .

[0272] For example, see Fig.16 , Fig.16 Another interface diagram of a camera control method provided in an embodiment of the present application is shown in FIG. Fig.16 As shown in (a) in the figure, the terminal device is running a video application. When the video application is running, the terminal device receives a new SMS push, displays the new SMS notification in the banner notification area, starts the eye tracking process, and displays the gaze prompt point. In this case, the screen direction of the terminal device is upward (up refers to the positive direction of the z-axis of the world coordinate system). Fig.16As shown in (b), the user holding the terminal device turns his wrist, and the user turns the screen of the terminal device downward (down refers to the negative direction of the z-axis of the world coordinate system). Furthermore, according to the method provided in the embodiment of the present application, the terminal device determines that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist-turning action, then the smart code recognition service sends a call request to the camera service module to call the front RGB camera. Since the terminal device is in the tracking mode of the eye movement service (that is, the terminal device is executing the eye movement tracking process), and the camera occupied by the process corresponding to the eye movement service is the front RGB camera, in order to avoid interrupting the process of viewing text messages, the smart perception module stops the smart code recognition service function and returns a stop notification to the smart code recognition service, while the eye movement service continues to execute the eye movement tracking process. At this time, the display interface shows as follows. Fig.16 The interface shown in (c) in the figure is displayed until the eye tracking process is completed, and the resources of the front RGB camera are released. When the eye tracking calibration process is completed, the process corresponding to the eye tracking service will release the resources of the front RGB camera, and the smart perception module will notify the smart code recognition service. The smart code recognition service can immediately call the front RGB camera to collect images after the eye tracking calibration process is completed to obtain the QR code image and display the code scanning interface (such as Fig.16 As shown in (d) in the figure), the QR code information in the image is recognized by the background, and then after the image recognizes the QR code information, the display is as follows Fig.16 In the interface shown in (e), the terminal device directly calls up the interface corresponding to the QR code information, for example, displaying the transfer interface of application A.

[0273] In some embodiments, when the eye tracking process is completed, the process corresponding to the eye movement service will release the resources of the front RGB camera. At this time, the time interval from the triggering moment of the user's wrist flipping action can be further determined. If the time interval is less than the first interval length, then when the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image.

[0274] That is, only when the time interval between the eye tracking service releasing the resources of the front RGB camera and the triggering moment of the user's wrist flipping action is less than the first interval duration, the smart code recognition service will obtain the permission to call the front RGB camera after the eye tracking process is completed. This can avoid the situation where the code scanning interface is suddenly displayed a long time after the user flips his wrist.

[0275] In this embodiment, if it is determined that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist flipping action, the smart code recognition service pre-enables the front camera to capture images and recognize the QR code. At this time, it is determined whether the pre-called camera is called by the eye tracking process of the eye movement service. If the pre-called camera is called by the tracking process of the eye movement service, the current eye tracking process is maintained, which can avoid the interruption of the user's viewing push process, thereby resolving the camera usage conflict between the eye movement service and the smart code scanning service.

[0276] Fig.17 A flowchart of another camera control method provided in an embodiment of the present application. Fig.17 As shown, the method may include:

[0277] S1701. Determine the screen status of the terminal device. If it is determined that the screen status indicates that the terminal device is in a bright screen unlocked state, execute subsequent steps.

[0278] S1702, determining the posture change information and screen direction of the terminal device; if it is determined that the value represented by the posture change information is greater than or equal to a preset change threshold, and the screen direction is a direction other than the first direction, executing subsequent steps.

[0279] S1703. The intelligent perception module obtains the camera information of the pre-called camera.

[0280] S1704. Determine usage of the pre-called camera according to camera information of the pre-called camera.

[0281] S1705. Determine whether the pre-called camera is in the calling state of the eye movement service according to the usage of the pre-called camera. If so, execute the subsequent steps; otherwise, the smart code recognition service calls the pre-called camera.

[0282] The above S1701 to S1705 can refer to the introduction of S1401 to S1405, which will not be elaborated here.

[0283] For example, taking the above-mentioned pre-called camera as the front RGB camera as an example, if the terminal device is executing the eye tracking process at this time, that is, it is in the tracking mode of the eye movement service, at this time, the eye movement service may call the front RGB camera, or it may call the front tof camera. When the eye movement service calls the front RGB camera, it is determined that the pre-called camera is in the calling state of the eye movement service.

[0284] As an example, when the terminal device displays a banner notification bar and displays a gaze prompt point to prompt the user to gaze at the SMS notification, that is, the terminal device is executing the eye tracking process, in order to respond to the user's wrist flip operation and avoid the failure of the smart code recognition due to the inability to call the front RGB camera, the terminal device performs the following steps:

[0285] S1706: The eye movement service cancels the eye movement data tracking process and releases the resources of the front RGB camera.

[0286] In an embodiment of the present application, when the smart perception module receives a request from the smart code recognition service to call the front RGB camera, it can notify the eye movement service to cancel the eye movement calibration process, that is, the terminal device stops the eye movement service. At this time, the process corresponding to the eye movement service will release the hardware resources it occupies, including the front camera resources it calls, such as the front RGB camera and the front tof camera.

[0287] S1707: When the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image.

[0288] After step S1707, the terminal device may execute from step S1701 again.

[0289] For example, Fig.18 A schematic diagram of an interface of a camera control method provided in an embodiment of the present application, such as Fig.18 As shown in (a) in the figure, the terminal device is running a video application. When the video application is running, the terminal device receives a new SMS push, displays the new SMS notification in the banner notification area, starts the eye tracking process, and displays the gaze prompt point. In this case, the screen direction of the terminal device is upward (up refers to the positive direction of the z-axis of the world coordinate system). Fig.18 As shown in (b), the user holding the terminal device turns his wrist, and the user turns the screen of the terminal device downward (down refers to the negative direction of the z-axis of the world coordinate system). Furthermore, according to the method provided in the embodiment of the present application, the terminal device determines that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist-turning action, then the smart code recognition service sends a call request to the camera service module to call the front RGB camera. Since the terminal device is in the tracking mode of the eye movement service (that is, the terminal device is executing the eye movement tracking process), and the camera occupied by the process corresponding to the eye movement service is the front RGB camera, in order to respond to the wrist-turning action, the smart perception module will notify the eye movement service to cancel the eye movement tracking process after receiving the front RGB camera call request of the smart code recognition service, that is, the terminal device stops the eye movement service, and the process corresponding to the eye movement service will release the hardware resources it occupies, including the front camera resources it calls, such as the front RGB camera. The smart perception module notifies the smart code recognition service, and the smart code recognition service can immediately call the front RGB camera to capture images when the eye movement service releases the front RGB camera resources to obtain the QR code image and display the code scanning interface (such as Fig.18As shown in (c) in the figure), the QR code information in the image is recognized by the background, and then after the image recognizes the QR code information, the display is as follows Fig.18 In the interface shown in (d), the terminal device directly calls up the interface corresponding to the QR code information, for example, displaying the transfer interface of application A.

[0290] This embodiment is different from the first embodiment. When it is determined that the terminal device is in a bright screen unlocked state, the screen is not facing upward, and there is a wrist flipping action, the smart code recognition service pre-enables the front camera to capture images and recognize QR codes. At this time, it is determined whether the pre-called camera is called by the eye tracking process of the eye movement service. If the pre-called camera is called by the calibration process of the eye movement service, the eye tracking process is canceled to release the resources of the front RGB camera. If the eye movement service releases the resources of the front RGB camera, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image. It can respond to the user's wrist flipping action and complete the code scanning service, thereby resolving the camera usage conflict between the eye movement service and the smart code scanning service.

[0291] This article introduces the camera control method for the third conflict scenario. Fig.19 A flowchart of another camera control method provided in an embodiment of the present application. Fig.19 As shown, the method may include:

[0292] S1901. Determine the screen status of the terminal device. If it is determined that the screen status indicates that the terminal device is in a bright screen unlocked state, execute subsequent steps.

[0293] S1902, determining the posture change information and screen direction of the terminal device; if it is determined that the value represented by the posture change information is greater than or equal to a preset change threshold, and the screen direction is a direction other than the first direction, executing subsequent steps.

[0294] S1903. The intelligent perception module obtains the camera information of the pre-called camera.

[0295] S1904: Determine usage of the pre-called camera according to camera information of the pre-called camera.

[0296] The above S1901 to S1904 can refer to the introduction of S901 to S904, which will not be repeated here.

[0297] S1905. Determine whether the pre-called camera is in the calling state of the eye movement service according to the usage of the pre-called camera. If not, the smart code recognition service calls the pre-called camera.

[0298] S1906: When the smart code recognition service calls the pre-called camera and detects the triggering opportunity of the eye movement service, the eye movement service is not started.

[0299] When the user flips the phone to scan the code, if the eye movement service triggering opportunity is detected, in order to avoid the eye movement service seizing the use rights of the front RGB camera and causing the code scanning failure, when the smart code recognition service calls the pre-called camera, when the eye movement service triggering opportunity is detected, the eye movement service will not be started, that is, the smart code recognition operation will continue.

[0300] The eye movement service is triggered when the banner notification application detects that the terminal device has received a new text message or a new push message.

[0301] For example, see Fig. 20 , Fig. 20 Another interface diagram of a camera control method provided in an embodiment of the present application is shown in FIG. Fig. 20 As shown in (a) in FIG. 1 , the terminal device displays the display interface of the desktop application, and the screen direction of the terminal device is upward (upward refers to the positive direction of the z-axis of the world coordinate system). Fig. 20 As shown in (b) in the figure, the user holding the terminal device turns his wrist, and the user turns the screen of the terminal device downward (down refers to the negative direction of the z-axis of the world coordinate system). Then, according to the method provided in the embodiment of the present application, the terminal device determines that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist-turning action, then the smart code recognition service sends a call request to the camera service module to call the front RGB camera. Since the front RGB camera of the terminal device is not occupied by the eye movement service, the smart code recognition service calls the front RGB camera to capture images to obtain the QR code image and display the code scanning interface (such as Fig. 20 In this case, the terminal device receives a new SMS message. In order to avoid interrupting the code scanning process, the terminal device does not start the eye tracking service at this time, such as Fig. 20 As shown in (d) in the figure, at this time, the display interface of the terminal device only displays the content pushed by the text message, but does not display the gaze prompt point.

[0302] In some embodiments, after detecting the triggering opportunity of the eye movement service, the usage of the camera to be called by the eye movement service can be further determined. If the camera to be called is a tof camera, and the camera being used by the smart code recognition service is an RGB camera, it can be determined that there is no camera call conflict between the two services, and the smart code recognition process and the eye movement tracking process can be executed normally.

[0303] This embodiment is different from the first embodiment. When it is determined that the terminal device is in the unlocked state with the screen on, the screen is not facing upward, and there is a wrist flipping action, the smart code recognition service pre-enables the front camera to capture images and recognize the QR code. At this time, it is determined whether the pre-called camera is called by the eye movement service. If the pre-called camera is not called by the eye movement service, the smart code recognition service calls the front RGB camera to capture images and recognize the QR code information in the image. If the smart code recognition service calls the pre-called camera, the eye movement service triggering opportunity is detected, and the eye movement service is not started, and the code scanning service can continue to be completed, thereby resolving the camera usage conflict between the eye movement service and the smart code scanning service.

[0304] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0305] The embodiment of the present application can divide the functional modules of the device of the camera control method according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0306] Fig.21 This is a schematic diagram of the structure of a chip provided in an embodiment of the present application. Fig.21 As shown, the chip 210 includes one or more (including two) processors 2101 , a communication line 2102 , a communication interface 2103 and a memory 2104 .

[0307] In some implementations, the memory 2104 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.

[0308] The method described in the above embodiment of the present application can be applied to the processor 2101, or implemented by the processor 2101. The processor 2101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the execution method of the above first device or second device can be completed by the hardware integrated logic circuit or software instructions in the processor 2101. The above processor 2101 can be a general processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 2101 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0309] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 2104, and the processor 2101 reads the information in the memory 2104 and completes the steps of the above method in combination with its hardware.

[0310] The processor 2101 , the memory 2104 , and the communication interface 2103 may communicate with each other via the communication line 2102 .

[0311] In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory, or may be downloaded and installed in the memory in the form of software.

[0312] The embodiment of the present application also provides a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium can include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (digital versatile disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0313] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.

[0314] As a possible design, the computer readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while optical discs reproduce data optically using lasers.

[0315] The above combinations should also be included in the scope of computer-readable media. The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A camera control method, characterized in that: The method comprises: Determine the screen status of the terminal device; If it is determined that the screen state indicates that the terminal device is in a screen-on unlock state, determining posture change information and screen direction of the terminal device; If it is determined that the value represented by the posture change information is greater than or equal to a preset change threshold, and the screen direction is a direction other than the first direction, determining the calling status of the front camera of the terminal device; If the front camera is in the target service calling state, the smart code recognition service is stopped; After the target service releases the resources of the front camera, the smart code recognition service calls the front camera to obtain an image and recognizes the two-dimensional code information in the image; wherein the first direction is the positive direction of the z-axis of the world coordinate system.

2. The method according to claim 1, characterized in that: The determining the calling status of the front camera includes: determining whether the front camera is in the first working mode of the target service; Accordingly, the method further comprises: Stop the Smart Code Recognition service and return a stop notification to the Smart Code Recognition service; The eye movement calibration process is executed until the eye movement calibration process is completed, and then the resources of the front camera are released.

3. The method according to claim 1, characterized in that The determining the calling status of the front camera includes: determining whether the front camera is in the first working mode of the target service; Accordingly, the method further comprises: Cancel the eye movement calibration process to release the resources of the front camera.

4. The method according to claim 1, characterized in that: The determining the calling status of the front camera includes: determining whether the front camera is in the second working mode of the target service; Accordingly, the method further comprises: Stop the Smart Code Recognition service and return a stop notification to the Smart Code Recognition service; The eye tracking process is executed until the eye tracking process is completed, and then the resources of the front camera are released.

5. The method according to claim 1, characterized in that The determining the calling status of the front camera includes: determining whether the front camera is in the second working mode of the target service; Accordingly, the method further comprises: The eye movement data tracking process is canceled to release the resources of the front camera.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the smart code recognition service calls the pre-call camera, if the target service trigger timing is detected, the target service will not be started.

7. The method according to claim 6, characterized in that The target service includes an eye movement service.

8. The method according to claim 2 or 3, characterized in that: The first working mode is a calibration mode of the eye movement service.

9. The method according to claim 4 or 5, characterized in that: The second working mode is an eye movement tracking mode.

10. The method according to claim 1, characterized in that The front camera is a front RGB camera and / or a front TOF camera.

11. The method according to claim 1, characterized in that: Determining the posture change information of the terminal device includes: Acquire acceleration change data collected by an acceleration sensor in the terminal device within a preset time period, and / or acquire angle change data collected by a gyroscope sensor in the terminal device within the preset time period; The posture change information is determined according to the acceleration change data and / or the angle change data.

12. The method according to claim 1, characterized in that Determining the screen direction of the terminal device includes: Obtaining angle data collected by the gyroscope sensor in the terminal device at the current moment; The screen direction of the terminal device is determined according to the angle data.

13. The method according to claim 1, characterized in that The determining the calling status of the front camera of the terminal device includes: Get the camera information of the pre-called camera; The usage of the pre-called camera is determined according to the camera information of the pre-called camera.

14. A terminal device, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are coupled, and the memory is used to store a computer program. When the processor executes the computer program, the terminal device executes the steps of the method described in any one of claims 1 to 13.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises a computer program, and when the computer program is run on a computer, the computer is caused to execute the steps of the method according to any one of claims 1 to 13.

16. A chip, characterized in that: The chip comprises a processor, the processor is coupled to a memory, the memory is used to store computer program instructions, when the processor executes the computer program instructions, the chip executes the steps of the method according to any one of claims 1 to 13.