Screen state control method, device, electronic device and storage medium

By using speakers and microphones in electronic devices to transmit and receive Chirp signals to determine the movement trend and distance of the target object, the problem of increased manufacturing costs of infrared proximity sensors is solved, and more reliable screen status control is achieved.

CN117714592BActive Publication Date: 2024-10-25HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311000191.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-08
Publication Date
2024-10-25
Estimated Expiration
2043-08-08

AI Technical Summary

Technical Problem

In the prior art, an infrared proximity sensor is used to measure distance to control the on/off of the screen of an electronic device, which requires additional infrared devices, which increases manufacturing costs and structural complexity.

Method used

Using multiple frames of original Chirp signals that are continuously and repeatedly transmitted, the echo signals are collected to determine the movement trend and distance between the electronic device and the target object, and the screen status is controlled based on the trend and distance, and existing speakers and microphones are used to transmit and receive signals.

Benefits of technology

There is no need to add additional components, which saves manufacturing costs, improves the reliability and accuracy of screen status control, and avoids miscontrol problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117714592B_ABST
    Figure CN117714592B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of terminal technology, and provides a method, device, electronic device and storage medium for controlling the screen state, the method comprising: when a ranging scene is triggered, continuously and repeatedly transmitting multiple frames of original Chirp signals; collecting echo signals corresponding to the multiple frames of original Chirp signals; determining the current motion trend and current distance between the electronic device and the target object based on the echo signal and the original Chirp signal; determining the screen state of the electronic device according to the current motion trend and current distance. Thus, the Chirp signal is emitted and the echo signal is received by the existing device in the electronic device, so as to detect the motion trend and distance between the electronic device and the target object through the ultrasonic signal, and the screen state of the electronic device is controlled in combination with the judgment results of the two, so that not only does it not need to add additional devices, but also saves manufacturing costs and improves the reliability of screen state control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of terminal technology, and in particular, relates to a method and device for controlling screen status, an electronic device, and a computer-readable storage medium. Background Art

[0002] When using electronic devices such as mobile phones, in some application scenarios, the electronic device needs to be able to automatically sense the target object to control the screen of the electronic device to turn on or off according to the distance between the target object and the electronic device. For example, in scenarios such as making a call, there is usually a need to control the screen of the electronic device to turn on or off according to the distance between the electronic device and the user.

[0003] In the related art, an infrared proximity sensor is usually used to measure the distance between a target object and an electronic device to control the lighting and extinguishing of the electronic device screen. However, measuring the distance by an infrared proximity sensor requires additional infrared devices to be added to the electronic device, which increases the manufacturing cost and structural complexity of the electronic device. Summary of the invention

[0004] The embodiments of the present application provide a method, device, electronic device and computer-readable storage medium for controlling the screen status of an electronic device, which can solve the problem that when measuring the distance through an infrared proximity sensor to control the screen lighting of an electronic device, an additional infrared device needs to be added to the electronic device, which increases the manufacturing cost and structural complexity of the electronic device.

[0005] In a first aspect, an embodiment of the present application provides a method for controlling a screen state, which is applied to an electronic device, comprising: when a ranging scenario is triggered, continuously and repeatedly transmitting multiple frames of original Chirp signals; collecting echo signals corresponding to the multiple frames of original Chirp signals, wherein the echo signals include signals reflected by the target object from the multiple frames of original Chirp signals; determining a current motion trend of the electronic device relative to the target object based on the echo signals and the original Chirp signals; determining a current distance between the electronic device and the target object based on the echo signals and the original Chirp signals; and determining a screen state of the electronic device based on the current motion trend and the current distance, wherein the screen state includes being on or off.

[0006] In a possible implementation of the first aspect, the current motion trend includes approaching, moving away, and no state; accordingly, determining the screen state of the electronic device according to the current motion trend and the current distance includes:

[0007] If the current motion trend is approaching and the current distance is greater than the first distance threshold, determining that the screen state of the electronic device remains unchanged;

[0008] If the current motion trend is approaching and the current distance is less than or equal to the first distance threshold, determining that the screen state of the electronic device is off;

[0009] If the current movement trend is moving away and the current distance is greater than the first distance threshold, determining that the screen state of the electronic device is lit;

[0010] If the current movement trend is moving away and the current distance is less than or equal to the first distance threshold, determining that the screen state of the electronic device remains unchanged;

[0011] If the current motion trend is no state and the current distance is greater than the first distance threshold, determining that the screen state of the electronic device is lit;

[0012] If the current motion trend is no state and the current distance is less than or equal to the first distance threshold, it is determined that the screen state of the electronic device is off.

[0013] Optionally, in another possible implementation manner of the first aspect, determining the current distance between the electronic device and the target object based on the echo signal and the original Chirp signal includes:

[0014] Perform cross-correlation calculation on the echo signal and the original Chirp signal to determine the transmission delay between the echo signal and the original Chirp signal;

[0015] Determine the current distance based on the transmission delay and signal propagation speed.

[0016] Optionally, in another possible implementation of the first aspect, determining the current motion trend of the electronic device relative to the target object based on the echo signal and the original Chirp signal includes:

[0017] Based on the echo signal and the original Chirp signal, determine the signal characteristics of the effective channel in the detection sensing area, wherein the effective channel is determined based on the bandwidth and signal propagation speed of the original Chirp signal and the specified constraint distance, the signal characteristics are related to the amplitude and phase change information of the echo signal, and the specified constraint distance is used for the electronic device to identify the current movement trend;

[0018] Determine the current movement trend based on the signal characteristics of the effective channel.

[0019] Optionally, in yet another possible implementation of the first aspect, the step of determining a signal feature of a valid channel in the detection sensing area based on the echo signal and the original Chirp signal includes:

[0020] During the signal acquisition process, each time a frame of echo signal is acquired, the first echo signal is coherently demodulated based on the original Chirp signal corresponding to the first echo signal to obtain a coherent demodulated signal corresponding to the first echo signal, wherein the first echo signal is a frame of echo signal currently acquired;

[0021] Performing fast Fourier transform processing on the coherent demodulation signal corresponding to the first echo signal to obtain a first Fourier transform result corresponding to the first echo signal;

[0022] The signal characteristics of the effective channel at the current moment are determined according to the first Fourier transform result and the second Fourier transform result corresponding to the second echo signal, wherein the second echo signal is a frame of echo signal collected last time.

[0023] Optionally, in yet another possible implementation manner of the first aspect, determining the signal characteristic of the effective channel at the current moment according to the first Fourier transform result and the second Fourier transform result corresponding to the second echo signal includes:

[0024] Acquire channel impulse response CIR data of the effective channel in the first Fourier transform result to obtain first CIR data;

[0025] Acquire CIR data of the effective channel in the second Fourier transform result to obtain second CIR data;

[0026] 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;

[0027] Based on the third CIR data and the fourth CIR data, the signal characteristics of the effective channel at the current moment are determined, wherein the fourth CIR data is the data determined last time for representing the dynamic information of the effective channel.

[0028] Optionally, in another possible implementation manner of the first aspect, determining the signal characteristics of the valid channel at the current moment based on the third CIR data and the fourth CIR data includes:

[0029] Determine phase change information based on the third CIR data and the fourth CIR data, wherein 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;

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

[0031] Optionally, in another possible implementation of the first aspect, determining the current motion trend according to the signal characteristics of the effective channel includes:

[0032] Performing mean filtering processing on the signal characteristics of each effective channel in the multiple effective channels respectively;

[0033] Cache the signal characteristics of each valid channel after mean filtering;

[0034] In the process of caching the signal features, a sliding window having a window length of a first preset length and a sliding step length of a second preset length is used to obtain the signal features of each valid channel from the cached signal features, wherein the first preset length includes M frames of signal features, M is an integer greater than 1, and the second preset length is greater than the first preset length;

[0035] If the sum of the signal characteristics of any valid channel in the sliding window satisfies the first preset condition, and the sum of the signal characteristics of all valid channels in the sliding window satisfies the second preset condition, then the number of signal characteristic frames greater than the first threshold in each valid channel in the sliding window is counted to obtain the first signal characteristic frame number, and the number of signal characteristic frames less than the second threshold in each valid channel in the sliding window is counted to obtain the second signal characteristic frame number;

[0036] The current motion trend is determined based on the first preset condition satisfied by the sum of signal characteristics of any valid channel in the sliding window, the second preset condition satisfied by the sum of signal characteristics of all valid channels in the sliding window, the first signal feature frame number and the second signal feature frame number.

[0037] Optionally, in yet another possible implementation of the first aspect, determining the current motion trend according to a first preset condition satisfied by the sum of signal features of any valid channel in the sliding window, a second preset condition satisfied by the sum of signal features of all valid channels in the sliding window, the first signal feature frame number, and the second signal feature frame number includes:

[0038] When the sum of the signal characteristics of any valid channel in the sliding window is greater than the third threshold, and the sum of the signal characteristics of all valid channels in the sliding window is greater than the fourth threshold, if the first signal characteristic frame number is greater than the first signal characteristic frame number threshold, and the second signal characteristic frame number is less than the second signal characteristic frame number threshold, it is determined that the current motion trend is close;

[0039] When the sum of the signal characteristics of any valid channel in the sliding window is less than the fifth threshold, and the sum of the signal characteristics of all valid channels in the sliding window is less than the sixth threshold, if the first signal feature frame number is less than the second signal feature frame number threshold, and the second signal feature frame number is greater than the first signal feature frame number threshold, it is determined that the current motion trend is moving away.

[0040] Optionally, in another possible implementation of the first aspect, the acquiring of echo signals corresponding to multiple frames of original Chirp signals includes:

[0041] Receive initial echo signals corresponding to multiple frames of original Chirp signals through a signal receiver;

[0042] Performing filtering on the initial echo signal to obtain high-frequency information of the initial echo signal;

[0043] The high frequency information of the initial echo signal is collected as the echo signal.

[0044] Optionally, in another possible implementation manner of the first aspect, before the continuously and repeatedly transmitting multi-frame original linear frequency modulation Chirp signal, the method further includes:

[0045] K frames of original flag signals are transmitted, wherein the original flag signal is a signal generated by timing inverting the original Chirp signal, and the transmission time interval between the K frame flag signal and multiple frames of original Chirp signals is a preset duration, and K is a positive integer.

[0046] Optionally, in another possible implementation manner of the first aspect, before acquiring echo signals corresponding to multiple frames of original Chirp signals, the method further includes:

[0047] Receive a flag bit echo signal corresponding to the original flag bit signal of the K frame through a signal receiver;

[0048] Signal alignment is performed based on the marker echo signal and the marker signal.

[0049] Optionally, in yet another possible implementation of the first aspect, the performing of signal alignment based on the flag bit echo signal and the flag bit signal includes:

[0050] Each time a frame of the marker echo signal is received, a third preset length is used as a displacement, and similarity calculation is performed based on the original marker signal and the marker echo signal in a stepwise displacement manner;

[0051] During the calculation process, each similarity score obtained after each similarity calculation is cached;

[0052] Using a similarity score sliding window with a window length of a fourth preset length and a sliding step length of a unit sampling interval, searching from the cached similarity scores for a target similarity score that is located at the center of the similarity score sliding window and is the maximum value in the similarity score sliding window;

[0053] If the target similarity score is found, and the window distance between the current similarity score sliding window and the similarity score sliding window when the target similarity score was found last time is within a preset range, the currently found target similarity score is cached;

[0054] When the number of cached target similarity scores is K, if the difference between the maximum value and the minimum value of all cached target similarity scores is less than the product of the minimum value and a preset value, it is determined that the signals are aligned.

[0055] In a second aspect, an embodiment of the present application provides a screen status control device, which is applied to an electronic device, including: a first transmitting module, which is used to continuously and repeatedly transmit multiple frames of original Chirp signals when a ranging scenario is triggered; a first acquisition module, which is used to acquire echo signals corresponding to the multiple frames of original Chirp signals, wherein the echo signals include signals reflected by the target object from the multiple frames of original Chirp signals; a first determination module, which is used to determine the current motion trend of the electronic device relative to the target object based on the echo signal and the original Chirp signal; a second determination module, which is used to determine the current distance between the electronic device and the target object based on the echo signal and the original Chirp signal; and a third determination module, which is used to determine the screen status of the electronic device based on the current motion trend and the current distance, wherein the screen status includes being on or off.

[0056] In a possible implementation manner of the second aspect, the current motion trend includes approaching, moving away, and no state; accordingly, the third determining module includes:

