CN117135602A - Data interaction method for handwriting pen multi-connection scene, handwriting pen and Bluetooth system - Google Patents

Data interaction method for handwriting pen multi-connection scene, handwriting pen and Bluetooth system Download PDF

Info

Publication number
CN117135602A
CN117135602A CN202310475859.7A CN202310475859A CN117135602A CN 117135602 A CN117135602 A CN 117135602A CN 202310475859 A CN202310475859 A CN 202310475859A CN 117135602 A CN117135602 A CN 117135602A
Authority
CN
China
Prior art keywords
data
transmission link
electronic device
stylus
data transmission
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
CN202310475859.7A
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 CN202310475859.7A priority Critical patent/CN117135602A/en
Publication of CN117135602A publication Critical patent/CN117135602A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Position Input By Displaying (AREA)

Abstract

The embodiment of the application provides a data interaction method based on a handwriting pen multi-connection scene, a handwriting pen and a Bluetooth system. In the method, the data transmission link is locked by determining the data transmission link matched with the electronic equipment, and the interactive data content is transmitted to the electronic equipment by utilizing the locked data transmission link. The problems of transmission link errors and link switching difficulty existing in data interaction between the handwriting pen and the electronic equipment under the handwriting pen multi-connection scene can be effectively solved.

Description

Data interaction method for handwriting pen multi-connection scene, handwriting pen and Bluetooth system
Technical Field
The embodiment of the application relates to the field of terminal equipment, in particular to a data interaction method for a handwriting pen multi-connection scene, a handwriting pen and a Bluetooth system.
Background
A stylus, as an input device, may be used to provide input to an interactive display of an electronic device. Therefore, many types of data interactions are often required between the stylus and the electronic device.
In a multi-connection scenario where a stylus is paired with multiple electronic devices, there may be transmission link errors and link switching difficulties in data interaction between the stylus and the electronic devices.
Disclosure of Invention
In order to solve the technical problems, the application provides a data interaction method based on a handwriting pen multi-connection scene, a handwriting pen and a Bluetooth system. In the method, the data transmission link is locked by determining the data transmission link matched with the electronic equipment, and the interactive data content is transmitted to the electronic equipment by utilizing the locked data transmission link. The problems of transmission link errors and link switching difficulty existing in data interaction between the handwriting pen and the electronic equipment under the handwriting pen multi-connection scene can be effectively solved.
In a first aspect, an embodiment of the present application provides a method for data interaction in a multi-connection scenario of a stylus, where the method is applied to the stylus, and a first wireless connection is established between the stylus and a plurality of electronic devices, where the first wireless connection is used to implement general service data transmission; the method comprises the following steps: in response to receiving a data interaction request of a first electronic device, determining a data transmission link for responding to the data interaction request; locking the data transmission link under the condition that the data transmission link is an effective transmission link; transmitting interactive data content with the first electronic device using the locked data transmission link, the first electronic device comprising any of the plurality of electronic devices.
The first electronic device can be any electronic device in the plurality of electronic devices, the data transmission link is locked by determining the data transmission link for responding to the data interaction request of the first electronic device, and interaction data content is transmitted to the first electronic device by utilizing the locked data transmission link, so that the data interaction between the handwriting pen and the plurality of electronic devices is realized under the handwriting pen multi-connection scene.
The writing pen and the plurality of electronic devices can carry out writing service data interaction, and also support the transmission of general service data, wherein the general service data comprises writing pen attribute data, firmware upgrading data, operation log data and the like. The method can effectively ensure the accuracy of the data transmission link when the handwriting pen interacts with the electronic equipment, and can effectively solve the problem of difficult switching of the data interaction link in a handwriting pen multi-connection scene.
According to a first aspect, the determining a data transmission link for responding to the data interaction request comprises: and determining the data transmission link according to the request type of the data interaction request and the physical address of the first electronic equipment.
The physical address of the first electronic device is used to uniquely identify the source of the interactive request. According to the request type of the data interaction request and the physical address of the first electronic equipment, the data transmission link used for interaction response is determined, and the accuracy and the effectiveness of the data transmission link during interaction response of the handwriting pen can be effectively ensured.
According to a first aspect, or any implementation manner of the first aspect, after determining a data transmission link for responding to the data interaction request, the method further includes: determining at least one candidate transmission link indicated by the request type, the at least one candidate transmission link corresponding to at least some of the plurality of electronic devices; and determining the data transmission link matched with the first electronic device as a valid transmission link under the condition that any candidate transmission link is not locked.
And under the condition that any candidate transmission link is not locked, the character handwriting pen does not process the data interaction request of the same type at the same time, and the response to the data interaction request of the first electronic device is determined.
According to a first aspect, or any implementation manner of the first aspect, after determining a data transmission link for responding to the data interaction request, the method further includes: determining a time interval for receiving a data interaction request of the second electronic device and the first electronic device in response to the received data interaction request of the second electronic device; and determining that the data transmission link matched with the first electronic device is an effective transmission link under the condition that the time interval indicates that the handwriting pen receives the data interaction request of the second electronic device based on the earlier time and the time interval is larger than a preset threshold value.
And under the condition that the handwriting pen receives the data interaction request of the second electronic device based on the earlier time and the time interval is larger than the preset threshold, the handwriting pen is characterized in that the handwriting pen does not process the data interaction requests of different electronic devices within the same time, and the fact that the handwriting pen can respond to the data interaction request of the first electronic device is determined.
According to a first aspect, or any implementation manner of the first aspect, the locking the data transmission link in the case that the data transmission link is a valid transmission link includes: and setting a status bit of the data transmission link as an occupied bit in a link table maintained by the handwriting pen so as to lock the data transmission link.
By locking the data transmission link for responding to the first electronic device, the accuracy of interaction response of the handwriting pen under the multi-connection scene can be effectively ensured, and interaction response of the handwriting pen to different electronic devices can be supported.
According to a first aspect, or any implementation manner of the first aspect, after the transmission with the first electronic device of the interactive data content is completed, the method further includes: in the link table, status bits of the data transmission links are set to available bits to release the locked data transmission links.
According to the first aspect, or any implementation manner of the first aspect, the data interaction request includes a firmware upgrade request; said transmitting interactive data content with said first electronic device using said locked data transmission link, comprising: determining whether to upgrade the handwriting pen firmware according to the firmware version number carried in the firmware upgrade request; and under the condition that the firmware of the handwriting pen is updated, returning updating response information to the first electronic equipment by utilizing the locked data transmission link, so that the first electronic equipment sends a firmware updating data packet based on the updating response information. The method is beneficial to realizing firmware upgrading of different electronic devices on the handwriting pen under a multi-connection scene, and can effectively ensure that firmware upgrading services triggered by different hosts can be smoothly carried out. The complex operation of the user is not needed, and the user experience is improved.
According to the first aspect, or any implementation manner of the first aspect, the determining whether to upgrade the handwriting pen firmware according to the firmware version number carried in the firmware upgrade request includes: and determining to perform handwriting pen firmware upgrading when the existing firmware version number of the handwriting pen is lower than the firmware version number in the firmware upgrading request and the handwriting pen is in a low-activity-level state. The firmware upgrade is carried out when the handwriting pen is in a low activity level state, so that the handwriting pen firmware upgrade can be effectively ensured not to be interrupted, and the handwriting pen firmware upgrade success rate can be effectively improved.
According to a first aspect, or any implementation manner of the first aspect, the transmitting interactive data content with the first electronic device using the locked data transmission link further includes: and returning upgrade status information to the first electronic device by utilizing the locked data transmission link in the process of running the firmware upgrade data packet. The upgrade status information includes, for example, upgrade progress information, upgrade interruption information, upgrade success information, and the like.
According to the first aspect, or any implementation manner of the first aspect, the method further includes: writing the firmware upgrading data packet into a target partition in the process of upgrading the firmware of the handwriting pen, wherein the target partition is different from a current running partition of the handwriting pen; setting the target partition as a partition to be operated of the handwriting pen; restarting the stylus, and running the firmware upgrading data packet in the partition to be run to realize firmware upgrading for the stylus.
According to a first aspect, or any implementation manner of the first aspect, the data interaction request includes a log export request; said transmitting interactive data content with said first electronic device using said locked data transmission link, comprising: and sending a running log data packet to the first electronic device by using the locked data transmission link. The handwriting pen maintenance and test service triggered by different hosts can be effectively guaranteed to be smoothly carried out under the handwriting pen multi-connection scene, the handwriting pen can be supported to send operation log data to different hosts, and the matching and accuracy of interaction response of the handwriting pen to different hosts can be effectively guaranteed.
According to a first aspect, or any implementation manner of the first aspect, the data interaction request includes a writing interaction request; said transmitting interactive data content with said first electronic device using said locked data transmission link, comprising: and transmitting writing pressure data to the first electronic device by using the locked data transmission link.
According to the first aspect, or any implementation manner of the first aspect, in a case that the data interaction request is a writing interaction request, it is characterized that a second wireless connection is further established between the first electronic device and the handwriting pen, where the second wireless connection is used to implement writing service data transmission; the method further comprises the steps of: responding to a received writing interaction request of the first electronic equipment, and taking the first electronic equipment as a main connection equipment; and directly transmitting writing pressure data matched with the writing interaction request to the main connection device.
According to a first aspect, or any implementation manner of the first aspect above, the second wireless connection is a hopp connection. The HOGP connection may be used to align the stylus with an application specification of the electronic device for wireless transmission of writing service data.
According to a first aspect, or any implementation manner of the first aspect, the first wireless connection is a GATT connection. The GATT connection may be used to align the stylus with the core protocol of the electronic device for wireless transmission of general service data.
In a second aspect, an embodiment of the present application provides a stylus, where a first wireless connection is established between the stylus and a plurality of electronic devices, where the first wireless connection is used to implement general service data transmission; the stylus includes a processor and a memory for storing instructions that, when executed by the processor, cause the stylus to: responding to a received data interaction request of a first electronic device, and determining a data transmission link matched with the first electronic device according to the request type of the data interaction request; locking the data transmission link under the condition that the data transmission link is an effective transmission link; transmitting interactive data content with the first electronic device using the locked data transmission link, the first electronic device comprising any of the plurality of electronic devices.
Any implementation manner of the second aspect and the second aspect corresponds to any implementation manner of the first aspect and the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation manner of the second aspect may be referred to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which are not described herein.
In a third aspect, an embodiment of the present application provides a bluetooth system, including a stylus and a plurality of electronic devices, where a first wireless connection is established between the stylus and the plurality of electronic devices, where the first wireless connection is used to implement general service data transmission, a first electronic device in the plurality of electronic devices initiates a data interaction request to the stylus, and the stylus executes the data interaction method according to the first aspect
In a fourth aspect, embodiments of the present application provide a computer readable medium storing a computer program comprising instructions for performing the method of the first aspect or any possible implementation of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program comprising instructions for performing the method of the first aspect or any possible implementation of the first aspect.
In a sixth aspect, an embodiment of the present application provides a chip, where the chip includes a processing circuit and a transceiver pin. Wherein the transceiver pin and the processing circuit communicate with each other via an internal connection path, the processing circuit performing the method of the first aspect or any one of the possible implementation manners of the first aspect to control the receiving pin to receive signals and to control the transmitting pin to transmit signals.
Drawings
Fig. 1 is a schematic diagram illustrating an application scenario;
fig. 2 is a schematic diagram of an exemplary bluetooth protocol framework;
FIG. 3 is a schematic diagram of a communication connection of an exemplary stylus with an electronic device;
FIG. 4 is a block diagram of the software architecture of an exemplary stylus and electronic device;
fig. 5 is a schematic diagram of a data interaction process between a stylus pen and a first electronic device according to an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a process of firmware upgrade interaction between a stylus and a first electronic device according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a process for partition switching of a stylus according to an embodiment of the present application;
FIG. 8 is a schematic diagram illustrating interaction between a stylus and a first electronic device in firmware upgrade according to an embodiment of the present application;
FIG. 9 is a schematic diagram illustrating a process of log-derived interaction between a stylus and a first electronic device according to an embodiment of the present application;
FIG. 10 is a schematic diagram illustrating a process of writing interaction between a stylus and a first electronic device according to an embodiment of the present application;
fig. 11 is a schematic diagram of a data interaction flow between a stylus and a first electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone.
The terms first and second and the like in the description and in the claims of embodiments of the application, are used for distinguishing between different objects and not necessarily for describing a particular sequential order of objects. For example, the first target object and the second target object, etc., are used to distinguish between different target objects, and are not used to describe a particular order of target objects.
In embodiments of the application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the description of the embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" means two or more. For example, the plurality of processing units refers to two or more processing units; the plurality of systems means two or more systems.
Before the technical scheme of the embodiment of the application is described, an application scene of the embodiment of the application is described with reference to the attached drawings. Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present application. The application scenario includes a stylus 100 and a plurality of electronic devices, where the plurality of electronic devices includes, for example, a tablet 110a, a tablet 110c, a mobile phone 110b, and a mobile phone 110d. A first wireless connection is established between the stylus 100 and the plurality of electronic devices, the first wireless connection being for enabling universal service data transmission. The general service data includes, for example, handwriting attribute data, screen parameter data, handwriting firmware upgrade data, handwriting operation log data, and other types of data.
The first wireless connection between the stylus 100 and the plurality of electronic devices may be established through a near field communication technology, including, for example, bluetooth, wiFi, or NFC (Near Field Communication ) technology, or the like. Illustratively, the stylus 100 establishes a first wireless connection with a plurality of electronic devices through a bluetooth network, where the first wireless connection may be, for example, a generic attribute (Generic Attribute, GATT) protocol connection, and GATT is a generic specification for transmitting or receiving data segments that is established over the bluetooth connection.
It should be noted that, in practical application, the number of handwriting pens, tablet computers and mobile phones may be one or more, and the number of each electronic device in fig. 1 is only an illustrative example, which is not a limitation of the present application. In the embodiment of the application, the data interaction between the handwriting pen and the tablet computer is taken as an example for explanation, and in other embodiments, the application can also be suitable for the data interaction between the handwriting pen and the mobile phone, the intelligent large screen, the notebook computer, the wearable equipment and other electronic equipment with touch screens, and the application is not limited.
In an embodiment of the present application, the stylus 100 may include an active stylus and a passive stylus, and the stylus 100 is, for example, an active stylus. In some embodiments, the active stylus is an active capacitive stylus that can emit a voltage drive signal to change an electric field at a touch point of the touch screen, thereby changing an electrode capacitance at the touch point. The control chip of the touch screen can determine the position of the touch point by detecting the change of the electrode capacitance. In other embodiments, an active stylus may also be employed, and the active electromagnetic stylus may emit electromagnetic drive signals to change the magnetic flux at the touch point of the touch screen. The control chip of the touch screen can determine the position of the touch point by detecting the change of the magnetic flux. In addition, a pressure sensor can be added into the pen point of the active touch pen so as to simulate the real handwriting of a person through the pen point under different forces.
Under the multi-connection scene of the handwriting pen, the handwriting pen is paired with a plurality of electronic devices, and a first wireless connection is established, wherein the first wireless connection is used for realizing universal service data transmission. The general service data includes, for example, handwriting attribute data, screen parameter data, handwriting firmware upgrade data, handwriting operation log data, and the like. The first wireless connection may be, for example, a GATT connection that may be used to align the stylus with a core protocol of the electronic device for wireless transmission of general service data.
In the process of establishing the GATT connection between the electronic equipment and the handwriting pen, the electronic equipment pops up a prompt box, a user indicates agreement to establish the GATT connection by clicking a connection button in the prompt box, and then the GATT connection is established between the electronic equipment and the handwriting pen. If the user clicks a cancel button in the prompt box, the user does not agree to establish the GATT connection, and the electronic equipment and the handwriting pen fail to establish the GATT connection.
After the electronic device establishes the GATT connection with the stylus, the electronic device may automatically establish a second wireless connection with the stylus, which may be, for example, a hopp connection. The HOGP connection may be used to align the stylus with an application specification of the electronic device for wireless transmission of writing service data. For example, when the pen tip of the stylus touches the touch screen of the electronic device, the HOGP connection is automatically established between the stylus and the electronic device, so that a user can perform a touch operation on the electronic device using the stylus. The handwriting pen can be connected with a plurality of electronic devices in a GATT mode, and the HOGP connection between the handwriting pen and the corresponding electronic device can be achieved through touch operation on a certain electronic device.
The Bluetooth communication unit in the handwriting pen can provide two service interfaces for the service side, wherein one service interface is a GATT connection interface, and the other service interface is a HOGP connection interface. The service mode that can be supported by the service side of the handwriting pen is simpler, for example, the service side of the handwriting pen does not support context tracing of message sources and does not support multiple electronic devices to initiate the same service at the same time. Therefore, in the process of data interaction with the electronic device, the service side of the handwriting pen may not distinguish the source of the request, and does not distinguish the message reply channel for requesting the response, but uniformly replies the message to the electronic device connected with the handwriting pen, i.e. sends the message to the electronic device connected with the handwriting pen with the HOGP. Therefore, in a multi-connection scenario where a stylus is paired with a plurality of electronic devices, there may be a transmission link error and a link switching difficulty in data interaction between the stylus and the electronic devices.
For example, a GATT connection is established between the stylus 100 and the tablet 110a, and the stylus 100 and the tablet 110a support transmission of general service data such as firmware upgrade data, a stylus operation log, stylus attributes, and a stylus operating state. The GATT connection and the hotp connection are established between the stylus 100 and the tablet 110c, and the transmission of the writing pressure data is supported between the stylus 100 and the tablet 110c in addition to the transmission of the general service data such as firmware upgrade data, stylus operation logs, stylus attributes, stylus working states and the like.
In the case where the tablet pc 110a initiates a firmware upgrade request to the stylus 100, since the stylus 100 only supports request response according to the message type, but not according to the message source channel, the stylus 100 may send upgrade response information to the tablet pc 110c, thereby causing failure of upgrade response to the tablet pc 110a, and disabling normal firmware upgrade to the stylus 100.
The firmware upgrade refers to updating or upgrading firmware in the hardware device. Firmware is an embedded software in a hardware device that controls the basic functions of the device, such as startup, input/output, network connection, etc. Firmware upgrades may be used to fix known vulnerabilities, increase device functionality, improve device performance and stability, guarantee device security, and the like.
Fig. 2 is a schematic diagram of an exemplary bluetooth protocol framework, and as shown in fig. 2, the bluetooth protocol framework may include a Host, an HCI (Host Controller Interface, host control interface), and a Controller. The Host protocol stack defines a plurality of applications (profiles) and core protocols (protocols) in the bluetooth framework. Core protocols include, but are not limited to, bluetooth-based services protocols SDP (Service Discover Protocol), generic attribute (Generic Attribute, GATT) protocols, and the like.
HCI provides a unified interface to the link manager and a unified way to enter baseband for upper layer protocols. HCI defines the underlying protocols between Host and Controller, such as data transport formats, commands and events, etc. The Controller defines the underlying hardware components including an RF (Radio Frequency) layer, a baseband (Base band) layer, and an LM (Link Manager) layer. The LM layer may be used to manage link establishment, link maintenance, link release, etc. operations between bluetooth devices. In addition, the LM layer can also be used for transmitting and receiving data packets and ensuring the safety and reliability of data packet transmission.
Fig. 3 illustrates a schematic diagram of a communication connection of a stylus with an electronic device. As shown in fig. 3, stylus 200 includes, but is not limited to: the components of the stylus 200 shown in fig. 3 include, but are not limited to, a pressure sensor 201, a microcontroller unit (microcontroller unit, MCU) 202, a bluetooth communication unit 203, a bluetooth antenna 204, and a code electrode 205. In other embodiments of the present application, stylus 200 may include more or fewer components than shown, or certain components may be combined, certain components may be split, or different arrangements of components.
Optionally, the pressure sensor 201 may be configured to obtain a motion track signal of the pen tip of the stylus 200, sense a pressure applied to the pen tip of the stylus 200 by a contact surface (e.g., a touch screen of the electronic device 210), obtain a corresponding pressure parameter, and report the pressure parameter to the MCU202. The types of pressure sensors 201 include, for example, resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc., which include at least two parallel plates with conductive material.
It should be noted that the MCU202 is only illustrative, and other devices that can function as a processor or a microcontroller may be alternative to the MCU described above.
The MCU202 is used to process the pressure parameters received from the pressure sensor 201 accordingly. Alternatively, the MCU202 may generate a pressure-sensitive signal based on the pressure parameter acquired from the pressure sensor 201, and output the pressure-sensitive signal to the electronic device 210 through the bluetooth communication unit 203 and the bluetooth antenna 204. Correspondingly, the antenna in the electronic device 210 may acquire the corresponding pressure parameter based on the received pressure sensing signal, and transmit the acquired pressure parameter to the bluetooth driver, where the bluetooth driver continuously reports the pressure parameter to an upper module (e.g. TP HAL), and the upper module may perform corresponding processing on the pressure parameter.
Illustratively, the code electrode 205 is located at the pen tip side of the stylus pen, and when the pen tip of the stylus pen 200 is close to the touch screen of the electronic device, the code electrode 205 may be used to receive the detection signal sent by the TP sensor of the electronic device 210 and send the detection signal to the MCU202. The MCU202 may control the encoding electrode 205 to output a square wave signal (the square wave signal may also be referred to as a touch signal, a trigger signal, a touch signal, or the like) having a specified frequency based on the received detection signal. Accordingly, the electronic device 210 may determine the position of the tip of the stylus 200 on the touch screen of the electronic device based on the square wave signal received by the TP sensor.
In some embodiments, bluetooth communication unit 203 may be configured to listen for signals transmitted by electronic device 210, such as probe requests, scan signals, firmware upgrade requests, log export requests, etc., and to send probe responses, scan responses, firmware upgrade responses, running log data packets, etc., accordingly. The bluetooth communication unit 203 may be configured to establish a wireless communication connection with the electronic device 210, so as to implement data interaction with the electronic device.
Alternatively, the pressure sensor 201, the MCU202, the bluetooth communication unit 203, and the bluetooth antenna 204 may be integrated on the same chip, or may be separate components and connected through a bus.
In some embodiments, stylus 200 may also employ other short-range wireless technologies for data interaction with electronic device 210, such as Wi-Fi technology, ultra Wide Band (UWB) technology, and the like. It will be appreciated that when stylus 200 and the electronic device communicate interactive data content via Wi-Fi technology, both stylus 200 and electronic device 210 have Wi-Fi communication units therein.
Fig. 4 is a block diagram illustrating a software structure of a stylus and an electronic apparatus. The layered architecture divides the software into a plurality of layers, each layer has clear roles and division, and the layers are communicated through software interfaces.
In some embodiments, the system of stylus 200 may be divided into three layers, an application layer, a service layer, and a driver layer, respectively, from top to bottom. As shown in fig. 4, the application layer may include a series of application packages, the application layer includes, for example, a host-side communication agent, the service layer includes, for example, touch management and bluetooth communication management, and the driver layer includes, for example, a pen-side driver.
In some embodiments, the system of the electronic device 210 may be divided into three layers, an application layer, a service layer, and a driver layer, respectively, from top to bottom. As shown in fig. 4, the application layer may include a series of application packages, the application includes, for example, a stylus management application, the service layer includes, for example, a stylus management service and a near field communication management service, and the driving layer includes, for example, a Touch Panel (TP) driver, a human interface device (Human Interface Device, HID) driver, and a near field communication driver. By way of example, the near field communication management service may include a bluetooth management service, an NFC management service, a Wi-Fi management service, etc., and the near field communication drive may include a bluetooth drive, an NFC drive, a Wi-Fi drive, etc.
The process of data interaction between the stylus and the first electronic device is schematically described below in connection with the interaction schematic of the modules shown in fig. 5. The handwriting pen is paired with the plurality of electronic devices and establishes a first wireless connection, and the first wireless connection is used for realizing universal service data transmission. The general service data includes, for example, handwriting attribute data, screen parameter data, handwriting operation state data, handwriting firmware upgrade data, handwriting operation log data, and the like. The first wireless connection may be, for example, a GATT connection for aligning the stylus with a core protocol of the electronic device.
As shown in fig. 5, the data interaction process includes operations S101 to S104, for example.
In operation S101, a stylus receives a data interaction request initiated by a first electronic device.
The first electronic device may be any electronic device of a plurality of electronic devices, for example. The Bluetooth communication unit in the handwriting pen receives a data interaction request initiated by the first electronic equipment and transmits the data interaction request to the service side of the handwriting pen. Request types of data interaction requests include, for example, firmware upgrade requests, log export requests, write interaction requests, and the like. The bluetooth communication unit in the handwriting pen can provide two types of service interfaces for the service side, wherein one service interface is a GATT connection interface, and the other service interface is a hotp interface. The Bluetooth communication unit can transmit the data interaction request to the service side through the GATT connection interface, and the service side responds based on the data interaction request.
In operation S102, the stylus determines a data transmission link for responding to the data interaction request.
For example, the data transmission link for responding to the data interaction request may be determined by the bluetooth communication unit in the stylus according to the request type of the data interaction request and the physical address of the first electronic device. After the Bluetooth communication unit transmits the data interaction request to the service side, the service side responds to the data interaction request to obtain interaction data content, the interaction data content is transmitted to the Bluetooth communication unit, and the Bluetooth communication unit transmits the interaction data content to the first electronic device by utilizing the determined data transmission link.
The operation of determining the data transmission link by using the bluetooth communication unit may be performed before the bluetooth communication unit delivers the data interaction request to the service side, may be performed after the bluetooth communication unit receives the interaction data content transmitted by the service side, or may be performed after the bluetooth communication unit delivers the data interaction request to the service side and before receiving the interaction data content transmitted by the service side, which is not limited in this embodiment.
In operation S103, the stylus locks the determined data transmission link.
Illustratively, a bluetooth communication unit in the stylus may be utilized to determine whether the data transmission link is a valid transmission link prior to locking the data transmission link. In case the data transmission link is determined to be a valid transmission link, the data transmission link is locked by means of the bluetooth communication unit.
In an exemplary manner, a bluetooth communication unit in a stylus is used to determine, based on the request type of the data interaction request, candidate transmission links matching the request type, i.e. candidate transmission links for processing data interaction requests of the same request type. For example, in the case where the request type of the data interaction request is a firmware upgrade request, the bluetooth communication unit regards all transmission links in the link table for processing the firmware upgrade request as candidate transmission links matching the firmware upgrade request. The candidate transmission link may correspond to at least a portion of the plurality of electronic devices, at least a portion of which may include the first electronic device.
After determining candidate transmission links matching the request type, the bluetooth communication unit determines whether any of the candidate transmission links is in a locked state. And in the case that any candidate transmission link is not in a locked state, determining the data transmission link for responding to the first electronic device as a valid transmission link. Because the service side of the handwriting pen does not support the simultaneous processing of the data interaction requests of the same type, the service side of the handwriting pen is characterized as processing the data interaction requests of the same type under the condition that the candidate transmission link is in a locking state, and the data transmission link is not locked at the moment, namely the data interaction requests of the first electronic equipment are not responded.
In another example manner, since the service side of the stylus does not support processing the data interaction requests of different electronic devices at the same time, when the bluetooth communication unit further receives the data interaction request of the second electronic device, the bluetooth communication unit is used to determine a time interval for receiving the data interaction request of the second electronic device and the first electronic device. And under the condition that the time interval indicates that the handwriting pen receives the data interaction request of the second electronic equipment based on the earlier time and the time interval is larger than a preset threshold value, determining that the data transmission link matched with the first electronic equipment is an effective transmission link.
The request type of the data interaction request initiated by the second electronic device may be different from the request type of the data interaction request initiated by the first electronic device, and may be the same as the request type of the data interaction request initiated by the first electronic device. In the event that the time interval indicates that the stylus receives a data interaction request from the second electronic device based on an earlier time, it is determined whether the time interval is greater than a preset threshold.
And under the condition that the time interval is larger than the preset threshold, representing the reserved abundant time for the handwriting pen to process the data interaction request of the second electronic equipment, wherein the handwriting pen can additionally process the data interaction request of the first electronic equipment. And under the condition that the time interval is smaller than or equal to a preset threshold value, representing that the insufficient time is not reserved for the handwriting pen to process the data interaction request of the second electronic equipment, and additionally processing the data interaction request of the first electronic equipment at the moment can cause errors on the service side of the handwriting pen, so that the data transmission link for responding to the first electronic equipment is taken as an invalid transmission link. The threshold value of the time interval may be set empirically or in actual condition, and this embodiment is not limited thereto.
In the case where the data transmission link is determined to be a valid transmission link, the Bluetooth communication unit locks the data transmission link. Illustratively, with a bluetooth communication unit, the status bits of the data transmission links in the link table are set to the occupied bits to achieve locking of the data transmission links. For example, with a bluetooth communication unit, the status bit of the data transmission link with the link ID of 011 in the link table is set to 1 to lock the data transmission link. The data transmission link with the link ID 011 may be, for example, a message transmission channel for responding to a firmware upgrade request of the first electronic device.
In operation S104, the stylus transmits data interactive contents with the first electronic device using the locked data transmission link.
The service side of the stylus pen responds to the data interaction request, and then the data interaction content obtained by the response is transmitted to the Bluetooth communication unit. The bluetooth communication unit transmits the data interaction content to the first electronic device using the locked data transmission link. For example, in the case where the first electronic device initiates a firmware upgrade request, the bluetooth communication unit transmits upgrade response information, e.g., indicating whether the first electronic device is allowed to transmit a firmware upgrade data packet, to the first electronic device using the locked data transmission link. For another example, in the case where the first electronic device initiates a log export request, the bluetooth communication unit sends a running log data packet of the stylus to the first electronic device using the locked data transmission link.
As an alternative, the bluetooth communication unit sets the status bit of the data transmission link to an available bit to release the locked data transmission link in the link table after the completion of the transmission of the interactive data content over the data transmission link. For example, with a bluetooth communication unit, the status bit of the data transmission link with the link ID 011 in the link table is set to 0 to release the locked data transmission link.
The firmware upgrade interaction process between the stylus and the first electronic device is schematically described below in connection with the interaction schematic of the modules shown in fig. 6.
As shown in fig. 6, the firmware upgrade interaction process includes operations S201, S21, S22, and S208 to S213, for example.
In operation S201, a bluetooth communication unit in a stylus receives a firmware upgrade request initiated by a first electronic device.
Illustratively, firmware upgrades for handwriting are aimed at, for example, increasing handwriting functionality, increasing compatibility with newly developed displays, improving handwriting performance, providing patches/patches, enhancing security, and the like.
In operation S21, a firmware upgrade response is performed using the firmware upgrade unit in the stylus pen, and operation S21 may include operations S202 to S204, for example.
In operation S202, the bluetooth communication unit in the stylus communicates the firmware upgrade request to the firmware upgrade unit.
Illustratively, the bluetooth communication unit may distinguish between the sources of the received interactive requests, e.g., the bluetooth communication unit may determine the target electronic device that initiated the firmware upgrade request based on the physical address of the requesting source device, etc. The physical address of the requesting source device is used to uniquely identify the electronic device and may be used to ensure the uniqueness of the electronic device. The physical address of the requesting source device may include, for example, a media access control (Media Access Control, MAC) address of the electronic device, which may be, for example, a bluetooth MAC address of the electronic device.
In operation S203, the firmware upgrade unit determines whether to perform firmware upgrade based on the firmware upgrade request.
Illustratively, the firmware upgrade unit determines whether to upgrade the handwriting pen firmware according to the firmware version number carried in the firmware upgrade request. In one example manner, a stylus firmware upgrade is determined to be performed where an existing firmware version number of the stylus is lower than a firmware version number in a firmware upgrade request and the stylus is in a low activity level state.
Alternatively, the firmware upgrade unit may determine that the stylus is in a low activity level state in a case where the stylus is in a stable charge state. For example, when the firmware upgrade unit detects that the stylus pen is in a charging state and the charging time period is longer than a set threshold value, it deduces that the stylus pen is in a stable charging state, and the user is less likely to use the stylus pen in a short period of time, and the stylus pen is in a low activity level state.
For another example, the firmware upgrade unit may determine whether the stylus is in a low activity level state according to an operation state of an activity level sensor in the stylus. The activity level sensor includes, for example, a pressure sensor in a stylus, an inertial sensor, a light-based proximity sensor, a magnetic sensor, and the like.
In operation S204, the firmware upgrade unit transmits upgrade response information to the bluetooth communication unit.
Illustratively, after determining whether to perform the stylus firmware upgrade, the firmware upgrade unit transmits upgrade response information to the bluetooth communication unit, the upgrade response information indicating whether to allow the first electronic device to transmit the firmware upgrade data packet. In general, in the event that a stylus firmware upgrade is determined to be performed, the upgrade response information indicates that the first electronic device is allowed to transmit a firmware upgrade data packet. And under the condition that the firmware of the handwriting pen is not upgraded, the upgrade response information indicates that the first electronic equipment is refused to send the firmware upgrade data packet.
In operation S22, the data transmission link for responding to the firmware upgrade request is locked using the bluetooth communication unit in the stylus pen, and operation S22 may include operations S205 to S207, for example.
In operation S205, the bluetooth communication unit determines a data transmission link for responding to the firmware upgrade request.
Illustratively, in the link table maintained by the stylus, the bluetooth communication unit determines a data transmission link for responding to the firmware upgrade request of the first electronic device based on the physical address of the first electronic device and link information in the link table. The link information in the link table includes, for example, information about the function of the transmission link, for example, a request type of the data exchange request to which the corresponding transmission link matches, status bits, for example, indicating whether the corresponding transmission link is locked, link IDs, for example, indicating an exchange request type associated with the corresponding transmission link and a physical address of the electronic device.
In operation S206, the bluetooth communication unit determines whether the data transmission link is a valid transmission link.
Illustratively, the bluetooth communication unit may consider all transmission links matching the firmware upgrade request as candidate transmission links in a link table maintained by the stylus. In other words, all transmission links in the link table for responding to the firmware upgrade request are taken as candidate transmission links. The candidate transmission link may correspond to at least some of the plurality of electronic devices, which may include the first electronic device.
The bluetooth communication unit determines whether any of the candidate transmission links is in a locked state. Illustratively, the bluetooth communication unit may determine whether the corresponding candidate transmission link is in a locked state based on the status bit information in the link table. In the event that none of the candidate transmission links is in a locked state, the data transmission link for responding to the firmware upgrade request of the first electronic device is determined to be a valid transmission link. In the case where there is a candidate transmission link in a locked state, the data transmission link for responding to the firmware upgrade request of the first electronic device is determined to be an invalid transmission link.
In the case where any candidate transmission link is in a locked state, it is characterized that the stylus is processing other interactive requests of the same type, which may be initiated by the first electronic device or by other electronic devices than the first electronic device. Since the service side of the stylus does not support processing a plurality of identical data interaction requests at the same time, the data transmission link for responding to the firmware upgrade request of the first electronic device is used as an invalid transmission link when any candidate transmission link is in a locked state, and at this time, the stylus may not respond to the firmware upgrade request of the first electronic device.
In operation S207, the bluetooth communication unit locks an active data transmission link.
For example, in the case where it is determined that the data transmission link is a valid transmission link, the bluetooth communication unit may set a status bit of the data transmission link to an occupied bit to lock the data transmission link in the link table.
The execution order of the operations S21 and S22 may be arbitrarily adjusted. That is, the operation of performing the firmware upgrade response using the firmware upgrade unit may be performed before the operation of locking the data transmission link using the bluetooth communication unit, may be performed after the operation of locking the data transmission link using the bluetooth communication unit, or may be performed simultaneously with the operation of locking the data transmission link using the bluetooth communication unit.
In operation S208, upgrade response information is transmitted to the first electronic device using the locked data transmission link through the bluetooth communication unit.
In operation S209, a firmware upgrade data packet transmitted by the first electronic device is received through the bluetooth communication unit.
In an exemplary case, the upgrade response information indicates that the firmware upgrade is performed, the stylus upgrade management unit of the first electronic device transmits a firmware upgrade data packet.
In operation S210, the bluetooth communication unit transfers the firmware upgrade data packet to the firmware upgrade unit.
In operation S211, the firmware upgrade unit installs the firmware upgrade data packet to upgrade the firmware of the stylus pen.
The firmware upgrading unit may install the received firmware upgrading data packet immediately, or may cache the firmware upgrading data packet in a storage unit of the stylus pen, and install the firmware upgrading data packet when the stylus pen is in a low activity level state, so as to upgrade the firmware of the stylus pen.
The firmware upgrade unit transmits upgrade status information to the bluetooth communication unit in operation S212.
In operation S213, the bluetooth communication unit transmits upgrade status information to the first electronic device using the locked data transmission link.
Illustratively, the upgrade status information includes, for example, upgrade progress information, upgrade interruption information, upgrade success information, and the like.
After receiving the firmware upgrading data packet, the firmware upgrading unit can write the firmware upgrading data packet into an upgrading partition in the handwriting pen, and the upgrading partition can be independent of other partitions except the running partition of the handwriting pen. In the process of updating the firmware of the handwriting pen, the firmware updating unit copies the firmware updating data packet to a target partition in the running partition, and the target partition can be different from the current running partition of the handwriting pen. Then, the firmware upgrading unit sets the target partition as a partition to be operated of the handwriting pen, and operates the firmware upgrading data packet in the partition to be operated by restarting the handwriting pen so as to realize firmware upgrading for the handwriting pen.
The following describes a schematic description of the partition switching process in the stylus in conjunction with the partition switching schematic diagram shown in fig. 7. The partition switching process includes operations S301 to S303, for example.
Illustratively, in the packet transfer process shown in fig. 7a, the firmware upgrade unit writes the received firmware upgrade data packet to an upgrade partition in the stylus, which may be a partition independent of other partitions of the stylus. In the case where the chip in the stylus supports dual partitions, the running partitions include, for example, partition a and partition B.
In the installation process as shown in fig. 7b, the firmware upgrade unit copies the firmware upgrade data packet to a target partition among the operating partitions, which may be different from the current operating partition of the stylus, in operation S302. For example, the current running partition of the stylus is a partition a pointed by a running partition pointer, and the target partition of the copied firmware upgrade data packet may be a partition B, where the partition a and the partition B are different running partitions in the stylus.
As an alternative embodiment, the firmware upgrade unit may check the received firmware upgrade data packet, for example, check the integrity of the firmware upgrade data packet, and check whether the firmware upgrade data packet is tampered with, before writing the firmware upgrade data packet to the target partition. And under the condition that the firmware upgrading data packet is complete and is not tampered, the firmware upgrading unit writes the firmware upgrading data packet into a target partition in the handwriting pen.
In the partition switching and restarting process shown in fig. 7c, operation S303 is performed, and the firmware upgrade unit is used to restart the stylus and switch the current running partition of the stylus to the target partition. Illustratively, the firmware upgrade unit is utilized to switch the running partition pointer from partition a to partition B to effect a switch of the current running partition of the stylus from partition a to partition B. And running a firmware upgrading data packet in the newly cut-in current running partition to realize firmware upgrading for the handwriting pen.
As an alternative embodiment, before the current running partition of the stylus is switched by the firmware upgrading unit, the current running partition before the switching can be backed up, so that the function of the stylus can be quickly recovered in case of abnormality in the firmware upgrading process.
The process of upgrading the stylus firmware is schematically described below with reference to the interaction schematic of the stylus with the first electronic device shown in fig. 8.
As shown in fig. 8, the firmware upgrade process includes, for example, operations S401 to S409.
In operation S401, a query is made between the stylus and the first electronic device as to whether a firmware upgrade is performed for the stylus, and a firmware upgrade mode is determined.
Illustratively, the first electronic device obtains the firmware upgrade data package from an OTA (Over The Aire Technology, space download technology) server. The accessory management service in the first electronic device determines whether the firmware of the handwriting pen is required to be upgraded according to the version number of the firmware upgrading data packet and the existing firmware version number of the handwriting pen. In the event that a stylus firmware upgrade is determined to be required, the accessory management service displays an option that the stylus firmware upgrade may be performed. In response to a user selection to perform a stylus firmware upgrade, the accessory management service provides an option button for firmware upgrade modes, including, for example, a foreground immediate upgrade and a background automatic upgrade. In response to a triggering operation of the user for the upgrade mode option button, the accessory management service initiates a firmware upgrade request to the stylus. The firmware upgrading unit in the handwriting pen determines whether to upgrade the firmware according to the firmware version information in the firmware upgrading request to obtain upgrading response information.
In operation S402, the firmware upgrade unit in the stylus locks the upgrade channel.
Illustratively, by the firmware upgrade unit, a data transmission link for responding to a firmware upgrade request of the first electronic device is determined in a link table maintained by the stylus pen, and a status bit of the data transmission link is set to an occupied bit to implement locking an upgrade channel.
In operation S403, firmware upgrade parameter negotiation is performed between the stylus and the first electronic device.
Illustratively, the stylus may negotiate parameters such as encryption public keys, upgrade partitions, data packet read rights, and the like with the first electronic device.
In operation S404, the first electronic device transmits a firmware upgrade data packet to the stylus pen.
In operation S405, the stylus initiates an upgrade data packet verification request to the first electronic device.
Illustratively, the stylus initiates an upgrade data packet verification request to the first electronic device using the locked upgrade channel to request verification of the integrity, security, and correctness of the firmware upgrade data packet, and verification of whether the firmware upgrade data packet is tampered with, etc.
In operation S406, the first electronic device performs a packet verification response to the stylus.
The upgrade engine in the first electronic device checks the firmware upgrade data packet to obtain a data packet check result, and sends the data packet check result to the handwriting pen through the accessory management service in the first electronic device. For example, the upgrade engine checks the digital signature or the encryption private key of the firmware upgrade data packet to obtain a data packet check result.
In operation S407, the stylus copies the firmware upgrade data packet into the running partition.
Illustratively, the Bluetooth communication connection between the first electronic device and the stylus is broken prior to copying the firmware upgrade data package to the operating partition. The running partition copied by the firmware upgrading data packet is different from the current running partition of the handwriting pen.
In operation S408, the stylus switches the running partition pointer and performs a system restart.
Illustratively, the stylus switches the running partition pointer from the current running partition to the running partition copied into the firmware upgrade data package. And restarting the system by the handwriting pen, and running a firmware upgrading data packet in the newly cut-in running partition to upgrade the handwriting pen firmware.
The log-derived interaction process between the stylus and the first electronic device is schematically described below in connection with the interaction diagram of the modules shown in fig. 9. As shown in fig. 9, the log interaction process includes operations S501, S51, S52, and S508, for example.
The stylus pen is paired with the plurality of electronic devices and a first wireless connection is established, the first wireless connection is used for realizing transmission of general service data, the general service data comprises stylus pen operation log data, and the first wireless connection can be a GATT connection. The first electronic device may be any of a plurality of electronic devices.
In operation S501, a bluetooth communication unit in a stylus receives a log-export request initiated by a first electronic device.
Illustratively, the bluetooth communication unit receives a log export request initiated by a stylus maintenance management unit in the first electronic device, the log export request being for requesting export of running log data of the stylus. The operation log data includes, for example, attribute data of a handwriting pen, operation time data, position information data, pressure-sensitive information data, battery level information, error information recording, and the like.
The attribute data includes, for example, data of a date of production of the stylus, a firmware version number, and the like, and the operation time data includes, for example, data of a start time, an end time, a use time period, and the like of the user using the stylus. The position information data includes, for example, position information and the like during the use of the stylus by the user. The pressure information data includes, for example, data such as the pressure magnitude and pressure change trend of the handwriting pen during writing. The error information record includes, for example, error information, fault information, and the like of the stylus during use. The travel log data may be used to assist in analyzing the habit and preferences of a user using the stylus, to improve stylus functionality, and to address issues that arise during use of the stylus.
In operation S51, a firmware upgrade response is performed using the log management unit in the stylus pen, and operation S21 may include operations S502 to S504, for example.
In operation S502, the bluetooth communication unit in the stylus communicates the log-export request to the log management unit.
In operation S503, the log management unit determines whether to perform log export based on the log export request.
Illustratively, in response to a received log-export request, the log-management unit determines whether to conduct log-export based on hardware functionality and software settings of the stylus. For example, the log management unit may determine whether to derive operation log data of the handwriting pen according to information such as whether the handwriting pen has a built-in log recording function, an operation state of the handwriting pen, log recording settings of the user for the handwriting pen (for example, recording writing speed, pressure, inclination angle, etc. of the handwriting pen), and the like.
For example, the log management unit may determine whether the handwriting pen has a recording function of the corresponding log content according to the running log content indicated by the log export request, so as to determine whether to conduct log export. In addition, the log management unit may determine whether to export running log data of the handwriting pen according to the dimension authority of the first electronic device for the handwriting pen.
In operation S504, in the case where it is determined to perform log export, the log management unit transmits the operation log data to the bluetooth communication unit.
In operation S52, the data transmission link for responding to the log-export request is locked using the bluetooth communication unit in the stylus, and operation S52 may include operations S505 to S507, for example.
In operation S505, the bluetooth communication unit determines a data transmission link for responding to the log export request.
Illustratively, in a link table maintained by the stylus, the bluetooth communication unit determines a data transmission link for responding to a log export request of the first electronic device based on the physical address of the first electronic device and link information in the link table.
In operation S506, the bluetooth communication unit determines whether the data transmission link is a valid transmission link.
In operation S507, the bluetooth communication unit locks an active data transmission link.
The execution order of the operations S51 and S52 may be arbitrarily adjusted. That is, the operation of performing the log-derived response with the log management unit may be performed before the operation of locking the data transmission link with the bluetooth communication unit, may be performed after the operation of locking the data transmission link with the bluetooth communication unit, or may be performed simultaneously with the operation of locking the data transmission link with the bluetooth communication unit.
In operation S508, the operation log data is transmitted to the first electronic device using the locked data transmission link through the bluetooth communication unit.
The writing interaction process between the stylus and the first electronic device is schematically described below with reference to the interaction schematic diagram of the modules shown in fig. 10. As shown in fig. 10, the writing interaction process includes operations S601, S61, S62, and S608, for example.
The stylus pen is paired with a plurality of electronic devices and establishes a first wireless connection, which is used for realizing universal service data transmission, and the first wireless connection can be, for example, a GATT connection. The first electronic device may be any of a plurality of electronic devices.
In response to receiving the writing interaction request of the first electronic device, it is determined that a second wireless connection is also established between the first electronic device and the stylus. The second wireless connection is used to enable transmission of writing service data including, for example, writing pressure data, writing location data (e.g., indicating writing coordinate information, writing offset information, etc.). The second wireless connection may be, for example, a hopp connection, and an electronic device having a hopp connection with a stylus pen may be used as the main connection device.
In operation S601, a bluetooth communication unit in a stylus receives a writing interaction request initiated by a first electronic device.
Illustratively, the bluetooth communication unit receives a writing interaction request initiated by a stylus writing management unit in the first electronic device. When handwriting is used for writing content on the touch screen of the first electronic device, an electromagnetic signal generated in the writing process can be captured by the built-in inductor of the handwriting pen. The writing interaction request can be used for requesting the handwriting pen to transmit the captured electromagnetic signals to the first electronic device through a Bluetooth communication technology, so that the first electronic device can analyze and identify the electromagnetic signals through built-in identification software to convert the electromagnetic signals into a text or digital format. After the recognition is completed, the first electronic device may display the converted content.
In operation S61, writing interactive response is performed using the writing management unit in the stylus pen, and operation S61 may include operations S602 to S604, for example.
In operation S602, the bluetooth communication unit in the handwriting pen transfers a writing interaction request to the writing management unit.
In operation S603, the writing management unit determines whether to perform writing interaction based on the writing interaction request.
Illustratively, in response to the received writing interaction request, the writing management unit determines whether to perform the writing interaction, e.g., according to compatibility between the stylus and the first electronic device, writing software support of the first electronic device, bluetooth communication status between the stylus and the first electronic device, etc.
In operation S604, in case it is determined to perform writing interaction, the writing management unit transmits writing pressure data to the bluetooth communication unit.
In operation S62, the data transmission link for responding to the writing interaction request is locked using the bluetooth communication unit in the stylus, and operation S62 may include operations S605 to S607, for example.
In operation S605, the bluetooth communication unit determines a data transmission link for responding to the writing interaction request.
Illustratively, in a link table maintained by the stylus, the bluetooth communication unit determines a data transmission link for responding to the written interactive request of the first electronic device based on the physical address of the first electronic device and link information in the link table.
In operation S606, the bluetooth communication unit determines whether the data transmission link is a valid transmission link.
In operation S607, the bluetooth communication unit locks an active data transmission link.
The execution order of the operations S61 and S62 may be arbitrarily adjusted. That is, the operation of performing the log-derived response using the writing management unit may be performed before the operation of locking the data transmission link using the bluetooth communication unit, may be performed after the operation of locking the data transmission link using the bluetooth communication unit, or may be performed simultaneously with the operation of locking the data transmission link using the bluetooth communication unit.
In operation S608, writing pressure data is transmitted to the first electronic device using the locked data transmission link through the bluetooth communication unit.
As one example, the writing interaction process may also include operations S601, S61, and S609 (i.e., operations S62 and S608 are not performed).
In operation S609, writing pressure data is directly transmitted to the first electronic device.
Illustratively, in response to receiving a writing interaction request of the first electronic device, the first electronic device is used as a main connection device, and writing pressure data is directly transmitted to the main connection device.
The process of data interaction between the stylus and the first electronic device is schematically described below in connection with the flowchart shown in fig. 11. As shown in fig. 11, the data interaction process includes operations S701 to S716, for example.
In operation S701, a stylus receives a data interaction request initiated by a first electronic device.
In operation S702, the stylus determines whether the data interaction request is a writing interaction request, and if so, operation S703 is performed, otherwise, operation S704 is performed.
In operation S703, the stylus transmits writing pressure data through the main link, and the flow ends.
In an exemplary embodiment, when the data interaction request is a writing interaction request, the handwriting pen determines that the first electronic device is a main connection device, a data transmission link between the handwriting pen and the first electronic device is a main connection device, and the handwriting pen transmits writing pressure data to the first electronic device through the main link.
In operation S704, the stylus pen determines whether the data interaction request is a firmware upgrade request, and if so, operation S705 is performed, otherwise, operation S711 is performed.
In operation S705, the stylus consults the link table to determine a data transmission link for responding to the firmware upgrade request of the first electronic device.
In operation S706, the stylus determines candidate transmission links matching the firmware upgrade request.
By way of example, the candidate transmission links may include all transmission links in the link table for processing the firmware upgrade request, the candidate transmission links corresponding to at least some of the plurality of electronic devices, at least some of which may include the first electronic device.
In operation S707, the stylus pen determines whether any candidate transmission link is locked, and if so, operation S710 is performed, otherwise operation S708 is performed.
In operation S708, the stylus locks the data transmission link and updates the link table.
In operation S709, the stylus transmits upgrade response information using the locked data transmission link, and the flow ends.
In operation S710, the stylus feedback link state is busy, and the flow ends.
In operation S711, the stylus pen determines whether the data interaction request is a log export request, if yes, operation S712 is performed, otherwise the flow ends.
In operation S712, the stylus consults the link table to determine a data transmission link for responding to the log export request of the first electronic device.
In operation S713, the stylus determines a candidate transmission link matching the log-derived request.
In operation S714, the stylus determines whether any candidate transmission link is locked, if so, operation S710 is performed, otherwise operation S715 is performed.
In operation S715, the stylus locks the data transmission link and updates the link table.
In operation S716, the stylus transmits the operation log data using the locked data transmission link, and the flow ends.
It will be appreciated that the stylus, in order to achieve the above-described functions, includes corresponding hardware and/or software modules that perform the respective functions. The present application can be implemented in hardware or a combination of hardware and computer software, in conjunction with the example algorithm steps described in connection with the embodiments disclosed herein. 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 decisions should not be interpreted as causing a departure from the scope of the present application.
All relevant contents of each step related to the above method embodiment may be cited to the functional descriptions of the corresponding functional modules, which are not described herein.
The embodiment also provides a handwriting pen, wherein a first wireless connection is established between the handwriting pen and a plurality of electronic devices, and the first wireless connection is used for realizing universal service data transmission. The stylus includes a processor and a memory for storing instructions that, when executed by the processor, cause the stylus to: in response to receiving a data interaction request of the first electronic device, determining a data transmission link matched with the first electronic device according to a request type of the data interaction request; under the condition that the data transmission link is an effective transmission link, locking the data transmission link; the interactive data content is transmitted with a first electronic device comprising any of a plurality of electronic devices using the locked data transmission link.
The embodiment also provides a Bluetooth system, which comprises a handwriting pen and a plurality of electronic devices, wherein a first wireless connection is established between the handwriting pen and the plurality of electronic devices, the first wireless connection is used for realizing universal service data transmission, the first electronic device in the plurality of electronic devices initiates a data interaction request to the handwriting pen, and the handwriting pen executes the data interaction method in the embodiment.
The present embodiment also provides a computer storage medium having stored therein computer instructions which, when executed on an electronic device, cause the electronic device to perform the above-mentioned related method steps to implement the data interaction method in the above-mentioned embodiments.
The present embodiment also provides a computer program product which, when run on a computer, causes the computer to perform the above-mentioned related steps to implement the data interaction method in the above-mentioned embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be embodied as a chip, component or module, which may include a processor and a memory coupled 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 executes the data interaction method in the above method embodiments.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are used to execute the corresponding methods provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding methods 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 by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. 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 the embodiments 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.
Any of the various embodiments of the application, as well as any of the same embodiments, may be freely combined. Any combination of the above is within the scope of the application.
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 for causing 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 embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.
The steps of a method or algorithm described in connection with the present disclosure may be embodied in hardware, or may be embodied in software instructions executed by a processor. The software instructions may be comprised of corresponding software modules that may be stored in random access Memory (Random Access Memory, RAM), flash Memory, read Only Memory (ROM), erasable programmable Read Only Memory (Erasable Programmable ROM), electrically Erasable Programmable Read Only Memory (EEPROM), registers, hard disk, a removable disk, a compact disc Read Only Memory (CD-ROM), or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC.
Those skilled in the art will appreciate that in one or more of the examples described above, the functions described in the embodiments of the present application may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, these functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (18)

