Distance detection method and device and electronic equipment

By introducing multiple detection units and digital processing modules into the capacitive sensor to perform interference judgment and compensation, the problem of low detection accuracy of capacitive proximity sensors in complex environments is solved, and a higher distance detection accuracy is achieved.

CN120559628APending Publication Date: 2025-08-29VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510858061.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

The existing capacitive proximity sensor has low accuracy in distance detection results, and due to limited space of the whole machine and complex environmental interference, it has failed function.

Method used

A capacitive sensor including at least one first detection unit and a second detection unit is used, and a capacitive sensor is connected to the plate through different detection paths, and interference judgment and compensation are used to use a digital processing module to obtain detection data after the interference is eliminated.

Benefits of technology

The accuracy of the distance detection results of the capacitive sensor is improved, and data stability is achieved through interference compensation adjustment, ensuring the reliability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120559628A_ABST
    Figure CN120559628A_ABST
Patent Text Reader

Abstract

The invention discloses a distance detection method and device and electronic equipment, and belongs to the technical field of electronic equipment. The distance detection device comprises a capacitive sensor, wherein the capacitive sensor comprises at least one first detection unit and at least one second detection unit; the first detection unit is connected to the first polar plate through a first detection path, and the first detection unit is used for outputting first detection data; the second detection unit is connected with a second detection path, and the second detection unit is used for outputting second detection data; and the first digital processing module is respectively connected with the first detection unit and the second detection unit, the first digital processing module is used for determining third detection data according to the first detection data and the second detection data, and the third detection data is the detection data after interference elimination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to a distance detection method, device and electronic equipment. Background Art

[0002] Electronic devices with antennas and transmitters currently generate electromagnetic radiation. To reduce the impact of this radiation on users, capacitive proximity sensors built into electronic devices detect the user's distance. When the user's distance reaches a certain threshold, the antenna's radiation output is reduced, thereby minimizing the amount of radiation reaching the user.

[0003] As the space of the entire device becomes increasingly limited, the capacitor plates of the capacitive proximity sensor are getting closer to other devices. In addition, the environment in which the entire device is used is more complex, and external interference will also couple to the capacitor plates of the capacitive proximity sensor. These will cause the function of the capacitive proximity sensor to fail, thereby reducing the accuracy of the distance detection results of the capacitive proximity sensor. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide a distance detection method, device, and electronic device to solve the problem of low accuracy of distance detection results of existing capacitive proximity sensors.

[0005] In a first aspect, an embodiment of the present application provides a distance detection device, comprising:

[0006] A capacitive sensor comprising at least one first detection unit and at least one second detection unit;

[0007] The first detection unit is connected to the first electrode plate through a first detection path, and the first detection unit is used to output first detection data;

[0008] The second detection unit is connected to the second detection path, and the second detection unit is used to output second detection data;

[0009] A first digital processing module, wherein the first digital processing module is connected to the first detection unit and the second detection unit respectively, and the first digital processing module is used to determine third detection data based on the first detection data and the second detection data, wherein the third detection data is the detection data after eliminating interference.

[0010] In a second aspect, an embodiment of the present application further provides a distance detection method, which is applied to the distance detection device as described in the first aspect, comprising:

[0011] The first digital processing module acquires first detection data output by the first detection unit and second detection data output by the second detection unit on the capacitive sensor;

[0012] The first digital processing module determines third detection data according to the first detection data and the second detection data, where the third detection data is detection data after eliminating interference.

[0013] In a third aspect, an embodiment of the present application further provides an electronic device, comprising the distance detection device as described in the first aspect above.

[0014] In the distance detection device of the embodiment of the present application, there is a capacitive sensor including at least one first detection unit and at least one second detection unit, the first detection unit is connected to the first electrode through the first detection path, the second detection unit is connected to the second detection path, and the first digital processing module is connected to the first detection unit and the second detection unit respectively. The third detection data is determined based on the first detection data output by the first detection unit and the second detection data output by the second detection unit. The third detection data is the detection data after eliminating interference. In this way, the distance detection device uses the detection data output by the detection unit to realize interference judgment of the capacitive sensor for distance detection, and when interference exists, the detection data after eliminating interference is obtained through interference compensation adjustment for subsequent distance calculation, thereby improving the accuracy of the distance detection result of the capacitive sensor. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a schematic diagram of the structure of a commonly used capacitive proximity sensor;

[0016] Figure 2 This is one of the circuit structure diagrams of the distance detection device according to an embodiment of the present application;

[0017] Figure 3 This is the second circuit structure diagram of the distance detection device according to an embodiment of the present application;

[0018] Figure 4 This is one of the flow charts of the distance detection method according to an embodiment of the present application;

[0019] Figure 5 This is the second flow chart of the distance detection method according to an embodiment of the present application;

[0020] Figure 6 This is the third flow chart of the distance detection method according to the embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0022] The terms "first," "second," and the like in the specification of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. Furthermore, the term "and / or" in this specification indicates at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0023] For ease of understanding, the relevant contents of this application are briefly described below.

