Screen state control method, electronic device and readable storage medium

By combining ultrasonic, acceleration and angular velocity sensors to determine the movement trend and answering gestures of electronic devices, it solves the problem of accidentally turning off the screen under the control of ultrasonic signals and achieves more accurate screen status control.

CN117714593BActive Publication Date: 2024-09-20HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311068853.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-23
Publication Date
2024-09-20
Estimated Expiration
2043-08-23

AI Technical Summary

Technical Problem

In the existing technology, when an electronic device controls the screen to turn on and off through ultrasonic signals, there is a problem of mistakenly controlling the screen to turn off, especially when the back or side is close to a person's face, resulting in abnormal screen turning off.

Method used

Using a method that combines ultrasonic sensors, acceleration sensors and angular velocity sensors, by determining the movement trend of electronic devices and answering gestures, combined with the effectiveness of answering gestures, the screen can be accurately controlled on and off to avoid accidentally turning off the screen.

Benefits of technology

It improves the accuracy of screen status control, avoids the phenomenon of accidentally turning off the screen, and avoids frequent switching of the screen on and off by setting the status duration to prevent screen flickering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117714593B
    Figure CN117714593B
Patent Text Reader

Abstract

The present application discloses a method for controlling the screen state, an electronic device, and a readable storage medium, and belongs to the field of terminal technology. The method includes: when the electronic device is in a call state, when the movement trend of the electronic device is close to a face, if the answering gesture of the electronic device is a close-to-face answering gesture, and the close-to-face answering gesture is valid, then the screen of the electronic device is controlled to turn off. After the screen of the electronic device is turned off, when the movement trend of the electronic device is away from the face, if the answering gesture of the electronic device is a far-from-face answering gesture, and the far-from-face answering gesture is valid, then the screen is controlled to turn on. The present application improves the accuracy of screen state control by determining the movement trend and answering gesture of the electronic device, and combining whether the answering gesture is valid, to determine whether to control the screen to turn off or turn on the screen, and avoids the phenomenon of accidental screen turning off.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a method for controlling screen status, an electronic device, and a readable storage medium. Background Technology

[0002] When using electronic devices such as mobile phones, in some application scenarios, it is often necessary for the device to automatically sense whether it is approaching or moving away from a person's face in order to control whether the screen turns on or off. For example, during a phone call, the screen turns off when the device senses the face approaching and turns on when it senses the face moving away.

[0003] In related technologies, electronic devices typically use ultrasonic signals for sensing. For example, during a phone call, the electronic device can continuously emit ultrasonic signals and receive the echo signals reflected from the face. Then, based on the echo signals, the distance between the face and the electronic device is determined using a sound wave amplitude detection method. In other words, the distance is judged based on the attenuation of the echo signal's amplitude as it travels through the medium, and the screen is then controlled to turn on or off based on this distance.

[0004] However, ultrasonic signals have poor directionality. The ultrasonic signals from electronic devices are generally spherical sound fields, making them detectable regardless of whether the device is approaching or moving away from you. Therefore, when the device approaches from behind or from the side towards your face, it can easily cause the screen to accidentally turn off, resulting in abnormal screen shutdowns. Summary of the Invention

[0005] This application provides a screen state control method, an electronic device, and a readable storage medium, which can solve the problem of accidental control easily caused by controlling the screen solely based on ultrasonic signals in related technologies. The technical solution is as follows:

[0006] Firstly, a method for controlling screen status is provided, applied to an electronic device in a call state, the method comprising:

[0007] If the movement trend of the electronic device is close to a human face, and if the answering gesture of the electronic device is a gesture of answering the call close to a human face, and the gesture of answering the call close to a human face is effective, then the screen of the electronic device is turned off.

[0008] After the electronic device is turned off, if the movement trend of the electronic device is away from the face, and the answering gesture of the electronic device is a gesture of answering the call away from the face, and the gesture of answering the call away from the face is effective, then the screen is controlled to turn on.

[0009] In this way, by determining the movement trend of the electronic device and the answering gesture, and combining whether the answering gesture is effective, it is determined whether to control the screen to turn on or off, which improves the accuracy of screen status control and avoids phenomena such as accidental screen turning off.

[0010] As an example of this application, after the electronic device is turned off, if the movement trend of the electronic device is away from the face, and if the answering gesture of the electronic device is a gesture of answering the call away from the face, and the gesture of answering the call away from the face is valid, then controlling the screen to turn on includes:

[0011] After the electronic device screen is turned off, if the movement trend of the electronic device is away from the face, and if the answering gesture of the electronic device is a gesture of answering the call away from the face, and the gesture of answering the call away from the face is valid, and if the duration of the state is greater than a first duration threshold, then the screen is controlled to turn on. The duration of the state is the duration between the current time point and the last time the screen was controlled to turn off.

[0012] In this way, by setting the duration of the state, you can avoid frequently switching the screen on and off, thereby preventing screen flickering.

[0013] As an example of this application, the electronic device is equipped with an ultrasonic sensor, an acceleration sensor, and an angular velocity sensor; before controlling the screen of the electronic device to turn off, if the electronic device's gesture for answering a call is a gesture for answering a call near a face and the gesture is valid, the method further includes:

[0014] Data is continuously acquired using the ultrasonic sensor, the accelerometer, and the angular velocity sensor, respectively.

[0015] Based on the continuously acquired multiple frames of first ultrasonic signals, it is determined whether the movement trend of the electronic device is approaching the human face;

[0016] If it is determined that the movement trend of the electronic device is approaching the face, after a second time threshold, based on the continuously collected first acceleration data and the continuously collected first angular velocity data, it is determined whether the answering gesture of the electronic device is the approaching face answering gesture.

[0017] If it is determined that the gesture for answering a call on the electronic device is the gesture for answering a call near a face, the validity of the gesture for answering a call near a face is determined based on the multi-frame first angular velocity data.

[0018] In this way, by collecting signals from multiple sensors and determining the movement trend, answering gesture, and validity of the gesture based on these signals, the screen status can be controlled according to the recognition results, thus improving the accuracy of screen status control.

[0019] As an example of this application, each frame of acceleration data collected by the accelerometer includes a first acceleration component, a second acceleration component, and a third acceleration component, wherein the first acceleration component is the acceleration component on the X-axis of the spatial coordinate system of the electronic device, the second acceleration component is the acceleration component on the Y-axis of the spatial coordinate system, and the third acceleration component is the acceleration component on the Z-axis of the spatial coordinate system.

[0020] The step of determining whether the answering gesture of the electronic device is the near-face answering gesture based on continuously acquired multi-frame first acceleration data and continuously acquired multi-frame first angular velocity data includes:

[0021] The acceleration magnitude value corresponding to each frame of first acceleration data is determined by calculating based on the first acceleration component, the second acceleration component, and the third acceleration component included in each frame of first acceleration data in the multi-frame first acceleration data.

[0022] Based on the acceleration modulus value corresponding to the first acceleration data of each frame, target indication information is determined. The target indication information is used to indicate the weightlessness and weightlessness of the electronic device. When the target indication information is a first value, it is used to indicate that the electronic device is first weightless and then weightless. When the target indication information is a second value, it is used to indicate that the electronic device is first weightless and then weightless.

[0023] Based on the target indication information, the multi-frame first acceleration data, and the multi-frame first angular velocity data, determine whether the answering gesture of the electronic device is the approach face answering gesture.

[0024] Thus, by determining the answering gesture of an electronic device based on multiple frames of continuously collected first acceleration data and multiple frames of continuously collected first angular velocity data, the effectiveness and accuracy of answering gesture recognition can be improved.

[0025] As an example of this application, determining the target indication information based on the acceleration magnitude value corresponding to the first acceleration data of each frame includes:

[0026] Based on the acceleration magnitude value corresponding to the first acceleration data of each frame, the waveform is plotted according to the chronological order of the acquisition time of the first acceleration data of each frame to obtain the acceleration magnitude waveform.

[0027] If the acceleration magnitude waveform is a peak-and-valley waveform, and if the peak value of the acceleration magnitude waveform is greater than a first threshold, the valley value of the acceleration magnitude waveform is less than a second threshold, and the time interval between the peak value and the valley value is greater than a third threshold, then the target indication information is determined to be the first value.

[0028] If the acceleration magnitude waveform is a waveform with a trough followed by a peak, and if the peak value is less than the fourth threshold, the trough value is less than the fifth threshold, and the time interval between the peak value and the trough value is greater than the sixth threshold, then the target indication information is determined to be the second value.

[0029] In this way, by determining the target indication information, the changes in weightlessness and hypergravity of the electronic device can be determined, thereby determining the movement of the electronic device. This makes it easier to determine the gesture for answering the call based on the target indication information.

[0030] As an example of this application, each frame of angular velocity data collected by the angular velocity sensor includes a first angular velocity component and a second angular velocity component. The first angular velocity component is the angular velocity component on the X-axis of the spatial coordinate system, and the second angular velocity component is the angular velocity component on the Z-axis of the spatial coordinate system.

[0031] The step of determining whether the answering gesture of the electronic device is the near-face answering gesture based on the target indication information, the multi-frame first acceleration data, and the multi-frame first angular velocity data includes:

[0032] If the electronic device satisfies at least one of the following conditions based on the target indication information, the multi-frame first acceleration data, and the multi-frame first angular velocity data, the answering gesture of the electronic device is determined to be the near-face answering gesture.

[0033] Condition 1: The multi-frame first angular velocity data includes at least a preset number of first angular velocity components, all of which are greater than the seventh threshold.

[0034] Condition 2: The second angular velocity component in the multi-frame first angular velocity data shows a decreasing trend, and the multi-frame first angular velocity data includes at least the preset number of second angular velocity components that are all greater than the eighth threshold; the first acceleration component in the multi-frame first acceleration data shows an increasing trend, and the multi-frame first acceleration data includes at least the preset number of first acceleration components that are all greater than the ninth threshold; and the target indication information is the first value.

[0035] Condition 3: The second angular velocity component in the multi-frame first angular velocity data shows an increasing trend, and at least the preset number of second angular velocity components in the multi-frame first angular velocity data are all less than the tenth threshold; the first acceleration component in the multi-frame first acceleration data shows a decreasing trend, and at least the preset number of first acceleration components in the multi-frame first acceleration data are all less than the eleventh threshold; and the target indication information is the first value.

[0036] Condition 4: The second acceleration component in the multi-frame first acceleration data shows a decreasing trend, and at least the preset number of second acceleration components in the multi-frame first acceleration data are all less than the twelfth threshold, and the target indication information is the second value.

[0037] Thus, by combining the target indication information with multiple frames of first acceleration data and multiple frames of first angular velocity data to determine whether the electronic device's answering gesture is similar to a human face answering gesture, the accuracy of the judgment can be improved.

[0038] As an example of this application, each frame of angular velocity data collected by the angular velocity sensor includes a first angular velocity component and a second angular velocity component. The first angular velocity component is the angular velocity component on the X-axis of the spatial coordinate system, and the second angular velocity component is the angular velocity component on the Z-axis of the spatial coordinate system.

[0039] The step of determining whether the approach-to-face answering gesture is effective based on the multi-frame first angular velocity data includes:

[0040] If the magnitude of the mean of the first angular velocity component in the multi-frame first angular velocity data is greater than the thirteenth threshold, and / or the magnitude of the mean of the second angular velocity component in the multi-frame first angular velocity data is greater than the thirteenth threshold, then the gesture of approaching the face to answer the phone is determined to be valid.

[0041] If the magnitude of the mean of the first angular velocity component in the multi-frame first angular velocity data is less than or equal to the thirteenth threshold, and the magnitude of the mean of the second angular velocity component in the multi-frame first angular velocity data is less than or equal to the thirteenth threshold, then the gesture of approaching the face to answer the phone is determined to be invalid.

[0042] Thus, by determining the modulus of the mean of the first angular velocity components of multiple frames of first angular velocity data, the validity of the answering gesture of the electronic device can be determined based on the modulus of the mean of the first angular velocity data. This facilitates subsequent determination of whether the electronic device is close to a human face based on the recognition results, so as to accurately control the state of the screen.

[0043] As an example of this application, determining whether the motion trend of the electronic device is approaching the human face based on multiple continuously acquired frames of first ultrasonic signals includes:

[0044] The signal characteristics of the effective channel of each frame of the first ultrasonic signal in the multi-frame first ultrasonic signal are determined. The effective channel is determined based on the bandwidth and signal propagation speed of the chirp signal emitted by the ultrasonic sensor and the determination distance threshold.

[0045] Based on the signal characteristics of the effective channel of each frame of the first ultrasonic signal in the multi-frame first ultrasonic signal, it is determined whether the motion trend of the electronic device is approaching the human face.

[0046] Thus, by determining the signal characteristics of the effective channel, the motion trend of the electronic device can be determined to be approaching a face. Since the effective channel is determined based on the bandwidth and propagation speed of the chirp signal and a judgment distance threshold, which is used by the electronic device to identify whether it is approaching or moving away, the signal characteristics of the effective channel that can represent the effective distance within the detection sensing area are selected for analysis. Furthermore, because the signal characteristics are correlated with the amplitude and phase changes of the echo signal, the accuracy of motion trend recognition can be improved.

[0047] As an example of this application, each frame of ultrasonic signal acquired by the ultrasonic sensor includes a chirp signal and an echo signal, wherein the echo signal is the signal reflected by the face after the chirp signal emitted by the electronic device.

[0048] The step of determining the signal characteristics of the effective channel of each frame of the first ultrasonic signal in the multi-frame first ultrasonic signal includes:

[0049] Based on the Chirp signal in the first ultrasonic signal of the target, the echo signal in the first ultrasonic signal of the target is coherently demodulated to obtain the coherent demodulated signal corresponding to the first ultrasonic signal of the target, wherein the first ultrasonic signal of the target is any one frame of the first ultrasonic signal in the multiple frames of the first ultrasonic signal.

[0050] Determine the first Fourier transform result of the coherent demodulated signal corresponding to the first ultrasonic signal of the target;

[0051] Obtain the channel impulse response (CIR) data of the effective channel from the first Fourier transform result to obtain the first CIR data;

[0052] Based on the first CIR data and the second CIR data, the third CIR data is determined. The third CIR data represents the dynamic information of the effective channel at the current moment. The second CIR data is the CIR data of the effective channel in the second Fourier transform result. The second Fourier transform result is the Fourier transform result of the coherent demodulated signal corresponding to the previous frame of the first ultrasonic signal of the target first ultrasonic signal.

[0053] Based on the third CIR data and the fourth CIR data, phase change information is determined. The fourth CIR data is the previously determined data used to represent the dynamic information of the effective channel. The phase change information is used to indicate the rotation direction of the third CIR data relative to the fourth CIR data in the complex plane coordinate system.

