Data processing method and apparatus

By processing TOF data to generate images and performing facial recognition in a trusted execution environment, the security and accuracy issues of existing facial recognition technologies are resolved, achieving fast and secure facial recognition.

CN116935467BActive Publication Date: 2026-11-20HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310851465.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-12
Publication Date
2026-11-20
Estimated Expiration
2041-08-12

AI Technical Summary

Technical Problem

Existing facial recognition technologies are inadequate in terms of security, accuracy, and speed, especially when facing malicious attacks, low-quality images, and latency issues.

Method used

Facial recognition is performed using Time-of-Flight (TOF) data. By processing the TOF data in a Trusted Execution Environment (TEE), TOF images are generated and recognized. Combined with the software framework of the Android operating system, the security and accuracy of the data processing and recognition process are ensured.

Benefits of technology

It improves the security and accuracy of facial recognition, reduces the possibility of malicious attacks, lowers the risk of impersonation by similar faces, and reduces response latency while ensuring recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116935467B_ABST
    Figure CN116935467B_ABST
Patent Text Reader

Abstract

The application provides a data processing method and device, acquires first frame TOF data, processes the first frame TOF data into a TOF image, uses the first frame TOF image for face recognition, and obtains a recognition result. The TOF data is used for face recognition, which has higher security. After the first frame TOF image is obtained, the first frame TOF image is used for face recognition, so the execution speed is high. Because the TOF data is less affected by light, even the first frame TOF data can obtain a TOF image with high quality, so the recognition accuracy is high.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application filed with the Chinese Patent Office with application number 202110924492.3, filing date August 12, 2021, entitled "Data Processing Method and Apparatus". Technical Field

[0002] This application relates to the field of electronic information, and in particular to a data processing method and apparatus. Background Technology

[0003] Facial recognition is widely used by electronic devices to identify authorized users. For example, in face unlock functionality, the decision to unlock the screen is based on whether facial recognition is successful.

[0004] Given the above scenarios, in terms of security, the issue of malicious attacks needs to be considered. Regarding accuracy, the problem of inaccurate recognition results due to poor image quality needs to be addressed. And in terms of user experience, latency issues need to be considered.

[0005] It is clear that the problem that needs to be solved is how to achieve facial recognition safely, accurately, and quickly. Summary of the Invention

[0006] This application provides a data processing method and apparatus, with the aim of solving the problem of how to achieve facial recognition safely, accurately, and quickly.

[0007] To achieve the above objectives, this application provides the following technical solution:

[0008] The first aspect of this application provides a data processing method, comprising: acquiring Time-of-Flight (TOF) data, wherein the TOF data includes multiple safety indication frames and multiple face recognition frames, the TOF data being TOF data triggered by a task request issued by an application and collected by a TOF camera; processing a first face recognition frame into a first TOF image, the first face recognition frame being the first frame among the multiple face recognition frames; and using the first TOF image to perform face recognition to obtain a first recognition result. Using TOF data for face recognition offers higher security, and using the first TOF image generated from the first TOF data for face recognition allows for faster recognition results. Furthermore, because TOF data is less affected by light, even the first TOF data can yield a high-quality TOF image, thus achieving higher recognition accuracy.

[0009] Optionally, acquiring TOF data includes: acquiring TOF data using preset fixed exposure parameters.

[0010] Optionally, the following steps can be performed serially using only one processor: processing the first face recognition frame into a first Time-of-Flight (TOF) image, and using the first TOF image for face recognition to obtain a first recognition result. Because the first TOF image is used for face recognition, even if data processing and recognition are performed serially using only one processor, a relatively fast speed can be achieved.

[0011] Optionally, it may also include: using the first recognition result to perform a task to respond to a specific function of the application based on the face recognition of the TOF data.

[0012] Optionally, performing the task using the first recognition result includes: the first recognition result indicating that the recognition is successful, and performing the first task.

[0013] Optionally, the step of using the first recognition result to execute the task further includes: if the first recognition result indicates that the recognition fails and a preset termination condition is met, executing a second task, wherein the termination condition includes the execution time of the task reaching a preset time threshold. Setting a termination condition helps reduce task response latency while ensuring recognition accuracy.

[0014] Optionally, performing the task using the first recognition result further includes: if the first recognition result indicates that the recognition failed and a preset termination condition is not met, obtaining and using the recognition result of another facial recognition frame to respond to the task. Continuing facial recognition even when the preset condition is not met helps to further improve the accuracy of the recognition.

[0015] Optionally, the method further includes: after acquiring the first face recognition frame, acquiring the first AE result. The other face recognition frame is acquired using exposure parameters adjusted by the first AE result, thus improving the quality of the other face recognition frame and facilitating a more accurate recognition result.

[0016] Optionally, the step of using the first frame TOF image for facial recognition to obtain a first recognition result includes: receiving the storage information of the first frame TOF image through a trusted facial application within a Trusted Execution Environment (TEE), and then transmitting the storage information of the first frame TOF image to the facial recognition module through the trusted facial application; reading the first frame TOF image based on the storage information of the first frame TOF image through the facial recognition module; and performing facial recognition on the first frame TOF image through the facial recognition module to obtain the first recognition result. Implementing data processing and facial recognition within the TEE further enhances security.

[0017] Optionally, processing the first facial recognition frame into a first Time-of-Flight (TOF) image includes: receiving the storage information of the first facial recognition frame through the trusted facial application, and then transmitting the storage information of the first facial recognition frame to the data processing module through the trusted facial application; reading the first facial recognition frame based on the storage information of the first facial recognition frame through the data processing module; and converting the first facial recognition frame into a first TOF image through the data processing module. Transmitting the storage information of the TOF data, rather than the TOF data itself, helps to further improve the security of the TOF data and saves transmission bandwidth resources.

[0018] Optionally, the method further includes: storing the first frame of the TOF image through the data processing module, and transmitting the stored information of the first frame of the TOF image to the facial trusted application. Transmitting the stored information of the TOF image improves the security of the TOF image and saves transmission bandwidth resources.

[0019] Optionally, the step of using the first frame TOF image for facial recognition to obtain a first recognition result includes: generating the first frame TOF image through a facial application client of the hardware abstraction layer, and then using the first frame TOF image for facial recognition to obtain a first recognition result. This is implemented based on the Android operating system's software framework, offering high compatibility and feasibility.

[0020] Optionally, processing the first facial recognition frame into a first Time-of-Flight (TOF) image includes: receiving the first facial recognition frame through the facial application client and processing it into a first TOF image. This is implemented using a software framework based on the Android operating system, offering high compatibility and feasibility.

[0021] A second aspect of this application provides a data processing method, comprising: acquiring Time-of-Flight (TOF) data, the TOF data including multiple safety indication frames and multiple face recognition frames, wherein the TOF data is TOF data triggered by a task request issued by an application and collected by a TOF camera; using a first face recognition frame to obtain a first TOF image and a first After Effects (AE) result; after acquiring the m-th face recognition frame, using the m-th face recognition frame to obtain the m-th TOF image, wherein the m-th face recognition frame is the earliest face recognition frame acquired based on the first AE result; wherein m is an integer greater than 1; and performing face recognition using at least the m-th TOF image to obtain a recognition result. Because face recognition is performed using at least the m-th TOF image, and the m-th face recognition frame is the earliest face recognition frame acquired based on the first AE result, an accurate recognition result can be obtained with a small time delay even if the recognition of the first frame of TOF data fails.

[0022] Optionally, acquiring TOF data includes: acquiring TOF data using preset fixed exposure parameters.

[0023] Optionally, the following steps can be performed serially using only one processor: obtaining a first frame TOF image and a first AE result using the first frame face recognition frame, obtaining a m-th frame TOF image using the m-th frame face recognition frame, and performing face recognition using at least the m-th frame TOF image to obtain a recognition result, to be compatible with a single processor scenario.

[0024] Optionally, it may also include: using the recognition results to perform tasks to respond to specific functions of the application based on the facial recognition results of the TOF data.

[0025] Optionally, using the recognition result to perform the task includes: the recognition result indicating that the recognition is successful, and performing the first task.

[0026] Optionally, the step of using the recognition result to execute the task further includes: if the recognition result indicates that the recognition failed and a preset termination condition is met, executing a second task, wherein the termination condition includes the execution time of the task reaching a preset time threshold. Setting a termination condition helps reduce task response latency while ensuring recognition accuracy.

[0027] Optionally, the step of using the recognition result to perform the task further includes: if the recognition result indicates that the recognition fails and does not meet the preset termination condition, obtaining and using the recognition results of three other facial recognition frames to respond to the task, so as to improve the accuracy of the recognition result.

[0028] Optionally, the step of using at least the m-th frame of the TOF image for face recognition to obtain a recognition result includes: performing face recognition using the m-th frame of the TOF image to obtain the m-th recognition result; if the m-th recognition result indicates that the recognition failed, performing face recognition using the first frame of the TOF image to obtain a first recognition result. Because the m-th frame of the TOF image is generated using a face recognition frame adjusted based on the first AE result, it has a higher quality. Using the m-th frame of the TOF image for face recognition first is beneficial for obtaining a more accurate recognition result as quickly as possible.

[0029] Optionally, the step of using at least the m-th frame of the Time-of-Flight (TOF) image for facial recognition to obtain the recognition result includes: receiving the stored information of at least the m-th frame of the TOF image through a trusted facial application within a Trusted Execution Environment (TEE); transmitting the stored information of the at least m-th frame of the TOF image to the facial recognition module through the trusted facial application; reading the at least m-th frame of the TOF image based on the stored information of the at least m-th frame of the TOF image through the facial recognition module; and performing facial recognition on the at least m-th frame of the TOF image through the facial recognition module to obtain the recognition result. Performing data processing and facial recognition within the TEE provides higher security.

[0030] Optionally, processing the m-th facial recognition frame into the m-th TOF image includes: receiving the storage information of the m-th facial recognition frame through the trusted facial application, and then transmitting the storage information of the m-th facial recognition frame to the data processing module through the trusted facial application; reading the m-th facial recognition frame based on the storage information of the m-th facial recognition frame through the data processing module; and processing the m-th facial recognition frame into the first frame TOF image through the data processing module. Transmitting only the storage information of the TOF data, rather than the TOF data itself, is beneficial for further improving security and saving on transmission bandwidth resources.