[0057] A first determining unit, configured to determine that the screen state of the electronic device remains unchanged if the current motion trend is close and the current distance is greater than a first distance threshold;

[0058] A second determining unit, configured to determine that the screen state of the electronic device is off if the current motion trend is close and the current distance is less than or equal to the first distance threshold;

[0059] A third determining unit, configured to determine that the screen state of the electronic device is lit if the current movement trend is moving away and the current distance is greater than a first distance threshold;

[0060] a fourth determining unit, configured to determine that the screen state of the electronic device remains unchanged if the current movement trend is moving away and the current distance is less than or equal to the first distance threshold;

[0061] a fifth determining unit, configured to determine that the screen state of the electronic device is lit if the current motion trend is no state and the current distance is greater than a first distance threshold;

[0062] The sixth determination unit is used to determine that the screen state of the electronic device is off if the current motion trend is no state and the current distance is less than or equal to the first distance threshold.

[0063] Optionally, in another possible implementation of the second aspect, the second determining module includes:

[0064] A seventh determination unit, configured to perform cross-correlation calculation on the echo signal and the original Chirp signal to determine a transmission delay between the echo signal and the original Chirp signal;

[0065] The eighth determining unit is used to determine the current distance according to the transmission delay and the signal propagation speed.

[0066] Optionally, in another possible implementation of the second aspect, the first determining module includes:

[0067] a ninth determination unit, configured to determine a signal characteristic of an effective channel in the detection sensing area based on the echo signal and the original Chirp signal, wherein the effective channel is determined based on a bandwidth and a signal propagation speed of the original Chirp signal and a specified constraint distance, the signal characteristic is related to the amplitude and phase change information of the echo signal, and the specified constraint distance is used for the electronic device to identify a current motion trend;

[0068] The tenth determining unit is used to determine the current motion trend according to the signal characteristics of the effective channel.

[0069] Optionally, in yet another possible implementation manner of the second aspect, the ninth determining unit is specifically configured to:

[0070] During the signal acquisition process, each time a frame of echo signal is acquired, the first echo signal is coherently demodulated based on the original Chirp signal corresponding to the first echo signal to obtain a coherent demodulated signal corresponding to the first echo signal, wherein the first echo signal is a frame of echo signal currently acquired;

[0071] Performing fast Fourier transform processing on the coherent demodulation signal corresponding to the first echo signal to obtain a first Fourier transform result corresponding to the first echo signal;

[0072] The signal characteristics of the effective channel at the current moment are determined according to the first Fourier transform result and the second Fourier transform result corresponding to the second echo signal, wherein the second echo signal is a frame of echo signal collected last time.

[0073] Optionally, in yet another possible implementation manner of the second aspect, the ninth determining unit is further configured to:

[0074] Acquire channel impulse response CIR data of the effective channel in the first Fourier transform result to obtain first CIR data;

[0075] Acquire CIR data of the effective channel in the second Fourier transform result to obtain second CIR data;

[0076] 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;

[0077] Based on the third CIR data and the fourth CIR data, the signal characteristics of the effective channel at the current moment are determined, wherein the fourth CIR data is the data determined last time for representing the dynamic information of the effective channel.

[0078] Optionally, in another possible implementation manner of the second aspect, the ninth determining unit is further configured to:

[0079] Determine phase change information based on the third CIR data and the fourth CIR data, wherein 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;

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

[0081] Optionally, in yet another possible implementation manner of the second aspect, the tenth determining unit is specifically configured to:

[0082] Performing mean filtering processing on the signal characteristics of each effective channel in the multiple effective channels respectively;

[0083] Cache the signal characteristics of each valid channel after mean filtering;

[0084] In the process of caching the signal features, a sliding window having a window length of a first preset length and a sliding step length of a second preset length is used to obtain the signal features of each valid channel from the cached signal features, wherein the first preset length includes M frames of signal features, M is an integer greater than 1, and the second preset length is greater than the first preset length;

[0085] If the sum of the signal characteristics of any valid channel in the sliding window satisfies the first preset condition, and the sum of the signal characteristics of all valid channels in the sliding window satisfies the second preset condition, then the number of signal characteristic frames greater than the first threshold in each valid channel in the sliding window is counted to obtain the first signal characteristic frame number, and the number of signal characteristic frames less than the second threshold in each valid channel in the sliding window is counted to obtain the second signal characteristic frame number;

[0086] The current motion trend is determined based on the first preset condition satisfied by the sum of signal characteristics of any valid channel in the sliding window, the second preset condition satisfied by the sum of signal characteristics of all valid channels in the sliding window, the first signal feature frame number and the second signal feature frame number.

[0087] Optionally, in yet another possible implementation manner of the second aspect, the tenth determining unit is further configured to:

[0088] When the sum of the signal characteristics of any valid channel in the sliding window is greater than the third threshold, and the sum of the signal characteristics of all valid channels in the sliding window is greater than the fourth threshold, if the first signal characteristic frame number is greater than the first signal characteristic frame number threshold, and the second signal characteristic frame number is less than the second signal characteristic frame number threshold, it is determined that the current motion trend is close;

[0089] When the sum of the signal characteristics of any valid channel in the sliding window is less than the fifth threshold, and the sum of the signal characteristics of all valid channels in the sliding window is less than the sixth threshold, if the first signal feature frame number is less than the second signal feature frame number threshold, and the second signal feature frame number is greater than the first signal feature frame number threshold, it is determined that the current motion trend is moving away.

[0090] Optionally, in yet another possible implementation of the second aspect, the first acquisition module includes:

[0091] A first receiving unit, configured to receive initial echo signals corresponding to multiple frames of original Chirp signals through a signal receiver;

[0092] A first filtering unit, used for filtering the initial echo signal to obtain high-frequency information of the initial echo signal;

[0093] The first acquisition unit is used to acquire high-frequency information of the initial echo signal as an echo signal.

[0094] Optionally, in another possible implementation of the second aspect, the apparatus further includes:

[0095] The second transmitting module is used to transmit K frames of original flag signals, wherein the original flag signal is a signal generated by timing inverting the original Chirp signal, and the transmission time interval between the K frame flag signal and multiple frames of original Chirp signals is a preset duration, and K is a positive integer.

[0096] Optionally, in another possible implementation of the second aspect, the apparatus further includes:

[0097] The first receiving module is used to receive a flag bit echo signal corresponding to the original flag bit signal of the K frame through a signal receiver;

[0098] The first alignment module is used to perform signal alignment based on the flag echo signal and the flag signal.

[0099] Optionally, in yet another possible implementation of the second aspect, the first alignment module includes:

[0100] A first similarity calculation unit is used for performing similarity calculation based on the original flag position signal and the flag position echo signal by stepwise displacement with a third preset length as displacement each time a frame of the flag position echo signal is received;

[0101] A first cache unit is used to cache each similarity score obtained after each similarity calculation during the calculation process;

[0102] A first search unit is used to use a similarity score sliding window with a window length of a fourth preset length and a sliding step length of a unit sampling interval to search from the cached similarity scores for a target similarity score that is located at the center of the similarity score sliding window and is a maximum value in the similarity score sliding window;

[0103] A second cache unit is used to cache the currently found target similarity score if a target similarity score is found and a window distance between a current similarity score sliding window and a similarity score sliding window when the target similarity score was found last time is within a preset range;

[0104] The eleventh determining unit is configured to determine that the signals are aligned if, when the number of cached target similarity scores is K, the difference between the maximum value and the minimum value of all cached target similarity scores is less than the product of the minimum value and a preset value.

[0105] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the screen status control method as described above when executing the computer program.

[0106] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the screen status control method as described above.

[0107] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the screen status control method as described above.

[0108] The beneficial effects of the embodiments of the present application compared with the prior art are: Chirp signals are emitted through existing devices (such as speakers and microphones) in electronic devices and echo signals corresponding to the Chirp signals are received, so as to detect the movement trend and distance between the electronic device and the target object through ultrasonic signals, and the screen state of the electronic device is jointly controlled in combination with the movement trend determination result and the distance determination result, thereby not only eliminating the need to add additional devices, saving the manufacturing cost of the electronic device, but also improving the reliability of screen state control. BRIEF DESCRIPTION OF THE DRAWINGS

[0109] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0110] Figure 1 is a schematic diagram of a signal frequency change provided by an embodiment of the present application;

[0111] Figure 2 is a schematic diagram of rotation of signal data in a complex plane provided by an embodiment of the present application;

[0112] Figure 3 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0113] Figure 4 is a schematic diagram of another application scenario provided by an embodiment of the present application;

[0114] Figure 5 is a schematic diagram of another application scenario provided by an embodiment of the present application;

[0115] Figure 6 This is a schematic diagram of the architecture of a software system of an electronic device provided by an embodiment of the present application;

[0116] Figure 7 is a flowchart of a method for controlling a screen state provided in an embodiment of the present application;

[0117] Figure 8 is a schematic diagram of an ultrasonic signal provided by an embodiment of the present application;

[0118] Fig. 9 is a schematic diagram of a part of an ultrasonic signal transmitted according to an embodiment of the present application;

[0119] Fig.10 is a flowchart of another method for controlling a screen state provided by an embodiment of the present application;

[0120] Fig.11 is a schematic diagram of a signal alignment method provided by an embodiment of the present application;

[0121] Fig.12 is a schematic diagram of an original Chirp signal and an echo signal provided in an embodiment of the present application;

[0122] Fig.13 is a schematic diagram of a cross-correlation function curve provided by an embodiment of the present application;

[0123] Fig.14 This is a flow chart of combining the current motion trend and the current distance to jointly determine the screen state, provided by an embodiment of the present application;

[0124] Fig.15 is a flowchart of another method for controlling screen status provided by an embodiment of the present application;

[0125] Fig.16 This is a schematic diagram of signal data distribution after fast Fourier transformation provided by an embodiment of the present application;

[0126] Fig.17 is a schematic diagram of signal characteristics of a second channel and a third channel provided by an embodiment of the present application;

[0127] Fig.18 is a structural schematic diagram of a screen status control device provided by an embodiment of the present application;

[0128] Fig.19 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0129] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0130] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0131] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0132] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0133] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0134] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0135] Before introducing the method provided in the embodiments of the present application, the terms involved in the embodiments of the present application are first explained.

[0136] Chirp signal: a linear frequency modulated pulse signal, which is an ultrasonic signal with an ultrasonic signal range greater than 20kHz. Chirp signals need to propagate in a medium, and when propagating in the medium, they have good directivity, strong penetration, and strong anti-interference ability, and can achieve high-precision ranging with less impact from environmental factors within a short distance. As an example and not a limitation, the bandwidth of commonly used Chirp signals includes 3.4kHz, 6.8kHz, etc.

[0137] Coherent demodulation: refers to de-skewing the echo signal based on the Chirp signal. The echo signal is the signal after the Chirp signal is reflected by the target object. In implementation, the Chirp signal and the echo signal of the Chirp signal can be conjugate multiplied to obtain the coherent demodulation signal corresponding to the echo signal.

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

[0139] The effective distance represented by the unit frequency component: The embodiment of the present application refers to the effective distance that the signal data of a single channel in the FFT observation window can represent after performing FFT on the relevant demodulated signal. The effective distance is related to the bandwidth of the selected Chirp signal and the signal propagation speed. The specific derivation process is: during the propagation of the echo signal, the relative displacement will cause the signal frequency of the echo signal to change. In a short period of time, it can be considered that the signal frequency of the echo signal changes linearly, such as Figure 1 As shown, the signal frequency change slope is S = F / Δt, where the bandwidth of the Chirp signal satisfies B = S × T c , T c is the duration of a single-frame Chirp signal (i.e., the period of the Chirp signal). According to the absolute distance expression It can be concluded that Thus, it can be deduced After converting the equation, we can get Where v is the signal propagation speed of the Chirp signal (i.e., the speed of sound), which is 340 m / s. According to the principle of Fast Fourier Transform, the FFT observation window can distinguish intervals greater than 1 / c The unit frequency component of Hz, that is That is to say Therefore, it can be concluded That is, after the fast Fourier transform, the effective distance that the unit frequency component in the FFT observation window can represent is

