Stylus calibration method, electronic device, and storage medium
By detecting the wear height and angle of the pen tip and using a preset mapping relationship for compensation, the problem of writing accuracy and consistency caused by pen wear is solved, achieving higher writing accuracy and smoothness.
Patent Information
- Application Number
- CN202311291904.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-09-28
AI Technical Summary
In existing technologies, wear on the pen tip leads to a decrease in writing accuracy and handwriting consistency. The compensation algorithm fails to effectively consider the impact of pen tip wear, resulting in handwriting deviation and uneven writing.
By detecting the wear height of the stylus tip and the angle between it and the touch screen, and using a preset mapping relationship for compensation, the actual position of the worn stylus tip is determined, thus improving positional accuracy.
It improves the writing accuracy and smoothness of the stylus, ensuring that the writing strokes match the pen tip trajectory, thus enhancing the user experience.
Smart Images

Figure CN118444796B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and particularly relates to a stylus calibration method, an electronic device and a storage medium. BACKGROUND
[0002] With the development of touch technology, more and more electronic devices use touch to interact with humans. In addition to being able to use fingers to touch and operate, the touch display screen of an electronic device can also use a stylus to touch and operate.
[0003] Using a stylus to write on an electronic device such as a mobile phone or a tablet computer brings great convenience and enjoyment to users, and this also makes the stylus gradually become a standard configuration of an electronic device. In order to improve the writing accuracy of the stylus and the fluency of the writing trace, and to bring a better experience to users, it is particularly important to accurately detect the position of the tip of the stylus on the touch display screen of the electronic device. SUMMARY
[0004] The present application provides a stylus calibration method, an electronic device and a storage medium, which can consider the influence of tip wear on the position of the tip on the touch display screen in the compensation process, so that the position determined after compensation is the actual position of the worn tip on the touch display screen, thereby improving the accuracy of the stylus.
[0005] In a first aspect, the present application provides a stylus calibration method, which is applied to an electronic device including a touch display screen, the electronic device is in communication connection with a stylus, the stylus includes a tip and an antenna, and the antenna is arranged in the tip. The stylus calibration method can include: detecting a pen-down event; determining a tip wear height of the stylus; determining an included angle between the stylus and the touch display screen as a first angle; and compensating a first tip position corresponding to the stylus according to the first angle and the tip wear height, to obtain a second tip position.
[0006] The pen-down event refers to an event generated when the tip of the stylus contacts the touch display screen of the electronic device; the pen-down event can include touch coordinates, touch force, a timestamp of a touch operation, and angle information.
[0007] The first tip position represents the corresponding report point position of the tip under the pen-down event; and the second tip position represents the position of the tip corresponding to the tip wear height on the touch display screen under the pen-down event.
[0008] The first aspect provides the stylus calibration method, first, the height of the stylus tip wear is determined, and then the first stylus tip position on the touch display screen is compensated according to the angle between the stylus and the touch display screen and the height of the stylus tip wear, and the second stylus tip position on the touch display screen after the wear is obtained. In the compensation process, the influence of the stylus tip wear on the position of the stylus tip on the touch display screen is fully considered, so that the second stylus tip position determined after the compensation is the actual position of the stylus tip on the touch display screen after the wear, thereby improving the accuracy of the second stylus tip position and the accuracy of the stylus.
[0009] When the user uses the worn stylus to write on the touch display screen, if the compensation algorithm in the related art is used to compensate the report point position, the stylus tip position determined by the electronic device (i.e., the report point position after compensation) will not be consistent with the actual position of the stylus tip on the touch display screen after the wear, thereby causing the writing trace displayed on the touch display screen to be inconsistent with the trajectory of the stylus tip moved on the touch display screen, i.e., the writing trace is offset.
[0010] However, when the user uses the worn stylus to write on the touch display screen, the second stylus tip position determined after the compensation is the actual position of the stylus tip on the touch display screen after the wear, so that the writing trace displayed on the touch display screen is consistent with the trajectory of the stylus tip moved on the touch display screen, thereby improving the writing accuracy and fluency of the stylus and improving the user experience.
[0011] In a possible implementation manner, the height of the stylus tip wear is determined, including: collecting a first stylus tip signal strength corresponding to the stylus; and determining the height of the stylus tip wear according to a preset mapping relationship and the first stylus tip signal strength.
[0012] The preset mapping relationship represents the corresponding relationship between different stylus tip signal strengths and different stylus tip wear heights.
[0013] In this implementation manner, based on the preset mapping relationship established in advance, the height of the stylus tip wear corresponding to the first stylus tip signal strength can be quickly found, thereby improving the speed of determining the height of the stylus tip wear. Moreover, since the preset mapping relationship is obtained through multiple measurements in a laboratory environment, the accuracy of the corresponding relationship between different stylus tip signal strengths and different stylus tip wear heights is ensured, thereby ensuring the accuracy of the height of the stylus tip wear corresponding to the first stylus tip signal strength found based on the preset mapping relationship.
[0014] In a possible implementation manner, in the process of establishing the preset mapping relationship, a professional measuring instrument is used to measure different stylus tip wear heights of the stylus, when it is detected that an angle between the stylus with the stylus tip wear height and the touch display screen is the second angle and a click pressure of the stylus with the stylus tip wear height is the preset pressure threshold, the stylus tip signal strength corresponding to the stylus tip wear height is collected and recorded. The multiple different stylus tip wear heights measured in this scenario and the stylus tip signal strength corresponding to each stylus tip wear height are input into the electronic device, and the electronic device establishes the preset mapping relationship based on the multiple different stylus tip wear heights measured in this scenario and the stylus tip signal strength corresponding to each stylus tip wear height.
[0015] Based on this implementation manner, collecting the first stylus tip signal strength can include: detecting that the angle between the stylus and the touch display screen is the second angle and the click pressure of the stylus is the preset pressure threshold, and collecting the first stylus tip signal strength. The absolute value of the difference between the second angle and the first angle is greater than 0.
[0016] In this implementation manner, the preset mapping relationship is established under the condition that it is detected that the angle between the stylus and the touch display screen is the second angle and the click pressure of the stylus is the preset pressure threshold, and the first stylus tip signal strength is collected under the condition that it is detected that the angle between the stylus and the touch display screen is the second angle and the click pressure of the stylus is the preset pressure threshold. The angle between the stylus and the touch display screen is consistent, and the click pressure of the stylus is consistent. The stylus tip wear height found based on the preset mapping relationship is more accurate, which is beneficial to accurately compensating the first stylus tip position based on the stylus tip wear height, thereby improving the accuracy of the second stylus tip position after compensation, and further improving the accuracy of the stylus.
[0017] In a possible implementation manner, the first stylus tip position corresponding to the stylus is compensated according to the first angle and the stylus tip wear height to obtain a second stylus tip position, including: determining a difference between a preset stylus tip compensation height and the stylus tip wear height of the stylus; the preset stylus tip compensation height represents a vertical height between an antenna in an un-worn stylus tip and the touch display screen under a stylus drop event; and determining the second stylus tip position according to the first angle, the difference between the preset stylus tip compensation height and the stylus tip wear height of the stylus, and the first stylus tip position.
[0018] In this implementation manner, when the first stylus tip position is compensated, the influence of the stylus tip wear on the position of the stylus tip on the touch display screen is fully considered, and the coordinate offset is corrected, so that the second stylus tip position determined after compensation is actually the position of the worn stylus tip on the touch display screen, thereby improving the accuracy of the second stylus tip position and improving the accuracy of the stylus.
[0019] In a possible implementation, the electronic device stores a plurality of preset mapping relationships, each of which represents a correspondence between different stylus tip signal strengths and different stylus tip wear heights in a preset scenario of the electronic device; the preset scenario includes at least one of whether the electronic device is in a charging state and whether a screen protection film is attached to the touch display screen.
[0020] When the touch display screen is attached with the screen protection film, the type of the screen protection film can include a plastic film, a water-based film, a tempered film, a frosted film, a mirror film, and the like.
[0021] In this implementation, the electronic device stores preset mapping relationships in different preset scenarios, so that the electronic device and the stylus can match the corresponding preset mapping relationship in different preset scenarios, thereby effectively reducing the interference of the scenario factor on the determination of the stylus tip wear height, and making the stylus tip wear height found in the matched preset mapping relationship more accurate.
[0022] In a possible implementation, the stylus tip wear height of the stylus is determined by: determining the stylus tip wear height of the stylus according to the stylus tip signal strength collected when the electronic device is in the preset scenario and the preset mapping relationship matched with the preset scenario.
[0023] In this implementation, the corresponding preset mapping relationship is matched according to different preset scenarios of the electronic device, which can effectively reduce the interference of the scenario factor on the determination of the stylus tip wear height, make the stylus tip wear height found in the matched preset mapping relationship more accurate, and be conducive to accurately compensating the first stylus tip position based on the stylus tip wear height, thereby improving the accuracy of the second stylus tip position after compensation and further improving the accuracy of the stylus.
[0024] In a possible implementation, the stylus calibration method provided by the embodiment of the application further includes: when it is detected that the stylus replaces the stylus tip, determining that the stylus tip wear height of the stylus is 0.
[0025] In this implementation, when it is detected that the stylus replaces the stylus tip, the stylus tip wear height of the stylus is quickly determined to be 0, the first stylus tip position is compensated again based on the stylus tip wear height, thereby improving the accuracy of the second stylus tip position after compensation and further improving the accuracy of the stylus.
[0026] In a possible implementation, the stylus tip wear height of the stylus is determined by: detecting that the stylus and the electronic device establish a communication connection for the first time, collecting a first stylus tip signal strength corresponding to the stylus; collecting a second stylus tip signal strength corresponding to the stylus; determining a stylus tip signal strength change between the first stylus tip signal strength and the second stylus tip signal strength; and determining the stylus tip wear height of the stylus according to the stylus tip signal strength change and a target mapping relationship.
[0027] The first stylus tip signal intensity refers to the stylus tip signal intensity of the stylus collected by the electronic device when the stylus contacts the touch display screen of the electronic device for the first time.
[0028] The second stylus tip signal intensity is a non-first stylus tip signal intensity, and the second stylus tip signal intensity is greater than the first stylus tip signal intensity.
[0029] The target mapping relationship represents a corresponding relationship between different stylus tip signal intensity change amounts and different stylus tip wear heights.
[0030] Because the stylus tips manufactured by manufacturers can be different, the heights of the stylus tips of the stylus out of the factory are different, and thus the first stylus tip signal intensity corresponding to the stylus out of the factory is different. In this implementation manner, the stylus tip wear height of the stylus is determined based on the stylus tip signal intensity change amount and the target mapping relationship, and is not affected by the manufacturers, so that the stylus tip wear height corresponding to the stylus can be accurately determined, and the first stylus tip position can be accurately compensated, the accuracy of the second stylus tip position after compensation is improved, and thus the accuracy of the stylus is improved.
[0031] In a second aspect, the present application provides an electronic device, which comprises: one or more processors; one or more memories; a module installed with a plurality of application programs; and the memory stores one or more programs, when the one or more programs are executed by the processor, the electronic device executes the method in the first aspect and any possible implementation manner thereof.
[0032] In a third aspect, the present application provides a chip comprising a processor. The processor is configured to read and execute a computer program stored in a memory to execute the method in the first aspect and any possible implementation manner thereof.
[0033] Optionally, the chip further comprises a memory, and the memory is connected to the processor through a circuit or a wire.
[0034] Optionally, the chip further comprises a communication interface.
[0035] In a fourth aspect, the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program is executed by an electronic device, the electronic device executes the method in the first aspect and any possible implementation manner thereof.
[0036] In a fifth aspect, the present application provides a computer program product, and the computer program product comprises: computer program code, when the computer program code is executed on an electronic device, the electronic device executes the method in the first aspect and any possible implementation manner thereof.
[0037] In a sixth aspect, this application provides a device system including a stylus and an electronic device. The electronic device includes a touch display screen and is communicatively connected to the stylus. The stylus can perform touch operations on the touch display screen. The stylus and the electronic device cooperate with each other to enable the electronic device to perform the methods in the first aspect and any possible implementation thereof.
[0038] In a seventh aspect, this application provides a stylus, which includes a pen tip, a button, a pen body, and a main circuit board. The stylus cooperates with an electronic device to enable the electronic device to perform the methods in the first aspect and any possible implementation thereof.
[0039] The technical effects achieved by the second, third, fourth, fifth, sixth, and seventh aspects mentioned above are similar to the technical effects achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0040] Figure 1(a) is a schematic diagram of an application scenario of a stylus provided in an embodiment of this application;
[0041] Figure 1(b) is a schematic diagram of another application scenario of the stylus provided in the embodiment of this application;
[0042] Figure 2 This is a schematic diagram of the structure of a stylus 100 provided in an embodiment of this application;
[0043] Figure 3 A schematic diagram of the structure of an unworn pen tip provided for an embodiment of this application;
[0044] Figure 4 A schematic diagram of the structure of a worn pen tip provided in an embodiment of this application;
[0045] Figure 5 This is a schematic diagram of the hardware structure of an electronic device shown in an exemplary embodiment of this application;
[0046] Figure 6 This is a hardware interaction diagram between a stylus and an electronic device, illustrating an exemplary embodiment of this application.
[0047] Figure 7 This is a schematic flowchart illustrating a stylus calibration method according to an embodiment of this application;
[0048] Figure 8 This is a schematic diagram of pen tips with different degrees of wear, as shown in one embodiment of this application;
[0049] Figure 9 This is a flowchart illustrating step S304 of a stylus calibration method according to an embodiment of this application.
[0050] Figure 10 A schematic diagram of different degrees of wear of a stylus tip is shown for another embodiment of the present application;
[0051] Figure 11 A specific flow chart of step S302 of a stylus calibration method is shown for an embodiment of the present application;
[0052] Figure 12 A schematic diagram of a preset mapping relationship is shown for an embodiment of the present application;
[0053] Figure 13 A schematic flow chart of another stylus calibration method is shown for an embodiment of the present application;
[0054] Figure 14 A schematic diagram of a target mapping relationship is shown for an embodiment of the present application;
[0055] Figure 15 A schematic diagram of a chip structure is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0056] The technical solutions in the present application will be described below with reference to the accompanying drawings.
[0057] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the present application only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0058] Hereinafter, the terms "first" and "second" are only used for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more features. In the description of the embodiments, unless otherwise specified, the meaning of "multiple" is two or more than two.
[0059] Reference within the specification to "one embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase "in one embodiment" or "in some embodiments" in various places within specified
[0060] It should be noted that the touch pen calibration method provided by the embodiments of the present application can be applied to any electronic device with a touch display screen.
[0061] In some embodiments of the present application, the electronic device can be referred to as a user equipment (UE), a terminal device, etc. For example, the electronic device can be a smart screen, a tablet computer (PAD), a handheld device (such as a mobile phone) with a wireless communication function, a wearable device, a television, a vehicle-mounted electronic device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, a wireless terminal device in industrial control, a wireless terminal device in self driving, a wireless terminal device in remote medical treatment, a wireless terminal device in smart grid, a wireless terminal device in transportation safety, a wireless terminal device in smart city, a wireless terminal device in smart home, etc. The electronic device can also be a device or apparatus that can include a touch display screen, and the specific type of the electronic device is not limited in the embodiments of the present application.
[0062] In order to better understand the touch pen calibration method provided by the embodiments of the present application, the following first explains some terms involved in the embodiments of the present application, so as to facilitate the understanding of the skilled in the art.
[0063] 1. Stylus
[0064] The stylus is also called a handwriting pen. In embodiments of the present application, the stylus can include an active stylus.
[0065] The active stylus is also called an active pen, or an active handwriting pen. The active stylus can emit a touch signal, and an electronic device receives the touch signal and determines the position of the tip of the active stylus on a touch display screen based on the touch signal.
[0066] 2. Point reporting position
[0067] In embodiments of the present application, the point reporting position refers to the position of the tip of the stylus on the touch display screen detected by the electronic device through the touch signal emitted by the antenna in the stylus when the tip of the stylus contacts the touch display screen.
[0068] The above is a brief introduction to the terms involved in embodiments of the present application, which will not be described again below.
[0069] With the development of touch technology, more and more electronic devices use touch to interact with humans. In addition to using fingers to contact and operate, the touch display screen of the electronic device can also use a stylus to perform touch operations, which enriches the application scenarios of the stylus. For example, using a stylus can perform writing operations on electronic devices such as mobile phones and tablet computers, bringing great convenience and creative fun to users.
[0070] The application scenarios of the stylus in the present application will be described below in conjunction with the accompanying drawings.
[0071] Please refer to FIG. 1(a), which is a schematic diagram of an application scenario of a stylus provided in an embodiment of the present application. The application scenario includes a stylus 100 and an electronic device 200. As shown in FIG. 1(a), the stylus 100 can be an active stylus, and the electronic device 200 can be a tablet computer. The active stylus is used in combination with the tablet computer. A user uses the active stylus to perform input operations on the touch display screen of the tablet computer, and the tablet computer performs responses to the input operations.
[0072] Please refer to FIG. 1(b), which is another schematic diagram of an application scenario of a stylus provided in an embodiment of the present application. As shown in FIG. 1(b), the stylus 100 can be an active stylus, and the electronic device 200 can be a mobile phone. The active stylus is used in combination with the mobile phone. Similarly, a user uses the active stylus to perform input operations on the touch display screen of the mobile phone, and the mobile phone performs responses to the input operations.
[0073] Specifically, the stylus 100 allows for direct touch operation on the touchscreen display of the electronic device 200, enabling input via the stylus 100. For example, input via the stylus 100 can be used for writing and drawing, or to recognize relevant control commands; there are no limitations on this. These control commands may include commands to switch brushes, switch colors, switch to eraser mode, switch stroke thickness, and undo.
[0074] The stylus 100 and the electronic device 200 can communicate via short-range wireless communication to enable information exchange between them. In the application scenario shown in Figure 1, the short-range wireless communication connection can include, but is not limited to: Bluetooth connection, Wi-Fi connection, Wi-Fi peer-to-peer (P2P) connection, Zigbee connection, and Near Field Communication (NFC) connection.
[0075] The application scenarios of the stylus in this application have been described above. The structure of the stylus is described below with reference to the accompanying drawings. Please refer to... Figure 2 , Figure 2 This is a schematic diagram of the structure of a stylus 100 provided in an embodiment of this application. Figure 2 As shown, the stylus 100 may include a pen tip 1011, a button 1012, a pen body 1013, and a main circuit board. The main circuit board is disposed in the pen body 1013, and a first antenna is disposed in the pen tip 1011.
[0076] Specifically, the touch display screen of the electronic device 200 is a capacitive touch display screen with electrodes distributed on it. When the stylus 100 approaches or touches the capacitive touch display screen, the portion of the stylus 100 that approaches or touches the capacitive touch display screen (such as the stylus tip 1011) forms a capacitance with the electrodes near the corresponding position on the capacitive touch display screen. Then, the stylus 100 emits a touch signal through a first antenna, which is transmitted to the electronic device 200 via the main circuit board. After receiving the touch signal emitted by the first antenna, the electronic device 200 can detect the stylus tip signal strength of the touch signal and obtain the stylus tip signal strength of the stylus tip 1011.
[0077] Alternatively, in one possible implementation, after receiving the touch signal emitted by the first antenna, the electronic device 200 can determine the position of the stylus tip 1011 on the touch display screen based on the touch signal emitted by the first antenna.
[0078] like Figure 2As shown, the second antenna is also arranged in the pen body 1013. After the capacitance is formed, the stylus 100 sends the touch signal through the second antenna, and the main circuit board sends the touch signal sent by the second antenna to the electronic device 200. After receiving the touch signals sent by the first antenna and the second antenna, the electronic device 200 can determine the position of the stylus tip 1011 on the touch display screen according to the touch signals sent by the first antenna and the second antenna.
[0079] The key 1012 is arranged on the pen body 1013 and is used to control the stylus 100 to trigger various functions (for example, turning off, turning on, switching eraser and brush, etc.).
[0080] In order to improve the writing feeling of the user, the shell of the stylus tip 1011 is usually made of plastic material, that is, a layer of plastic is wrapped outside the first antenna, which will cause inaccurate detection when the touch signal sent by the first antenna is used to detect the position of the stylus tip 1011 on the touch display screen. For example, Figure 2 As shown, the end of the stylus tip 1011 away from the pen body 1013 is tapered, and the tip of the taper is adjacent to the first antenna. When the stylus 100 contacts the touch display screen, if the stylus 100 is perpendicular to the touch display screen, the vertical projection position of the first antenna on the touch display screen is consistent with the position of the tip on the touch display screen. At this time, the position of the stylus tip 1011 on the touch display screen detected by the touch signal sent by the first antenna is the actual position of the stylus tip 1011 on the touch display screen.
[0081] If the stylus 100 is not perpendicular to the touch display screen, that is, the stylus 100 is inclined to the touch display screen, the vertical projection position of the first antenna on the touch display screen is not consistent with the position of the tip on the touch display screen. For example, when the stylus 100 is inclined to the right, the vertical projection position of the first antenna on the touch display screen is behind the position of the tip on the touch display screen. Therefore, it is necessary to use a compensation algorithm to compensate the reported position (that is, the position of the stylus tip 1011 on the touch display screen detected by the touch signal sent by the first antenna) so that the compensated reported position is consistent with the actual position of the tip on the touch display screen.
[0082] However, since the shell of the pen tip 1011 is made of plastic material, as the use time of the stylus 100 increases, the tip of the pen tip 1011 will be worn. However, the compensation algorithm in the related art does not take into account the wear of the pen tip when compensating the reported point position. Therefore, if the compensation algorithm in the related art is still used to compensate the reported point position, the reported point position after compensation will be inconsistent with the actual position of the tip on the touch display screen due to excessive compensation. If the reported point position after compensation is taken as the position of the pen tip (i.e., the actual position of the pen tip 1011 of the stylus 100 on the touch display screen), the determined position of the pen tip will be inaccurate, which will cause the writing trace displayed on the touch display screen to be inconsistent with the writing trace of the pen tip, and the writing accuracy of the stylus will be reduced.
[0083] Referring to Figure 3 , Figure 3 a structure diagram of a non-worn pen tip is provided in an embodiment of the present application. Figure 3 The first antenna shown in Figure 2 The structure of the first antenna after amplification, the side of the first antenna close to the tip is adjacent to the tip of the pen tip 1011. When the stylus 100 is not perpendicular to the touch display screen, i.e., the stylus 100 is inclined to the touch display screen, the vertical projection position of the first antenna on the touch display screen is inconsistent with the actual position of the tip on the touch display screen.
[0084] As Figure 3 shown, the tip intersects the touch display screen at point A, and the vertical projection of the first antenna on the touch display screen intersects the touch display screen at point B. Point B is on the right side of point A, or point B is after point A. The compensation algorithm is used to compensate the reported point position (i.e., the position of point B), so that the reported point position after compensation (i.e., the position of point B after compensation) is consistent with the actual position of the tip on the touch display screen (i.e., the position of point A). It can be understood that the coordinate deviation amount AB is calculated, and the coordinate of point B is compensated by the coordinate deviation amount AB to obtain the coordinate of point A.
[0085] Among them, the coordinate deviation amount AB can be obtained by calculating the cosine value of the included angle between the stylus 100 and the touch display screen. For example, the information sent by the stylus 100 to the electronic device 200 carries the included angle between the stylus 100 and the touch display screen, and the vertical height of the tip is also known, so the coordinate deviation amount AB can be directly calculated.
[0086] Figure 3 The scene described in the corresponding embodiment is a scene for compensating a non-worn pen tip. If the compensation algorithm in the related art is still used to compensate the worn pen tip, the finally determined position of the pen tip will be inaccurate.
[0087] Referring to Figure 4 ,Figure 4 A schematic diagram of a worn-out stylus tip is provided in an embodiment of the present application. As shown, the tip of the stylus tip 1011 is worn out. In this case, when the stylus 100 contacts the touch display screen, the first antenna on the side close to the tip is closer to the touch display screen. It can be understood that, in this case, the reported point position is closer to the actual position of the stylus tip 1011 on the touch display screen. If the compensation algorithm in the related art is still used to compensate the reported point position, the compensated reported point position will be beyond the actual position of the stylus tip 1011 on the touch display screen due to over-compensation, resulting in inaccurate stylus tip position determined finally, and further resulting in inconsistency between the writing trace displayed on the touch display screen and the stylus trace, i.e. writing trace offset, reducing the writing accuracy of the stylus and the user experience. Figure 4
[0088] Therefore, an electronic device calibration method is provided in an embodiment of the present application. The method is applied to an electronic device including a touch display screen. The electronic device is in communication connection with a stylus. The stylus includes a stylus tip. The method includes detecting a pen-down event, determining a stylus tip wear height of the stylus, determining an included angle between the stylus and the touch display screen as a first angle, and compensating a first stylus tip position corresponding to the stylus according to the first angle and the stylus tip wear height to obtain a second stylus tip position. The first stylus tip position represents a reported point position corresponding to the stylus tip under the pen-down event. The second stylus tip position represents a position of the stylus tip on the touch display screen corresponding to the stylus tip wear height under the pen-down event.
[0089] The electronic device calibration method provided in an embodiment of the present application first determines the stylus tip wear height of the current stylus, and then compensates the first stylus tip position of the un-worn stylus tip on the touch display screen according to the included angle between the stylus and the touch display screen and the stylus tip wear height to obtain the second stylus tip position of the worn stylus tip on the touch display screen. In the compensation process, the influence of the stylus tip wear on the position of the stylus tip on the touch display screen is fully considered, so that the second stylus tip position determined after compensation is actually the position of the worn stylus tip on the touch display screen, thereby improving the accuracy of the second stylus tip position and the accuracy of the stylus.
[0090] When a user writes on the touch display screen using the worn stylus, if the compensation algorithm in the related art is used to compensate the reported point position, the stylus tip position determined by the electronic device (i.e. the compensated reported point position) will be inconsistent with the actual position of the worn stylus tip on the touch display screen, resulting in inconsistency between the writing trace displayed on the touch display screen and the trajectory of the worn stylus tip moved on the touch display screen, i.e. writing trace offset.
[0091] When the user writes on the touch display screen using the worn stylus, the second stylus tip position determined after compensation is the actual position of the worn stylus tip on the touch display screen, so that the writing traces displayed on the touch display screen are consistent with the track of the worn stylus tip moving on the touch display screen, thereby improving the writing accuracy and writing fluency of the stylus and improving the user experience.
[0092] The structure of the stylus is described above in combination with the drawings, and the hardware structure of the electronic device 200 involved in the embodiments of the present application is briefly introduced in combination with the drawings.
[0093] Please refer to Figure 5 , Figure 5 The hardware structure of the electronic device shown in an exemplary embodiment of the present application is shown in the figure.
[0094] As Figure 5 shown, the electronic device 200 can include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charge management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headset interface 270D, a sensor module 280, a key 290, a motor 291, an indicator 292, a camera 293, a display screen 292, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 can include a pressure sensor 280A, a gyroscope sensor 280B, a barometric pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, etc.
[0095] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0096] The processor 210 can include one or more processing units, for example: the processor 210 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
[0097] The memory in the processor 210 can also be configured to store instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory can save instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to use the instructions or data again, it can be directly called from the memory. Avoid repeated access and reduce the waiting time of the processor 210, thereby improving the efficiency of the system.
[0098] In the embodiments of the present application, the memory in the processor 210 can be used to store a plurality of preset mapping relationships. Each preset mapping relationship represents the correspondence between different stylus tip signal strengths and different stylus tip wear heights of the electronic device 200 in a preset scene.
[0099] The charging management module 240 is configured to receive charging input from a charger. The charging management module 240 can also supply power to the electronic device 200 through the power management module 241 while charging the battery 242. In the embodiments of the present application, the stylus 100 can also be charged through the charging management module 240.
[0100] The power management module 241 is configured to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the display screen 294, the camera 293, and the wireless communication module 260, etc. In the embodiments of the present application, the stylus 100 can also be powered through the power management module 241.
[0101] The wireless communication function of the electronic device 200 can be realized through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor and the baseband processor, etc.
[0102] The antenna 1 and the antenna 2 are used for transmitting and receiving electromagnetic wave signals. The structure of the antenna 1 and the antenna 2 in the embodiment is only an example. Each antenna in the electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
[0103] The mobile communication module 250 can provide a solution including 2G / 3G / 2G / 5G wireless communication applied to the electronic device 200.
[0104] The wireless communication module 260 can provide a solution including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, and the like wireless communication applied to the electronic device 200. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 can also receive signals to be sent from the processor 210, perform frequency modulation, amplification, and convert them into electromagnetic wave radiation via the antenna 2. In the embodiment of the present application, the wireless communication module 260 can establish a short-distance wireless communication connection with the stylus 100.
[0105] In some embodiments, the antenna 1 of the electronic device 200 is coupled with the mobile communication module 250, and the antenna 2 is coupled with the wireless communication module 260, so that the electronic device 200 can communicate with other devices through wireless communication technology, for example, so that the electronic device 200 can communicate with the stylus 100 through wireless communication technology.
[0106] The electronic device 200 realizes the display function through the GPU, the display screen 294, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 can include one or more GPUs that execute program instructions to generate or change display information.
[0107] The display screen 294 is configured to display images, videos, and the like. A series of graphical user interfaces (GUIs) can be displayed on the display screen 294 of the electronic device 200.
[0108] In some embodiments, the display screen 294 can be a touch display screen. The display screen 294 can include a touch sensor 280K. The touch sensor 280K can also be referred to as a “touch panel”. That is, the display screen 294 can include a display panel and a touch panel, and the touch sensor 280K and the display screen 294 form a touch display screen, which can also be referred to as a “touch screen”. The touch sensor 280K is configured to detect a touch operation applied thereto or in the vicinity thereof. After detecting the touch operation, the touch sensor 280K can transmit the touch operation to an upper layer via a kernel layer driver (e.g., a TP driver) to determine a touch event type. A visual output related to the touch operation can be provided via the display screen 294. In some other embodiments, the touch sensor 280K can be disposed on a surface of the electronic device 200, which is different from the position of the display screen 294.
[0109] For example, when the touch sensor 280K receives a touch operation of the stylus 100, the kernel layer processes the touch operation into a raw input event, which includes information such as a touch coordinate, a touch force, a timestamp of the touch operation, a type of the touch subject, and the like. The raw input event is stored in the kernel layer, and the kernel layer reports the raw input event to the application framework layer. The application framework layer analyzes the information included in the raw input event to obtain an operation type and a report point position. Meanwhile, the application framework layer can determine a focus application according to a current focus, and send the analyzed information to the focus application.
[0110] For example, the current focus is a position in the touch display screen touched by the stylus 100 in the current touch operation, and the focus application is an application running in the foreground of the electronic device 200 or an application corresponding to the position touched in the touch operation.
[0111] The GPU is configured to render an image corresponding to the raw input event, and pre-process the rendered layer. The hardware compositor is configured to superimpose and compose the pre-processed layer into an image, and the display driver of the kernel layer is configured to display the image, so that the touch display screen displays a corresponding interface that should be displayed by the focus application in response to the raw input event.
[0112] The internal memory 221 can be used to store computer executable program codes, the executable program codes including instructions. The processor 210 performs various function applications and data processing of the electronic device 200 by running the instructions stored in the internal memory 221. The internal memory 221 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one APP (such as a sound playing function, an image playing function, etc.) required by a function, etc. The data storage area can store data (such as a plurality of preset mapping relationships) created during use of the electronic device 200, etc. In addition, the internal memory 221 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0113] The pressure sensor 280A is used to sense a pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 280A can be disposed on the display screen 294. There are many types of pressure sensors 280A, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates with conductive material. When a force is applied to the pressure sensor 280A, the capacitance between the electrodes changes. The electronic device 200 determines the intensity of the pressure according to the change in capacitance. For example, when the stylus 100 is close to or contacts the display screen 294, the part (such as the tip) of the stylus 100 close to or contacting the display screen 294 forms a capacitance with the electrodes near the corresponding position of the display screen 294. Then, the stylus 100 sends a touch signal through the first antenna, and the touch signal is sent to the electronic device 200 through the main circuit board. After receiving the touch signal sent by the first antenna, the electronic device 200 determines the tip signal intensity according to the change in capacitance.
[0114] The electronic device 200 can also calculate the position of the touch according to the detection signal of the pressure sensor 280A. For example, the position of the tip of the stylus 100 on the touch display screen is determined.
[0115] The acceleration sensor 280E can detect the acceleration of the electronic device 200 in various directions (generally three axes). When the electronic device 200 is stationary, the acceleration sensor 280E can detect the size and direction of gravity. It can also be used to identify the posture of the electronic device, applied to landscape / portrait screen switching, pedometer, etc.
[0116] It can be understood that the electronic device can also include a speed sensor. The speed sensor is used to obtain the moving speed of the electronic device.
[0117] The stylus calibration method provided in the embodiments of the present application can be implemented in the electronic device 200 with the above hardware structure.
[0118] The hardware structure of the electronic device 200 involved in the embodiments of the present application is briefly introduced above, and the hardware interaction between the stylus 100 and the electronic device 200 involved in the embodiments of the present application is described below in combination with the drawings.
[0119] Please refer to Figure 6 , Figure 6 The hardware interaction diagram between the stylus and the electronic device according to an exemplary embodiment of the present application is shown. As shown in Figure 6 , the stylus 100 can include a micro controller unit (MCU) 101, a first communication module 102, an antenna 103, a sensor module 104, a charging module 105 and a battery 106.
[0120] The sensor module 104 can include but is not limited to a pressure sensor 114 and an acceleration sensor 124, and the antenna 103 can include a first antenna and a second antenna.
[0121] The electronic device 200 can include a touch display screen 201 and a second communication module 202. The touch display screen can include a touch panel sensor (TP) 211 and a touch integrated circuit (IC) chip 212.
[0122] The first communication module 102 in the stylus 100 and the second communication module 202 in the electronic device 200 can be wireless communication modules such as wireless local area network (e.g. Wi-Fi network) modules, Bluetooth modules and near field communication (NFC) modules, and the embodiments of the present application do not limit this.
[0123] It should be understood that the stylus 100 and the electronic device 200 can establish a short distance wireless communication connection through the first communication module 102 and the second communication module 202. For example, a Bluetooth channel can be established between the stylus 100 and the electronic device 200, and through the Bluetooth channel, information such as configuration parameters and pressure signals can be transmitted between the stylus 100 and the electronic device 200.
[0124] The configuration parameters are used to instruct the stylus 100 to send touch signals according to a certain rule. The touch signals can be used by the electronic device 200 to determine the position of the stylus tip (or stylus tip position) of the stylus 100 on the touch display screen 201.
[0125] The touch sensor 211 in the electronic device 200 is composed of an electrode array, which includes a plurality of electrodes arranged in rows and columns. When the stylus 100 is close to or contacts the touch sensor 211, the part (e.g., the stylus tip) of the stylus 100 close to or contacting the touch sensor 211 forms a capacitor with the electrodes near the corresponding position of the touch sensor, and an electrical circuit is established through the capacitor.
[0126] After the electrical circuit is established, the stylus 100 and the electronic device 200 can interact signals through the electrical circuit. For example, the touch sensor 211 in the electronic device 200 can send an uplink signal to the stylus 100 through the electrical circuit, and the antenna in the stylus 100 can send a touch signal to the electronic device 200 through the electrical circuit. The uplink signal and the touch signal are usually square wave signals.
[0127] The touch sensor 211 in the electronic device 200 is used to collect touch information. The touch information can include information about the stylus 100 touching the touch display screen 201 of the electronic device 200 and information about a user (e.g., a finger or a knuckle of the user) touching the touch display screen 201. In the embodiments of the present application, the touch information mainly refers to information about the stylus tip of the stylus 100 performing touch operations on the touch display screen 201. The touch IC chip 212 in the electronic device 200 can determine the position of the stylus tip of the stylus 100 on the touch display screen 201 based on the touch information collected by the touch sensor 211.
[0128] The pressure sensor 114 in the stylus 100 can be arranged at the stylus tip of the stylus 100 and is used to collect pressure signals of the stylus tip. For example, when the stylus tip of the stylus 100 contacts the touch display screen 201 of the electronic device 200, the pressure sensor 114 can collect pressure signals generated by the touch display screen 201 pressing the stylus tip. The stylus 100 can send the pressure signals to the electronic device 200 through the wireless communication connection, so that the electronic device 200 can determine the click pressure of the stylus 100 according to the pressure signals.
[0129] The acceleration sensor 124 in the stylus 100 can be used to collect three-axis acceleration values of the stylus 100, including an acceleration value on the X-axis, an acceleration value on the Y-axis, and an acceleration value on the Z-axis.
[0130] The acceleration sensor 124 can also send the three-axis acceleration values to the MCU 101, and the MCU 101 can obtain the inclination and motion state of the stylus 100 based on the three-axis acceleration values. The motion state is used to represent whether the stylus 100 is in a stationary state or a non-stationary state.
[0131] The MCU 101 can also be configured to control the operation of corresponding components in the stylus 100 based on the three-axis acceleration values collected by the acceleration sensor 124. For example, when the MCU 101 determines that the stylus 100 is in a flat state, the MCU 101 can control the antenna 103, the pressure sensor 114, and other components to stop working, thereby reducing the power consumption of the stylus 100.
[0132] The charging module 105 in the stylus 100 described above can be configured to receive a charging input to charge the battery 106 in the stylus 100.
[0133] It should be understood that Figure 6 The hardware structure of the stylus 100 and the hardware structure of the electronic device 200 shown above are only examples, and in actual implementation, one or more of the above modules can be added or reduced, or the above modules can be combined. The embodiments of the present application do not make specific limitations on this.
[0134] Please refer to Figure 7 , Figure 7 A schematic flowchart of a stylus calibration method according to an embodiment of the present application is shown. The method will be described in detail below.
[0135] S301, a pen drop event is detected.
[0136] In the embodiments of the present application, the pen drop event is also referred to as an original input event, or a TP report point event. The pen drop event refers to an event generated when the tip of the stylus contacts the touch display screen of the electronic device.
[0137] The pen drop event can include touch coordinates, touch force, a timestamp of the touch operation, and an angle of the stylus, etc.
[0138] It should be understood that the user can directly perform a touch operation on the touch display screen of the electronic device by using the stylus to achieve the input of the stylus. For example, the user can write and draw by using the input of the stylus, and the user can also recognize related control instructions by using the input of the stylus, etc. The related control instructions can include a brush switching instruction, a color switching instruction, an eraser switching instruction, a stroke thickness switching instruction, a cancel instruction, etc.
[0139] For example, when the user performs a touch operation on the touch display screen of the electronic device by using the stylus, the tip of the stylus contacts the touch display screen of the electronic device. The touch sensor in the electronic device receives the touch operation of the stylus, and identifies the pen drop event corresponding to the touch operation through the kernel layer in the electronic device.
[0140] Optionally, in a possible implementation, before detecting the pen-down event, a short-range wireless communication connection between the stylus and the electronic device can be established first. For example, when the user needs to use the stylus as an auxiliary tool to control the electronic device or to write on the electronic device, the user can trigger the stylus to turn on. After the stylus turns on, the Bluetooth module of the stylus can be started. After the Bluetooth module of the stylus is started, the Bluetooth module of the stylus can establish a Bluetooth connection with the electronic device.
[0141] For example, after the Bluetooth module of the stylus is started, the Bluetooth module of the stylus can send handshake data to the electronic device (for example, a tablet computer, a smart phone, or the like). When the distance between the stylus and the electronic device meets a preset connection threshold, the electronic device can receive the handshake data from the stylus. Then, the electronic device performs device verification according to the received handshake data, and returns a device verification result to the stylus.
[0142] When the device verification result returned by the electronic device to the stylus indicates that the verification is passed, the stylus sends Bluetooth information of the stylus to the electronic device. Then, the electronic device performs Bluetooth information verification according to the received Bluetooth information. Finally, the electronic device returns a Bluetooth information verification result to the stylus. When the Bluetooth information verification result indicates that the verification is passed, the electronic device and the stylus establish a Bluetooth connection.
[0143] It can be understood that the "preset connection threshold" described above refers to the maximum transmission distance for Bluetooth communication between the stylus and the electronic device, for example, within 8 meters, within 10 meters, within 15 meters, or the like.
[0144] Optionally, in a possible implementation, the electronic device and the stylus can each include a wireless chip that can support wireless communication within a preset distance. For example, the stylus can send handshake data to the electronic device in a wireless transparent transmission manner. The handshake data can include device information of the stylus, such as a device name, a serial number (SN), software system information, product hardware information, or the like, and the present application does not limit the device information of the stylus.
[0145] It can be understood that the "preset distance" described above refers to the maximum transmission distance for communication between the wireless chip of the stylus and the wireless chip of the electronic device.
[0146] It should be understood that in the embodiments of the present application, the electronic device and the stylus both include a Bluetooth module integrated with Bluetooth function, which is used for communication through Bluetooth transmission. Optionally, the Bluetooth module can include a chip, a circuit set, and other peripheral devices, etc., which will not be described here. Optionally, the Bluetooth module can include a classic Bluetooth (BT) module or a Bluetooth Low Energy module (BLE), and the embodiments of the present application do not limit the implementation form of the Bluetooth module.
[0147] It should also be understood that in the embodiments of the present application, the Bluetooth information of the stylus can include Bluetooth protocol information, wireless information, Media Access Control (MAC) address information, Internet protocol address (IP address) and other information related to Bluetooth connection of the stylus.
[0148] S302, determining the stylus tip wear height of the stylus.
[0149] As the name implies, the stylus tip wear height of the stylus is the height worn off by the stylus tip of the stylus, which can also be understood as the height worn off by the tip of the stylus.
[0150] For ease of understanding, please refer to Figure 8 , Figure 8 is a schematic diagram of the stylus tip with different wear degrees according to an embodiment of the present application. As shown in (a) of Figure 8 , the tip is not worn, or in other words, the stylus tip of the stylus is not worn, that is, the stylus tip wear height of the stylus is 0. Among them, the stylus tip wear height refers to the height worn off by the stylus tip or the tip.
[0151] It should be understood that when the tip is not worn, or in other words, the stylus tip of the stylus is not worn, the height of the tip is a preset height. Among them, the preset height can be a specific height, or a height range. For example, the preset height can be 0.8 millimeters (mm), 0.9 mm, 1 mm, 1.1 mm, 1.2 mm, etc., and the preset height can also be 0.7 mm-1.3 mm. It should be understood that the height of the unworn tip is determined by the process when the stylus is made, and the embodiments of the present application do not limit this.
[0152] As shown in (b) of Figure 8As shown in (a) of FIG. 1, the stylus is perpendicular to the touch display screen, and the tip of the stylus contacts the touch display screen of the electronic device. The measured H represents the height of the un-worn tip. In the embodiments of the present application, the height of the un-worn tip is also the preset tip compensation height, which is the vertical height between the first antenna in the un-worn tip and the touch display screen.
[0153] As shown in (b) of FIG. 1, the tip is worn, or the tip of the stylus is worn, and the worn height of the tip of the stylus is h1. It can be understood that the worn height of the tip of the stylus is relative to the un-worn tip, or the un-worn tip of the stylus. Figure 8 As shown in (c) of FIG. 1, the tip is completely worn, or the tip of the stylus is completely worn, and the worn height of the tip of the stylus is h2. In this case, the worn height of the tip of the stylus is equal to the height of the tip, i.e., h2 is equal to H.
[0154] Figure 8 As shown in (c) of FIG. 1, the tip is completely worn, or the tip of the stylus is completely worn, and the worn height of the tip of the stylus is h2. In this case, the worn height of the tip of the stylus is equal to the height of the tip, i.e., h2 is equal to H.
[0155] For example, in a possible implementation, the height of the un-worn tip and the height of the tip remaining after being worn are measured, the difference between the height of the un-worn tip and the height of the tip remaining after being worn is calculated, and the worn height of the tip of the stylus is obtained. Then, the worn height of the tip of the stylus is input into the electronic device, for example, the user manually inputs the worn height of the tip of the stylus into the electronic device.
[0156] Optionally, in a possible implementation, the height of the un-worn tip and the height of the tip remaining after being worn can be input into the electronic device, the difference between the height of the un-worn tip and the height of the tip remaining after being worn is calculated by the electronic device, and the worn height of the tip of the stylus is obtained.
[0157] Optionally, in a possible implementation, after the worn height of the tip of the stylus is determined, the determined worn height of the tip is stored in the register of the electronic device. When a new worn height of the tip is determined again, the new worn height of the tip can replace the previously stored worn height of the tip, so that the worn height of the tip stored in the electronic device is always the latest. This is beneficial to subsequent compensation of the first tip position based on the latest worn height of the tip, thereby improving the accuracy of the second tip position after compensation, and further improving the accuracy of the stylus.
[0158] S303, determine that the included angle between the stylus and the touch display screen is a first angle.
[0159] In the embodiments of the present application, the first angle can be a non-90-degree angle.
[0160] In one example, when the stylus is perpendicular to the touch display screen, i.e., the angle between the stylus and the touch display screen is 90 degrees, in the pen-down event, the report point position corresponding to the stylus tip with the tip wear height is consistent with the position of the stylus tip with the tip wear height on the touch display screen, and at this time, the report point position does not need to be compensated.
[0161] In another example, when the stylus is inclined to the touch display screen, i.e., the angle between the stylus and the touch display screen is not 90 degrees, in the pen-down event, the report point position corresponding to the stylus tip with the tip wear height is not consistent with the actual position of the stylus tip with the tip wear height on the touch display screen, and at this time, the report point position needs to be compensated to obtain the actual position of the stylus tip with the tip wear height on the touch display screen. Therefore, it is necessary to determine whether the angle between the stylus and the touch display screen is the first angle.
[0162] Exemplarily, the first antenna and the second antenna are respectively fixedly arranged at the stylus tip and the stylus body of the stylus, and the distance between the first antenna and the second antenna can be directly obtained. In the pen-down event, the electronic device can obtain the vertical projection position of the first antenna on the touch display screen and the vertical projection position of the second antenna on the touch display screen, and can calculate the distance between the vertical projection positions of the first antenna and the second antenna on the touch display screen. According to the distance between the first antenna and the second antenna, the distance between the vertical projection positions of the first antenna and the second antenna on the touch display screen, and the cosine theorem, the angle between the stylus and the touch display screen can be calculated.
[0163] The first antenna and the second antenna are arranged in the stylus, and the arrangement positions of the first antenna and the second antenna in the stylus can be pre-stored in the stylus. The electronic device can obtain the arrangement positions of the first antenna and the second antenna from the stylus.
[0164] Optionally, in one possible implementation, the acceleration sensor in the stylus can collect three-axis acceleration values of the stylus, and the three-axis acceleration values are used by the MCU in the stylus to calculate the inclination angle and the motion state of the stylus. When the stylus contacts the touch display screen, the stylus reports touch data to the electronic device. The touch data can include the inclination angle of the stylus and the motion state of the stylus. The electronic device obtains its own inclination angle, and calculates the angle between the stylus and the touch display screen based on the inclination angle of the stylus and the inclination angle of the electronic device.
[0165] S304, compensating the first stylus tip position corresponding to the stylus according to the first angle and the tip wear height to obtain a second stylus tip position.
[0166] The first stylus tip position represents a report point position corresponding to the stylus tip in the stylus-down event. The report point position represents a position of the stylus tip on the touch display detected by the electronic device through the touch signal sent by the first antenna. In this example, the report point position is a position of the stylus tip corresponding to the stylus tip wear height on the touch display detected by the electronic device through the touch signal sent by the first antenna.
[0167] It should be understood that, since the report point position is the position of the stylus tip on the touch display detected by the electronic device through the touch signal sent by the first antenna, the detected report point position is the same regardless of whether the stylus tip is worn.
[0168] The second stylus tip position represents a position of the stylus tip corresponding to the stylus tip wear height on the touch display in the stylus-down event. It can be understood that the position of the stylus tip corresponding to the stylus tip wear height (the position of the tip corresponding to the stylus tip wear height) on the touch display.
[0169] In the related art, a compensation algorithm is used to compensate for the report point position, but since the compensation algorithm in the related art does not take into account the wear of the stylus tip, the compensated report point position is still inconsistent with the actual position of the worn stylus tip on the touch display.
[0170] The touch stylus calibration method provided by the embodiments of the present application first determines the stylus tip wear height of the current touch stylus, and then compensates for the first stylus tip position of the unworn stylus tip on the touch display according to the angle between the touch stylus and the touch display and the stylus tip wear height, to obtain the second stylus tip position of the worn stylus tip on the touch display. In the compensation process, the effect of the wear of the stylus tip on the position of the stylus tip on the touch display is fully considered, so that the second stylus tip position determined after compensation is the actual position of the worn stylus tip on the touch display, thereby improving the accuracy of the second stylus tip position and improving the accuracy of the touch stylus.
[0171] When the user uses the worn touch stylus to write on the touch display, if the compensation algorithm in the related art is used to compensate for the report point position, the position of the stylus tip determined by the electronic device (i.e., the compensated report point position) will be inconsistent with the actual position of the worn stylus tip on the touch display, resulting in a situation where the writing trace displayed on the touch display is inconsistent with the trajectory of the worn stylus tip moved by the user on the touch display, i.e., a writing trace offset occurs.
[0172] When the user writes on the touch display screen using the worn stylus, the second stylus tip position determined after compensation is the actual position of the worn stylus tip on the touch display screen, so that the writing traces displayed on the touch display screen are consistent with the track of the worn stylus tip on the touch display screen, thereby improving the writing accuracy and writing fluency of the stylus and improving the user experience.
[0173] Referring to Figure 9 , Figure 9 A specific flowchart of step S304 of the stylus calibration method shown in the embodiments of the present application, the step S304 can include step S3041 and step S3042, and the details are as follows.
[0174] S3041, determine the difference between the preset stylus tip compensation height and the stylus tip wear height.
[0175] The preset stylus tip compensation height represents the vertical height between the antenna in the unworn stylus tip and the touch display screen under the pen-down event.
[0176] In the embodiments of the present application, the preset stylus tip compensation height is also the height of the unworn tip. As shown in (a) of Figure 8 The touch stylus is perpendicular to the touch display screen, and the stylus tip of the touch stylus contacts the touch display screen of the electronic device, and the measured H is the preset stylus tip compensation height.
[0177] It should be understood that the error between the report point position and the actual position of the unworn tip (unworn stylus tip) on the touch display screen is caused by the height of the tip, so the report point position is compensated based on the height, therefore, the height of the tip is also called the preset stylus tip compensation height. It should be noted that the related art does not consider the stylus tip wear height, and only compensates the report point position based on the preset stylus tip compensation height, resulting in inaccurate report point position after compensation.
[0178] It should be understood that the preset stylus tip compensation height is also a preset height. The preset height can be a specific height or a height range, and the details can be referred to the description in step S302, which will not be repeated here.
[0179] In one example, the preset stylus tip compensation height is input into the electronic device in advance, and the electronic device calculates the difference between the preset stylus tip compensation height and the stylus tip wear height.
[0180] In another example, the preset stylus tip compensation height is stored in the stylus in advance, and the electronic device can obtain the preset stylus tip compensation height from the stylus. Then, the electronic device calculates the difference between the preset stylus tip compensation height and the stylus tip wear height.
[0181] S3042, determine the second stylus position according to the first angle, the difference between the preset stylus compensation height and the stylus wear height of the stylus, and the first stylus position.
[0182] The first angle represents the angle of the included angle between the stylus and the touch display screen.
[0183] In the embodiments of the present application, the first angle can be represented by θ, the preset stylus compensation height can be represented by H, and the stylus wear height of the stylus can be represented by h.
[0184] Illustratively, the electronic device obtains a first coordinate value corresponding to the first stylus position; calculates the product of the cosine value of the first angle and the difference (the difference between the preset stylus compensation height and the stylus wear height of the stylus); and determines a second coordinate value corresponding to the second stylus position according to the first coordinate value and the product.
[0185] The first coordinate value includes a first horizontal coordinate value and a first vertical coordinate value, and the second coordinate value includes a second horizontal coordinate value and a second vertical coordinate value.
[0186] In the embodiments of the present application, the second horizontal coordinate value is determined by a preset formula, which is as follows:
[0187] X2 = X1 - (H - h) x cos θ, (1)
[0188] In the above formula (1), X2 represents the second horizontal coordinate value, X1 represents the first horizontal coordinate value, H represents the preset stylus compensation height, h represents the stylus wear height of the stylus, (H - h) represents the difference between the preset stylus compensation height and the stylus wear height of the stylus, θ represents the first angle, and cos θ represents the cosine value of the first angle.
[0189] For ease of understanding, please refer to Figure 10 , Figure 10 is a schematic diagram of the stylus with different wear degrees shown by another embodiment of the present application. As shown in (a) in Figure 10 , the tip is not worn, or in other words, the stylus tip is not worn. In this scenario, the preset stylus compensation height is H, and the stylus wear height of the stylus is 0.
[0190] The tip intersects the touch display screen at point C, and the vertical projection of the first antenna on the touch display screen intersects the touch display screen at point D. Point D is on the right side of point C, or in other words, point D is after point C. The touch stylus calibration method provided in the embodiments of the present application is used to compensate the report point position (i.e. the position of point D) so that the compensated report point position (i.e. the position of the compensated point D) is consistent with the actual position of the tip on the touch display screen (i.e. the position of point C).
[0191] Using the horizontal coordinate value as an example, the horizontal coordinate value of point C can be calculated using the aforementioned preset formula. For instance, the electronic device can obtain the vertical projection position of the first antenna on the touch screen, i.e., obtain the first horizontal coordinate value, which is also the horizontal coordinate value of point D. Given the preset pen tip compensation height as H, the pen tip wear height as 0, and the angle between the pen and the touch screen as θ, substituting these known parameters into the aforementioned preset formula, the second horizontal coordinate value, i.e., the horizontal coordinate value of point C, can be calculated.
[0192] like Figure 10 As shown in (b), the tip is worn, or the stylus tip is worn. In this scenario, the preset tip compensation height is H, and the stylus tip wear height is h.
[0193] The worn tip intersects the touchscreen display at point E, and the vertical projection of the first antenna onto the touchscreen display intersects the display at point F. Point F is to the right of point E, or in other words, point F is after point E. If a compensation algorithm from related technologies is used to compensate for the reported point position (i.e., the position of point F), overcompensation may occur because the algorithm does not consider tip wear. Figure 10 As shown in (c), the original compensated reporting position (i.e., the position of the compensated point F) should be consistent with the position of point E. However, after the compensation algorithm in the related technology is used to compensate the reporting position (i.e., the position of point F), the compensated reporting position (i.e., the position of the compensated point F) is consistent with the position of point G, resulting in a coordinate offset. This causes the pen tip position (i.e., the compensated reporting position) determined by the electronic device to be inaccurate.
[0194] The stylus calibration method provided in this application compensates for the reported position (i.e., the position of point F). Taking into account the wear of the pen tip, the compensated reported position (i.e., the position of point F) can be made consistent with the actual position of the worn tip on the touch screen (i.e., the position of point E).
[0195] Taking the horizontal coordinate value as an example, the horizontal coordinate value of point E can be calculated using the aforementioned preset formula. For instance, the electronic device can obtain the vertical projection position of the first antenna on the touch screen, i.e., obtain the first horizontal coordinate value, which is the horizontal coordinate value of point F. Given the preset pen tip compensation height as H and the pen tip wear height as h, the difference between the preset pen tip compensation height and the pen tip wear height can be calculated as Hh. Furthermore, the angle between the pen and the touch screen is known to be θ. Substituting these known parameters into the aforementioned preset formula, the second horizontal coordinate value, i.e., the horizontal coordinate value of point E, can be calculated.
[0196] The above is described by taking the horizontal coordinate value as an example, and the calculation method of the vertical coordinate value is similar, which is not described here again.
[0197] It should be understood that, at the second horizontal coordinate value, the included angle between the stylus and the touch display screen is the included angle between the stylus and the touch display screen in the X-axis direction; when calculating the second vertical coordinate value, the included angle between the stylus and the touch display screen is the included angle between the stylus and the touch display screen in the Y-axis direction.
[0198] In this implementation, when the first stylus position is compensated, the influence of stylus wear on the position of the stylus on the touch display screen is fully considered, and the coordinate offset is corrected, so that the second stylus position determined after compensation is the actual position of the worn stylus on the touch display screen, thereby improving the accuracy of the second stylus position and improving the accuracy of the stylus.
[0199] Please refer to Figure 11 , Figure 11 A specific flowchart of step S302 of a stylus calibration method shown in an embodiment of the present application, the above step S302 can include step S3021 and step S3022, as follows.
[0200] S3021, collect the first stylus signal strength corresponding to the stylus.
[0201] Exemplarily, when the stylus is close to or contacts the touch display screen, the part (such as the tip) of the stylus close to or contacting the touch display screen forms a capacitor with the electrode near the corresponding position of the touch display screen. Then, the stylus sends a touch signal through the first antenna and sends the touch signal to the electronic device. After receiving the touch signal sent by the first antenna, the electronic device determines the first stylus signal strength corresponding to the stylus according to the change of the capacitor. Specifically, the electronic device can detect the first stylus signal strength corresponding to the stylus through the touch sensor arranged on the touch display screen.
[0202] As can be known from the derivation of the capacitor formula, the closer the stylus tip (or tip) of the stylus to the touch display screen of the electronic device, the stronger the stylus tip signal strength detected by the electronic device; the farther the stylus tip (or tip) of the stylus to the touch display screen of the electronic device, the weaker the stylus tip signal strength detected by the electronic device. Then, the more serious the wear of the stylus tip (or tip) of the stylus, the closer the first antenna in the stylus to the touch display screen of the electronic device, and the stronger the stylus tip signal strength detected by the electronic device. Conversely, the more slight the wear of the stylus tip (or tip) of the stylus, the farther the first antenna in the stylus to the touch display screen of the electronic device, and the weaker the stylus tip signal strength detected by the electronic device.
[0203] It should be understood that after the distance between the stylus tip (or nib) and the touch display screen of the electronic device is greater than a certain value, the electronic device will not be able to detect the stylus tip signal strength of the stylus.
[0204] wherein the capacitance formula is:
[0205] In the above formula (2), C represents the capacitance, ε represents the dielectric constant of the medium, or the relative dielectric constant, S represents the facing area of the capacitor plate, k represents the electrostatic force constant, and d represents the distance between the first antenna in the stylus and the touch display screen of the electronic device.
[0206] S3022, according to the preset mapping relationship and the first stylus tip signal strength, determining the stylus tip wear height of the stylus.
[0207] Exemplarily, the preset mapping relationship is pre-stored in the electronic device, and the preset mapping relationship represents the corresponding relationship between different stylus tip signal strengths and different stylus tip wear heights.
[0208] After the electronic device obtains the first stylus tip signal strength, the electronic device looks up the stylus tip wear height corresponding to the first stylus tip signal strength in the preset mapping relationship, so as to determine the stylus tip wear height of the stylus in the current stylus drop event.
[0209] wherein the corresponding relationship between different stylus tip signal strengths and different stylus tip wear heights is obtained by related personnel in a laboratory environment. For example, the scenario of a user using a stylus on a touch display screen of an electronic device can be simulated, and as the use time of the stylus increases, the stylus tip (or nib) gradually wears. The stylus tip wear height is measured by a professional measuring instrument, and during the measurement, the stylus tip signal strength corresponding to each stylus tip wear height is recorded each time the stylus tip wear height is measured. The measured multiple different stylus tip wear heights and the stylus tip signal strength corresponding to each stylus tip wear height are input into the electronic device, and the electronic device establishes the preset mapping relationship based on the measured multiple different stylus tip wear heights and the stylus tip signal strength corresponding to each stylus tip wear height.
[0210] For example, the stylus tip wear height of 0 is measured, and the stylus tip signal strength corresponding to the stylus tip wear height of 0 is 3000; the stylus tip wear height of 0.5 mm is measured, and the stylus tip signal strength corresponding to the stylus tip wear height of 0.5 mm is 3500; the stylus tip wear height of h is measured, and the stylus tip signal strength corresponding to the stylus tip wear height of h is 4000, etc. This is only an exemplary description, and the actual measurement is subject to the limitation.
[0211] Please refer to Figure 12 , Figure 12 is a preset mapping relationship shown in an embodiment of the present application. As shown inFigure 12 As shown, the horizontal axis h represents the stylus tip wear height, and the vertical axis SS represents the stylus tip signal strength. It can be seen that as the stylus tip wear height increases, the stylus tip signal strength also increases and eventually tends to a stable value. For example, the plastic of the stylus (or tip) has been worn through, and the antenna inside has been exposed. After that, the stylus tip wear height no longer increases, and the corresponding stylus tip signal strength also tends to be stable.
[0212] In this implementation, based on the pre-established preset mapping relationship, the stylus tip wear height corresponding to the first stylus tip signal strength can be quickly found, thereby improving the speed of determining the stylus tip wear height. Moreover, since the preset mapping relationship is obtained based on multiple measurements in a laboratory environment, the accuracy of the correspondence between different stylus tip signal strengths and different stylus tip wear heights is ensured, thereby ensuring the accuracy of the stylus tip wear height corresponding to the first stylus tip signal strength found based on the preset mapping relationship.
[0213] Optionally, in a possible implementation, in the process of establishing the preset mapping relationship, the stylus tip wear heights of the stylus are measured by using professional measuring instruments. During the measurement, each time a stylus tip wear height is measured, the stylus with the stylus tip wear height is used on the touch display screen of the electronic device. When it is detected that the angle between the stylus with the stylus tip wear height and the touch display screen is a second angle, the stylus tip signal strength corresponding to the stylus at the stylus tip wear height is collected and recorded. The multiple different stylus tip wear heights measured in this scenario and the stylus tip signal strength corresponding to each stylus tip wear height are input into the electronic device. The electronic device establishes the preset mapping relationship based on the multiple different stylus tip wear heights measured in this scenario and the stylus tip signal strength corresponding to each stylus tip wear height.
[0214] The second angle can be a preset angle. The preset angle can be a specific angle or an angle range. For example, the preset angle can be 88 degrees, 89 degrees, 90 degrees, 91 degrees, etc. The preset angle can be 85 degrees to 95 degrees. This is only an example and is not limited in this regard.
[0215] In this implementation, in the process of establishing the preset mapping relationship, when it is detected that the angle between the stylus with the stylus tip wear height and the touch display screen is a second angle, the stylus tip signal strength corresponding to the stylus at the stylus tip wear height is collected and recorded. In this way, it can be ensured that the collected stylus tip signal strengths are all collected at the same second angle, which can effectively avoid the influence of different angles between the stylus and the touch display screen on the collected stylus tip signal strengths, thereby improving the accuracy of the established preset mapping relationship.
[0216] Optionally, in a possible implementation, the method for calibrating the stylus provided by the embodiment of the present application can be that, when the angle between the stylus and the touch display screen is detected to be the second angle, the first stylus signal strength is collected.
[0217] For example, the first angle can be a non-90-degree angle, and the second angle can be a preset angle, and the absolute value of the difference between the second angle and the first angle can be greater than 0. For example, in a certain scenario, the first angle can be 60 degrees, and the second angle can be 90 degrees; or the first angle can be 45 degrees, and the second angle can be 89 degrees, and the like, which are merely exemplary and are not limited in this regard.
[0218] It should be understood that the method for detecting the angle between the stylus and the touch display screen to be the second angle is the same as the method for determining the angle between the stylus and the touch display screen to be the first angle in step S303 described above, and reference can be made to the description in step S303 described above, which will not be repeated here.
[0219] For example, if the electronic device detects that the angle between the stylus and the touch display screen is not the second angle, for example, the electronic device detects that the angle between the stylus and the touch display screen is 60 degrees, the first stylus signal strength is not collected, and the angle between the stylus and the touch display screen continues to be detected.
[0220] When the electronic device detects that the angle between the stylus and the touch display screen is the second angle, the first stylus signal strength corresponding to the current stylus is detected by the touch sensor arranged on the touch display screen. In the plurality of preset mapping relationships stored in the electronic device, the preset mapping relationship established under the condition that the angle between the stylus and the touch display screen is the second angle is searched, and the stylus tip wear height corresponding to the first stylus signal strength is searched in the preset mapping relationship, so as to determine the stylus tip wear height of the stylus under the current pen drop event.
[0221] Then, when the angle between the stylus and the touch display screen is determined to be the first angle, the first stylus position corresponding to the stylus is compensated according to the first angle and the stylus tip wear height determined in the scene, to obtain a second stylus position.
[0222] In this implementation, the preset mapping relationship used is established under the condition that the angle between the stylus and the touch display screen is the second angle, and the first stylus signal strength collected is also collected under the condition that the angle between the stylus and the touch display screen is the second angle. The angle between the stylus and the touch display screen is consistent, the stylus tip wear height searched based on the preset mapping relationship is more accurate, which is conducive to accurately compensating the first stylus position based on the stylus tip wear height, thereby improving the accuracy of the second stylus position after compensation, and further improving the accuracy of the stylus.
[0223] Optionally, in a possible implementation, in the process of establishing the preset mapping relationship, the professional measuring instrument is used to measure different stylus tip wear heights of the stylus, and during the measurement, the stylus with each measured stylus tip wear height is used on the touch display screen of the electronic device. When it is detected that the angle between the stylus with the stylus tip wear height and the touch display screen is the second angle, and the click pressure of the stylus with the stylus tip wear height is the preset pressure threshold, the stylus tip signal strength corresponding to the stylus tip wear height is collected and recorded. The measured different stylus tip wear heights and the stylus tip signal strength corresponding to each stylus tip wear height are input into the electronic device, and the electronic device establishes the preset mapping relationship based on the measured different stylus tip wear heights and the stylus tip signal strength corresponding to each stylus tip wear height.
[0224] The preset pressure threshold can be set or adjusted according to actual conditions. In the embodiments of the present application, the preset pressure threshold can be any value in 30 grams (g) to 300 g, and specifically, the preset pressure threshold can be 30 g, 50 g, 80 g, etc. This is only an example and is not limited.
[0225] In this implementation, in the process of establishing the preset mapping relationship, when it is detected that the angle between the stylus with the stylus tip wear height and the touch display screen is the second angle, and the click pressure of the stylus with the stylus tip wear height is the preset pressure threshold, the stylus tip signal strength corresponding to the stylus tip wear height is collected and recorded. On the one hand, it can be ensured that the collected stylus tip signal strength is collected at the same second angle, which can effectively avoid the influence of the collected stylus tip signal strength due to the different angles between the stylus and the touch display screen. On the other hand, since the shell of the stylus tip is made of plastic material, and the plastic has elasticity, different click pressures will cause the distance between the first antenna in the stylus and the touch display screen of the electronic device to change, thereby affecting the collected stylus tip signal strength. In this method, the click pressure of the stylus is fixed to ensure that the collected stylus tip signal strength is more accurate, thereby improving the accuracy of the established preset mapping relationship.
[0226] Optionally, in a possible implementation, the stylus calibration method provided by the embodiments of the present application can be that when the angle between the stylus and the touch display screen is the second angle, and the click pressure of the stylus is the preset pressure threshold, the first stylus tip signal strength is collected.
[0227] Exemplarily, the pressure sensor in the stylus can be used to collect a pressure signal of the stylus tip, and when the stylus tip (or the tip end) of the stylus contacts the touch display screen of the electronic device, the pressure sensor can collect a pressure signal generated by the touch display screen pressing the stylus tip. The stylus can send the pressure signal to the electronic device through a wireless communication connection, so that the electronic device can determine the click pressure of the stylus according to the pressure signal.
[0228] The electronic device determines whether the click pressure is a preset pressure threshold. If the electronic device determines that the click pressure is not the preset pressure threshold, the first stylus signal strength is not collected, and the detection is continued. If the electronic device determines that the click pressure is the preset pressure threshold, and the angle between the stylus and the touch display screen is the second angle, the first stylus signal strength is collected.
[0229] Among the plurality of preset mapping relationships stored in the electronic device, a preset mapping relationship established under the condition that the angle between the stylus and the touch display screen is the second angle and the click pressure of the stylus is the preset pressure threshold is searched, and a stylus tip wear height corresponding to the first stylus signal strength is searched in the preset mapping relationship, so as to determine the stylus tip wear height of the stylus under the current pen drop event.
[0230] Then, when the angle between the stylus and the touch display screen is the first angle, the first stylus position corresponding to the stylus is compensated according to the first angle and the stylus tip wear height determined in the scene, to obtain a second stylus position.
[0231] In this implementation, the preset mapping relationship used is established under the condition that the angle between the stylus and the touch display screen is the second angle and the click pressure of the stylus is the preset pressure threshold, and the first stylus signal strength collected is also collected under the condition that the angle between the stylus and the touch display screen is the second angle and the click pressure of the stylus is the preset pressure threshold. The angle between the stylus and the touch display screen is consistent, the click pressure of the stylus is consistent, the stylus tip wear height searched based on the preset mapping relationship is more accurate, which is conducive to accurately compensating the first stylus position based on the stylus tip wear height, thereby improving the accuracy of the second stylus position after compensation, and further improving the accuracy of the stylus.
[0232] Optionally, in a possible implementation, the electronic device has a plurality of preset mapping relationships stored in advance, and each preset mapping relationship represents a corresponding relationship between different stylus signal strengths and different stylus tip wear heights in a preset scene.
[0233] The preset scene can include at least one of the following: whether the electronic device is in a charging state, whether a screen protection film is attached to the touch display screen, and the like.
[0234] For example, the electronic device is in a charging state, or the electronic device is in a non-charging state; the touch display screen is attached with a screen protection film, or the touch display screen is not attached with a screen protection film.
[0235] When the touch display screen is attached with a screen protection film, the type of the screen protection film can include a plastic film, a water-based film, a tempered film, a frosted film, a mirror film, and the like.
[0236] In one example, the preset scenario can be that the electronic device is in a charging state and the touch display screen is not attached with a screen protection film. In this preset scenario, the corresponding preset mapping relationship in this preset scenario is established by the method of establishing a preset mapping relationship described above.
[0237] In another example, the preset scenario can be that the electronic device is in a charging state and the touch display screen is attached with a screen protection film, but the type of the screen protection film is not distinguished. In this preset scenario, the corresponding preset mapping relationship in this preset scenario is established by the method of establishing a preset mapping relationship described above.
[0238] In yet another example, the preset scenario can be that the electronic device is in a charging state and the touch display screen is attached with a screen protection film, and the type of the screen protection film is distinguished. In this preset scenario, the corresponding preset mapping relationship in this preset scenario is established by the method of establishing a preset mapping relationship described above.
[0239] In still another example, the preset scenario can be that the electronic device is in a non-charging state and the touch display screen is not attached with a screen protection film. In this preset scenario, the corresponding preset mapping relationship in this preset scenario is established by the method of establishing a preset mapping relationship described above.
[0240] In another example, the preset scenario can be that the electronic device is in a non-charging state and the touch display screen is attached with a screen protection film, but the type of the screen protection film is not distinguished. In this preset scenario, the corresponding preset mapping relationship in this preset scenario is established by the method of establishing a preset mapping relationship described above.
[0241] In yet another example, the preset scenario can be that the electronic device is in a non-charging state and the touch display screen is attached with a screen protection film, and the type of the screen protection film is distinguished. In this preset scenario, the corresponding preset mapping relationship in this preset scenario is established by the method of establishing a preset mapping relationship described above.
[0242] Optionally, the preset scenario can also include whether the height of the tip of the stylus when it leaves the factory is a preset height, which can also be understood as whether the height of the tip of the stylus when it is not worn is a preset height. In this preset scenario, the corresponding preset mapping relationship in this preset scenario is established by the method of establishing a preset mapping relationship described above.
[0243] In this implementation, the preset mapping relationship under different preset scenes is established in advance, so that the electronic device and the stylus can match the corresponding preset mapping relationship when they are in different preset scenes, thereby effectively reducing the interference of the scene factor on the determination of the stylus tip wear height, and making the stylus tip wear height found in the matched preset mapping relationship more accurate.
[0244] Optionally, in a possible implementation, the stylus tip wear height is determined according to the stylus tip signal strength collected when the electronic device is in a preset scene and the preset mapping relationship matched with the preset scene.
[0245] For example, the preset scene in which the electronic device is currently located is detected. Whether the electronic device is in a charging state can be determined by a charging identifier in the electronic device. For example, the electronic device has a charging identifier stored in advance, which is used to indicate that the electronic device is in a charging state or that the electronic device is in an uncharged state. Alternatively, the charging management module in the electronic device can be used to determine whether the electronic device is in a charging state or an uncharged state.
[0246] Whether the touch display screen is attached with a screen protection film can be determined by a preset film attachment detection algorithm. When it is determined that the touch display screen is attached with a screen protection film, different types of the screen protection film need to be determined, and the different types of the screen protection film can also be determined by the preset film attachment detection algorithm.
[0247] It should be understood that whether the touch display screen is attached with a screen protection film and the different types of the screen protection film can also be input by a user into the electronic device.
[0248] The height of the tip of the stylus when it is shipped can be stored in the stylus in advance, and the electronic device can directly obtain the height of the tip of the stylus when it is shipped from the stylus.
[0249] For example, after detecting the preset scene in which the electronic device is currently located, the stylus tip signal strength under the preset scene is collected. Among the plurality of preset mapping relationships stored in the electronic device, the preset mapping relationship matched with the preset scene is found, and the stylus tip wear height corresponding to the first stylus tip signal strength is found in the preset mapping relationship, so as to determine the stylus tip wear height of the stylus under the current stylus drop event.
[0250] Then, when the angle between the stylus and the touch display screen is determined to be a first angle, the first stylus tip position corresponding to the stylus is compensated according to the first angle and the stylus tip wear height determined under the scene, to obtain a second stylus tip position.
[0251] In this implementation, according to different preset scenes in which the electronic device is located, the corresponding preset mapping relationship is matched, which can effectively reduce the interference of scene factors on the determination of the stylus tip wear height, make the stylus tip wear height found in the matched preset mapping relationship more accurate, and be beneficial to accurately compensating the first stylus tip position based on the stylus tip wear height, thereby improving the accuracy of the second stylus tip position after compensation, and further improving the precision of the stylus.
[0252] Optionally, in a possible implementation, the stylus calibration method provided in the present application can further include, after the step S304:
[0253] S305, detecting a pen-up event.
[0254] In the embodiments of the present application, the pen-up event refers to an event generated when the stylus tip of the stylus leaves the touch display screen of the electronic device.
[0255] For example, when the user withdraws the stylus from the touch display screen of the electronic device, the stylus tip of the stylus is no longer in contact with the touch display screen of the electronic device. The touch sensor in the electronic device receives the operation of the stylus leaving the touch display screen, and identifies the corresponding pen-up event through the kernel layer in the electronic device.
[0256] Based on the detected pen-up event, when a pen-down event is detected again, the method described in the steps S301 to S304 is executed, and the cycle is repeated. In this implementation, the latest wear condition of the stylus tip can be grasped in real time, and the first stylus tip position is compensated based on the latest wear condition of the stylus tip, so that the second stylus tip position can be accurately determined each time, and the precision of the stylus is improved.
[0257] Optionally, in a possible implementation, the method described in the steps S301 to S304 can be periodically executed. Wherein, the periodicity can refer to each time the stylus is detected to be powered on, or each time the stylus is detected to be used for a preset time length, or each time the user starts the stylus tip wear calibration function, etc.
[0258] The preset time length can be set and adjusted according to actual conditions, which is not limited in the embodiments of the present application. For example, the preset time length can be 24 hours, 48 hours, 100 hours, etc.
[0259] Since the method described in the steps S301 to S304 is periodically executed, the power consumption of the stylus and the electronic device can be effectively saved.
[0260] Optionally, in a possible implementation, the stylus calibration method provided in the present application further includes determining that the stylus tip wear height of the stylus is 0 when it is detected that the stylus is replaced with a new stylus tip.
[0261] Exemplarily, when the plastic of the pen tip (or nib) is worn to a certain extent, for example, the pen tip is worn to a height of 2 / h, or the plastic of the pen tip (or nib) has been worn through and the antenna inside has leaked out, the user will replace the pen tip. After replacing the pen tip, when the electronic device detects a pen drop event again, the pen tip signal strength corresponding to the stylus after replacing the pen tip is collected, and the pen tip wear height of the stylus is determined again according to the preset mapping relationship and the pen tip signal strength. For example, it is determined that the pen tip wear height of the stylus is 0.
[0262] Alternatively, after the user replaces the pen tip, the user can input the information that the pen tip is replaced into the electronic device, and the electronic device directly determines that the pen tip wear height of the stylus is 0. Or, after the user replaces the pen tip, the user can also input the pen tip wear height of 0 in the electronic device.
[0263] Then, when it is determined that the angle between the stylus and the touch display screen is a first angle, the first pen tip position corresponding to the stylus is compensated according to the first angle and the currently determined pen tip wear height to obtain a second pen tip position.
[0264] In this implementation, when it is detected that the stylus replaces the pen tip, the pen tip wear height of the stylus is quickly determined to be 0, and the first pen tip position is compensated again based on the pen tip wear height, thereby improving the accuracy of the second pen tip position after compensation, and further improving the accuracy of the stylus.
[0265] Please refer to Figure 13 , Figure 13 Another stylus calibration method is shown in the schematic flowchart of the embodiments of the present application. The method will be described in detail below.
[0266] S401, a preset mapping relationship is established.
[0267] S402, a pen drop event is detected.
[0268] S403, when it is detected that the angle between the stylus and the touch display screen is a second angle and the click pressure of the stylus is a preset pressure threshold, a first pen tip signal strength is collected.
[0269] S404, a preset scene in which the electronic device is located is determined, and a preset mapping relationship matched with the preset scene is obtained.
[0270] S405, the pen tip wear height of the stylus is determined according to the first pen tip signal strength and the preset mapping relationship matched with the preset scene.
[0271] S406, when it is determined that the angle between the stylus and the touch display screen is a first angle, the first pen tip position corresponding to the stylus is compensated according to the first angle and the pen tip wear height to obtain a second pen tip position.
[0272] S407, detecting the pen lifting event, and returning to execute step S402.
[0273] It is worth mentioning that the implementation in steps S401 to S407 can refer to the foregoing related description, which will not be repeated here.
[0274] The touch pen calibration method provided by the embodiment of the present application fully considers the influence of the tip wear on the position of the tip on the touch display screen in the compensation process, so that the second tip position determined after compensation is the actual position of the worn tip on the touch display screen, thereby improving the accuracy of the second tip position and the precision of the touch pen.
[0275] When the user writes on the touch display screen using the worn touch pen, if the compensation algorithm in the related technology is used to compensate the report point position, the tip position determined by the electronic device (i.e. the report point position after compensation) will be inconsistent with the actual position of the worn tip on the touch display screen, thereby causing the writing trace displayed on the touch display screen to be inconsistent with the trajectory of the worn tip moved on the touch display screen, i.e. the writing trace is offset.
[0276] However, when the user writes on the touch display screen using the worn touch pen, the writing trace displayed on the touch display screen is consistent with the trajectory of the worn tip moved on the touch display screen, thereby improving the writing precision and fluency of the touch pen and improving the user experience.
[0277] Alternatively, in a possible implementation, since the tips manufactured by manufacturers may have differences, the height of the tip of the touch pen out of the factory is different. For example, the height of the tip of some touch pens is 1.2 mm, the height of the tip of some touch pens is 1 mm, and the height of the tip of some touch pens is 0.8 mm. Since the height of the unworn tip will affect the distance between the first antenna and the touch display screen, the distance will affect the collected tip signal strength, and different tip signal strengths will affect the determination of the tip wear height, which will cause errors in the determination of the tip wear height, thereby inaccurate compensation of the first tip position.
[0278] In order to avoid the above situation, the embodiment of the present application further provides a method for determining the height of the tip wear of the stylus, which comprises: collecting the first tip signal strength corresponding to the stylus when the stylus first establishes a communication connection with the electronic device; collecting the second tip signal strength corresponding to the stylus; determining the tip signal strength change between the first tip signal strength and the second tip signal strength; and determining the height of the tip wear of the stylus according to the tip signal strength change and a target mapping relationship.
[0279] Exemplarily, when the stylus first establishes a communication connection with the electronic device, a prompt information is displayed in the electronic device, which is used to prompt the stylus to first establish a communication connection with the electronic device. The electronic device collects the first tip signal strength corresponding to the stylus when detecting the landing event.
[0280] Optionally, in a possible implementation manner, the first tip signal strength can refer to the tip signal strength of the stylus collected by the electronic device when the stylus first contacts the touch display screen of the electronic device.
[0281] Optionally, in another possible implementation manner, the first tip signal strength can also refer to the average value of the tip signal strength of the stylus collected by the electronic device multiple times when the tip of the stylus is not worn. For example, when the tip of the stylus is not worn, the electronic device collects the tip signal strength of the stylus multiple times to obtain multiple tip signal strengths, removes the maximum value and the minimum value in the multiple tip signal strengths, and calculates the average value of the remaining tip signal strengths to obtain the first tip signal strength. This is only an exemplary description, and is not limited thereto.
[0282] Optionally, the electronic device can also collect the first tip signal strength corresponding to the stylus when detecting that the included angle between the stylus and the touch display screen is the second angle.
[0283] Optionally, the electronic device can also collect the first tip signal strength corresponding to the stylus when detecting that the included angle between the stylus and the touch display screen is the second angle and the click pressure of the stylus is the preset pressure threshold.
[0284] Optionally, the electronic device can also collect the first tip signal strength corresponding to the stylus when the electronic device is in any of the aforementioned preset scenes.
[0285] The second tip signal strength is a non-first tip signal strength, and the second tip signal strength is greater than the first tip signal strength.
[0286] The pen tip signal strength change amount between the first pen tip signal strength and the second pen tip signal strength is a difference between the second pen tip signal strength and the first pen tip signal strength. For example, the difference between the second pen tip signal strength and the first pen tip signal strength is calculated to obtain the pen tip signal strength change amount.
[0287] Exemplarily, the target mapping relationship is pre-stored in the electronic device, and the target mapping relationship represents a corresponding relationship between different pen tip signal strength change amounts and different pen tip wear heights.
[0288] The corresponding relationship between different pen tip signal strength change amounts and different pen tip wear heights is obtained by relevant personnel through multiple measurements in a laboratory environment. For example, a scenario can be simulated that a user uses a stylus on a touch display screen of an electronic device, and the pen tip (or tip) of the stylus gradually wears as the use time of the stylus increases.
[0289] Specifically, the electronic device collects the pen tip signal strength of the stylus (or stylus) that is not worn (or in other words, the stylus out of the factory), and takes the pen tip signal strength as a reference signal strength, and determines that the pen tip wear height is 0. Then, the scenario of the gradual wear of the pen tip (or tip) of the stylus is simulated, and the different pen tip wear heights of the stylus are measured by professional measuring instruments. During this period, each time the pen tip wear height is measured, the pen tip signal strength corresponding to the pen tip wear height is recorded, and the difference between the pen tip signal strength recorded each time and the reference signal strength is calculated, that is, the pen tip signal strength change amount between the pen tip signal strength recorded each time and the reference signal strength is calculated. The calculated multiple pen tip signal strength change amounts and multiple pen tip wear heights are input into the electronic device, and the electronic device establishes a target mapping relationship based on the multiple pen tip wear heights corresponding to the multiple pen tip signal strength change amounts.
[0290] For example, the height of the tip of the stylus is 1 mm when it leaves the factory, and the electronic device detects that the stylus tip signal strength of the stylus is 3000. The stylus tip signal strength 3000 is taken as the reference signal strength, and it is determined that the stylus tip wear height is 0. Subsequently, a scenario in which the stylus tip (or tip) of the stylus gradually wears is simulated. In one scenario, the electronic device detects that the stylus tip signal strength of the stylus is 3500, and it is measured that the stylus tip wear height is 0.5 mm. The difference between the stylus tip signal strength 3500 and the reference signal strength is calculated, and the stylus tip signal strength change amount is 500. The corresponding relationship between the stylus tip signal strength change amount and the stylus tip wear height is established, that is, the stylus tip signal strength change amount 500 corresponds to the stylus tip wear height 0.5 mm. In another scenario, the electronic device detects that the stylus tip signal strength of the stylus is 3800, and it is measured that the stylus tip wear height is 0.8 mm. The difference between the stylus tip signal strength 3800 and the reference signal strength is calculated, and the stylus tip signal strength change amount is 800. The corresponding relationship between the stylus tip signal strength change amount and the stylus tip wear height is established, that is, the stylus tip signal strength change amount 800 corresponds to the stylus tip wear height 0.8 mm, and so on.
[0291] It should be noted that, in actual establishment of the target mapping relationship, each time the stylus tip signal strength change amount increases by a preset threshold, the corresponding relationship between the stylus tip signal strength change amount and the stylus tip wear height is recorded. The preset threshold can be set or adjusted according to actual conditions, for example, the preset threshold can be 10, 50, 100, 200, etc., which is not limited. It should be understood that the smaller the preset threshold is set, the more comprehensive the target mapping relationship is, which is beneficial to more accurately determining the stylus tip wear height based on the target mapping relationship subsequently.
[0292] Optionally, in one possible implementation manner, in any of the aforementioned preset scenarios, the corresponding target mapping relationship in the preset scenario is established by the method of establishing the target mapping relationship described above.
[0293] For example, the method for determining the stylus tip wear height provided by the embodiments of the present application can be, when the stylus and the electronic device establish communication connection for the first time, the first stylus tip signal strength corresponding to the stylus is collected, and the first stylus tip signal strength is taken as the reference signal strength. It is determined that the stylus tip (or tip) of the stylus is not worn at this time, or it is determined that the stylus tip wear height of the stylus at this time is 0.
[0294] When the stylus tip event is detected, the second stylus tip signal strength corresponding to the stylus is collected. Optionally, the condition for collecting the second stylus tip signal strength corresponding to the stylus can be the same as the condition for collecting the first stylus tip signal strength corresponding to the stylus, or it can be different from the condition for collecting the first stylus tip signal strength corresponding to the stylus, which is not limited.
[0295] The difference between the second stylus signal strength and the first stylus signal strength is calculated to obtain a stylus signal strength change. A stylus wear height corresponding to the stylus signal strength change is found in the target mapping relationship, so as to determine the stylus wear height of the current stylus. Then, the first stylus position corresponding to the stylus is compensated according to the first angle and the stylus wear height, to obtain a second stylus position.
[0296] For example, the height of the tip of the stylus when leaving the factory is 0.8 mm, and the electronic device detects that the stylus signal strength of the stylus is 3300. The stylus signal strength 3300 is taken as a reference signal strength, and the stylus wear height is determined to be 0. The second stylus signal strength corresponding to the stylus is collected as 3500, the difference between the second stylus signal strength 3500 and the first stylus signal strength 3300 is calculated to obtain a stylus signal strength change of 200. In the target mapping relationship, the stylus wear height corresponding to the stylus signal strength change 200 is found to be 0.2. Then, the first stylus position corresponding to the stylus is compensated according to the first angle and the stylus wear height, to obtain a second stylus position.
[0297] In this implementation, the stylus wear height of the stylus is determined based on the stylus signal strength change and the target mapping relationship, and is not affected by the height of the tip of the stylus when leaving the factory. Therefore, the stylus wear height corresponding to the stylus can be accurately determined, and the first stylus position can be accurately compensated, thereby improving the accuracy of the second stylus position after compensation, and further improving the precision of the stylus.
[0298] Alternatively, in a possible implementation, when the electronic device is in any of the aforementioned preset scenes, the first stylus signal strength and the second stylus signal strength corresponding to the stylus are collected, and the stylus signal strength change between the first stylus signal strength and the second stylus signal strength is determined. In the plurality of target mapping relationships stored in the electronic device, a target mapping relationship matching the preset scene is found, and a stylus wear height corresponding to the stylus signal strength change is found in the target mapping relationship, so as to determine the stylus wear height of the current stylus. Then, the first stylus position corresponding to the stylus is compensated according to the first angle and the stylus wear height, to obtain a second stylus position.
[0299] In this implementation, the corresponding target mapping relationship is matched according to different preset scenes of the electronic device, which can effectively reduce the interference of scene factors on the determination of the stylus wear height, so that the stylus wear height found in the matched target mapping relationship is more accurate, and it is beneficial to accurately compensate the first stylus position based on the stylus wear height, thereby improving the accuracy of the second stylus position after compensation, and further improving the precision of the stylus.
[0300] Please refer toFigure 14 , Figure 14 A target mapping relationship diagram is shown in an embodiment of the present application. As shown in FIG. 6, the horizontal axis hh represents the stylus tip wear height, and the vertical axis ΔSS represents the stylus signal strength variation. It can be seen that as the stylus tip wear height increases, the stylus signal strength variation also increases, and eventually tends to a stable value. For example, the plastic of the stylus (or tip) has been worn through, and the antenna inside has been exposed. After that, the stylus tip wear height no longer increases, and the corresponding stylus signal strength variation also tends to be stable. Figure 14
[0301] It should be understood that as the stylus (or tip) wears, the distance between the first antenna and the touch display screen becomes closer, and the stylus signal strength collected by the electronic device becomes stronger. Therefore, when the second stylus signal strength collected is greater than the first stylus signal strength, it can be proved that the stylus (or tip) of the stylus is worn.
[0302] Optionally, when it is detected that the stylus replaces the stylus tip, the above method of determining the stylus tip wear height of the stylus is re-executed. For details, refer to the foregoing description, which will not be repeated here. In this way, the replaced stylus tip is not affected by the manufacturer, and the corresponding stylus tip wear height of the stylus can still be accurately determined.
[0303] The above describes an example of the stylus calibration method provided by the embodiments of the present application in detail. It can be understood that in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the functions. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered beyond the scope of the present application.
[0304] The embodiments of the present application can divide the functional modules of the electronic device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. The integrated module can be realized in the form of hardware or software functional module. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division. There can be another division method in actual implementation.
[0305] It should be noted that all related contents of each step involved in the above method embodiments can be cited to the function description of the corresponding functional module, which will not be repeated here.
[0306] The electronic device provided by the embodiment is used to execute the stylus calibration method, and thus the same effects as the implementation method can be achieved.
[0307] In the case of using the integrated unit, the electronic device can further include a processing module, a storage module and a communication module. The processing module can be used to control and manage the actions of the electronic device. The storage module can be used to support the electronic device to execute the storage of program codes and data, etc. The communication module can be used to support the communication between the electronic device and other devices.
[0308] The processing module can be a processor or a controller. It can realize or execute various exemplary logical blocks, modules and circuits described in combination with the disclosure. The processor can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and microprocessors, etc. The storage module can be a memory. The communication module can be a device for interacting with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a WiFi chip, etc.
[0309] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device related to the embodiment can be a device with the structure as shown in the figure. Figure 5
[0310] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the stylus calibration method of any one of the above embodiments.
[0311] The embodiment of the present application further provides a computer program product, which, when running on a computer, causes the computer to execute the related steps to realize the stylus calibration method in the above embodiment.
[0312] The embodiment of the present application further provides a device system, which includes a stylus and an electronic device. The electronic device includes a touch display screen. The electronic device is in communication connection with the stylus. The stylus can perform touch operations on the touch display screen. The stylus and the electronic device cooperate with each other to realize the stylus calibration method in the above embodiment.
[0313] The embodiment of the present application further provides a stylus, which includes a stylus tip, a key, a stylus body and a main circuit board. The stylus and the electronic device cooperate with each other to realize the stylus calibration method in the above embodiment.
[0314] The embodiment of the present application further provides a chip. Please refer to Figure 15 ,Figure 15 A chip structure diagram is provided for an embodiment of the present application. Figure 15 The chip can be a general-purpose processor or a special-purpose processor. The chip includes a processor 510. The processor 510 is configured to execute the stylus calibration method of any of the above embodiments.
[0315] Optionally, the chip further includes a transceiver 520 configured to be controlled by the processor and configured to support the communication device to perform the above-mentioned technical solutions.
[0316] Optionally, Figure 15 The chip can further include a storage medium 530.
[0317] It should be noted that, Figure 15 The chip can be implemented using one or more field programmable gate arrays (FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuitry, or any combination thereof, capable of performing the various functions described throughout this application.
[0318] The electronic device, computer readable storage medium, computer program product or chip provided by the embodiments can achieve the beneficial effects of the corresponding methods provided above, and thus the beneficial effects of the corresponding methods provided above will not be repeated here.
[0319] From the above description of the embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the above-mentioned division of functional modules is taken as an example for illustration, and in actual application, the above-mentioned functions can be completed by different functional modules according to needs, i.e., the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0320] In the several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only schematic, and the division of the modules or units is only a logical function division, and there can be another division way in actual implementation, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0321] The units described as separate components may or may not be physically separate, and the components displayed as units may be a physical unit or multiple physical units, that is, may be located in one place, or also can be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0322] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0323] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical scheme of the embodiments of the present application essentially or the part that contributes to the prior art or the whole or part of the technical scheme can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0324] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A stylus calibration method, characterized by, The method is applied to an electronic device including a capacitive touch display screen, the electronic device is connected with a touch pen through Bluetooth, the touch pen includes a pen tip, the material of the pen tip is plastic material, and the method includes the following steps. A pen drop event is detected. It is determined that an included angle between the touch pen and the capacitive touch display screen is a first angle. When it is detected that the first angle is within a preset angle range and a click pressure of the touch pen is between 30 grams and 300 grams, a first pen tip signal strength corresponding to the touch pen is determined according to a change in capacitance; the first angle and the first pen tip signal strength are determined in a preset scene, and the preset scene includes any one of the following: the electronic device is in a charging state and is attached with a screen protection film, the electronic device is in a charging state and is not attached with a screen protection film, the electronic device is in a non-charging state and is attached with a screen protection film, and the electronic device is in a non-charging state and is not attached with a screen protection film. A pen tip wear height of the touch pen is determined according to a preset mapping relationship and the first pen tip signal strength; the preset mapping relationship represents a corresponding relationship between different pen tip signal strengths and different pen tip wear heights; the preset mapping relationship is established in advance in different preset scenes, each preset scene corresponds to a preset mapping relationship, and different pen tip signal strengths are collected when an included angle between the touch pen and the capacitive touch display screen is within a preset angle range and a click pressure of the touch pen is between 30 grams and 300 grams. A second pen tip position is obtained by compensating a first pen tip position corresponding to the touch pen according to the first angle and the pen tip wear height; the first pen tip position represents a report point position corresponding to the pen tip in the pen drop event; the report point position refers to a position of the pen tip on the capacitive touch display screen detected by the electronic device according to a touch signal emitted by the touch pen when the pen tip contacts the capacitive touch display screen; and the second pen tip position represents a position of the worn pen tip on the touch display screen in the pen drop event.
2. The method of claim 1, wherein, The touch pen includes an antenna arranged in the pen tip, and the second pen tip position is obtained by compensating the first pen tip position corresponding to the touch pen according to the first angle and the pen tip wear height, including the following steps. A difference between a preset pen tip compensation height and the pen tip wear height of the touch pen is determined; the preset pen tip compensation height represents a vertical height between the antenna in the pen tip and the touch display screen in the pen drop event; The second pen tip position is determined according to the first angle, the difference between the preset pen tip compensation height and the pen tip wear height of the touch pen, and the first pen tip position.
3. The method according to claim 1 or 2, characterized in that, The method further includes the following steps. When it is detected that the touch pen is replaced with a new pen tip, the pen tip wear height of the touch pen is determined to be 0.
4. The method of claim 1, wherein, The method further includes the following steps. When it is detected that the touch pen is connected with the electronic device through Bluetooth for the first time, a first pen tip signal strength corresponding to the touch pen is collected; A second pen tip signal strength corresponding to the touch pen is collected. determine a stylus signal strength change amount between the first stylus signal strength and the second stylus signal strength; determine a stylus tip wear height of the stylus according to the stylus signal strength change amount and a target mapping relationship, the target mapping relationship representing a corresponding relationship between different stylus signal strength change amounts and different stylus tip wear heights.
5. An electronic device, comprising: comprise: one or more processors; one or more memories; the memory stores one or more programs, when the one or more programs are executed by the processor, make the electronic device execute the method in any one of claims 1 to 4.
6. A chip, characterized by comprise: a processor, configured to call and run a computer program from a memory, so that an electronic device installed with the chip executes the method in any one of claims 1 to 4.
7. A computer readable storage medium characterized in that, the computer readable storage medium stores a computer program, when the computer program is executed by an electronic device, makes the electronic device execute the method in any one of claims 1 to 4.
Citation Information
Patent Citations
Detection and calculation method for correction of handwriting inclination angle of electromagnetic pen
CN113835541A
Contact positioning method and device, terminal and non-temporary storage medium
CN115167716A
Disabling stylus to prevent worn tip performance degradation and screen damage
US20170249028A1