Electronic device and target state detection method and device thereof

By emitting infrared light signals from the light emitting unit of the photoelectric sensor and performing time domain signal alignment and subtraction processing, the detection error problem of the infrared photoelectric sensor under ambient light interference is solved, and the detection precision and accuracy are improved.

CN114166258BActive Publication Date: 2024-08-30北京易美新创科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111294180.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-03
Publication Date
2024-08-30
Estimated Expiration
2041-11-03

AI Technical Summary

Technical Problem

Infrared photoelectric sensors are susceptible to interference from ambient light, leading to detection errors and confusion, especially when ambient light intensity is high.

Method used

By controlling the light emitting unit of the photoelectric sensor to emit infrared light signals at a preset frequency within a preset time period, it receives and performs time domain signal alignment and subtraction processing to offset the interference of ambient light signals, and confirm whether the detection signal meets the preset conditions to determine the target. state.

Benefits of technology

It effectively offsets the interference of ambient light signals on the photoelectric sensor, improves the detection precision and accuracy, and makes the photoelectric sensor have better resistance to ambient light interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114166258B
    Figure CN114166258B
Patent Text Reader

Abstract

The present disclosure relates to the field of photoelectric detection technology, and provides an electronic device and a method and device for detecting a target state thereof. The method includes: controlling a light emitting unit of a photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time length, and the preset time length includes at least one emission cycle; controlling a light detection unit of the photoelectric sensor to receive a first light signal and a second light signal within a preset time length, wherein the first light signal corresponds to an ambient light signal when the light emitting unit is in a closed state, and the second light signal corresponds to a light signal when the light emitting unit is in an open state; performing time domain signal alignment and subtraction processing on a second electrical signal and a first electrical signal obtained at the output end of the photoelectric sensor in response to the second light signal and the first light signal in each emission cycle, to obtain a detection signal; if the detection signal meets a preset condition, it is confirmed that the electronic device provided with the photoelectric sensor is currently in a target state. The present disclosure improves the photoelectric sensor's ability to resist ambient light interference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of photoelectric detection technology, and in particular to an electronic device and a method and device for detecting a target state thereof. Background Art

[0002] Infrared photoelectric sensors are devices that detect infrared light and convert it into an output electrical signal. Different infrared light intensities will produce different output electrical signals. In practical applications, infrared photoelectric sensors can respond not only to infrared light, but also to natural light (visible light) in the environment, causing signal interference. Especially when the ambient light intensity is high, it is easy to cause misjudgment or detection confusion. Summary of the invention

[0003] In view of this, the embodiments of the present disclosure provide an electronic device and a method and device for detecting a target state thereof, so as to solve the problem in the prior art that photoelectric sensors are easily disturbed by ambient light, resulting in detection errors.

[0004] According to a first aspect of an embodiment of the present disclosure, a method for detecting a target state of an electronic device is provided, comprising: controlling a light emitting unit of a photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period, wherein the preset time period includes at least one emission cycle; controlling a light detection unit of the photoelectric sensor to receive a first light signal and a second light signal within a preset time period, wherein the first light signal corresponds to an ambient light signal when the light emitting unit is in an off state, and the second light signal corresponds to a light signal when the light emitting unit is in an on state; performing time domain signal alignment and subtraction processing on a second electrical signal output by the photoelectric sensor in response to conversion of the second light signal in each emission cycle and a first electrical signal output by the photoelectric sensor in response to conversion of the first light signal to obtain a detection signal; if the detection signal satisfies a preset condition, it is confirmed that the electronic device provided with the photoelectric sensor is currently in a target state, wherein the preset condition at least includes that the amplitude of the detection signal is within a preset signal amplitude range.

[0005] According to a second aspect of an embodiment of the present disclosure, a target state detection device of an electronic device is provided, comprising: an emission control module, configured to control a light emission unit of a photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time length, wherein the preset time length includes at least one emission cycle; a detection module, configured to control the light detection unit of the photoelectric sensor to receive a first light signal and a second light signal within a preset time length, wherein the first light signal corresponds to an ambient light signal when the light emission unit is in an off state within each emission cycle, and the second light signal corresponds to a light signal when the light emission unit is in an on state within each emission cycle; a processing module, configured to perform time domain signal alignment and subtraction processing on a second electrical signal converted from the second light signal by the photoelectric sensor in each emission cycle and a first electrical signal converted from the first light signal by the photoelectric sensor to obtain a detection signal; and a confirmation module, configured to confirm that the electronic device provided with the photoelectric sensor is currently in a target state if the detection signal satisfies a preset condition, wherein the preset condition at least includes that the amplitude of the detection signal is within a preset signal amplitude range.