[0024] Commonly used capacitive proximity sensor structures, such as Figure 1 As shown. The capacitive proximity sensor consists of two parts: the metal plate and the capacitive proximity sensor functional module. The metal plate acts as a plate of the capacitor.

[0025]

[0026] Where: C represents the capacitance between the plate and the ground; k represents the electrostatic force constant; S represents the plate area; ε represents the dielectric constant; and h represents the distance between the object and the plate.

[0027] As the object approaches the external medium, the dielectric constant will change, so the capacitance between the plate and the ground will change.

[0028]

[0029] Among them, C represents the capacitance between the plate and the ground; Q represents the charge; and U represents the voltage difference between the plate and the ground.

[0030] At this time, the same amount of charge is charged to the capacitor, and the voltage difference between the plate and the ground changes. By detecting the change in the plate voltage, the change in external capacitance can be determined, thereby inferring the distance of the object.

[0031] The external capacitance can be detected by charging and discharging the electrode through a capacitive proximity sensor (such as a SAR sensor), and the charge is transferred to the capacitance-to-voltage module inside the sensor, and then voltage sampling is performed to achieve analog-to-digital conversion.

[0032] However, in the terminal environment, many other components operate in addition to the SAR sensor, creating a complex operating environment. External coupling interference can affect the sensor's normal operation, leading to SAR sensor failure. Furthermore, device space is becoming increasingly limited. As the capacitor plates of capacitive sensors are increasingly close to other components, interference increases, further impacting the SAR sensor's normal operation and causing SAR sensor failure. Furthermore, with the increasing number of device components and interference frequency bands, the SAR sensor's internal capacitance-to-voltage converter is more susceptible to interference.

[0033] In order to solve the above technical problems, the distance detection device provided in the embodiment of the present application is described in detail below through specific embodiments and application scenarios in combination with the accompanying drawings.

[0034] like Figure 2 FIG. 1 is a schematic diagram of the circuit structure of a distance detection device according to an embodiment of the present application. The distance detection device includes: a capacitive sensor 1, comprising at least one first detection unit 11 and at least one second detection unit 12; the first detection unit 11 is connected to the first electrode 3 via a first detection path 2, and outputs first detection data; the second detection unit 12 is connected to the second detection path 4, and is configured to output second detection data; and a first digital processing module 31, connected to the first detection unit 11 and the second detection unit 12, respectively, and configured to determine third detection data based on the first detection data and the second detection data, wherein the third detection data is the detection data after interference elimination.

[0035] The distance detection device of the embodiment of the present application has a capacitive sensor including at least one first detection unit and at least one second detection unit, the first detection unit is connected to the first electrode through a first detection path, the second detection unit is connected to the second detection path, and the first digital processing module is connected to the first detection unit and the second detection unit respectively. Third detection data is determined based on the first detection data output by the first detection unit and the second detection data output by the second detection unit. The third detection data is the detection data after eliminating interference. In this way, the distance detection device uses the detection data output by the detection unit to realize interference judgment of the capacitive sensor for distance detection, and when interference exists, obtains the detection data after eliminating interference through interference compensation adjustment for subsequent distance calculation, thereby improving the accuracy of the distance detection result of the capacitive sensor.

[0036] In some embodiments, the first detection unit 11 and the second detection unit 12 both include:

[0037] The capacitance-to-voltage module 5 is configured to convert the capacitance signal into an analog voltage signal. Specifically, the capacitance-to-voltage module 5 converts the capacitance signal into an analog voltage signal according to a set sampling frequency.

[0038] The analog-to-digital conversion module 6 is connected to the capacitance-to-voltage conversion module 5 and is used to convert the analog voltage signal into a digital signal.

[0039] The second digital processing module 7 is connected to the analog-to-digital conversion module 6 and is used to filter the digital signal to obtain first output data.

[0040] Here, filtering the digital signal is performed to remove noise. The first output data is also a digital signal.

[0041] The capacitance-to-voltage module 5 , the analog-to-digital conversion module 6 and the second digital processing module 7 are connected in sequence, and the second digital processing module 7 is connected to the first digital processing module 31 .

[0042] As an optional implementation method, see Figure 2 The first detection path 2 includes a first resistor 21, a first wiring path 22, a first inductor 23, and a first capacitor 24. The first wiring path 22 is electrically connected to the first resistor 21 and the first inductor 23, respectively. The first inductor 23 is electrically connected to the first electrode plate 3 and the first capacitor 24, respectively. The first capacitor 24 is grounded. The first resistor 21 is electrically connected to the first detection unit 11. Specifically, the first resistor 21 is electrically connected to the capacitance-to-voltage module 5 within the first detection unit 11.

[0043] Here, the first routing path 22 is used for electrical connection.

[0044] Based on this, optionally, the second detection path 4 includes a second resistor 8 and a second routing path 9 , and the second resistor 8 is connected to the second routing path 9 and the second detection unit 12 respectively.