[0031] Optionally, the method further includes: storing the first frame of the TOF image through the data processing module, and transmitting the stored information of the first frame of the TOF image to the facial trust application. Transmitting only the stored information of the TOF image, rather than the TOF image itself, helps to further improve security and save on transmission bandwidth resources.

[0032] Optionally, the step of using at least the m-th frame of the TOF image for facial recognition to obtain a recognition result includes: using the face application client of the hardware abstraction layer to perform facial recognition using at least the m-th frame of the TOF image to obtain a recognition result.

[0033] Optionally, obtaining the first frame of TOF image and the first AE result using the first frame of facial recognition includes: receiving the first frame of facial recognition through the facial application client and processing the first frame of facial recognition into the first frame of TOF image. Obtaining the m-th frame of TOF image using the m-th frame of facial recognition includes: receiving the m-th frame of facial recognition through the facial application client and processing the m-th frame of facial recognition into the m-th frame of TOF image. Implemented based on the Android operating system software framework, it has high compatibility and feasibility.

[0034] A third aspect of this application provides a data processing method, comprising: acquiring the intensity value of ambient light;

[0035] If the intensity value of the ambient light is not greater than a preset first intensity threshold, the data processing method provided in the first aspect of this application is used; if the intensity value of the ambient light is greater than the first intensity threshold, the data processing method provided in the second aspect of this application is used. Selecting different data processing methods based on the intensity value of the ambient light allows the chosen method to be more adaptable to the external environment, thereby achieving faster execution speed while maintaining safety and accuracy.

[0036] A fourth aspect of this application provides an electronic device, including a TOF camera, a memory, and a processor. The TOF camera is used to acquire TOF data. The memory is used to store program code. The processor is used to run the program code to implement the data processing method provided in the first, second, or third aspect of this application.

[0037] A fifth aspect of this application provides a chip system comprising: at least one processor and an interface, the interface being configured to receive code instructions and transmit them to the at least one processor; the at least one processor executing the code instructions to implement the data processing method provided in the first, second, or third aspect of this application.

[0038] A sixth aspect of this application provides a readable storage medium having a program stored thereon, which, when read and run by a computing device, implements the data processing method provided in the first, second, or third aspect of this application. Attached Figure Description

[0039] Figure 1a Example diagram of a scenario using electronic devices for facial recognition;

[0040] Figure 1b This is an example of a scenario where facial recognition is performed using electronic devices under strong light.

[0041] Figure 2 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application;

[0042] Figure 3 This is a schematic diagram of the software framework for facial recognition implemented in an electronic device according to an embodiment of this application;

[0043] Figure 4 This is a flowchart of a facial recognition method disclosed in an embodiment of this application;

[0044] Figure 5 This is a flowchart illustrating yet another facial recognition method disclosed in an embodiment of this application;

[0045] Figure 6 This is a flowchart illustrating yet another facial recognition method disclosed in an embodiment of this application;

[0046] Figure 7 This is a flowchart of a data processing method disclosed in an embodiment of this application;

[0047] Figure 8 This is a flowchart illustrating yet another data processing method disclosed in an embodiment of this application;

[0048] Figure 9 for Figure 8 A flowchart illustrating the specific implementation of S819 in China;

[0049] Figure 10 This is a flowchart of a data acquisition method disclosed in an embodiment of this application;

[0050] Figure 11 This is a flowchart illustrating yet another data acquisition method disclosed in an embodiment of this application;

[0051] Figure 12 This is a flowchart illustrating yet another data acquisition method disclosed in an embodiment of this application;

[0052] Figure 13 A schematic diagram of another software framework for implementing facial recognition on electronic devices. Detailed Implementation

[0053] Figure 1a In scenarios where facial recognition is applied to electronic devices, when a user uses an electronic device such as a mobile phone to perform a function requiring user authorization, the user voluntarily or based on prompts from the electronic device, points the device's camera at their face. Electronic devices are currently typically equipped with RGB (Red, Green, Blue) cameras. After capturing an image through the RGB camera, the electronic device performs facial recognition on the image. Facial recognition includes, but is not limited to, comparing with stored facial templates and anti-spoofing identification. After obtaining the recognition result, the task is executed based on the recognition result.

[0054] For example, a user intends to unlock the screen using facial recognition. They hold the phone screen towards their face so the front-facing camera can capture an image of their face. After capturing the image, the phone performs facial recognition. If the recognition is successful, the screen unlocks; otherwise, it remains locked.

[0055] During their research, the inventors discovered that the security of electronic devices when using recognition results to identify authorized users needs to be improved: Currently, malicious attacks on faces can be mainly divided into planar attacks (such as using photos to impersonate real faces), head model mask attacks (such as using 3D models to impersonate real faces), and similar face impersonation.

[0056] During their research, the inventors also discovered that using Time-of-Flight (TOF) data for facial recognition has the following advantages: 1. TOF data can generate depth and infrared images, thus providing good anti-spoofing performance (i.e., preventing planar attacks and mask attacks). 2. TOF data is less affected by light, resulting in higher data quality. Therefore, a higher threshold can be used for face comparison, reducing the possibility of impersonation by similar faces. It is evident that using TOF data for facial recognition can improve security.

[0057] However, current mainstream hardware platforms only support RGB data processing, not TOF data processing. For example, current mainstream image signal processors (ISPs) can only process RGB camera raw data (Camera Raw Data) acquired by RGB cameras back to RGB raw data, but cannot process TOF data (such as TOF Camera Data) acquired by TOF cameras. Redesigning the hardware platform to process TOF data is too costly. Therefore, software frameworks are needed to process TOF data. However, software is more vulnerable to attacks than hardware. In this case, even if TOF data is used for facial recognition, security vulnerabilities still exist.

[0058] The following embodiments of this application provide a facial recognition method applied to electronic devices, with the aim of improving the security of facial recognition.

[0059] Figure 2 Example diagram of an electronic device, including: TOF camera 1, processor 2, memory 3, and I / O subsystem 4.

[0060] TOF camera 1 is used to acquire TOF data. In some implementations, TOF camera 1 is set as the front-facing camera of an electronic device to capture data from the device's display screen. Figure 2 (Not shown in the image) TOF data in front of the subject. For example, collecting TOF data of a face located in front of the display screen of an electronic device.

[0061] The TOF camera 1 includes a TOF sensor 11, a TOF sensor controller 12, a TOF light source 13, and a TOF light source controller 14.

[0062] In some embodiments, the TOF light source controller 14 is controlled by the TOF sensor controller 12 to control the TOF light source 13. Under the control of the TOF light source controller 14, the TOF light source 13 emits infrared (IR) light. The TOF sensor 11 is used to sense the infrared (IR) light reflected from an object, such as a human face, to collect TOF data.

[0063] The TOF sensor controller 12 and the TOF light source controller 14 are located in the I / O subsystem 4 and communicate with the processor 2 through the I / O subsystem 4.

[0064] The memory 3 can be used to store computer-executable program code. Specifically, the memory 3 may include a program storage area and a data storage area. The program storage area can store program code required to implement the operating system, software system, or at least one function. The data storage area can store data acquired, generated, and used during the use of the electronic device.

[0065] In some implementations, all or part of the memory 3 can be integrated into the processor 2 as internal memory of the processor 2. In other implementations, the memory 3 is external memory relative to the processor 2 and communicates with the processor 2 through the processor 2's external memory interface.

[0066] In some implementations, memory 3 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0067] Processor 2 may include one or more processing units, such as application processor (AP), graphics processing unit (GPU), image signal processor (ISP), etc.

[0068] In some implementations, processor 2 may include a secure area processor 21, where the data involved in facial recognition can be stored. The secure area processor 21 can then execute the processing flow of this data by calling program code in memory 3 to improve the security of facial recognition.

[0069] In some implementations, the secure area processor 21 stores the TOF data acquired by the TOF camera 1, generates a TOF image using the TOF data, performs facial recognition processing using the TOF image, and obtains the recognition result. The processor 2 can then use the recognition result to perform tasks such as face unlocking or face payment.

[0070] Optionally, the electronic device may also include an ambient light sensor. Figure 2 (Not shown in the diagram), it is used to sense the ambient light intensity of the environment in which the electronic device is located. It can be understood that the ambient light sensor is controlled by an ambient light sensor controller located in I / O subsystem 4. Figure 2 (Not shown in the image) communicates with processor 2.

[0071] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0072] It is understandable that the processor 2, by running the code stored in the memory 3, can implement an operating system such as iOS, Android (open-source), Windows, or HarmonyOS. In the following embodiments, Android (open-source) will be used as an example.

[0073] The processor 2 of the electronic device runs the program code stored in the memory 3, which can achieve... Figure 3 The software framework shown is based on the Android open-source operating system:

[0074] The software framework includes a Trusted Execution Environment (TEE) and a Rich Execution Environment (REE) capable of executing rich instructions. The TEE can be implemented by the secure region processor 21 in processor 2 by running program code.

[0075] The REE includes various layers of the Android open-source operating system, including but not limited to: the application layer, the application framework layer, the hardware abstraction layer, and the kernel layer.

[0076] The application layer can include a series of application packages. For example... Figure 3 As shown, the application package can include payment applications and lock screen applications. Each application can initiate task requests in different scenarios to trigger facial recognition.

[0077] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 3 As shown, the application framework layer can include a camera service and a face service. The camera service is used to implement camera functionality. The face service is used to implement facial recognition functionality.

[0078] The Hardware Abstraction Layer (HAL) is used to abstract hardware. It hides the hardware interface details of a specific platform, providing the operating system with a virtual hardware platform that is hardware-independent and portable across multiple platforms. The Camera Hardware Abstraction Layer (HAL3) within the HAL is used to respond to commands from the Camera service and control the camera. The Face Client application (Face CA) accesses trusted applications within the TEE by calling the API (Application Programming Interface) of the TEE client located on the REE, thereby using the security features provided by the TEE and trusted applications.

