A method and device for determining handwriting correction parameters of a stylus pen

By obtaining capacitance information and pressure-sensitive signals, it determines the film status of the terminal screen and automatically adjusts the stylus handwriting correction parameters, solving the problem of handwriting distortion after the terminal screen is filmed, achieving accurate correction of handwriting pen handwriting and improving user experience.

CN117707353BActive Publication Date: 2024-10-18HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310859440.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-12
Publication Date
2024-10-18
Estimated Expiration
2043-07-12

AI Technical Summary

Technical Problem

After the terminal screen is pasted with a film, the handwriting correction parameters of the stylus cannot be automatically adjusted, causing the handwriting to be distorted and skewed. Existing technology cannot automatically detect whether the screen is pasted with a film.

Method used

By obtaining capacitance information and pressure-sensitive signals, the film status of the electronic device is determined, and the handwriting correction parameters of the stylus are automatically adjusted according to the status. The capacitance sensor and pressure sensor are used to collect data, and after fusion processing, the model is input to determine the film status.

Benefits of technology

It achieves accurate correction of handwriting pen handwriting, avoids distortion and skewing of handwriting, improves user experience, and increases the intelligence of handwriting pen handwriting correction parameters in electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117707353B_ABST
    Figure CN117707353B_ABST
Patent Text Reader

Abstract

The present application provides a method for determining handwriting correction parameters of a stylus. The method includes: when the stylus contacts the screen of an electronic device, obtaining target capacitance information, the target capacitance information includes the capacitance values ​​collected by each capacitance sensor of the electronic device in the current collection cycle; obtaining a target pressure-sensing signal; then, according to the target capacitance information and the target pressure-sensing signal, determining the state of the electronic device, the state includes a film-applied state or a non-film-applied state, and the electronic device can realize automatic perception of whether the screen is filmed or not filmed; finally, determining the handwriting correction parameters of the stylus according to the state of the electronic device, the electronic device can automatically adjust the corresponding handwriting correction parameters of the stylus according to the perceived film-applied or non-filmed state, and improve the intelligence level of the adjustment of the handwriting correction parameters of the stylus in the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminals, and in particular to a method and device for determining handwriting correction parameters of a stylus pen. Background Art

[0002] In the process of using the terminal, users often put a protective film on the terminal screen to protect the terminal screen. However, the protective film will affect the user's experience of using the stylus. Usually, the stylus handwriting correction parameters on the terminal are set according to the terminal's unfilmed state, and the stylus handwriting correction parameters are not applicable to handwriting correction in the terminal's filmed state. Moreover, the terminal cannot automatically sense the screen film state and cannot adjust the corresponding stylus handwriting correction parameters in time. Therefore, when the terminal screen is affixed with a protective film, when the user uses a stylus to write on the terminal screen, the handwriting often becomes distorted and crooked. Summary of the invention

[0003] In order to solve the above technical problems, the present application provides a method for determining stylus pen handwriting correction parameters and an electronic device, so that the electronic device can automatically sense whether the screen is covered with a film and adjust the corresponding stylus pen handwriting correction parameters in time.

[0004] In the first aspect, the present application provides a method for determining a stylus pen handwriting correction parameter. The method is applied to an electronic device. The method comprises: when the stylus pen contacts the screen of the electronic device, obtaining target capacitance information; the target capacitance information comprises the capacitance values ​​collected by each capacitance sensor of the electronic device in the current collection cycle; obtaining a target pressure-sensing signal; then, according to the target capacitance information and the target pressure-sensing signal, determining the state of the electronic device, the state comprises a film-applied state or an unfilm-applied state, and the electronic device realizes automatic perception of whether the screen is film-applied or not film-applied; finally, determining the handwriting correction parameter of the stylus pen according to the state of the electronic device, and the electronic device can automatically adjust the corresponding handwriting correction parameter of the stylus pen according to the perceived film-applied or unfilmed state, thereby improving the intelligence level of the handwriting correction parameter adjustment of the stylus pen in the electronic device.

[0005] According to the first aspect, when the stylus pen contacts the screen of the electronic device, the target capacitance information is obtained, including: when the stylus pen contacts the screen of the electronic device, in the current acquisition cycle, the capacitance information at multiple moments is obtained based on the touch sampling rate as the target capacitance information; wherein the capacitance information at each moment includes the capacitance of each capacitance sensor at that moment. In the embodiment of the present application, the target capacitance information is the capacitance information obtained when the stylus pen contacts the screen of the electronic device, and there will be no floating ground signal in the capacitance information, and the data accuracy is high. In addition, the target capacitance information includes capacitance information at multiple moments, which expands the data time scale.

[0006] According to the first aspect, or any one of the implementations of the first aspect above, the state of the electronic device is determined according to the target capacitance information and the target pressure-sensing signal, including: determining the writing position characteristic data of the stylus according to the target capacitance information; determining the capacitance characteristic data according to the target capacitance information; determining the pressure characteristic data according to the target pressure-sensing signal; performing data fusion processing on the writing position characteristic data, the capacitance characteristic data and the pressure characteristic data to obtain the first use characteristic information; the first use characteristic information is used to indicate the contact characteristics between the stylus and the screen of the electronic device; inputting the first use characteristic information into the first model to obtain the first film state information; and determining the state of the electronic device according to the first film state information. In the embodiment of the present application, the target capacitance information and the target pressure-sensing signal are subjected to data processing, and the first use characteristic information obtained after the data processing is input into the first model to determine the state of the electronic device, so that the first use characteristic information does not need to be subjected to complex calculations each time, and the efficiency of determining the state of the electronic device can be improved.

[0007] According to the first aspect, or any implementation of the first aspect above, the writing position characteristic data of the stylus is determined according to the target capacitance information, including: for the capacitance information at each moment in the target capacitance information, determining the position of the maximum capacitance from the capacitance information; using the position of the maximum capacitance in the capacitance information at each moment as the writing position characteristic data. In the embodiment of the present application, the writing position characteristic data of the stylus is also determined based on the target capacitance information, so that the writing position characteristic data can also participate in the process of determining the state of the electronic device, thereby improving the accuracy of the determined state.

[0008] According to the first aspect, or any implementation of the first aspect above, the capacitance characteristic data is determined according to the target capacitance information, including: selecting multiple frames of capacitance information according to a preset selection rule from all capacitance information of the target capacitance information; extracting a capacitance matrix of a preset size from each frame of the selected capacitance information as the capacitance characteristic data. In the embodiment of the present application, the capacitance characteristic data can be extracted from the target capacitance information, thereby achieving redundancy removal of the target capacitance information, and facilitating the subsequent determination of the state of the electronic device.

[0009] According to the first aspect, or any implementation of the first aspect above, the matrix center of the capacitance matrix includes the maximum capacitance of each frame of capacitance information. The maximum capacitance of each frame of capacitance information is the position where the stylus touches the screen of the electronic device, and taking it as the center of the capacitance matrix can improve the data availability of the capacitance matrix.

[0010] According to the first aspect, or any implementation method of the first aspect above, the preset selection rule is: select the capacitance information where the maximum capacitance is located, and take the capacitance information where the maximum capacitance is located as the center, select the capacitance information at five moments before the center and the capacitance information at five moments after the center.

[0011] According to the first aspect, or any implementation of the first aspect above, the handwriting correction parameters of the stylus are determined according to the state of the electronic device, including: when the state of the electronic device is a film-applied state, the handwriting correction parameters of the stylus are determined to be film-applied state handwriting correction parameters; wherein the film-applied state handwriting correction parameters are used to correct the first handwriting written by the stylus on the electronic device with the film; when the state of the electronic device is a non-film-applied state, the handwriting correction parameters of the stylus are determined to be non-film-applied state handwriting correction parameters; wherein the non-film-applied state handwriting correction parameters are used to correct the second handwriting written by the stylus on the electronic device without the film. The electronic device can automatically determine the corresponding handwriting correction parameters according to whether the film is applied or not, thereby improving the intelligent degree of handwriting correction parameter adjustment.

[0012] According to the first aspect, or any implementation method of the first aspect above, after determining the handwriting correction parameters of the stylus according to the state of the electronic device, it also includes: correcting the handwriting of the stylus according to the determined handwriting correction parameters, which can effectively correct the handwriting and avoid the distortion of the handwriting.

[0013] According to the first aspect, or any implementation of the first aspect above, the handwriting correction parameter includes a compensation value for each contact point in the handwriting, and the step of correcting the handwriting of the stylus according to the determined handwriting correction parameter includes: for each contact point in the handwriting, selecting a corresponding compensation value from the handwriting correction parameter; determining the theoretical position of the contact point according to the compensation value and the actual position of the contact point; and determining the corrected handwriting based on the theoretical position of each contact point in the handwriting. In the embodiment of the present application, the handwriting can be effectively corrected to avoid the distortion of the handwriting.

[0014] According to the first aspect, or any implementation method of the first aspect above, determining the state of the electronic device according to the first film state information includes: determining whether the state of the electronic device indicated by the first film state information is consistent with the state of the electronic device indicated by the historical film state information; when the first film state information is consistent with the state of the electronic device indicated by the historical film state information, determining the state indicated by the first film state information as the state of the electronic device, which can improve the accuracy of film state perception, wherein the historical film state information is used to indicate the state of the electronic device in any collection cycle before the current collection cycle.

[0015] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the state of the electronic device indicated by the first film state information is inconsistent with the state of the historical film state information, the second usage characteristic information is input into the first model to obtain the second film state information output by the first model; the second film state information is used to indicate the state of the electronic device in the next collection cycle of the current collection cycle; when the state of the electronic device indicated by the first film state information is consistent with the state of the electronic device indicated by the second film state information, the state indicated by the first film state information is determined as the state of the electronic device. In the embodiment of the present application, when the film state of the electronic device indicated by the first film state information is inconsistent with the film state of the electronic device indicated by the historical film state information, it means that the film state of the electronic device has changed. Therefore, in order to ensure the accuracy of the perception result, the film state perception can be performed again to further improve the accuracy of the film state perception.

