A method and device for detecting the state of a touch writing pen based on a Hall sensor
Through the Hall sensor-based touch pen status detection method, the level value of each pin is obtained, and the accurate detection and home reminder of the status of multiple touch pens is achieved, which solves the problem of inaccurate detection of multiple touch pen status in the prior art, and improves the user experience.
Patent Information
- Application Number
- CN202211099956.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-09-07
AI Technical Summary
The existing touch all-in-one machine only supports the detection of a single touch stylus pen, and cannot accurately detect the lifting or dropping status of multiple touch stylus pens, and lacks the reminder function of the touch stylus home.
The touch pen status detection method based on Hall sensor is adopted. By obtaining the pin level value of each Hall sensor, the initialization and current status of each touch pen are judged, and the status of multiple touch pens is detected, and the user is provided with a tip for picking up and home reminder when necessary.
Improves the accuracy of status detection of multiple touch pens, ensuring that touch pens can be properly relocated and reduces the risk of loss or damage.
Smart Images

Figure CN115900519B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of stylus state detection, and particularly to a method and device for detecting the state of a touch writing pen based on a Hall sensor. Background Art
[0002] Currently, a touch all-in-one machine is equipped with a touch writing pen, but the touch writing pen needs to be placed in a pen holder specially set on the body of the all-in-one machine so that users can conveniently pick up the pen for touch writing. And currently, the touch all-in-one machine only supports the detection of a single touch writing pen. For multiple touch writing pens, when detecting the picking up or putting down of multiple touch writing pens, it cannot support detecting which pen in which pen holder is picked up or put down, and for the used touch writing pen, it does not support the function of reminding the touch writing pen to return to its place. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a method and device for detecting the state of a touch writing pen based on a Hall sensor, which can realize the detection of the states of multiple touch writing pens and improve the accuracy of detecting the states of multiple touch writing pens.
[0004] To solve the above technical problem, the present invention provides a method for detecting the state of a touch writing pen based on a Hall sensor, including:
[0005] When receiving a touch writing pen state detection instruction, obtain the initialization level value of each pin corresponding to each Hall sensor, and according to the initialization level value, obtain the initialization state of each touch writing pen;
[0006] Obtain the level value of each pin, and according to the level value, obtain the current state of each touch writing pen;
[0007] Judge whether the current state is the same as the corresponding initialization state. If so, judge that the state of the touch writing pen has not changed. If not, judge that the state of the touch writing pen has changed, and use the current state as the corresponding initialization state, and return to the step of "obtaining the level value of each pin" until receiving a stop touch writing pen state detection instruction.
[0008] In a possible implementation manner, the method for detecting the state of a touch writing pen based on a Hall sensor provided by an embodiment of the present invention further includes:
[0009] When receiving a connection configuration detection instruction, judge whether each touch writing pen is placed at a different Hall sensor position. If so, obtain the pin level value of each pin;
[0010] Send a pen-lifting prompt to the user, and when it is detected that the user successively lifts the touch pen on the to-be-configured Hall sensor, obtain the current pin level value of each pin;
[0011] Compare the pin level value of each pin with the current pin level value, obtain the pins to be detected where the pin level value is different from the current pin level value, and establish a connection configuration relationship between the to-be-configured Hall sensor and the to-be-configured pins.
[0012] In a possible implementation manner, a method for detecting the state of a touch pen based on a Hall sensor provided by an embodiment of the present invention further includes:
[0013] When the touch pen is in the pen-lifting state, perform touch point detection on the writing screen;
[0014] When no touch point is detected on the writing screen, record the no-touch duration to obtain the no-touch time, and determine whether the no-touch time is greater than a preset no-touch time threshold. If so, initiate a pen-return reminder to the user. If not, return to the step of "performing touch point detection on the writing screen";
[0015] When a touch point is detected on the writing screen, clear the no-touch time and return to the step of "performing touch point detection on the writing screen".
[0016] In a possible implementation manner, obtaining the current state of each touch pen according to the level value specifically includes:
[0017] When the level value is low, obtain that the current state of the touch pen is the pen-lifting state;
[0018] When the level value is high, obtain that the current state of the touch pen is the pen-putting state.
[0019] In a possible implementation manner, before obtaining the initialization level value of each pin corresponding to each Hall sensor, it further includes:
[0020] Set multiple Hall sensors, set corresponding pins for each Hall sensor, and establish a connection relationship between each Hall sensor and the corresponding pins.
[0021] An embodiment of the present invention further provides a device for detecting the state of a touch pen based on a Hall sensor, including: a touch pen state detection module, where the touch pen state detection module includes an initialization state detection unit, a current state detection unit, and a state change detection unit;
[0022] The initialization state detection unit is used to obtain the initialization level value of each pin corresponding to each Hall sensor when receiving a touch pen state detection instruction, and obtain the initialization state of each touch pen according to the initialization level value;
[0023] The current state detection unit is used to obtain the level value of each pin, and obtain the current state of each touch pen according to the level value;
[0024] The state change detection unit is used to determine whether the current state is the same as the corresponding initialization state. If so, it is determined that the state of the touch pen has not changed. If not, it is determined that the state of the touch pen has changed, and the current state is used as the corresponding initialization state, and the step of "obtaining the level value of each pin" is returned until a stop touch pen state detection instruction is received.
[0025] In a possible implementation manner, a touch pen state detection device based on Hall sensors provided in an embodiment of the present invention further includes: a connection configuration detection module, where the connection configuration detection module includes a pin level detection unit, a current pin level detection unit, and a connection configuration state detection unit;
[0026] The pin level detection unit is used to determine whether each touch pen is placed at different Hall sensor positions when receiving a connection configuration detection instruction. If so, obtain the pin level value of each pin;
[0027] The current pin level detection unit is used to send a touch pen lifting prompt to the user, and obtain the current pin level value of each pin when detecting that the user successively lifts the touch pens on the Hall sensors to be configured;
[0028] The connection configuration unit is used to compare the pin level value and the current pin level value of each pin, obtain the pins to be detected whose pin level value and current pin level value are different, and establish a connection relationship between the Hall sensor to be configured and the pins to be configured.
[0029] In a possible implementation manner, a touch pen state detection device based on Hall sensors provided in an embodiment of the present invention further includes: a touch pen return reminder module, where the touch pen return reminder module includes a touch point detection unit, a no-touch time recording unit, and a no-touch time clearing unit;
[0030] The touch point detection unit is used to perform touch point detection on the writing screen when the touch pen is in the lifted state;
[0031] The touchless time recording unit is used to record the touchless duration when no touch point is detected on the writing screen, obtain the touchless time, and determine whether the touchless time is greater than a preset touchless time threshold. If so, a reminder for the touch pen to return to its position is sent to the user. If not, the process returns to the step of "detecting touch points on the writing screen".
[0032] The touchless time clearing unit is used to clear the touchless time when a touch point is detected on the writing screen, and return to the step of "detecting touch points on the writing screen".
[0033] In a possible implementation manner, the current state detection unit is used to obtain the current state of each touch pen according to the level value, specifically including:
[0034] When the level value is low, it is obtained that the current state of the touch pen is the pen-lifted state;
[0035] When the level value is high, it is obtained that the current state of the touch pen is the pen-down state.
[0036] In a possible implementation manner, before obtaining the initialization level value of each pin corresponding to each Hall sensor, it further includes: a connection unit;
[0037] The connection unit is used to set multiple Hall sensors, set corresponding pins for each Hall sensor, and establish a connection relationship between each Hall sensor and the corresponding pin.
[0038] An embodiment of the present invention further provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the method for detecting the state of a touch pen based on a Hall sensor as described in any one of the above.
[0039] An embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the method for detecting the state of a touch pen based on a Hall sensor as described in any one of the above.
[0040] A method and device for detecting the state of a touch pen based on a Hall sensor according to an embodiment of the present invention have the following beneficial effects compared with the prior art:
[0041] When receiving a touch pen state detection instruction, based on the connection relationship between the Hall sensors and the pins, obtain the initialization level value of each pin corresponding to each Hall sensor, and according to the initialization level value, obtain the initialization state of each touch pen; obtain the level value of each pin in real time, and according to the level value, obtain the current state of each touch pen; based on judging the current state of each touch pen and the initialization state of the corresponding touch pen, based on the judgment result, detect the state change of each touch pen until receiving a stop touch pen state detection instruction. Compared with the prior art, the technical solution of the present invention can realize the detection of the states of multiple touch pens and improve the accuracy of detecting the states of multiple touch pens. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a schematic flowchart of an embodiment of a method for detecting the state of a touch pen based on a Hall sensor provided by the present invention;
[0043] Figure 2 is a schematic flowchart of another embodiment of a method for detecting the state of a touch pen based on a Hall sensor provided by the present invention;
[0044] Figure 3 is a schematic structural diagram of an embodiment of a device for detecting the state of a touch pen based on a Hall sensor provided by the present invention;
[0045] Figure 4 is a schematic structural diagram of another embodiment of a device for detecting the state of a touch pen based on a Hall sensor provided by the present invention;
[0046] Figure 5 is a schematic diagram of the placement positions of the Hall sensors and pins of an embodiment provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0048] Embodiment 1
[0049] See Figure 1 , Figure 1 is a schematic flowchart of an embodiment of a method for detecting the state of a touch pen based on a Hall sensor provided by the present invention. As shown in Figure 1 shown, the method includes steps 101 - 103, specifically as follows:
[0050] Step 101: When receiving a touch pen state detection instruction, obtain the initialization level value of each pin corresponding to each Hall sensor, and obtain the initialization state of each touch pen according to the initialization level value.
[0051] In one embodiment, first set multiple Hall sensors, set corresponding pins for each Hall sensor, and establish a connection relationship between each Hall sensor and the corresponding pin.
[0052] As a preferred solution in this embodiment, set the number of Hall sensors to four, namely the first Hall sensor, the second Hall sensor, the third Hall sensor, and the fourth Hall sensor; when the number of Hall sensors is set to four, the number of corresponding pins is set to four, namely the first pin, the second pin, the third pin, and the fourth pin; among them, multiple Hall sensors are arranged at the front panel of the all-in-one machine, and multiple pins are arranged on the main board of the all-in-one machine, as Figure 5 shown Figure 5 is a schematic diagram of the placement positions of the Hall sensors and pins.
[0053] Specifically, connect the first Hall sensor to the first pin, connect the second Hall sensor to the second pin, connect the third Hall sensor to the third pin, and connect the fourth Hall sensor to the fourth pin.
[0054] In one embodiment, the number of multiple Hall sensors can be set based on the number of touch pens of the all-in-one machine, and one Hall sensor is set for each touch pen for subsequent touch pen state detection.
[0055] Preferably, multiple touch pens are set on the all-in-one machine, and for each touch pen, set its tip size to be different.
[0056] In one embodiment, after establishing a connection relationship between multiple Hall sensors and the corresponding pins, receive instructions from the all-in-one machine in real time.
[0057] In one embodiment, when receiving a touch pen state detection instruction, obtain the initialization level value of each pin corresponding to each Hall sensor based on the set number of Hall sensors.
[0058] In one embodiment, the detection principle of detecting the state of the touch writing pen based on the connection relationship between the Hall sensor and the pin is as follows: when the touch writing pen approaches or moves away from the Hall sensor, the Hall sensor will change the level state of the pin. Based on the program to detect the level state of the pin to determine whether the touch writing pen is in the pen-up state or the pen-down state. For example, when the touch writing pen approaches the Hall sensor, the Hall sensor will raise the level state of the pin, and at this time, the detected level state of the pin is high level; when the touch writing pen leaves the Hall sensor by a certain distance, the Hall sensor will lower the level state of the pin, and at this time, the detected level state of the pin is low level.
[0059] Preferably, the relationship between the state of the touch writing pen and the level state of the pin can also be set as follows: when the touch writing pen approaches the Hall sensor, the Hall sensor will lower the level state of the pin, and at this time, the detected level state of the pin is low level; when the touch writing pen leaves the Hall sensor by a certain distance, the Hall sensor will raise the level state of the pin, and at this time, the detected level state of the pin is high level.
[0060] Preferably, when the number of the Hall sensors is four, obtain the first initialization level value of the first pin, and based on the first initialization level value, obtain the first initialization state of the first touch writing pen; obtain the second initialization level value of the second pin, and based on the second initialization level value, obtain the second initialization state of the second touch writing pen; obtain the third initialization level value of the third pin, and based on the third initialization level value, obtain the third initialization state of the third touch writing pen; obtain the fourth initialization level value of the fourth pin, and based on the fourth initialization level value, obtain the fourth initialization state of the fourth touch writing pen.
[0061] In one embodiment, when the initial level value is low level, the obtained initialization state of the touch writing pen is the pen-up state; when the initial level value is high level, the obtained initialization state of the touch writing pen is the pen-down state.
[0062] Preferably, when the first initialization level value is low, the first initialization state of the first touch writing pen is obtained as the pen-up state; when the first initialization level value is high, the first initialization state of the first touch writing pen is obtained as the pen-down state; when the second initialization level value is low, the second initialization state of the second touch writing pen is obtained as the pen-up state; when the second initialization level value is high, the second initialization state of the second touch writing pen is obtained as the pen-down state; when the third initialization level value is low, the third initialization state of the third touch writing pen is obtained as the pen-up state; when the third initialization level value is high, the second initialization state of the third touch writing pen is obtained as the pen-down state; when the fourth initialization level value is low, the fourth initialization state of the fourth touch writing pen is obtained as the pen-up state; when the fourth initialization level value is high, the fourth initialization state of the fourth touch writing pen is obtained as the pen-down state.
[0063] Step 102: Obtain the level value of each pin, and based on the level value, obtain the current state of each touch writing pen.
[0064] In an embodiment, based on the obtained level value of each pin, the current state of each corresponding touch writing pen is obtained; when the level value is low, the current state of the touch writing pen is obtained as the pen-up state; when the level value is high, the current state of the touch writing pen is obtained as the pen-down state.
[0065] Preferably, when the first level value of the first pin is low, the first current state of the first touch writing pen is obtained as the pen-up state; when the first level value is high, the first current state of the first touch writing pen is obtained as the pen-down state; when the second level value of the second pin is low, the second current state of the second touch writing pen is obtained as the pen-up state; when the second level value is high, the second current state of the second touch writing pen is obtained as the pen-down state; when the first level value of the third pin is low, the third current state of the third touch writing pen is obtained as the pen-up state; when the third level value is high, the third current state of the third touch writing pen is obtained as the pen-down state; when the fourth level value of the fourth pin is low, the fourth current state of the fourth touch writing pen is obtained as the pen-up state; when the fourth level value is high, the fourth current state of the fourth touch writing pen is obtained as the pen-down state.
[0066] Step 103: Determine whether the current state is the same as the corresponding initialization state. If so, determine that the state of the touch writing pen has not changed. If not, determine that the state of the touch writing pen has changed, and use the current state as the corresponding initialization state, and return to the step of "obtaining the level value of each pin" until a stop touch writing pen state detection instruction is received.
[0067] In one embodiment, after obtaining the initialization state of the touch writing pen in step 101 and obtaining the current state of the touch writing pen in step 102, based on comparing the initialization state and the current state, the change state of the touch writing pen is obtained.
[0068] Preferably, determine whether the first current state is the same as the first initialization state. If so, determine that the state of the first touch writing pen has not changed. If not, determine that the state of the first touch writing pen has changed, and use the first current state as the first initialization state, and return to the step of "obtaining the first level value of the first pin" in step 102.
[0069] Preferably, determine whether the second current state is the same as the second initialization state. If so, determine that the state of the second touch writing pen has not changed. If not, determine that the state of the second touch writing pen has changed, and use the second current state as the second initialization state, and return to the step of "obtaining the second level value of the second pin" in step 102.
[0070] Preferably, determine whether the third current state is the same as the third initialization state. If so, determine that the state of the third touch writing pen has not changed. If not, determine that the state of the third touch writing pen has changed, and use the third current state as the third initialization state, and return to the step of "obtaining the third level value of the third pin" in step 102.
[0071] Preferably, determine whether the fourth current state is the same as the fourth initialization state. If so, determine that the state of the fourth touch writing pen has not changed. If not, determine that the state of the fourth touch writing pen has changed, and use the fourth current state as the fourth initialization state, and return to the step of "obtaining the fourth level value of the fourth pin" in step 102.
[0072] In one embodiment, the detection of the state of the touch writing pen is stopped only when a stop touch writing pen state detection instruction is received.
[0073] In one embodiment, in the actual touch writing pen usage scenario, after the user picks up the touch writing pen and draws on the writing screen, they often forget to put the touch writing pen back in place, resulting in the touch writing pen being placed randomly, and it is easy to have problems such as the touch writing pen being lost or the internal components of the touch writing pen being damaged. Based on this, in the process of detecting the state of the touch writing pen in this embodiment, when it is detected that the touch writing pen is in the lifted state, the touch point detection on the writing screen is also performed based on the touch frame.
[0074] Specifically, when no touch point on the writing screen is detected, the non-touch duration is recorded to obtain the non-touch time, and it is judged whether the non-touch time is greater than the preset non-touch time threshold, where the preset non-touch time threshold is 10 minutes; if so, a touch writing pen return reminder is sent to the user, and if not, the process returns to the step of "performing touch point detection on the writing screen"; when a touch point on the writing screen is detected, the non-touch time is cleared, and the touch point detection on the writing screen continues, so as to timely remind the user to perform the touch writing pen return process. Preferably, the above touch point is the touch point drawn by the touch writing pen.
[0075] In one embodiment, since the tip sizes of each touch pen are different, when the touch frame detects the touch points on the writing screen, it can also judge the tip size of the touch writing pen based on the detected size of the touch points, and display the touch trajectories of the touch writing pens with different tip sizes on the writing screen in different colors or thicknesses.
[0076] Embodiment 2
[0077] See Figure 2 , Figure 2 which is a schematic flowchart of another embodiment of a touch writing pen state detection method based on a Hall sensor provided by the present invention. As Figure 2 shown, compared with Embodiment 1, the method provided in this embodiment further includes the following:
[0078] Step 201: When a connection configuration detection instruction is received, judge whether each touch writing pen is placed at the Hall sensor position. If so, obtain the pin level value of each pin.
[0079] In one embodiment, when the all-in-one machine is assembled as a whole, if it is not possible to determine whether the Hall sensors in the all-in-one machine can be connected to the corresponding pins, it may occur that multiple Hall sensors cannot be uniformly and fixedly connected to the pins on the main board of the all-in-one machine. For example, the third Hall sensor is connected to the first pin, and the first Hall sensor is connected to the third pin. As a result, when detecting the state of the touch writing pen later, it is impossible to uniformly detect the state of each touch writing pen. It may occur that the pen on the second Hall sensor is lifted, but the level state of the third pin is changed. Therefore, it is necessary to detect the connection configuration of each Hall sensor and each pin on the all-in-one machine to determine the connection relationship between each Hall sensor and each pin, which is convenient for subsequent detection of the writing state of the touch writing pen.
[0080] In one embodiment, it is determined whether each touch writing pen is placed at a different Hall sensor position. If so, the first pin level value of the first pin, the second pin level value of the second pin, the third pin level value of the third pin, and the fourth pin level value of the fourth pin are obtained. Since each touch writing pen is placed at a different Hall sensor position, the pin level value of each obtained pin is a high level.
[0081] Step 202: Send a touch writing pen lifting prompt to the user, and when it is detected that the user successively lifts the touch writing pen on the Hall sensor to be configured, obtain the current pin level value of each pin.
[0082] In one embodiment, a touch writing pen lifting prompt is sent to the user so that the user successively lifts the touch writing pens on the Hall sensors in the preset arrangement order of the Hall sensors. Among them, the preset arrangement order of the Hall sensors can be the first Hall sensor, the second Hall sensor, the third Hall sensor, and the fourth Hall sensor. Similarly, it is also possible to select the arrangement order from left to right or from right to left to successively lift the touch writing pens on the Hall sensors. Among them, the Hall sensor corresponding to the lifted touch writing pen is the Hall sensor to be configured.
[0083] In one embodiment, when it is detected that the user lifts the touch writing pen, obtain the current pin level value of each pin. Specifically, simultaneously obtain the first current pin level value of the first pin, the second current pin level value of the second pin, the third current pin level value of the third pin, and the fourth current pin level value of the fourth pin.
[0084] Step 203: Compare the pin level value and the current pin level value of each pin, obtain the pins to be detected where the pin level value and the current pin level value are different, and establish a connection configuration relationship between the Hall sensor to be detected and the pins to be configured.
[0085] In one embodiment, since the pin level values of each pin of the touch writing pen in the pen-down state are obtained in step 201, and the current pin level values of each pin of a single touch writing pen in the pen-up state are obtained in step 202, due to the change in the state of the single touch writing pen, there will be a difference between the current pin level value of a single pin and the pin level value obtained in step 101.
[0086] Based on the above, compare the pin level value and the current pin level value of each pin, obtain the pins whose pin level value and current pin level value are different, set the pins as pins to be configured, and establish a connection configuration relationship between the to-be-configured Hall sensor and the pins to be configured.
[0087] As an example of this embodiment: Since the detection program only reads the high and low level states (1 or 0) of the pins in real time, and this state value is set by the Hall sensor. When the Hall sensor detects that there is a touch writing pen, it will pull up the level value of the corresponding pin, and when the Hall sensor does not detect the touch writing pen, it will pull down the level value of the corresponding pin. Therefore, when the first Hall sensor is connected to the third pin, lifting the touch writing pen on the first Hall sensor only changes the current pin level value of the third pin. Therefore, the current pin level values of other pins are equal to their corresponding pin level values. Therefore, by simply lifting the touch writing pen on the Hall sensor once and obtaining the pins whose level values have changed among all the pins, it can be known which pin the to-be-configured Hall sensor is connected to. By sequentially lifting the touch writing pens on all the Hall sensors, the pins connected to each Hall sensor can be detected.
[0088] Embodiment 3
[0089] See Figure 3 , Figure 3 is a schematic structural diagram of an embodiment of a touch writing pen state detection device based on a Hall sensor provided by the present invention. As Figure 3 shown, the device includes a touch writing pen state detection module 301. Among them, the touch writing pen state detection module includes an initialization state detection unit 3011, a current state detection unit 3012, and a state change detection unit 3013, which are specifically as follows:
[0090] The initialization state detection unit 3011 is configured to obtain the initialization level value of each pin corresponding to each Hall sensor when receiving a touch writing pen state detection instruction, and obtain the initialization state of each touch writing pen according to the initialization level value;
[0091] The current state detection unit 3012 is configured to obtain the level value of each pin, and obtain the current state of each touch writing pen according to the level value;
[0092] The state change detection unit 3013 is configured to determine whether the current state is the same as the corresponding initialization state. If so, it is determined that the state of the touch writing pen has not changed. If not, it is determined that the state of the touch writing pen has changed, and the current state is used as the corresponding initialization state, and the process returns to the step of "obtaining the level value of each pin" until a stop touch writing pen state detection instruction is received.
[0093] In one embodiment, the current state detection unit 3012 is configured to obtain the current state of each touch writing pen according to the level value. Specifically, when the level value is low, the current state of the touch writing pen is obtained as the pen-lifted state; when the level value is high, the current state of the touch writing pen is obtained as the pen-down state.
[0094] In one embodiment, the touch writing pen state detection module 301 further includes a connection unit 3014; the connection unit 3014 is configured to set a plurality of Hall sensors, set corresponding pins for each Hall sensor, and establish a connection relationship between each Hall sensor and the corresponding pin.
[0095] In one embodiment, the touch writing pen state detection device based on Hall sensors provided in this embodiment further includes: a touch writing pen return reminder module 302, where the touch writing pen return reminder module 302 includes a touch point detection unit 3021, a no-touch time recording unit 3022, and a no-touch time clearing unit 3023.
[0096] The touch point detection unit 3021 is configured to perform touch point detection on the writing screen when the touch writing pen is in the pen-lifted state.
[0097] The no-touch time recording unit 3022 is configured to record the no-touch duration when no touch point on the writing screen is detected, obtain the no-touch time, and determine whether the no-touch time is greater than a preset no-touch time threshold. If so, a touch writing pen return reminder is sent to the user. If not, the process returns to the step of "performing touch point detection on the writing screen".
[0098] The no-touch time clearing unit 3023 is configured to clear the no-touch time when a touch point on the writing screen is detected, and return to the step of "performing touch point detection on the writing screen".
[0099] Embodiment 4
[0100] See Figure 4 ,Figure 4 This is a schematic structural diagram of another embodiment of a touch writing pen state detection device based on a Hall sensor provided by the present invention. As shown in Figure 4 As shown, compared with Embodiment 3, the touch writing pen state detection device provided in this embodiment further includes a connection configuration detection module 303. Among them, the connection configuration detection module 303 includes a pin level detection unit 3031, a current pin level detection unit 3032, and a connection configuration unit 3033, specifically as follows:
[0101] The pin level detection unit 3031 is configured to, when receiving a connection configuration detection instruction, determine whether each touch writing pen is placed at a different Hall sensor position. If so, obtain the pin level value of each pin;
[0102] The current pin level detection unit 3032 is configured to send a touch writing pen lifting prompt to the user, and when detecting that the user successively lifts the touch writing pens on the Hall sensors to be configured, obtain the current pin level value of each pin;
[0103] The connection configuration unit 3033 is configured to compare the pin level value and the current pin level value of each pin, obtain the pins to be detected whose pin level values and current pin level values are different, and establish a connection relationship between the Hall sensors to be configured and the pins to be configured.
[0104] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described device can refer to the corresponding process in the foregoing method embodiment, and will not be elaborated here.
[0105] It should be noted that the embodiments of the above touch writing pen state detection device based on a Hall sensor are merely illustrative. The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0106] Based on the above embodiments of the touch writing pen state detection method based on a Hall sensor, another embodiment of the present invention provides a touch writing pen state detection terminal device based on a Hall sensor. The touch writing pen state detection terminal device based on a Hall sensor includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the touch writing pen state detection method based on a Hall sensor according to any embodiment of the present invention is implemented.
[0107] Exemplarily, in this embodiment, the computer program may be divided into one or more modules. The one or more modules are stored in the memory and executed by the processor to implement the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the touch writing pen state detection terminal device based on a Hall sensor.
[0108] The touch writing pen state detection terminal device based on a Hall sensor may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The touch writing pen state detection terminal device based on a Hall sensor may include, but is not limited to, a processor and a memory.
[0109] The so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the touch writing pen state detection terminal device based on a Hall sensor, and connects various parts of the entire touch writing pen state detection terminal device based on a Hall sensor through various interfaces and circuits.
[0110] The memory may be used to store the computer program and / or modules. The processor realizes various functions of the touch writing pen state detection terminal device based on a Hall sensor by running or executing the computer program and / or modules stored in the memory, and by calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system, application programs required for at least one function, etc.; the data storage area may store data created according to the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0111] Based on the embodiments of the above method for detecting the state of a touch writing pen based on a Hall sensor, another embodiment of the present invention provides a storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the storage medium is located to execute the method for detecting the state of a touch writing pen based on a Hall sensor according to any embodiment of the present invention.
[0112] In this embodiment, the above storage medium is a computer-readable storage medium. The computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0113] In summary, the present invention provides a method and device for detecting the state of a touch writing pen based on a Hall sensor. When a touch writing pen state detection instruction is received, based on the connection relationship between the Hall sensor and the pins, the initialization level value of each pin corresponding to each Hall sensor is obtained, and according to the initialization level value, the initialization state of each touch writing pen is obtained; the level value of each pin is obtained in real time, and according to the level value, the current state of each touch writing pen is obtained; based on judging the current state of each touch writing pen and the initialization state of the corresponding touch writing pen, based on the judgment result, the state change of each touch writing pen is obtained until a stop touch writing pen state detection instruction is received. Compared with the prior art, the technical solution of the present invention can realize the detection of the states of multiple touch writing pens and improve the accuracy of detecting the states of multiple touch writing pens.
[0114] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and substitutions can be made, and these improvements and substitutions should also be regarded as the protection scope of the present invention.
Claims
1. A method for detecting the state of a touch writing pen based on a Hall sensor, characterized in that, Including: When the all-in-one machine receives a touch pen state detection instruction, obtain the initialization level value of each pin corresponding to each Hall sensor, and according to the initialization level value, obtain the initialization state of each touch pen; Obtain the level value of each pin, and according to the level value, obtain the current state of each touch pen; Judge whether the current state is the same as the corresponding initialization state. If so, judge that the state of the touch pen has not changed. If not, judge that the state of the touch pen has changed, and use the current state as the corresponding initialization state, and return to the step of "obtaining the level value of each pin" until the all-in-one machine receives a stop touch pen state detection instruction; When the all-in-one machine receives a connection configuration detection instruction, judge whether each touch pen is placed at different Hall sensor positions. If so, obtain the pin level value of each pin; Send a touch pen lift prompt to the user, and when it is detected that the user successively lifts the touch pens on the Hall sensors to be configured, obtain the current pin level value of each pin; Compare the pin level value of each pin with the current pin level value, obtain the pins to be configured where the pin level value and the current pin level value are different, and establish a connection configuration relationship between the Hall sensors to be configured and the pins to be configured; Before obtaining the initialization level value of each pin corresponding to each Hall sensor, it further includes: Set a plurality of Hall sensors for the all-in-one machine, set corresponding pins for each Hall sensor, and establish a connection relationship between each Hall sensor and the corresponding pin.
2. The touch writing pen state detection method based on a Hall sensor according to claim 1, characterized in that, It further includes: When the touch pen is in the lifted state, perform touch point detection on the writing screen; When no touch point on the writing screen is detected, record the no-touch duration to obtain the no-touch time, and judge whether the no-touch time is greater than a preset no-touch time threshold. If so, initiate a touch pen return reminder to the user. If not, return to the step of "performing touch point detection on the writing screen"; When a touch point on the writing screen is detected, clear the no-touch time and return to the step of "performing touch point detection on the writing screen".
3. The touch writing pen state detection method based on a Hall sensor according to claim 1, wherein According to the level value, obtaining the current state of each touch pen specifically includes: When the level value is low, obtain that the current state of the touch pen is the lifted state; When the level value is high, obtain that the current state of the touch pen is the placed state.
4. A touch writing pen state detection device based on a Hall sensor, characterized in that, Including: A touch pen state detection module and a connection configuration detection module. Among them, the touch pen state detection module includes an initialization state detection unit, a current state detection unit, and a state change detection unit; the connection configuration detection module includes a pin level detection unit, a current pin level detection unit, and a connection configuration unit; The initialization state detection unit is used to obtain the initialization level value of each pin corresponding to each Hall sensor when the all-in-one machine receives the touch pen state detection instruction, and obtain the initialization state of each touch pen according to the initialization level value; The current state detection unit is used to obtain the level value of each pin, and obtain the current state of each touch writing pen according to the level value; The state change detection unit is used to determine whether the current state is the same as the corresponding initialization state. If so, it is determined that the state of the touch pen has not changed. If not, it is determined that the state of the touch pen has changed, and the current state is used as the corresponding initialization state, and the step of "obtaining the level value of each pin" is returned until the all-in-one machine receives an instruction to stop the touch pen state detection; The pin level detection unit is used to determine whether each of the touch writing pens is placed at a different Hall sensor position when the all-in-one machine receives a connection configuration detection instruction, and if so, obtain a pin level value of each pin; The current pin level detection unit is used to send a stylus pen lifting prompt to the user, and obtain the current pin level value of each pin when detecting that the user lifts the stylus pen on the Hall sensor to be configured one by one; The connection configuration unit is used to compare the pin level value of each pin with the current pin level value, obtain the pin to be configured whose pin level value is different from the current pin level value, and establish a connection relationship between the Hall sensor to be configured and the pin to be configured; Before obtaining the initialization level value of each pin corresponding to each Hall sensor, it also includes: A plurality of Hall sensors are arranged on the integrated machine, and a corresponding pin is arranged on each Hall sensor, and a connection relationship is established between each Hall sensor and the corresponding pin.
5. The touch writing pen state detection device based on a Hall sensor according to claim 4, wherein, Also includes: A touch pen return reminder module, wherein the touch pen return reminder module includes a touch point detection unit, a no-touch time recording unit, and a no-touch time clearing unit; The touch point detection unit is used to detect the touch points on the writing screen when the touch writing pen is in the pen-lifting state; The no-touch time recording unit is used to record the no-touch time when no touch point on the writing screen is detected to obtain the no-touch time, and determine whether the no-touch time is greater than a preset no-touch time threshold. If so, a reminder to return the touch pen to its original position is sent to the user; if not, the step of "detecting touch points on the writing screen" is returned to the user; The no-touch time clearing unit is used to clear the no-touch time when a touch point on the writing screen is detected, and return to the step of "detecting a touch point on the writing screen".
6. A terminal device, characterized in that, The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for detecting the state of a stylus pen based on a Hall sensor as claimed in any one of claims 1 to 3 is implemented.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the Hall sensor-based touch writing pen state detection method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Intelligent pen box for electronic whiteboard
CN108052217A
Touch screen adjusting method and device, storage medium and terminal
CN113835555A
Pen input device
JP1999184633A