[0006] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including a photoelectric sensor, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0007] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0008] Compared with the prior art, the embodiments of the present disclosure have the following beneficial effects: by controlling the light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period, the preset time period includes at least one emission cycle; controlling the light detection unit of the photoelectric sensor to receive a first light signal and a second light signal within a preset time period, the first light signal corresponds to the ambient light signal when the light emitting unit is in a closed state, and the second light signal corresponds to the light signal when the light emitting unit is in an open state; performing time domain signal alignment and subtraction processing on the second electrical signal converted and output by the photoelectric sensor for the second light signal in each emission cycle and the first electrical signal converted and output by the photoelectric sensor for the first light signal to obtain a detection signal; if the detection signal meets a preset condition, it is confirmed that the electronic device provided with the photoelectric sensor is currently in the target state, and the preset condition at least includes that the amplitude of the detection signal is within a preset signal amplitude range, so as to offset the signal interference caused by the ambient light signal to the detection of the photoelectric sensor, so that the photoelectric sensor has better anti-ambient light interference capability and improves the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, 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 disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0010] Figure 1 is a flow chart of a method for detecting a target state of an electronic device provided by an embodiment of the present disclosure;

[0011] Figure 2 is a flow chart of a method for detecting an in-ear state of a wireless headset provided by an embodiment of the present disclosure;

[0012] Figure 3 is a signal principle diagram of in-ear status detection of a wireless headset provided by an embodiment of the present disclosure;

[0013] Figure 4 is a schematic diagram of a target state detection device of an electronic device provided by an embodiment of the present disclosure;

[0014] Figure 5 It is a schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0015] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present disclosure. However, it should be clear to those skilled in the art that the present disclosure may 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 avoid obstructing the description of the present disclosure with unnecessary details.

[0016] A method and device for detecting a target state of an electronic device according to an embodiment of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0017] See also Figure 1 , is a flow chart of a method for detecting a target state of an electronic device provided by an embodiment of the present disclosure. Figure 1 As shown, the target state detection method of the electronic device includes:

[0018] S101, controlling a light emitting unit of a photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period, wherein the preset time period includes at least one emission cycle;

[0019] S102, controlling the light detection unit of the photoelectric sensor to receive a first light signal and a second light signal within a preset time period, wherein the first light signal corresponds to an ambient light signal when the light emitting unit is in a turned-off state, and the second light signal corresponds to a light signal when the light emitting unit is in a turned-on state;

[0020] S103, performing time domain signal alignment and subtraction processing on a second electrical signal output by the photoelectric sensor after converting the second optical signal in each emission cycle and a first electrical signal output by the photoelectric sensor after converting the first optical signal to obtain a detection signal;

[0021] S104: If the detection signal satisfies a preset condition, it is confirmed that the electronic device provided with the photoelectric sensor is currently in a target state, and the preset condition at least includes that the amplitude of the detection signal is within a preset signal amplitude range.

[0022] According to the classification of the light source emitted by the light emitting unit, the photoelectric sensor can be divided into ultraviolet light photoelectric sensor, visible light photoelectric sensor and infrared light photoelectric sensor. In the embodiment of the present disclosure, the photoelectric sensor is an infrared light photoelectric sensor, which can also be simply referred to as a photoelectric sensor. The preset duration of the light emitting unit to emit an infrared light signal can be one emission cycle, or it can be two or more emission cycles. As for the duration of each emission cycle, the embodiment of the present disclosure does not limit this. For example, the light emitting unit is controlled to emit an infrared light signal within a preset duration of an emission cycle, and the light emitting unit is turned on and off in sequence within the emission cycle. When the light emitting unit is in the on state, the infrared light signal is emitted, and when the light emitting unit is in the off state, the infrared light signal is not emitted.

[0023] Correspondingly, when the light emitting unit emits an infrared light signal, the light detection unit of the light sensor can receive the surrounding light signals to convert and output corresponding electrical signals. When the light emitting unit is in the off state, the light signal that the light detection unit can receive is only the ambient light signal, that is, the first light signal; when the light emitting unit is in the on state, the light signal that the light detection unit can receive includes not only the infrared light signal emitted by the light emitting unit, but also the ambient light signal, such as the visible light in the environment. Therefore, the photoelectric sensor converts the second light signal received by the light detection unit in an emission cycle into a second electrical signal, and converts the first light signal received by the light detection unit in the same emission cycle into a first electrical signal, and performs time domain signal alignment and subtraction processing on the second electrical signal and the first electrical signal, and detects the signal after the signal subtraction processing, which is equivalent to the electrical signal output by the photoelectric sensor after canceling the ambient light signal received by the light detection unit in the emission cycle.

[0024] It can be seen that the detection signal obtained after processing is equivalent to the absence of interference from ambient light signals. The judgment condition for the electronic device in the target state can be the preset signal amplitude range set according to the electrical signal output by the photoelectric sensor in any state of the electronic device in a dark environment (i.e., without interference from ambient light). Then, it is only necessary to judge whether the processed detection signal meets the judgment condition for the electronic device in the target state to determine the state of the electronic device.

[0025] Specifically, the preset signal amplitude range can be a signal amplitude range pre-set according to the maximum signal amplitude in the time domain of the detection signal output by the photoelectric sensor of the electronic device in the target state without ambient light interference, or it can be a signal amplitude range pre-set according to the minimum signal amplitude and maximum signal amplitude in the time domain of the detection signal output by the photoelectric sensor of the electronic device in the target state without ambient light interference. The embodiments of the present disclosure are not limited to this.