[0016] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the states of the electronic device indicated by the first film state information and the second film state information are inconsistent, the third use characteristic information is input into the first model to obtain the third film state information output by the first model; the third film state information is used to indicate the state of the electronic device in the second collection cycle after the current collection cycle; the state indicated by the third film state information is determined as the state of the electronic device. When the states of the electronic device indicated by the first film state information and the second film state information are inconsistent, it indicates that the film state perception of the electronic device may be unstable, so the film state perception is performed again to further improve the accuracy of the film state perception.

[0017] According to the first aspect, or any implementation of the first aspect above, the electronic device and the stylus are connected via Bluetooth, so that data interaction between the electronic device and the stylus is facilitated.

[0018] In the second aspect, the present application provides a model training method. The method is applied to a server. The method includes: obtaining first stylus training information of an electronic device in a non-film-applied state; the first stylus training information includes first capacitance information and a first pressure-sensing signal; obtaining second stylus training information of an electronic device in a film-applied state; the second stylus training information includes second capacitance information and a second pressure-sensing signal; processing sample data based on the first capacitance information and the first pressure-sensing signal to obtain first training feature data; processing sample data based on the second capacitance information and the second pressure-sensing signal to obtain second training feature data; training an initial first model based on the first training feature data and the second training feature data to obtain a trained first model; wherein the trained first model is used to determine the state of the electronic device, the state including the film-applied state or the non-film-applied state, so that the electronic device can determine the handwriting correction parameters of the stylus according to the state. In an embodiment of the present application, the first model can be trained for the film-applied state perception of the electronic device, so that the electronic device can automatically perceive whether the screen is film-applied.

[0019] In a third aspect, the present application provides an electronic device, comprising: one or more processors; a memory; and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by one or more processors, the electronic device executes the method for determining handwriting correction parameters as in the first aspect, or any one of the implementations of the first aspect above.

[0020] According to the third aspect, the electronic device is connected to the stylus pen via Bluetooth.

[0021] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here.

[0022] In a fourth aspect, the present application provides an electronic device, the electronic device comprising: one or more processors; a memory; and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the one or more processors, the electronic device executes the model training method as in the second aspect. The technical effects corresponding to the fourth aspect can refer to the technical effects corresponding to the above-mentioned second aspect, and will not be repeated here.

[0023] In a fifth aspect, the present application provides a computer storage medium, including computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method for determining handwriting correction parameters of the first aspect or any one of the implementations of the first aspect. The fifth aspect corresponds to the first aspect and any one of the implementations of the first aspect. The technical effects corresponding to the third aspect and any one of the implementations of the third aspect can be referred to the technical effects corresponding to the first aspect and any one of the implementations of the first aspect, which will not be repeated here.

[0024] In a sixth aspect, the present application provides a computer storage medium, including computer instructions, which, when executed on an electronic device, cause the electronic device to execute the model training method of the second aspect. The technical effects corresponding to the sixth aspect can be referred to the technical effects corresponding to the second aspect above, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0026] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0027] Figure 3 A software structure block diagram of an electronic device provided in an embodiment of the present application;

[0028] Figure 4 A schematic diagram of a communication connection between an electronic device and a stylus provided in an embodiment of the present application;

[0029] Figure 5 A schematic diagram of data interaction between an electronic device and a stylus provided in an embodiment of the present application;

[0030] Figure 6 A schematic diagram of the distribution of capacitance values ​​collected by a capacitance sensor of an electronic device before and after film application provided in an embodiment of the present application;

[0031] Figure 7 A schematic diagram of the functional relationship between a stylus pen and a capacitance sensor provided in an embodiment of the present application;

[0032] Figure 8 A schematic diagram of a capacitance sensor for collecting capacitance information provided by an embodiment of the present application;

[0033] Fig. 9 A schematic diagram of a flow chart of a first model training method provided in an embodiment of the present application;

[0034] Fig.10 A schematic diagram of obtaining capacitance characteristic data provided by an embodiment of the present application;

[0035] Fig.11 A schematic diagram of a model training provided in an embodiment of the present application;

[0036] Fig.12 A flowchart of a first model deployment method provided in an embodiment of the present application;

[0037] Fig.13 A flowchart of a method for configuring handwriting correction parameters of a stylus pen provided in an embodiment of the present application;

[0038] Fig.14 A schematic diagram of determining handwriting correction parameters in an unfilmed state provided by an embodiment of the present application;

[0039] Fig.15 A schematic diagram of an application effect provided by an embodiment of the present application;

[0040] Fig.16 A flowchart of another method for configuring stylus pen handwriting correction parameters provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0042] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0043] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.

[0044] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0045] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0046] When using electronic devices, users often put a protective film on the screen to protect the screen of the electronic device. The protective film can be a tempered film, a paper-like film, etc. However, the protective film will affect the user's use of the stylus. Among them, the stylus (also called a stylus or an active pen) is a device used to write on an electronic device.

[0047] Before describing the technical solution of the embodiments of the present application, the application scenarios of the embodiments of the present application are first described with reference to the accompanying drawings. Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application, the application scenario includes an electronic device 100 and a stylus 101.

[0048] Usually, the handwriting correction parameters of the stylus on the electronic device are set according to the state of the electronic device without film. Figure 1 As shown, in Figure 1 In the scenario shown in (1), the screen of the electronic device 100 is not covered with a protective film, and the user uses the stylus 101 to write straight lines on the screen of the electronic device 100 without a protective film, that is, the stylus 101 moves from the dotted line position to the solid line position in the side view, and the handwriting 103 displayed on the display interface 102 in response to the writing operation of the stylus 101 is a straight line. Figure 1 In the scenario shown in (2), after the screen of the electronic device 100 is affixed with a protective film 104, the user uses the stylus 101 to write straight lines on the screen with the protective film 104, that is, in the side view, the stylus 101 moves from the dotted line position to the solid line position, and the handwriting 106 displayed on the display interface 105 in response to the writing operation of the stylus 101 is a distorted and crooked line. This is because after the screen of the electronic device 100 is affixed with the protective film 104, the handwriting correction parameters of the electronic device's stylus are not adjusted as the electronic device's film-affixing state changes, and the handwriting correction parameters of the electronic device before the electronic device is affixed with the film are not applicable to the handwriting correction in the electronic device's film-affixing state, resulting in the handwriting 106 displayed on the display interface 105 in response to the writing operation of the stylus 101 being a distorted and crooked line.

[0049] In order to solve the above problems, the embodiments of the present application provide a first model training method, a deployment method, and a stylus handwriting correction parameter configuration method, so that the electronic device can accurately sense the film state of the screen after the stylus touches the screen, and automatically match the corresponding stylus handwriting correction parameters according to the film state, thereby achieving accurate correction of the stylus handwriting and improving the user experience.

[0050] Figure 2 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. It should be understood that: Figure 2 The electronic device 100 shown is only one example of an electronic device, and the electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have a different configuration of components. Figure 1 The various components shown in the EMBODIMENTS 2000 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.

[0051] The electronic device 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, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a capacitance sensor 180M, etc.

[0052] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0053] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0054] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. The USB interface 130 is an interface that complies with USB standard specifications, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, or may be used to transfer data between the electronic device 100 and a peripheral device. It may also be used to connect headphones to play audio through the headphones. The interface may also be used to connect other electronic devices, such as AR devices, etc.

[0055] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0056] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The wireless communication function of the electronic device 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.

[0057] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 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.

[0058] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The wireless communication module 160 can provide solutions for wireless communications 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 technology (IR), etc., applied to the electronic device 100.

[0059] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.

[0060] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0061] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0062] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0063] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0064] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0065] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0066] 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 electronic device 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 may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. 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.

[0067] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0068] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0069] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0070] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0071] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0072] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0073] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0074] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0075] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0076] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0077] 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 electronic device 100, which is different from the position of the display screen 194.

[0078] The capacitance sensor 180M is used to detect the writing operation of the stylus pen acting on or near the capacitance sensor 180M. The capacitance sensor can transmit the detected writing operation of the stylus pen to the application processor and provide visual output related to the writing operation through the display screen 194.

[0079] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0080] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. Indicator 192 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0081] The software system of the electronic device 100 may 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 electronic device 100.

[0082] Figure 3 A software structure block diagram of an electronic device 100 provided in an embodiment of the present application.

[0083] The layered architecture of the electronic device 100 divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the framework layer, the Android runtime (Android runtime), the hardware abstraction layer (HAL), the system library and the kernel layer.

[0084] The application layer may include a series of application packages, such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications. It should be noted that the applications included in the application layer shown in the figure are only exemplary and are not limited in this application. It is understandable that the applications included in the application layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, compared with Figure 3 The application layer shown includes applications, and the electronic device 100 may include more or fewer applications, or the electronic device 100 may include completely different applications.

[0085] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer, including various components and services to support developers' Android development. The framework layer includes some predefined functions. Figure 3 As shown, the framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a stylus management service, and the like.

[0086] 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.

[0087] 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.

[0088] 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.

[0089] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

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

[0091] 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, an electronic device vibrates, an indicator light flashes, etc.

[0092] The stylus management service may also be referred to as a stylus management service, which is used to manage a stylus connected to an electronic device, including controlling connection and disconnection with the stylus.

[0093] The Hardware Abstraction Layer (HAL) is an interface layer between the operating system kernel and the hardware circuit. The hardware abstraction layer provides a virtual hardware platform for the operating system. The operating system kernel or the hardware driver can call the hardware abstraction layer. Figure 3 As shown, in the embodiment of the present application, the hardware abstraction layer includes a data processing module, a first model, a decision module, and a handwriting correction module.

[0094] The data processing module is used to perform corresponding data processing operations on the received data, such as data extraction processing, data fusion processing, etc.

[0095] The first model is used to determine the film-applying state of the electronic device.

[0096] The decision module is used to control whether it is necessary to re-determine the film state of the electronic device.

[0097] The handwriting correction module is used to automatically configure corresponding stylus handwriting correction parameters according to the film-sticking state of the electronic device, and correct the handwriting of the stylus according to the stylus handwriting correction parameters.

[0098] 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.

[0099] Understandably, Figure 3 The layers in the software structure shown and the components included in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in the present application.

