Control method and device
Through the combination of the first sensor and the second sensor, combined with the frequency difference of the detection signal and the feedback signal, the approach and distance of the object are accurately detected, and the problem of low ultrasonic detection accuracy in the prior art is solved and the functions of electronic equipment are improved The working state consistency and power utilization of components.
Patent Information
- Application Number
- CN202411194622.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-17
AI Technical Summary
The existing ultrasonic detection methods have low accuracy in some scenarios, which leads to electronic devices being unable to accurately detect the approach and distance of objects, resulting in the working status of functional components not in line with the actual use scenarios.
By combining the first sensor and the second sensor, the approach parameters of the object are determined by detecting the frequency difference between the signal and the feedback signal, and the working status of the functional components is assisted according to the detection results of the second sensor, ensuring that the functional components of the electronic device are in Accurate control over different distances.
It improves the accuracy of the working state of the functional components when the object is approaching or away from the electronic device, reduces false touch and power consumption, and adapts to different usage scenarios.
Smart Images

Figure CN119154964A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of control technology, and in particular to a control method and device. Background Art
[0002] Currently, some electronic devices can detect whether an object is approaching or moving away from the electronic device, and execute corresponding control instructions according to the detection results.
[0003] For example, when a user holds a mobile communication device to make a call, the mobile communication device can detect that the user's face is close to the device, execute a screen-off command, and control the display screen of the mobile communication device to turn off. When the call ends, the mobile communication device can detect that the user's face is away from the device, and execute a screen-on command to turn on the display screen.
[0004] One way to implement this function is that the device transmits ultrasonic waves, receives reflected ultrasonic echoes, and detects the approach and distance of objects based on the ultrasonic waves and ultrasonic echoes. However, this detection method has low accuracy in some scenarios. Summary of the invention
[0005] To this end, this application discloses the following technical solutions:
[0006] The first aspect of the present application provides a control method, comprising:
[0007] detecting a first proximity parameter between the electronic device and an object within a first distance according to the first sensor;
[0008] When the first proximity parameter indicates that the object is approaching or moving away from the electronic device, controlling the working state of the functional component of the electronic device according to the first proximity parameter;
[0009] When the first proximity parameter indicates that the object is stationary relative to the electronic device, obtaining a second proximity parameter according to a second sensor of the electronic device, the second proximity parameter indicating whether there is an object within a second distance of the electronic device, the second distance being smaller than the first distance;
[0010] The working state of the functional component of the electronic device is controlled according to the second proximity parameter.
[0011] Optionally, the detecting, according to the first sensor, a first proximity parameter between the electronic device and an object within a first distance includes:
[0012] transmitting a detection signal;
[0013] When there is an object within a first distance of the electronic device, obtaining, by the first sensor, a feedback signal generated by the object based on the detection signal;
[0014] A first proximity parameter of the object is determined based on the frequency of the detection signal and the frequency of the feedback signal.
[0015] Optionally, determining the first proximity parameter of the object according to the frequency of the detection signal and the frequency of the feedback signal includes:
[0016] When the frequency of the feedback signal is consistent with the frequency of the detection signal, determining a first proximity parameter of the object as that the object is stationary relative to the electronic device;
[0017] When the frequency of the feedback signal is greater than the frequency of the detection signal, determining a first proximity parameter of the object as the object approaching the electronic device;
[0018] When the frequency of the feedback signal is less than the frequency of the detection signal, it is determined that the first proximity parameter of the object is that the object is far away from the electronic device.
[0019] Optionally, also include:
[0020] When it is determined based on the second proximity parameter that the object at the second distance disappears, obtaining the first proximity parameter and the second proximity parameter within a target time length according to the first sensor and the second sensor;
[0021] The electronic device is controlled according to the first proximity parameter and the second proximity parameter obtained within the target time period.
[0022] Optionally, controlling the electronic device according to the first proximity parameter and the second proximity parameter obtained within the target duration includes:
[0023] When the first proximity parameter within the target duration indicates that the object is far away from the electronic device, controlling the working state of the functional component of the electronic device according to the first proximity parameter within the target duration;
[0024] When the second proximity parameter within the target duration indicates that there is an object within the second distance, controlling the working state of the functional component of the electronic device according to the second proximity parameter within the target duration;
[0025] When the first proximity parameter within the target duration represents that the object is stationary relative to the electronic device, the working state of the functional component of the electronic device is controlled according to the second proximity parameter within the target duration.
[0026] Optionally, the detecting, according to the first sensor, a first proximity parameter between the electronic device and an object within a first distance includes:
[0027] In response to the target function of the electronic device being activated, a first proximity parameter between the electronic device and an object within a first distance is detected according to a first sensor.
[0028] Optionally, when the first proximity parameter represents that the object is approaching or moving away from the electronic device, controlling the working state of a functional component of the electronic device according to the first proximity parameter includes:
[0029] When the first proximity parameter indicates that the object is close to the electronic device, controlling the screen of the electronic device to turn off;
[0030] When the first proximity parameter indicates that the object is far away from the electronic device, the screen of the electronic device is controlled to light up.
[0031] Optionally, controlling the working state of a functional component of the electronic device according to the second proximity parameter includes:
[0032] When the second proximity parameter indicates that there is an object within the second distance, controlling the screen of the electronic device to turn off;
[0033] When the second proximity parameter indicates that there is no object within the second distance, the screen of the electronic device is controlled to light up.
[0034] Optionally, the first sensor is an ultrasonic sensor, and the second sensor is a capacitive touch sensing sensor.
[0035] A second aspect of the present application provides a control device, comprising:
[0036] a detection unit, configured to detect a first proximity parameter between the electronic device and an object within a first distance according to a first sensor;
[0037] a control unit, configured to control a working state of a functional component of the electronic device according to the first proximity parameter when the first proximity parameter indicates that the object is approaching or moving away from the electronic device;
[0038] an obtaining unit, configured to obtain, when the first proximity parameter indicates that the object is stationary relative to the electronic device, a second proximity parameter according to a second sensor of the electronic device, wherein the second proximity parameter indicates whether there is an object within a second distance of the electronic device, the second distance being smaller than the first distance;
[0039] The control unit is used to control the working state of the functional component of the electronic device according to the second proximity parameter. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0041] Figure 1 is a flow chart of a control method provided by an embodiment of the present application;
[0042] Figure 2 is a flow chart of another control method provided by an embodiment of the present application;
[0043] Figure 3 is a flow chart of another control method provided in an embodiment of the present application;
[0044] Figure 4 is a structural schematic diagram of a control device provided in an embodiment of the present application;
[0045] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] This application embodiment provides a control method, see Figure 1 , is a flow chart of the method, and the method may include the following steps.
[0048] S101: Detecting, using a first sensor, a first proximity parameter between an electronic device and an object within a first distance.
[0049] The first sensor may be a sensor installed on the electronic device for detecting whether the electronic device is close to or away from other objects in the environment. The object here may be any physical object located in front of the screen of the electronic device, such as the user's head, clothing wrapped around the electronic device, or other physical objects.
[0050] The first sensor can detect the first proximity parameter by transmitting a signal and receiving a feedback signal generated by an object in the environment reflecting the detection signal. The first sensor can detect the first proximity parameter of an object within a certain distance from the electronic device, that is, within a first distance. For an object outside the first distance, due to the long distance between the object and the electronic device, the first sensor may not receive the feedback signal because the intensity of the feedback signal is too low, resulting in the first sensor failing to detect the first proximity parameter of the object outside the first distance.
[0051] Different styles and models of first sensors may have different performances, and thus the corresponding first distances may be different. In this embodiment, the first distance may be between 50 millimeters (mm) and 100 mm.
[0052] The first proximity parameter may indicate the displacement of an object within the first distance relative to the electronic device. For example, the first proximity parameter may indicate that the object within the first distance is approaching the electronic device, i.e., the object is moving toward the electronic device. Alternatively, the first proximity parameter may indicate that the object within the first distance is moving away from the electronic device, i.e., the object is moving away from the electronic device. Alternatively, the first proximity parameter may indicate that the object within the first distance is stationary relative to the electronic device, i.e., no relative displacement occurs between the object and the electronic device.
[0053] The first sensor may detect a first proximity parameter of the object based on the Doppler effect, and the detection process may include the following steps:
[0054] transmitting a detection signal;
[0055] When an object exists within a first distance of the electronic device, obtaining a feedback signal generated by the object based on the detection signal through the first sensor;
[0056] A first proximity parameter of the object is determined according to the frequency of the detection signal and the frequency of the feedback signal.
[0057] When the first sensor is started, it can periodically emit a detection signal to the space environment where the electronic device is located according to a specific first detection cycle. When the emitted detection signal is blocked by an object in the environment, the object will reflect the detection signal to form a feedback signal from the object.
[0058] When there is an object within a first distance of the electronic device, the feedback signal generated by the object within the first distance can be received by the first sensor. Then, the first sensor can determine the frequency of the received feedback signal, compare the frequency of the feedback signal with the frequency of the emitted detection signal, and determine the first proximity parameter of the object based on the comparison result, that is, determine whether the object is in a state of being far away from the electronic device, being stationary with the electronic device, and being stationary relative to the electronic device.
[0059] When the first sensor compares the frequency of the feedback signal with the frequency of the detection signal, the first proximity parameter may be determined based on the comparison result in the following manner:
[0060] When the frequency of the feedback signal is consistent with the frequency of the detection signal, determining a first proximity parameter of the object as the object being stationary relative to the electronic device;
[0061] When the frequency of the feedback signal is greater than the frequency of the detection signal, determining a first proximity parameter of the object as the object approaching the electronic device;
[0062] When the frequency of the feedback signal is less than the frequency of the detection signal, it is determined that the first proximity parameter of the object is that the object is far away from the electronic device.
[0063] The principle of the first sensor determining the first proximity parameter is as follows:
[0064] When the signal emitted by the signal source is reflected by an object near the signal source, if the object and the signal source are relatively stationary, the frequencies of the signal emitted by the signal source and the signal reflected by the object are consistent. If there is relative motion between the object and the signal source, the frequencies of the signal emitted by the signal source and the signal reflected by the object will be different. If the object is far away from the signal source, the frequency of the signal reflected by the object will be lower than the frequency of the signal emitted by the signal source. If the object is close to the signal source, the frequency of the signal reflected by the object will be higher than the frequency of the signal emitted by the signal source. This phenomenon is called the Doppler effect.
[0065] Based on the Doppler effect, the electronic device can act as a signal source, send a detection signal through a first sensor, receive a feedback signal generated by an object within a first distance reflecting the detection signal, and then determine a first proximity parameter of the object relative to the electronic device by comparing the frequency of the feedback signal with the frequency of the detection signal.
[0066] S102: When the first proximity parameter represents that the object is approaching or moving away from the electronic device, control the working state of the functional component of the electronic device according to the first proximity parameter.
[0067] In step S102, the electronic device may control the working state of one or more functional components of the electronic device according to the first proximity parameter.
[0068] In some embodiments, the electronic device may control the working state of the screen according to the first proximity parameter in the following manner:
[0069] When the first proximity parameter indicates that the object is close to the electronic device, controlling the screen of the electronic device to turn off;
[0070] When the first proximity parameter represents that the object is far away from the electronic device, the screen of the electronic device is controlled to light up.
[0071] As an example, the above control method can be applied to the voice call scenario of an electronic device. After an electronic device establishes a voice communication connection with another electronic device, the user can move the electronic device close to the ear in order to listen to the voice received by the electronic device. When the user moves the electronic device to the ear, the first sensor can obtain a first proximity parameter representing the proximity of an object to the electronic device. The object here can be the user's head. Then, the electronic device controls the screen of the electronic device to turn off according to the first proximity parameter, which not only reduces the power consumption of the screen, but also avoids erroneous operation caused by the screen of the electronic device being accidentally touched by the user's face or ear when the electronic device is close to the ear.
[0072] During a voice call, or when a voice call ends, the user can move the electronic device away from the vicinity of the ear, for example, move the electronic device from the vicinity of the ear to a certain distance in front of the user's eyes, and continue to watch the screen of the electronic device. When the user moves the electronic device away from the vicinity of the ear, the first sensor can detect a first proximity parameter characterizing the object being away from the electronic device, and the electronic device then controls the screen of the electronic device to light up based on the first proximity parameter, so that the screen can display the image normally.
[0073] In some embodiments, the electronic device may also control the working state of the speaker of the electronic device according to the first proximity parameter in the following manner:
[0074] When the first proximity parameter indicates that the object is close to the electronic device, controlling a speaker of the electronic device to output sound at a first volume;
[0075] When the first proximity parameter indicates that the object is far away from the electronic device, a speaker of the electronic device is controlled to output sound at a second volume, where the second volume is greater than the first volume.
[0076] That is to say, when an object represented by the first proximity parameter approaches the electronic device, the electronic device can lower the volume of the speaker output of the electronic device and output sound at a lower volume. When the object represented by the first proximity parameter moves away from the electronic device, the electronic device can increase the volume of the speaker output of the electronic device and output sound at a higher volume.
[0077] Taking the voice call scenario as an example, when the user moves the electronic device towards the ear, the first proximity parameter represents that the object is close to the electronic device, so the electronic device reduces the volume of the speaker output to avoid discomfort to the user due to excessive output volume when the distance to the ear is close. When the user moves the electronic device away from the ear, the first proximity parameter represents that the object is far away from the electronic device, so the electronic device increases the volume of the speaker output so that the user can still clearly hear the sound of the speaker when the distance to the ear is far away.
[0078] In some embodiments, the first sensor may be an ultrasonic sensor, or the first sensor may be composed of a speaker (horn) and a receiver (microphone) of an electronic device, wherein the speaker may emit an ultrasonic signal, and the receiver may receive an ultrasonic echo signal reflected from an object within a first distance, and the emitted ultrasonic signal may be used as a detection signal, and the received ultrasonic echo signal may be used as a feedback signal.
[0079] S103, when the first proximity parameter represents that the object is stationary relative to the electronic device, obtain a second proximity parameter according to a second sensor of the electronic device, the second proximity parameter representing whether there is an object within a second distance of the electronic device, the second distance being smaller than the first distance.
[0080] The first sensor generally has a certain detection accuracy limitation. When the relative motion between the object and the electronic device is slow, the Doppler effect generated by the object's motion is weak. At this time, the difference between the frequency of the detection signal and the frequency of the feedback signal is small, resulting in the first sensor being unable to identify the difference between the frequency of the detection signal and the frequency of the feedback signal. In this case, the first proximity parameter obtained by the first sensor may be a parameter characterizing the object being stationary relative to the electronic device.
[0081] That is to say, when the object moves slowly relative to the electronic device, the first proximity parameter detected by the first sensor may not be able to correctly characterize the displacement of the object relative to the electronic device, that is, the object slowly approaches or moves away from the electronic device, but the result detected by the first sensor characterizes that the object is stationary relative to the electronic device, which causes the electronic device to be unable to correctly control its own functional components.
[0082] Taking the voice call scenario as an example, when the user slowly moves the electronic device towards the ear, due to the slow speed of the ear approaching the electronic device, the first proximity parameter detected by the first sensor may indicate that the ear is stationary relative to the electronic device. Therefore, when the electronic device has moved to a position close to the ear, the electronic device has not controlled the screen to turn off, and it is easy to accidentally touch the screen and cause misoperation. When the user slowly moves the electronic device away from the ear, the first proximity parameter detected by the first sensor may indicate that the ear is stationary relative to the electronic device. Therefore, when the electronic device has moved away from the ear and moved to a certain distance in front of the user's eyes, the electronic device has not turned on the screen, resulting in the screen being unable to display the image normally.
[0083] In response to the above situation, in this embodiment, the electronic device can further obtain a proximity parameter of a second sensor of the electronic device when the first proximity parameter represents that the object is stationary relative to the electronic device, and obtain a second proximity parameter based on the second sensor of the electronic device. Different from the first proximity parameter, the second proximity parameter can directly represent whether there is an object within a second distance of the electronic device.
[0084] The second distance is smaller than the first distance, and as an example, the second distance may be 15 mm. That is, the detection range of the second sensor is smaller than the detection range of the first sensor. The first sensor can detect the displacement of an object at a longer distance relative to the electronic device, and the second sensor can detect whether there is an object at a closer distance to the electronic device.
[0085] In this embodiment, the second sensor may be a touch sensing sensor, for example, a capacitive touch sensing sensor.
[0086] The touch sensing sensor may include several electronic components, which may output different electrical parameters depending on whether there is an object within the second distance of the touch sensing sensor. Thus, the touch sensing sensor may obtain a second proximity parameter representing whether there is an object within the second distance based on the electrical parameters output by these electronic components.
[0087] Taking a capacitive touch sensing sensor as an example, the capacitive touch sensing sensor may include a plurality of capacitive elements. The capacitive parameters output by these capacitive elements when there is an object within a second distance of the capacitive touch sensing sensor are different from the capacitive parameters output by these capacitive elements when there is no object within the second distance. Based on the capacitive parameters output by these capacitive elements, the capacitive touch sensing sensor can obtain a second proximity parameter representing whether there is an object within the second distance.
[0088] S104: Control the working state of the functional component of the electronic device according to the second proximity parameter.
[0089] In step S104, the functional component controlled by the electronic device according to the second proximity parameter may be the same as or different from the functional component controlled according to the first proximity parameter.
[0090] When controlling the working state of the functional component according to the second proximity parameter, if the second proximity parameter represents that there is an object within the second distance, the electronic device can control the working state of the functional component in a control manner in which the first proximity object represents that the object is approaching the electronic device; if the second proximity parameter represents that there is no object within the second distance, the electronic device can control the working state of the functional component in a control manner in which the first proximity object represents that the object is far away from the electronic device.
[0091] For example, the electronic device may control the operating state of the screen of the electronic device according to the second proximity parameter in the following manner.
[0092] When the second proximity parameter indicates that there is an object within the second distance, controlling the screen of the electronic device to turn off;
[0093] When the second proximity parameter indicates that there is no object within the second distance, the screen of the electronic device is controlled to light up.
[0094] Taking a call scenario as an example, when the user slowly moves the electronic device toward the ear, the first proximity parameter indicates that the ear is stationary relative to the electronic device. At this time, the electronic device obtains a second proximity parameter of the second sensor. When the electronic device is not moved within 15 mm of the ear, the second proximity parameter indicates that there is no object within the second distance, and the electronic device controls the screen to be lit, and the screen displays the image normally. When the electronic device slowly moves within 15 mm of the ear, the first proximity parameter still indicates that the ear is stationary relative to the electronic device, and the second proximity parameter indicates that there is an object within the second distance, so the electronic device controls the screen to be turned off, and the screen does not display an image.
[0095] When the user slowly moves the electronic device to a position away from the ear, the first proximity parameter represents that the ear is stationary relative to the electronic device. At this time, if the electronic device has not moved to a position more than 15 mm away from the ear, the second proximity parameter represents that there is an object within the second distance, and the electronic device still controls the screen to turn off. If the electronic device moves to a position more than 15 mm away from the ear, the second proximity parameter represents that there is no object within the second distance, and the electronic device can control the screen to light up.
[0096] In some embodiments, the electronic device may also control the working state of the speaker of the electronic device according to the second proximity parameter in the following manner:
[0097] When the second proximity parameter indicates that there is an object within a second distance of the electronic device, controlling a speaker of the electronic device to output sound at a first volume;
[0098] When the second proximity parameter indicates that there is no object within a second distance of the electronic device, the speaker of the electronic device is controlled to output sound at a second volume, where the second volume is greater than the first volume.
[0099] The above control method can refer to the above method of controlling the volume of the speaker according to the first proximity parameter, which will not be described in detail.
[0100] The beneficial effects of this embodiment are:
[0101] When the first proximity parameter represents that an object within a first distance is stationary relative to the electronic device, the working state of the functional component is further controlled according to the second proximity parameter representing whether there is an object within a second distance. Therefore, this embodiment can use the second sensor to assist in controlling the functional components of the electronic device when the detection results of some first sensors are inaccurate, so that the working state of the functional components of the electronic device is more in line with the actual usage scenario of the electronic device.
[0102] In some optional embodiments, when a user is using an electronic device, there may be a small random fluctuation in the distance between the electronic device and a nearby object. Since the detection range of the second sensor is small, this small fluctuation may cause an object originally within the second distance of the electronic device to move beyond the second distance, thereby causing the second proximity parameter to change from representing that there is an object within the second distance to representing that there is no object within the second distance. However, at this time, the electronic device may still be in a usage scenario close to the object. Therefore, if the working state of the functional component is immediately controlled to change accordingly when there is an object within the second distance and there is no object within the second distance, the working state of the functional component may be inconsistent with the actual usage scenario.
[0103] Taking the voice call scenario as an example, assuming that the second distance is 15mm, the user may unconsciously move the electronic device slightly near the ear during the call, and sometimes move the electronic device to a position beyond 15mm from the ear, for example, 20mm from the ear. The second proximity parameter changes from representing the presence of an object within the second distance to representing the absence of an object within the second distance, but the electronic device is still in the use scenario of making a voice call near the user's ear. At this time, if the screen of the electronic device is immediately controlled from the off state to the lit state according to the change of the second proximity parameter, on the one hand, there is a risk of accidental touch because the electronic device is still close to the ear, and on the other hand, the distance from the electronic device to the ear may fluctuate repeatedly around 15mm, and frequent control of the screen switching between lighting and extinguishing will consume the power of the electronic device.
[0104] In view of the above problems, this embodiment also provides a control method, see Figure 2 , which is a flow chart of the control method.
[0105] S201 : when it is determined based on the second proximity parameter that an object at a second distance disappears, obtaining a first proximity parameter and a second proximity parameter within a target time period according to a first sensor and a second sensor.
[0106] The method of determining the disappearance of the object at the second distance based on the second proximity parameter may be:
[0107] When the electronic device detects that the second proximity parameter changes from indicating that there is an object within the second distance to indicating that there is no object within the second distance, the electronic device determines that the object within the second distance disappears.
[0108] That is, after obtaining the second proximity parameter representing the presence of an object within the second distance, the electronic device can control the working state of the functional component based on the second proximity parameter, such as controlling the screen to turn off. Afterwards, the electronic device can continuously obtain the second proximity parameter from the second sensor. If the obtained second proximity parameter still represents the presence of an object within the second distance, the electronic device controls the functional component to maintain the current working state. If at a certain moment the electronic device finds that the second proximity parameter has changed to represent the absence of an object within the second distance, the electronic device determines that the object at the second distance has disappeared at this time, and starts to execute step S201.
[0109] The target duration refers to a period of time after the electronic device determines that the object within the second distance disappears. The specific length can be set as needed. If the electronic device needs to quickly adjust the working state of the functional component, a shorter target duration can be set. If the second proximity parameter frequently switches between an object within the second distance and no object within the second distance during the user's use of the electronic device, a longer target duration can be set to avoid the electronic device frequently changing the working state of the functional component. As an example, the target duration can be set to 1 second or 2 seconds.
[0110] Taking the target duration of 2 seconds as an example, assuming that the electronic device determines at time T0 that the object within the second distance disappears, the electronic device can obtain the first proximity parameter and the second proximity parameter in real time during the period from T0 to T0+2 seconds.
[0111] S202: Control the electronic device according to the first proximity parameter and the second proximity parameter obtained within the target time period.
[0112] Among them, Figure 2 As shown, the electronic device can control the electronic device based on the first proximity parameter and the second proximity parameter within the target duration in the following manner:
[0113] S2021: When the first proximity parameter within the target time duration indicates that the object is far away from the electronic device, control the working state of the functional component of the electronic device according to the first proximity parameter within the target time duration.
[0114] When it is determined based on the second proximity parameter that the object within the second distance disappears, the usage scenario of the electronic device may be that the user actively moves the electronic device away from the object within the second distance. For example, when a voice call ends, the user actively moves the electronic device close to the ear away from the ear. In this case, the first sensor can detect that the object within the first distance is moving away from the electronic device.
[0115] Therefore, if at any moment within the target duration, the first proximity parameter obtained by the electronic device represents that the object within the first distance is moving away from the electronic device, the electronic device can control the working state of the functional components of the electronic device according to the first proximity parameter representing the moving away of the object.
[0116] For example, when the second proximity parameter indicates that there is an object within the second distance, the electronic device controls the screen to turn off. When the electronic device determines that the object within the second distance disappears based on the second proximity parameter, the electronic device continues to obtain the first proximity parameter within the target time length. If the first proximity parameter obtained during this period indicates that the object is moving away, the electronic device controls the screen to light up.
[0117] S2022: When the second proximity parameter within the target duration indicates that there is an object within the second distance, control the working state of the functional component of the electronic device according to the second proximity parameter within the target duration.
[0118] When it is determined based on the second proximity parameter that the object within the second distance disappears, the usage scenario of the electronic device may also be that the user unconsciously controls the electronic device to move near the object, and the distance from the electronic device to the nearby object may fluctuate around the second distance. For example, in a voice call scenario, the user may move the electronic device that was originally 10 mm away from the ear to a farther position, such as 20 mm away from the ear, and then move the electronic device very close to the ear, such as 5 mm away from the ear, one second later.
[0119] In this case, the second proximity parameter obtained by the second sensor can frequently switch between representing the presence of an object within the second distance and representing the absence of an object within the second distance. For example, in the above-mentioned voice call scenario, when the electronic device moves from 10 mm to 20 mm, the second proximity parameter changes from representing the presence of an object to representing the absence of an object, so that the electronic device determines that the object within the second distance disappears. One second later, the electronic device moves again to 5 mm from the ear, and the second proximity parameter changes from representing the absence of an object to representing the presence of an object.
[0120] Therefore, if the electronic device obtains the second proximity parameter characterizing the presence of an object within the second distance at any moment within the target time length, it can be determined that the user is currently in a scenario where the user unconsciously controls the electronic device to move near the object, and therefore the working state of the functional component can continue to be controlled in the control manner according to the second proximity parameter characterizing the presence of an object within the second distance.
[0121] For example, in the above voice call scenario, when the electronic device moves from 10 mm to 20 mm from the ear, and then moves from 20 mm to 5 mm after 1 second, the electronic device always controls the screen to remain off.
[0122] S2023: When the first proximity parameter within the target time period indicates that the object is stationary relative to the electronic device, control the working state of the functional component of the electronic device according to the second proximity parameter within the target time period.
[0123] When it is determined based on the second proximity parameter that the object within the second distance disappears, the usage scenario of the electronic device may also be that the user actively moves the electronic device slowly in a direction away from the object within the second distance. For example, when a voice call ends, the user slowly moves the electronic device close to the ear away from the ear.
[0124] In this case, since the electronic device moves away from the object at a slow speed, the first proximity parameter may always represent that the object within the first distance is stationary relative to the electronic device, and while the object moves away from the electronic device, the second proximity parameter always represents that there is no object within the second distance.
[0125] Therefore, if, by the end of the target duration, the first proximity parameter obtained by the electronic device always represents that the object is stationary relative to the electronic device, and the second proximity parameter always represents that there is no object within the second distance, it can be considered that the current usage scenario is that the user actively moves the electronic device slowly away from the object. Therefore, the working state of the functional component can be controlled according to the second proximity parameter representing that there is no object within the second distance within the target duration, for example, the screen can be controlled from an off state when it is determined that the object disappears to a lit state when there is no object within the second distance.
[0126] Optionally, if the first proximity parameter obtained by the electronic device at any time within the target duration represents that the object is approaching the electronic device, the electronic device may also use the first proximity parameter to control the working state of the functional component, such as controlling the screen to be off.
[0127] The beneficial effects of this embodiment are:
[0128] When it is determined that the object within the second distance disappears, it is possible to identify whether the electronic device is currently moving slightly near the object or continuously moving away from the object within the second distance based on the first proximity parameter and the second proximity parameter within the target time length, thereby accurately controlling the state of functional components according to different scenarios, at least partially solving the problem of frequent changes in the working state of functional components when the electronic device moves back and forth slightly near the object.
[0129] In some optional embodiments, the electronic device may use the first sensor to detect the first proximity parameter only when a specific condition is met, and does not detect the first detection parameter if the specific condition is not met. Figure 3 , which is a flow chart of a control method of this embodiment.
[0130] S301 , in response to a target function of an electronic device being activated, detecting, using a first sensor, a first proximity parameter between the electronic device and an object within a first distance.
[0131] The target function can be a function that satisfies the following conditions:
[0132] If, after a function is activated, the user is likely to move the electronic device to a position close to any object, it can be determined that the function is a target function.
[0133] As an example, the target function may be a voice call function of the electronic device. When the electronic device activates the voice call function by actively calling other devices or responding to calls from other devices, the user may need to move the electronic device close to the ear, so in step S301, the electronic device may detect whether the voice call function is activated, and if the voice call function is activated, the first sensor may be used to detect the first proximity parameter, and if the voice call function is not activated, the first sensor may not be used to detect the first proximity parameter.
[0134] Optionally, when determining that the target function is activated, it is possible to further detect whether the electronic device is connected to an external audio device. If the electronic device is connected to the external audio device, the first proximity parameter may not be detected. If the electronic device is not connected to the external audio device, the first proximity parameter may be detected.
[0135] The external audio device may be another device that is communicatively connected to the electronic device (wired or wirelessly connected) and can output the audio signal of the electronic device, for example, it may be a wired headset, a Bluetooth headset, a Bluetooth speaker, or the like.
[0136] If the electronic device is connected to an external audio device, it can be considered that the user will not move the electronic device close to the ear, and the user may need to use the screen, so the first proximity parameter may not be detected. If the electronic device is not connected to an external audio device, it can be considered that the user may move the electronic device close to the ear, so the first proximity parameter may be detected.
[0137] S302: When the first proximity parameter represents that the object is approaching or moving away from the electronic device, control the working state of the functional component of the electronic device according to the first proximity parameter.
[0138] S303, when the first proximity parameter represents that the object is stationary relative to the electronic device, obtain a second proximity parameter according to a second sensor of the electronic device, the second proximity parameter represents whether there is an object within a second distance of the electronic device, and the second distance is smaller than the first distance.
[0139] S304: Control the working state of the functional component of the electronic device according to the second proximity parameter.
[0140] The implementation of steps S302 to S304 can be found in Figure 1 The corresponding steps are not repeated here.
[0141] The beneficial effects of this embodiment are:
[0142] Through the method of this embodiment, the electronic device can use the first sensor to detect the first proximity parameter only when it is necessary to control the working state of the corresponding functional component according to the approach or distance of the object. When there is no such requirement, the first sensor is not used to detect the first proximity parameter, thereby shortening the working time of the first sensor and reducing the power consumption of the first sensor.
[0143] The present application provides a control device, see Figure 4 , the device may include the following units.
[0144] A detection unit 401, configured to detect a first proximity parameter between the electronic device and an object within a first distance according to a first sensor;
[0145] A control unit 402, configured to control the working state of a functional component of the electronic device according to the first proximity parameter when the first proximity parameter indicates that the object is approaching or moving away from the electronic device;
[0146] An obtaining unit 403 is configured to obtain a second proximity parameter according to a second sensor of the electronic device when the first proximity parameter indicates that the object is stationary relative to the electronic device, the second proximity parameter indicating whether there is an object within a second distance of the electronic device, the second distance being smaller than the first distance;
[0147] The control unit 402 is used to control the working state of the functional components of the electronic device according to the second proximity parameter.
[0148] Optionally, when the detection unit 401 detects a first proximity parameter between the electronic device and an object within a first distance according to the first sensor, it can be used to:
[0149] transmitting a detection signal;
[0150] When an object exists within a first distance of the electronic device, obtaining a feedback signal generated by the object based on the detection signal through the first sensor;
[0151] A first proximity parameter of the object is determined according to the frequency of the detection signal and the frequency of the feedback signal.
[0152] Optionally, when the detection unit 401 determines the first proximity parameter of the object according to the frequency of the detection signal and the frequency of the feedback signal, it can be used to:
[0153] When the frequency of the feedback signal is consistent with the frequency of the detection signal, determining a first proximity parameter of the object as the object being stationary relative to the electronic device;
[0154] When the frequency of the feedback signal is greater than the frequency of the detection signal, determining a first proximity parameter of the object as the object approaching the electronic device;
[0155] When the frequency of the feedback signal is less than the frequency of the detection signal, it is determined that the first proximity parameter of the object is that the object is far away from the electronic device.
[0156] Optionally, the obtaining unit 403 is further configured to:
[0157] When it is determined based on the second proximity parameter that the object at the second distance disappears, obtaining the first proximity parameter and the second proximity parameter within the target time length according to the first sensor and the second sensor;
[0158] The control unit 402 is further configured to:
[0159] The electronic device is controlled according to the first proximity parameter and the second proximity parameter obtained within the target time period.
[0160] Optionally, when the control unit 402 controls the electronic device according to the first proximity parameter and the second proximity parameter obtained within the target duration, it can be used to:
[0161] When the first proximity parameter within the target duration represents that the object is far away from the electronic device, controlling the working state of the functional component of the electronic device according to the first proximity parameter within the target duration;
[0162] When the second proximity parameter within the target duration indicates that there is an object within the second distance, controlling the working state of the functional component of the electronic device according to the second proximity parameter within the target duration;
[0163] When the first proximity parameter within the target time period indicates that the object is stationary relative to the electronic device, the working state of the functional component of the electronic device is controlled according to the second proximity parameter within the target time period.
[0164] Optionally, when the detection unit 401 detects a first proximity parameter between the electronic device and an object within a first distance according to the first sensor, it can be used to:
[0165] In response to a target function of the electronic device being activated, a first proximity parameter between the electronic device and an object within a first distance is detected according to a first sensor.
[0166] Optionally, when the first proximity parameter represents that the object is approaching or moving away from the electronic device, the control unit 402 controls the working state of the functional component of the electronic device according to the first proximity parameter, which can be used to:
[0167] When the first proximity parameter indicates that the object is close to the electronic device, controlling the screen of the electronic device to turn off;
[0168] When the first proximity parameter represents that the object is far away from the electronic device, the screen of the electronic device is controlled to light up.
[0169] Optionally, when the control unit 402 controls the working state of the functional component of the electronic device according to the second proximity parameter, it can be used to:
[0170] When the second proximity parameter indicates that there is an object within the second distance, controlling the screen of the electronic device to turn off;
[0171] When the second proximity parameter indicates that there is no object within the second distance, the screen of the electronic device is controlled to light up.
[0172] Optionally, the first sensor is an ultrasonic sensor, and the second sensor is a capacitive touch sensing sensor.
[0173] The working principle of the control device provided in this embodiment can be found in the relevant steps of the control method provided in any embodiment of the present application, and will not be repeated here.
[0174] The present application also provides an electronic device. Figure 5 , is a schematic diagram of the structure of the electronic device, which may include a first sensor 501, a second sensor 502, a memory 503 and a processor 504.
[0175] The first sensor 501 is used to detect a first proximity parameter of an object within a first distance of the electronic device;
[0176] The second sensor 502 is used to detect a second proximity parameter of an object within a second distance of the electronic device;
[0177] The memory 503 is used to store computer programs;
[0178] The processor 504 is used to execute the above-mentioned computer program, and implement the control method provided in the embodiment of the present application based on the first proximity parameter and the second proximity parameter.
[0179] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0180] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0181] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the relevant technology in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0182] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0183] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A control method, comprising: Detecting a first proximity parameter between the electronic device and an object within a first distance according to the first sensor; When the first proximity parameter represents that the object is approaching or moving away from the electronic device, controlling the working state of the functional component of the electronic device according to the first proximity parameter; When the first proximity parameter indicates that the object is stationary relative to the electronic device, obtaining a second proximity parameter according to a second sensor of the electronic device, the second proximity parameter indicating whether there is an object within a second distance of the electronic device, the second distance being smaller than the first distance; The working state of the functional component of the electronic device is controlled according to the second proximity parameter.
2. The method according to claim 1, wherein the step of detecting a first proximity parameter between the electronic device and an object within a first distance using a first sensor comprises: transmitting a detection signal; When there is an object within a first distance of the electronic device, obtaining, by the first sensor, a feedback signal generated by the object based on the detection signal; A first proximity parameter of the object is determined based on the frequency of the detection signal and the frequency of the feedback signal.
3. The method according to claim 2, wherein determining the first proximity parameter of the object according to the frequency of the detection signal and the frequency of the feedback signal comprises: When the frequency of the feedback signal is consistent with the frequency of the detection signal, determining a first proximity parameter of the object as that the object is stationary relative to the electronic device; When the frequency of the feedback signal is greater than the frequency of the detection signal, determining a first proximity parameter of the object as the object approaching the electronic device; When the frequency of the feedback signal is less than the frequency of the detection signal, it is determined that the first proximity parameter of the object is that the object is far away from the electronic device.
4. The method according to claim 1, further comprising: When it is determined based on the second proximity parameter that the object at the second distance disappears, obtaining the first proximity parameter and the second proximity parameter within a target time length according to the first sensor and the second sensor; The electronic device is controlled according to the first proximity parameter and the second proximity parameter obtained within the target time period.
5. The method according to claim 4, wherein controlling the electronic device according to the first proximity parameter and the second proximity parameter obtained within the target duration comprises: When the first proximity parameter within the target duration indicates that the object is far away from the electronic device, controlling the working state of the functional component of the electronic device according to the first proximity parameter within the target duration; When the second proximity parameter within the target duration indicates that there is an object within the second distance, controlling the working state of the functional component of the electronic device according to the second proximity parameter within the target duration; When the first proximity parameter within the target duration represents that the object is stationary relative to the electronic device, the working state of the functional component of the electronic device is controlled according to the second proximity parameter within the target duration.
6. The method according to claim 1, wherein the step of detecting a first proximity parameter between the electronic device and an object within a first distance using a first sensor comprises: In response to the target function of the electronic device being activated, a first proximity parameter between the electronic device and an object within a first distance is detected according to a first sensor.
7. The method according to claim 1, wherein when the first proximity parameter indicates that the object is approaching or moving away from the electronic device, controlling the working state of the functional component of the electronic device according to the first proximity parameter comprises: When the first proximity parameter indicates that the object is close to the electronic device, controlling the screen of the electronic device to turn off; When the first proximity parameter indicates that the object is far away from the electronic device, the screen of the electronic device is controlled to light up.
8. The method according to claim 1, wherein controlling the working state of the functional component of the electronic device according to the second proximity parameter comprises: When the second proximity parameter indicates that there is an object within the second distance, controlling the screen of the electronic device to turn off; When the second proximity parameter indicates that there is no object within the second distance, the screen of the electronic device is controlled to light up. 9 . The method according to claim 1 , wherein the first sensor is an ultrasonic sensor, and the second sensor is a capacitive touch sensing sensor.
10. A control device comprising: a detection unit, configured to detect a first proximity parameter between the electronic device and an object within a first distance according to a first sensor; a control unit, configured to control a working state of a functional component of the electronic device according to the first proximity parameter when the first proximity parameter indicates that the object is approaching or moving away from the electronic device; an obtaining unit, configured to obtain, when the first proximity parameter indicates that the object is stationary relative to the electronic device, a second proximity parameter according to a second sensor of the electronic device, wherein the second proximity parameter indicates whether there is an object within a second distance of the electronic device, the second distance being smaller than the first distance; The control unit is used to control the working state of the functional component of the electronic device according to the second proximity parameter.
