A handwriting processing method, terminal device and chip system

By monitoring the pressure value and signal strength of the stylus, identifying its departure status and terminating the display, the problem of untimely disappearing of the stylus handwriting is solved and the user experience is improved.

CN117991913BActive Publication Date: 2025-01-10HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310357242.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2025-01-10
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

The problem of the stylus' handwriting disappearing on the terminal device screen is not timely, resulting in a decline in user experience.

Method used

By monitoring the pressure value and coupled signal strength of the stylus, identifying whether the stylus leaves the handwriting module, terminating the display of subsequent handwriting content, and using the pressure value and signal intensity change trend and critical threshold within the preset time range to accurately identify the departure of the stylus. state.

Benefits of technology

The handwriting of handwriting has been realized to disappear in time as soon as possible, improve the situation of handwriting that disappears in time, and improve the user's writing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117991913B_ABST
    Figure CN117991913B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a handwriting processing method, a terminal device and a chip system, which are applicable to the field of data processing technology. The method includes: obtaining a first pressure value and a latest first signal strength within a preset time range, and identifying whether the stylus has left the handwriting module based on the first pressure value and the first signal strength. When it is identified that the stylus has left the handwriting module, the handwriting content to be displayed that was input by the stylus in the handwriting module within the first time range after the current moment is terminated. Or the response to several target coupling signals is terminated, and the target coupling signal is a coupling signal between the stylus and the terminal device obtained after the current moment. The embodiment of the present application can improve the problem of delayed disappearance of handwriting.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application submitted to the State Intellectual Property Office on November 4, 2022, with application number 202211374510.6 and application name "A handwriting processing method, terminal device and chip system". Technical Field

[0002] The present application relates to the field of stylus technology, and in particular to a handwriting processing method, terminal equipment and chip system. Background Art

[0003] A stylus (also called a touch pen or active pen) is a device used to write on a terminal device. In actual applications, when a user uses a stylus to write on the screen of a terminal device, there will be a certain delay from the time the user applies force to the stylus to the time the terminal device displays the corresponding handwriting on the screen. When the user stops writing and takes the stylus off the screen of the terminal device, the delay will cause the handwriting on the terminal device to disappear in time. As a result, even if the stylus has left the screen, the new handwriting will continue to be displayed on the screen of the terminal device.

[0004] If the stylus handwriting does not disappear in time, the user experience of the stylus and the terminal device will be reduced. Therefore, how to solve or improve the situation that the stylus handwriting does not disappear in time is a problem that needs to be solved in practical applications. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a handwriting processing method, a terminal device and a chip system, which can improve the problem that the handwriting of the stylus pen disappears slowly in the terminal device.

[0006] A first aspect of an embodiment of the present application provides a handwriting processing method, which is applied to a terminal device, wherein the terminal device includes a handwriting module, and the handwriting module is used for a handwriting pen to input handwriting content. The method includes:

[0007] First, obtain the first pressure value within the preset time range and the latest first signal strength. Then, identify whether the stylus has left the handwriting module based on the first pressure value and the first signal strength. Finally, when it is identified that the stylus has left the handwriting module, stop displaying the handwriting content to be displayed that was input by the stylus in the handwriting module within the first time range after the current moment, or stop responding to several target coupling signals, where the target coupling signal is the coupling signal between the stylus and the terminal device obtained after the current moment. The first pressure value is the pressure value applied by the user to the stylus, or the pressure value applied by the stylus to the handwriting module, and the end moment of the preset time range is the current moment. The first signal strength is the signal strength of the coupling signal between the terminal device and the stylus.

[0008] Since the force applied by the stylus will decrease (i.e., releasing force) when the user withdraws the pen, the pressure value in the recent period of time can be regarded as one of the characteristics of the withdrawal. At the same time, in actual applications, the signal amount of the coupling signal will decrease as the distance between the stylus and the handwriting module increases. Therefore, it is possible to identify whether the stylus has left the handwriting module based on the obtained pressure value and signal amount. When it is identified that the stylus has left the handwriting module, the terminal device chooses not to display the handwriting content within a certain range. As a result, the handwriting can disappear in time as soon as the stylus leaves the handwriting module, so as to improve or even avoid the situation where the handwriting of the stylus disappears untimely.

[0009] In a first possible implementation manner of the first aspect, identifying whether the stylus has left the handwriting module according to the first pressure value and the first signal strength includes:

[0010] The change trend of the first pressure value within a preset time range is detected, and when the detected change trend is from large to small, and the first signal strength is less than or equal to the target critical threshold, it is determined that the stylus has left the handwriting module.

[0011] Since the force applied by the stylus tends to decrease gradually during the process of the user withdrawing the pen, the downward trend of the pressure value can be regarded as one of the characteristics of the withdrawal. When the pressure value decreases, and the signal quantity decreases to less than or equal to the target critical threshold, it means that the withdrawal operation has reached the state where the pen tip leaves the handwriting module, that is, the stylus has left the handwriting module at this time. This enables fast and accurate recognition of the stylus leaving the handwriting module.

[0012] In a second possible implementation manner of the first aspect, the handwriting module includes multiple areas.

[0013] Before identifying whether the stylus has left the handwriting module according to the first pressure value and the first signal strength, the method further includes: determining the area where the stylus is located on the handwriting module at the current moment, taking the area as the first area, and acquiring a target critical threshold associated with the first area.

[0014] In the embodiment of the present application, the handwriting module is divided into multiple areas, and the critical thresholds associated with different areas are set, so that the critical thresholds of the embodiment of the present application can effectively adapt to the different actual conditions of different positions of the handwriting module. Therefore, the embodiment of the present application can more accurately identify the state of the pen tip leaving the handwriting module.

[0015] In a third possible implementation of the first aspect, when the target critical threshold associated with the first area is not obtained, the critical threshold associated with each area within a preset area range adjacent to the first area is searched, and then based on the one or more critical thresholds found, the target critical threshold corresponding to the first area is determined.

[0016] When the critical threshold of the area where the stylus is located is not directly obtained, the embodiment of the present application actively searches for the critical threshold of the surrounding area, and determines the critical threshold used this time based on the searched critical threshold. Since the adjacent areas of the handwriting module have similar conditions, the embodiment of the present application can still obtain a better critical threshold for use when there is no associated critical threshold in the current area, and has a certain adaptability to various possible situations.

[0017] In a fourth possible implementation manner of the first aspect, determining a target critical threshold corresponding to the first area based on the found one or more critical thresholds includes:

[0018] When critical thresholds associated with a plurality of regions are found within the preset region range, a second region closest to the first region is selected from the found regions.

[0019] When a second region is screened out, the critical threshold associated with the second region is used as the target critical threshold corresponding to the first region.

[0020] When multiple second regions are screened out, the average of the critical thresholds associated with all the second regions is used as the target critical threshold corresponding to the first region.

[0021] The embodiment of the present application can adaptively determine the most suitable critical threshold value according to the search results. Therefore, the embodiment of the present application can effectively deal with various possible situations of the critical threshold value, has strong adaptability and compatibility to various possible situations, and can improve the effectiveness of the acquired critical threshold value.

[0022] In a fifth possible implementation manner of the first aspect, a method for determining the target critical threshold includes:

[0023] Obtain the latest second pressure value, the latest second signal strength, and the latest target tilt angle between the stylus and the handwriting module, wherein the second pressure value is the pressure value applied by the user to the stylus, or the pressure value applied by the stylus to the handwriting module, and the second signal strength is the signal strength of the coupling signal between the terminal device and the stylus.

[0024] A mapping relationship among the pressure value, the tilt angle, and the signal strength is obtained, and a residual signal strength is determined according to the second pressure value, the target tilt angle, and the mapping relationship.

[0025] The residual signal strength in the second signal strength is removed to obtain an initial signal strength, and then the target critical threshold is determined based on the initial signal strength.

[0026] The embodiment of the present application can effectively eliminate the influence of the force applied by the user to the stylus on the signal amount, as well as the influence of the contact area between the stylus tip and the screen on the signal amount. Therefore, the initial signal amount obtained can be closer to the signal amount in the state where the actual stylus is just separated from the screen. Based on the initial signal amount, the critical threshold is determined, which can effectively improve the rationality of the critical threshold, thereby improving the accuracy of the separation recognition of the stylus and the handwriting module. At the same time, since the embodiment of the present application can adaptively learn a suitable critical threshold when the user normally uses the stylus to write in the handwriting module. Compared with setting a fixed-size critical threshold, the embodiment of the present application can effectively adapt to various terminal device conditions and stylus conditions, and can update the critical threshold in time with the changes in the terminal device condition and the stylus condition. Therefore, the critical threshold obtained in the embodiment of the present application has a stronger adaptability and higher flexibility to the actual application situation, and the effectiveness of the critical threshold is higher.

[0027] As an embodiment of the present application, the mapping relationship belongs to a linear function type relationship.

[0028] In a sixth possible implementation manner of the first aspect, the handwriting module includes multiple areas, and a method for determining the target critical threshold includes:

[0029] Obtain the latest second pressure value, the latest second signal strength, and the latest target tilt angle between the stylus and the handwriting module, wherein the second pressure value is the pressure value applied by the user to the stylus, or the pressure value applied by the stylus to the handwriting module, and the second signal strength is the signal strength of the coupling signal between the terminal device and the stylus.

[0030] The area where the stylus pen is located on the handwriting module at the current moment is determined, and the area is used as the second area.

[0031] A mapping relationship associated with the second region is obtained, and then the residual signal strength is determined according to the second pressure value, the target tilt angle, and the mapping relationship, wherein the mapping relationship is a mapping relationship between the pressure value, the tilt angle, and the signal strength.

[0032] The residual signal strength in the second signal strength is removed to obtain an initial signal strength, and a target critical threshold associated with the second region is determined based on the initial signal strength.

[0033] The embodiment of the present application has all the beneficial effects of the fifth possible implementation method of the first aspect. At the same time, the embodiment of the present application can achieve more detailed differentiation and learning of the critical threshold by learning the critical threshold in different regions. The critical threshold thus obtained can better adapt to different regions within the same screen, so that when the subsequent terminal device uses the critical threshold to determine whether the stylus has left the screen, the judgment result is more accurate and reliable. Therefore, the embodiment of the present application can further improve the effectiveness of the critical threshold obtained.

[0034] In a seventh possible implementation manner of the first aspect, the mapping relationship is a functional relationship between the pressure value, the tilt angle, and the signal amount.

[0035] In an eighth possible implementation manner of the first aspect, detecting a change trend of the first pressure value within a preset time range includes:

[0036] First, all the first pressure values ​​acquired within a preset time range are compared with each other in units of two adjacent first pressure values.

[0037] When the size comparison result includes the first category results and the second category results, the number of the first category results is counted, and the difference between the two adjacent first pressure values ​​in each second category result is obtained. If the number of the first category results is greater than the preset decreasing threshold, and the differences corresponding to all the second category results are less than the preset mutation threshold, the change trend is determined to be from large to small. Among them, the first category result refers to the pressure value obtained first in two adjacent first pressure values ​​that is greater than the pressure value obtained later, and the second category result refers to the pressure value obtained first in two adjacent first pressure values ​​that is less than or equal to the pressure value obtained later.

[0038] Through the embodiments of the present application, on the one hand, it is possible to normally identify whether the pressure value is showing a decreasing trend; on the other hand, it is possible to tolerate the interference of some noise data and accurately identify the changing trend as a decreasing trend when such noises appear, thus having a strong anti-interference ability.

[0039] In a ninth possible implementation manner of the first aspect, detecting a change trend of the first pressure value within a preset time range includes:

[0040] Function fitting is performed on multiple first pressure values ​​acquired within a preset time range to obtain a corresponding pressure change function.

[0041] If the pressure change function is a decreasing function, it is determined that the change trend of the first pressure value is from large to small.

[0042] By means of function fitting, the overall trend of pressure value changes can be better reflected, thereby improving the accuracy of identifying the change trend.

[0043] A second aspect of an embodiment of the present application provides a critical threshold learning method, characterized in that it is applied to a terminal device, the terminal device includes a handwriting module, and includes:

[0044] Obtain the latest second pressure value, the latest second signal strength, and the latest target tilt angle between the stylus and the handwriting module, wherein the second pressure value is the pressure value applied by the user to the stylus, or the pressure value applied by the stylus to the handwriting module, and the second signal strength is the signal strength of the coupling signal between the terminal device and the stylus.

[0045] A mapping relationship among the pressure value, the tilt angle, and the signal strength is obtained, and a residual signal strength is determined according to the second pressure value, the target tilt angle, and the mapping relationship.

