CN115525176B - Data transmission method, touch pen and storage medium - Google Patents

Data transmission method, touch pen and storage medium Download PDF

Info

Publication number
CN115525176B
CN115525176B CN202210348967.3A CN202210348967A CN115525176B CN 115525176 B CN115525176 B CN 115525176B CN 202210348967 A CN202210348967 A CN 202210348967A CN 115525176 B CN115525176 B CN 115525176B
Authority
CN
China
Prior art keywords
pressure sensing
chip
processor
stylus
pressure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210348967.3A
Other languages
Chinese (zh)
Other versions
CN115525176A (en
Inventor
姚轶帆
李毅勃
李凯
靳百萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210348967.3A priority Critical patent/CN115525176B/en
Priority to CN202310877120.9A priority patent/CN116991257A/en
Publication of CN115525176A publication Critical patent/CN115525176A/en
Application granted granted Critical
Publication of CN115525176B publication Critical patent/CN115525176B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/038Control and interface arrangements therefor, e.g. drivers or device-embedded control circuitry
    • G06F3/0383Signal control means within the pointing device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03545Pens or stylus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/038Indexing scheme relating to G06F3/038
    • G06F2203/0384Wireless input, i.e. hardware and software details of wireless interface arrangements for pointing devices
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application provides a data transmission method, a touch pen and a storage medium, wherein the method is applied to the touch pen, the touch pen comprises a code printing chip, a pressure sensing chip, a pressure sensor and a processor, and the method comprises the following steps: the coding chip sends a pressure sensing acquisition request to the pressure sensing chip; the pressure sensing chip acquires pressure sensing data of the pressure sensor based on the pressure sensing acquisition request; the processor acquires the pressure sensing data acquired by the pressure sensing chip; and the processor sends the pressure sensing data to an electronic device. By the data transmission method, the time delay brought by the fact that the code printing chip triggers the interrupt request processor to collect the pressure sensing and report the pressure sensing in the original process and then the processor schedules the pressure sensing chip can be reduced, and the user experience is improved.

Description

Data transmission method, touch pen and storage medium
Technical Field
The present disclosure relates to the field of touch technologies, and in particular, to a data transmission method, a stylus, and a storage medium.
Background
With the development of touch technology, more and more electronic devices perform man-machine interaction in a touch mode, a user can operate a touch screen of the electronic device through a touch pen to input corresponding instructions to the electronic device, and the electronic device executes corresponding operations according to the instructions input by the user.
When the touch pen operates on the screen of the electronic device, the touch pen can send the pressure value detected by the pen point of the touch pen to the electronic device, and the electronic device controls the stroke weight according to the pressure value.
However, time delay exists in the pressure value acquisition and uploading process, so that the real-time performance is poor, and the user experience is affected.
Disclosure of Invention
The embodiment of the application provides a data transmission method, a touch pen and a storage medium, wherein under the condition that the code printing time sequence of the touch pen is consistent with the code printing acquisition time sequence of electronic equipment, a code printing chip of the touch pen triggers an interrupt request pressure sensing chip to acquire pressure sensing data of a pen point and report the pressure sensing data to a processor, and then the processor sends the pressure sensing data to the electronic equipment.
In a first aspect, an embodiment of the present application provides a data transmission method, applied to a stylus, where the stylus includes a coding chip, a pressure sensing chip, a pressure sensor, and a processor, the method includes: the coding chip sends a pressure sensing acquisition request to the pressure sensing chip; the pressure sensing chip collects pressure sensing data of the pressure sensor based on the pressure sensing collection request; the processor acquires pressure sensing data acquired by the pressure sensing chip; and the processor transmits the pressure sensitive data to the electronic device. The code printing chip of the touch pen directly sends the interrupt signal to the pressure sensing chip of the touch pen at preset time, so that the time delay problem caused by task scheduling of the processor of the touch pen can be solved, the processor of the touch pen can read current pressure sensing data from the pressure sensing chip within preset time, and the probability that electromagnetic interference is caused by the fact that the code printing of the touch pen simultaneously transmits the pressure sensing data is reduced, so that the pressure sensing data read by the processor of the touch pen is distorted is reduced.
Further, the code printing chip sending the pressure sensing acquisition request to the pressure sensing chip comprises: after the touch pen receives an uplink signal sent by the electronic equipment, the coding chip sends a downlink signal and sends a pressure sensing acquisition request to the pressure sensing chip at preset time.
Further, the sending of the downlink signal by the coding chip and the sending of the pressure sensing acquisition request to the pressure sensing chip at the preset time include: the coding chip sends downlink signals and sends pressure sensing acquisition requests to the pressure sensing chip after sending the downlink signals for preset times.
Further, the code printing chip sending the pressure sensing acquisition request to the pressure sensing chip comprises: the coding chip interrupts sending the pressure sensing acquisition request to the pressure sensing chip.
Further, the pressure sensing acquisition request is a pressure sensing chip awakening instruction; the process of the pressure sensing chip for collecting the pressure sensing data of the pressure sensor based on the pressure sensing collecting request comprises the following steps: the pressure sensing chip is awakened based on the awakening instruction of the pressure sensing chip and acquires pressure sensing data of the pressure sensor.
Further, the processor acquiring the pressure sensing data acquired by the pressure sensing chip includes: the processor reads the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through a serial interface between the processor and the pressure sensing chip.
Further, before the process that the processor reads the pressure sensing data collected by the pressure sensing chip to the memory of the processor through the serial interface between the processor and the pressure sensing chip, the method further comprises: after the pressure sensing chip acquires the pressure sensing data, a first data reading request is sent to the processor, wherein the first data reading request is an interrupt signal; the processor reads the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through the serial interface between the processor and the pressure sensing chip comprises the following steps: the processor reads the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through a serial interface between the processor and the pressure sensing chip based on the first data reading request.
Further, before the process that the processor reads the pressure sensing data collected by the pressure sensing chip to the memory of the processor through the serial interface between the processor and the pressure sensing chip, the method further comprises: after the pressure sensing chip acquires the pressure sensing data, sequentially sending a second data reading request and the pressure sensing data of the pressure sensor to the processor, wherein the second data reading request is an interrupt signal; the processor reads the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through the serial interface between the processor and the pressure sensing chip comprises the following steps: the processor reads the pressure sensing data of the pressure sensor to the memory of the processor through a serial interface between the processor and the pressure sensing chip based on the second data reading request.
Further, the code printing chip sending the pressure sensing acquisition request to the pressure sensing chip comprises: the coding chip sends a pressure sensing acquisition request to the pressure sensing chip and sends a status message to the processor; the processor obtaining the pressure sensing data collected by the pressure sensing chip comprises the following steps: based on the state information, the processor reads the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through a serial interface between the processor and the pressure sensing chip.
In a second aspect, embodiments of the present application provide a stylus, including: the pressure sensor is used for detecting pressure sensing data of a pen point of the touch control pen; the device comprises a code printing chip, a pressure sensing chip and a processor, wherein the code printing chip is electrically connected with the pressure sensing chip, and the pressure sensing chip is electrically connected with the processor and the pressure sensor; the code printing chip is used for sending a pressure sensing acquisition request to the pressure sensing chip; the pressure sensing chip is used for acquiring pressure sensing data of the pressure sensor based on the pressure sensing acquisition request; the processor is used for acquiring pressure sensing data acquired by the pressure sensing chip; and the processor is used for sending the pressure sensing data to the electronic equipment.
Further, the coding chip is specifically configured to send a downlink signal after the stylus receives an uplink signal sent by the electronic device, and send a pressure sensing acquisition request to the pressure sensing chip at a preset time.
Further, the processor is connected to the pressure sensing chip through the serial interface, and the processor is specifically configured to read pressure sensing data of the pressure sensor acquired by the pressure sensing chip to the memory of the processor through the serial interface.
Further, a set output pin of the coding chip is connected with an interrupt pin of the pressure sensing chip through a signal wire; the coding chip is specifically used for sending a pressure sensing acquisition request to the pressure sensing chip in an interrupted way through the signal line.
In a third aspect, embodiments of the present application further provide a data transmission system, including: the touch pen comprises a touch pen and a plurality of electronic devices, wherein the touch pen is provided in the second aspect. The stylus may send the pressure-sensitive data to the currently operating electronic device via a wireless communication connection (e.g., bluetooth). The electronic device to be controlled can be correspondingly controlled according to the nib pressure sensing data provided by the touch pen, for example, in a scene of drawing on a screen of the electronic device through the touch pen, the electronic device can control the thickness degree of the strokes drawn by the touch pen on the screen of the electronic device according to the pressure sensing data.
In a fourth aspect, embodiments of the present application further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the data transmission method provided in the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the prior art descriptions, it being obvious that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
Fig. 1 is a schematic view of a scenario provided in an embodiment of the present application;
FIG. 2A is a schematic diagram of a sending timing of a touch pen sending a pressure acquisition interrupt signal in the related art;
FIG. 2B is a schematic diagram showing interaction of internal components during pressure sensing acquisition of a stylus according to the related art;
FIG. 2C is a schematic diagram of a related art pressure sensing acquisition process;
fig. 3A is a schematic structural diagram of a stylus according to an embodiment of the present application;
FIG. 3B is a schematic diagram of a partially disassembled structure of a stylus according to one embodiment of the present disclosure;
fig. 4 is a schematic diagram of interaction between a stylus and an electronic device according to an embodiment of the present application;
fig. 5 is a schematic hardware structure of a stylus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a scenario in which an embodiment of the present application is applicable;
FIG. 8 is a schematic diagram of a stylus application flow applicable to one embodiment of the present application;
FIG. 9A is a schematic diagram of a capacitance change of an electronic device screen according to an embodiment of the present application;
FIG. 9B is another schematic diagram of a capacitance change of an electronic device screen according to an embodiment of the present application;
FIG. 10 is a timing diagram of signal synchronization of an electronic device and a stylus according to an embodiment of the present application;
FIG. 11 is a schematic diagram illustrating connection between a touch pen coding chip and a pressure sensing chip according to an embodiment of the present disclosure;
fig. 12A is a schematic diagram illustrating interaction of internal elements during pressure sensing acquisition of a stylus according to an embodiment of the present disclosure;
fig. 12B is a flowchart of a data transmission method according to an embodiment of the present application;
FIG. 13A is a schematic diagram illustrating interaction of internal components during pressure sensing of another stylus according to embodiments of the present application;
fig. 13B is a flowchart of another data transmission method according to an embodiment of the present application;
FIG. 14A is a schematic diagram illustrating interaction of internal components during pressure sensing of a stylus according to an embodiment of the present application
Fig. 14B is a flowchart of still another data transmission method according to an embodiment of the present application;
FIG. 15A is a schematic diagram illustrating interaction of internal components during pressure sensing of a stylus according to an embodiment of the present application
Fig. 15B is a flowchart of still another data transmission method according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Fig. 1 is a schematic view of a scenario suitable for the embodiment of the present application. Referring to fig. 1, a stylus (stylus) 100 and an electronic device 200 are included in the scene. In fig. 1, the electronic device 200 is illustrated as a tablet pc (portable android device, PAD). The stylus 100 may provide input to the electronic device 200, and the electronic device 200 performs an operation responsive to the input based on the input of the stylus 100. In one embodiment, the stylus 100 and the electronic device 200 may be interconnected by a communication network to enable interaction of wireless signals. The communication network may be, but is not limited to: WI-FI hotspot networks, WI-FI peer-to-peer (P2P) networks, bluetooth networks, zigbee networks, or near field communication (near field communication, NFC) networks. The stylus 100 provided in the embodiments of the present application may be an active capacitive stylus, which may be referred to as an active capacitive stylus.
Fig. 2A is a schematic diagram of a transmission timing of a touch pen transmitting a pressure sensing acquisition interrupt signal in the related art, as shown in fig. 2A, in the related art, a code printing chip of the touch pen performs seven times of code printing in each period (for example, one period is 16.67 ms), and a pressure sensing acquisition time slot with a set duration (for example, 3.12 ms) is reserved after the third code printing for the pressure sensing chip of the touch pen to acquire pressure sensing data of a pen point of the touch pen and report the pressure sensing data to an MCU of the touch pen 100.
Fig. 2B is a schematic diagram of interaction of internal elements during pressure sensing collection of a stylus in the related art, and fig. 2C is a schematic diagram of a pressure sensing collection flow in the related art, as shown in fig. 2B and fig. 2C, where step (1) to step (5) correspond to step 201 to step 205, specifically, after the code printing chip of the stylus finishes the code printing for the third time, the code printing chip of the stylus sends an Interrupt (INT) signal to the MCU of the stylus, after receiving the interrupt signal, the MCU of the stylus sends a wake-up instruction to the pressure sensing chip to notify the pressure sensing chip to perform pressure sensing collection, and the MCU of the stylus reads the pressure sensing data collected by the pressure sensing chip into the memory through a serial port between the MCU of the stylus and the pressure sensing chip of the stylus, and then sends the pressure sensing data to the electronic device through bluetooth. That is, in an ideal case, the stylus finishes reporting the pressure sensing data between the third code printing and the fourth code printing.
The touch pen can integrate multiple functions of code printing synchronization, pressure sensing acquisition, charge and discharge, bluetooth communication, gesture detection and the like, so that an embedded real-time operation system needs to be supported for ensuring the real-time performance and reliability of the active capacitance pen. The charging and discharging function is that the stylus controls the charging and discharging drive of the power supply; the gesture detection function is to determine that the touch pen is in a static state or a moving state currently based on detection results of a gyroscope and an acceleration sensor which are arranged in the touch pen; such as information on the angle between the stylus and the horizontal plane; the Bluetooth communication function is that the touch pen establishes a Bluetooth passage with other equipment and performs data interaction through the Bluetooth passage; in addition, the code printing synchronization function and the pressure sensing acquisition function are described in the following embodiments. The embedded operating system is a special operating system and is responsible for the allocation of all software and hardware resources, task scheduling, control and coordination of concurrent activities of the touch control pen. The multi-task scheduling delay of the embedded real-time operating system is affected by a plurality of factors such as task priority, task state, task context switching and the like. The interrupt signal sent to the MCU by the stylus coding chip may be "interrupted" by other high priority interrupts. Therefore, before the MCU of the stylus receives the interrupt signal and sends the wake-up instruction to the pressure sensing chip, because the system may be interrupted by other interrupts or preempted by other processes, the pressure sensing acquisition is delayed (i.e. the pressure sensing data cannot be timely reported to the MCU of the stylus before the next code printing signal is transmitted), if the process of fourth code printing and the process of reporting the pressure sensing data overlap due to the delay, in other words, the process of fourth code printing is performed simultaneously with step S504 shown in fig. 2C, i.e. if the pressure sensing data is transmitted on the serial port and the code printing occurs simultaneously during the transmission process of the pressure sensing data, the code printing signal sent by the stylus during the code printing process can reach 40V, so that the code printing of the stylus can cause electromagnetic interference to the transmission of the pressure sensing data, and the pressure data read out by the MCU of the stylus is distorted under the influence of electromagnetic interference, thereby affecting the authenticity of the pressure sensing data sent by the stylus to the electronic device.
Fig. 3A is a schematic structural diagram of a stylus according to an embodiment of the present application. The stylus 100 may include a nib 10, a barrel 20, and a rear cover 30. The inside of the pen holder 20 is of a hollow structure, the pen point 10 and the rear cover 30 are respectively positioned at two ends of the pen holder 20, the rear cover 30 and the pen holder 20 can be inserted or clamped, and the matching relationship between the pen point 10 and the pen holder 20 is detailed in the description of fig. 3B.
Fig. 3B is a schematic diagram of a partially disassembled structure of a stylus according to an embodiment of the present application. The stylus 100 further includes a spindle assembly 50, the spindle assembly 50 is located in the pen holder 20, and the spindle assembly 50 is slidably disposed in the pen holder 20. Spindle assembly 50 has external threads 51 thereon and nib 10 includes writing end 11 and connecting end 12, wherein connecting end 12 of nib 10 has internal threads (not shown) that mate with external threads 51.
When the spindle assembly 50 is assembled into the barrel 20, the connecting end 12 of the nib 10 extends into the barrel 20 and is threadedly coupled with the external threads 51 of the spindle assembly 50. In some other examples, the connection between the connection end 12 of the pen tip 10 and the spindle assembly 50 may also be achieved by a removable manner, such as a snap fit. The replacement of the nib 10 is achieved by the removable connection between the connecting end 12 of the nib 10 and the spindle assembly 50.
In order to detect the pressure applied to the writing end 11 of the nib 10, a gap 10a is formed between the nib 10 and the barrel 20, so that when the writing end 11 of the nib 10 is applied with an external force, the nib 10 can move towards the barrel 20, and the movement of the nib 10 drives the spindle assembly 50 to move in the barrel 20. And for detecting the external force, a pressure sensing assembly 60 is arranged on the spindle assembly 50, a part of the pressure sensing assembly 60 is fixedly connected with a fixing structure in the pen holder 20, and a part of the pressure sensing assembly 60 is fixedly connected with the spindle assembly 50. Thus, when the spindle assembly 50 moves along with the pen tip 10, since a portion of the pressure sensing assembly 60 is fixedly connected with the fixing structure in the pen holder 20, the movement of the spindle assembly 50 drives the pressure sensing assembly 60 to deform, the deformation of the pressure sensing assembly 60 is transmitted to the circuit board 70 (for example, the pressure sensing assembly 60 and the circuit board 70 can be electrically connected through a wire or a flexible circuit board), and the circuit board 70 detects the pressure of the writing end 11 of the pen tip 10 according to the deformation of the pressure sensing assembly 60, so that the thickness of the line of the writing end 11 is controlled according to the pressure of the writing end 11 of the pen tip 10.
Note that the pressure detection of the pen tip 10 includes, but is not limited to, the above method. For example, the pressure of the pen tip 10 may be detected by a pressure sensor provided in the writing end 11 of the pen tip 10.
In this embodiment, referring to fig. 3B, the stylus pen 100 further includes a plurality of electrodes, which may be, for example, a first transmitting electrode 41, a ground electrode 43, and a second transmitting electrode 42. The first emitter electrode 41, the ground electrode 43, and the second emitter electrode 42 are all electrically connected to the circuit board 70. The first transmitting electrode 41 may be located within the pen tip 10 and close to the writing end 11, and the circuit board 70 may be configured as a control board that may provide signals to the first transmitting electrode 41 and the second transmitting electrode 42, respectively, the first transmitting electrode 41 being configured to transmit a first signal, and a coupling capacitance may be formed between the first transmitting electrode 41 and the touch screen 201 of the electronic device 200 when the first transmitting electrode 41 is close to the touch screen 201 of the electronic device 200, so that the electronic device 200 may receive the first signal. Because the tip of the stylus 100 is provided with electrodes, the touch screen 201 is integrated with an electrode array for touch sensing. When the tip of the stylus 100 is closer to the touch screen 201, insulating substances (such as air and glass on the touch screen) exist between the electrode 140 of the stylus 100 and the electrode array of the touch screen 201, so that coupling capacitance is formed between the electrode 140 of the stylus 100 and the electrode array of the touch screen 201, that is, signals can be transmitted through the coupling capacitance. When the electronic device 200 receives the first signal from the stylus 100, the capacitance value at the corresponding position of the touch screen 201 may change. Accordingly, the electronic device 200 may determine the location of the stylus 100 (or the tip of the stylus 100) on the touch screen 201 based on the change in capacitance value on the touch screen 201. The second transmitting electrode 42 is configured to transmit a second signal, and the electronic device 200 may determine the tilt angle of the stylus 100 according to the received second signal. In this embodiment, the second emitter electrode 42 may be located on the inner wall of the barrel 20. In one example, the second emitter electrode 42 may also be located on the spindle assembly 50.
The ground electrode 43 may be located between the first and second transmitting electrodes 41 and 42, or the ground electrode 43 may be located at the outer circumference of the first and second transmitting electrodes 41 and 42, the ground electrode 43 serving to reduce coupling of the first and second transmitting electrodes 41 and 42 with each other.
When the electronic device 200 receives the first signal from the stylus 100, the capacitance value at the corresponding position of the touch screen 201 may change. Accordingly, the electronic device 200 may determine the location of the stylus 100 (or the tip of the stylus 100) on the touch screen 201 based on the change in capacitance value on the touch screen 201. In addition, the electronic device 200 may acquire the tilt angle of the stylus 100 using a dual-nib projection method in the tilt angle detection algorithm. Wherein the first transmitting electrode 41 and the second transmitting electrode 42 are positioned differently in the stylus 100, so that when the electronic device 200 receives the first signal and the second signal from the stylus 100, the capacitance values at two positions on the touch screen 201 will change. The electronic device 200 may obtain the tilt angle of the stylus 100 according to the distance between the first emitter electrode 41 and the second emitter electrode 42 and the distance between the two positions of the touch screen 201 after the capacitance value is changed, and more detailed obtaining of the tilt angle of the stylus 100 may be described with reference to the related dual-nib projection method in the prior art.
In the embodiment of the present application, referring to fig. 3B, the stylus 100 further includes: and a battery assembly 80, the battery assembly 80 being configured to provide power to the circuit board 70. The battery assembly 80 may include a lithium ion battery, or the battery assembly 80 may include a nickel-chromium battery, an alkaline battery, a nickel-hydrogen battery, or the like. In one embodiment, the battery included in the battery assembly 80 may be a rechargeable battery or a disposable battery, wherein when the battery included in the battery assembly 80 is a rechargeable battery, the stylus 100 may charge the battery in the battery assembly 80 by wireless charging.
Fig. 4 is a schematic diagram of interaction between a stylus and an electronic device according to an embodiment of the present application, and referring to fig. 4, after the electronic device 200 is wirelessly connected to the stylus 100, the electronic device 200 may send an uplink signal to the stylus 100 through an electrode array. The stylus 100 may receive the uplink signal through the receiving electrode, and the stylus 100 transmits the downlink signal through the transmitting electrode (e.g., the first transmitting electrode 41 and the second transmitting electrode 42). The downlink signal comprises the first signal and the second signal, and the downlink signal is the code signal. When the tip 10 of the stylus 100 contacts the touch screen 201, a capacitance value at a corresponding position of the touch screen 201 may change, and the electronic device 200 may determine the position of the tip 10 of the stylus 100 on the touch screen 201 based on the capacitance value on the touch screen 201. In one embodiment, the upstream and downstream signals may be square wave signals.
Fig. 5 is a schematic hardware structure of a stylus according to an embodiment of the present application. Referring to fig. 5, the stylus 100 may have a processor 110. The processor 110 may include storage and processing circuitry for supporting the operation of the stylus 100. The storage and processing circuitry may include storage devices such as non-volatile memory (e.g., flash memory or other electrically programmable read-only memory configured as a solid state drive), volatile memory (e.g., static or dynamic random access memory), and the like. Processing circuitry in the processor 110 may be used to control the operation of the stylus 100. The processing circuitry may be based on one or more microprocessors, microcontrollers, digital signal processors, baseband processors, power management units, audio chips, application specific integrated circuits, and the like.
One or more sensors may be included in the stylus 100. For example, the sensor may include a pressure sensor 120. The pressure sensor 120 may be disposed at the writing end 11 of the stylus 100 (as shown in fig. 3B). Of course, the pressure sensor 120 may also be disposed in the barrel 20 of the stylus 100, such that when one end of the nib 10 of the stylus 100 is stressed, the other end of the nib 10 moves to apply force to the pressure sensor 120. In one embodiment, the processor 110 may adjust the line thickness of the stylus 100 at the point 10 writing according to the amount of pressure detected by the pressure sensor 120.
The stylus 100 may include a pressure sensing chip 130 therein. The pressure sensing chip 130 is connected to the pressure sensor 120 and the processor 110, respectively. The pressure sensing chip 130 may convert the pressure sensing data detected by the pressure sensor 120 from an analog signal to a digital signal and report the digital signal to the processor 110.
In this embodiment, the stylus 100 may include one or more electrodes 140 (specifically, refer to the description in fig. 3B), where one electrode 140 may be located at the writing end of the stylus 100, and where one electrode 140 may be located in the pen tip 10, refer to the related description above.
The stylus 100 may include a coding chip 150 therein. The code chip 150 is connected to the electrode 140 and the processor 110, respectively. The code-printing chip 150 may transmit a downlink signal using a transmitting electrode in the electrodes 140 or receive an uplink signal transmitted by the touch screen 201 of the electronic device 200 using a receiving electrode in the electrodes 140. The transmitting electrode may also be considered as a coding antenna during the time that the transmitting electrode transmits the downlink signal.
The processor 110 may be used to run software on the stylus 100 that controls the operation of the stylus 100. During operation of the stylus 100, software running on the processor 110 may process sensor inputs, button inputs, and inputs from other devices to monitor movement of the stylus 100 and other user inputs. Software running on the processor 110 may detect user commands and may communicate with the electronic device 200.
To support wireless communication of the stylus 100 with the electronic device 200, the stylus 100 may include a wireless module. In fig. 8, a wireless module is illustrated as a bluetooth module 160. The wireless module may also be a WI-FI hotspot module, a WI-FI point-to-point module, or the like. Bluetooth module 160 may include a radio frequency transceiver, such as a transceiver. Bluetooth module 160 may also include one or more antennas. The transceiver may transmit and/or receive wireless signals using an antenna, which may be based on the type of wireless module, bluetooth signals, wireless local area network signals, remote signals such as cellular telephone signals, near field communication signals, or other wireless signals.
It should be understood that the electronic device 200 in the embodiment of the present application may be referred to as a User Equipment (UE), a terminal (terminal), or the like, and for example, the electronic device 200 may be a tablet (portable android device, PAD), a personal digital assistant (personal digital assistant, PDA), a handheld device with a wireless communication function, a computing device, an in-vehicle device, or a wearable device, a Virtual Reality (VR) electronic device, an augmented reality (augmented reality, AR) electronic device, a wireless terminal in industrial control (industrial control), a wireless terminal in self-driving (self-driving), a wireless terminal in remote medical (remote medical), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation security (transportation safety), a mobile terminal or a fixed terminal with a touch screen, such as a wireless terminal in smart city (smart home), or the like. The form of the electronic device in the embodiment of the present application is not particularly limited.
Fig. 6 is a schematic structural diagram of an electronic device 200 according to an embodiment of the present application. Referring to fig. 6, the electronic device 200 may include multiple subsystems that cooperate to perform, coordinate, or monitor one or more operations or functions of the electronic device 200. Electronic device 200 includes processor 210, input surface 220, coordination engine 230, wireless interface 240, and display 250.
The coordination engine 230 utilizes the sensor layer to locate the stylus 100 on the input surface 220 and uses the techniques described herein to estimate the angular position of the stylus 100 relative to the plane of the input surface 220. In one embodiment, the input surface 220 may be referred to as a touch screen 201.
The electronic device 200 also includes a wireless interface 240 to facilitate electronic communications between the electronic device 200 and the stylus 100. In one embodiment, the electronic device 200 may be configured to communicate with the stylus 100 via a low energy bluetooth communication interface or a near field communication interface. In other examples, the communication interface facilitates electronic communications between the electronic device 200 and an external communication network, device, or platform.
The display 250 may be located behind the input surface 220 or may be integral therewith, in many cases, the user manipulating the stylus 100 to interact with the interface.
It will be apparent to one skilled in the art that some of the specific details presented above with respect to the electronic device 200 may not be required to practice a particular described embodiment or equivalent thereof. Similarly, other electronic devices may include a greater number of subsystems, modules, components, etc. Some of the sub-modules may be implemented as software or hardware, where appropriate. It should be understood, therefore, that the foregoing description is not intended to be exhaustive or to limit the disclosure to the precise form described herein. On the contrary, many modifications and variations will be apparent to those of ordinary skill in the art in light of the above teachings.
Based on the structures shown in fig. 5 and 6, the following describes a procedure of interaction between the electronic device and the stylus with reference to fig. 7 and 8. Fig. 7 is a schematic view of a scenario to which an embodiment of the present application is applicable, fig. 8 is a schematic view of a stylus application flow to which an embodiment of the present application is applicable, and in conjunction with fig. 7 and fig. 8, a stylus 100 and an electronic device 200 may be included in the usage scenario, where the stylus 100 is illustrated by taking an active capacitive pen as an example, and the electronic device is illustrated by taking a tablet computer as an example. For example, when the stylus 100 and the electronic device 200 establish a bluetooth connection, that is, a communication channel between the stylus 100 and the electronic device 200 is established through bluetooth, an electrode array of the screen of the electronic device 200 periodically transmits an uplink signal; when the pen tip of the stylus 100 approaches the screen of the electronic device 200, the stylus 100 collects an uplink signal from the electronic device 200, that is, completes synchronization according to the uplink signal; after the stylus 100 collects the uplink signal each time, the downlink signal and the nib pressure sensing data are sent through the electrode, namely the stylus 100 periodically sends the nib pressure sensing data; when the pen tip of the stylus 100 is far away from the screen of the electronic device 200, the stylus 100 cannot collect the uplink signal through the electrode any more, so that synchronization is finished, and the stylus 100 does not send the downlink signal and the pen tip pressure sensing data any more.
The bluetooth connection may be a classical bluetooth connection or a bluetooth low energy (Bluetooth Low Energy, BLE) connection. In one embodiment, a Bluetooth address for uniquely identifying the stylus 100 may be stored in a corresponding memory of the electronic device 200. In addition, the memory of the electronic device 200 may also store connection data of the stylus 100 that was successfully paired with the electronic device 200 before. For example, the connection data may be a bluetooth address of the stylus 100 successfully paired with the electronic device 200. Based on the connection data, the electronic device can be automatically paired with the stylus without having to configure a connection therebetween, such as for validity verification or the like. The bluetooth address may be a medium access control (media access control, MAC) address. The electronic device 200 needs to acquire the bluetooth address of the stylus 100 through a pairing process with the stylus 100. For example, the user may actively control the pairing between the stylus 100 and the electronic device 200, so that the stylus 100 transmits a broadcast, where the broadcast may carry a bluetooth address and a device name of the stylus 100, and after the electronic device 200 searches for the broadcast transmitted by the stylus 100, the device name option of the stylus 100 is displayed, and after the user clicks on the device name option corresponding to the stylus 100 on the screen of the electronic device 200, the electronic device 200 receives a determination operation based on the device name option of the stylus 100, that is, bluetooth pairing with the stylus 100 may be performed. However, this pairing method requires a user to perform a determination operation, which is cumbersome, so the electronic device 200 may also obtain the bluetooth address of the stylus 100 through other communication methods to achieve pairing. For example, the electronic device 200 is already paired with a bluetooth keyboard and in a connected state; the stylus 100 can be adsorbed in the containing part of the Bluetooth keyboard when not in use, the stylus 100 sends the Bluetooth address of the stylus 100 to the Bluetooth keyboard through the coil, and the stylus 100 sends a broadcast at the same time; the bluetooth keyboard transmits the bluetooth address of the stylus 100 to the electronic device 200 via a proprietary bluetooth data channel. Then, the application of the private channel information is processed by the electronic equipment 200, and after the Bluetooth address of the touch control pen 100 is received, the application of the pairing processing in the electronic equipment 200 is reported; then the application triggers the flick frame on the interface to connect the user or directly initiates the connection to the stylus 100, thereby completing the pairing between the stylus 100 and the electronic device 200. Thus, the user does not need a complicated pairing confirmation process, only needs to put the stylus 100 into the accommodating part of the bluetooth keyboard, and can realize the pairing between the stylus 100 and the electronic device 200 without sense, after that, when the user needs to use the stylus 100, the user only needs to take out the stylus 100 from the accommodating part of the bluetooth keyboard, the stylus 100 can establish bluetooth connection with the electronic device 200, and the user can directly use the stylus 100 to perform touch operation on the screen of the electronic device 200.
Fig. 9A is a schematic diagram of a change in capacitance value of a touch screen. When the electronic device 200 receives the first signal from the first transmitting electrode 41 of the stylus 100, the capacitance value of the electrode array of the touch screen at the corresponding position may change. Referring to fig. 9A, the electronic device 200 may determine the position of the tip of the stylus 100 based on the change in the capacitance value on the touch screen, where the peak of the capacitance value in fig. 9A represents the change in the capacitance value at the corresponding position of the touch screen. In addition, the electronic equipment can acquire the included angle by adopting a double-nib projection method in the inclination angle detection algorithm. Referring to fig. 9B, the first and second emitter electrodes 41 and 42 in the stylus 100 may be disposed at a tip of the stylus, the first emitter electrode 41 being disposed near a tip of the tip, and the second emitter electrode 42 being distant from the tip of the tip with respect to the first emitter electrode 41. When the electronic device 200 receives the first signal and the second signal from the stylus 100, the capacitance values of two positions (such as position B and position C) of the touch screen of the electronic device 200 will change, and the electronic device 200 may obtain the included angle based on the distance between the first electrode and the second electrode and the distance between the two positions of the touch screen, and a more specific dual-nib projection method may refer to a specific description of the related art. Fig. 9A illustrates the positions where the stylus touches the touch screen with black dots, and fig. 9B illustrates positions B and C with black dots.
In one embodiment, since the electronic device 200 and the stylus 100 are two independent systems, the stylus 100 does not know when the electronic device 200 will perform the downstream signal acquisition, and thus the electronic device 200 may periodically send the upstream signal (synchronization signal) through the electrode array. So that after the stylus 100 receives the uplink signal, the downlink signal is sent at the agreed time sequence based on the uplink signal, that is, the time sequence synchronization between the electronic device 200 and the stylus 100 is realized, so that the electronic device 200 can collect the downlink signal from the stylus 100 in the collection period of the downlink signal, and further, the touch interaction is realized. For example, when the electronic device 200 is successfully connected to the stylus 100 through bluetooth, the electronic device 200 periodically transmits an uplink signal, and at this time, when the stylus 100 is close to the electronic device 200, the receiving electrode of the stylus 100 may receive the uplink signal (synchronization signal) transmitted from the electronic device 200, and the stylus 100 controls the electrode 140 to transmit a downlink signal (including the first signal) based on the uplink signal, and when the stylus 100 does not receive the uplink signal, it indicates that the stylus 100 is far from the electronic device 200, and no touch operation is performed, and thus no downlink signal is transmitted, so as to reduce power consumption. For example, if the user puts the stylus 100 beside the electronic device 200, the stylus 100 does not perform a touch operation on the screen of the electronic device 200, and the stylus 100 cannot receive an uplink signal transmitted from the electronic device 200 because the stylus 100 is far from the electronic device 200, so that the stylus 100 does not transmit a downlink signal to reduce power consumption. However, at this time, if the user picks up the stylus 100 to start the touch operation on the electronic device 200, the sending of the downlink signal is triggered only when the stylus 100 approaches the electronic device 200 to a certain extent and receives the uplink signal from the electronic device 200, so as to implement the touch function with the electronic device 200, which may cause touch delay. Therefore, in other possible embodiments, the electronic device 200 may also send an uplink signal to the stylus 100 through a bluetooth connection, so that when the stylus 100 is far away from the electronic device 200 (the stylus 100 cannot receive a signal sent by the electronic device 200 through the electrode array at a far distance), the stylus 100 may also receive the uplink signal through the bluetooth connection, so as to trigger sending a downlink signal, which may reduce the touch delay. For example, even if the user puts the stylus 100 beside the electronic device, the electronic device 200 may send an uplink signal to the stylus 100 through a bluetooth connection, and the stylus 100 may send a downlink signal based on the received uplink signal, when the user picks up the stylus 100 to start a touch operation on the electronic device 200, as long as the stylus 100 approaches to a certain extent to the electronic device 200, the electronic device 200 may receive the downlink signal from the stylus 100 to implement a touch interaction function, so that the response of the electronic device 200 to the touch interaction operation based on the stylus 100 is more timely, and the touch delay is reduced. In other embodiments, the electronic device 200 may also send the uplink signal to the stylus 100 through other wireless transmission methods, and is not limited to sending through bluetooth. In the following embodiments, only the electronic device 200 will be described by taking an example of transmitting an uplink signal through the electrode array.
Fig. 10 is a signal synchronization timing chart of the electronic device and the stylus according to the embodiment of the present application, as shown in fig. 10, in one possible implementation, the screen refresh rate of the electronic device 200 is 60Hz, and the screen refresh rate refers to the number of times of refreshing the screen displayed by the electronic device 200 per second. The screen refresh rate may also be referred to as a display frequency or a display frame rate. The screen refresh rate may be 60Hz, 90Hz, or 120Hz. Illustratively, when the electronic device 200 establishes a wireless connection, such as a Bluetooth connection, with the stylus 100. The electronic device 200 periodically transmits an upstream signal. When the stylus 100 collects the uplink signal from the electronic device 200, the coding chip of the stylus 100 can perform coding multiple times in one period of the uplink signal, so as to display the touch position of the user. The period may be a period of screen refresh, for example 16.67ms. For example, the coding chip of the stylus 100 may code 7 times in one period, i.e. send 7 downlink signals to the electronic device 200.
Specifically, for example, the refresh rate of the electronic device 200 is 60Hz, which means that the screen of the electronic device 200 is refreshed 60 times per second, that is, the screen is refreshed once every 16.67ms (1000 ms/60), and the time for refreshing the screen once is one frame, that is, one frame is 16.67ms. The refreshing process of the picture is a process of writing data voltages into pixels in a screen, and after each time the data voltages are received, the corresponding gray scale is displayed on the basis of the latest received data voltage for one pixel in the screen until the updated data voltages are received next time, and the pixels which are arranged in an array form the whole screen picture by luminous display. The writing process of the data voltage is generally realized through a progressive scanning process, and the screen refreshing is completed by progressively scanning the data voltage from the first row of pixels to the last row of pixels. Because the electrode array for implementing the touch function and the screen for implementing the display function in the electronic device 200 are integrally disposed, the process of writing data and the process of collecting signals through the electrode array are required to be performed in different time periods, so as to improve the adverse effect of the touch related signals on writing of data voltages. To coordinate the display of the electronic device 200, the electronic device 200 may send an upstream signal according to a screen refresh rate. For example, the screen refresh rate of the electronic device 200 is 60Hz, and the screen has m rows of pixels. In each frame time (16.67 ms), the electronic device 200 firstly transmits an uplink signal through the electrode array, starts a first pixel scan after transmitting the uplink signal, the first pixel scan is a 1 st to n1 st pixel scan, i.e. writing data voltages into the 1 st to n1 st pixel lines row by row, the duration of the 1 st to n1 st pixel scan is a, then the electronic device 200 performs a first downlink signal acquisition through the electrode array, the acquisition duration is b, for example, a+b=2.08 ms, then performs a second pixel scan, i.e. a n1+1 to n2 th pixel scan, the acquisition duration is a, then the electronic device 200 performs a second downlink signal acquisition through the electrode array, the acquisition duration is b, then performs a third pixel scan, i.e. n2+1 to n3 th pixel scan, the scanning duration is a, then the electronic device 200 performs a third downlink signal acquisition through the electrode array, the acquisition duration is b, then performs a fourth pixel scan, i.e. n3+1 to n4 th pixel scan is a+3, the duration is a+b=3, and the fourth downlink signal acquisition is a, the fourth downlink signal acquisition is performed through the electrode array, the electronic device is a screen is a, the time duration of a is a shared line after each time is a, and the fourth downlink signal acquisition is performed, the fourth line is a line, the signal acquisition is a shared by the electrode is a line, and the fourth line is a line, and the signal is a shared by the line, and the line is a line after the fourth line is a shared. The above 16.67ms is a frame time, and in one frame time, the electronic device 200 performs pixel scanning and downlink signal acquisition in a time-sharing manner, so as to reduce the probability of interference between the two. After one frame ends, the electronic device 200 transmits an uplink signal, performs pixel scanning, and downlink signal acquisition in the same manner in each frame, that is, one frame time is a period of transmitting the uplink signal.
For the stylus 100, the receiving electrode can continuously collect the uplink signal, when the receiving electrode collects the uplink signal from the electronic device 200, on one hand, the stylus 100 is closer to the screen of the electronic device 200 and needs to send the downlink signal so as to interact with the electronic device 200 to realize the touch function, on the other hand, since the electronic device 200 only collects the downlink signal in a specific period, the stylus 100 can realize synchronization with the electronic device 200 according to the time when the uplink signal is collected so as to send the downlink signal in a corresponding period, and the electronic device 200 can collect the downlink signal. For example, when the stylus pen 100 collects the uplink signal from the electronic device 200 through the receiving electrode, the first sending of the downlink signal is performed after the time point of receiving the uplink signal passes through the time a, and the sending of the downlink signal includes sending the first signal through the first sending electrode and sending the second signal through the second sending electrode, where the time length of the first sending of the downlink signal is b, so that it is ensured that the electronic device 200 can collect the downlink signal from the stylus pen 100 when the first downlink signal collection is performed, and the probability that the stylus pen 100 sends the downlink signal in the process of performing the pixel scanning by the electronic device 200 can be reduced, so as to improve the adverse effect of the downlink signal on the data writing process of the pixels in the electronic device 200 due to capacitive coupling. Similarly, after the first downlink signal is sent, the stylus pen 100 performs the second downlink signal sending at intervals a, where the second downlink signal sending time is b, then performs the third downlink signal sending at intervals a, where the sending time is b, then performs the fourth downlink signal sending at intervals a+b+a=3.12 ms, where the sending time is b, then sequentially performs the fourth to seventh downlink signal sending at intervals a, where each sending time is b, and where the interval between any two downlink signals is a. Even if the stylus pen 100 uses the time of the collected uplink signal as the reference time, based on the reference time, seven processes of transmitting the downlink signal are performed according to the agreed time sequence, so that each time the downlink signal is transmitted corresponds to the period in which the electronic device 200 collects the downlink signal. Then, if the user still uses the stylus pen 100 to perform a touch operation on the electronic device 200, the stylus pen 100 still collects a new uplink signal from the electronic device 200 through the receiving electrode, and the stylus pen 100 still performs a process of transmitting a downlink signal according to a agreed time sequence according to the time when the uplink signal is collected as a reference. That is, each time the stylus pen 100 collects an uplink signal from the electronic device 200, seven processes of transmitting a downlink signal are performed according to the agreed time sequence. If a user continues a touch operation on the electronic device 200 using the stylus 100, the stylus 100 can achieve timing synchronization with the electronic device 200 and a touch interaction function with the electronic device 200 in the above manner. If the user stops using the stylus 100 and lifts the stylus 100 from the screen surface of the electronic device 200, that is, the stylus 100 is far away from the electronic device 200, on one hand, the stylus 100 cannot collect the uplink signal from the electronic device 200, so that after the last seven rounds of downlink signal transmission are completed, the downlink signal is not continuously transmitted; on the other hand, the electronic device 200 cannot collect the downlink signal from the stylus 100.
It should be noted that the above synchronization process between the stylus pen 100 and the electronic device 200 is merely illustrative in an ideal case, and in the actual synchronization process, the transmission delay and the processing delay of the uplink signal may also need to be considered, so as to set the period of sending the downlink signal. In addition, the electronic device 200 performs seven downlink signal acquisitions within one frame time only as an example, and may be specifically set as required, where the more times of acquiring the downlink signal within one frame time, the higher the touch sampling rate. The higher the touch sampling rate is, the higher the touch sensitivity is, for example, when a user writes by using the touch pen 100, the higher touch sampling rate can bring better hand following effect to the user, and strokes on the screen of the electronic device 200 can reflect the writing action of the user more timely; however, since the process of touch sampling and the process of pixel scanning need to be performed in a time-sharing manner, increasing the touch sampling rate compresses the time of pixel scanning, and thus the number of times the electronic device 200 performs downlink signal acquisition in one frame time needs to be set according to the time required for pixel scanning and the requirement for the screen refresh rate in combination with the requirement for the touch sampling rate. In addition, in the above-mentioned synchronization process, in one period of the uplink signal, the interval between any two adjacent downlink signal acquisitions except for the interval between the third downlink signal acquisition and the fourth downlink signal acquisition is a+b+a may be a, and the interval between the third downlink signal acquisition and the fourth downlink signal acquisition is reserved for the time of acquiring the pressure-sensitive data by the stylus pen 100, and the process of acquiring the pressure-sensitive data will be described in detail in the following. In other possible embodiments, the interval between the transmission of the uplink signal and the first acquisition of the downlink signal may be other than a.
The above embodiment is described by taking the screen refresh rate of the electronic device 200 as 60Hz as an example, and in other possible implementations, the screen refresh rate of the electronic device 200 is, for example, 90Hz, and at this time, the screen of the electronic device 200 refreshes the screen every 11.11ms, so that in accordance with the screen refresh rate of the electronic device 200, the electronic device 200 sends the uplink signal every 11.11 ms. At different screen refresh rates, the electronic device 200 may collect downlink signals at different times per frame time, the duration b of the downlink signal may be different, and the interval between the two downlink signal collection may be different, which represents the touch signal collection timing. In one possible implementation, the electronic device 200 may dynamically switch the screen refresh rate, for example, to a higher screen refresh rate of 90Hz in a game scenario to ensure game flow, and to a lower screen refresh rate of 60Hz in a non-game scenario to reduce power consumption. In this case, there are corresponding downstream signal acquisition timings for different screen refresh rates. For the electronic device 200, at different screen refresh rates, the transmission timing of the uplink signal needs to be adjusted according to the refresh rate, for example, when the screen refresh rate of the electronic device 200 is switched from 60Hz to 90Hz, the electronic device 200 changes the original uplink signal transmitted every 16.67ms to the uplink signal transmitted every 11.11ms, and correspondingly changes the downlink signal acquisition timing; for the stylus 100, since the screen refresh rate of the electronic device 200 is changed to change the downlink signal acquisition timing, it is necessary to know the current screen refresh rate of the electronic device 200 to adaptively switch the downlink signal transmission timing. For example, the electronic device 200 may send a message to notify the stylus 100 through the bluetooth connection when the screen refresh rate is switched, so that the stylus 100 may know the current screen refresh rate of the electronic device 200, and then, when the uplink signal is collected each time, may send the downlink signal based on the corresponding downlink signal sending timing according to the current screen refresh rate of the electronic device 200, so that the electronic device 200 may collect the downlink signal synchronously; for another example, since the transmission period of the uplink signal is also changed after the screen refresh rate of the electronic device 200 is switched, the stylus pen 100 may determine the screen refresh rate of the electronic device 200 according to the time interval between the uplink signals collected two adjacent times, if the time interval between the uplink signals collected two adjacent times is 16.67ms, determine the current screen refresh rate of the electronic device 200 to be 60Hz, if the time interval between the uplink signals collected two adjacent times is 11.11ms, determine the current screen refresh rate of the electronic device 200 to be 90Hz, and transmit the downlink signal according to the determined screen refresh rate by adopting the corresponding time sequence, that is, the electronic device 200 can synchronously collect the downlink signal.
In some embodiments, in order to solve the problem that the sending of the downlink signal and the reading of the pressure sensing data through the serial port are performed simultaneously, the read pressure sensing data is distorted due to electromagnetic interference, referring to fig. 10, after the stylus 100 sends the 3 rd downlink signal within 16.67ms of the period of the uplink signal, a set duration is reserved as a pressure sensing acquisition time slot for the pressure sensing chip of the stylus 100 to perform pressure sensing acquisition, and the processor of the stylus 100 reads the pressure sensing data acquired by the pressure sensing chip through the serial port.
In one possible implementation, the reserved set duration may be set according to needs, for example, the set duration is a sum of a duration between two adjacent downlink signals sent by the two-section stylus 100 and a duration occupied by one downlink signal, that is, the reserved set duration may be a+b+a. For example, when the refresh rate of the electronic device 200 is 60Hz and the stylus pen 100 collects the uplink signal, the stylus pen 100 may send 8 downlink signals (i.e. perform 8 coding) within 16.67ms, so as to reduce the probability of distortion of the pressure sensing data read by the processor due to the electromagnetic interference, after sending 3 downlink signals, the stylus pen 100 does not immediately send the 4 th downlink signal (i.e. actually sends 7 downlink signals within 16.67ms of a period of one uplink signal), but reserves a set time period as a pressure sensing collection time slot for the pressure sensing chip of the stylus pen 100 to perform pressure sensing collection, and the processor of the stylus pen 100 reads the pressure sensing data collected by the pressure sensing chip through the serial port, and sends the 4 th downlink signal after sending the 3 rd downlink signal and setting the time interval. The reserved set time period may be 3.12ms, and the processor of the stylus 100 needs to read the pressure-sensitive data collected by the pressure-sensitive chip through the serial port within the reserved set time (3.12 ms) so as to reduce the probability that the process of reading the pressure-sensitive data through the serial port overlaps with the process of sending the fourth downlink signal, thereby generating distortion of the pressure-sensitive data read by the processor caused by electromagnetic interference. The specific implementation process of the pressure sensing chip of the stylus 100 for pressure sensing collection and the processor of the stylus 100 for reading the pressure sensing data collected by the pressure sensing chip through the serial port is described in detail in the following.
The embodiment of the application provides a data transmission method, which is applied to a stylus 100, wherein the stylus 100 is connected with an electronic device 200 through bluetooth, and after the stylus 100 collects an uplink signal sent by the electronic device 200, a coding chip of the stylus 100 sends a downlink signal and sends a pressure sensing collection request to a pressure sensing chip of the stylus 100 at a preset time. The pressure sensing chip of the stylus 100 may be awakened by the pressure sensing acquisition request to acquire pressure sensing data of the pressure sensor of the stylus 100 and provide the pressure sensing data to the processor of the stylus 100. By the method, the problem of time delay caused by task scheduling of the processor of the touch pen 100 can be solved, so that the processor of the touch pen 100 can read current pressure-sensitive data from the pressure-sensitive chip within a reserved set time, and the probability of electromagnetic interference caused by coding of the touch pen 100 and transmission of the pressure-sensitive data at the same time is reduced, so that the pressure-sensitive data read by the processor of the touch pen 100 is distorted.
In order to realize that the code-printing chip of the stylus may send an interrupt signal to the pressure-sensing chip of the stylus, referring to fig. 11, the code-printing chip of the stylus is connected to the pressure-sensing chip based on the structure of the stylus 100 shown in fig. 5. The code printing chip is provided with a setting output pin P1 for sending a pressure sensing acquisition request, and the code printing chip is used for sending a request through the setting output pin P1 to trigger the acquisition of pressure sensing data. The pressure sensing chip is provided with an interrupt pin P2 and is used for triggering and collecting pressure sensing data based on signals acquired by the interrupt pin P2. The set output pin P1 of the coding chip is connected with the interrupt pin P2 of the pressure sensing chip, so that the coding chip sends a pressure sensing acquisition request to the pressure sensing chip through communication connection between the pins to trigger acquisition of pressure sensing data, and the specific triggering process is described in detail in the following.
Fig. 12A is a schematic diagram showing interaction between internal elements during pressure sensing collection of a stylus according to an embodiment of the present application, and fig. 12B is a flow chart of a data transmission method according to an embodiment of the present application, and, with reference to fig. 12A and fig. 12B, the stylus 100 may perform pressure sensing data collection and transmission response based on corresponding signals in a pressure sensing collection time slot during downlink signal transmission, that is, send pressure sensing data to an electronic device by using the data transmission method according to an embodiment of the present application. The data transmission method provided in the embodiment of the present application may be applied to a stylus with the structure shown in fig. 5 and 11, where the stylus includes a processor 110, a pressure sensing chip 130 and a coding chip 150, and a set output pin P1 of the coding chip is connected to an interrupt pin P2 of the pressure sensing chip, and the data transmission method is described below with reference to fig. 12A and 12B based on the structure shown in fig. 5 and 11, where the data transmission method includes:
step 1101: the coding chip 150 of the stylus 100 sends a pressure sensing acquisition request to the pressure sensing chip 130 of the stylus 100 in an interrupt manner.
The pressure sensing collection request may be regarded as a wake-up instruction, and has a wake-up function, that is, the pressure sensing chip 130 of the stylus 100 is woken up when receiving the pressure sensing collection request sent by the code printing chip 150 of the stylus 100, and then the pressure sensing chip 130 of the stylus 100 is woken up to execute the pressure sensing collection task.
The pressure sensing collection request is an interrupt signal, where the interrupt signal is intended to request the pressure sensing chip 130 to perform interrupt processing based on the request of the code printing chip 150, and the pressure sensing chip 130 performs a pressure sensing collection task in response to the interrupt signal of the code printing chip 150, and the pressure sensing collection task includes, for example, the pressure sensing chip 130 collecting current pressure sensing data of the pen tip detected by the pressure sensor 120 of the stylus 100.
The interrupt is specifically that when an event of a certain emergency or abnormality occurs during the execution of the program by the processor, the executing program is paused, the event is processed, the program which has just been paused is continuously executed at the breakpoint after the event is processed, and the flow of interrupt processing includes:
(1) Sending a terminal request: the interrupt source transmits an interrupt request signal (hereinafter referred to as interrupt signal) to the processor.
(2) Interrupt response: the processor enters an interrupt response stage according to an interrupt signal sent by the interrupt source, and sends an interrupt response signal to the interrupt source.
(3) Breakpoint protection: the processor saves the breakpoint protection scene.
(4) Executing an interrupt service routine: the processor executes the program corresponding to the interrupt signal.
(5) Interrupt return: the processor resume breakpoint returns to the interrupted main program.
When the above interrupt processing procedure is suitable for the embodiment of the present application, after the pressure sensing chip 130 of the stylus 100 receives the interrupt signal sent by the code printing chip 150 of the stylus 100, the pressure sensing chip 130 pauses the execution of the main program currently being executed, and shifts to the execution of the program corresponding to the interrupt signal, and after the execution of the program corresponding to the interrupt signal is completed, the pressure sensing chip 130 returns to continue to execute the main program that was originally interrupted. For example, the pressure sensing chip 130 of the stylus 100 is executing the program a, and after the pressure sensing chip 130 of the stylus 100 receives the interrupt signal sent by the code printing chip 150, the execution of the program a is paused, and the program corresponding to the interrupt signal is executed, that is, the pressure sensing chip 130 of the stylus 100 acquires the pressure sensing data of the pen point, and the pressure sensing data of the pen point is reported to the processor 110 of the stylus 100 after the pressure sensing chip 130 acquires the pressure sensing data of the pen point. So that the processor of the stylus 100 can read the pressure sensing data of the pen tip into its own memory, wherein the specific acquisition mode is described in detail in the following.
In one embodiment, the trigger timing in step S1101 may be when the encoding chip 150 has sent the downlink signal for a preset number of times. For example, when the stylus pen 100 collects the uplink signal, the code printing chip 150 is controlled to send the downlink signal 7 times, and the triggering time may be when the code printing chip 150 sends the downlink signal 3 rd time. In another embodiment, the trigger timing may be a preset time point, where the preset time point may be set based on an internal clock of the stylus 100. For example, the time period of 3a+3b when the stylus pen 100 collects the uplink signal is just the time when the code printing chip 150 sends the 3 rd downlink signal, so the trigger timing may be the time when the stylus pen 100 collects the uplink signal and passes 3 a+3b.
It should be noted that, the timing at which the code printing chip 150 of the stylus 100 triggers the sending of the interrupt signal to the pressure sensing chip 130 of the stylus 100 is merely an example, which is not limited in the embodiment of the present application. For example, in other possible embodiments, the code printing chip 150 of the stylus pen 100 may trigger sending an interrupt signal to the pressure sensing chip 130 of the stylus pen 100 after sending the downlink signal for the 1 st time, where a set period of time may be reserved between sending the downlink signal for the 1 st time and sending the downlink signal for the 2 nd time for pressure sensing acquisition. In addition, the specific value of the set duration is not limited, in order to reduce the probability of simultaneous performance of sending the downlink signal and reading the pressure sensing data through the serial port, the set duration is longer than the interval duration between any two other adjacent downlink signal sending processes, but in order to ensure the sampling rate of the downlink signal, the set duration cannot be too long, otherwise, the number of times of sampling the downlink signal by the electronic device 200 in one frame time is compressed.
When the trigger timing in step S1101 is that the code printing chip 150 has sent the downlink signal for the preset number of times, the stylus pen 100 may perform the counting process on the sending of the downlink signal of the code printing chip, in one possible implementation manner, the stylus pen 100 may perform the counting process based on the built-in counter, that is, after the code printing chip of the stylus pen sends the downlink signal once, the count value of the counter is incremented by one, after all the downlink signals in a frame are sent, the trigger counter clears the count value, and re-counts after entering the period of the next uplink signal. In the above-described counting method, when the count value of the counter is the count threshold value, the code-printing chip of the stylus pen 100 may be triggered to transmit an interrupt signal to the pressure-sensitive chip 130 of the stylus pen 100. For example, the count threshold is 3, and the stylus pen 100 is set within 16.67ms of the period of the uplink signal, and after the 3 rd downlink signal is sent, the code printing chip 150 of the stylus pen 100 is triggered to send the interrupt signal to the pressure sensing chip 130 of the stylus pen 100.
By the interrupt processing manner, real-time performance of some programs during execution can be ensured, for example, the time (i.e., the reserved set time) reserved for the pressure sensing chip to collect and report the pressure sensing data between the third time of sending the downlink signal and the fourth time of sending the downlink signal is limited, and the reporting of the pressure sensing data needs to be completed within the limited time, so that in order to reduce the time delay caused by waking up the pressure sensing chip by the processor, the code printing chip 150 can send an interrupt signal to the pressure sensing chip 130, so that the pressure sensing chip 130 does not need to wait for the scheduling process of the processor, and the pressure sensing data is directly collected according to the interrupt signal from the code printing chip 150, so that the executing efficiency of the pressure sensing collection task is improved.
The data transmission method further comprises the following steps:
step 1102: the pressure sensing chip 130 of the stylus 100 collects pressure sensing data based on the pressure sensing collection request.
When the pressure sensing chip 130 receives the interrupt signal (pressure sensing acquisition request) sent by the code printing chip 150, the currently running program or task may be stopped and the pressure sensing acquisition task may be executed, or it may be understood that the pressure sensing chip 130 is awakened after receiving the interrupt signal and performs interrupt processing to execute the pressure sensing acquisition task. The performance of the task of pressure sensing collection may be understood as that the pressure sensing chip 130 collects the nib pressure sensing data detected by the pressure sensor 120 and transmits the nib pressure sensing data to the processor 110. The code printing chip 150 directly sends the interrupt signal to the pressure sensing chip 130, so that the pressure sensing chip 130 performs interrupt processing to execute the pressure sensing acquisition task, the time delay caused by the dispatch of the pressure sensing acquisition task by the processor of the touch pen 100 can be reduced, and the execution efficiency of the pressure sensing acquisition task can be improved.
Step 1103: the processor 110 of the stylus 100 acquires pressure-sensitive data acquired by the pressure-sensitive chip.
After the pressure sensing chip 130 collects the current pressure sensing data of the pen tip detected by the pressure sensor 120, the processor 110 of the stylus 100 may further obtain the pen tip pressure sensing data collected by the pressure sensing chip 130. The pressure sensing chip 130 of the touch pen 100 is connected with the processor of the touch pen 100 through a serial interface, and then the processor 110 of the touch pen 100 can read the pressure sensing data acquired by the pressure sensing chip into the internal memory thereof through the serial interface between the processor and the pressure sensing chip 130.
Step 1104: the processor 110 of the stylus 100 transmits the current pressure-sensitive data to the electronic device 200 via bluetooth.
Wherein the stylus 100 may establish a wireless connection with the electronic device 200 before the processor 110 synchronizes the received pressure-sensitive data to the electronic device 200. The real-time performance of triggering the pressure sensing acquisition and reporting process can be improved by the interrupt request mode; more importantly, compared with the flow of pressure sensing collection in the related art shown in fig. 2B and fig. 2C, the triggering manner of pressure sensing collection provided in the embodiment of the present application can reduce the delay caused by the influence of multiple factors such as task priority, task state, task context switching and the like on the MCU existing in the scheduling process in the related art shown in fig. 2B and fig. 2C. In this embodiment of the present application, the code printing chip 150 directly sends a pressure sensing collection request to the pressure sensing chip 130, so the pressure sensing chip 130 can timely receive the pressure sensing collection request from the code printing chip 150, further execute corresponding pressure sensing data collection and reporting processes based on the request information, and before the pressure sensing chip 130 of the stylus 100 collects the pressure sensing data, the processor 110 does not need to schedule, so even if the processor 110 has a task to be processed, the pressure sensing data collection process is not blocked, and thus the real-time performance of the pressure sensing data transmission between the stylus 100 and the electronic device 200 is improved. In addition, due to the reduced time delay of the pressure sensing data acquisition, the process of reading the pressure sensing data acquired by the pressure sensing chip to the internal memory by the processor 110 of the stylus 100 through the serial interface between the processor and the pressure sensing chip 130 is less likely to overlap with the process of sending the downlink signal by the stylus 100, so that the probability of distortion of the pressure sensing data read by the processor of the stylus 100 is reduced.
In one embodiment, as shown in fig. 13A and 13B, after the pressure sensing chip 130 of the stylus 100 collects the pressure sensing data based on the pressure sensing collection request, step 1015 is performed, where step 1015 is: the first data reading request is sent to the processor 110 of the stylus 100, where the first data reading request is an interrupt signal, and step 1103 specifically includes: the processor 110 of the stylus 100 reads the pressure-sensitive data collected by the pressure-sensitive chip 130 to its own memory through a serial interface with the pressure-sensitive chip 130 based on the first data read request.
The pressure sensing chip 130 of the stylus 100 has a set output pin, and the set output pin of the pressure sensing chip 130 is electrically connected to the interrupt pin of the processor 110. The pressure sensing chip 130 is used for sending the first data reading request through the setting output pin. The processor 110 of the stylus 100 has an interrupt pin, and the processor 110 is configured to trigger reading of pressure-sensitive data from an interrupt source (i.e. the pressure-sensitive chip 130) to its own memory based on a first data reading request (interrupt signal) acquired by the interrupt pin, and specifically, the processor 110 may perform interrupt processing after receiving the first data reading request, where the interrupt processing includes: the program or task currently being executed by the processor 110 is suspended, and the program or task is transferred to execute the program or task in which the pressure sensing data collected by the pressure sensing chip 130 is read to the memory thereof through the serial interface with the pressure sensing chip 130, and the suspended program or task is returned to be executed after the pressure sensing data is read.
When the processor 110 of the stylus 100 reads the pressure-sensitive data from the pressure-sensitive chip 130 based on the first data reading request, the processor 110 may read the pressure-sensitive data with the target identifier at the pressure-sensitive chip 130 to its own memory. The specific implementation mode is as follows:
(1) the pressure sensing chip 130 of the stylus 100 and the processor 110 may mutually agree on a manner of setting an identification to the pressure sensing data.
(2) After the pressure sensing chip 130 of the stylus 100 collects the current pressure sensing data based on the pressure sensing collection request, an identifier is set for the current pressure sensing data according to the agreed mode.
(3) After the processor 110 of the stylus 100 receives the first data reading request, the pressure sensing data with the target identifier at the pressure sensing chip 130 is read to the internal memory.
The pressure sensing chip 130 of the stylus 100 and the processor 110 may mutually agree to set an identifier for the pressure sensing data collected by the pressure sensing chip 130 in a sequential numbering manner. Illustratively, the pressure sensing chip 130 of the stylus 100 sets the number of the last several collected pressure sensing data as: 00001. 00002 and 00003, after the current pressure sensing data is collected by the pressure sensing chip 130 of the stylus 100 based on the pressure sensing collection request, the number of the current pressure sensing data is set to 00004 according to the agreed mode, and the first data reading request is sent to the processor 110 of the stylus 100. After the processor 110 of the stylus 100 receives the first data reading request, the processor 110 of the stylus 100 reads the pressure sensing data with the target number at the pressure sensing chip 130 into the self memory, wherein the processor 110 of the stylus 100 can know that the number of the pressure sensing data to be read currently is 00004 according to the convention, and therefore the processor 110 of the stylus 100 can purposefully read the pressure sensing data with the number 00004 at the pressure sensing chip 130 into the self memory. The manner in which the pressure sensing chip 130 of the stylus 100 and the processor 110 agree with each other may include, but is not limited to, the above-described sequential numbering method for setting an identifier for the pressure sensing data collected by the pressure sensing chip 130.
In another embodiment, as shown in fig. 14A and 14B, after the pressure sensing chip 130 of the stylus 100 collects the pressure sensing data based on the pressure sensing collection request, step 1016 is executed, where step 1016 is: sequentially sending a second data reading request and pressure sensing data acquired based on the pressure sensing acquisition request to the processor 110 of the stylus 100, where the second data reading request is an interrupt signal, and step 1103 specifically includes: the processor 110 of the stylus 100 reads the pressure-sensitive data collected by the pressure-sensitive chip 130 to its own memory through a serial interface with the pressure-sensitive chip 130 based on the second data read request.
The pressure sensing chip 130 of the stylus 100 has a set output pin, and the set output pin of the pressure sensing chip 130 is electrically connected to the interrupt pin of the processor 110. The pressure sensing chip 130 is used for sending the second data reading request through the setting output pin. After the pressure sensing chip 130 sends the second data reading request, the collected pressure sensing data is transmitted to the processor of the stylus 100 through serial connection with the processor 110 of the stylus 100.
Specifically, the processor 110 may perform an interrupt process after receiving the second data read request, where the interrupt process includes: the program or task currently being executed by the processor 110 is suspended, and the program or task is converted into execution, the pressure sensing data sent by the pressure sensing chip 130 through the serial port connection between the two is read to the internal memory of the processor, and the suspended program or task is returned to be executed after the reading is completed. In this embodiment, after the pressure sensing chip 130 of the stylus 100 collects the pressure sensing data, an interrupt signal (i.e. the second data reading request) is sent to the processor of the stylus 100, and the pressure sensing data collected this time is transmitted to the processor 110 through a serial port connection with the processor 110, and the processor 110 reads the pressure sensing data transmitted through the serial port connection to its own memory through interrupt processing, so that the processor 110 can obtain the pressure sensing data relatively quickly, and the transmission delay is relatively low, thereby further ensuring that the processor of the stylus 100 obtains the pressure sensing data within the reserved set time.
In another embodiment, as shown in fig. 15A and 15B, after the stylus 100 receives the uplink signal sent by the electronic device 200, the coding chip 150 of the stylus 100 sends the downlink signal and sends the pressure sensing acquisition request to the pressure sensing chip at a preset time and sends the status message to the processor 110 of the stylus 100, that is, step 1101 specifically includes: step 1101a and step 1101b, step 1101a being: the coding chip 150 of the stylus 100 sends a pressure sensing acquisition request to the pressure sensing chip 130, and step 1101b is: the encoding chip 150 of the stylus 100 sends a status message to the processor 110 of the stylus 100. The pressure sensing chip 130 of the stylus 100 then collects pressure sensing data of the pressure sensor based on the pressure sensing collection request. Step 1103 specifically includes: the processor 110 of the stylus 100 reads the pressure sensing data collected by the pressure sensing chip to its own memory through a serial interface with the pressure sensing chip based on the status message.
In one embodiment, after the processor 110 of the stylus 100 receives the status message, the processor 110 may periodically read at the pressure sensing chip of the stylus 100 through a serial interface with the pressure sensing chip until the pressure sensing data with the target identifier is read to its own memory. The implementation manner of reading the pressure sensing data with the target identifier by the processor 110 to the memory thereof may be the same as or similar to that in the above embodiment, and will not be described herein.
In another embodiment, after the processor 110 of the stylus 100 receives the status message, the processor 110 starts timing, and reads the pressure sensing data with the target identifier at the pressure sensing chip to the memory thereof through the serial interface between the processor 110 and the pressure sensing chip after the set period of time.
The wake-up time of the pressure sensing chip 130 and the time for the pressure sensing chip 130 to collect the pressure sensing data may be predetermined, so that the time required for the pressure sensing chip 130 of the stylus pen 100 to wake up and the time required for the pressure sensing chip 130 to collect the pressure sensing data may be predetermined, and the set period of time may be determined according to the required time, in other words, the set period of time may be the total time of the time required for the pressure sensing chip 130 of the stylus pen 100 to wake up and the time required for the pressure sensing chip 130 to collect the pressure sensing data. It can be understood that after the processor 110 of the stylus 100 receives the status message and a set period of time elapses, the processor 110 is regarded as that the pressure sensing chip 130 has collected the pressure sensing data, and the processor 110 can read the pressure sensing data with the target identifier at the pressure sensing chip to the memory thereof through the serial interface with the pressure sensing chip. The implementation manner of reading the pressure sensing data with the target identifier by the processor 110 to the memory thereof may be the same as or similar to that in the above embodiment, and will not be described herein.
In one embodiment, the step 1103 may specifically be: the processor 110 reads the pressure sensing data of the pressure sensor 120 acquired by the pressure sensing chip 130 to the memory of the processor 110 through the serial interface. If the process of step 1103 occurs simultaneously with the coding process, the process of transmitting the pressure-sensitive data through the serial interface is susceptible to electromagnetic interference generated by the downlink signal. In the embodiment of the present application, the scheduling of the processor 110 is not required before the pressure sensing data is reported to the processor 110, so that the time delay of the pressure sensing data acquisition and reporting is reduced, that is, the probability of electromagnetic interference generated by downlink signals in the process of transmitting the pressure sensing data through the serial interface is reduced.
In one embodiment, before the stylus 100 sends the pressure-sensitive data to the electronic device 200, it may be determined whether the nib pressure value corresponding to the pressure-sensitive data read into the memory is 0, and if it is determined that the nib pressure value corresponding to the pressure-sensitive data is not 0, the processor 110 sends the pressure-sensitive data to the electronic device 200 through a bluetooth connection with the electronic device 200; if it is determined that the nib pressure value corresponding to the pressure sensing data is 0, that is, it is determined that the nib of the stylus 100 is pressureless by the present pressure sensing acquisition, and in an exemplary embodiment, the nib of the stylus 100 leaves the touch screen of the electronic device 200, the processor 110 does not send the pressure sensing data to the electronic device 200.
In one possible implementation, when the processor 110 sends the current pressure sensing data to the electronic device 200, the processor 110 may perform data transmission through a wireless communication connection between the active capacitive stylus and the electronic device 200. Among other wireless communication connections between the active capacitive pen and the electronic device 200 include, but are not limited to, connections made through the following networks: WI-FI hotspot networks, WI-FI peer-to-peer (P2P) networks, bluetooth networks, zigbee networks, or near field communication (near field communication, NFC) networks. Taking bluetooth connection as an example, the active capacitive stylus establishes a bluetooth transmission channel between the bluetooth module and the wireless interface 240 of the electronic device 200, and thus the processor 110 may send the current pressure sensing data to the electronic device 200 through bluetooth. The tablet may perform corresponding control according to nib pressure sensing data provided by the active capacitive pen, for example, in a scene where the active capacitive pen draws on the screen of the electronic device 200, the electronic device 200 may control the thickness of the pen drawing on the screen of the electronic device 200 according to the pressure sensing data.
In one implementation, a communication link is connected between a coding chip and a pressure sensing chip of the stylus provided in the embodiments of the present application. Specifically, the code printing chip 150 has a set output pin, and the code printing chip 150 is configured to send a pressure sensing acquisition request through the set output pin; the pressure sensing chip 130 has an interrupt pin, and the pressure sensing chip 130 is used for triggering and collecting pressure sensing data of the pressure sensor 120 based on a signal acquired by the interrupt pin and reporting the pressure sensing data to the processor 110. The set output pin of the code printing chip 150 is electrically connected to the interrupt pin of the pressure sensing chip 130. Through the communication connection between the two, the manner of interrupting the sending of the pressure-sensing acquisition request to the pressure-sensing chip when determining that the touch pen 100 and the touch screen 201 of the electronic device 200 are in code printing synchronization can be realized, so that the real-time performance of the pressure-sensing data synchronization is improved.
Yet another embodiment of the present application also provides a data transmission system that may include the stylus 100 provided by the embodiment of fig. 5 and one or more electronic devices 200 provided by the embodiment of fig. 6. Wherein the stylus may be in a distributed system with one or more electronic devices 200. After approaching to the touch screen 201 of any electronic device 200, the touch pen 100 can realize code printing synchronization with the touch screen 201, and further the touch pen can perform corresponding interaction with the electronic device, for example, the touch pen 100 inputs corresponding control signals to the electronic device 200 through clicking, writing and other operations on the touch screen 201.
Still another embodiment of the present application further provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a data transmission method provided by any of the embodiments of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a Processor (Processor) to perform part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention are intended to be included within the scope of the present invention.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (15)

1. A data transmission method, characterized in that it is applied to a stylus, the stylus includes a coding chip, a pressure sensing chip, a pressure sensor and a processor, the method includes:
the coding chip sends a pressure sensing acquisition request to the pressure sensing chip;
the pressure sensing chip acquires pressure sensing data of the pressure sensor based on the pressure sensing acquisition request;
The processor acquires the pressure sensing data acquired by the pressure sensing chip; and
the processor sends the pressure sensing data to an electronic device;
the code printing chip is provided with a set output pin for sending the pressure sensing acquisition request, the pressure sensing chip is provided with an interrupt pin, and the set output pin of the code printing chip is connected with the interrupt pin of the pressure sensing chip;
the code printing chip sending the pressure sensing acquisition request to the pressure sensing chip comprises the following steps:
the coding chip sends the pressure sensing acquisition request to the interrupt pin of the pressure sensing chip through the set output pin;
the pressure sensing chip acquires pressure sensing data of the pressure sensor based on the pressure sensing acquisition request, and the pressure sensing data comprises:
and the pressure sensing chip acquires pressure sensing data of the pressure sensor based on the pressure sensing acquisition request acquired by the interrupt pin.
2. The method of claim 1, wherein the encoding chip sending a pressure-sensitive acquisition request to the pressure-sensitive chip comprises:
after the touch pen receives the uplink signal sent by the electronic equipment, the coding chip sends a downlink signal and sends a pressure sensing acquisition request to the pressure sensing chip at preset time.
3. The method of claim 2, wherein the sending, by the coding chip, a downlink signal and sending, at a preset occasion, a pressure-sensing acquisition request to the pressure-sensing chip comprises:
the coding chip sends a downlink signal and sends a pressure sensing acquisition request to the pressure sensing chip after sending the downlink signal for preset times.
4. A method according to any one of claims 1 to 3,
the code printing chip sending the pressure sensing acquisition request to the pressure sensing chip comprises the following steps:
the coding chip sends a pressure sensing acquisition request to the pressure sensing chip in an interrupt mode.
5. The method of claim 1, wherein the pressure sensing acquisition request is a pressure sensing chip wake-up instruction;
the process of the pressure sensing chip for collecting the pressure sensing data of the pressure sensor based on the pressure sensing collecting request comprises the following steps:
the pressure sensing chip is awakened based on the awakening instruction of the pressure sensing chip and acquires pressure sensing data of the pressure sensor.
6. The method of claim 1, wherein the processor obtaining the pressure-sensitive data collected by the pressure-sensitive chip comprises:
and the processor reads the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through a serial interface between the processor and the pressure sensing chip.
7. The method of claim 6, wherein the step of providing the first layer comprises,
before the process that the processor reads the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through the serial interface between the processor and the pressure sensing chip, the method further comprises the following steps:
after the pressure sensing chip acquires the pressure sensing data, a first data reading request is sent to the processor, wherein the first data reading request is an interrupt signal;
the processor reading the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through a serial interface between the processor and the pressure sensing chip comprises:
and the processor reads the pressure sensing data acquired by the pressure sensing chip to a memory of the processor through a serial interface between the processor and the pressure sensing chip based on the first data reading request.
8. The method of claim 6, wherein the step of providing the first layer comprises,
before the process that the processor reads the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through the serial interface between the processor and the pressure sensing chip, the method further comprises the following steps:
after the pressure sensing chip acquires the pressure sensing data, sequentially sending a second data reading request and the pressure sensing data of the pressure sensor to the processor, wherein the second data reading request is an interrupt signal;
The processor reading the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through a serial interface between the processor and the pressure sensing chip comprises:
and the processor reads the pressure sensing data of the pressure sensor to the memory of the processor through a serial interface between the processor and the pressure sensing chip based on the second data reading request.
9. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the code printing chip sending the pressure sensing acquisition request to the pressure sensing chip comprises the following steps:
the coding chip sends a pressure sensing acquisition request to the pressure sensing chip and sends a status message to the processor;
the processor obtaining the pressure sensing data collected by the pressure sensing chip comprises the following steps:
and the processor reads the pressure sensing data acquired by the pressure sensing chip to the memory of the processor through a serial interface between the processor and the pressure sensing chip based on the state information.
10. A stylus, comprising:
a pressure sensor for detecting pressure sensing data of a tip of the stylus;
the code printing device comprises a code printing chip, a pressure sensing chip and a processor, wherein the code printing chip is electrically connected with the pressure sensing chip, and the pressure sensing chip is electrically connected with the processor and the pressure sensor;
The coding chip is used for sending a pressure sensing acquisition request to the pressure sensing chip;
the pressure sensing chip is used for acquiring pressure sensing data of the pressure sensor based on the pressure sensing acquisition request;
the processor is used for acquiring the pressure sensing data acquired by the pressure sensing chip; and
the processor is used for sending the pressure sensing data to the electronic equipment;
the code printing chip is provided with a set output pin for sending the pressure sensing acquisition request, the pressure sensing chip is provided with an interrupt pin, and the set output pin of the code printing chip is connected with the interrupt pin of the pressure sensing chip;
the coding chip is specifically used for sending the pressure sensing acquisition request to the pressure sensing chip through the set output pin;
the pressure sensing chip is specifically used for acquiring pressure sensing data of the pressure sensor based on the pressure sensing acquisition request acquired by the interrupt pin.
11. The stylus of claim 10, wherein the touch pad is configured to be mounted on a touch pad,
the code printing chip is specifically configured to send a downlink DD220003I03 after the stylus receives an uplink signal sent by the electronic device
And the line signal sends a pressure sensing acquisition request to the pressure sensing chip at preset time.
12. The stylus of claim 10, wherein the touch pad is configured to be mounted on a touch pad,
the processor is connected to the pressure sensing chip through a serial interface, and the processor is specifically configured to read the pressure sensing data collected by the pressure sensing chip to the memory of the processor through the serial interface.
13. The stylus of claim 10, wherein the touch pad is configured to be mounted on a touch pad,
the set output pin of the coding chip is connected with the interrupt pin of the pressure sensing chip through a signal wire;
the coding chip is specifically used for sending the pressure sensing acquisition request to the pressure sensing chip in an interrupted way through the signal line.
14. A data transmission system, comprising:
a stylus and a number of electronic devices, wherein the stylus is a stylus according to any one of claims 10 to 13.
15. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the data transmission method according to any one of claims 1-9.
CN202210348967.3A 2022-04-01 2022-04-01 Data transmission method, touch pen and storage medium Active CN115525176B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210348967.3A CN115525176B (en) 2022-04-01 2022-04-01 Data transmission method, touch pen and storage medium
CN202310877120.9A CN116991257A (en) 2022-04-01 2022-04-01 Data transmission method, touch pen and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210348967.3A CN115525176B (en) 2022-04-01 2022-04-01 Data transmission method, touch pen and storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202310877120.9A Division CN116991257A (en) 2022-04-01 2022-04-01 Data transmission method, touch pen and storage medium

Publications (2)

Publication Number Publication Date
CN115525176A CN115525176A (en) 2022-12-27
CN115525176B true CN115525176B (en) 2023-07-25

Family

ID=84695585

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202310877120.9A Pending CN116991257A (en) 2022-04-01 2022-04-01 Data transmission method, touch pen and storage medium
CN202210348967.3A Active CN115525176B (en) 2022-04-01 2022-04-01 Data transmission method, touch pen and storage medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202310877120.9A Pending CN116991257A (en) 2022-04-01 2022-04-01 Data transmission method, touch pen and storage medium

Country Status (1)

Country Link
CN (2) CN116991257A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116737016A (en) * 2023-06-29 2023-09-12 上海水木蓝鲸半导体技术有限公司 Control method and device for touch data scanning, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113054984A (en) * 2021-05-20 2021-06-29 上海艾为微电子技术有限公司 Pressure-sensitive detection circuit, chip, system and pressure-sensitive detection method
CN214277261U (en) * 2021-03-15 2021-09-24 北京科加触控技术有限公司 Pressure acquisition device, pressure detection device and electronic pen
CN113918034A (en) * 2020-07-08 2022-01-11 株式会社和冠 Stylus, sensor controller and methods performed thereby
CN114217700A (en) * 2022-02-18 2022-03-22 荣耀终端有限公司 Touch pen switching method and input device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018201316A1 (en) * 2017-05-03 2018-11-08 深圳市柔宇科技有限公司 Tablet, notepad, and handwriting input methods thereof
CN109521893B (en) * 2018-10-17 2022-11-25 京东方科技集团股份有限公司 Touch pen, touch panel, touch sensing system and control method thereof
CN112882643A (en) * 2021-01-28 2021-06-01 维沃移动通信有限公司 Control method of touch pen, control method of electronic equipment and touch pen
CN112558796B (en) * 2021-02-19 2021-07-06 深圳市千分一智能技术有限公司 Electronic pen, control method and device thereof, and computer-readable storage medium
CN116247766A (en) * 2021-03-15 2023-06-09 荣耀终端有限公司 Wireless charging system, chip and wireless charging circuit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918034A (en) * 2020-07-08 2022-01-11 株式会社和冠 Stylus, sensor controller and methods performed thereby
CN214277261U (en) * 2021-03-15 2021-09-24 北京科加触控技术有限公司 Pressure acquisition device, pressure detection device and electronic pen
CN113054984A (en) * 2021-05-20 2021-06-29 上海艾为微电子技术有限公司 Pressure-sensitive detection circuit, chip, system and pressure-sensitive detection method
CN114217700A (en) * 2022-02-18 2022-03-22 荣耀终端有限公司 Touch pen switching method and input device

Also Published As

Publication number Publication date
CN116991257A (en) 2023-11-03
CN115525176A (en) 2022-12-27

Similar Documents

Publication Publication Date Title
CN110830198B (en) Control information transmission method and equipment
KR102490415B1 (en) Electronic device and method for power saving in the electronic device
US10038790B2 (en) Communication service operating method and electronic device supporting the same
EP3107183B1 (en) Device and method for providing notification on wireless charging state
US20180004324A1 (en) Touch sensing device, pen, and method for measuring position
CN111124158B (en) Information input equipment, terminal, control method thereof and chip
KR102469570B1 (en) Electronic apparatus and operating method thereof
EP3131317B1 (en) Method and apparatus for providing location information
KR20160062534A (en) Method for organizing proximity network and an electronic device thereof
KR20160090074A (en) Method and apparatus for reducing power consumption of electronic device
KR20170098109A (en) Method for selection of transmission Antenna and electronic device supporting the same
CN105338052B (en) Method and apparatus for synchronizing applications of electronic devices
KR102513790B1 (en) Method and apparatus for transmitting a wireless power
CN111885581A (en) Discovery method and electronic equipment thereof
KR20190064295A (en) Apparatus and method for manegementing consumption power in a electrolic device
US20160150582A1 (en) Electronic device for establishing communication by electronic device
EP3557460B1 (en) Electronic device and method for controlling biosensor linked with display by using same
KR102356968B1 (en) Method and apparatus for connecting with external device
CN115525176B (en) Data transmission method, touch pen and storage medium
CN107409358B (en) Power saving method in peer-to-peer network and electronic device performing the same
KR20160084777A (en) Supporting method for register setup and electronic device supporting the same
KR102318055B1 (en) An elelctronic device and a coverrage compensation method for a shortrange communication in the elelctronic device
US11044723B2 (en) Electronic device and communication method for electronic device
EP3470970B1 (en) Electronic device and touch input sensing method of electronic device
CN115525175B (en) Data transmission method, touch pen and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant