Method for identifying power supply mode of equipment based on touch sensor
By using the power supply power supply noise monitoring and periodic charging and discharging technology of touch sensors, the cost and real-time problems of identifying the power supply mode of electronic equipment in the prior art are solved, and efficient and accurate power supply mode identification is achieved, reducing hardware costs and expanding The purpose of the sensor.
Patent Information
- Application Number
- CN202411266913.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-13
AI Technical Summary
The prior art requires additional hardware modules when identifying the power supply mode of electronic devices, which increases cost and structural complexity, and has poor real-time performance, which cannot meet the market's demand for intelligent power management.
The touch sensor-based method is adopted to monitor the noise level of the power supply of the touch sensor, and periodic charge and discharge and pulse count values are used to identify the power supply method of the device, without the need for additional hardware, real-time power supply method identification is achieved.
It realizes accurate and real-time identification of the power supply method of the equipment, reduces hardware costs and structural complexity, improves the energy efficiency of the equipment, and expands the use of touch sensors.
Smart Images

Figure CN119126957A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power management of electronic devices, and in particular to a method for identifying a power supply mode of a device (such as external power supply or battery power supply), and to a device that uses the method to identify its power supply mode. Background Art
[0002] With the popularity of mobile electronic devices such as smartphones and tablets, especially with the deep integration of advanced technologies such as 5G networks, the Internet of Things (IoT), and artificial intelligence (AI), these electronic devices have leapt from simple communication and entertainment tools to smart hubs for daily life, work and study, health monitoring, and even smart home control. Users' expectations for the performance of such electronic devices continue to rise, and they pursue faster computing speeds, better visual experiences, and stronger multitasking capabilities in an extremely thin and light form factor.
[0003] In this context, how to ensure that electronic devices have high performance while maintaining long-term battery life has long been a key challenge that the electronic device field must face. To meet this challenge, the research and development focus of technicians is mainly on how to develop high-energy-density batteries, optimize intelligent power management solutions, and faster charging technologies, so as to maximize the use time of electronic devices without compromising on their performance, portability, and design aesthetics.
[0004] Among them, for the intelligent management scheme of optimizing power supply, how to accurately identify the power supply mode of the device is crucial. In the prior art, the identification of the power supply mode of the device is generally through the analysis of the working performance of the chip used in the device or the long-term characteristics of the power supply voltage. Among them, the analysis of the working performance of the chip is generally achieved by analyzing the working performance of the chip under different power supply conditions, such as response speed, sensitivity, etc. to realize the identification of the power supply mode. The analysis of the long-term characteristics of the power supply voltage is based on long-term monitoring of the changes in the power supply voltage. For example, when using an external power supply, the power supply voltage is usually shown to be basically stable and accompanied by more frequent small voltage fluctuations, while when using a battery, the power supply voltage is presented as a slow and monotonous decrease over time. However, no matter what kind of analysis method is used, it is necessary to rely on the signal or hardware monitoring module connected additionally to the device. These additional monitoring modules will not only increase the cost of the entire device, but also affect its structural complexity, and at the same time lead to additional power consumption. In addition, the existing analysis methods all require a relatively long period of monitoring of the device to obtain the corresponding analysis results, so the real-time performance is poor.
[0005] Therefore, there is an urgent need for an innovative technology that can automatically identify the power supply mode of the device in a simple, efficient and economical way, overcome the problems in the existing technology, and meet the market demand for intelligent power management. Summary of the invention
[0006] The task of the present invention is to propose a method for identifying a power supply mode of a device, in particular a method for identifying a power supply mode of a device based on a touch sensor, so as to solve the problems existing in the prior art.
[0007] The basic working principle of the method according to the present invention is to utilize the working characteristics of the touch sensor itself - that is, to continuously and in real time monitor the noise level of the power supply of the touch sensor by periodically charging and discharging a specific touch pin in the touch sensor and to identify the occurrence of a touch action by monitoring the pulse count value output by the touch sensor within a fixed time interval, so as to identify the power supply mode of the device according to the level of the noise level. Among them, the noise level of the power supply of the touch sensor is affected by the noise level of the power supply of the device itself, and is particularly positively correlated with the noise level of the power supply of the device itself. Specifically, according to the present invention, the monitoring of the noise level of the power supply of the touch sensor is achieved by continuously measuring the total time consumed by a fixed number of charges and discharges completed at the touch pins that are periodically charged and discharged in the touch sensor.
[0008] In the method for identifying the power supply mode of a device based on a touch sensor according to the first aspect of the present invention, when working, the control unit of the touch sensor controls the internal power supply to continuously and periodically charge and discharge the touch pin of the touch sensor, and generates an output pulse signal based on the periodic charge and discharge, and the method includes the following steps:
[0009] - obtaining a plurality of original values of total charge and discharge times corresponding to a plurality of consecutive charge and discharge rounds based on the output pulse signal, wherein each charge and discharge round includes a fixed number of charge and discharge operations on the touch pin;
[0010] - taking each N original values of the plurality of original values as a group to obtain M groups of original values, and obtaining M groups of identification data groups corresponding to the M groups of original values, each group of identification data groups including one or more identification data that can reflect the noise of the power supply of the device, wherein N and M are both positive integers; and
[0011] - Comparing each identification data included in one or more sets of the identification data with a corresponding threshold value T, and identifying the power supply mode of the device based on the comparison result.
[0012] In a preferred embodiment according to the present invention, the identification data is selected from the group consisting of:
[0013] - the difference between each raw value and the average of the above raw values,
[0014] - the absolute value of the above difference,
[0015] - the average of the absolute values of the above differences,
[0016] - the square of the above difference,
[0017] - the average of the squared values of the above differences, i.e. the variance of the original values,
[0018] - the sum of the variances of the original values, i.e. the sum of the variances of the original values,
[0019] - the filtered difference of each filtered value from the average of the above filtered values,
[0020] - the absolute value of the difference after the above filtering,
[0021] - the average of the absolute values of the above filtered differences,
[0022] - the square of the difference after filtering,
[0023] - the average of the squared values of the above filtered differences, i.e. the variance of the filtered values, and
[0024] - The sum of the variances of the above filtered values, ie the sum of the variances of the filtered values.
[0025] In a preferred embodiment of the present invention, identifying the power supply mode of the device based on the comparison result includes:
[0026] - When each identification data in the M groups of identification data is always greater than the corresponding threshold value T, the power supply mode of the device is identified as external power supply, such as mains power supply;
[0027] - when each identification data in the M groups of identification data is always smaller than the corresponding threshold value T, the power supply mode of the device is identified as battery power supply; and
[0028] When the identification data in the M groups of identification data changes from greater than the corresponding threshold T to less than the corresponding threshold T or changes from less than the corresponding threshold T to greater than the corresponding threshold T, it will be recognized that a change in the power supply mode has occurred.
[0029] In a preferred embodiment of the present invention, when the device is identified as having undergone a first change in power supply mode, whether a second change in power supply mode has occurred is continuously identified during subsequent L consecutive rounds of charge and discharge, where L is a positive integer greater than or equal to N, and wherein, if a second change in power supply mode is identified, the change in the first power supply mode is identified as interference, and the power supply mode of the device is identified as the power supply mode before the first change in power supply mode occurs; if the second change in power supply mode is not identified, the change in the first power supply mode is identified as a valid change, and the power supply mode of the device is identified as the power supply mode after the first change in power supply mode occurs.
[0030] In a preferred embodiment of the present invention, the threshold T is preset based on empirical data or is dynamically adjustable.
[0031] In a preferred embodiment according to the present invention, presetting the threshold value T based on empirical data includes: using one or more samples of a type of power supply to perform measurements, and determining standard values of various identification data when using the type of power supply based on the measurement results, and setting the threshold value T required for identifying between different types of power supplies based on the standard values.
[0032] In a preferred embodiment of the present invention, dynamically adjusting the threshold T comprises: determining the threshold T according to the variance of the filtered measurement value measured under different power supply modes and the difference from the base value under the corresponding power supply mode.
[0033] In a preferred embodiment of the present invention, the device is a mobile device, an embedded device, or any electronic device and system that requires accurate identification of a power supply mode.
[0034] In a preferred embodiment of the present invention, the touch sensor is an on-chip touch sensor.
[0035] The above method of the present invention is based on the unique working mode of the touch sensor itself. By analyzing the differences in stability and interference characteristics of different power supply methods, it can realize accurate and real-time identification of the power supply mode of the device without adding additional hardware, which helps to better improve the energy efficiency of the device.
[0036] According to a second aspect of the present invention, a device for identifying its power supply mode using the above method is provided, the device comprising:
[0037] - A touch sensor, the touch sensor comprising:
[0038] Touch pins are used to connect the internal circuit of the touch sensor to the external circuit.
[0039] A control unit, the control unit comprising:
[0040] An internal power supply, which is used to power the components within the touch sensor,
[0041] A control module, which is used to control the internal power supply so as to periodically charge and discharge the touch pins, and
[0042] A voltage comparator, which generates an output pulse signal based on periodic charge and discharge, and an internal data processing unit, which obtains a plurality of original values of total charge and discharge times corresponding to a plurality of consecutive charge and discharge rounds based on the output pulse signal, wherein each charge and discharge round includes a fixed number of charge and discharge operations on the touch pin;
[0043] - an external data processing unit, which takes each N original values of the plurality of original values as a group to obtain M groups of original values, and obtains M groups of identification data corresponding to the M groups of original values, each group of identification data including one or more identification data capable of reflecting the noise of the power supply of the device, wherein N and M are both positive integers; and
[0044] - an identification unit which compares each identification data included in one or more sets of identification data with a corresponding threshold value T and identifies a power supply mode of the device based on a result of the comparison.
[0045] In a preferred embodiment according to the present invention, the touch sensor also includes a touch electrode and a wiring connecting the touch pin and the touch electrode, wherein the touch pin, the touch electrode and the wiring form a touch sensing channel, and the capacitance of the touch sensing channel is connected in parallel with the capacitance of the touch pin itself.
[0046] In a preferred embodiment of the present invention, the touch electrode is in the form of a circular copper foil pad.
[0047] In a preferred embodiment of the present invention, a series resistor is provided in the wiring to form an RC filter with the parasitic capacitance in the touch sensing channel. The resistance value of the series resistor is 510Ω. In addition, the distance between the series resistor and the touch pin is less than 10 mm.
[0048] In the above device according to the present invention, there is no need for additional hardware devices that have to be used in the prior art to determine the power supply mode of the device, thereby reducing the structural complexity and use cost of the device.
[0049] According to a third aspect of the present invention, a use of a touch sensor for identifying a power supply mode of a device is proposed.
[0050] In the prior art, the touch sensor is only used to identify the occurrence of a touch action, but according to the present invention, the inventor creatively utilizes the unique working mode of the touch sensor itself to expand its use. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The embodiments of the present application are described below with reference to the accompanying drawings, and the features and related advantages of the present invention will become more apparent.
[0052] Figure 1 is a schematic cross-sectional view of the structure of an exemplary touch sensor system known in the prior art (here, a built-in touch sensor of Espressif's ESP series chip is used as an example);
[0053] Figure 2 A schematic diagram showing a voltage waveform at a touch pin of a touch sensor known in the prior art and a pulse waveform output by the touch sensor;
[0054] Figure 3 A schematic diagram showing the time consumed for periodically charging and discharging a touch pin of a touch sensor in a device, measured respectively when the device is powered by a battery and an external power supply and no touch action occurs;
[0055] Figure 4 A flow chart showing a method according to one embodiment of the present invention is shown;
[0056] Figure 5 A schematic diagram showing a data window, data bits and filled original values used in the method according to the present invention;
[0057] Figure 6 A schematic diagram showing a group of raw values used in the method according to the present invention;
[0058] Figure 7 A schematic diagram showing the variance and waveform of the filtered values obtained in the two cases of using a battery and an external power supply;
[0059] Figure 8 It shows the variance of the filtered value and the change of the waveform when interference (here, a touch action) occurs when the battery is used for power supply;
[0060] Fig. 9 A schematic diagram showing the relationship between the dynamically adjusted threshold value T and the variance of the filtered value obtained in the two cases of using a battery and an external power supply and the base value;
[0061] Fig.10 FIG. 4 is an illustrative diagram of a touch sensing channel of a touch sensor according to an embodiment of the present invention, including a series resistor R added to the trace.
[0062] In the drawings, the same reference numerals are used to indicate features that are similar or identical, or have similar or identical functions. Here, the drawings in the specification of the present application are intended to enable those skilled in the art to better understand the technical solutions of the present application. It should be noted that the elements in the drawings are not drawn strictly in proportion to their actual sizes. DETAILED DESCRIPTION
[0063] Explanation of terms
[0064] In order to better understand the technical solution of the present invention, the specific meanings of relevant technical terms are first explained below.
[0065] In the scope of the present invention, a "touch sensor system" refers to a system for sensing touch actions, which is composed of a touch sensor body and external protective covering layers, touch electrodes, insulating substrates, wiring and other components.
[0066] "Touch sensor" refers to a capacitive touch sensor, such as an on-chip touch sensor, which includes touch pins, a control unit, and an internal data processing unit. The control unit includes an internal power supply for powering the components inside the touch sensor, a control module for implementing various control functions, and a voltage comparator for outputting monitoring result signals.
[0067] The "protective cover" is also commonly referred to as the touch panel. This type of touch panel is made of insulating material and its function is to isolate the touch electrodes from the external environment, thereby playing a protective role.
[0068] The "touch electrode" is an important part of the touch sensor. When a finger touches the touch panel, it will form a parallel plate capacitor with the touch electrode, thereby changing the capacitance in the touch sensing channel (composed of the touch electrode, traces and touch pins). The touch electrode is usually made of conductive materials and has various forms, such as copper foil, metal plate, touch spring, etc. on a printed circuit board (PCB).
[0069] The "insulating substrate" is a component that supports the touch electrodes and is generally made of non-conductive material.
[0070] "Traces" are used to connect touch electrodes to touch pins, and may include, for example, PCB traces and connectors. Traces are usually the main cause of introducing interference and parasitic capacitance.
[0071] "Sensitivity" refers to the rate of change of the touch sensor reading when a touch action occurs (unit: %).
[0072] “Parasitic capacitance Cp” refers to the internal capacitance of the sensor electrode, which is generally composed of, for example, PCB traces, touch electrodes, vias, and air gaps. During design, parasitic capacitance should generally be minimized as much as possible, because such parasitic capacitance can reduce the sensitivity of the touch sensor.
[0073] "Grid ground" refers to ground wires that are cross-woven into a mesh. Generally, when designing a PCB board with a capacitive touch sensor, a grounding copper layer must be laid around the traces of the touch sensing channel. The design of such a grounding copper layer must be relatively cautious, because although it can increase the anti-interference ability, it may also increase the parasitic capacitance Cp in the touch sensor system, thereby reducing the sensitivity of the touch sensor. Therefore, a compromise in the prior art is to use this special mesh grounding wire to fill between the solid copper and the clearance.
[0074] "Charge and discharge cycle" refers to the total time required to complete a fixed number of charge and discharges when the capacitance at the touch pin is periodically charged and discharged in the touch sensor. When the voltage provided by the internal power supply for charging and discharging the touch pin is constant, the charge and discharge cycle is proportional to the total capacitance at the touch pin, that is, the larger the total capacitance, the longer the time for a fixed number of charge and discharges, that is, the longer the charge and discharge cycle.
[0075] Corresponding to the "charge and discharge cycle", the "pulse count value" refers to the number of charge and discharge times completed within a fixed time interval when the capacitance at the touch pin is periodically charged and discharged in the touch sensor. When the voltage provided by the internal power supply for charging and discharging the touch pin is constant, the pulse count value is inversely proportional to the total capacitance at the touch pin, that is, the larger the total capacitance, the fewer the number of charge and discharge times within the same time interval, that is, the smaller the pulse count value.
[0076] How it works
[0077] Figure 1 The schematic cross-sectional view of the structure of a touch sensor system 10 known in the prior art is shown. The touch sensor system 10 shown here includes a built-in touch sensor of, for example, an ESP32 series chip of Espressif Systems.
[0078] like Figure 1 As shown in FIG. 1 , a chip 110 is arranged on the lower surface of the insulating substrate 120, and the chip 110 has a built-in on-chip sensor (in the Figure 1(not shown in the figure). In contrast, a touch electrode 130 is arranged on the upper surface of the insulating substrate 120, that is, on the side opposite to the chip 110. Here, the touch electrode 130 shown is designed as a small circular pad (Pad), which is implemented in the form of a copper foil disc. Here, the touch electrode 130 can also be designed into other shapes according to actual needs and implemented in any suitable form, as long as the touch electrode 130 can form a parallel plate capacitor equivalent to the finger when the finger touches. The trace 140 passing through the via 150 provided in the insulating substrate 120 couples the touch electrode 130 with the touch pin 170 of the touch sensor on the chip. In addition, on the upper surface of the insulating substrate 220, that is, on the same side as the touch electrode 130, a grid ground 260 is arranged around the touch electrode 230 to shield external noise.
[0079] During the operation of such a touch sensor, when, for example, a user's finger performs a touch action, a parallel plate capacitor will be equivalently formed between the finger (which itself acts as a conductor) and the touch electrode 130. At this time, the equivalent capacitance of the parallel plate capacitor is connected in parallel with the capacitance on the touch pin 170, thereby significantly increasing the total capacitance of the touch pin 170. According to the capacitance-current formula I=C*du / dt, it can be seen that when the charging and discharging current for charging and discharging the touch pin 170 - the charging current is provided by the internal power supply of the touch sensor and is only affected by the power supply - remains unchanged, as the total capacitance on the touch pin 170 increases, the corresponding charging and discharging time will be extended. Therefore, whether a touch action has occurred can be determined based on the total time corresponding to the completion of the predetermined charging and discharging or the change in the total time.
[0080] Figure 2 A schematic diagram of a voltage waveform when periodic charging and discharging is performed at the touch pin 170 and a pulse waveform output by the touch sensor is shown to help further illustrate the details of the working principle of the touch sensor.
[0081] exist Figure 2 The upper middle sub-figure (A) shows that when the touch sensor is not working, the voltage at its touch pin 170 is at a low level U0. When the touch sensor is working, its control unit controls the internal power supply to periodically charge and discharge the touch pin 170. During this periodic charge and discharge process, the voltage at the touch pin 170 will be at a reference high voltage U H With a reference low voltage U L As shown in sub-figure (A), at time t0 when the touch sensor starts to work, the voltage of the touch pin 170 starts to rise from the low level U0. At time t1, the voltage of the touch pin 170 reaches the reference low voltage U LSubsequently, the voltage of the touch pin 170 continues to increase and reaches the reference high voltage U at time t2. H After time t2, the voltage of the touch pin decreases and reaches the reference high voltage U at time t3. L Here, the voltage of the touch pin changes from U L Rise to U H And return to U L The entire time length (t3-t1) corresponds to a complete charge and discharge cycle. In addition, as shown in the sub-figure (B) below, under the action of the voltage comparator in the touch sensor, a pulse low level U is output between t1 and t2. PL , and between t2 and t3, a pulse high level U is output PH In other words, after each complete charge and discharge cycle, the touch sensor generates an output pulse and the pulse count value increases by one.
[0082] It should be noted here that the core working principle of the technical solution according to the present invention is based on the following key fact: when the touch sensor is in normal operation and the interference noise in the surrounding environment can be ignored (for example, no touch behavior occurs), the capacitance at the touch pin (the so-called static capacitance value) and its charge and discharge rate will remain unchanged. This means that the pulse count of the output pulses generated by the touch sensor will remain stable within the same time interval. In other words, the total time consumed to complete a fixed number of charge and discharge (or to complete a fixed number of charge and discharge cycles) will be stable.
[0083] Specific technical solutions
[0084] The implementation scheme according to the first aspect of the present application will be described in detail below.
[0085] The inventors of the present application have found in practice that when the device uses different power supplies, the noise level of the power supply will affect the internal power supply of the touch sensor, and then affect the charge and discharge voltage applied at the touch pin of the touch sensor, specifically causing the charge and discharge voltage to fluctuate. In this case, when the capacitance at the touch pin remains unchanged, the fluctuation of the charge and discharge voltage will cause the time of each charge and discharge cycle to change. For example, when using an external power supply (such as mains power), since additional interference noise may be introduced during the AC-DC conversion process in its corresponding adapter (usually a switching adapter), its noise level will be higher than the noise level when using battery power.
[0086] Figure 3The diagram shows the time consumed for periodically charging and discharging the touch pins of the touch sensor in the device, measured when the device is powered by a battery and powered by an external power supply (these two situations are clearly divided by a red vertical line) and no touch action occurs. Figure 3 In the graph shown, each data point corresponds to the time corresponding to 500 complete charge and discharge cycles of the touch pin, and the unit of the time data is "RTC_SLOW_CLK cycle". Among them, the blue line shows a series of raw values (rawvalue) of the time consumed for 500 complete charge and discharge cycles. The green line shows a series of filtered values (smooth value) obtained after filtering the raw values, such as IIR filtering. The red line shows the base value (baselinevalue) used when detecting touch actions. The base value will change accordingly with the change of the capacitance at the touch pin. For example, when the hand is close to or in contact with the touch sensor, the capacitance of the touch pin increases, and the base value will also increase. As shown, in the absence of interference, the base value remains basically constant (its fluctuation rate is only about 20 / 25940*100%=0.07%). It should be noted that no matter how the raw value and the filtered value change, the average of the two follows the base value.
[0087] according to Figure 3 As shown, when the device is powered by a battery, the fluctuation of the original value and the filtered value is small, and the fluctuation amplitude does not exceed 80 (RTC_SLOW_CLK cycle). When the device is powered by an external power supply, the original value and the filtered value at this time show obvious changes (consistent with the conclusion that the external power supply will introduce relatively large noise as mentioned above). Figure 3 It can be seen that when using external power supply, the fluctuation range of both the original value and the filtered value is basically increased to twice that of when using battery power supply. In addition, when the power supply mode of the device is switched from battery power supply to external power supply, the fluctuation of the base value under these two power supply modes is relatively small. Here, when using external power supply, it is only reduced by about 20 (RTC_SLOW_CLK cycles) compared with when using battery power supply. It can be seen that the fluctuation of the base value cannot be used alone as a reliable basis for identifying the power supply mode.
[0088] Based on the above findings, the inventors of the present application creatively proposed a recognition method, the flow chart of which is as follows: Figure 4 As shown. This method cleverly utilizes the unique working mode of the existing touch sensor to determine the power supply mode of the device. Specifically, during operation, the touch pin of the touch sensor is continuously charged and discharged periodically, and a corresponding output pulse signal is generated based on the periodic charging and discharging. The method includes the following steps:
[0089] Step S1 : Based on the output pulse signal, multiple original values of total charge and discharge times corresponding to multiple consecutive charge and discharge rounds are obtained, wherein each charge and discharge round includes a fixed number of charge and discharge operations on the touch pin.
[0090] Among them, since the duration of a single charge and discharge cycle is extremely short, in order to ensure the reliability of the measurement results, a complete charge and discharge cycle (i.e., one round of charge and discharge) usually consists of multiple charge and discharge cycles, such as Figure 3 500 charge-discharge cycles in the example shown. However, even if one cycle of charge-discharge corresponds to 500 charge-discharge cycles, the total duration of the cycle is still short. At this time, in order to reliably and accurately identify the power supply mode, that is, to avoid recognition errors caused by short-term or transient interference factors such as touch, it is necessary to use multiple raw values for recognition.
[0091] According to the present invention, step S1 may also include the following exemplary sub-steps, and those skilled in the art will appreciate that various similar steps, data structures, quantities, etc. may be used to implement corresponding functions without departing from the concept of the present application.
[0092] Initialization step S11: Figure 5 As shown, a data window with a length of N is set (in this embodiment, N is 100, and a first-in-first-out queue data structure is adopted), and all data bits in the data window (from E1 to E 100 The data bits are initialized to empty (e.g., 0, null, etc.) so that the data bits can be used to store the raw values (here A) corresponding to the charge and discharge cycles that are subsequently collected. i represents, i is a positive integer).
[0093] Data pre-collection step S12: collect the raw values at a certain measurement interval, and then perform subsequent pre-processing steps. In this embodiment, the measurement interval is, for example, an interval of 500 pulse count values. The measurement interval can also be an integer multiple of the pulse count values corresponding to the fixed number of charge and discharge, such as an interval of 1000 pulse count values or 2000 pulse count values. As mentioned above, since the duration of a single charge and discharge cycle is extremely short, appropriately extending the measurement interval will not cause a user-perceivable adverse effect on the real-time recognition of the method according to the present invention.
[0094] Preprocessing step S13: Each time a new raw value is collected, all existing data stored in the data window are first shifted forward by one data bit, and then the newly collected raw value is stored in the last data bit in the data window. Figure 5The first row in the figure shows the first acquisition of the original value (represented by A1) and its filling into the data window data position E. 100 Then, it is determined whether the data window has been filled (i.e., the data stored in the first data bit E1 in the data window is not empty). If the data window is not filled, Figure 5 As shown in the 1st and 2nd rows of , the data pre-collection step S12 is returned and re-executed. If the data window is filled, as shown in Figure 5 As shown in line 3 of , the subsequent data processing steps are performed.
[0095] Step S2 : Take each N original values of the multiple original data values as a group to obtain M groups of original values, and obtain M groups of identification data corresponding to the M groups of original values, wherein each group of identification data includes one or more identification data that can reflect the noise of the power supply of the device, wherein N and M are both positive integers. Figure 6 As shown in the example, each 100 raw values form a group, and rows 1 to 3 show the first to third groups of raw data (i.e., A1 to A2). 100 , A2 to A 101 and A3 to A 102 ), in other words, in this example, M=3, and 3 sets of identification data can be obtained based on these 3 sets of original data (not shown in the figure).
[0096] According to the present invention, the identification data may be selected from the group consisting of the following items: the difference between each original value and the average value of the original values, the absolute value of the difference, the average value of the absolute value of the difference, the square value of the difference, the average value of the square value of the difference, and the sum of the variances of the original values. It should be noted that the above enumeration of identification data is not intended to be exhaustive of all possible types, and those skilled in the art may choose to use any other appropriate type of identification data according to actual needs without departing from the spirit of the present invention.
[0097] In addition, since the filtered values can exclude high-frequency noise, they are more stable than the unprocessed original values, which can effectively improve the robustness of the recognition method. Therefore, the recognition data can preferably be selected from the group including the following items: the filtered difference between each filtered value and the average value of the filtered values, the absolute value of the filtered difference, the average value of the absolute value of the filtered difference, the square value of the filtered difference, the average value of the square value of the filtered difference, and the sum of the variances of the filtered values.
[0098] According to the present invention, step S2 may further include the following exemplary sub-steps:
[0099] Data processing step S21: Calculate the required identification data based on the original values stored in the data window. Here, an example is taken when the data window is just filled and the identification data is calculated for the first time (e.g. Figure 6The calculated identification data is, for example, the difference between each original value (here, "each original value" refers to the last original value in the data window from the time when the data window is filled) and the average value of the original values, which is equal to A 100 –(A1+A 2+。。。+ A 100 ) / 100. In this example, only one type of identification data is used as an example, but multiple types of identification data may also be used at the same time. The use of multiple types of identification data can correct the identification result and reduce the possibility of identification errors when a single identification standard is used. After the calculation is completed, the subsequent data updating step S22 and the identification step may be performed simultaneously or sequentially.
[0100] Data updating step S22: the original values are collected again at the certain measurement interval, the original value stored in the first data bit in the data window is discarded, and if any, a set of identification data corresponding to the original data is discarded, and then all the remaining data bits of the data window (i.e., E2 to E3) are collected again. N ) is moved forward by one data bit (i.e., moved to E1 to E N-1 ) and fill the last data bit of the data window (i.e. E) with the newly collected original value. N ),like Figure 6 After the data update is completed, the process returns to and executes the calculation step S21.
[0101] Step S3 : Compare each identification data included in one or more groups of identification data with a corresponding threshold value T, and identify the power supply mode of the device based on the comparison result.
[0102] In a preferred embodiment of the present invention, identifying the power supply mode of the device based on the comparison result includes, for example:
[0103] - When each identification data in the M groups of identification data is always greater than the corresponding threshold T, the power supply mode of the device is identified as external power supply;
[0104] - when each identification data in the M groups of identification data is always smaller than the corresponding threshold value T, the power supply mode of the device is identified as battery power supply; and
[0105] When the identification data in the M groups of identification data changes from greater than the corresponding threshold T to less than the corresponding threshold T or changes from less than the corresponding threshold T to greater than the corresponding threshold T, it will be recognized that a change in the power supply mode has occurred.
[0106] The above describes the implementation of the identification method according to the present invention. The greatest advantage of this identification method is that it can effectively identify the power supply mode without adding any additional or dedicated hardware, which greatly saves hardware costs. At the same time, since this method is essentially an extended application based on the inherent working mode of the touch sensor (i.e., continuously performing periodic charging and discharging operations on its touch pins), it will not only not cause any interference to the normal function of the sensor itself, but also expand the use of the touch sensor.
[0107] It is worth noting that this method of identifying the power supply mode is not limited to the application scenario of touch sensors, but has a wider applicability. This method can be applied to any other equipment and system in which some components (such as pins, capacitors, etc.) are periodically charged and discharged during work, and the time consumed by these periodic charging and discharging is affected by the power supply mode.
[0108] The following is based on Figure 7 A preferred embodiment of the present invention is described below. The embodiment identifies the power supply mode of the device based on the sum of variances of filtered values. Figure 7 A schematic diagram of the variance and waveform of the filtered values obtained in the two cases of battery power supply and external power supply is shown. It can be clearly seen from the figure that when the device is powered by a battery, the variance and sum of the filtered values are small; and when the power supply mode of the device is changed to be powered by an external power supply, the variance and sum of the filtered values will increase rapidly. According to the results of the measurements conducted by the inventor, the variance and sum of the filtered values when powered by an external power supply is approximately 10 times the variance and sum of the filtered values when powered by a battery. The multiple value is related to the specific device used in the measurement process, and different external power supplies may have different multiple relationships. In this case, the threshold T is preset based on empirical data.
[0109] According to the present invention, one or more threshold values T preset based on empirical data may include, for example: using one or more samples (which may be more finely classified according to parameters such as output power) of a specific type of power supply (such as an external adapter or an internal battery of the device) to perform one or more measurements, preferably multiple measurements, and determining the standard values of various identification data when using this specific type of power supply based on the measurement results, such as the average value of multiple measurement results. Based on such standard values, the corresponding threshold values T can be set. For example, the middle value of the standard value of the identification data when using an external power adapter and the standard value of the identification data when using a battery is used as the threshold value T. For example, based on Figure 5 In the embodiment shown, as described above, the threshold T is selected as the middle value of the sum of the variances of the filtered values determined under the two power supply modes. Figure 5As shown, the sum of the variances when powered by a battery is 1000, while the sum of the variances when powered by an external power source is 10000. In this case, the threshold T can be selected as 5500.
[0110] In addition, in actual use, when a touch action occurs, such as a finger approaching or touching the touch sensor, the measured original value and the filtered value may change significantly. Figure 8 As shown in the figure, the variance and waveform of the filtered value when a touch action occurs under battery power supply. In the process of the touch action, the variance and waveform of the filtered value will first rise and then fall (as shown in the area between the two red lines in the center of the figure), and finally return to the same level as when no contact action is performed. The variance and waveform of the filtered value when powered by an external power supply are also similar to Figure 8 shown.
[0111] Therefore, in order to prevent the above-mentioned large-scale waveform changes caused by interference from causing incorrect identification of the power supply mode, the following further preferred implementation manner is proposed according to the present invention.
[0112] An additional count value c is set and initialized to 0. A determination threshold L is set, and the determination threshold L should be greater than or equal to the length value N of the data window. For example, if the length value N is 100, the upper limit determination threshold L can be set to 200. When the variance sum of the filtered values changes, for example, the variance sum of the filtered values changes from less than the threshold value T to greater than the threshold value T, then each time a new original value is collected and the relevant identification data is calculated, it is determined whether the variance sum of the filtered values is still greater than the threshold value T. If it is greater than the threshold value T, the count value c is increased by one, and if it is less than the threshold value T, the count value c is reset to zero. When the variance sum of the filtered values continues to be greater than the threshold value T after the first change, the count value c will continue to accumulate. Until the count value c is greater than the upper limit determination threshold L, it is determined that the power supply mode of the device has indeed changed, that is, the power supply from the battery is changed to the power supply from the external power supply. If the count value c increases, but the variance and waveform changes of the filtered values caused by the contact action do not always remain greater than the threshold T, and therefore the count value c is reset to zero when the variance and waveform of the filtered values no longer exceed the threshold T, then this situation will be judged as a touch action or other possible interference situations, and will not be judged as a change in the power supply method.
[0113] In addition, in actual use, in addition to the touch action, there are various other noise sources that may affect the voltage and / or capacitance at the touch pin of the touch sensor, such as electrostatic discharge (ESD), electrical fast transient (EFT), etc. Therefore, in a further preferred embodiment of the present invention, in order to ensure the robustness of power supply mode recognition under different noise environments, it is proposed that corresponding improvements can be made at the detection algorithm level. Specifically, the threshold T can be dynamically adjusted so that when the external environmental noise changes, the reliability of the recognition result can be improved based on the dynamically adjusted threshold T.
[0114] The inventor of the present invention has found through experimental tests that the measured original value and the filtered value will change with the external noise. For example, when the external noise increases, the original value and the filtered value will increase accordingly, but the base value will not change significantly. In the case of a change in the power supply mode, even if the base value may change to a certain extent, it is usually not significant.
[0115] Therefore, Figure 7 As shown in FIG. 1 , assuming that the difference between the sum of the variances of the filtered output values output by the touch sensor and the base value when the device is powered by a battery is D, the threshold T can be set to x times the difference D (the x value can be measured according to the actual external power supply). Therefore, as the sum of the variances of the filtered output values changes, the threshold T will also change dynamically.
[0116] For example, when the device is in an environment with relatively small external noise, the variance of the filtered values is small when powered by a battery and increases significantly when powered by an external power supply, but the base value under the two power supply modes remains basically constant. The median value of the variance of the filtered values under the two different power supply modes is calculated to obtain the threshold value T in the environment with relatively small external noise, and the x value related to the specific external power supply can be derived from it.
[0117] When the device is in a situation where the external noise is relatively large, as mentioned above, assuming that the base value does not change substantially with the noise, in this noisy environment, the variance of the filtered output value of the device when it is powered by a battery and the difference from the base value can be calculated, and the difference can be multiplied by the corresponding x value obtained in the environment with less noise to obtain the threshold value T in the environment with more noise.
[0118] By dynamically adjusting the threshold T in this way, the problem that only using a fixed threshold T may not be able to accurately identify the power supply mode of the device under complex external noise conditions is overcome.
[0119] According to the second aspect of the present invention, a device for identifying its power supply mode using the above method is also proposed, the device at least comprising: a touch sensor, an external data processing unit and an identification unit. The touch sensor comprises: a touch pin, which is used to connect the internal circuit of the touch sensor with the external circuit; a control unit, which has an internal power supply for powering the components in the touch sensor, a control module for controlling the internal power supply so as to periodically charge and discharge the touch pin, and a voltage comparator for generating an output pulse signal based on the periodic charge and discharge; and an internal data processing unit, which obtains a plurality of original values of the total charge and discharge time corresponding to a plurality of consecutive rounds of charge and discharge based on the output pulse signal, each round of charge and discharge includes a fixed number of charge and discharge of the touch pin. The external data processing unit takes each N original values of the plurality of original values as a group to obtain M groups of original values, and obtains M groups of identification data corresponding to the M groups of original values, each group of identification data includes one or more identification data that can reflect the noise of the power supply of the device, wherein N and M are both positive integers. The identification unit is used to compare one or more identification data in the M groups of identification data with the corresponding threshold value T, and identify the power supply mode of the device based on the comparison result.
[0120] Back to Figure 1 In the example shown, in the touch sensor system 10 of the prior art, the wiring 140 between the touch electrode 130 and the touch pin 170 is the main factor that introduces interference and parasitic capacitance Cp in the touch sensor system 10. Figure 8 As shown, in order to improve the interference caused by the parasitic capacitor Cp and ensure the reliability of power supply mode identification, a series resistor R can be added to the line 140. The series resistor R and the parasitic capacitor Cp will equivalently form an RC filter, thereby reducing the coupling noise and interference on the line 140.
[0121] The value of the series resistor R is subject to many factors, such as the internal resistance of the touch sensing channel, the charge and discharge frequency, the external parasitic capacitance, etc. Therefore, if the value of the series resistor R is too large, it will cause distortion and reduce the sensitivity, and if it is too small, the filtering effect will not be obvious. According to the present invention, the acceptable value of the series resistor R is in the range of 500Ω to 2KΩ, wherein the preferred value is 510Ω.
[0122] In addition, in order to avoid the additional parasitic capacitance between the series resistor R and the touch pin 230 as much as possible, the distance between the series resistor R and the touch pin 230 should be as small as possible, and the preferred distance value should be less than 10 mm.
[0123] The touch sensor-based power supply mode intelligent recognition technology of the present invention provides an efficient, low-cost and automatic power supply mode recognition solution for electronic devices, which greatly promotes power management and device performance optimization.
[0124] Although various embodiments of various aspects of the present invention have been described for the purpose of facilitating understanding of the present invention, it should not be understood that the teachings of the present invention are limited to these embodiments. Features disclosed in a specific embodiment are not limited to this embodiment, but can be combined with features disclosed in different embodiments. It should be understood by those skilled in the art that there are also possible more optional embodiments and variations, and various changes and modifications can be made to the above-mentioned components and structures without departing from the scope defined by the claims of the present invention.
Claims
1. A method for identifying a power supply mode of a device based on a touch sensor, wherein a control unit of the touch sensor controls an internal power supply to continuously and periodically charge and discharge a touch pin of the touch sensor, and generates an output pulse signal based on the periodic charge and discharge, the method comprising the following steps: S1. Based on the output pulse signal, a plurality of original values of total charge and discharge times corresponding to a plurality of consecutive charge and discharge rounds are obtained, wherein each charge and discharge round includes a fixed number of charge and discharge operations on the touch pin; S2. taking each N of the plurality of the original values as a group to obtain M groups of the original values, and obtaining M groups of identification data corresponding to the M groups of the original values, each group of identification data including one or more identification data capable of reflecting the noise of the power supply of the device, wherein N and M are both positive integers; as well as S3. Compare each identification data included in one or more sets of the identification data with a corresponding threshold value (T), and identify the power supply mode of the device based on the comparison result.
2. The method according to claim 1, characterized in that The identification data is selected from the group consisting of: the difference between each of the original values and the average of the original values, The absolute value of the difference, the average of the absolute values of the differences, The square value of the difference, The average of the square values of the differences, The sum of the variances of the original values, the filtered difference of each filtered value and the mean of the filtered values, The absolute value of the filtered difference, The average value of the absolute values of the filtered differences, The square value of the filtered difference, the average of the squared values of the filtered differences, and The sum of the variances of the filtered values.
3. The method according to claim 1 or 2, characterized in that: Step S3 also includes: When each identification data in the M groups of identification data is always greater than the corresponding threshold value (T), identifying the power supply mode of the device as external power supply; When each identification data in the M groups of identification data is always smaller than the corresponding threshold value (T), identifying the power supply mode of the device as battery power supply; and When the identification data in the M groups of identification data changes from greater than the corresponding threshold (T) to less than the corresponding threshold (T) or changes from less than the corresponding threshold (T) to greater than the corresponding threshold (T), it will be recognized as a change in the power supply method.
4. The method according to claim 3, characterized in that When the device is identified as having undergone a first change in power supply mode, whether a second change in power supply mode has occurred is continuously identified during subsequent L consecutive rounds of charge and discharge, where L is a positive integer greater than or equal to N, and wherein, if the second change in power supply mode is identified, the change in the first power supply mode is identified as interference, and the power supply mode of the device is identified as the power supply mode before the first change in power supply mode occurs; if the second change in power supply mode is not identified, the change in the first power supply mode is identified as a valid change, and the power supply mode of the device is identified as the power supply mode after the first change in power supply mode occurs.
5. The method according to claim 1 or 2, characterized in that: The threshold (T) is preset based on empirical data or can be dynamically adjusted.
6. The method according to claim 5, characterized in that Presetting the threshold value (T) based on empirical data includes: using one or more samples of a type of power supply to perform measurements, and determining standard values of various identification data when using the type of power supply based on the measurement results, and setting the threshold value (T) required for identifying between different types of power supplies based on the standard values.
7. The method according to claim 5, characterized in that Dynamically adjusting the threshold value (T) includes: determining the threshold value (T) according to the variance of the filtered value measured under different power supply modes and the difference with the base value under the corresponding power supply mode.
8. A device for identifying its power supply mode using the method according to any one of the preceding claims, the device comprising: A touch sensor, the touch sensor comprising: A touch pin, which is used to connect the internal circuit of the touch sensor with an external circuit, A control unit, the control unit comprising: an internal power supply for powering components within the touch sensor, a control module, which is used to control the internal power supply so as to periodically charge and discharge the touch pin, and a voltage comparator, which generates an output pulse signal based on the periodic charge and discharge, and an internal data processing unit, which obtains original values of a plurality of total charge and discharge times corresponding to a plurality of consecutive charge and discharge rounds based on the output pulse signal, wherein each charge and discharge round includes a fixed number of charge and discharge operations on the touch pin; an external data processing unit, which takes each N of the plurality of the original values as a group to obtain M groups of the original values, and obtains M groups of identification data corresponding to the M groups of the original values, each group of identification data including one or more identification data capable of reflecting the noise of the power supply of the device, wherein N and M are both positive integers; as well as An identification unit compares each identification data included in one or more sets of the identification data with a corresponding threshold value (T), and identifies the power supply mode of the device based on the comparison result.
9. The device according to claim 8, characterized in that The touch sensor also includes a touch electrode and a wiring connecting the touch pin and the touch electrode, wherein the touch pin, the touch electrode and the wiring form a touch sensing channel, and the capacitance of the touch sensing channel is connected in parallel with the capacitance of the touch pin itself.
10. The device according to claim 9, characterized in that A series resistor is provided in the wiring, so as to form an RC filter with the parasitic capacitance in the touch sensing channel.
11. The device according to claim 10, characterized in that The resistance value of the series resistor is 510Ω.
12. The device according to claim 10 or 11, characterized in that The distance between the series resistor and the touch pin is less than 10 mm.
13. A use of a touch sensor for identifying a power supply mode of a device.