[0054] Based on the phase change information and the amplitude corresponding to the third CIR data, the signal characteristics of the effective channel of the target first ultrasonic signal at the current moment are determined.

[0055] Thus, phase analysis is performed on two consecutive frames of CIR data from the effective channel, and the signal characteristics of the effective channel at the current moment are determined based on the analysis results and the amplitude corresponding to the third CIR data, so that the motion trend of the electronic device can be determined based on the signal characteristics.

[0056] As an example of this application, the number of valid channels is multiple;

[0057] The step of determining whether the motion trend of the electronic device is approaching the human face based on the signal characteristics of the effective channel of each frame of the first ultrasonic signal in the multi-frame first ultrasonic signal includes:

[0058] If the sum of signal features of any one of the multiple effective channels is greater than a first feature threshold, the sum of all signal features of the multiple effective channels is greater than a second feature threshold, the number of first signal feature frames corresponding to each of the multiple effective channels is greater than a first frame number threshold, and the number of second signal feature frames corresponding to each of the multiple effective channels is less than a second frame number threshold, then the motion trend of the electronic device is determined to be approaching the face. The first signal feature frame number is the number of signal feature frames in the corresponding effective channel that is greater than a third feature threshold, and the second signal feature frame number is the number of signal feature frames in the corresponding effective channel that is less than a fourth feature threshold.

[0059] If the sum of the signal features of any one of the multiple valid channels is less than a fifth feature threshold, the sum of all the signal features of the multiple valid channels is less than a sixth feature threshold, the number of first signal feature frames corresponding to each of the multiple valid channels is less than a second frame number threshold, and the number of second signal feature frames corresponding to each of the multiple valid channels is greater than the first frame number threshold, then the motion trend of the electronic device is determined to be moving away from the face.

[0060] Thus, by determining the displacement intensity of the target object relative to the electronic device through multi-channel joint analysis, and thereby determining whether displacement has occurred, the accuracy of motion trend judgment can be improved. Furthermore, when making judgments based on the signal characteristics of a single effective channel, the differences between a few signal characteristics and the actual motion trend caused by small jitters or shaking are also considered. This avoids the problem of miscontrolling the screen state in unobstructed shaking scenarios or accidental touch scenarios, thereby improving recognition accuracy.

[0061] As an example of this application, when the movement trend of the electronic device is away from the face, if the answering gesture of the electronic device is a gesture of answering the call away from the face, and the gesture of answering the call away from the face is valid, then before controlling the screen to light up, the method further includes:

[0062] If the movement trend of the electronic device is determined to be away from the face based on the continuously acquired multiple frames of second ultrasonic signals, after a second time threshold, it is determined whether the answering gesture of the electronic device is the gesture of answering the face away from the face based on the continuously acquired multiple frames of second acceleration data and the continuously acquired multiple frames of second angular velocity data.

[0063] If it is determined that the gesture for answering a call on the electronic device is the gesture for answering a call away from the face, the validity of the gesture for answering a call away from the face is determined based on the multi-frame second angular velocity data.

[0064] Thus, if the movement trend of the electronic device is determined to be away from the face based on multiple frames of second ultrasonic signals, after waiting for a period of time, the gesture of answering the call can be determined to be away from the face based on the multiple frames of second acceleration data and multiple frames of second angular velocity data received at this time, which can avoid misjudgment.

[0065] As an example of this application, determining whether the answering gesture of the electronic device is the gesture of answering the call away from the face based on continuously acquired multi-frame second acceleration data and continuously acquired multi-frame second angular velocity data includes:

[0066] Based on the multi-frame second acceleration data, target indication information is determined. The target indication information is used to indicate the weightlessness and weightlessness of the electronic device. When the target indication information is a first value, it is used to indicate that the electronic device first experiences weightlessness and then weightlessness. When the target indication information is a second value, it is used to indicate that the electronic device first experiences weightlessness and then weightlessness.

[0067] Based on the target indication information, the multi-frame second acceleration data, and the multi-frame second angular velocity data, determine whether the answering gesture of the electronic device is the gesture of answering the call away from the face.

[0068] Thus, by determining the target indication information to ascertain the weightlessness or overweight status of the electronic device, and by combining multiple frames of second acceleration data and multiple frames of second angular velocity data to determine whether the electronic device's answering gesture is a gesture away from the face, the accuracy of the judgment can be improved.

[0069] As an example of this application, determining whether the answering gesture of the electronic device is the gesture of answering the call away from the face based on the target indication information, the multi-frame second acceleration data, and the multi-frame second angular velocity data includes:

[0070] If the electronic device satisfies at least one of the following conditions based on the target indication information, the multi-frame second acceleration data, and the multi-frame second angular velocity data, the answering gesture of the electronic device is determined to be the away-from-face answering gesture.

[0071] Condition 5: The multi-frame second angular velocity data includes at least a preset number of first angular velocity components that are all less than the fourteenth threshold. The first angular component is the angular velocity component on the X-axis in the spatial coordinate system of the electronic device.

[0072] Condition 6: The second angular velocity component in the multi-frame second angular velocity data shows an increasing trend, and at least a preset number of second angular velocity components in the multi-frame second angular velocity data are all less than the fifteenth threshold; the first acceleration component in the multi-frame second acceleration data shows a decreasing trend, and at least a preset number of first acceleration components in the multi-frame second acceleration data are all less than the sixteenth threshold; and the target indication information is the second value, where the second angular velocity component is the angular velocity component on the Z-axis of the spatial coordinate system, and the first acceleration component is the acceleration component on the X-axis of the spatial coordinate system.

[0073] Condition 7: The second angular velocity component in the multi-frame second angular velocity data shows a decreasing trend, and at least the preset number of second angular velocity components in the multi-frame second angular velocity data are all greater than the seventeenth threshold; the first acceleration component in the multi-frame second acceleration data shows an increasing trend, and at least the preset number of first acceleration components in the multi-frame second acceleration data are all greater than the eighteenth threshold; and the target indication information is the second value.

[0074] Condition 8: The second acceleration component in the multi-frame second acceleration data shows an increasing trend, and the multi-frame second acceleration data includes at least the preset number of second acceleration components that are all greater than the nineteenth threshold, and the target indication information is the first value, and the second acceleration component is the acceleration component on the Y-axis in the spatial coordinate system;

[0075] Condition 9: The second acceleration component in the multi-frame second acceleration data shows an increasing trend, the third acceleration component in the multi-frame second acceleration data shows an increasing trend, and the magnitude of at least the preset number of second angular velocity components in the multi-frame second angular velocity data is greater than the twentieth threshold. The third acceleration component is the acceleration component on the Z-axis in the spatial coordinate system.

[0076] Thus, by combining target indication information with multiple frames of second acceleration data and multiple frames of second angular velocity data to determine whether the electronic device's answering gesture is a gesture that moves away from the face, the accuracy of the judgment can be improved.

[0077] In a second aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the screen state control method described in the first aspect above.

[0078] Thirdly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform the screen state control method described in the first aspect.

[0079] Fourthly, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to execute the screen state control method described in the first aspect above.

[0080] The technical effects achieved by the second, third, and fourth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0081] Figure 1This is a schematic diagram illustrating an application scenario according to an exemplary embodiment;

[0082] Figure 2 This is a schematic diagram illustrating an application scenario according to another exemplary embodiment;

[0083] Figure 3 This is a schematic diagram illustrating an application scenario according to another exemplary embodiment;

[0084] Figure 4 This is a schematic diagram illustrating a software system of an electronic device according to an exemplary embodiment;

[0085] Figure 5 This is a schematic diagram of a screen state control method according to an exemplary embodiment;

[0086] Figure 6 This is a flowchart illustrating a screen state control method according to an exemplary embodiment;

[0087] Figure 7 This is a schematic diagram of the waveform of an ultrasonic signal according to an exemplary embodiment;

[0088] Figure 8 This is a schematic diagram illustrating the distribution of signal data after a partial FFT, according to an exemplary embodiment.

[0089] Figure 9 This is a schematic diagram illustrating the spatial coordinate system of an electronic device according to an exemplary embodiment;

[0090] Figure 10 This is a schematic diagram illustrating an approach / distance determination according to an exemplary embodiment;

[0091] Figure 11 This is a waveform diagram illustrating the correspondence between overweight and weightlessness according to an exemplary embodiment;

[0092] Figure 12 This is a schematic diagram illustrating the rotation of an electronic device about the X-axis according to an exemplary embodiment;

[0093] Figure 13 This is a waveform diagram of gyro data according to an exemplary embodiment;

[0094] Figure 14 This is a schematic diagram illustrating an application scenario according to another exemplary embodiment;

[0095] Figure 15 This is a schematic diagram illustrating the distribution pattern of a waveform according to an exemplary embodiment;

[0096] Figure 16 This is a schematic diagram illustrating the distribution pattern of a waveform according to another exemplary embodiment;

[0097] Figure 17 This is a schematic diagram illustrating the distribution pattern of a waveform according to another exemplary embodiment;

[0098] Figure 18 This is a schematic diagram illustrating the rotation of an electronic device about the X-axis according to another exemplary embodiment;

[0099] Figure 19 This is a schematic diagram illustrating an application scenario according to another exemplary embodiment;

[0100] Figure 20 This is a schematic diagram illustrating the distribution pattern of a waveform according to another exemplary embodiment;

[0101] Figure 21 This is a schematic diagram illustrating the distribution pattern of a waveform according to another exemplary embodiment;

[0102] Figure 22 This is a schematic diagram illustrating a method for determining a fusion result according to an exemplary embodiment;

[0103] Figure 23 This is a schematic diagram illustrating a method for controlling screen state based on fusion results according to an exemplary embodiment;

[0104] Figure 24 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment. Detailed Implementation

[0105] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0106] It should be understood that "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " indicates "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, to facilitate a clear description of the technical solutions of this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.

[0107] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0108] Before introducing the screen state control method provided in the embodiments of this application, the terms and vocabulary involved in the embodiments of this application will be explained.

[0109] Chirp signal: also known as linear frequency modulated pulse signal, is a type of ultrasonic signal with a range greater than 20kHz. Chirp signals require propagation through a medium and exhibit good directivity, strong penetration, and strong anti-interference capabilities, enabling high-precision ranging over short distances with minimal impact from environmental factors. As an example, and not a limitation, commonly used chirp signal bandwidths include 3.4kHz and 6.8kHz.

[0110] Coherent demodulation refers to the deskewing of echo signals based on chirp signals. Echo signals are the signals reflected from chirp signals by a target object (such as a human face), and are therefore a type of ultrasonic signal. In the computation, the chirp signal and its echo signal are multiplied by their conjugate to obtain the coherently demodulated signal corresponding to the echo signal.

[0111] Unit frequency component: After performing a Fast Fourier Transform (FFT) on an ultrasonic signal (such as a coherent demodulated signal), the Fourier Transform result includes signal data from multiple channels. The signal data in a single channel is the unit frequency component. The number of channels can be customized according to the requirements of the Fast Fourier Transform.

[0112] Effective distance represented by a unit frequency component: In this embodiment, the effective distance represented by the signal data of a single channel within the FFT observation window after performing an FFT on the correlated demodulated signal is determined. This effective distance is related to the bandwidth and propagation speed of the selected chirp signal. The effective distance represented by a unit frequency component within the FFT observation window after Fast Fourier Transform (FFT) is... Where v is the propagation speed of the Chirp signal, which is 340 m / s, and B is the bandwidth of the Chirp signal.

[0113] Chirp signal distance determination principle: When determining distance based on chirp signals, the determination can be made by analyzing the coherent demodulated signal of the echo. Specifically, the signal data after Fast Fourier Transform (FFT) of the coherent demodulated signal is a complex number. When the signal frequency changes, the complex number will rotate in the complex plane. When the signal frequency increases, i.e., the distance increases, the complex number rotates counterclockwise in the complex plane; when the signal frequency decreases, i.e., the distance decreases, the complex number rotates clockwise in the complex plane. Based on this, the cross product of the complex number after coherent demodulation and FFT of two consecutive echo signals can be used to determine whether the target object is approaching or moving away. Specifically, the complex number is represented as a. t +b t j, cross product is (a t ,b t )×(a t+1 ,b t+1 ) = a t b t+1 -a t+1 b t =|a t ,b t ||a t+1 ,b t+1 |sinθ, where θ is the phase difference (or phase angle) between the echo signal x(t) and the echo signal x(t+1). Clearly, when θ is positive, sinθ is positive, meaning the phase angle between the echo signal x(t) and the echo signal x(t+1) increases, and the signal frequency of the echo signal increases, thus indicating an increase in distance. Conversely, when θ is negative, sinθ is negative, meaning the phase angle between the echo signal x(t) and the echo signal x(t+1) decreases, and the signal frequency of the echo signal decreases, thus indicating a decrease in distance.

[0114] Hamming window: It can be used to extract a portion of the ultrasonic signal from a continuous ultrasonic signal. The extracted portion of the ultrasonic signal is used for subsequent processing. For example, it can be used to extract a cycle of chirp signal as a frame of chirp signal transmitted by an electronic device.

[0115] In daily life, when using electronic devices such as mobile phones, users often want the device to automatically sense the approach and distance of a target object in certain application scenarios, such as making or receiving phone calls, and thus automatically control the screen to turn on or off. In some examples, the electronic device uses ultrasonic signals to sense the target object. For instance, when a user is making or receiving a phone call, the phone continuously emits ultrasonic signals. When the user brings the phone close to their face, the phone can sense that the distance between the phone and the face is less than a certain threshold, in which case the phone turns off the screen. When the user moves the phone away from their face, the electronic device can sense that the distance between the electronic device and the face is greater than the threshold, in which case the phone turns on the screen. However, because the sound field of ultrasonic signals is a spherical sound field, meaning that approach and distance from any direction can be detected, this can lead to false screen turning off when the target object is approached from behind or from the side. In other words, ultrasonic signals cannot accurately identify the user's interaction intent. Therefore, this application provides a screen state control method that can accurately identify the user's interaction intent in a call scenario, thereby accurately controlling the screen to turn on or off.

[0116] To facilitate understanding, the following section will use a mobile phone as an example to introduce several exemplary application scenarios involved in the embodiments of this application.