[0140] Chirp signal distance determination principle: When making distance determination based on Chirp signals, the determination can be made by analyzing the coherent demodulation signal of its echo signal. Specifically, the signal data after fast Fourier transform of the coherent demodulation signal is a complex number. When the signal frequency changes, the complex number will rotate on the complex plane. For example, Figure 2 As shown in the figure, when the signal frequency increases, that is, the distance increases, the complex number rotates counterclockwise in the complex plane; when the signal frequency decreases, that is, the distance is close, the complex number rotates clockwise in the complex plane. Based on this, we can judge whether the target object is approaching or moving away by performing a cross product of the complex number based on two consecutive echo signals after coherent demodulation and fast Fourier transform. Specifically, the complex number is represented by a t +t j, the 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) from the echo signal x(t) to the echo signal x(t+1). Obviously, when θ is positive, sinθ is positive, which means that the phase angle from the echo signal x(t) to the echo signal x(t+1) increases, and the signal frequency of the echo signal increases, which can indicate that the distance increases; conversely, when θ is negative, sinθ is negative, which means that the phase angle from the echo signal x(t) to the echo signal x(t+1) decreases, and the signal frequency of the echo signal decreases, which can indicate that the distance decreases.

[0141] Hamming window: It can be used to intercept part of the ultrasonic signal from the continuous ultrasonic signal. The intercepted part of the ultrasonic signal is used for subsequent processing. For example, it can be used to intercept a period of Chirp signal as a frame of original Chirp signal emitted by an electronic device.

[0142] Cross-correlation calculation: The meaning of cross-correlation between two functions is: the infinite integral of taking the complex conjugate and reverse translation of the two functions and multiplying them; or: the infinite integral of multiplying the first function by the second function after taking the complex conjugate and translation in turn. It can be proved that the two definitions are completely equivalent (can be derived from each other). From a physical point of view, the result of the cross-correlation operation reflects the measure of the similarity between the two signals. The cross-correlation function is a very important signal processing tool, which can be used to measure the similarity or correlation between two signals. In practical applications, the cross-correlation function is often used for tasks such as signal matching, image matching, and motion estimation. In signal processing, the cross-correlation function is often used for signal matching. For example, we can use a known signal as a template, and then perform cross-correlation calculation on it and an unknown signal to find the part that is most similar to the template. This method can be used to recognize speech signals, music signals, image signals, etc.

[0143] After introducing the terms involved in the embodiments of the present application, the application scenarios involved in the embodiments of the present application are introduced next.

[0144] In the process of using an electronic device, in some application scenarios, the user requires the electronic device to automatically detect the distance between the target object and the electronic device in its detection sensing area, so as to automatically control the screen to light up or turn off. For example, the following exemplary application scenarios may be involved:

[0145] In one possible application scenario, please refer to Figure 3 ,like Figure 3 As shown in Figure (a), when a user uses a mobile phone to make a call, the screen of the mobile phone is lit before the user brings the mobile phone close to him / her. Figure 3 As shown in Figure (b), when the user puts the phone close to the ear, the phone automatically detects that a target object is approaching, and the phone can automatically control the screen to turn off. Figure 3 As shown in Figure (c), when the user moves the phone away from the ear for a certain distance, the phone detects that the target object is far away, and the phone can automatically control the screen to light up. That is, when the phone is making a call, it can automatically control the screen to turn off or on by detecting the distance between the target object and the phone in the detection sensing area.

[0146] In another possible application scenario, please refer to Figure 4 ,like Figure 4 As shown in Figure (a), a user is using WeChat on his mobile phone. TM During the chat process of the application, if the phone is not close to the user, the screen of the phone is lit. Figure 4 In Figure (b), when the user triggers the WeChat application in the mobile phone to play the received voice message and puts the mobile phone close to the ear to listen to the voice, the mobile phone detects that a target object is approaching, and the mobile phone can automatically control the screen to turn off; please refer to Figure 4 In Figure (c), when the user moves the phone away from the ear by a certain distance, the phone detects that the target object is far away, and the phone can automatically control the screen to light up. That is, when the phone plays a voice message through the WeChat TM application, the screen can be automatically turned off or on by detecting the distance between the target object and the phone in the detection sensing area.

[0147] In another possible application scenario, please refer to Figure 5 As shown in Figure (a), after the mobile phone is turned on, the mobile phone can continuously detect, so that when a target object approaches the mobile phone, the mobile phone can automatically control the screen to light up, and when the target object moves away from the mobile phone, the mobile phone can automatically control the screen to turn off. Figure 5 As shown in Figure (b) in FIG. 1 , when the user places the mobile phone in the computer bag, the mobile phone can automatically control the screen to turn off. Figure 5 As shown in Figure (c), when the user takes the mobile phone out of the computer bag, the mobile phone can automatically control the screen to light up.

[0148] To this end, an embodiment of the present application provides a method for controlling the screen state, which can accurately determine the movement trend of the target object relative to the electronic device, as well as the distance between the target object and the electronic device. When it is determined that the target object is close to the mobile phone and the distance is close, the mobile phone controls the screen to turn off, and when it is determined that the target object is far away from the mobile phone and the distance is far, the mobile phone controls the screen to turn on. In other words, this method not only does not require the addition of additional infrared devices, but also can avoid miscontrol of the screen, thereby avoiding problems such as mis-extinguishing the screen, and improving the reliability and robustness of screen state control. Its specific implementation can be seen as follows Figure 7 The embodiment shown.

[0149] It should be noted that the above-mentioned application scenarios are merely exemplary and do not limit the application scenarios of the screen status control method provided in the embodiments of the present application. That is, the method can also be applied to other application scenarios that require distance and proximity detection to control the screen status, or can also be applied to other application scenarios that require distance and proximity detection to perform other operations.

[0150] It should also be noted that the above is explained using a mobile phone as an example. In addition, the screen status control method provided in the embodiment of the present application can also be applied to electronic devices such as sports cameras (GoPro), digital cameras, tablet computers, desktops, laptops, handheld computers, notebook computers, vehicle-mounted equipment, ultra-mobile personal computers (ultra-mobile personal computers, UMPC), netbooks, cellular phones, personal digital assistants (personal digital assistants, PDAs), augmented reality (augmented reality, AR) and virtual reality (virtual reality, VR) devices, wearable devices (such as wearable smart bracelets, etc.), smart home devices (such as smart refrigerators, smart TVs, etc.), and the embodiment of the present application is not limited to this.

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

[0152] Figure 6 is a block diagram of a software system of an electronic device provided in an embodiment of the present application. Figure 6, the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime (Android runtime) and the system layer, and the kernel layer. In addition, Figure 6 The relationship between the hardware layer and the software system is also shown. As an example of the present application, the hardware layer includes a signal transmitter and a signal receiver. The signal transmitter is used to transmit the original Chirp signal, such as the signal transmitter is a transmitting antenna, including but not limited to a speaker. The signal receiver is used to receive the echo signal of the original Chirp signal. In an example, the signal receiver can be but not limited to a microphone, etc.

[0153] The application layer can include a series of application packages. Figure 6 As shown, the application package may include instant messaging, calling, camera, gallery, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0154] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. As an example of this application, Figure 6 As shown, the application framework layer may include a ranging scene triggering module, a ranging management module, and a screen state control module. The ranging scene triggering module is used to monitor whether the ranging scene is triggered, and to notify the ranging management module when the ranging scene is triggered. The ranging management module is used to trigger the signal transmitter to transmit the original Chirp signal, and obtain the echo signal received by the signal receiver, and determine the movement trend of the target object relative to the electronic device based on the original Chirp signal and the echo signal. The screen state control module is used to control the state of the screen of the electronic device, such as controlling the screen to light up or control the screen to turn off.

[0155] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0156] The system library can include multiple functional modules, such as: surface manager, media library, 3D graphics processing library (such as: OpenGL ES), 2D graphics engine (such as: SGL), etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.

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

[0158] The screen status control method, device, electronic device, storage medium and computer program provided in the present application are described in detail below with reference to the accompanying drawings.

[0159] In the above Figure 6 Based on the electronic device shown in FIG. 1 , the screen state control method provided by the embodiment of the present application is introduced below. Figure 7 , Figure 7 is a flowchart of a method for controlling a screen state provided in an embodiment of the present application. As an example but not a limitation, the method may be performed by Figure 6 The electronic device shown in the figure is executed, and the electronic device is implemented by the interaction of the above modules. The method may include part or all of the following contents:

[0160] Step 701: When a ranging scenario is triggered, multiple frames of original Chirp signals are continuously and repeatedly transmitted.

[0161] In a possible application scenario, such as Figure 3 As shown in Figure (a), the user makes a call through the call application in the mobile phone. At this time, the call application initiates a call. In this case, the distance measurement scenario is triggered, that is, distance measurement is required to control the screen state of the electronic device during the call.

[0162] It should be noted that the present application embodiment is only described by taking the distance measurement scenario being triggered during the process of initiating a call through a call application of an electronic device as an example. In another example, the distance measurement scenario being triggered may also include other application scenarios, such as Figure 5 As shown, the ranging scene is triggered when the electronic device is turned on and the system is started, etc., which will not be described in detail here.

[0163] In order to enable the mobile phone to automatically measure distance in the detection sensing area and control the screen status during a call, the call 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 is triggered.

[0164] After receiving the ranging scenario trigger notification sent by the call application, the ranging scenario trigger module determines that the ranging application scenario is triggered. In this case, the ranging scenario trigger module triggers the ranging management module so that the ranging management module can determine the current movement trend of the electronic device relative to the target object and the current distance between the electronic device and the target object.

[0165] In an embodiment of the present application, after the ranging scene is triggered, the ranging management module can trigger the signal transmitter to continuously and repeatedly transmit multiple frames of original Chirp signals, so that after the original Chirp signal is reflected by the target object, the current movement trend of the electronic device relative to the target object and the current distance between the electronic device and the target object are determined according to the echo signal corresponding to the original Chirp signal.

[0166] Furthermore, since there may be a system time error between the signal transmitter and the signal receiver of the electronic device, the original Chirp signal and the echo signal can be aligned by the flag signal to eliminate the influence of the system time error on the ranging, and further improve the reliability of the screen state control. That is, in a possible implementation of the embodiment of the present application, before the above step 701, it can also include:

[0167] K frames of original flag signals are transmitted, wherein the original flag signal is a signal generated by timing inverting the original Chirp signal, and the transmission time interval between the K frame flag signal and multiple frames of original Chirp signals is a preset duration.

[0168] As an example of the present application, K is a positive integer, for example, K is 3.

[0169] The preset duration may be set according to demand, for example, the preset duration may be T, where T is a value greater than 1.

[0170] The signal frequency range of the original Chirp signal is [m, n], that is, the starting frequency is mHz and the ending frequency is nHz, where m is greater than 20k and nm is the bandwidth of the original Chirp signal. Since the higher the signal frequency, the more severe the attenuation in the air, the signal frequency is usually not selected to be too large.

[0171] As an example, in implementation, before transmitting the flag signal or the original Chirp signal, the flag signal or the original Chirp signal can be smoothed by a Hamming window to intercept the flag signal or the original Chirp signal with a signal length of N, that is, the length of each frame of ultrasonic signal (flag signal or original Chirp signal) is N, which is used for transmission, calculation and other processing. In this way, smoothing the ultrasonic signal by a Hamming window can avoid abnormal noise in the signal splicing process. Where N can be set according to demand, for example, N can be 512.

[0172] For example, Figure 8 As shown, assuming that the unprocessed original Chirp signal is as follows Figure 8 As shown in Figure (a), the original Chirp signal after Hamming window processing is as follows Figure 8 As shown in Figure (b) in the figure, the flag signal after Hamming window processing is as follows Figure 8 As shown in Figure (c).

[0173] As an example of the present application, in order to accurately align the signal, before transmitting the original Chirp signal, a K frame flag signal can be transmitted by the signal transmitter, and then the original Chirp signal can be continuously and repeatedly transmitted after a preset time. Fig. 9 As shown, Fig. 9 The diagram shows a partial display of the transmitted ultrasonic signal, that is, the first three frames are the flag signals after Hamming window smoothing, and after a preset time, the original Chirp signal after Hamming window smoothing is continuously and repeatedly transmitted. In this way, signal alignment can be performed in the subsequent process of receiving the flag echo signal of the K-frame flag signal, that is, the signal alignment time point is determined, and then, from the signal alignment time point, after a preset time, the echo signal received by the signal receiver can be obtained as the echo signal of the first frame original Chirp signal.

[0174] It is worth mentioning that by inverting the timing of the original Chirp signal, the obtained flag signal is different from the original Chirp signal, so that signal alignment is performed at the early stage of signal reception to avoid misalignment.