[0100] Figure 4 A schematic diagram of a communication connection between an electronic device and a stylus pen provided in an embodiment of the present application. Figure 4 As shown, the stylus pen 200 includes but is not limited to: a microcontroller unit (MCU) 201, a pressure sensor 202, a Bluetooth integrated circuit (IC) 203, a Bluetooth antenna 204, an electrode 205 and other components. It can be understood that Figure 4 The components included in the stylus pen 200 are shown, but do not constitute a specific limitation on the stylus pen 200. In other embodiments of the present application, the stylus pen 200 may include more or fewer components than shown, or combine or separate some components, or arrange the components differently.

[0101] Optionally, the pressure sensor 202 is used to obtain pressure parameters. For example, when the tip of the stylus touches an object (such as a touch screen), the pressure sensor 202 can obtain corresponding pressure parameters based on the pressure received, and report the pressure parameters to the MCU 201. Optionally, the pressure parameters can also be called pressure data, pressure information, etc., which is not limited in this application.

[0102] Optionally, MCU201 is used to process the pressure parameters received from pressure sensor 202 accordingly. MCU201 has the feature of "always on", which can ensure the normal operation of the sensor with extremely low power consumption. It should be noted that MCU201 is only an illustrative example, and other devices that can function as a processor or microcontroller can be alternative forms of the above-mentioned MCU.

[0103] Optionally, the MCU 201 is further used to control the Bluetooth antenna 204 to output a pressure-sensing signal, and the pressure-sensing signal is used to indicate the pressure parameter obtained by the MCU 201 from the pressure sensor 202. Exemplarily, the MCU 201 may generate a pressure-sensing signal based on the pressure parameter obtained from the pressure sensor 202, and output the pressure-sensing signal to the electronic device 210 through the Bluetooth IC 203 and the Bluetooth antenna 204. Accordingly, in some embodiments, the antenna (e.g. Figure 1 The antenna 2 in the electronic device 210 can obtain the corresponding pressure parameter based on the received pressure sensing signal, and transmit the obtained pressure parameter to the Bluetooth driver, which then reports the pressure parameter to the upper layer module (e.g., the data processing module of the HAL layer), and the upper layer module can process the pressure parameter accordingly. Figure 1 The antenna 2) in the apparatus can send the received pressure-sensing signal to other devices, such as a server.

[0104] Optionally, MCU201 is also used to receive and process data from electrode 205. Exemplarily, electrode 205 may be located at the tip side of the electronic device. Exemplarily, when the tip of stylus 200 is close to the screen of the electronic device, electrode 205 of the stylus may receive a detection signal sent by the capacitance sensor of the electronic device 210, and output the detection signal to MCU201. MCU201 may control electrode 205 to output a square wave signal with a specified frequency (which may be called radio frequency frequency) based on the received detection signal (square wave signal may also be called touch signal, trigger signal or touch control signal, etc., which is not limited in this application).

[0105] Optionally, the MCU 201 , the pressure sensor 202 , the Bluetooth IC 203 , and the Bluetooth antenna 204 may be integrated into the same chip, or may be separate components and connected via a bus.

[0106] In some embodiments, the stylus of the present application may also use other short-range wireless technologies to exchange data with electronic devices such as electronic devices, such as Wi-Fi technology, Ultra Wide Band (UWB) and other short-range wireless communication technologies. It can be understood that when the stylus 200 and the electronic device transmit pressure information or square wave signals through Wi-Fi technology, both the stylus 200 and the electronic device 210 have Wi-Fi modules.

[0107] The data interaction between the electrode 205 of the stylus pen and the capacitance sensor is described in detail below.

[0108] Figure 5 A schematic diagram of data interaction between an electronic device and a stylus provided in an embodiment of the present application. Figure 5 , Figure 5 The timing control signal of the electronic device and the timing control signal of the stylus are shown in the figure, and the frequencies of the timing control signal of the electronic device and the timing control signal of the stylus have been pre-configured. The electronic device sends an uplink signal 501 (such as the detection signal sent by the aforementioned capacitance sensor) at a refresh rate of 120Hz, that is, the time interval between the electronic device sending two uplink signals is 8ms. This time interval is the display refresh cycle of the electronic device, that is, the refresh cycle of the picture displayed by the electronic device. In response to receiving the uplink signal 501 sent by the electronic device, the stylus sends an electrode signal 502 14 times in each display refresh cycle. The electrode signal 502 is emitted at the touch scanning pit position in the timing control signal of the stylus (when the timing control signal is high), as shown in FIG. Figure 5 In the touch scanning pit positions 1-14 shown in FIG. 1 , the electrode signal 502 may be a square wave signal.

[0109] In each display refresh cycle, the stylus can report the touch position twice at the predetermined touch scanning pit. Exemplarily, the stylus can report the horizontal coordinate x1 of touch position 1 at touch scanning pit 5, and report the vertical coordinate y1 of touch position 1 at touch scanning pit 7; report the horizontal coordinate x2 of touch position 2 at touch scanning pit 9, and report the vertical coordinate y2 of touch position 2 at touch scanning pit 11. When the capacitance sensor on the electronic device receives the horizontal and vertical coordinates (x1, y1) of touch position 1 reported by the stylus, the capacitance of the capacitance sensor at the position (x1, y1) on the screen of the electronic device will change. Similarly, when the capacitance sensor on the electronic device receives the horizontal and vertical coordinates (x2, y2) of touch position 2 reported by the stylus, the capacitance of the capacitance sensor at the position (x2, y2) on the screen of the electronic device will change.

[0110] It should be noted that the electronic device can obtain (sample) the touch position information twice in one display refresh cycle, that is, it can be considered that the touch sampling rate of the electronic device is 240 Hz.

[0111] Figure 6 A schematic diagram of the distribution of capacitance values ​​collected by a capacitance sensor of an electronic device before and after film application is provided in an embodiment of the present application. The following description is made by taking the stylus 101 as an example of performing the same writing operation at the same position of the electronic device 100 before and after film application.

[0112] like Figure 6 As shown in (1), Figure 6 In the scene a of (1) before the electronic device 100 is filmed, the tip of the stylus pen 101 touches the screen 107 of the electronic device 100, and the capacitance value collected by the capacitance sensor near the tip of the stylus pen 101 is as follows: Figure 6 As shown in 108-5 in b of (1), each block is used to indicate a capacitance sensor, and the numbers in the blocks are used to indicate the size of the capacitance value detected by the capacitance sensor. For example, the capacitance value detected by the capacitance sensor 108-01 is 2560, and the capacitance value detected by the capacitance sensor 108-02 is 112.

[0113] like Figure 6 As shown in (2), Figure 6 In the scenario c of (2) where the electronic device 100 is affixed with a protective film 104, the tip of the stylus pen 101 contacts the protective film 104 of the electronic device 100. It should be noted that: Figure 6 The position of the pen tip of the stylus 101 in c of (2) is Figure 6 The tip position of the stylus pen 101 in a of (1) corresponds to the same position on the screen 107. The capacitance value collected by the partial capacitance sensor near the tip of the stylus pen 101 is as follows: Figure 6 As shown in 108-4 in d of (2), each block is used to indicate a capacitance sensor, and the numbers in the blocks are used to indicate the size of the capacitance value detected by the capacitance sensor. For example, the capacitance value detected by the capacitance sensor 108-01 is 2204, and the capacitance value detected by the capacitance sensor 108-02 is 103.

[0114] Comparing the capacitance distribution shown in 108-4 with the capacitance distribution shown in 108-5, the capacitance value collected by the capacitance sensor 108-01 before the electronic device 100 is filmed is 2560, and the capacitance value collected after the film is filmed is 2204, while the capacitance value collected by the capacitance sensor 108-02 before the electronic device 100 is filmed is 112, and the capacitance value collected after the film is filmed is 99, that is, for the same writing operation of the stylus on the electronic device, the capacitance distribution collected by the electronic device in the film-applied state and the capacitance distribution collected in the non-film-applied state are completely different. In the embodiment of the present application, the capacitance value collected by the capacitance sensor can be used to sense the film-applied state of the electronic device.

[0115] Figure 7 A schematic diagram of the functional relationship between a stylus pen and a capacitance sensor provided in an embodiment of the present application. Figure 7 As shown, in the side views a, c, and e of the electronic device 100, a capacitance sensor array 108 is disposed below the outermost screen 107 of the electronic device 100. It can be seen in b, d, and f, which contain top views of the electronic device 100, that the capacitance sensor array 108 includes a plurality of capacitance sensors arranged in rows and columns, wherein each small square is used to indicate a capacitance sensor. Generally speaking, the process of the capacitance sensor sensing the stylus is related to the distance between the stylus and the screen of the electronic device. In the process of the stylus constantly approaching the screen of the electronic device, the capacitance sensor that is closer to the pen tip is more likely to produce a capacitance change, and the capacitance sensor that is farther away from the pen tip is less likely to produce a capacitance change.

[0116] like Figure 7 As shown in (1), Figure 7 In the scenario a of (1), when the tip of the stylus pen 101 does not touch the screen 107 of the electronic device 100 and the distance D1 between the stylus pen 101 and the screen 107 is greater than a preset distance, the capacitance signal detected by the capacitance sensor array 108 near the tip of the stylus pen 101 is as follows: Figure 7 As shown in 108-1 in b of (1), each block is used to indicate a capacitance sensor, and the numbers in the blocks are used to indicate the size of the capacitance value detected by the capacitance sensor, for example, the capacitance value detected by the capacitance sensor 108-01 is 1, and the capacitance value detected by the capacitance sensor 108-02 is 2. The preset distance can be determined by the parameters of the capacitance sensor or pre-set by the electronic device 100, for example, 5mm, which is not specifically limited in this embodiment. In the capacitance signal near the pen tip shown in 108-1, the capacitance values ​​detected by each capacitance sensor are close to 0, which can be considered as noise values. In other words, the capacitance sensor array 108 cannot sense the stylus 101 at this time.