[0046] The residual signal strength in the second signal strength is removed to obtain the initial signal strength, and then the target critical threshold is determined based on the initial signal strength. The target critical threshold is used to compare with the first signal strength of the latest coupling signal between the terminal device and the stylus to identify whether the stylus has left the handwriting module.

[0047] The embodiment of the present application can effectively eliminate the influence of the force applied by the user to the stylus on the signal amount, and the influence of the contact area between the stylus pen head and the screen on the signal amount. Therefore, the initial signal amount obtained can be closer to the signal amount in the state where the actual stylus is just separated from the screen. Based on the initial signal amount, the critical threshold is determined, which can effectively improve the rationality of the critical threshold, thereby improving the accuracy of the separation recognition of the stylus and the handwriting module. At the same time, since the embodiment of the present application can adaptively learn a suitable critical threshold when the user normally uses the stylus to write in the handwriting module. Compared with setting a fixed-size critical threshold, the embodiment of the present application can effectively adapt to various terminal device conditions and stylus conditions, and can update the critical threshold in time with the changes in the terminal device condition and the stylus condition. Therefore, the critical threshold obtained in the embodiment of the present application has stronger adaptability and higher flexibility to the actual application situation, and the effectiveness of the critical threshold is higher. Based on the learned target critical threshold, it is compared with the first signal strength of the latest coupling signal to identify whether the stylus has left the handwriting module, which can effectively improve the accuracy of recognition.

[0048] In a first possible implementation manner of the second aspect, the handwriting module includes multiple areas. Obtaining a mapping relationship between the pressure value, the tilt angle, and the signal strength includes:

[0049] The area where the stylus pen is located on the handwriting module at the current moment is determined, and the area is used as the second area.

[0050] A mapping relationship associated with the second area is obtained, where the mapping relationship is a mapping relationship between the pressure value, the tilt angle, and the signal strength.

[0051] Based on the initial signal strength, determine the target critical threshold, including:

[0052] Based on the initial signal strength, a target critical threshold associated with the second region is determined.

[0053] The embodiment of the present application can achieve more detailed differentiation and learning of the critical threshold by learning the critical threshold in different regions. Therefore, the critical threshold obtained can better adapt to different regions in the same screen, so that when the subsequent terminal device uses the critical threshold to judge whether the stylus has left the screen, the judgment result is more accurate and reliable. Therefore, the embodiment of the present application can further improve the effectiveness of the critical threshold obtained.

[0054] As an embodiment of the present application, the mapping relationship belongs to a linear function type relationship.

[0055] A third aspect of the embodiment of the present application provides a handwriting processing device, the handwriting processing device comprising a handwriting module, the handwriting module is used for a handwriting pen to input handwriting content, the handwriting processing device comprises:

[0056] The pressure acquisition module is used to acquire a first pressure value within a preset time range, where the first pressure value is the pressure value applied by the user to the stylus or the pressure value applied by the stylus to the handwriting module, and the end time of the preset time range is the current time.

[0057] The signal quantity acquisition module is used to obtain the latest first signal strength, where the first signal strength is the signal strength of the coupling signal between the terminal device and the stylus.

[0058] The identification module is used to identify whether the stylus has left the handwriting module according to the first pressure value and the first signal strength.

[0059] The display control module is used to terminate the display of the handwriting content to be displayed input by the stylus in the handwriting module within the first time range after the current moment, or terminate the response to several target coupling signals, when it is recognized that the stylus has left the handwriting module, where the target coupling signal is the coupling signal between the stylus and the terminal device obtained after the current moment.

[0060] As an embodiment of the present application, the handwriting processing device can also implement any method of the first aspect described above.

[0061] A fourth aspect of the embodiments of the present application provides a critical threshold learning device, wherein the critical threshold learning device includes a handwriting module, and the critical threshold learning device includes:

[0062] A data acquisition module is used to obtain the latest second pressure value, the latest second signal strength and the latest target tilt angle between the stylus and the handwriting module, wherein the second pressure value is the pressure value applied by the user to the stylus, or the pressure value applied by the stylus to the handwriting module, and the second signal strength is the signal strength of the coupling signal between the terminal device and the stylus.

[0063] The mapping acquisition module is used to obtain the mapping relationship between the pressure value, the tilt angle and the signal strength.

[0064] The residual calculation module is used to determine the residual signal strength according to the second pressure value, the target tilt angle and the mapping relationship.

[0065] The residual removal module is used to remove the residual signal strength in the second signal strength to obtain the initial signal strength.

[0066] The threshold determination module is used to determine the target critical threshold based on the initial signal strength. The target critical threshold is used to compare with the first signal strength of the latest coupling signal between the terminal device and the stylus to identify whether the stylus leaves the handwriting module.

[0067] As an embodiment of the present application, the critical threshold learning device can also implement any method as described in the second aspect above.

[0068] In a fifth aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the processor implements a method as described in any one of the first aspects above, or implements a method as described in any one of the second aspects above.

[0069] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements a method as described in any one of the first aspects above, or implements a method as described in any one of the second aspects above.

[0070] In a seventh aspect, an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the method as described in any one of the first aspects above, or to implement any one of the methods described in the second aspect above. The chip system can be a single chip, or a chip module composed of multiple chips.

[0071] In an eighth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device executes the method described in any one of the first aspects above, or implements any one of the methods described in the second aspect above.

[0072] It can be understood that the beneficial effects of the third to eighth aspects mentioned above can be found in the relevant descriptions of the first and second aspects mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1A A schematic diagram of a scene in which a stylus pen writes on a screen of a terminal device provided in an embodiment of the present application;

[0074] Figure 1B A schematic diagram of the time delay of each step in the handwriting display process provided in an embodiment of the present application;

[0075] Figure 1C A schematic diagram of a scene of withdrawing a stylus provided in an embodiment of the present application;

[0076] Figure 1D A schematic diagram of a scenario in which handwriting does not disappear in time during the process of withdrawing the stylus provided in an embodiment of the present application;

[0077] Figure 2 A flowchart of a handwriting processing method provided in an embodiment of the present application;

[0078] Figure 3 A schematic diagram of a scenario of a signal quantity, an applied force, and a distance from a screen provided in an embodiment of the present application;

[0079] Figure 4 A flowchart of a method for realizing the identification of whether the stylus has left the first module provided in an embodiment of the present application;

[0080] Figure 5 A schematic diagram of a process for analyzing a pressure value change trend provided in an embodiment of the present application;

[0081] Figure 6 A schematic diagram of a scenario for dividing a screen into regions provided in an embodiment of the present application;

[0082] Figure 7 A schematic diagram of a flow chart of a method for obtaining a critical threshold value provided in an embodiment of the present application;

[0083] Figure 8 A schematic diagram of the overall solution flow of a handwriting processing method provided in an embodiment of the present application;

[0084] Fig. 9A A flowchart of a critical threshold learning method provided in an embodiment of the present application;

[0085] Fig. 9B A schematic diagram of a process for starting to learn critical conditions provided in an embodiment of the present application;

[0086] Fig.10 A schematic diagram of a scene of writing with a stylus at different tilt angles provided in an embodiment of the present application;

[0087] Fig.11 A schematic diagram of a process for calculating an initial signal quantity provided in an embodiment of the present application;

[0088] Fig.12Another schematic diagram of a critical threshold learning method provided in an embodiment of the present application;

[0089] Fig.13 Another schematic diagram of a critical threshold learning method provided in an embodiment of the present application;

[0090] Fig.14 A schematic diagram of the structure of a stylus pen and a touch screen of a terminal device provided in an embodiment of the present application;

[0091] Fig.15 A schematic diagram of the structure of a handwriting processing device provided in an embodiment of the present application;

[0092] Fig.16 A schematic diagram of the structure of a tablet computer provided in an embodiment of the present application;

[0093] Fig.17 A software structure diagram of a terminal device provided in an embodiment of the present application;

[0094] Fig.18 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0095] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0096] The following is an explanation of some concepts that may be involved in this application:

[0097] Multiple: In the embodiments of the present application, multiple refers to two or more.

[0098] Coupling signal and signal quantity: In the embodiment of the present application, the coupling signal refers to a signal generated based on the coupling method between the stylus and the terminal device. The coupling signal can be used for the terminal device to draw handwriting. For example, the terminal device can determine the thickness, depth, etc. of the handwriting based on the signal strength of the coupling signal. Among them, the type of coupling signal needs to be determined according to the actual coupling method between the stylus and the terminal device. For example, in some embodiments, when the coupling method between the stylus and the terminal device is capacitive coupling, and the stylus is a capacitive stylus, the coupling signal may be a capacitive signal. When the coupling method between the stylus and the terminal device is electromagnetic coupling, and the stylus is an electromagnetic stylus, the coupling signal may be an electromagnetic signal. When the coupling method between the stylus and the terminal device is to detect the operation of the stylus through resistance, and the stylus is a resistive stylus, the coupling signal may be a resistive signal.

[0099] In an embodiment of the present application, the signal quantity is used to represent the signal strength of the coupling signal between the terminal device and the stylus. On this basis, the signal quantity can be the actual signal strength value of the coupling signal, or it can be a quantized value after the signal strength of the coupling signal is converted according to a specific rule. Since the types of coupling signals corresponding to different coupling modes are different, the actual physical units of the corresponding signal quantities will also be different. For ease of explanation, the embodiments of the present application illustrate the signal quantities in the form of pure numerical values. For example, in some embodiments, the signal quantity can be n, where n is an arbitrary positive number. The specific physical unit corresponding to the signal quantity can be determined according to the actual coupling mode used, and no special description is given in the embodiments of the present application.

[0100] In the following embodiments of the present application, the signal strength of the coupling signal is represented by the signal quantity for description, that is, the signal quantity in each embodiment can also be replaced by the signal strength.

[0101] Handwriting module: refers to the hardware in the terminal device that can be used to write with a stylus, so that the stylus can input handwriting content by writing in the handwriting module. Depending on the type of terminal device, the specific hardware corresponding to the handwriting module may also vary. For example, for some terminal devices, the screen supports stylus writing, and the screen can be used as a handwriting module of the terminal device. Such as common smart phones and tablets. For another example, for terminal devices such as handwriting tablets and drawing tablets that have hardware other than screens to support stylus writing, these hardware that support stylus writing can also be used as handwriting modules of terminal devices.

[0102] A stylus is a device used to write on a terminal device. Users can use the stylus to perform touch, writing, or drawing operations on the terminal device. With the increasing popularity of smart terminal devices such as mobile phones, tablets, and notebooks, users' demand for styluses and usage scenarios are becoming more and more diverse. For example, you can refer to Figure 1A , which is a schematic diagram of possible scenarios of writing with a stylus on the screen of a terminal device.

[0103] According to the working principle, the stylus can be classified into resistive stylus and inductive stylus, among which the inductive stylus can be further divided into electromagnetic stylus and capacitive stylus. When writing with stylus of different working principles, in order for the terminal device to display the handwriting of the stylus on the screen, the data required to be obtained and the method of obtaining the data may be different. But generally speaking, it is necessary to obtain the coordinate information of the stylus when writing and the pressure value of the handwriting module. Among them, the coordinate information is used to locate the handwriting display position, which can be detected by the terminal device. The pressure value can be used by the terminal device to determine whether the stylus leaves the handwriting module (i.e., whether the pen is withdrawn). The pressure value can be detected by the stylus and sent to the terminal device through coding or Bluetooth communication methods. In the actual application process, after obtaining the coordinate information and pressure value, the terminal device can perform the corresponding handwriting analysis and display. If the terminal device obtains the coordinate information but does not obtain the pressure value, it can determine that the stylus is withdrawn. At this time, the handwriting can be displayed instead of the cursor.

[0104] In actual applications, when a user uses a stylus to write on the handwriting module of a terminal device, there are several main steps from the user applying force to the stylus to the terminal device displaying the corresponding handwriting on the screen. Figure 1B , is a schematic diagram of the delay of each step in the process of displaying handwriting provided by the embodiment of the present application. The details are as follows:

[0105] 1. The user applies a certain force to the stylus or releases the force. At this time, the stylus can be in a normal writing state on the handwriting module of the terminal device, or it can be in a state of leaving the handwriting module. The pressure sensor of the stylus can detect the force applied by the user, but due to the sensitivity limitation of the pressure sensor, there is a detection delay of T1 time for force detection.

[0106] 2. After the pressure sensor of the stylus detects the pressure data, it needs to parse the pressure data to get the corresponding pressure value. At this time, it is affected by factors such as the pressure sampling cycle and the pressure priority of the stylus control processor, and there is a pressure parsing delay of T2 time.

[0107] 3. The stylus sends the pressure value and other required data (such as coupling signals, etc.) to the terminal device through coding or Bluetooth communication. At this time, there is a transmission delay of T3 time. The specific communication method needs to be determined according to the actual situation.