[0117] Please refer to Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario according to an exemplary embodiment. In this application scenario, a user makes and receives phone calls while their upper body is in an upright position (such as standing or sitting). Figure 1 As shown in Figure (a), during a phone call, the phone screen is on until the user brings the phone close to their face. Figure 1 As shown in Figure (b), when a user holds their phone close to their face, if the distance between the phone and the face is less than a certain threshold (e.g., 5cm), and the user maintains the gesture of holding the phone close to their face to answer a call (e.g., placing the phone to their ear), the phone automatically turns off the screen. Please refer to [reference needed]. Figure 1 In Figure (c), when the user moves the phone away from their ear, if the phone detects that the distance between itself and the face exceeds a certain threshold, it automatically turns on the screen after a certain period (e.g., 2 seconds) once it is determined that the user has moved the phone away from their ear and the movement is effective. The threshold can be set according to requirements, and this embodiment does not limit its setting.

[0118] In another example, please refer to Figure 2When a user holds the phone to their ear to make a call, even if the user is running while answering the call, although the phone may occasionally move away from the ear during running, the phone can detect this movement as ineffective, and therefore the screen remains off. This accurately identifies abnormal shaking and prevents accidental screen activation.

[0119] It should be noted that the above application scenarios can be either the user holding the phone with their left hand close to or away from their ear to make a call, or the user holding the phone with their right hand close to or away from their face to make a call. In either case, the method provided in this application embodiment can enable the mobile phone to accurately recognize the user's interaction intent.

[0120] Please refer to Figure 3 , Figure 3 This is a schematic diagram illustrating an application scenario according to another exemplary embodiment. In this application scenario, the user is in a lying position using a mobile phone to make and receive calls, such as... Figure 3 As shown in Figure (a), the phone screen is on before the user brings the phone close to their ear. Figure 3 As shown in Figure (b), when a user holds the phone close to their face, if the distance between the phone and the face is less than or equal to a threshold, and the user maintains the gesture of holding the phone close to their face to answer a call (e.g., placing the phone to their ear), the phone automatically turns off the screen. Similarly, when the user moves the phone away from their ear, if the phone detects that the distance between itself and the face is greater than the threshold, after a certain period (e.g., 2 seconds), and confirming that the user has moved the phone away from their ear and the movement is effective, the phone automatically turns on the screen. In other words, when a user is holding the phone in a lying position to make or receive a call, the phone can also automatically turn the screen off or on when it approaches or moves away from the face.

[0121] It should be noted that the above application scenarios are only examples. In another example, users may make or receive calls in other postures, such as holding the phone while lying on their side. In this case, the phone can still control the screen to turn on or off as it approaches or moves away from the user's face.

[0122] It should also be noted that the above example illustrates how the screen can be automatically turned on or off during a phone call. In another example, when a user makes a voice call through an instant messaging application on their phone, the phone can also automatically detect this and control the screen to turn on or off.

[0123] The above explanation uses a mobile phone as an example of an electronic device. In another example, the electronic device may be other devices with call functionality and screen control requirements. The software system of this electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to illustrate the software system of the electronic device.

[0124] Figure 4 This is a block diagram of a software system for an electronic device provided in an embodiment of this application. See also... Figure 4 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system layer, and the kernel layer.

[0125] in addition, Figure 4 The relationship between the hardware layer and the software system is also illustrated. As an example of this application, the hardware layer includes, but is not limited to, ultrasonic sensors, accelerometers, and gyroscopes. In one example, the ultrasonic sensor includes an ultrasonic transmitter and an ultrasonic receiver. The ultrasonic transmitter is used to transmit chirp signals; for example, the ultrasonic transmitter can be, but is not limited to, a transmitting antenna or an earpiece. The ultrasonic receiver is used to receive the echo signals of the chirp signals; for example, the ultrasonic receiver can be, but is not limited to, a microphone. The gyroscope sensor can be used to determine the angular velocity components around three coordinate axes (i.e., the x, y, and z axes) in the spatial coordinate system of an electronic device. In some embodiments, the gyroscope sensor can be used to determine the motion attitude of the electronic device. The accelerometer can be used to detect the magnitude of the acceleration components in various directions in the spatial coordinate system of the electronic device. When the electronic device is stationary, it can detect the magnitude and direction of gravity. In some examples, the accelerometer can be used to identify the attitude of the electronic device, applied to applications such as screen orientation switching and pedometers. Exemplarily, the accelerometer can be an accelerometer (ACC).

[0126] The application layer can include a series of application packages. For example... Figure 4 As shown, the application package may include applications such as instant messaging, calling, camera, gallery, maps, navigation, WLAN, Bluetooth, music, video, and SMS. Instant messaging applications include those capable of voice and video calls, such as WeChat. TM wait.

[0127] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. As an example in this application, such as... Figure 4 As shown, the application framework layer may include a ranging scene triggering module, a first recognition module, a second recognition module, a third recognition module, an ultrasonic gesture fusion module, and a screen state control module. The ranging scene triggering module monitors whether a ranging scene is triggered, and, if so, triggers the first, second, and third recognition modules. The first recognition module determines the movement trend of the electronic device relative to the face based on ultrasonic signals. The second recognition module determines, based on data collected by the accelerometer and gyroscope sensors, whether the electronic device's answering gesture is an approaching or moving away gesture. An approaching gesture means the user holds the electronic device almost close to their face while answering the call, indicating a very close distance. A moving away gesture means the user holds the electronic device some distance away from their face while answering the call, indicating a less close distance. The third recognition module detects whether the approaching or moving away gesture is valid. The ultrasonic gesture fusion module fuses the recognition results from the first recognition module, the second recognition module, and the third recognition module to determine the approaching, moving away, or holding state of the electronic device during a call. The screen state control module controls the screen state of the electronic device based on the fusion result from the ultrasonic gesture fusion module, such as controlling the screen to turn on or off.

[0128] The Android Runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries consist of two parts: one part contains the functionalities that Java needs to call, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0129] The system library can include multiple functional modules, such as a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. The media libraries support various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing libraries are used for 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.

[0130] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, and sensor drivers. For example, sensor drivers include, but are not limited to, drivers for ultrasonic sensors, accelerometer sensors, and gyroscope sensors.

[0131] exist Figure 4 Based on the electronic device shown, the screen state control method provided in the embodiments of this application will be described next. Please refer to... Figure 5 , Figure 5 This is an architectural diagram illustrating a screen state control method according to an exemplary embodiment. It is an example and not a limitation. When the call application is making a call, it notifies the ranging scene triggering module. The ranging scene touch module triggers the first recognition module, the second recognition module and the third recognition module to perform automatic detection.

[0132] In one example, the first recognition module continuously transmits chirp signals through the earpiece (i.e., ultrasonic transmitter) in the mobile phone and receives the echo signals of the chirp signals through the microphone (i.e., ultrasonic receiver) in the mobile phone. Then, the first recognition module determines the movement trend of the electronic device based on the chirp signals and echo signals, that is, performs face recognition when approaching or moving away from the face, and reports the first recognition result to the ultrasonic gesture fusion module.

[0133] The second recognition module determines the answering gesture of the electronic device based on the acceleration data collected by the accelerometer and the angular velocity data collected by the gyroscope, that is, it performs the recognition of the answering gesture when approaching or moving away from the face, and reports the second recognition result to the ultrasonic gesture fusion module.

[0134] The third recognition module performs gesture validity detection based on the angular velocity data collected by the gyroscope sensor. It also detects whether the gesture of answering the phone near or away from the face is valid, and reports the third recognition result to the ultrasonic gesture fusion module.

[0135] The ultrasound gesture fusion module fuses the first recognition result reported by the first recognition module, the second recognition result reported by the second recognition module, and the third recognition result reported by the third recognition module. For example, please refer to [link to example]. Figure 5 If the first recognition result reported by the first recognition module is that the electronic device is close to the face, and the second recognition result reported by the second recognition module is that the gesture of answering a call is close to the face, the ultrasonic gesture fusion module combines the third recognition result reported by the third recognition module to determine whether the screen-off control conditions are met, and reports the final fusion result to the screen status control module. If the first recognition result reported by the first recognition module is that the electronic device is far away from the face, and the second recognition result reported by the second recognition module is that the gesture of answering a call is far away from the face, the ultrasonic gesture fusion module combines the third recognition result reported by the third recognition module to determine whether the screen-on control conditions are met, and reports the final fusion result to the screen status control module.

[0136] The screen state control module, based on the fusion results reported by the ultrasonic gesture fusion module and combined with the state duration maintenance mechanism, decides whether to control the display to turn on or off. The state duration maintenance mechanism sets the minimum duration for maintaining the screen state, which can be set according to actual needs, such as 5 seconds.

[0137] For ease of understanding, based on the above embodiments, the following will combine... Figure 6 The screen state control method provided in the embodiments of this application will be described in detail. This method may include some or all of the following:

[0138] Step 601: The call application initiates a call.

[0139] In one possible application scenario, such as Figure 1 As shown in Figure (a), when a user makes or receives a call through a calling application on their mobile phone, the calling application initiates a call. In this case, the ranging scenario is triggered, meaning that the screen state of the electronic device needs to be controlled by automatic sensing during the call.

[0140] It should be noted that the embodiments in this application are only illustrated by taking the example of an electronic device initiating a call service through a calling application. In another example, the ranging scenario may also be triggered in other application scenarios, such as when the electronic device makes a voice call through an instant messaging application.

[0141] Step 602: The call application sends a ranging scenario trigger notification to the ranging scenario trigger module. The ranging scenario trigger notification is used to instruct the initiation of a call.

[0142] In order for the phone to automatically perform sensor detection and control the screen state during a call, the calling application can send a ranging scene trigger notification to the ranging scene trigger module after initiating a call, so that the ranging scene trigger module knows that the current ranging scene has been triggered.

[0143] Step 603: The ranging scene triggering module triggers the first recognition module, the second recognition module and the third recognition module.

[0144] That is, after receiving the ranging scene trigger notification, the ranging scene trigger module triggers the first recognition module, the second recognition module and the third recognition module to start running respectively, so that the first recognition module performs approach or distance recognition, the second recognition module performs approach face answering gesture or distance answering gesture recognition, and the third recognition module detects whether the approach face answering gesture or distance answering gesture is valid.

[0145] Step 604: The first identification module continuously and repeatedly transmits the Chirp signal through the earpiece.

[0146] As an example of this application, after the ranging scene triggering module is triggered, the first identification module triggers the earpiece to continuously and repeatedly transmit the Chirp signal. Exemplarily, the signal frequency range of each frame of the Chirp signal is [m, n], that is, the starting frequency is mHz and the ending frequency is nHz, where m is greater than 20kHz, and nm is the bandwidth of the Chirp signal. Since the higher the signal frequency, the more severe the attenuation in the air, the signal frequency usually does not need to be too high.

[0147] In one example, before transmitting the chirp signal, one or more frames of flag bit signals can be transmitted consecutively. This allows for signal alignment during subsequent calculations, determining the signal alignment timing. The flag bit signal can be the chirp signal after timing inversion. For instance, three frames of flag bit signals can be transmitted consecutively, followed by a third time interval (a threshold value) before the chirp signal is transmitted again. The third time interval can be set as needed; for example, it can be T, where T is a value greater than 1.

[0148] It is worth mentioning that by inverting the timing of the Chirp signal, the resulting flag signal is different from the Chirp signal, thus enabling signal alignment at the beginning of signal reception and avoiding misalignment.

[0149] As an example, in implementation, before transmitting each frame of flag bit signal or chirp signal, a Hamming window can be used to smooth each frame of flag bit signal or chirp signal to extract a flag bit signal or chirp signal of length N. That is, the length of each frame of flag bit signal and each frame of chirp signal is N. Thus, smoothing the flag bit signal or chirp signal using a Hamming window can avoid abnormal noise during signal splicing. N can be set according to requirements; for example, N can be 512. For example, as shown... Figure 7 As shown, assuming the unprocessed Chirp signal is as follows: Figure 7 As shown in Figure (a), the Chirp signal after Hamming window processing is as follows: Figure 7 As shown in Figure (b), the flag bit signal after Hamming window processing is as follows: Figure 7 As shown in Figure (c).

[0150] Step 605: The first identification module receives the echo signal of the Chirp signal through the microphone.

[0151] As an example of this application, after the ranging scene triggering module is triggered, the first recognition module triggers the microphone to start receiving signals. The first recognition module performs frame segmentation processing on the received echo signal so that the motion trend of the electronic device can be determined based on the received echo signal and the transmitted chirp signal. As an example and not a limitation, after the first recognition module receives the echo signal through the microphone, it can filter the received echo signal to remove low-frequency information and retain high-frequency information. Then, the filtered echo signal is processed into frames. That is, a full frame is determined whenever a full frame of echo signal of length N is collected, i.e., a frame of echo signal is collected, and then this frame of echo signal is buffered; otherwise, if the frame is not full, signal reception and frame segmentation processing continue.

[0152] In one example, if the first identification module transmits a flag signal via the earpiece before transmitting the chirp signal, then during signal reception, the first signal received is the flag echo signal reflected by the target object. Thus, before receiving the echo signal, the first identification module can perform signal alignment based on the received flag echo signal, and then, starting from the signal alignment time point, after a third time threshold, begin receiving the chirp signal echo signal.

[0153] As an example and not a limitation, during signal alignment, the first identification module determines the similarity between the currently received flag bit echo signal and its corresponding flag bit signal by gradually shifting the signal based on the received flag bit echo signal and its corresponding flag bit signal. Then, it determines the signal alignment time point based on the determined similarity, for example, by determining the time point corresponding to the maximum similarity. Alternatively, other methods can be used to determine the signal alignment time point, which is not limited in this embodiment.

[0154] Step 606: The first recognition module determines whether the movement trend of the electronic device is approaching a human face based on the signal characteristics of the effective channel of each frame of the first ultrasonic signal in the multi-frame first ultrasonic signal.

[0155] For ease of understanding and description, the chirp signal and echo signal collected by the ultrasonic sensor are referred to as ultrasonic signals. That is, each frame of ultrasonic signal collected by the ultrasonic sensor includes chirp signal and echo signal. For ease of distinction, in this embodiment, the ultrasonic signal collected by the ultrasonic sensor before the screen is turned off is referred to as the first ultrasonic signal.

[0156] During the reception of echo signals, the first recognition module can continuously identify motion trends based on the first ultrasonic signal acquired by the ultrasonic sensor. As an example, during each recognition, the first recognition module can acquire multiple frames of echo signals from the continuously received echo signals through a sliding window. The window length and sliding step size can be preset, and can be set as needed. For example, the preset length could be the length of 20 chirp signals, and the preset sliding step size could be the length of 1 chirp signal, allowing the first recognition module to acquire 20 frames of echo signals at a time. Then, based on the acquired multiple echo signals and the corresponding chirp signal for each frame, the first recognition module determines the signal characteristics of the effective channel of each echo signal within the detection sensing area. Subsequently, based on the signal characteristics of the effective channel of each echo signal, it determines whether the motion trend of the electronic device is approaching a face, thus completing one motion trend recognition. The effective channel is determined based on the bandwidth and propagation speed of the chirp signal, as well as a judgment distance threshold.