[0117] like Figure 7 As shown in (2), Figure 7In the scenario c of (2) where the tip of the stylus pen 101 does not touch the screen 107 of the electronic device 100, but the distance D2 between the stylus pen 101 and the screen 107 is equal to or less than the preset distance, the capacitance signal collected by the capacitance sensor array 108 near the tip of the stylus pen 101 is as follows: Figure 7 As shown in 108-2 in d of (2), each block is used to indicate a capacitance sensor, and the numbers in the blocks are used to indicate the size of the capacitance value detected by the capacitance sensor. For example, the capacitance value detected by the capacitance sensor 108-01 is 300, and the capacitance value detected by the capacitance sensor 108-02 is 50.

[0118] Will Figure 7 (1) and Figure 7 By comparing (2) in Figure 7 (1) to Figure 7 Process (2) is the process in which the stylus 101 approaches the screen 107 but does not touch the screen 107. The capacitance detected by the capacitance sensor 108-01 changes from 1 to 300, and the capacitance detected by the capacitance sensor 108-02 changes from 2 to 50. That is, the capacitance signal collected by the capacitance sensor array 108 near the tip of the stylus 101 increases during this process.

[0119] like Figure 7 As shown in (3), Figure 7 In the scenario e of (3) where the tip of the stylus pen 101 touches the screen 107 of the electronic device 100, the capacitance signal collected by the capacitance sensor array 108 near the tip of the stylus pen 101 is as follows: Figure 7 As shown in 108-3 in f of (3), each block is used to indicate a capacitance sensor, and the numbers in the blocks are used to indicate the size of the capacitance value detected by the capacitance sensor. For example, the capacitance value detected by the capacitance sensor 108-01 is 2560, and the capacitance value detected by the capacitance sensor 108-02 is 112.

[0120] Will Figure 7 (2) and Figure 7 By comparing (3), we can see that Figure 7 (2) to Figure 7 The process (3) is the process in which the stylus pen 101 approaches the screen 107 and contacts the screen 107. The capacitance detected by the capacitance sensors 108-01 and 108-02 is used as an example for explanation. The capacitance detected by the capacitance sensor 108-01 changes from 300 to 2560, and the capacitance detected by the capacitance sensor 108-02 changes from 50 to 112. That is, in this process, the capacitance signal collected by the capacitance sensor array 108 near the tip of the stylus pen 101 increases significantly.

[0121] Depend on Figure 7 It can be seen that Figure 7(1) to Figure 7 (2) and then Figure 7 The process (3) is the process in which the stylus 101 approaches and contacts the screen 107 of the electronic device 100. In this process, the capacitance value collected by the capacitance sensor array 108 near the tip of the stylus 101 is increasing. Figure 7 (3) to Figure 7 (2) and then Figure 7 The process (1) can be considered as the process of the stylus 101 moving away from the screen 107 of the electronic device 100. During this process, the capacitance value collected by the capacitance sensor array 108 near the tip of the stylus 101 is continuously reduced until the capacitance values ​​collected by each capacitance sensor are all noise values.

[0122] Figure 8 A schematic diagram of a capacitance sensor for collecting capacitance information provided by an embodiment of the present application. Figure 8 As shown, as time t passes, the capacitance sensor array 108 on the electronic device 100 can obtain the capacitance information 900 of the electronic device frame by frame according to the set touch sampling rate. Each frame of capacitance information 900 includes the capacitance values ​​detected by each capacitance sensor in the electronic device 100 at the same time. The touch sampling rate can be set to 240 Hz, that is, the capacitance sensor array 108 collects a frame of capacitance information 900 every (1000 / 240) ms≈4.16 ms.

[0123] by Figure 8 Take a frame of capacitance information 901 collected at time t1 as an example, the capacitance information 901 includes the capacitance values ​​detected by each capacitance sensor in the electronic device 100 at time t1. In the capacitance information 901, the capacitance values ​​collected by some capacitance sensors near the tip of the stylus 101 are shown in 901-1, where each block represents a capacitance sensor, and the number in each block represents the capacitance value collected by the capacitance sensor, for example, the capacitance value collected by sensor 901-10 is 3995, and the capacitance value collected by sensor 901-11 is 78; the capacitance values ​​collected by some capacitance sensors far from the tip of the stylus are shown in 901-2, for example, the capacitance value collected by sensor 901-20 is 2, and the capacitance value collected by sensor 901-21 is 1. It can be seen that the closer the capacitance sensor is to the tip of the stylus, the larger the capacitance value collected.

[0124] Figure 8The capacitance information 902 collected at time t2 includes the capacitance values ​​detected by each capacitance sensor in the electronic device 100 at time t2. In the capacitance information 902, the capacitance values ​​collected by some capacitance sensors near the tip of the stylus 101 are shown in 902-1, where each block represents a capacitance sensor, and the numbers in each block represent the capacitance values ​​collected by the capacitance sensor, for example, the capacitance value collected by sensor 902-10 is 3795, and the capacitance value collected by sensor 902-11 is 67; the capacitance values ​​collected by some capacitance sensors far from the tip of the stylus are shown in 901-2, for example, the capacitance value collected by sensor 902-20 is 2, and the capacitance value collected by sensor 902-21 is 1.

[0125] Comparing the capacitance information 901 collected at time t1 and the capacitance information 902 collected at time t2, it can be seen that among the capacitance values ​​collected by the capacitance sensors near the pen tip, the maximum capacitance value changes from 3995 collected by sensor 901-10 to 3795 collected by sensor 902-10; while among the capacitance values ​​collected by the capacitance sensors far from the stylus tip, the capacitance value changes very little. It can be seen that with the collection time, the capacitance values ​​collected by the capacitance sensors near the pen tip change significantly, while the capacitance values ​​collected by the capacitance sensors far from the stylus tip do not change significantly, that is, the capacitance values ​​collected by the capacitance sensors near the pen tip are valid data.

[0126] Fig. 9 The flowchart of a first model training method provided in an embodiment of the present application is shown in FIG. The first model training method is applied to a server, and the server includes a data processing module and a training module. Fig. 9 As shown, the first model training method includes: steps S1 to S5.

[0127] Step S1: The data processing module obtains first stylus training information of the electronic device in a state where no film is applied.

[0128] The first stylus training information includes capacitance information collected by the electronic device in a non-film-attached state and a pressure-sensing signal transmitted by the stylus.

[0129] In one embodiment, the data processing module obtains first stylus training information of the electronic device in a state where no film is applied, including: step S11 - step S12.

[0130] Step S11: The data processing module receives first capacitance value information sent by the electronic device.

[0131] The first capacitance information includes capacitance values ​​detected by capacitance sensors in the electronic device without film at multiple times. The first capacitance information is capacitance information collected and sent by the electronic device without film. In this embodiment, the method for collecting the first capacitance information by the electronic device without film can refer to the above Figure 8 The detailed description of the acquisition capacitance value is not repeated here.

[0132] In one embodiment, when the stylus pen contacts the screen of the electronic device with the film attached, the electronic device sends the first capacitance value information collected in the current collection cycle to the data processing module in the server.

[0133] Among them, Figure 6 As shown, the electronic device is equipped with a plurality of capacitance sensors distributed in an array, and the plurality of capacitance sensors are normally open to detect the capacitance distribution of the electronic device according to the touch sampling rate.

[0134] In order to improve the effectiveness and accuracy of the collected capacitance value, the current collection period can be set to include at least 11 collection times, such as Figure 8 As shown in , the time interval between two acquisitions is (1000 / 240) ms, so 11 acquisitions require (1000 / 240)*10 ms, and the current acquisition period can be set to at least (1000 / 240)*10 ms. In some examples, the current acquisition period can also be set to 1 s.

[0135] Step S12: The data processing module receives a first pressure sensing signal sent by the electronic device.

[0136] The first pressure-sensing signal includes pressure parameters of the stylus pen in contact with the electronic device without a film.

[0137] In the embodiment of the present application, in response to contact with the electronic device, the stylus sends a first pressure-sensing signal to the electronic device at a frequency synchronized with the touch sampling rate of the electronic device. After receiving the first pressure-sensing signal from the stylus, the electronic device forwards the first pressure-sensing signal to the data processing module of the server. The manner in which the stylus sends a pressure-sensing signal to the electronic device can be referred to in the aforementioned Figure 4 The detailed description in is not repeated here.

[0138] Through the above steps S11 and S12, the server can obtain the first stylus training information of the electronic device in a state where no film is applied.

[0139] Step S2: The data processing module obtains the second stylus training information of the electronic device in the film-applied state.

[0140] The second stylus training information includes capacitance information collected by the electronic device in the film-attached state and a pressure-sensing signal transmitted by the stylus.

[0141] In one implementation, the data processing module obtains the second stylus training information of the electronic device in the film-applied state, including: step S21-step S22.

[0142] Step S21: The data processing module receives second capacitance information sent by the electronic device.

[0143] The second capacitance information includes the capacitance values ​​detected by each capacitance sensor in the electronic device with the film applied at multiple times. The second capacitance information is the capacitance information collected and sent by the electronic device in the film-applied state. In this embodiment, the method for collecting the second capacitance information by the electronic device in the film-applied state can refer to the aforementioned Figure 8 The detailed description of the acquisition capacitance value is not repeated here.

[0144] In one embodiment, in response to the current maximum capacitance being equal to or greater than the first capacitance threshold, the electronic device sends the second capacitance information collected in the current collection period to the data processing module in the server.

[0145] The first capacitance threshold is a boundary for distinguishing whether the capacitance signal is a noise signal or a valid capacitance signal. When the capacitance is less than the first capacitance threshold, the capacitance is a noise signal and is invalid information; when the capacitance is equal to or greater than the first capacitance threshold, the capacitance is valid capacitance information. The first capacitance threshold can be set according to actual application, and is not limited in this embodiment, for example, it is set to 300. According to the above Figure 7 As can be seen from the description in , when the stylus is close to and in contact with the screen of the electronic device, the capacitance value collected by the capacitance sensor array near the tip of the stylus is constantly increasing. Therefore, when the current maximum capacitance value collected by the capacitance sensor is equal to or greater than the first capacitance threshold, it means that the capacitance sensor array in the current electronic device has sensed the stylus. At this time, the capacitance value collected by the capacitance sensor is no longer all noise signals, but valid capacitance value information is collected, which can be used for the subsequent training of the first model. Therefore, the second capacitance value information collected in the current collection cycle is sent to the data processing module in the server.