1. The data interaction method of the handwriting pen multi-connection scene is characterized by being applied to the handwriting pen, wherein a first wireless connection is established between the handwriting pen and a plurality of electronic devices, and the first wireless connection is used for realizing universal service data transmission; the method comprises the following steps:
In response to receiving a data interaction request of a first electronic device, determining a data transmission link for responding to the data interaction request;
locking the data transmission link under the condition that the data transmission link is an effective transmission link;
transmitting interactive data content with the first electronic device using the locked data transmission link,
the first electronic device includes any electronic device of the plurality of electronic devices.
2. The method of claim 1, wherein the determining a data transmission link for responding to the data interaction request comprises:
and determining the data transmission link according to the request type of the data interaction request and the physical address of the first electronic equipment.
3. The method according to claim 1 or 2, further comprising, after determining a data transmission link for responding to the data interaction request:
determining at least one candidate transmission link indicated by the request type, the at least one candidate transmission link corresponding to at least some of the plurality of electronic devices;
and determining the data transmission link matched with the first electronic device as a valid transmission link under the condition that any candidate transmission link is not locked.
4. The method according to claim 1 or 2, further comprising, after determining a data transmission link for responding to the data interaction request:
determining a time interval for receiving a data interaction request of the second electronic device and the first electronic device in response to the received data interaction request of the second electronic device;
and determining that the data transmission link matched with the first electronic device is an effective transmission link under the condition that the time interval indicates that the handwriting pen receives the data interaction request of the second electronic device based on the earlier time and the time interval is larger than a preset threshold value.
5. The method of claim 1, wherein said locking the data transmission link if the data transmission link is a valid transmission link comprises:
and setting a status bit of the data transmission link as an occupied bit in a link table maintained by the handwriting pen so as to lock the data transmission link.
6. The method of claim 5, further comprising, after completing the transmission of the interactive data content with the first electronic device:
In the link table, status bits of the data transmission links are set to available bits to release the locked data transmission links.
7. The method of claim 1, wherein the data interaction request comprises a firmware upgrade request; said transmitting interactive data content with said first electronic device using said locked data transmission link, comprising:
determining whether to upgrade the handwriting pen firmware according to the firmware version number carried in the firmware upgrade request;
and under the condition that the firmware of the handwriting pen is updated, returning updating response information to the first electronic equipment by utilizing the locked data transmission link, so that the first electronic equipment sends a firmware updating data packet based on the updating response information.
8. The method of claim 7, wherein determining whether to perform a stylus firmware upgrade based on a firmware version number carried in the firmware upgrade request comprises:
and determining to perform handwriting pen firmware upgrading when the existing firmware version number of the handwriting pen is lower than the firmware version number in the firmware upgrading request and the handwriting pen is in a low-activity-level state.
9. The method of claim 7, wherein the transmitting interactive data content with the first electronic device using the locked data transmission link further comprises:
and returning upgrade status information to the first electronic device by utilizing the locked data transmission link in the process of running the firmware upgrade data packet.
10. The method as recited in claim 7, further comprising:
writing the firmware upgrading data packet into a target partition in the process of upgrading the firmware of the handwriting pen, wherein the target partition is different from a current running partition of the handwriting pen;
setting the target partition as a partition to be operated of the handwriting pen;
restarting the stylus, and running the firmware upgrading data packet in the partition to be run to realize firmware upgrading for the stylus.
11. The method of claim 1, wherein the data interaction request comprises a log export request; said transmitting interactive data content with said first electronic device using said locked data transmission link, comprising:
and sending a running log data packet to the first electronic device by using the locked data transmission link.
12. The method of claim 1, wherein the data interaction request comprises a written interaction request; said transmitting interactive data content with said first electronic device using said locked data transmission link, comprising:
and transmitting writing pressure data to the first electronic device by using the locked data transmission link.
13. The method according to claim 12, wherein in case the data interaction request is a writing interaction request, characterizing that a second wireless connection is also established between the first electronic device and the stylus, the second wireless connection being for enabling writing service data transmission; the method further comprises the steps of:
responding to a received writing interaction request of the first electronic equipment, and taking the first electronic equipment as a main connection equipment;
and directly transmitting writing pressure data matched with the writing interaction request to the main connection device.
14. The method of claim 13, wherein the second wireless connection is a hopp connection.
15. The method of claim 1, wherein the first wireless connection is a GATT connection.
16. The handwriting pen is characterized in that a first wireless connection is established between the handwriting pen and a plurality of electronic devices, and the first wireless connection is used for realizing universal service data transmission;
the stylus includes a processor and a memory for storing instructions that, when executed by the processor, cause the stylus to:
responding to a received data interaction request of a first electronic device, and determining a data transmission link matched with the first electronic device according to the request type of the data interaction request;
locking the data transmission link under the condition that the data transmission link is an effective transmission link;
transmitting interactive data content with the first electronic device using the locked data transmission link,
the first electronic device includes any electronic device of the plurality of electronic devices.
17. A bluetooth system, comprising a stylus and a plurality of electronic devices, wherein a first wireless connection is established between the stylus and the plurality of electronic devices, the first wireless connection being used to implement universal service data transmission, a first electronic device of the plurality of electronic devices initiating a data interaction request to the stylus, the stylus performing the data interaction method according to any one of claims 1 to 15.
18. A computer readable storage medium comprising a computer program which, when run on a stylus, causes the stylus to perform the data interaction method of any one of claims 1 to 15.
CN202310475859.7A 2023-04-25 2023-04-25 Data interaction method for handwriting pen multi-connection scene, handwriting pen and Bluetooth system Pending CN117135602A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310475859.7A CN117135602A (en) 2023-04-25 2023-04-25 Data interaction method for handwriting pen multi-connection scene, handwriting pen and Bluetooth system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310475859.7A CN117135602A (en) 2023-04-25 2023-04-25 Data interaction method for handwriting pen multi-connection scene, handwriting pen and Bluetooth system

