Method and device for controlling the transmission power of infrared sensors
By adjusting the emission power parameters of the infrared sensor according to the screen brightness value, the problem of light spots caused by the infrared sensor in the bright screen state is solved, realizing the normal operation and high-precision measurement of the infrared sensor in the bright screen state, and reducing product costs.
Patent Information
- Application Number
- CN202211349517.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2042-10-31
AI Technical Summary
Existing technologies using infrared sensors when the screen is on can easily cause light spots on the screen, and alternatives such as touch screens or ultrasonic sensors have lower accuracy and increase product costs.
By acquiring the screen brightness value, the infrared sensor's emission power parameters, such as operating current, pulse width, and pulse count, are adjusted to control the infrared sensor's emission power in a negative correlation, ensuring that the infrared sensor works normally without producing light spots when the screen is on.
When the screen is on, the infrared sensor can work normally without producing light spots, saving product costs and improving measurement accuracy, while avoiding the measurement blind spots of the ultrasonic sensor at close range.
Smart Images

Figure CN115718329B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic equipment technology, and in particular to a method and apparatus for controlling the emission power of an infrared sensor, an electronic device, and a readable storage medium. Background Technology
[0002] With the popularization of smart electronic devices, full-screen electronic devices have become the mainstream form. Infrared sensors are now standard equipment for smart electronic devices, used to determine the approach or distance of people. Infrared sensors are usually placed under the screen. When the screen is on, the infrared sensor works, and due to the photoelectric effect, light spots will appear on the screen.
[0003] Currently, existing technologies stop the infrared sensor from working when the screen is on, allowing electronic devices to use touchscreens or ultrasound to replace the infrared sensor, thus avoiding the generation of light spots.
[0004] The implementation of the above solutions requires electronic devices to have touch screen or ultrasonic functions, which has poor applicability and increases the cost of the product. In addition, the solutions of replacing infrared sensors with touch screens and ultrasonic sensors have lower accuracy compared to infrared sensors. Summary of the Invention
[0005] The present invention provides a method and apparatus for controlling the emission power of an infrared sensor, an electronic device, and a readable storage medium, so as to achieve the effect of normal operation of the infrared sensor without producing light spots when the screen is on.
[0006] In a first aspect, embodiments of the present invention provide a method for controlling the emission power of an infrared sensor, the method comprising:
[0007] Obtain the screen brightness value of an electronic device;
[0008] Based on the screen brightness value, the emission power parameters of the infrared sensor are determined. The emission power parameters include at least one of the following: the operating current value of the infrared sensor within a preset period, the pulse width value, and the number of pulses. Each parameter in the emission power parameters is negatively correlated with the screen brightness value.
[0009] The infrared sensor is controlled to transmit signals according to the transmission power parameters.
[0010] Secondly, embodiments of the present invention provide a control device for the emission power of an infrared sensor, the device comprising:
[0011] The acquisition module is used to acquire the screen brightness value of the electronic device screen;
[0012] The parameter determination module is used to determine the transmission power parameters of the infrared sensor based on the screen brightness value. The transmission power parameters include: the operating current value, pulse width value, and number of pulses of the infrared sensor within a preset period. The parameter value of the transmission power parameters is negatively correlated with the screen brightness value.
[0013] The signal transmission module is used to control the infrared sensor to transmit signals according to the transmission power parameters.
[0014] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method as described in the first aspect.
[0015] Fourthly, embodiments of the present invention also provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the method as described in the first aspect.
[0016] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the method as described in the first aspect.
[0017] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the steps of the method as described in the first aspect.
[0018] In this embodiment, the screen brightness value of the electronic device screen is obtained, and the transmission power parameters of the infrared sensor are determined based on the screen brightness value. The transmission power of the infrared sensor is adjusted by adjusting the transmission power parameters, which include: the operating current value, pulse width value, and number of pulses of the infrared sensor within a preset period. The higher the screen brightness, the smaller each parameter in the transmission power parameters. By reducing the transmission power of the infrared sensor, when the infrared sensor is controlled by the transmission power parameters to work under the current screen brightness, no light spots will appear on the screen, so that the infrared sensor can work normally under bright screen conditions. The screen does not need to be equipped with ultrasonic or touch screen functions, saving product costs. In addition, since the infrared sensor has strong signal reflection and reception capabilities at close range when measuring near or far, while the ultrasonic sensor has a measurement blind zone at close range, the infrared sensor solution has higher measurement accuracy than the alternative ultrasonic solution when the screen is bright. Attached Figure Description
[0019] Figure 1This is a flowchart of the steps of a method for controlling the transmission power of an infrared sensor according to an embodiment of the present invention;
[0020] Figure 2 This is a schematic diagram of the infrared sensor without adjusted transmission power provided in an embodiment of the present invention;
[0021] Figure 3 This is a schematic diagram illustrating the reduction in the operating current value of the infrared sensor provided in this embodiment of the invention;
[0022] Figure 4 This is a schematic diagram illustrating the correspondence between the operating current value and the screen brightness value provided in an embodiment of the present invention;
[0023] Figure 5 This is a schematic diagram illustrating the reduction of the infrared sensor pulse width value provided in an embodiment of the present invention;
[0024] Figure 6 This is a schematic diagram illustrating the reduction in the number of infrared sensor pulses provided in an embodiment of the present invention;
[0025] Figure 7 This is a schematic diagram illustrating the correspondence between the number of pulses and the screen brightness value provided in an embodiment of the present invention;
[0026] Figure 8 This is a block diagram of an infrared sensor emission power control device provided in an embodiment of the present invention;
[0027] Figure 9 An electronic device provided in this embodiment of the invention;
[0028] Figure 10 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0029] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0030] Figure 1 This invention provides a method for controlling the transmission power of an external sensor, the method comprising:
[0031] Step 101: Obtain the screen brightness value of the electronic device screen.
[0032] In this embodiment of the invention, the screen brightness value refers to the brightness of the electronic device's screen. Generally, the screen brightness value ranges from 0 to 255. At a brightness value of 0, the screen is dimmest, and at a brightness value of 255, the screen is brightest. The impact of the infrared sensor's operation on the brightness of the light spots appearing on the screen varies at different screen brightness values. Therefore, the current screen brightness value of the electronic device can be obtained first, and the emission power of the infrared sensor can be adjusted accordingly to ensure that the current operation of the infrared sensor does not produce light spots on the screen.
[0033] Step 102: Determine the transmission power parameters of the infrared sensor based on the screen brightness value. The transmission power parameters include: the operating current value, pulse width value, and number of pulses of the infrared sensor within a preset period. Each parameter in the transmission power parameters is negatively correlated with the screen brightness value.
[0034] In this embodiment of the invention, the electronic device screen can be an OLED (Organic Light-Emitting Diode) screen. Currently, the commonly used under-display infrared solution is a short-wavelength under-display infrared solution, in which the wavelength of the infrared sensor's emitting lamp is 940nm. If the OLED screen is working when it is bright, the infrared light illuminates the TFT (Thin Film Transistor) of the screen's pixel driving circuit, causing a photoelectric effect and generating leakage current. This results in the pixels being abnormally illuminated, producing light spots. The brighter the screen, the greater the leakage current generated by infrared irradiation, and the more obvious the light spots become. Therefore, when the screen is brighter, the emission power of the infrared sensor should be lower to reduce the magnitude of the leakage current generated by the photoelectric effect and reduce the brightness of the screen light spots, thus avoiding the light spots affecting the user experience.
[0035] Furthermore, the preset period is the period of the infrared sensor's transmitted signal. The transmission power of the infrared sensor is affected by the magnitude of the operating current, the pulse width, and the number of pulses within the preset period. Specifically, the larger the operating current, the greater the transmission power of the infrared sensor; the larger the pulse width, the greater the transmission power of the infrared sensor; and the more pulses, the greater the transmission power of the infrared sensor. Therefore, by adjusting the magnitude of the operating current, the pulse width, and the number of pulses within the preset period, the transmission power of the infrared sensor can be adjusted.
[0036] refer to Figure 2 , Figure 2 This is a schematic diagram of an infrared sensor without adjusted transmission power. Figure 2In this diagram, T represents the preset period, I / ma represents the operating current value, Tu represents the pulse width, and the number of black bars represents the number of pulses. By setting a negative correlation between the parameters in the transmission power parameters and the screen brightness value, the values of each parameter in the transmission power parameters decrease as the screen brightness value increases, thereby reducing the transmission power of the infrared sensor and thus reducing the brightness of the light spot. For example, the transmission power of the infrared sensor can be reduced by decreasing the operating current value, decreasing the pulse width value, or decreasing the number of pulses. It should be noted that the transmission power can be adjusted by adjusting only one of the transmission power parameters or by adjusting multiple transmission power parameters simultaneously; this embodiment of the invention does not limit this.
[0037] Optionally, step 102 specifically includes:
[0038] Sub-step 1021: The ratio of the third preset adjustment coefficient to the screen brightness value is taken as the first ratio, and the first ratio is added to the fourth preset adjustment coefficient to obtain the operating current value of the infrared sensor within a preset period.
[0039] In an embodiment of the present invention, reference is made to Figure 3 , Figure 3 This diagram illustrates the reduction in the operating current of the infrared sensor. In the diagram, I1 represents the operating current value relative to... Figure 2 The value of I after reduction in the reference. Figure 4 , Figure 4 This diagram illustrates the relationship between operating current and screen brightness. The relationship between screen brightness and operating current can be expressed by the first formula:
[0040] I = k11 / Br + k12
[0041] Where I is the operating current value, Br is the screen brightness value, k11 is the third preset adjustment coefficient, and K12 is the fourth preset adjustment coefficient. K11 and K12 can be determined based on the correspondence between the screen brightness value Br and the operating current I that does not produce a light spot under the screen brightness value Br. By adjusting the value of the operating current through parameters K11 and K12, the transmission power control of the infrared sensor can be made more accurate.
[0042] Optionally, step 102 specifically includes:
[0043] Sub-step 1022: Obtain the brightness value range to which the screen brightness value belongs, and determine the pulse width value within the preset period of the infrared sensor according to the preset first relationship, wherein the first relationship includes the correspondence between the brightness value range and the pulse width value.
[0044] In an embodiment of the present invention, reference is made to Figure 5 , Figure 5 This is a schematic diagram illustrating the reduction of the pulse width value of an infrared sensor. Figure 5 In this context, Tu represents the pulse width before reduction, and Tu1 represents the pulse width after reduction.
[0045] The pulse width value is negatively correlated with the screen brightness value because the pulse width value generally increases exponentially, such as 4µs, 8µs, 16µs, 32µs, etc. Therefore, the pulse width value can be configured in a gradient according to the screen brightness value. By setting different brightness value ranges and their corresponding pulse widths, it is possible to achieve no glare at different screen brightness values. For example, when Br < Br1, Tu = Tu1; when Br1 < Br < Br2, Tu = Tu2… Br1 can be the first brightness value range, such as 20, and Br1-Br2 can be the second brightness value range, such as 20-40. Tu1 can be greater than Tu2. Through gradient settings, different brightness value ranges correspond to different pulse widths, thus achieving no glare on the screen when it is on.
[0046] Optionally, step 102 specifically includes:
[0047] Sub-step 1023: The ratio of the fifth preset adjustment coefficient to the screen brightness value is used as the second ratio, and the second ratio is added to the sixth preset adjustment coefficient to obtain the number of pulses in the preset period of the infrared sensor.
[0048] In this embodiment of the invention, the number of pulses is negatively correlated with the screen brightness value, as shown in the reference. Figure 6 , Figure 6 This diagram illustrates the reduction in the number of pulses from an infrared sensor. The number of black bars in the diagram represents the number of pulses. (Reference) Figure 7 , Figure 7 This diagram illustrates the relationship between the number of pulses and the screen brightness value. The relationship between screen brightness value and the number of pulses can be expressed by the second formula:
[0049] N = k31 / Br + k32
[0050] Where N is the number of pulses, Br is the screen brightness value, k31 is the fifth preset adjustment coefficient, and K32 is the sixth preset adjustment coefficient. K31 and K32 can be determined based on the correspondence between the screen brightness value Br and the number of pulses N that do not produce light spots under the screen brightness value Br. By adjusting the number of pulses through parameters K31 and K32, the transmission power control of the infrared sensor can be made more accurate.
[0051] Step 103: Control the infrared sensor to transmit signals according to the transmission power parameters.
[0052] In this embodiment of the invention, after determining the power emission parameter value of the infrared sensor based on the screen brightness value, the infrared sensor can be controlled to emit signals based on one or more parameter values included in the power emission parameters, so that the infrared sensor can work normally and not generate light spots under the current screen brightness value.
[0053] Optionally, after step 103, the method further includes:
[0054] Step 104: Receive the actual reflected signal returned by the transmitted signal through the infrared sensor, and determine the target sensitivity value based on the signal strength value of the actual reflected signal and the preset initial sensitivity value.
[0055] In this embodiment of the invention, after adjusting the transmission power parameter of the infrared sensor, the signal strength value of the infrared sensor when there is no object blocking it will also change. The signal strength value reflects the intensity of the reflected signal received by the infrared sensor. After reducing the transmission power of the infrared sensor, the signal strength value of the infrared sensor when there is no object blocking it will also decrease. If the signal strength value when there is no object blocking it is too small, it will affect the accuracy of the infrared sensor. If the signal strength value when there is no object blocking it is too large, it will exceed the register range. Therefore, the magnitude of the signal strength value at output is adjusted by the sensitivity value so that the final output signal strength value meets the accuracy requirements of the infrared sensor and does not exceed the register range. According to the magnitude of the signal strength value, the initial sensitivity value is adaptively adjusted so that the adjusted target sensitivity value can more accurately adjust the output value of the infrared reference value.
[0056] Optionally, step 104 specifically includes:
[0057] Sub-step 1041: Receive the actual reflected signal through the infrared sensor, obtain the first signal intensity value of the actual reflected signal, and obtain the initial sensitivity value; the first signal intensity value is the intensity of the reflected signal received when there is no object blocking the direction of the infrared sensor's emitted signal.
[0058] In this embodiment of the invention, the intensity of the reflected signal received when there is no object blocking the direction of the infrared sensor's emitted signal is used as a first signal intensity value. The first signal intensity value is the intensity of the initial signal value of the received reflected signal after the initial sensitivity value is adjusted. By judging the first signal intensity value, it is determined whether to adjust the initial sensitivity value.
[0059] Sub-step 1042: If the first signal strength value is less than the first threshold, then the initial sensitivity value is increased to obtain the target sensitivity value.
[0060] In this embodiment of the invention, the sensitivity value is a parameter that affects the magnitude of the signal strength value. The first threshold is a preset minimum signal strength value. If the first signal strength value is less than the first threshold, the initial sensitivity value is considered to be small, and the initial sensitivity value can be increased to obtain the target sensitivity value.
[0061] Sub-step 1043: If the first signal strength value is greater than the second threshold, then the initial sensitivity value is reduced to obtain the target sensitivity value.
[0062] In this embodiment of the invention, the second threshold is a preset maximum signal strength value. If the first signal strength value is greater than the first threshold, the initial sensitivity value is considered to be high, causing the signal strength value to exceed the register range. The initial sensitivity value can be reduced to obtain the target sensitivity value.
[0063] Furthermore, the initial sensitivity value can be adjusted in steps, dividing the sensitivity value into different levels. Increasing the sensitivity value raises it by one level, while decreasing it lowers it by one level. This embodiment of the invention does not limit this approach.
[0064] Step 105: Determine the corrected first target detection judgment value based on the signal strength value and target sensitivity value of the actual reflected signal.
[0065] Optionally, step 105 specifically includes:
[0066] Sub-step 1051: Obtain the first signal strength value and the second signal strength value of the actual reflected signal. The first signal strength value is the intensity of the reflected signal received when there is no object blocking the direction of the infrared sensor's emitted signal, and the second signal strength value is the intensity of the reflected signal received when there is an object blocking the direction of the infrared sensor's emitted signal.
[0067] In this embodiment of the invention, the method for determining whether an object is within the preset range of the infrared sensor is to determine whether the difference between the signal strength values received by the infrared sensor when there is no object blocking it exceeds a preset threshold. If it exceeds the threshold, the object is considered to be within the preset distance range of the infrared sensor.
[0068] After adjusting the infrared emission power, the first signal strength value will change accordingly. If the operating current is 100mA at a certain screen brightness level, the corresponding first signal strength value is 100. If the object is 4cm away from the infrared sensor, the second signal strength value is 500. Therefore, the signal strength increment (when there is obstruction, the increment relative to the unobstructed signal strength value) is 400. Setting the preset threshold to 300, the signal strength increment is 400, which is greater than 300, and the infrared sensor correctly determines that the object is within the preset distance range of the infrared sensor.
[0069] If the screen brightness increases and the operating current decreases to 50mA, and the signal strength value or preset threshold is not processed, the first signal strength value will be 50. If the object is 4cm away from the infrared sensor, the second signal strength value will be 250. The signal strength increment of 200 is less than the preset threshold of 300. When the object is close to the infrared sensor at the same distance, the infrared sensor cannot properly determine that the object is within the preset distance range of the infrared sensor, resulting in abnormal function of the infrared sensor.
[0070] Therefore, it is necessary to normalize the signal strength values under different screen brightness to avoid malfunctions of the infrared sensor.
[0071] Sub-step 1052: Based on the operating current value or pulse width value or pulse number, target sensitivity value, first signal strength value, and first preset adjustment coefficient, normalize the first signal strength value to obtain the third signal strength value.
[0072] Sub-step 1053: Based on the operating current value or pulse width value or pulse number, target sensitivity value, second signal strength value, and first preset adjustment coefficient, normalize the second signal strength value to obtain the fourth signal strength value.
[0073] Sub-step 1054: The difference between the third signal strength value and the fourth signal strength value is determined as the first target detection judgment value.
[0074] In this embodiment of the invention, in order to use the same preset threshold to determine whether an object is within a preset distance range of the infrared sensor, the first signal strength value and the second signal strength value can be normalized. This ensures that after adjusting the transmission power parameter, the same first and second signal strength values are obtained at the same distance from the infrared sensor but with different transmission power parameters, thus enabling the infrared sensor to function normally. Specifically, this can include normalization methods for different cases of adjusting the operating current value, pulse width value, or number of pulses.
[0075] In the first scenario, if the transmit power parameter is adjusted to the operating current value, then without considering the sensitivity value, the operating current value can be normalized according to the third formula:
[0076] RAWdata = rawdata × Is / I
[0077] The operating current value is normalized using Is / I, where Is is a preset value, I is the actual operating current value, rawdata is the signal strength value before normalization, and RAWdata is the signal strength value after normalization.
[0078] If Is is specified as 100mA, and the object is 4cm away from the infrared sensor;
[0079] When I = 100mA, the second signal strength value = 500, Is / I = 1, and the normalized second signal strength value = 500.
[0080] When I becomes 50mA, the second signal strength value is 250, Is / I = 2, and the normalized second signal strength value is 250 × 2 = 500.
[0081] I becomes 20mA, the second signal strength value = 100, Is / I = 5, and the normalized second infrared parameter = 100 × 5 = 500.
[0082] This ensures that the signal strength value remains the same under different actual operating current values.
[0083] If the transmit power parameter is adjusted to the operating current value, then without considering the operating current value, the sensitivity value can be normalized according to the fourth formula:
[0084] RAWdata = rawdata × Ks / K
[0085] The sensitivity is normalized using Ks / K, where Ks is a predefined value, K is the actual sensitivity value, rawdata is the signal strength value before normalization, and RAWdata is the signal strength value after normalization.
[0086] If Ks is specified as 2x, and the object is 4 cm away from the infrared sensor;
[0087] When K = 2x, the second signal strength value = 500, Ks / K = 1, and the normalized second signal strength value = 500 × 1 = 500.
[0088] K becomes 4x, the second signal strength value = 1000, Ks / K = 0.5, and the normalized second signal strength value = 1000 × 0.5 = 500.
[0089] When K becomes 1x, the second signal strength value is 250, Ks / K = 2, and the normalized second signal strength value is 250 × 2 = 500.
[0090] This achieves the same signal strength value at different sensitivity levels in sequence.
[0091] Since the actual digital output of the signal strength value is determined by both the operating current value and the sensitivity value, a comprehensive fifth formula can be obtained to determine the final normalized signal strength value.
[0092] RAWdata=rawdata×(k13×Is / I+k14)×Ks / K
[0093] Since the working current value and the signal strength value are not completely linearly related, k13 and k14 are introduced as the first preset adjustment coefficients to adjust the magnitude of the signal strength value. The definitions of other parameters are the same as those above.
[0094] In the second scenario, if the transmit power parameter is adjusted to the pulse width value, then without considering the sensitivity value, the pulse width value can be normalized according to the sixth formula:
[0095] RAWdata = rawdata × Tus / Tu
[0096] The pulse width value is normalized using Tus / Tu, where Tus is a predefined value, Tu is the actual pulse width value, rawdata is the signal strength value before normalization, and RAWdata is the signal strength value after normalization.
[0097] If Tus is specified as 16us, and the object is 4cm away from the infrared sensor;
[0098] Tus = 16us, second signal strength value = 500, Tus / Tu = 1, normalized second signal strength value = 500.
[0099] Tus becomes 32us, the second signal strength value = 1000, Tus / Tu = 0.5, and the normalized second signal strength value = 1000 × 0.5 = 500.
[0100] Tus becomes 8us, the second signal strength value = 250, Tus / Tu = 2, and the normalized second infrared parameter = 250 × 5 = 500.
[0101] This ensures that the signal strength value remains the same under different actual operating current values.
[0102] If the transmit power parameter is adjusted to the pulse width value, then without considering the pulse width value, the sensitivity value can be normalized according to the fourth formula:
[0103] RAWdata = rawdata × Ks / K
[0104] The sensitivity is normalized using Ks / K, where Ks is a predefined value, K is the actual sensitivity value, rawdata is the signal strength value before normalization, and RAWdata is the signal strength value after normalization. For details on sensitivity normalization, please refer to the description above; it will not be repeated here.
[0105] Since the actual digital output of the signal strength value is determined by both the pulse width and sensitivity values, a comprehensive seventh formula can be derived to determine the final normalized signal strength value.
[0106] RAWdata=rawdata×(k21×Tus / Tu+k22)×Ks / K
[0107] Since the pulse width and signal strength are not completely linearly related, k21 and k22 are introduced as the first preset adjustment coefficients. k21 and k22 are determined according to the actual situation and are used to adjust the magnitude of the signal strength. The definitions of other parameters are the same as those above.
[0108] In the third case, if the transmit power parameter is adjusted in terms of the number of pulses, then without considering the sensitivity value, the number of pulses can be normalized according to the eighth formula:
[0109] RAWdata = rawdata × Ns / N
[0110] The number of pulses is normalized using Ns / N, where Ns is a predefined value, N is the actual number of pulses, rawdata is the signal strength value before normalization, and RAWdata is the signal strength value after normalization.
[0111] If Ns is specified as 4, and the object is 4 cm away from the infrared sensor;
[0112] When N=4, the second signal strength value is 500, Ns / N=1, and the normalized second signal strength value is 500.
[0113] When N becomes 8, the second signal strength value is 250, Ns / N = 2, and the normalized second signal strength value is 250 × 2 = 500.
[0114] When N becomes 2, the second signal strength value is 100, Ns / N = 5, and the normalized second infrared parameter is 100 × 5 = 500.
[0115] This achieves the same signal strength value for different actual pulse numbers in sequence.
[0116] If the transmit power parameter is adjusted in terms of the number of pulses, then without considering the influence of the number of pulses, the sensitivity value can be normalized according to the fourth formula:
[0117] RAWdata = rawdata × Ks / K
[0118] For details, please refer to the description of sensitivity normalization above; it will not be repeated here.
[0119] Since the actual digital output of the signal strength value is determined by both the number of pulses and the sensitivity value, a comprehensive ninth formula can be obtained to determine the final normalized signal strength value.
[0120] RAWdata=rawdata×(k33×Tus / Tu+k34)×Ks / K
[0121] Since the number of pulses and the signal strength value are not completely linearly related, k33 and k34 are introduced as the first preset adjustment coefficients. k33 and k34 are determined according to actual use and are used to adjust the magnitude of the signal strength value. The definitions of other parameters are the same as those above.
[0122] By employing the three normalization methods described above, third and fourth signal strength values are obtained. The difference between these values can be calculated to determine whether the object is within the preset distance range of the infrared sensor. This ensures that the same signal strength value is obtained for objects at the same distance from the infrared sensor but with different transmission power parameters, allowing the infrared sensor to make a correct judgment.
[0123] Step 106: If the first target detection judgment value is greater than the preset threshold, it is determined that the object is within the preset distance range of the infrared sensor.
[0124] In this embodiment of the invention, if the first target detection judgment value is greater than the preset threshold, then it is determined that the object is within the preset distance range of the infrared sensor, as described in step 105, which will not be repeated here.
[0125] Optionally, the method after step 103 further includes:
[0126] Step 107: Receive the actual reflected signal returned by the transmitted signal through the infrared sensor, and determine the target sensitivity value based on the signal strength value of the actual reflected signal and the preset initial sensitivity value.
[0127] Refer to step 104; it will not be repeated here.
[0128] Step 108: Determine the second detection judgment value based on the signal strength value of the actual reflected signal and the target sensitivity value.
[0129] Optionally, step 108 specifically includes:
[0130] Sub-step 1081: Obtain the first signal strength value and the second signal strength value of the actual reflected signal. The first signal strength value is the intensity of the reflected signal received when there is no object blocking the direction of the infrared sensor's emitted signal, and the second signal strength value is the intensity of the reflected signal received when there is an object blocking the direction of the infrared sensor's emitted signal.
[0131] In this embodiment of the invention, if the signal strength value is not normalized, the infrared sensor can still function normally by normalizing a preset threshold, i.e., different transmit power parameters correspond to different preset thresholds.
[0132] Specifically, a first signal strength value and a second signal strength value are obtained, and the first signal strength value and the second signal strength value are the actual received signal strength.
[0133] Sub-step 1082: Determine the second detection judgment value based on the first signal strength value, the second signal strength value, and the target sensitivity value.
[0134] In this embodiment of the invention, the first signal intensity value and the second signal intensity value are adjusted by the target sensitivity value to obtain the adjusted first signal intensity value and the second signal intensity value. The difference between the adjusted first signal intensity value and the second signal intensity value is obtained to obtain the second detection judgment value.
[0135] Step 109: Obtain the corrected target preset threshold based on the operating current value, pulse width value, pulse number, initial preset threshold, target sensitivity value, and second adjustment coefficient.
[0136] In this embodiment of the invention, to obtain different preset thresholds under different transmission power parameters, so that the infrared sensor can correctly determine whether an object is within a preset distance range under different transmission power parameters, a method can be included to normalize the preset threshold under different conditions of adjusting the operating current value, pulse width value, or number of pulses.
[0137] In the first scenario, if the transmit power parameter is adjusted to the operating current value, then without considering the sensitivity value, the operating current value can be normalized according to the tenth formula:
[0138] Th_0 = Th × Is / I
[0139] The operating current value is normalized using Is / I, where Is is a preset value, I is the actual operating current value, Th is the initial preset threshold before normalization, and Th_0 is the target preset threshold after normalization.
[0140] If Is is specified as 100mA and the initial preset threshold is 300, then when the object is 4cm away from the infrared sensor;
[0141] When I = 100mA, the initial preset threshold is 300, the first signal strength value = 100, the second signal strength value = 500, the signal strength increment = 400, and the normalized target preset threshold =
[0142] 300×1=300, the signal strength value increment is greater than the target preset threshold, and the infrared sensor normally judges that the object is within the preset distance range;
[0143] When I becomes 50mA, the first signal strength value is 50, the second signal strength value is 250, the signal strength value increment is 200, I / Is = 0.5, and the normalized target preset threshold is 300 × 0.5 = 150. The signal strength value increment of 200 is greater than the target preset threshold of 150, so the infrared sensor normally judges that the object is within the preset distance range.
[0144] When I becomes 20mA, the first signal strength value = 20, the second signal strength value = 100, the signal strength value increment = 80, I / Is = 0.2, the normalized target preset threshold = 300 × 0.2 = 60, the signal strength value increment of 80 is greater than the target preset threshold of 60, and the infrared sensor normally judges that the object is within the preset distance range.
[0145] By normalizing the preset threshold, the infrared sensor can correctly determine whether an object is within the preset distance range.
[0146] If the transmit power parameter is adjusted to the operating current value, then without considering the operating current value, the sensitivity value can be normalized according to formula eleven:
[0147] Th_0=Th×Ks / K
[0148] The sensitivity is normalized using Ks / K, where Ks is a predefined value, K is the actual sensitivity value, Th is the initial preset threshold before normalization, and Th_0 is the target preset threshold after normalization.
[0149] If Ks is specified as 2x, and the object is 4cm away from the infrared sensor, the preset threshold is 300.
[0150] When K = 2x, the first signal strength value = 100, the second signal strength value = 500, the signal strength value increment = 400, the normalized target preset threshold = 300 × 1 = 300, the signal strength value increment 400 is greater than the target preset threshold 300, and the infrared sensor normally judges that the object is within the preset distance range.
[0151] K becomes 4x, the first signal strength value = 200, the second signal strength value = 1000, the signal strength value increment = 800, K / Ks = 2, the normalized target preset threshold = 300 × 2 = 600, the signal strength value increment 800 is greater than the target preset threshold 600, the infrared sensor normally judges that the object is within the preset distance range.
[0152] K becomes 1x, the first signal strength value = 50, the second signal strength value = 250, the signal strength value increment = 200, K / Ks = 0.5, the normalized target preset threshold = 300 × 0.5 = 150, the signal strength value increment of 200 is greater than the target preset threshold of 150, the infrared sensor normally judges that the object is within the preset distance range.
[0153] The infrared sensor can be used to determine that the object is within a preset distance range at different sensitivity values.
[0154] Since the target preset threshold is determined by both the operating current value and the sensitivity value, a comprehensive twelfth formula can be obtained to determine the final normalized target preset threshold.
[0155] Th_0=Th×(k13×Is / I+k14)×Ks / K
[0156] Since the working current value and the preset threshold are not completely linearly related, k13 and k14 are introduced as second preset adjustment coefficients to adjust the size of the target preset threshold. The definitions of other parameters are the same as those above.
[0157] In the second scenario, if the transmit power parameter is adjusted to the pulse width value, then without considering the sensitivity value, the pulse width value can be normalized according to formula thirteen:
[0158] Th_0 = Th × Tus / Tu
[0159] The pulse width value is normalized using Tus / Tu, where Tus is a predefined value, Tu is the actual pulse width value, Th is the initial preset threshold before normalization, and Th_0 is the target preset threshold after normalization.
[0160] If Tus is specified as 16us and the preset threshold is 300, then when the object is 4cm away from the infrared sensor;
[0161] When Tus = 16us, the first signal strength value = 100, the second signal strength value = 500, the signal strength value increment is 400, Tus / Tu = 1, the normalized target preset threshold = 300 × 1 = 300, the signal strength value increment of 400 is greater than the target preset threshold of 300, and the infrared sensor normally judges that the object is within the preset distance range.
[0162] Tus becomes 32us, the first signal strength value = 200, the second signal strength value = 1000, the signal strength value increment is 800, Tus / Tu = 2, the normalized target preset threshold = 300 × 2 = 600, the signal strength value increment of 800 is greater than the target preset threshold of 600, the infrared sensor normally judges that the object is within the preset distance range.
[0163] Tus becomes 8us, the first signal strength value = 50, the second signal strength value = 250, the signal strength value increment is 200, Tus / Tu = 0.5, the normalized target preset threshold = 300 × 0.5 = 150, the signal strength value increment of 200 is greater than the target preset threshold of 150, the infrared sensor normally judges that the object is within the preset distance range;
[0164] The infrared sensor can correctly determine that an object is within a preset distance range under different actual pulse widths.
[0165] If the transmit power parameter is adjusted to the pulse width value, then without considering the pulse width value, the sensitivity value can be normalized according to formula eleven:
[0166] Th_0=Th×Ks / K
[0167] The sensitivity is normalized using Ks / K, where Ks is a predefined value, K is the actual sensitivity value, Th is the initial preset threshold before normalization, and Th_0 is the target preset threshold after normalization. For details, please refer to the description of sensitivity normalization above; it will not be repeated here.
[0168] Since the target preset threshold is determined by both the pulse width and sensitivity values, a comprehensive fourteenth formula can be derived to determine the final normalized target preset threshold:
[0169] Th_0=Th×(k21×Tus / Tu+k22)×Ks / K
[0170] Since the pulse width and the target preset threshold are not completely linearly related, k21 and k22 are introduced as second preset adjustment coefficients. k21 and k22 are determined according to the actual situation and are used to adjust the size of the target preset threshold. The definitions of other parameters are the same as those above.
[0171] In the third case, if the transmit power parameter is adjusted in terms of the number of pulses, then without considering the sensitivity value, the number of pulses can be normalized according to formula number fifteen:
[0172] Th_0 = Th × Ns / N
[0173] The number of pulses is normalized by Ns / N, where Ns is a predefined value, N is the actual number of pulses, Th is the initial preset threshold before normalization, and Th_0 is the target preset threshold after normalization.
[0174] If Ns is specified as 4 and the preset threshold is 300, then when the object is 4 cm away from the infrared sensor;
[0175] When N=4, the first signal strength value = 100, the second signal strength value = 500, the signal strength value increment is 400, Ns / N=1, the normalized target preset threshold = 300×1=300, the signal strength value increment of 400 is greater than the target preset threshold of 300, and the infrared sensor normally judges that the object is within the preset distance range.
[0176] When N becomes 8, the first signal strength value = 200, the second signal strength value = 1000, the signal strength value increment is 800, Ns / N = 2, the normalized target preset threshold = 300 × 2 = 600, the signal strength value increment of 800 is greater than the target preset threshold of 600, and the infrared sensor normally judges that the object is within the preset distance range.
[0177] When N becomes 2, the first signal strength value is 50, the second signal strength value is 250, Ns / N is 0.5, the signal strength value increment is 200, Ns / N is 0.5, and the normalized target preset threshold is 300 × 0.5 = 150. The signal strength value increment of 200 is greater than the target preset threshold of 150, so the infrared sensor normally judges that the object is within the preset distance range.
[0178] By sequentially generating different actual pulse counts, the infrared sensor can normally determine that the object is within the preset distance range.
[0179] If the transmit power parameter is adjusted in terms of the number of pulses, then without considering the influence of the number of pulses, the sensitivity value can be normalized according to formula eleven:
[0180] Th_0=Th×Ks / K
[0181] For details, please refer to the description of sensitivity normalization above; it will not be repeated here.
[0182] Since the target preset threshold is determined by both the number of pulses and the sensitivity value, a comprehensive sixteenth formula can be obtained to determine the final normalized signal strength value.
[0183] Th_0=Th×(k33×Tus / Tu+k34)×Ks / K
[0184] Since the number of pulses and the target preset threshold are not completely linearly related, k33 and k34 are introduced as second preset adjustment coefficients. k33 and k34 are determined according to actual use and are used to adjust the size of the target preset threshold. The definitions of other parameters are the same as those above.
[0185] By employing the three normalization methods described above, a target preset threshold is obtained. This threshold is then used to determine whether an object is within the preset distance range of the infrared sensor. This allows for the use of different target preset thresholds to determine the distance to the infrared sensor under different emission power parameters, ensuring the infrared sensor functions correctly.
[0186] Step 110: When the second detection judgment value is greater than the target preset threshold, it is determined that the object is within the preset distance range of the infrared sensor.
[0187] In this embodiment of the invention, when the second detection judgment value is greater than the target preset threshold, it is determined that the object is within the preset distance range of the infrared sensor, referring to step 109, which will not be repeated here.
[0188] In summary, in this embodiment, by acquiring the screen brightness value of the electronic device screen, the transmission power parameters of the infrared sensor are determined based on the screen brightness value. The transmission power of the infrared sensor is adjusted by adjusting the transmission power parameters, which include: the operating current value, pulse width value, and number of pulses of the infrared sensor within a preset period. The higher the screen brightness, the smaller each parameter in the transmission power parameters. By reducing the transmission power of the infrared sensor, when the infrared sensor operates under the control of the transmission power parameters at the current screen brightness, no light spots will appear on the screen, allowing the infrared sensor to work normally even when the screen is bright. The screen does not need to be equipped with ultrasonic or touch screen functions, saving product costs. In addition, since the infrared sensor has strong signal reflection and reception capabilities at close range when measuring near or far, while the ultrasonic sensor has a measurement blind zone at close range, the infrared sensor solution has higher measurement accuracy than the alternative ultrasonic solution when the screen is bright.
[0189] The infrared sensor emission power control method provided in this application can be executed by an infrared sensor emission power control device. This application uses an example of an infrared sensor emission power control device executing the infrared sensor emission power control method to illustrate the infrared sensor emission power control device provided in this application.
[0190] Figure 8 This invention provides a control device for the transmission power of an infrared sensor, such as... Figure 8 As shown, the device 20 includes:
[0191] The acquisition module 201 is used to acquire the screen brightness value of the electronic device screen;
[0192] The parameter determination module 202 is used to determine the transmission power parameters of the infrared sensor based on the screen brightness value. The transmission power parameters include: the operating current value, pulse width value, and number of pulses of the infrared sensor within a preset period. The parameter values in the transmission power parameters are negatively correlated with the screen brightness value.
[0193] The signal transmitting module 203 is used to control the infrared sensor to transmit signals according to the transmission power parameters.
[0194] Optionally, the device further includes:
[0195] The target sensitivity value determination module is used to receive the actual reflected signal returned by the transmitted signal through the infrared sensor, and determine the target sensitivity value based on the signal strength value of the actual reflected signal and the preset initial sensitivity value.
[0196] The first target detection judgment value determination module is used to determine the corrected first target detection judgment value based on the signal strength value and target sensitivity value of the actual reflected signal.
[0197] The first distance confirmation module is used to determine that the object is within the preset distance range of the infrared sensor if the first target detection judgment value is greater than a preset threshold.
[0198] Optionally, the first target detection judgment value determination module includes:
[0199] The first acquisition submodule is used to acquire a first signal strength value and a second signal strength value of the actual reflected signal. The first signal strength value is the intensity of the reflected signal received when there is no object blocking the direction of the infrared sensor's emitted signal, and the second signal strength value is the intensity of the reflected signal received when there is an object blocking the direction of the infrared sensor's emitted signal.
[0200] The first calculation submodule is used to normalize the first signal strength value based on the operating current value or pulse width value or pulse number, target sensitivity value, first signal strength value, and first preset adjustment coefficient to obtain a third signal strength value.
[0201] The second calculation submodule is used to normalize the second signal strength value based on the operating current value or pulse width value or pulse number, target sensitivity value, second signal strength value, and first preset adjustment coefficient to obtain a fourth signal strength value.
[0202] The first target detection judgment value determination submodule determines the difference between the third signal strength value and the fourth signal strength value as the first target detection judgment value.
[0203] Optionally, the device further includes:
[0204] The target sensitivity value determination module is used to receive the actual reflected signal returned by the transmitted signal through the infrared sensor, and determine the target sensitivity value based on the signal strength value of the actual reflected signal and the preset initial sensitivity value.
[0205] The second detection judgment value determination module is used to determine the second detection judgment value based on the signal strength value of the actual reflected signal and the target sensitivity value.
[0206] The target preset threshold determination module is used to obtain the corrected target preset threshold based on the operating current value or pulse width value or pulse number, the initial preset threshold, the target sensitivity value, and the second adjustment coefficient.
[0207] The second distance confirmation module is used to determine that the object is within the preset distance range of the infrared sensor when the second detection judgment value is greater than the target preset threshold.
[0208] Optionally, the second detection judgment value determination module includes:
[0209] The second acquisition submodule is used to acquire a first signal strength value and a second signal strength value of the actual reflected signal. The first signal strength value is the intensity of the reflected signal received when there is no object blocking the direction of the infrared sensor's emitted signal, and the second signal strength value is the intensity of the reflected signal received when there is an object blocking the direction of the infrared sensor's emitted signal.
[0210] The second detection judgment value determination submodule is used to determine the second detection judgment value based on the first signal strength value, the second signal strength value, and the target sensitivity value.
[0211] Optionally, the target sensitivity value determination module includes:
[0212] The third acquisition submodule is used to receive the actual reflected signal through the infrared sensor, acquire the first signal strength value of the actual reflected signal, and acquire the initial sensitivity value; the first signal strength value is the intensity of the reflected signal received when there is no object blocking the direction of the infrared sensor's emitted signal.
[0213] The first correction submodule is used to increase the initial sensitivity value to obtain the target sensitivity value if the first signal strength value is less than the first threshold.
[0214] The second correction submodule is used to reduce the initial sensitivity value to obtain the target sensitivity value if the first signal strength value is greater than the second threshold.
[0215] Optionally, the parameter determination module 202 includes:
[0216] The first parameter determination submodule is used to take the ratio of the third preset adjustment coefficient to the screen brightness value as the first ratio, and add the first ratio to the fourth preset adjustment coefficient to obtain the operating current value of the infrared sensor within a preset period.
[0217] The second parameter determination submodule obtains the brightness value range to which the screen brightness value belongs, and determines the pulse width value within a preset period of the infrared sensor according to a preset first relationship, wherein the first relationship includes the correspondence between the brightness value range and the pulse width value.
[0218] The third parameter determination submodule takes the ratio of the fifth preset adjustment coefficient to the screen brightness value as the second ratio, and adds the second ratio to the sixth preset adjustment coefficient to obtain the number of pulses in the preset period of the infrared sensor.
[0219] In summary, this application provides a device for controlling the emission power of an infrared sensor. It acquires the screen brightness value of an electronic device's screen, determines the emission power parameters of the infrared sensor based on the screen brightness value, and adjusts the emission power parameters to control the emission power of the infrared sensor. The emission power parameters include: the operating current value, pulse width value, and number of pulses of the infrared sensor within a preset period. The higher the screen brightness, the smaller the parameter values in the emission power parameters. By reducing the emission power of the infrared sensor, when the infrared sensor operates under the control of the emission power parameters at the current screen brightness, it prevents light spots from appearing on the screen, allowing the infrared sensor to work normally even when the screen is bright. The screen does not need to be equipped with ultrasonic or touchscreen functions, saving product costs. Furthermore, since infrared sensors have strong signal reflection and reception capabilities at close range when measuring near or far distances, while ultrasonic sensors have measurement blind spots at close range, the infrared sensor solution provides higher measurement accuracy compared to the alternative ultrasonic solution when the screen is bright.
[0220] In this application embodiment, the control device for the infrared sensor's emission power can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the device.
[0221] In this application embodiment, the control device for the infrared sensor's emission power can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0222] The infrared sensor emission power control device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.
[0223] Optionally, such as Figure 9 As shown, this application embodiment also provides an electronic device 400, including a processor 401 and a memory 402. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the various steps of the above-described infrared sensor emission power control method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0224] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0225] Figure 10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0226] The electronic device 400 includes, but is not limited to, components such as: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.
[0227] Those skilled in the art will understand that the electronic device 400 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 8 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0228] It should be understood that, in this embodiment, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042. The GPU 10041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0229] The memory 1009 can be used to store software programs and various data. The memory 1009 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1009 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1009 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0230] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor 1010.
[0231] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described infrared sensor emission power control method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0232] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0233] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described infrared sensor emission power control method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0234] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0235] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the infrared sensor emission power control method described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0236] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0237] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0238] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method of controlling the transmission power of an infrared sensor, characterized in that The method comprises: acquiring a screen brightness value of an electronic device screen; determining an emission power parameter of the infrared sensor according to the screen brightness value, the emission power parameter comprising: a working current value, a pulse width value and a pulse number of the infrared sensor in a preset period, and the parameter value of the emission power parameter being in a negative correlation with the screen brightness value; controlling the infrared sensor to emit signals according to the emission power parameter; receiving an actual reflection signal returned for the emitted signal by the infrared sensor, and determining a target sensitivity value according to a signal strength value of the actual reflection signal and a preset initial sensitivity value; determining a first target detection judgment value after correction according to the signal strength value of the actual reflection signal and the target sensitivity value; if the first target detection judgment value is greater than a preset threshold value, determining that an object is within a preset distance range of the infrared sensor.
2. The method of claim 1, wherein, The method further comprises: acquiring a first signal strength value and a second signal strength value of the actual reflection signal, the first signal strength value being the strength of the reflection signal received when the direction of the emitted signal of the infrared sensor is not blocked by an object, and the second signal strength value being the strength of the reflection signal received when the direction of the emitted signal of the infrared sensor is blocked by an object; performing a normalization calculation on the first signal strength value according to the working current value or the pulse width value or the pulse number, the target sensitivity value, the first signal strength value and a first preset adjustment coefficient, to obtain a third signal strength value; performing a normalization calculation on the second signal strength value according to the working current value or the pulse width value or the pulse number, the target sensitivity value, the second signal strength value and the first preset adjustment coefficient, to obtain a fourth signal strength value; determining the difference between the third signal strength value and the fourth signal strength value as the first target detection judgment value.
3. The method of claim 1, wherein, The method further comprises: receiving an actual reflection signal returned for the emitted signal by the infrared sensor, and determining a target sensitivity value according to a signal strength value of the actual reflection signal and a preset initial sensitivity value; determining a second target detection judgment value according to the signal strength value of the actual reflection signal and the target sensitivity value; obtaining a preset threshold value after correction according to the working current value or the pulse width value or the pulse number, the initial preset threshold value, the target sensitivity value and a second preset adjustment coefficient; if the second target detection judgment value is greater than the preset threshold value, determining that an object is within a preset distance range of the infrared sensor.
4. The method of claim 3, wherein, The method further comprises: acquiring a first signal strength value and a second signal strength value of the actual reflection signal, the first signal strength value being the strength of the reflection signal received when the direction of the emitted signal of the infrared sensor is not blocked by an object, and the second signal strength value being the strength of the reflection signal received when the direction of the emitted signal of the infrared sensor is blocked by an object; performing a normalization calculation on the first signal strength value according to the working current value or the pulse width value or the pulse number, the target sensitivity value, the first signal strength value and a first preset adjustment coefficient, to obtain a third signal strength value; performing a normalization calculation on the second signal strength value according to the working current value or the pulse width value or the pulse number, the target sensitivity value, the second signal strength value and the first preset adjustment coefficient, to obtain a fourth signal strength value; determining the difference between the third signal strength value and the fourth signal strength value as the first target detection judgment value. acquire a first signal intensity value and a second signal intensity value of the actual reflected signal, the first signal intensity value being an intensity of the reflected signal received when there is no object blocking the direction of the signal emitted by the infrared sensor, and the second signal intensity value being an intensity of the reflected signal received when there is an object blocking the direction of the signal emitted by the infrared sensor; determine a second target detection judgment value according to the first signal intensity value, the second signal intensity value, and the target sensitivity value.
5. The method according to claim 1 or 3, characterized in that, The method further includes: acquiring a first signal intensity value of the actual reflected signal received by the infrared sensor, and acquiring an initial sensitivity value; the first signal intensity value being an intensity of the reflected signal received when there is no object blocking the direction of the signal emitted by the infrared sensor; if the first signal intensity value is less than a first threshold value, increasing the initial sensitivity value to obtain a target sensitivity value; if the first signal intensity value is greater than a second threshold value, decreasing the initial sensitivity value to obtain a target sensitivity value.
6. The method of claim 1, wherein, The method further includes: determining a working current value of the infrared sensor according to the screen brightness value, including:
7. The method of claim 1, wherein, taking a ratio of a third preset adjustment coefficient and the screen brightness value as a first ratio, and adding the first ratio and a fourth preset adjustment coefficient to obtain the working current value of the infrared sensor in a preset period. The method further includes:
8. The method of claim 1, wherein, determining a pulse width value of the infrared sensor according to the screen brightness value, including: acquiring a brightness value interval to which the screen brightness value belongs, and determining a pulse width value in a preset period of the infrared sensor according to a preset first relationship; the first relationship including a corresponding relationship between the brightness value interval and the pulse width value.
9. An apparatus for controlling the transmission power of an infrared sensor, characterized by The method further includes: determining a pulse number of the infrared sensor according to the screen brightness value, including: taking a ratio of a fifth preset adjustment coefficient and the screen brightness value as a second ratio, and adding the second ratio and a sixth preset adjustment coefficient to obtain the pulse number of the infrared sensor in a preset period. The apparatus includes: an acquisition module configured to acquire a screen brightness value of a screen of an electronic device; a parameter determination module configured to determine a transmission power parameter of the infrared sensor according to the screen brightness value, the transmission power parameter including a working current value, a pulse width value, and a pulse number of the infrared sensor in a preset period, and a parameter value of the transmission power parameter being in a negative correlation relationship with the screen brightness value; a signal transmission module configured to control the infrared sensor to perform signal transmission according to the transmission power parameter; a sensitivity determination module configured to receive, by the infrared sensor, an actual reflected signal returned in response to the transmitted signal, and determine a target sensitivity value according to a signal intensity value of the actual reflected signal and an initial sensitivity value; a judgment value determination module configured to determine a first target detection judgment value after correction according to the signal intensity value of the actual reflected signal and the target sensitivity value. A range determining module is configured to determine that the object is within a preset distance range of the infrared sensor if the first target detection judgment value is greater than a preset threshold value.
10. An electronic device, comprising: A processor and a memory are included, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the method in any one of claims 1 to 8.
11. A readable storage medium, characterized by, The readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to implement the steps of the method in any one of claims 1 to 8.
Citation Information
Patent Citations
Calibration method and device of proximity sensor, storage medium and electronic equipment
CN107943345A
Proximity light sensor control method and related equipment
CN114172983A