[0026] According to the technical solution provided by the embodiment of the present disclosure, the light emitting unit of the photoelectric sensor is controlled to emit an infrared light signal at a preset frequency within a preset time length, and the preset time length includes at least one emission cycle; the light detection unit of the photoelectric sensor is controlled to receive a first light signal and a second light signal within a preset time length, the first light signal corresponds to the ambient light signal when the light emitting unit is in a closed state, and the second light signal corresponds to the light signal when the light emitting unit is in an open state; the second electrical signal converted and output by the photoelectric sensor for the second light signal in each emission cycle and the first electrical signal converted and output by the photoelectric sensor for the first light signal are aligned and subtracted in the time domain to obtain a detection signal; if the detection signal meets the preset conditions, it is confirmed that the electronic device provided with the photoelectric sensor is currently in the target state, and the preset conditions at least include that the amplitude of the detection signal is within the preset signal amplitude range, so as to offset the signal interference caused by the ambient light signal to the detection of the photoelectric sensor, so that the photoelectric sensor has better anti-ambient light interference capability and improves the detection accuracy.

[0027] In addition, the preset duration for controlling the light emitting unit of the photoelectric sensor to emit infrared light may include one emission cycle, two emission cycles, or more than two emission cycles. In the embodiment of the present disclosure, the preset duration is an integer multiple of the emission cycle duration, for example, the preset duration includes 1, 2, 3... or N emission cycles, where N is an integer and N≥1.

[0028] In some embodiments, when N=1, that is, the preset time length includes one emission cycle; accordingly, if the detection signal meets the preset conditions, the step of determining that the electronic device equipped with the photoelectric sensor is currently in the target state includes: if the amplitude of the detection signal is within the preset signal amplitude range, confirming that the electronic device is currently in the target state.

[0029] Specifically, when the preset time length only includes one transmission cycle, only one detection signal is obtained. Therefore, it is only necessary to determine whether the electronic device is in the target state based on the judgment result of this one detection signal, that is, as long as the amplitude of the detection signal is within the preset signal amplitude range, it is determined that the electronic device is currently in the target state.

[0030] According to the technical solution provided by the embodiment of the present disclosure, the detection signal of the photoelectric sensor can be quickly acquired, and the determination result of the target state of the electronic device can be quickly obtained by comparing it with the determination condition.

[0031] Furthermore, considering the complexity of the ambient light signal, in general, the light in the environment is natural light, and it is rare for the light intensity to change repeatedly and rapidly. However, in reality, the environment in which the electronic device is located may also include a light environment set artificially. In this scenario, the ambient light signal around the electronic device may suddenly change in light intensity. If this sudden change occurs within a transmission cycle, it will cause a huge difference in the ambient light signal around the light emitting unit when it is turned on and off, thereby interfering with the detection signal obtained within the transmission cycle.

[0032] In some embodiments, the duration of the emission cycle of the light emission unit of the photosensor is 0.03-300 milliseconds.

[0033] Specifically, the transmission period can be in the millisecond level, for example, the transmission period is 10, 30, 50, 70, 90, 110, 130, 150, 170, 190, 210, 230, 250, 270 or 300 milliseconds, or 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260 or 280 milliseconds; the transmission period can also be in the microsecond level, for example, the transmission period is 30, 40, 50, 60, 70, 80, 90 or 100 microseconds, or 200, 300, 400, 500, 600, 700, 800, 900 or 1000 microseconds, etc. In actual applications, the duration of the transmission period can be set by yourself, and the embodiments of the present disclosure are not limited to this.

[0034] According to the technical solution provided in the embodiment of the present disclosure, by setting the duration of the emission cycle to milliseconds or microseconds, that is, the emission cycle is very short, the possibility of changes in ambient light in such a short time is very low, thereby avoiding signal confusion or interference caused by changes in ambient light within a single emission cycle.

[0035] In some embodiments, when N≥, that is, the preset duration includes at least two emission cycles, and the preset condition also includes that the number of detection signals whose amplitudes are within the preset signal amplitude range reaches a first preset number; accordingly, if the detection signal satisfies the preset condition, the step of determining that the electronic device provided with a photoelectric sensor is currently in the target state includes: obtaining N detection signals corresponding to N emissions; comparing the amplitudes of the N detection signals with the preset signal amplitude range, respectively, and determining the number of target detection signals whose amplitudes are within the preset signal amplitude range among the N detection signals based on the comparison results; when the number of target detection signals reaches the first preset number, determining that the electronic device is currently in the target state.

[0036] Specifically, assuming that N=10, that is, there are 10 transmission cycles within the preset time length, 10 detection signals can be obtained accordingly: J01, J02, J03, J04, J05, J06, J07, J08, J09, J10. The detection signals J01, J02, J03, J04, J05, J06, J07, J08, J09, J10 are compared with the preset signal amplitude range respectively, and the number of target detection signals whose signal amplitudes are within the preset signal amplitude range in the comparison results is counted, and finally the number of target detection signals is M, where M is a non-negative integer. For example, in the comparison results of the detection signals J01, J02, J03, J04, J05, J06, J07, J08, J09, and J10 with the preset signal amplitude range, if only the detection signals J01, J02, J03, J05, J06, J08, J09, and J10 are located in the preset signal amplitude range, that is, the target detection signal number M=8, if the first preset number is 8, then M=8≥8, then it is determined that the electronic device is currently in the target state; if only the detection signals J01, J02, J05, J06, J08, J09, and J10 are located in the preset signal amplitude range, that is, the target detection signal number M=7, if the first preset number is 8, then M=7<8, then it is determined that the electronic device is not currently in the target state.

