Patent Description:
A capacitance detection apparatus can identify whether a human body or other conductors are approaching based on a capacitance value variation. <FIG> shows a schematic structural diagram of a typical capacitance detection apparatus. The capacitance detection apparatus includes: a sensor <NUM>, an amplifier (AMP) <NUM>, and an analog to digital converter (ADC) <NUM>. When a human body or other conductors are approaching, a capacitance value of a capacitor Cx of the sensor <NUM> to the system ground GND will vary. The sensor <NUM> may output a detected capacitance signal to the amplifier <NUM>, to input an amplified capacitance signal to the analog to digital converter <NUM>, thereby obtaining a raw capacitance signal RawData. A difference value between the raw capacitance signal RawData and a reference signal Ref may be computed to obtain a capacitance variation signal Diff; and a signal value of the capacitance variation signal Diff may be compared with a preset threshold to identify whether a human body or other conductors are approaching or moving away from the capacitance detection apparatus. The reference signal Ref is a signal outputted from the capacitance detection apparatus when there is no additional input from a human body or other conductors.

<FIG> shows a schematic fluctuation diagram of a raw capacitance signal RawData outputted from the above typical capacitance detection apparatus; as can be seen therefrom, at a moment t1, a signal value of the raw capacitance signal RawData is equal to a signal value of a reference signal Ref, indicating that no human body or other conductors are approaching the capacitance detection apparatus; at a moment t2, a signal value of the raw capacitance signal RawData reaches a proximity threshold ONth, indicating that a human body or other conductors have approached the capacitance detection apparatus; and at a moment t3, the signal value of the raw capacitance signal RawData decreases to an off threshold OFFth, indicating that the human body or other conductors are moving away from the capacitance detection apparatus.

However, in a practical application, factors such as an ambient temperature or noise interference will cause reference drift. Therefore, if the signal value of the reference signal Ref is not updated in real time, a signal value of a capacitance variation signal Diff will tend to deviate from a capacitance variation with respect to an actual operation, thus further resulting in misrecognition or missed recognition of an event. The event includes: a human body or other conductors approach the capacitance detection apparatus, or a human body or other conductors move away from the capacitance detection apparatus.

In the prior art, a common reference updating method is first-order hysteresis filtering, which may be described by an equation below:<MAT>.

Ref(n) is a current n-th frame of reference value of the reference signal Ref, Ref(n-<NUM>) is an (n-<NUM>)-th frame of reference value of the reference signal Ref, RawData(n) is the current n-th frame of raw capacitance data of the raw capacitance signal RawData, and Coefx is a filter coefficient. The size of the filter coefficient Coefx can affect smoothness and delayed response of the Ref(n), and the size of the filter coefficient Coefx is adjusted such that the higher the smoothness is, the greater the delayed response is; and the smaller the delayed response is, the lower the smoothness is.

The reference updating method weighs current sampled RawData(n) and last outputted Ref(n-<NUM>), to update partial data of the raw capacitance signal RawData to a new reference signal Ref. However, this method will partially update both valid data and noise in the raw capacitance signal RawData to the reference signal Ref, resulting in noise jitter in the computed capacitance variation signal Diff. If it is intended to reduce jitter of the reference signal Ref, greater delayed response will be caused. Therefore, the above reference updating method is difficult to be adapted to an application scenario that is more sensitive to noise interference and delayed response.

<CIT> is directed to a baseline update method and a contactor control device, wherein, setting a baseline according to the capacitance value of the first frame of the touch screen, and calculating the difference between the current capacitance value and the baseline; if it is determined that the difference between the current capacitance value and the baseline is less than the first negative noise threshold; it is further judged whether the difference between the current capacitance value and the baseline is less than the first negative noise threshold within the first time range; if the difference is less than the first negative noise threshold within the first time range, then updating the baseline according to the current capacitance value to perform the baseline extreme recovery function; judging whether the touch screen is touched according to the difference between the current capacitance value and the updated baseline; if it is judged that the touch screen is touched, then turn off the extreme value recovery function of the baseline so that the difference between the current capacitance value and the updated baseline is less than the first negative noise threshold again and no longer update the baseline; when the difference between the current capacitance value and the baseline is between the positive noise threshold and the second negative noise threshold, adding the difference between the current capacitance value and the baseline to an accumulator for accumulation.