[0175] It should be noted that the embodiment of the present application is described by aligning the signal by transmitting a flag signal as an example. In another example, the flag signal may not be transmitted, but the original Chirp signal may be directly and continuously transmitted. In this case, the signal alignment can be performed based on the original Chirp signal and its echo signal, which is not limited in the embodiment of the present application.

[0176] It should be noted that the embodiment of the present application is described by taking the example of transmitting K frame flag signals to perform signal alignment. In another example, signal alignment can also be performed by transmitting a frame flag signal, which is not limited in the embodiment of the present application.

[0177] Step 702: Acquire echo signals corresponding to multiple frames of original Chirp signals, wherein the echo signals include signals of the multiple frames of original Chirp signals reflected by the target object.

[0178] Please refer to Fig.10 After the electronic device transmits the ultrasonic signal in the manner shown in step 701, the signal can be received by the signal receiver. Since the original chrip signal is continuously and repeatedly transmitted, the ranging management module can continuously receive the echo signal corresponding to the original chrip signal through the signal receiver.

[0179] Furthermore, since the original Chirp signal and the echo signal may introduce noise during the propagation process, the received echo signal may be filtered to remove the noise in the echo signal, thereby further improving the reliability of the screen state control. That is, in a possible implementation of the embodiment of the present application, the above step 702 may include:

[0180] Receive initial echo signals corresponding to multiple frames of original Chirp signals through a signal receiver;

[0181] Performing filtering on the initial echo signal to obtain high-frequency information of the initial echo signal;

[0182] The high frequency information of the initial echo signal is collected as the echo signal.

[0183] In an example, please refer to Fig.10 After the echo signal is received by the signal receiver, the received echo signal can also be filtered by a filter (such as a bandpass filter or a high-pass filter) to remove low-frequency information and retain high-frequency information.

[0184] Furthermore, when the original chirp signal and the echo signal are aligned by transmitting a flag signal, before receiving the echo signal, it is necessary to perform signal alignment according to the received flag echo signal to eliminate the system time error between the signal transmitter and the signal receiver, so as to further improve the reliability of the screen state control. That is, in a possible implementation of the embodiment of the present application, before the above step 702, it may also include:

[0185] Receive a flag bit echo signal corresponding to the original flag bit signal of the K frame through a signal receiver;

[0186] Signal alignment is performed based on the marker echo signal and the marker signal.

[0187] Please refer to Fig.10 After the electronic device transmits the ultrasonic signal in the above manner, it receives the signal through the signal receiver. It is not difficult to understand that in the early stage of signal reception, the signal received is the marker echo signal reflected by the target object from the original marker signal. After receiving the K-frame marker echo signal and after the preset time, it starts to receive the echo signal corresponding to the original Chirp signal.

[0188] As an example, the specific implementation of performing signal alignment based on the received flag bit echo signal may include:

[0189] Each time a frame of the marker echo signal is received, a third preset length is used as a displacement, and similarity calculation is performed based on the original marker signal and the marker echo signal in a stepwise displacement manner;

[0190] During the calculation process, each similarity score obtained after each similarity calculation is cached;

[0191] Using a similarity score sliding window with a window length of a fourth preset length and a sliding step length of a unit sampling interval, searching from the cached similarity scores for a target similarity score that is located at the center of the similarity score sliding window and is the maximum value in the similarity score sliding window;

[0192] If the target similarity score is found, and the window distance between the current similarity score sliding window and the similarity score sliding window when the target similarity score was found last time is within a preset range, the currently found target similarity score is cached;

[0193] When the number of cached target similarity scores is K, if the difference between the maximum value and the minimum value of all cached target similarity scores is less than the product of the minimum value and a preset value, it is determined that the signals are aligned.

[0194] The third preset length may be set according to actual needs. For example, the third preset length may be a unit sampling interval, that is, the third preset length is 1.

[0195] The fourth preset length may be set according to actual needs. For example, the fourth preset length may be L, where L includes a plurality of unit sampling intervals. As an example but not a limitation, L may be the same as N.

[0196] The preset range may be set as required. For example, the preset range may be [Ln, L+n], where n includes the lengths of multiple unit sampling intervals. For example, n includes the lengths of 3 unit sampling intervals.

[0197] The preset value can be set according to the requirements. For example, the preset value can be 0.1.

[0198] As mentioned above, K is the number of frames of the flag signal that is continuously and repeatedly transmitted, for example, K is 3.

[0199] For an example, see Fig.10 In the process of receiving the marker echo signal, the received marker echo signal can be filtered, for example, it can be filtered by a bandpass filter or a high-pass filter to remove low-frequency information and retain high-frequency information, thereby reducing the interference of subsequent signal processing. After that, the marker echo signal after filtering can be cached. Whenever a frame of marker echo signal is cached, the similarity between the currently received frame of marker echo signal and the original marker signal can be calculated by point-by-point translation with 1 as the displacement to determine the similarity score, for example, by multiplying and summing bit by bit to determine the similarity score. In this way, a similarity score can be obtained for each displacement. During the calculation process, the ranging management module caches the similarity score obtained each time. The higher the similarity score, the greater the similarity between the marker echo signal and the original marker signal, thereby indicating that the probability of alignment is greater.

[0200] Furthermore, since there may be large amplitude noise in the marker echo signal, there may be certain errors if the signal alignment is performed only based on the maximum value of the similarity score. Considering that in the case of continuously transmitting K frames of original marker signals, when the similarity calculation is performed based on the marker echo signal of each frame of the original marker signal in a step-by-step manner, the interval between the maximum similarity scores corresponding to the marker echo signals of each adjacent frame will be within a fixed preset range, and the difference between the K maximum similarity scores is small. Based on this, in order to avoid misalignment due to the influence of high amplitude noise, during the calculation process, the ranging management module can use a similarity score sliding window with a window length of the fourth preset length and a sliding step length of the unit sampling interval to find the target similarity score that is located at the center of the similarity score sliding window and is the maximum value in the similarity score sliding window from the cached similarity scores. During the sliding process of the similarity score sliding window, each time the sliding window slides, if there is a target similarity score in the similarity score sliding window, determine the window distance between the current similarity score sliding window position and the similarity score sliding window position when the target similarity score was found last time. When the window distance is within the preset range, it means that the target similarity scores found twice in succession are not close, which means that the target similarity score found currently and the target similarity score found last time may not be determined based on the same frame flag echo signal, that is, the target similarity score found currently may be the maximum similarity score between a new frame flag echo signal and the original flag signal. In this case, the target similarity score found currently is cached. Otherwise, if the target similarity score does not exist in the similarity score sliding window, the similarity score sliding window will continue to slide. In addition, when the target similarity score is found through the similarity score window, if the window distance between the current similarity score sliding window position and the similarity score sliding window position when the target similarity score was found last is not within the preset range, it means that the two target similarity scores are probably not determined based on two consecutive frames of flag bit echo signals. In this case, the last determined target similarity score can be deleted from the cache, and the currently determined target similarity score can be cached. Of course, it is not difficult to understand that when the target similarity score is found for the first time, only the target similarity score is cached, and then the similarity score sliding window is continued to slide to continue to find the next target similarity score.

[0201] After that, when the number of cached target similarity scores is K, it is determined whether all the cached target similarity scores satisfy the condition (max - min) < a × min, where max is the maximum value among all the cached target similarity scores, min is the minimum value among all the cached target similarity scores, and a is a preset value. If it is satisfied, it indicates that the difference between the K similarity scores is small. At this time, it can be determined that K maximum similarity scores have been found at the current moment, and the K maximum similarity scores are respectively determined based on the flag echo signals of different frames in the K-frame flag echo signals. Thus, it can be determined that the signals are aligned, and the signal alignment time point is the calculation time point of the last similarity score in the similarity score sliding window when the target similarity score was last found. Of course, if all the cached target similarity scores do not satisfy the condition (max - min) < a × min, the search can be continued, or signal alignment can be stopped, or signal alignment can be performed during the reception of the Chirp signal.

[0202] Exemplarily, please refer to Fig.11 , for ease of understanding, it is assumed here that the length of the flag signal is 5. During the reception of the flag echo signal, whenever a flag echo signal with a length of 5 is cached, with a displacement of 1, the similarity score between the flag echo signal and the flag signal is determined by gradually displacing, and the similarity score obtained each time is cached. For example Fig.11 shown, after receiving the first-frame flag echo signal, by gradually displacing, the similarity scores 0.2, 0.4, 0.9, 0.5, 0.3 are obtained in sequence. After receiving the second-frame flag echo signal, by gradually displacing, the similarity scores 0.3, 0.6, 0.8, 0.4, 0.3 are obtained in sequence, and after receiving the third-frame flag echo signal, by gradually displacing, the similarity scores 0.4, 0.3, 0.8, 0.2, 0.2 are obtained in sequence. During the calculation of the similarity score, a similarity score sliding window with a window length of 5 and a moving step size of 1 is used to search for the target similarity score from the cached similarity scores. As Fig.11As shown, the target similarity score found for the first time is 0.9, and this target similarity score is cached. The target similarity score found for the second time is 0.8. Assuming the preset range is [3, 7], since the window distance between the position of the similarity score sliding window at this time and the position of the similarity score sliding window when the target similarity was found for the first time is 5, which is within the preset range, the target similarity score found for the second time is cached. After that, the similarity score sliding window continues to slide. The target similarity score that can be found for the third time is 0.8. Since the window distance between the position of the similarity score sliding window at this time and the position of the similarity score sliding window when the target similarity was found for the previous time (i.e., the second time) is 5, which is within the preset range, the target similarity score found for the third time is cached. At this time, three target similarity scores have been cached. Through calculation, it can be known that the three target similarity scores satisfy the condition (max - min) < a × min. In this case, it is determined that the signal is aligned, and the signal alignment time point is the calculation time point of the last similarity score in the similarity score sliding window when the target similarity score was found for the third time.

[0203] It is worth mentioning that by strongly constraining the maximum similarity score interval and amplitude difference corresponding to the echo signals of the K-frame flag bits respectively, the signal alignment has no strong dependence on the amplitude of the flag bit echo signals, which can avoid misalignment caused by amplitude noise, thereby improving the stability and reliability of the alignment result.

[0204] As an example, after aligning the signals, the ranging management module can collect echo signals after a preset duration from the signal alignment time point. The echo signal is the signal reflected by the target object of multiple consecutive and repeatedly transmitted original Chirp signals. Since there is a preset duration between the original chirp signal and the last transmitted original flag bit signal in the K-frame original flag bit signals, after the signal alignment, the echo signal received after a preset duration from the signal alignment time point is the starting point of the first transmitted original chirp signal, that is, from this moment on, the subsequent received echo signals are aligned with the original chirp signal.

[0205] Since the original chirp signal is continuously and repeatedly transmitted, correspondingly, the ranging management module can continuously receive the echo signals of the original chirp signal through the signal receiver. In one example, please continue to refer to Fig.10After receiving the echo signal through the signal receiver, the received echo signal can also be filtered through the filter to remove low-frequency information and retain high-frequency information. After that, the echo signal after filtering is cached, and the signal is framed during the caching process, that is, whenever the cache is full of echo signals with a length of N, a full frame is determined, that is, a frame of echo signal is collected; otherwise, if it is not full, the cache continues and the signal is framed.

[0206] Step 703: Determine the current movement trend of the electronic device relative to the target object based on the echo signal and the original Chirp signal.

[0207] In the embodiment of the present application, after the original Chirp signal is transmitted, the information such as the copy and phase will change during the propagation and reflection process, that is, the amplitude difference and phase difference between the echo signal and the original Chirp signal can reflect the proximity or distance between the electronic device and the target object. Fig.10 After receiving the echo signal, the echo signal can be multiplied with the original chirp signal to perform coherent demodulation on the echo signal, and the demodulated signal generated by the coherent demodulation can be transformed by FFT, and the phase difference between the echo signal and the original chirp signal can be analyzed. Then, based on the phase analysis result, the current movement trend of the electronic device relative to the target object can be determined, that is, whether the current movement trend between the electronic device and the target object is moving away or approaching.

[0208] It should be noted that when the electronic device moves a very small distance, or shakes within a very small range, it may not be possible to judge the movement trend between the electronic device and the target object as moving away or approaching. At this time, the current movement trend between the electronic device and the target object can be determined as stateless.

[0209] Step 704: determine the current distance between the electronic device and the target object based on the echo signal and the original Chirp signal.