[0037] Specifically, the first preset number may be a numerical threshold value set by the user based on experience, or may be a numerical threshold value obtained by adjusting the already set first preset number based on the number of acquired detection signals, and the embodiments of the present disclosure are not limited to this.

[0038] According to the technical solution provided by the embodiment of the present disclosure, at least two detection signals corresponding to at least two emission cycles are obtained by the light emitting unit, which are compared with the preset signal amplitude range respectively, so as to determine the number of target detection signals that meet the preset signal amplitude range in these at least two detection signals. As long as the number of target detection signals reaches a first preset number, it is determined that the electronic device is in the target state, thereby avoiding the situation where a single detection signal may cause an erroneous detection result due to changes in the ambient light signal, thereby improving the detection accuracy.

[0039] In some embodiments, when N≥, that is, the preset duration includes at least two emission cycles, and the preset condition also includes that the number of detection signals whose amplitudes are within the preset signal amplitude range reaches a second preset number; accordingly, if the detection signal satisfies the preset condition, the step of determining that the electronic device provided with a photoelectric sensor is currently in the target state includes: comparing the detection signal obtained in real time in the i-th emission cycle of N emission cycles with the preset signal amplitude range, wherein i is a non-zero integer, the initial value is 0, and i≤N; based on the comparison result, calculating i=i+1, and when the comparison result is that the signal amplitude is within the preset signal amplitude range, the number of target detection signals is counted as M=M+1, and the initial value of M is 0; when i is less than N, the range is compared in real time with the preset signal amplitude range for the detection signal corresponding to the i-th emission cycle of N emission cycles; when i is equal to N, if the number of target detection signals M reaches the second preset number, it is determined that the electronic device is currently in the target state.

[0040] Specifically, it is also assumed that N=10, that is, the preset duration includes 10 transmission cycles. When the detection signal J01 of the first transmission cycle is obtained in real time, the detection signal J01 is compared with the preset signal amplitude range. If the detection signal J01 is within the preset signal amplitude range, the number of target detection signals is increased by 1, and then the detection signal J02 of the second transmission cycle obtained in real time is compared with the preset signal amplitude range. On the contrary, if the detection signal J01 is not within the preset signal amplitude range, the detection signal J02 of the second transmission cycle obtained in real time is directly compared with the preset signal amplitude range. This is repeated until the detection signal J10 of the tenth transmission cycle is obtained in real time. The detection signal J10 is compared with the preset signal amplitude range and a corresponding comparison result is obtained. At this point, the comparison of all detection signals of 10 transmission cycles is completed, and the final target detection signal number M is obtained. When the target detection signal number M reaches the second preset number, it is determined that the electronic device is in the target state, otherwise it is determined that the electronic device is in the non-target state.

[0041] Specifically, the second preset number may be a numerical threshold value set by the user based on experience, or may be a numerical threshold value obtained by adjusting the already set second preset number based on the number of acquired detection signals, and the embodiments of the present disclosure are not limited to this.

[0042] According to the technical solution provided by the embodiments of the present disclosure, by comparing the detection signal obtained in real time in each transmission cycle with the preset signal amplitude range, the comparison results of the detection signals of all transmission cycles before the current transmission cycle can be obtained in real time. There is no need to wait until the detection signals of all transmission cycles are acquired and then compare them separately, which avoids the situation where a large amount of data occupies too much memory, and the detection results can be obtained quickly.

[0043] In some embodiments, when N≥2, that is, the preset duration includes at least two emission cycles, and the preset condition also includes that the number of detection signals whose amplitudes are within the preset signal amplitude range reaches a third preset number; if the detection signal satisfies the preset condition, then the step of determining that the electronic device provided with a photoelectric sensor is currently in the target state includes: obtaining N detection signals corresponding to N emission cycles; sorting the N detection signals based on the time sequence of the emission cycles, and comparing the kth target detection signal among the sorted N detection signals with the preset signal amplitude range in reverse order to obtain a corresponding comparison result, and calculating k=k-1, k is a non-negative integer, and the initial value is k=N; when the comparison result of the k-1th detection signal is inconsistent with the kth detection signal, stop comparing the detection signals, and determine the k-1 value corresponding to the k-1th detection signal; if the value N-k+1 reaches the third preset number, and the amplitude of the k=Nth detection signal is within the preset signal amplitude range, then it is determined that the electronic device is currently in the target state.