[0157] The decision distance threshold is used by electronic devices to identify whether an object is approaching or moving away; it is a hard requirement indicating whether an electronic device is approaching or moving away. The decision distance threshold determines the effective decision distance for approaching and moving away from a face, thus constraining the size of the detection sensing area. As an example, and not a limitation, if the decision distance threshold is 5cm, the detection sensing area can be (0cm, 10cm). The effective decision distance for approaching a face is (0cm, 5cm), and the effective decision distance for moving away from a face is (5cm, 10cm). That is, if a target object is within the (0cm, 5cm) range of the detection sensing area, its movement trend can be determined as approaching a face; conversely, if the target object is within the (5cm, 10cm) range of the detection sensing area, its movement trend can be determined as moving away from a face.

[0158] The number of effective channels may be one or more, and is related to the effective distance represented by a unit frequency component of the selected chirp signal and the determination distance threshold. As mentioned earlier, the effective distance represented by a unit frequency component is related to the bandwidth and propagation speed of the chirp signal. That is, the effective distance represented by a unit frequency component differs depending on the bandwidth of the chirp signal used. For example, when using a chirp signal with a bandwidth of 3.4 kHz, the effective distance represented by a unit frequency component is 5 cm; similarly, when using a chirp signal with a bandwidth of 6.8 kHz, the effective distance represented by a unit frequency component is 2.5 cm. Therefore, with the determination distance threshold remaining constant, different bandwidths of the chirp signal result in different effective distances represented by a unit frequency component, thus requiring different channels to be analyzed (i.e., effective channels). See also... Figure 8 , Figure 8This is a schematic diagram illustrating the signal data distribution after Fast Fourier Transform (FFT) according to an exemplary embodiment. Each row corresponds to the signal data of a single channel in different frames, and each column corresponds to the signal data of a single frame. Since the distances represented by each channel after FFT are Nan (first channel), 0~d (second channel), d~2d (third channel), 2d~3d (fourth channel), ..., in one example, when the distance threshold is 5cm, if the effective distance represented by a unit frequency component is 5cm, the effective channels to be analyzed can include (0, 5cm) and (5, 10cm). Since the imaginary part of the first channel is continuously 0, it is not suitable for phase analysis. Therefore, the effective channels at this time include the second and third channels. Channel; if the effective distance represented by a unit frequency component is 2.5cm, then the effective channels to be analyzed can include (0, 2.5cm), (2.5, 5cm), (5, 7.5cm), and (7.5, 10cm), that is, the effective channels include the second, third, fourth, and fifth channels. Alternatively, when the effective distance represented by a unit frequency component is 2.5cm, the effective channels to be analyzed can also include (0, 2.5cm), (2.5, 5cm), and (5, 7.5cm), that is, the effective channels include the second, third, and fourth channels. The specific selection can be made according to actual needs, as long as the selected distance includes the range within 5cm and beyond 5cm.

[0159] Signal characteristics are related to the amplitude and phase change information of the echo signal. In one example, determining the signal characteristics of the effective channel of each echo signal in the multi-frame echo signal within the detection sensing area, based on the acquired multi-frame echo signals and the chirp signal corresponding to each echo signal in the multi-frame echo signals, may include: coherently demodulating the echo signals in the target first ultrasonic signal according to the chirp signal in the target first ultrasonic signal to obtain the coherent demodulated signal corresponding to the target first ultrasonic signal, where the target first ultrasonic signal is any one of the multi-frame first ultrasonic signals. The first Fourier transform result of the coherent demodulated signal corresponding to the target first ultrasonic signal is then determined. The channel impulse response (CIR) data of the effective channel in the first Fourier transform result is obtained to obtain the first CIR data. Based on the first and second CIR data, the third CIR data is determined. The third CIR data represents the dynamic information of the effective channel at the current moment. The second CIR data is the CIR data of the effective channel in the second Fourier transform result. The second Fourier transform result is the Fourier transform result of the coherent demodulated signal corresponding to the previous frame of the first ultrasonic signal of the target first ultrasonic signal. Based on the third and fourth CIR data, phase change information is determined. The fourth CIR data is the data previously determined to represent the dynamic information of the effective channel. The phase change information is used to indicate the rotation direction of the third CIR data relative to the fourth CIR data in the complex plane coordinate system. Based on the phase change information and the amplitude corresponding to the third CIR data, the signal characteristics of the effective channel of the target first ultrasonic signal at the current moment are determined.

[0160] In other words, when performing signal feature analysis based on the target's first ultrasonic signal, the first identification module determines the coherent demodulated signals of the chirp signal and the echo signal within the target's first ultrasonic signal. It then performs a Fast Fourier Transform (FFT) on this coherent demodulated signal to obtain the first FFT result, and performs analysis based on the first FFT result. When the echo signal length is N, the first FFT result is a complex number with N sampling points, each sampling point corresponding to one channel. After the first FFT, the CIR data for each channel is Z. i ={z1,z2,...,z N}, where Z i Let S be the CIR data for the i-th channel, where each element is a complex number representing a different frame. The first identification module acquires the first CIR data of the valid channel and the second CIR data of the valid channel from the second Fourier transform result. The first CIR data is subtracted from the second CIR data to perform static elimination of the valid channel signal, i.e., a first-order difference operation, to obtain the third CIR data representing the dynamic information of the valid channel at the current moment. For example, the third CIR data might be S. i Si =z i -z i-1 =a t +b t j, where z i For the first CIR data, z i-1 This is the second CIR data. It's easy to understand that, for the first ultrasonic signal in the previous frame, the fourth CIR data corresponding to the first ultrasonic signal in the previous frame can also be determined in the same way. In this way, the signal characteristics of the effective channel at the current moment can be determined using the dynamic information of the previous and subsequent frames of the effective channel.

[0161] Specifically, the first identification module performs a conjugate multiplication of the third CIR data and the fourth CIR data. If the result of the conjugate multiplication is positive, the phase change information is positive, for example, a phase change of 1. This indicates that the third CIR data has rotated in the reverse direction relative to the fourth CIR data in the complex plane, indicating an increase in the phase difference, which in turn indicates an increase in the echo signal frequency and thus an increase in distance. If the result of the conjugate multiplication is negative, the phase change information is negative, for example, a phase change of -1. This indicates that the third CIR data has rotated in the forward direction relative to the fourth CIR data in the complex plane, indicating a decrease in the phase difference, which in turn indicates a decrease in the echo signal frequency and thus a decrease in distance.

[0162] Subsequently, the first identification module determines the signal characteristics of the effective channel at the current moment based on the phase change information and the amplitude corresponding to the third CIR data. In one example, its specific implementation may include: determining the amplitude corresponding to the third CIR data, multiplying the phase change information by the amplitude to obtain the signal characteristics of the effective channel at the current moment, for example, the signal characteristics of the effective channel at the current moment are f. Where sign represents phase change information. This represents the amplitude corresponding to the third CIR data. In other words, the signal characteristic is inverted relative to the phase change information; when the phase difference is positive, the signal characteristic is negative, and when the phase difference is negative, the signal characteristic is positive.

[0163] Following the above method, the signal characteristics of the effective channels of each frame of the first ultrasonic signal can be determined, thereby obtaining the signal characteristics of multiple frames of effective channels. When there are multiple effective channels, the signal characteristics of each effective channel in each frame of the first ultrasonic signal can be determined separately according to the above procedure.

[0164] It is worth mentioning that, in determining signal characteristics, this embodiment determines the signal characteristics of the effective channel to be analyzed based on the effective distance represented by a unit frequency component and the judgment distance threshold, avoiding the need to analyze other incoherent signal data. Furthermore, these signal characteristics are related to the amplitude and phase change information of the coherent demodulated signal of the echo signal, allowing for effective analysis within the detection sensing area, thereby improving the reliability of subsequent analysis.

[0165] In one example, when there are multiple effective channels, determining whether the motion trend of an electronic device is approaching a face based on the signal characteristics of the effective channels in each frame of the first ultrasonic signal can be implemented as follows: If the sum of the signal characteristics of any one of the multiple effective channels is greater than a first feature threshold, the sum of all signal characteristics of the multiple effective channels is greater than a second feature threshold, the number of first signal feature frames corresponding to each of the multiple effective channels is greater than a first frame number threshold, and the number of second signal feature frames corresponding to each of the multiple effective channels is less than a second frame number threshold, then the motion trend of the electronic device is determined to be approaching a face. The first signal feature frame number is the number of signal feature frames in the corresponding effective channel that are greater than a third feature threshold, and the second signal feature frame number is the number of signal feature frames in the corresponding effective channel that are less than a fourth feature threshold. If the sum of the signal characteristics of any one of the multiple effective channels is less than a fifth feature threshold, the sum of all signal characteristics of the multiple effective channels is less than a sixth feature threshold, the number of first signal feature frames corresponding to each of the multiple effective channels is less than a second frame number threshold, and the number of second signal feature frames corresponding to each of the multiple effective channels is greater than a first frame number threshold, then the motion trend of the electronic device is determined to be moving away from a face.

[0166] The first, second, third, fourth, fifth, and sixth feature thresholds can be set according to requirements. In one example, the fifth feature threshold is the product of -1 and the first feature threshold, and the sixth feature threshold is the product of -1 and the second feature threshold. Additionally, the first and second frame count thresholds can also be set as needed.

[0167] The sum of signal characteristics of any valid channel includes the sum of all signal characteristics of that valid channel in each frame of the first ultrasonic signal across multiple frames. In other words, it is the sum of the signal characteristics of that valid channel in each frame of the first ultrasonic signal across multiple frames. Adding the sums of the signal characteristics of each valid channel yields the sum of all signal characteristics of multiple valid channels.

[0168] If the sum of signal features from any valid channel is greater than the first feature threshold, and the sum of signal features from multiple valid channels is greater than the second feature threshold, it indicates that the electronic device has a significant displacement relative to the target object. This means the electronic device has undergone continuous displacement relative to the target object. In this case, the displacement can be determined as approaching or moving away based on the first and second signal feature frame counts, thus determining the motion trend. Since the signal features and phase change information are inverted, a positive signal feature indicates approach. Therefore, if the first signal feature frame count is greater than the first frame count threshold (meaning the majority of frames in each valid channel have signal features greater than the third feature threshold), it indicates that more signal features indicate the target object is approaching the electronic device. Furthermore, since there may be minor jitter, shaking, or accidental touches during the approach, a few frames may have signal features less than the fourth feature threshold. Therefore, if the first signal feature frame count is greater than the first frame count threshold and the second signal feature frame count is less than the second frame count threshold, the motion trend of the electronic device can be determined as approaching the face.

[0169] Furthermore, since signal features can be positive or negative, if the sum of signal features from any valid channel is less than the fifth feature threshold, and the sum of signal features from multiple valid channels is less than the sixth feature threshold, it indicates that the displacement intensity of the target object relative to the electronic device is relatively large. This means that the target object has undergone continuous displacement relative to the electronic device. In this case, the displacement can be further determined as approaching or moving away based on the first and second signal feature frame counts to determine the motion trend. Since a negative signal feature indicates moving away, if the second signal feature frame count is greater than the first frame count threshold, it means that more signal features indicate the target object is moving away from the electronic device. Additionally, since there may be minor jitter, shaking, or accidental touches during the moving away process, a few frames may have signal features greater than the third feature threshold. Therefore, if the first signal feature frame count is less than the second frame count threshold, and the second signal feature frame count is greater than the first frame count threshold, it can be determined that the motion trend of the electronic device is moving away from the face.

[0170] In one example, the signal characteristics of each effective channel can be mean-filtered before analysis based on the signal characteristics of multiple effective channels, and then the analysis can be performed based on the mean-filtered signal characteristics of each effective channel.

[0171] For example, taking multiple effective channels including a first channel and a second channel, the number of first ultrasonic signal frames is 20, the first feature threshold is Q1, the second feature threshold is Q2, the third feature threshold is Q3, the fourth feature threshold is Q4, the first frame number threshold is P1, the second frame number threshold is P2, the fifth feature threshold is -1*Q1, and the sixth feature threshold is -1*Q2 as an example. During the analysis, the signal features of 20 frames after mean filtering in the first channel and the signal features of 20 frames after mean filtering in the second channel are obtained respectively. Then, based on the acquired 40 frames of signal features, analysis is performed. Specifically, in one case, if the following conditions 1 and 2 are met, the motion trend of the electronic device is determined to be approaching a human face: where condition 1 is that the sum of the 20 frames of signal features of the first channel or the sum of the 20 frames of signal features of the second channel is greater than Q1, and the sum of the 40 frames of signal features of the first channel and the second channel is greater than Q2; condition 2 is that the number of frames with signal features greater than Q3 in the 20 frames of signal features of the first channel is greater than P1, the number of frames with signal features greater than Q3 in the 20 frames of signal features of the second channel is greater than P1, the number of frames with signal features less than Q4 in the 20 frames of signal features of the first channel is less than P2, and the number of frames with signal features less than Q4 in the 20 frames of signal features of the second channel is less than P2. In another case, if the following conditions 3 and 4 are met, the movement trend of the electronic device is determined to be moving away from the face: Condition 3 is that the sum of the signal features of 20 frames of the first channel or the sum of the signal features of 20 frames of the second channel is less than -1*Q1, and the sum of the signal features of 40 frames of the first channel and the second channel is less than -1*Q2; Condition 4 is that the number of frames with signal features less than Q4 in the 20 frames of the first channel is greater than P1, the number of frames with signal features less than Q4 in the 20 frames of the second channel is greater than P1, the number of frames with signal features greater than Q3 in the 20 frames of the first channel is less than P2, and the number of frames with signal features greater than Q3 in the 20 frames of the second channel is less than P2.

[0172] It is worth mentioning that in the process of determining motion trends based on the signal characteristics of multiple effective channels, the displacement intensity is determined by the sum of the channel characteristics of the effective channels. When the displacement intensity is determined to be large, the displacement is determined to be approaching or moving away based on the continuous signal characteristics of each effective channel. This improves the accuracy of approach or moving away judgment compared to the method of directly judging based on absolute distance. In addition, when judging based on the signal characteristics of a single effective channel, the differences between a few signal characteristics and the actual motion trend caused by small jitters or shaking are also considered. This can avoid the problem of miscontrolling the screen state in non-obstructed shaking scenarios and accidental touch scenarios, improve the recognition accuracy, and thus avoid problems such as abnormal screen shutdown in non-obstructed shaking scenarios and accidental touch scenarios.