[0045] Among them, although the second routing path 9 is not electrically connected to the electrode plate, it can still be used to sense whether there is interference. By comparing the second detection data collected by the second routing path 9 with the first detection data, it can be determined whether there is interference.

[0046] It should be noted that the first detection channel 2 serves as the main detection channel, and the second detection channel 4 serves as the auxiliary detection channel. The capacitance signal collected through the main detection channel will be processed by the first detection unit 11 to output the first detection data, and the capacitance signal collected through the auxiliary detection channel will be processed by the second detection unit 12 to output the second detection data.

[0047] Next, the first digital processing module 31 uses the first detection data output by the first detection unit 11 and the second detection data output by the second detection unit 12 to determine whether interference exists during the distance detection by the capacitive sensor. If interference exists, the module performs interference compensation to obtain third detection data after eliminating the interference, which is then used for distance calculation. This interference compensation adjustment stabilizes the output data, ensuring the stability of the capacitive sensor. Furthermore, the interference-compensated data can be used for subsequent distance calculations, improving the accuracy of the capacitive sensor's distance detection results.

[0048] In some embodiments, the first digital processing module 31 is further configured to:

[0049] determining, based on the first detection data and the second detection data, whether there is interference in distance detection by the capacitive sensor;

[0050] If it is determined that the first type of interference exists after the judgment, determining the first coefficient according to the first detection data and the second detection data, and determining the third detection data according to the first coefficient, the first detection data and the second detection data;

[0051] Here, the first type of interference refers to the monotonicity of the first detection data and the monotonicity of the second detection data. In other words, the first type of interference is interference that causes the detection data to be monotonic. It should be noted that monotonicity refers to the overall upward or downward trend of the data, which can be simply understood as whether the overall trend of the function curve satisfies a monotonic function.

[0052] If it is determined after the judgment that the second type of interference exists, determining the second coefficient according to the first detection data and the second detection data, and determining the third detection data according to the second coefficient, the first detection data and the second detection data;

[0053] Here, the second type of interference refers to interference caused by frequency superposition of the first detection data and frequency superposition of the same frequency as the first detection data in the second detection data. The second type of interference is interference caused by frequency superposition.

[0054] If it is determined after judgment that the third type of interference exists, adjusting the sampling frequency of the capacitance-to-voltage module in the first detection unit, and using the average value of the first detection data obtained after adjusting the sampling frequency as the third detection data;

[0055] Here, the third type of interference refers to the presence of frequency superposition in the first detection data and the absence of frequency superposition in the second detection data, that is, only the first detection data has frequency superposition, and the purpose of adjusting the sampling frequency is to avoid the interference frequency.

[0056] If it is determined that no interference exists, the first detection data is used as the third detection data.

[0057] Based on this, in some embodiments, the first digital processing module 31 is further configured to:

[0058] When the first detection data is monotonic and the second detection data is monotonic, determining that a first type of interference exists;

[0059] When the first detection data is monotonic and the second detection data is not monotonic, determining that there is no interference;

[0060] In the case where the first detection data is not monotonic, determining whether the first detection data has frequency superposition, and obtaining a determination result;

[0061] If the judgment result is negative, it is determined that there is no interference;

[0062] If the judgment result is yes and the second detection data has frequency superposition of the same frequency as the first detection data, it is determined that the second type of interference exists;

[0063] If the judgment result is yes and there is no frequency superposition in the second detection data, it is determined that the first detection data has the third type of interference.

[0064] The first digital processing module 31 uses the first detection data output by the first detection unit 11 and the second detection data output by the second detection unit 12 to determine whether there is interference in the distance detection of the capacitive sensor. When there is interference (such as the first type of interference, the second type of interference, and the third type of interference), the third detection data after eliminating the interference is obtained through corresponding interference compensation adjustment for distance calculation. In this way, the accuracy of the distance detection result of the capacitive sensor can be improved.