[0108] 4. After receiving the pressure value and other data, the terminal device processes the pressure value and other data accordingly, and then displays the corresponding handwriting on the screen. At this time, due to the limitations of factors such as the processing power of the terminal device processor, there is a display delay of T4 time.

[0109] By the above Figure 1B From the analysis of each step, we can see that there may be a time delay from T1 to T4 from the time the user applies force to the stylus to the time the terminal device displays the corresponding handwriting on the screen, so the handwriting display of the terminal device will lag behind the user's actual operation of the stylus. On this basis, you can refer to Figure 1C , is a schematic diagram of a scene of withdrawing a stylus provided in an embodiment of the present application. Figure 1C , when the user takes the stylus away from the terminal device screen (also known as lifting or withdrawing the pen), when the stylus leaves the screen, the force applied by the user to the stylus becomes 0. However, due to the time delay from T1 to T4, the terminal device receives the pressure value with a delay, so that the terminal device can still obtain the coordinate information and pressure value for a short period of time after the stylus leaves the handwriting module, and the handwriting will continue to be displayed with a delay. Therefore, in actual applications, when the stylus is withdrawn, the terminal device may not be able to disappear the handwriting in time.

[0110] Let's take an example to illustrate. You can continue to refer to Figure 1D , is a schematic diagram of a scenario in which the handwriting does not disappear in time during the process of removing the stylus provided by the embodiment of the present application. Assume that the user used the stylus to write something on the screen of the terminal device before time t1, and took the stylus away from the screen at time t1. At this time, you can refer to Figure 1D (a) in the figure is the handwriting content and state of the stylus when the stylus just leaves the screen at time t1. At time t2 (time t2 is the time after time t1), although the stylus leaves the screen, due to the detection delay and pressure analysis delay, the pressure value data received by the terminal device is still the data at time t1. At this time, the terminal device will still display the handwriting corresponding to time t1 at time t2. At this time, you can refer to Figure 1D (b) in the figure is the handwriting content displayed on the screen at time t2. It can be seen that at time t2, the handwriting appears to be retraced after the stylus is removed from the screen.

[0111] If the stylus handwriting does not disappear in time, it will lead to a poor writing experience for the user and reduce the user experience of the stylus and the terminal device. Therefore, how to solve or improve the problem that the stylus handwriting does not disappear in time is a problem that needs to be solved in practical applications.

[0112] In order to improve the problem of the delayed disappearance of stylus handwriting, an optional approach is to solve or improve any one or more of the delays in detection delay, pressure analysis delay, transmission delay and display delay. For example, a pressure sensor with higher sampling sensitivity can be used to reduce the detection delay. The sampling frequency of the stylus for pressure data can be increased, such as from 60 Hz to 120 Hz, to reduce the pressure analysis delay. A more stable and efficient communication method can be used between the terminal device and the stylus to shorten the transmission delay. The terminal device can use a processor with stronger processing power to shorten the display delay, etc. Although these methods can shorten the overall delay to a certain extent, thereby improving the problem of delayed disappearance of stylus handwriting, they are all highly dependent on hardware, which leads to high cost and difficulty in implementing the methods. At the same time, the degree of improvement is also relatively limited, resulting in the problem of delayed disappearance of stylus handwriting still being relatively serious.

[0113] In order to improve the problem of delayed disappearance of handwriting by the stylus, in the embodiment of the present application, the terminal device can simultaneously monitor the pressure value of the stylus and the signal amount of the coupling signal acquired in the recent period. And identify whether the stylus has left the handwriting module of the terminal device according to the pressure value and the signal amount. At the same time, after determining that the stylus has left the handwriting module, the terminal device stops displaying the handwriting content within the subsequent preset range.

[0114] Since the force applied by the stylus will gradually decrease (i.e., releasing the force) during the process of the user withdrawing the pen, the pressure value in the recent period of time can be regarded as one of the characteristics of the withdrawal of the pen. At the same time, in actual applications, the signal amount of the coupling signal will decrease as the distance between the stylus and the handwriting module increases. The farther the stylus tip is from the handwriting module, the smaller the signal amount that the terminal device can obtain. Therefore, according to actual needs, a critical threshold for evaluating the distance between the stylus tip and the handwriting module can be set. Then, based on the obtained pressure value and signal amount, it is identified whether the stylus has left the handwriting module. When it is identified that the stylus has left the handwriting module, the terminal device chooses not to display the handwriting content within the subsequent preset range. As a result, the handwriting can disappear in time as soon as the stylus leaves the handwriting module, improving or even avoiding the situation where the handwriting of the stylus disappears untimely.

[0115] The following describes the scenarios to which this application can be applied:

[0116] The embodiments of the present application can be applied to scenarios where any stylus pen is used to write on a terminal device, wherein writing includes but is not limited to operations such as writing and drawing.

[0117] At the same time, the embodiments of the present application do not impose too many restrictions on the specific device types and software and hardware configurations of the terminal device and the stylus, which can be determined according to actual applications. For example, the handwriting processing method provided in the embodiments of the present application can be applied to any terminal device that supports a stylus, such as a mobile phone, a tablet computer, a handwriting tablet, a drawing tablet, and a wearable device. At this time, the terminal device is the executor of the handwriting processing method provided in the embodiments of the present application. At the same time, the stylus can be a resistive stylus, an inductive stylus, or a stylus based on other principles. At the same time, the embodiments of the present application do not impose too many restrictions on the communication method between the stylus and the terminal device, and any communication method is acceptable.

[0118] In order to illustrate the technical solution described in the present application, the handwriting module is a terminal device screen, and the stylus is an inductive stylus, and is described through a specific embodiment. In other embodiments, the handwriting module may also be other hardware other than the screen. Since the user uses the stylus to write, the force applied by the user to the stylus will be transmitted from the stylus to the handwriting module of the terminal device. Therefore, the pressure value in the embodiment of the present application may refer to the pressure value corresponding to the force applied by the user to the stylus, or it may refer to the pressure value corresponding to the force applied by the stylus to the handwriting module of the terminal device. The forces corresponding to the two pressure values ​​are essentially the same. The following examples are all taken as examples in which the pressure value is the pressure value corresponding to the force applied by the user to the stylus.

[0119] Figure 2 The following is a flowchart of the handwriting processing method according to the first embodiment of the present application, which is described in detail as follows:

[0120] S201, the terminal device obtains the pressure value of the stylus pen and the signal amount of the coupling signal, and identifies whether the stylus pen leaves the handwriting module of the terminal device according to the obtained pressure value and signal amount.

[0121] The pressure value obtained in S201 may also be referred to as a first pressure value, and the signal amount obtained may also be referred to as a first signal amount or a first signal strength.

[0122] Since the stylus pen is used to operate the screen through the pen tip to achieve writing in actual applications, whether the stylus pen leaves the screen in the embodiment of the present application actually refers to whether the pen tip of the stylus pen leaves the screen.

[0123] On the one hand, the pressure value of the stylus (hereinafter referred to as the pressure value) can change with the magnitude of the force applied by the user to the stylus. Within the effective detectable range of the pressure value, when the force applied by the user to the stylus increases, the pressure value can increase accordingly, and when the force applied by the user to the stylus decreases, the pressure value can decrease accordingly. In the process of withdrawing the pen, the force applied by the user to the stylus will gradually decrease, so that the pressure value will also gradually decrease in the process of withdrawing the pen. Therefore, in theory, by detecting the changing trend of the pressure value, the user's pen withdrawal behavior can be identified.

[0124] It should be noted that for styluses of other principles such as resistive styluses, the methods for obtaining pressure values ​​may be somewhat different. For example, in some scenarios, the pressure value may be actively detected by the terminal device. However, within the effective detectable range of the pressure value, the pressure value may also change with the magnitude of the force applied by the user to the stylus, so the user's pen withdrawal behavior can also be identified by using the changing trend of the pressure value.

[0125] On the other hand, in actual applications, the amount of coupled signals will decrease as the distance between the stylus and the screen increases. The farther the stylus tip (hereinafter referred to as the tip) is from the screen, the smaller the amount of signals that the terminal device can obtain. Figure 3 , is a schematic diagram of a scenario of the signal amount of a coupling signal, the applied force, and the distance from the screen provided by an embodiment of the present application. Assuming that the signal amount when the stylus tip just touches the screen is 6200, when the user continues to apply force to the stylus, the signal amount may increase to 6800, and when the stylus tip is 0.2 mm away from the screen, the signal amount may drop to 5800. Therefore, in theory, the distance between the stylus tip and the screen can be identified by the size of the coupling signal.

[0126] Based on the above analysis, the embodiment of the present application can identify the user's pen withdrawal behavior through the pressure value, and at the same time identify the distance between the stylus and the screen in combination with the signal amount, so as to accurately identify whether the pen tip has left the screen during the pen withdrawal process. Specifically, it can be identified whether the pressure value has shown a downward trend in the recent period of time, and at the same time identify whether the signal amount is less than a set critical threshold. If both conditions are met at the same time, it can be determined that the stylus has left the handwriting module.

[0127] The way to obtain the pressure value and the signal quantity is not limited here, and can be determined according to the actual application situation. For example, the pressure value and the signal quantity can be detected by the stylus and sent to the terminal device for use, or the terminal device can actively detect one or both of the data. In addition, the frequency of obtaining the pressure value and the signal quantity (that is, the execution frequency of S201) is not too limited here. For example, in some optional embodiments, some trigger conditions can be set, such as when the pressure value is not 0, the operation of S201 is executed when the trigger condition is met.

[0128] As an optional embodiment of the present application, refer to Figure 4 , is a flowchart of a method for realizing identification of whether a stylus has left a handwriting module of a terminal device provided by an embodiment of the present application, in which S201 can be replaced by: S301 to S304. The details are as follows:

[0129] S301, the terminal device obtains the pressure value of the stylus and the signal amount of the coupling signal.

[0130] S302, the terminal device detects the change trend of the pressure value within a preset time range, wherein the end time of the preset time range is the current time.

[0131] The operation of S301 can refer to the relevant description of S201, which will not be repeated here. Among them, since the embodiment of the present application needs to detect the change trend of the pressure value, the pressure value data within the preset time range is obtained, and the specific number of pressure values ​​obtained needs to be determined according to the sampling frequency of the pressure value by the stylus or the terminal device and the duration of the preset time range. The signal amount can be the signal amount obtained most recently.

[0132] In the embodiment of the present application, the time range for pressure value detection (i.e., preset time range) can be pre-set by the technician, and no further limitation is given here. In order to make the result of the trend analysis real-time, the preset time range is actually the time range closest to the current moment, so the end time of the preset time range is the current moment.

[0133] In some optional embodiments, considering that the actual time consumption of the user's pen withdrawal behavior is often in the millisecond level, the upper limit of the duration of the preset time range can be set to 1000 milliseconds. Specifically, the average time consumption of some users' pen withdrawal behaviors can also be counted in advance, and the average time consumption is used as the upper limit value. Reasonable setting of the upper limit of the preset time range can prevent the duration of the preset time range from being too long, making the user's behavior complexity during this period too high, thereby reducing the effectiveness of the collected pressure value and failing to accurately detect the pen withdrawal behavior.

[0134] At the same time, it is considered that the terminal device or stylus has a relatively limited frequency of detecting pressure values, for example, common detection frequencies include 60 Hz, 120 Hz, and 144 Hz. The pressure value detection frequency determines the shortest interval required to obtain a single pressure value. For example, for a detection frequency of 60 Hz, the terminal device can obtain a pressure value every 16.66 milliseconds at the fastest. When performing a trend analysis, a certain number of pressure values ​​is required so that the analyzed trend has a certain degree of credibility. Based on this, the embodiment of the present application can pre-set a minimum number of samples, and calculate the lower limit of the duration of the preset time range based on the quotient of the pressure value detection frequency of the terminal device or stylus and the minimum number of samples. For example, assuming that the detection frequency is 60 Hz and the minimum number of samples is set to 10, the lower limit of the duration of the preset time range is equal to 10 divided by 60 Hz, that is, 166.6 milliseconds.

[0135] As an optional embodiment of the present application, when the upper and lower limits of the duration of the above-mentioned preset time range are met, any value within the range from the lower limit to the upper limit can be selected as the duration of the preset time range. For example, assuming that the lower limit is 166.6 milliseconds and the upper limit is 1000 milliseconds, any value within 166.6 milliseconds to 1000 milliseconds can be selected as the duration of the preset time range, such as 500 milliseconds. At this time, the preset time range is the 500 milliseconds closest to the current moment. When the specific duration of the preset time range is known, the start time can be determined by calculating the specific duration forward based on the current moment, thereby determining the preset time range from the start time to the current moment.

