Touch detection method, equipment and device and computer readable storage medium

文档序号:1390258 发布日期:2020-02-28 浏览:2次 中文

阅读说明:本技术 一种触碰检测方法、设备、装置和计算机可读存储介质 (Touch detection method, equipment and device and computer readable storage medium ) 是由 陈思 吴玉锦 于 2019-11-26 设计创作,主要内容包括:本发明公开了一种触碰检测方法、设备、装置和计算机可读存储介质,应用于可携带设备中,所述方法包括:每隔设定时间段对可变电容进行充放电;获取所述可变电容在充电状态下从基准电压到指定电压的充电时长;根据所获取的充电时长来确定所述可携带设备是否处于触碰状态。使用时,由于可变电容可设置可携带设备中,通过检测可变电容的充电时长来判断当前设备是否处于佩戴状态,无需在可携带设备上开孔,因此保留了设备结构的完整性。(The invention discloses a touch detection method, equipment, a device and a computer readable storage medium, which are applied to portable equipment, wherein the method comprises the following steps: charging and discharging the variable capacitor every set time period; acquiring the charging time length from a reference voltage to a specified voltage of the variable capacitor in a charging state; and determining whether the portable equipment is in a touch state according to the acquired charging time length. During the use, because variable capacitor can set up in the portable equipment, it is long to judge whether current equipment is in the wearing state through detecting variable capacitor's the length of charging, need not to go up the trompil at the portable equipment, has consequently remain the integrality of equipment structure.)

1. A touch detection method is applied to a portable device, and comprises the following steps:

charging and discharging the variable capacitor every set time period;

acquiring the charging time length from a reference voltage to a specified voltage of the variable capacitor in a charging state;

and determining whether the portable equipment is in a touch state according to the acquired charging time length.

2. The method of claim 1, wherein the touch state comprises a wearing state and a touch state for a touch key.

3. The method of claim 1, wherein the variable capacitance is a first capacitance when the portable device is in a non-touch state and changes from the first capacitance to a second capacitance when the portable device is in a touch state;

correspondingly, the variable capacitor is charged and discharged every set time period; acquiring the charging time length from a reference voltage to a specified voltage of the variable capacitor in a charging state, wherein the acquiring comprises the following steps:

charging and discharging the first capacitor or the second capacitor at intervals of a set time period;

and acquiring the charging time length of the first capacitor or the second capacitor from the reference voltage to the specified voltage in the charging state.

4. The method of claim 3, wherein the portable device comprises a pad;

the first capacitor is located in the portable equipment;

when a conductor is close to the pad, the portable equipment is in a touch state, and a temporary capacitor is generated between the conductor and the pad;

the second capacitor is the superposition of the first capacitor and the temporary capacitor.

5. The method of claim 1, wherein the determining whether the portable device is in a touch state according to the acquired charging duration comprises:

judging whether the charging time length exceeds a time length threshold value or not;

and if the charging time length is judged to exceed the time length threshold value, determining that the portable equipment is in a touch state.

6. The method of claim 5, wherein after determining that the portable device is in the touch state, the method further comprises:

and driving the portable equipment to change from the non-working state to the working state.

7. A touch detection device, applied to a portable device, the device comprising:

the charge-discharge module is used for charging and discharging the variable capacitor at intervals of a set time period;

the time length obtaining module is used for obtaining the charging time length from the reference voltage to the specified voltage of the variable capacitor in the charging state;

and the detection module is used for determining whether the portable equipment is in a touch state according to the acquired charging time.

8. The touch detection device is applied to portable equipment and comprises a processor, a bonding pad, a resistor, a semiconductor switch and a power supply;

the pad is positioned on a printed circuit board in the portable equipment, and a first capacitor is generated between the pad and the printed circuit board;

when the conductor is close to the bonding pad, a temporary capacitor is generated between the conductor and the bonding pad, and the temporary capacitor and the first capacitor are overlapped to obtain a second capacitor;

the power supply, the resistor and the bonding pad are sequentially connected in series;

the semiconductor switch is connected between the bonding pad and the ground wire in series;

the GPIO pin in the processor is connected with the semiconductor switch and used for driving the semiconductor switch to be switched on or switched off every set time period so as to charge and discharge the first capacitor or the second capacitor;

and a TIM _ CCR pin in the processor is connected between the resistor and the pad and used for acquiring the charging time length from the reference voltage to the specified voltage of the first capacitor or the second capacitor in the charging state and determining whether the portable equipment is in the touch state according to the acquired charging time length.

9. The device of claim 8, further comprising a high voltage protection element:

the high-voltage protection element is connected between the variable capacitor and the ground wire and is used for preventing the device from being damaged due to instantaneous high voltage.

10. A computer-readable storage medium comprising a set of computer-executable instructions that, when executed, perform a touch detection method as recited in any one of claims 1-6.

Technical Field

The present invention relates to the field of touch technologies, and in particular, to a touch detection method, device, and apparatus, and a computer-readable storage medium.

Background

Disclosure of Invention

The embodiment of the invention provides a touch detection method, equipment, a device and a computer readable storage medium, which can realize touch detection without damaging the structural integrity of the equipment.

The invention provides a touch detection method applied to portable equipment, which comprises the following steps: charging and discharging the variable capacitor every set time period; acquiring the charging time length from a reference voltage to a specified voltage of the variable capacitor in a charging state; and determining whether the portable equipment is in a touch state according to the acquired charging time length.

In one embodiment, the touch state includes a wearing state and a touch state for the touch key.

In an embodiment, the variable capacitor is a first capacitor when the portable device is in a non-touch state, and is converted from the first capacitor to a second capacitor when the portable device is in a touch state; correspondingly, the variable capacitor is charged and discharged every set time period; acquiring the charging time length from a reference voltage to a specified voltage of the variable capacitor in a charging state, wherein the acquiring comprises the following steps: charging and discharging the first capacitor or the second capacitor at intervals of a set time period; and acquiring the charging time length of the first capacitor or the second capacitor from the reference voltage to the specified voltage in the charging state.

In one embodiment, the portable device includes a pad; the first capacitor is located in the portable equipment; when a conductor is close to the pad, the portable equipment is in a touch state, and a temporary capacitor is generated between the conductor and the pad; the second capacitor is the superposition of the first capacitor and the temporary capacitor.

In an implementation manner, the determining whether the portable device is in a touch state according to the acquired charging duration includes: judging whether the charging time length exceeds a time length threshold value or not; and if the charging time length is judged to exceed the time length threshold value, determining that the portable equipment is in a touch state.

In a possible embodiment, after determining that the portable device is in the touch state, the method further comprises: and driving the portable equipment to change from the non-working state to the working state.

Another aspect of the present invention provides a touch detection device, applied to a portable device, the device including: the charge-discharge module is used for charging and discharging the variable capacitor at intervals of a set time period; the time length obtaining module is used for obtaining the charging time length from the reference voltage to the specified voltage of the variable capacitor in the charging state; and the detection module is used for determining whether the portable equipment is in a touch state according to the acquired charging time.

The invention provides a touch detection device, which is applied to portable equipment and comprises a processor, a bonding pad, a resistor, a semiconductor switch and a power supply; the pad is positioned on a printed circuit board in the portable equipment, and a first capacitor is generated between the pad and the printed circuit board; when the conductor is close to the bonding pad, a temporary capacitor is generated between the conductor and the bonding pad, and the temporary capacitor and the first capacitor are overlapped to obtain a second capacitor; the power supply, the resistor and the bonding pad are sequentially connected in series; the semiconductor switch is connected between the bonding pad and the ground wire in series; the GPIO pin in the processor is connected with the semiconductor switch and used for driving the semiconductor switch to be switched on or switched off every set time period so as to charge and discharge the first capacitor or the second capacitor; and a TIM _ CCR pin in the processor is connected between the resistor and the pad and used for acquiring the charging time length from the reference voltage to the specified voltage of the first capacitor or the second capacitor in the charging state and determining whether the portable equipment is in the touch state according to the acquired charging time length.

In an embodiment, the device further comprises a high voltage protection element: the high-voltage protection element is connected between the variable capacitor and the ground wire and is used for preventing the device from being damaged due to instantaneous high voltage.

In another aspect, the present invention provides a computer-readable storage medium comprising a set of computer-executable instructions that, when executed, perform a method of touch detection.

In the embodiment of the invention, firstly, the variable capacitor is charged and discharged at intervals of a set time period, and then the charging time length from the reference voltage to the specified voltage of the variable capacitor in the charging state is obtained; and then determining whether the portable equipment is in a touch state according to the acquired charging time length.

During the use, because variable capacitor can set up in the portable equipment, it is long to judge whether current equipment is in the wearing state through detecting variable capacitor's the length of charging, need not to go up the trompil at the portable equipment, has consequently remain the integrality of equipment structure.

Drawings

The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:

in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

Fig. 1 is a schematic diagram illustrating an implementation process of a touch detection method according to an embodiment of the present invention;

fig. 2 is a schematic structural diagram of a touch detection device according to an embodiment of the invention;

fig. 3 is a schematic structural diagram of a touch detection device according to an embodiment of the invention;

fig. 4 is a schematic diagram illustrating an implementation effect of a touch detection device according to an embodiment of the invention.

Detailed Description

In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Fig. 1 is a schematic diagram illustrating an implementation process of a touch detection method according to an embodiment of the present invention; as shown in fig. 1.

The invention provides a touch detection method applied to portable equipment, which comprises the following steps:

step 101, charging and discharging a variable capacitor every set time period;

102, acquiring a charging time length from a reference voltage to a specified voltage of a variable capacitor in a charging state;

and 103, determining whether the portable equipment is in a touch state according to the acquired charging time.

In this embodiment, the portable device may be a watch, an earphone, a mobile phone, or other devices that can be carried around by people. The variable capacitor can be arranged on the portable equipment, when a conductor (such as a human body) is close to or touches the portable equipment, the portable equipment is caused to be in a touch state, otherwise, the portable equipment is in a non-touch state, and the capacitance of the variable capacitor can change along with the current state of the portable equipment.

The method comprises the following steps: first, the variable capacitor is charged and discharged at intervals of a set time period, wherein each set time period can be equal in length or unequal in length, and the charging or discharging time is a fixed value.

And then, under the charging state of the variable capacitor, acquiring the real-time voltage of the variable capacitor in real time through a voltage monitoring means, and recording a first time point of the variable capacitor at the reference voltage and a second time point of the variable capacitor at the specified voltage through a timing tool, wherein the difference value between the first time point and the second time point is the charging time length. The charging time length is different with the different capacitance of the variable capacitor. In practical applications, the reference voltage is generally set to 0 v, and the predetermined voltage is a fixed value according to the tolerable magnitude of the capacitor.

And finally, determining whether the current portable equipment is in a touch state or not according to the acquired charging time.

During the use, because variable capacitor can set up in the portable equipment, it is long to judge whether current equipment is in the wearing state through detecting variable capacitor's the length of charging, need not to go up the trompil at the portable equipment, has consequently remain the integrality of equipment structure.

In one embodiment, the touch state includes a wearing state and a touch state for the touch key.

In this embodiment, when the method is applied to wearable devices such as a watch and an earphone, whether the current device is in a wearing state is determined through the charging duration, and when the method is applied to devices with touch keys such as a mobile phone and a tablet, whether the touch key of the current device is in a touch state is determined through the charging duration.

In an embodiment, the variable capacitor is a first capacitor when the portable device is in a non-touch state, and is converted from the first capacitor to a second capacitor when the portable device is in a touch state;

correspondingly, charging and discharging the variable capacitor every set time period; the method for acquiring the charging time length of the variable capacitor from the reference voltage to the specified voltage in the charging state comprises the following steps:

charging and discharging the first capacitor or the second capacitor at intervals of a set time period;

and acquiring the charging time length of the first capacitor or the second capacitor from the reference voltage to the specified voltage in the charging state.

In this embodiment, when the portable device is in a non-touch state, the variable capacitor is a first capacitor, and the capacitance of the first capacitor is a fixed value.

Correspondingly, when the portable equipment is in a non-touch state, the first capacitor is charged and discharged at intervals of a set time period, and the charging time length from the reference voltage to the specified voltage of the first capacitor in the charging state is obtained; when the portable equipment is in a touch state, the second capacitor is charged and discharged every set time period, and the charging time length from the reference voltage to the specified voltage of the second capacitor in the charging state is obtained.

In one embodiment, a portable device includes a pad;

the first capacitor is positioned in the portable equipment;

when the conductor is close to the pad, the portable equipment is in a touch state, and a temporary capacitor is generated between the conductor and the pad;

the second capacitor is the superposition of the first capacitor and the temporary capacitor.

In this embodiment, the pad is mounted on a printed circuit board in the interior of the portable device. If the portable equipment is wearable equipment such as a watch, an earphone and the like, the bonding pad is specifically positioned on one surface, close to the skin of the human body, of the wearable equipment; if the portable device is a mobile phone, a tablet, or other touch device with touch keys, the pad is specifically located on a surface of the touch device close to the touch screen.

A first capacitor, namely a stray capacitor is formed between the bonding pad and the printed circuit board, when a conductor (such as a human body) is close to the bonding pad, a temporary capacitor is formed between the bonding pad and the conductor, and the temporary capacitor and the first capacitor are overlapped to form a second capacitor.

In one implementation, determining whether the portable device is in a touch state according to the acquired charging time period includes:

judging whether the charging time exceeds a time threshold;

and if the charging time length is judged to exceed the time length threshold value, determining that the portable equipment is in a touch state.

In this embodiment, the specific steps of step 103 are: and comparing the acquired charging time with a preset time threshold, and if the acquired charging time exceeds the time threshold, determining that the portable equipment is in a touch state at the moment. On the contrary, if the acquired charging time does not exceed the time threshold, it is determined that the portable device is in a non-touch state at the moment.

In an implementation manner, after determining that the portable device is in the touch state, the method further includes:

driving the portable device from the inactive state to the active state.

In this embodiment, after determining that the portable device is in the touch state, the portable device is driven to change from the non-operating state to the operating state, where the non-operating state includes a sleep state, a standby state, and a power-off state, and the operating state includes a wake-up state and a power-on state.

This scheme can be used for can waking up or the start-up automatically under the touching state at portable equipment, can practice thrift the consumption, promotes continuation of the journey.

Fig. 2 is a schematic flow chart illustrating an implementation of a touch detection device according to an embodiment of the present invention, as shown in fig. 2.

Another aspect of an embodiment of the present invention provides a touch detection device, which is applied to a portable device, and includes:

the charging and discharging module 201 is used for charging and discharging the variable capacitor every set time period;

a duration obtaining module 202, configured to obtain a charging duration from a reference voltage to a specified voltage of the variable capacitor in a charging state;

the detecting module 203 is configured to determine whether the portable device is in a touch state according to the obtained charging duration.

In this embodiment, the portable device may be a watch, an earphone, a mobile phone, or other devices that can be carried around by people. The variable capacitor can be arranged on the portable equipment, when a conductor (such as a human body) is close to or touches the portable equipment, the portable equipment is caused to be in a touch state, otherwise, the portable equipment is in a non-touch state, and the capacitance of the variable capacitor can change along with the current state of the portable equipment.

When the charging and discharging module 201 is used, the variable capacitor is charged and discharged at intervals of a set time period, wherein each set time period may be equal in length or different in length, and the charging or discharging time is a fixed value.

Next, the duration obtaining module 202 obtains a real-time voltage of the variable capacitor in real time through a voltage monitoring means in a state that the variable capacitor is charged, and records a first time point of the variable capacitor at the reference voltage and a second time point of the variable capacitor at the specified voltage through a timing tool, where a difference between the first time point and the second time point is a charging duration. The charging time length is different with the different capacitance of the variable capacitor. In practical applications, the reference voltage is generally set to 0 v, and the predetermined voltage is a fixed value according to the tolerable magnitude of the capacitor.

Finally, the detection module 203 determines whether the portable device is currently in a touch state according to the acquired charging duration.

During the use, because variable capacitor can set up in the portable equipment, it is long to judge whether current equipment is in the wearing state through detecting variable capacitor's the length of charging, need not to go up the trompil at the portable equipment, has consequently remain the integrality of equipment structure.

Fig. 3 is a schematic structural diagram of a touch detection device according to an embodiment of the invention, as shown in fig. 3.

The invention provides another aspect of a touch detection device, which is applied to portable equipment and comprises a processor, a bonding pad, a resistor, a semiconductor switch and a power supply;

the pad is positioned on a printed circuit board in the portable equipment, and a first capacitor is generated between the pad and the printed circuit board;

when the conductor is close to the bonding pad, a temporary capacitor is generated between the conductor and the bonding pad, and the temporary capacitor is superposed with the first capacitor to obtain a second capacitor;

the power supply, the resistor and the bonding pad are sequentially connected in series;

the semiconductor switch is connected between the bonding pad and the ground wire in series;

the GPIO pin in the processor is connected with the semiconductor switch and used for driving the semiconductor switch to be switched on or switched off every set time period so as to charge and discharge the first capacitor or the second capacitor;

and a TIM _ CCR pin in the processor is connected between the resistor and the pad and used for acquiring the charging time length from the reference voltage to the specified voltage of the first capacitor or the second capacitor in the charging state and determining whether the portable equipment is in the touch state or not according to the acquired charging time length.

In this embodiment, the touch detection device is installed inside the portable device, and if the portable device is a wearable device such as an earphone or a watch, the pad is specifically located on a surface of the portable device close to the skin of the human body, and if the portable device is a touch device such as a mobile phone or a tablet that includes a touch key, the pad is specifically located on a surface of the touch device close to the touch key.

The processor is a general-purpose processor, and the general-purpose processor comprises a general purpose GPIO pin and a TIM _ CCR pin. The resistance of the resistor is of the order of M Ω, preferably 1M Ω. The semiconductor switches are preferably NMOS switches. The power supply is preferably a dc power supply. The first capacitance is stray capacitance Cs generated between the pad and the printed circuit board, when the conductor is close to the pad, temporary capacitance Cx is generated between the conductor and the pad, and the second capacitance is Cs + Cx.

The power supply VDD is connected to the terminal a of the resistor R, and the terminal b of the resistor R is connected to the pad p. The TIM _ CCR pin is a capture function pin of a timer of the processor, and is connected to the pad p and used for reading the voltage on the pad p in real time. The D end of the NMOS switch Q is connected to a bonding pad p, the S end is connected to a ground end GND, the G end is connected to an DISCHARGER pin of the processor, the DISCHARGER pin is a general GPIO pin of the processor, and high level and low level are output alternately at set time intervals to enable the NMOS switch Q to be turned on or turned off at the time intervals.

In use, firstly, the DISCHARGER pin outputs high level to turn on the NMOS switch Q, and at this time, the voltage of the stray capacitor Cs (or Cs + Cx) is reduced to the reference voltage (i.e. 0 v), and then the DISCHARGER pin outputs low level to turn on and turn off the NMOS switch Q. At this time, the power supply VDD charges the stray capacitance Cs (or Cs + Cx) through the resistor R. During the charging process, the TIM _ CCR pin of the processor captures the voltage value of the pad p in real time, and records the charging time of the stray capacitance Cs (or Cs + Cx) rising from the reference voltage to the specified voltage Vth when the voltage on the pad reaches the specified voltage Vth. The capacitance charging and discharging formula is Vc (VDD (1-e (-t/RC)), wherein Vc is capacitance voltage, VDD is charging voltage, R is charging resistance, C is capacitance value, e is natural base number, and t is charging time.

The device is simple in components and small in occupied resource, and the wearing detection and the touch key detection can be realized only by the components. And when the device is installed, no hole needs to be formed in the shell of the equipment, and the structural integrity of the shell is reserved.

Fig. 4 is a schematic diagram illustrating an implementation effect of a touch detection device according to an embodiment of the invention.

Referring to fig. 4, when the portable device is in the untouched state, the charging curve is shown as a in the following diagram, and when the portable device is in the touched state, the human body and the pad P introduce a new capacitance Cx, and the charging curve of Cs + Cx is shown as B in the diagram, and as can be seen from the diagram, the time when the voltage on the TIM _ CCR pin reaches Vth is Tcs and Tcs + Tcx respectively.

The processor is also preset with a time length threshold value, and the time length threshold value is larger than Tcs and smaller than Tcs + Tcx. And when the charging time length does not exceed the time length threshold value, the portable equipment is determined to be in an untouched state.

In one embodiment, the device further comprises a high voltage protection element:

and a high voltage protection element connected between the variable capacitor and the ground line for preventing the device from being damaged due to the transient high voltage.

In this embodiment, the high voltage protection element is specifically a TVS tube, and an a terminal of the TVS tube is connected to the pad p, and a b terminal of the TVS tube is connected to the ground terminal GND, so as to prevent the circuit from being damaged due to an instantaneous high voltage, where the origin of the instantaneous high voltage may be generated by static electricity.

In another aspect, the present invention provides a computer-readable storage medium, which includes a set of computer-executable instructions, when executed, for performing a touch detection method according to any one of the above embodiments.

The computer-readable storage medium comprises a set of computer-executable instructions, and is applied to portable equipment, and when the instructions are executed, the instructions are used for charging and discharging the variable capacitor at intervals of a set time period; acquiring the charging time length from the reference voltage to the specified voltage of the variable capacitor in the charging state; and determining whether the portable equipment is in a touch state according to the acquired charging time length.

In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.

Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.

The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:三维电阻率原位监测探针

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!