Handwriting pen handwriting generation method and electronic equipment

By integrating the communication module and the acceleration sensor module in the electronic device, the inclination angle between the stylus and the electronic device is accurately determined, and the problem of inclination angle cannot be determined under the large inclination angle is solved, achieving more accurate handwriting generation and better user experience.

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

Patent Information

Application Number
CN202510126725.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-27
Publication Date
2025-04-01
Estimated Expiration
2045-01-27

AI Technical Summary

Technical Problem

When the inclination angle between the stylus and the electronic device is large, the electronic device cannot accurately determine the inclination angle between the stylus and the electronic device, resulting in the inclination angle being unable to determine the corresponding handwriting of the stylus according to the inclination angle.

Method used

By integrating the communication module and the acceleration sensor module in the electronic device, the acceleration information sent by the stylus is received, and combined with the acceleration sensor information on the electronic device, the inclination angle between the stylus and the electronic device is accurately determined.

Benefits of technology

Even when the inclination angle is large, the electronic device can accurately determine the inclination angle, receive and respond to the instructions of the stylus, and perform operations associated with the handwriting corresponding to the stylus according to the inclination angle, thereby improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739323A_ABST
    Figure CN119739323A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a handwriting generation method of a handwriting pen and electronic equipment, and relates to the technical field of terminals, and the method can accurately execute an operation associated with the handwriting corresponding to the handwriting pen according to an inclination angle. Specifically, the electronic equipment receives first information sent by the handwriting pen through a communication module, and the first information comprises acceleration information collected by a first acceleration sensor module in the handwriting pen. The electronic device determines a first tilt angle between the stylus and the electronic device. Wherein the first inclination angle is determined through the first information and the second information, and the second information comprises acceleration information collected by a second acceleration sensor module on the electronic equipment or inclination angle information associated with the acceleration information. Under the condition that the contact area between the handwriting pen and the electronic equipment is smaller than or equal to a first threshold value, the electronic equipment receives a first instruction of the handwriting pen. And the electronic equipment responds to the first instruction and executes an operation associated with the handwriting corresponding to the handwriting pen according to the first inclination angle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a handwriting generation method and an electronic device. Background Art

[0002] With the development of technology, electronic devices can be equipped with styluses so as to perform more precise writing or more precise touch control on the electronic devices through the stylus.

[0003] However, when the inclination angle between the stylus and the electronic device is large, the electronic device cannot accurately determine the inclination angle between the stylus and the electronic device, thereby causing the electronic device to be unable to determine the handwriting corresponding to the stylus according to the inclination angle. Summary of the Invention

[0004] The embodiments of the present application provide a method for generating handwriting of a stylus pen and an electronic device, which can accurately perform operations associated with handwriting corresponding to the stylus pen according to the inclination angle.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, a method for generating handwriting using a stylus is provided, which is applied to an electronic device, wherein the electronic device includes a communication module and a second acceleration sensor module. The electronic device receives first information sent by the stylus through the communication module, wherein the first information includes acceleration information collected by the first acceleration sensor module in the stylus. The electronic device determines a first inclination angle between the stylus and the electronic device. The first inclination angle is determined by the first information and the second information, wherein the second information includes acceleration information collected by the second acceleration sensor module, or the second information includes inclination information associated with the acceleration information collected by the second acceleration sensor module. When the contact area between the stylus and the electronic device is less than or equal to a first threshold, the electronic device receives a first instruction from the stylus. The electronic device then responds to the first instruction and performs an operation associated with the handwriting corresponding to the stylus according to the first inclination angle.

[0007] In the above solution, both the first information and the second information are determined based on the acceleration information collected by the acceleration sensor module. The acceleration information collected by the acceleration sensor module can accurately reflect the tilt of the device, and thus the inclination angle determined by the electronic device based on the first and second information is also accurate. Even when the inclination angle between the stylus and the electronic device is large, that is, when the contact area between the stylus and the electronic device is less than or equal to the first threshold, the electronic device can still accurately determine the inclination angle. The electronic device can also receive and respond to instructions from the stylus and accurately perform operations associated with the stylus's handwriting based on the first inclination angle.

[0008] In a possible implementation manner of the first aspect, the first inclination angle may range from 0 degrees to 360 degrees.

[0009] In the above solution, both the first information and the second information are determined based on acceleration information collected by the acceleration sensor module. Acceleration information can reflect changes in the orientation of the device where the acceleration sensor is located in space. Therefore, the first inclination angle obtained by the electronic device based on the first and second information can range from 0 degrees to 360 degrees. That is, the electronic device can determine the inclination angle between the electronic device and the stylus regardless of their posture.

[0010] In another possible implementation of the first aspect, when the contact area between the stylus and the touch screen is less than or equal to a first threshold, the electronic device receives a first instruction generated by the stylus contacting the touch screen. In response to the first instruction, the electronic device performs a handwriting operation associated with handwriting corresponding to the stylus according to the first tilt angle.

[0011] In the above scheme, when the contact area between the stylus and the touch screen is less than or equal to the first threshold, the electronic device can also perform the handwriting operation associated with the handwriting corresponding to the stylus according to the first inclination angle after receiving the first instruction. That is, the electronic device can perform the handwriting operation even when the first inclination angle is large, so that the electronic device can better simulate the effect of the user writing with a real pen, thereby improving the user experience.

[0012] In another possible implementation of the first aspect, in some embodiments, when the stylus is not in contact with the electronic device, the electronic device receives, via a communication module, a first instruction sent by the stylus, where the first instruction is used to remotely control the electronic device to perform a first operation. In response to the first instruction, the electronic device performs a first operation associated with handwriting corresponding to the stylus based on the first tilt angle.

[0013] In the above solution, when the stylus pen and the electronic device are not in contact, the electronic device can receive a first instruction to enable the stylus pen to perform an operation on the electronic device through the air. This operation allows the user to interact without directly contacting the electronic device, thereby enhancing the user experience.