[0136] In some embodiments, S301 may also be replaced by: the terminal device detects the change trend of the pressure value within the preset time period closest to the current moment. The preset time period is the duration of the preset time range. The only difference here is the way of describing the preset time range, and the essential principle is still the same, so it will not be repeated here.

[0137] After obtaining the pressure values ​​within the preset time range, the terminal device can start to analyze the change trend of these pressure values ​​within the preset time range, such as a decreasing trend, an increasing trend or a stable trend. Among them, the decreasing trend can also be called a downward trend, gradually decreasing or changing from large to small, which means that the pressure value is gradually decreasing as a whole within the preset time range. The increasing trend can also be called an upward trend, gradually increasing or changing from small to large, which means that the pressure value is gradually increasing as a whole within the preset time range. The embodiment of the present application does not make too many restrictions on the specific analysis method of the change trend, and any method that can realize the data change trend analysis is acceptable. For example, in some optional embodiments, the change trend of the pressure value can be analyzed by a neural network learning method. It is also possible to use a curve fitting method to fit the obtained pressure value to a function, and determine the corresponding change trend based on the fitted function (i.e., the pressure change function). If it is assumed that the fitted function is an increasing function, it means that the change trend is an increasing trend. If it is assumed that the fitted function is a decreasing function, it means that the change trend is a decreasing trend.

[0138] As an optional embodiment of the present application, reference may be made to Figure 5 , is a flow chart of a pressure value change trend analysis provided by an embodiment of the present application. At this time, S302 can be replaced by: S401 to S404. The details are as follows:

[0139] S401, comparing the sizes of two adjacent pressure values ​​of all pressure values ​​within a preset time range in units of two.

[0140] During the process of the user withdrawing the pen, the force applied to the stylus will gradually decrease, so the pressure value obtained is also decreasing in theory. Based on this, the embodiment of the present application can first compare the sizes of the relevant adjacent pressure values ​​in turn, so as to determine whether each adjacent pressure value is increasing or decreasing. At this time, the size comparison result between every two adjacent pressure values ​​can be divided into two possible results: a first type of result and a second type of result. Among them, the first type of result means that the pressure value obtained first is greater than the pressure value obtained later, that is, the pressure value has decreased. The second type of result means that the pressure value obtained first is less than or equal to the pressure value obtained later, that is, the pressure value remains unchanged or increases.

[0141] Take an example to illustrate. Assume that within the preset time range, five pressure values ​​are obtained according to the obtained time sorting: pressure value 1, pressure value 2, pressure value 3, pressure value 4 and pressure value 5. At this time, by performing a pairwise comparison of adjacent pressure values, four groups of comparison results can be obtained, namely: comparison result 1 of pressure value 1 and pressure value 2, comparison result 2 of pressure value 2 and pressure value 3, comparison result 3 of pressure value 3 and pressure value 4, and comparison result 4 of pressure value 4 and pressure value 5. On this basis, it is assumed that the magnitude relationship of the five pressure values ​​is: pressure value 1>pressure value 2>pressure value 3<pressure value 4>pressure value 5. At this time, it can be seen that comparison result 1, comparison result 2 and comparison result 4 all belong to the first category of results, and since pressure value 3<pressure value 4, comparison result 3 belongs to the second category of results.

[0142] S402, if all comparison results are first-type results, determine that the change trend is a decreasing trend. The first-type result means that of two adjacent pressure values, the pressure value obtained first is greater than the pressure value obtained later.

[0143] When all comparison results are the first type of results, it means that the pressure value is continuously decreasing and the user is withdrawing the pen. At this time, it can be determined that the change trend is a decreasing trend.

[0144] As an optional embodiment of the present application, if all comparison results are the second type of results, it means that the user is maintaining the force applied to the stylus or increasing the force applied. At this time, the change trend may be an increasing trend or a stable trend.

[0145] S403, if the comparison result includes both the first category results and the second category results, count the number of the first category results and obtain the difference between two adjacent pressure values ​​in each second category result. The second category result refers to two adjacent pressure values, in which the pressure value obtained first is less than or equal to the pressure value obtained later.

[0146] S404: If the number of the first category results is greater than a preset decreasing threshold, and the differences corresponding to all the second category results are less than a preset mutation threshold, it is determined that the change trend is a decreasing trend.

[0147] Considering that in actual applications, due to the influence of various known or unknown factors, the change of pressure value may be difficult to show a standard decreasing trend. For example, in the process of reducing the pressure value, the pressure value may suddenly increase or remain unchanged due to the uneven force applied by the user to the stylus. Therefore, in order to improve the accuracy of identifying the decreasing trend, when the first category of results and the second category of results are detected at the same time, the embodiment of the present application counts the number of first category results on the one hand, and calculates the difference between two adjacent pressure values ​​in each second category of results on the other hand. For example, assuming that pressure value 3 < pressure value 4, the comparison result 3 of pressure value 3 and pressure value 4 belongs to the second category of results. At this time, the embodiment of the present application can calculate the difference between pressure value 3 and pressure value 4.

[0148] On the basis of obtaining the difference corresponding to each of the second category results, the embodiment of the present application will continue to detect whether these differences have too large values. Specifically, it will detect whether there is a difference greater than or equal to the preset mutation threshold. If there is a situation where the difference is too large, it is very likely that the user is not doing a normal pen withdrawal operation. When all the differences are less than the mutation threshold, it means that although there is a sudden increase in the pressure value, the increase is relatively limited, and it is likely to be some noise data generated by various factors. Therefore, when the embodiment of the present application detects that there are more pressure values ​​that are decreasing (that is, the number of the first category results is greater than the preset decreasing threshold), and all the differences are less than the mutation threshold, the change trend can still be determined to be a decreasing trend. Among them, the specific values ​​of the decreasing threshold and the mutation threshold are not limited here and can be set by the technician. For example, in some optional embodiments, the decreasing threshold can be set to a preset ratio of the number of all pressure values ​​obtained within a preset time range, such as 2 / 3, and the decreasing threshold can also be set to a specific value, such as 20 or 25.

[0149] Through the embodiments of the present application, on the one hand, it is possible to normally identify whether the pressure value is showing a decreasing trend; on the other hand, it is possible to tolerate the interference of some noise data and accurately identify the changing trend as a decreasing trend when such noises appear, thus having a strong anti-interference ability.

[0150] S303: The terminal device obtains a critical threshold and detects whether the signal quantity is less than or equal to the critical threshold.

[0151] Depend on Figure 3It can be seen from the relevant description of the illustrated embodiment that the signal amount of the coupling signal will decrease as the distance between the stylus pen and the screen increases. At the same time, it is also found in actual applications that even if the stylus pen and the screen are in a state of just being separated, there will be a certain amount of signal. Therefore, in the embodiment of the present application, a corresponding critical threshold is also set for the state where the stylus pen and the screen are just separated, and after the signal amount is obtained, it is compared whether the signal amount is less than or equal to the critical threshold. In the embodiment of the present application, the critical threshold currently required to be used by the terminal device or the critical threshold required to be learned is also referred to as the target critical threshold. As in S303, what is obtained is the target critical threshold.

[0152] Among them, the embodiments of the present application do not impose too many restrictions on the method of setting the critical threshold, including but not limited to pre-setting a fixed critical threshold, or pre-setting a learning method for the critical threshold, and then the terminal device autonomously learns and determines an appropriate critical threshold.

[0153] As an optional embodiment of the present application, considering that there may be some differences in the hardware conditions at different positions of the screen in actual applications, this leads to some differences in the amount of signal that can be detected by the terminal device when the screen is in different positions in actual applications and is just separated from the stylus. Based on this, in order to improve the accuracy of detecting the distance between the stylus and the screen, so as to improve the accuracy of detecting when the stylus leaves the screen. In an embodiment of the present application, the screen can be divided into multiple different areas in advance, and each area can be used as an independent critical threshold setting object. On this basis, S303's operation of obtaining the critical threshold specifically includes: S3031, the terminal device obtains the area where the stylus is located, and obtains the critical threshold associated with the area.

[0154] Specifically, the terminal device may first obtain the coordinate information of the stylus, then locate the area where the stylus is currently located based on the coordinate information, and finally obtain the critical threshold corresponding to the area. The area where the stylus is located may be referred to as the current area or the first area.

[0155] The embodiments of the present application do not make too many restrictions on the division rules of the screen area, which can be set by the technicians. For example, in some optional embodiments, the area can be as fine as the pixel level, such as defining each pixel in the screen as an area, and the number of pixels is the number of areas. In another optional embodiment, the screen can also be divided into several areas with more pixels and larger areas.

[0156] For example, you can refer to Figure 6 , is a schematic diagram of a scenario for dividing a screen into regions provided by an embodiment of the present application. Figure 6As shown in (a) in the figure, each pixel point in the screen can be defined as a region. In this case, the screen contains regions with the number of pixels. Figure 6 As shown in (b), the screen can be divided into 9 areas, from area 1 to area 9, which have different sizes but all contain multiple pixels.

[0157] Considering that in actual applications, some areas may not have associated critical thresholds. For example, the technicians did not set a fixed critical threshold for some areas, or although a learning method for the critical threshold was set, the corresponding critical threshold has not yet been learned for some areas due to various circumstances. At this time, it may be impossible to directly obtain the required critical threshold in S3031. In order to cope with this situation, when the terminal device of the embodiment of the present application fails to obtain the critical threshold associated with the area where the stylus is located, it can also search for the critical threshold of the surrounding area, and determine the critical threshold used this time based on the searched critical threshold. On the basis of S3031, you can refer to Figure 7 , is a flow chart of a method for obtaining a critical threshold value provided in an embodiment of the present application. The details are as follows:

[0158] S3031, the terminal device obtains the area where the stylus is located, and obtains the critical threshold associated with the area.

[0159] Since the terminal device needs to use the critical threshold of the area where the stylus is located at this time, the critical threshold at this time can also be called a target critical threshold.

[0160] S3032: If the critical threshold associated with the area where the stylus is located is not obtained, the terminal device searches for the critical threshold of each area within a preset area range adjacent to the area.

[0161] In actual applications, the hardware conditions of adjacent areas in the screen are generally similar. For example, the lines of adjacent areas of the screen are close, so the closer the areas are, the more consistent their hardware configurations and external interference are. For example, when the screen is subjected to external influences such as impact, the adjacent areas are often affected in similar ways. Therefore, when the critical threshold of the area where the stylus is located is not directly obtained, the embodiment of the present application can first perform a critical threshold search on the area around the stylus. Among them, the specific size of the preset area range for the search is not overly limited here. For example, in some optional embodiments, the preset area range can be set to the n areas closest to the area where the stylus is located, where n is an arbitrary positive integer, or the preset area range can be set to a range with the area where the stylus is located as a circle and a radius of m, where m is an arbitrary positive number. In other optional embodiments, the area can also be divided into multiple channels in a horizontal or vertical manner, and each channel contains multiple areas in a horizontal or vertical column. On this basis, the preset area range can also be the nearest one or more channels.

[0162] Take an example to illustrate, you can still refer to Figure 6 In the embodiment shown, it is assumed that the preset area range is set to the 5 areas closest to the area where the stylus is located, and the area where the stylus is located is Figure 6 (b) is region 7. At this time, the preset region range includes 5 regions, namely, region 4, region 8, region 1, region 5, and region 9. Therefore, if the critical threshold associated with region 7 is not obtained, the critical threshold can be searched for these 5 regions.

[0163] S3033: Determine a critical threshold corresponding to the area where the stylus is located based on the found one or more critical thresholds.

[0164] When one or more critical thresholds are searched out in the preset area, the terminal device can determine the applicable signal area of ​​the area where the stylus is located based on these critical thresholds as a reference benchmark. For example, the mean or mode value of these critical thresholds can be taken as the applicable signal area of ​​the area where the stylus is located, or the critical threshold of the area closest to the area where the stylus is located among these critical thresholds can be taken as the applicable signal area of ​​the area where the stylus is located.

[0165] As an optional embodiment of determining the critical threshold in S3033 in the present application, in the embodiment of the present application, the critical threshold corresponding to the area where the stylus is located can be specifically determined according to the critical threshold found. In this case, S3033 can be replaced by: S30331 to S30332. The details are as follows:

[0166] S30331: If only one critical threshold is found, the found critical threshold is used as the critical threshold corresponding to the area where the stylus is located.

[0167] S30332, if critical thresholds of multiple regions are found, the region closest to the region where the stylus is located is screened out from the multiple regions found out. If a closest region is screened out, the critical threshold of the closest region is used as the critical threshold corresponding to the region where the stylus is located. If there are multiple regions closest to the region where the stylus is located among the multiple regions screened out, the average of the critical thresholds of these regions is used as the region closest to the region where the stylus is located.

[0168] The area selected in S30332 and closest to the area where the stylus is located may also be referred to as the second area.

