Pen-up detection method, electronic device, and computer-readable storage medium
Patent Information
- Application Number
- CN202211430849.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2042-11-15
AI Technical Summary
[0003]现有技术的缺陷在于,轻触按键是一种成本较高的器件,在提笔检测设备中采用轻触按键将会导致设备的整体成本上升
[0015]The beneficial effects of this application are as follows: Unlike existing technologies, the technical solution of this application places the magnet and capacitor plate on one side of the housing, and sets the target pen on the other side of the housing corresponding to the position of the magnet or capacitor plate. In this structure, when the target pen is put down and lifted, the distance between the capacitor plate and other magnets or magnetic components changes, causing a change in the capacitance value of the capacitor plate itself. By processing the capacitance value or capacitance value-related data of the capacitor plate, it can be determined whether the target pen has not changed its state, has been lifted, or has been put down. Based on the above method, the state change of the target pen can be determined using only a capacitor plate, magnets, and magnetic components. The number of components used is small, reducing the cost of the pen lifting detection equipment.
Smart Images

Figure CN118051129B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technology, and in particular to pen-picking methods, electronic devices, and computer-readable storage media. Background Technology
[0002] In existing technologies, pen-lifting detection devices typically employ a touch button in conjunction with a magnet that is elastically connected to the housing via a spring. This creates a device for detecting changes in the state of the target pen. When the target pen containing the magnetic component is placed down, the magnetic component moves closer to the magnet, causing the magnet to move closer to the touch button. By checking whether the touch button is pressed, the change in the target pen's state can be determined.
[0003] The drawback of existing technology is that tactile buttons are a relatively expensive device, and using tactile buttons in pen lifting detection equipment will increase the overall cost of the equipment. Summary of the Invention
[0004] The main technical problem addressed in this application is how to reduce the cost of pen-lifting detection equipment.
[0005] To solve the above-mentioned technical problems, the first technical solution adopted in this application is: a pen-lifting detection method applied to a pen-lifting detection device, the pen-lifting detection device including a housing, a magnet, a capacitor plate, and a target pen, the magnet and the capacitor plate being located on one side of the housing, the capacitor plate being located between the magnet and the housing, and a position on the other side of the housing corresponding to the position of the magnet or the capacitor plate being used for storing the target pen, the target pen including a magnetic component; the pen-lifting detection method includes: determining the state change of the target pen based on the change in the capacitance value of the capacitor plate.
[0006] The pen lifting detection method includes the following steps before determining the state change of the target pen based on the change in capacitance value of the capacitor plate: when the target pen has not undergone a state change, acquiring the charging voltage of the capacitor plate and recording it as the initial charging voltage; the step of determining the state change of the target pen based on the change in capacitance value of the capacitor plate includes: acquiring the charging voltage of the capacitor plate and recording it as the real-time charging voltage; and judging the state change of the target pen based on the real-time charging voltage and the initial charging voltage.
[0007] The step of obtaining the charging voltage of the capacitor plate when the target pen has not changed state includes: continuously obtaining the charging voltage of the capacitor plate a preset number of times to obtain a preset number of undetermined initial charging voltages; if the difference between the maximum and minimum values of the preset number of undetermined initial charging voltages is less than a preset difference threshold, then the average value of the preset number of undetermined initial charging voltages is determined as the initial charging voltage; if the difference between the maximum and minimum values of the preset number of undetermined initial charging voltages is not less than the preset difference threshold, then the process returns to the step of continuously obtaining the charging voltage of the capacitor plate a preset number of times to obtain a preset number of undetermined initial charging voltages when the target pen has not changed state, and subsequent steps.
[0008] The step of obtaining the charging voltage of the capacitor plate, denoted as the real-time charging voltage, includes: completely discharging the capacitor plate; charging the capacitor plate with a preset voltage within a preset time period; and obtaining the voltage of the capacitor plate, denoted as the real-time charging voltage.
[0009] The steps for determining the state change of the target pen based on the real-time charging voltage and the initial charging voltage include: if the real-time charging voltage is greater than the target sum value, then the target pen is determined to be lifted; if the real-time charging voltage is less than the target difference value, then the target pen is determined to be put down; if the real-time charging voltage is not less than the target difference value and not greater than the target sum value, then the target pen has not undergone a state change of being lifted or put down; wherein, the target sum value is the sum of the initial charging voltage and the preset error, and the target difference value is the difference between the initial charging voltage and the preset error.
[0010] Among them, after determining that the target pen has been lifted or put down, the process returns to the step of obtaining the charging voltage of the capacitor plate and recording it as the initial charging voltage when the target pen has not changed state, and then proceeds to the subsequent steps.
[0011] The pen-lifting detection device also includes a spring; the magnet is elastically connected to the housing via the spring, and the capacitor plate is fixedly connected to the housing.
[0012] The pen-lifting detection device also includes a spring, and the housing is a non-magnetic metal housing; the magnet is elastically connected to the housing via the spring, and the capacitor plate is fixedly connected to the magnet.
[0013] To solve the above-mentioned technical problems, the second technical solution adopted in this application is: an electronic device, including: a memory and a processor; the memory is used to store program instructions, and the processor is used to execute the program instructions to implement the above-mentioned method.
[0014] To solve the above-mentioned technical problems, the third technical solution adopted in this application is: a computer-readable storage medium storing program instructions, which implement the above-mentioned method when executed by a processor.
[0015] The beneficial effects of this application are as follows: Unlike existing technologies, the technical solution of this application places the magnet and capacitor plate on one side of the housing, and sets the target pen on the other side of the housing corresponding to the position of the magnet or capacitor plate. In this structure, when the target pen is put down and lifted, the distance between the capacitor plate and other magnets or magnetic components changes, causing a change in the capacitance value of the capacitor plate itself. By processing the capacitance value or capacitance value-related data of the capacitor plate, it can be determined whether the target pen has not changed its state, has been lifted, or has been put down. Based on the above method, the state change of the target pen can be determined using only a capacitor plate, magnets, and magnetic components. The number of components used is small, reducing the cost of the pen lifting detection equipment. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of the structure of the first embodiment of the pen-picking device of this application;
[0018] Figure 2 This is one of the structural schematic diagrams of the second embodiment of the pen-picking detection device of this application;
[0019] Figure 3 This is the second structural schematic diagram of the second embodiment of the pen-picking detection device of this application;
[0020] Figure 4 This is one of the structural schematic diagrams of the third embodiment of the pen-picking detection device of this application;
[0021] Figure 5 This is the second structural schematic diagram of the third embodiment of the pen-picking detection device of this application;
[0022] Figure 6 This is a flowchart illustrating one embodiment of the pen-picking detection method of this application;
[0023] Figure 7 This is a schematic diagram of the structure of an embodiment of the electronic device of this application;
[0024] Figure 8 This is a schematic diagram of an embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0025] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the application. Similarly, the following embodiments are only some, not all, embodiments of the present application, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present application.
[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0027] In the description of this application, it is necessary to specify that, unless otherwise expressly stated and limited, the terms "installation," "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or a connection through an intermediate medium. Those skilled in the art will understand the specific meanings of the above terms within the context of this application.
[0028] This application first proposes a pen-lifting detection method, applied to a pen-lifting detection device, see [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram of the structure of the first embodiment of the pen-lifting detection device of this application, as shown below. Figure 1 As shown, the pen detection device includes a housing 11, a magnet 12, a capacitor plate 13, and a target pen 14. The magnet 12 and the capacitor plate 13 are located on one side of the housing 11, and the capacitor plate 13 is located between the magnet 12 and the housing 11. The other side of the housing 11 has a position corresponding to the position of the magnet 12 or the capacitor plate 13 for storing the target pen 14. The target pen 14 includes a magnetic component 141.
[0029] Pen-picking detection methods include:
[0030] Based on the change in capacitance value of capacitor plate 13, determine the state change of target pen 14.
[0031] Specifically, the formula for calculating the capacitance value of capacitor plate 13 is as follows:
[0032]
[0033] In equation (1), C is the capacitance of capacitor plate 13, ε is the dielectric constant, S is the area of the plate, and d is the distance between the two plates of capacitor plate 13.
[0034] In the first case, by Figure 1 As can be seen from the pen-lifting detection device shown, both the magnet 12 and the capacitor plate 13 can be fixedly connected to the housing 11. When the target pen 14 is lifted or put down, the distance between the magnetic element 141 and the capacitor plate 13 inside the target pen 14 will also change. Specifically, the magnetic element 141 moving away from the capacitor plate 13 is equivalent to the distance between the two plates in the capacitor plate 13 increasing, and the magnetic element 141 moving closer to the capacitor plate 13 is equivalent to the distance between the two plates in the capacitor plate 13 decreasing.
[0035] In the second case, see Figure 2 and Figure 3 , Figure 2 This is one of the structural schematic diagrams of the second embodiment of the pen-picking detection device of this application. Figure 3 This is the second structural schematic diagram of the second embodiment of the pen-picking detection device of this application, consisting of... Figure 2 and Figure 3 As shown in the pen-lifting detection device, the magnet 12 is elastically connected to the housing 11 via the spring 15, and the capacitor plate 13 is fixedly connected to the housing 11. Figure 2 As shown, when the capacitive stylus 14 is lifted, the magnet 12 moves away from the capacitor plate 13 due to the elastic force of the spring 15. Figure 3 As shown, when the capacitive pen 14 is put down, the magnetic element 12 moves closer to the capacitor plate 13 due to the elastic force of the spring element 15. The magnetic element 141 moving away from the capacitor plate 13 is equivalent to the distance between the two plates in the capacitor plate 13 increasing, and the magnetic element 141 moving closer to the capacitor plate 13 is equivalent to the distance between the two plates in the capacitor plate 13 decreasing.
[0036] In the third case, see Figure 4 and Figure 5 , Figure 4 This is one of the structural schematic diagrams of the third embodiment of the pen-picking detection device of this application. Figure 5 This is the second structural schematic diagram of the third embodiment of the pen-picking detection device of this application, consisting of... Figure 4 and Figure 5 As shown in the pen-lifting detection device, the magnet 12 is elastically connected to the housing 11 via a spring 15, the capacitor plate 13 is fixedly connected to the magnet 12, and the housing 11 is a non-magnetic metal housing. Figure 4 As shown, when the capacitive pen 14 is lifted, the capacitor plate 13 moves away from the metal casing due to the elastic force of the spring 15, as... Figure 5 As shown, when the capacitive pen 14 is put down, the capacitor plate 13 moves closer to the metal shell due to the elastic force of the spring member 15. The metal shell moving away from the capacitor plate 13 is equivalent to the distance between the two plates in the capacitor plate 13 increasing, and the metal shell moving closer to the capacitor plate 13 is equivalent to the distance between the two plates in the capacitor plate 13 decreasing.
[0037] Increasing the distance between the two plates will decrease the capacitance of capacitor plate 13, while decreasing the distance between the two plates will increase the capacitance of capacitor plate 13.
[0038] Based on the above method, the state change of the target pen 14 can be determined by determining the change in the capacitance value of the capacitor plate 13 when the target pen 14 is lifted, put down, or does not change state.
[0039] Specifically, the capacitor board 13 may include a PCB substrate and two PCB traces disposed on the PCB substrate. The two PCB traces are equivalent to the two plates of a capacitor. There is a parasitic capacitance between the two PCB traces, and the capacitance value of the parasitic capacitance is the capacitance value of the capacitor board 13.
[0040] Unlike existing technologies, the technical solution of this application places the magnet and capacitor plate on one side of the housing, and sets the target pen on the other side of the housing corresponding to the position of the magnet or capacitor plate. With this structure, when the target pen is put down and lifted, the distance between the capacitor plate and other magnets or magnetic components changes, causing a change in the capacitance value of the capacitor plate itself. By processing the capacitance value or capacitance-related data of the capacitor plate, it can be determined whether the target pen has not changed its state, has been lifted, or has been put down. Based on this method, the state change of the target pen can be determined using only a capacitor plate, magnets, and magnetic components, reducing the number of components used and lowering the cost of the pen lifting detection equipment.
[0041] Furthermore, compared to traditional pen-lifting detection devices that use tactile buttons, the above method avoids detection errors caused by poor matching between the tactile buttons and the corresponding springs, and also avoids detection errors caused by oxidation of the tactile buttons themselves, thus improving the accuracy and reliability of pen-lifting detection.
[0042] In one embodiment, see Figure 6 , Figure 6 This is a flowchart illustrating one embodiment of the pen-picking detection method of this application, as shown below. Figure 6 As shown, before the step of determining the state change of the target pen 14 based on the change in capacitance value of capacitor plate 13, the pen lifting detection method includes:
[0043] Step S11: When the target pen 14 has not changed state, obtain the charging voltage of the capacitor plate 13 and record it as the initial charging voltage.
[0044] When the target pen 14 is placed on the other side of the housing 11 at a position corresponding to the position of the magnet 12 or the capacitor plate 13, it can be determined that the target pen 14 has not changed its state. The voltage value of the capacitor plate 13 after being fully discharged and charged for a preset time can be determined as the initial charging voltage. This initial charging voltage is used as a comparison benchmark for subsequent voltage comparison.
[0045] The steps for determining the state change of the target pen 14 based on the change in capacitance value of capacitor plate 13 include:
[0046] Step S12: Obtain the charging voltage of capacitor plate 13 and record it as the real-time charging voltage.
[0047] The voltage value after the capacitor plate 13 has been fully discharged and charged for a preset time interval can be determined as the real-time charging voltage.
[0048] Step S13: Determine the state change of the target pen 14 based on the real-time charging voltage and the initial charging voltage.
[0049] Since the charging efficiency of capacitor plate 13 decreases when the capacitance value increases, and increases when the capacitance value decreases, by comparing the real-time charging voltage with the initial charging voltage and determining the capacitance value change of capacitor plate 13 based on the comparison result, it is possible to determine whether the target pen 14 has not changed its state, has been lifted, or has been put down based on the capacitance value change.
[0050] Based on the above method, it is possible to detect the state changes of the target pen 14 in real time by using simple devices such as magnet 12, capacitor plate 13, and target pen 14. This reduces the cost and difficulty of pen lifting detection. Furthermore, since the devices and methods involved are relatively simple, they are less prone to failure, thus improving the reliability of pen lifting detection.
[0051] Specifically, after determining that the target pen 14 has been lifted and put down, the process returns to the step of obtaining the charging voltage of the capacitor plate 13 when the target pen 14 has not changed state, and recording it as the initial charging voltage, and then proceeds to the subsequent steps.
[0052] Based on the above method, the initial charging voltage of the capacitor plate 13 can be re-acquired and updated after the target pen 14 is lifted and put down by the user. This allows for timely updates of the initial charging voltage of the capacitor plate 13 when the target pen 14 has not changed state, after the charging voltage of the capacitor plate 13 and its related components changes due to the lifting and putting down of the target pen 14. This avoids misjudging the state change of the target pen 14 due to the untimely update of the initial charging voltage, thus improving the accuracy of pen lifting detection.
[0053] Optionally, step S11 may specifically include:
[0054] When the target pen 14 does not change state, the charging voltage of the capacitor plate 13 is continuously acquired a preset number of times to obtain a preset number of undetermined initial charging voltages.
[0055] If the difference between the maximum and minimum values among the preset number of undetermined initial charging voltages is less than a preset difference threshold, then the average value of the preset number of undetermined initial charging voltages is determined as the initial charging voltage.
[0056] If the difference between the maximum and minimum values among the preset number of undetermined initial charging voltages is not less than the preset difference threshold, then return to the step of continuously acquiring the charging voltage of the capacitor plate 13 a preset number of times to obtain the preset number of undetermined initial charging voltages while the target pen 14 has not changed state, and the subsequent steps.
[0057] Specifically, the pen-lifting detection device may also include a processing module (e.g., a microcontroller unit), with the input and output terminals of the processing module connected to one of the two plates of the capacitor plate 13, and the other plate of the capacitor plate 13 grounded.
[0058] During the process of acquiring the charging voltage of capacitor plate 13 in a single operation (such as the initial charging voltage to be determined or other charging voltages), the input and output terminals of the processing module can first be controlled to enter the output mode and output a low-level signal to completely discharge capacitor plate 13. Then, the input and output terminals of the processing module can be made to output a high-level signal to charge capacitor plate 13 for a preset time. Finally, the input and output terminals of the processing module can be controlled to enter the input mode to detect the voltage of capacitor plate 13 and determine the charging voltage of capacitor plate 13 at this time.
[0059] Based on the above method, the charging voltage of the capacitor plate 13 can be continuously obtained a preset number of times to obtain a preset number of initial charging voltages to be determined.
[0060] If the difference between the maximum and minimum values among the preset number of undetermined initial charging voltages is less than the preset difference threshold, then the capacitance value of capacitor plate 13 can be considered to be in a stable state, and the accuracy of the obtained charging voltage is relatively high. At this time, the average value of the preset number of undetermined initial charging voltages can be determined as the initial charging voltage.
[0061] If the difference between the maximum and minimum values among the preset number of undetermined initial charging voltages is not less than the preset difference threshold, it can be considered that the capacitance value of capacitor plate 13 is in an unstable state and the error rate of the obtained charging voltage is high. At this time, the process can be returned to the step of continuously acquiring the charging voltage of capacitor plate 13 a preset number of times when the target pen 14 has not changed state, so as to obtain a preset number of undetermined initial charging voltages and subsequent steps, and a new batch of undetermined initial charging voltages can be acquired in order to determine the initial charging voltage.
[0062] Based on the above method, it is possible to avoid determining the initial charging voltage of capacitor plate 13 before the capacitance value of capacitor plate 13 has stabilized, thereby obtaining an incorrect charging voltage and causing errors in subsequent pen lifting detection, thus improving the accuracy of pen lifting detection.
[0063] Optionally, step S12 may specifically include:
[0064] Completely discharge capacitor plate 13.
[0065] The capacitor plate 13 is charged with a preset voltage within a preset time period.
[0066] Obtain the voltage of capacitor plate 13 and record it as the real-time charging voltage.
[0067] Specifically, the pen-lifting detection device may also include a processing module (e.g., a microcontroller unit), with the input and output terminals of the processing module connected to one of the two plates of the capacitor plate 13, and the other plate of the capacitor plate 13 grounded.
[0068] During the process of acquiring the charging voltage (such as real-time charging voltage or other charging voltage) of capacitor plate 13 in a single operation, the input and output terminals of the processing module can first be controlled to enter the output mode and output a low-level signal to completely discharge capacitor plate 13. Then, the input and output terminals of the processing module can be made to output a high-level signal to charge capacitor plate 13 for a preset duration. Finally, the input and output terminals of the processing module can be controlled to enter the input mode to detect the voltage of capacitor plate 13 and determine the charging voltage of capacitor plate 13 at this time.
[0069] Based on the above method, it is possible to ensure the uniformity of charging time and charging base voltage when acquiring each real-time charging voltage, thereby improving the reliability of the obtained real-time charging voltage and thus improving the accuracy and reliability of the subsequent determination of the state change of the target pen 14 based on the comparison between the real-time charging voltage and the initial charging voltage.
[0070] Optionally, step S13 may specifically include:
[0071] If the real-time charging voltage is greater than the target value, then it is determined that the target pen 14 has been lifted.
[0072] If the real-time charging voltage is less than the target difference, then it is determined that the target pen 14 has been put down.
[0073] If the real-time charging voltage is not less than the target difference and not greater than the target sum, then it is determined that the target pen 14 has not undergone any state change of being lifted or lowered.
[0074] The target sum is the sum of the initial charging voltage and the preset error, and the target difference is the difference between the initial charging voltage and the preset error.
[0075] Specifically, if the real-time charging voltage is greater than the target value, it can be determined that the charging efficiency of the capacitor plate 13 has increased, and then it can be inferred that the capacitance value of the capacitor plate 13 has decreased. Based on equation (1), it can be known that d increases at this time, and thus it can be determined that the target pen 14 has been lifted.
[0076] If the real-time charging voltage is less than the target value, it can be determined that the charging efficiency of the capacitor plate 13 has decreased, and it can be inferred that the capacitance value of the capacitor plate 13 has increased. Based on equation (1), it can be known that d decreases at this time, so it can be determined that the target pen 14 has been put down.
[0077] If the real-time charging voltage is not less than the target difference and not greater than the target sum, it can be determined that the charging efficiency of the capacitor plate 13 has not changed significantly, and it can be inferred that the capacitance value of the capacitor plate 13 has not changed significantly. Based on equation (1), it can be known that d has not changed significantly at this time, so it can be determined that the target pen 14 has not changed its state of being lifted or lowered.
[0078] Based on the above method, it is possible to determine whether the capacitance value of the capacitor plate 13 has changed by comparing the real-time charging voltage with the initial charging voltage, and further determine whether the target pen 14 has not changed its state of being lifted or put down, or has been lifted or put down, based on the change in capacitance value. This achieves accurate judgment of the three states, ensuring the accuracy and reliability of pen lifting detection while using only simple components to construct the pen lifting detection device.
[0079] This application also proposes an electronic device, such as Figure 7 As shown, Figure 7 This is a schematic diagram of the structure of an embodiment of the electronic device of this application. The electronic device 20 includes: a processor 21, a memory 22, and a bus 23.
[0080] The processor 21 and the memory 22 are respectively connected to the bus 23. The memory 22 stores program instructions, and the processor 21 is used to execute the program instructions to implement the pen lifting detection method in the above embodiment.
[0081] In this embodiment, processor 21 can also be referred to as CPU (Central Processing Unit). Processor 21 may be an integrated circuit chip with signal processing capabilities. Processor 21 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor, or processor 21 can be any conventional processor.
[0082] Unlike existing technologies, the technical solution of this application places the magnet and capacitor plate on one side of the housing, and sets the target pen on the other side of the housing corresponding to the position of the magnet or capacitor plate. With this structure, when the target pen is put down and lifted, the distance between the capacitor plate and other magnets or magnetic components changes, causing a change in the capacitance value of the capacitor plate itself. By processing the capacitance value or capacitance-related data of the capacitor plate, it can be determined whether the target pen has not changed its state, has been lifted, or has been put down. Based on this method, the state change of the target pen can be determined using only a capacitor plate, magnets, and magnetic components, reducing the number of components used and lowering the cost of the pen lifting detection equipment.
[0083] This application also proposes a computer-readable storage medium, such as Figure 8 As shown, Figure 8 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of this application. The computer-readable storage medium 30 stores program instructions 31 thereon. When the program instructions 31 are executed by a processor (not shown), they implement the pen-lifting detection method in the above embodiment.
[0084] In this embodiment, the computer-readable storage medium 30 may be, but is not limited to, a USB flash drive, SD card, PD optical drive, portable hard drive, high-capacity floppy drive, flash memory, multimedia memory card, storage unit in a server, FPGA, or ASIC, etc.
[0085] Unlike existing technologies, the technical solution of this application places the magnet and capacitor plate on one side of the housing, and sets the target pen on the other side of the housing corresponding to the position of the magnet or capacitor plate. With this structure, when the target pen is put down and lifted, the distance between the capacitor plate and other magnets or magnetic components changes, causing a change in the capacitance value of the capacitor plate itself. By processing the capacitance value or capacitance-related data of the capacitor plate, it can be determined whether the target pen has not changed its state, has been lifted, or has been put down. Based on this method, the state change of the target pen can be determined using only a capacitor plate, magnets, and magnetic components, reducing the number of components used and lowering the cost of the pen lifting detection equipment.
[0086] In the description of this application, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0087] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0088] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0089] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (which may be a personal computer, server, network device, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0090] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A pen-lifting detection method, characterized in that, An application is made in a pen-lifting detection device, which includes a housing, a magnet, a capacitor plate, and a target pen. The magnet and the capacitor plate are located on one side of the housing, and the capacitor plate is located between the magnet and the housing. On the other side of the housing, a position corresponding to the position of the magnet or the capacitor plate is used to store the target pen, which includes a magnetic component. The pen-lifting detection method includes: Based on the change in capacitance value of the capacitor plate, the state change of the target pen is determined; Prior to the step of determining the state change of the target pen based on the change in capacitance value of the capacitor plate, the pen lifting detection method includes: When the target pen does not change state, the charging voltage of the capacitor plate is obtained and recorded as the initial charging voltage; The step of determining the state change of the target pen based on the change in capacitance value of the capacitor plate includes: The charging voltage of the capacitor plate is obtained and recorded as the real-time charging voltage; Based on the real-time charging voltage and the initial charging voltage, the state change of the target pen is determined; The step of determining the state change of the target pen based on the real-time charging voltage and the initial charging voltage includes: If the real-time charging voltage is greater than the target value, then it is determined that the target pen has been lifted; If the real-time charging voltage is less than the target difference, then it is determined that the target pen has been put down; If the real-time charging voltage is not less than the target difference and not greater than the target sum, then it is determined that the target pen has not undergone a change in state of being lifted or lowered. Wherein, the target sum is the sum of the initial charging voltage and the preset error, and the target difference is the difference between the initial charging voltage and the preset error.
2. The pen-lifting detection method according to claim 1, characterized in that, The step of obtaining the charging voltage of the capacitor plate when the target pen does not undergo a state change includes: The charging voltage of the capacitor plate is continuously acquired a preset number of times to obtain the preset number of initial charging voltages to be determined. If the difference between the maximum and minimum values among the preset number of undetermined initial charging voltages is less than a preset difference threshold, then the average value of the preset number of undetermined initial charging voltages is determined as the initial charging voltage. If the difference between the maximum and minimum values among the preset number of undetermined initial charging voltages is not less than a preset difference threshold, then the process returns to the step of continuously acquiring the charging voltage of the capacitor plate a preset number of times to obtain the preset number of undetermined initial charging voltages while the target pen has not undergone a state change, and subsequent steps.
3. The pen-lifting detection method according to claim 1, characterized in that, The step of obtaining the charging voltage of the capacitor plate and recording it as the real-time charging voltage includes: The capacitor plate is completely discharged; The capacitor plate is charged with a preset voltage within a preset time period; The voltage of the capacitor plate is obtained and recorded as the real-time charging voltage.
4. The pen-lifting detection method according to claim 1, characterized in that, After determining that the target pen has been lifted or put down, return to the step of obtaining the charging voltage of the capacitor plate when the target pen has not changed state, and recording it as the initial charging voltage, and the subsequent steps.
5. The pen-lifting detection method according to any one of claims 1 to 4, characterized in that, The pen-lifting detection device also includes a spring; The magnet is elastically connected to the housing via the spring, and the capacitor plate is fixedly connected to the housing.
6. The pen-lifting detection method according to any one of claims 1 to 4, characterized in that, The pen-lifting detection device also includes a spring, and the housing is a non-magnetic metal housing; The magnet is elastically connected to the housing via the spring, and the capacitor plate is fixedly connected to the magnet.
7. An electronic device, characterized in that, include: Memory and processor; The memory is used to store program instructions, and the processor is used to execute the program instructions to implement the method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Electronic equipment and control method
CN111897445A