[0065] As an optional implementation method, see Figure 3 The capacitive sensor 1 includes at least one first detection unit 11. Each first detection path 2 includes a first resistor 21, a first wiring path 22, a first inductor 23, and a first capacitor 24. The first wiring path 22 is electrically connected to the first resistor 21 and the first inductor 23, respectively. The first inductor 23 is electrically connected to the electrode plate (3 or 3') and the first capacitor 24, respectively. The first capacitor 24 is grounded. The first resistor 21 is electrically connected to the first detection unit 11. Specifically, the first resistor 21 is electrically connected to the capacitance-to-voltage module 5 within the first detection unit 11.

[0066] It is understandable that when there are two first detection paths 2 and two first detection units 11, different first detection units 11 can detect whether there is interference between different plates, such as Figure 3 As shown, one of the first detection units 11 can be connected to the second electrode plate 3 ′ to detect whether there is interference on the second electrode plate 3 ′.

[0067] It should be noted that the two first detection channels 2 are independent detection channels without distinction between primary and secondary. The capacitance signals collected by the two detection channels will be processed by their respective detection units to output their respective corresponding first detection data.

[0068] It can be understood that each step of processing data in each first detection unit 11 can be implemented by its second digital processing module 7 .

[0069] Afterwards, the second digital processing module 7 is further configured to determine fourth detection data based on the first detection data, where the fourth detection data is the detection data after interference elimination. Specifically, the second digital processing module 7 determines whether interference exists during the distance detection performed by the capacitive sensor based on the first detection data output by the first detection unit 11. If interference exists, the module then performs interference compensation to obtain fourth detection data after interference elimination for use in distance calculation. In this way, the interference compensation adjustment stabilizes the output data, ensuring the stability of the capacitive sensor. Furthermore, subsequent distance calculations using the data after interference compensation can improve the accuracy of the capacitive sensor's distance detection results.

[0070] In the second embodiment, two first detection units 11 are integrated in the capacitive sensor. This is only an example. Two or more first detection units can be integrated in the capacitive sensor. The first detection paths corresponding to different first detection units are connected to different first plates, and the positions of different first plates are different. This is not only conducive to the overall layout design when the distance detection device is applied to electronic equipment, but also can achieve effect detection in multiple directions and multiple positions.

[0071] In some embodiments, the second digital processing module 7 is further configured to:

[0072] determining, based on the first detection data, whether there is interference in distance detection by the capacitive sensor;

[0073] If interference is determined, adjusting the sampling frequency of the capacitance-to-voltage module in the first detection unit, and using the average value of the first detection data calculated after adjusting the sampling frequency as the fourth detection data;

[0074] Here, as long as the first detection unit 11 outputs data, the second digital processing module 7 can determine whether there is interference in the distance detection of the capacitive sensor based on the first detection data output by the first detection unit 11. When interference is determined to be present, the sampling frequency of the capacitance-to-voltage module in the first detection unit 11 is adjusted to avoid external interference in the future, and the average value of the first detection data calculated after the sampling frequency adjustment is used as the fourth detection data, where the fourth detection data is used for subsequent distance calculation, thereby improving the accuracy of the distance detection result of the capacitive sensor.

[0075] If it is determined that there is no interference, the first detection data is used as the fourth detection data.

[0076] Here, when it is determined that there is no interference, it means that the first detection data is stable and the state of the capacitive sensor is stable, and the first detection data output by the first detection unit 11 can be directly used for subsequent distance calculation.

[0077] In some embodiments, the second digital processing module 7 is further configured to:

[0078] For each first detection data, calculating a first difference between a maximum value and a minimum value in the first detection data;

[0079] When the first difference is greater than the first threshold and the first detection data is not monotonic, it is determined that interference exists;

[0080] It should be noted that the first difference is greater than the first threshold, indicating that the data value span in the first detection data is large. Meanwhile, the first detection data is not monotonic, indicating that the first detection data is also unstable. Therefore, it is determined that interference exists.

[0081] In a case where the first difference is smaller than or equal to the first threshold, or the first difference is greater than the first threshold and the first detection data is monotonic, it is determined that there is no interference.

[0082] It should be noted that if the first difference is less than or equal to the first threshold, it means that the data value in the first detection data changes little, and the data is determined to be stable and there is no interference; or if the first difference is greater than the first threshold, it means that the data value in the first detection data has a large span, and the first detection data is monotonic, it means that the first detection data is stable, and therefore it is determined that there is no interference.

[0083] like Figure 4 As shown, the embodiment of the present application further provides a distance detection method, which is applied to the distance detection device as described in the above embodiment, that is, the method is performed by the distance detection device. The method may specifically include:

[0084] Step 401: A first digital processing module obtains first detection data output by a first detection unit and second detection data output by a second detection unit on a capacitive sensor.

[0085] In step 402 , the first digital processing module determines third detection data based on the first detection data and the second detection data, where the third detection data is detection data after eliminating interference.

[0086] The distance detection method of the embodiment of the present application is applied to a distance detection device, which has a capacitive sensor including at least one first detection unit and at least one second detection unit, wherein the first detection unit is designed to be connected to the first electrode plate through a first detection path, the second detection unit is connected to the second detection path, and the first digital processing module is connected to the first detection unit and the second detection unit respectively. Third detection data is determined based on the first detection data output by the first detection unit and the second detection data output by the second detection unit. The third detection data is the detection data after eliminating interference. In this way, the detection data output by the detection unit can be used to realize interference judgment of distance detection by the capacitive sensor, and when interference exists, the detection data after eliminating interference is obtained through interference compensation adjustment for subsequent distance calculation, thereby improving the accuracy of the distance detection result of the capacitive sensor.

[0087] In some embodiments, in step 402, the first digital processing module determines the third detection data based on the first detection data and the second detection data, including:

[0088] Step 4021: The first digital processing module determines whether there is interference in the distance detection of the capacitive sensor based on the first detection data and the second detection data.

[0089] In some embodiments, the first digital processing module determines whether interference exists in distance detection by the capacitive sensor based on the first detection data and the second detection data, which may include:

[0090] The first digital processing module determines that a first type of interference exists when the first detection data is monotonic and the second detection data is monotonic;

[0091] Here, the first type of interference refers to the monotonicity of the first detection data and the monotonicity of the second detection data. In other words, the first type of interference is monotonic. It should be noted that monotonicity refers to the overall upward or downward trend of the data, which can be simply understood as whether the function curve still has fluctuations or is a straight line.

[0092] Whether the first detection data is monotonic can be determined using a least squares method. Specifically, the first detection data is calculated and processed based on the least squares method to obtain an expected value and a slope value corresponding to the first detection data. If the expected value is within a first preset range and the slope value is within a second preset range, the first detection data is determined to be monotonic.

[0093] The first digital processing module determines that there is no interference when the first detection data is monotonic and the second detection data is not monotonic;

[0094] It should be noted that simply determining that the first detection data is monotonic does not determine whether interference exists. It only indicates that the first detection data does not have interference or that the same monotonic interference exists. Further determination of whether the second detection data is monotonic is necessary. Similarly, the above method is also used to determine whether the second detection data is monotonic. Monotonic interference includes, but is not limited to, interference caused by rising device temperature.

[0095] The first digital processing module determines whether there is frequency superposition in the first detection data when the first detection data is not monotonic, and obtains a determination result;

[0096] Here, whether there is frequency superposition in the first detection data can be determined by Fourier transform.

[0097] If the judgment result is negative, the first digital processing module determines that there is no interference;

[0098] The first digital processing module determines that the second type of interference exists when the judgment result is yes and the second detection data has a frequency superposition of the same frequency as the first detection data;

[0099] It should be noted that after determining whether the first detection data has frequency superposition, it is necessary to further determine whether the second detection data has frequency superposition at the same frequency as the first detection data to determine whether there is co-frequency interference between the first and second detection data. The determination of whether the second detection data has frequency superposition interference can be performed using Fourier transform.

[0100] Here, the second type of interference refers to the presence of frequency superposition in the first detection data and the presence of frequency superposition in the second detection data at the same frequency as the first detection data. The second type of interference is frequency superposition interference. Frequency superposition interference includes but is not limited to co-frequency interference of the NFC antenna and co-frequency interference of the current loop.

[0101] When the judgment result is yes and there is no frequency superposition in the second detection data, the first digital processing module determines that the third type of interference exists in the first detection data.

[0102] Here, the third type of interference refers to the presence of frequency superposition in the first detection data and the absence of frequency superposition in the second detection data, that is, the presence of frequency superposition in only the first detection data.

[0103] Step 4022: If the first digital processing module determines that the first type of interference exists, the first digital processing module determines a first coefficient based on the first detection data and the second detection data, and determines third detection data based on the first coefficient, the first detection data, and the second detection data.

[0104] As an optional implementation, determining the first coefficient according to the first detection data and the second detection data may include:

[0105] Calculating a first slope value of the first detection data and a second slope value of the second detection data;

[0106] It should be noted that the first detection data includes n detection data output by the first detection unit 11 after n consecutive detections, and the second detection data includes n detection data output by the second detection unit 12 after n consecutive detections, where n is an integer greater than 1.

[0107] Here, for monotonic interference, the first slope value of the first detection data is represented by k1, and the second slope value of the second detection data is represented by k2.

[0108] A ratio of the first slope value to the second slope value is determined as a first coefficient.

[0109] As an optional implementation, determining the third detection data according to the first coefficient, the first detection data, and the second detection data includes:

[0110] Calculate the product of the first coefficient and the second detection data obtained in this detection to obtain first product data;

[0111] A first difference between the first detection data and the first product data obtained in this detection is determined as the third detection data.

[0112] Here, for monotonic interference, the first coefficient x = k1 / k2, if the first detection data obtained by this detection is represented by a, and the second detection data obtained by this detection is represented by b, then the first product data = b*x, the first difference = ab*x, and the third detection data, that is, the current output data is ab*x.

[0113] Step 4023: If the first digital processing module determines that the second type of interference exists, the first digital processing module determines a second coefficient based on the first detection data and the second detection data, and determines third detection data based on the second coefficient, the first detection data, and the second detection data.

[0114] Here, the second type of interference is a frequency superposition type of interference. For the frequency superposition type of interference, the first slope value of the first detection data is represented by k3, and the second slope value of the second detection data is represented by k4.

[0115] For frequency superposition type interference, the second coefficient y = k3 / k4. If the first detection data obtained in this detection is represented by a and the second detection data obtained in this detection is represented by b, then the first product data = b*y, the first difference = ab*y, and the third detection data, that is, the current output data is ab*y.

[0116] In step 4024, if the first digital processing module determines that the third type of interference exists, the first digital processing module adjusts the sampling frequency of the capacitance-to-voltage module in the first detection unit, and uses the average value of the first detection data calculated after the sampling frequency adjustment as the third detection data.

[0117] For the third type of interference, that is, when only the first detection data has frequency superposition, the sampling frequency of the capacitance-to-voltage module in the first detection unit is adjusted, and the average value of the first detection data calculated after adjusting the sampling frequency is used as the third detection data.

[0118] Optionally, if the sampling frequency of the capacitance-to-voltage module 5 in the first detection unit 11 is A before, the sampling frequency of the capacitance-to-voltage module 5 in the first detection unit 11 is adjusted to A+f, where f represents the changed frequency.

[0119] The above is a specific implementation of how to determine the third detection data when interference exists. As for how to determine the third detection data when no interference exists, see step 4025 below.

[0120] In step 4025 , when the first digital processing module determines that there is no interference, the first detection data is used as the third detection data.

[0121] Here, when the first digital processing module determines that there is no interference, it means that the first detection data is stable and the state of the capacitive sensor is stable. The first detection data (i.e., the third detection data) output by the first detection unit can be directly used for subsequent distance calculation.

[0122] See also Figure 5 The following describes the implementation process of the distance detection method of the present application, which is applicable to the above-mentioned Figure 2 The distance detection device shown.

[0123] Step 501: The sampling frequencies of the capacitance-to-voltage module of the first detection unit and the capacitance-to-voltage module of the second detection unit are both set to an initial frequency F=A;

[0124] Step 502: The first digital processing module reads n data a1 to an outputted by the first detection unit; and reads n data b1 to bn outputted by the second detection unit.

[0125] Step 503, determine whether a1-an are monotonic;

[0126] If yes, go to step 504; if no, go to step 506.

[0127] Step 504, determine whether b1 to bn are monotonic;

[0128] If yes, go to step 505; if no, go to step 507.

[0129] Step 505, output value = ab*x;

[0130] It should be noted that when a1-an and b1-bn are monotonic, this indicates external interference with the same plate trend, and the output value is the data after compensation for the x coefficient. Here, the slope k1 of a1-an and the slope k2 of b1-bn need to be fitted using the least squares method when the built-in parameters are used, where x = k1 / k2.

[0131] Step 506, determining whether a1-an have frequency superposition f1 by Fourier transform;

[0132] If not, execute step 507; if so, execute step 508.

[0133] Step 507, output value = a;

[0134] Step 508, determine whether b1-bn have frequency superposition f1 by Fourier transform;

[0135] It should be noted that the frequency superposition of a1~an and the frequency superposition of b1~bn are calculated. The two groups of data a1~an and b1~bn are amplitude data. Fourier transform is performed on these two groups of data to obtain frequency domain signals; and the maximum point of the transformed frequency domain signal is queried to confirm the frequency point f1, and to confirm whether a1~an and b1~bn have the same frequency superposition.

[0136] Specifically, the Fourier transform can be expressed as:

[0137]

[0138] Among them, h[n] is a low-pass filter and g[n] is a high-pass filter, which can be adjusted according to the actual measured data.

[0139] d[j] is the frequency domain signal representation after transformation.

[0140] If yes, go to step 509; if no, go to step 510.

[0141] Step 509, output value = ab*y;

[0142] If the data output by the first and second detection units have the same frequency, it indicates external co-frequency interference, and the output value is the data after the y coefficient compensation. When built-in parameters are required, the slope k3 of a1 to an and the slope k4 of b1 to bn are fitted using the least squares method, where y = k3 / k4.

[0143] It should be noted that in this example, a and b represent the current output data.

[0144] Step 510: Adjust the sampling frequency F=A+f of the capacitance-to-voltage module of the first detection unit, and the output value=sum(a1, ...an) / n.

[0145] Among them, when the data output by the first detection unit carries a certain external frequency point, but the data output by the second detection unit does not have this frequency point, it means that the data output by the first detection unit is interfered with by the external same-frequency interference. At this time, the sampling frequency F=A+f of the capacitance-to-voltage module of the first detection unit is adjusted to stagger the sampling frequency jump and the frequency superposition interference.

[0146] In some embodiments, the first detection data includes detection data output by two first detection units 11; this embodiment is applicable to Figure 3 The distance detection device shown corresponds to the distance detection device corresponding to the second embodiment described above; accordingly, the method of the present application further includes:

[0147] The second digital processing module within the first detection unit determines fourth detection data based on the first detection data. The fourth detection data is the detection data after eliminating interference. It is understood that each processing step of determining the fourth detection data based on the first detection data can be implemented by the second digital processing module within the first detection unit.

[0148] As an optional implementation, the second digital processing module determines the fourth detection data based on the first detection data, including:

[0149] 1) The second digital processing module determines whether there is interference in the distance detection of the capacitive sensor based on the first detection data;