[0044] Specifically, it is also assumed that N=10, that is, the preset duration has 10 emission cycles, and in the order of the emission cycle time, the 10 detection signals corresponding to the 10 emission cycles are: J01, J02, J03, J04, J05, J06, J07, J08, J09, J10. On the basis of obtaining the 10 detection signals, each detection signal is compared with the preset signal in reverse order, that is, the detection signals J10, J09, J08, J07, J06, J05, J04, J03, J02, J01 are compared with the preset signal amplitude range in turn, and when the comparison results of two adjacent detection signals are inconsistent, the comparison is stopped. For example, when the comparison results of the detection signal J05 and the detection signal J06 are inconsistent, k-1=5, N-(k-1)=5, if the third preset number is 5, then the value N-(k-1) reaches the third preset number, and the detection result of the 10th detection signal J10 is within the preset signal amplitude range, then it is determined that the electronic device is currently in the target state. For another example, when the comparison results of the detection signal J06 and the detection signal J07 are inconsistent, k-1=6, N-(k-1)=4, if the third preset number is 5, then the value N-(k-1) does not reach the third preset number, then it is determined that the electronic device is currently in a non-target state.

[0045] According to the technical solution provided by the embodiments of the present disclosure, the detection signal is compared with the preset signal amplitude range in reverse order. When the comparison results of two adjacent detection signals are inconsistent, it is determined that the electronic device is currently in the target state based on the fact that the number of identical comparison results obtained satisfies a third preset number and these identical comparison results are signal amplitudes within the preset signal amplitude range, thereby reducing the number of comparisons of the detection signal in the process of determining the target state of the electronic device and improving the detection speed.

[0046] In some embodiments, after confirming that the electronic device provided with the photoelectric sensor is currently in the target state, the method further includes: activating the electronic device to put the electronic device in a working state.

[0047] Specifically, when it is determined that the electronic device is currently in the target state, the electronic device can be controlled to execute preset control instructions, which may include activation instructions, play instructions or alarm instructions, etc. As for which preset control instructions to choose, it can be set according to the product type of the electronic device or the actual needs of the product, and the embodiments of the present disclosure do not limit this.

[0048] Specifically, the electronic device may be any of the following products: a wireless headset, a sweeping robot, or an automated guided vehicle (i.e., an Automated Guided Vehicle). Taking the wireless headset as an example, the target state may be that the wireless headset is currently in the ear state. For example, when it is determined that the wireless headset is in the ear state, the wireless headset is activated to put the wireless headset in a working state.

[0049] In some embodiments, the electronic device is a wireless headset, and before the step of controlling the light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time length, it also includes: detecting the working state of the electronic device; if the electronic device is in an out-of-box state, entering the step of controlling the light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time length.

[0050] Specifically, the wireless headset includes a Bluetooth headset, for example, the wireless headset is a TWS (True Wireless Stereo, in Chinese: true wireless stereo) headset. Generally, wireless headsets are equipped with a charging box. Depending on whether the wireless headset is in the charging box, the working state of the wireless headset can be divided into an in-box state and an out-of-box state. In the embodiment of the present disclosure, when the electronic device is in the out-of-box state, that is, the light emitting unit of the photoelectric sensor enters the step of emitting an infrared light signal at a preset frequency within a preset time, which is equivalent to executing the target state detection method of the electronic device.

[0051] In one application embodiment, the electronic device is a wireless headset. Figure 2 , is a flow chart of a method for detecting the in-ear state of a wireless headset provided by an embodiment of the present disclosure. Figure 2 As shown, the in-ear state detection method of the wireless headset includes:

[0052] S201, controlling the light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period, where the preset time period includes N emission cycles, where N is an integer and N≥2;

[0053] S202, controlling the light detection unit of the photoelectric sensor to receive a first light signal and a second light signal within a preset time period, wherein the first light signal corresponds to an ambient light signal when the light emitting unit is in a turned-off state, and the second light signal corresponds to a light signal when the light emitting unit is in a turned-on state;

[0054] S203, sequentially performing time domain signal alignment and subtraction processing on the second electrical signal output by the photoelectric sensor in the i-th transmission cycle of N transmission cycles from the second optical signal to the first electrical signal output by the photoelectric sensor in the i-th transmission cycle to obtain a detection signal of the i-th transmission cycle, where i is a non-negative integer and the initial value of i is 0;

[0055] S204, determining whether the detection signal of the i-th transmission cycle is within a preset signal amplitude range;

[0056] S205, if yes, confirm that the detection signal is a target detection signal, and count the number of target detection signals as n=n+1, where n is a non-negative integer and the initial value of n is 0, and then proceed to step S207;

[0057] S206, if not, confirming that the detection signal is not a target detection signal;

[0058] S207, calculate i=i+1;

[0059] S208, determine whether i=N?;

[0060] S209, if i<N, return to step S203;

[0061] S210, if i=N, determine whether n is greater than or equal to a first preset number: if so, activate the wireless headset; if not, do not activate the wireless headset.

[0062] Specifically, the preset signal amplitude range may be a range threshold value pre-set according to experimental data, or a new range threshold value obtained by re-modifying the range threshold value, and the embodiments of the present disclosure are not limited to this. For example, when the wireless headset is pre-recorded in the ear under dark conditions (i.e., no visible light), the light emitting unit of the photoelectric sensor is controlled to send a third electrical signal corresponding to infrared light. The third electrical signal is an ideal detection signal of the photoelectric sensor in the absence of interference from ambient light signals. Therefore, a signal determination range can be set according to the maximum value and / or minimum value of the third electrical signal, thereby obtaining a preset signal amplitude range.

