Pressure sensing calibration method of electronic pen, electronic pen and computer program product
By setting pressure monitoring areas and sensors in the electronic pen, the pressure value is automatically calibrated, and the inaccurate pressure feeling of the electronic pen is solved under environmental changes or structural damage, and the accuracy and reliability of writing and painting are improved.
Patent Information
- Application Number
- CN202510344374.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-08
AI Technical Summary
In the case of changes in the use environment or damaged internal structure of the electronic pen, the pressure sensing value is inaccurate, resulting in ink leakage and incorrect erasing of handwriting.
By setting a pressure monitoring area and pressure sensor in the electronic pen, determine whether the pressure sensing calibration conditions are met, obtain real-time pressure values and update the initial pressure values, perform calibration pressure value calibration, and send calibration pressure sensing values to the target device.
It improves the accuracy and reliability of electronic pen writing on the touch screen, avoids the problems of ink leakage and handwriting error erasing, simplifies the calibration process and improves efficiency, and has multi-protocol versatility.
Smart Images

Figure CN120276608A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic devices, and in particular, to a pressure sensitivity calibration method for an electronic pen, an electronic pen, and a computer program product. Background Art
[0002] An electronic pen is an input tool that can perform functions such as writing and drawing on a touch screen provided by an electronic device.
[0003] Generally, data interaction between an electronic pen and an electronic device with a touch screen is carried out through a certain type of communication protocol. During the process of a user using the electronic pen to write and draw on the touch screen, the electronic pen can transmit the pressure sensitivity value of the electronic pen to the electronic device, so that the electronic device outputs a writing trajectory corresponding to the pressure sensitivity value on the touch screen according to the pressure sensitivity value.
[0004] However, when the usage environment of the electronic pen changes and its internal structure is damaged, the actual pressure sensitivity value of the electronic pen is greater than the initial pressure sensitivity value set at the factory when the user does not use the electronic pen to write and draw on the touch screen. When the tip of the electronic pen is in a suspended state, a writing trajectory will also appear on the touch screen of the electronic device that interacts with the electronic pen, resulting in the problem of ink leakage of the electronic pen, and reducing the accuracy and reliability of the writing trace of the electronic pen on the touch screen. Summary of the Invention
[0005] Embodiments of the present invention provide a pressure sensitivity calibration method for an electronic pen, an electronic pen, and a computer program product, which can solve the problem of ink leakage of the electronic pen in the related art when the usage environment of the electronic pen changes and its internal structure is damaged.
[0006] To solve the above problems, in a first aspect, embodiments of the present invention disclose a pressure sensitivity calibration method for an electronic pen, which is applied to the electronic pen. The electronic pen includes a pressure monitoring area and a pressure sensor arranged in cooperation with the pressure monitoring area; the method includes:
[0007] Determine whether the electronic pen meets the pressure sensitivity calibration condition;
[0008] When the electronic pen meets the pressure sensitivity calibration condition, use the pressure sensor to obtain a first pressure value of the pressure monitoring area; the first pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen meets the pressure sensitivity calibration condition;
[0009] Update the initial pressure value corresponding to the pressure monitoring area according to the first pressure value; the initial pressure value is the pressure value of the pressure monitoring area stored in the electronic pen in a suspended state;
[0010] When the electronic pen does not meet the pressure sensitivity calibration condition, the second pressure value of the pressure monitoring area is obtained by using the pressure sensor; the second pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen does not meet the pressure sensitivity calibration condition.
[0011] The second pressure value is calibrated according to the initial pressure value to obtain a calibrated pressure value.
[0012] The calibrated pressure sensitivity value corresponding to the calibrated pressure value is determined, and the calibrated pressure sensitivity value is sent to the target electronic device for the target electronic device to output corresponding handwriting based on the calibrated pressure sensitivity value.
[0013] Optionally, the electronic pen further includes a motion sensor; determining whether the electronic pen meets the pressure sensitivity calibration condition includes:
[0014] The motion state data of the electronic pen is obtained by using the motion sensor.
[0015] Whether the electronic pen meets the pressure sensitivity calibration condition is determined according to the motion state data.
[0016] Optionally, the motion state data includes the angular velocity of the electronic pen at at least two moments and the acquisition moments corresponding to the angular velocity; determining whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data includes:
[0017] The angular acceleration of the electronic pen is determined according to the angular velocity and the acquisition moment corresponding to the angular velocity.
[0018] When the angular acceleration is greater than a first preset threshold, it is determined that the electronic pen meets the pressure sensitivity calibration condition.
[0019] Optionally, the motion state data further includes the linear acceleration of the electronic pen; determining whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data includes:
[0020] When the angular acceleration is greater than the first preset threshold and the linear acceleration is less than a second preset threshold, it is determined that the electronic pen meets the pressure sensitivity calibration condition.
[0021] Optionally, determining whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data includes:
[0022] The rotation angle of the electronic pen is determined according to the angular velocity and the acquisition moment corresponding to the angular velocity.
[0023] When the angular acceleration is greater than a first preset threshold, the linear acceleration is less than a second preset threshold, and the rotation angle is greater than a third preset threshold, it is determined that the electronic pen meets the pressure sensitivity calibration condition.
[0024] Optionally, the electronic pen includes a function button; determining whether the electronic pen meets the pressure sensitivity calibration condition includes:
[0025] When a start signal of the function button is received, it is determined that the electronic pen meets the pressure sensitivity calibration condition.
[0026] Optionally, the number of the first pressure values is at least 2; updating the initial pressure value corresponding to the pressure monitoring area according to the first pressure value includes:
[0027] Determine the minimum value among the first pressure values;
[0028] Update the initial pressure value corresponding to the pressure monitoring area to the minimum value.
[0029] Optionally, calibrating the second pressure value according to the initial pressure value to obtain a calibrated pressure value includes:
[0030] Calculate the difference between the second pressure value and the initial pressure value;
[0031] Determine the difference as the calibrated pressure value.
[0032] In a second aspect, an embodiment of the present invention discloses a pressure sensitivity calibration device for an electronic pen, which is applied to the electronic pen. The electronic pen includes a pressure monitoring area and a pressure sensor arranged in cooperation with the pressure monitoring area; the device includes:
[0033] A first determination module, configured to determine whether the electronic pen meets the pressure sensitivity calibration condition;
[0034] A first acquisition module, configured to, when the electronic pen meets the pressure sensitivity calibration condition, use the pressure sensor to acquire a first pressure value of the pressure monitoring area; the first pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen meets the pressure sensitivity calibration condition;
[0035] An update module, configured to update the initial pressure value corresponding to the pressure monitoring area according to the first pressure value; the initial pressure value is the pressure value of the pressure monitoring area stored in the electronic pen in a suspended state;
[0036] A second acquisition module, configured to, when the electronic pen does not meet the pressure sensitivity calibration condition, acquire a second pressure value of the pressure monitoring area by using the pressure sensor; the second pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen does not meet the pressure sensitivity calibration condition;
[0037] A calibration module, configured to calibrate the second pressure value according to the initial pressure value to obtain a calibrated pressure value;
[0038] A second determination module, configured to determine a calibrated pressure sensitivity value corresponding to the calibrated pressure value, and send the calibrated pressure sensitivity value to a target electronic device for the target electronic device to output corresponding handwriting based on the calibrated pressure sensitivity value.
[0039] In a third aspect, an embodiment of the present invention further discloses an electronic pen, which includes a processor, a memory, a communication interface, a communication bus, a pressure monitoring area, and a pressure sensor arranged in cooperation with the pressure monitoring area. The processor, the memory, and the communication interface complete communication with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions cause the processor to execute the pressure sensitivity calibration method of the electronic pen as described above.
[0040] In a fourth aspect, an embodiment of the present invention further discloses a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the pressure sensitivity calibration method of the electronic pen as described above is implemented.
[0041] In a fifth aspect, an embodiment of the present invention further discloses a readable storage medium. When instructions in the readable storage medium are executed by a processor of an electronic pen, the processor can execute the pressure sensitivity calibration method of the electronic pen as described above.
[0042] Embodiments of the present invention have the following advantages:
[0043] An embodiment of the present invention provides a pressure sensitivity calibration method for an electronic pen. By determining whether the electronic pen meets the pressure sensitivity calibration condition, and when the electronic pen meets the pressure sensitivity calibration condition, a pressure sensor arranged in cooperation with the pressure monitoring area is used to obtain a first pressure value of the pressure monitoring area, and the initial pressure value corresponding to the pressure monitoring area is updated according to the first pressure value; during the subsequent process of the user using the electronic pen for writing and drawing, the electronic pen calibrates the second pressure value obtained in real time by using the initial pressure value, determines the calibration pressure sensitivity value corresponding to the calibration pressure value, and sends the calibration pressure sensitivity value to the target electronic device for the target electronic device to output corresponding handwriting based on the calibration pressure sensitivity value. When the electronic pen meets the pressure sensitivity calibration condition, automatic calibration of the initial pressure value of the pressure monitoring area stored in the electronic pen in a suspended state is realized, overcoming the problem of ink leakage of the electronic pen in scenarios such as changes in the use environment of the electronic pen and damage to the internal structure, and improving the accuracy and reliability of the writing and drawing traces of the electronic pen on the touch screen of the target electronic device.
[0044] It should be understood that the above general description and subsequent detailed description are only exemplary and explanatory, and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings according to these drawings without creative efforts.
[0046] Figure 1 is the step flow of a pressure sensitivity calibration method for an electronic pen provided by an embodiment of the present invention Figure 1 ;
[0047] Figure 2 is the step flow of a pressure sensitivity calibration method for an electronic pen provided by an embodiment of the present invention Figure 2 ;
[0048] Figure 3 is the logical block diagram of a pressure sensitivity calibration device for an electronic pen provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0049] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. 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.
[0050] To make the above objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] Method Embodiment
[0052] Refer to Figure 1 , which shows the step flow of a pressure sensitivity calibration method for an electronic pen provided by an embodiment of the present invention. Figure 1 The method may specifically include the following steps:
[0053] Step S101: Determine whether the electronic pen meets the pressure sensitivity calibration condition.
[0054] Step S102: When the electronic pen meets the pressure sensitivity calibration condition, use the pressure sensor to obtain the first pressure value of the pressure monitoring area.
[0055] Step S103: Update the initial pressure value corresponding to the pressure monitoring area according to the first pressure value.
[0056] Step S104: When the electronic pen does not meet the pressure sensitivity calibration condition, use the pressure sensor to obtain the second pressure value of the pressure monitoring area.
[0057] Step S105: Calibrate the second pressure value according to the initial pressure value to obtain the calibrated pressure value.
[0058] Step S106: Determine the calibrated pressure sensitivity value corresponding to the calibrated pressure value, and send the calibrated pressure sensitivity value to the target electronic device for the target electronic device to output corresponding handwriting based on the calibrated pressure sensitivity value.
[0059] The pressure sensitivity calibration method for an electronic pen provided by an embodiment of the present invention can be applied to an electronic pen, which includes a microcontroller unit (MCU), a pressure monitoring area, and a pressure sensor arranged in cooperation with the pressure monitoring area.
[0060] Among them, the MCU is used to perform the operations corresponding to steps S101 to S106; the pressure monitoring area may include, but is not limited to, the tip of the electronic pen and the tail of the electronic pen, etc., and the pressure monitoring area is used to implement functions such as writing, erasing, etc. on the touch screen of the target electronic device; the pressure sensor arranged in cooperation with the pressure monitoring area is used to obtain the pressure value received by the pressure monitoring area in real time and transmit the pressure value to the MCU; the pressure value obtained by the MCU using the pressure sensor in step S102 is recorded as the first pressure value, the pressure value obtained by the MCU using the pressure sensor in step S104 is recorded as the second pressure value, and the first pressure value and the second pressure value are real-time pressure values of the pressure monitoring area obtained by the MCU using the pressure sensor at different acquisition times.
[0061] The target electronic device includes a touch screen. When the electronic pen and the target electronic device establish a communication connection based on a preset type of communication protocol, the user can use the electronic pen to perform functions such as writing, drawing, and erasing on the touch screen of the target electronic device. Specifically, during the process of the user using the electronic pen to write, draw, or erase on the touch screen of the target electronic device, the MCU in the electronic pen first uses the pressure sensor to obtain the pressure value in the pressure monitoring area, then determines the pressure sensing value corresponding to the pressure value, and finally sends the pressure sensing value to the target electronic device through the communication connection with the target electronic device. When the target electronic device receives the pressure sensing value sent by the electronic pen, it outputs a writing trajectory corresponding to the pressure sensing value on the touch screen according to the pressure sensing value, so as to form the handwriting of the user writing and drawing on the touch screen on the touch screen.
[0062] However, in actual application scenarios, changes in the usage environment of the electronic pen (such as temperature, humidity, etc.) and structural damage caused by wear of the pressure sensing module in the electronic pen during long-term use will cause the actual pressure value in the pressure monitoring area of the electronic pen in the suspended state to be greater than the initial pressure value set at the factory. In this scenario, when the user uses the electronic pen to write and draw on the touch screen, when the user lifts the pressure monitoring area of the electronic pen until it is not in contact with the touch screen, since the actual pressure value in the pressure monitoring area in the suspended state is greater than the initial pressure value set at the factory. For example, the actual pressure value in the pressure monitoring area in the suspended state is 50 gf (gram-force), while the initial pressure value of the pressure monitoring area set at the factory for the electronic pen is 0 gf. When the user lifts the pressure monitoring area of the electronic pen until it is not in contact with the touch screen, after the MCU of the electronic pen sends the pressure sensing value corresponding to the pressure value of 50 gf to the target electronic device, the target electronic device will output the writing trajectory corresponding to the pressure value of 50 gf on the touch screen, resulting in the touch screen of the target electronic device that interacts with the electronic pen showing a writing trajectory even when the tip of the electronic pen is in the suspended state in the actual use scenario, causing the problem of ink leakage in the electronic pen; correspondingly, when the user uses the electronic pen to erase the handwriting on the touch screen, when the user lifts the pressure monitoring area of the electronic pen until it is not in contact with the touch screen, since the actual pressure value in the pressure monitoring area in the suspended state is greater than the initial pressure value set at the factory. For example, the actual pressure value in the pressure monitoring area in the suspended state is 50 gf, while the initial pressure value of the pressure monitoring area set at the factory for the electronic pen is 0 gf. When the user lifts the pressure monitoring area of the electronic pen until it is not in contact with the touch screen, after the MCU of the electronic pen sends the pressure sensing value corresponding to the pressure value of 50 gf to the target electronic device, the target electronic device will output the erasing trajectory corresponding to the pressure value of 50 gf on the touch screen, resulting in the touch screen of the target electronic device that interacts with the electronic pen showing an erasing trajectory even when the tip of the electronic pen is in the suspended state in the actual use scenario, causing the problem of incorrect erasure of handwriting and reducing the accuracy and reliability of the writing and drawing of the electronic pen on the touch screen.
[0063] Specifically, when the user uses the electronic pen to write, draw, or erase on the touch screen of the target electronic device, the pressure monitoring area will sense the pressure from the touch screen, and this pressure is transmitted through the pressure monitoring area to the pressure sensor arranged in cooperation with the pressure monitoring area, enabling the pressure sensor to obtain the pressure value received by the pressure monitoring area and sending this pressure value to the MCU.
[0064] In the embodiment of the present invention, the initial pressure value corresponding to the pressure monitoring area is the pressure value of the pressure monitoring area stored in the electronic pen in the suspended state; it can be understood that the initial pressure value corresponding to the pressure monitoring area stored in the electronic pen can be the pressure value of the pressure monitoring area in the suspended state set when the electronic pen leaves the factory; the initial pressure value corresponding to the pressure monitoring area stored in the electronic pen can also be the pressure value of the pressure monitoring area in the suspended state after the MCU executes step S103 for updating.
[0065] Among them, the area in the electronic pen for storing the initial pressure value can be the flash memory of the MCU (Flash Memory).
[0066] Without being affected by the usage environment of the electronic pen and the wear of the pressure sensing module in the electronic pen, the initial pressure value of the pressure monitoring area set when the electronic pen leaves the factory in the suspended state is generally 0; in the case that the electronic pen has problems such as ink leakage and / or accidental erasure of handwriting, it indicates that the actual pressure value of the pressure monitoring area in the suspended state is inconsistent with the initial pressure value set when the electronic pen leaves the factory. The MCU can update the initial pressure value through the operations corresponding to steps S101 to S103 above, and calibrate the second pressure value by using the updated initial pressure value in step S105. By determining the calibration pressure sensing value corresponding to the calibration pressure value and sending the calibration pressure sensing value to the target electronic device in step S106, the accuracy and reliability of the handwriting output by the target electronic device can be improved, and the occurrence of problems such as ink leakage and accidental erasure of handwriting can be avoided.
[0067] In the related art, although a calibration system can be added for a specified type of communication protocol, it can only add the calibration system corresponding to this communication type for a certain type of communication protocol, and this calibration system cannot be universal for multiple protocols. However, in the actual application scenario, the communication protocols between different types of electronic pens and the target electronic device are different. If calibration systems are added separately for each type of communication protocol, not only the calibration cost is high, but also the newly added calibration systems will occupy the original hardware and software resources of the electronic pen, resulting in the occupation and waste of the resources of the electronic pen.
[0068] In view of the above problems, the pressure sensitivity calibration method of the electronic pen provided by the embodiments of the present invention is such that the MCU in the electronic pen determines whether the electronic pen meets the pressure sensitivity calibration condition. When the electronic pen meets the pressure sensitivity calibration condition, the MCU uses a pressure sensor arranged in cooperation with the pressure monitoring area to obtain a first pressure value of the pressure monitoring area, and updates the initial pressure value corresponding to the pressure monitoring area according to the first pressure value. During the subsequent process of the user using the electronic pen for writing and drawing, the MCU can calibrate the second pressure value obtained in real time by using the initial pressure value, determine the calibration pressure sensitivity value corresponding to the calibrated pressure value, and send the calibrated pressure sensitivity value to the target electronic device, so that the target electronic device outputs corresponding handwriting based on the calibrated pressure sensitivity value. When the electronic pen meets the pressure sensitivity calibration condition, the automatic calibration of the initial pressure value of the pressure monitoring area stored in the electronic pen in the suspended state is realized, overcoming the problems of ink leakage and handwriting mis-erasure of the electronic pen in scenarios such as changes in the use environment of the electronic pen and damage to the internal structure, and improving the accuracy and reliability of the handwriting written by the electronic pen on the touch screen of the target electronic device. In addition, the pressure sensitivity calibration method of the electronic pen provided by the embodiments of the present invention can complete the automatic calibration process at the electronic pen end without relying on the data interaction between the electronic pen and the target electronic device. This not only simplifies the process of pressure sensitivity calibration of the electronic pen and improves the efficiency of pressure sensitivity calibration, but also, when the calibration process does not involve the data interaction between the electronic pen and the target electronic device, the pressure sensitivity calibration process is not restricted by the type of communication protocol, has higher versatility, and expands the application scope of the embodiments of the present invention.
[0069] Among them, the target electronic device may include, but is not limited to, mobile terminals such as laptop computers, tablet computers, personal digital assistants (PDAs), handheld devices, computing devices, etc., and fixed terminals such as digital TVs, desktop computers, etc. The types of communication protocols between the electronic pen and the target electronic device may include, but are not limited to, USI (Universal Stylus Initiative), MPP (Microsoft Pen Protocol), HPP (Huawei Pen Protocol), BPP (BOE Pen Protocol), and LPP (Lenovo Pen Protocol), etc.
[0070] In the embodiments of the present invention, the MCU in the electronic pen can determine in real time whether the electronic pen currently meets the pressure sensitivity calibration condition through step S101.
[0071] As an alternative embodiment, in step S101, when the MCU receives a pressure sensing calibration instruction, it can determine that the electronic pen meets the pressure sensing calibration condition; during the operation of the electronic pen, when the MCU does not receive a pressure sensing calibration instruction, it can determine that the electronic pen does not meet the pressure sensing calibration condition. Among them, the pressure sensing calibration instruction is used to indicate that the electronic pen meets the pressure sensing calibration condition and perform the operations corresponding to steps S102 to S103 to update the initial pressure value corresponding to the pressure monitoring area.
[0072] During the user's use of the electronic pen, when there are problems such as ink leakage and / or handwriting accidental erasure in the electronic pen, the user can input a pressure sensing calibration instruction to the electronic pen to indicate that the electronic pen performs the operations corresponding to steps S102 to S103 to update the initial pressure value corresponding to the pressure monitoring area stored in the electronic pen.
[0073] Among them, the ways for the user to input a pressure sensing calibration instruction to the electronic pen may include but are not limited to: driving the electronic pen to perform a preset operation, clicking on a target area in the electronic pen, etc. Exemplarily, driving the electronic pen to perform a preset operation includes driving the electronic pen to draw a circle in the air; clicking on a target area in the electronic pen includes continuously clicking on the target area in the electronic pen N times, where N is an integer greater than 0, and the target area is any area on the electronic pen.
[0074] Specifically, when it is determined that the electronic pen meets the pressure sensing calibration condition, it indicates that the actual pressure value of the current electronic pen's pressure monitoring area in the suspended state is inconsistent with the initial pressure value stored in the MCU's flash memory, and there are problems such as ink leakage and / or handwriting accidental erasure in the electronic pen. The MCU performs the operations corresponding to steps S102 to S103 to update the initial pressure value stored in the flash memory to the actual pressure value of the current electronic pen's pressure monitoring area in the suspended state; when it is determined that the electronic pen does not meet the pressure sensing calibration condition, it indicates that the actual pressure value of the current electronic pen's pressure monitoring area in the suspended state is consistent with the initial pressure value stored in the flash memory, and there are no problems such as ink leakage and handwriting accidental erasure in the electronic pen, so there is no need to perform the operations corresponding to steps S102 to S103. The MCU can perform the operations corresponding to steps S104 to S106 to send the calibrated pressure sensing value to the target electronic device in real time.
[0075] In the embodiment of the present invention, the original value of the initial pressure value stored in the flash memory is the pressure value of the pressure monitoring area set at the factory of the electronic pen in the suspended state; after the MCU performs step S103 to update the initial pressure value, the initial pressure value stored in the flash memory is the updated pressure value.
[0076] In step S102, when the electronic pen meets the pressure sensing calibration condition, the MCU can use the pressure sensor to obtain the real-time pressure value of the pressure monitoring area and determine this real-time pressure value as the first pressure value. The first pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen meets the pressure sensing calibration condition.
[0077] It should be noted that when there are problems such as ink leakage and / or handwriting accidental erasure in the electronic pen, to ensure the accuracy of updating the initial pressure value, the user needs to input a pressure sensing calibration instruction to the electronic pen when the pressure monitoring area is in a suspended state, so that when the MCU determines that the electronic pen meets the pressure sensing calibration condition, the first pressure value obtained by using the pressure sensor is the real-time pressure value of the pressure monitoring area in the suspended state.
[0078] In some embodiments, the number of first pressure values obtained by the MCU through step S102 is 1; specifically, when the MCU determines that the electronic pen meets the pressure sensing calibration condition, it can obtain the real-time pressure value of the pressure monitoring area at the moment when it determines that the electronic pen meets the pressure sensing calibration condition and determine this real-time pressure value as the first pressure value.
[0079] In some other embodiments, the number of first pressure values obtained by the MCU through step S102 is at least 2; specifically, when the MCU determines that the electronic pen meets the pressure sensing calibration condition, it can obtain the real-time pressure values of the pressure monitoring area at at least two moments within the target time period when it determines that the electronic pen meets the pressure sensing calibration condition and determine the real-time pressure values as the first pressure values. The target time period is the time period including the moment when the MCU determines that the electronic pen meets the pressure sensing calibration condition, and the moment when the MCU determines that the electronic pen meets the pressure sensing calibration condition can be any moment within the target time period; as an example, the starting value of the target time period is the moment when the MCU determines that the electronic pen meets the pressure sensing calibration condition; as another example, the moment when the MCU determines that the electronic pen meets the pressure sensing calibration condition is the middle value in the target time period.
[0080] In step S103, when the number of first pressure values obtained by the MCU through step S102 is 1, the MCU can update the initial pressure value stored in the flash memory to the first pressure value obtained by the MCU through step S102; when the number of first pressure values obtained by the MCU through step S102 is at least 2, first, the MCU calculates the average value of the first pressure values; then, the MCU updates the initial pressure value stored in the flash memory to the average value of the first pressure values.
[0081] In an embodiment of the present invention, the MCU can execute step S104 to obtain a second pressure value of the pressure monitoring area by using the pressure sensor at any time when it is determined through step S101 that the electronic pen does not meet the pressure sensing calibration condition. The second pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen does not meet the pressure sensing calibration condition.
[0082] It should be noted that the second pressure value can be the real-time pressure value of the pressure monitoring area during the process of the user using the electronic pen to write, draw, erase, etc. on the touch screen of the target electronic device, or the second pressure value can also be the real-time pressure value of the pressure monitoring area in a suspended state when the user does not use the electronic pen to write, draw, erase, etc.
[0083] Specifically, during the process of the user using the electronic pen to write, draw, erase, etc. on the touch screen of the target electronic device, the second pressure value is the pressure value of the pressure monitoring area when it is subjected to the pressure of the touch screen. In this scenario, the second pressure value is greater than the first pressure range. Wherein, the first pressure range is the pressure range determined according to the initial pressure value. Exemplarily, the first pressure range is the pressure range determined with the initial pressure value as the central value.
[0084] When the user lifts the electronic pen during the process of using the electronic pen to write, draw, erase, etc. on the touch screen of the target electronic device, or when the electronic pen is in the standby state, the second pressure value is the pressure value of the pressure monitoring area in the suspended state. In this scenario, the second pressure value falls within the first pressure range.
[0085] In step S105, the MCU obtains the initial pressure value from the flash memory and calibrates the second pressure value according to the initial pressure value to obtain the calibrated pressure value.
[0086] When the calibrated pressure value is obtained through step S105, the MCU can execute step S106. First, determine the calibrated pressure sensing value corresponding to the calibrated pressure value obtained in step S105, and then send the calibrated pressure sensing value to the target electronic device based on the communication connection between the electronic pen and the target electronic device; when the target electronic device receives the calibrated pressure sensing value sent by the electronic pen, it can determine the pixel value corresponding to the calibrated pressure sensing value, and then output the writing trajectory corresponding to the calibrated pressure sensing value according to the pixel value corresponding to the calibrated pressure sensing value, so as to form the handwriting of the user writing on the touch screen on the touch screen.
[0087] The way for the MCU to determine the calibrated pressure sensing value corresponding to the calibrated pressure value is: map the calibrated pressure value to the preset pressure sensing level, and determine the pressure sensing level corresponding to the calibrated pressure value as the calibrated pressure sensing value corresponding to the calibrated pressure value.
[0088] The preset pressure sensitivity levels are determined according to the design requirements of the electronic pen and the actual needs of users; exemplarily, if the electronic pen is designed to have 8192 levels of pressure sensitivity, the MCU will map the calibrated pressure value to an integer value between 0 and 8191 to determine the pressure sensitivity level corresponding to the calibrated pressure value.
[0089] During the operation of the electronic pen, the MCU can continuously monitor whether the electronic pen meets the pressure sensitivity calibration conditions, and when the electronic pen meets the pressure sensitivity calibration conditions, automatically perform the operations corresponding to steps S102 to S103 to update the initial pressure sensitivity values stored in the flash memory in a timely manner, which can improve the reliability of the calibrated pressure value obtained by the MCU through step S105 and the calibrated pressure sensitivity value determined by step S106, and further improve the accuracy and reliability of the writing and drawing traces of the electronic pen on the touch screen of the target electronic device.
[0090] In an alternative embodiment of the present invention, the electronic pen further includes a motion sensor; determining whether the electronic pen meets the pressure sensitivity calibration conditions in step S101 includes:
[0091] Step S1011, obtaining the motion state data of the electronic pen by using the motion sensor.
[0092] Step S1012, determining whether the electronic pen meets the pressure sensitivity calibration conditions according to the motion state data.
[0093] In an embodiment of the present invention, when the electronic pen further includes a motion sensor, during the process of the MCU determining whether the electronic pen meets the pressure sensitivity calibration conditions, the motion sensor can be used to obtain the motion state data of the electronic pen, and whether the electronic pen meets the pressure sensitivity calibration conditions is determined according to the motion state data.
[0094] Among them, the motion sensor is used to obtain the motion state data of the electronic pen in real time and transmit the motion state data to the MCU; the motion state data includes the angular velocity of the electronic pen and the linear acceleration of the electronic pen.
[0095] In an alternative embodiment of the present invention, the motion sensor has a linear acceleration detection function and an angular velocity detection function.
[0096] Optionally, the motion sensor may include an acceleration sensor and a gyroscope; the acceleration sensor has a linear acceleration detection function and is used to obtain the linear acceleration of the electronic pen and transmit the linear acceleration to the MCU, and the gyroscope has an angular velocity detection function and is used to obtain the angular velocity of the electronic pen and transmit the angular velocity to the MCU.
[0097] Optionally, the motion sensor may include a six-axis sensor or a nine-axis sensor.
[0098] Among them, the six-axis sensor includes three accelerometers and three gyroscopes. The six-axis sensor is used to obtain the linear acceleration of the electronic pen in three directions of the X-axis, Y-axis, and Z-axis through the three accelerometers, and obtain the angular velocity of the electronic pen in three directions of the X-axis, Y-axis, and Z-axis through the three gyroscopes.
[0099] The nine-axis sensor includes a three-axis acceleration sensor, a three-axis gyroscope, and a three-axis electronic compass. The nine-axis sensor is used to obtain the linear acceleration of the electronic pen in three directions of the X-axis, Y-axis, and Z-axis through the three-axis acceleration sensor, obtain the angular velocity of the electronic pen in three directions of the X-axis, Y-axis, and Z-axis through the three-axis gyroscope, and correct the orientation of the electronic pen through the three-axis electronic compass.
[0100] In the embodiment of the present invention, when the user discovers problems such as ink leakage and / or handwriting accidental erasure during the use of the electronic pen, the user can send a pressure sensitivity calibration instruction to the MCU of the electronic pen by shaking the pen.
[0101] Among them, when the user sends a pressure sensitivity calibration instruction to the MCU of the electronic pen by shaking the pen, the moment when the MCU determines that the electronic pen meets the pressure sensitivity calibration condition is the moment when the user starts to shake the pen.
[0102] When the number of the first pressure values obtained by the MCU through step S102 is at least 2, the target time period for the MCU to obtain the first pressure values includes the moment when the user starts to shake the pen and the moment when the user ends shaking the pen.
[0103] During the process of the user shaking the pen, the angular velocity, the change in angular velocity, and the angular acceleration in a certain direction among the three directions of the X-axis, Y-axis, and Z-axis of the electronic pen will all suddenly increase. Based on this, the MCU can use at least one of the angular velocity, the change in angular velocity, and the angular acceleration as the feature of the motion state data to determine whether the electronic pen meets the pressure sensitivity calibration condition.
[0104] The feature of the motion state data includes at least one of the angular acceleration, angular velocity, and change in angular velocity of the electronic pen.
[0105] Specifically, the motion state data obtained by the MCU through step S1011 may include the motion state data of the electronic pen at at least two different moments.
[0106] As an alternative implementation, in step S1012, first, the MCU calculates the absolute value of the difference between the angular velocities at adjacent moments based on the angular velocity in the motion state data as the change amount of the angular velocity of the electronic pen at adjacent moments; then, the MCU matches the absolute value with a fourth preset threshold; when the absolute value is less than or equal to the fourth preset threshold, it indicates that the change amount of the angular velocity of the electronic pen at adjacent moments is small and the user has not performed a flicking operation, and the MCU can determine that the electronic pen does not meet the pressure sensitivity calibration condition; when the absolute value is greater than the fourth preset threshold, it indicates that the change amount of the angular velocity of the electronic pen at adjacent moments is large, the MCU can determine that the user has performed a flicking operation, and the MCU can further determine that the electronic pen meets the pressure sensitivity calibration condition.
[0107] Among them, the fourth preset threshold is the maximum value of the change amount of the angular velocity of the electronic pen at adjacent moments when the user is normally using the electronic pen for writing, drawing or erasing, and the change amount of the angular velocity of the electronic pen at adjacent moments during the flicking operation is greater than the fourth preset threshold.
[0108] As another alternative implementation, in step S1012, the MCU matches the angular velocity in the motion state data with a fifth preset threshold; when the angular velocity is less than or equal to the fifth preset threshold, it indicates that the angular velocity of the electronic pen is small and the user has not performed a flicking operation, and the MCU can determine that the electronic pen does not meet the pressure sensitivity calibration condition; when the angular velocity is greater than the fifth preset threshold, it indicates that the angular velocity of the electronic pen is large, the MCU can determine that the user has performed a flicking operation, and the MCU can further determine that the electronic pen meets the pressure sensitivity calibration condition.
[0109] Among them, the fifth preset threshold is the maximum value of the angular velocity of the electronic pen when the user is normally using the electronic pen for writing, drawing or erasing, and the angular velocity of the electronic pen during the flicking operation is greater than the fifth preset threshold.
[0110] In an alternative embodiment of the present invention, the motion state data includes the angular velocity of the electronic pen at at least two moments and the acquisition moments corresponding to the angular velocity; step S1012 of determining whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data includes:
[0111] Step A11: Determine the angular acceleration of the electronic pen according to the angular velocity and the acquisition moment corresponding to the angular velocity.
[0112] Step A12: When the angular acceleration is greater than a first preset threshold, determine that the electronic pen meets the pressure sensitivity calibration condition.
[0113] In an embodiment of the present invention, when the MCU determines whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data, it may first determine the attitude data of the electronic pen according to the motion state data; then determine whether the electronic pen meets the pressure sensitivity calibration condition according to the attitude data.
[0114] Among them, the attitude data of the electronic pen includes the angular acceleration of the electronic pen.
[0115] Specifically, the MCU can calculate the angular acceleration of the electronic pen through the following formula according to the angular velocity obtained at different times in the motion state data and the acquisition time corresponding to the angular velocity through step A11:
[0116]
[0117] Among them, α represents the angular acceleration of the electronic pen; ω1 represents the angular velocity of the electronic pen at the first moment; ω2 represents the angular velocity of the electronic pen at the second moment; t1 represents the first moment; t2 represents the second moment, and the first moment and the second moment are adjacent acquisition times.
[0118] In the case where the angular acceleration of the electronic pen is obtained through step A11, the MCU can determine whether the electronic pen meets the pressure sensitivity calibration condition according to the magnitude relationship between the angular acceleration and the first preset threshold.
[0119] In the case where the angular acceleration is greater than the first preset threshold, it indicates that the angular acceleration of the electronic pen increases. The MCU can determine that the user has performed a flicking operation of the pen, and the MCU can execute step A12 to determine that the electronic pen meets the pressure sensitivity calibration condition; in the case where the angular acceleration is less than or equal to the first preset threshold, it indicates that the angular acceleration of the electronic pen has not increased or has not increased to be greater than the first preset threshold. The MCU can determine that the user has not performed a flicking operation of the pen, and the MCU can determine that the electronic pen does not meet the pressure sensitivity calibration condition.
[0120] Among them, the first preset threshold is the maximum value of the angular acceleration of the electronic pen when the user is normally using the electronic pen for writing, drawing or erasing, and the angular acceleration of the electronic pen is greater than the first preset threshold during the flicking operation of the user.
[0121] As an example, the first preset threshold is 100rad / s 2 .
[0122] It can be understood that in the scenario where the user extends or waves the arm while holding the electronic pen, the angular acceleration of the electronic pen is less than or equal to the first preset threshold corresponding to the pen - throwing operation, the angular velocity of the electronic pen is less than or equal to the fifth preset threshold corresponding to the pen - throwing operation, and the change amount of the angular velocity of the electronic pen is less than or equal to the fourth preset threshold corresponding to the pen - throwing operation. In the embodiment of the present invention, the MCU determines whether the electronic pen meets the pressure - sensing calibration condition according to any one of the angular acceleration, angular velocity, and change amount of the angular velocity of the electronic pen, which can avoid the mis - triggering of the operations corresponding to steps S102 to S103 in the scenario where the user extends or waves the arm while using the electronic pen for writing or drawing. It can improve the reliability of the result of determining whether the electronic pen meets the pressure - sensing calibration condition by the embodiment of the present invention, avoid the mis - triggering of the operations corresponding to steps S102 to S103, not only improve the accuracy of the initial pressure value stored in the flash memory, but also avoid the occupation of the electronic pen resources caused by the MCU's mis - execution of the operations corresponding to steps S102 to S103, and improve the reliability of the pressure - sensing calibration process of the electronic pen.
[0123] Furthermore, the pressure - sensing calibration method of the electronic pen provided by the embodiment of the present invention can define the way that the user inputs a pressure - sensing calibration instruction to the electronic pen as a pen - throwing operation, and determine whether the electronic pen meets the pressure - sensing calibration condition according to the characteristics of the motion state data of the electronic pen (angular acceleration, angular velocity, change amount of angular velocity) during the user's pen - throwing operation. It can not only realize the automatic pressure - sensing calibration of the pen tip, but also the relevant data for determining whether the electronic pen meets the pressure - sensing calibration condition is easy to obtain, which is beneficial to simplifying the process of determining whether the electronic pen meets the pressure - sensing calibration condition and improving the efficiency of pressure - sensing calibration of the electronic pen.
[0124] As an optional implementation manner, during the process of the MCU determining whether the electronic pen meets the pressure - sensing calibration condition according to the motion state data, it can also determine whether the electronic pen meets the pressure - sensing calibration condition according to the angular acceleration, angular velocity, and change amount of the angular velocity of the electronic pen at the same time. Specifically, when the angular acceleration of the electronic pen is greater than the first preset threshold, the angular velocity is greater than the fifth preset threshold, and the change amount of the angular velocity is greater than the fourth preset threshold, the MCU determines that the electronic pen meets the pressure - sensing calibration condition; when the angular acceleration of the electronic pen is less than or equal to the first preset threshold, and / or the angular velocity is less than or equal to the fifth preset threshold, and / or the change amount of the angular velocity is less than or equal to the fourth preset threshold, the MCU determines that the electronic pen does not meet the pressure - sensing calibration condition.
[0125] In an optional embodiment of the present invention, the motion state data further includes the linear acceleration of the electronic pen; step S1012 of determining whether the electronic pen meets the pressure - sensing calibration condition according to the motion state data includes:
[0126] Step A21: When the angular acceleration is greater than a first preset threshold and the linear acceleration is less than a second preset threshold, it is determined that the electronic pen meets the pressure sensitivity calibration condition.
[0127] In the embodiment of the present invention, the MCU in the electronic pen can further determine whether the electronic pen meets the pressure sensitivity calibration condition according to the linear acceleration of the electronic pen in the motion state data on the basis of the angular acceleration of the electronic pen.
[0128] Specifically, during the process of the user performing a pen-swinging operation, when the angular velocity, the angular velocity change amount, and the angular acceleration of the electronic pen in a certain direction among the three directions of the X-axis, Y-axis, and Z-axis suddenly increase, the linear acceleration of the electronic pen is generally small and less than the linear acceleration of the electronic pen during free fall.
[0129] In the scenario where the electronic pen drops, free fall is the main motion mode of the electronic pen dropping. In the embodiment of the present invention, to prevent the MCU from mis-determining that the electronic pen meets the pressure sensitivity calibration condition according to the motion state data due to the electronic pen dropping scenario, when the MCU determines whether the electronic pen meets the pressure sensitivity calibration condition, while considering the angular acceleration of the electronic pen, it also considers the linear acceleration. Thus, it can avoid the mis-triggering of the corresponding operations in steps S102 to S103 caused by the scenario of the user stretching the arm or waving the arm while holding the electronic pen during the process of using the electronic pen for writing and drawing, and at the same time avoid the mis-triggering of the corresponding operations in steps S102 to S103 caused by the electronic pen dropping scenario, further improving the accuracy of the result of determining whether the electronic pen meets the pressure sensitivity calibration condition through the embodiment of the present invention and the reliability of the process of performing pressure sensitivity calibration on the electronic pen.
[0130] Specifically, when the MCU determines whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data, first, the angular acceleration of the electronic pen is determined according to the angular velocity and the acquisition moment corresponding to the angular velocity through step A11; then, the angular acceleration of the electronic pen is matched with the first preset threshold, and the linear acceleration of the electronic pen in the motion state data is matched with the second preset threshold; when the angular acceleration is greater than the first preset threshold and the linear acceleration is less than the second preset threshold, the MCU executes step A21 to determine that the electronic pen meets the pressure sensitivity calibration condition; when the angular acceleration is less than or equal to the first preset threshold, and / or, the linear acceleration is greater than or equal to the second preset threshold, the MCU determines that the electronic pen does not meet the pressure sensitivity calibration condition.
[0131] Among them, the second preset threshold can be 9.8m / s 2 。
[0132] In an alternative embodiment of the present invention, determining whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data in step S1012 includes:
[0133] Step A31: Determine the rotation angle of the electronic pen according to the angular velocity and the acquisition time corresponding to the angular velocity.
[0134] Step A32: Determine that the electronic pen meets the pressure sensitivity calibration condition when the angular acceleration is greater than a first preset threshold, the linear acceleration is less than a second preset threshold, and the rotation angle is greater than a third preset threshold.
[0135] In an embodiment of the present invention, when the MCU determines whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data, it can first determine the attitude data of the electronic pen according to the motion state data; then, simultaneously determine whether the electronic pen meets the pressure sensitivity calibration condition according to the linear acceleration and the attitude data in the motion state data, further improving the accuracy of the result of determining whether the electronic pen meets the pressure sensitivity calibration condition and the reliability of the process of performing pressure sensitivity calibration on the electronic pen.
[0136] Among them, the attitude data of the electronic pen includes the angular acceleration of the electronic pen and the rotation angle of the electronic pen.
[0137] Specifically, when the MCU determines whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data, it can determine the angular acceleration of the electronic pen according to the angular velocity and the acquisition time corresponding to the angular velocity through step A11, and determine the rotation angle of the electronic pen according to the angular velocity and the acquisition time corresponding to the angular velocity through step A31; then, match the angular acceleration of the electronic pen with the first preset threshold, match the linear acceleration with the second preset threshold, and match the rotation angle with the third preset threshold.
[0138] When the angular acceleration is greater than the first preset threshold, the linear acceleration is less than the second preset threshold, and the rotation angle is greater than the third preset threshold, the MCU executes step A32 to determine that the electronic pen meets the pressure sensitivity calibration condition; when the angular acceleration is less than or equal to the first preset threshold, and / or, the linear acceleration is greater than or equal to the second preset threshold, and / or, the rotation angle is less than or equal to the third preset threshold, the MCU determines that the electronic pen does not meet the pressure sensitivity calibration condition.
[0139] Among them, in step A31, the MCU can calculate and determine the rotation angle of the electronic pen according to the angular velocity and the acquisition time corresponding to the angular velocity through the following formula:
[0140]
[0141] where, θ *represents the rotation angle of the electronic pen between the first moment t1 and the second moment t2; represents the average value of the angular velocity of the electronic pen between the first moment t1 and the second moment t2.
[0142] The third preset threshold is the maximum value of the rotation angle of the electronic pen at adjacent acquisition moments during the normal use of the electronic pen for writing and drawing by the user, and the rotation angle of the electronic pen is greater than the third preset threshold during the pen-swinging operation.
[0143] As an example, the third preset threshold is 45°.
[0144] In an actual application scenario, when the MCU determines whether the electronic pen meets the pressure-sensing calibration condition according to the operating state data, it can combine the pressure-sensing calibration requirements of the electronic pen and determine whether the electronic pen meets the pressure-sensing calibration condition according to one or more of the angular velocity, the change in angular velocity, the angular acceleration, the linear acceleration, and the rotation angle of the electronic pen. The embodiments of the present invention do not make specific limitations on this.
[0145] As an example, referring to Figure 2 , the step flow of a pressure-sensing calibration method for an electronic pen provided by an embodiment of the present invention is shown Figure 2 , the method includes:
[0146] Step S201, obtaining motion state data by using a six-axis sensor.
[0147] Specifically, the MCU uses a six-axis sensor to obtain the motion state data of the electronic pen; the operating state data includes the angular velocity of the electronic pen at at least two moments and the acquisition moments corresponding to the angular velocity.
[0148] Step S202, whether the angular velocity and the angular acceleration suddenly increase.
[0149] Specifically, first, the MCU determines the angular acceleration of the electronic pen according to the angular velocity and the acquisition moment corresponding to the angular velocity in the motion state data; then, the MCU matches the angular velocity of the electronic pen with a fifth preset threshold and matches the angular acceleration of the electronic pen with a first preset threshold; in the case where the angular velocity is greater than the fifth preset threshold and the angular acceleration is greater than the first preset threshold, it indicates that the angular velocity and the angular acceleration suddenly increase, and the MCU determines that the electronic pen meets the pressure-sensing calibration condition; in the case where the angular velocity is less than or equal to the fifth preset threshold, and / or, the angular acceleration is less than or equal to the first preset threshold, the angular velocity and / or the angular acceleration do not suddenly increase, and the MCU determines that the electronic pen does not meet the pressure-sensing calibration condition.
[0150] In the case where the angular velocity and the angular acceleration suddenly increase, the MCU executes step S203; in the case where the angular velocity and / or the angular acceleration do not suddenly increase, the MCU executes step S205.
[0151] Step S203: Determine the initial pressure value after calibration of the pressure monitoring area in the suspended state.
[0152] Specifically, in the case where the angular velocity and angular acceleration suddenly increase, first, the MCU obtains the real-time pressure value of the pressure monitoring area at at least two moments within the target time period when it determines that the electronic pen meets the pressure sensing calibration condition by using the pressure sensor, and determines the real-time pressure value as the first pressure value; then, the MCU calculates the average value of the first pressure values, and determines the average value as the initial pressure value after calibration of the pressure monitoring area in the suspended state.
[0153] Step S204: Save the calibrated initial pressure value.
[0154] Specifically, the MCU updates the initial pressure value after calibration of the pressure monitoring area in the suspended state determined in step S203 to the flash memory of the MCU, so as to save the calibrated initial pressure value.
[0155] It can be understood that only the latest determined calibrated initial pressure value obtained through step S203 can be stored in the flash memory of the MCU.
[0156] Step S205: End.
[0157] Specifically, in the case where the angular velocity and / or angular acceleration do not suddenly increase, the MCU does not need to perform the operations corresponding to steps S203 to S204. The MCU can perform step S205 and the operations corresponding to steps S104 to S106 to send the calibrated pressure sensing value to the target electronic device.
[0158] In an alternative embodiment of the present invention, the electronic pen includes a function button; step S101 of determining whether the electronic pen meets the pressure sensing calibration condition includes:
[0159] Step S1013: Determine that the electronic pen meets the pressure sensing calibration condition when receiving the start signal of the function button.
[0160] In the embodiment of the present invention, a function button is provided in the electronic pen. When the user finds that there is a problem of ink leakage and / or handwriting accidental erasure during the use of the electronic pen, the user can send a pressure sensing calibration instruction to the MCU of the electronic pen by activating the function button. Among them, the way for the user to activate the function button may include but is not limited to single pressing the function button, long pressing the function button, rotating the function button, etc.
[0161] When the user activates the function button, the MCU in the electronic pen can receive the activation signal of the function button. When the MCU receives the activation signal of the function button, it can execute step S1013 to determine that the electronic pen meets the pressure sensitivity calibration condition.
[0162] Correspondingly, when the MCU does not receive the activation signal of the function button, it can determine that the electronic pen does not meet the pressure sensitivity calibration condition.
[0163] In the pressure sensitivity calibration method of the electronic pen provided by the embodiments of the present invention, a function button is set in the electronic pen. When the user discovers problems such as ink leakage and / or handwriting accidental erasure in the process of using the electronic pen, by activating the function button, when the MCU receives the activation signal of the function button, it can determine that the electronic pen meets the pressure sensitivity calibration condition and execute the operations corresponding to steps S102 to S103 to update the initial pressure value stored in the flash memory. While solving the problems of ink leakage and handwriting accidental erasure of the electronic pen, it simplifies the operation process for the MCU to determine whether the electronic pen meets the pressure sensitivity calibration condition and improves the efficiency of pressure sensitivity calibration of the electronic pen.
[0164] In an alternative embodiment of the present invention, the number of the first pressure values is at least 2; step S103 of updating the initial pressure value corresponding to the pressure monitoring area according to the first pressure value includes:
[0165] Step S1031: Determine the minimum value among the first pressure values.
[0166] Step S1032: Update the initial pressure value corresponding to the pressure monitoring area to the minimum value.
[0167] In the embodiments of the present invention, the number of the first pressure values obtained by the MCU through step S102 is at least 2.
[0168] Specifically, in the case where the user sends a pressure calibration instruction to the MCU of the electronic pen, for example, the user sends a pressure calibration instruction to the MCU of the electronic pen by means of pen shaking. To avoid the problem that during the process of the user sending a pressure calibration instruction (pen shaking) to the MCU of the electronic pen, the pressure monitoring area accidentally touches other objects (such as the desktop, clothes, etc.), resulting in an overly large first pressure value obtained by the MCU at the moment when the pressure monitoring area touches other objects, and further resulting in an overly large initial pressure value updated based on the first pressure value, the MCU can first determine the minimum value from the first pressure value obtained through step S102 through step S1031; then, through step S1032, update the initial pressure value corresponding to the pressure monitoring area stored in the electronic pen to this minimum value, thereby improving the accuracy of updating the initial pressure value corresponding to the pressure monitoring area based on the first pressure value, and further improving the accuracy and reliability of the writing trace of the electronic pen on the touch screen of the target electronic device.
[0169] In an alternative embodiment of the present invention, step S105 of calibrating the second pressure value according to the initial pressure value to obtain a calibrated pressure value includes:
[0170] Step S1051: Calculate the difference between the second pressure value and the initial pressure value.
[0171] Step S1052: Determine the difference as the calibrated pressure value.
[0172] In the embodiment of the present invention, during the process of the MCU calibrating the second pressure value according to the initial pressure value to obtain a calibrated pressure value, the difference between the second pressure value obtained through step S104 and the initial pressure value stored in the flash memory can be determined as the calibrated pressure value through steps S1051 to S1052. Thus, the second pressure value obtained in real time can be calibrated based on the initial pressure value stored in the flash memory, improving the reliability of the calibrated pressure value sent by the MCU to the target electronic device through step S106, and further improving the accuracy and reliability of the writing trace of the electronic pen on the touch screen of the target electronic device.
[0173] In summary, the embodiment of the present invention provides a pressure sensitivity calibration method for an electronic pen. By determining whether the electronic pen meets the pressure sensitivity calibration condition, and when the electronic pen meets the pressure sensitivity calibration condition, a first pressure value of the pressure monitoring area is obtained by using a pressure sensor arranged in cooperation with the pressure monitoring area, and the initial pressure value corresponding to the pressure monitoring area is updated according to the first pressure value; in the subsequent process of the user using the electronic pen for writing and drawing, the electronic pen calibrates the second pressure value obtained in real time by using the initial pressure value, determines the calibration pressure sensitivity value corresponding to the calibration pressure value, and sends the calibration pressure sensitivity value to the target electronic device for the target electronic device to output corresponding handwriting based on the calibration pressure sensitivity value. When the electronic pen meets the pressure sensitivity calibration condition, the automatic calibration of the initial pressure value of the pressure monitoring area stored in the electronic pen in the suspended state is realized, the problem of ink leakage of the electronic pen caused by changes in the use environment of the electronic pen and damage to the internal structure is overcome, and the accuracy and reliability of the writing and drawing traces of the electronic pen on the touch screen of the target electronic device are improved.
[0174] It should be noted that for the method embodiment, for the sake of simple description, it is all expressed as a series of action combinations. However, those skilled in the art should know that the embodiment of the present invention is not limited by the described action sequence, because according to the embodiment of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiment of the present invention.
[0175] Device embodiment
[0176] Referring to Figure 3 , a logic block diagram of a pressure sensitivity calibration device for an electronic pen provided by an embodiment of the present invention is shown. The electronic pen includes a pressure monitoring area and a pressure sensor arranged in cooperation with the pressure monitoring area; the device includes:
[0177] A first determination module 301, configured to determine whether the electronic pen meets the pressure sensitivity calibration condition;
[0178] A first acquisition module 302, configured to, when the electronic pen meets the pressure sensitivity calibration condition, use the pressure sensor to acquire a first pressure value of the pressure monitoring area; the first pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen meets the pressure sensitivity calibration condition;
[0179] An update module 303, configured to update the initial pressure value corresponding to the pressure monitoring area according to the first pressure value; the initial pressure value is the pressure value of the pressure monitoring area stored in the electronic pen in the suspended state;
[0180] A second acquisition module 304, configured to, when the electronic pen does not meet the pressure sensitivity calibration condition, acquire a second pressure value of the pressure monitoring area by using the pressure sensor; the second pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen does not meet the pressure sensitivity calibration condition;
[0181] A calibration module 305, configured to calibrate the second pressure value according to the initial pressure value to obtain a calibrated pressure value;
[0182] A second determination module 306, configured to determine a calibrated pressure sensitivity value corresponding to the calibrated pressure value, and send the calibrated pressure sensitivity value to a target electronic device for the target electronic device to output a corresponding handwriting based on the calibrated pressure sensitivity value.
[0183] Optionally, the electronic pen further includes a motion sensor; the first determination module includes:
[0184] A first acquisition sub-module, configured to acquire motion state data of the electronic pen by using the motion sensor;
[0185] A first determination sub-module, configured to determine whether the electronic pen meets the pressure sensitivity calibration condition according to the motion state data.
[0186] Optionally, the motion state data includes the angular velocity of the electronic pen at at least two moments and the acquisition moments corresponding to the angular velocity; the first determination sub-module includes:
[0187] A first determination unit, configured to determine the angular acceleration of the electronic pen according to the angular velocity and the acquisition moment corresponding to the angular velocity;
[0188] A second determination unit, configured to determine that the electronic pen meets the pressure sensitivity calibration condition when the angular acceleration is greater than a first preset threshold.
[0189] Optionally, the motion state data further includes the linear acceleration of the electronic pen; the first determination sub-module includes:
[0190] A third determination unit, configured to determine that the electronic pen meets the pressure sensitivity calibration condition when the angular acceleration is greater than a first preset threshold and the linear acceleration is less than a second preset threshold.
[0191] Optionally, the first determination sub-module includes:
[0192] A fourth determination unit, configured to determine the rotation angle of the electronic pen according to the angular velocity and the acquisition moment corresponding to the angular velocity;
[0193] A fifth determination unit, configured to determine that the electronic pen meets the pressure sensitivity calibration condition when the angular acceleration is greater than a first preset threshold, the linear acceleration is less than a second preset threshold, and the rotation angle is greater than a third preset threshold.
[0194] Optionally, the electronic pen includes a function button; the first determination module includes:
[0195] A second determination sub-module, configured to determine that the electronic pen meets the pressure sensitivity calibration condition when a start signal of the function button is received.
[0196] Optionally, the number of the first pressure values is at least 2; the update module includes:
[0197] A third determination sub-module, configured to determine the minimum value among the first pressure values;
[0198] An update sub-module, configured to update the initial pressure value corresponding to the pressure monitoring area to the minimum value.
[0199] Optionally, the calibration module includes:
[0200] A calculation sub-module, configured to calculate a difference between the second pressure value and the initial pressure value;
[0201] A fourth determination sub-module, configured to determine the difference as a calibration pressure value.
[0202] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, refer to the partial description of the method embodiment.
[0203] Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, refer to each other.
[0204] An embodiment of the present invention further provides an electronic pen, which includes a processor, a memory, a communication interface, a communication bus, a pressure monitoring area, and a pressure sensor cooperatively arranged with the pressure monitoring area. The processor, the memory, and the communication interface complete mutual communication through the communication bus; the memory is used to store executable instructions, and the executable instructions cause the processor to execute the pressure sensitivity calibration method of the foregoing electronic pen.
[0205] The processor may be an MCU, a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA or other programmable devices, transistor logic devices, hardware components, or any combination thereof. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0206] The communication bus may include a path for transmitting information between the memory and the communication interface. The communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
[0207] The memory may be a ROM (Read-Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or may also be an EEPROM (Electrically Erasable Programmable Read-Only Memory), a CD-ROM (Compact Disc Read-Only Memory), magnetic tape, a floppy disk, and optical data storage devices, etc.
[0208] The embodiments of the present invention also provide a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by the processor, the pressure sensitivity calibration method of the foregoing electronic pen is implemented.
[0209] The embodiments of the present invention also provide a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by the processor of an electronic device (server or terminal), the processor can execute the pressure sensitivity calibration method of the foregoing electronic pen.
[0210] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference may be made to each other.
[0211] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention can take the form of completely hardware embodiments, completely software embodiments, or embodiments combining software and hardware aspects. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0212] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, as well as the combination of flows and / or blocks in the flowchart and / or block diagram. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of multiple blocks.
[0213] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal devices to work in a predictive manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of multiple blocks.
[0214] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal devices, such that a series of operation steps are executed on the computer or other programmable terminal devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable terminal devices provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of multiple blocks.
[0215] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0216] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.
[0217] The above has introduced in detail a pressure sensitivity calibration method, an electronic pen and a computer program product provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A pressure sensitivity calibration method for an electronic pen, characterized in that, Applied to an electronic pen, the electronic pen includes a pressure monitoring area and a pressure sensor arranged in cooperation with the pressure monitoring area; the method includes: Determine whether the electronic pen meets the pressure sensing calibration condition; When the electronic pen meets the pressure sensing calibration condition, use the pressure sensor to obtain a first pressure value of the pressure monitoring area; the first pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen meets the pressure sensing calibration condition; Update the initial pressure value corresponding to the pressure monitoring area according to the first pressure value; the initial pressure value is the pressure value of the pressure monitoring area stored in the electronic pen in the suspended state; When the electronic pen does not meet the pressure sensing calibration condition, use the pressure sensor to obtain a second pressure value of the pressure monitoring area; the second pressure value is the real-time pressure value of the pressure monitoring area when the electronic pen does not meet the pressure sensing calibration condition; Calibrate the second pressure value according to the initial pressure value to obtain a calibrated pressure value; Determine the calibrated pressure sensing value corresponding to the calibrated pressure value, and send the calibrated pressure sensing value to a target electronic device for the target electronic device to output corresponding handwriting based on the calibrated pressure sensing value.
2. The method according to claim 1, wherein The electronic pen further includes a motion sensor; determining whether the electronic pen meets the pressure sensing calibration condition includes: Use the motion sensor to obtain motion state data of the electronic pen; Determine whether the electronic pen meets the pressure sensing calibration condition according to the motion state data.
3. The method according to claim 2, wherein The motion state data includes the angular velocity of the electronic pen at at least two moments and the acquisition moments corresponding to the angular velocity; determining whether the electronic pen meets the pressure sensing calibration condition according to the motion state data includes: Determine the angular acceleration of the electronic pen according to the angular velocity and the acquisition moment corresponding to the angular velocity; When the angular acceleration is greater than a first preset threshold, determine that the electronic pen meets the pressure sensing calibration condition.
4. The method according to claim 3, wherein The motion state data further includes the linear acceleration of the electronic pen; determining whether the electronic pen meets the pressure sensing calibration condition according to the motion state data includes: When the angular acceleration is greater than the first preset threshold and the linear acceleration is less than a second preset threshold, determine that the electronic pen meets the pressure sensing calibration condition.
5. The method according to claim 4, wherein Determining whether the electronic pen meets the pressure sensing calibration condition according to the motion state data includes: Determine the rotation angle of the electronic pen according to the angular velocity and the acquisition moment corresponding to the angular velocity; When the angular acceleration is greater than the first preset threshold, the linear acceleration is less than the second preset threshold, and the rotation angle is greater than a third preset threshold, determine that the electronic pen meets the pressure sensing calibration condition.
6. The method according to claim 1, wherein The electronic pen includes a function button; determining whether the electronic pen meets the pressure sensing calibration condition includes: When a start signal of the function button is received, determine that the electronic pen meets the pressure sensing calibration condition.
7. The method according to claim 1, characterized in that The number of the first pressure values is at least 2; updating the initial pressure value corresponding to the pressure monitoring area according to the first pressure value includes: Determine the minimum value among the first pressure values; Update the initial pressure value corresponding to the pressure monitoring area to the minimum value.
8. The method according to claim 1, wherein The calibrating the second pressure value according to the initial pressure value to obtain a calibrated pressure value includes: Calculate the difference between the second pressure value and the initial pressure value; Determine the difference as the calibrated pressure value.
9. An electronic pen, characterized in that, The electronic pen includes a processor, a memory, a communication interface, a communication bus, a pressure monitoring area, and a pressure sensor arranged in cooperation with the pressure monitoring area, and the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used for storing executable instructions, and the executable instructions cause the processor to execute the pressure sensing calibration method of the electronic pen according to any one of claims 1 to 8.
10. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the pressure sensing calibration method of the electronic pen according to any one of claims 1 to 8 is implemented.