[0150] Optionally, the second digital processing module determines, based on the first detection data, whether interference occurs in distance detection by the capacitive sensor, including:

[0151] The second digital processing module calculates a first difference between a maximum value and a minimum value in each first detection data;

[0152] The second digital processing module determines that interference exists when the first difference is greater than a first threshold and the first detection data is not monotonic;

[0153] Here, the second difference is greater than the first threshold, indicating that the data value span in the first detection data is large, and the first detection data is not monotonic, indicating that the first detection data is also unstable, so it is determined that interference exists.

[0154] The second digital processing module determines that there is no interference when the first difference is less than or equal to the first threshold, or when the first difference is greater than the first threshold and the first detection data is monotonic.

[0155] It should be noted that if the first difference is less than or equal to the first threshold, it means that the data value in the first detection data changes little, and the data is determined to be stable and there is no interference; or, if the first difference is greater than the first threshold, it means that the data value in the first detection data has a large span, and the first detection data is monotonic, it means that the first detection data is stable, and therefore it is determined that there is no interference.

[0156] 2) When the second digital processing module determines that interference exists, it adjusts the sampling frequency of the capacitance-to-voltage module in the first detection unit, and uses the average value of the first detection data calculated after the sampling frequency adjustment as the fourth detection data;

[0157] It should be noted that as long as the first detection unit outputs data, the second digital processing module can determine whether interference exists during distance detection by the capacitive sensor based on the first detection data output by the first detection unit. If interference exists, the sampling frequency of the capacitance-to-voltage module within the first detection unit is adjusted to avoid subsequent external interference. The average value of the first output data calculated after the sampling frequency adjustment is used as the fourth detection data, where the fourth detection data is used for subsequent distance calculation. This can improve the accuracy of the distance detection results of the capacitive sensor.