Embodiments of the present disclosure provide a method for updating a capacitance reference, a chip, and a capacitance detection apparatus, for effectively updating the capacitance reference value in real time, and reducing the impacts of noise jitter and delayed response on the capacitance detection performance.

A method for updating a capacitance reference, a chip of executing the method, a capacitance detection apparatus of comprising the chip and a computer readable storage medium as defined in the claims are provided.

It is understandable that the chip according to the second aspect, the capacitance detection apparatus according to the third aspect, and the computer readable storage medium according to the fourth aspect provided above are all configured to execute the corresponding method provided above, and therefore, the beneficial effects in the corresponding methods provided above may be referred to for the beneficial effects to be achieved whereby. The description will not be repeated here.

One or more embodiments are illustrated with reference to the pictures in the corresponding drawings, but these illustrations do not constitute a limitation on the embodiments. In addition, unless otherwise particularly stated, the figures in the accompanying drawings do not constitute a limitation of scale.

The technical solutions in embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Apparently, the embodiments described below are a part, instead of all, of the embodiments of the present disclosure.

The terms used in the present disclosure are intended merely to describe particular embodiments, and are not intended to limit the present disclosure. The singular forms of "a" and "the" used in the present disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

It should also be understood that unless a specified order is clearly stated in the context of the present disclosure, the processing steps described herein may be performed differently from the specified order. That is, each step may be performed in the specified order, or each step may be performed substantially simultaneously, each step may be performed in a reverse order, or each step may be performed in a different order.

In addition, the terms such as "first" and "second" are only used for distinguishing between similar objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, features defined with "first," "second," or the like may explicitly or implicitly include one or more of the features.

As shown in <FIG>, a schematic block diagram of a method for updating a capacitance reference provided in an embodiment of the present disclosure is shown. The method may be applied to a capacitance detection apparatus, and specifically includes the following steps:
Step S101: determining, based on an n-th frame of raw capacitance data RawData(n) and an (n-M)-th frame of raw capacitance data RawData(n-M) outputted from the capacitance detection apparatus, a feature value Feature(n) corresponding to the n-th frame of raw capacitance data.

The feature value Feature(n) corresponding to the n-th frame of raw capacitance data may indicate a different stage in a process of a conductor (a human body or other conductors) approaching or moving away from the capacitance detection apparatus.

Step S102: computing a difference value between the n-th frame of raw capacitance data RawData(n) and a reference value Ref(n-<NUM>) corresponding to an (n-<NUM>)-th frame of raw capacitance data outputted from the capacitance detection apparatus, to obtain a capacitance variation Diff(n).

By setting the capacitance variation Diff(n)=RawData(n)-Ref(n-<NUM>), a capacitance variation corresponding to the n-th frame of raw capacitance data may be predicted based on the capacitance variation Diff(n), thereby determining a moving state of the conductor. Specifically, the moving state may include: having approached the capacitance detection appearance (approached state) and not approaching the capacitance detection apparatus (non-approaching state). The capacitance variation corresponding to the n-th frame of raw capacitance data is the difference value between the n-th frame of raw capacitance data RawData(n) and the corresponding reference value Ref(n) thereof, i.e., RawData(n)-Ref(n), which may be used for indicating a current capacitance variation caused by the human body or other conductors.

Step S103a: determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is less than a first threshold Thr<NUM>, and the capacitance variation Diff(n) is less than a proximity threshold Thron, the n-th frame of raw capacitance data RawData(n) or the (n-<NUM>)-th frame of raw capacitance data RawData(n-<NUM>) as a reference value Ref(n) corresponding to the n-th frame of raw capacitance data. The proximity threshold Thron may be used for determining whether the conductor has approached the capacitance detection apparatus; and the first threshold Thr<NUM> may be used for determining whether there is an additional input from the conductor on the capacitance detection apparatus.

The capacitance variation Diff(n) may be compared with the proximity threshold Thron, to determine whether the conductor has approached the capacitance detection apparatus, i.e., determine the moving state of the conductor. Specifically, if the capacitance variation Diff(n) reaches the proximity threshold Thron, i.e., is greater than or equal to the proximity threshold Thron, it may be determined that the conductor is in the approached state; and if the capacitance variation Diff(n) does not reach the proximity threshold Thron, i.e., is less than the proximity threshold Thron, it may be determined that the conductor is in a non-approaching state. In addition, the size of the proximity threshold Thron may be generated by machine learning based on training data. The training data may include, but is not limited to, a corresponding capacitance variation Diff(n) when different types of conductors come in contact with the capacitance detection apparatus to different extents and a corresponding capacitance variation Diff(n) when there are different distances between different types of conductors and the capacitance detection apparatus. In addition, the size of the proximity threshold Thron may also be adjusted accordingly based on subsequent actual applications of a user, thereby more accurately distinguishing whether the human body or other conductors have approached the capacitance detection apparatus, and better adapting to different application scenarios.

