CN117354772A - Method for establishing connection with handwriting pen and electronic equipment - Google Patents

Method for establishing connection with handwriting pen and electronic equipment Download PDF

Info

Publication number
CN117354772A
CN117354772A CN202211348893.XA CN202211348893A CN117354772A CN 117354772 A CN117354772 A CN 117354772A CN 202211348893 A CN202211348893 A CN 202211348893A CN 117354772 A CN117354772 A CN 117354772A
Authority
CN
China
Prior art keywords
magnetic flux
geomagnetic sensor
connection
electronic device
sensor
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.)
Pending
Application number
CN202211348893.XA
Other languages
Chinese (zh)
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 CN202211348893.XA priority Critical patent/CN117354772A/en
Publication of CN117354772A publication Critical patent/CN117354772A/en
Pending legal-status Critical Current

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/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
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D21/00Measuring or testing not otherwise provided for
    • G01D21/02Measuring two or more variables by means not covered by a single other subclass
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01VGEOPHYSICS; GRAVITATIONAL MEASUREMENTS; DETECTING MASSES OR OBJECTS; TAGS
    • G01V3/00Electric or magnetic prospecting or detecting; Measuring magnetic field characteristics of the earth, e.g. declination, deviation
    • G01V3/40Electric or magnetic prospecting or detecting; Measuring magnetic field characteristics of the earth, e.g. declination, deviation specially adapted for measuring magnetic field characteristics of the earth
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Remote Sensing (AREA)
  • Databases & Information Systems (AREA)
  • Environmental & Geological Engineering (AREA)
  • Geology (AREA)
  • General Life Sciences & Earth Sciences (AREA)
  • Geophysics (AREA)
  • Position Input By Displaying (AREA)

Abstract

The embodiment of the application provides a method and electronic equipment for establishing connection with a handwriting pen, wherein the method is executed by the electronic equipment and comprises the following steps: acquiring first data acquired by a geomagnetic sensor in electronic equipment; determining that the handwriting pen is adsorbed on the electronic equipment under the condition that the first data meets the preset condition, wherein the preset condition is used for judging whether the handwriting pen is adsorbed on the electronic equipment or not; the electronic device establishes a connection with the stylus. According to the method, the adsorption state of the handwriting pen is determined by acquiring the sensor data of the geomagnetic sensor, and then the electronic equipment and the handwriting pen are paired according to the adsorption state of the handwriting pen, so that the operation steps of a user when the electronic equipment and the handwriting pen are paired can be reduced, and the usability is improved; and moreover, the geomagnetic sensor is used for acquiring sensor data to identify the adsorption state of the handwriting pen, and can be connected with a chip in the electronic equipment in an I2C bus connection mode, so that the hardware cost is reduced.

Description