[0014] In another possible implementation of the first aspect, the first operation may be an operation performed on a game interface of the electronic device, the first operation may also be an operation to determine the posture of a user holding a stylus, or the first operation may be an operation to determine an action password lock of the electronic device.

[0015] In the above solution, in this embodiment, the electronic device uses the first instruction to enable the electronic device to perform the first operation associated with the handwriting corresponding to the stylus according to the first tilt angle, thereby improving the user experience.

[0016] In another possible implementation of the first aspect, the electronic device determines the angle between the stylus pen's axis and the electronic device's normal direction based on the first information and the second information, and then determines a complementary angle corresponding to the complementary angle and uses the complementary angle as the first inclination angle.

[0017] In the above solution, the electronic device accurately detects the angle between the axial direction of the stylus and the normal direction of the electronic device, and uses the corresponding complementary angle as the first inclination angle, thereby accurately identifying the first inclination angle.

[0018] In another possible implementation of the first aspect, the electronic device determines a second tilt angle of the stylus in the first direction based on the first information. The electronic device then obtains second information collected by the second acceleration sensor module. The electronic device further determines a third tilt angle of the electronic device in the first direction based on the second information. The electronic device then determines an included angle using the second tilt angle and the third tilt angle.

[0019] In the above solution, the electronic device can accurately obtain the included angle through the second inclination angle and the third inclination angle, so that no matter what posture the electronic device and the stylus are in, the electronic device can accurately calculate the included angle between the normal direction of the electronic device and the axial direction of the stylus.

[0020] In another possible implementation of the first aspect, the stylus may further include a first gyroscope module. The electronic device obtains third information sent by the stylus via the communication module. The third information includes posture information collected by the first gyroscope module in the stylus. The electronic device then corrects the first information based on the third information to obtain corrected fourth information. The electronic device then determines a first tilt angle between the stylus and the electronic device based on the second and fourth information.

[0021] In the above solution, there may be errors in the process of the acceleration sensor module collecting acceleration information. The electronic device can use the gyroscope information (or posture information) on the stylus to correct the acceleration information collected by the acceleration sensor module to obtain more accurate acceleration information of the stylus. The electronic device can obtain the first inclination angle more accurately through the corrected acceleration information and the second information.

[0022] In a second aspect, the present application provides an electronic device, which includes: a memory and one or more processors. When the processor executes one or more computer programs stored in the memory, the electronic device executes the method in the first aspect and any possible implementation thereof.

[0023] In a third aspect, the present application provides an electronic device comprising: a memory and one or more processors, the memory being coupled to the processors. The memory stores computer program code, which includes computer instructions that, when executed by the processor, cause the electronic device to perform the method of the first aspect and any possible implementation thereof.

[0024] In a fourth aspect, the present application provides a chip system, which is applied to an electronic device including a memory and a display screen. The chip system includes: a processor, when the processor executes computer instructions stored in the memory, the chip system executes the method in the first aspect and any possible implementation thereof.

[0025] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method of the first aspect and any possible implementation thereof.

[0026] In a sixth aspect, embodiments of the present application provide a computer program product that, when executed on a computer, causes the computer to perform the method of the first aspect and any possible implementation thereof. The computer may be the electronic device of the second aspect and any possible implementation thereof, the electronic device of the third aspect and any possible implementation thereof, or the chip system of the fourth aspect and any possible implementation thereof.

[0027] It can be understood that the beneficial effects that can be achieved by the electronic device of the second aspect, the electronic device of the third aspect, the chip system of the fourth aspect, the computer-readable storage medium of the fifth aspect, and the computer program product of the sixth aspect provided above can refer to the beneficial effects in the method of the first aspect and any possible implementation thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0030] Figure 3 A schematic diagram of a software system architecture of an electronic device provided in an embodiment of the present application;

[0031] Figure 4 A flowchart of a method for generating handwriting using a stylus pen is provided in an embodiment of the present application;

[0032] Figure 5A schematic diagram of the principle of angle calculation provided in an embodiment of the present application;

[0033] Figure 6 A flowchart of another method for generating handwriting using a stylus pen is provided in an embodiment of the present application;

[0034] Figure 7 A timing diagram of a handwriting generation method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0036] Electronic devices can be equipped with styluses to achieve more precise touch and writing. For example, the electronic device can receive touches from the stylus and reproduce the effect of real pen strokes based on the touch operations of the stylus. Styluses include, but are not limited to, capacitive styluses and electromagnetic styluses. Capacitive styluses can also include active capacitive styluses.

[0037] In some embodiments, an electronic device can recreate the actual stylus strokes based on the tilt angle (referred to as the inclination angle) between the electronic device and the stylus, as well as the pressure applied to the stylus tip. However, if the inclination angle between the electronic device and the stylus is large, the stylus tip's contact structure may prevent the electronic device from detecting the contact point and further determining the inclination angle, thus preventing the electronic device from recreating the actual stylus strokes. For example, if the inclination angle is large, the electronic device cannot determine the inclination angle, and thus cannot draw the stylus strokes.

[0038] The following describes in detail how a capacitive stylus determines the tilt angle.

[0039] Figure 1 This is a schematic diagram of the interaction between a stylus and an electronic device provided in an embodiment of the present application. Figure 1 As shown in (a) of FIG, a capacitive stylus is provided with two electrodes: a first electrode 101 disposed on a pen tip 102, and a second electrode 103 disposed on a grip portion 104 of the capacitive stylus. The capacitive stylus can transmit electrical signals to the touch screen of an electronic device through the electrodes. For example, the electrical signals can consist of high and low levels, and the high and low level transmission processes follow a predetermined pattern.

[0040] Recombination Figure 1 In (a) and (b), the operating plane on the electronic device 200 receives the electrical signals emitted by the two electrodes on the capacitive stylus to determine the first position 105 of the pen tip 102 corresponding to the first electrode 101 on the touch screen, and determines the second position 106 of the grip portion 104 corresponding to the second electrode 103 vertically mapped on the touch screen.