Step S103b: determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is greater than or equal to the first threshold Thr<NUM>, and the capacitance variation Diff(n) is less than the proximity threshold Thron, the reference value Ref(n) corresponding to the n-th frame of raw capacitance data based on the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data.

Step S103c: determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is greater than or equal to a second threshold Thr<NUM>, and is less than or equal to the first threshold Thr<NUM>, and the capacitance variation Diff(n) is greater than or equal to the proximity threshold Thron, the reference value Ref(n) corresponding to the n-th frame of raw capacitance data based on the feature value Feature(n) corresponding to the n-th frame of raw capacitance data, a feature value Feature(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data, the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data, and a reference value Ref(n-<NUM>) corresponding to an (n-<NUM>)-th frame of raw capacitance data outputted from the capacitance detection apparatus.

The second threshold Thr<NUM> is less than the first threshold Thr<NUM>. The second threshold Thr<NUM> may be used for determining whether the conductor is gradually disconnected from contact with the capacitance detection apparatus, and specifically may be used for further determining whether a moving trend of the conductor in the approached state is to maintain stable contact with the capacitance detection apparatus or to start to move away from the capacitance detection apparatus.

Step S103d: determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is less than the second threshold Thr<NUM> or greater than the first threshold Thr<NUM>, and the capacitance variation Diff(n) is greater than or equal to the proximity threshold Thron, the reference value Ref(n) corresponding to the n-th frame of raw capacitance data based on the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data.

In the above, n is a positive integer greater than <NUM>, M is a positive integer greater than or equal to <NUM>, and M <n. When n is greater than <NUM> or <NUM>, a value of Ref (<NUM>) or Ref (<NUM>) may be set to be equal to a signal value of a raw capacitance signal outputted from the capacitance detection apparatus when there is no additional input from a human body or other conductors.

Specifically, setting of the first threshold Thr<NUM> may also be generated by machine learning based on training data. The training data may include, but is not limited to: a capacitance variation when there is no additional input from a human body or other conductors on the capacitance detection apparatus, a capacitance variation when a human body or other conductors start to approach the capacitance detection apparatus, and a capacitance variation when a human body or other conductors start to move away from the capacitance detection apparatus. In addition, the second threshold Thr<NUM> may be set as a negative value, and its absolute value may be from <NUM> to <NUM> times as much as the first threshold Thr<NUM>.

The feature value Feature(n) is set based on the n-th frame of raw capacitance data RawData(n) and the (n-M)-th frame of raw capacitance data RawData(n-M), the size of the feature value Feature(n) is compared with the size of a preset threshold, a process of a human body or other conductors approaching or moving away from the capacitance detection apparatus may be classified into different stages, and a corresponding capacitance reference updating approach may be set based on different moving states (approached/non-approaching) and moving trends (approaching, maintaining contact, moving away) of a conductor in each stage, thereby effectively updating the reference value in real time.

Specifically, Feature(n)<Thr<NUM> and Diff(n)<Thron may indicate that there is no additional input caused by a conductor on the capacitance detection apparatus, including: no conductor starts to approach the capacitance detection apparatus, and a conductor has moved away from the capacitance detection apparatus; and the raw capacitance data RawData(n) in this stage only indicates a capacitance variation caused by an environmental noise, such that this stage may be referred to as a noise stage.

Feature(n)≥Thr<NUM> and Diff(n)<Thron may indicate that a conductor is slowly/rapidly approaching the capacitance detection apparatus, but the conductor is still in a non-approaching state, such that this stage may be referred to as a pre-approaching stage.

Thr<NUM>≤Feature(n)≤Thr<NUM> and Diff(n)≥Thron may indicate that a conductor maintains stable contact with the capacitance detection apparatus, and has reached a most approaching state; and Feature(n)>Thr<NUM> or Feature(n) <Thr<NUM> and Diff(n) ≥Thron means that the conductor is in the approached state and is further approaching the capacitance detection apparatus, or is gradually disconnected from contact with the capacitance detection apparatus, i.e., starts to leave from the capacitance detection apparatus. The two stages may be referred to as an approaching stage.

As a possible implementation, the determining, based on the n-th frame of raw capacitance data RawData(n) and the (n-M)-th frame of raw capacitance data RawData(n-M) outputted from the capacitance detection apparatus, the feature value Feature(n) corresponding to the n-th frame of raw capacitance data further includes: determining a difference value between the n-th frame of raw capacitance data RawData(n) and the (n-M)-th frame of raw capacitance data RawData(n-M) as the feature value Feature(n) corresponding to the n-th frame of raw capacitance data.

Therefore, Feature(n)=RawData(n)-RawData(n-M) may be set. A value of M may be set based on an actual application scenario and to-be-achieved application objective, and may be at least <NUM>. Further, the smaller the value of M is, the better the timeliness of the capacitor reference update is, but the higher the computing workload is.

As a possible implementation, the determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is less than the first threshold Thr<NUM>, and the capacitance variation Diff(n) is less than the proximity threshold Thron, the n-th frame of raw capacitance data RawData(n) or the (n-<NUM>)-th frame of raw capacitance data RawData(n-<NUM>) as the reference value Ref(n) corresponding to the n-th frame of raw capacitance data further includes: determining a minimum value of the n-th frame of raw capacitance data RawData(n) and the (n-<NUM>)-th frame of raw capacitance data RawData(n-<NUM>) as the reference value Ref(n) corresponding to the n-th frame of raw capacitance data.

Therefore, Ref(n)=min{RawData(n), RawData(n-<NUM>)} may be set in the noise stage. This reference updating approach may enable a noise in a capacitance variation signal Diff in this stage to merely have a one-way variation, thereby effectively reducing a noise of a reverse variation in the capacitance variation signal Diff, can reduce a noise variance in the capacitance variation signal Diff in this stage by half compared with first-order hysteresis filtering commonly used in the prior art, will not consume a valid signal component in the capacitance variation signal Diff, and in addition, may also enable the reference signal Ref to track the fluctuations of the raw capacitance signal RawData in real time, thereby reducing the impacts of noise jitter and delayed response on the capacitance detection performance.

As a possible implementation, the determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is greater than or equal to the first threshold Thr<NUM>, and the capacitance variation Diff(n) is less than the proximity threshold Thron, the reference value Ref(n) corresponding to the n-th frame of raw capacitance data based on the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data further includes:
When the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is greater than or equal to the first threshold Thr<NUM>, and is less than a third threshold Thr<NUM>, and the capacitance variation Diff(n) is less than the proximity threshold Thron, a sum of the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data and a first correction value Corr<NUM> is determined as the reference value Ref(n) corresponding to the n-th frame of raw capacitance data; and when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is greater than or equal to the third threshold Thr<NUM>, and the capacitance variation Diff(n) is less than the proximity threshold Thron, a sum of the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data and a second correction value Corr<NUM> is determined as the reference value Ref(n) corresponding to the n-th frame of raw capacitance data. The third threshold Thr<NUM> may be used for determining an extent to which the conductor is approaching the capacitance detection apparatus, and the third threshold Thr<NUM> is greater than the first threshold Thr<NUM>; and the first correction value Corr<NUM> and the second correction value Corr<NUM> may be used for characterizing an offset of a reference value caused by an environmental factor in a corresponding stage, respectively.

Therefore, in the pre-approaching stage, this reference updating approach can reduce the reference drift noise caused by an environmental factor such as temperature, improve the signal-to-noise ratio of the capacitance variation signal Diff, and update the reference signal Ref in real time, thereby reducing the impacts of noise jitter and delayed response on the capacitance detection performance.

Therefore, the pre-approaching stage may be further divided into two sub-stages, and a human body or other conductors approach the capacitance detection apparatus to different extents in the two sub-stages. Specifically, when Thr<NUM>≤Feature(n)<Thr<NUM>, and Diff(n)<Thron, Ref(n)=Ref(n-<NUM>)+Corr<NUM> is set, and this stage may be referred to as a first pre-approaching sub-stage; and when Feature(n)≥Thr<NUM> and Diff(n)<Thron, Ref(n)=Ref(n-<NUM>)+Corr<NUM> is set, and this stage may be referred to as a second pre-approaching sub-stage. The approaching extent in the second pre-approaching stage is higher than that in the first pre-approaching stage. Specifically, the first correction value Corr<NUM> may be set to be about <NUM>% of the proximity threshold Thron, and the second correction value Corr<NUM> may be set to be equal to the first correction value Corr<NUM> or slightly smaller than the first correction value Corr<NUM>. The third threshold Thr<NUM> may be set as an opposite number of the second threshold Thr<NUM>, i.e., <NUM> to <NUM> times as much as the first threshold Thr<NUM>.

As a possible implementation, the determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is greater than or equal to the second threshold Thr<NUM>, and is less than or equal to the first threshold Thr<NUM>, and the capacitance variation Diff(n) is greater than or equal to the proximity threshold Thron, the reference value Ref(n) corresponding to the n-th frame of raw capacitance data based on the feature value Feature(n) corresponding to the n-th frame of raw capacitance data, the feature value Feature(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data, the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data, and the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data outputted from the capacitance detection apparatus further includes:
computing a difference value between the feature value Feature(n) corresponding to the n-th frame of raw capacitance data and the feature value Feature(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data, to obtain a first variation Diff_Feature(n); computing a difference value between the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data and the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data outputted from the capacitance detection apparatus, to obtain a second variation Diff-Ref(n-<NUM>); and enabling the reference value Ref(n) corresponding to the n-th frame of raw capacitance data to satisfy an equation below:
<MAT>.

The second variation Diff_Ref(n-<NUM>)≠<NUM>. If in this stage, Ref(n-<NUM>) is equal to Ref(n-<NUM>), the second variation Diff_Ref(n-<NUM>) may be set as a non-zero constant value, for example, may be set to be equal to a value of a non-zero second variation Diff_Ref(n-<NUM>) in a previous frame.

In this stage, the conductor steadily maintains contact with the capacitance detection apparatus, and is in the most approaching state. The conductor generally shakes to a certain extent or has a temperature difference from a sensor in the capacitance detection apparatus, which tends to cause abnormal jitter variation of the raw capacitance signal RawData, further makes the capacitance variation signal Diff have an obvious noise component, and affects the accuracy of the capacitance detection result, while the updating the capacitance reference value in real time by the above approach can extract the jitter variation in the raw capacitance signal RawData in a process of the conductor maintaining continuous and stable contact with the capacitance detection apparatus, and superimpose the jitter variation to the reference signal Ref, thereby reducing low-frequency noise in the capacitance variation signal Diff, and effectively reducing the probability of misrecognition or missed recognition of an event.

As a possible implementation, the determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is less than the second threshold Thr<NUM> or greater than the first threshold Thr<NUM>, and the capacitance variation Diff(n) is greater than or equal to the proximity threshold Thron, the reference value Ref(n) corresponding to the n-th frame of raw capacitance data based on the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data further includes:.

determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is greater than the first threshold Thr<NUM>, and the capacitance variation Diff(n) is greater than or equal to the proximity threshold Thron, the sum of the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data and the second correction value Corr<NUM> as the reference value Ref(n) corresponding to the n-th frame of raw capacitance data; and determining, when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is less than the second threshold Thr<NUM>, and the capacitance variation Diff(n) is greater than or equal to the proximity threshold Thron, a sum of the reference value Ref(n-<NUM>) corresponding to the (n-<NUM>)-th frame of raw capacitance data and a third correction value Corr<NUM> as the reference value Ref(n) corresponding to the n-th frame of raw capacitance data.

The third correction value Corr<NUM> may be used for characterizing an offset of a reference value caused by an environmental factor in a corresponding stage. Specifically, the third correction value Corr<NUM> may be set based on an actual application scenario, and may be equal to the first correction value Corr<NUM> and the second correction value Corr<NUM>, or slightly smaller than the first correction value Corr<NUM>.

Therefore, this stage may be further divided into two sub-stages. Feature(n)>Thr<NUM> and Diff(n) ≥Thron means that the conductor is in an approached state and is further approaching the capacitance detection apparatus. Ref(n)=Ref(n-<NUM>)+Corr<NUM> is set to ensure that the signal value of the reference signal Ref in this stage is continuous with the signal value in the last stage (the second pre-approaching sub-stage). Feature(n)<Thr<NUM> and Diff(n) ≥Thron means that the conductor is in the approached state, but is gradually disconnected from contact with the capacitance detection apparatus, i.e., starts to leave from the capacitance detection apparatus. Ref(n)=Ref (n-<NUM>)+Corr<NUM> is set to ensure that the reference signal Ref can be promptly updated in real time following the raw capacitance signal RawData.

In this stage, the above reference updating approach can reduce the reference drift noise caused by an environmental factor such as temperature, improve the signal-to-noise ratio of the capacitance variation signal Diff, and enable the reference signal Ref to promptly track the variation of the raw capacitance signal RawData in real time, thereby reducing the impacts of noise jitter and delayed response on the capacitance detection performance.

As shown in <FIG>, a schematic fluctuation diagram of a raw capacitance signal and a feature signal in a process of a conductor approaching and moving away provided in an embodiment of the present disclosure is shown. It can be seen that by comparing the Feature(n) with the first threshold Thr<NUM>, the second threshold Thr<NUM>, and the third threshold Thr<NUM>, the process of the conductor approaching and moving away from a capacitance detection apparatus may be divided into different stages, including a noise stage (T<NUM> and T<NUM>), a pre-approaching stage (T<NUM>), and an approaching stage (T<NUM>), where, in the T<NUM> period of the noise stage, there is no additional input from the conductor on the capacitance detection apparatus, and in the T<NUM> period of the noise stage, the conductor has moved away from the capacitor detection apparatus; and the pre-approaching stage may be further divided into two sub-stages based on different approaching extents, and the approaching stage may be further divided into three sub-stages based on different moving trends. In addition, it can be seen that a feature signal Feature corresponding to M=<NUM> has a smaller delayed response than a feature signal Feature corresponding to M=<NUM>.

As shown in <FIG>, a schematic diagram of updating a reference signal in a process of a conductor approaching and moving away provided in an embodiment of the present disclosure is shown; where the method for updating a capacitance reference provided in the above embodiments is used respectively in each stage of the conductor approaching and moving away from a capacitance detection apparatus. It can be seen that in T<NUM> period (noise stage), there is no additional input from a human body or other conductors on the capacitance detection apparatus, and a reference signal Ref can be updated in real time to track the variation of a raw capacitance signal RawData; in T<NUM> period (pre-approaching stage), a human body or other conductors are approaching the capacitance detection apparatus, but are still in a non-approaching state, and the reference signal Ref can track rise and variation of the raw capacitance signal RawData in time and update the raw capacitance signal in real time; in T<NUM> period (approaching stage), when a human body or other conductors are in an approached state and maintain stable contact with the capacitance detection apparatus, the reference signal Ref can also track the jitter variation of the raw capacitance signal RawData in real time, effectively reduce a low-frequency noise component in the capacitance variation signal Diff, and improve the signal-to-noise ratio of the capacitance variation signal Diff, thereby improving the accuracy of the capacitance detection result; and when the human body or other conductors are in an approached state and are further approaching the capacitance detection apparatus or are gradually disconnected from contact with the capacitance detection apparatus, the reference signal Ref can update the raw capacitance signal RawData in real time based on the variation; and in T<NUM> period (noise stage), the human body or other conductors have moved away from the capacitance detection apparatus, the reference signal Ref can be quickly updated and quickly restored to a regular reference level, thereby reducing the impacts of delayed response on the sensitivity and accuracy of subsequent capacitance detection.

As shown in <FIG>, a schematic fluctuation diagram of a capacitance variation signal in a process of a conductor approaching and moving away provided in an embodiment of the present disclosure is shown, where the method for updating a capacitance reference provided in the above embodiments is used respectively in each stage of the conductor rapidly/slowly approaching and moving away from a capacitance detection apparatus. It can be seen that in the process of a human body or other conductors are rapidly/slowly approaching and moving away from the capacitance detection apparatus, the capacitance variation signal can quickly reach a target level, and can accurately reflect whether the human body or other conductors are approaching the capacitance detection apparatus in real time, thereby improving the sensitivity and accuracy of capacitance detection.

In a practical application, it is often necessary to accurately recognize the process of a human body or other conductors slowly approaching and rapidly moving away in real time. Therefore, the method for updating a capacitance reference provided in the embodiments of the present disclosure can be well adapted to this application scenario.

It should be noted that in order to adapt to sizes of different thresholds, a proportional coefficient of a feature value Feature(n) corresponding to an n-th frame of raw capacitance data may be scaled accordingly. For example, Feature(n)=[RawData(n)-RawData(nM)]*a may be set, where a may be a constant greater than <NUM>, such that a value of Feature(n) corresponds to the size of a preset threshold, to effectively distinguish between different stages in the process of the conductor approaching or moving away from the capacitance detection apparatus, and different reference updating methods are set for different stages to effectively update the reference value in real time, thereby reducing the impacts of noise jitter and delayed response on the capacitance detection performance, improving the accuracy of the capacitance detection result, and reducing the probability of misrecognition or missed recognition of an event.

The method for updating a capacitance reference provided in the embodiments of the present disclosure can be adapted to various scenarios where accurate detection of capacitance is required, including wearing detection, touch detection, SAR (Specific Absorption Rate) application, and the like. For example, in an ear detection application of a Bluetooth headset (such as a TWS earbud), the method can accurately identify whether a user has worn the Bluetooth headset.

As shown in <FIG>, a schematic structural diagram of a chip provided in an embodiment of the present disclosure is shown. A chip <NUM> includes a memory <NUM> and a processor <NUM>; where the memory <NUM> may store computer program instructions, and the processor <NUM> may invoke the computer program instructions stored in the memory <NUM>, such that the chip <NUM> may execute the method for updating a capacitor reference provided in the first aspect or any one of the possible implementations in the first aspect described above.

Specifically, the memory <NUM> may be a volatile memory (VM) such as a random access memory (RAM), or a non-volatile memory (NVM) such as a hard disk drive (HDD) or a solid state drive (SSD), or a circuit or any other apparatus capable of realizing storage functions. The memory <NUM> is, and is not limited to, any other medium that may store or carry desired program codes in the form of instructions or data structures and can be accessed by a computer.

The processor <NUM> may be, and is not limited to, a general purpose processor (such as a microprocessor), a digital signal processor, an application specific integrated circuit, a transistor logic device, a field programmable gate array, or other programmable logic devices, and may implement or execute the methods, steps, and logic block diagrams provided in the embodiments of the present disclosure. The methods and steps provided in the embodiments of the present disclosure may be directly embodied as being executed and completed by a hardware processor, or being executed and completed by a combination of hardware and software modules in the processor.

The chip <NUM> may also be referred to as a system chip, a system-on-chip, and so on.

In a third aspect, an embodiment of the present disclosure provides a capacitance detection apparatus, including the chip as provided in the above second aspect.

The capacitance detection apparatus may execute the method for updating a capacitance reference provided in the first aspect or any one of the possible implementations in the first aspect described above.

In a fourth aspect, an embodiment of the present disclosure provides a computer readable storage medium that may store a computer program, where the computer program may cause a computer to execute the method for updating a capacitance reference provided in the first aspect or any one of the possible implementations in the first aspect described above.

The computer readable storage medium may be any available medium accessible to the computer, or may be a data storage device, such as a server or a data center, integrated with one or more available mediums. The available medium may be, and is not limited to, a magnetic medium (such as a hard disk drive, a floppy disk, or a magnetic tape), a semiconductor medium (such as a solid state drive), or an optical medium (such as a digital video disk (DVD).

Claim 1:
A method for updating a capacitance reference, being applied to a capacitance detection apparatus, the method comprising:
determining (S101), based on a difference value between an n-th frame of raw capacitance data RawData(n) and an (n-M)-th frame of raw capacitance data RawData(n-M) outputted from the capacitance detection apparatus, a feature value Feature(n) corresponding to the n-th frame of raw capacitance data; wherein the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is used for indicating different stages in a process of a conductor approaching or moving away from the capacitance detection apparatus;
computing (S102) a difference value between the n-th frame of raw capacitance data RawData(n) and a reference value Ref(n-<NUM>) corresponding to an (n-<NUM>)-th frame of raw capacitance data outputted from the capacitance detection apparatus, to obtain a capacitance variation Diff(n); and
determining (S103a), when the feature value Feature(n) corresponding to the n-th frame of raw capacitance data is less than a first threshold Thr<NUM>, and the capacitance variation Diff(n) is less than a proximity threshold Thron, the n-th frame of raw capacitance data RawData(n) or the (n-<NUM>)-th frame of raw capacitance data RawData(n-<NUM>) as a reference value Ref(n) corresponding to the n-th frame of raw capacitance data; wherein the proximity threshold Thron is used for determining whether the conductor has approached the capacitance detection apparatus; and the first threshold Thr<NUM> is used for determining whether there is an additional input from the conductor on the capacitance detection apparatus,
wherein n is a positive integer greater than <NUM>, M is a positive integer greater than or equal to <NUM>, and M <n.