[0063] See also Figure 3 , is a signal principle diagram of the in-ear status detection of the wireless headset provided by the embodiment of the present disclosure. Figure 3 As shown, the state of the wireless headset can be divided into an in-ear state and an out-ear state, and the light emitting unit of the photoelectric sensor is controlled to emit an infrared light signal in a periodic pulse manner.

[0064] In dark conditions, there is no interference from natural light in the environment. When the light emitting unit is turned off, no infrared light signal is emitted, and the light detection unit does not receive the light signal. Therefore, the photoelectric sensor outputs an electrical signal of 0; when the light emitting unit is turned on, an infrared light signal is emitted, and the light detection unit receives the infrared light signal, and obtains the third electrical signal E at the output end of the photoelectric sensor. Specifically, the third electrical signal is equivalent to a detection signal obtained without interference from the ambient light signal. Therefore, the determination condition of whether the wireless headset is in the in-ear state can be set according to the signal characteristics of the third electrical signal, for example, the preset signal amplitude range is set to [A, B], so that the signal amplitude of the third electrical signal E is between A and B.

[0065] Under ambient light conditions, due to the interference of ambient light, when the light emitting unit is turned off, no infrared light signal is emitted, and the light detection unit receives a first light signal, which is an ambient light signal, and obtains a first electrical signal C at the output end of the photoelectric sensor; when the light emitting unit is turned on, an infrared light signal is emitted, and the light detection unit receives a second light signal, which includes an ambient light signal and an infrared light signal, and obtains a second electrical signal D at the output end of the photoelectric sensor. The second electrical signal D is aligned and subtracted from the first electrical signal C in the time domain to obtain a detection signal DC, which is equivalent to canceling the interference signal part of the ambient light signal from the second electrical signal D, so that the interference signal part of the ambient light signal is eliminated in the detection signal obtained under ambient light conditions.

[0066] Combination Figure 3 It can be seen that, assuming that the first electrical signal and the second electrical signal are not offset, when the wireless headset is in the outside-ear state, the signal amplitude of the second electrical signal D obtained under the interference of the ambient light signal may reach the preset signal amplitude range; when the wireless headset is in the in-ear state, the signal amplitude of the second electrical signal D obtained under the interference of the ambient light signal is obviously higher than the signal amplitude of the third electrical signal E that is not interfered by the ambient light signal. Therefore, subtracting and offsetting the second electrical signal and the first electrical signal to obtain the detection signal DC is equivalent to eliminating the interference signal part caused by the ambient light signal in the transmission period, and then judging whether the detection signal is within the preset signal amplitude range, that is, whether A≤DC≤B is satisfied. If so, confirming that the detection signal is the target signal, and finally determining whether the wireless headset is in the in-ear state based on the number of target signals, further eliminating the signal interference caused by the ambient light signal to the photoelectric sensor, enhancing the anti-interference ability of the photoelectric sensor, and improving the detection accuracy.

[0067] like Figure 3 As shown, P2-P1 is the duration of a transmission cycle of the light emitting unit transmitting the infrared light signal. Within the duration of a transmission cycle, the on duration and the off duration of the light emitting unit are equal.

[0068] It should be noted that when the wireless headset is outside the ear, there is no ear canal to reflect the infrared light signal. Figure 3 The light signal received by the light detection unit and the electrical signal obtained at the output end of the photoelectric sensor are treated as if no infrared light signal is received.

[0069] 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 disclosure.

[0070] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0071] Figure 4 It is a schematic diagram of a target state detection device of an electronic device provided by an embodiment of the present disclosure.

[0072] like Figure 4 As shown, the target state detection device of the electronic device includes:

[0073] The emission control module 401 is configured to control the light emission unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period, wherein the preset time period includes at least one emission cycle;

[0074] The detection module 402 is configured to control the light detection unit of the photoelectric sensor to receive a first light signal and a second light signal within a preset time period, wherein the first light signal corresponds to an ambient light signal when the light emitting unit is in a closed state in each emission cycle, and the second light signal corresponds to a light signal when the light emitting unit is in an open state in each emission cycle;

[0075] The processing module 403 is configured to perform time domain signal alignment and subtraction processing on the second electrical signal output by the photoelectric sensor after converting the second optical signal and the first electrical signal output by the photoelectric sensor after converting the first optical signal in each emission cycle to obtain a detection signal;

[0076] The confirmation module 404 is configured to confirm that the electronic device provided with the photoelectric sensor is currently in the target state if the detection signal meets a preset condition, and the preset condition at least includes that the amplitude of the detection signal is within a preset signal amplitude range.

