Search

EP-4742013-A1 - INTERACTION METHOD FOR STYLUS AND ELECTRONIC DEVICE, AND STYLUS AND ELECTRONIC DEVICE

EP4742013A1EP 4742013 A1EP4742013 A1EP 4742013A1EP-4742013-A1

Abstract

This application provides a method for interaction between a stylus and an electronic device, a stylus, and an electronic device. In the method, the stylus transmits a first coded signal when the stylus is in contact with a screen of the electronic device; when the stylus transmits the first coded signal, the electronic device collects a coded signal at a first sampling frequency, and performs a writing operation; when the stylus leaves the screen, the stylus transmits a second coded signal, where a frequency of the first coded signal is different from a frequency of the second coded signal; and when the stylus transmits the second coded signal, the electronic device collects a coded signal at the first sampling frequency. In this application, when the stylus leaves the screen, the electronic device still collects the coded signal at the first sampling frequency. In this way, when the screen is in contact with the screen again, the electronic device can more quickly detect that the stylus is in contact with the screen, and can perform a line drawing operation in time, thereby avoiding a problem that water does not flow out when the stylus is in contact with the screen, and improving writing immediateness of the stylus.

Inventors

  • ZHENG, TAO

Assignees

  • Huawei Technologies Co., Ltd.

Dates

Publication Date
20260513
Application Date
20241104

Claims (20)

  1. A method for interaction between a stylus and an electronic device, comprising: transmitting, by the stylus, a first coded signal when the stylus is in contact with a screen of the electronic device; when the stylus transmits the first coded signal, collecting, by the electronic device, a coded signal at a first sampling frequency, and performing a writing operation; when the stylus leaves the screen, transmitting, by the stylus, a second coded signal, wherein a frequency of the first coded signal is different from a frequency of the second coded signal; and when the stylus transmits the second coded signal, collecting, by the electronic device, a coded signal at the first sampling frequency.
  2. The method according to claim 1, wherein before the stylus is in contact with the screen of the electronic device, the method further comprises: entering a first sleep state after the stylus is powered on, wherein when the stylus enters the first sleep state, the stylus performs detection on an acceleration transducer; or entering a second sleep state after the stylus is powered on, wherein when the stylus enters the second sleep state, the stylus performs detection on an acceleration transducer and performs detection on a pressure sensor.
  3. The method according to claim 2, wherein after entering the first sleep state, the method further comprises: when it is determined, based on data collected by the acceleration transducer, that the stylus is in a used state, transmitting, by the stylus, the second coded signal, and detecting, based on data collected by the pressure sensor, whether the stylus is in contact with the screen; and when the stylus transmits the second coded signal, collecting, by the electronic device, a coded signal at the first sampling frequency.
  4. The method according to claim 3, wherein after transmitting, by the stylus, the second coded signal, the method further comprises: if it is not detected, within first preset duration, that the stylus is in contact with the screen, entering, by the stylus, the first sleep state; and transmitting, by the stylus, the first coded signal when the stylus is in contact with the screen of the electronic device comprises: if it is detected, within the first preset duration, that the stylus is in contact with the screen, transmitting, by the stylus, the first coded signal.
  5. The method according to claim 2, wherein after entering the first sleep state, the method further comprises: when it is determined, based on data collected by the acceleration transducer, that the stylus is in a used state, entering, by the stylus, the second sleep state.
  6. The method according to claim 2 or 5, wherein after entering the second sleep state, the method further comprises: detecting, by the stylus based on data collected by the pressure sensor, whether the stylus is in contact with the screen.
  7. The method according to claim 6, wherein the method further comprises: if it is not detected, within second preset duration, that the stylus is in contact with the screen, entering, by the stylus, the first sleep state; and transmitting, by the stylus, the first coded signal when the stylus is in contact with the screen of the electronic device comprises: if it is detected, within the second preset duration, that the stylus is in contact with the screen, transmitting, by the stylus, the first coded signal.
  8. The method according to claim 6 or 7, wherein after transmitting, by the stylus, the second coded signal, the method further comprises: if it is not detected, within third preset duration, that the stylus is in contact with the screen, entering, by the stylus, the second sleep state; and if it is detected, within the third preset duration, that the stylus is in contact with the screen, transmitting, by the stylus, the first coded signal.
  9. The method according to any one of claims 1 to 8, wherein when the stylus transmits the second coded signal, after collecting, by the electronic device, the coded signal at the first sampling frequency, the method further comprises: when the stylus is in contact with the screen again, transmitting, by the stylus, the first coded signal; and when the stylus transmits the first coded signal, collecting, by the electronic device, the coded signal at the first sampling frequency, and performing the writing operation.
  10. A method for interaction between a stylus and an electronic device, applied to the stylus, wherein the method comprises: transmitting a first coded signal when being in contact with a screen of the electronic device; and transmitting a second coded signal when leaving the screen, wherein a frequency of the first coded signal is different from a frequency of the second coded signal.
  11. The method according to claim 10, wherein before the stylus is in contact with the screen of the electronic device, the method further comprises: entering a first sleep state after power-on, wherein when entering the first sleep state, the stylus performs detection on an acceleration transducer; or entering a second sleep state after power-on, wherein when entering the second sleep state, the stylus performs detection on an acceleration transducer and performs detection on a pressure sensor.
  12. The method according to claim 11, wherein after entering the first sleep state, the method further comprises: when it is determined, based on data collected by the acceleration transducer, that the stylus is in a used state, transmitting the second coded signal, and detecting, based on data collected by the pressure sensor, whether the stylus is in contact with the screen.
  13. The method according to claim 12, wherein after transmitting the second coded signal, the method further comprises: if it is not detected, within first preset duration, that the stylus is in contact with the screen, entering the first sleep state; and transmitting the first coded signal when being in contact with the screen of the electronic device comprises: if it is detected, within the first preset duration, that the stylus is in contact with the screen, transmitting the first coded signal.
  14. The method according to claim 11, wherein after entering the first sleep state, the method further comprises: when it is determined, based on data collected by the acceleration transducer, that the stylus is in a used state, entering the second sleep state.
  15. The method according to claim 11 or 14, wherein after entering the second sleep state, the method further comprises: detecting, based on data collected by the pressure sensor, whether the stylus is in contact with the screen.
  16. The method according to claim 15, wherein the method further comprises: if it is not detected, within second preset duration, that the stylus is in contact with the screen, entering the first sleep state; and transmitting the first coded signal when being in contact with the screen of the electronic device comprises: if it is detected, within the second preset duration, that the stylus is in contact with the screen, transmitting the first coded signal.
  17. The method according to claim 15 or 16, wherein after transmitting the second coded signal, the method further comprises: if it is not detected, within third preset duration, that the stylus is in contact with the screen, entering the second sleep state; and if it is detected, within the third preset duration, that the stylus is in contact with the screen, transmitting the first coded signal.
  18. The method according to any one of claims 10 to 17, wherein after transmitting the second coded signal when leaving the screen, the method further comprises: when being in contact with the screen again, transmitting the first coded signal.
  19. A method for interaction between a stylus and an electronic device, applied to the electronic device, wherein the method comprises: when the stylus transmits a first coded signal, collecting a coded signal at a first sampling frequency, and performing a writing operation, wherein the first coded signal is transmitted when the stylus is in contact with a screen of the electronic device; and when the stylus transmits a second coded signal, collecting a coded signal at the first sampling frequency, wherein the second coded signal is transmitted when the stylus leaves the screen, and a frequency of the first coded signal is different from a frequency of the second coded signal.
  20. The method according to claim 19, wherein when the stylus transmits the second coded signal, after collecting the coded signal at the first sampling frequency, the method further comprises: when a strength of the second coded signal is less than or equal to a strength threshold, detecting the coded signal at a second sampling frequency, wherein the second sampling frequency is less than the first sampling frequency.