[0158] 3) When the second digital processing module determines that there is no interference, the first detection data is used as the fourth detection data.

[0159] When it is determined that there is no interference, it means that the first detection data is stable and the state of the capacitive sensor is stable, and the first detection data output by the first detection unit can be directly used for subsequent distance calculation.

[0160] See also Figure 6 The following describes the implementation process of the distance detection method of the present application, which is applicable to the above-mentioned Figure 3 The distance detection device shown.

[0161] Step 601: The sampling frequency of the capacitance-to-voltage module of the first detection unit is set to an initial frequency F=A;

[0162] Step 602: The digital processing module reads n data a1-an outputted by the detection unit;

[0163] Step 603, calculating the difference X between the maximum and minimum values ​​of a1 to an;

[0164] Step 604 , determining whether X is greater than m; wherein m refers to a threshold value set manually based on experience, namely, a first threshold value.

[0165] If yes, execute step 605; if no, execute step 606.

[0166] Step 605, determine whether a1-an are monotonic;

[0167] If yes, go to step 606; if no, go to step 607.

[0168] Step 606, output value = a;

[0169] It should be noted that, in this example, a represents the current output data.

[0170] Step 607 , adjusting the sampling frequency F=A+f of the capacitance-to-voltage module of the first detection unit, and outputting a value=sum(a1, . . . an) / n.