[0146] The current acquisition period can be set according to actual application conditions and is not limited in this embodiment. For example, it can be set to 1s.

[0147] Step S22: The data processing module receives a second pressure-sensing signal sent by the electronic device.

[0148] The second pressure-sensing signal includes pressure parameters of the stylus pen in contact with the electronic device with the film.

[0149] In response to the contact with the electronic device, the stylus sends a pressure-sensing signal to the electronic device at a frequency synchronized with the touch sampling rate of the electronic device. After receiving the pressure-sensing signal from the stylus, the electronic device forwards the pressure-sensing signal to the data processing module of the server. The manner in which the stylus sends the pressure-sensing signal to the electronic device can be referred to in the aforementioned Figure 4 The detailed description in is not repeated here.

[0150] Through the above steps S21 and S22, the server can obtain the second stylus training information of the electronic device in the film-applied state.

[0151] Step S3: The data processing module processes the sample data based on the first capacitance information and the first pressure sensing signal to obtain first training feature data.

[0152] Among them, sample data processing includes but is not limited to data calculation processing, data extraction processing, data fusion processing, etc.

[0153] In one embodiment, the step of the data processing module performing data processing on the first capacitance information and the first pressure sensing signal to obtain the first training feature data includes: step S31 to step S34.

[0154] Step S31, determining writing position characteristic data according to the first capacitance information.

[0155] The first capacitance information includes capacitance values ​​detected by capacitance sensors in the electronic device without film attached at multiple moments, that is, the first capacitance information includes capacitance information collected from multiple frames of the electronic device without film attached.

[0156] In an embodiment of the present application, for the capacitance information at each moment in the first capacitance information (each frame of capacitance information), the position of the maximum capacitance is determined from the capacitance information, which is determined as the contact position between the stylus and the electronic device, and the position of the maximum capacitance in the capacitance information at each moment is used as the writing position feature data.

[0157] Step S32: extracting capacitance characteristic data according to the first capacitance information.

[0158] The first capacitance information includes capacitance values ​​detected by each capacitance sensor in the electronic device without film at multiple moments. Figure 8 As can be seen from the description in , the capacitance value collected by the capacitance value sensor near the tip of the stylus pen changes significantly, while the capacitance value collected by the capacitance value sensor far from the tip of the stylus pen does not change significantly, that is, the capacitance value collected by the capacitance value sensor near the tip of the stylus pen is valid data. In addition, there are also restrictions on the length and width of the input data when training the first model. Therefore, for each frame of capacitance value information in the first capacitance value information, the corresponding matrix is ​​extracted from the capacitance value information according to the length and width requirements of the input data.

[0159] like Fig.10 As shown, taking the capacitance information 901 collected at time t1 as an example, when the length and width of the input data are required to be 2*7, the corresponding 2*7 matrix 901-3 is extracted from the capacitance information 901, and the matrix center of the matrix 901-3 contains the maximum capacitance in the capacitance information, that is, the capacitance 3995 collected by the capacitance sensor 901-10.

[0160] In the embodiment of the present application, in order to improve the accuracy of training data, it is necessary to obtain the corresponding 2*7 matrix from the capacitance information of multiple consecutive moments contained in the first capacitance information 1100, and together form the capacitance feature data. In some embodiments, the capacitance information containing the maximum capacitance can be taken as the center, and 5 frames of adjacent capacitance information can be taken from the front and back of the capacitance information, and the corresponding matrix can be extracted. Fig.10 As shown, the maximum capacitance value included in capacitance information 901 is 3995 collected by sensor 901-10, the maximum capacitance value included in the capacitance information 904 adjacent to it is 3795 collected by capacitance sensor 904-10, and the maximum capacitance value included in the capacitance information 903 adjacent to it is 3895 collected by capacitance sensor 903-10. Therefore, the capacitance information containing the maximum capacitance value in the first capacitance information is 901. Taking capacitance information 901 as the center, 5 frames of adjacent capacitance information are taken forward and the corresponding 2*7 matrix is ​​extracted, and 5 frames of adjacent capacitance information are taken backward and the corresponding 2*7 matrix is ​​extracted, which together constitute capacitance feature data 1101. The size of capacitance feature data 1101 is 11×2×7.

[0161] Step S33: extracting pressure characteristic data from the first pressure sensing signal.

[0162] The pressure characteristic data is the data in the pressure sensing signal used to indicate the pressure parameters.

[0163] Step S34: fusing the writing position feature data, the capacitance feature data and the pressure feature data to obtain first training feature data.

[0164] Among them, the method of data fusion processing can be selected according to the actual application situation and is not specifically limited in the embodiments of the present application.

[0165] In the embodiment of the present application, through the above steps S31 to S34, the first training feature data is obtained. The first training feature data is the usage feature data of the stylus on an electronic device without a film, including writing position feature data, capacitance feature data and pressure feature data.

[0166] Step S4: The data processing module processes the sample data based on the second capacitance information and the second pressure sensing signal to obtain second training feature data.

[0167] The process of processing the sample data of the second capacitance information and the second pressure signal is similar to the data processing process in step S3, which will not be repeated here. The second training feature data is the use feature data of the stylus on the electronic device with the film, including writing position feature data, capacitance feature data and pressure feature data.

[0168] Step S5: The data processing module sends the first training feature data and the second training feature data to the training module.

[0169] The first training feature data includes labels without film attached, and the second training feature data includes labels with film attached.

[0170] Step S6: The training module trains an initial first model according to the first training feature data and the second training feature data to obtain a trained first model.

[0171] like Fig.11 As shown, the training module uses the first training feature data and the second training feature data as input data, respectively, and inputs them into the initial first model 1200 to obtain the corresponding output result. Among them, the first training feature data and the second training feature data are multiple groups, and the multiple groups of first training feature data are different, and the multiple groups of first training feature data are also different. The output result is used to indicate whether the electronic device is filmed or not. The weight of the first model 1200 is updated according to the output result, and finally the weight parameter that meets the requirements is obtained, and the weight parameter that meets the requirements is the weight of the trained first model.

[0172] In an embodiment of the present application, the first model can be a network model based on deep learning, such as ResNet18 (a residual network including 18 convolutional layers) in Convolutional Neural Networks (CNN), which is not specifically limited in this embodiment.

[0173] In the embodiment of the present application, through the above steps S1 to S5, a trained first model is obtained, and the trained first model can determine the film state of the electronic device according to the usage feature data of the stylus on the electronic device.

[0174] It should be noted that the capacitance values ​​collected by the capacitance sensor under the screen are collectively referred to as capacitance signals. When a finger or stylus touches the screen, the capacitance value collected by the capacitance sensor will change, that is, the capacitance signal changes. Generally speaking, the capacitance signal obtained based on the finger touching the screen of the electronic device will contain a floating ground signal. The floating ground signal is relative to the ground signal. The ground signal refers to the capacitance data collected when the user is grounded or the shell of the tablet / mobile phone is grounded; the floating ground signal refers to the capacitance data collected when the user is not grounded or the shell of the tablet / mobile phone is not grounded. The maximum capacitance value of the floating ground signal is much smaller than the maximum capacitance value of the ground signal, and its capacitance distribution is similar to the capacitance distribution collected when the electronic device is filmed. Therefore, using the capacitance signal obtained based on the finger touching the screen of the electronic device to perceive the film state will interfere with the perception accuracy. Since the stylus has active capacitance, there is no floating ground signal. In the embodiment of the present application, when training the first model, the first capacitance information and the second capacitance information obtained based on the stylus are used to improve the recognition accuracy of the film state of the first model obtained by training.

[0175] Fig.12 A flowchart of a first model deployment method provided in an embodiment of the present application. The first model deployment method is applied to a server, or to an electronic device capable of terminal deployment. Fig.12 As shown, the first model deployment method includes: step S131-step S132.

[0176] Step S131: convert the trained first model into a preset format.

[0177] Among them, the preset format conversion can be the conversion from pyTorch (an open source neural network framework) to NCNN (a deployment framework for deploying models to mobile devices).

[0178] In an embodiment of the present application, during the training of the first model, the framework used by the first model may be pyTorch. PyTorch is a large machine learning framework that requires a large amount of storage space, so a lightweight framework, such as NCNN, is required when deploying the model. In this embodiment, after the first model training is completed, the first model is converted from pyTorch to NCNN to facilitate the subsequent deployment of the first model.

[0179] Step S132: deploy the first model and other collaborative modules converted into a preset format in the hardware abstraction layer of the electronic device.

[0180] Among them, Figure 3As shown, the other collaborative modules are, for example, a data processing module, a decision module and a handwriting correction module. The data processing module has the same function as the data processing module of the server in the aforementioned embodiment, and is used to process the received multiple stylus usage data into input data that can be input into the first model. The decision module is used to determine whether the film-sticking state of the electronic device output by the first model can be recognized. The decision module is described in detail in the embodiments described later, and will not be repeated here; the handwriting correction module is used to realize the automatic matching of the handwriting correction parameters of the stylus according to the film-sticking state of the electronic device output by the first model. Similarly, the handwriting correction module is described in detail in the embodiments described later, and will not be repeated here.

[0181] In an embodiment of the present application, the trained first model is deployed on an electronic device, so that the electronic device can automatically sense the film-sticking status of the electronic device through the first model.

[0182] Fig.13 A flowchart of a method for configuring handwriting correction parameters of a stylus pen is provided in an embodiment of the present application. The method for configuring handwriting correction parameters of a stylus pen is applied to an electronic device, which can be an electronic device that can be written by a stylus pen, such as a tablet, a mobile phone, or a laptop computer. Fig.13 As shown, the handwriting correction parameter configuration method includes: step S141-step S147.

[0183] Step S141 : in response to the stylus pen contacting the screen of the electronic device, the capacitance sensor sends the target capacitance information collected in the current collection period to the data processing module.