[0173] It should be noted that the specific implementation for determining the motion trend of the electronic device described above is optional. In another example, other implementation methods can also be used to determine the motion trend of the electronic device. For instance, if the sum of signal features of any one effective channel is greater than a first feature threshold, and the sum of all signal features of multiple effective channels is greater than a second feature threshold, then if the number of first signal feature frames is greater than a first frame count threshold, the motion trend of the electronic device is determined to be approaching a face. Alternatively, if the sum of signal features of any one effective channel is less than a fifth feature threshold, and the sum of all signal features of multiple effective channels is less than a sixth feature threshold, then if the number of second signal feature frames is greater than a first frame count threshold, the motion trend of the electronic device is determined to be moving away from a face.

[0174] It should also be noted that the above explanation assumes multiple effective channels. In another example, when there is only one effective channel, during motion trend determination, if the sum of the signal features of the effective channels is greater than the first feature threshold, and the number of signal feature frames within the effective channel that are greater than the third feature threshold is greater than the first frame count threshold, and the number of signal feature frames within the effective channel that are less than the fourth feature threshold is less than the second frame count threshold, then the motion trend of the electronic device is determined to be approaching the face. Otherwise, if the sum of the signal features of the effective channels is less than the fifth feature threshold, and the number of signal feature frames within the effective channel that are greater than the third feature threshold is less than the second frame count threshold, and the number of signal feature frames within the effective channel that are greater than the fourth feature threshold is greater than the first frame count threshold, then the motion trend of the electronic device is determined to be moving away from the face.

[0175] Furthermore, if the signal characteristics of multiple effective channels do not meet the above-mentioned conditions for judging whether the electronic device is approaching or moving away from the face, it can be determined that the movement trend of the electronic device is to remain still, that is, the electronic device is neither approaching nor moving away from the face.

[0176] It should be noted that the above description is based on the example of acquiring multiple echo signals during the identification process and then determining the signal characteristics of the effective channel of the Chirp signal corresponding to each echo signal. In another example, during the reception of echo signals, for each received echo signal, the signal characteristics of the effective channel of the Chirp signal corresponding to the currently received echo signal are determined based on the currently received echo signal and the corresponding Chirp signal. Then, during identification, the signal characteristics of the effective channel of the Chirp signal corresponding to each echo signal in the multiple echo signals can be directly acquired for identification. This application does not limit this aspect.

[0177] Step 607: The first recognition module sends the first recognition result to the ultrasonic gesture fusion module.

[0178] In one possible scenario, the first recognition result indicates that the movement trend of the electronic device is towards the face; in another possible scenario, the first recognition result indicates that the movement trend of the electronic device is away from the face; and in yet another possible scenario, the first recognition result indicates that the movement trend of the electronic device is to remain still.

[0179] If the electronic device is still in a call, the first identification module will continue with the next identification operation.

[0180] Step 608: The second identification module continuously collects data through the accelerometer and gyroscope sensors respectively.

[0181] In other words, after the second identification module is triggered by the ranging scene triggering module, it continuously collects data through the accelerometer and gyroscope sensors. In one example, the accelerometer and gyroscope sensors are in an inactive state. In this case, after the second identification module is triggered, it triggers the accelerometer to start collecting data and caches the collected acceleration data, and it triggers the gyroscope to start collecting data and caches the collected angular velocity data.

[0182] In another example, the accelerometer and gyroscope are in the active state. In this case, after the second identification module is triggered, it caches the acceleration data collected by the accelerometer and the angular velocity data collected by the gyroscope.

[0183] Each frame of acceleration data acquired by the accelerometer includes a first acceleration component, a second acceleration component, and a third acceleration component. The first acceleration component is the acceleration component on the X-axis of the electronic device's spatial coordinate system, which can be denoted as accX. The second acceleration component is the acceleration component on the Y-axis of the spatial coordinate system, which can be denoted as accY. The third acceleration component is the acceleration component on the Z-axis of the spatial coordinate system, which can be denoted as accZ. In one example, the spatial coordinate system of the electronic device is as follows: Figure 9 As shown, the X-axis is the coordinate axis along the width of the electronic device's screen, the Y-axis is the coordinate axis along the length of the electronic device's screen, and the Z-axis is the coordinate axis perpendicular to the plane where the electronic device's screen is located.

[0184] Each frame of angular velocity data acquired by an angular velocity sensor (such as a gyroscope sensor) includes a first angular velocity component, a second angular velocity component, and a third angular velocity component. The first angular velocity component is the angular velocity component on the X-axis of the spatial coordinate system, which can be denoted as gyroX. The second angular velocity component is the angular velocity component on the Z-axis of the spatial coordinate system, which can be denoted as gyroZ. The third angular velocity component is the angular velocity component on the Y-axis of the spatial coordinate system, which can be denoted as gyroY.

[0185] Step 609: The second recognition module determines whether the electronic device's answering gesture is similar to a human face answering gesture based on the continuously collected multiple frames of first accelerometer data and the continuously collected multiple frames of first angular velocity data.

[0186] For ease of understanding and description, the acceleration data collected by the accelerometer before the screen is turned off is referred to as the first acceleration data, and the angular velocity data collected by the gyroscope sensor before the screen is turned off is referred to as the first angular velocity data.

[0187] Similarly, after being triggered, the second recognition module continuously performs call-answering gesture recognition while the electronic device is in a call. During each recognition, the second recognition module can retrieve multiple frames of first acceleration data from the cached first acceleration data using a sliding window of preset length and preset step size; for example, retrieving 20 frames of first acceleration data through the sliding window. Similarly, the second recognition module can retrieve multiple frames of first angular velocity data from the cached first angular velocity data using a sliding window of the same size; for example, retrieving 20 frames of first angular velocity data through the sliding window. Then, call-answering gesture recognition is performed based on the retrieved multiple frames of first acceleration and first angular velocity data.

[0188] As an example of this application, please see Figure 10 The specific implementation of determining the answering gesture of an electronic device based on multiple frames of first acceleration sensor data and multiple frames of first angular velocity data may include: calculating the acceleration magnitude corresponding to each frame of first acceleration data based on the first acceleration component, second acceleration component, and third acceleration component included in each frame of first acceleration data; determining target indication information based on the acceleration magnitude corresponding to each frame of first acceleration data; determining target indication information to indicate the weightlessness and weight-loss status of the electronic device; indicating the electronic device experiencing weightlessness first when the target indication information is a first value, and weightlessness second when the target indication information is a second value; and determining whether the answering gesture of the electronic device is similar to a human face answering gesture based on the target indication information, multiple frames of first acceleration data, and multiple frames of first angular velocity data.

[0189] The first and second values ​​can be set according to requirements, for example, the first value is 1 and the second value is -1.

[0190] Normally, acceleration data collected by an accelerometer can determine whether an electronic device is experiencing weightlessness or overweight. However, this only determines an instantaneous state of the electronic device and cannot analyze its movement. In this embodiment, multiple frames of first acceleration data are used to analyze the relationship between weightlessness and overweight during the movement of the electronic device. This allows for subsequent determination of the electronic device's movement based on this relationship. Furthermore, by combining multiple frames of first acceleration data and multiple frames of first angular velocity data, it can be determined whether the gesture used by the electronic device to answer a call is close to or away from a person's face.

[0191] In one example, for any one frame of first acceleration data in multiple frames of first acceleration data, the second identification module can square and sum the first, second, and third acceleration components included in this frame of first acceleration data, and then take the square root of the result to determine the acceleration magnitude corresponding to this frame of first acceleration data, that is, to determine the magnitude of the first, second, and third acceleration components in this frame of first acceleration data. For example, the second identification module can determine the acceleration magnitude corresponding to this frame of first acceleration data based on the first, second, and third acceleration components included in this frame of first acceleration data using the following formula (1):

[0192]

[0193] Here, accNorm represents the acceleration magnitude.

[0194] Following the above method, the acceleration magnitude value corresponding to each frame of first acceleration data in multiple frames can be determined, thus obtaining multiple acceleration magnitude values. Then, as... Figure 10 As shown, the second identification module can determine the target indication information based on the multiple acceleration modulus values, that is, determine the relationship between the overweight and weightlessness of the electronic device.

[0195] In one example, the specific implementation of determining target indication information based on the multiple acceleration magnitude values ​​may include: based on the acceleration magnitude value corresponding to the first acceleration data in each frame, waveforms are plotted according to the chronological order of the acquisition time of the first acceleration data in each frame to obtain acceleration magnitude waveforms. If the acceleration magnitude waveform is a peak-to-valley waveform, and if the peak value of the acceleration magnitude waveform is greater than a first threshold, the valley value is less than a second threshold, and the time interval between the peak and valley values ​​is greater than a third threshold, then the target indication information is determined to be a first value. If the acceleration magnitude waveform is a valley-to-peak waveform, and the peak value is less than a fourth threshold, the valley value is less than a fifth threshold, and the time interval between the peak and valley values ​​is greater than a sixth threshold, then the target indication information is determined to be a second value.

[0196] The first, second, third, fourth, fifth, and sixth thresholds can all be set according to actual needs, and this application embodiment does not limit this. In one example, the first, second, third, fourth, fifth, and sixth thresholds can be denoted as Thd1, Thd2, Thd3, Thd4, Thd5, and Thd6, respectively.

[0197] That is, after determining the acceleration magnitude value corresponding to each frame of the first acceleration data in multiple frames of first acceleration data, waveforms are drawn based on the obtained multiple acceleration magnitude values. Based on the drawn acceleration magnitude value waveforms, the variation law of these multiple acceleration magnitude values ​​is analyzed, thereby determining the target indication information, that is, determining the relationship between the overweight and weightlessness of the electronic device.

[0198] Please refer to Figure 11 , Figure 11 This is a schematic diagram illustrating the waveform distribution of acceleration modulus under different conditions of hypergravity and weightlessness, according to an exemplary embodiment. Figure 11 Figure (a) in the figure is a waveform diagram drawn after processing the acceleration data collected by the accelerometer in the scenario of the electronic device experiencing weightlessness followed by hypergravity. Figure 11 Figure (b) in the diagram is a waveform diagram plotted after processing the acceleration data collected by the accelerometer in a scenario where the electronic device experiences weightlessness followed by weightlessness. For example, when the user is in an upright position, and holds the electronic device close to their ear (i.e., very close to their face) from below, the acceleration data collected by the accelerometer is processed, and the resulting acceleration magnitude is plotted as shown in the diagram. Figure 11 The waveform shown in Figure (a) is as follows. Since, according to the principle of gravitational and weightless states, electronic devices will experience gravitational stress followed by weightlessness in this scenario, therefore... Figure 11 The waveform distribution pattern shown in Figure (a) leads to the conclusion that when the acceleration magnitude waveform is a leading peak followed by a trough, with a peak value greater than Thd1 and a trough value less than Thd2, and the time interval between the peak and trough values ​​greater than Thd3, it can be determined that the electronic device experiences first hypergravity followed by weightlessness. Therefore, the target indication information can be identified as the first value, for example... Figure 10 As shown, this can be recorded as flag = 1. Additionally, when the user is lying flat or on their side, and the user holds the electronic device close to their ear (i.e., very close to their face), the acceleration data collected by the accelerometer is processed, and then the waveform of the calculated acceleration magnitude is plotted to obtain the following result: Figure 11 The waveform shown in Figure (b) illustrates this. Since, according to the principle of weightlessness and hypergravity, electronic devices will experience weightlessness followed by hypergravity in this scenario, therefore... Figure 11The waveform distribution pattern shown in Figure (b) suggests that when the acceleration magnitude waveform exhibits a pattern of initial trough followed by peak, with the peak value less than Thd4, the trough value less than Thd5, and the time interval between the peak and trough values ​​greater than Thd6, the electronic device is in a state of initial weightlessness followed by g-force. This allows us to determine that the target indication information is the second value, for example... Figure 10 As shown, this can be recorded as flag = -1.

[0199] In one possible scenario, if the acceleration magnitude waveform does not satisfy any of the above conditions, that is, it does not satisfy... Figure 11 The distribution pattern shown in Figure (a) does not satisfy... Figure 11 The distribution pattern shown in Figure (b) indicates that the target indication information is the third value. The third value can be set according to requirements, for example... Figure 10 As shown, the third value can be 0, which can be recorded as flag=0. In this case, it means that the electronic device is neither overweight nor weightless.

[0200] After determining the target indication information, the second electronic device, based on the target indication information and combining multiple frames of first acceleration data and multiple frames of first angular velocity data, determines whether the electronic device's answering gesture is similar to a human face answering gesture. As an example of this application, please refer to... Figure 10 The specific judgment process may include the following operations:

[0201] A1. Determine if condition one is met. If condition one is met, then determine that the electronic device's answering gesture is similar to a human face answering gesture. If condition one is not met, perform the following operation A2.

[0202] Condition one is that the first angular velocity data in multiple frames includes at least a preset number of first angular velocity components that are all greater than the seventh threshold. The preset number can be set according to actual needs, for example, the preset number is 15. The seventh threshold can be set according to actual needs, and this application embodiment does not limit it. In some examples, the seventh threshold can be denoted as Thd7.

[0203] In one possible scenario, as the user holds the electronic device close to their face (i.e., very close to the face), the screen of the electronic device rotates clockwise around the X-axis. For example, the screen of the electronic device might rotate in the following direction: Figure 12 As shown, the screen's rotation around the X-axis follows the right-hand rule; that is, when the four fingers of the right hand (excluding the thumb) are clenched into a fist, the direction they point is clockwise, and vice versa. In applications where the electronic device's screen rotates clockwise around the X-axis, the waveform of the angular velocity data collected by the gyroscope sensor is plotted to obtain... Figure 13 The waveform diagram of the near part, in which Figure 13The 131 in the figure represents the variation of the first angular velocity component gyroX. Figure 13 The 132 in the figure represents the variation law of the second angular velocity component gyroY, and Figure 13 The 133 in the figure represents the variation of the third angular velocity component gyroZ. From... Figure 13 It is easy to see that when the screen of an electronic device rotates clockwise around the X-axis and is close to a person's face, most of the first angular velocity components in the angular velocity data collected by the gyroscope sensor are greater than a certain threshold (i.e., the seventh threshold). Therefore, please continue to see... Figure 10 If at least a preset number of first angular velocity components in multiple frames of first angular velocity data are greater than Thd7, that is, if condition one is met, it can be determined that the electronic device's answering gesture is an approaching gesture to answer a call. Otherwise, if condition one is not met, since the electronic device may approach the face from other directions, the second recognition module continues to make a judgment, that is, it performs the following operation A2.

[0204] A2. Determine whether condition two or condition three is met. If condition two or condition three is met, then determine that the electronic device's answering gesture is a gesture that is close to a human face. If neither condition two nor condition three is met, then perform the following operation A3.