[0210] In the embodiment of the present application, since the time interval between the emission of the original Chirp signal and the reception of the echo signal can represent the transmission time of the original Chirp signal between the electronic device and the target object, and the signal propagation speed of the original Chirp signal is known (i.e., the speed of sound), the transmission delay between the echo signal and the original Chirp signal can be determined based on the original Chirp signal and the echo signal, and the current distance between the electronic device and the target object can be determined based on the transmission delay and the signal propagation speed. That is:

[0211] d=V×t0 / 2

[0212] Wherein, d is the current distance between the electronic device and the target object, V is the signal propagation speed, and t0 is the transmission delay between the echo signal and the original Chirp signal.

[0213] As a possible implementation, since the cross-correlation function can represent the similarity between two signals, the transmission delay between the echo signal and the original Chirp signal can be determined by performing a cross-correlation calculation on the echo signal and the original Chirp signal. That is, in a possible implementation of the embodiment of the present application, the above step 704 may include:

[0214] Performing cross-correlation calculation on the echo signal and the original Chirp signal to determine the transmission delay between the echo signal and the original Chirp signal;

[0215] Determine the current distance based on the transmission delay and signal propagation speed.

[0216] As a possible implementation, assume that the original Chirp signal is Fig.12 The x(t) shown in , the echo signal is Fig.11 The x shown in r (t), that is, the original Chirp signal x(t) and the echo signal x r (t) is t0. If the original Chirp signal x(t) is r (t) is a continuous signal, then the original Chirp signal x(t) and the echo signal x r (t) is the formula for the cross-correlation function between continuous signals:

[0217] R(τ)=∫x(t)·x r (t+τ)dt

[0218] If the original Chirp signal x(t) and the echo signal x r (t) is a discrete signal, then the original Chirp signal x(t) and the echo signal x r (t) is the formula for the cross-correlation function between continuous signals:

[0219] R(τ)=Σx(t)·x r (t+τ)

[0220] According to the above formula, if the original Chirp signal x(t) and the echo signal x r The transmission delay between the original Chirp signal x(t) and the echo signal x is t0. r The cross-correlation function R(τ) corresponding to (t) reaches its maximum value when τ = t0, as shown in Fig.13As shown, the τ value that makes the cross-correlation function R(τ) reach the maximum value can be determined as the echo signal x r The transmission delay t0 between the original Chirp signal x(t) and the electronic device x(t) is t0 = argmax(R(τ)). Then, the current distance d = V × t0 / 2 between the electronic device and the target object can be determined.

[0221] Step 705, determining the screen status of the electronic device according to the current movement trend and the current distance, wherein the screen status includes whether the screen is on or off.

[0222] In an embodiment of the present application, after determining the current motion trend and the current distance between the electronic device and the target object, a joint judgment can be made based on the current motion trend and the current distance to control the screen of the electronic device to turn on or off.

[0223] As a possible implementation, the screen state of the electronic screen may be determined by:

[0224] If the current motion trend is approaching and the current distance is greater than the first distance threshold, determining that the screen state of the electronic device remains unchanged;

[0225] If the current motion trend is approaching and the current distance is less than or equal to the first distance threshold, determining that the screen state of the electronic device is off;

[0226] If the current movement trend is moving away and the current distance is greater than the first distance threshold, determining that the screen state of the electronic device is lit;

[0227] If the current movement trend is moving away and the current distance is less than or equal to the first distance threshold, determining that the screen state of the electronic device remains unchanged;

[0228] If the current motion trend is no state and the current distance is greater than the first distance threshold, determining that the screen state of the electronic device is lit;

[0229] If the current motion trend is no state and the current distance is less than or equal to the first distance threshold, it is determined that the screen state of the electronic device is off.

[0230] The first distance threshold can be determined according to actual needs and specific application scenarios, and the present application embodiment does not limit this. For example, the first distance threshold can be 5 cm.

[0231] It is understandable that if Fig.14As shown, if the current motion trend is approaching and the current distance is greater than the first distance threshold, it can be determined that the distance between the current electronic device and the target object is still far away, but the distance may be getting closer and closer. Therefore, no matter whether the current screen state of the electronic device is lit or off, the screen state of the electronic device can be kept unchanged; if the current motion trend is approaching and the current distance is less than or equal to the first threshold, it can be determined that the distance between the electronic device and the target object is already very close and is still in a state of continuous approach, so it can be determined that the user currently does not need to view the screen of the electronic device, so it can be determined that the current screen state of the electronic device is off, and the screen of the electronic device is controlled to be off; if the current motion trend is moving away and the current distance is greater than the first distance threshold, it can be determined that the distance between the electronic device and the target object is far away and is moving away from the target object, that is, the current user may need to view the screen, so the screen state of the electronic device can be lit, and the screen of the electronic device can be controlled to light up; if the current motion trend is moving away and the current distance is less than or equal to the first distance threshold, it can be Determine that the current electronic device is moving away from the target object, but the distance is still relatively close, the user may not have the need to view the screen at present, and the screen state of the current electronic device may be in the screen-off state, so the screen state of the electronic device can be kept unchanged; if the current motion trend is no state, the screen state of the electronic device can be determined according to the current distance, that is, if the current motion trend is no state and the current distance is greater than the first distance threshold, it can be determined that the electronic device may be currently stationary or moving with a small amplitude, and the distance between the electronic device and the target object is large, so it can be determined that the user may currently have the need to view the screen, so that the screen state of the electronic device can be determined to be lit, and the screen of the electronic device can be controlled to light up; if the current motion trend is no state and the current distance is less than or equal to the first distance threshold, it can be determined that the electronic device may be currently stationary or moving with a small amplitude, and the distance between the electronic device and the target object is small, so it can be determined that the user may not have the need to view the screen at present, so that the screen state of the electronic device can be determined to be off, and the screen of the electronic device can be controlled to turn off;

[0232] The screen state control method provided in the embodiment of the present application is to continuously and repeatedly transmit multiple frames of original Chirp signals when the ranging scene is triggered, and collect echo signals corresponding to the multiple frames of original Chirp signals, and then determine the current motion trend and current distance between the electronic device and the target object based on the echo signal and the original Chirp signal, and then determine the screen state of the electronic device according to the current motion trend and current distance. Thus, the Chirp signal is emitted by the existing devices (such as speakers and microphones) in the electronic device and the echo signal corresponding to the Chirp signal is received, so as to detect the motion trend and distance between the electronic device and the target object through ultrasonic signals, and the screen state of the electronic device is jointly controlled in combination with the motion trend determination result and the distance determination result, so that not only does it not need to add additional devices, but also saves the manufacturing cost of the electronic device and improves the reliability of screen state control.

[0233] Combine the following Fig.15 , the screen status control method provided in the embodiment of the present application is further explained.

[0234] Fig.15 A flow chart of another method for controlling screen status provided in an embodiment of the present application is shown.

[0235] like Fig.15 As shown, the method for controlling the screen state includes the following steps:

[0236] Step 1501: When a ranging scenario is triggered, multiple frames of original Chirp signals are continuously and repeatedly transmitted.

[0237] Step 1502: Acquire echo signals corresponding to multiple frames of original Chirp signals, wherein the echo signals include signals of the multiple frames of original Chirp signals reflected by the target object.

[0238] The specific implementation process and principle of the above steps 1501-1502 can be referred to the detailed description of the above embodiment, which will not be repeated here.

[0239] Step 1503: Determine the signal characteristics of the effective channel in the detection sensing area based on the echo signal and the original Chirp signal.

[0240] Among them, the effective channel is determined based on the bandwidth and signal propagation speed of the original Chirp signal, as well as the specified constraint distance. The signal characteristics are related to the amplitude and phase change information of the echo signal. The specified constraint distance is used for electronic devices to identify the current movement trend.

[0241] In the embodiment of the present application, the signal feature is related to the amplitude and phase change information of the echo signal, that is, the signal feature is not only related to the amplitude of the echo signal, but also to the phase difference.

[0242] Among them, the specified constraint distance can be used for electronic devices to identify the approaching state or the distant state, that is, a hard requirement for indicating the approaching or distant state of the electronic device. The specified constraint distance can be set according to the judgment requirements of the screen on and off switching, and the effective judgment distance for approaching and the effective judgment distance for distant can be constrained, thereby constraining the range size of the detection sensing area. As an example and not a limitation, assuming that the specified constraint distance is 5cm, the range of the detection sensing area can generally be (0cm, 10cm), wherein the effective judgment distance for approaching can be (0cm, 5cm), and the effective judgment distance for distant is (5cm, 10cm), that is, if the target object is within the range of (0cm, 5cm) of the detection sensing area, the movement trend can be determined to be approaching, conversely, if the target object is within the range of (5cm, 10cm) of the detection sensing area, the movement trend can be determined to be distant.

[0243] Among them, the number of effective channels may be one or more, and the number of effective channels is related to the bandwidth of the selected original Chirp signal and the specified constraint distance. Specifically, based on the previous records, when the bandwidth of the original Chirp signal used is different, the effective distance represented by the unit frequency component is different. For example, when the original Chirp signal with a bandwidth of 3.4K is selected, the effective distance represented by the unit frequency component is 5cm. When the original Chirp signal with a bandwidth of 6.8K is selected, the effective distance represented by the unit frequency component is 2.5cm. Therefore, when the specified constraint distance remains unchanged, when the bandwidth of the original Chirp signal used is different, the channels (effective channels) that need to be analyzed are different because the effective distances represented by the unit frequency components are different. Please refer to Fig.16 , Fig.16: is a schematic diagram of signal data distribution after fast Fourier transformation according to an exemplary embodiment, wherein each row corresponds to signal data of different frames of a single channel, and each column corresponds to signal data of a single frame. Since the distances represented by each channel after fast Fourier transformation are Nan (first channel), 0~d (second channel), d~2d (third channel), 2d~3d (fourth channel), ..., etc., in one example, when the specified constraint distance is 5cm, if the effective distance represented by the unit frequency component is 5cm, the selected effective channels to be analyzed may 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 channel and the third channel. channel; if the effective distance represented by the unit frequency component is 2.5cm, the selected effective channels to be analyzed may include (0, 2.5cm), (2.5, 5cm), (5, 7.5cm), (7.5, 10cm), that is, the effective channels at this time include the second channel, the third channel, the fourth channel and the fifth channel, or when the effective distance represented by the unit frequency component is 2.5cm, the selected effective channels to be analyzed may also include (0, 2.5cm), (2.5, 5cm) and (5, 7.5cm), that is, the effective channels at this time include the second channel, the third channel and the fourth channel. The specific selection can be made according to actual needs, and the selected distance only needs to include the range within 5cm and outside 5cm.

[0244] As an example of the present application, the specific implementation of determining the signal characteristics of the effective channel in the detection sensing area based on the echo signal and the original Chrip signal may include:

[0245] During the signal acquisition process, each time a frame of echo signal is acquired, the first echo signal is coherently demodulated based on the original Chirp signal corresponding to the first echo signal to obtain a coherent demodulated signal corresponding to the first echo signal, wherein the first echo signal is a frame of echo signal currently acquired;

[0246] Performing fast Fourier transform processing on the coherent demodulation signal corresponding to the first echo signal to obtain a first Fourier transform result corresponding to the first echo signal;

[0247] The signal characteristics of the effective channel at the current moment are determined according to the first Fourier transform result and the second Fourier transform result corresponding to the second echo signal, wherein the second echo signal is a frame of echo signal collected last time.

[0248] like Fig.10As shown, in the process of echo signal acquisition, each time a frame of echo signal is fully cached, a frame of echo signal (i.e., the first echo signal) currently cached is conjugate-multiplied with a frame of original Chirp signal corresponding to the first echo signal to coherently demodulate the first echo signal, thereby de-skewing the first echo signal to obtain a coherent demodulated signal corresponding to the first echo signal. Afterwards, a fast Fourier transform is performed on the coherent demodulated signal corresponding to the first echo signal to obtain a first Fourier transform result. When the length of the first echo signal is N, the first Fourier transform result is a complex number of N sampling points, and each sampling point corresponds to a channel. Afterwards, the signal characteristics of the effective channel at the current moment can be determined from the N channels based on the first Fourier transform result and the second Fourier transform result corresponding to the second echo signal of the previous frame.

[0249] As an example of the present application, according to the first Fourier transform result and the second Fourier transform result corresponding to the second echo signal, the specific implementation of determining the signal characteristics of the effective channel at the current moment may include: obtaining the channel impulse response (CIR) data of the effective channel in the first Fourier transform result to obtain the first CIR data, and obtaining the CIR data of the effective channel in the second Fourier transform result to obtain the second CIR data. Based on the first CIR data and the second CIR data, the third CIR data is determined, and the third CIR data represents the dynamic information of the effective channel at the current moment. Based on the third CIR data and the fourth CIR data, the signal characteristics of the effective channel at the current moment are determined, and the fourth CIR data is the data determined last time for representing the dynamic information of the effective channel.