[0184] like Figure 6 As shown, the electronic device is equipped with a plurality of capacitance sensors distributed in an array, which are normally open and detect the capacitance distribution of the electronic device according to a predetermined touch sampling rate. The process of the capacitance sensor collecting target capacitance information can be referred to in the above Figure 8 The detailed description is omitted here. The target capacitance information includes capacitance information at multiple moments in the current acquisition cycle, and the capacitance information at each moment includes the capacitance of each capacitance sensor at that moment. In order to ensure the validity and accuracy of the collected capacitance, the current acquisition cycle includes at least 11 acquisitions. For example, when the touch sampling rate is 240Hz, the duration of the current acquisition cycle can be set to 1s, then the current acquisition cycle includes 240 acquisitions.

[0185] In one example, the electronic device is in a state without a film attached, and the contact between the stylus pen and the screen of the electronic device refers to contact with the outer screen of the electronic device.

[0186] In another example, the electronic device is in a film-covered state, and the contact between the stylus pen and the screen of the electronic device refers to contact with the protective film affixed to the outer screen of the electronic device.

[0187] Step S142: The wireless communication module sends the target pressure-sensing signal received from the stylus pen to the data processing module.

[0188] In this embodiment, the electronic device and the stylus pen communicate with each other in the following manner: Figure 4 As shown, when the tip of the stylus touches the screen of the electronic device, the pressure sensor 202 can obtain the corresponding pressure parameter based on the pressure received, and report the pressure parameter to the MCU 201. The MCU 201 is also used to control the Bluetooth antenna 204 to output a target pressure signal at a frequency synchronized with the touch sampling rate of the electronic device. The target pressure signal is used to indicate the pressure parameter obtained by the MCU 201 from the pressure sensor 202. Figure 4 The antenna in the electronic device 210 can send the received target pressure-sensing signal to the data processing module.

[0189] The electronic device can determine the state of the electronic device according to the target capacitance information and the target pressure-sensing signal, and the state includes the film-applied state or the film-unapplied state, and finally determine the handwriting correction parameters of the stylus according to the state of the electronic device. The electronic device determines the state of the electronic device according to the target capacitance information and the target pressure-sensing signal, including the following steps S143-S145; and determines the handwriting correction parameters of the stylus according to the state of the electronic device, including steps S146-147.

[0190] Step S143: The data processing module processes the sample data based on the target capacitance information and the target pressure sensing signal to obtain the first usage characteristic information.

[0191] Among them, sample data processing includes but is not limited to data calculation processing, data extraction processing, data fusion processing, etc.

[0192] The first usage characteristic information is

[0193] In this embodiment, the data processing module processes the sample data based on the target capacitance information and the target pressure sensing signal to obtain the first usage characteristic information, including: step S1431-step S1434.

[0194] Step S1431, determining writing position feature data according to target capacity information.

[0195] The target capacitance information includes capacitance values ​​detected by capacitance sensors in the electronic device without film attached at multiple moments, that is, the target capacitance information includes capacitance information collected from multiple frames of the electronic device without film attached.

[0196] In an embodiment of the present application, for the capacitance information at each moment in the target capacitance information (each frame of capacitance information), the position of the maximum capacitance is determined from the capacitance information, and the position of the maximum capacitance in the capacitance information at each moment is used as the writing position feature data.

[0197] Step S1432: extracting capacitance characteristic data according to the target capacitance information.

[0198] The method of extracting capacitance characteristic data according to target capacitance information is similar to that in the above embodiment. Fig.10 The method of extracting the capacitance characteristic data according to the first capacitance information is similar to that shown in the figure. Therefore, the method of extracting the capacitance characteristic data according to the target capacitance information can refer to the method in the above embodiment. Fig.10 The detailed description of extracting the capacitance characteristic data according to the first capacitance information is shown and will not be repeated here.

[0199] Step S1433: extract pressure characteristic data from the target pressure sensing signal.

[0200] The pressure characteristic data is the data in the pressure sensing signal used to indicate the pressure parameters.

[0201] Step S1434: fusing the writing position characteristic data, the capacitance characteristic data and the pressure characteristic data to obtain first usage characteristic information.

[0202] Among them, the method of data fusion processing can be selected according to the actual application situation, and the method of data fusion processing is not specifically limited in the embodiments of the present application.

[0203] In the embodiment of the present application, through the above steps S1431 to S1434, the first usage characteristic information is obtained. The first usage characteristic information is the usage characteristic data of the stylus on the electronic device without a film, including writing position characteristic data, capacitance characteristic data and pressure characteristic data.

[0204] Step S144: The data processing module inputs the first usage characteristic information into a pre-configured first model.

[0205] The first model is a model for sensing the current film-sticking state of the electronic device.

[0206] Step S145: The first model outputs first film sticking state information to the handwriting correction module based on the input first usage feature information.

[0207] The first film-applying state information is information on whether the electronic device is currently pasted with a film, determined by the first model based on the input first usage characteristic information. The first film-applying state information is used to indicate whether the electronic device is pasted with a film or not pasted with a film.

[0208] In one example, if a film is applied, the first model can identify that the electronic device has a film applied based on the first usage characteristic information, and output first film application state information to the note correction module, where the first film application state information is used to indicate the film application. The note correction module executes S146.

[0209] In another example, if the electronic device is not covered with a film, the first model can identify that the electronic device is covered with a film based on the first usage characteristic information, and output second film state information to the note correction module, where the second film state information is used to indicate that the electronic device is not covered with a film. The note correction module executes S147.

[0210] Step S146: When the first film-applying state information indicates that the electronic device has no film applied, the handwriting correction module configures handwriting correction parameters for the non-film-applying state.

[0211] The handwriting correction parameter in the unfilmed state is a parameter used to correct the first handwriting written by the stylus on the electronic device without a film, and the handwriting correction parameter in the unfilmed state can indicate the compensation value of the first handwriting at each contact point.

[0212] The handwriting correction module pre-stores handwriting correction parameters corresponding to each film application state, for example, handwriting correction parameters in the unfilmed state corresponding to the electronic device not having a film applied, and handwriting correction parameters in the filmed state corresponding to the electronic device having a film applied.

[0213] In one embodiment, the step of determining the handwriting correction parameter in the unfilmed state corresponding to the situation that the electronic device is not filmed includes: the following steps 1 to 3.

[0214] Step 1: Fig.14 As shown in (1), a mechanical arm 1500 is used to fix the stylus 101, and a straight line segment is written at a constant speed on the electronic device 100 without a film, and the electronic device 100 collects the straight line segment data.

[0215] Step 2: The electronic device establishes a Fig.14 The theoretical and actual coordinate relationship shown in (2) in FIG. 1501 is a graph showing the theoretical handwriting and 1502 is a graph showing the actual handwriting.

[0216] Step 3: The electronic device calculates the coordinate relationship between the theory and the actual coordinates. Fig.14 The compensation value of each contact point shown in (3) is determined as the handwriting correction parameter in the unfilmed state.

[0217] The compensation value of each touch point is equal to the difference between the actual handwriting position and the theoretical handwriting position. Fig.14The contact point 1503 on the actual handwriting shown in (2) has an actual handwriting position of (a, b). The corresponding contact point on the theoretical handwriting is 1504, and the position is (a+offsetx, b+offsety). Then the compensation value of the contact point 1503 is (offsetx, offsety).

[0218] It should be noted that if you need to determine the handwriting correction parameters for the film-sticking state, Fig.14 By replacing the electronic device without film with the electronic device with film, the handwriting correction parameters in the film-applied state can be determined, which will not be repeated here.

[0219] In the embodiment of the present application, after the handwriting correction module configures the handwriting correction parameters for the unfilmed state, in response to the user's first writing action on the screen using the stylus, the handwriting correction module corrects the first stylus handwriting corresponding to the first writing action based on the handwriting correction parameters for the unfilmed state, thereby optimizing the first stylus handwriting.

[0220] In one example, the step of correcting the first stylus handwriting corresponding to the first writing action based on the handwriting correction parameter in the unfilmed state includes: for each contact point in the first stylus handwriting, selecting a corresponding compensation value from the handwriting correction parameter in the unfilmed state; adding the compensation value to the actual position of the contact point to determine the theoretical position of the contact point; and forming the theoretical positions of all the contact points in the first stylus handwriting into the corrected first stylus handwriting.

[0221] Step S147: When the first film-applying state information indicates that the electronic device has applied a film, the handwriting correction module configures the film-applying state handwriting correction parameters.

[0222] The film-applied state handwriting correction parameter is a parameter used to correct the second handwriting written by the stylus on the film-applied electronic device, and the film-applied state handwriting correction parameter can indicate the compensation value of the second handwriting at each contact point.

[0223] In the embodiment of the present application, after the handwriting correction module configures the film state handwriting correction parameters, in response to the user's second writing action on the screen using the stylus, the second stylus handwriting corresponding to the second writing action is corrected based on the film state handwriting correction parameters to achieve optimization of the stylus handwriting.

[0224] In one example, the step of correcting the second stylus handwriting corresponding to the second writing action based on the film state handwriting correction parameter includes: for each contact point in the second stylus handwriting, selecting a corresponding compensation value from the film state handwriting correction parameter; adding the compensation value to the actual position of the contact point to determine the theoretical position of the contact point; and forming the theoretical positions of all the contact points in the second stylus handwriting into the corrected second stylus handwriting.

[0225] In the embodiment of the present application, first, in response to the current maximum capacitance being equal to or greater than the first capacitance threshold, the capacitance sensor sends the target capacitance information collected in the current collection period to the data processing module; the wireless communication module also sends the target pressure-sensing signal received from the stylus to the data processing module; then, the data processing module performs sample data processing based on the target capacitance information and the target pressure-sensing signal to obtain first usage characteristic information, and inputs the first usage characteristic information into a pre-configured first model, so that the first model outputs first film-sticking state information to the handwriting correction module, thereby realizing automatic perception of the film-sticking state of the electronic device; finally, the handwriting correction module configures the handwriting correction parameters for the unfilm-sticking state when the first film-sticking state information indicates that the electronic device is not film-sticking, and configures the handwriting correction parameters for the film-sticking state when the first film-sticking state information indicates that the electronic device is film-sticking, thereby realizing automatic configuration of the corresponding stylus handwriting correction parameters according to the perceived film-sticking state, thereby optimizing the handwriting of the stylus and improving the user experience.