[0205] Condition 2 is as follows: the second angular velocity component in the multi-frame first angular velocity data shows a decreasing trend, and the multi-frame first angular velocity data includes at least a preset number of second angular velocity components that are all greater than the eighth threshold; the first acceleration component in the multi-frame first acceleration data shows an increasing trend, and the multi-frame first acceleration data includes at least a preset number of first acceleration components that are all greater than the ninth threshold; and the target indication information is the first value.

[0206] The eighth and ninth thresholds can be set according to requirements, and this application embodiment does not limit them. In some examples, the eighth threshold can be denoted as Thd8, and the ninth threshold can be denoted as Thd9.

[0207] Condition 3 is as follows: the second angular velocity component in the multi-frame first angular velocity data shows an increasing trend, and at least a preset number of second angular velocity components in the multi-frame first angular velocity data are all less than the tenth threshold; the first acceleration component in the multi-frame first acceleration data shows a decreasing trend, and at least a preset number of first acceleration components in the multi-frame first acceleration data are all less than the eleventh threshold; and the target indication information is the first value.

[0208] The tenth and eleventh thresholds can be set according to requirements, and this application embodiment does not limit them. In some examples, the tenth threshold can be denoted as Thd10, and the ninth threshold can be denoted as Thd11.

[0209] In one possible scenario, the user holds the electronic device in their left hand and approaches the left side of the face from the right or left side, for example, by moving the device from the right side of the left ear to the left ear, or by moving in a trajectory such as... Figure 14 As shown in Figure (a), or when the electronic device is held in the left hand and brought closer to the left ear from the left side, the screen of the electronic device rotates around the Z-axis. In this scenario, as the electronic device approaches the face, the waveform of the acceleration data collected by the accelerometer can be plotted to obtain the following result: Figure 15 The waveform diagram of the first half (i.e., the near part) of Figure (a) can be obtained by plotting the waveform of the angular velocity data collected by the gyroscope sensor, as shown below. Figure 15 The waveform diagram in the first half of Figure (b) is shown below, as well as the waveform obtained after processing the acceleration data collected by the accelerometer by calculating the modulus and plotting the waveform. Figure 15 The waveform diagram of the first half of Figure (c) in the diagram. Therefore, according to Figure 15 The distribution pattern of the waveforms shown can be used to deduce: Figure 10 As shown, when gyroZ in the first angular velocity data of multiple frames shows a decreasing trend and most of gyroZ are greater than Thd8, when accX in the first acceleration data of multiple frames shows an increasing trend and most of accX are greater than Thd9, and when flag=1, that is, when the above condition two is met, it can be determined that the user is holding the electronic device with his left hand close to his face, and thus it can be determined that the gesture of answering the call on the electronic device is a gesture of answering the call close to the face.

[0210] In another possible scenario, the user holds the electronic device in their right hand and approaches the right side of their face from the left or right side; that is, the user holds the electronic device in their right hand and approaches the right ear from the left side of the right ear, for example, the movement trajectory is as follows: Figure 14 As shown in Figure (b), or when the electronic device is held in the right hand and brought closer to the right ear from the right side, the screen of the electronic device also rotates around the Z-axis. In this scenario, as the electronic device approaches the face, the waveform of the acceleration data collected by the accelerometer can be plotted to obtain the following result: Figure 16 The waveform of the first half (i.e., the near part) of Figure (a) can be obtained by plotting the waveform of the angular velocity data collected by the gyroscope sensor, as shown below. Figure 16 The waveform diagram in the first half of Figure (b) is shown below, as well as the waveform obtained after processing the acceleration data collected by the accelerometer by calculating the modulus and plotting the waveform. Figure 16 The waveform diagram of the first half of Figure (c) in the diagram. Therefore, according to Figure 16 The distribution pattern of the waveforms shown can be used to deduce: Figure 10As shown, when gyroZ in the first angular velocity data of multiple frames shows an increasing trend and most of gyroZ are less than Thd10, when accX in the first acceleration data of multiple frames shows a decreasing trend and most of accX are less than Thd11, and when flag=1, that is, when the above condition two is met, it can be determined that the user is holding the electronic device with his right hand close to his face, and thus it can be determined that the gesture of answering the call on the electronic device is a gesture of answering the call close to the face.

[0211] Otherwise, if neither condition two nor condition three is met, since the electronic device may approach the face from other directions, the second recognition module will make a further judgment, that is, perform the following operation A3.

[0212] A3: Determine whether condition four is met. If condition four is met, then determine that the electronic device's answering gesture is similar to a human face answering gesture. If condition four is not met, then determine that the electronic device's answering gesture is not similar to a human face answering gesture.

[0213] Condition 4 is: the second acceleration component in the multi-frame first acceleration data shows a decreasing trend, and the multi-frame first acceleration data includes at least a preset number of second acceleration components that are all less than the twelfth threshold, and the target indication information is the second value.

[0214] The twelfth threshold can be set according to actual needs. In some examples, the twelfth threshold can be denoted as Thd12.

[0215] In one possible scenario, the user might be making or receiving calls while lying flat or on their side. When a user is lying flat or on their side, and they pick up the electronic device and place it to their ear to answer the call, with the device close to their face, the waveform of the acceleration data collected by the accelerometer can be plotted to obtain... Figure 17 The waveform diagram in the first half (i.e., the near part) of Figure (a) and the waveform obtained after processing the acceleration data collected by the accelerometer by taking the modulus and plotting the waveform are shown below. Figure 17 The waveform diagram in the first half of figure (b) is shown. Therefore, according to... Figure 17 The distribution pattern of the waveform diagrams shown clearly indicates that when the user is lying flat or on their side, accY decreases as the electronic device approaches the ear, with most accY values ​​being less than Thd12, and flag = -1. Therefore, when condition four is met, it means that the user is holding the electronic device close to their ear while lying flat or on their side, thus confirming that the gesture for answering a call using the electronic device is a gesture that approaches the face.

[0216] It is worth mentioning that following the above order during gesture recognition, prioritizing recognition based on the judgment conditions corresponding to the user's habitual answering gestures, can improve recognition efficiency.

[0217] Of course, the above recognition order is exemplary. In another example, recognition can be performed in other orders. For example, the second recognition module can first determine whether condition two or condition three is met. If conditions two and three are not met, it then determines whether condition one is met. If condition one is not met, it then determines whether condition four is met. In summary, if any one or more of the above conditions are met, the second recognition module can determine that the electronic device's answering gesture is similar to a human face answering gesture. The specific order of judgment is not limited in this embodiment.

[0218] As an example and not a limitation, if any of the above conditions are not met, that is, if it is determined that the electronic device's answering gesture is not a gesture of answering the call close to the face, the second recognition module may continue to determine whether the electronic device's answering gesture is a gesture of answering the call far away from the face.

[0219] As an example of this application, please see Figure 10 The second recognition module's determination of whether the electronic device's answering gesture is a gesture away from the face can include the following steps B1-B4:

[0220] B1: Determine if condition 10 is met. If condition 10 is met, then determine that the electronic device's answering gesture is a gesture that is far away from the face. If condition 10 is not met, then perform the following operation B2.

[0221] Among them, condition ten is: the first angular velocity data of multiple frames includes at least a preset number of first angular velocity components that are all less than the fourteenth threshold.

[0222] The fourteenth threshold can be set according to actual needs. In one example, the fourteenth threshold can be denoted as Thd14.

[0223] In one possible scenario, as the user moves the electronic device away from the face (i.e., just a short distance away), the screen of the electronic device may rotate counterclockwise around the X-axis. For example, the screen might rotate in the following direction: Figure 18 As shown. In this application scenario, the waveform of the angular velocity data collected by the gyroscope sensor can be plotted to obtain... Figure 13 The waveform diagram of the portion furthest from the center. Figure 13As can be seen, when the screen of the electronic device rotates counterclockwise around the X-axis and is far away from the face, most of the gyroX data collected by the gyroscope sensor is less than a certain threshold (i.e., the fourteenth threshold). Therefore, if at least a preset number of first angular velocity components in multiple frames of first angle data are less than the fourteenth threshold, i.e., condition ten is met, it can be determined that the gesture of answering the call from the electronic device is a gesture of answering the call away from the face. Otherwise, if condition ten is not met, since the electronic device may move away from the face in other directions, the second recognition module continues to judge, i.e., performs the following operation B2.

[0224] B2: Determine whether condition eleven or condition twelve is met. If condition eleven or condition twelve is met, then determine that the electronic device's answering gesture is a gesture that is far away from the face. If neither condition eleven nor condition twelve is met, then perform the following operation B3.

[0225] Condition 11 is: the second angular velocity component in the multi-frame first angular velocity data shows an increasing trend, and at least a preset number of second angular velocity components in the multi-frame first angular velocity data are all less than the fifteenth threshold; the first acceleration component in the multi-frame first acceleration data shows a decreasing trend, and at least a preset number of first acceleration components in the multi-frame first acceleration data are all less than the sixteenth threshold; and the target indication information is the second value.

[0226] The fifteenth and sixteenth thresholds can be set according to actual needs. In one example, the fifteenth threshold is Thd15, and the sixteenth threshold is denoted as Thd16.

[0227] Condition 12 is: the second angular velocity component in the multi-frame first angular velocity data shows a decreasing trend, and the multi-frame first angular velocity data includes at least a preset number of second angular velocity components that are all greater than the seventeenth threshold; the first acceleration component in the multi-frame first acceleration data shows an increasing trend, and the multi-frame first acceleration data includes at least a preset number of first acceleration components that are all greater than the eighteenth threshold; and the target indication information is the second value.

[0228] The seventeenth and eighteenth thresholds can be set according to actual needs. In one example, the seventeenth threshold is denoted as Thd17 and the eighteenth threshold is denoted as Thd18.

[0229] Please continue reading Figure 15 The waveform diagram of the latter half (i.e., the part furthest away) of the image. Figure 15 The waveform diagram of the distant portion in Figure (a) is a schematic diagram obtained by plotting the waveform of acceleration data collected by the accelerometer when the user holds the electronic device in their left hand and it is far away from their face. Figure 15The waveform diagram of the distant part in Figure (b) is a schematic diagram of the waveform obtained by plotting the angular velocity data collected by the gyroscope sensor in this scenario. Figure 15 The waveform diagram of the distant portion in Figure (c) is a schematic diagram obtained by processing the acceleration data collected by the accelerometer in this scenario and then plotting the waveform. Therefore, according to Figure 15 The distribution pattern of the waveforms shown can be deduced from: Please refer to... Figure 10 In the first angular velocity data of multiple frames, gyroZ shows an increasing trend and most of gyroZ are less than Thd15. In the first acceleration data of multiple frames, accX shows a decreasing trend and most of accX are less than Thd16. And flag = -1. That is, under the condition of satisfying condition eleven, it can be determined that the user is holding the electronic device with his left hand away from his face. Therefore, it can be determined that the gesture of answering the call on the electronic device is the gesture of answering the call away from the face.

[0230] Please continue reading Figure 16 The waveform diagram of the latter half (i.e., the part furthest away) of the image. Figure 16 The waveform diagram of the distant part in Figure (a) is a schematic diagram obtained by plotting the waveform of acceleration data collected by the accelerometer when the user holds the electronic device in their right hand away from their face. Figure 16 The waveform diagram of the distant part in Figure (b) is a schematic diagram of the waveform obtained by plotting the angular velocity data collected by the gyroscope sensor in this scenario. Figure 16 The waveform diagram of the distant portion in Figure (c) is a schematic diagram obtained by processing the acceleration data collected by the accelerometer in this scenario and then plotting the waveform. Therefore, according to Figure 16 The distribution pattern of the waveforms shown can be deduced as follows: gyroZ in the first angular velocity data of multiple frames shows a decreasing trend and most of gyroZ are greater than a certain threshold (i.e., the seventeenth threshold); accX in the first acceleration data of multiple frames shows an increasing trend and most of accX are greater than the eighteenth threshold; and flag = -1, that is, under the condition of satisfying condition twelve, it can be determined that the user is holding the electronic device with his right hand away from his face, and thus it can be determined that the gesture for answering a call on the electronic device is a gesture for answering a call away from the face.

[0231] Otherwise, if neither condition eleven nor condition twelve is met, the second recognition module will continue to make a judgment, i.e., perform the following operation B3, since the electronic device may move away from the face in other directions.

[0232] B3: Determine if condition thirteen is met. If condition thirteen is met, determine that the electronic device's answering gesture is a gesture that is far away from the face. If condition thirteen is not met, then perform the following operation B4.

[0233] Condition thirteen is: the second acceleration component in the first acceleration data of multiple frames shows an increasing trend, and the first acceleration data of multiple frames includes at least a preset number of second acceleration components that are all greater than the nineteenth threshold, and the target indication information is the first value.

[0234] The nineteenth threshold can be set according to requirements. In one example, the nineteenth threshold can be denoted as Thd19.

[0235] In one possible scenario, the user might be making or receiving calls while lying flat or on their side. Please see [link to relevant documentation]. Figure 17 , Figure 17 The waveform diagram in the latter half (i.e., the part furthest away) of Figure (a) is a schematic diagram obtained by plotting the waveform of acceleration data collected by an accelerometer during the process of a user removing the electronic device from their ear while lying flat or on their side to make a phone call. Figure 17 The waveform diagram in the latter half of Figure (b) is a schematic diagram obtained by processing the modulus of the acceleration data collected by the accelerometer and then plotting the waveform in this scenario. Therefore, according to Figure 17 The distribution pattern of the waveforms shown indicates that when the user is lying flat or on their side, accY increases and exceeds the nineteenth threshold when the electronic device is moved away from the ear, and the electronic device first experiences weightlessness and then weightlessness, i.e., flag = 1. Therefore, when condition thirteen is met, it means that the user moved the electronic device away from the ear while lying flat or on their side, thus confirming that the gesture for answering a call from the electronic device is a gesture away from the face. Otherwise, if condition thirteen is not met, since the electronic device may move away from the face in other directions, the second recognition module continues to judge, i.e., performs the following operation B4.

[0236] B4: Determine whether condition fourteen is met. If condition fourteen is met, then determine that the electronic device's answering gesture is a gesture of answering the call away from the face. If condition fourteen is not met, then determine that the electronic device's answering gesture is not a gesture of answering the call away from the face.

[0237] Condition fourteen is: the second acceleration component in the multi-frame first acceleration data shows an increasing trend, the third acceleration component in the multi-frame first acceleration data shows an increasing trend, and the magnitude of at least a preset number of second angular velocity components in the multi-frame first angular velocity data is greater than the twentieth threshold.

[0238] The twentieth threshold can be set according to requirements. In one example, the twentieth threshold can be denoted as Thd20.