[0171] An embodiment of the present invention further provides an electronic device, comprising the distance detection device as described in the above embodiment.

[0172] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0173] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A distance detection device, characterized in that: include: A capacitive sensor comprising at least one first detection unit and at least one second detection unit; The first detection unit is connected to the first electrode plate through a first detection path, and the first detection unit is used to output first detection data; The second detection unit is connected to the second detection path, and the second detection unit is used to output second detection data; A first digital processing module, wherein the first digital processing module is connected to the first detection unit and the second detection unit respectively, and the first digital processing module is used to determine third detection data based on the first detection data and the second detection data, wherein the third detection data is the detection data after eliminating interference.

2. The distance detection device according to claim 1, wherein: The first detection unit and the second detection unit include: Capacitance-to-voltage module, used to convert capacitance signals into analog voltage signals; an analog-to-digital conversion module, connected to the capacitance-to-voltage conversion module, and configured to convert the analog voltage signal into a digital signal; a second digital processing module, connected to the analog-to-digital conversion module, configured to filter the digital signal to obtain first detection data; The capacitance-to-voltage module, the analog-to-digital conversion module, and the second digital processing module are connected in sequence, and the second digital processing module is connected to the first digital processing module.

3. The distance detection device according to claim 1, wherein: The first detection path includes a first resistor, a first routing path, a first inductor and a first capacitor; wherein, the first routing path is electrically connected to the first resistor and the first inductor respectively, the first inductor is electrically connected to the first electrode plate and the first capacitor respectively, the first capacitor is grounded, and the first resistor is electrically connected to the first detection unit.

4. The distance detection device according to claim 1, wherein: The second detection path includes a second resistor and a second routing path, and the second resistor is respectively connected to the second routing path and the second detection unit.

5. The distance detection device according to claim 1, wherein: The first digital processing module is further configured to: determining, based on the first detection data and the second detection data, whether interference exists in distance detection by the capacitive sensor; If it is determined after the judgment that the first type of interference exists, determining a first coefficient according to the first detection data and the second detection data, and determining the third detection data according to the first coefficient, the first detection data, and the second detection data; If it is determined after the judgment that the second type of interference exists, determining a second coefficient based on the first detection data and the second detection data, and determining the third detection data based on the second coefficient, the first detection data, and the second detection data; If it is determined after judgment that the third type of interference exists, adjusting the sampling frequency of the first detection unit, and using an average value of the first detection data obtained after adjusting the sampling frequency as the third detection data; If it is determined that no interference exists, the first detection data is used as the third detection data.