[0226] Fig.15 A schematic diagram of an application effect provided by an embodiment of the present application. The electronic device 100 is configured with a first model, which can automatically sense the film-applying state of the electronic device and configure the corresponding stylus pen handwriting correction parameters according to the film-applying state. For example, a user uses a stylus pen 101 to write a straight line on the electronic device 100 that has just been filmed and has not adjusted the stylus pen handwriting correction parameters. Fig.15 As shown, the handwriting written by the user using the stylus 101 on the electronic device 100 may include a part 1601 and a part 1602. The handwriting in the part 1601 is distorted and crooked because the handwriting correction parameters of the stylus have not been adjusted when the user writes. The electronic device uses the handwriting correction parameters of the unfilmed state to correct the handwriting in the filmed state, resulting in the handwriting in the part 1601 being distorted and crooked.

[0227] When the user writes the portion 1601, the electronic device can Fig.13 The provided stylus pen handwriting correction parameter configuration method senses the film-applying state of the electronic device and configures the corresponding stylus pen handwriting correction parameters according to the film-applying state. After the film-applying state handwriting correction parameter configuration is completed, the electronic device will correct the subsequent handwriting according to the film-applying state handwriting correction parameter, so that the handwriting of part 1602 is not distorted or crooked.

[0228] It should be noted that Fig.15This is an exemplary description of the application effect. In order to better illustrate the effect of the embodiment of the present application, part 1601 of the handwriting is enlarged for illustration. In actual application, the length of the distorted and crooked part of the handwriting is generally less than 2 mm. The method for configuring the handwriting correction parameters provided in the embodiment of the present application can complete the film state perception of the electronic device without obvious perception by the user and configure the corresponding handwriting correction parameters according to the film state, thereby realizing handwriting optimization and improving the user experience.

[0229] Generally, the film state of an electronic device has a certain timeliness. The probability of sensing different film states for two strokes written by a stylus at similar times is relatively low. Therefore, in order to further improve the accuracy of film state sensing, the present application embodiment provides another method for configuring stylus handwriting correction parameters, which determines the final film state based on the film state information sensed several times in succession.

[0230] Fig.16 A flowchart of another stylus pen handwriting correction parameter configuration method provided in an embodiment of the present application. The stylus pen handwriting correction parameter configuration method is applied to an electronic device, which can be an electronic device that can be written by a stylus, such as a tablet, a mobile phone, or a laptop computer. The other stylus pen handwriting correction parameter configuration method can be in Fig.13 The first model outputs the first film sticking state information based on the input first usage feature information (step S145) and then executes. Fig.16 As shown, the handwriting correction parameter configuration method includes: step S171-step S179.

[0231] Step S1701: The decision module compares the first film pasting state information with the historical film pasting state information to determine whether the film pasting states of the electronic device indicated by the first film pasting state information and the historical film pasting state information are consistent.

[0232] The historical film state information is the film state information stored after the film state of the electronic device was sensed last time, for example, it may be the film state information sensed when the electronic device was used the previous day.

[0233] In one example, when the electronic device uses a stylus to write on the electronic device one day before the current time, the electronic device obtains the historical film state information and stores the historical film state information. The way in which the electronic device obtains the historical film state information is similar to the way in which the first film state information is obtained in the aforementioned embodiment, and will not be repeated here.

[0234] Step S1702: When the first film pasting state information is consistent with the film pasting state of the electronic device indicated by the historical film pasting state information, the decision module sends the first film pasting state information to the handwriting correction module.

[0235] Among them, when the first film state information is consistent with the electronic device film state indicated by the historical film state information, it means that the electronic device film state indicated by the first film state information is highly accurate, and therefore, the first film state information can be directly output to the handwriting correction module.

[0236] Step S1703: The handwriting correction module configures, for the electronic device, handwriting correction parameters corresponding to the film application state of the electronic device indicated by the first film application state information.

[0237] In one example, the note correction module configures a film state handwriting correction parameter in response to the first film state information indicating that the electronic device has a film.

[0238] In another example, in response to the first film state information indicating that the electronic device has no film applied, the note correction module configures handwriting correction parameters for the non-film applied state.

[0239] Step S1704: When the first film application state information and the film application state of the electronic device indicated by the historical film application state information are inconsistent, the decision module sends the first control information to the data processing module.

[0240] In one example, the first film status information indicates that the electronic device has a film applied, and the historical film status information indicates that the electronic device has no film applied. The first film status information is inconsistent with the film status of the electronic device indicated by the historical film status information, and the decision module sends the first control information to the data processing module.

[0241] In another example, the first film status information indicates that the electronic device has no film applied, and the historical film status information indicates that the electronic device has a film applied. The first film status information is inconsistent with the film status of the electronic device indicated by the historical film status information, and the decision module sends the first control information to the data processing module.

[0242] It should be noted that, from the above two examples, when the first film state information is inconsistent with the film state of the electronic device indicated by the historical film state information, it means that the film state of the electronic device has changed. Therefore, in order to ensure the accuracy of the perception result, the decision module can control the data processing module and the intelligent perception module to re-perform the film state perception. The first control information is control information used to control the data processing module to re-perform the film state perception.

[0243] Step S1705: The data processing module inputs the second usage characteristic information into the pre-configured first model in response to the first control information.

[0244] In one embodiment, after obtaining the first usage characteristic information, the electronic device performs sample data processing based on the target capacitance information sent by the capacitance sensor in the next acquisition cycle of the current acquisition cycle and the pressure sensing information forwarded by the wireless communication module in the time period of the next acquisition cycle to obtain the second usage characteristic information, that is, the second usage characteristic information is the next characteristic information obtained by the data processing module after obtaining the first usage characteristic information. The sample data processing can refer to the above embodiment. Fig.13 The corresponding detailed description will not be repeated here.

[0245] Step S1706: The first model outputs the second film sticking state information to the decision module based on the input second usage feature information.

[0246] Step S1707: The decision module compares the first film pasting state information with the second film pasting state information to determine whether the film pasting states of the electronic device indicated by the first film pasting state information and the second film pasting state information are consistent.

[0247] In an example, the first film state information indicates that the electronic device has a film applied, and the second film state information indicates that the electronic device has a film applied. If the first film state information and the second film state information indicate that the electronic device has a film applied, the film states of the electronic device are consistent, and the following step S1708 is executed.

[0248] In another example, if the first film state information indicates that the electronic device has a film applied, and the second film state information indicates that the electronic device has no film applied, then the film states of the electronic device indicated by the first film state information and the second film state information are inconsistent, and the following step S1710 is executed.

[0249] In another example, the first film status information indicates that the electronic device has no film applied, and the second film status information indicates that the electronic device has a film applied. If the first film status information and the second film status information indicate that the film application status of the electronic device are inconsistent, the following step S1710 is executed.

[0250] Step S1708: When the first film state information and the second film state information indicate the same film state of the electronic device, the decision module sends the first film state information to the handwriting correction module.

[0251] The first film state information and the second film state information indicate the same film state of the electronic device, indicating that the first film state information is highly credible. Therefore, the decision module sends the first film state information to the handwriting correction module.

[0252] It should be noted that, since the first film state information and the second film state information indicate the same film state of the electronic device, the decision module in step S1708 may also send the second film state information to the handwriting correction module.

[0253] Step S1709: The handwriting correction module configures, for the electronic device, handwriting correction parameters corresponding to the film-applying state of the electronic device indicated by the first film-applying state information.

[0254] In one example, in response to the first film state information indicating that the electronic device is not film-attached, the note correction module configures the handwriting correction parameters for the non-film-attached state. After the handwriting correction module configures the handwriting correction parameters for the non-film-attached state, in response to the user's first writing action on the screen using a stylus, the handwriting correction module corrects the first stylus handwriting corresponding to the first writing action based on the handwriting correction parameters for the non-film-attached state, thereby optimizing the first stylus handwriting.

[0255] In another example, the note correction module configures the film state handwriting correction parameters in response to the first film state information indicating that the electronic device has a film. After the handwriting correction module configures the film state handwriting correction parameters, in response to the user's second writing action on the screen using the stylus, the second stylus handwriting corresponding to the second writing action is corrected based on the film state handwriting correction parameters to optimize the stylus handwriting.

[0256] Step S1710: When the first film pasting state information and the second film pasting state information indicate inconsistent film pasting states of the electronic device, the decision module sends second control information to the data processing module.

[0257] The first film state information and the second film state information indicate inconsistent film states of the electronic device, indicating that the film state perception process is unstable and there may be errors in the two most recent perceived film states. Therefore, in order to ensure the accuracy of the perception results, the decision module can control the data processing module and the intelligent perception module to re-perform film state perception. The second control information is control information for controlling the data processing module to re-perceive the film state perception.

[0258] Step S1711: The data processing module inputs the third usage characteristic information into the pre-configured first model in response to the second control information.

[0259] In one embodiment, after obtaining the second usage characteristic information, the electronic device performs sample data processing based on the target capacitance information sent by the capacitance sensor in the second collection cycle after the current collection cycle and the pressure information forwarded by the wireless communication module in the time period of the second collection cycle to obtain the third usage characteristic information, that is, the third usage characteristic information is the next characteristic information obtained by the data processing module after obtaining the second usage characteristic information. The sample data processing can refer to the above embodiment. Fig.13 The corresponding detailed description will not be repeated here.

[0260] Step S1712: The first model outputs the third film application state information to the decision module based on the input third usage feature information.

[0261] After the first model outputs the third film pasting state information, the third film pasting state information is consistent with the film pasting state indicated by the first film pasting state information, or is consistent with the film pasting state indicated by the second film pasting state information.

[0262] For example, in one example, the third film status information indicates that the electronic device has a film, the first film status information indicates that the electronic device has a film, and the second film status information indicates that the electronic device has no film, then the third film status information is consistent with the film status indicated by the first film status information.

[0263] In another example, the third film status information indicates that the electronic device is not pasted with a film, the first film status information indicates that the electronic device is not pasted with a film, and the second film status information indicates that the electronic device is pasted with a film, then the third film status information is consistent with the film status indicated by the first film status information.

[0264] In another example, the third film status information indicates that the electronic device has a film, the first film status information indicates that the electronic device has no film, and the second film status information indicates that the electronic device has a film, then the third film status information is consistent with the film status indicated by the second film status information.