[0041] The electronic device 200 then determines a first distance between the pen tip 102 and the grip portion 104, and a second distance between the first position 105 and the second position 106. The electronic device 200 then uses trigonometric functions to determine The electronic device 200 then uses inverse trigonometric functions to determine The value of is the tilt angle between the electronic device 200 and the capacitive stylus.

[0042] However, if Figure 1 As shown in (b) of FIG. 1 , because the second electrode 103 is disposed on the grip portion 104 and the grip portion 104 is annular, when the second electrode 103 transmits an electrical signal to the touch screen, a portion of the touch screen can receive the electrical signal. The electronic device 200 then determines the second position 106 in this portion. For example, when the tilt angle between the electronic device 200 and the stylus is small, the area of ​​the electronic device 200 that can receive the electrical signal transmitted by the second electrode 103 is the first area 107, which is relatively small. The electronic device 200 then determines the second position 106 based on the first area 107. For another example, when the tilt angle between the electronic device 200 and the stylus is large, the area of ​​the electronic device 200 that can receive the electrical signal transmitted by the second electrode 103 is the second area 108, which is relatively large. The electronic device 200 then determines the second position 106 based on the second area 108.

[0043] However, if the inclination angle between the electronic device 200 and the stylus is large, and the electronic device 200 determines the second position 106 based on the second area 108, the second position 106 determined by the electronic device 200 based on the second area 108 may not be accurate due to the large area of ​​the second area 108. This will cause an error in the second distance obtained by combining the first position 105 and the second position 106, and thus an error in the inclination angle obtained by combining the second distance and the first distance. The inclination angle error may be around 5 degrees.

[0044] Moreover, when the inclination angle between the stylus and the electronic device 200 is large, the electronic device 200 is unable to detect the position of the stylus contact due to the influence of the pen tip contact structure, that is, the electronic device 200 may not be able to determine the first position 105, and then the electronic device 200 cannot determine the second distance through the first position 105 and the second position 106, and further cannot determine the inclination angle through the second distance and the first distance, and thus the electronic device 200 cannot restore the strokes corresponding to the stylus according to the inclination angle information.

[0045] To this end, the present application provides a method for generating handwriting using a stylus. An electronic device determines the inclination angle between the stylus and the electronic device using first acceleration information and second acceleration information. The first acceleration information is acceleration information collected by a first acceleration sensor module on the stylus, and the second acceleration information is acceleration information collected by a second acceleration sensor module on the electronic device. When the contact area between the stylus and the electronic device is less than or equal to a first threshold, the electronic device receives and responds to instructions from the stylus and performs an operation associated with the handwriting corresponding to the stylus based on the first inclination angle.

[0046] It will be appreciated that in this embodiment, the acceleration information collected by the acceleration sensor module can accurately reflect the tilt of the device, and thus the inclination angle determined by the electronic device using the first acceleration information and the second acceleration information is also accurate. Even when the inclination angle between the stylus and the electronic device is large, that is, when the contact area between the stylus and the electronic device is less than or equal to the first threshold, the electronic device can accurately determine the inclination angle, and the electronic device can receive and respond to the stylus's instructions, performing operations associated with the stylus's corresponding handwriting based on the first inclination angle. For example, the electronic device can generate and display corresponding brushstrokes based on the inclination angle.

[0047] For example, the electronic device may be a mobile phone, a tablet computer, a smart remote control, a wearable device (such as a smart bracelet, smart watch, or smart glasses), a PDA, or an augmented reality (AR) / virtual reality (VR) device. Alternatively, the mobile phone 200 may be another type of electronic device, such as a portable multimedia player (PMP) or a media player. The embodiments of this application do not impose any restrictions on the specific type of electronic device.

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

[0049] The electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a sensor module 280, cameras 1~N293, and display screens 1~N294, wherein the sensor module 280 may include a touch sensor 280K, a gyroscope sensor 280B, an acceleration sensor 280E, etc.

[0050] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

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

[0052] The controller may be the nerve center and command center of the electronic device 200. 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.

[0053] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.

[0054] In some embodiments, the processor 210 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0055] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may include multiple I2C busses. The processor 210 may be coupled to the touch sensor 280K, charger, flash, camera 193, etc. via different I2C bus interfaces. For example, the processor 210 may be coupled to the touch sensor 280K via the I2C interface, enabling communication between the processor 210 and the touch sensor 280K via the I2C bus interface, thereby implementing the touch function of the electronic device 200.

[0056] The wireless communication function of the electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, 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 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0058] Display screen 294 is used to display images, videos, etc. Display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 200 may include one or N display screens 294, where N is a positive integer greater than one.

[0059] Video codecs are used to compress or decompress digital video. Electronic device 200 may support one or more video codecs. This allows electronic device 200 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0060] The NPU is a neural-network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU enables intelligent cognitive applications in electronic device 200, such as image recognition, face recognition, speech recognition, and text comprehension.

[0061] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0062] The internal memory 221 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by running the instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area can 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 can store data created during the use of the electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 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.

[0063] The touch sensor 280K is also called a "touch panel." The touch sensor 280K can be disposed on the display screen 294. The touch sensor 280K and the display screen 294 form a touch screen, also called a "touch screen." The touch sensor 280K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 294. In other embodiments, the touch sensor 280K can also be disposed on the surface of the electronic device 200, at a location different from that of the display screen 294.

[0064] The gyroscope sensor 280B can be used to determine the motion posture of the electronic device 200. In some embodiments, the angular velocity of the electronic device 200 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 280B. The gyroscope sensor 280B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 280B detects the angle of the electronic device 200 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 200 through reverse movement to achieve anti-shake. The gyroscope sensor 280B can also be used for navigation and somatosensory game scenes.