[0239] The magnitude of the second angular velocity component refers to the absolute value of the second angular velocity component, which is a positive number. The magnitudes of other components in the embodiments of this application are similarly determined.

[0240] In one possible scenario, the user might also hold the electronic device horizontally away from their ear, or rather, move it away in a direction perpendicular to their face, for example, in a movement trajectory like... Figure 19 As shown. Please see below. Figure 20 In this scenario, waveform plotting can be performed on the acceleration data collected by the accelerometer to obtain the following... Figure 20 The waveform shown in Figure (a) and the waveform obtained by plotting the angular velocity data collected by the gyroscope sensor are as follows: Figure 20 The waveform shown in Figure (b) is from... Figure 20 It is easy to see that when the electronic device is horizontally away from the ear, the second acceleration component increases, the third acceleration component also increases, and the magnitude of most of the second angular velocity components is greater than Thd20. Therefore, if condition fourteen is satisfied, it can be determined that the electronic device is horizontally away from the face, and thus the gesture for answering the call on the electronic device is a gesture of answering the call away from the face. Otherwise, if condition fourteen is not satisfied, it can be determined that the gesture for answering the call on the electronic device is a gesture of holding the call, that is, the electronic device is neither close to nor far from the face.

[0241] It should be noted that before performing identification processing based on multiple frames of first acceleration data and multiple frames of first angular velocity data, preprocessing such as filtering can be performed on the multiple frames of first acceleration data and multiple frames of first angular velocity data. This application embodiment will not describe this in detail.

[0242] Step 610: The second recognition module sends the second recognition result to the ultrasonic gesture fusion module.

[0243] That is, after the identification in step 609, the second identification module reports the second identification result to the ultrasound gesture fusion module. In one possible case, the second identification result indicates that the electronic device's answering gesture is a gesture close to the face; in another possible case, the second identification result indicates that the electronic device's answering gesture is a gesture away from the face; and in yet another possible case, the second identification result indicates that the electronic device's answering gesture is a gesture of maintaining the answering gesture.

[0244] During implementation, after the second recognition module reports the recognition results to the ultrasonic gesture fusion module, it continues to perform the next round of recognition.

[0245] Step 611: The third recognition module determines whether the gesture of answering a call near a person's face is valid based on the continuously collected multi-frame first angular velocity data.

[0246] In one possible scenario, a user might make or receive a phone call while running or brisk walking. The undulating gait and swaying cause slight vibrations in the electronic device. Consequently, the data collected by the accelerometer and gyroscope might show waveforms indicating proximity or distance. Since ultrasound has a sensitivity of only 5cm, it can also easily produce proximity or distance recognition results. Therefore, controlling the screen state solely based on the first and second recognition results could lead to screen flickering. To address this, the electronic device uses a third recognition module to determine the validity of the answering gesture based on multiple frames of first angular velocity data.

[0247] As an example of this application, the specific implementation of the third recognition module in determining whether a face-approaching phone answering gesture is valid based on continuously acquired multi-frame first angular velocity data may include: determining that the face-approaching phone answering gesture is valid if the magnitude of the average of the first angular velocity components in the multi-frame first angular velocity data is greater than a thirteenth threshold, and / or if the magnitude of the average of the second angular velocity components in the multi-frame first angular velocity data is greater than a thirteenth threshold. Otherwise, determining that the face-approaching phone answering gesture is invalid if the magnitude of the average of the first angular velocity components in the multi-frame first angular velocity data is less than or equal to the thirteenth threshold, and the magnitude of the average of the second angular velocity components in the multi-frame first angular velocity data is less than or equal to the thirteenth threshold.

[0248] The thirteenth threshold can be set according to actual needs, and this application embodiment does not limit it. In one example, the thirteenth threshold can be denoted as Thd13.

[0249] Please see Figure 21 , Figure 21 Figure (a) illustrates the variation of acceleration data (i.e., Acc data) under conditions where the gesture to answer a call near a face is effective and ineffective (e.g., in a running scenario), and... Figure 21 Figure (b) illustrates the changes in gyroX and gyroZ when the gesture for answering a call near a face is effective, and also illustrates the changes in gyroX and gyroZ when the gesture for answering a call near a face is ineffective. Figure 21 From this, we can conclude that when the near-face answering gesture is effective, the modulus of the mean value of gyroZ in the cached multi-frame first angular velocity components is greater than a certain threshold (i.e., the thirteenth threshold), and / or, the modulus of the mean value of gyroX in the cached multi-frame first angular velocity components is greater than the thirteenth threshold. Therefore, in this case, it can be determined that the near-face answering gesture is effective. Furthermore, from... Figure 21It can be concluded that when the gesture to answer a call near the face is invalid, the modulus of the mean value of gyroZ in the first angular velocity component of the cached multi-frame is less than or equal to the thirteenth threshold, and the modulus of the mean value of gyroX is also less than or equal to the thirteenth threshold. Therefore, in this case, it can be determined that the gesture to answer a call near the face is invalid.

[0250] It should be noted that this explanation is based on the example of the answering gesture determined in step 609 being a gesture close to the face. When determining whether an answering gesture away from the face is effective, the above conditions can also be used for judgment.

[0251] It should be noted that there is no strict order of execution between steps 609 and 611. In one example, steps 609 and 611 are executed in parallel.

[0252] Step 612: The second recognition module sends the third recognition result to the ultrasonic gesture fusion module.

[0253] In one possible scenario, the third recognition result is used to indicate that the current proximity gesture is valid; in another possible scenario, the third recognition is used to indicate that the current answering gesture is invalid. The answering gesture could be an approach gesture, a distance gesture, or a holding gesture.

[0254] Step 613: The ultrasound gesture fusion module fuses the first recognition result, the second recognition result, and the third recognition result.

[0255] As an example of this application, since the ultrasonic proximity / distance threshold is 5cm, if the first recognition result reported by the first recognition module indicates that the movement trend of the electronic device is approaching the face, the first recognition result reported by the second recognition module may be a gesture of answering a call away from the face, meaning that the second recognition module has not yet recognized that the electronic device is approaching the face. In this case, if the results are fused, it is easy to lead to misjudgment. Therefore, when performing result fusion, the ultrasonic gesture fusion module can wait for a period of time after receiving the first recognition result reported by the first recognition module, that is, use the second recognition result reported by the second recognition module after a second time threshold has elapsed, and then perform fusion based on the second recognition result, the first recognition result, and the third recognition result.

[0256] The second duration threshold can be set according to requirements. For example, the value range of the second duration threshold can be [1.5, 3] seconds.

[0257] As an example of this application, please refer to Figure 22The specific implementation of fusion can include: if the first recognition result reported by the first recognition module is an approaching motion trend, and after waiting for a second time threshold, the second recognition module reports a second recognition result of an approaching face answering gesture, and the third recognition module reports a third recognition result indicating a valid answering gesture, then the fusion result is determined to be "approaching". If the first recognition result reported by the first recognition module is a moving away from the motion trend, and after waiting for a second time threshold, the second recognition module reports a second recognition result of a moving away from the face answering gesture, and the third recognition module reports a third recognition result indicating a valid answering gesture, then the fusion result is determined to be "moving away". Otherwise, the fusion result is determined to be "maintaining".

[0258] Step 614: The ultrasonic gesture fusion module sends the fusion result to the screen status control module.

[0259] Step 615: The screen status control module controls the screen status of the electronic device based on the fusion result.

[0260] After receiving the fusion results reported by the ultrasonic gesture fusion module, the screen status control module determines whether to control the electronic device's screen to turn on or off. For an example, please refer to... Figure 23 The specific implementation of the screen state control module controlling the screen state of the electronic device based on the fusion result may include: when the fusion result is close or far, determining whether the current fusion result is the same as the previous fusion result; if they are different, determining whether the duration of the state has reached a first duration threshold; if the duration of the state has reached the first duration threshold, switching the screen state to the state corresponding to the fusion result; otherwise, if the duration of the state has not reached the first duration threshold, maintaining the screen state. If the current fusion result is the same as the previous fusion result, maintaining the screen state.

[0261] The duration of a state is the time interval between the point in time when the previous fusion result differed from the current fusion result and the current point in time. The first duration threshold, also known as the minimum duration mentioned earlier, can be set according to requirements; for example, the first duration threshold can be 5 seconds or 10 seconds.

[0262] For example, assuming the first duration threshold is 10 seconds, if the current fusion result is "close" and the previous fusion result was "far," and the screen was switched from off to on based on the previous fusion result. If the state duration is 5 seconds, the screen remains off, and the state duration is continuously counted; if the state duration is 12 seconds, the screen is switched from on to off, and the state duration is recounted.

[0263] Of course, if the fusion result is to maintain, the electronic device will continue to maintain the previous screen state. For example, if the previous screen state was on and the fusion result is to maintain, the screen of the electronic device will continue to be on.

[0264] It is worth mentioning that by setting a state duration maintenance mechanism, frequent switching of screen states can be avoided, thereby avoiding problems such as frequent screen flickering that consumes more power in electronic devices.

[0265] It should be noted that the above-described specific implementation of controlling the screen state of electronic devices based on the fusion result is only an example. In another example, the screen state control module can also directly control the screen state based on the fusion result. For example, if the fusion result is close, the screen is turned off; if the fusion result is far away, the screen is turned on; and if the fusion result is keep, the screen state is kept.

[0266] When the electronic device is in a screen-off state, if the movement of the electronic device is away from the face and the gesture for answering a call is also away from the face, and if the gesture for answering a call is effective, then the screen will be turned on.

[0267] In other words, after the electronic device enters the screen-off state, it continues to collect data through the ultrasonic sensor, accelerometer, and gyroscope sensor, respectively. For ease of understanding and description, the ultrasonic signal collected by the ultrasonic sensor after the screen is off will be referred to as the second ultrasonic signal, the acceleration data collected by the accelerometer sensor after the screen is off will be referred to as the second acceleration data, and the angular velocity data collected by the gyroscope sensor after the screen is off will be referred to as the second angular velocity data.

[0268] During data acquisition, the first recognition module continues to identify the movement trend of the electronic device based on multiple frames of continuously acquired second ultrasonic signals. The second recognition module continues to identify the answering gesture of the electronic device based on multiple frames of continuously acquired second acceleration data and multiple frames of second angular velocity data. The third recognition module continues to determine the validity of the answering gesture based on multiple frames of second angular velocity data. Then, the ultrasonic posture recognition module fuses the recognition results reported by the first, second, and third recognition modules to determine whether the electronic device is moving away from the face, and then continues to control the state of the screen.

[0269] In one example, determining whether an electronic device's answering gesture is a gesture away from a face, based on continuously acquired multi-frame second acceleration data and multi-frame second angular velocity data, may include: determining target indication information based on the multi-frame second acceleration data; and determining whether the electronic device's answering gesture is a gesture away from a face based on the target indication information, the multi-frame second acceleration data, and the multi-frame second angular velocity data. Specifically, if the electronic device satisfies at least one of the following conditions based on the target indication information, the multi-frame second acceleration data, and the multi-frame second angular velocity data, then the electronic device's answering gesture is determined to be a gesture away from a face:

[0270] Condition 5: The second angular velocity data in multiple frames includes at least a preset number of first angular velocity components, all of which are less than the fourteenth threshold.

[0271] Condition 6: The second angular velocity component in the multi-frame second angular velocity data shows an increasing trend, and at least a preset number of second angular velocity components in the multi-frame second angular velocity data are all less than the fifteenth threshold; the first acceleration component in the multi-frame second acceleration data shows a decreasing trend, and at least a preset number of first acceleration components in the multi-frame second acceleration data are all less than the sixteenth threshold; and the target indication information is the second value.

[0272] Condition 7: The second angular velocity components in the multi-frame second angular velocity data show a decreasing trend, and at least a preset number of second angular velocity components in the multi-frame second angular velocity data are greater than the seventeenth threshold; the first acceleration components in the multi-frame second acceleration data show an increasing trend, and at least a preset number of first acceleration components in the multi-frame second acceleration data are greater than the eighteenth threshold; and the target indication information is the second value.

[0273] Condition 8: The second acceleration components in the multi-frame second acceleration data show an increasing trend, and the multi-frame second acceleration data includes at least a preset number of second acceleration components that are all greater than the nineteenth threshold, and the target indication information is the first value.

[0274] Condition 9: The second acceleration component in the multi-frame second acceleration data shows an increasing trend, the third acceleration component in the multi-frame second acceleration data shows an increasing trend, and the magnitude of at least a preset number of second angular velocity components in the multi-frame second angular velocity data is greater than the twentieth threshold.

[0275] The specific process for determining distance can be found in steps B1-B4 above, and will not be repeated here.

[0276] Additionally, if the fusion result is determined to be far apart, the screen brightness can be controlled through the set state duration maintenance mechanism, as detailed above.

[0277] It should be noted that the multiple thresholds involved in the embodiments of this application may be partially the same or all different, and the embodiments of this application do not limit this.

[0278] In this embodiment, when the electronic device is in a call state, if the device's movement trend is towards a face, and the answering gesture is a gesture towards the face that is effective, then the screen of the electronic device is turned off. Then, if the device's movement trend is away from the face, and the answering gesture is a gesture away from the face that is effective, then the screen is turned on. Thus, by determining the movement trend and answering gesture of the electronic device, and combining this with the effectiveness of the answering gesture, the determination of whether to turn the screen off or on improves the accuracy of screen state control and avoids accidental screen off.

[0279] Please see Figure 24 , Figure 24 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0280] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 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.

[0281] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0282] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0283] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

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

[0285] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0286] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via a USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device 100 via the power management module 141.

[0287] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0288] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

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

[0290] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is an integer greater than 1.

[0291] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0292] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions, such as saving music, video, and other files on the external memory card.

[0293] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created by electronic device 100 during use (such as audio data, phonebook, etc.). Furthermore, internal memory 121 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.

[0294] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D and application processor.

[0295] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0296] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify sound sources, and perform directional recording, etc. As an example of this application, microphone 170C can function as a signal receiver, used to receive the echo signal of the original chirp signal reflected by the target object, or to receive the echo signal of the flag bit signal reflected by the target object.

[0297] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0298] The accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in various directions (generally three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. The accelerometer 180E can also be used to identify the attitude of electronic device 100, and can be applied to applications such as screen orientation switching and pedometers.

[0299] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).

[0300] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.

Claims

1. A method for controlling a screen state, characterized in that: Applied to an electronic device, the electronic device is in a call state, and the method includes: In the case where the movement trend of the electronic device is close to a human face, if the answering gesture of the electronic device is a close-to-face answering gesture, and the close-to-face answering gesture is valid, controlling the screen of the electronic device to turn off; After the screen of the electronic device is turned off, when the movement trend of the electronic device is away from the face, if the answering gesture of the electronic device is an answering gesture away from the face, and the answering gesture away from the face is valid, the screen is controlled to light up.