Description

This application claims priority to Chinese Patent Application No. 202311480916.7, filed with the China National Intellectual Property Administration on November 7, 2023 and entitled "METHOD FOR INTERACTION BETWEEN STYLUS AND ELECTRONIC DEVICE, STYLUS, AND ELECTRONIC DEVICE", which is incorporated herein by reference in its entirety. TECHNICAL FIELD Embodiments of this application relate to the field of communication technologies, and in particular, to a method for interaction between a stylus and an electronic device, a stylus, and an electronic device. BACKGROUND With development of touch control technologies, more electronic devices perform human-machine interaction in a touch control manner. For example, a user may operate a screen of an electronic device via a stylus to provide an input for the electronic device, and the electronic device may perform a corresponding operation based on the input. Currently, there is a stylus that can operate all day long and always transmit a coded signal. When detecting the coded signal, the electronic device may perform a writing operation. When the electronic device fails to detect the coded signal, the electronic device enters a low power consumption mode. When the electronic device detects the coded signal again, the electronic device may exit the low power consumption mode, and continue to perform the writing operation. There is a delay in this period of time, causing a writing delay. SUMMARY Embodiments of this application provide a method for interaction between a stylus and an electronic device, a stylus, and an electronic device. When the stylus leaves a screen, the electronic device still collects a coded signal at a first sampling frequency; and when the screen is in contact with the screen again, the electronic device can quickly detect that the stylus is in contact with the screen, thereby avoiding a writing delay, and improving writing immediateness of the stylus. According to a first aspect, an embodiment of this application provides a method for interaction between a stylus and an electronic device. The method is applied to a system for interaction between a stylus and an electronic device, and the system may include the stylus and the electronic device. In the method, the stylus transmits a first coded signal when the stylus is in contact with a screen of the electronic device; and when the stylus transmits the first coded signal, the electronic device collects a coded signal at a first sampling frequency, and performs a writing operation. When the electronic device detects that the stylus transmits the first coded signal, the electronic device may determine that the stylus is in contact with the screen, and the electronic device may perform a writing operation based on a location of the stylus on the screen. When the stylus leaves the screen, the stylus transmits a second coded signal, where a frequency of the first coded signal is different from a frequency of the second coded signal. When the stylus transmits the second coded signal, the electronic device collects a coded signal at the first sampling frequency. When the electronic device detects that the stylus transmits the first coded signal, the electronic device may determine that the stylus leaves the screen, and the electronic device may stop performing the writing operation. In addition, in embodiments of this application, the electronic device does not reduce the sampling frequency, but continues to collect the coded signal at the first sampling frequency. In embodiments of this application, the stylus may transmit coded signals of different frequencies, to indicate that the stylus is in contact with the screen or leaves the screen. In this way, the electronic device may determine, based on the detected coded signal, that the stylus is in contact with the screen or leaves the screen. When the stylus leaves the screen, the electronic device still collects the coded signal at the first sampling frequency. In this way, when the screen is in contact with the screen again, the electronic device can more quickly detect that the stylus is in contact with the screen, and can perform a line drawing operation in time, thereby avoiding a problem that water does not flow out when the stylus is in contact with the screen, and improving writing immediateness of the stylus. In addition, in embodiments of this application, the stylus may transmit coded signals of different frequencies, to indicate that the stylus is in contact with the screen or leaves the screen. Compared with a conventional-technology solution in which the stylus does not transmit the coded signal after leaving the screen, in this application, after the stylus leaves the screen, the second coded signal may be transmitted, so that the electronic device can detect the second coded signal more quickly, and the electronic device can stop the line drawing operation in time, thereby reducing a response delay and avoiding a trailing phenomenon.