[0065] Accelerometer 280E can detect the magnitude of acceleration of electronic device 200 in all directions (generally three axes). When electronic device 200 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0066] Figure 3 A schematic diagram of the software system architecture of an electronic device provided in an embodiment of the present application.

[0067] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device.

[0068] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the hardware abstraction layer, and the kernel layer, from top to bottom.

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

[0070] like Figure 3 As shown, the application layer may include: system applications, third-party applications, etc. It should be understood that system applications may include: drawing board, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications, which are not shown one by one in the figure.

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

[0072] like Figure 3 As shown, the application framework layer may include: a stylus interface. The application framework layer may also include: a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc., which are not shown one by one in the figure.

[0073] The stylus interface is used to provide the application in the application layer with information related to the current touch of the stylus, which includes: coordinate position information of the stylus, pressure information of the stylus, and the tilt angle between the stylus and the electronic device.

[0074] The hardware abstraction layer (HAL) is a layer between the application framework layer and the kernel layer. Its purpose is to abstract the hardware. The HAL includes a tilt calculation module. This module is used to read first and second information from the kernel layer and calculate the tilt angle between the stylus and the electronic device based on the first and second information.

[0075] The kernel layer is the layer between hardware and software. It includes Bluetooth drivers, sensor drivers, and other components. The Bluetooth driver connects to other device drivers, enabling Bluetooth communication with them. For example, an electronic device can use the Bluetooth driver to receive the first information from a stylus. The sensor driver reads sensor information collected by sensors and transmits it to the inclination calculation module. For example, the sensor driver can retrieve information collected by the accelerometer and touch sensor.

[0076] The handwriting generation method of the present application is described in detail below with reference to the accompanying drawings.

[0077] Figure 4 This is a flow chart of a method for generating handwriting using a stylus pen. Figure 4 As shown, the specific implementation steps of the handwriting pen handwriting generation method of the present application are as follows.

[0078] Step 401: The electronic device receives first information sent by the stylus through a communication module. The first information includes acceleration information collected by a first acceleration sensor module in the stylus.

[0079] The electronic device and the stylus pen may be provided with a communication module, which may be a Bluetooth module, an infrared transmission module, a Wi-Fi transmission module, etc. The communication module enables communication between the electronic device and the stylus pen. The embodiment of the present application does not limit the communication method, and the communication method may be Bluetooth communication, Wi-Fi communication, infrared communication, etc.

[0080] The accelerometer module can detect changes in an object's orientation in space, particularly in terms of tilt angle. Acceleration information reflects changes in an object's acceleration along three axes (typically the X, Y, and Z axes). This acceleration change data is used to determine the object's orientation in space.

[0081] In this embodiment, after the electronic device and the stylus establish a communication connection, the stylus can send first information to the electronic device in real time to inform the electronic device of the acceleration information currently collected by the first acceleration sensor module in the stylus.

[0082] Step 402: The electronic device determines a first tilt angle between the stylus and the electronic device. The first tilt angle is determined based on first information and second information, where the second information includes acceleration information collected by the second acceleration sensor module, or the second information includes tilt angle information associated with the acceleration information collected by the second acceleration sensor module.

[0083] In this embodiment, the electronic device is also provided with an acceleration sensor module for collecting acceleration information of the electronic device and determining changes in the electronic device in space through the acceleration information.

[0084] The electronic device can also obtain associated inclination information based on the acceleration information collected by the second acceleration sensor module. The inclination information can refer to the inclination information between the electronic device and the reference X-axis, Y-axis and Z-axis. For example, the electronic device can obtain pitch angle information relative to the reference X-axis, roll angle information can be obtained on the Y-axis, and yaw angle information can be obtained on the Z-axis.

[0085] In some embodiments, when the second information is tilt information, the electronic device can also convert the acceleration information in the first information into associated tilt information, and then obtain the first tilt between the stylus and the electronic device based on the tilt information corresponding to the first information and the second information.

[0086] In some embodiments, when the second information is acceleration information, the electronic device can directly calculate the first tilt angle between the stylus and the electronic device based on the first information and the second information. The electronic device can also convert the first information into associated first tilt angle information, and convert the second information into associated second tilt angle information, and then calculate the first tilt angle between the stylus and the electronic device based on the first tilt angle information and the second tilt angle information.

[0087] Step 403: When the contact area between the stylus pen and the electronic device is less than or equal to a first threshold, the electronic device receives a first instruction from the stylus pen.

[0088] In this embodiment, when the tilt angle between the electronic device and the stylus is large, the contact area between the stylus and the electronic device will be less than or equal to the first threshold.

[0089] The first instruction is used to cause the electronic device to perform an operation associated with the handwriting corresponding to the stylus according to the first inclination angle. For example, the first instruction can cause the electronic device to draw the handwriting corresponding to the stylus according to the first inclination angle, or the first instruction can cause the electronic device to perform certain operations by remotely controlling the electronic device without contact with the stylus, such as transferring a file on the electronic device to another electronic device using the stylus. In the embodiments of the present application, there is no limitation on the first instruction.

[0090] Step 404: The electronic device responds to the first instruction and performs an operation associated with the handwriting corresponding to the stylus according to the first tilt angle.

[0091] In this embodiment, the operation associated with the handwriting corresponding to the stylus may include a handwriting operation, a touch operation, etc. For example, when the electronic device responds to a first instruction and performs a handwriting operation corresponding to the stylus according to a first tilt angle, the electronic device may generate handwriting corresponding to the stylus according to the first tilt angle and display it on the display screen of the electronic device. For example, the electronic device responds to the first instruction, obtains the first tilt angle, and performs a touch operation corresponding to the stylus according to the first tilt angle, and the electronic device may respond to the touch operation.