[0077] According to the technical solution provided by the embodiment of the present disclosure, the light emitting unit of the photoelectric sensor is controlled to emit an infrared light signal at a preset frequency within a preset time length, and the preset time length includes at least one emission cycle; the light detection unit of the photoelectric sensor is controlled to receive a first light signal and a second light signal within a preset time length, the first light signal corresponds to the ambient light signal when the light emitting unit is in a closed state, and the second light signal corresponds to the light signal when the light emitting unit is in an open state; the second electrical signal converted and output by the photoelectric sensor for the second light signal in each emission cycle and the first electrical signal converted and output by the photoelectric sensor for the first light signal are aligned and subtracted in the time domain to obtain a detection signal; if the detection signal meets the preset conditions, it is confirmed that the electronic device provided with the photoelectric sensor is currently in the target state, and the preset conditions at least include that the amplitude of the detection signal is within the preset signal amplitude range, so as to offset the signal interference caused by the ambient light signal to the detection of the photoelectric sensor, so that the photoelectric sensor has better anti-ambient light interference capability and improves the detection accuracy.

[0078] In some embodiments, the preset duration includes N transmission cycles, where N is a positive integer greater than or equal to 2, and the preset condition also includes that the number of detection signals whose amplitudes are within the preset signal amplitude range reaches a first preset number; Figure 4 The confirmation module 404 in obtains N detection signals corresponding to N emissions; compares the amplitudes of the N detection signals with the preset signal amplitude range respectively, and determines the number of target detection signals whose amplitudes are within the preset signal amplitude range among the N detection signals based on the comparison results; when the number of target detection signals reaches a first preset number, determines that the electronic device is currently in the target state.

[0079] In some embodiments, the preset duration includes N transmission cycles, where N is a positive integer greater than or equal to 2, and the preset condition also includes that the number of detection signals whose amplitudes are within the preset signal amplitude range reaches a second preset number; Figure 4 The confirmation module 404 in the step compares the detection signal obtained in real time in the i-th transmission cycle among N transmission cycles with the preset signal amplitude range, wherein i is a non-zero integer, the initial value is 0, and i≤N; based on the comparison result, i=i+1 is calculated, and when the comparison result is that the signal amplitude is within the preset signal amplitude range, the number of target detection signals is counted as M=M+1, and the initial value of M is 0; when i is less than N, the detection signal corresponding to the i-th transmission cycle among N transmission cycles is compared with the preset signal amplitude range in real time; when i is equal to N, if the number of target detection signals M reaches a second preset number, it is determined that the electronic device is currently in the target state.

[0080] In some embodiments, the preset duration includes N transmission cycles, where N is a positive integer greater than or equal to 2, and the preset condition also includes that the number of detection signals whose amplitudes are within the preset signal amplitude range reaches a third preset number; Figure 4 The confirmation module 404 in obtains N detection signals corresponding to N transmission cycles; sorts the N detection signals based on the time sequence of the transmission cycles, compares the k-th target detection signal among the sorted N detection signals with the preset signal amplitude range in reverse order, obtains the corresponding comparison result, and calculates k=k-1, k is a non-negative integer, and the initial value is k=N; when the comparison result of the k-1-th detection signal is inconsistent with the k-th detection signal, stops comparing the detection signals, and determines the k-1 value corresponding to the k-1-th detection signal; if the value N-k+1 reaches the third preset number, and the amplitude of the k=N-th detection signal is within the preset signal amplitude range, it is determined that the electronic device is currently in the target state.

[0081] In some embodiments, the preset duration includes one transmission cycle; Figure 4 The confirmation module 404 in is used to confirm that the electronic device is currently in the target state if the amplitude of the detection signal is within the preset signal amplitude range.

[0082] In some embodiments, the target state detection device of the electronic device further includes: an activation module 405 configured to activate the electronic device after confirming that the electronic device provided with the photoelectric sensor is currently in the target state, so as to put the electronic device in a working state.

[0083] In some embodiments, the electronic device is a wireless headset; the target state detection device of the electronic device also includes: entering a module 406, which is configured to detect the working state of the electronic device before controlling the light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period; if the electronic device is in an out-of-box state, then entering a step of controlling the light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period.

[0084] In some embodiments, the transmission period has a duration of 0.03-300 milliseconds.

[0085] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0086] Figure 5 Schematic diagram of an electronic device 5 provided in an embodiment of the present disclosure. Figure 5As shown, the electronic device 5 of this embodiment includes: a photoelectric sensor 504, a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program 503, the steps in the above-mentioned various method embodiments are implemented. Alternatively, when the processor 501 executes the computer program 503, the functions of each module / unit in the above-mentioned various device embodiments are implemented.

[0087] Exemplarily, the computer program 503 may be divided into one or more modules / units, which are stored in the memory 502 and executed by the processor 501 to complete the present disclosure. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 503 in the electronic device 5.

[0088] The electronic device 5 may be a wireless headset, a sweeping robot, an automatic guided vehicle, or other electronic device. The electronic device 5 may include, but is not limited to, a processor 501, a memory 502, and a photoelectric sensor 504. Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 5 and does not constitute a limitation of the electronic device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0089] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0090] The memory 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. Further, the memory 502 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device. The memory 502 may also be used to temporarily store data that has been output or is to be output.

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

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

[0093] 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 disclosure.

[0094] In the embodiments provided in the present disclosure, 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 modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.

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

[0096] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0097] If the integrated module / 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 disclosure implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. 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. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.

[0098] The above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These 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 disclosure, and should all be included in the protection scope of the present disclosure.