[0079] The kernel layer is the layer between hardware and software. Hardware driver software is usually located in the kernel layer. Figure 3 In this architecture, one of the functions of the ISP-Lite in the kernel layer is to drive the ISP-Lite (a part of the ISP) in the processor, converting the TOF data acquired by the TOF sensor (such as TOF camera Raw Data) into data formats commonly used in image processing, such as TOF raw data. In the following embodiments, the data processed by the ISP-Lite and the TOF data acquired by the TOF camera are collectively referred to as TOF data. The TOF camera driver in the kernel layer is used to drive the TOF camera. The TEE includes various applications, modules, and units for face recognition based on TOF data. Among them, the Face Trusted Application (Face TA) is responsible for scheduling the various modules and units in the TEE and communicating with the REE. The data processing module is used to process data such as Raw Data. The face recognition module is used to implement functions such as face recognition using face templates and face template management.

[0080] based on Figure 3The framework shown allows the electronic device to process TOF data into TOF images in the TEE and perform facial recognition using the TOF images in the TEE to obtain the recognition result. That is, based on using TOF data for facial recognition to improve security, both data processing and recognition are implemented in the TEE, which can further improve security.

[0081] The following will combine Figure 3 The facial recognition method disclosed in the embodiments of this application will be described in detail, such as... Figure 4 As shown, the facial recognition method performed by the electronic device disclosed in this application includes the following steps:

[0082] S401. Through the application layer, the task request is transmitted to the face service in the application framework layer.

[0083] Understandably, an application can initiate a task and send a task request to the Face service in response to at least one instruction, at least one user action, or at least one sensor signal, or periodically. Taking a lock screen application as an example, when a user presses the power button, triggering the unlock task, the unlock application sends an unlock request to the Face service.

[0084] S402. Transmit task requests to the Face Client application (Face CA) of the Hardware Abstraction Layer via Face service.

[0085] S403. Transmit image requests to the camera service in the application framework layer via Face CA in response to task requests.

[0086] S404. Transmit image requests to the Camera Hardware Abstraction Layer (Camera HAL3) via Camera service.

[0087] S405 responds to image requests via Camera HAL3 and transmits image output instructions to the kernel-level TOF camera driver to drive the TOF camera to acquire TOF data.

[0088] S406, the kernel-level ISP-Lite receives and processes the TOF data, storing it in the first secure buffer of the TEE as first storage information. The first storage information indicates the storage address.