[0092] It will be appreciated that in this embodiment, both the first information and the second information are determined based on the acceleration information collected by the acceleration sensor module. The acceleration information collected by the acceleration sensor module can accurately reflect the tilt of the device, and thus the inclination angle determined by the electronic device using the first and second information is also accurate. Even when the inclination angle between the stylus and the electronic device is large, that is, when the contact area between the stylus and the electronic device is less than or equal to the first threshold, the electronic device can still accurately determine the inclination angle. Furthermore, the electronic device can receive and respond to instructions from the stylus, accurately executing operations associated with the stylus's handwriting based on the first inclination angle.

[0093] In some embodiments, the first inclination angle may range from 0 degrees to 360 degrees.

[0094] It will be appreciated that both the first information and the second information are determined based on the acceleration information collected by the acceleration sensor module, and that the acceleration information can reflect the changes in the orientation of the device in which the acceleration sensor is located in space. Therefore, the first inclination angle obtained by the electronic device based on the first and second information can range from 0 degrees to 360 degrees. That is, regardless of the posture of the electronic device and the stylus, the electronic device can determine the inclination angle between the electronic device and the stylus.

[0095] In some embodiments, when the electronic device is a straight-screen electronic device, the electronic device can detect that the tilt angle between the electronic device and the stylus is in the range of 0 to 360 degrees. In other embodiments, when the electronic device is a foldable screen electronic device, the electronic device can also detect that the tilt angle between the electronic device and the stylus is in the range of 0 to 360 degrees. That is, in the embodiments of the present application, regardless of the type of electronic device, the embodiments of the present application can detect the tilt angle between a certain operating plane on the electronic device and the stylus.

[0096] Taking a straight-screen electronic device as an example, the electronic device may also include a touch screen. When a stylus pen contacts the touch screen, the electronic device may detect the inclination angle between the touch screen and the stylus pen, which may range from 0 degrees to 180 degrees. For example, when the electronic device receives a touch operation on the touch screen from the stylus pen, the electronic device may detect the inclination angle between the stylus pen and the touch screen, which may range from 0 degrees to 180 degrees, and generate handwriting corresponding to the stylus pen based on the inclination angle.

[0097] Taking a straight-screen electronic device as an example, a touch screen is provided on one side of the electronic device, and the stylus is on the side facing away from the touch screen, and the stylus is not in contact with the touch screen, the electronic device can detect an inclination angle range of 180 degrees to 360 degrees, and the electronic device can perform operations associated with the handwriting corresponding to the stylus based on the inclination angle.

[0098] Taking the foldable screen electronic device as an example, when the foldable screen electronic device is an outward-folding foldable screen electronic device, no matter which side of the screen the stylus touches, the electronic device can detect the inclination angle between the stylus and the electronic device, and the inclination angle range is 0 degrees to 360 degrees.

[0099] After the electronic device determines the first tilt angle, the electronic device can perform an operation associated with the handwriting corresponding to the stylus according to the first tilt angle.

[0100] In some embodiments, when the contact area between the stylus and the touch screen is less than or equal to a first threshold, the electronic device receives a first instruction generated by the stylus contacting the touch screen. In response to the first instruction, the electronic device performs a handwriting operation associated with handwriting corresponding to the stylus according to the first tilt angle.

[0101] The following describes in detail how an electronic device performs a handwriting operation using a specific embodiment.

[0102] After the electronic device and the stylus establish a communication connection, the electronic device determines in real time the coordinate position information, pressure information, and inclination information of the stylus's current touch. The coordinate position information is determined by the touch screen. The pressure information and inclination information can be determined by the first information received by the communication module. Specifically, the first information may include not only the acceleration information collected by the first sensor module but also the pressure information of the stylus. The electronic device can determine the inclination information based on the acceleration information collected by the first sensor module and the acceleration information collected by the second sensor module.

[0103] After the electronic device determines the coordinate position information, pressure information, and first tilt angle information of the current touch of the stylus, the electronic device receives and responds to the first instruction from the stylus and performs a handwriting operation based on the first tilt angle. The handwriting operation may refer to the electronic device generating and displaying handwriting based on the movement position and tilt angle of the stylus when the stylus is used to draw on the electronic device. Furthermore, during the handwriting operation, even if the first tilt angle is large, such that the contact area between the stylus and the touch screen is less than or equal to the first threshold, the electronic device can still generate corresponding handwriting based on the first tilt angle.

[0104] In some embodiments, the electronic device may also be combined with 0-gram ink discharge technology, so that when the first inclination angle is relatively large, the electronic device can still generate corresponding handwriting according to the first inclination angle.

[0105] Specifically, when the first tilt angle is large, the stylus tip may tilt due to the pen tip contact structure, and the pen tip may not contact the touch screen. In this case, the stylus cannot obtain the pressure information of the pen tip, making it impossible for the electronic device to generate and display the handwriting corresponding to the stylus at the large tilt angle.

[0106] In this embodiment, the electronic device uses 0g ink discharge technology. Even when the stylus cannot obtain the pressure information of the pen tip at a large tilt angle, the electronic device can generate and display the handwriting corresponding to the stylus through the change in capacitance.

[0107] It can be understood that in this embodiment, when the contact area between the stylus and the touch screen is less than or equal to the first threshold, the electronic device can also perform the handwriting operation associated with the handwriting corresponding to the stylus according to the first inclination angle after receiving the first instruction. That is, the electronic device can perform the handwriting operation even when the first inclination angle is large, so that the electronic device can better simulate the effect of the user writing with a real pen, thereby improving the user experience.

[0108] In other embodiments, when the stylus is not in contact with the electronic device, the electronic device receives a first instruction sent by the stylus via a communication module, where the first instruction is used to remotely control the electronic device to perform a first operation. In response to the first instruction, the electronic device performs a first operation associated with the handwriting corresponding to the stylus based on the first tilt angle.

[0109] It can be understood that in this embodiment, when the stylus and the electronic device are not in contact, the electronic device can receive a first instruction to enable the stylus to perform an operation on the electronic device through the air. This operation allows the user to interact without directly contacting the electronic device, thereby enhancing the user experience.