[0169] If only one area with a critical threshold is found within the preset area, the critical threshold of the area can be used as the critical threshold for the area where the stylus is located. If multiple areas with critical thresholds are found within the preset area, the area closest to the area where the stylus is located can be first screened out according to the principle of proximity. If there is only one closest area, the critical threshold of the area can be used as the critical threshold for the area where the stylus is located. However, if there are multiple closest areas with the same physical distance, the critical thresholds of these areas can be averaged, and the average can be used as the critical threshold for the area where the stylus is located.

[0170] Still available for reference Figure 6 The embodiment shown is used as an example for illustration. It is assumed that the preset area range is set to the 5 areas closest to the area where the stylus is located, and the area where the stylus is located is Figure 6 (b) Area 7 in the figure. At this time, the preset area range includes 5 areas, namely area 4, area 8, area 1, area 5 and area 9. Assuming that only the critical threshold of one area is found after searching these 5 areas, the searched critical threshold can be used for area 7. If multiple critical thresholds are found, continue to identify the number of nearest areas. For example, assuming that the critical thresholds of areas 4, 5 and 9 are found, the area closest to area 7 is only area 4, so the critical threshold of area 4 can be used for area 7. Assuming that the critical thresholds of areas 4, 8 and 5 are found, the areas closest to area 7 are area 4 and area 8, so the average of the critical thresholds of areas 4 and 8 can be used as the critical threshold of area 7.

[0171] When the critical threshold of the area where the stylus is located is not directly obtained, the embodiment of the present application actively searches for the critical threshold of the surrounding area, and adaptively determines the most suitable critical threshold according to the search results. Therefore, the embodiment of the present application effectively copes with various possible situations of the critical threshold, has strong adaptability and compatibility to various possible situations, and can improve the effectiveness of the acquired critical threshold.

[0172] As an optional embodiment of the present application, when the terminal device cannot obtain an available critical threshold, so that the relationship between the signal quantity and the critical threshold cannot be detected in S303, in the embodiment of the present application, the recognition result can be selected as: it is impossible to recognize whether the stylus has left the handwriting module of the terminal device. At this time, the terminal device can continue to display the handwriting normally.

[0173] S304: If the pressure value has a decreasing trend within a preset time range and the signal amount is less than or equal to a critical threshold, the terminal device determines that the stylus has left the handwriting module.

[0174] When the pressure value is identified to be decreasing (i.e., decreasing from large to small), and the signal amount is less than or equal to the critical threshold, it means that the stylus is in the state of being withdrawn and the distance from the screen has just been removed. Therefore, the embodiment of the present application can determine that the stylus has left the screen.

[0175] S202: If it is recognized that the stylus has left the handwriting module, the terminal device stops displaying the handwriting content to be displayed that is input by the stylus within a preset range after the current time.

[0176] When it is recognized that the stylus has left the screen, in order to avoid the handwriting disappearing in time, the embodiment of the present application can cancel the display of the handwriting after the stylus leaves. Specifically, the embodiment of the present application can pre-set a preset range that is not displayed each time, and each time it is recognized that the stylus has left the screen, all handwriting contents within the preset range will not be displayed. Among them, since the handwriting contents after the current moment are actually not displayed yet, they can all be regarded as handwriting contents waiting to be displayed later, that is, handwriting contents to be displayed in the embodiment of the present application. Under normal circumstances, if you want to display these handwriting contents to be displayed, you need to continue to obtain new coupling signals and perform response processing to obtain the corresponding handwriting contents, and then display them on the screen. Therefore, in order not to display these handwriting contents to be displayed, you can choose to terminate the response processing of the new coupling signals obtained after the current moment, thereby terminating the generation of these handwriting contents to be displayed.

[0177] Among them, the preset range can also be called the preset first range. The embodiment of the present application does not make too many restrictions on the specific range size of the preset range. At the same time, in some embodiments, the preset range can be a time range, and the preset range can also be called the first time range. For example, the first time range can be set to h milliseconds, and h is any positive number within 1000. For example, h=30 can be set, and the terminal device can not display the handwriting content to be displayed within the next 30 milliseconds. The first time range can also be set to an infinite time length, and the terminal device can stop displaying the handwriting content to be displayed indefinitely until it is re-triggered by other trigger conditions and starts displaying the handwriting content. In other optional embodiments, the preset range can also be a number range of coupling signals, for example, the k coupling signals obtained after the current moment can be terminated to respond, so that the handwriting content corresponding to these coupling signals is not displayed, where k is an arbitrary positive integer, such as k=1, which means that the handwriting content of the next frame is not displayed. Among them, the coupling signal obtained after the current moment can be called a target coupling signal.

[0178] As an optional embodiment of the present application, the handwriting content corresponding to the current moment can be displayed or not.

[0179] It should be noted that in the embodiment of the present application, all the generated handwriting contents and the handwriting contents to be displayed are regarded as the handwriting contents input by the stylus.

[0180] As an optional embodiment of the present application, if it is not recognized that the stylus has left the handwriting module, the handwriting can be displayed normally.

[0181] It should be understood that in actual applications, the trigger condition of S201 can be set according to needs. At this time, the number of execution times of operations from S201 to S202 can be single or multiple times, which can be determined according to actual conditions and is not excessively limited here.

[0182] As an optional embodiment of the present application, reference may be made to Figure 8 , is a schematic diagram of the overall solution flow of a handwriting processing method provided in an embodiment of the present application. The details are as follows:

[0183] S501, the terminal device obtains the pressure value of the stylus pen and determines whether the pressure value is 0. If the pressure value is not 0, execute S502. If the pressure value is 0, execute S505.

[0184] S502, the terminal device obtains the critical threshold associated with the area where the stylus is located, and determines whether the critical threshold can be obtained. If the critical threshold can be obtained, S503 is executed, and if the critical threshold cannot be obtained, S506 is executed.

[0185] S503, the terminal device identifies whether the change trend of the pressure value within the preset time range is a decreasing trend. If it is a decreasing trend, execute S504, if not, execute S506.

[0186] S504, the terminal device identifies whether the signal amount of the coupled signal is less than or equal to a critical threshold. If the signal amount is less than or equal to the critical threshold, S505 is executed; if the signal amount is greater than the critical threshold, S506 is executed.

[0187] S505: The terminal device sets the pressure value to 0 and does not display the handwriting content within a preset range after the current moment.

[0188] S506, the terminal device displays the handwriting content normally.

[0189] After executing the operation of S505 or S506, a single processing of the handwriting content is completed.

[0190] The operation details, principles and beneficial effects of S502 to S506 can all be referred to in the above Figures 2 to 7 The relevant description of the embodiment is not repeated here. At the same time, the embodiment of the present application also adds a processing scheme when the pressure value is 0. Since the pressure value is 0, it means that the stylus has left the screen, so at this time, it can jump to S505 to not display the handwriting content.

[0191] As an optional embodiment of the present application, operations S501 to S506 may be performed once each time the terminal device acquires a new pressure value or coupling signal, or may be performed periodically according to a preset processing frequency, and no further limitations are imposed here.

[0192] Above Figures 1A to 8 The various embodiments shown are all embodiments for processing stylus handwriting. As an optional embodiment of the present application, it can be set to execute the contents of the above embodiments when the terminal device is in stylus mode. The stylus mode can be manually turned on by the user or actively turned on by the terminal device when a stylus or other preset conditions are detected.

[0193] In order to improve the problem of the stylus handwriting not disappearing in time, in the embodiment of the present application, the terminal device can simultaneously monitor the pressure value of the stylus and the signal amount of the coupling signal. When it is detected that the pressure value is decreasing and the signal amount is less than or equal to the critical threshold, it is determined that the stylus has left the handwriting module of the terminal device. After determining that the stylus has left the handwriting module, the terminal device does not display the handwriting content within the subsequent preset range.

[0194] Since the force applied by the stylus will gradually decrease (i.e., releasing the force) during the process of the user withdrawing the pen, the downward trend of the pressure value can be regarded as one of the characteristics of the withdrawal of the pen. At the same time, in actual applications, the signal amount of the coupling signal will decrease as the distance between the stylus and the handwriting module increases. The farther the stylus tip is from the handwriting module, the smaller the signal amount that the terminal device can obtain. Therefore, according to actual needs, a critical threshold for evaluating the distance between the stylus tip and the handwriting module can be set. When the pressure value decreases, the signal amount decreases to less than or equal to the critical threshold, indicating that the withdrawal operation has reached the state where the pen tip leaves the handwriting module, that is, the stylus has left the handwriting module at this time. Thereby realizing the rapid and accurate recognition of the stylus leaving the handwriting module. At this time, the terminal device chooses not to display the handwriting content within the subsequent preset range, so that the handwriting can disappear in time as soon as the stylus leaves the handwriting module, thereby improving or even avoiding the situation where the handwriting of the stylus disappears in time. At the same time, the embodiment of the present application also provides a specific recognition scheme for the pressure value change trend, and a specific acquisition scheme for the critical threshold, so that the change trend and the critical threshold can be accurately and effectively processed.

[0195] As an optional embodiment of the present application, considering that in actual application, when the stylus is just separated from the screen, the signal amount of the coupling signal will at least be affected by the terminal device and the stylus. Therefore, even for the same terminal device, the critical threshold suitable for different usage scenarios may vary greatly. Based on this, in order to improve the effectiveness of the critical threshold, the above Figures 2 to 8 The illustrated embodiment can better identify the state where the stylus pen has just been separated from the screen based on the critical threshold used. Figures 2 to 8 Based on the embodiments shown, reference can be made to Fig. 9A , is a flow chart of a critical threshold learning method in the handwriting processing method provided in the embodiment of the present application. The details are as follows:

[0196] S600: When the preset triggering condition is met, S601 is executed and the terminal device starts learning the critical threshold.

[0197] Among them, the critical threshold that the terminal device needs to learn can also be called the target critical threshold.

[0198] First of all, it should be explained that in the process of the user using the stylus, the learning operation of the critical threshold in the embodiment of the present application is Figures 2 to 8 The operations of the illustrated embodiment can be executed in parallel or in series, and can be set according to actual needs, which is not limited here. The details are as follows:

[0199] When executed in parallel, the learning operation of the critical threshold in the embodiment of the present application is Figures 2 to 8Each step operation in the illustrated embodiment can be processed by two relatively independent processes of the terminal device, and the terminal device can execute both at the same time. At this time, if the terminal device obtains the critical threshold value through the learning method of the embodiment of the present application before the operations of obtaining the critical threshold value such as S303 and S3031, then the operations such as S303 and S3031 can obtain the critical threshold value obtained by the learning method of the embodiment of the present application.

[0200] When executed serially, the learning operation of the critical threshold in the embodiment of the present application can be integrated into Figures 2 to 8 In the scheme logic of the illustrated embodiment, as a refinement of one of the steps. For example, in the operation process of obtaining the critical threshold value, such as S303 and S3031, if the required critical threshold value is not read, the embodiment of the present application can be started. Or if the critical threshold value of other areas is not found within the preset area in S3032, the embodiment of the present application can also be started.

[0201] Specifically, the trigger condition can be set to determine when to execute the embodiment of the present application. For example, as an optional embodiment of the present application, the trigger condition of critical threshold learning can be set to any of the following conditions:

[0202] Trigger condition 1: The terminal device is in stylus mode or detects a stylus, and the pressure value of the stylus obtained by the terminal device is not 0.

[0203] Trigger condition 2: The pressure value of the stylus obtained by the terminal device is not 0, and the signal amount of the coupled signal obtained is greater than the preset basic threshold.

[0204] Trigger condition 3: The terminal device detects that the pressure value of the stylus is not 0, the signal amount of the coupling signal is greater than the preset basic threshold, and the length of the handwriting detected at that time is greater than the length threshold.

[0205] Among them, the specific values ​​of the basic threshold and the length threshold can be set by technical personnel and are not limited here.

[0206] As an optional embodiment of the present application, corresponding to trigger condition 1, refer to Fig. 9B , is a flowchart of starting to learn critical conditions provided by an embodiment of the present application. In the embodiment of the present application, S600 can be replaced by: S6001 to S6002. The details are as follows:

[0207] S6001, the terminal device identifies whether it is currently in a stylus mode or detects a stylus. If the stylus mode is detected or the stylus is detected, S6002 is executed.

[0208] If not detected, learning of the critical threshold may not be initiated.

[0209] S6002, the terminal device identifies whether the pressure value of the stylus obtained is 0. If the pressure value is not 0, the critical threshold is learned. If the pressure value is 0, it can be determined that the current stylus has left the screen.