Claims

1. A method for detecting a target state of an electronic device, characterized in that: include: Controlling a light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period, wherein the preset time period includes at least one emission cycle; Controlling the light detection unit of the photoelectric sensor to receive a first light signal and a second light signal within the preset time period, wherein the first light signal corresponds to an ambient light signal when the light emitting unit is in a turned-off state, and the second light signal corresponds to a light signal when the light emitting unit is in a turned-on state; Performing time domain signal alignment and subtraction processing on a second electrical signal output by the photoelectric sensor after converting the second optical signal in each emission cycle and a first electrical signal output by the photoelectric sensor after converting the first optical signal to obtain a detection signal; If the detection signal satisfies a preset condition, it is confirmed that the electronic device provided with the photoelectric sensor is currently in the target state, and the preset condition at least includes that the amplitude of the detection signal is within a preset signal amplitude range; The light emitting unit is turned on and off in sequence during the emission cycle. When the light emitting unit is in the on state, an infrared light signal is emitted, and when the light emitting unit is in the off state, no infrared light signal is emitted.

2. The method according to claim 1, characterized in that The preset duration includes N transmission cycles, where N is a positive integer greater than or equal to 2, and the preset condition also includes that the number of detection signals whose amplitudes are within the preset signal amplitude range reaches a first preset number; The step of determining that the electronic device provided with the photoelectric sensor is currently in the target state if the detection signal meets the preset condition comprises: Obtain N detection signals corresponding to N transmissions; Comparing the amplitudes of the N detection signals with a preset signal amplitude range respectively, and determining the number of target detection signals whose amplitudes are within the preset signal amplitude range among the N detection signals based on the comparison results; When the number of the target detection signals reaches a first preset number, it is determined that the electronic device is currently in the target state.

3. The method according to claim 1, characterized in that The preset duration includes N transmission cycles, where N is a positive integer greater than or equal to 2, and the preset condition also includes that the number of detection signals whose amplitudes are within the preset signal amplitude range reaches a second preset number; The step of determining that the electronic device provided with the photoelectric sensor is currently in the target state if the detection signal meets the preset condition comprises: Compare the detection signal obtained in real time in the i-th transmission cycle of N transmission cycles with the preset signal amplitude range, where i is a non-zero integer, the initial value is 0, and i≤N; Based on the comparison result, i=i+1 is calculated, and when the comparison result is that the signal amplitude is within the preset signal amplitude range, the number of target detection signals is counted as M=M+1, and the initial value of M is 0; When i is less than N, a step of comparing the detection signal corresponding to the i-th transmission cycle in the N transmission cycles with a preset signal amplitude range in real time; When i is equal to N, if the number M of target detection signals reaches a second preset number, it is determined that the electronic device is currently in the target state.

4. The method according to claim 1, characterized in that: The preset duration includes one transmission cycle; The step of determining that the electronic device provided with the photoelectric sensor is currently in the target state if the detection signal meets the preset condition comprises: If the amplitude of the detection signal is within the preset signal amplitude range, it is confirmed that the electronic device is currently in the target state.

5. The method according to claim 1, characterized in that After the step of confirming that the electronic device provided with the photoelectric sensor is currently in the target state, the method further includes: Activate the electronic device to put the electronic device into working state.

6. The method according to claim 1, characterized in that The electronic device is a wireless headset; Before the step of controlling the light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time, the method further includes: Detecting the working status of the electronic device; If the electronic device is in a non-in-box state, the process proceeds to the step of controlling the light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period.

7. The method according to any one of claims 1 to 6, characterized in that: The duration of the transmission cycle is 0.03-300 milliseconds.

8. A target state detection device for an electronic device, characterized in that: include: an emission control module, configured to control a light emitting unit of the photoelectric sensor to emit an infrared light signal at a preset frequency within a preset time period, wherein the preset time period includes at least one emission cycle, wherein the light emitting unit is sequentially turned on and off within the emission cycle, and when the light emitting unit is in the on state, the infrared light signal is emitted, and when the light emitting unit is in the off state, the infrared light signal is not emitted; a detection module, configured to control the light detection unit of the photoelectric sensor to receive a first light signal and a second light signal within the preset time period, wherein the first light signal corresponds to an ambient light signal in a state where the light emitting unit is turned off in each of the emission cycles, and the second light signal corresponds to a light signal in a state where the light emitting unit is turned on in each of the emission cycles; a processing module configured to perform time domain signal alignment and subtraction processing on a second electrical signal output by the photoelectric sensor after converting the second optical signal and a first electrical signal output by the photoelectric sensor after converting the first optical signal in each emission cycle to obtain a detection signal; The confirmation module is configured to confirm that the electronic device provided with the photoelectric sensor is currently in a target state if the detection signal meets a preset condition, and the preset condition at least includes that the amplitude of the detection signal is within a preset signal amplitude range.

9. An electronic device comprising a photoelectric sensor, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Target state detection device of electronic equipment and electronic equipment

    CN216387375U

  • Apparatus for and method of electro-optically reading a target in the presence of ambient light by detecting and suppressing the ambient light

    US20180094970A1