Publications (1)

Publication Number Publication Date
CN117135602A true CN117135602A (en) 2023-11-28

Family

ID=88860585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310475859.7A Pending CN117135602A (en) 2023-04-25 2023-04-25 Data interaction method for handwriting pen multi-connection scene, handwriting pen and Bluetooth system

Country Status (1)

Country Link
CN (1) CN117135602A (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140256250A1 (en) * 2013-03-11 2014-09-11 Barnesandnoble.Com Llc Peer-to-peer data transfer using near field communication (nfc)-enabled styluses
US20150169335A1 (en) * 2013-12-12 2015-06-18 Samsung Electronics Co., Ltd. Method and apparatus for controlling operations of electronic device
CN109618373A (en) * 2019-01-15 2019-04-12 Oppo广东移动通信有限公司 Link choosing method and relevant apparatus
CN111324229A (en) * 2018-12-14 2020-06-23 韩鼎楠 Multi-person mixed office handwriting pen system
WO2020141784A1 (en) * 2019-01-02 2020-07-09 삼성전자 주식회사 Electronic device for sharing content by using stylus pen, and control method therefor
WO2022078171A1 (en) * 2020-10-14 2022-04-21 华为技术有限公司 Stylus switching method and system, and stylus
WO2022179443A1 (en) * 2021-02-27 2022-09-01 华为技术有限公司 Nfc method and system, and electronic device
WO2022247638A1 (en) * 2021-05-26 2022-12-01 华为技术有限公司 Method for controlling connection of stylus, and electronic device
CN115442778A (en) * 2021-06-03 2022-12-06 Oppo广东移动通信有限公司 Method and device for establishing Bluetooth link, bluetooth chip and equipment
CN115562694A (en) * 2022-02-10 2023-01-03 荣耀终端有限公司 Stylus pen upgrading method, control terminal and medium
WO2023011316A1 (en) * 2021-08-02 2023-02-09 华为技术有限公司 Data transmission method, electronic device, chip, and storage medium
CN115767487A (en) * 2021-09-06 2023-03-07 炬芯科技股份有限公司 Low-power-consumption Bluetooth multi-connection method, device and system
CN115802325A (en) * 2021-09-09 2023-03-14 荣耀终端有限公司 Stylus pen connection method and Bluetooth system

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140256250A1 (en) * 2013-03-11 2014-09-11 Barnesandnoble.Com Llc Peer-to-peer data transfer using near field communication (nfc)-enabled styluses
US20150169335A1 (en) * 2013-12-12 2015-06-18 Samsung Electronics Co., Ltd. Method and apparatus for controlling operations of electronic device
CN111324229A (en) * 2018-12-14 2020-06-23 韩鼎楠 Multi-person mixed office handwriting pen system
WO2020141784A1 (en) * 2019-01-02 2020-07-09 삼성전자 주식회사 Electronic device for sharing content by using stylus pen, and control method therefor
CN109618373A (en) * 2019-01-15 2019-04-12 Oppo广东移动通信有限公司 Link choosing method and relevant apparatus
WO2022078171A1 (en) * 2020-10-14 2022-04-21 华为技术有限公司 Stylus switching method and system, and stylus
WO2022179443A1 (en) * 2021-02-27 2022-09-01 华为技术有限公司 Nfc method and system, and electronic device
WO2022247638A1 (en) * 2021-05-26 2022-12-01 华为技术有限公司 Method for controlling connection of stylus, and electronic device
CN115442778A (en) * 2021-06-03 2022-12-06 Oppo广东移动通信有限公司 Method and device for establishing Bluetooth link, bluetooth chip and equipment
WO2023011316A1 (en) * 2021-08-02 2023-02-09 华为技术有限公司 Data transmission method, electronic device, chip, and storage medium
CN115767487A (en) * 2021-09-06 2023-03-07 炬芯科技股份有限公司 Low-power-consumption Bluetooth multi-connection method, device and system
CN115802325A (en) * 2021-09-09 2023-03-14 荣耀终端有限公司 Stylus pen connection method and Bluetooth system
CN115562694A (en) * 2022-02-10 2023-01-03 荣耀终端有限公司 Stylus pen upgrading method, control terminal and medium

Similar Documents

Publication Publication Date Title
AU2019302353B2 (en) Coupling a pen device to a companion device based on pen proximity
CN111665964B (en) Active pen and input device
EP3281141B1 (en) Cloud-based cross-device digital pen pairing
EP2453364B1 (en) A method for deterministic SAS discovery and configuration
CN102763095B (en) Portable storage interface
US20200128003A1 (en) Method, apparatus, and system for controlling intelligent device, and storage medium
CN102752364B (en) Data transmission method and device
US20110111698A1 (en) Electronic apparatus and access control method
US11656802B2 (en) Distributed block storage service command processing method, apparatus, device and medium
CN105745947A (en) Systems and methods for reporting a user interface status
KR20130003852A (en) System for providing remote device driver and mehtod for providing remote device driver
WO2017211260A1 (en) Data access method and related device
CN117135602A (en) Data interaction method for handwriting pen multi-connection scene, handwriting pen and Bluetooth system
CN113010498A (en) Data synchronization method and device, computer equipment and storage medium
CN107615826B (en) Method for determining network type in wireless communication network, access point equipment, terminal equipment and wireless network controller
US20120271925A1 (en) Virtual Address for Virtual Port
US10845918B2 (en) Touch system, input device for the same and signal transmission method for the same
KR20140111434A (en) System and method for data transmission
CN112788651A (en) Control method, terminal and storage medium
CN112769780B (en) Equipment information acquisition method and device, electronic equipment and storage medium
WO2015120593A1 (en) Mobile terminal and control method for access control system
EP2579632B1 (en) Preventing terminals from operating an abnormal ciphering algorithm
CN116954750A (en) Online firmware modification method and device and related products
CN115964069A (en) Firmware upgrading method and device, microphone assembly, equipment and storage medium
KR101593899B1 (en) Cloud computing method, clould computing server performing the same and storage media storing the same

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