[0265] In another example, the third film status information indicates that the electronic device is not pasted with a film, the first film status information indicates that the electronic device is pasted with a film, and the second film status information indicates that the electronic device is not pasted with a film, then the third film status information is consistent with the film status indicated by the second film status information.

[0266] When the third film state information is consistent with the film state indicated by the first film state information, it means that the third film state information and the first film state information have high accuracy; when the third film state information is consistent with the film state indicated by the second film state information, it means that the third film state information and the second film state information have high accuracy. Therefore, the film state of the electronic device can be finally determined directly according to the film state indicated by the third film state information.

[0267] Step S1713: The decision module sends the third film state information to the handwriting correction module.

[0268] Step S1714: When the third film-applying state information indicates that the electronic device has no film-applying state, the handwriting correction module configures handwriting correction parameters for the electronic device in the non-film-applying state.

[0269] The handwriting correction parameter in the unfilmed state is a parameter used to correct the first handwriting written by the stylus on the electronic device without a film, and the handwriting correction parameter in the unfilmed state can indicate the compensation value of the first handwriting at each contact point.

[0270] In the embodiment of the present application, after the handwriting correction module configures the handwriting correction parameters for the unfilmed state, the electronic device responds to the user's writing action on the screen using the stylus pen, and corrects the stylus handwriting based on the handwriting correction parameters for the unfilmed state, thereby optimizing the stylus handwriting.

[0271] Step S1715: When the third film-applying state information indicates that the electronic device has a film applied, the handwriting correction module configures a film-applying state handwriting correction parameter for the electronic device.

[0272] The film-applied state handwriting correction parameter is a parameter used to correct the second handwriting written by the stylus on the film-applied electronic device, and the film-applied state handwriting correction parameter can indicate the compensation value of the second handwriting at each contact point.

[0273] In another stylus pen handwriting correction parameter configuration method provided in an embodiment of the present application, the final film sticking state is determined according to the film sticking state information sensed several times in succession, which can further improve the accuracy of film sticking state perception, optimize the stylus pen handwriting, and improve the user experience.

[0274] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0275] The steps performed by the electronic device 100 in the stylus pen handwriting correction parameter configuration method provided in the embodiment of the present application may also be performed by a chip system included in the electronic device 100, wherein the chip system may include a processor and a Bluetooth chip. The chip system may be coupled to a memory so that the chip system calls a computer program stored in the memory when it is running to implement the steps performed by the electronic device 100. The processor in the chip system may be an application processor or a processor other than an application processor.

[0276] As described above, the above embodiments 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, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for determining handwriting correction parameters of a stylus pen, It is characterized in that Applied to electronic equipment, the method comprises: When the stylus pen contacts the screen of the electronic device, target capacitance information is acquired; the target capacitance information includes capacitance values ​​collected by each capacitance sensor of the electronic device in a current collection cycle; Acquire target pressure sensing signal; Determine the state of the electronic device according to the target capacitance information and the target pressure sensing signal; the state includes a film-applied state or a film-unapplied state; Determining a handwriting correction parameter of the stylus according to the state of the electronic device; The step of determining the state of the electronic device according to the target capacitance information and the target pressure sensing signal includes: Determining writing position characteristic data of the stylus according to the target capacitance information; Determine capacitance characteristic data according to the target capacitance information; Determining pressure characteristic data according to the target pressure sensing signal; Performing data fusion processing on the writing position characteristic data, the capacitance characteristic data and the pressure characteristic data to obtain first usage characteristic information; the first usage characteristic information is used to indicate the contact characteristics between the stylus pen and the screen of the electronic device; Inputting the first usage characteristic information into a first model to obtain first film sticking state information; Determining the state of the electronic device according to the first film state information; Wherein, determining the writing position characteristic data of the stylus according to the target capacitance information includes: For the capacitance information at each moment in the target capacitance information, determining the location of the maximum capacitance from the capacitance information; The position of the maximum capacitance in the capacitance information at each moment is used as the writing position characteristic data.

2. The method according to claim 1, It is characterized in that When the stylus pen contacts the screen of the electronic device, obtaining target capacitance information includes: When the stylus pen contacts the screen of the electronic device, in the current acquisition cycle, capacitance information at multiple moments is acquired based on the touch sampling rate as the target capacitance information; wherein the capacitance information at each moment includes the capacitance of each capacitance sensor at that moment.

3. The method according to claim 1, It is characterized in that Determining capacitance characteristic data according to the target capacitance information includes: From all the capacitance information of the target capacitance information, multiple frames of capacitance information are selected according to a preset selection rule; A capacitance matrix of a preset size is extracted from each frame of selected capacitance information as the capacitance characteristic data.

4. The method according to claim 3, It is characterized in that The matrix center of the capacitance matrix includes the maximum capacitance of the capacitance information of each frame.

5. The method according to claim 3, It is characterized in that The preset selection rule is: select the capacitance information where the maximum capacitance is located, and take the capacitance information where the maximum capacitance is located as the center, select the capacitance information at five moments before the center and the capacitance information at five moments after the center.

6. The method according to claim 1, It is characterized in that The step of determining the handwriting correction parameter of the stylus according to the state of the electronic device comprises: When the state of the electronic device is a film-applied state, determining the handwriting correction parameter of the stylus pen as a film-applied state handwriting correction parameter; wherein the film-applied state handwriting correction parameter is used to correct the first handwriting written by the stylus pen on the film-applied electronic device; When the electronic device is in a non-film-attached state, the handwriting correction parameters of the stylus are determined to be non-film-attached state handwriting correction parameters; wherein the non-film-attached state handwriting correction parameters are used to correct the second handwriting written by the stylus on the non-film-attached electronic device.

7. The method according to claim 6, It is characterized in that After determining the handwriting correction parameter of the stylus according to the state of the electronic device, the method further includes: The handwriting of the stylus pen is corrected according to the determined handwriting correction parameter.

8. The method according to claim 7, It is characterized in that The handwriting correction parameter includes a compensation value for each contact point in the handwriting, and the step of correcting the handwriting of the stylus according to the determined handwriting correction parameter includes: For each contact point in the handwriting, selecting a corresponding compensation value from the handwriting correction parameters; Determining a theoretical position of the contact point according to the compensation value and the actual position of the contact point; The corrected handwriting is determined based on the theoretical position of each contact point in the handwriting.

9. The method according to claim 1, It is characterized in that The determining the state of the electronic device according to the first film sticking state information includes: Determine whether the state of the electronic device indicated by the first film sticking state information is consistent with the state of the historical film sticking state information; When the first film state information is consistent with the state of the electronic device indicated by the historical film state information, the state indicated by the first film state information is determined as the state of the electronic device; the historical film state information is used to indicate the state of the electronic device in any collection cycle before the current collection cycle.

10. The method according to claim 9, It is characterized in that The method further comprises: In the case that the state of the electronic device indicated by the first film pasting state information is inconsistent with the state of the historical film pasting state information, the second usage characteristic information is input into the first model to obtain the second film pasting state information output by the first model; the second film pasting state information is used to indicate the state of the electronic device in the next collection cycle of the current collection cycle; When the states of the electronic device indicated by the first film sticking state information and the second film sticking state information are consistent, the state indicated by the first film sticking state information is determined as the state of the electronic device.

11. The method according to claim 10, It is characterized in that The method further comprises: In the case that the states of the electronic device indicated by the first film sticking state information and the second film sticking state information are inconsistent, the third usage characteristic information is input into the first model to obtain the third film sticking state information output by the first model; the third film sticking state information is used to indicate the state of the electronic device in a second collection cycle after the current collection cycle; The state indicated by the third film state information is determined as the state of the electronic device.

12. The method according to claim 1, It is characterized in that The electronic device is connected to the stylus pen via Bluetooth.

13. A model training method, It is characterized in that Applied to a server, the method comprises: Acquire first stylus training information of the electronic device in a state where no film is applied; the first stylus training information includes first capacitance information and a first pressure sensing signal; Acquire second stylus pen training information of the electronic device in the film-applied state; the second stylus pen training information includes second capacitance value information and second pressure sensing signal; Performing sample data processing based on the first capacitance information and the first pressure sensing signal to obtain first training feature data; Performing sample data processing based on the second capacitance information and the second pressure sensing signal to obtain second training feature data; An initial first model is trained based on the first training feature data and the second training feature data to obtain a trained first model; wherein the trained first model is used to determine a state of the electronic device, the state including a film-applied state or a film-unapplied state, so that the electronic device can determine a handwriting correction parameter of the stylus according to the state; The performing sample data processing based on the first capacitance information and the first pressure sensing signal to obtain first training feature data includes: Determine writing position characteristic data according to the first capacitance value information; Extracting capacitance characteristic data according to the first capacitance information; Extracting pressure characteristic data from the first pressure sensing signal; Performing data fusion processing on the writing position feature data, the capacitance feature data and the pressure feature data to obtain the first training feature data; Wherein, determining the writing position characteristic data according to the first capacitance value information includes: For the capacitance information at each moment in the first capacitance information, determining the location of the maximum capacitance from the capacitance information; The position of the maximum capacitance in the capacitance information at each moment is used as the writing position characteristic data.

14. An electronic device, It is characterized in that The electronic device comprises: one or more processors; Memory; And a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the one or more processors, the electronic device executes the method for determining the handwriting correction parameters of any one of claims 1-12.

15. The electronic device according to claim 14, It is characterized in that The electronic device is connected to the stylus pen via Bluetooth.

16. An electronic device, It is characterized in that The electronic device comprises: one or more processors; Memory; And a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the one or more processors, the electronic device executes the model training method as described in claim 13.

17. A computer storage medium, It is characterized in that The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method for determining the handwriting correction parameters of a stylus pen as claimed in any one of claims 1 to 12.

18. A computer storage medium, It is characterized in that It includes computer instructions, which, when executed on an electronic device, cause the electronic device to execute the model training method as claimed in claim 13.

Citation Information

Patent Citations

  • Method and device for adjusting operation mode of equipment and electronic equipment

    CN113157082A

  • Intensity calibration method of active capacitance stylus, electronic equipment and readable storage medium

    CN114047834A