[0250] As mentioned above, the Fourier transform result is a complex number of N sampling points. For example, the CIR data of each channel after the fast Fourier transform is Z i ={z1,z2,…,z N}, where Z i is the CIR data of the ith channel, and each element is a complex number, representing different frames. The ranging management module obtains the first CIR data of the effective channel in the first Fourier transform result, and obtains the second CIR data of the effective channel in the second Fourier transform result, subtracts the first CIR data from the second CIR data to perform static elimination on the effective channel signal, that is, perform a first-order difference operation, and obtains the third CIR data used to represent the dynamic information of the effective channel at the current moment. For example, the third CIR data is S i , S i =z i -z i-1 =a t +b t j, where z i is the first CIR data, zi-1 It is easy to understand that for the second echo signal, the fourth CIR data corresponding to the second echo signal can also be determined in the above manner, and then the signal characteristics of the effective channel at the current moment can be determined using the dynamic information of the previous and next frames of the effective channel.

[0251] As an example of the present application, a specific implementation of determining the signal characteristics of the valid channel at the current moment based on the third CIR data and the fourth CIR data may include: determining phase change information based on the third CIR data and the fourth CIR data, the phase change information being used to indicate the rotation direction of the third CIR data relative to the fourth CIR data in the complex plane coordinate system. Determine the signal characteristics of the valid channel at the current moment based on the phase change information and the amplitude corresponding to the third CIR data.

[0252] Specifically, after the third CIR data is conjugate multiplied with the fourth CIR data, if the result of the conjugate multiplication is positive, the phase change information is positive, for example, the phase change information is 1, which indicates that the third CIR data rotates in the opposite direction relative to the fourth CIR data in the complex plane, indicating that the phase difference increases, thereby indicating that the echo signal frequency increases, and further indicating that the distance increases. If the result of the conjugate multiplication is negative, the phase change information is negative, for example, the phase change information is -1, which indicates that the third CIR data rotates in the positive direction relative to the fourth CIR data in the complex plane, indicating that the phase difference decreases, thereby indicating that the echo signal frequency decreases, and further indicating that the distance decreases.

[0253] Determining 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 includes: determining the amplitude corresponding to the third CIR data, multiplying the phase change information by the amplitude, and obtaining 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 is the phase change information, is the amplitude corresponding to the third CIR data. That is, the signal feature is inverted relative to the phase change information. When the phase difference is positive, the signal feature is negative, and when the phase difference is negative, the signal feature is positive.

[0254] According to the above method, each time a frame of echo signal is received, a signal feature of the effective channel can be determined. During the signal reception process, multiple signal features of the effective channel can be determined, or in other words, multiple frames of signal features can be determined, and each frame of signal features is a signal feature.

[0255] It should be noted that, when there are multiple valid channels, the signal characteristics of each of the multiple valid channels can be determined according to the above process. Fig.17 , Fig.17It is a schematic diagram of signal characteristics of a second channel and a third channel provided in an embodiment of the present application.

[0256] It is worth mentioning that when determining the signal characteristics, the embodiment of the present application determines the signal characteristics of the effective channel to be analyzed based on the effective distance represented by the unit frequency component and the specified constraint distance, avoiding the need to analyze other irrelevant signal data. And the signal characteristics are related to the amplitude and phase change information of the coherent demodulation signal of the echo signal, and can be effectively analyzed within the detection sensing area, thereby improving the reliability of subsequent analysis.

[0257] Step 1504: determine the current motion trend according to the signal characteristics of the effective channel.

[0258] As mentioned above, the number of effective channels may be one or more. When the number of effective channels is more than one, as an example of the present application, the specific implementation of determining the current motion trend of the target object relative to the electronic device according to the signal characteristics of the effective channels may include:

[0259] Performing mean filtering processing on the signal characteristics of each effective channel in the multiple effective channels respectively;

[0260] Cache the signal characteristics of each valid channel after mean filtering;

[0261] In the process of caching the signal features, a sliding window having a window length of a first preset length and a sliding step length of a second preset length is used to obtain the signal features of each valid channel from the cached signal features, wherein the first preset length includes M frames of signal features, M is an integer greater than 1, and the second preset length is greater than the first preset length;

[0262] If the sum of the signal characteristics of any valid channel in the sliding window satisfies the first preset condition, and the sum of the signal characteristics of all valid channels in the sliding window satisfies the second preset condition, then the number of signal characteristic frames greater than the first threshold in each valid channel in the sliding window is counted to obtain the first signal characteristic frame number, and the number of signal characteristic frames less than the second threshold in each valid channel in the sliding window is counted to obtain the second signal characteristic frame number;

[0263] The current motion trend is determined based on a first preset condition satisfied by the sum of signal features of any valid channel in the sliding window, a second preset condition satisfied by the sum of signal features of all valid channels in the sliding window, the first signal feature frame number, and the second signal feature frame number.

[0264] Among them, the first preset length can be set according to needs. Since the first preset length includes M frames of signal characteristics, it is not difficult to understand that the size of the first preset length determines the size of M. For example, the first preset length includes 20 frames of signal characteristics.

[0265] The second preset length can be set according to demand. For example, the second preset length is M+b frames, and b can be set according to demand, for example, b is 5 frames.

[0266] The first preset condition and the second preset condition can be set according to requirements.

[0267] The first threshold value may be set as required, and the second threshold value may also be set as required.

[0268] That is, when there are multiple valid channels, in the process of determining the signal characteristics of each valid channel, the signal characteristics can be mean filtered, and the signal characteristics after mean filtering can be cached. In the process of caching signal characteristics, the ranging management module uses a sliding window with a window length of a first preset length and a sliding distance of a second preset length to obtain M-frame signal characteristics of each valid channel from the cached signal characteristics. Each time M-frame signal characteristics are obtained, the sum of the M-frame signal characteristics of each valid channel in the multiple valid channels and the sum of all signal characteristics in the multiple valid channels can be determined. When the sum of the M-frame signal characteristics of any valid channel in the multiple valid channels meets the first preset condition, and the sum of all signal characteristics of the multiple valid channels meets the second preset condition, the number of frames of signal characteristics greater than the first threshold in the M-frame signal characteristics of each valid channel in the multiple valid channels is counted to obtain the first signal characteristic frame number, and the number of signal characteristic frames less than the second threshold in the M-frame signal characteristics of each valid channel is counted to obtain the second signal characteristic frame number. Afterwards, based on a first preset condition satisfied by the sum of signal characteristics of any valid channel in the sliding window, a second preset condition satisfied by the sum of signal characteristics of all valid channels in the sliding window, the first signal characteristic frame number, and the second signal characteristic frame number, the current movement trend of the electronic device relative to the target object is determined.

[0269] It should be noted that if the sum of the signal characteristics of no valid channel among the multiple valid channels in the sliding window satisfies the first preset condition, and / or the sum of the signal characteristics of all the valid channels in the sliding window does not satisfy the second preset condition, then the number of first signal feature frames and the number of second signal feature frames may not be counted. In this case, the current judgment is terminated, that is, the motion trend judgment is not performed based on the signal characteristics in the current sliding window, and the signal characteristics of the next sliding window are obtained to perform the next motion trend judgment.

[0270] As an example of the present application, according to the first preset condition satisfied by the sum of the signal characteristics of any valid channel in the sliding window, the second preset condition satisfied by the sum of the signal characteristics of all valid channels in the sliding window, the first signal feature frame number and the second signal feature frame number, determining the current motion trend of the electronic device relative to the target object specifically includes the following two cases:

[0271] The first case: when the sum of the signal characteristics of any valid channel in the sliding window is greater than the third threshold, and the sum of the signal characteristics of all valid channels in the sliding window is greater than the fourth threshold, if the first signal feature frame number is greater than the first signal feature frame number threshold, and the second signal feature frame number is less than the second signal feature frame number threshold, then it is determined that the current motion trend of the electronic device relative to the target object is approaching.

[0272] The third threshold and the fourth threshold can be set according to the requirements. As an example of the present application, the third threshold and the fourth threshold are both positive numbers.

[0273] When the sum of the signal features of any valid channel in the sliding window is greater than the third threshold, and the sum of the signal features of all valid channels in the sliding window is greater than the fourth threshold, it indicates that the displacement intensity of the target object relative to the electronic device is large, that is, it can be determined that the target object has been continuously displaced relative to the electronic device. In this case, the displacement can be determined to be close or far away according to the first signal feature frame number and the second signal feature frame number to determine the movement trend. Since the signal feature and the phase change information are negated, when the signal feature is a positive number, it indicates that it is close. Therefore, if the first signal feature frame number is greater than the first signal feature frame number threshold, that is, the number of frames of signal features greater than the first threshold in the M frame signal features of each valid channel is the majority, which indicates that more signal features indicate that the target object is approaching the electronic device. In addition, since there may be a small shake or shake, or an accidental touch during the approach process, there will be a few frames of signal features less than the second threshold. Therefore, when the first signal feature frame number is greater than the first signal feature frame number threshold, and the second signal feature frame number is less than the second signal feature frame number threshold, it can be determined that the current movement trend of the electronic device relative to the target object is close.

[0274] The second case: when the sum of the signal characteristics of any valid channel in the sliding window is less than the fifth threshold, and the sum of the signal characteristics of all valid channels in the sliding window is less than the sixth threshold, if the first signal feature frame number is less than the second signal feature frame number threshold, and the second signal feature frame number is greater than the first signal feature frame number threshold, it is determined that the current movement trend is moving away.

[0275] The fifth threshold value may be set according to actual needs. As an example of the present application, the fifth threshold value may be the product of the third threshold value and -1.

[0276] The sixth threshold value may be set according to actual needs. As an example of the present application, the sixth threshold value may be the product of the fourth threshold value and -1.

[0277] When the sum of the signal features of any valid channel in the sliding window is less than the fifth threshold, and the sum of the signal features of all valid channels in the sliding window is less than the sixth threshold, it means that the displacement intensity of the electronic device relative to the target object is large, that is, it can be determined that the electronic device has undergone continuous displacement relative to the target object. In this case, the displacement generated can be determined to be close or far away according to the first signal feature frame number and the second signal feature frame number to determine the current motion trend. Since the signal feature is negative when it indicates that it is far away, if the second signal feature frame number is greater than the first signal feature frame number threshold, that is, the number of frames of signal features less than the second threshold in the M frames of signal features of each valid channel accounts for the majority, it means that more signal features mean that the electronic device is far away from the target object. In addition, since there may be small jitters or shakes, or accidental touches during the process of moving away, there will be a few frames of signal features greater than the first threshold. Therefore, when the first signal feature frame number is less than the second signal feature frame number threshold, and the second signal feature frame number is greater than the first signal feature frame number threshold, it can be determined that the current motion trend of the electronic device relative to the target object is far away.

[0278] For example, multiple valid channels include a first channel and a second channel, M is 20, a first threshold is Q1, a second threshold is Q2, a third threshold is Q3, a fourth threshold is Q4, a first signal feature frame number threshold is P1, a second signal feature frame number threshold is P2, a fifth threshold is -1×Q3, and a sixth threshold is -1×Q4. In the judgment process, 20 frames of signal features after mean filtering in the first channel and 20 frames of signal features after mean filtering in the second channel are obtained respectively. Then, analysis is performed based on the acquired 40 frames of signal features. Specifically, in one case, if the following conditions 1 and 2 are met, it is determined that the current motion trend of the electronic device relative to the target object is approaching: 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 Q3, and the sum of the 40 frames of signal features of the first channel and the second channel is greater than Q4; Condition 2 is that the number of frames of signal features greater than Q1 in the 20 frames of signal features of the first channel is greater than P1, the number of frames of signal features greater than Q1 in the 20 frames of signal features of the second channel is greater than P1, the number of frames of 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 of 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, it is determined that the current movement trend of the electronic device relative to the target object is moving away: Condition 3 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 less than -1×Q3, and the sum of the 40 frames of signal features of the first channel and the second channel is less than -1×Q4; Condition 4 is that the number of frames of signal features less than Q2 in the 20 frames of signal features of the first channel is greater than P1, the number of frames of signal features less than Q2 in the 20 frames of signal features of the second channel is greater than P1, the number of frames of signal features greater than Q1 in the 20 frames of signal features of the first channel is less than P2, and the number of frames of signal features greater than Q1 in the 20 frames of signal features of the second channel is less than P2.