Method for establishing connection with handwriting pen and electronic equipment
Technical Field
The application relates to the technical field of electronics, in particular to a method for establishing connection with a handwriting pen and electronic equipment.
Background
With the development of electronic technology, electronic devices are more and more, for example, tablet computers have become necessary articles for people to work and learn. People can use the tablet personal computer to listen to songs, watch drama, play games, draw pictures, write words and the like; in drawing or writing, if a finger is used for touch operation, it is inconvenient, so it is very important to provide a handwriting pen for the tablet computer.
In order to normally use a stylus, it is generally necessary to bluetooth pair the stylus and tablet computer. The conventional technology is usually to pair with the handwriting pen through a 'setup' path in the tablet computer, however, the pairing process is complicated, and the usability is poor for users.
Disclosure of Invention
The application provides a method and electronic equipment for establishing connection with a handwriting pen, which can improve the usability of establishing connection between the handwriting pen and a tablet computer by a user and reduce hardware cost.
In a first aspect, the present application provides a method for a stylus and tablet computer, the method performed by an electronic device, comprising: acquiring first data acquired by a geomagnetic sensor in electronic equipment; determining that the handwriting pen is adsorbed on the electronic equipment under the condition that the first data meets the preset condition, wherein the preset condition is used for judging whether the handwriting pen is adsorbed on the electronic equipment or not; the electronic device establishes a connection with the stylus.
The geomagnetic sensor is arranged on one side of the electronic equipment and used for collecting magnetic field intensity data around the geomagnetic sensor so as to judge whether the handwriting pen is close to and adsorbed. The first data collected is sensor data, and when the sensor data meets the preset condition, the handwriting pen can be determined to be adsorbed on one side of the electronic equipment, on which the geomagnetic sensor is mounted. Alternatively, the stylus may be adsorbed on the electronic device as normal adsorption or as dislocation adsorption. After determining that the stylus has been attached to the electronic device, the electronic device may establish a connection with the stylus.
Optionally, when the electronic device and the handwriting pen are connected, the bluetooth functions of the two parties need to be started first, then the electronic device can send a connection establishment request to the handwriting pen, and after the handwriting pen confirms the connection establishment request, the two parties establish bluetooth connection.
Alternatively, the first data may be magnetic fluxes in each axial direction (i.e., triaxial magnetic fluxes) in the geomagnetic sensor, the preset condition may be a preset magnetic flux threshold, and when the collected triaxial magnetic fluxes satisfy the condition of the magnetic flux threshold, the first data is considered to satisfy the preset condition.
In the implementation mode, the electronic equipment determines the adsorption state of the handwriting pen by acquiring the sensor data of the geomagnetic sensor, and then pairs the electronic equipment with the handwriting pen according to the adsorption state of the handwriting pen, so that the operation steps of a user when the electronic equipment is paired with the handwriting pen can be reduced, and the usability is improved; in addition, in the embodiment of the application, the geomagnetic sensor is used for acquiring sensor data to identify the adsorption state of the handwriting pen, and the geomagnetic sensor can be connected with a chip in the electronic equipment in an I2C bus connection mode, so that hardware cost is reduced.
With reference to the first aspect, in some implementations of the first aspect, the first data meets a preset condition including that at least one magnetic flux of the triaxial magnetic fluxes is located in a first magnetic flux threshold interval or at least one magnetic flux is located in a second magnetic flux threshold interval.
For example, in this implementation, an x-axis magnetic flux of the three-axis magnetic fluxes is selected, and if the x-axis magnetic flux is located in the first magnetic flux threshold interval or in the second magnetic flux threshold interval, it is determined that the first data satisfies the preset condition.
Specifically, the electronic equipment firstly judges whether the x-axis magnetic flux is located in a first magnetic flux threshold interval, and if so, the electronic equipment meets the preset condition; if the magnetic flux is not located, judging whether the x-axis magnetic flux is located in the second magnetic flux threshold value interval, and if the magnetic flux is located in the second magnetic flux threshold value interval, meeting the preset condition.
In one possible implementation, in the case where the at least one magnetic flux is located in the first magnetic flux threshold interval, the adsorption surface or adsorption point of the stylus is in full contact with the electronic device, that is, in a normal adsorption state at this time.
In another possible implementation, when the at least one magnetic flux is located in the second magnetic flux threshold interval, the suction surface or the suction point of the stylus is not fully contacted with the electronic device, that is, is in a dislocated suction state. In both implementations, it may be determined that the stylus is attached to the electronic device.
In a further possible embodiment, the suction surface or suction point of the stylus pen is not in contact with the electronic device, i.e. is in a suction-free state, when the at least one magnetic flux is located neither in the first nor in the second magnetic flux threshold interval.
In the implementation mode, the electronic equipment judges the triaxial magnetic flux and the magnetic flux threshold value to determine whether the preset condition is met or not, and further whether the handwriting pen is adsorbed on the electronic equipment or not is determined, so that connection between the subsequent electronic equipment and the handwriting pen is established, and usability is improved.
With reference to the first aspect, in some implementations of the first aspect, the determining that the stylus is adsorbed on the electronic device includes: if the contact state of the adsorption surface or the adsorption point of the handwriting pen and the electronic equipment does not change within a preset time from the first moment, determining that the handwriting pen is adsorbed on the electronic equipment, wherein the first moment is the moment when the geomagnetic sensor collects first data.
In this implementation manner, in order to ensure that the handwriting pen is always adsorbed on the electronic device, rather than being misplaced on the electronic device, the electronic device may determine, after determining that the first data meets the preset condition, whether the handwriting pen is still adsorbed on the electronic device within a preset period (for example, 3 seconds) after that, and the specific process may be: and continuously acquiring sensor data acquired by the geomagnetic sensor, determining whether the sensor data meet preset conditions, if so, determining that the handwriting pen is indeed adsorbed on the electronic equipment, and subsequently executing the process of establishing connection between the electronic equipment and the handwriting pen. Therefore, unnecessary operation of a user under the condition that the handwriting pen is misplaced on the electronic equipment can be reduced, and the use experience of the user is improved.
With reference to the first aspect, in some implementations of the first aspect, the establishing a connection between the electronic device and the stylus includes: displaying a connection prompt box, wherein the connection prompt box comprises a connection control; and receiving touch operation of a user on the connection control, responding to the touch operation, sending a connection request to the handwriting pen, and establishing connection with the handwriting pen.
In the process of establishing connection between the electronic equipment and the handwriting pen, the electronic equipment can pop up a connection prompt box for a user to select a connection control in the connection prompt box. After receiving the touch operation of the user on the connection control, a connection request can be initiated to the handwriting pen. By initiating a connection confirmation prompt box to the user, unnecessary operations of the user can be further reduced, for example, if the user does not need to pair the handwriting pen in fact, if the electronic device establishes a connection, the user is required to cancel the connection again.
With reference to the first aspect, in some implementations of the first aspect, the electronic device includes a sensor hub, and the acquiring the first data acquired by the geomagnetic sensor in the electronic device includes: the sensor rhub acquires first data from the geomagnetic sensor.
Optionally, the geomagnetic sensor is connected with the sensor rhub through an I2C bus mode. In the implementation mode, the geomagnetic sensor is connected with the sensor rhub through an I2C bus connection mode so as to carry out data communication, and the hardware cost for installing the geomagnetic sensor can be reduced.
In one implementation, determining that the stylus is adsorbed on the electronic device if the first data meets a preset condition includes: in the case that the first data meets the preset condition, the sensor rhub determines that the handwriting pen is adsorbed on the electronic equipment. That is, the above-described process of determining whether the first data satisfies the preset condition may be performed by a sensor rhub, which is a type of fast memory that can be directly accessed, and the working power consumption of the electronic device may be reduced by processing the sensor data by the sensor rhub.
In one implementation, the electronic device further includes an application processor (application processor, AP), the electronic device establishing a connection with the stylus, comprising: the AP indicates that a service application installed in the electronic equipment is connected with the handwriting pen according to a received indication message sent by the sensor rhub, wherein the indication message comprises information for representing that the handwriting pen is adsorbed on the electronic equipment; the business application establishes a connection with the stylus.
The service application can be a bluetooth keyboard application, and if the adsorption state of the handwriting pen is a normal adsorption state or a dislocation adsorption state, the service application can call a popup window interface of the frame layer to pop up a connection prompt box so as to realize the process of establishing connection with the handwriting pen.
In a second aspect, the present application provides an apparatus, which is included in an electronic device, and which has a function of implementing the electronic device behavior in the first aspect and possible implementations of the first aspect. The functions may be realized by hardware, or may be realized by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the functions described above. Such as a receiving module or unit, a processing module or unit, etc.
In a third aspect, the present application provides an electronic device, the electronic device comprising: a processor, a memory, and an interface; the processor, the memory and the interface cooperate with each other such that the electronic device performs any one of the methods of the technical solutions of the first aspect.
In a fourth aspect, the present application provides a chip comprising a processor. The processor is configured to read and execute a computer program stored in the memory to perform the method of the first aspect and any possible implementation thereof.
Optionally, the chip further comprises a memory, and the memory is connected with the processor through a circuit or a wire.
Further optionally, the chip further comprises a communication interface.
In a fifth aspect, the present application provides a computer readable storage medium, in which a computer program is stored, which when executed by a processor causes the processor to perform any one of the methods of the first aspect.
In a sixth aspect, the present application provides a computer program product comprising: computer program code which, when run on an electronic device, causes the electronic device to perform any one of the methods of the solutions of the first aspect.
Drawings
FIG. 1 is a schematic diagram of an example of a Bluetooth set-up interface provided in the prior art;
FIG. 2 is a diagram illustrating an example of an interface for displaying a connection prompt box according to the prior art;
fig. 3 is a schematic structural diagram of an example of an electronic device according to an embodiment of the present application;
FIG. 4 is a block diagram of a software architecture of an example electronic device according to an embodiment of the present application;
FIG. 5 is an application scenario diagram of an example of a method for establishing a connection with a stylus according to an embodiment of the present disclosure;
FIG. 6 is a flowchart of a method for establishing a connection with a stylus according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram showing an adsorption state of a handwriting pen according to an embodiment of the present disclosure;
FIG. 8 is a flowchart of another method for establishing a connection with a stylus according to an embodiment of the present disclosure;
FIG. 9 is a flowchart of another method for establishing a connection with a stylus according to embodiments of the present application;
Fig. 10 is a schematic diagram of an interaction flow between modules in an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" means two or more than two.
The terms "first," "second," "third," and the like, are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", or a third "may explicitly or implicitly include one or more such feature.
Currently, in order to facilitate users to use electronic devices such as a tablet computer, the tablet computer is equipped with a handwriting pen, and after the handwriting pen is bluetooth paired with the tablet computer, the users can use the handwriting pen to operate the tablet computer. For example, handwriting pens are used to write, draw, etc. on tablet computers. Therefore, bluetooth pairing of the stylus and the tablet computer is required in advance to establish a connection.
In one conventional technology, bluetooth pairing is typically performed on a stylus and a tablet computer by the following arrangement: as shown in fig. 1, a setting interface of the tablet computer is opened, a bluetooth option is clicked, and after entering the bluetooth setting interface, a bluetooth function switch is opened. At this time, the tablet computer can search for available devices through the Bluetooth signal and display the available devices in the available device list. If the stylus is located within the bluetooth signal search range of the tablet computer, the name of the stylus is displayed in the available device list, for example: M-Pencil. Then the user can select the handwriting pen, and then the tablet computer and the handwriting pen are connected in a Bluetooth mode, and the pairing process is completed.
In the conventional technology, a user needs to complete the pairing process through one step of operation of setting an interface, the operation is complicated, and the usability is poor for the user.
In another conventional technology, bluetooth pairing is typically performed on a stylus and a tablet computer by the following adsorption pairing method: the tablet personal computer is internally provided with a Hall sensor and a magnet, and the handwriting pen is internally provided with a plurality of magnets; if the stylus is adsorbed at the middle position (with a volume key) of the top of the tablet computer, the Hall sensor can identify the adsorption state, and when the state of normal adsorption is identified, the tablet computer can pop up a prompt box on a display screen, for example, as shown in fig. 2. Then, the user can click on the "connect" option in the prompt box, and the pairing process of the tablet computer and the handwriting pen can be completed.
In this conventional technology, since the arrangement of the Hall sensor needs to involve a plurality of peripheral devices such as a flexible circuit board (flexible printed circuit, FPC), a low dropout linear regulator (low dropout regulator, LDO), hardware corners, and the like, the hardware cost thereof is high.
In view of this, the embodiment of the present application provides a method for establishing connection with a stylus, which can reduce operation steps when a user pairs a tablet computer and the stylus, and improve usability; in addition, in the embodiment of the application, the geomagnetic sensor is used for acquiring the sensor data to identify the adsorption state of the handwriting pen, and the geomagnetic sensor can be connected with a chip in the electronic equipment in an I2C bus connection mode, so that the hardware cost is reduced. It should be noted that, the method for establishing connection with a handwriting pen provided in the embodiment of the present application may be applied to an electronic device capable of adsorbing a handwriting pen, such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), and the like, and the embodiment of the present application does not limit the specific type of the electronic device.
Fig. 3 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application. Taking the electronic device 100 as a tablet computer as an example, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, a magnet 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor AP, a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called directly from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The antenna 1 is used for transmitting and receiving electromagnetic wave signals. The structure of the antenna 1 in fig. 3 is only one example. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 1, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves to radiate through the antenna 1.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The magnetic sensor 180D includes a geomagnetic sensor (geomagnetic sensor). The electronic device 100 may detect the adsorption state of the stylus pen using the magnetic sensor 180D.
In general, the processor 110 of the electronic device 100 may further include a low-power CPU, that is, a sensor hub, where the sensor hub is mainly used to connect and process data from various sensor devices, and is a fast memory that can be directly accessed, and occupies about several hundred KB of memory space, so that the working power consumption of the electronic device can be reduced by processing the sensor data through the sensor hub. The sensor rhub can be connected with the geomagnetic sensor through an I2C bus mode, data of the geomagnetic sensor are read in real time, and then the adsorption state of the handwriting pen is identified through the method provided by the embodiment. And then the identified adsorption state is reported to an Application Processor (AP) by the sensor rhub, the AP is uploaded to a corresponding application (such as a Bluetooth keyboard application), the application decides whether connection with a handwriting pen is required to be established or not, and a prompt box is popped up for a user to select connection when the connection is required to be established. Because the I2C bus only needs one data line and one clock line, no special interface circuit is needed, and the filter of the on-chip interface circuit can filter burrs on bus data, the I2C bus simplifies hardware circuit wiring and reduces hardware cost.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The magnet 195 is usually disposed on the side of the electronic device 100 having the volume key, and can attract an object having magnetism, for example, a stylus pen having a plurality of magnets disposed therein, so that the stylus pen can be attracted to the magnet 195.
It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In this embodiment, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
Fig. 4 is a software configuration block diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is respectively an application layer, an application framework layer, a An Zhuoyun row (Android run) and system, a kernel layer and a hardware layer from top to bottom. The application layer may include a series of application packages.
As shown in fig. 4, the application package may include camera, gallery, calendar, map, navigation, WLAN, bluetooth, music, video, etc. applications.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 4, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, browsing history, bookmarks, and the like.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android runtimes include core libraries and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media library (media library), three-dimensional graphics processing library (e.g., openGL ES), 2D graphics engine (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The hardware layer at least comprises a geomagnetic sensor, a sensor rhub and an application processor AP. An algorithm module can be integrated in the sensor rhub and used for executing an algorithm process for identifying the adsorption state of the handwriting pen. And the identified adsorption state is reported to an Application Processor (AP) by the sensor rhub, and the AP is uploaded to the corresponding application.
For easy understanding, the following embodiments of the present application will take an electronic device having the structure shown in fig. 3 and fig. 4 as an example, and specifically describe a method for establishing connection with a handwriting pen provided in the embodiments of the present application with reference to the accompanying drawings and application scenarios.
The embodiment of the application is applicable to any electronic equipment which can be provided with a handwriting pen, and as shown in fig. 5, the handwriting pen can be adsorbed on one side of the electronic equipment, and a geomagnetic sensor is arranged inside the side. Fig. 6 is a flowchart of a method for establishing a connection with a stylus according to an embodiment of the present application, where the method is executed by an electronic device, and may specifically include:
s101, acquiring sensor data acquired by a geomagnetic sensor.
After the electronic equipment is started, the geomagnetic sensor is in an on state, so that the geomagnetic sensor can acquire the surrounding magnetic field intensity data in real time, for example, when a magnetic object approaches, the magnetic field intensity perceived by the geomagnetic sensor is enhanced, and the acquired magnetic field intensity data also changes correspondingly. After the electronic device acquires the sensor data acquired by the geomagnetic sensor, the following process of S102 may be performed on the sensor data acquired each time.
Alternatively, geomagnetic sensors typically have a three-axis coordinate system, and the sensor data acquired thereof may include three-axis magnetic fluxes, i.e., magnetic fluxes in the x-axis, y-axis, and z-axis (in weber Wb). Here, the definition of magnetic flux may be: in a uniform magnetic field with a magnetic induction strength B, there is a plane with an area S perpendicular to the magnetic field direction, and the product of the magnetic induction strength B and the area S (the effective area S, i.e. the area passing perpendicularly through the magnetic field lines) is called the magnetic flux passing through this plane.
In one implementation, the geomagnetic sensor collects sensor data in real time, and the sensor data can be obtained from the geomagnetic sensor in real time by a sensor rhub in the electronic device. Alternatively, the sensor rhub and the geomagnetic sensor may be connected through an I2C bus.
S102, determining the adsorption state of the stylus on the electronic equipment according to the sensor data.
It will be appreciated that geomagnetic sensors are typically located on one side of an electronic device, typically with a built-in magnet that may attract a magnet in a stylus to attract the stylus to the electronic device. When the handwriting pen is gradually close to the side, the magnetic field intensity perceived by the geomagnetic sensor is gradually increased due to the fact that the magnet is arranged in the handwriting pen, and then the collected triaxial magnetic flux is also gradually increased. Thus, the electronic device can determine the adsorption state of the stylus according to the triaxial magnetic flux in the sensor data, for example, the larger the magnetic flux is, the greater the possibility that the stylus is in a normal adsorption state.
In one implementation, if the triaxial magnetic fluxes in the sensor data are all greater than or equal to the corresponding magnetic flux thresholds, the electronic device may determine that the stylus is in a normal adsorption state. If at least one of the three axis magnetic fluxes in the sensor data is smaller than the corresponding magnetic flux threshold value, the electronic device can determine that the stylus is in a non-adsorption state.
Illustratively, assume that the set magnetic flux thresholds are respectively: the x-axis threshold is A, y, the B, z-axis threshold is C, and the triaxial magnetic flux acquired by the geomagnetic sensor is: x-axis magnetic flux a, y-axis magnetic flux b, and z-axis magnetic flux c. If a is greater than or equal to A, B is greater than or equal to B, and C is greater than or equal to C, the electronic device determines that the stylus is in a normal adsorption state. If a is smaller than A, B is smaller than B, or C is smaller than C, the electronic equipment determines that the handwriting pen is in a non-adsorption state.
In another implementation, at least one of the three axial magnetic fluxes may be selected, and the adsorption state of the stylus pen may be determined according to the magnitude relation between the magnetic fluxes and the magnetic flux threshold. In this embodiment, the magnetic flux of the coordinate axis perpendicular to the magnetic field direction in the triaxial coordinate system of the geomagnetic sensor is selected to determine (because the magnetic flux of the coordinate axis perpendicular to the magnetic field direction is larger), for example, the x-axis magnetic flux is selected to determine the adsorption state of the stylus pen.
Illustratively, assuming an x-axis threshold of a, the x-axis magnetic flux acquired is a. If the x-axis magnetic flux a is greater than or equal to the x-axis threshold A, the electronic device determines that the stylus is in a normal adsorption state. If the x-axis magnetic flux a is smaller than the x-axis threshold A, the electronic device determines that the stylus is in a non-adsorption state.
In still another implementation manner, in order to further accurately determine the adsorption state of the handwriting pen, the adsorption state may be divided into a normal adsorption state, a misplaced adsorption state and a non-adsorption state, and the effect schematic diagrams corresponding to the three adsorption states are shown in fig. 7, so that it can be seen that the misplaced adsorption state is a state between the normal adsorption state and the non-adsorption state, for example, the handwriting pen is obliquely placed on one side of the electronic device with a geomagnetic sensor. The three adsorption states are defined below:
in the embodiment of the present application, a surface of the stylus pen having a magnet (i.e., having an adsorption capability) is referred to as an adsorption surface, or an area of the stylus pen having a magnet is referred to as an adsorption point. If the adsorption surface or the adsorption point of the handwriting pen is in full contact with the electronic equipment, the handwriting pen is in a normal adsorption state; if the adsorption surface or the adsorption point of the handwriting pen is not completely contacted with the electronic equipment, the handwriting pen is called as a dislocation adsorption state; if the adsorption surface or adsorption point of the stylus pen is not in contact with the electronic device, the stylus pen is called an adsorption-free state.
In this implementation, as shown in fig. 8, the process of determining the adsorption state of the stylus according to the sensor data may include the steps of:
S1021, it is determined whether the sensor data satisfies the first condition, if yes, S1022 is executed, and if no, S1023 is executed.
Here, the first condition may be a set first magnetic flux threshold interval, where we may select the x-axis magnetic flux in the sensor data as a judgment object, judge whether the x-axis magnetic flux is located in the first magnetic flux threshold interval, execute S1022 if it is within the first magnetic flux threshold interval, and execute S1023 if it is not within the first magnetic flux threshold interval.
S1022, determining that the adsorption state of the stylus pen is a normal adsorption state.
Alternatively, the first magnetic flux threshold interval may be [ A1, A2]; for example, [ A1, A2] may be [ -1000wb,1000wb ], and if the obtained x-axis magnetic flux is located in the [ -1000wb,1000wb ], the adsorption state of the stylus pen is determined to be a normal adsorption state, as shown in fig. 7, that is, the adsorption surface or adsorption point of the stylus pen is in full contact with the electronic device.
S1023, judging whether the sensor data meets the second condition, if yes, executing S1024, and if not, executing S1025.
The second condition may be a set second magnetic flux threshold interval, and if the obtained x-axis magnetic flux is not located in the first magnetic flux threshold interval, the electronic device may further determine whether the x-axis magnetic flux is located in the second magnetic flux threshold interval. If the magnetic flux is within the second magnetic flux threshold interval, S1024 is executed, and if the magnetic flux is not within the second magnetic flux threshold interval, S1025 is executed.
S1024, determining that the adsorption state of the stylus pen is a misplaced adsorption state.
S1025, determining that the adsorption state of the stylus pen is an adsorption-free state.
Alternatively, the second magnetic flux threshold interval may be [ A3, A4]; illustratively, [ A3, A4] may be [ -1400Wb,1400Wb ], and if the obtained x-axis magnetic flux is located in the [ -1400Wb,1400Wb ] section, the suction state of the stylus pen is determined to be a dislocated suction state, as shown in FIG. 7, that is, the suction face or suction point of the stylus pen is not fully in contact with the electronic device. If the obtained x-axis magnetic flux is not located in the first magnetic flux threshold interval or the second magnetic flux threshold interval, determining that the adsorption state of the stylus pen is an adsorption-free state, namely that the adsorption surface or the adsorption point of the stylus pen is not contacted with the electronic equipment.
It will be appreciated that the values of [ A1, A2] and [ A3, A4] are not limited to the above examples, and may be set according to the actual characteristics of the electronic device and the stylus (such as the size and magnetic force of the built-in magnet, and the influence of the current inside the electronic device).
S103, popping up a connection prompt box according to the adsorption state of the handwriting pen.
As can be seen from the above process, the adsorption state of the stylus may include a normal adsorption state, a dislocation adsorption state and a non-adsorption state, and if the adsorption state is the normal adsorption state or the dislocation adsorption state, it can be inferred that the user wants to operate the electronic device by using the stylus, then it is necessary to connect the stylus with the electronic device. Therefore, in one implementation manner, if the bluetooth functions of the electronic device and the handwriting pen are both turned on at this time, the electronic device may search for the handwriting pen through the bluetooth signal, and pop up the connection prompt box as shown in fig. 2; then, the user can select a connection control in the connection prompt box so as to establish connection between the electronic equipment and the handwriting pen. Alternatively, the connection may be a bluetooth connection, i.e. a bluetooth pairing procedure is performed; other short-range communication connections are also possible, and the connection mode is not limited in the embodiments of the present application. If the Bluetooth function of the current electronic equipment is not started, the user can be prompted to start the Bluetooth switch, and the connection prompt box is popped up after the Bluetooth switch is started.
In another implementation manner, if the bluetooth functions of the electronic device and the handwriting pen are both turned on, the electronic device may automatically establish a bluetooth connection with the handwriting pen in the background without popping up the connection prompt box.
It will be appreciated that if the stylus is in a non-adsorbed state, it may be inferred that the user does not want to use the stylus to operate the electronic device, and the connection prompt box may not be popped up.
It is further understood that, in the case where the stylus is connected to the electronic device, if the user adsorbs the stylus to the electronic device again, the electronic device may not respond to the adsorption state.
In the embodiment, the electronic device determines the adsorption state of the handwriting pen by acquiring the sensor data of the geomagnetic sensor in real time, and then pops up the connection prompt box according to the adsorption state of the handwriting pen, so that a user can pair the electronic device with the handwriting pen, and the operation steps of the user when the user pairs the electronic device with the handwriting pen can be reduced, and the usability is improved; in addition, in the embodiment of the application, the geomagnetic sensor is used for acquiring the sensor data to identify the adsorption state of the handwriting pen, and the geomagnetic sensor can be connected with a chip in the electronic equipment in an I2C bus connection mode, so that the hardware cost is reduced.
On the basis of the above embodiment, since the sensor data of the geomagnetic sensor is acquired in real time, the above determination process is performed for each acquired sensor data. If the adsorption state of the handwriting pen determined according to the sensor data acquired in the nth second is a normal adsorption state, the electronic equipment ejects the connection prompt box, but the user moves the handwriting pen away again and does not want to use the handwriting pen, the connection prompt box ejected by the electronic equipment is useless, and the user needs to cancel the connection prompt box.
In order to reduce the unnecessary operations of the user, the electronic device may further perform the following steps after determining the adsorption state of the stylus pen, as shown in fig. 9, on the basis of fig. 8:
s1026, judging whether the adsorption state of the stylus is changed within a preset time period, if so, returning to S1021, and if not, executing S1027.
S1027, recording the adsorption state of the handwriting pen.
The preset duration may be N seconds, for example, may be 3 seconds. After the electronic device determines the adsorption state of the stylus pen by adopting the process of fig. 8, the electronic device continuously acquires the sensor data of the geomagnetic sensor, and determines the adsorption state of the stylus pen according to the continuously acquired sensor data. If the adsorption states of the handwriting pens corresponding to the sensor data acquired by the electronic equipment within N seconds are the same, the fact that the adsorption states of the handwriting pens are unchanged, namely the states are stable, can be determined. Then, the electronic device may record the adsorption state, and execute the operation of the subsequent step S103 according to the adsorption state, for example, determine whether to pop up the connection prompt box.
For example, assuming that the stylus adsorption state determined from the sensor data acquired in the nth second is a normal adsorption state, and then the stylus adsorption states corresponding to the sensor data acquired in the [ N, n+n ] second by the electronic device are both normal adsorption states, it may be determined that the stylus adsorption state has not changed. If the adsorption state of the handwriting pen corresponding to the sensor data acquired by the electronic device in [ N, n+n ] seconds is not the normal adsorption state, it can be determined that the adsorption state of the handwriting pen is changed, and then the electronic device continues to acquire the sensor data of the geomagnetic sensor, and the step S1021 is executed.
Through the embodiment shown in fig. 9, after determining the adsorption state of the stylus, the electronic device determines whether the state is stable, and if so, performs subsequent operations to reduce unnecessary operations of the user and improve the use experience of the user.
On the basis of the foregoing embodiment, in conjunction with the software architecture block diagram shown in fig. 4, the embodiment of the present application further provides a flowchart of a method for establishing a connection with a handwriting pen, which relates to a data interaction process between modules in an electronic device, as shown in fig. 10, where the process may include:
S201, the geomagnetic sensor acquires sensor data in real time.
S202, sensor data are acquired from the geomagnetic sensor by the sensor rhub.
The sensor rhub can be connected with the geomagnetic sensor through an I2C bus mode, sensor data are read from the geomagnetic sensor in real time, and the obtained sensor data can be described in the above S101.
S203, determining the adsorption state of the handwriting pen by the sensor data.
The implementation manner of determining the adsorption state of the stylus pen by using the sensor rhub can be referred to the description of fig. 8 or fig. 9, and will not be described herein. Alternatively, this step may be performed by an algorithm module in sensorhub.
S204, the sensor rhub sends the adsorption state of the stylus pen to the application processor AP.
Alternatively, this step may be sent by an event reporting module in sensorhub to the application processor AP. Optionally, the sensor rhub may also send an indication message to the application processor AP, where the indication message carries the adsorption state of the stylus pen.
S205, the application processor AP sends the adsorption state of the stylus pen to the service application.
S206, the business application determines to execute the action according to the adsorption state of the handwriting pen.
The business application may be, for example, a bluetooth keyboard application. If the adsorption state of the handwriting pen is a normal adsorption state or a dislocation adsorption state, the business application can call the popup window interface of the frame layer to pop up the connection prompt box so as to realize the process of establishing connection with the handwriting pen.
In the above embodiment, the sensor data of the geomagnetic sensor is acquired in real time to determine the adsorption state of the handwriting pen, so that the business application pops up the connection prompt box according to the adsorption state of the handwriting pen, and the user can pair the electronic equipment with the handwriting pen, so that the operation steps of the user when the user pairs the electronic equipment with the handwriting pen can be reduced, and the usability is improved; in addition, in the embodiment of the application, the geomagnetic sensor is used for acquiring the sensor data to identify the adsorption state of the handwriting pen, and the geomagnetic sensor can be connected with a chip in the electronic equipment in an I2C bus connection mode, so that the hardware cost is reduced.
Examples of the method for establishing connection with the stylus according to the embodiments of the present application are described above in detail. It will be appreciated that the electronic device, in order to achieve the above-described functions, includes corresponding hardware and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application in conjunction with the embodiments, but such implementation is not to be considered as outside the scope of this application.
The embodiment of the present application may divide the functional modules of the electronic device according to the above method examples, for example, may divide each function into each functional module corresponding to each function, for example, a detection unit, a processing unit, a display unit, or the like, or may integrate two or more functions into one module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
It should be noted that, all relevant contents of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
The electronic device provided in this embodiment is configured to execute the method for establishing connection with a stylus, so that the same effects as those of the implementation method can be achieved.
In case an integrated unit is employed, the electronic device may further comprise a processing module, a storage module and a communication module. The processing module can be used for controlling and managing the actions of the electronic equipment. The memory module may be used to support the electronic device to execute stored program code, data, etc. And the communication module can be used for supporting the communication between the electronic device and other devices.
Wherein the processing module may be a processor or a controller. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. A processor may also be a combination that performs computing functions, e.g., including one or more microprocessors, digital signal processing (digital signal processing, DSP) and microprocessor combinations, and the like. The memory module may be a memory. The communication module can be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip and other equipment which interact with other electronic equipment.
In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device according to this embodiment may be a device having the structure shown in fig. 3.
The embodiment of the application also provides a computer readable storage medium, in which a computer program is stored, which when executed by a processor, causes the processor to execute the method for establishing connection with a stylus according to any one of the embodiments.
The embodiment of the application also provides a computer program product, which when running on a computer, causes the computer to execute the relevant steps to realize the method for establishing connection with the handwriting pen in the embodiment.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component, or a module, and may include a processor and a memory connected to each other; the memory is configured to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory, so that the chip performs the method of establishing connection with the stylus in the above method embodiments.
The electronic device, the computer readable storage medium, the computer program product or the chip provided in this embodiment are used to execute the corresponding method provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding method provided above, and will not be described herein.
It will be appreciated by those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, 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 parts may or may not be physically separate, and the parts shown as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. 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 software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of 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 is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

1. A method of establishing a connection with a stylus, the method performed by an electronic device including a geomagnetic sensor, the method comprising:
the geomagnetic sensor collects magnetic flux;
and if the magnetic flux of at least one axis in the magnetic fluxes collected by the geomagnetic sensor at the first moment is located in a first magnetic flux threshold interval, and the magnetic fluxes of at least one axis in the magnetic fluxes collected by the geomagnetic sensor are located in the first magnetic flux threshold interval within a preset time after the first moment, displaying a connection prompt box, wherein the connection prompt box comprises a connection control.
2. The method of claim 1, wherein if at the first time instant the magnetic flux of at least one axis of the magnetic fluxes collected by the geomagnetic sensor is not within the first magnetic flux threshold interval, the method further comprises:
and if the magnetic flux of at least one axis in the magnetic fluxes collected by the geomagnetic sensor at the first moment is located in a second magnetic flux threshold interval, and the magnetic fluxes of at least one axis in the magnetic fluxes collected by the geomagnetic sensor are located in the second magnetic flux threshold interval within a preset time after the first moment, displaying a connection prompt box.
3. The method according to claim 2, wherein the method further comprises:
if the magnetic flux of at least one axis in the magnetic flux collected by the geomagnetic sensor is not located in the second magnetic flux threshold interval at the first moment, or the magnetic flux of at least one axis in the magnetic flux collected by the geomagnetic sensor is not located in the second magnetic flux threshold interval within the preset time after the first moment, a connection prompt box is not displayed.
4. The method of claim 1, wherein prior to determining that the magnetic flux of at least one axis of magnetic flux collected by the geomagnetic sensor at the first time is within the first magnetic flux threshold interval, the method further comprises:
and determining that the magnetic flux of at least one axis in the magnetic fluxes acquired by the geomagnetic sensor at the first moment is not located in a second magnetic flux threshold interval.
5. The method according to claim 4, wherein the method further comprises:
if the magnetic flux of at least one axis in the magnetic flux collected by the geomagnetic sensor is not located in a first magnetic flux threshold interval at the first moment, or the magnetic flux of at least one axis in the magnetic flux collected by the geomagnetic sensor is not located in the first magnetic flux threshold interval within a preset time after the first moment, a connection prompt box is not displayed.
6. The method of any one of claims 1 to 5, wherein after the displaying a connection prompt box, the method further comprises:
receiving touch operation of a user on the connection control;
and responding to the touch operation, sending a connection request to the handwriting pen, and establishing connection with the handwriting pen.
7. The method of claim 6, wherein the connection established between the electronic device and the stylus is a bluetooth connection.
8. The method of claim 1, wherein the electronic device further comprises a sensor hub, the method further comprising:
the sensor rhub acquires magnetic fluxes acquired by the geomagnetic sensor, and determines that at least one axis of the magnetic fluxes acquired by the geomagnetic sensor at the first moment is located in a first magnetic flux threshold interval, and that at least one axis of the magnetic fluxes acquired by the geomagnetic sensor is located in the first magnetic flux threshold interval within a preset time period after the first moment.
9. The method of claim 7, wherein the geomagnetic sensor and the sensor rhub are connected by means of an I2C bus.
10. The method according to claim 7 or 8, wherein the electronic device further comprises an application processor AP, and wherein displaying the connection prompt box comprises:
and the AP indicates the service application installed in the electronic equipment to display the connection prompt box according to the received indication message sent by the sensor rhub.
11. A method of establishing a connection with a stylus, the method performed by an electronic device including a geomagnetic sensor, the method comprising:
the geomagnetic sensor collects magnetic flux;
and if the magnetic flux of the first shaft in the magnetic flux collected by the geomagnetic sensor at the first moment is located in a first magnetic flux threshold interval, and the magnetic flux of the second shaft in the magnetic flux collected by the geomagnetic sensor at the first moment is located in a second magnetic flux threshold interval, displaying a connection prompt box, wherein the connection prompt box comprises a connection control.
12. The method of claim 11, wherein the method further comprises:
if the magnetic flux of the first axis is not located in the first magnetic flux threshold interval in the magnetic flux collected by the geomagnetic sensor at the first moment, or the magnetic flux of the second axis is not located in the second magnetic flux threshold interval in the magnetic flux collected by the geomagnetic sensor at the first moment, a connection prompt box is not displayed.
13. An electronic device, comprising:
one or more processors;
one or more memories;
a geomagnetic sensor;
the memory stores one or more programs that, when executed by the processor, cause the electronic device to perform the method of any of claims 1-12.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, causes the processor to perform the method of any of claims 1 to 12.
CN202211348893.XA 2022-06-28 2022-06-28 Method for establishing connection with handwriting pen and electronic equipment Pending CN117354772A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211348893.XA CN117354772A (en) 2022-06-28 2022-06-28 Method for establishing connection with handwriting pen and electronic equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211348893.XA CN117354772A (en) 2022-06-28 2022-06-28 Method for establishing connection with handwriting pen and electronic equipment
CN202210739104.9A CN114827972B (en) 2022-06-28 2022-06-28 Method for establishing connection with stylus pen and electronic equipment

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202210739104.9A Division CN114827972B (en) 2022-06-28 2022-06-28 Method for establishing connection with stylus pen and electronic equipment

Publications (1)

Publication Number Publication Date
CN117354772A true CN117354772A (en) 2024-01-05

Family

ID=82523235

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202211348893.XA Pending CN117354772A (en) 2022-06-28 2022-06-28 Method for establishing connection with handwriting pen and electronic equipment
CN202210739104.9A Active CN114827972B (en) 2022-06-28 2022-06-28 Method for establishing connection with stylus pen and electronic equipment

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202210739104.9A Active CN114827972B (en) 2022-06-28 2022-06-28 Method for establishing connection with stylus pen and electronic equipment

Country Status (1)

Country Link
CN (2) CN117354772A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115185389B (en) * 2022-09-09 2022-12-06 广州市保伦电子有限公司 Method, device, storage medium and system for identifying state of pen in lifting and placing process
CN117130496A (en) * 2023-04-24 2023-11-28 荣耀终端有限公司 Handwriting pen offset detection method and electronic equipment
CN117129763A (en) * 2023-04-24 2023-11-28 荣耀终端有限公司 Handwriting pen offset detection method and electronic equipment

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58103032A (en) * 1981-12-15 1983-06-18 Yokogawa Hokushin Electric Corp Character input device
EP2763380B1 (en) * 2013-01-31 2018-07-11 Sensirion AG Portable electronic device with improved chemical sampling
JP5472505B2 (en) * 2013-03-18 2014-04-16 大日本印刷株式会社 Computer apparatus and program
CN103309513B (en) * 2013-06-24 2016-02-03 中国科学技术大学 Comprise the handwriting input equipment of palm side surface information
DE102013214020A1 (en) * 2013-07-17 2015-02-19 Stabilo International Gmbh Digital pen
CN106055204B (en) * 2016-05-30 2020-06-23 联想(北京)有限公司 Information display method and device
CN110007784B (en) * 2019-02-28 2020-07-24 华为技术有限公司 Active stylus calibration method, active stylus and electronic equipment
CN113260963A (en) * 2019-03-08 2021-08-13 深圳市柔宇科技股份有限公司 Transmission method and transmission system of writing note information and electronic equipment
WO2021014701A1 (en) * 2019-07-19 2021-01-28 株式会社ワコム Electronic pen and handwriting input apparatus
KR20210014401A (en) * 2019-07-30 2021-02-09 삼성전자주식회사 Electronic device for identifying gesture by stylus pen and method for operating thereof
KR20210035002A (en) * 2019-09-23 2021-03-31 삼성전자주식회사 Electronic device for detecting stylus pen and method for operating thereof
CN113672099A (en) * 2020-05-14 2021-11-19 华为技术有限公司 Electronic equipment and interaction method thereof
CN113360031A (en) * 2021-03-25 2021-09-07 维沃移动通信有限公司 Display method, display device, electronic equipment and storage medium
CN113809835A (en) * 2021-08-11 2021-12-17 荣耀终端有限公司 Wireless charging method, device, chip, system and computer readable storage medium

Also Published As

Publication number Publication date
CN114827972A (en) 2022-07-29
CN114827972B (en) 2022-11-08

Similar Documents

Publication Publication Date Title
CN114827972B (en) Method for establishing connection with stylus pen and electronic equipment
CN113434288B (en) Memory management method and electronic equipment
CN111543042B (en) Notification message processing method and electronic equipment
AU2018456082B2 (en) Stylus detection method, system, and related device
KR20150026056A (en) An electronic device with curved bottom and operating method thereof
CN114217699A (en) Method for detecting pen point direction of stylus pen, electronic equipment and stylus pen
CN113986092A (en) Message display method and device
CN114371985A (en) Automated testing method, electronic device, and storage medium
WO2022161024A1 (en) Upgrade prompt method, terminal device, and computer readable storage medium
CN115879088A (en) Authority checking method and electronic equipment
WO2022117002A1 (en) Wireless charging method between electronic devices, storage medium, and electronic devices therefor
WO2021104000A1 (en) Screen display method and electronic device
CN113380240B (en) Voice interaction method and electronic equipment
WO2021238376A1 (en) Function pack loading method and apparatus, and server and electronic device
CN116780683A (en) Power supply control method and electronic equipment
CN117116258B (en) Voice awakening method and electronic equipment
CN108664421A (en) Obtain the method, apparatus and storage medium of multi-medium data
CN117082419B (en) Speaker control method, system, device, apparatus and storage medium
CN116708647B (en) Notification message reply method and electronic equipment
CN114006969B (en) Window starting method and electronic equipment
CN116088955B (en) Process processing method and terminal equipment
CN112565284B (en) Access control method and device for components in application program and electronic equipment
WO2024078251A1 (en) Display method and electronic device
CN118193092A (en) Display method and electronic equipment
CN116661616A (en) Device operation method, electronic device system, device, 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