2. The method according to claim 1, characterized in that After the screen of the electronic device is turned off, when the movement trend of the electronic device is to move away from the face of the person, if the answering gesture of the electronic device is a gesture of answering the call away from the face of the person, and the gesture of answering the call away from the face of the person is valid, controlling the screen to turn on the screen, including: After the screen of the electronic device is turned off, when the movement trend of the electronic device is away from the face, if the answering gesture of the electronic device is an answering gesture away from the face, and the answering gesture away from the face is valid, if the state continues for a duration greater than a first duration threshold, the screen is controlled to light up, wherein the state continues for a duration that is the duration between the current time point and the time point when the screen was last controlled to be turned off.

3. The method according to claim 1 or 2, characterized in that The electronic device is equipped with an ultrasonic sensor, an acceleration sensor and an angular velocity sensor; In the case where the movement trend of the electronic device is close to a human face, if the answering gesture of the electronic device is a close-to-face answering gesture, and the close-to-face answering gesture is valid, before controlling the screen of the electronic device to turn off, the method further includes: Continuously collecting data through the ultrasonic sensor, the acceleration sensor and the angular velocity sensor respectively; determining, based on the continuously collected multiple frames of first ultrasonic signals, whether the movement trend of the electronic device is approaching the human face; In the case where it is determined that the movement trend of the electronic device is close to the human face, after a second time threshold, determining whether the answering gesture of the electronic device is the answering gesture close to the human face according to the continuously collected multiple frames of first acceleration data and the continuously collected multiple frames of first angular velocity data; In the case where it is determined that the answering gesture of the electronic device is the close-to-face answering gesture, it is determined whether the close-to-face answering gesture is valid according to the multiple frames of first angular velocity data.

4. The method according to claim 3, characterized in that Each frame of acceleration data collected by the acceleration sensor includes a first acceleration component, a second acceleration component and a third acceleration component, wherein the first acceleration component is the acceleration component on the X-axis in the spatial coordinate system of the electronic device, the second acceleration component is the acceleration component on the Y-axis in the spatial coordinate system, and the third acceleration component is the acceleration component on the Z-axis in the spatial coordinate system; The determining, based on the continuously collected multiple frames of first acceleration data and the continuously collected multiple frames of first angular velocity data, whether the answering gesture of the electronic device is the close-to-face answering gesture includes: Calculating based on the first acceleration component, the second acceleration component and the third acceleration component included in each frame of the first acceleration data in the multiple frames of the first acceleration data, respectively, to determine the acceleration modulus value corresponding to each frame of the first acceleration data; Determine target indication information based on the acceleration modulus corresponding to each frame of the first acceleration data, the target indication information being used to indicate the overweight and weightlessness of the electronic device, and when the target indication information is a first value, it is used to indicate that the electronic device is first overweight and then weightless, and when the target indication information is a second value, it is used to indicate that the electronic device is first weightless and then overweight; Determine whether the answering gesture of the electronic device is the close-to-face answering gesture according to the target indication information, the multiple frames of first acceleration data, and the multiple frames of first angular velocity data.

5. The method according to claim 4, characterized in that The determining the target indication information based on the acceleration modulus value corresponding to each frame of the first acceleration data includes: Based on the acceleration modulus value corresponding to each frame of the first acceleration data, waveform drawing is performed in the order of the acquisition time of each frame of the first acceleration data to obtain an acceleration modulus value waveform; In the case where the acceleration modulus waveform is a waveform with a peak first and a valley later, if the peak value of the acceleration modulus waveform is greater than a first threshold, the valley value of the acceleration modulus waveform is less than a second threshold, and the time interval between the peak value and the valley value is greater than a third threshold, then determining that the target indication information is the first value; When the acceleration modulus waveform is a waveform with a valley first and a peak later, if the peak value is less than the fourth threshold, the valley value is less than the fifth threshold, and the time interval between the peak value and the valley value is greater than the sixth threshold, then the target indication information is determined to be the second value.

6. The method according to claim 4 or 5, characterized in that Each frame of angular velocity data collected by the angular velocity sensor includes a first angular velocity component and a second angular velocity component, the first angular velocity component is an angular velocity component on an X-axis in the spatial coordinate system, and the second angular velocity component is an angular velocity component on a Z-axis in the spatial coordinate system; The determining, according to the target indication information, the multiple frames of first acceleration data, and the multiple frames of first angular velocity data, whether the answering gesture of the electronic device is the close-to-face answering gesture includes: In a case where it is determined that the electronic device satisfies at least one of the following conditions according to the target indication information, the multiple frames of first acceleration data, and the multiple frames of first angular velocity data, determining that the answering gesture of the electronic device is the close-to-face answering gesture; Condition 1: the multiple frames of first angular velocity data include at least a preset number of first angular velocity components that are greater than a seventh threshold; Condition 2: the second angular velocity component in the multiple frames of first angular velocity data shows a decreasing trend, and at least the preset number of second angular velocity components in the multiple frames of first angular velocity data are all greater than the eighth threshold, and the first acceleration component in the multiple frames of first acceleration data shows an increasing trend, and at least the preset number of first acceleration components in the multiple frames of first acceleration data are all greater than the ninth threshold, and the target indication information is the first value; Condition three: the second angular velocity component in the multiple frames of first angular velocity data shows an increasing trend, and at least the preset number of second angular velocity components in the multiple frames of first angular velocity data are all smaller than the tenth threshold value, and the first acceleration component in the multiple frames of first acceleration data shows a decreasing trend, and at least the preset number of first acceleration components in the multiple frames of first acceleration data are all smaller than the eleventh threshold value, and the target indication information is the first value; Condition four: the second acceleration component in the multiple frames of first acceleration data shows a decreasing trend, and at least the preset number of second acceleration components in the multiple frames of first acceleration data are all smaller than the twelfth threshold, and the target indication information is the second value.

7. The method according to claim 3, characterized in that Each frame of angular velocity data collected by the angular velocity sensor includes a first angular velocity component and a second angular velocity component, the first angular velocity component is an angular velocity component on an X-axis in a spatial coordinate system of the electronic device, and the second angular velocity component is an angular velocity component on a Z-axis in the spatial coordinate system; The determining whether the face approaching answering gesture is valid according to the multiple frames of first angular velocity data includes: When the modulus of the mean value of the first angular velocity component in the multiple frames of first angular velocity data is greater than the thirteenth threshold value, and / or the modulus of the mean value of the second angular velocity component in the multiple frames of first angular velocity data is greater than the thirteenth threshold value, it is determined that the approaching face answering gesture is valid; When the modulus of the mean of the first angular velocity component in the multiple frames of first angular velocity data is less than or equal to the thirteenth threshold, and the modulus of the mean of the second angular velocity component in the multiple frames of first angular velocity data is less than or equal to the thirteenth threshold, it is determined that the approaching face answering gesture is invalid.

8. The method according to claim 3, characterized in that The determining, based on the continuously collected multiple frames of first ultrasonic signals, whether the movement trend of the electronic device is approaching the human face includes: Determine a signal characteristic of an effective channel of each frame of the first ultrasonic signal in the plurality of frames of the first ultrasonic signal, wherein the effective channel is determined based on a bandwidth and a signal propagation speed of a Chirp signal emitted by the ultrasonic sensor, and a distance determination threshold; It is determined whether the movement trend of the electronic device is approaching the human face according to the signal characteristics of the effective channel of each frame of the first ultrasonic signal in the multiple frames of the first ultrasonic signal.

9. The method according to claim 8, characterized in that Each frame of ultrasonic signal collected by the ultrasonic sensor includes a chirp signal and an echo signal, wherein the echo signal is a signal of the chirp signal emitted by the electronic device reflected by the face of the person; The determining of the signal characteristics of the effective channel of each frame of the first ultrasonic signal in the multiple frames of the first ultrasonic signal comprises: coherently demodulate the echo signal in the target first ultrasonic signal according to the Chirp signal in the target first ultrasonic signal to obtain a coherent demodulation signal corresponding to the target first ultrasonic signal, wherein the target first ultrasonic signal is any frame of the first ultrasonic signal in the multiple frames of the first ultrasonic signal; Determine a first Fourier transform result of a coherent demodulation signal corresponding to the target first ultrasonic signal; Acquire channel impulse response CIR data of the effective channel in the first Fourier transform result to obtain first CIR data; Determine third CIR data based on the first CIR data and the second CIR data, wherein the third CIR data represents dynamic information of the effective channel at the current moment, the second CIR data is the CIR data of the effective channel in the second Fourier transform result, and the second Fourier transform result is the Fourier transform result of the coherent demodulation signal corresponding to the first ultrasonic signal of the previous frame of the target first ultrasonic signal; Determine phase change information based on the third CIR data and the fourth CIR data, wherein the fourth CIR data is data determined last time and used to represent dynamic information of a valid channel, and the phase change information is used to indicate a rotation direction of the third CIR data relative to the fourth CIR data in a complex plane coordinate system; Based on the phase change information and the amplitude corresponding to the third CIR data, the signal characteristics of the effective channel of the target first ultrasonic signal at the current moment are determined.

10. The method according to claim 8 or 9, characterized in that The number of valid channels is multiple; The determining, based on the signal characteristics of the effective channel of each frame of the first ultrasonic signal in the multiple frames of the first ultrasonic signal, whether the movement trend of the electronic device is approaching the human face includes: In the case where the sum of the signal features of any one of the multiple valid channels is greater than the first feature threshold, the sum of all the signal features of the multiple valid channels is greater than the second feature threshold, the number of first signal feature frames corresponding to each of the multiple valid channels is greater than the first frame number threshold, and the number of second signal feature frames corresponding to each of the multiple valid channels is less than the second frame number threshold, it is determined that the movement trend of the electronic device is approaching the face, the first signal feature frame number is the number of signal feature frames in the corresponding valid channel that is greater than the third feature threshold, and the second signal feature frame number is the number of signal feature frames in the corresponding valid channel that is less than the fourth feature threshold; When the sum of the signal characteristics of any one of the multiple valid channels is less than the fifth characteristic threshold, the sum of all signal characteristics of the multiple valid channels is less than the sixth characteristic threshold, the number of first signal feature frames corresponding to each of the multiple valid channels is less than the second frame number threshold, and the number of second signal feature frames corresponding to each of the multiple valid channels is greater than the first frame number threshold, it is determined that the movement trend of the electronic device is away from the face.

11. The method according to any one of claims 1, 2, 4, 5, 7, 8 and 9, characterized in that In the case where the movement trend of the electronic device is away from the face, if the answering gesture of the electronic device is an answering gesture away from the face, and the answering gesture away from the face is valid, before controlling the screen to light up, the method further includes: In a case where it is determined according to the continuously collected multiple frames of second ultrasonic signals that the movement trend of the electronic device is away from the human face, after a second time threshold has passed, determining whether the answering gesture of the electronic device is the answering gesture away from the human face according to the continuously collected multiple frames of second acceleration data and the continuously collected multiple frames of second angular velocity data; In a case where it is determined that the answering gesture of the electronic device is the answering gesture away from the face, it is determined whether the answering gesture away from the face is valid according to the multiple frames of second angular velocity data.

12. The method according to claim 11, characterized in that The determining, based on the continuously collected multiple frames of second acceleration data and the continuously collected multiple frames of second angular velocity data, whether the answering gesture of the electronic device is the answering gesture away from the face includes: Determine target indication information according to the multiple frames of second acceleration data, the target indication information being used to indicate the overweight and weightlessness of the electronic device, and when the target indication information is a first value, it is used to indicate that the electronic device is first overweight and then weightless, and when the target indication information is a second value, it is used to indicate that the electronic device is first weightless and then overweight; Determine whether the answering gesture of the electronic device is the answering gesture away from the face according to the target indication information, the multiple frames of second acceleration data and the multiple frames of second angular velocity data.

13. The method according to claim 12, characterized in that The determining, according to the target indication information, the multiple frames of second acceleration data, and the multiple frames of second angular velocity data, whether the answering gesture of the electronic device is the answering gesture away from the face includes: In a case where it is determined that the electronic device satisfies at least one of the following conditions according to the target indication information, the multiple frames of second acceleration data, and the multiple frames of second angular velocity data, determining that the answering gesture of the electronic device is the answering gesture away from the face; Condition 5: the multiple frames of second angular velocity data include at least a preset number of first angular velocity components that are all less than a fourteenth threshold, and the first angular component is an angular velocity component on the X-axis in the spatial coordinate system of the electronic device; Condition six: the second angular velocity component in the multiple frames of second angular velocity data shows an increasing trend, and at least the preset number of second angular velocity components in the multiple frames of second angular velocity data are all less than the fifteenth threshold, and the first acceleration component in the multiple frames of second acceleration data shows a decreasing trend, and at least the preset number of first acceleration components in the multiple frames of second acceleration data are all less than the sixteenth threshold, and the target indication information is the second numerical value, the second angular velocity component is the angular velocity component on the Z coordinate axis in the spatial coordinate system, and the first acceleration component is the acceleration component on the X coordinate axis in the spatial coordinate system; Condition seven: the second angular velocity component in the multiple frames of second angular velocity data shows a decreasing trend, and at least the preset number of second angular velocity components in the multiple frames of second angular velocity data are all greater than the seventeenth threshold, and the first acceleration component in the multiple frames of second acceleration data shows an increasing trend, and at least the preset number of first acceleration components in the multiple frames of second acceleration data are all greater than the eighteenth threshold, and the target indication information is the second value; Condition eight: the second acceleration component in the multiple frames of second acceleration data shows an increasing trend, and at least the preset number of second acceleration components in the multiple frames of second acceleration data are all greater than the nineteenth threshold, and the target indication information is the first value, and the second acceleration component is the acceleration component on the Y coordinate axis in the spatial coordinate system; Condition nine: the second acceleration component in the multiple frames of second acceleration data shows an increasing trend, the third acceleration component in the multiple frames of second acceleration data shows an increasing trend, and the moduli of at least the preset number of second angular velocity components in the multiple frames of second angular velocity data are all greater than the twentieth threshold value, and the third acceleration component is the acceleration component on the Z coordinate axis in the spatial coordinate system.

14. An electronic device, characterized in that: The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method according to any one of claims 1 to 13 when executing the computer program.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Proximity sensor threshold adjusting method and device and intelligent device

    CN104683598A

  • Lighting control method and device for electronic equipment and electronic equipment

    CN109361815A

  • A method for controlling on-off of a terminal screen and a terminal

    CN109710142A

  • Screen state control method of mobile terminal, mobile terminal and medium

    CN113965643A

  • Screen control method and device

    CN116055625A