[0279] It is worth mentioning that in the process of judging the motion trend based on the signal characteristics of multiple valid channels, the displacement intensity is determined based on the sum of the channel characteristics of the valid channels. When the displacement intensity is determined to be large, the displacement is determined to be close or far away based on the continuous signal characteristics of each valid channel. Compared with the judgment method directly based on absolute distance, the accuracy of screen state control is improved. In addition, when judging based on the signal characteristics of a single valid channel, the situation where a few signal characteristics caused by small jitters or shaking are different from the actual motion trend is also considered, which can avoid the problem of miscontrol of the screen state in non-occluded shaking scenes and accidental touch scenes, improve recognition accuracy, and avoid problems such as abnormal screen failure in non-occluded shaking scenes and accidental touch scenes.

[0280] It should be noted that the motion trend determination method in the first case and the second case described above is only an optional implementation method. In another example, according to the first preset condition satisfied by the sum of the signal characteristics of any valid channel in the sliding window, the second preset condition satisfied by the sum of the signal characteristics of all valid channels in the sliding window, the first signal feature frame number and the second signal feature frame number, the specific implementation of determining the current motion trend of the electronic device relative to the target object may also include:

[0281] In the case where the sum of the signal characteristics of any valid channel in the sliding window is greater than the third threshold value, and the sum of the signal characteristics of all valid channels in the sliding window is greater than the fourth threshold value, if the first signal characteristic frame number is greater than the first signal characteristic frame number threshold value, then the current motion trend of the electronic device relative to the target object is determined to be approaching. Alternatively, in the case where the sum of the signal characteristics of any valid channel in the sliding window is less than the fifth threshold value, and the sum of the signal characteristics of all valid channels in the sliding window is less than the sixth threshold value, if the second signal characteristic frame number is greater than the first signal characteristic frame number threshold value, then the current motion trend of the electronic device relative to the target object is determined to be moving away.

[0282] It should also be noted that the above description is based on the example that the number of effective channels is multiple. In another example, when the number of effective channels is one, the specific implementation of determining the movement trend of the electronic device relative to the target object based on the signal characteristics of the effective channel may include:

[0283] The signal characteristics of the effective channel are processed by mean filtering. The signal characteristics of the effective channel after mean filtering are cached. The signal characteristics of the effective channel are obtained from the cached signal characteristics using a sliding window with a window length of a first preset length and a sliding step length of a second preset length. If the sum of the signal characteristics of the effective channel in the sliding window is greater than the third threshold, and the number of signal characteristic frames greater than the first threshold in the effective channel in the sliding window is greater than the first signal characteristic frame number threshold, and the number of signal characteristic frames less than the second threshold in the effective channel in the sliding window is less than the second signal characteristic frame number threshold, then it is determined that the current movement trend of the electronic device relative to the target object is approaching. Otherwise, if the sum of the signal characteristics of the effective channel in the sliding window is less than the fifth threshold, and the number of signal characteristic frames greater than the first threshold in the effective channel in the sliding window is less than the second signal characteristic frame number threshold, and the number of signal characteristic frames greater than the second threshold in the effective channel in the sliding window is greater than the first signal characteristic frame number threshold, then it is determined that the current movement trend of the electronic device relative to the target object is moving away.

[0284] Step 1505: Determine the current distance between the electronic device and the target object based on the echo signal and the original Chirp signal.

[0285] Step 1506, determining the screen status of the electronic device according to the current movement trend and the current distance, wherein the screen status includes whether the screen is on or off.

[0286] The specific implementation process and principle of the above steps 1505-1506 can be referred to the detailed description of the above embodiment, which will not be repeated here.

[0287] The screen state control method provided by the embodiment of the present application is to continuously and repeatedly transmit multiple frames of original Chirp signals when the ranging scene is triggered, and collect echo signals corresponding to the multiple frames of original Chirp signals, and then determine the signal characteristics of the effective channel in the detection sensing area based on the echo signal and the original Chirp signal, and determine the current motion trend of the electronic device relative to the target object based on the signal characteristics of the effective channel, and determine the current distance between the electronic device and the target object based on the echo signal and the original Chirp signal, and then determine the screen state of the electronic device according to the current motion trend and the current distance. Therefore, since the effective channel is determined based on the bandwidth and signal propagation speed of the original Chirp signal and the specified constraint distance, the specified constraint distance is used for the electronic device to identify the approaching state or the distant state, that is, the signal characteristics of the channel that can represent the effective distance in the detection sensing area are selected for analysis, and since the signal characteristics are related to the amplitude and phase change information of the echo signal, the accuracy of the analysis can be improved, and the accuracy of the screen state control is improved, so that the problem of false screen off can be avoided, and the reliability of the screen state control is further improved.

[0288] In addition, since most electronic devices are equipped with a signal transmitter and a signal receiver for ultrasonic signals, the method provided in the embodiment of the present application can be widely used in various electronic devices without adding additional devices, thereby saving hardware costs.

[0289] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0290] Corresponding to the screen state control method described in the above embodiment, Fig.18 A structural block diagram of a screen status control device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0291] Reference Fig.18 , the device 1800, comprises:

[0292] The first transmitting module 1801 is used to continuously and repeatedly transmit multiple frames of original Chirp signals when a ranging scenario is triggered;

[0293] The first acquisition module 1802 is used to acquire echo signals corresponding to multiple frames of original Chirp signals, wherein the echo signals include signals reflected by the target object from the multiple frames of original Chirp signals;

[0294] A first determination module 1803 is used to determine the current movement trend of the electronic device relative to the target object based on the echo signal and the original Chirp signal;

[0295] A second determination module 1804 is used to determine the current distance between the electronic device and the target object based on the echo signal and the original Chirp signal;

[0296] The third determination module 1805 is used to determine the screen status of the electronic device according to the current movement trend and the current distance, wherein the screen status includes on or off.

[0297] In actual use, the screen status control device provided in the embodiment of the present application can be configured in any electronic device to execute the aforementioned screen status control method.

[0298] The screen state control device provided in the embodiment of the present application continuously and repeatedly transmits multiple frames of original Chirp signals when the ranging scene is triggered, and collects echo signals corresponding to the multiple frames of original Chirp signals, and then determines the current motion trend and current distance between the electronic device and the target object based on the echo signals and the original Chirp signals, and then determines the screen state of the electronic device according to the current motion trend and current distance. Thus, the Chirp signal is emitted by the existing devices (such as speakers and microphones) in the electronic device and the echo signal corresponding to the Chirp signal is received, so as to detect the motion trend and distance between the electronic device and the target object through ultrasonic signals, and the screen state of the electronic device is jointly controlled in combination with the motion trend determination result and the distance determination result, so that not only does it not need to add additional devices, but also saves the manufacturing cost of the electronic device and improves the reliability of screen state control.

[0299] In a possible implementation of the present application, the current motion trend includes approaching, moving away, and no state; accordingly, the third determination module 1805 includes:

[0300] A first determining unit, configured to determine that the screen state of the electronic device remains unchanged if the current motion trend is close and the current distance is greater than a first distance threshold;

[0301] A second determining unit, configured to determine that the screen state of the electronic device is off if the current motion trend is close and the current distance is less than or equal to the first distance threshold;

[0302] A third determining unit, configured to determine that the screen state of the electronic device is lit if the current movement trend is moving away and the current distance is greater than a first distance threshold;

[0303] a fourth determining unit, configured to determine that the screen state of the electronic device remains unchanged if the current movement trend is moving away and the current distance is less than or equal to the first distance threshold;

[0304] a fifth determining unit, configured to determine that the screen state of the electronic device is lit if the current motion trend is no state and the current distance is greater than a first distance threshold;

[0305] The sixth determination unit is used to determine that the screen state of the electronic device is off if the current motion trend is no state and the current distance is less than or equal to the first distance threshold.

[0306] Furthermore, in another possible implementation of the present application, the second determining module 1804 includes:

[0307] A seventh determination unit, configured to perform cross-correlation calculation on the echo signal and the original Chirp signal to determine a transmission delay between the echo signal and the original Chirp signal;

[0308] The eighth determining unit is used to determine the current distance according to the transmission delay and the signal propagation speed.

[0309] Furthermore, in another possible implementation of the present application, the first determining module 1803 includes:

[0310] a ninth determination unit, configured to determine a signal characteristic of an effective channel in the detection sensing area based on the echo signal and the original Chirp signal, wherein the effective channel is determined based on a bandwidth and a signal propagation speed of the original Chirp signal and a specified constraint distance, the signal characteristic is related to the amplitude and phase change information of the echo signal, and the specified constraint distance is used for the electronic device to identify a current motion trend;

[0311] The tenth determining unit is used to determine the current motion trend according to the signal characteristics of the effective channel.

[0312] Furthermore, in another possible implementation of the present application, the ninth determining unit is specifically configured to:

[0313] During the signal acquisition process, each time a frame of echo signal is acquired, the first echo signal is coherently demodulated based on the original Chirp signal corresponding to the first echo signal to obtain a coherent demodulated signal corresponding to the first echo signal, wherein the first echo signal is a frame of echo signal currently acquired;

[0314] Performing fast Fourier transform processing on the coherent demodulation signal corresponding to the first echo signal to obtain a first Fourier transform result corresponding to the first echo signal;

[0315] The signal characteristics of the effective channel at the current moment are determined according to the first Fourier transform result and the second Fourier transform result corresponding to the second echo signal, wherein the second echo signal is a frame of echo signal collected last time.

[0316] Furthermore, in another possible implementation of the present application, the ninth determining unit is further configured to:

[0317] Acquire channel impulse response CIR data of the effective channel in the first Fourier transform result to obtain first CIR data;

[0318] Acquire CIR data of the effective channel in the second Fourier transform result to obtain second CIR data;

[0319] 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;

[0320] Based on the third CIR data and the fourth CIR data, the signal characteristics of the effective channel at the current moment are determined, wherein the fourth CIR data is the data determined last time for representing the dynamic information of the effective channel.

[0321] Furthermore, in another possible implementation of the present application, the ninth determining unit is further configured to:

[0322] Determine phase change information based on the third CIR data and the fourth CIR data, wherein 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;

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

[0324] Furthermore, in another possible implementation of the present application, the tenth determining unit is specifically configured to:

[0325] Performing mean filtering processing on the signal characteristics of each effective channel in the multiple effective channels respectively;

[0326] Cache the signal characteristics of each valid channel after mean filtering;

[0327] In the process of caching the signal features, a sliding window having a window length of a first preset length and a sliding step length of a second preset length is used to obtain the signal features of each valid channel from the cached signal features, wherein the first preset length includes M frames of signal features, M is an integer greater than 1, and the second preset length is greater than the first preset length;

[0328] If the sum of the signal characteristics of any valid channel in the sliding window satisfies the first preset condition, and the sum of the signal characteristics of all valid channels in the sliding window satisfies the second preset condition, then the number of signal characteristic frames greater than the first threshold in each valid channel in the sliding window is counted to obtain the first signal characteristic frame number, and the number of signal characteristic frames less than the second threshold in each valid channel in the sliding window is counted to obtain the second signal characteristic frame number;

[0329] The current motion trend is determined based on the first preset condition satisfied by the sum of signal characteristics of any valid channel in the sliding window, the second preset condition satisfied by the sum of signal characteristics of all valid channels in the sliding window, the first signal feature frame number and the second signal feature frame number.

[0330] Furthermore, in another possible implementation of the present application, the tenth determining unit is further configured to:

[0331] When the sum of the signal characteristics of any valid channel in the sliding window is greater than the third threshold, and the sum of the signal characteristics of all valid channels in the sliding window is greater than the fourth threshold, if the first signal characteristic frame number is greater than the first signal characteristic frame number threshold, and the second signal characteristic frame number is less than the second signal characteristic frame number threshold, it is determined that the current motion trend is close;

[0332] When the sum of the signal characteristics of any valid channel in the sliding window is less than the fifth threshold, and the sum of the signal characteristics of all valid channels in the sliding window is less than the sixth threshold, if the first signal feature frame number is less than the second signal feature frame number threshold, and the second signal feature frame number is greater than the first signal feature frame number threshold, it is determined that the current motion trend is moving away.

[0333] Furthermore, in another possible implementation of the present application, the first acquisition module 1802 includes:

[0334] A first receiving unit, configured to receive initial echo signals corresponding to multiple frames of original Chirp signals through a signal receiver;