[0210] In practical applications, any one or more of the above trigger conditions 1 to 3 can be selected as the trigger condition in S300. When multiple trigger conditions are selected at the same time, you can choose to use the "and" or "or" logical relationship for processing. For example, when the "and" logical relationship is used for processing, the terminal device can determine that it can start learning the critical threshold when multiple selected trigger conditions are met at the same time. When the "or" logical relationship is used for processing, the terminal device can start learning the critical threshold when any selected trigger condition is met.

[0211] It should be understood that in the process of actual users using the stylus, the triggering condition for critical threshold learning may be triggered multiple times, so the learning of the critical threshold in the embodiment of the present application may also occur multiple times. For example, suppose that the triggering condition involves determining whether the triggering condition is met based on the acquired pressure value and / or signal amount, such as trigger bar 1 and trigger condition 2 mentioned above. Then, each time the terminal device acquires a new pressure value and / or signal amount, it can meet the triggering conditions in sequence, thereby starting a new learning of the critical threshold. By updating and learning the critical threshold multiple times, the critical threshold learned by the embodiment of the present application can be made to better meet the actual conditions of the terminal device and the stylus, thereby improving the effectiveness and real-time performance of the critical threshold.

[0212] S601, obtaining the signal amount of the coupling signal, the pressure value of the stylus pen, and the tilt angle of the stylus pen.

[0213] Since the embodiments of the present application and Figures 2 to 8 The operations of the embodiment shown can be executed in parallel or in series. Figures 2 to 8 The pressure value and signal quantity obtained in the embodiment shown may be the same data or different data. The specific data shall be determined according to the actual application. For the convenience of distinction, in the embodiment of the present application, Figures 2 to 8The pressure value and signal quantity used in the illustrated embodiment may be referred to as the first pressure value and the first signal quantity (i.e., the first signal strength). The pressure value and signal quantity obtained when the critical threshold learning is performed in the embodiment of the present application may be referred to as the second pressure value and the second signal quantity (the second signal quantity may also be referred to as the second signal strength). Since there are multiple first pressure values ​​(used to analyze the trend of change), the second pressure value may be a pressure value obtained from the first pressure value, such as the latest pressure value in the first pressure value, or may be a pressure value independent of the first pressure value. The second signal quantity and the first signal quantity may be the same signal quantity, or may be two independent signal quantities.

[0214] In actual applications, when a user writes with a stylus, the amount of signal acquired by the terminal device will be affected by both the force applied by the user to the stylus and the contact area between the stylus tip and the screen.

[0215] As for the effect of applied force, assuming that other variables remain constant, within the effective range of the applied force that can be detected by the stylus or terminal device, theoretically, the greater the force the user applies to the stylus, the greater the signal amount. For example, you can refer to Figure 3 In the example shown, when the terminal device and the stylus are fixed and the inclination angle of the stylus relative to the screen remains unchanged, the user continues to apply force to the stylus when the tip of the stylus just touches the screen, which can increase the signal amount from 6200 to 6800. Since the force applied by the user to the stylus can be reflected as the pressure value of the stylus, it can be seen that the pressure value will affect the signal amount obtained by the terminal device.

[0216] The contact area between the stylus tip and the screen can be reflected as the tilt angle between the stylus and the screen. The larger the tilt angle, the larger the contact area between the stylus tip and the screen. Therefore, the impact of the stylus tip on the contact area between the stylus tip and the screen can be quantified as the impact of the stylus tilt angle on the signal. In practical applications, assuming that other variables remain constant, within the effective range of the stylus detectable tilt angle, theoretically, the smaller the stylus tilt angle, the larger the signal. For an example, refer to Fig.10 , is a schematic diagram of a scene of writing with a stylus at different tilt angles provided by an embodiment of the present application. Assume that during the writing process, the user keeps the force applied to the stylus constant, but changes the tilt angle of the stylus, so that the tilt angle changes from 90° to 60° and then to 30°. At this time, you can refer to Fig.10 In (a) and (b), when the tilt angle is 90°, the signal amount is 6500, when the tilt angle decreases to 60°, the signal amount increases to 6800, and when the tilt angle decreases to 30°, the signal amount increases to 7000. As an optional embodiment of the present application, the tilt angle of the stylus pen ranges from (0° to 90°).

[0217] From the above analysis, it can be seen that in order to obtain the critical threshold value corresponding to the state where the stylus is just separated from the screen, it is necessary to remove the signal caused by the pressure value and the tilt angle on the basis of the normally obtained signal (hereinafter, the signal caused by the pressure value or the tilt angle is referred to as the residual amount, or the residual signal amount). Therefore, in the embodiment of the present application, the terminal device can obtain the corresponding real-time stylus pressure value and tilt angle while obtaining the signal amount of the coupling signal. Among them, the tilt angle can be actively detected by the stylus and sent to the terminal device. In the embodiment of the present application, the obtained tilt angle of the stylus can also be called the target tilt angle.

[0218] S602: Acquire a mapping relationship.

[0219] In the embodiment of the present application, a technician can pre-quantify the impact of pressure value and tilt angle on the signal quantity, and obtain the corresponding relationship between the pressure value change and the residual amount, and the relationship between the tilt angle change and the residual amount (these two relationship systems are referred to as mapping relationships in the embodiment of the present application). On this basis, the terminal device can continue to obtain the corresponding mapping relationship after obtaining the actual pressure value and tilt angle of the stylus. Among them, the embodiment of the present application does not make too many restrictions on the quantitative evaluation of the mapping relationship.

[0220] As an optional embodiment of the present application, any of the following quantitative evaluation methods may be used to obtain the mapping relationship:

[0221] Quantitative evaluation method 1: Using the control variable method, only the pressure value or tilt angle is used as the independent variable each time, and the corresponding signal quantity is used as the dependent variable. By adjusting different independent variable values, multiple corresponding dependent variable values ​​can be obtained. Then, through the function fitting method, the obtained multiple independent variable values ​​and dependent variable values ​​are fitted with functions to obtain the corresponding functional relationship.

[0222] At this time, the pressure value and the tilt angle have their own corresponding functional relationships, and these two functional relationships can be used as mapping relationships between pressure values ​​and tilt angles. Therefore, in S602, a mapping relationship corresponding to the pressure value and a mapping relationship corresponding to the tilt angle can be obtained, which are two independent mapping relationships.

[0223] Quantitative evaluation method 2: Using the control variable method, the pressure value and the tilt angle are used as independent variables at the same time, and the corresponding signal quantity is used as the dependent variable. By adjusting different independent variable values, multiple corresponding dependent variable values ​​can be obtained. Then, through the function fitting method, the obtained multiple independent variable values ​​and dependent variable values ​​are fitted with functions to obtain the corresponding functional relationship.

[0224] At this time, the pressure value and the tilt angle have a common functional relationship, and the functional relationship can be used as a mapping relationship between the pressure value and the tilt angle, so a mapping relationship can be obtained in S602.

[0225] In practical applications, the functional relationship between the pressure value and the residual amount and the functional relationship between the tilt angle and the residual amount are often linear relationships. Therefore, in order to simplify the mapping relationship and improve the computing efficiency of the terminal device, when performing function fitting in the above quantitative evaluation method 1 and quantitative evaluation method 2, linear function fitting can be performed to obtain the corresponding linear mapping relationship.

[0226] S603: Process the pressure value and the tilt angle according to the mapping relationship to obtain a corresponding residual amount, and remove the residual amount in the signal amount to obtain a corresponding initial signal amount.

[0227] On the basis of obtaining the mapping relationship, the pressure value and the tilt angle are substituted into the function through the mapping relationship to obtain the corresponding residual amount (also called residual signal strength). On this basis, the residual amount is subtracted from the actual signal amount to obtain the signal amount (referred to as the initial signal amount in the embodiment of the present application) when the stylus pen is just separated from the screen and there is theoretically no applied force and no contact area influence.

[0228] Taking an example for illustration, it is assumed that the above quantitative evaluation method 1 is used to obtain the mapping relationship, and the mapping relationship finally obtained is:

[0229] The mapping relationship between the pressure value and the residual is: y1=a×x1, where x1 is the pressure value, y1 is the residual corresponding to the pressure value, a is the pressure compensation coefficient, and a is a constant;

[0230] The mapping relationship between the tilt angle and the residual amount is: y2=b×x2, where x2 is the tilt angle, y2 is the residual amount corresponding to the tilt angle, b is the angle compensation coefficient, and b is a constant. The specific values ​​of a and b can be determined by linear function fitting.

[0231] You can refer to Fig.11 , is a flow chart of obtaining the initial signal quantity by respectively calculating the residual quantity for the pressure value and the tilt angle provided in the embodiment of the present application. At this time, S602 and S603 can be replaced by:

[0232] S700, obtaining a mapping relationship corresponding to a pressure value and a mapping relationship corresponding to an inclination angle.

[0233] S701, processing the acquired pressure value through the mapping relationship of the pressure value to obtain a residual amount corresponding to the pressure value.

[0234] S702: Process the acquired tilt angle according to the mapping relationship of the tilt angle to obtain a residual amount corresponding to the tilt angle.

[0235] S703, subtracting two residual quantities from the actually acquired signal quantity to obtain an initial signal quantity.

[0236] S604, determining a critical threshold based on the initial signal quantity.

[0237] If there is no critical threshold at present, the initial semaphore is used as the critical threshold. If there is a critical threshold at present, the initial semaphore is compared with the current critical threshold, and when the initial semaphore is greater than the current critical threshold, the initial semaphore is updated to the new critical threshold.

[0238] Since the critical threshold may be learned multiple times in actual applications, each time the initial signal amount is obtained, there may be a critical threshold recorded in the historical record. Based on this, when the initial signal amount is obtained, if the terminal device currently does not have a critical threshold, the initial signal amount can be used as the critical threshold. If the terminal device already has a critical threshold, the critical threshold is compared with the initial signal amount. When the initial signal amount is greater than the critical threshold, the initial signal amount is used as the new critical threshold, which can improve the sensitivity of recognizing the state of the stylus just separated from the screen, thereby improving the recognition speed of the stylus leaving the screen. As an optional embodiment of the present application, when the initial signal amount is less than or equal to the current critical threshold, you can choose not to update the current critical threshold, but continue to use the critical threshold.

[0239] As another optional embodiment of the present application, it is also possible to choose not to consider whether there is a critical threshold, but to use the initial signal amount as the critical threshold after obtaining the minimum initial signal amount. In this case, S604 can be replaced by: using the initial signal amount as the critical threshold.

[0240] As an optional embodiment of the present application, based on Fig. 9A The principle described in the illustrated embodiment can also be selected to only consider the influence of the force applied by the user to the stylus on the signal quantity, or only consider the influence of the contact area between the stylus tip and the screen on the signal quantity. Correspondingly, in S601, it is possible to choose to obtain the signal quantity and pressure value, or to obtain the signal quantity and tilt angle. The mapping relationship obtained in S602 is the mapping relationship corresponding to the pressure value, or the mapping relationship corresponding to the tilt angle. In S603, the residual amount of the signal quantity or the pressure value is calculated, and the corresponding initial signal quantity is calculated. The rest are the same as Fig. 9A The embodiments shown are the same and will not be described in detail here.

[0241] In an embodiment of the present application, a mapping relationship between pressure value and tilt angle is created, and the corresponding residual is calculated based on the mapping relationship and the actual pressure value and tilt angle. The calculated residual is then subtracted from the actual signal to obtain the initial signal, so that the embodiment of the present application can effectively eliminate the influence of the force applied by the user to the stylus on the signal, as well as the influence of the contact area between the stylus tip and the screen on the signal. The initial signal thus obtained can be closer to the signal when the actual stylus is just separated from the screen. Determining the critical threshold based on the initial signal can effectively improve the rationality of the critical threshold, thereby improving the accuracy of identifying the separation of the stylus and the screen.

[0242] At the same time, since the embodiment of the present application can adaptively learn a suitable critical threshold value when the user normally uses the stylus to write on the screen. Compared with setting a fixed-size critical threshold value, the embodiment of the present application can effectively adapt to various terminal device conditions and stylus conditions, and can update the critical threshold value in time with changes in the terminal device conditions and stylus conditions. Therefore, the critical threshold value obtained in the embodiment of the present application has stronger adaptability and flexibility to actual application conditions, and the effectiveness of the critical threshold value is higher.

[0243] As another optional embodiment of the present application, considering that there may be some differences in the hardware conditions at different positions of the screen in actual applications, this may lead to some differences in the amount of signal that can be detected by the terminal device when the screen is in different positions in actual applications and is in a state of just being separated from the stylus. Based on this, in order to improve the effectiveness of the learned critical threshold, so as to improve the accuracy of identifying the state of the stylus just being separated from the screen. In the embodiment of the present application, the screen can be divided into multiple different areas in advance, and each area can be used as an independent critical threshold setting object. Among them, the embodiment of the present application does not impose too many restrictions on the area division rules. For example, you can refer to Figure 6 The illustrated embodiment and other related embodiments are divided.