[0110] In some embodiments, the first operation may be an operation performed on a game interface of the electronic device, the first operation may be an operation to determine the posture of a user holding a stylus, or the first operation may be an operation to determine an action code lock of the electronic device.

[0111] The first operation may be an operation performed on a game interface of the electronic device, which means that the electronic device can use the stylus as an operating stick on the game interface. For example, after the electronic device detects handwriting corresponding to the stylus, the electronic device can operate the game interface according to the handwriting.

[0112] The first operation may also be an operation of determining the posture of the user holding the stylus pen, which means that the electronic device can detect handwriting corresponding to the movement of the stylus pen and determine the posture of the user holding the stylus pen based on the handwriting.

[0113] In some embodiments, after the electronic device determines the posture of the user holding the stylus, the electronic device can determine the handwriting currently written by the user in the air through the user posture, and the electronic device can generate a corresponding character string based on the handwriting.

[0114] After the electronic device determines the posture of the user holding the stylus, the electronic device can also simulate the sound of the user playing a musical instrument according to the posture.

[0115] After the electronic device determines the posture of the user holding the stylus, if the posture is a preset posture, the electronic device can perform a corresponding operation based on the posture. For example, if the electronic device determines that the posture of the user holding the stylus is posture 1, the electronic device can transfer the data in the memory to other electronic devices.

[0116] There is no limitation on the operation of the electronic device after determining the gesture of the user holding the stylus pen.

[0117] The first operation may also be determining the motion code lock of the electronic device, which means that the electronic device can detect dynamic information when the user operates the stylus through the stylus. Since the user's dynamic information is difficult to imitate, the electronic device can use the dynamic information as the motion code lock. The electronic device can determine the currently detected motion code lock and unlock the electronic device if the motion code lock is correct.

[0118] It can be understood that in this embodiment, the electronic device uses the first instruction to enable the electronic device to perform the first operation associated with the handwriting corresponding to the stylus according to the first tilt angle, thereby improving the user experience.

[0119] In some embodiments, the electronic device determines the angle between the stylus' axis and the electronic device's normal direction based on the first information and the second information, and then determines a complementary angle corresponding to the complementary angle and uses the complementary angle as the first inclination angle.

[0120] The axis direction refers to the extension direction of the stylus, and the normal direction refers to the direction perpendicular to the screen of the electronic device or the operating plane.

[0121] During the process of determining the included angle, the electronic device uses the first information and the second information to determine the inclination angle of the stylus relative to the electronic device screen or surface. After determining the included angle, the electronic device further determines the complementary angle and uses this complementary angle as the inclination angle between the electronic device and the stylus. For example, the electronic device can subtract the determined included angle from 90 degrees to obtain the complementary angle.

[0122] It can be understood that in this embodiment, the electronic device accurately detects the angle between the axial direction of the stylus and the normal direction of the electronic device, and uses the corresponding complementary angle as the first inclination angle, thereby accurately identifying the first inclination angle.

[0123] The following is a more detailed description of how to obtain the angle based on the first information and the second information.

[0124] In some embodiments, the electronic device determines a second tilt angle of the stylus in the first direction based on the first information. The electronic device then obtains second information collected by the second acceleration sensor module. The electronic device further determines a third tilt angle of the electronic device in the first direction based on the second information. The electronic device then determines an included angle using the second and third tilt angles.

[0125] Figure 5 This is a schematic diagram of the principle of angle calculation provided in the embodiment of the present application. Figure 5 As shown, the electronic device 200 can establish a reference coordinate system, that is, a spatial coordinate system of the X-axis, Y-axis, and Z-axis. The first direction can be the Z-axis direction, the second inclination angle can be the inclination angle between the axis direction of the stylus 100 and the Z-axis direction, and the third inclination angle can be the inclination angle between the normal direction of the electronic device 200 and the Z-axis direction. Based on the second inclination angle and the third inclination angle, the electronic device 200 then determines the angle between the normal direction of the electronic device 200 and the axis direction of the stylus 100. In the embodiment of the present application, the first direction can also be the X-axis direction or the Y-axis direction, and the first direction is not limited in this application.

[0126] Specifically, the electronic device establishes a reference coordinate system, and the first direction can be Figure 5 The electronic device obtains the acceleration information of the stylus collected by the first acceleration sensor module in the first information, and then converts the acceleration information into the inclination angle between the axis direction of the stylus and the X-axis direction, the Y-axis direction, and the Z-axis direction.

[0127] The following is a specific description using an example in which the electronic device converts acceleration information into a second inclination angle between the axis direction of the stylus and the Z-axis direction.

[0128] The electronic device first converts the stylus's acceleration information on the X-axis into a pitch angle value, the Y-axis acceleration information into a roll angle value, and the Z-axis acceleration information into a yaw angle value. The angle values ​​after the electronic device's conversion can be represented by (f1, g1, p1), where f1 is the pitch angle value, g1 is the roll angle value, and p1 is the yaw angle value. The acceleration values ​​can be represented by (x1, y1, z1), where x1 is the acceleration value on the X-axis, y1 is the acceleration value on the Y-axis, and z1 is the acceleration value on the Z-axis. The formula used by the electronic device to convert (x1, y1, z1) into (f1, g1, p1) can be:

[0129] f1= ;

[0130] g1= ;

[0131] p1= .

[0132] The electronic device then obtains the first space vector of the stylus in the reference coordinate system based on the pitch angle value, the roll angle value, and the yaw angle value. The electronic device then calculates the component of the first space vector in the Z-axis direction to obtain the second space vector. For example, the electronic device can multiply the inverse vector of the first space vector by (0, 0, 1) to obtain the second space vector. Since the electronic device is calculating the component in the Z-axis direction, the value of the Z-axis is 1, the value of the X-axis is 0, and the value of the Y-axis is 0. The expression can be:

[0133] ;

[0134] in, is the first space vector, is the second space vector.

[0135] After obtaining the second space vector, that is, after obtaining the component of the first space vector in the Z-axis direction, the electronic device calculates the second inclination angle between the axis direction of the stylus and the Z-axis direction according to the second space vector.

[0136] Similarly, the electronic device obtains the acceleration information of the electronic device collected by the second acceleration sensor module in the second information. The electronic device first converts the acceleration information of the electronic device on the X-axis into a pitch angle value, and converts the acceleration information of the Y-axis into a roll angle value, and converts the acceleration information of the Z-axis into a yaw angle value. The electronic device then obtains the third space vector of the electronic device in the reference coordinate system based on the pitch angle value, the roll angle value and the yaw angle value, and the electronic device then calculates the component of the third space vector in the Z-axis direction, that is, obtains the fourth space vector. After the electronic device obtains the fourth space vector, that is, after the electronic device obtains the component of the third space vector in the Z-axis direction, the electronic device then obtains the third inclination angle between the normal direction of the electronic device and the Z-axis direction according to the fourth space vector.

[0137] After the electronic device calculates the third and second inclination angles, it can determine the included angle based on the third and second inclination angles. Specifically, the electronic device determines the included angle between the normal direction of the electronic device and the axis direction of the stylus. For example, the electronic device can add the third and second inclination angles to obtain the included angle.

[0138] Alternatively, in other embodiments, after the electronic device obtains the fourth space vector and the second space vector, the electronic device may calculate the dot product between the fourth space vector and the second space vector, as well as the modulus of the fourth space vector and the modulus of the second space vector, and then divide the dot product between the fourth space vector and the second space vector by the modulus of the fourth space vector and the modulus of the second space vector to directly obtain the angle between the normal direction of the electronic device and the axis direction of the stylus. The expression may be:

[0139] ,in, is the angle, is the second space vector, is the fourth space vector.

[0140] It can be understood that in this embodiment, the electronic device can accurately obtain the angle through the second inclination angle and the third inclination angle, so that no matter what posture the electronic device and the stylus are in, the electronic device can accurately calculate the angle between the normal direction of the electronic device and the axial direction of the stylus.

[0141] In some embodiments, the stylus may further include a first gyroscope module. The electronic device receives third information sent by the stylus via the communication module. The third information includes posture information collected by the first gyroscope module in the stylus. The electronic device then corrects the first information based on the third information to obtain corrected fourth information. The electronic device then determines a first tilt angle between the stylus and the electronic device based on the second and fourth information.

[0142] It can be understood that in this embodiment, there may be errors in the process of the acceleration sensor module collecting acceleration information. The electronic device can use the gyroscope information (or posture information) on the stylus to correct the acceleration information collected by the acceleration sensor module to obtain more accurate acceleration information of the stylus. The electronic device can obtain the first inclination angle more accurately through the corrected acceleration information and the second information.

[0143] Among them, the gyroscope module and the acceleration sensor module can be integrated on the same chip, or integrated on different chips respectively, and then the power supply module on the stylus pen supplies power to the chip.

[0144] Next, combine Figure 3 The software architecture in the present invention will be described in more detail on the specific embodiment of the handwriting generation method of the present invention. Figure 6 As shown, Figure 6 A flowchart of another method for generating handwriting using a stylus pen is provided in an embodiment of the present application, and the specific steps are as follows.

[0145] Step 601: a tilt angle calculation module in a hardware abstraction layer of an electronic device reads first information and second information, and calculates a first tilt angle based on the first information and the second information.

[0146] The first information is obtained by receiving information sent by the stylus in real time through the Bluetooth driver in the kernel layer. The second information is acceleration information collected by the second acceleration sensor module and obtained in real time by the sensor driver in the kernel layer.

[0147] Step 602: The electronic device determines the pressure information of the stylus according to the first information received in real time by the Bluetooth driver.

[0148] Step 603: The electronic device obtains information collected by the touch sensor through the sensor driver, and determines the coordinate position information of the current touch of the stylus.

[0149] Step 604: The electronic device responds to the operation of opening the drawing tablet application, and the drawing tablet application calls the stylus interface in the application framework layer to obtain the coordinate position information, the first tilt angle and the pressure information of the current touch of the stylus.

[0150] Step 605: The electronic device generates handwriting corresponding to the stylus according to the information returned by the stylus interface, and displays the handwriting in the interface of the drawing board application.

[0151] In this embodiment, the execution order of the step of the electronic device calculating the first tilt angle, the step of the electronic device determining the coordinate position information, and the step of the electronic device determining the pressure information is not limited and can also be executed simultaneously.

[0152] The following is a detailed description of the handwriting generation method of the present application in conjunction with the timing diagram. Figure 7 As shown, Figure 7 A timing diagram of a handwriting generation method provided in an embodiment of the present application, the specific steps of which are as follows.

[0153] Step 701: The tilt angle calculation module reads the first information and the second information, and calculates the first tilt angle according to the first information and the second information.

[0154] Step 702: The tilt angle calculation module determines the coordinate position information and pressure information of the current touch of the stylus.

[0155] Step 703: In response to the drawing tablet opening operation, the drawing tablet calls the stylus interface to obtain the coordinate position information, the first tilt angle, and the pressure information of the current touch of the stylus.

[0156] Step 704: The stylus interface obtains the coordinate position information, the first tilt angle, and the pressure information of the current touch of the stylus from the tilt angle calculation module.

[0157] Step 705: The stylus interface returns the coordinate position information, the first tilt angle, and the pressure information of the current touch of the stylus to the drawing board.

[0158] Step 706: The drawing board generates corresponding handwriting according to the coordinate position information, the first tilt angle, and the pressure information of the current touch of the stylus returned by the stylus interface.

[0159] It is understood that in the embodiments of the present application, during the data transmission process of the communication module on the electronic device, the transmission protocol can be analyzed to obtain the transmitted data. When it is determined that the data transmitted by the stylus to the electronic device is acceleration information or gyroscope data, it is determined that the solution of the present application is used.