[0089] The ISP-Lite stores the received and processed TOF data into the TEE, which is equivalent to the TOF data being stored directly from the hardware (the processor's ISP) into the secure area, thus reducing the possibility of being attacked.

[0090] S407: Transmit the first storage information to the Camera HAL3 in the hardware abstraction layer through the kernel layer's ISP-Lite.

[0091] Because the first stored information is transmitted within the REE, to ensure its security, the first stored information can optionally be encrypted, i.e., ciphertext. In this step, an example of encrypted information is a file descriptor (FD), used to describe the storage location and reading method.

[0092] For ease of description, the ciphertext of the first stored information will be referred to as FD1.

[0093] S408 transmits FD1 and calibration data to the Camera service in the application framework layer via Camera HAL3.

[0094] Because calibration data is needed for the generation of subsequent TOF images, Camera HAL3 obtains the calibration data pre-configured in the REE and transmits it to the TEE along with FD1.

[0095] Optionally, Camera HAL3 can obtain a portion of the calibration data from the REE's storage unit and another portion of the calibration data from the TOF camera.

[0096] S409. Transmit FD1 and calibration data to the Face CA of the hardware abstraction layer via the Camera service.

[0097] S410, transmit FD1 and calibration data to the Face Trusted Application (Face TA) of the TEE via Face CA.

[0098] It is understandable that the information interaction between modules in each layer of the REE can follow the communication protocol between each layer.

[0099] Based on the existing operating system framework, the storage information of TOF data is transmitted to the TEE, laying the foundation for processing TOF data in the TEE. Furthermore, ISP-Lite stores the received and processed TOF data into the TEE, ensuring the security of the TOF data.

[0100] S411. Transmit FD1 to the TEE's data processing module via the TEE's Face TA, and store the calibration data in the TEE's calibration data storage unit.

[0101] S412. The data processing module reads TOF data from the first safety buffer storage unit according to FD1 and reads calibration data from the calibration data storage unit.

[0102] S413. Using the data processing module, depth images and infrared images are generated using TOF data and TOF camera calibration data.

[0103] S414. The TOF image is stored in the second secure buffer storage unit of the TEE using the second storage information through the data processing module.

[0104] Since both are implemented in the TEE, the second stored information does not need to be encrypted.

[0105] S415. Transmit the second stored information to Face TA through the data processing module.

[0106] S416. Transmit the second stored information to the face recognition module via Face TA.

[0107] S417. The face recognition module reads the TOF image from the second secure buffer storage unit based on the second storage information.

[0108] S418. Perform facial recognition on the read TOF image using the facial recognition module to obtain the recognition result.

[0109] Specifically, the facial recognition module uses a pre-configured facial template to perform facial comparison on the TOF image, obtaining the comparison result. Furthermore, the TOF image is used for anti-counterfeiting verification to obtain the anti-counterfeiting result. The recognition result can be determined based on both the comparison result and the anti-counterfeiting result. For example, if the comparison result is "comparison passed" and the anti-counterfeiting result is "anti-counterfeiting passed," then the recognition result is "passed."

[0110] As mentioned earlier, because TOF images include both depth and infrared images, a higher comparison threshold can be used when comparing infrared images with a face module, resulting in higher accuracy and reducing the possibility of facial spoofing. Furthermore, since depth and infrared images can be used simultaneously for anti-spoofing identification, it offers high anti-spoofing performance (i.e., high resistance to planar attacks and head-mask attacks).

[0111] S419. Transmit the recognition result to Face TA through the facial recognition module.

[0112] S420: The recognition result is transmitted to the Face CA of the REE via the Face TA of the TEE.

[0113] S421. Transmit the recognition results to the Face service in the application framework layer via Face CA.

[0114] S422. Transmit the recognition results to the application that initiated the task request in the application layer through the Face service.

[0115] Taking the lock screen application at the application layer as an example, after the lock screen application initiates an unlock request, it receives the recognition result and, based on the recognition result, indicates that the recognition is successful and executes the unlock task; if the recognition result indicates that the recognition is unsuccessful, it executes the task of keeping the lock screen state.

[0116] It is understandable that other applications at the application layer initiate task requests and obtain facial recognition results in a similar process, which will not be elaborated here.

[0117] The facial recognition method described in this embodiment uses Time-of-Flight (TOF) data for facial recognition, thus offering high security. Furthermore, implementing TOF-based facial recognition within a TEE (Transient Electronic Equipment) ensures the security of the TOF data, the data processing process, and the recognition process, thereby further enhancing the security of facial recognition.

[0118] Furthermore, based on the various layers of the Android operating system, it enables the transmission of data storage information, recognition results, and calibration data between the REE and TEE, exhibiting good compatibility.

[0119] Understandably, because the calibration data belongs to the camera domain rather than the face domain, in some implementations, the calibration data can also be transferred from the Camera service to the Face CA via the Face service.

[0120] It is understandable that once the calibration data is stored in the calibration data storage unit of the TEE, the calibration data in the TEE's calibration data storage unit will not be lost as long as the processor does not lose power. Therefore, it is not necessary to reload the calibration data. Of course, the calibration data can also be reloaded; this is not a limitation here. Transmitting the calibration data together with FD1 is only one implementation method; they can also be transmitted separately, with the transmission path as described above.

[0121] Understandably, a Time-of-Flight (TOF) camera captures a set of TOF data with each exposure, then performs multiple exposures to capture multiple sets of TOF data. After a first duration, it pauses, then performs multiple more exposures, and so on. These multiple sets of continuously captured TOF data are called one frame of TOF data, and the multiple sets of TOF data captured after the first duration interval are called another frame of TOF data. Without considering the processing and transmission delays of other modules, ISP-Lite also stores each frame of TOF data into the first secure buffer storage unit at the first duration interval, and also transmits the storage information of each frame of TOF data to Face CA at the first duration interval. Face CA also transmits the storage information of each frame of TOF data to Face TA at the first duration interval. Therefore, Face TA also receives the storage information of each frame of TOF data at the first duration interval. Figure 4 S406 can be used to store any frame of TOF data, S407-S411 can be used to transmit any frame of TOF data, S413-S419 can be used to process the TOF data for this frame, and S420-S422 can be used to process the recognition results for this frame of TOF data, or it can be used to process the recognition results for multiple frames of TOF data.

[0122] Because TOF cameras acquire TOF data by projecting infrared light, it is necessary to pay attention to the safety of the human eye during the acquisition process. Furthermore, since the quality of the TOF image affects the accuracy of the recognition results, and the exposure parameters of the TOF camera directly affect the image quality, it is necessary to optimize the exposure parameters of the TOF camera.

[0123] In the embodiments of this application, Figure 4 The process shown is further improved, and the data processing module can generate different parameters for adjusting the TOF camera based on the type of received TOF data.

[0124] Figure 5 The diagram illustrates the process of generating and feeding back Automatic Exposure (AE) results, and controlling the camera based on those results. This explanation only covers the initial stages. Figure 5 and Figure 4 The difference:

[0125] S413a: The data processing module of the TEE, in response to the TOF data as a face recognition frame, generates a depth image, an infrared image, and an AE result.

[0126] In the embodiments of this application, the TOF camera divides the acquired TOF data into safety indication frames and face recognition frames. The safety indication frame carries an eye safety flag to indicate whether the infrared light emitted by the TOF camera is safe for the human eye. The face recognition frame is a TOF data frame used for face recognition. In some implementations, the type of the TOF data frame is indicated by at least one of a numerical value, character, or string within the TOF data frame.

[0127] In some implementations, the first to fourth frames of TOF data acquired via Time-of-Flight (TOF) data collection are safety indication frames, while subsequent frames are face recognition frames. The safety indication frames include eye safety markers.

[0128] The AE (Advanced Exposure Result) is used to adjust the exposure parameters of the TOF camera. Optionally, the AE result includes, but is not limited to, the exposure time and the physical gain of the TOF sensor. One way to generate the AE result is to extract the facial region from the TOF raw data (i.e., the original image), calculate the brightness value of the facial region, and compare it with a pre-configured target brightness value to obtain the exposure time and the physical gain of the TOF sensor. An AE result can be generated for each frame of TOF data, or multiple frames of TOF data can be used to generate a single AE result.

[0129] S415a: The second stored information and the AE result are transmitted to the Face TA of the TEE through the data processing module of the TEE.

[0130] It is understandable that if the AE result of the previous frame of TOF data is the same as the latest AE result, the latest AE result can be omitted to save TEE resources.

[0131] S420a transmits the recognition results and AE results to the FaceCA of the REE hardware abstraction layer via the Face TA of the TEE.

[0132] S423a: Transmit the AE results to the Camera service in the REE application framework layer via Face CA.

[0133] S424a: Transmit the AE results to the Camera HAL3 in the hardware abstraction layer via Camera service.

[0134] S425a: Using Camera HAL3, adjust the TOF camera based on the AE results via the TOF camera driver.

[0135] The Camera HAL3 can send AE results to the TOF sensor controller via the TOF camera driver, and the TOF sensor controller will then control the TOF sensor to collect TOF data according to the AE results.

[0136] Figure 6 The diagram illustrates the process of generating and feeding back safety identifiers, and controlling the camera based on these identifiers. This explanation is only for illustrative purposes. Figure 6 and Figure 4 The difference:

[0137] S413b: The data processing module of the TEE generates a security identifier in response to the TOF data being a security indication frame.

[0138] Safety signs are used to indicate whether the TOF light source is safe for the human eye.

[0139] Optionally, the safety identifier is generated as follows: After receiving a TOF data frame (i.e., a safety indication frame) carrying an eye safety flag, the eye safety flag is extracted, and the safety of the human eye is determined based on the extracted eye safety flag to generate a safety identifier. If the eye safety flag indicates safety, a safety identifier indicating safety is obtained. If the eye safety flag indicates unsafety, a safety identifier indicating unsafety is obtained.

[0140] S415b: The second stored information and security identifier are transmitted to the FaceTA of the TEE through the data processing module of the TEE.

[0141] Generally, during the time-of-flight (TOF) camera's acquisition process, the eye safety flag carried in each safety indication frame is the same. For example, in the first to fourth safety indication frames, the eye safety flag indicates either eye safety or eye unsafety. In this case, multiple safety flags are identical, so only one safety flag can be transmitted to save TEE resources.

[0142] However, it cannot be ruled out that in some cases, the human eye flag bits in multiple security indication frames may be different. Therefore, it is also possible to transmit only the last security identifier, that is, the security identifier determined based on the last received security indication frame, to save TEE resources.

[0143] S420b transmits the recognition results and security identifiers to the Face CA of the REE's hardware abstraction layer via the Face TA of the TEE.

[0144] S423b: Transmit the security identifier to the Camera service in the REE application framework layer via Face CA.

[0145] S424b transmits the security identifier to the Camera HAL3 in the hardware abstraction layer via the Camera service.

[0146] S425b, via Camera HAL3, adjusts the TOF camera using the TOF camera driver based on the safety markings.

[0147] Adjustments to the TOF camera include, but are not limited to: turning off the TOF camera if a safety sign indicates it is unsafe for the human eye, or reducing the emission intensity of the TOF light source. If a safety sign indicates it is safe for the human eye, then TOF data frames are acquired and identified as TOF data frames for face recognition (i.e., face recognition frames).

[0148] based on Figure 2 Optionally, the Camera HAL3 can send a shutdown command to the TOF sensor controller via the TOF camera driver to shut down the TOF camera.

[0149] In summary, after obtaining TOF Raw Data through the processor, the electronic device processes the TOF Raw Data into a TOF image in the TEE, and uses the TOF image for facial recognition, thus making facial recognition more secure.

[0150] Furthermore, by integrating various layers of the Android system, the transmission of TOF data storage information to the TEE was realized, which not only laid the foundation for processing in the TEE but also achieved compatibility with the Android system.

[0151] It is evident that even if the processor of an electronic device does not support the generation of TOF images, the framework and process described in this embodiment can still achieve facial recognition using TOF data, thereby improving security.

[0152] Furthermore, it can also ensure eye safety and adjust exposure parameters, thereby improving the security of facial recognition and enabling electronic devices to have better performance.

[0153] It is understandable that the above Figures 4-6Although the Android operating system is used as an example for illustration, the facial recognition method described in this application is not limited to the Android operating system. For example, the operation of the TEE is not limited to the Android operating system, so the functions of the various applications, modules, and units in the TEE can also be implemented in other operating systems. The operation of the REE is also not limited to the Android operating system, so the transmission paths for TOF data and calibration data to the TEE, as well as the transmission paths for task requests and the feedback paths for recognition results, can all be adapted to different operating systems, as long as the transmission of TOF data and calibration data from the REE to the TEE, and the collection of TOF data triggered by task requests and the use of recognition results for task execution can be achieved.

[0154] The inventors discovered that, in addition to security, the accuracy and execution speed of facial recognition also have room for improvement; that is, facial recognition still has the following problems:

[0155] Inaccurate recognition results due to poor image quality: Due to the influence of ambient light, the data collected by the camera may have quality defects such as overexposure, blurring, and insufficient brightness. Since facial recognition is based on the data collected by the camera, there may be problems with the comparison results. For example, the same person may fail the facial recognition.

[0156] Excessive latency leads to a poor user experience: combined with Figure 1a In the scenario shown, if facial recognition is too slow, the user will have to wait too long, which will reduce user comfort. Poor image quality is usually the cause of excessive latency.

[0157] Improving image quality and improving execution speed are contradictory: to improve image quality, the image must be processed through iteration, noise reduction, and other methods to make the image converge. The more processing methods there are, the slower the processing speed becomes.

[0158] During their research, the inventors also discovered that TOF imaging has the following characteristics:

[0159] (1) TOF data acquired by a TOF camera is less affected by ambient light, so in most scenarios, the quality of the first frame of TOF data acquired by the TOF camera (such as the first frame of face recognition) is sufficient to meet the requirements for recognition accuracy. Therefore, in most scenarios, the first frame of TOF data can be used to obtain a face recognition result with high accuracy.

[0160] Taking facial recognition unlock as an example: Suppose the face attempting to unlock is the face already registered in the electronic device, meaning the face attempting to unlock can unlock the screen. In this case, the first frame of TOF data can be used to unlock the device.

[0161] (2) When the feedback adjustment mechanism (the feedback adjustment mechanism refers to using the previously acquired data and the camera's calibration data to adjust the exposure parameters of the subsequently acquired data to improve image quality) is in effect, the convergence speed of TOF data (convergence means no longer changing) is fast, and it takes about 3-4 frames of TOF data to converge.

[0162] Continuing with the previous example, assuming that the first frame of TOF data does not unlock, then if the exposure parameters are adjusted using the feedback adjustment mechanism, and the third or fourth frame of TOF data converges (meaning that even if the exposure parameters are adjusted again, the TOF data will no longer change), then the third or fourth frame of TOF data can unlock.

[0163] Based on the characteristics of TOF imaging, using TOF data for facial recognition to improve security provides a possibility for balancing accuracy and speed.

[0164] In the following embodiments, based on the aforementioned method of storing each frame of TOF data to the TEE sequentially at a first time interval and transmitting the storage information of each frame of TOF data to the TEE, combined with the above-mentioned characteristics of TOF imaging, the purpose of accurately and quickly obtaining recognition results is achieved by scheduling the data processing module and the face recognition module through Face TA.

[0165] Figure 7 This application discloses a data processing method in an embodiment, which is related to... Figure 4 , Figure 5 or Figure 6 The improvements lie in the applications and modules within the TEE, while the functions of each module and the data transmission methods within the REE are also similar. Figure 4 , Figure 5 or Figure 6 The same applies, so I won't repeat myself. Figure 7 The process shown, starting from when Face TA receives FD1 and calibration data, includes the following steps:

[0166] After receiving the first frame of TOF data (FD1) from S701 and Face TA, FD1 is transmitted to the data processing module.

[0167] In some implementations, the first frame of TOF data is the first frame of TOF data acquired by the Camera HAL3 in response to an image request, controlling the TOF camera driver.

[0168] In some implementations, the TOF data frames acquired by the TOF camera are designated as safety indication frames and face recognition frames, respectively. The safety indication frame carries an eye safety flag to indicate whether the infrared light emitted by the TOF camera is safe for the human eye. The face recognition frame is the TOF data frame used for face recognition. In this case, the first TOF data frame in this step is the first face recognition frame.

[0169] S702, the data processing module uses FD1 to read the first frame of TOF data from the first security buffer storage unit and read calibration data from the calibration data storage unit.

[0170] In this embodiment, it is assumed that the calibration data has been stored in the calibration data storage unit.

[0171] S703 The data processing module uses the first frame of TOF data and calibration data to generate a TOF image and an automatic exposure (AE) result.

[0172] As mentioned earlier, TOF images include depth images and infrared images.

[0173] The AE (Adaptive After Effects) results are used by the TOF camera to adjust the exposure parameters of the acquired TOF data. The AE results include, but are not limited to, the exposure duration and the physical gain of the TOF sensor. One way to generate AE results is to extract the facial region from the TOF raw image (Raw Data), calculate the brightness value of the facial region, and compare it with a pre-configured target brightness value to obtain the exposure duration and the physical gain of the TOF sensor.

[0174] For ease of description, the TOF image obtained by processing the first frame of TOF data is referred to as the first frame TOF image. The AE result obtained from the first frame of TOF data is referred to as the first AE result.

[0175] S704, the data processing module stores the first frame TOF image in the second secure buffer storage unit.

[0176] S705, the data processing module transmits the storage information of the first frame TOF image and the first AE result to Face TA.

[0177] Understandably, since the storage information of the first frame of the TOF image is only transmitted via TEE, it can be transmitted in plaintext.

[0178] S706 and Face TA transmit the first AE result to the TOF camera.

[0179] The path from the first AE result to the TOF camera, combined with Figure 4 , Figure 5 or Figure 6The example shown is: Face TA, Face CA, Camera service, Camera HAL3, and the TOF sensor controller of the TOF camera, which then uses the first AE result to adjust the parameters of the TOF camera, including but not limited to the exposure time.

[0180] It is understandable that the TOF data frames that the first AE result can be applied to are related to the processing time of the TOF data by the processor. Taking a 30ms acquisition interval of the TOF camera as an example, assuming that the total time for the processor to generate the first TOF image and the first AE result is also 30ms, then the first AE result can be applied to the third frame of TOF data acquired by the TOF camera at the earliest.

[0181] Generating and transmitting the AE results is an optional step. The purpose is to improve the quality of subsequently acquired TOF data, thereby obtaining higher quality TOF images and more accurate recognition results.

[0182] The first frame of TOF data can be acquired using pre-configured fixed exposure parameters.

[0183] S707 and Face TA transmit the stored information of the first frame of the TOF image to the face recognition module to trigger the face recognition module to perform face recognition.

[0184] Understandably, the execution order of S706 and S707 is not limited.

[0185] S708 The face recognition module uses the storage information of the first frame TOF image to read the first frame TOF image from the second secure buffer storage unit.

[0186] S709 The face recognition module uses the first frame of the TOF image to perform face recognition and obtain the first recognition result.

[0187] Combination Figure 3 The facial recognition module calls a facial template to perform facial comparison on the first frame of the TOF image. In addition to facial comparison, depth maps and infrared images can also be used for anti-counterfeiting verification. Therefore, facial recognition includes both facial comparison and anti-counterfeiting verification. If both facial comparison and anti-counterfeiting verification pass, the facial recognition result indicates success.

[0188] S710, the facial recognition module transmits the first recognition result to Face TA.

[0189] S711. Face TA determines whether the first recognition result indicates that the recognition is successful. If yes, execute S712; otherwise, execute S713.

[0190] S712, Face TA transmits the first recognition result to Face CA.

[0191] As mentioned earlier, Face CA transmits the initial recognition result to the initiator of the task, such as an app unlocking.

[0192] S713. Face TA determines whether the termination condition is met. If yes, execute S712; otherwise, execute S714.

[0193] The termination condition can be preset. In this step, the termination condition includes: the execution time of the task reaches a second duration threshold. An example of the second duration threshold is 5 seconds. The termination condition is optional; it is also possible to omit checking whether the termination condition is met and execute S714 if the first recognition result indicates that the recognition failed.

[0194] As can be seen, the purpose of setting a termination condition is to avoid unnecessary time consumption during task execution: if facial recognition still fails after a certain period of time, it can be basically determined that the facial recognition result is unsuccessful, for example, the face attempting to unlock was not pre-stored in the electronic device. Therefore, there is no need to continue facial recognition. Instead, the facial recognition result should be fed back to the task as soon as possible to reduce task execution latency and thus ensure a better user experience.

[0195] S714, Face TA, receives another frame of TOF data from the TOF camera.

[0196] Taking the TOF camera's 30ms acquisition interval as an example, the time taken to generate the first TOF image and the first AE result is also 30ms. In this case, the next frame of TOF data received from the TOF camera is the seventh frame of TOF data acquired by the TOF camera.

[0197] It is understandable that, since the first AE can be applied to the third frame of TOF data as early as possible, the seventh frame of TOF data is a TOF data frame acquired after adjusting the exposure parameters using the results of the first AE.

[0198] After receiving another TOF data frame, the subsequent process that Face TA needs to perform can be found in S701-S714. That is, the first frame of TOF data, which is the object of processing in S701-S714, is replaced with the newly received frame of TOF data, such as the seventh frame of TOF data. The processing result of the first frame of TOF data is adaptively replaced with the processing result of the newly received frame of TOF data (for example, replacing the first frame of TOF image with the second frame of TOF image). This will not be elaborated here.

[0199] Figure 7The process shown differs from existing facial recognition processes in at least the following ways: Existing image data processing processes include iterative processing of image data to obtain converged image data, with the aim of obtaining images of sufficient quality to meet recognition accuracy requirements.

[0200] Taking RGB data as an example, because RGB data is easily affected by ambient light, the quality of the first frame of RGB data collected is usually insufficient for accurate recognition. Therefore, iterative processing of the RGB data is required to obtain converged RGB data, which is then used to perform facial recognition to ensure the accuracy of the recognition results. Typically, depending on the iterative algorithm, RGB data converges in about 10 frames at faster speeds, and 30-40 frames at slower speeds. Therefore, the consensus among those skilled in the art is that the first frame of RGB data is likely to be of very poor quality due to the influence of ambient light, and directly using it for facial recognition is meaningless.

[0201] In this embodiment, based on the above-mentioned TOF imaging principle (1), in most scenarios, the first frame of TOF data converges, indicating that the first frame of TOF data can likely yield a relatively accurate recognition result. Therefore, after the electronic device acquires the first frame of TOF data, the first frame of TOF image generated from the first frame of TOF data is used to obtain the facial recognition result. Thus, while ensuring high accuracy of the recognition result, a smaller processing delay can be achieved. In other words, based on the above-mentioned principle of TOF imaging, the step of iterating image data to obtain converged image data is omitted in exchange for improved image data processing speed.

[0202] Furthermore, the inventors discovered in their research that the interval for a TOF camera to acquire TOF data and the time for a processor to generate a TOF image are typically both 30ms, while the face recognition time is typically 150ms. Therefore, the time to obtain a recognition result using TOF data is: 30ms + 150ms = 180ms. Under otherwise identical conditions, this value demonstrates that the method described in this embodiment allows users to clearly perceive a faster unlocking speed, thus improving the user experience.

[0203] Because the second frame of TOF data is acquired using the exposure parameters determined by the first AE result, the probability of convergence is greater. Therefore, even if the first frame of TOF data fails to be recognized due to quality issues, the second frame of TOF data can still be successfully recognized. The time taken is (30ms + 150ms) * 2 = 360ms, which is still advantageous compared to the convergence time of RGB data.

[0204] A more specific scenario example used in this embodiment is as follows:

[0205] Limited by the hardware capabilities of mobile phones, they only have one processor (such as...). Figure 2 The security area processor 21 shown can be used to implement facial recognition.

[0206] Assuming the face attempting to unlock is a face already registered in the electronic device, after the user faces the phone screen, the TOF camera collects TOF data at 30ms intervals and transmits it to the processor. After receiving the first frame of TOF data, the processor processes the first frame of TOF data into a first frame of depth image and a first frame of infrared image according to the process described in this embodiment, and uses the first frame of depth image and the first frame of infrared image to obtain the first recognition result. During the process of the processor generating the first frame of TOF image and calculating the recognition result, because the processor is occupied, although the TOF camera is still transmitting TOF data frames to the processor, the processor can no longer receive subsequent TOF data frames. That is to say, except for the first frame of TOF data received, other TOF data frames are discarded.

[0207] As can be seen, this embodiment does not consider the TOF data iteration process, which perfectly suits the scenario of having only one processor. In other words, in a scenario where only one processor is used for TOF data processing and facial recognition, if both recognition processing and TOF data iteration are required to wait for TOF data convergence, the processor must process them sequentially, resulting in excessive time consumption. The method described in this embodiment, however, does not perform the TOF data iteration step, thus shortening the processing time. Furthermore, because TOF data converges in the first frame in most cases, it can ensure relatively accurate recognition results while reducing facial recognition time.

[0208] In summary, the data method described in this embodiment, based on the characteristic that TOF data has a high probability of convergence in the first frame, ensures that facial recognition can be performed accurately and quickly in most cases. Furthermore, because TOF data is highly secure when used for facial recognition, it can achieve the goal of safe, accurate, and fast facial recognition.

[0209] During their research, the inventors further discovered that in outdoor scenarios, because natural light also contains light with wavelengths close to the infrared light emitted by the TOF light source, the first frame of TOF data may be overexposed. In this case, the quality of the first frame of TOF data is insufficient to obtain accurate recognition results. As in the aforementioned example, if the device cannot unlock on the first frame, the required unlocking latency is at least 360ms, and there is room for further reduction in this latency.

[0210] Another data processing method disclosed in the embodiments of this application, such as Figure 8 As shown:

[0211] S801-S806 are the same as S701-S706; please refer to [link / reference] for details. Figure 8 This will not be elaborated upon here.

[0212] S807-S812 describes the processing flow for the second frame of TOF data after receiving the storage information of the second frame. This flow is the same as the processing flow for the first frame of TOF data. For details, please refer to [link to documentation]. Figure 8 This will not be elaborated upon here.

[0213] It is understandable that the second frame of TOF data may be a TOF data frame acquired by the TOF camera using exposure parameters adjusted based on the first AE result, or it may have the same exposure parameters as the first frame of TOF data. Which one it is depends on the interval at which the TOF camera acquires TOF data frames (as mentioned in the first time interval) and the time it takes for the processor to receive the TOF data frame and then provide the AE result.

[0214] Assuming the time interval between TOF camera data acquisition and transmission is 30ms, and the time for the processor to process the TOF data into a TOF image and obtain the AE result is also 30ms, then the first AE result cannot be applied to the acquisition of the second frame of TOF data.

[0215] S813-S818 describes the processing flow for the third frame of TOF data after receiving the storage information. This flow is the same as the processing flow for the first frame of TOF data. For details, please refer to [link to documentation]. Figure 8 This will not be elaborated upon here.

[0216] As can be seen from the above process, the difference between this embodiment and the previous embodiment is that it receives and processes the first three frames of TOF data.

[0217] S819, Face TA calls the facial recognition module to perform facial recognition.

[0218] One possible implementation of S819 is as follows: Figure 9 As shown:

[0219] S901, Face TA transmits the stored information of the third frame TOF image to the face recognition module.

[0220] S902. After the face recognition module reads the third frame TOF image using the stored information of the third frame TOF image, it uses the third frame TOF image to perform face recognition and obtains the recognition result of the third frame TOF image.

[0221] Understandably, the facial recognition module reads the third frame of the TOF image from the second secure buffer storage unit. Figure 9 This will not be elaborated upon further.

[0222] For ease of distinction, the recognition result of the third frame image is referred to as the third recognition result.

[0223] S903, the facial recognition module transmits the third recognition result to Face TA.

[0224] S904. Face TA determines whether the third recognition result indicates that the recognition is successful. If yes, execute S905; otherwise, execute S906.

[0225] S905 and Face TA transmit the third recognition result to Face CA.

[0226] Since the third frame of TOF data is most likely acquired after adjusting the exposure parameters using the AE results, its quality is most likely to be optimal. Therefore, using the third frame of TOF image for face recognition first can further reduce the time consumption.

[0227] S906 and Face TA transmit the storage information of the first TOF image and the storage information of the second TOF image to the face recognition module.

[0228] S907, the facial recognition module obtains the first recognition result and the second recognition result.

[0229] The first recognition result is the result of facial recognition performed on the first TOF image. The second recognition result is the result of facial recognition performed on the second TOF image.

[0230] It is understandable that the order in which the first and second TOF images are used for facial recognition is not limited.

[0231] S908, the facial recognition module transmits the first and second recognition results to Face TA.

[0232] S909. If at least one of the first and second recognition results is approved, Face TA will transmit the approved recognition result to TOF CA.

[0233] S910. If both the first and second recognition results indicate recognition failure, Face TA determines whether the termination condition is met. If yes, execute S911; otherwise, execute again. Figure 8 The process is shown below.

[0234] The definition of the termination condition can be found in the above embodiments. In this step, the duration threshold in the termination condition can be shorter than the duration threshold in the termination condition in the above embodiments because, in this embodiment, multiple frames of TOF data have already been collected and processed. An example of the duration threshold in this step is 3 seconds.

[0235] It should be noted that executing it again... Figure 8 In the illustrated process, "the Nth frame of TOF data" means that N is no longer the sequence of data frames acquired by the TOF camera. N = 1, 2, 3, which refers to the number of frames the processor is executing in this process. Figure 8 The process shown involves the ordering of received TOF data frames. For example, when S801 is executed again, the TOF camera might have acquired the 9th frame of TOF data, but in this execution... Figure 8 In the illustrated process, the processor receives the first frame of TOF data. Therefore, the "first frame of TOF data" mentioned in S801 refers to the data received during this execution. Figure 8 The first frame of TOF data shown in the process is not the first frame of TOF data actually acquired by the TOF camera.

[0236] S911 and Face TA will transmit the recognition results of failed recognitions to TOF CA.

[0237] Understandably, besides Figure 9 In addition to the methods shown, S819 can also be implemented in other ways, such as performing face recognition sequentially using the first, second, and third TOF images, or performing recognition using only the third TOF image. If the recognition result indicates failure, the process can be repeated. Figure 8 The process shown is designed to save resources such as memory. Other implementation methods will not be listed here. The method described in this embodiment is based on the above-mentioned TOF imaging principle (2) TOF data converges after 2-3 frames. 3 frames of TOF data are processed continuously to obtain the recognition result. For outdoor scenes, it can achieve a smaller processing latency than the above embodiment.

[0238] Figure 8 The application scenario of the process shown is as follows:

[0239] Assuming the face attempting to unlock is the same face already registered in the electronic device, the user faces the screen in an outdoor environment. The TOF camera collects TOF data at 30ms intervals and transmits it to the processor. After receiving the first frame of TOF data, the processor processes the received TOF data to generate the first TOF image and the first AE result.

[0240] Because the electronic device is outdoors, it is highly unlikely to be unlocked based on the first frame of TOF data. Therefore, after generating the first TOF image and transmitting the first AE result, the processor will not perform facial recognition but will continue to receive and process TOF data frames. Since the time for generating the TOF image and AE result is 30ms, which is comparable to the time for the TOF camera to acquire and transmit TOF data, after processing the first frame of TOF data, it can continue to receive and process the second frame of TOF data, and after processing the second frame of TOF data, it can continue to receive and process the third frame of TOF data.

[0241] Based on the aforementioned duration, the first AE result generated from the first frame of TOF data can be applied to the third frame of TOF data at the earliest. Therefore, the third frame of TOF data will most likely unlock successfully.

[0242] The shortest time consumed to obtain the recognition result from the third frame of TOF data is 30ms*3+150ms. Compared with the above embodiment, if the first frame of TOF data fails to unlock, the unlocking is changed from the seventh frame to the third frame, which can improve the speed and reduce the latency.

[0243] As can be seen, if the first frame of TOF data can unlock the image, the processing time for two more TOF data points (generating the TOF image and the AE result) is increased by 60ms compared to the above embodiment. Therefore, the data processing method described in this embodiment improves the unlocking speed in outdoor strong light scenes by sacrificing the unlocking speed of the first frame of TOF data.

[0244] Understandably, since the first AE result applies to the third frame of TOF data, it is optional that... Figure 8 In this process, the second frame of TOF data and its AE result can be omitted, i.e., S807-S812 are not executed, to save resources. Correspondingly, the second frame of TOF image is no longer involved in obtaining the recognition result.

[0245] In summary, the second frame of TOF data can be received without processing. Alternatively, the second frame of TOF data can be discarded instead of being received.

[0246] In this embodiment, taking the continuous processing of three frames of TOF data in one process as an example, the number of TOF data frames processed continuously is actually related to the time taken to generate and feed back the AE result, as well as the first time interval of the TOF camera acquiring data frames.

[0247] Based on the scenarios applicable to the above embodiments, it can be understood that the above... Figure 7 or Figure 8 The method described can be used with judgment conditions to select the best option, based on... Figure 3The software framework shown in this application, and another data processing method disclosed in this embodiment, includes the following steps:

[0248] 1. Face CA obtains the intensity value of ambient light.

[0249] based on Figure 3 As shown in the software framework, after receiving a task request, Face CA can also send a light intensity request to obtain the ambient light intensity value. It can be understood that the light intensity request can be sent to the corresponding driver in the kernel layer through the application framework layer and the corresponding module in the hardware abstraction layer. The corresponding driver in the kernel layer then drives the light sensor to sense the ambient light intensity value and feeds it back to Face CA.

[0250] 2. Face CA transmits the ambient light intensity value to Face TA.

[0251] 3. Face TA determines whether the ambient light intensity is greater than a preset first intensity threshold. If so, it executes... Figure 7 The data processing flow shown will be executed if not. Figure 8 The data processing flow is shown below.

[0252] In this embodiment, the intensity value of light is used to determine the environment in which the electronic device is located, and a process more adapted to the environment is used to obtain facial recognition results. Therefore, while improving security, it can also maximize the accuracy and speed of obtaining facial recognition results.

[0253] During their research, the inventors further discovered that, regardless of whether it is an outdoor or indoor scene, when the ambient light is extremely strong and the sensor of the TOF camera is facing a strong light source, the quality of the first frame of TOF data cannot support accurate facial recognition results. Therefore, it is necessary to converge the TOF data to increase the time required for facial recognition.

[0254] For example Figure 1b In this scenario, the user is outdoors in extremely strong sunlight, with their back to the sun. In this situation, the user points their phone's front-facing camera at their face in an attempt to unlock it using facial recognition (assuming the user's face is already stored in the phone as a facial recognition module). Compared to an indoor environment, this process takes significantly longer to unlock.

[0255] This application provides a data acquisition method to address the above problems. The purpose is to acquire higher quality first-frame TOF data, thereby improving the accuracy of the recognition results of the first-frame TOF data while achieving higher security when using TOF data for facial recognition, and further realizing the goal of quickly completing facial recognition.

[0256] Figure 10This application discloses a data acquisition method, which is executed by the aforementioned electronic device, in conjunction with... Figures 2-6 As shown, Figure 10 The process begins with Camera HAL3 driving the TOF camera to acquire data, and includes the following steps:

[0257] S1001 and Camera HAL3 respond to image requests and transmit image output commands to the TOF camera.

[0258] Combination Figure 2 as well as Figure 3 It is understandable that Camera HAL3 can transmit image output commands to the TOF camera through the kernel-level TOF camera driver.

[0259] S1002, the TOF camera responds to the image output command and acquires the first frame of TOF data, including depth data, projection off data, and infrared data.

[0260] Depth data is used to generate depth images. Projection-off data is TOF data acquired by the TOF camera with the TOF light source turned off. Infrared data is used to generate infrared images.

[0261] The depth data and infrared data are both TOF data collected by the TOF camera with the TOF light source turned on.

[0262] When a Time-of-Flight (TOF) camera is powered on, the TOF light source is turned on by default. In some implementations, the TOF sensor controller of the TOF camera transmits an image output command to the TOF sensor. In response to the image output command, the TOF sensor acquires depth data and transmits a shutdown command to the TOF light source controller. The TOF light source controller, in response to the shutdown command, shuts down the TOF light source, and the TOF sensor acquires projection shutdown data. Alternatively, the TOF sensor transmits an on command to the TOF light source controller, which, in response, turns on the TOF light source, and the TOF sensor acquires infrared data.

[0263] In some implementations, an example of the first frame of TOF data is: four sets of depth data, one set of projection-off data, and one set of infrared data. "One set of data" can be understood as a two-dimensional array.

[0264] The TOF sensor first acquires depth data sequentially for a first exposure duration, then acquires infrared data for a second exposure duration, and finally acquires projection shutdown data for either the first or second exposure duration. The first and second exposure durations can be carried in the image output command by the Camera HAL3 or transmitted separately to the TOF camera, or transmitted to the TOF camera by other modules, or pre-obtained by the TOF camera from the storage module.

[0265] It is understandable that the timing of the TOF sensor sending a shutdown command to the TOF light source controller is related to the first exposure duration, and the timing of the TOF sensor sending an activation command to the TOF light source controller is related to the exposure duration for projecting shutdown data.

[0266] In some implementations, the TOF sensor can mark TOF data acquired within a first time range as projection-off data. The first time range can be determined based on the interval between the time the TOF sensor issues a shutdown command and the time it issues an on command. The TOF sensor can mark TOF data acquired before the first time range as depth data and TOF data acquired after the first time range as infrared data.

[0267] It is understood that the order in which the TOF camera acquires depth data, projection shutdown data, and infrared data is not limited. For example, it can acquire data in the order of projection shutdown data, infrared data, and depth data, or it can acquire data in the order of infrared data, depth data, and projection shutdown data. The timing of the TOF sensor transmitting shutdown and startup commands to the TOF light source controller is adjusted according to the order.

[0268] In this step, a TOF sensor is used to control the TOF light source to turn on or off, which has a higher execution speed.

[0269] S1003. After the data processing module obtains the first frame of TOF data, it determines whether the infrared data in the first frame of TOF data contains the target data block. If yes, execute S1004; otherwise, execute S1005.

[0270] The specific method by which the data processing module obtains the first frame of TOF data is as follows: Figure 4 , Figure 5 or Figure 6 As shown, no further details will be provided.

[0271] Infrared data is a two-dimensional array. It can be understood that the two-dimensional array includes some values ​​arranged in rows and columns. Each value can be regarded as a data point. The target data block is a data block that meets the following preset conditions: the number of data points with values ​​greater than the first threshold is greater than the second threshold.

[0272] As mentioned earlier, the infrared data acquired by the TOF sensor is a two-dimensional array. After being processed by ISP-Lite, it becomes raw infrared data, i.e., the raw infrared image. Therefore, it can be understood that the target data block is the target region in the raw infrared image, and each value in the target data block is the brightness value of the corresponding pixel in the target region. Thus, for the raw infrared image, the target region is the region where the number of pixels with brightness values ​​greater than the first threshold is greater than the second threshold.

[0273] When the ambient light is extremely strong and the TOF camera is facing a strong light source, the TOF data acquired by the TOF camera is usually overexposed due to the strong light. Therefore, most of the pixel values ​​in the overexposed areas of the raw infrared image generated by the TOF data are too bright, which affects the recognition. The conditions of the target area (data block) in this step are set based on this principle.

[0274] S1004. Using the infrared data in the first frame of TOF data, subtract the projection off data in the first frame of TOF data to obtain the processed first frame of TOF data, and process the processed first frame of TOF data into a TOF image.

[0275] S1005. Process the first frame of TOF data into a TOF image.

[0276] It is understandable that processing the first frame of TOF data into a TOF image means processing the depth data in the first frame of TOF data into a depth image and the infrared data in the first frame of TOF data into an infrared image.

[0277] The method described in this embodiment improves the quality of the first frame of TOF data by subtracting the projection-off data from the infrared data in the first frame of TOF data when the infrared data is overexposed. This removes the influence of ambient light on the infrared data, thereby improving the quality of the first frame of TOF data and obtaining a higher quality TOF image, which is beneficial to improving the accuracy and speed of face recognition.

[0278] Figure 11 This is yet another data acquisition method disclosed in the embodiments of this application, by... Figure 3 The Camera HAL3 execution shown includes the following steps:

[0279] S1101. In response to an image request, determine whether the interval duration is within a preset range. If yes, execute S1102; otherwise, execute S1103.

[0280] The interval is the time interval between the last time TOF data is collected (referred to as the first moment) and the time when the first frame of TOF data will be collected (referred to as the second moment).

[0281] Understandably, because Camera HAL3 drives the TOF camera to acquire TOF data through the kernel-level TOF camera driver, it can select a second time step based on the time when the image output command is sent to the TOF camera driver. For example, it can add a certain delay to the time when the image output command is sent to the TOF camera driver and use that time step as the second time step. Alternatively, to simplify the process, Camera HAL3 can directly use the system's current time step as the second time step.

[0282] In this embodiment, the first frame of TOF data refers to, for example, Figure 4 , Figure 5 ,or Figure 6 As shown, the application issues a task request, triggering the first frame of TOF data captured by the TOF camera. The last frame can be the last frame of TOF data captured by the TOF camera triggered by the application's previous task request.

[0283] S1102: Instruct the TOF camera to use the exposure parameters used in the last TOF data acquisition to acquire the first frame of TOF data at the second moment.

[0284] As mentioned earlier, since the parameters of the TOF camera can be adjusted using the AE results, the exposure parameters used in the last TOF data acquisition are very likely the adjusted exposure parameters. Furthermore, since the interval between the first and second moments is within the preset range, it is very likely that the last acquisition took place in the same environment. Therefore, the exposure parameters used in the last TOF data acquisition are very likely to be applicable to the current environment as well, which is conducive to obtaining higher quality TOF data and thus to obtaining higher quality TOF images.

[0285] S1103, instructs the TOF camera to acquire the first frame of TOF data using pre-configured exposure parameters.

[0286] If the interval between the first and second moments is long, it means that a long time has passed since the last TOF data acquisition. Therefore, the environment in which the electronic device is located may have changed. As a result, the exposure parameters used in the last TOF data acquisition are no longer applicable to the current environment. Therefore, it is not very meaningful to use the exposure parameters used in the last TOF data acquisition. Instead, the pre-configured exposure parameters should be used.

[0287] The data acquisition method described in this embodiment makes full use of the exposure parameters adjusted by the AE adjustment mechanism to improve the quality of the first frame of TOF data, and further obtain a higher quality TOF image, which is beneficial to improving the accuracy and speed of face recognition.

[0288] It is understandable that the exposure parameters used in the last TOF data acquisition in the above steps are only one implementation method, because the time of the last TOF data acquisition is the latest time from the second time. Therefore, the purpose of comparing it with the last TOF data acquisition is to save computing resources.

[0289] However, in this embodiment, the comparison is not limited to the last TOF data acquisition; any acquisition prior to the second time step can be compared with the second time step. Therefore, the conditions for the first time step can be summarized as: earlier than the second time step and the interval between the two time steps is within a preset range.

[0290] Figure 12 This is yet another data acquisition method disclosed in the embodiments of this application, by... Figure 3 The Camera HAL3 execution shown includes the following steps:

[0291] S1201, In response to an image request, obtain the light intensity.

[0292] In this step, the ambient light sensor on the electronic device can be used to obtain the light intensity of the environment in which the electronic device is located.

[0293] S1202, instructs the TOF camera to use the exposure time corresponding to the light intensity to collect the first frame of TOF data.

[0294] In this embodiment, multiple light intensity ranges and their corresponding exposure times are pre-configured, and the correspondences satisfy the following principles:

[0295] 1. The light intensity range includes the indoor light intensity range and the outdoor light intensity range.

[0296] Pre-configured fixed exposure times may not be suitable for outdoor environments. Therefore, the exposure times used in indoor and outdoor environments will differ. Thus, it is necessary to use light intensity ranges to represent this difference.

[0297] Furthermore, because the intensity of light varies greatly in outdoor environments, it is necessary to further differentiate the exposure parameters used for different light intensity ranges in outdoor environments.

[0298] 2. The larger the value in each light intensity range, the shorter the corresponding exposure time.

[0299] Because a longer exposure time results in a brighter image, in outdoor environments, it is necessary to shorten the exposure time to avoid the problem of excessive image brightness reducing sharpness.

[0300] An example of the correspondence configured based on the above principles is as follows:

[0301] L≤500lux, t=1ms (default fixed value);

[0302] 500lux<L≤3000lux, t=0.7ms;

[0303] 3000lux<L≤30000lux, t=0.5ms;

[0304] L>30000lux, t=0.3ms.

[0305] In the above example, L denotes the light intensity value, t denotes the exposure duration, and L≤500lux is the indoor light intensity interval, that is, a value less than 500lux can be considered as the electronic device being in an indoor environment, in which case the default fixed exposure duration can be used.

[0306] 500lux<L≤3000lux, 3000lux<L≤30000lux, and L>30000lux are intervals further divided for the outdoor environment. It can be seen that among the three intervals, the interval with a larger corresponding value has a shorter exposure duration.

[0307] It can be understood that the granularity of the intensity intervals for the outdoor environment in the above example can be adjusted. A smaller granularity leads to more precise control over the exposure time, which is more conducive to improving image quality, and thus more conducive to increasing the speed of image processing.

[0308] It can be understood that the Camera HAL3 may transmit the exposure duration corresponding to the light intensity to the TOF sensor controller of the TOF camera through the TOF camera driver.

[0309] It can be seen that in this embodiment, the exposure duration for collecting TOF data is obtained based on the light intensity of the environment where the electronic device is located, which is beneficial to collecting TOF data with brightness meeting the face recognition requirement in the first frame, thereby helping to improve the accuracy and speed of face recognition.

[0310] It should be noted that, Figures 7-12 the process shown is not limited to Figure 3 the software framework shown, and may also be applied in Figure 13 the software framework shown.

[0311] Figure 13 there is no TEE provided, that is, both TOF data processing and face recognition are executed in the REE, and specifically, may be executed in the Face CA. Therefore, TOF data can be directly transmitted between various modules, rather than the storage information of TOF data. That is, Figure 13 and Figure 3The difference is that after ISP-Lite receives the TOF data collected by the TOF camera, it transmits the TOF data to Face CA via Camera HAL3 and Camera service. Face CA processes the TOF data into a TOF image and uses the TOF image for facial recognition.

[0312] based on Figure 13 , Figure 7 In the process shown, each step is performed by Face CA: After receiving the first frame of TOF data, Face CA processes the first frame of TOF data into a first frame of TOF image and obtains the first AE result. The first AE result is transmitted to Camera HAL3, and the first frame of TOF image is used for face recognition to obtain the first recognition result. If the first recognition result indicates that the recognition is successful, the first recognition result is transmitted to Face service. If the first recognition result indicates that the recognition is unsuccessful, the seventh frame of TOF data is received again.

[0313] based on Figure 13 , Figure 8 The process shown is executed by Face CA, and will not be described in detail here.

[0314] based on Figure 13 , Figure 10 The process shown can be simplified by replacing the data processing module with Face CA; further details are omitted.

[0315] Figures 11-12 The process shown is applicable to Figure 13 .

[0316] Understandable Figures 7-12 The illustrated process is not limited to the Android operating system. Modules with the same functionality as the data module in other operating systems can implement the steps performed by the data module, and modules with the same functionality as the Camera HAL3 can implement the steps performed by the Camera HAL3.

[0317] Understandable Figure 3 The modules within the illustrated software framework can be split or merged based on their functions to achieve variations. For example, a TOF TA can be added to the TEE to implement the Face TA's function of scheduling data processing modules and transmitting AE results or security identifiers, while Face TA is only used to schedule the face recognition module. Correspondingly, modules such as TOF CA that communicate with TOF TA can be added to the REE, and the data transmission paths within the REE can be adaptively adjusted.

[0318] Figures 7-12The process shown also applies to the modified software framework described above, and the implementation of some functions can be adapted by adjusting the execution module.

[0319] This application also discloses a chip system, including: at least one processor and an interface, wherein the interface is used to receive code instructions and transmit them to at least one processor, and the at least one processor executes the code instructions to implement at least one of the above-mentioned facial recognition method, data acquisition method and data processing method.

[0320] The specific process by which the processor implements the above functions can be found in the above embodiments, and will not be repeated here.

[0321] This application also discloses a computer-readable storage medium storing program code thereon. When the program code is executed by a computer device, it implements at least one of the facial recognition method, data acquisition method, and data processing method described in the above embodiments.

Claims

1. A data processing method, characterized in that, Applied to an electronic device running a Trusted Execution Environment (TEE) and a Generic Execution Environment (REE), the method includes: Acquire TOF data and store the TOF data in the TEE, wherein the TOF data includes multiple safety indication frames; In the TEE, in response to the TOF data being a safety indication frame, a safety identifier is generated based on the human eye safety flag bit in the safety indication frame. The safety identifier is used to indicate whether the TOF light source is safe for the human eye. In the REE, multiple facial recognition frames are acquired based on the safety identifier used to indicate the safety of the TOF light source for the human eye; The facial recognition frame is stored in the TEE with first storage information, and the first storage information is transmitted from the REE to the TEE; In the TEE, based on the first stored information, the first face recognition frame in the multi-frame face recognition frames is processed into a first frame TOF image; In the TEE, the first frame of the TOF image is used for facial recognition to obtain a first recognition result; The first identification result is transmitted from the TEE to the REE.

2. The method according to claim 1, characterized in that, The acquisition of TOF data includes: TOF data is obtained using preset fixed exposure parameters.

3. The method according to any one of claims 1-2, characterized in that, The process is executed serially by a single processor: processing the first frame of facial recognition into a first frame of TOF image, and using the first frame of TOF image for facial recognition to obtain a first recognition result.

4. The method according to any one of claims 1-2, characterized in that, Also includes: Use the first identification result to perform the task.

5. The method according to claim 4, characterized in that, The step of performing the task using the first identification result includes: The first recognition result indicates that the recognition is successful, and the first task is executed.

6. The method according to claim 5, characterized in that, The step of using the first recognition result to perform the task further includes: The first identification result indicates that the identification failed and the preset termination condition is met, and the second task is executed. The termination condition includes the execution time of the task reaching a preset time threshold.

7. The method according to claim 5 or 6, characterized in that, The step of using the first recognition result to perform the task further includes: The first recognition result indicates that the recognition failed and the preset termination condition was not met, and the recognition result of another facial recognition frame is obtained and used to respond to the task.

8. The method according to claim 7, characterized in that, The other facial recognition frame was acquired using exposure parameters adjusted from the first AE result; The method further includes: After acquiring the first facial recognition frame, the first AE result is acquired.

9. The method according to any one of claims 1-2, characterized in that, In the TEE, facial recognition is performed using the first frame of the TOF image to obtain a first recognition result, including: After receiving the storage information of the first frame TOF image through the face trusted application of the TEE, the storage information of the first frame TOF image is transmitted to the face recognition module through the face trusted application. The face recognition module reads the first frame of the TOF image based on the stored information of the first frame of the TOF image. The face recognition module performs face recognition on the first frame of the TOF image to obtain the first recognition result.

10. The method according to claim 9, characterized in that, In the TEE, based on the first stored information, processing the first face recognition frame among the multiple face recognition frames into a first TOF image includes: After receiving the first stored information of the first facial recognition frame through the facial trusted application, the first stored information of the first facial recognition frame is transmitted to the data processing module through the facial trusted application. The data processing module reads the first facial recognition frame based on the first stored information of the first facial recognition frame. The data processing module converts the first facial recognition frame into a first-frame TOF image.

11. The method according to claim 10, characterized in that, Also includes: The data processing module stores the first frame TOF image and transmits the storage information of the first frame TOF image to the facial trusted application.

12. The method according to any one of claims 1-2, characterized in that, The step of using the first frame of the TOF image for facial recognition to obtain a first recognition result includes: After generating the first frame of TOF image through the face application client of the hardware abstraction layer, the first frame of TOF image is used for face recognition to obtain the first recognition result.

13. The method according to claim 12, characterized in that, The step of processing the first face recognition frame into a first TOF image includes: The first facial recognition frame is received by the facial application client, and the first facial recognition frame is processed into a first TOF image.

14. A data processing method, characterized in that, Applied to an electronic device running a Trusted Execution Environment (TEE) and a Generic Execution Environment (REE), the method includes: Acquire TOF data and store the TOF data in the TEE, wherein the TOF data includes multiple safety indication frames; In the TEE, in response to the TOF data being a safety indication frame, a safety identifier is generated based on the human eye safety flag bit in the safety indication frame. The safety identifier is used to indicate whether the TOF light source is safe for the human eye. In the REE, multiple facial recognition frames are acquired based on the safety identifier used to indicate the safety of the TOF light source for the human eye; The facial recognition frame is stored in the TEE with first storage information, and the first storage information is transmitted from the REE to the TEE; In the TEE, based on the first stored information, the first frame of the face recognition frame in the multi-frame face recognition frames is used to obtain the first frame of the TOF image and the first AE result; In the TEE, after acquiring the m-th face recognition frame, the m-th face recognition frame is used to process and obtain the m-th TOF image. The m-th face recognition frame is the earliest face recognition frame acquired based on the first AE result; m is an integer greater than 1. At least the m-th frame of the TOF image is used for facial recognition to obtain the recognition result; The identification result is transmitted from the TEE to the REE.

15. The method according to claim 14, characterized in that, The acquisition of TOF data includes: TOF data is obtained using preset fixed exposure parameters.

16. The method according to claim 14 or 15, characterized in that, The process is executed serially using only one processor: obtaining a first-frame TOF image and a first AE result using the first-frame face recognition frame, obtaining a m-th-frame TOF image using the m-th-frame face recognition frame, and performing face recognition using at least the m-th-frame TOF image to obtain a recognition result.

17. The method according to any one of claims 14-15, characterized in that, Also includes: Use the recognition results to perform tasks.

18. The method according to claim 17, characterized in that, The process of using the recognition results to perform the task includes: The recognition result indicates that the recognition was successful, and the first task can be executed.

19. The method according to claim 18, characterized in that, The step of using the recognition result to perform the task further includes: The recognition result indicates that the recognition failed and the preset termination condition is met, and the second task is executed. The termination condition includes the execution time of the task reaching a preset time threshold.

20. The method according to claim 18, characterized in that, The step of using the recognition result to perform the task further includes: The recognition result indicates that the recognition failed and the preset termination condition was not met. The recognition results of three additional facial recognition frames are then obtained and used to respond to the task.

21. The method according to any one of claims 14-15, characterized in that, The facial recognition process, which uses at least the m-th frame of the TOF image, yields the following recognition results: Face recognition is performed using the m-th frame of the TOF image to obtain the m-th recognition result; The m-th recognition result indicates that the recognition failed. The first frame TOF image is used for facial recognition to obtain the first recognition result.

22. The method according to any one of claims 14-15, characterized in that, The facial recognition process, which uses at least the m-th frame of the TOF image, yields the following recognition results: After receiving the storage information of at least the m-th frame TOF image through the face trusted application of the TEE, the storage information of the at least m-th frame TOF image is transmitted to the face recognition module through the face trusted application, and the storage information includes the first storage information. The facial recognition module reads at least the m-th frame of the TOF image based on the stored information of at least the m-th frame of the TOF image. The facial recognition module performs facial recognition on at least the m-th frame of the TOF image to obtain the recognition result.

23. The method according to claim 22, characterized in that, The process of obtaining the m-th frame TOF image using the m-th frame face recognition frame includes: After receiving the storage information of the m-th facial recognition frame through the facial trusted application, the storage information of the m-th facial recognition frame is transmitted to the data processing module through the facial trusted application. The data processing module reads the m-th facial recognition frame based on the stored information of the m-th facial recognition frame. The data processing module processes the m-th face recognition frame into the m-th TOF image.

24. The method according to claim 23, characterized in that, Also includes: The data processing module stores the m-th frame TOF image and transmits the storage information of the m-th frame TOF image to the facial trusted application.

25. The method according to any one of claims 14-15, characterized in that, The process of using at least the m-th frame of the TOF image for facial recognition to obtain the recognition result includes: The facial application client, through the hardware abstraction layer, performs facial recognition using at least the m-th frame of the TOF image to obtain the recognition result.

26. The method according to claim 25, characterized in that, The process of obtaining the first TOF image and the first AE result using the first facial recognition frame includes: The facial application client receives the first facial recognition frame and processes it into a first TOF image. The process of obtaining the m-th frame TOF image using the m-th frame face recognition frame includes: The face application client receives the m-th face recognition frame and processes it into a m-th TOF image.

27. A data processing method, characterized in that, include: Obtain the intensity value of ambient light; The intensity value of the ambient light is not greater than a preset first intensity threshold, and the data processing method described in any one of claims 1-13 is used; If the intensity value of the ambient light is greater than the first intensity threshold, the data processing method according to any one of claims 14-26 shall be used.

28. An electronic device, characterized in that, include: A TOF camera used to collect TOF data; Memory, used to store program code; A processor for running the program code to implement the data processing method according to any one of claims 1-26.

29. A chip system, characterized in that, include: At least one processor and an interface, the interface being used to receive code instructions and transmit them to the at least one processor; The at least one processor executes the code instructions to implement the data processing method according to any one of claims 1-26.

30. A readable storage medium having a program stored thereon, characterized in that, When the program is read and run by a computing device, the data processing method according to any one of claims 1-26 is implemented.

Citation Information

Patent Citations

  • Screen unlocking method, apparatus and device, and computer readable storage medium

    CN108108686A

  • Face counterfeit detection method and device, computer equipment and storage medium

    CN112232324A