[0244] Based on the premise of dividing the screen into areas, Fig. 9A The embodiment shown can be refined. Specifically, please refer to Fig.12 , is a flow chart of the critical threshold learning method provided in the embodiment of the present application. The details are as follows:

[0245] S600, when the preset triggering condition is met, S6011 is executed and the terminal device starts learning the critical threshold.

[0246] For details, please refer to Fig. 9A The relevant description of S600 in the illustrated embodiment is not repeated here.

[0247] S6011, obtaining the signal quantity of the coupling signal, the pressure value of the stylus, the tilt angle of the stylus, and the coordinate information of the stylus.

[0248] S6021, determining the area where the stylus is located according to the coordinate information, and obtaining a mapping relationship associated with the area where the stylus is located.

[0249] The area where the stylus pen is located in the embodiment of the present application may also be referred to as the second area. Figures 2 to 8 The operations of the embodiment shown can be performed in parallel or in series. Figures 2 to 8 In the illustrated embodiment, the first area where the stylus is located may be the same area or different areas.

[0250] S6031, processing the pressure value and the tilt angle according to the mapping relationship to obtain a corresponding residual amount, and removing the residual amount in the signal amount to obtain an initial signal amount corresponding to the area where the stylus is located.

[0251] For details, please refer to Fig. 9A The relevant description of S603 in the illustrated embodiment is not repeated here.

[0252] S6041, determining a critical threshold associated with the area where the stylus is located based on the initial signal quantity.

[0253] If the area where the stylus is located has no associated critical threshold, the initial semaphore is used as the critical threshold associated with the area where the stylus is located. If the area where the stylus is located already has a critical threshold, the initial semaphore is compared with the current critical threshold, and when the initial semaphore is greater than the current critical threshold, the initial semaphore is updated to the new critical threshold of the area where the stylus is located.

[0254] The operating principles, details and beneficial effects of S6011 to S6041 are Fig. 9A S601 to S604 in the illustrated embodiment are substantially the same, so reference may be made to the relevant descriptions of S601 to S604. Only the differences are described as follows:

[0255] In the embodiment of the present application, the critical threshold values ​​associated with each area of ​​the screen are independent. That is, the learning, setting, and updating operations of the critical threshold values ​​associated with each area are independent of each other, so the mapping relationship between the pressure value and the tilt angle of each area is also independent, and the critical threshold values ​​associated with each area may be the same or different.

[0256] In order to determine the area where the stylus is currently writing (i.e., the area where the stylus is located), the embodiment of the present application refines S601 to obtain S6011, and the coordinate information of the stylus can be obtained at the same time. After obtaining the coordinate information, S602 can be refined to obtain S6021. At this time, the terminal device can locate the area where the stylus is located based on the coordinate information, and then find the mapping relationship between the pressure value and the tilt angle in the area. After the pressure value and the tilt angle are processed based on the mapping relationship to obtain the residual value, and the residual value is taken out from the signal amount, the initial signal amount corresponding to the area where the stylus is located can be obtained, so S6031 which is refined from S603 can be obtained. Finally, based on the initial signal amount, the critical threshold suitable for the area where the stylus is located can be determined, so S6041 which is refined from S604 can be obtained.

[0257] relatively Fig. 9A For the embodiment shown, on the one hand, the embodiment of the present application has Fig. 9A All the beneficial effects of the illustrated embodiments, such as the critical threshold obtained in the embodiments of the present application, have stronger adaptability and flexibility to actual application situations, and the effectiveness of the critical threshold is higher. On the other hand, the embodiments of the present application can achieve more detailed differentiation and learning of the critical threshold by learning the critical threshold in different regions. The critical threshold thus obtained can better adapt to different areas within the same screen, so that when the subsequent terminal device uses the critical threshold to determine whether the stylus has left the screen, the judgment result is more accurate and reliable. Therefore, the embodiments of the present application can further improve the effectiveness of the critical threshold obtained.

[0258] As an optional embodiment of the present application, FIG. 9A to FIG. 12 On the basis of the embodiment shown, the terminal device in the embodiment of the present application can also perform noise detection when acquiring the signal amount, and stop learning the critical threshold when the acquired signal amount has large noise. In this case, it can prevent the situation where the noise is too large, resulting in a large error in learning the critical threshold, so as to improve the effectiveness of the learned critical threshold.

[0259] As an optional embodiment of the present application, FIG. 9A to FIG. 12 The embodiment shown, with Figure 7 By combining the embodiments shown in the figure, a combined embodiment for obtaining a critical threshold can be obtained. Fig.13 , is a flow chart of a method for obtaining a critical threshold value provided in an embodiment of the present application. The details are as follows:

[0260] S800: The terminal device obtains the area where the stylus pen is located.

[0261] S801, determining whether there is a critical threshold obtained by learning in the region.

[0262] If the area where the stylus is located has a critical threshold obtained by learning, subsequent operation steps are performed based on the critical threshold, for example, step S304 of determining whether the signal amount is less than or equal to the critical threshold.

[0263] S802: If the area where the stylus is located does not have a learned critical threshold, the terminal device searches for critical thresholds learned in various areas within a preset area range adjacent to the area.

[0264] S803: Determine a critical threshold corresponding to the area where the stylus is located based on the found one or more critical thresholds.

[0265] Subsequent operation steps are performed based on the critical threshold, for example, step S304 of determining whether the signal quantity is less than or equal to the critical threshold.

[0266] For the operating principles, details and beneficial effects of S800 to S803, please refer to Figure 7 The embodiment shown, FIG. 9A to FIG. 12 The description of the illustrated embodiment and other related embodiments will not be repeated here.

[0267] As an optional embodiment of the present application, refer to Fig.14 , is a schematic diagram of the structure of a stylus pen and a touch screen of a terminal device according to an embodiment of the present application. The details are as follows:

[0268] In the embodiment of the present application, the stylus pen includes: a main control module, a pressure sensing module, a communication module and other functional modules, including but not limited to: a gesture module and a touch module.

[0269] The terminal device screen includes: an analysis module, a storage module and other functional modules, including but not limited to: a display control module, a power module, etc.

[0270] The functions of each module are described as follows:

[0271] The main control module of the stylus pen: mainly used to control the working logic of the stylus pen device, such as coding timing, pressure sensor acquisition cycle, etc.

[0272] Pressure sensing module of the stylus: Contains a pressure sensor used to sense changes in pressure of the stylus.

[0273] The communication module of the stylus pen is used to send the pressure value of the stylus pen and the coupling signal (also referred to as the electrode signal in the embodiment of the present application) to the terminal device. The communication module can be a coding module or a Bluetooth module.

[0274] Screen analysis module: used to analyze the signals from the stylus, including but not limited to pressure value, tilt angle, etc. It is also used to calculate the coordinate information or tilt angle of the stylus tip. (Depending on the actual application, the stylus tilt angle can be calculated by the stylus or by the terminal device screen)

[0275] The storage module of the screen is used to store some status information and other data, such as the learned critical threshold.

[0276] Corresponding to the handwriting processing method described in the above embodiment, Fig.15 A schematic diagram of the structure of a handwriting processing device provided in an embodiment of the present application is shown. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.

[0277] Reference Fig.15 The handwriting processing device includes a handwriting module, and the handwriting module is used for a handwriting pen to input handwriting content. The handwriting processing device includes:

[0278] The pressure acquisition module 151 is used to acquire a first pressure value within a preset time range, where the first pressure value is the pressure value applied by the user to the stylus pen, or the pressure value applied by the stylus pen to the handwriting module, and the end time of the preset time range is the current time.

[0279] The signal quantity acquisition module 152 is used to acquire the latest first signal strength, where the first signal strength is the signal strength of the coupling signal between the terminal device and the stylus.

[0280] The identification module 153 is used to identify whether the stylus has left the handwriting module according to the first pressure value and the first signal strength.

[0281] The display control module 154 is used to terminate the display of the handwriting content to be displayed input by the stylus in the handwriting module within the first time range after the current moment, or terminate the response to several target coupling signals, when it is recognized that the stylus has left the handwriting module, where the target coupling signal is the coupling signal between the stylus and the terminal device acquired after the current moment.

[0282] Corresponding to the critical threshold learning method of the above embodiment, the present application embodiment provides a critical threshold learning device. The critical threshold learning device includes a handwriting module, and the critical threshold learning device includes:

[0283] A data acquisition module is used to obtain the latest second pressure value, the latest second signal strength and the latest target tilt angle between the stylus and the handwriting module, wherein the second pressure value is the pressure value applied by the user to the stylus, or the pressure value applied by the stylus to the handwriting module, and the second signal strength is the signal strength of the coupling signal between the terminal device and the stylus.

[0284] The mapping acquisition module is used to obtain the mapping relationship between the pressure value, the tilt angle and the signal strength.

[0285] The residual calculation module is used to determine the residual signal strength according to the second pressure value, the target tilt angle and the mapping relationship.

[0286] The residual removal module is used to remove the residual signal strength in the second signal strength to obtain the initial signal strength.

[0287] The threshold determination module is used to determine the target critical threshold based on the initial signal strength. The target critical threshold is used to compare with the first signal strength of the latest coupling signal between the terminal device and the stylus to identify whether the stylus leaves the handwriting module.

[0288] The process of each module in the handwriting processing device and the critical threshold learning device provided in the embodiment of the present application realizing its respective function can be specifically referred to the aforementioned Figures 2 to 13 The description of the illustrated embodiment and other related method embodiments will not be repeated here.

[0289] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0290] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0291] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0292] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0293] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0294] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions, and cannot be understood as indicating or suggesting relative importance. It should also be understood that although the terms "first", "second", etc. are used to describe various elements in some embodiments of the present application in the text, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, the first table can be named as the second table, and similarly, the second table can be named as the first table without departing from the scope of the various described embodiments. The first table and the second table are both tables, but they are not the same table.

[0295] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0296] Terminal Equipment may also be called User Equipment, Mobile Station (MS), Mobile Terminal, etc.

[0297] The handwriting processing method provided in the embodiments of the present application can be applied to terminal devices such as mobile phones, tablet computers, handwriting tablets, drawing tablets, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific types of terminal devices.

[0298] For example, the terminal device can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a TV set top box (STB), a customer premises equipment (CPE) and / or other devices for communicating on a wireless system and a next-generation communication system, such as a terminal device in a 5G network or a terminal device in a future evolved public land mobile network (PLMN) network, etc.

[0299] As an example but not limitation, when the terminal device is a wearable device, the wearable device can also be a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0300] The following uses a tablet computer as an example. Fig.16 FIG. 1 shows a schematic structural diagram of a tablet computer 100 .

[0301] The tablet computer 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194 (also referred to as a screen), and a SIM card interface 195, etc. The sensor module 180 may include a gyroscope sensor 180A, an acceleration sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an ambient light sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, and a touch sensor 180K (of course, the tablet computer 100 may also include other sensors, such as a temperature sensor, a pressure sensor, an air pressure sensor, a bone conduction sensor, etc., which are not shown in the figure).

[0302] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (Neural-network Processing Unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. Among them, the controller can be the nerve center and command center of the tablet computer 100. The controller can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.

[0303] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0304] The processor 110 can run the handwriting processing method provided in the embodiment of the present application to improve the situation where the handwriting disappears in time and enhance the user experience. The processor 110 can include different devices. For example, when the CPU and GPU are integrated, the CPU and GPU can cooperate to execute the handwriting processing method provided in the embodiment of the present application. For example, part of the algorithm in the handwriting processing method is executed by the CPU, and the other part of the algorithm is executed by the GPU to obtain faster processing efficiency.

[0305] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the tablet computer 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. The display screen 194 can be used to display information input by a user or information provided to a user and various graphical user interfaces (GUI). For example, the display screen 194 can display photos, videos, web pages, or files, etc. For another example, the display screen 194 can display a graphical user interface. The graphical user interface includes a status bar, a hidden navigation bar, a time and weather widget, and application icons, such as a browser icon. The status bar includes the operator name (such as China Mobile), the mobile network (such as 4G), the time, and the remaining power. The navigation bar includes a back key icon, a home key icon, and a forward key icon. In addition, it can be understood that in some embodiments, the status bar may also include a Bluetooth icon, a Wi-Fi icon, an external device icon, etc. It can also be understood that in other embodiments, the graphical user interface may also include a Dock bar, and the Dock bar may include commonly used application icons, etc. When the processor detects a touch event of a user's finger (or a stylus, etc.) for a certain application icon, in response to the touch event, the user interface of the application corresponding to the application icon is opened, and the user interface of the application is displayed on the display screen 194.