[0160] In summary, through the handwriting generation method of the present application, the electronic device can accurately determine the inclination angle between the electronic device and the stylus through the first information and the second information. Even when the inclination angle is large, the electronic device can perform operations related to the handwriting corresponding to the stylus according to the inclination angle, ensuring the normal operation of the stylus on the electronic device and realizing accurate detection of large inclination angles.

[0161] Some other embodiments of the present application provide an electronic device, which may include: a memory and one or more processors. When the processor executes one or more computer programs stored in the memory, the electronic device performs the functions or steps in the above method embodiments. The structure of the electronic device can refer to Figure 2 and Figure 3 The structure of the electronic device 200 is shown.

[0162] Some other embodiments of the present application provide an electronic device, which may include: a memory and one or more processors, wherein the memory and the one or more processors are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device performs the various functions or steps in the above method embodiments. The structure of the electronic device can refer to Figure 2 and Figure 3 The structure of the electronic device 200 is shown.

[0163] Some other embodiments of the present application provide a chip system, which is applied to an electronic device including a memory and a display screen, and the chip system includes: a processor. When the processor executes computer instructions stored in the memory, the chip system performs the various functions or steps in the above method embodiments. The structure of the electronic device can be referred to Figure 2 and Figure 3 The structure of the electronic device 200 is shown.

[0164] An embodiment of the present application further provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes the various functions or steps executed by the electronic device in the above-mentioned method embodiment.

[0165] An embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the functions or steps executed by the electronic device in the above method embodiment.

[0166] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0167] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0168] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0169] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0170] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0171] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be magnetic media (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid-state drive).

[0172] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0173] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A handwriting pen handwriting generation method, applied to electronic equipment, characterized in that: The electronic device comprises a communication module and a second acceleration sensor module, and the method comprises: Receiving first information sent by the stylus through the communication module, the first information including acceleration information collected by a first acceleration sensor module in the stylus; Determine a first inclination angle between the stylus and the electronic device; the first inclination angle is determined by the first information and the second information, the second information includes the acceleration information collected by the second acceleration sensor module, or the second information includes the inclination angle information associated with the acceleration information collected by the second acceleration sensor module; When the contact area between the stylus pen and the electronic device is less than or equal to a first threshold, receiving a first instruction of the stylus pen; In response to the first instruction, an operation associated with the handwriting corresponding to the stylus is performed according to the first inclination angle.

2. The method according to claim 1, characterized in that The first inclination angle ranges from 0 degrees to 360 degrees.

3. The method according to claim 1 or 2, characterized in that: The electronic device further comprises: a touch screen; Receiving a first instruction from the stylus pen includes: receiving the first instruction generated by the stylus pen contacting the touch screen when the contact area between the stylus pen and the touch screen is less than or equal to a first threshold; In response to the first instruction, performing an operation associated with the handwriting corresponding to the stylus according to the first inclination angle includes: in response to the first instruction, performing a handwriting operation associated with the handwriting corresponding to the stylus according to the first inclination angle.

4. The method according to claim 1 or 2, characterized in that: The method further comprises: Receiving a first instruction from the stylus pen comprises: receiving, through the communication module, the first instruction sent by the stylus pen when the stylus pen is not in contact with the electronic device, wherein the first instruction is used to remotely control the electronic device to perform a first operation; In response to the first instruction, performing an operation associated with the handwriting corresponding to the stylus according to the first inclination angle includes: in response to the first instruction, performing a first operation associated with the handwriting corresponding to the stylus according to the first inclination angle.

5. The method according to claim 4, characterized in that The first operation includes any one of the following: The first operation is an operation performed on a game interface of the electronic device; The first operation is an operation of determining a posture of a user holding the stylus pen; The first operation is an operation of determining an action code lock of the electronic device.

6. The method according to claim 1 or 2, characterized in that: The determining a first inclination angle between the stylus and the electronic device comprises: Determine the angle between the axial direction of the stylus and the normal direction of the electronic device according to the first information and the second information; A complementary angle corresponding to the included angle is determined, and the complementary angle is used as the first inclination angle.

7. The method according to claim 6, characterized in that The step of determining the angle between the axis direction of the stylus pen and the normal direction of the electronic device according to the first information and the second information includes: Determine a second inclination angle of the stylus in the first direction according to the first information; Acquire the second information collected by the second acceleration sensor module; determining, according to the second information, a third inclination angle of the electronic device in the first direction; The included angle is determined by the second inclination angle and the third inclination angle.

8. The method according to claim 1 or 2, characterized in that: The method further comprises: Acquiring third information sent by the stylus through the communication module, wherein the third information includes posture information collected by the first gyroscope module in the stylus; The determining a first inclination angle between the stylus and the electronic device comprises: Correcting the first information according to the third information to obtain corrected fourth information; The first inclination angle between the stylus and the electronic device is determined according to the second information and the fourth information.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; when the processor executes one or more computer programs stored in a memory, the electronic device executes the method according to any one of claims 1 to 8.

10. An electronic device, characterized in that: The electronic device comprises: one or more processors; a memory; wherein the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions so that the electronic device executes the method as described in any one of claims 1-8.

11. A chip system, characterized in that: The chip system is applied to an electronic device including a memory and a display screen; the chip system includes: a processor; when the processor executes computer instructions stored in the memory, the electronic device executes the method as described in any one of claims 1-8.

12. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 8.

13. A computer program product comprising instructions, characterized in that When the computer program product is run on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Automatic variable stroke type handwriting input device

    CN103218065A

  • Information processing method and electronic pen

    CN104345917A

  • Device and method for manipulating user interfaces with a stylus

    CN107667333A

  • Jewelry style code determination method and device, computer equipment and storage medium

    CN114239758A

  • Display supporting photosensing for stylus detection

    CN117762275A