6. The distance detection device according to claim 5, characterized in that The first digital processing module is further configured to: When the first detection data is monotonic and the second detection data is monotonic, determining that the first type of interference exists; When the first detection data is monotonic and the second detection data is not monotonic, determining that there is no interference; In a case where the first detection data is not monotonic, determining whether the first detection data has frequency superposition, and obtaining a determination result; If the judgment result is no, determining that there is no interference; If the judgment result is yes and the second detection data has frequency superposition of the same frequency as the first detection data, determining that the second type of interference exists; If the judgment result is yes and the second detection data does not have frequency superposition, it is determined that the first detection data has the third type of interference.

7. The distance detection device according to claim 1, wherein: The first detection unit is further configured to determine fourth detection data based on the first detection data, where the fourth detection data is detection data after interference is eliminated.

8. The distance detection device according to claim 7, characterized in that: The first detection unit is further configured to: determining, based on the first detection data, whether there is interference in distance detection by the capacitive sensor; If interference is determined to exist, adjusting the sampling frequency of the first detection unit, and using an average value of the first detection data calculated after adjusting the sampling frequency as the fourth detection data; or, If it is determined that no interference exists, the first detection data is used as the fourth detection data.

9. The distance detection device according to claim 8, characterized in that: The first detection unit is further configured to: For each first detection data, calculating a first difference between a maximum value and a minimum value in the first detection data; When the first difference is greater than a first threshold and the first detection data is not monotonic, determining that interference exists; In a case where the first difference is smaller than or equal to the first threshold, or the first difference is larger than the first threshold and the first detection data is monotonic, it is determined that there is no interference.

10. A distance detection method, applied to the distance detection device according to any one of claims 1 to 9, characterized in that: include: The first digital processing module acquires first detection data output by the first detection unit and second detection data output by the second detection unit on the capacitive sensor; The first digital processing module determines third detection data according to the first detection data and the second detection data, where the third detection data is detection data after eliminating interference.

11. The method according to claim 10, characterized in that The first digital processing module determines third detection data according to the first detection data and the second detection data, including: The first digital processing module determines whether there is interference in the distance detection performed by the capacitive sensor based on the first detection data and the second detection data; When the first digital processing module determines that the first type of interference exists, the first digital processing module determines a first coefficient based on the first detection data and the second detection data, and determines the third detection data based on the first coefficient, the first detection data, and the second detection data; When the first digital processing module determines that the second type of interference exists, the first digital processing module determines a second coefficient based on the first detection data and the second detection data, and determines the third detection data based on the second coefficient, the first detection data, and the second detection data; When the first digital processing module determines that the third type of interference exists, the first digital processing module adjusts the sampling frequency of the first detection unit, and uses the average value of the first detection data calculated after adjusting the sampling frequency as the third detection data; When the first digital processing module determines that no interference exists, the first detection data is used as the third detection data.

12. The method according to claim 11, characterized in that The first digital processing module determines, based on the first detection data and the second detection data, whether interference occurs in distance detection by the capacitive sensor, including: The first digital processing module determines that the first type of interference exists when the first detection data is monotonic and the second detection data is monotonic; The first digital processing module determines that there is no interference when the first detection data is monotonic and the second detection data is not monotonic; The first digital processing module determines whether the first detection data has frequency superposition when the first detection data is not monotonic, and obtains a determination result; The first digital processing module determines that there is no interference if the judgment result is no; The first digital processing module determines that the second type of interference exists when the judgment result is yes and the second detection data has frequency superposition of the same frequency as the first detection data; The first digital processing module determines that the first detection data has the third type of interference when the judgment result is yes and there is no frequency superposition in the second detection data.

13. The method according to claim 10, characterized in that The method further comprises: The first detection unit determines fourth detection data based on the first detection data, where the fourth detection data is detection data after eliminating interference.

14. The method according to claim 13, characterized in that The first detection unit determines fourth detection data based on the first detection data, including: The first detection unit determines whether there is interference in the distance detection performed by the capacitive sensor based on the first detection data; When the first detection unit determines that interference exists, the first detection unit adjusts the sampling frequency of the first detection unit, and uses the average value of the first detection data calculated after adjusting the sampling frequency as the fourth detection data; or When it is determined that no interference exists, the first detection unit uses the first detection data as the fourth detection data.

15. The method according to claim 14, characterized in that The first detection unit determines, based on the first detection data, whether interference occurs in distance detection by the capacitive sensor, including: The first detection unit calculates, for each first detection data, a first difference between a maximum value and a minimum value in the first detection data; The first detection unit determines that interference exists when the first difference is greater than a first threshold and the first detection data is not monotonic; The first detection unit determines that there is no interference when the first difference is less than or equal to the first threshold, or when the first difference is greater than the first threshold and the first detection data is monotonic.

16. An electronic device, characterized in that: The device comprises the distance detection device according to any one of claims 1 to 9.