[0335] A first filtering unit, used for filtering the initial echo signal to obtain high-frequency information of the initial echo signal;

[0336] The first acquisition unit is used to acquire high-frequency information of the initial echo signal as an echo signal.

[0337] Furthermore, in another possible implementation of the present application, the apparatus 1800 further includes:

[0338] The second transmitting module is used to transmit K frames of original flag signals, wherein the original flag signal is a signal generated by timing inverting the original Chirp signal, and the transmission time interval between the K frame flag signal and multiple frames of original Chirp signals is a preset duration, and K is a positive integer.

[0339] Furthermore, in another possible implementation of the present application, the apparatus 1800 further includes:

[0340] The first receiving module is used to receive a flag bit echo signal corresponding to the original flag bit signal of the K frame through a signal receiver;

[0341] The first alignment module is used to perform signal alignment based on the flag echo signal and the flag signal.

[0342] Furthermore, in another possible implementation of the present application, the first alignment module includes:

[0343] A first similarity calculation unit is used for performing similarity calculation based on the original flag position signal and the flag position echo signal by stepwise displacement with a third preset length as displacement each time a frame of the flag position echo signal is received;

[0344] A first cache unit is used to cache each similarity score obtained after each similarity calculation during the calculation process;

[0345] A first search unit is used to use a similarity score sliding window with a window length of a fourth preset length and a sliding step length of a unit sampling interval to search from the cached similarity scores for a target similarity score that is located at the center of the similarity score sliding window and is a maximum value in the similarity score sliding window;

[0346] A second cache unit is used to cache the currently found target similarity score if a target similarity score is found and a window distance between a current similarity score sliding window and a similarity score sliding window when the target similarity score was found last time is within a preset range;

[0347] The eleventh determining unit is configured to determine that the signals are aligned if, when the number of cached target similarity scores is K, the difference between the maximum value and the minimum value of all cached target similarity scores is less than the product of the minimum value and a preset value.

[0348] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0349] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0350] In order to implement the above embodiments, the present application also proposes an electronic device.

[0351] Fig.19 A schematic diagram of the structure of an electronic device according to an embodiment of the present application.

[0352] See also Fig.19 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

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

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

[0355] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

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

[0357] 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.

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

[0359] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device 100 through the power management module 141.

[0360] The power management module 141 is used to connect 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 provides power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193 and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

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

[0362] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0363] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0364] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0365] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0366] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).

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

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

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

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

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

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

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

[0374] The external memory 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 memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0375] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0376] The electronic device 100 can implement audio functions, such as music playback, recording, etc., through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D and the application processor.

[0377] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc. As an example of the present application, microphone 170C can be used as a signal receiver to receive the echo signal of the original Chirp signal reflected by the target object, or to receive the marker echo signal of the original marker signal reflected by the target object.

[0378] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, in a shooting scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0379] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0380] It should be noted that the implementation process and technical principles of the electronic device of this embodiment refer to the aforementioned explanation of the screen status control method of the embodiment of the present application, and will not be repeated here.

[0381] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0382] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0383] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0384] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0385] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0386] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0387] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0388] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for controlling screen status, It is characterized in that Used in electronic equipment, including: When the ranging scenario is triggered, a plurality of frames of original linear frequency modulation Chirp signals are continuously and repeatedly transmitted by the existing signal transmitter in the electronic device; Collecting echo signals corresponding to multiple frames of the original Chirp signals through an existing signal receiver in the electronic device, wherein the echo signals include signals of the multiple frames of the original Chirp signals reflected by the target object; Based on the echo signal and the original Chirp signal, determining a signal feature of an effective channel in a detection sensing area, wherein the effective channel is determined based on a bandwidth and a signal propagation speed of the original Chirp signal and a specified constraint distance, the signal feature is related to amplitude and phase change information of the echo signal, and the specified constraint distance is used by the electronic device to identify a current motion trend; determining a current movement trend of the electronic device relative to the target object according to a signal characteristic of the effective channel; Determine a transmission delay between the echo signal and the original Chirp signal based on the echo signal and the original Chirp signal; Determining a current distance between the electronic device and the target object according to the transmission delay and the signal propagation speed; Determining a screen state of the electronic device according to the current motion trend and the current distance, wherein the screen state includes being on or off; Wherein, determining the signal characteristics of the effective channel in the detection sensing area based on the echo signal and the original Chirp signal includes: During the signal acquisition process, each time a frame of the echo signal is acquired, the first echo signal is coherently demodulated based on the original Chirp signal corresponding to the first echo signal to obtain a coherent demodulated signal corresponding to the first echo signal, wherein the first echo signal is a frame of echo signal currently acquired; Performing fast Fourier transform processing on the coherent demodulated signal corresponding to the first echo signal to obtain a first Fourier transform result corresponding to the first echo signal; Acquire channel impulse response CIR data of the effective channel in the first Fourier transform result to obtain first CIR data; Acquire CIR data of the effective channel in a second Fourier transform result corresponding to a second echo signal to obtain second CIR data, wherein the second echo signal is a frame of echo signal collected last time; 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 valid channel at a current moment; 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 for representing dynamic information of the 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 at the current moment are determined.

2. The method according to claim 1, It is characterized in that The current motion trend includes approaching, moving away, and no state, and determining the screen state of the electronic device according to the current motion trend and the current distance includes: If the current motion trend is close and the current distance is greater than a first distance threshold, determining that the screen state of the electronic device remains unchanged; If the current motion trend is close and the current distance is less than or equal to the first distance threshold, determining that the screen state of the electronic device is off; If the current movement trend is moving away and the current distance is greater than the first distance threshold, determining that the screen state of the electronic device is lit; If the current movement trend is moving away and the current distance is less than or equal to the first distance threshold, determining that the screen state of the electronic device remains unchanged; If the current motion trend is no state and the current distance is greater than the first distance threshold, determining that the screen state of the electronic device is lit; If the current motion trend is no state and the current distance is less than or equal to the first distance threshold, it is determined that the screen state of the electronic device is off.

3. The method according to claim 1, It is characterized in that The determining, based on the echo signal and the original Chirp signal, a transmission delay between the echo signal and the original Chirp signal, comprises: A cross-correlation calculation is performed on the echo signal and the original Chirp signal to determine a transmission delay between the echo signal and the original Chirp signal.

4. The method according to claim 1, It is characterized in that The determining the current motion trend according to the signal characteristics of the effective channel includes: Performing mean filtering processing on the signal characteristics of each effective channel in the multiple effective channels respectively; Buffering the signal characteristics of each valid channel after mean filtering; In the process of caching the signal features, using a sliding window with a window length of a first preset length and a sliding step length of a second preset length, obtaining the signal features of each valid channel from the cached signal features, wherein the first preset length includes M frames of signal features, M is an integer greater than 1, and the second preset length is greater than the first preset length; If the sum of the signal characteristics of any valid channel in the sliding window satisfies the first preset condition, and the sum of the signal characteristics of all valid channels in the sliding window satisfies the second preset condition, then counting the number of signal characteristic frames greater than the first threshold in each valid channel in the sliding window to obtain the first signal characteristic frame number, and counting the number of signal characteristic frames less than the second threshold in each valid channel in the sliding window to obtain the second signal characteristic frame number; The current motion trend is determined based on the first preset condition satisfied by the sum of signal characteristics of any valid channel in the sliding window, the second preset condition satisfied by the sum of signal characteristics of all valid channels in the sliding window, the first signal feature frame number and the second signal feature frame number.

5. The method according to claim 4, It is characterized in that The determining the current motion trend according to the first preset condition satisfied by the sum of signal characteristics of any valid channel in the sliding window, the second preset condition satisfied by the sum of signal characteristics of all valid channels in the sliding window, the first signal characteristic frame number, and the second signal characteristic frame number, comprises: In the case where the sum of the signal characteristics of any valid channel in the sliding window is greater than the third threshold, and the sum of the signal characteristics of all the valid channels in the sliding window is greater than the fourth threshold, if the first signal characteristic frame number is greater than the first signal characteristic frame number threshold, and the second signal characteristic frame number is less than the second signal characteristic frame number threshold, it is determined that the current motion trend is close; When the sum of the signal characteristics of any valid channel in the sliding window is less than the fifth threshold, and the sum of the signal characteristics of all the valid channels in the sliding window is less than the sixth threshold, if the first signal feature frame number is less than the second signal feature frame number threshold, and the second signal feature frame number is greater than the first signal feature frame number threshold, it is determined that the current motion trend is moving away.

6. The method according to claim 1, It is characterized in that The collecting of echo signals corresponding to the original Chirp signals of multiple frames includes: Receive, by a signal receiver, initial echo signals corresponding to multiple frames of the original Chirp signals; Performing filtering processing on the initial echo signal to obtain high-frequency information of the initial echo signal; The high frequency information of the initial echo signal is collected as the echo signal.

7. The method according to any one of claims 1 to 6, It is characterized in that Before the continuously and repeatedly transmitting multi-frame original linear frequency modulation Chirp signal, the method further includes: Transmit K frames of original flag signals, wherein the original flag signal is a signal generated by timing inverting the original Chirp signal, and the transmission time interval between the K frame flag signal and the multiple frames of original Chirp signals is a preset duration, and K is a positive integer.

8. The method according to claim 7, It is characterized in that Before acquiring the echo signals corresponding to the original Chirp signals of multiple frames, the method further includes: Receive, by the signal receiver, a flag bit echo signal corresponding to the original flag bit signal of the K frame; Signal alignment is performed based on the marker echo signal and the marker signal.

9. The method according to claim 8, It is characterized in that The performing signal alignment based on the flag echo signal and the flag signal includes: Each time a frame of the marker echo signal is received, a third preset length is used as a displacement, and similarity calculation is performed based on the original marker signal and the marker echo signal in a stepwise displacement manner; During the calculation process, each similarity score obtained after each similarity calculation is cached; Using a similarity score sliding window with a window length of a fourth preset length and a sliding step length of a unit sampling interval, searching from the cached similarity scores for a target similarity score that is located at the center of the similarity score sliding window and is the maximum value in the similarity score sliding window; If the target similarity score is found, and the window distance between the current similarity score sliding window and the similarity score sliding window when the target similarity score was found last time is within a preset range, the currently found target similarity score is cached; When the number of cached target similarity scores is K, if the difference between the maximum value and the minimum value of all cached target similarity scores is less than the product of the minimum value and a preset value, it is determined that the signals are aligned.

10. A device for controlling screen status, It is characterized in that Used in electronic equipment, including: A first transmitting module is used to continuously and repeatedly transmit multiple frames of original linear frequency modulation Chirp signals through an existing signal transmitter in the electronic device when a ranging scenario is triggered; A first acquisition module, configured to acquire echo signals corresponding to multiple frames of the original Chirp signals through an existing signal receiver in the electronic device, wherein the echo signals include signals of the multiple frames of the original Chirp signals reflected by a target object; a ninth determination unit, configured to determine a signal feature of an effective channel in a detection sensing area based on the echo signal and the original Chirp signal, wherein the effective channel is determined based on a bandwidth and a signal propagation speed of the original Chirp signal, and a specified constraint distance, the signal feature is related to amplitude and phase change information of the echo signal, and the specified constraint distance is used by the electronic device to identify a current motion trend; a tenth determining unit, configured to determine a current movement trend of the electronic device relative to the target object according to a signal characteristic of the effective channel; A second determination module is used to determine the transmission delay between the echo signal and the original Chirp signal based on the echo signal and the original Chirp signal; and determine the current distance between the electronic device and the target object according to the transmission delay and the signal propagation speed; A third determination module is used to determine the screen state of the electronic device according to the current motion trend and the current distance, wherein the screen state includes being on or off; Wherein, the ninth determining unit is specifically used for: During the signal acquisition process, each time a frame of the echo signal is acquired, the first echo signal is coherently demodulated based on the original Chirp signal corresponding to the first echo signal to obtain a coherent demodulated signal corresponding to the first echo signal, wherein the first echo signal is a frame of echo signal currently acquired; Performing fast Fourier transform processing on the coherent demodulated signal corresponding to the first echo signal to obtain a first Fourier transform result corresponding to the first echo signal; Acquire channel impulse response CIR data of the effective channel in the first Fourier transform result to obtain first CIR data; Acquire CIR data of the effective channel in a second Fourier transform result corresponding to a second echo signal to obtain second CIR data, wherein the second echo signal is a frame of echo signal collected last time; 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 valid channel at a current moment; 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 for representing dynamic information of the 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 at the current moment are determined.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.