[0306] In the embodiment of the present application, the display screen 194 can be an integrated flexible display screen, or a spliced ​​display screen consisting of two rigid screens and a flexible screen located between the two rigid screens. After the processor 110 runs the handwriting processing method provided in the embodiment of the present application, the processor 110 can control the external audio output device to switch the output audio signal.

[0307] The camera 193 (a front camera or a rear camera, or one camera can be used as both a front camera and a rear camera) is used to capture still images or videos. Generally, the camera 193 may include a photosensitive element such as a lens group and an image sensor, wherein the lens group includes a plurality of lenses (convex lenses or concave lenses) for collecting light signals reflected by the object to be photographed and transmitting the collected light signals to the image sensor. The image sensor generates an original image of the object to be photographed based on the light signal.

[0308] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the tablet computer 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store the code of the operating system, application programs (such as camera applications, WeChat applications, etc.). The data storage area can store data created during the use of the tablet computer 100 (such as images, videos, etc. collected by the camera application), etc.

[0309] The internal memory 121 may also store one or more computer programs corresponding to the handwriting processing method provided in the embodiment of the present application. The one or more computer programs are stored in the above-mentioned memory 121 and are configured to be executed by the one or more processors 110. The one or more computer programs include instructions, and the above-mentioned instructions can be used to execute the following steps: Figures 2 to 13 In each step of the corresponding embodiment, the computer program may include an account verification module and a priority comparison module. The account verification module is used to authenticate the system authentication account of other terminal devices in the local area network; the priority comparison module can be used to compare the priority of the audio output request service and the priority of the current output service of the audio output device. The status synchronization module can be used to synchronize the device status of the audio output device currently connected to the terminal device to other terminal devices, or synchronize the device status of the audio output device currently connected to other devices to the local. When the code of the handwriting processing method stored in the internal memory 121 is executed by the processor 110, the processor 110 can control the terminal device to process the handwriting data.

[0310] In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0311] Of course, the code of the handwriting processing method provided in the embodiment of the present application can also be stored in an external memory. In this case, the processor 110 can run the code of the handwriting processing method stored in the external memory through the external memory interface 120, and the processor 110 can control the terminal device to process the handwriting data.

[0312] The functions of the sensor module 180 are described below.

[0313] The gyroscope sensor 180A can be used to determine the motion posture of the tablet computer 100. In some embodiments, the angular velocity of the tablet computer 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180A. That is, the gyroscope sensor 180A can be used to detect the current motion state of the tablet computer 100, such as shaking or stillness.

[0314] When the display screen in the embodiment of the present application is a foldable screen, the gyroscope sensor 180A can be used to detect a folding or unfolding operation on the display screen 194. The gyroscope sensor 180A can report the detected folding operation or unfolding operation as an event to the processor 110 to determine the folded state or unfolded state of the display screen 194.

[0315] The acceleration sensor 180B can detect the magnitude of the acceleration of the tablet computer 100 in all directions (generally three axes). That is, the gyroscope sensor 180A can be used to detect the current motion state of the tablet computer 100, such as shaking or stillness. When the display screen in the embodiment of the present application is a foldable screen, the acceleration sensor 180B can be used to detect the folding or unfolding operation acting on the display screen 194. The acceleration sensor 180B can report the detected folding operation or unfolding operation as an event to the processor 110 to determine the folding state or unfolding state of the display screen 194.

[0316] The gyroscope sensor 180A (or the acceleration sensor 180B) can send the detected motion state information (such as angular velocity) to the processor 110. The processor 110 determines whether the current state is handheld or tripod based on the motion state information (for example, when the angular velocity is not 0, it indicates that the tablet computer 100 is in the handheld state).

[0317] The fingerprint sensor 180H is used to collect fingerprints. The tablet computer 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0318] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the tablet computer 100, which is different from the position of the display screen 194.

[0319] Exemplarily, the display screen 194 of the tablet computer 100 displays a main interface, which includes icons of multiple applications (such as a camera application, a WeChat application, etc.). The user clicks the icon of the camera application in the main interface through the touch sensor 180K, triggering the processor 110 to start the camera application and turn on the camera 193. The display screen 194 displays the interface of the camera application, such as a viewfinder interface.

[0320] The wireless communication function of the tablet computer 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0321] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in tablet computer 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0322] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the tablet computer 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110. In the embodiment of the present application, the mobile communication module 150 can also be used to interact with other terminal devices for information.

[0323] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0324] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the tablet computer 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. In the embodiment of the present application, the wireless communication module 160 can be used to access the access point device and send and receive messages to other terminal devices.

[0325] In addition, the tablet computer 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. For example, music playback, recording, etc. The tablet computer 100 can receive input from the key 190 and generate key signal input related to the user settings and function control of the tablet computer 100. The tablet computer 100 can use the motor 191 to generate a vibration prompt (such as a vibration prompt for an incoming call). The indicator 192 in the tablet computer 100 can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 in the tablet computer 100 is used to connect a SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195, to achieve contact and separation with the tablet computer 100.

[0326] It should be understood that in actual applications, the tablet computer 100 may include Fig.16 The embodiments of the present application are not limited to more or fewer components shown. The illustrated tablet computer 100 is only an example, and the tablet computer 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different component configuration. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0327] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal device. Fig.17 It is a software structure block diagram of the terminal device of an embodiment of the present application.

[0328] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0329] The application layer can include a series of application packages.

[0330] like Fig.17 As shown, the application package may include applications such as phone, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0331] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0332] like Fig.17 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0333] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0334] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0335] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0336] The phone manager is used to provide communication functions for terminal devices, such as the management of call status (including answering, hanging up, etc.).

[0337] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0338] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.

[0339] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0340] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0341] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0342] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0343] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0344] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.164, MP3, AAC, AMR, JPG, PNG, etc.

[0345] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0346] A 2D graphics engine is a drawing engine for 2D drawings.

[0347] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0348] The following is an example of the software and hardware workflow of the tablet computer 100 in conjunction with the scenario of handwriting processing by the tablet computer 100.

[0349] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into raw input events, which are stored in the kernel layer. The application framework layer obtains the raw input events from the kernel layer and processes the corresponding handwriting by calling the resource manager in the application framework layer.

[0350] Fig.18 Schematic diagram of the structure of a terminal device provided by an embodiment of the present application. Fig.18 As shown, the terminal device 18 of this embodiment includes: at least one processor 180 ( Fig.18 Only one is shown in the figure), a memory 181, wherein the memory 181 stores a computer program 182 that can be run on the processor 180. When the processor 180 executes the computer program 182, the steps in the above-mentioned various handwriting processing method embodiments are implemented, such as Figure 2 Alternatively, when the processor 180 executes the computer program 182, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Fig.15 The functions of modules 151 to 154 are shown.

[0351] The terminal device 18 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 180 and a memory 181. Those skilled in the art will appreciate that Fig.18 It is only an example of the terminal device 18 and does not constitute a limitation of the terminal device 18. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include an input sending device, a network access device, a bus, etc.

[0352] The processor 180 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0353] In some embodiments, the memory 181 may be an internal storage unit of the terminal device 18, such as a hard disk or memory of the terminal device 18. The memory 181 may also be an external storage device of the terminal device 18, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 18. Further, the memory 181 may also include both an internal storage unit and an external storage device of the terminal device 18. The memory 181 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 181 may also be used to temporarily store data that has been sent or is to be sent.

[0354] In addition, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0355] An embodiment of the present application also provides a terminal device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor, wherein when the processor executes the computer program, the terminal device implements the steps in any of the above-mentioned method embodiments.

[0356] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0357] An embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0358] An embodiment of the present application further provides a chip system, which includes a processor coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps in the above-mentioned method embodiments.

[0359] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0360] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0361] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0362] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0363] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A handwriting processing method, characterized in that: Applied to a terminal device, the terminal device includes a handwriting module, the handwriting module includes multiple areas, the handwriting module is used for a stylus pen to input handwriting content, the method includes: Acquire a first pressure value within a preset time range, where the first pressure value is a pressure value applied by the stylus pen to the handwriting module, and the end time of the preset time range is the current time; Acquire the latest first signal strength, where the first signal strength is the signal strength of a coupling signal between the terminal device and the stylus; Determine the area where the stylus pen is located on the handwriting module at the current moment, take the area as a first area, and obtain a target critical threshold associated with the first area, wherein the screen of the terminal device is divided into a plurality of different areas, and the rule for dividing the screen into areas includes: dividing a pixel into a region, or dividing a plurality of adjacent pixels into a region; When the target critical threshold associated with the first area is not obtained, searching for critical thresholds associated with each area within a preset area range adjacent to the first area; Determine the target critical threshold corresponding to the first area based on the found one or more critical thresholds; Determine that the change trend of the first pressure value within the preset time range is from large to small, and the first signal strength is less than or equal to the target critical threshold, and terminate the display of the handwriting content to be displayed input by the stylus in the handwriting module within the first time range after the current moment.

2. The handwriting processing method according to claim 1, characterized in that: The determining the target critical threshold corresponding to the first area based on the found one or more critical thresholds includes: When a plurality of regions having associated critical thresholds are found within the preset region range, a second region closest to the first region is selected from the found regions; When one of the second regions is screened out, the critical threshold associated with the second region is used as the target critical threshold corresponding to the first region.

3. The handwriting processing method according to claim 1, characterized in that: The determining the target critical threshold corresponding to the first area based on the found one or more critical thresholds includes: When a plurality of regions having associated critical thresholds are found within the preset region range, a second region closest to the first region is selected from the found regions; When a plurality of the second regions are screened out, an average of the critical thresholds associated with all the second regions is used as the target critical threshold corresponding to the first region.

4. The handwriting processing method according to claim 1, characterized in that: The method for determining the target critical threshold value includes: Acquire the latest second pressure value, the latest second signal strength, and the latest target tilt angle between the stylus and the handwriting module, wherein the second pressure value is the pressure value applied by the user to the stylus, or the pressure value applied by the stylus to the handwriting module, and the second signal strength is the signal strength of the coupling signal between the terminal device and the stylus; Obtaining the mapping relationship between pressure value, tilt angle and signal strength; determining a residual signal strength according to the second pressure value, the target tilt angle, and the mapping relationship; removing the residual signal strength from the second signal strength to obtain an initial signal strength; Based on the initial signal strength, the target critical threshold is determined.

5. The handwriting processing method according to claim 1, 2 or 3, characterized in that: The method for determining the target critical threshold comprises: Acquire the latest second pressure value, the latest second signal strength, and the latest target tilt angle between the stylus and the handwriting module, wherein the second pressure value is the pressure value applied by the user to the stylus, or the pressure value applied by the stylus to the handwriting module, and the second signal strength is the signal strength of the coupling signal between the terminal device and the stylus; Determine the area where the stylus pen is located on the handwriting module at the current moment, and use the area as the second area; Acquire a mapping relationship associated with the second area, where the mapping relationship is a mapping relationship between a pressure value, a tilt angle, and a signal strength; determining a residual signal strength according to the second pressure value, the target tilt angle, and the mapping relationship; removing the residual signal strength from the second signal strength to obtain an initial signal strength; The target critical threshold associated with the second region is determined based on the initial signal strength.

6. The handwriting processing method according to claim 5, characterized in that: The mapping relationship is a functional relationship between the pressure value, the tilt angle and the signal amount.

7. The handwriting processing method according to claim 1, characterized in that: Determining a change trend of the first pressure value within the preset time range includes: Taking all the first pressure values ​​acquired within the preset time range as a unit, respectively performing a size comparison between two adjacent first pressure values; When the size comparison result includes a first-category result and a second-category result, the number of the first-category results is counted, and the difference between two adjacent first pressure values ​​in each second-category result is obtained; wherein, the first-category result refers to two adjacent first pressure values, in which the pressure value obtained first is greater than the pressure value obtained later, and the second-category result refers to two adjacent first pressure values, in which the pressure value obtained first is less than or equal to the pressure value obtained later; When the number of the first category results is greater than a preset decreasing threshold, and the differences corresponding to all the second category results are less than a preset mutation threshold, it is determined that the change trend is from large to small.

8. The handwriting processing method according to claim 1, characterized in that: Determining a change trend of the first pressure value within the preset time range includes: Performing function fitting on the plurality of first pressure values ​​acquired within the preset time range to obtain a corresponding pressure change function; If the pressure change function is a decreasing function, it is determined that the change trend of the first pressure value is from large to small.

9. A terminal device, characterized in that: The terminal device comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the steps of the handwriting processing method according to any one of claims 1 to 8 when executing the computer program.

10. A chip system, characterized in that: The chip system includes a processor, which is coupled to a memory. The processor executes a computer program stored in the memory to implement the handwriting processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • A handwriting processing method, terminal device and chip system

    CN115421603B