WO2022022342A1 - Device pairing method and system, and accessory device and computer-readable storage medium - Google Patents

Device pairing method and system, and accessory device and computer-readable storage medium Download PDF

Info

Publication number
WO2022022342A1
WO2022022342A1 PCT/CN2021/107443 CN2021107443W WO2022022342A1 WO 2022022342 A1 WO2022022342 A1 WO 2022022342A1 CN 2021107443 W CN2021107443 W CN 2021107443W WO 2022022342 A1 WO2022022342 A1 WO 2022022342A1
Authority
WO
WIPO (PCT)
Prior art keywords
accessory
accessory device
information
electronic device
target
Prior art date
Application number
PCT/CN2021/107443
Other languages
French (fr)
Chinese (zh)
Inventor
李小仙
Original Assignee
华为技术有限公司
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
Priority claimed from CN202010731578.XA external-priority patent/CN113993109B/en
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022022342A1 publication Critical patent/WO2022022342A1/en

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/038Control and interface arrangements therefor, e.g. drivers or device-embedded control circuitry
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals

Definitions

  • the present application relates to the field of terminal technologies, and in particular, to a device pairing method, system, accessory device, and computer-readable storage medium.
  • some electronic devices with display screens are equipped with auxiliary accessory devices, such as stylus and the like.
  • auxiliary accessory devices such as stylus and the like.
  • the user can conveniently perform operations such as clicking, writing, etc. on the display screen of the electronic device.
  • the user When the current accessory device is paired with the electronic device, the user needs to attach the accessory device to a specific magnetic attraction position of the electronic device, or the user needs to contact and connect the connector on the accessory device with the interface on the electronic device.
  • the user When the user has multiple electronic devices, if the user wishes to use the accessory device on different electronic devices, the user needs to re-create the accessory device and the corresponding electronic device according to the above pairing scheme every time the user switches the use object of the accessory device. Pairing, the operation is complicated, and the fluency of the switching process is low, which affects the user experience.
  • the embodiments of the present application provide a device pairing method, system, accessory device, and computer-readable storage medium, which can solve the problem that in the current device pairing scheme, the pairing process of the accessory device and the electronic device is complicated, and when switching the use object of the accessory device, Low fluency, which affects the user experience.
  • an embodiment of the present application provides a device pairing method, which is applied to an accessory device, and the method includes:
  • the accessory device receives a first signal through a first communication connection, the first signal includes a target device number, and the first communication connection is established between the electronic device currently in contact with the accessory device and the accessory device. communication connection;
  • the accessory device matches the target device number with the first device number, and determines the electronic device corresponding to the first device number that is consistent with the target device number as the target device, and the first device number is the same as the target device number.
  • the accessory device is paired with the target device.
  • a first communication connection can be established between the accessory device and the electronic device.
  • the above electronic device may transmit the first signal to the accessory device through the first communication connection.
  • the first signal includes a target device number, and the target device number is the device number of the electronic device.
  • the specific type of the first communication connection can be set according to the actual situation.
  • the first communication connection may be an electrode channel formed by the electrode of the electronic device and the electrode of the accessory device.
  • the electrodes of the electronic equipment, the electrodes of the accessory equipment, and the insulating medium between them form a capacitor.
  • the capacitor has the characteristics of passing AC and blocking DC, so the above-mentioned electronic device can transmit the first signal to the accessory device through the above-mentioned first communication connection.
  • the first communication connection may be an NFC connection established between a Near Field Communication (Near Field Communication, NFC) module of the electronic device and an NFC module of an accessory device.
  • NFC Near Field Communication
  • the accessory device can usually only establish an NFC connection with the electronic device, but cannot establish an NFC connection with other electronic devices. , thus ensuring that accessory devices are not disturbed by non-contact electronic devices.
  • the target device number can be matched with each first device number.
  • the first device number is the device number of the electronic device that currently establishes a wireless connection with the accessory device.
  • the accessory device may determine the electronic device corresponding to the first device number consistent with the target device number as the target device, and pair with the target device.
  • the accessory device After the accessory device is paired with the target device, it means that the accessory device determines the target device as the default information transmission object.
  • the accessory device can exchange information with the target device through a wireless connection.
  • the accessory device can transmit pressure-sensitive information to the target device through a wireless connection, so that the target device can render a handwriting effect according to the pressure-sensitive information.
  • the above wireless connection types can be set according to the actual situation.
  • the above-mentioned wireless connection may be a Bluetooth (bluetooth, BT) connection, a Bluetooth Low Energy (BLE) connection, a wireless local area network (wireless local area networks, WLAN) connection, a radio frequency identification (radio frequency identification, RFID) connection Or a wireless connection channel such as a ZigBee connection.
  • the accessory device can automatically identify the target device and pair it, without the need for the user to actively perform a specific pairing operation. User experience.
  • the accessory device matches the target device number with the first device number, including:
  • the accessory device If the accessory device detects that the pressure sensor has collected the first pressure-sensing information, and the accessory device does not detect the second pressure-sensing information within a preset period of time before detecting the first pressure-sensing information, the accessory device will The accessory device matches the target device number with the first device number.
  • first pressure-sensing information is pressure-sensing information currently detected by the pressure sensor.
  • the second pressure-sensitive information is pressure-sensitive information other than the first pressure-sensitive information.
  • the accessory device can set a preset duration.
  • the specific value of the preset duration can be set according to the actual situation. For example, according to research, when the user uses the accessory device on different electronic devices, the switching time spent by the user each time switching the object of the accessory device is usually greater than 500ms. Therefore, the preset duration can be set to 500ms.
  • the accessory device has not detected the second pressure-sensing information within a preset period of time before detecting the first pressure-sensing information, it means that the target device may not be the default device.
  • the accessory device needs to identify the target device according to the target device number, and matches the target device number with the first device number, so as to identify the target device.
  • the accessory device determines a default device as the target device, where the default device is an electronic device currently paired with the accessory device.
  • the accessory device has detected the second pressure-sensing information within the preset time period before detecting the first pressure-sensing information, it means that the time interval between the two adjacent pressure-sensing information detected by the accessory device is not enough. Let the user switch the use object of the accessory device, and the accessory device does not switch the default device.
  • the accessory device directly determines the default device as the target device, and does not switch the pairing object.
  • determining the electronic device corresponding to the first device number that is consistent with the target device number as the target device includes:
  • the accessory device determines the default device as a target device, and the matching device is an electronic device corresponding to a first device number that is consistent with the target device number , the default device is the electronic device currently paired with the accessory device.
  • the target device number of each electronic device may be the same device number, when the target device number is the device number of the default device, the target device may be the default device, or the target device may not be the default device.
  • the accessory device may acquire each first device number, and determine whether there are multiple first device numbers that match the target device number.
  • the first device number includes the device number of the default device.
  • the accessory device does not switch the default device.
  • determining the electronic device corresponding to the first device number that is consistent with the target device number as the target device further includes:
  • the accessory device sends the first consultation information to each of the matching devices through the wireless connection, and the matching device is the same as the default device.
  • the electronic device corresponding to the first device number with the same target device number, and the default device is the electronic device currently paired with the accessory device;
  • the accessory device determines the matching device that sent the pairing confirmation information as the target device, wherein the pairing confirmation information is that the target device receives the first Feedback information after consultation.
  • the accessory device may send the first consultation information to each matching device through a wireless connection.
  • the matching device When the matching device receives the first consultation information, it is determined whether the device is the target device. If so, the matching device returns a pairing confirmation message to the accessory device. If not, the matching device returns a pairing failure message to the accessory device.
  • the first alarm signal can be transmitted to the electronic device through the second communication connection.
  • the type of the second communication connection can be set according to the actual situation.
  • the second communication connection may be the above-mentioned electrode channel; or, the second communication connection may also be the NFC connection established between the above-mentioned accessory device and the target device.
  • the accessory device determines the signal sent this time as the first-point reporting signal, and records the first-point reporting signal. first timing.
  • the electronic device may determine whether other point notification signals, that is, the second point notification signal, are detected within a preset time period before receiving the first point notification signal. If the electronic device does not detect the second point notification signal within the preset time period before receiving the first point notification signal, the first point notification signal received this time is determined as the first point notification signal received, and the first point notification signal received for the first time is recorded. two time.
  • the first consultation information may include the first time.
  • the matching device may calculate a deviation value between the first time and the second time.
  • the matching device If the last time the matching device receives an announcement signal is not the first time to receive an announcement, the matching device does not record the second time, or the above deviation value is greater than or equal to the preset deviation threshold, the matching device returns pairing failure information to the accessory device.
  • the matching device If the last time the matching device receives the reporting point signal is the first time receiving the reporting point, and the above deviation value is less than the preset deviation threshold, the matching device returns the pairing confirmation information to the accessory device.
  • the electronic device may be provided with a pressure sensor.
  • the accessory device When the accessory device is in contact with the electronic device, the accessory device records a third time when the first pressure-sensitive information is detected, and the electronic device records a fourth time when the third pressure-sensitive information is detected.
  • the third pressure-sensing information is pressure-sensing information currently detected by the pressure sensor of the electronic device.
  • the first consultation information may include the third time.
  • the matching device may calculate the deviation value between the third time and the fourth time.
  • the matching device If the deviation between the third time and the fourth time is greater than or equal to the preset deviation threshold, the matching device returns pairing failure information to the accessory device.
  • the matching device If the deviation between the third time and the fourth time is less than the preset deviation threshold, the matching device returns pairing confirmation information to the accessory device.
  • the electronic device may also verify the first consultation information in other manners, and the present application does not limit the manner in which the electronic device checks the first consultation information.
  • the accessory device can determine the matching device that sent the pairing confirmation information as the target device, pair with the target device, and set the target device as the default data transmission object.
  • the accessory device sends the first consultation information to each of the matching devices through the wireless connection, including:
  • the accessory device synchronously sends the first consultation information to each of the matching devices through the wireless connection.
  • the accessory device may choose to send the first consultation information to each matching device synchronously.
  • the accessory device sends the first consultation information to each matching device synchronously.
  • the error range should be set according to the actual situation.
  • the error range can be set to 1ms, 2ms, 5ms, etc. values.
  • the accessory device sends the first consultation information to each of the matching devices through the wireless connection, including:
  • the accessory device determines the polling sequence of each matching device according to the first preset rule
  • the accessory device sequentially sends the first consultation information to each of the matching devices through the wireless connection according to the polling sequence.
  • the accessory device may determine the polling sequence of each matching device according to the first preset rule, and then sequentially send the first consultation information to each matching device according to the polling sequence.
  • the first preset rule can be set according to actual needs. For example, in some embodiments, the first preset rule may be set to determine the polling order of each matching device according to the time when each matching device establishes a wireless connection with an accessory device, and sorting in order from near to far. In other embodiments, the first preset rule may be set to be sorted according to the time when each matching device has been set as the default device, in order from near to far, and the matching device that has not been set as the default device is sorted according to The time when each matching device establishes a wireless connection with the accessory device is sorted in order from near to far, so as to determine the polling sequence of each matching device.
  • the method further includes:
  • the accessory device performs a preset prompt operation.
  • the accessory device may fail to pair.
  • each first device number may be inconsistent with the target device number, resulting in failure to pair the accessory device.
  • the accessory device When the accessory device fails to pair, the accessory device can perform a preset prompt operation.
  • the content of the preset prompt operation can be set according to the actual situation.
  • the preset prompt operation may be any one or a combination of any one or a combination of prompt methods such as vibration, buzzer sounding, and speaker voice broadcast.
  • the method before the accessory device receives the first signal through the first communication connection, the method further includes:
  • the accessory device receives and stores the device number sent by each electronic device through the wireless connection.
  • the electronic device may send the device number to the accessory device through the wireless connection after the wireless connection is established.
  • the accessory device may store the device number of the electronic device in association with the wireless communication address of the electronic device.
  • the accessory device can obtain the first device number of each electronic device currently established wireless connection from the storage area, and match the first device number with the target device number to identify the target device.
  • the wireless connection is a Bluetooth connection
  • the accessory device is paired with the target device, including:
  • the accessory device and the target device establish a HoGP connection channel according to the universal attribute-based human-machine interface device interaction protocol HoGP.
  • the wireless connection when the wireless connection is a Bluetooth connection, the Bluetooth connection includes a HoGP connection channel and a Generic Attribute Profile (GATT) connection channel.
  • GATT Generic Attribute Profile
  • pairing the accessory device to the target device means that the accessory device establishes a HoGP connection channel with the target device.
  • an accessory device including:
  • a signal receiving module configured to receive a first signal through a first communication connection, the first signal includes a target device number, and the first communication connection is between an electronic device currently in contact with the accessory device and the accessory device established communication connections;
  • the number matching module is used to match the target device number with the first device number, and determine the electronic device corresponding to the first device number consistent with the target device number as the target device, and the first device number is the same as the target device number.
  • the device pairing module is used for pairing the target device.
  • the number matching module includes:
  • the first pairing sub-module is used for if the accessory device detects that the pressure sensor has collected the first pressure-sensing information, and the accessory device does not detect the first pressure-sensing information within a preset time period before detecting the first pressure-sensing information.
  • the target device number is matched with the first device number.
  • the number matching module further includes:
  • the second pairing submodule is used for if the accessory device detects that the pressure sensor has collected the first pressure-sensing information, and the accessory device detects the second pressure-sensing information within a preset period of time before detecting the first pressure-sensing information pressure-sensing information, the default device is determined as the target device, and the default device is the electronic device currently paired with the accessory device.
  • the number matching module includes:
  • the third pairing sub-module is configured to determine the default device as the target device if the number of matching devices is 1 and the matching device is the default device, and the matching device is the first device with the same number as the target device.
  • the electronic device corresponding to the device number, and the default device is the electronic device currently paired with the accessory device.
  • the number matching module further includes:
  • the consultation information submodule is used to send the first consultation information to each of the matching devices through the wireless connection if the number of matching devices is greater than 1 or the target device number is inconsistent with the device number of the default device, and the matching device
  • the device is an electronic device corresponding to the first device number that is consistent with the target device number, and the default device is the electronic device currently paired with the accessory device;
  • a fourth pairing sub-module configured to determine the matching device that sent the pairing confirmation information as the target device when the accessory device receives the pairing confirmation information, wherein the pairing confirmation information is that the target device receives the pairing confirmation information Information fed back after the first consultation information.
  • the consultation information submodule includes:
  • a synchronous sending sub-module is configured to synchronously send the first consultation information to each of the matching devices through the wireless connection.
  • the consultation information submodule includes:
  • a polling sequence submodule configured to determine the polling sequence of each matching device according to the first preset rule
  • the polling sending sub-module is configured to send the first consultation information to each of the matching devices in sequence through the wireless connection according to the polling sequence.
  • the accessory device further includes:
  • the information prompt module is used to perform a preset prompt operation if the pairing fails.
  • the accessory device further includes:
  • the number storage module is used to receive and store the device number sent by each electronic device through the wireless connection.
  • the wireless connection is a Bluetooth connection
  • the device pairing module is specifically configured to establish a HoGP connection channel with the target device according to the universal attribute-based human-machine interface device interaction protocol HoGP.
  • an embodiment of the present application provides a device pairing system, where the system includes at least one accessory device and at least one electronic device;
  • the accessory device When the accessory device is in contact with the electronic device, the accessory device is configured to perform the steps of the method described in the first aspect above.
  • the device pairing system may include one or more accessory devices and one or more electronic devices.
  • the accessory device When the accessory device is in contact with the electronic device in response to the user's operation, the accessory device may perform the steps of the method mentioned in the first aspect above.
  • an accessory device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • the processor executes the computer program, the accessory device realizes the steps of the above method.
  • a computer-readable storage medium where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the accessory device implements the steps of the above method.
  • a sixth aspect provides a chip system, the chip system may be a single chip or a chip module composed of multiple chips, the chip system includes a memory and a processor, and the processor executes the storage in the memory.
  • the accessory device obtains the first signal through the first communication connection, and the first signal includes the target device number. Then, the accessory device matches the target device number with each first device number, so as to determine the target device corresponding to the target device number. After the target device is determined, the accessory device is paired with the target device.
  • the accessory device can automatically identify the target device and pair it, without the need for the user to actively perform a specific pairing operation. User experience.
  • FIG. 1 is a schematic structural diagram of a device pairing system according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of an accessory device provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 4 is a block diagram of a software structure of an electronic device provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of an information channel provided by an embodiment of the present application.
  • FIG. 6 is a structural diagram of a touch sensor provided by an embodiment of the present application.
  • FIG. 7 is a system architecture diagram of a device pairing system provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a magnetic attraction pairing provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a connection verification operation provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a connection pairing provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of another connection pairing provided by an embodiment of the present application.
  • FIG. 12 is a schematic diagram of a low-power Bluetooth connection operation provided by an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 14 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 15 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 16 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 17 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 18 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 19 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 20 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 21 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 22 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 23 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 24 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 25 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 26 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 27 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG. 28 is a schematic flowchart of a device pairing method provided by an embodiment of the present application.
  • FIG. 29 is a schematic flowchart of another device pairing method provided by an embodiment of the present application.
  • FIG. 30 is a schematic flowchart of another device pairing method provided by an embodiment of the present application.
  • the term “if” may be contextually interpreted as “when” or “once” or “in response to determining” or “in response to detecting “.
  • the phrases “if it is determined” or “if the [described condition or event] is detected” may be interpreted, depending on the context, to mean “once it is determined” or “in response to the determination” or “once the [described condition or event] is detected. ]” or “in response to detection of the [described condition or event]”.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the steps involved in the device pairing method provided in the embodiments of the present application are only examples, and not all steps are required to be performed, or not all information or contents of messages are required to be selected. It can be increased or decreased as needed.
  • auxiliary accessory devices eg, stylus, etc.
  • a user When a current accessory device is paired with an electronic device, a user needs to actively perform a specific pairing operation. For example, the user needs to attach the accessory device to a specific magnetic attraction position of the electronic device, or the user needs to contact and connect the connector of the accessory device with the interface of the accessory device.
  • a user may own multiple electronic devices, eg, a user may own multiple tablet computers.
  • the user needs to actively perform a pairing operation every time the user switches the use object of the accessory device, so that the accessory device and the electronic device are re-paired. For example, after a user uses a stylus on a tablet, if he wants to use the stylus on another tablet, the user needs to place the stylus in a specific magnetic location on the other tablet, so that the stylus is connected to the other tablet. Pair with another tablet. After the pairing is complete, the user can use the stylus to perform operations such as clicking, writing, etc. on the other tablet.
  • the pairing process of the accessory device and the electronic device is complicated, and when switching the use object of the accessory device, the fluency is low, which greatly affects the user experience.
  • a device pairing method, an electronic device, and a computer-readable storage medium provided by the embodiments of the present application can simplify the pairing switching process between an accessory device and an electronic device, so that the accessory device can smoothly switch between different objects of use, solving the problem of In the current device pairing scheme, the pairing process of the accessory device and the electronic device is complicated, and the process of switching the use object of the accessory device is low in fluency, which affects the user's use experience, and has strong ease of use and practicability.
  • the device pairing system is a system to which the device pairing method provided by the embodiment of the present application is applicable.
  • the device pairing system includes at least one accessory device 101 (only one is shown in FIG. 1 ) and at least one electronic device 102 (only one is shown in FIG. 1 ) having a display screen.
  • the accessory device 101 is successfully paired with the electronic device 102
  • the user can use the accessory device 101 to perform operations such as clicking, writing, etc. on the display screen of the electronic device 102 .
  • the accessory device 101 may be an active stylus, for example, an active capacitive stylus. It is understandable that the stylus is only a word used in the embodiment of this application, and the meaning it represents is an information input device, and the functions performed by it have been recorded in this embodiment, and its name does not constitute a structure for this embodiment. any restrictions.
  • the stylus may also be referred to as, for example, a stylus pen, an active stylus pen, a signal pen, or other nouns.
  • the electronic device 102 may be a cell phone, tablet, personal digital assistant (PDA), wearable device, laptop, smart screen, desktop with a touch-sensitive surface (eg, a touch panel) Computers, smart TVs, smart screens, electronic billboards and other electronic equipment.
  • PDA personal digital assistant
  • Exemplary embodiments of electronic devices include, but are not limited to, electronic devices powered by iOS, android, microsoft, or other operating systems.
  • FIG. 2 is a schematic structural diagram of an accessory device 101 provided by an embodiment of the present application.
  • the accessory device 101 shown in FIG. 2 may be an active capacitive stylus.
  • the active capacitive stylus may include: a processor 201, a power supply 202, a microcontroller unit (MCU) 203, a direct current-direct current converter (DC/DC) ) 204 , a signal transmission circuit 205 , a signal detection circuit 206 , a pressure sensor 207 and a wireless communication module 208 .
  • MCU microcontroller unit
  • DC/DC direct current-direct current converter
  • the processor 201 may include one or more processing units, for example, the processor 201 may include an application processor (application processor, AP), a controller, a memory, and the like. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • controller controller
  • memory and the like.
  • different processing units may be independent devices, or may be integrated in one or more processors.
  • the power source 202 may be a rechargeable lithium battery or a replaceable standard battery or the like. During operation, the power supply 202 supplies power to the MCU 203, the signal transmission circuit 205, the signal detection circuit 206, the pressure sensor 207 and the wireless communication module 208 through the DC/DC power converter 204.
  • the signal detection circuit 206 can be disposed at the position of the pen tip of the accessory device 101 .
  • Signal detection circuit 206 may include one or more electrodes.
  • the signal detection circuit 206 may be used to detect a signal emitted by the screen of the electronic device 102, such as a Direct Sequence Spread Spectrum (DSSS) signal.
  • DSSS Direct Sequence Spread Spectrum
  • the pressure sensor 207 can be disposed at the position of the pen tip of the accessory device 101 .
  • the pressure sensor 207 can be used to detect the pressure value that the pen tip of the accessory device 101 bears, that is, pressure sensitive information.
  • the pressure sensor 207 may be any one or a combination of pressure sensors of a piezoresistive pressure sensor, a ceramic pressure sensor, a diffused silicon pressure sensor, a sapphire pressure sensor, a piezoelectric pressure sensor, and the like.
  • the wireless communication module 208 can provide a near field communication technology solution applied on the accessory device 101, for example, it can include Bluetooth (Bluetooth, BT), Bluetooth Low Energy (BLE), near field communication (near field communication) , NFC), wireless local area networks (WLAN) (such as wireless fidelity (WiFi)), radio frequency identification (radio frequency identification, RFID) or ZigBee (ZigBee) and other wireless communication solutions.
  • the wireless communication module 208 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 208 can be used together with an antenna (not shown in FIG. 2 ) of the accessory device 101 to receive electromagnetic waves through the antenna, demodulate and filter the electromagnetic wave signals, and send the processed signals to the processor 201 .
  • the wireless communication module 208 can also receive the signal to be sent from the processor 201, perform frequency modulation on it, amplify the signal, and convert it into electromagnetic waves for radiation through the antenna.
  • the MCU 203 generates a pulse width modulation (Pulse Width Modulation, PWM) signal under the control of the clock generated by the internal crystal oscillator, and drives the signal transmitting circuit 205 to transmit the PWM signal.
  • PWM Pulse Width Modulation
  • Signal transmission circuit 205 may include one or more electrodes.
  • the signal transmitting circuit 205 can be disposed at the position of the pen tip of the accessory device 101 .
  • the PWM signal transmitted by the signal transmitting circuit 205 is transmitted to the screen of the electronic device 102 through the pen tip of the accessory device 101 in the form of a high-voltage square wave signal.
  • the signal transmitting circuit 205 can be used to transmit a PWM signal, and the PWM signal is used for the electronic device 102 to determine the reporting point information of the accessory device 101 .
  • the signal transmitting circuit 205 can be used to transmit two PWM signals, wherein one signal is used by the electronic device 102 to determine the reporting point information of the accessory device 101 , and the two signals are combined for the electronic device 102 to determine the accessory device 101 of inclination.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the accessory device 101 .
  • the accessory device 101 may include more or less components than shown, such as buttons, LED indicators, or the accessory device 101 may also combine some components, or separate some components, Or a different component arrangement.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • FIG. 3 exemplarily shows a schematic structural diagram of an electronic device 102 provided by an embodiment of the present application.
  • the electronic device 102 may include: a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charge management module 340, a power management module 341, a battery 342, Antenna 1, Antenna 2, Mobile Communication Module 350, Wireless Communication Module 360, Audio Module 370, Speaker 370A, Receiver 370B, Microphone 370C, Headphone Interface 370D, Sensor Module 380, Key 390, Motor 391, Indicator 392, Camera 393, a display screen 394, and a subscriber identification module (subscriber identification module, SIM) card interface 395 and the like.
  • a processor 310 an external memory interface 320
  • an internal memory 321 a universal serial bus (USB) interface 330
  • USB universal serial bus
  • the sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, an air pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, and ambient light.
  • the processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (application processor, AP), a touch chip such as a touch panel integrated circuit (TPIC), a graphics processor (graphics processing unit, GPU), image signal processor (image signal processor, ISP), controller, memory, digital signal processor (digital signal processor, DSP), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor
  • AP application processor
  • TPIC touch panel integrated circuit
  • GPU graphics processor
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • DSP digital signal processor
  • the controller may be the nerve center and command center of the electronic device 102 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 310 for storing instructions and data.
  • the memory in processor 310 is cache memory. This memory may hold instructions or data that have just been used or cycled by processor 310. If the processor 310 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 310 is reduced, thereby increasing the efficiency of the system.
  • Internal memory 321 may be used to store computer executable program code, which includes instructions.
  • the processor 310 executes various functional applications and data processing of the electronic device 102 by executing the instructions stored in the internal memory 321 .
  • the internal memory 321 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 102 and the like.
  • the wireless communication function of the electronic device 102 may be implemented by the antenna 1, the antenna 2, the wireless communication module 360, the modem processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 102 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the wireless communication module 360 can provide applications on the electronic device 102 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), NFC, infrared technology (infrared, IR), RFID or ZigBee and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellites System
  • frequency modulation frequency modulation
  • FM frequency modulation
  • NFC infrared technology
  • RFID ZigBee and other wireless communication solutions.
  • the wireless communication module 360 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 360 receives electromagnetic waves via the antenna 2 , demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310 .
  • the wireless communication module 360 can also receive the signal to be sent from the processor 310 , perform frequency modulation on it, amplify it, and
  • the wireless communication module 360 may also receive wireless communication information (eg, a BLE message) sent by the accessory device 101 during the writing process, where the wireless communication information carries the pressure-sensing information detected by the accessory device 101 .
  • the wireless communication information is transmitted to the AP, and the AP determines the pressure-sensing information of the accessory device 101 according to the wireless communication information. After that, the AP can transfer the pressure-sensing information of the accessory device 101 to the GPU for subsequent graphics rendering for the accessory device 101 .
  • the electronic device 102 realizes the display function through the GPU, the display screen 394, and the AP.
  • the GPU is a microprocessor for image processing, and connects the display screen 394 and the AP.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 310 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the GPU may perform graphics rendering according to the pressure information, point reporting information, and inclination of the accessory device 101 , and transmit the rendered result to the display screen 394 , which displays the corresponding written content.
  • Display screen 394 is used to display images, videos, and the like. In this embodiment of the present application, the display screen 394 may be used to display the writing content of the accessory device 101 .
  • Display screen 394 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • the electronic device 102 may include 1 or N display screens 394 , where N is a positive integer greater than 1.
  • the pressure sensor 380A is used to sense the pressure signal, and can convert the pressure signal into a signal.
  • the pressure sensor 380A may be provided on the display screen 394 .
  • the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to pressure sensor 380A, the capacitance between the electrodes changes. The electronic device 102 determines the intensity of the pressure from the change in capacitance. When a touch operation acts on the display screen 394, the electronic device 102 detects the intensity of the touch operation according to the pressure sensor 380A.
  • the electronic device 102 can also calculate the touched position according to the detection signal of the pressure sensor 380A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
  • Touch sensor 380K also known as "touch panel”.
  • the touch sensor 380K may be disposed on the display screen 394, and the touch sensor 380K and the display screen 394 form a touch screen, also called a "touch screen”.
  • the touch sensor 380K is used to detect a touch operation on or near it.
  • the touch sensor can communicate the detected touch operation to the AP to determine the touch event type.
  • Visual output related to touch operations may be provided through display screen 394 .
  • the touch sensor 380K may also be disposed on the surface of the electronic device 102 at a different location than the display screen 394 .
  • the touch sensor 380K can be used to transmit a signal (eg, a DSSS signal) to the accessory device 101, and the signal can be used by the accessory device 101 to know that the screen of the electronic device 102 is nearby, that is, to know that the user has a writing intention.
  • a signal eg, a DSSS signal
  • the touch sensor 380K may also be used to receive a signal transmitted by the accessory device 101 , and the processor 310 may determine the reporting point information and the inclination according to the signal.
  • the working principle of the touch sensor 380K will be described in detail later, which will not be repeated here.
  • the screen of the electronic device 102 may refer to a device composed of a protective glass (not shown in the figure), a touch sensor 380K, a display screen 394, a bottom plate (not shown in the figure) and some peripheral circuits.
  • the screen is, from top to bottom, the protective glass, the touch sensor 380K, the display screen 394, and the bottom plate.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 102 .
  • the electronic device 102 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the software system of the electronic device 102 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present application take an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 102 as an example.
  • FIG. 4 is a block diagram of the software structure of the electronic device 102 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
  • the application layer can include a series of application packages.
  • the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and so on.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make these data accessible to applications.
  • the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
  • a display interface can consist of one or more views.
  • the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions of the electronic device 102, such as management of call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
  • Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
  • the core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • surface manager surface manager
  • media library Media Libraries
  • 3D graphics processing library eg: OpenGL ES
  • 2D graphics engine eg: SGL
  • the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
  • a first information channel, a second information channel and a third information channel may be formed between the accessory device 101 and the electronic device 102 .
  • the first information channel (ie the above wireless connection):
  • the wireless communication module 208 of the accessory device 101 and the wireless communication module 360 of the electronic device 102 have at least one communication processing module of the same type, and the wireless communication module 208 and the wireless communication module 360 establish the first information through the same type of communication processing module described above. aisle.
  • the wireless communication module 208 includes a BLE module and the wireless communication module 360 also includes a BLE module
  • the wireless communication module 208 and the wireless communication module 360 can establish a BLE connection channel.
  • the accessory device 101 and the electronic device 102 may exchange wireless communication information through the first information channel.
  • the accessory device 101 can send pressure-sensitive information to the electronic device 102 through the first information channel, so that the electronic device 102 renders a handwriting effect according to the pressure-sensitive information; the electronic device 102 can send configuration information to the accessory device 101 through the first information channel.
  • the second information channel (ie the above-mentioned second communication connection):
  • the second information channel is a channel through which the signal transmitting circuit 205 of the accessory device 101 transmits a signal (PWM signal) to the screen of the electronic device 102 .
  • the second information channel may include a first sub-channel, and the first sub-channel is composed of one electrode included in the signal transmitting circuit 205 of the pen tip of the accessory device 101 and the screen of the electronic device 102 .
  • the first sub-channel is used for the pen tip electrode of the accessory device 101 to cause the electrode of the signal transmitting circuit 205 to transmit a signal (eg, a PWM signal) to the screen of the electronic device 102 , and the signal is used for the electronic device 102 to obtain the report point information of the accessory device 101 .
  • a signal eg, a PWM signal
  • the in-screen touch sensor 380K of the electronic device 102 may include an X-axis electrode layer and a Y-axis electrode layer.
  • the X-axis electrode layer may include a plurality of transmit (transmit, Tx) electrodes distributed in a matrix
  • the Y-axis electrode layer may include a plurality of receive (receive, Rx) electrodes distributed in a matrix.
  • the Tx electrodes and the Rx electrodes form a crisscross network, and the intersections (ie coordinate points) of the Tx electrodes and the Rx electrodes form a mutual capacitance (ie the capacitance formed by the Tx electrodes and the adjacent Rx electrodes).
  • the touch chip connected to the touch sensor 380K can send an excitation signal to each Tx electrode in turn, and then the touch chip scans each receiving Rx electrode to receive an excitation signal. signal, convert the measured voltage value to digital signal and calculate the capacitance value.
  • the electronic device 102 detects the touch operation of the finger, and the principle of detecting the input content of the accessory device 101 is different.
  • the finger, the touch sensor 380K and the insulating material between them can form a coupling capacitance, causing a slight change in current and a change in mutual capacitance.
  • the electronic device 102 detects the change of the capacitance of the touch point by scanning the X-axis electrode matrix and the Y-axis electrode matrix, and calculates the position of the finger.
  • the Tx electrodes on the touch sensor 380K are converted into Rx electrodes, which alternate with the original Rx electrodes in the X and Y axes.
  • the transmit signal of the accessory device 101 eg, an active capacitive pen
  • the signal received on the Tx electrode (which has been converted into Rx electrode) and the original Rx electrode can be amplified by the amplifying circuit of the touch chip.
  • the numerical envelope composed of the amplitude value of the received signal (or the capacitance value of the X-axis and Y-axis) can be obtained on the X-axis electrode and the Y-axis electrode respectively, and the coordinates (x, y) of the signal receiving point can be obtained by calculation. , that is, the position point of the pen tip of the accessory device 101 on the screen, that is, reporting point information.
  • a calculation method can be performed by substituting the numerical envelope into the prior envelope model of the accessory device 101 .
  • the touch chip transforms the signal from time-frequency to frequency domain, such as performing fast Fourier transform on the signal, to obtain the frequency of the signal sent by the accessory device 101 .
  • the second information channel may further include a second sub-channel, which consists of one electrode included in the signal transmitting circuit 205 of the pen tip of the accessory device 101 and the screen of the electronic device 102 .
  • the electrodes in the second subchannel are different from the electrodes in the first subchannel.
  • the second sub-channel is used for the pen tip electrode of the accessory device 101 to transmit a signal (eg, a PWM signal) to the screen of the electronic device 102 .
  • the signal transmitted by the second sub-channel, and the signal transmitted by the first sub-channel are combined for the electronic device 102 to know the inclination of the accessory device 101 .
  • the signal transmitted by the first subchannel may be referred to as the first signal (or, the first signal may also be referred to as an alarm signal), and the signal transmitted by the second subchannel may be referred to as the second signal .
  • the third information channel (ie the above-mentioned first communication connection):
  • the third information channel is the channel through which the screen of the electronic device 102 transmits a signal (eg, a DSSS signal) to the signal detection circuit 206 of the accessory device 101 .
  • a signal eg, a DSSS signal
  • the third information channel consists of the screen of the electronic device 102 and one or more receive electrodes of the signal detection circuit 206 of the accessory device 101 .
  • a signal such as a signal modulated by DSSS, is sent by one or more Tx electrodes of the touch sensor 380K in the screen of the electronic device 102 and/or Tx electrodes converted from the Rx electrodes, and the signal is sent by the accessory device 101
  • One or more receiving electrodes of the pen tip receive.
  • This signal may be referred to as an uplink signal, and the uplink signal is used for the accessory device 101 to obtain the device number of the electronic device 102 .
  • the form of the device number can be set according to actual needs.
  • the device number can be a 2-bit or 3-bit binary number.
  • the optional numbers can include four numbers: 00, 01, 10, and 11.
  • the device number of the electronic device 102 may be a number arbitrarily selected from each optional number when the electronic device 102 is connected to the accessory device 101 for the first time; or, the device number of the electronic device 102 may be preset in the internal software system of the electronic device 102 Alternatively, the device number of the electronic device 102 may be a number designated by the user in the user interface of the electronic device 102 .
  • the electronic device 102 can change the device number of the electronic device 102 through software upgrade or user setting. Before the number of the electronic device 102 is changed, the same device number is used when the electronic device 102 is connected to each accessory device 101 .
  • the uplink signal (eg DSSS signal) sent by the electronic device 102 to the accessory device 101
  • the signal sent by the accessory device 101 to the electronic device 102 (eg the first signal, the The two signals) are signals transmitted between the screen of the electronic device 102 and the pen tip of the accessory device 101 , and need to be detected or sent by the screen of the electronic device 102 or the pen tip of the accessory device 101 .
  • the following describes the mechanism of the pen tip of the accessory device 101 and the screen detection and signal transmission mechanism of the electronic device 102 .
  • accessory device 101 may continuously transmit signals (eg, PWM signals), and may also continuously detect signals (eg, DSSS signals) transmitted by electronic device 102 .
  • signals eg, PWM signals
  • signals eg, DSSS signals
  • accessory device 101 may detect and transmit signals periodically, and transmit and detect may be separated in timing. That is, the accessory device 101 performs signal transmission and signal detection respectively in different time periods of the same cycle. In this way, interference between signals can be avoided, and the power of the accessory device 101 can be saved.
  • the electronic device 102 may continuously transmit a signal (eg, a DSSS signal), and may also continuously detect a signal (eg, a PWM signal) transmitted by the accessory device 101 .
  • a signal eg, a DSSS signal
  • a signal eg, a PWM signal
  • the electronic device 102 may detect and transmit signals periodically, and may separate transmission and detection in timing. In this way, interference between signals can be avoided and the power of the electronic device 102 can be saved.
  • the accessory device 101 transmits two signals (ie, the first signal and the second signal) in one cycle, the two signals may have overlapping parts in timing, or may not overlap in timing. No restrictions apply.
  • the pairing of the accessory device 101 and the electronic device 102 means that the accessory device 101 and the electronic device 102 mutually set each other as the default data transmission object.
  • the accessory device 101 is a stylus
  • the electronic device 102 includes a tablet computer 1 and a tablet computer 2
  • the stylus pen and the tablet computer 1 and the tablet computer 2 have established a first information channel
  • the stylus pen is paired with the tablet computer 1, then the subsequent
  • the stylus detects the pressure-sensitive information
  • the stylus will transmit the pressure-sensitive information to the tablet computer 1 by default, and will not transmit the pressure-sensitive information to the tablet computer 2 by default.
  • the accessory device 101 and the electronic device 102 can discover each other and establish a first information channel through the wireless communication module 208 and the wireless communication module 360 . After that, the accessory device 101 and the electronic device 102 can perform data interaction through the above-mentioned first information channel.
  • the accessory device 101 is a stylus
  • the electronic device 102 is a tablet computer
  • both the wireless communication module 208 and the wireless communication module 360 include a Bluetooth module.
  • the processor 201 of the stylus can be provided with a stylus driver 705, and the stylus driver 705 can perform data interaction with the Bluetooth module 706 of the stylus;
  • the processor 310 of the tablet computer can include an application program 702, a stylus service 701 and an input In the system 703, the Bluetooth module of the tablet computer may include a Bluetooth protocol stack 704; after the Bluetooth module 706 of the stylus and the Bluetooth module of the tablet computer establish a Bluetooth connection channel, the stylus driver 705 can send data through the Bluetooth module 706 of the stylus To the Bluetooth protocol stack 704 of the tablet computer, the Bluetooth protocol stack 704 transmits the data to the stylus service 701, and the stylus service 701 transmits the data transmitted by the Bluetooth protocol stack 704 and the data transmitted by the application 702 to the input system 703 for processing;
  • the process of establishing the first information channel between the accessory device 101 and the electronic device 102 for the first time may be the process of pairing the accessory device 101 and the electronic device 102 for the first time, or the process of establishing the first information channel between the accessory device 101 and the electronic device 102 for the first time may not be an accessory.
  • the process of pairing the device 101 and the electronic device 102 for the first time may be the process of pairing the accessory device 101 and the electronic device 102 for the first time, or the process of establishing the first information channel between the accessory device 101 and the electronic device 102 for the first time may not be an accessory.
  • the process of pairing the device 101 and the electronic device 102 for the first time may be the process of pairing the accessory device 101 and the electronic device 102 for the first time, or the process of establishing the first information channel between the accessory device 101 and the electronic device 102 for the first time may not be an accessory.
  • the process of pairing the device 101 and the electronic device 102 for the first time may be the process of pairing the accessory device 101 and the electronic device 102 for
  • the accessory device A and the electronic device B have never established a first information channel and have never been paired.
  • the accessory device A and the electronic device B can establish the first information channel for the first time, but the accessory device A and the electronic device B do not set each other as the default The information transmission object, accessory device A and electronic device B are not paired.
  • the process of establishing the first information channel between the accessory device A and the electronic device B for the first time is not the process of pairing the accessory device A and the electronic device B for the first time.
  • the accessory device A and the electronic device B may perform the pairing operation for the first time in response to the user's operation.
  • the accessory device A and the electronic device need to enable the wireless communication function to establish the first information channel, and set the other party as the default information transmission object.
  • the first pairing process of the accessory device A and the electronic device B is the process of establishing the first information channel between the accessory device A and the electronic device B for the first time.
  • the accessory device 101 and the electronic device 102 are paired for the first time, the accessory device 101 may be paired with the electronic device 102 according to a preset pairing manner.
  • the accessory device 101 and the electronic device 102 may be paired by magnetic pairing.
  • the accessory device 101 and the electronic device 102 may be provided with a magnetic attraction structure (for example, a Hall device) in a specific area.
  • a magnetic attraction structure for example, a Hall device
  • the magnetic attraction structure of the accessory device 101 is close to the magnetic attraction structure of the electronic device 102 , the The magnetic attraction structure is attracted to the magnetic attraction structure of the electronic device 102 .
  • the pairing operation of the accessory device 101 and the electronic device 102 is triggered.
  • the electronic device 102 may display a prompt box on the display interface. For example, as shown in FIG. 8 , the electronic device 102 may display a prompt box on the display interface to prompt the user whether to connect with the accessory device 101 (ie, “My Stylus Pen”), and provide two options of “Connect” and “Cancel” .
  • the accessory device 101 ie, “My Stylus Pen”
  • the electronic device 102 may send a first connection request to the accessory device 101 through the first information channel in response to the user's clicking operation on the “connection” option.
  • the accessory device 101 After receiving the first connection request, the accessory device 101 returns the first confirmation information to the electronic device 102 , completes the connection operation, and establishes a first information channel with the electronic device 102 . After that, the electronic device 102 and the accessory device 101 can perform data interaction through the first information channel.
  • the first connection request may include the device number of the electronic device 102 ; alternatively, the electronic device 102 may also send the device number of the electronic device 102 to the accessory device 101 after establishing the first information channel.
  • the accessory device After receiving the device number of the electronic device 102 , the accessory device saves the device number and wireless communication address of the electronic device 102 , and completes the first pairing of the accessory device 101 and the electronic device 102 .
  • the accessory device 101 and the electronic device 102 may be paired by connection and pairing.
  • one end of the accessory device 101 may be provided with a pen cap, and the pen cap and the main body of the accessory device 101 are detachable connection structures.
  • the connecting head provided on the accessory device 101 can be viewed.
  • the electronic device 102 may be provided with an interface. When the connector of the accessory device 101 is in contact with the interface of the electronic device 102, the pairing operation of the accessory device 101 and the electronic device 102 is triggered.
  • the electronic device 102 may display a prompt box on the display interface. For example, as shown in FIG. 11 , the electronic device 102 may display a prompt box on the display interface to prompt the user whether to connect with the accessory device 101 (ie, “My Stylus Pen”), and provide two options of “connect” and “cancel”.
  • the accessory device 101 ie, “My Stylus Pen”.
  • the electronic device 102 may send a first connection request to the accessory device 101 through the first information channel in response to the user's clicking operation on the “connection” option.
  • the accessory device 101 After receiving the first connection request, the accessory device 101 returns the first confirmation information to the electronic device 102, completes the connection operation, and establishes a first information channel with the electronic device 102. After that, the electronic device 102 and the accessory device 101 can perform data interaction through the first information channel.
  • the first connection request may include the device number of the electronic device 102 ; alternatively, the electronic device 102 may also send the device number of the electronic device 102 to the accessory device 101 after establishing the first information channel.
  • the accessory device After receiving the device number of the electronic device 102 , the accessory device saves the device number and wireless communication address of the electronic device 102 , and completes the first pairing of the accessory device 101 and the electronic device 102 .
  • the types of the above connectors can be set according to actual needs.
  • the above connector may be any one of a Micro-B connector, a Universal Serial Bus (Universal Serial Bus, USB) Type-C connector, a Lightning connector and the like.
  • the above-mentioned interface is an interface matched with the connector.
  • the above-mentioned interface can be any one of Micro-B interface, USB Type-C interface, Lightning interface and other interfaces.
  • each electronic device 102 may be provided with a corresponding device number.
  • the device number of the electronic device 102 may be preset at the factory, or the device number of the electronic device 102 may also be user-defined.
  • the device numbers of the electronic devices 102 may be the same, or the device numbers of the electronic devices 102 may also be different.
  • the electronic device 102 transmits the device number of the electronic device 102 to the accessory device 101 during the first pairing process of the accessory device 101 and the electronic device 102 .
  • the electronic device 102 may not transmit the device number during the first pairing process.
  • the electronic device 102 may transmit the device number of the electronic device 102 to the accessory device 101 through the first information channel.
  • the accessory device 101 and the electronic device 102 may have never been paired, but the accessory device 101 and the electronic device 102 should have established the first information channel at least once, so that the electronic device 102 can pass its device number to the device through the first information channel. Accessory device 101 .
  • This embodiment of the present application does not impose any restrictions on the timing when the electronic device 102 transmits its device number to the accessory device 101 .
  • the accessory device 101 is a stylus and the electronic device 102 is a tablet computer.
  • the stylus and the tablet are both provided with a magnetic attraction structure, and both the stylus and the tablet are provided with a BLE module.
  • the BLE connection channel includes a Generic Attribute Profile (GATT) connection channel and a generic attribute-based Human Interface Device Interaction Protocol (HID Over Gatt Profile, HoGP) connection channel.
  • GATT Generic Attribute Profile
  • HoGP Human Interface Device Interaction Protocol
  • the fact that the accessory device 101 is connected to multiple electronic devices 102 means that the accessory device 101 establishes a GATT connection channel with the multiple electronic devices 102 .
  • the pairing of the accessory device 101 and a certain electronic device 102 means that the accessory device 101 establishes a HoGP connection channel with the electronic device 102 .
  • a plurality of initial device numbers are preset in the tablet computer, and the tablet computer selects an initial device number from the initial device numbers as the device number of the tablet computer.
  • the stylus and the tablet When both the stylus and the tablet have the Bluetooth BLE function turned on, the stylus and the tablet can discover each other and establish a GATT connection channel.
  • a stylus can send an advertising physical channel PDU to a tablet's BLE module by sending it to the BLE module.
  • PDUs are protocol data units.
  • the type of broadcast physical channel PDU can be ADV_IND PDU, AVD_EXT_IND PDU, AUX_ADV_IND PDU, AUX_SYNC_IND and other PDU messages.
  • the tablet After receiving the broadcast physical channel PDU, the tablet can send a scan request PDU (eg SCAN_REQ PDU) to the stylus.
  • a scan request PDU eg SCAN_REQ PDU
  • the stylus After the stylus receives the scan request PDU, it returns the scan response PDU (eg SCAN_RSP PDU) to the tablet.
  • the scan response PDU eg SCAN_RSP PDU
  • the tablet sends a connection request (CONNECT_IND) to the stylus to establish a GATT connection channel.
  • the stylus and the tablet can communicate with each other by passing the Data Physical Channel PDU (Data Physical Channel PDU) through the GATT connection channel.
  • Data Physical Channel PDU Data Physical Channel PDU
  • the stylus can read the screen type, device parameters and other information of the tablet computer based on the GATT connection channel.
  • the tablet can pass the device number to the stylus based on the GATT connection channel.
  • a system prompt box will pop up on the display interface of the tablet, asking the user whether to connect with the stylus (ie, "My Stylus").
  • the tablet computer can control the BLE module to send a first connection request to the stylus in response to the user's click operation on the "connect" option, the stylus pen returns the first confirmation information, and the tablet computer and the stylus establish a GATT connection. Then, based on the GATT connection, the tablet sends the device number to the stylus, and the stylus learns and stores the device number of the tablet.
  • the stylus and the tablet establish a HoGP connection channel to complete the first pairing of the stylus and the tablet.
  • the service-related content specified in the protocol can be transmitted based on the HoGP.
  • the stylus can send pressure-sensitive information to the tablet computer through the HoGP connection channel based on the format and process of stylus transmission information specified in HoGP.
  • the signal transmitting circuit 205 of the accessory device 101 can establish a second information channel with the screen of the electronic device 102, and the signal detecting circuit 206 of the accessory device 101 can communicate with the electronic device 102.
  • the screen of 102 establishes a third information channel.
  • the accessory device 101 is provided with a pressure sensor 207.
  • the pressure sensor 207 of the accessory device 101 can detect pressure-sensing information (hereinafter referred to as the pressure-sensing information currently detected by the accessory device 101 for short). is the first pressure-sensitive information).
  • the accessory device 101 can send an announcement signal to the touch sensor 380K of the electronic device 102 through the second information channel.
  • the action of the accessory device 101 sending the announcement signal is called “announcement”.
  • the accessory device 101 may generate an announcement signal through a preset announcement signal generation method.
  • the accessory device 101 may generate an alarm signal through a pulse width modulation (Pulse Width Modulation, PWM) technology.
  • PWM Pulse Width Modulation
  • the touch sensor 380K of the electronic device 102 After the touch sensor 380K of the electronic device 102 receives the report signal, it can transmit the report signal to the processor 310, and the processor 310 performs frequency domain conversion on the report signal to obtain the frequency of the report signal.
  • the frequency determines the type of announcing signal, and determines the pen tip position of the accessory device 101 according to the announcing signal, and then displays a corresponding handwriting effect at the pen tip position or responds to a touch command corresponding to the pen tip position.
  • the accessory device 101 does not detect other pressure-sensing information (hereinafter referred to as the second pressure-sensing information) within the first preset time period before detecting the first pressure-sensing information, the report sent by the accessory device 101 this time
  • the point signal is determined to be the first point announcement signal, and the accessory device 101 records the first time when the first point announcement signal is sent.
  • the electronic device 102 When the electronic device 102 receives an announcement signal, if within the second preset time period before receiving the current announcement signal (hereinafter referred to as the first announcement signal), other announcement signals (hereinafter referred to as the first announcement signal) are not received.
  • the second report signal the electronic device 102 determines that the behavior of receiving the first report signal is the first time the report is received, and the electronic device 102 records the second time when the report is received for the first time.
  • the specific values of the first preset duration and the second preset duration may be set according to actual requirements. For example, according to research, when the user uses the accessory device 101 on different electronic devices 102, the switching time spent by the user each time switching the object of use of the accessory device 101 is usually greater than 500 ms. Therefore, the first preset time duration can be and the second preset duration is set to 500ms.
  • the first preset duration may be consistent with the second preset duration, or, the first preset duration may also be inconsistent with the second preset duration.
  • both the first preset duration and the second preset duration may be set to 500ms; or, the first preset duration may be set to 500ms, and the second preset duration may be set to 510ms.
  • the electronic device 102 may periodically generate an uplink signal, and send the uplink signal to the signal detection circuit 206 of the accessory device 101 through the above-mentioned third information channel.
  • the uplink signal is used to transmit the device number of the electronic device 102 , and the accessory device 101 can determine whether the accessory 101 has approached the electronic device 102 by detecting the uplink signal.
  • the electronic device 102 may generate an uplink signal according to a preset uplink signal generation manner. For example, the electronic device 102 may generate the above-mentioned uplink signal by using a direct sequence spread spectrum (Direct Sequence Spread Spectrum, DSSS) technology.
  • DSSS Direct Sequence Spread Spectrum
  • the signal detection circuit 206 of the accessory device 101 After receiving the uplink signal, the signal detection circuit 206 of the accessory device 101 transmits the uplink signal to the processor 201, and the processor 201 performs frequency domain conversion on the uplink signal to obtain the frequency of the uplink signal, and determines the frequency of the uplink signal according to the frequency of the uplink signal. type. In addition, the processor 201 can analyze the uplink signal to obtain the device number of the electronic device 102 .
  • the above-mentioned second information channel and third information channel may be two different information channels, and in this case, the second information channel and the third information channel are composed of different electrodes.
  • the second information channel and the third information channel may be the same information channel, and in this case, the second information channel and the third information channel are composed of the same electrodes.
  • the accessory device 101 and the electronic device 102 transmit the point announcement signal and the uplink signal through the same information channel.
  • the electronic device 102 After receiving the point report signal, the electronic device 102 needs to determine the position of the pen tip of the accessory device 101 according to the point report signal, and render the handwriting effect at the position of the pen point. Therefore, the accessory device 101 needs to transmit the pressure-sensitive information to the electronic device 102, so that the electronic device 102 renders the handwriting effect according to the pressure-sensitive information.
  • the accessory device 101 is a stylus 1401 and the electronic device 102 is a tablet computer 1402
  • the pressure sensor of the stylus 1401 207 can detect different pressure-sensitive information
  • the stylus 1011 transmits the pressure-sensitive information to the tablet computer 1402
  • the tablet computer 1402 renders the thickness of the handwriting according to the pressure-sensitive information. The greater the pressure-sensitive information, the thicker the handwriting.
  • the stylus 1501 establishes a GATT connection channel with the tablet computer 1502 and the tablet computer 1503, and the tablet computer 1502 and the tablet computer 1503 send their respective device numbers to the stylus 1501.
  • the tablet computer 1502 and the stylus 1501 establish a HoGP connection channel.
  • the user can move the stylus 1501 from the tablet computer 1502 to the tablet computer 1503, then the stylus 1501 disconnects the HoGP connection channel with the tablet computer 1502 and keeps the GATT connection channel (basic data connection channel), the stylus and the tablet computer 1503 establish a HoGP connection channel.
  • the process of the user moving the stylus 1501 from the tablet computer 1502 to the tablet computer 1503 takes a certain amount of time, that is, the switching time.
  • the accessory device 101 can determine whether the default device needs to be re-determined according to the above-mentioned first preset duration.
  • the default device is the electronic device 102 currently paired with the accessory device 101 .
  • the above-mentioned first information channel is a BLE connection channel
  • the default device is the electronic device 102 that has established a HoGP connection channel with the accessory device 101 .
  • the accessory device 101 If the accessory device 101 has detected the second pressure-sensing information within the first preset period of time before detecting the first pressure-sensing information, it means that the time interval between the accessory device 101 detecting the pressure-sensing information twice is not long enough for the accessory device 101 to detect the pressure-sensing information twice.
  • the accessory device 101 does not switch the default device, and sends the pressure-sensitive signal to the default device through the first information channel.
  • the pressure-sensitive signal includes first pressure-sensitive information, and the default device can render a handwriting effect according to the first pressure-sensitive information.
  • the target device may not be the default device.
  • the target device is the electronic device 102 that the accessory device 101 actually contacts.
  • the accessory device 101 needs to identify the target device according to the target device number, pair with the target device, and set the target device as a new default device.
  • the target device number is the device number of the target device, and the target device number can be obtained by parsing the above-mentioned uplink signal by the accessory device 101 .
  • the target device number is the device number of the default device, and among the verification devices, only the default device matches the target device number.
  • the verification device is the electronic device 102 that currently establishes the first information channel with the accessory device 101 .
  • the target device number of each electronic device 102 may be the same device number, when the target device number is the device number of the default device, the target device may be the default device, or the target device may not be the default device.
  • the accessory device 101 may acquire the device numbers of each verification device (ie, the first device number), and determine whether there are multiple verification devices whose device numbers match the target device numbers.
  • the verification device includes a default device.
  • the accessory device 101 does not switch the default device, and sends a pressure-sensitive signal to the default device.
  • the pressure-sensitive signal includes the above-mentioned first pressure-sensitive information.
  • the default device may render a handwriting effect at the position of the pen tip according to the first pressure-sensitivity information.
  • the target device number is the device number of the default device, and there are multiple matching devices in the verification device, or the target device number is not the device number of the default device, but there is a matching device.
  • the matching device is the authentication device that matches the target device number.
  • the accessory device 101 cannot directly identify the target from the matching device equipment.
  • the accessory device 101 may send the first consultation information to each matching device.
  • the content of the first consultation information may be set according to the actual situation.
  • the first consultation information may include the first point identification and the first time.
  • the accessory device 101 may synchronously send the above-mentioned first consultation information to each matching device through the first information channel.
  • the matching device After the matching device receives the first consultation information, the matching device can determine whether the last time announcing signal is received for the first time, and calculate the deviation between the second time locally recorded by the device and the first time.
  • the matching device If the last time the matching device receives an announcement signal is not the first time, the matching device does not record the second time, or the above deviation value is greater than or equal to the preset deviation threshold, the matching device returns pairing failure information to the accessory device 101 .
  • the matching device If the last time the matching device receives the report signal is the first time the report is received, and the deviation value is less than the preset deviation threshold, the matching device returns pairing confirmation information to the accessory device 101 .
  • the above-mentioned preset deviation threshold can be set according to actual needs. For example, in some embodiments, it is found through statistics that the sum of the time consumed by the accessory device 101 to transmit the alarm signal and the time consumed by the electronic device 102 to process the alarm signal is less than 2ms, then the user can set the preset deviation threshold to 2ms Alternatively, in other embodiments, the user may also set the preset deviation threshold to values such as 1ms, 3ms, and 5ms according to other influencing factors.
  • the accessory device 101 can send the first consultation information to each matching device, if the accessory device 101 receives the pairing confirmation information returned by any matching device, the accessory device 101 confirms the matching device that sent the pairing confirmation information as the target device, and matches the target device with the target device.
  • Device pairing sets the target device as the new default device. For example, when the above-mentioned first information channel is a BLE connection channel, after the accessory device 101 confirms the matching device that sent the pairing confirmation information as the target device, the accessory device 101 pairs with the target device, that is, the accessory device 101 establishes a HoGP connection channel with the target device , set the target device as the new default device.
  • the accessory device 101 sends the first consultation information to each matching device synchronously, it can be understood that the time when the accessory device 101 sends the first consultation information to each matching device is within a preset error range.
  • the error range can be set according to the actual situation.
  • the accessory device 101 includes a stylus 1701
  • the electronic device 102 includes a tablet computer 1702 , a tablet computer 1703 , and a tablet computer 1704 .
  • a Bluetooth module 17011 is provided; on the tablet computer 1702, a Bluetooth module 17021 is provided; on the tablet computer 1703, a Bluetooth module 17031 is provided; on the tablet computer 1704, a Bluetooth module 17041 is provided.
  • the stylus 1701 is paired with the tablet computer 1703, the stylus 1701 writes on the tablet computer 1703, and the Bluetooth module 17011 of the stylus 1701 establishes a HoGP connection channel with the Bluetooth module 17031 of the tablet computer 1703.
  • the Bluetooth module 17011 of the stylus 1701 establishes a GATT connection channel with the Bluetooth module 17021 of the tablet computer 1702 and the Bluetooth module 17041 of the tablet computer 1704 respectively.
  • the stylus 1701 is moved to the tablet computer 1702 , and in response to the user's operation, writes on the tablet computer 1702 and contacts the tablet computer 1702 .
  • the stylus 1701 When the stylus 1701 is in contact with the tablet computer 1702, the stylus 1701 sends the first point signal to the tablet computer 1702 through the second information channel, and the tablet computer 1702 sends the uplink signal to the stylus 1701 through the third information channel.
  • the pressure sensor 207 of the stylus 1701 detects the first pressure-sensing information, and the stylus 1701 does not detect the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, so the stylus 1701 records The first time at which the first point signal is sent.
  • the tablet computer 1702 receives the first point notification signal, and the tablet computer 1702 does not detect the second point notification signal within the second preset time period before receiving the first point notification signal, so the tablet computer 1702 will receive the first point notification signal.
  • the point signal is determined to be the first time announcing point is received, and the second time of first receiving announcing point is recorded.
  • the stylus 1701 Since the stylus 1701 does not detect the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, the stylus 1701 parses the uplink signal to obtain the target device number.
  • the stylus 1701 determines that the tablet computer 1702 , the tablet computer 1703 , and the tablet computer 1704 all match the target device number.
  • the stylus 1701 sends the first consultation information to the tablet computer 1702 , the tablet computer 1703 and the tablet computer 1704 synchronously.
  • the first consultation information includes the first point identifier and the first time.
  • the tablet computer 1702 After receiving the first consultation information, the tablet computer 1702 detects that the last time announcing signal is received for the first time, and then obtains the second time, subtracts the first time from the second time, and obtains the difference between the second time and the first time. Deviation.
  • the tablet computer 1702 When the tablet computer 1702 detects that the deviation value is smaller than the preset deviation threshold, it returns a pairing confirmation message to the stylus 1701 .
  • the tablet computer 1703 and the tablet computer 1704 After the tablet computer 1703 and the tablet computer 1704 receive the first consultation information, since the last time the tablet computer 1703 and the tablet computer 1704 received the report point signal is not the first time to receive the report point, the tablet computer 1703 returns a pairing failure message to the stylus 1701 , the tablet computer 1704 returns a pairing failure message to the stylus 1701 .
  • the stylus 1701 After receiving the pairing confirmation message sent by the tablet computer 1702, the stylus 1701 determines the tablet computer 1702 as the target device, establishes a HoGP connection channel with the tablet computer 1702, sets the tablet computer 1702 as the new default device, and sends the pairing instruction information to the tablet computer Computer 1702. After receiving the pairing instruction information, the tablet computer 1702 completes the pairing operation with the stylus 1701 .
  • the stylus 1701 and the tablet computer 1702 establish a HoGP connection channel
  • the stylus 1701 sends the first pressure-sensitive information to the tablet computer 1702
  • the tablet computer 1702 renders a handwriting effect according to the first pressure-sensitive information.
  • the accessory device 101 may determine the polling sequence of each matching device according to the first preset rule, and poll each matching device in turn according to the polling sequence.
  • the first preset rule can be set according to actual needs. For example, in some embodiments, the first preset rule may be set to determine the polling order of each matching device according to the time when each matching device and the accessory device 101 establish the first information channel, and sorting in order from near to far. . In other embodiments, the first preset rule may be set to be sorted according to the time when each matching device has been set as the default device, in order from near to far, and the matching device that has not been set as the default device is sorted according to The time for establishing the first information channel between each matching device and the accessory device 101 is sorted in order from near to far, so as to determine the polling sequence of each matching device.
  • the accessory device 101 After determining the polling sequence of each matching device, the accessory device 101 sequentially sends the first consultation information to each matching device according to the polling sequence.
  • the matching device After the matching device receives the first consultation information, the matching device can determine whether the last time announcing signal is received for the first time, and calculate the deviation between the second time locally recorded by the device and the first time.
  • the matching device If the last time the matching device receives an announcement signal is not the first time, the matching device does not record the second time, or the above deviation value is greater than or equal to the preset deviation threshold, the matching device returns pairing failure information to the accessory device 101 .
  • the matching device If the last time the matching device receives the report signal is the first time the report is received, and the deviation value is less than the preset deviation threshold, the matching device returns pairing confirmation information to the accessory device 101 .
  • the accessory device 101 receives the pairing failure information sent by the matching device, it sends the first consultation information to the next matching device according to the polling sequence.
  • the accessory device 101 If the accessory device 101 receives pairing confirmation information sent by the matching device, it stops polling, determines the matching device that sent the pairing confirmation information as the target device, pairs with the target device, and sets the target device as a new default device.
  • the accessory device 101 includes a stylus 1901
  • the electronic device 102 includes a tablet computer 1902 and a tablet computer 1903 .
  • a Bluetooth module 19011 is provided; on the tablet computer 1902, a Bluetooth module 19021 is provided; on the tablet computer 1903, a Bluetooth module 19031 is provided.
  • the stylus 1901 is paired with the tablet computer 1903, the stylus 1901 writes on the tablet computer 1903, and the Bluetooth module 19011 of the stylus 1901 establishes a HoGP connection channel with the Bluetooth module 19031 of the tablet computer 1903.
  • the Bluetooth module 19011 of the stylus 1901 and the Bluetooth module 19021 of the tablet computer 1902 establish a GATT connection channel.
  • the stylus 1901 is moved to the tablet computer 1902, and in response to the user's operation, writes on the tablet computer 1902 and contacts the tablet computer 1902.
  • the stylus 1901 When the stylus 1901 is in contact with the tablet computer 1902, the stylus 1901 sends the first point signal to the tablet computer 1902 through the second information channel, and the tablet computer 1902 sends the uplink signal to the stylus 1901 through the third information channel.
  • the pressure sensor 207 of the stylus 1901 detects the first pressure-sensitive information, and the stylus 1901 does not detect the second pressure-sensitive information within the first preset time period before detecting the first pressure-sensitive information, so the stylus 1901 records The first time at which the first point signal is sent.
  • the tablet computer 1902 receives the first report signal, and the tablet computer 1902 does not detect the second report signal within the second preset time period before receiving the first report signal, so the tablet computer 1902 will receive the first report.
  • the point signal is determined to be the first time announcing point is received, and the second time of first receiving announcing point is recorded.
  • the stylus 1901 Since the stylus 1901 does not detect the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, the stylus 1901 parses the uplink signal to obtain the target device number.
  • the stylus 1901 determines that both the tablet computer 1902 and the tablet computer 1903 match the target device number according to the target device number.
  • the stylus 1901 determines the polling order of the tablet computer 1902 and the tablet computer 1903 according to the first preset rule.
  • the first preset rule is that the stylus 1901 sorts according to the time when each matching device has been set as the default device, according to the order from near to far.
  • the time of establishing the first information channel with the stylus 1901 is sorted in order from near to far, so as to determine the polling order of each matching device.
  • the polling sequence of the tablet computer 1902 and the tablet computer 1903 is to query the tablet computer 1903 first, and then query the tablet computer 1902 .
  • the stylus 1901 sends the first consultation information to the tablet computer 1903 first.
  • the first consultation information includes the first point identifier and the first time.
  • the tablet computer 1903 After the tablet computer 1903 receives the first consultation information, it detects that the last time the tablet computer 1903 received an announcement signal is not the first time to receive an announcement. Therefore, the tablet computer 1903 returns a pairing failure message to the stylus 1901 .
  • the stylus pen 1901 After receiving the pairing failure information returned by the tablet computer 1903, the stylus pen 1901 sends the first consultation information to the tablet computer 1902 according to the above polling sequence.
  • the tablet computer 1902 After receiving the first consultation information, the tablet computer 1902 detects that the last time announcing signal is received for the first time, and then obtains the second time, subtracts the first time from the second time, and obtains the difference between the second time and the first time. Deviation.
  • the tablet computer 1902 when the tablet computer 1902 detects that the deviation value is smaller than the preset deviation threshold, it returns a pairing confirmation message to the stylus 1901, and renders the handwriting effect according to the first pressure-sensitive information.
  • the stylus 1901 After receiving the pairing confirmation message sent by the tablet computer 1902, the stylus 1901 determines the tablet computer 1902 as the target device, establishes a HoGP connection channel with the tablet computer 1902, sets the tablet computer 1902 as the new default device, and sends the pairing instruction information to the tablet computer Computer 1902. After receiving the pairing instruction information, the tablet computer 1902 completes the pairing operation with the stylus 1901 .
  • the stylus 1901 sends the first pressure-sensitive information to the tablet computer 1902, and the tablet computer 1902 renders the handwriting effect according to the first pressure-sensitive information.
  • the accessory device 101 has inquired about all matching devices and still does not receive the pairing confirmation message, it means that the target device may not have the wireless communication function enabled, so that the accessory device 101 cannot establish the first information channel with the target device.
  • the accessory device 101 may perform a preset prompt operation, and remind the user to enable the wireless communication function of the target device through the preset prompt operation.
  • the content of the preset prompt operation can be set according to the actual situation.
  • the preset prompting operation may be any one or a combination of any one or a combination of prompting methods such as vibration, buzzer sounding, and speaker voice broadcast.
  • the stylus 2201 is writing on the tablet computer 2202, and the tablet computer 2202 does not have the Bluetooth function enabled, so that the stylus 2201 cannot find the target device.
  • the stylus 2201 can remind the user to turn on the Bluetooth function of the tablet computer 2202 by means of vibration; or, as shown in FIG.
  • the stylus 2201 when the stylus 2201 is provided with a buzzer, the stylus 2201 can also control the buzzer to emit The sound of "di" reminds the user to turn on the Bluetooth function of the tablet computer 2202; or, as shown in Figure 24, when the stylus 2201 is provided with a speaker, the stylus 2201 can also control the speaker to broadcast "Please turn on the Bluetooth function", In this way, the user is reminded to turn on the Bluetooth function of the tablet computer 2202 .
  • the accessory device 101 includes a stylus 2501 and a stylus 2502
  • the electronic device 102 includes a mobile phone 2503 and a tablet computer 2504 .
  • the stylus 2501 is provided with a Bluetooth module 25011; the stylus 2502 is provided with a Bluetooth module 25021; the mobile phone 2503 is provided with a Bluetooth module 25031; and the tablet computer 2504 is provided with a Bluetooth module 25041.
  • the stylus 2501 is paired with the mobile phone 2503, the stylus 2501 writes on the mobile phone 2503, and the Bluetooth module 25011 of the stylus 2501 establishes a HoGP connection channel with the Bluetooth module 25031 of the mobile phone 2503.
  • the Bluetooth module 25011 of the stylus 2501 and the Bluetooth module 25041 of the tablet computer 2504 establish a GATT connection channel.
  • the stylus 2502 is paired with the tablet computer 2504, the stylus 2502 writes on the tablet computer 2504, and the Bluetooth module 25021 of the stylus 2502 establishes a HoGP connection channel with the Bluetooth module 25041 of the tablet computer 2504.
  • the Bluetooth module 25021 of the stylus 2502 and the Bluetooth module 25031 of the mobile phone 2503 establish a GATT connection channel.
  • the stylus 2501 leaves the mobile phone 2503, and the stylus 2502 leaves the tablet 2504.
  • the stylus 2502 is moved to the mobile phone 2503, and in response to the user's operation, writes on the mobile phone 2503 and contacts the mobile phone 2503.
  • the stylus 2502 When the stylus 2502 is in contact with the mobile phone 2503, the stylus 2502 sends the report signal 1 to the mobile phone 2503 through the second information channel, and the mobile phone 2503 sends the uplink signal 1 to the stylus 2502 through the third information channel.
  • the pressure sensor of the stylus 2502 detects the pressure-sensitive information 1, and the stylus 2502 does not detect other pressure-sensitive information within the first preset time period before detecting the pressure-sensitive information 1, so the stylus 2502 records and sends the report point signal 1 at time T1.
  • the mobile phone 2503 receives the report signal 1, and the mobile phone 2503 does not detect other report signals within the second preset time period before receiving the report signal 1, so the mobile phone 2503 determines that the report signal 1 is received for the first time. point, and record the time T2 when the point is first received.
  • the stylus 2502 Since the stylus 2502 does not detect other pressure-sensitive information within the first preset time period before detecting the pressure-sensitive information 1, the stylus 2502 parses the uplink signal 1 to obtain the target device number 1.
  • the stylus 2502 determines that both the mobile phone 2503 and the tablet computer 2504 match the target device number 1.
  • the stylus 2502 sends consultation information 1 to the mobile phone 2503 and the tablet computer 2504.
  • the consultation information 1 includes the first point identifier and the time T1.
  • the mobile phone 2503 After the mobile phone 2503 receives the consultation information 1, it detects that the last received report signal is the received report signal 1, and the received report signal 1 is the first time to receive the report. Therefore, the mobile phone 2503 obtains the time T2 and subtracts the time T1 from the time T2. , the first deviation value between time T2 and time T1 is obtained.
  • the mobile phone 2503 When the mobile phone 2503 detects that the first deviation value is smaller than the preset deviation threshold, it returns a pairing confirmation message to the stylus 2503 .
  • the tablet computer 2504 After the tablet computer 2504 receives the consultation information 1, it detects that the last time the tablet computer 2504 receives an announcement signal is not the first time to receive an announcement. Therefore, the tablet computer 2504 returns a pairing failure message to the stylus 2502.
  • the stylus 2502 After the stylus 2502 receives the pairing confirmation message sent by the mobile phone 2503, it determines the mobile phone 2503 as the target device, pairs with the mobile phone 2503, sets the mobile phone 2503 as the new default device, establishes a HoGP connection channel with the mobile phone 2503, and sends the pairing instruction information to Phone 2503. After receiving the pairing instruction information, the mobile phone 2503 completes the pairing operation with the stylus 2502 .
  • the stylus 2502 and the mobile phone 2503 establish a HoGP connection channel
  • the stylus 2502 sends the pressure sensitive information 1 to the mobile phone 2503
  • the mobile phone 2503 renders the handwriting effect according to the pressure sensitive information 1 .
  • the stylus 2501 is moved to the tablet computer 2504 , and in response to the user's operation, writes on the tablet computer 2504 and contacts the tablet computer 2504 .
  • the stylus 2501 When the stylus 2501 is in contact with the tablet computer 2504, the stylus 2501 sends an announcement signal 2 to the tablet computer 2504 through the AC connection channel, and the tablet computer 2504 sends the uplink signal 2 to the stylus pen 2501 through the AC connection channel.
  • the pressure sensor of the stylus 2501 detects the pressure-sensitive information 2, and the stylus 2501 does not detect other pressure-sensitive information within the first preset period of time before detecting the pressure-sensitive information 2, so the stylus 2501 records and sends the reporting point signal 2 at time T3.
  • the tablet computer 2504 receives the reporting point signal 2, and the tablet computer 2504 does not detect other reporting point signals within the second preset time period before receiving the reporting point signal 2, so the tablet computer 2504 determines that the received reporting point signal 2 is the first. Receive the report point for the second time, and record the time T4 when the report point is received for the first time.
  • the stylus 2501 Since the stylus 2501 does not detect other pressure-sensitive information within the first preset time period before detecting the pressure-sensitive information 2 , the stylus 2501 parses the uplink signal 2 to obtain the target device number 1 .
  • the stylus 2501 determines that both the mobile phone 2503 and the tablet computer 2504 match the target device number 1.
  • the stylus 2501 sends the consultation information 2 to the mobile phone 2503 and the tablet computer 2504 through the above.
  • the consultation information 2 includes the first point identifier and the time T3.
  • the stylus pen 2502 Since the stylus pen 2502 writes on the mobile phone 2503, after the mobile phone 2503 receives the consultation information 2, it detects that the last time the mobile phone 2503 receives the report signal is not the first time to receive the report, so the mobile phone 2503 returns a pairing failure message to the stylus 2501 .
  • the tablet computer 2504 After the tablet computer 2504 receives the consultation information 2, it detects that the last received report signal is the received report signal 2, and the received report signal 2 is the first time to receive the report. Therefore, the tablet computer 2504 obtains the time T4 and subtracts the time T4 from the time T4. At time T3, a second deviation value between time T4 and time T3 is obtained.
  • the tablet computer 2504 When the tablet computer 2504 detects that the second deviation value is smaller than the preset deviation threshold, it returns a pairing confirmation message to the stylus 2504 .
  • the stylus 2501 After receiving the pairing confirmation message sent by the tablet computer 2504, the stylus 2501 determines the tablet computer 2504 as the target device, pairs with the tablet computer 2504, sets the tablet computer 2504 as the new default device, and establishes a HoGP connection channel with the tablet computer 2504. Send pairing instructions to tablet 2504. After receiving the pairing instruction information, the tablet computer 2504 completes the pairing operation with the stylus 2501 .
  • the stylus 2502 and the tablet computer 2504 establish a HoGP connection channel
  • the stylus 2502 sends the pressure-sensitive information 2 to the tablet computer 2504
  • the tablet computer 2504 renders the handwriting effect according to the pressure-sensitive information 2 .
  • the target device number is not the device number of the default device, and there is no matching device in the verification device.
  • the target device number is not the device number of the default device, and there is no matching device in the verification device, it means that the target device number does not match each verification device.
  • device number 1 and device number 2 are stored in accessory device A.
  • accessory device A is writing on the default device.
  • the default device changed the device number from device number 1 to device number 3 and did not notify accessory device A.
  • the target device number obtained by accessory device A is device number 3, but accessory device A does not record device number 3. Therefore, accessory device A determines that the target device number is not the device number of the default device, and there is no match in the verification device. equipment.
  • the device number of the electronic device B is device number 3, and the wireless communication function is not enabled for the electronic device B.
  • the accessory device A writes on the electronic device B, and the obtained target device number is device number 3.
  • the electronic device B has never been connected to the accessory device A, and the wireless communication function is not currently enabled. Therefore, the accessory device A has never recorded the device number 3, so the accessory device determines that the target device number is not the device number of the default device, and verifies the device number in the device. No matching device exists.
  • the accessory device 101 may directly determine the current default device as the target device without switching the default device, and send a pressure-sensitive signal to the default device.
  • the default device After receiving the pressure-sensitive signal, the default device renders a handwriting effect according to the first pressure-sensitive information in the pressure-sensitive signal.
  • the accessory device 101 may also perform a preset prompt operation to remind the user to enable the wireless communication function of the target device through the preset prompt operation.
  • the content of the preset prompt operation can be set according to the actual situation.
  • the preset prompt operation may be any one or a combination of any one or a combination of prompt methods such as vibration, buzzer sounding, and speaker voice broadcast.
  • the electronic device 102 when the accessory device 101 and the electronic device 102 are in contact, the electronic device 102 can transmit an uplink signal to the accessory device 101 through the third information channel.
  • the target device number of the electronic device 102 is included in the uplink signal.
  • the accessory device 101 can determine whether the default device needs to be switched according to the target device number.
  • the accessory device 101 needs to switch the default device, it can send the first consultation information to the corresponding electronic device 102 according to the target device number, thereby identifying the target device, pairing with the target device, and setting the target device as a new default device.
  • the accessory device 101 can determine whether to switch the paired electronic device 102 and identify the target device by itself. This process does not require the user to actively perform a specific pairing operation, which improves the ability of the accessory device 101 to switch the use object.
  • the fluency, and strong ease of use and practicability improve the user experience.
  • the device pairing method provided by this embodiment includes:
  • the accessory device is in contact with the electronic device.
  • the pressure sensor of the accessory device detects the first pressure-sensitive information, and the signal transmitting circuit of the accessory device can establish a second information channel with the screen of the electronic device, and the signal detection circuit of the accessory device can A third information channel is established with the screen of the electronic device.
  • the accessory device can send the first point announcement signal to the electronic device through the second information channel, and the electronic device sends the uplink signal to the accessory device through the third information channel.
  • the electronic device After receiving the first report signal, the electronic device can determine the position of the pen tip according to the first report signal, and then render the handwriting effect at the position of the pen tip or respond to the touch command corresponding to the position of the pen tip.
  • the accessory device After the accessory device receives the uplink signal, it can parse the uplink signal to obtain the target device number of the target device (ie, the electronic device currently in contact with the accessory device).
  • the accessory device determines whether the second pressure-sensing information is not detected within the first preset time period before the first pressure-sensing information is detected, and if so, executes S2803, and if not, executes S2805.
  • the accessory device When the accessory device detects the first pressure-sensing information, it may detect whether other pressure-sensing information, that is, the second pressure-sensing information, has been detected in the previous first preset time period.
  • the accessory device If the accessory device has detected the second pressure-sensing information within the first preset period of time before the first pressure-sensing information is detected, it means that the time interval between the accessory device detecting the pressure-sensing information twice adjacently is not enough for the user to switch the accessory.
  • the target device is the electronic device currently paired with the accessory device (ie the default device). At this time, the accessory device executes S2805.
  • the accessory device has detected the second pressure-sensitivity information within a first preset time period before detecting the first pressure-sensitivity information, and the time when the accessory device detected the first pressure-sensitivity information is the same as when the second pressure-sensitivity information was detected.
  • the time interval is 87ms, and 87ms is not enough for the user to change the use object of the accessory device.
  • the accessory device can determine that the user has not changed the use object of the accessory device, and the target object is still the default device.
  • the accessory device does not detect the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, it indicates that the target device may not be the default device.
  • the first preset duration is set to 500ms. If the accessory device does not detect the second pressure-sensing information within 500ms before detecting the first pressure-sensing information, it means that the interval between the user's current use of the accessory device and the last time the user used the accessory device is sufficient for the user to replace the accessory device object of use.
  • the target device may still be the default device, that is, the user is still using the accessory device on the same electronic device; or, the target device may not be the default device, that is, the user has moved the accessory device to another electronic device for use.
  • the accessory device records the first time when the first pressure-sensing information is detected, and executes S2803.
  • the accessory device determines whether the target device number can be obtained by analysis, if so, execute S2804, and if not, execute S2814.
  • the accessory device parses the uplink signal to determine whether the target device number can be obtained by parsing.
  • the accessory device cannot parse the target device number, it may be that the accessory support function (such as the stylus function) is not enabled on the target device. Therefore, the target device does not transmit the uplink signal to the accessory device, and the accessory device cannot receive the uplink signal and cannot connect to the accessory device. The upstream signal is parsed, and the target device number cannot be obtained. Therefore, the accessory device executes S2814.
  • the accessory support function such as the stylus function
  • S2804 is executed.
  • the accessory device determines whether there is a verification device matching the target device number, if yes, execute S2806, and if not, execute S2805.
  • the verification device is the electronic device that currently establishes the first information channel with the accessory device.
  • Validation devices include default devices.
  • the accessory device can acquire the device number of each verification device to determine whether there is a verification device matching the target device number.
  • the matching between the verification device and the target device means that the device number of the verification device is consistent with the target device number.
  • the paired device executes S2806.
  • the accessory device executes S2805 without switching the default device.
  • the accessory device does not switch the default device.
  • step S2805 the accessory device determines the current default device as the target device, and does not switch the default device.
  • the accessory device can send the pressure-sensitive signal to the default device through the first information channel.
  • the pressure-sensitive signal includes first pressure-sensitive information, and after receiving the pressure-sensitive signal, the default device can render the handwriting effect at the position of the pen tip according to the first pressure-sensitive information in the pressure-sensitive signal.
  • the accessory device determines whether the target device number is the device number of the default device, and if so, executes S2807 , and if not, executes S2808 .
  • the accessory device After the accessory device detects that there is a verification device matching the target device number, the accessory device can determine whether the target device number is the device number of the default device.
  • the target device number is the device number of the default device, it means that the target device may be the default device, and at this time, the accessory device executes S2807.
  • the accessory device executes S2808.
  • the accessory device determines whether there is only one matching device in the verification device, if so, execute S2805, and if not, execute S2809.
  • the accessory device determines that the target device number is the device number of the default device, it can determine whether there is only one matching device in the verification device.
  • the matching device is the authentication device that matches the target device number.
  • the default device is also the verification device, if there is only one matching device in the verification device, it means that only the device number of the default device in the verification device is the target device number.
  • the accessory device can determine that the target device is the default device, so the accessory device does not need to switch the default device, and S2805 is executed.
  • the target device may be the default device, or the target device may not be the default device, and the accessory device cannot directly identify the target device from the matching device.
  • the accessory device may execute S2809 to query the default device first.
  • the accessory device determines the polling sequence of each matching device according to the first preset rule, sends the first consultation information to each matching device in turn according to the polling sequence, and then executes S2811.
  • the accessory device cannot directly identify the target device from the matching devices.
  • the accessory device can determine the polling sequence of each matching device according to the first preset rule, send the first consultation information to each matching device in turn according to the polling sequence, and identify the target device according to the information returned by the matching device.
  • the content of the first consultation information may be set according to the actual situation.
  • the first consultation information may include the first point identification and the first time.
  • the first preset rule can be set according to actual needs. For example, in some embodiments, the first preset rule may be set to determine the polling order of each matching device according to the time when each matching device and the accessory device establish the first information channel, and sorting in order from near to far. In other embodiments, the first preset rule may be set to be sorted according to the time when each matching device has been set as the default device, in order from near to far, and the matching device that has not been set as the default device is sorted according to The time for establishing the first information channel between each matching device and the accessory device is sorted in order from near to far, so as to determine the polling sequence of each matching device.
  • the accessory device sends the first consultation information to the default device, and then executes S2810.
  • the accessory device can send the first consultation information to the default device, and the default device is preferentially consulted.
  • the accessory device determines whether the pairing failure information returned by the default device is received, and if yes, executes S2808, and if not, executes S2805.
  • the electronic device When the electronic equipment receives the first point notification signal, if it has not received other point notification signals, that is, the second point notification signal, within the second preset time period before receiving the first point notification signal, the electronic device can The reception of the first point-reporting signal is determined as the first-time point-receiving point, and the second time when the point-receiving point is received for the first time is recorded.
  • the default device After receiving the first consultation information, the default device can inquire whether the last received signal is the first to receive the report.
  • the default device may calculate a deviation value between the second time and the first time in the first consultation information.
  • the default device may return pairing confirmation information to the accessory device.
  • the default device If the last time the default device receives an announcement signal is not the first time to receive an announcement, the default device does not record the second time, or the above deviation value is greater than or equal to the preset deviation threshold, the default device can return pairing failure information to the accessory device.
  • the accessory device can determine whether to receive the pairing failure information sent by the default device.
  • the accessory device receives the pairing failure information sent by the default device, it means that the target device is not the default device. At this time, the accessory device executes S2808 to poll each matching device to identify the target device.
  • the accessory device receives the pairing confirmation information sent by the default device, it means that the target device is the default device. At this time, the accessory device does not need to switch the default device, and S2805 is executed.
  • the accessory device determines whether the pairing confirmation information returned by the matching device is received, and if so, executes S2813, and if not, executes S2812.
  • the accessory device may send the first consultation information to each matching device in sequence according to the polling sequence.
  • the accessory device After each time the accessory device sends the first consultation information to the matching device, it may determine whether to receive the pairing confirmation information returned by the matching device.
  • the pairing confirmation message carries a confirmation indication.
  • the accessory device executes S2813.
  • the accessory device executes S2812.
  • the accessory device determines whether all matching devices have been polled, if so, execute S2814, and if not, execute S2808.
  • the accessory device After receiving the pairing failure information returned by the matching device, the accessory device can query whether all matching devices have been polled.
  • the accessory device may return to S2808, switch to the next matching device according to the polling sequence, send the first consultation information to the next matching device, and continue to perform the query operation.
  • the accessory device may execute S2814 to perform a preset prompt operation.
  • the accessory device sets the electronic device that sends the pairing confirmation information as a new default device.
  • the accessory device receives the pairing confirmation message, it means that the sender of the pairing confirmation message is the target device, the accessory device can be paired with the electronic device that sent the pairing confirmation message, and the pairing of the electronic device that sends the pairing confirmation message is set as the new default device .
  • the accessory device performs a preset prompt operation.
  • the accessory device can perform a preset prompt operation to remind the user to turn on the wireless communication function of the target device.
  • the content of the preset prompt operation can be set according to the actual situation.
  • the preset prompt operation may be any one or a combination of any one or a combination of prompt methods such as vibration, buzzer sounding, and speaker voice broadcast.
  • the device pairing method provided by this embodiment includes:
  • the electronic device receives the first reporting signal
  • the pressure sensor of the accessory device detects the first pressure-sensitive information, and the signal transmitting circuit of the accessory device can establish a second information channel with the screen of the electronic device, and the signal detection circuit of the accessory device can A third information channel is established with the screen of the electronic device.
  • the accessory device can send the first point announcement signal to the electronic device through the second information channel, and the electronic device sends the uplink signal to the accessory device through the third information channel.
  • the electronic device After receiving the first report signal, the electronic device can determine the position of the pen tip according to the first report signal, and then render the handwriting effect at the position of the pen tip or respond to the touch command corresponding to the position of the pen tip.
  • the accessory device After the accessory device receives the uplink signal, it can parse the uplink signal to obtain the device number of the electronic device.
  • the electronic device determines whether the second point notification signal has not been received within the second preset time period before receiving the first point notification signal, and if so, executes S2905, and if not, executes S2903.
  • the electronic device may determine whether other point notification signals, that is, the second point notification signal, have been received within the second preset time period before receiving the first point notification signal.
  • the electronic device determines that the current reception of the first point notification signal is not the first notification point received. At this time, the electronic device executes S2903.
  • the electronic device determines that the first point notification signal received this time is the first notification point received, and executes S2905 .
  • the electronic device receives the first consultation information carrying the first time, and then executes S2904.
  • the electronic device When the electronic device receives the report signal for the first time and it is not the first time to receive the report, if it is queried by the accessory device and receives the first consultation information carrying the first time, it means that the accessory device that sent the first consultation information It is not the accessory device currently in contact with the electronic device (hereinafter referred to as the contact device), and at this time, the electronic device executes S2904.
  • the electronic device sends the pairing failure information to the sender of the first consultation information.
  • the electronic device may send pairing failure information to the sender of the first inquiry message, so as to inform the accessory device that the inquiring object is wrong.
  • the electronic device may record the second time when the first alarm signal is received, so as to perform the verification operation subsequently.
  • the electronic device receives the first consultation information carrying the first time, and then executes S2907.
  • the electronic device executes S2907.
  • the electronic device calculates the deviation value between the second time and the first time, and determines whether the deviation value is smaller than the preset deviation threshold value, and if so, executes S2908 , and if not, executes S2904 .
  • the electronic device When the electronic device receives the report signal for the first time for the first time, if it receives the first consultation information, it can perform a verification operation on the first consultation information, and calculate the deviation value between the second time and the first time, Determine whether the deviation value is less than the preset deviation threshold.
  • the accessory device sending the first consultation information is a contact device, and at this time, the electronic device executes S2908.
  • the electronic device executes S2904 and sends pairing failure information to the sender of the first consultation information.
  • the electronic device sends the pairing confirmation information to the sender of the first consultation information.
  • the electronic device may send pairing confirmation information to the sender of the first consultation information.
  • the sender of the first consultation information After receiving the pairing confirmation information, the sender of the first consultation information confirms the electronic device as a paired device. At this time, the sender of the first consultation information may reply pairing instruction information to the electronic device.
  • the electronic device receives the pairing instruction information, and completes the pairing with the sender of the first consultation information.
  • the device pairing method provided by this embodiment includes:
  • the accessory device receives a first signal through a first communication connection, the first signal includes a target device number, and the first communication connection is a communication connection established between the electronic device currently in contact with the accessory device and the accessory device;
  • the accessory device matches the target device number with the first device number, and determines the electronic device corresponding to the first device number that is consistent with the target device number as the target device, and the first device number is the electronic device that has established a wireless connection with the accessory device. the device number of the device;
  • the accessory device is paired with the target device.
  • the accessory device acquires the first signal through the first communication connection, and the first signal includes the target device number. Then, the accessory device matches the target device number with each first device number, so as to determine the target device corresponding to the target device number. After the target device is determined, the accessory device is paired with the target device.
  • the accessory device can automatically identify the target device and pair it, without the need for the user to actively perform a specific pairing operation. User experience.
  • the disclosed apparatus/electronic device and method may be implemented in other manners.
  • the above-described embodiments of the apparatus/electronic device are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated modules/units if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the present application can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing the relevant hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium, and the computer When the program is executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like.
  • the computer-readable storage medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) ), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer-readable Storage media exclude electrical carrier signals and telecommunications signals.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The present application is applicable to the technical field of terminals. Provided are a device pairing method and system, and an accessory device and a computer-readable storage medium. In the device pairing method provided in the present application, an accessory device acquires a first signal by means of a first communication connection, wherein the first signal comprises a target device number; then, the accessory device matches the target device number with each first device number to determine a target device corresponding to the target device number; and after determining the target device, the accessory device is paired with the target device. By means of the device pairing method, the accessory device can automatically identify the target device and pair with same, and a user does not need to actively execute a specific pairing operation, such that the smoothness of the accessory device switching usage objects is improved. The method is easily implemented and is practical, and the use experience of a user is improved.

Description

设备配对方法、系统、配件设备及计算机可读存储介质Device pairing method, system, accessory device, and computer-readable storage medium
本申请要求于2020年07月27日提交国家知识产权局、申请号为202010731578.X、申请名称为“设备配对方法、系统、配件设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on July 27, 2020, the application number is 202010731578.X, and the application name is "device pairing method, system, accessory device and computer-readable storage medium", The entire contents of which are incorporated herein by reference.
技术领域technical field
本申请涉及终端技术领域,尤其涉及一种设备配对方法、系统、配件设备及计算机可读存储介质。The present application relates to the field of terminal technologies, and in particular, to a device pairing method, system, accessory device, and computer-readable storage medium.
背景技术Background technique
目前有些带显示屏的电子设备(例如平板电脑、手机等)配备了辅助性的配件设备,例如手写笔等。用户通过此类配件设备,可以方便地在电子设备的显示屏上进行点击、书写等操作。At present, some electronic devices with display screens (such as tablet computers, mobile phones, etc.) are equipped with auxiliary accessory devices, such as stylus and the like. Through such accessory devices, the user can conveniently perform operations such as clicking, writing, etc. on the display screen of the electronic device.
当前配件设备在与电子设备配对时,用户需要将配件设备吸附于电子设备的特定磁吸位置,或者,用户需要将配件设备上的连接头与电子设备上的接口接触连接。When the current accessory device is paired with the electronic device, the user needs to attach the accessory device to a specific magnetic attraction position of the electronic device, or the user needs to contact and connect the connector on the accessory device with the interface on the electronic device.
当用户拥有多个电子设备时,如果用户希望在不同的电子设备上使用配件设备,则在每次切换配件设备的使用对象时,用户都需要根据上述配对方案为配件设备和相应的电子设备重新配对,操作复杂,切换过程的流畅性较低,影响用户的使用体验。When the user has multiple electronic devices, if the user wishes to use the accessory device on different electronic devices, the user needs to re-create the accessory device and the corresponding electronic device according to the above pairing scheme every time the user switches the use object of the accessory device. Pairing, the operation is complicated, and the fluency of the switching process is low, which affects the user experience.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种设备配对方法、系统、配件设备及计算机可读存储介质,可以解决当前的设备配对方案中,配件设备与电子设备的配对过程复杂,切换配件设备的使用对象时,流畅性低,影响用户使用体验的问题。The embodiments of the present application provide a device pairing method, system, accessory device, and computer-readable storage medium, which can solve the problem that in the current device pairing scheme, the pairing process of the accessory device and the electronic device is complicated, and when switching the use object of the accessory device, Low fluency, which affects the user experience.
第一方面,本申请实施例提供了一种设备配对方法,应用于配件设备,所述方法包括:In a first aspect, an embodiment of the present application provides a device pairing method, which is applied to an accessory device, and the method includes:
所述配件设备通过第一通信连接接收第一信号,所述第一信号包括目标设备编号,所述第一通信连接为当前与所述配件设备接触的电子设备和所述配件设备之间建立的通信连接;The accessory device receives a first signal through a first communication connection, the first signal includes a target device number, and the first communication connection is established between the electronic device currently in contact with the accessory device and the accessory device. communication connection;
所述配件设备将所述目标设备编号与第一设备编号进行匹配,将与所述目标设备编号一致的第一设备编号对应的电子设备确定为目标设备,所述第一设备编号为与所述配件设备建立了无线连接的电子设备的设备编号;The accessory device matches the target device number with the first device number, and determines the electronic device corresponding to the first device number that is consistent with the target device number as the target device, and the first device number is the same as the target device number. The device number of the electronic device to which the accessory device has established a wireless connection;
所述配件设备对所述目标设备配对。The accessory device is paired with the target device.
需要说明的是,当配件设备和某一电子设备接触时,配件设备和该电子设备之间可以建立第一通信连接。It should be noted that when the accessory device is in contact with an electronic device, a first communication connection can be established between the accessory device and the electronic device.
上述电子设备可以通过第一通信连接传递第一信号至配件设备。第一信号中包括目标设备编号,目标设备编号为上述电子设备的设备编号。The above electronic device may transmit the first signal to the accessory device through the first communication connection. The first signal includes a target device number, and the target device number is the device number of the electronic device.
第一通信连接的具体类型可以根据实际情况进行设置。在一些实施例中,第一通 信连接可以为上述电子设备的电极与配件设备的电极组成的电极通道。The specific type of the first communication connection can be set according to the actual situation. In some embodiments, the first communication connection may be an electrode channel formed by the electrode of the electronic device and the electrode of the accessory device.
此时,上述电子设备的电极、配件设备的电极以及两者之间的绝缘介质组成电容。电容具有通交流、阻直流的特性,所以上述电子设备可以通过上述第一通信连接将第一信号传递至配件设备。At this time, the electrodes of the electronic equipment, the electrodes of the accessory equipment, and the insulating medium between them form a capacitor. The capacitor has the characteristics of passing AC and blocking DC, so the above-mentioned electronic device can transmit the first signal to the accessory device through the above-mentioned first communication connection.
在另一些实施例中,第一通信连接可以为上述电子设备的近场通信(Near Field Communication,NFC)模块与配件设备的NFC模块建立的NFC连接。In other embodiments, the first communication connection may be an NFC connection established between a Near Field Communication (Near Field Communication, NFC) module of the electronic device and an NFC module of an accessory device.
由于NFC连接的通信距离较短,通常为0至4厘米,所以当配件设备与某一电子设备接触时,配件设备通常只能与该电子设备建立NFC连接,而无法与其他电子设备建立NFC连接,从而确保配件设备不会受到非接触的电子设备的干扰。Because the communication distance of NFC connection is short, usually 0 to 4 cm, when an accessory device is in contact with an electronic device, the accessory device can usually only establish an NFC connection with the electronic device, but cannot establish an NFC connection with other electronic devices. , thus ensuring that accessory devices are not disturbed by non-contact electronic devices.
当配件设备通过第一通信连接获取到目标设备编号时,可以将目标设备编号与各个第一设备编号进行匹配。When the accessory device obtains the target device number through the first communication connection, the target device number can be matched with each first device number.
第一设备编号为当前与该配件设备建立了无线连接的电子设备的设备编号。The first device number is the device number of the electronic device that currently establishes a wireless connection with the accessory device.
如果存在与目标设备编号一致的第一设备编号,则配件设备可以将该与目标设备编号一致的第一设备编号对应的电子设备确定为目标设备,并与目标设备配对。If there is a first device number consistent with the target device number, the accessory device may determine the electronic device corresponding to the first device number consistent with the target device number as the target device, and pair with the target device.
配件设备与目标设备配对后,表示配件设备将该目标设备确定为默认的信息传输对象。此时,配件设备可以通过无线连接与目标设备进行信息交互。例如,配件设备可以通过无线连接传递压感信息至目标设备,使得目标设备可以根据压感信息渲染笔迹效果。After the accessory device is paired with the target device, it means that the accessory device determines the target device as the default information transmission object. At this point, the accessory device can exchange information with the target device through a wireless connection. For example, the accessory device can transmit pressure-sensitive information to the target device through a wireless connection, so that the target device can render a handwriting effect according to the pressure-sensitive information.
上述无线连接的类型可以根据实际情况进行设置。例如,上述无线连接可以为蓝牙(bluetooth,BT)连接、低功耗蓝牙(Bluetooth Low Energy,BLE)连接、无线局域网(wireless local area networks,WLAN)连接、射频识别(radio frequency identification,RFID)连接或紫蜂(ZigBee)连接等无线连接通道。The above wireless connection types can be set according to the actual situation. For example, the above-mentioned wireless connection may be a Bluetooth (bluetooth, BT) connection, a Bluetooth Low Energy (BLE) connection, a wireless local area network (wireless local area networks, WLAN) connection, a radio frequency identification (radio frequency identification, RFID) connection Or a wireless connection channel such as a ZigBee connection.
通过上述设备配对方法,配件设备可以自动识别目标设备并进行配对,无需用户主动执行特定的配对操作,提高了配件设备切换使用对象的流畅性,具有较强的易用性和实用性,提高了用户的使用体验。Through the above device pairing method, the accessory device can automatically identify the target device and pair it, without the need for the user to actively perform a specific pairing operation. User experience.
在第一方面的一种可能的实现方式中,所述配件设备将所述目标设备编号与第一设备编号进行匹配,包括:In a possible implementation manner of the first aspect, the accessory device matches the target device number with the first device number, including:
若所述配件设备检测到压力传感器采集到第一压感信息,且所述配件设备在检测到所述第一压感信息之前的预设时长内未检测到第二压感信息,则所述配件设备将所述目标设备编号与第一设备编号进行匹配。If the accessory device detects that the pressure sensor has collected the first pressure-sensing information, and the accessory device does not detect the second pressure-sensing information within a preset period of time before detecting the first pressure-sensing information, the accessory device will The accessory device matches the target device number with the first device number.
需要说明的是,上述第一压感信息为压力传感器当前检测到的压感信息。上述第二压感信息为第一压感信息以外的压感信息。It should be noted that the above-mentioned first pressure-sensing information is pressure-sensing information currently detected by the pressure sensor. The second pressure-sensitive information is pressure-sensitive information other than the first pressure-sensitive information.
由于用户切换配件设备的使用对象时,将配件设备从一电子设备移动至另一电子设备需要消耗一定的切换时长。When the user switches the use object of the accessory device, it takes a certain switching time to move the accessory device from one electronic device to another electronic device.
因此,配件设备可以设置预设时长。预设时长的具体数值可以根据实际情况进行设置。例如,根据研究表明,当用户在不同的电子设备上使用配件设备时,用户每次切换配件设备的使用对象所耗费的切换时长通常会大于500ms,因此,可以将预设时长设置为500ms。Therefore, the accessory device can set a preset duration. The specific value of the preset duration can be set according to the actual situation. For example, according to research, when the user uses the accessory device on different electronic devices, the switching time spent by the user each time switching the object of the accessory device is usually greater than 500ms. Therefore, the preset duration can be set to 500ms.
如果配件设备在检测到第一压感信息之前的预设时长内,未曾检测到第二压感信 息,则表示目标设备可能并非是默认设备。If the accessory device has not detected the second pressure-sensing information within a preset period of time before detecting the first pressure-sensing information, it means that the target device may not be the default device.
此时,配件设备需要根据目标设备编号识别目标设备,将目标设备编号与第一设备编号进行匹配,从而识别目标设备。At this time, the accessory device needs to identify the target device according to the target device number, and matches the target device number with the first device number, so as to identify the target device.
在第一方面的一种可能的实现方式中,还包括:In a possible implementation manner of the first aspect, it further includes:
若所述配件设备检测到压力传感器采集到第一压感信息,且所述配件设备在检测到所述第一压感信息之前的预设时长内检测到第二压感信息,则所述配件设备将默认设备确定为所述目标设备,所述默认设备为当前与所述配件设备配对的电子设备。If the accessory device detects that the pressure sensor has collected the first pressure-sensing information, and the accessory device detects the second pressure-sensing information within a preset time period before detecting the first pressure-sensing information, the accessory device The device determines a default device as the target device, where the default device is an electronic device currently paired with the accessory device.
需要说明的是,如果配件设备在检测到第一压感信息之前的预设时长内,曾经检测到第二压感信息,则表示配件设备相邻两次检测到压感信息的时间间隔不足以让用户切换配件设备的使用对象,配件设备不切换默认设备。It should be noted that if the accessory device has detected the second pressure-sensing information within the preset time period before detecting the first pressure-sensing information, it means that the time interval between the two adjacent pressure-sensing information detected by the accessory device is not enough. Let the user switch the use object of the accessory device, and the accessory device does not switch the default device.
也即是说,此时配件设备直接将默认设备确定为目标设备,不切换配对对象。That is to say, at this time, the accessory device directly determines the default device as the target device, and does not switch the pairing object.
在第一方面的一种可能的实现方式中,所述将与所述目标设备编号一致的第一设备编号对应的电子设备确定为目标设备,包括:In a possible implementation manner of the first aspect, determining the electronic device corresponding to the first device number that is consistent with the target device number as the target device includes:
若匹配设备的数量为1且所述匹配设备为默认设备,则配件设备将所述默认设备确定为目标设备,所述匹配设备为与所述目标设备编号一致的第一设备编号对应的电子设备,所述默认设备为当前与所述配件设备配对的电子设备。If the number of matching devices is 1 and the matching device is a default device, the accessory device determines the default device as a target device, and the matching device is an electronic device corresponding to a first device number that is consistent with the target device number , the default device is the electronic device currently paired with the accessory device.
需要说明的是,由于各个电子设备的设备编号可能为相同的设备编号,因此,当目标设备编号为默认设备的设备编号时,目标设备可能是默认设备,或者,目标设备也可能不是默认设备。It should be noted that since the device number of each electronic device may be the same device number, when the target device number is the device number of the default device, the target device may be the default device, or the target device may not be the default device.
此时,配件设备可以获取各个第一设备编号,判断是否存在多个第一设备编号与目标设备编号匹配。第一设备编号包括默认设备的设备编号。At this time, the accessory device may acquire each first device number, and determine whether there are multiple first device numbers that match the target device number. The first device number includes the device number of the default device.
如果验证设备中,只有默认设备的设备编号与目标设备编号匹配,则表示目标设备为默认设备。此时,配件设备不切换默认设备。If only the device number of the default device matches the target device number among the verification devices, it means that the target device is the default device. At this time, the accessory device does not switch the default device.
在第一方面的一种可能的实现方式中,所述将与所述目标设备编号一致的第一设备编号对应的电子设备确定为目标设备,还包括:In a possible implementation manner of the first aspect, determining the electronic device corresponding to the first device number that is consistent with the target device number as the target device further includes:
若匹配设备的数量大于1或所述目标设备编号与默认设备的设备编号不一致,则所述配件设备通过所述无线连接将第一咨询信息发送至各个所述匹配设备,所述匹配设备为与所述目标设备编号一致的第一设备编号对应的电子设备,所述默认设备为当前与所述配件设备配对的电子设备;If the number of matching devices is greater than 1 or the target device number is inconsistent with the device number of the default device, the accessory device sends the first consultation information to each of the matching devices through the wireless connection, and the matching device is the same as the default device. the electronic device corresponding to the first device number with the same target device number, and the default device is the electronic device currently paired with the accessory device;
当所述配件设备接收到配对确认信息时,所述配件设备将发送所述配对确认信息的匹配设备确定为目标设备,其中,所述配对确认信息为所述目标设备在接收到所述第一咨询信息后反馈的信息。When the accessory device receives the pairing confirmation information, the accessory device determines the matching device that sent the pairing confirmation information as the target device, wherein the pairing confirmation information is that the target device receives the first Feedback information after consultation.
需要说明的是,如果存在多个第一设备编号与目标设备编号一致,则表示存在多个匹配设备。It should be noted that if there are multiple first device numbers that are consistent with the target device numbers, it means that there are multiple matching devices.
当匹配设备的数量大于1或目标设备编号不是默认设备编号时,配件设备可以通过无线连接将第一咨询信息发送至各个匹配设备。When the number of matching devices is greater than 1 or the target device number is not the default device number, the accessory device may send the first consultation information to each matching device through a wireless connection.
当匹配设备接收到第一咨询信息时,判断本设备是否为目标设备。如果是,则匹配设备返回配对确认信息至配件设备。如果不是,则匹配设备返回配对失败信息至配件设备。When the matching device receives the first consultation information, it is determined whether the device is the target device. If so, the matching device returns a pairing confirmation message to the accessory device. If not, the matching device returns a pairing failure message to the accessory device.
具体地,在一些实施例中,配件设备与电子设备接触时,可以通过第二通信连接传递第一报点信号至电子设备。Specifically, in some embodiments, when the accessory device is in contact with the electronic device, the first alarm signal can be transmitted to the electronic device through the second communication connection.
第二通信连接的类型可以根据实际情况进行设置。例如,第二通信连接可以为上述电极通道;或者,第二通信连接也可以为上述配件设备和目标设备建立的NFC连接。The type of the second communication connection can be set according to the actual situation. For example, the second communication connection may be the above-mentioned electrode channel; or, the second communication connection may also be the NFC connection established between the above-mentioned accessory device and the target device.
如果配件设备在检测到第一压感信息之前的预设时长内未检测到压感信息,则配件设备将本次发送的报点信号确定为首点报点信号,记录发送首点报点信号的第一时间。If the accessory device does not detect the pressure-sensing information within the preset time period before detecting the first pressure-sensing information, the accessory device determines the signal sent this time as the first-point reporting signal, and records the first-point reporting signal. first timing.
电子设备在接收到第一报点信号之后,可以判断在接收到第一报点信号之前的预设时长内是否检测到其他报点信号,即第二报点信号。如果电子设备在接收到第一报点信号之前的预设时长内未检测到第二报点信号,则将本次接收第一报点信号确定为首次接收报点,记录首次接收报点的第二时间。After receiving the first point notification signal, the electronic device may determine whether other point notification signals, that is, the second point notification signal, are detected within a preset time period before receiving the first point notification signal. If the electronic device does not detect the second point notification signal within the preset time period before receiving the first point notification signal, the first point notification signal received this time is determined as the first point notification signal received, and the first point notification signal received for the first time is recorded. two time.
配件设备在发送第一咨询信息时,第一咨询信息可以包括第一时间。When the accessory device sends the first consultation information, the first consultation information may include the first time.
匹配设备在接收到第一咨询信息后,可以计算第一时间和第二时间的偏差值。After receiving the first consultation information, the matching device may calculate a deviation value between the first time and the second time.
如果匹配设备最近一次接收报点信号不是首次接收报点、匹配设备未记录第二时间或上述偏差值大于或等于预设偏差阈值,则匹配设备返回配对失败信息至配件设备。If the last time the matching device receives an announcement signal is not the first time to receive an announcement, the matching device does not record the second time, or the above deviation value is greater than or equal to the preset deviation threshold, the matching device returns pairing failure information to the accessory device.
如果上述匹配设备最近一次接收报点信号为首次接收报点,且上述偏差值小于预设偏差阈值,则匹配设备返回配对确认信息至配件设备。If the last time the matching device receives the reporting point signal is the first time receiving the reporting point, and the above deviation value is less than the preset deviation threshold, the matching device returns the pairing confirmation information to the accessory device.
在另一些实施例中,电子设备可以设置有压力传感器。In other embodiments, the electronic device may be provided with a pressure sensor.
当配件设备与电子设备接触时,配件设备记录检测到第一压感信息的第三时间,电子设备记录检测到第三压感信息的第四时间。第三压感信息为电子设备的压力传感器当前检测到的压感信息。When the accessory device is in contact with the electronic device, the accessory device records a third time when the first pressure-sensitive information is detected, and the electronic device records a fourth time when the third pressure-sensitive information is detected. The third pressure-sensing information is pressure-sensing information currently detected by the pressure sensor of the electronic device.
配件设备在发送第一咨询信息时,第一咨询信息可以包括第三时间。When the accessory device sends the first consultation information, the first consultation information may include the third time.
匹配设备在接收到第一咨询信息后,可以计算第三时间和第四时间的偏差值。After receiving the first consultation information, the matching device may calculate the deviation value between the third time and the fourth time.
如果上述第三时间和第四时间的偏差值大于或等于预设偏差阈值,则匹配设备返回配对失败信息至配件设备。If the deviation between the third time and the fourth time is greater than or equal to the preset deviation threshold, the matching device returns pairing failure information to the accessory device.
如果上述第三时间和第四时间的偏差值小于预设偏差阈值,则匹配设备返回配对确认信息至配件设备。If the deviation between the third time and the fourth time is less than the preset deviation threshold, the matching device returns pairing confirmation information to the accessory device.
在另一些实施例中,电子设备还可以通过其他方式对第一咨询信息进行校验,本申请对电子设备校验第一咨询信息的方式不作任何限制。In other embodiments, the electronic device may also verify the first consultation information in other manners, and the present application does not limit the manner in which the electronic device checks the first consultation information.
当配件设备接收到配对确认信息时,配件设备可以将发送该配对确认信息的匹配设备确定为目标设备,与目标设备配对,将目标设备设置为默认的数据传输对象。When the accessory device receives the pairing confirmation information, the accessory device can determine the matching device that sent the pairing confirmation information as the target device, pair with the target device, and set the target device as the default data transmission object.
在第一方面的一种可能的实现方式中,所述配件设备通过所述无线连接将第一咨询信息发送至各个所述匹配设备,包括:In a possible implementation manner of the first aspect, the accessory device sends the first consultation information to each of the matching devices through the wireless connection, including:
所述配件设备通过所述无线连接将第一咨询信息同步发送至各个所述匹配设备。The accessory device synchronously sends the first consultation information to each of the matching devices through the wireless connection.
需要说明的是,配件设备在发送第一咨询信息时,配件设备可以选择将第一咨询信息同步发送至各个匹配设备。It should be noted that, when the accessory device sends the first consultation information, the accessory device may choose to send the first consultation information to each matching device synchronously.
可以理解的是,在工程实践的过程中,电子设备难以精确地在同一时刻开始执行多个任务,如果电子设备开始执行多个任务的时间在一定的误差范围内,则可视为电子设备同步开始执行多个任务。It can be understood that in the process of engineering practice, it is difficult for electronic devices to start executing multiple tasks at the same time. If the time when electronic devices start executing multiple tasks is within a certain error range, it can be regarded as electronic device synchronization. Start multiple tasks.
因此,当配件设备发送第一咨询信息至各个匹配设备的时间在一定的误差范围内时,可以视为配件设备将第一咨询信息同步发送至各个匹配设备。Therefore, when the time when the accessory device sends the first consultation information to each matching device is within a certain error range, it can be considered that the accessory device sends the first consultation information to each matching device synchronously.
误差范围应当根据实际情况进行设置。例如,误差范围可以被设置为1ms、2ms、5ms等数值。The error range should be set according to the actual situation. For example, the error range can be set to 1ms, 2ms, 5ms, etc. values.
在第一方面的一种可能的实现方式中,所述配件设备通过所述无线连接将第一咨询信息发送至各个所述匹配设备,包括:In a possible implementation manner of the first aspect, the accessory device sends the first consultation information to each of the matching devices through the wireless connection, including:
所述配件设备根据第一预设规则确定各个匹配设备的轮询顺序;The accessory device determines the polling sequence of each matching device according to the first preset rule;
所述配件设备根据所述轮询顺序,通过所述无线连接将第一咨询信息依次发送至各个所述匹配设备。The accessory device sequentially sends the first consultation information to each of the matching devices through the wireless connection according to the polling sequence.
需要说明的是,在另一些情况下,配件设备可以根据第一预设规则确定各个匹配设备的轮询顺序,然后根据轮询顺序将第一咨询信息依次发送至各个匹配设备。It should be noted that, in other cases, the accessory device may determine the polling sequence of each matching device according to the first preset rule, and then sequentially send the first consultation information to each matching device according to the polling sequence.
第一预设规则可以根据实际需求进行设置。例如,在一些实施例中,第一预设规则可以设置为根据各个匹配设备与配件设备建立无线连接的时间,按照由近及远的顺序进行排序,确定各个匹配设备的轮询顺序。在另一些实施例中,第一预设规则可以设置为根据各个匹配设备曾经被设置为默认设备的时间,按照由近及远的顺序进行排序,未被设置过默认设备的匹配设备,则按照各个匹配设备与配件设备建立无线连接的时间,按照由近及远的顺序进行排序,从而确定各个匹配设备的轮询顺序。The first preset rule can be set according to actual needs. For example, in some embodiments, the first preset rule may be set to determine the polling order of each matching device according to the time when each matching device establishes a wireless connection with an accessory device, and sorting in order from near to far. In other embodiments, the first preset rule may be set to be sorted according to the time when each matching device has been set as the default device, in order from near to far, and the matching device that has not been set as the default device is sorted according to The time when each matching device establishes a wireless connection with the accessory device is sorted in order from near to far, so as to determine the polling sequence of each matching device.
在第一方面的一种可能的实现方式中,在所述配件设备将所述目标设备编号与第一设备编号进行匹配之后,还包括:In a possible implementation manner of the first aspect, after the accessory device matches the target device number with the first device number, the method further includes:
若配对失败,则所述配件设备执行预设提示操作。If the pairing fails, the accessory device performs a preset prompt operation.
需要说明的是,在一些情况下,配件设备有可能出现配对失败的情况。例如,在一些实施例中,可能各个第一设备编号均与目标设备编号不一致,导致配件设备配对失败。在另一些实施例中,可能存在匹配设备,但是各个匹配设备均返回配对失败信息至配件设备,导致配件设备配对失败。It should be noted that in some cases, the accessory device may fail to pair. For example, in some embodiments, each first device number may be inconsistent with the target device number, resulting in failure to pair the accessory device. In other embodiments, there may be matching devices, but each matching device returns pairing failure information to the accessory device, resulting in a failure to pair the accessory device.
当配件设备配对失败时,配件设备可以执行预设提示操作。When the accessory device fails to pair, the accessory device can perform a preset prompt operation.
预设提示操作的内容可以根据实际情况进行设置。例如,预设提示操作可以为振动、蜂鸣器发声、扬声器语音播报等提示方式中的任意一种或多种的组合。The content of the preset prompt operation can be set according to the actual situation. For example, the preset prompt operation may be any one or a combination of any one or a combination of prompt methods such as vibration, buzzer sounding, and speaker voice broadcast.
在第一方面的一种可能的实现方式中,在所述配件设备通过第一通信连接接收第一信号之前,还包括:In a possible implementation manner of the first aspect, before the accessory device receives the first signal through the first communication connection, the method further includes:
所述配件设备通过所述无线连接接收各个电子设备发送的设备编号并存储。The accessory device receives and stores the device number sent by each electronic device through the wireless connection.
需要说明的是,当电子设备与配件设备建立无线连接时,电子设备可以在建立了无线连接之后,通过无线连接发送设备编号至配件设备。It should be noted that when the electronic device establishes a wireless connection with the accessory device, the electronic device may send the device number to the accessory device through the wireless connection after the wireless connection is established.
当配件设备接收到电子设备通过无线连接发送的设备编号时,配件设备可以将电子设备的设备编号与该电子设备的无线通信地址关联存储。When the accessory device receives the device number sent by the electronic device through the wireless connection, the accessory device may store the device number of the electronic device in association with the wireless communication address of the electronic device.
当配件设备需要识别目标设备时,配件设备可以从存储区域中获取当前建立了无线连接的各个电子设备的第一设备编号,将第一设备编号与目标设备编号进行匹配,从而识别目标设备。When the accessory device needs to identify the target device, the accessory device can obtain the first device number of each electronic device currently established wireless connection from the storage area, and match the first device number with the target device number to identify the target device.
在第一方面的一种可能的实现方式中,所述无线连接为蓝牙连接;In a possible implementation manner of the first aspect, the wireless connection is a Bluetooth connection;
所述配件设备对所述目标设备配对,包括:The accessory device is paired with the target device, including:
所述配件设备与所述目标设备根据基于通用属性的人机接口设备交互协议HoGP建立HoGP连接通道。The accessory device and the target device establish a HoGP connection channel according to the universal attribute-based human-machine interface device interaction protocol HoGP.
需要说明的是,当无线连接为蓝牙连接时,蓝牙连接包括HoGP连接通道以及通用属性协议(Generic Attribute Profile,GATT)连接通道。It should be noted that, when the wireless connection is a Bluetooth connection, the Bluetooth connection includes a HoGP connection channel and a Generic Attribute Profile (GATT) connection channel.
当配件设备确定了目标设备之后,配件设备对目标设备配对是指配件设备与目标设备建立HoGP连接通道。After the accessory device determines the target device, pairing the accessory device to the target device means that the accessory device establishes a HoGP connection channel with the target device.
第二方面,本申请实施例提供了一种配件设备,包括:In a second aspect, an embodiment of the present application provides an accessory device, including:
信号接收模块,用于通过第一通信连接接收第一信号,所述第一信号包括目标设备编号,所述第一通信连接为当前与所述配件设备接触的电子设备和所述配件设备之间建立的通信连接;A signal receiving module, configured to receive a first signal through a first communication connection, the first signal includes a target device number, and the first communication connection is between an electronic device currently in contact with the accessory device and the accessory device established communication connections;
编号匹配模块,用于将所述目标设备编号与第一设备编号进行匹配,将与所述目标设备编号一致的第一设备编号对应的电子设备确定为目标设备,所述第一设备编号为与所述配件设备建立了无线连接的电子设备的设备编号;The number matching module is used to match the target device number with the first device number, and determine the electronic device corresponding to the first device number consistent with the target device number as the target device, and the first device number is the same as the target device number. The device number of the electronic device to which the accessory device has established a wireless connection;
设备配对模块,用于对所述目标设备配对。The device pairing module is used for pairing the target device.
在第二方面的一种可能的实现方式中,所述编号匹配模块,包括:In a possible implementation manner of the second aspect, the number matching module includes:
第一配对子模块,用于若所述配件设备检测到压力传感器采集到第一压感信息,且所述配件设备在检测到所述第一压感信息之前的预设时长内未检测到第二压感信息,则将所述目标设备编号与第一设备编号进行匹配。The first pairing sub-module is used for if the accessory device detects that the pressure sensor has collected the first pressure-sensing information, and the accessory device does not detect the first pressure-sensing information within a preset time period before detecting the first pressure-sensing information. For the second pressure-sensing information, the target device number is matched with the first device number.
在第二方面的一种可能的实现方式中,所述编号匹配模块,还包括:In a possible implementation manner of the second aspect, the number matching module further includes:
第二配对子模块,用于若所述配件设备检测到压力传感器采集到第一压感信息,且所述配件设备在检测到所述第一压感信息之前的预设时长内检测到第二压感信息,则将默认设备确定为所述目标设备,所述默认设备为当前与所述配件设备配对的电子设备。The second pairing submodule is used for if the accessory device detects that the pressure sensor has collected the first pressure-sensing information, and the accessory device detects the second pressure-sensing information within a preset period of time before detecting the first pressure-sensing information pressure-sensing information, the default device is determined as the target device, and the default device is the electronic device currently paired with the accessory device.
在第二方面的一种可能的实现方式中,所述编号匹配模块,包括:In a possible implementation manner of the second aspect, the number matching module includes:
第三配对子模块,用于若匹配设备的数量为1且所述匹配设备为默认设备,则将所述默认设备确定为目标设备,所述匹配设备为与所述目标设备编号一致的第一设备编号对应的电子设备,所述默认设备为当前与所述配件设备配对的电子设备。The third pairing sub-module is configured to determine the default device as the target device if the number of matching devices is 1 and the matching device is the default device, and the matching device is the first device with the same number as the target device. The electronic device corresponding to the device number, and the default device is the electronic device currently paired with the accessory device.
在第二方面的一种可能的实现方式中,所述编号匹配模块,还包括:In a possible implementation manner of the second aspect, the number matching module further includes:
咨询信息子模块,用于若匹配设备的数量大于1或所述目标设备编号与默认设备的设备编号不一致,则通过所述无线连接将第一咨询信息发送至各个所述匹配设备,所述匹配设备为与所述目标设备编号一致的第一设备编号对应的电子设备,所述默认设备为当前与所述配件设备配对的电子设备;The consultation information submodule is used to send the first consultation information to each of the matching devices through the wireless connection if the number of matching devices is greater than 1 or the target device number is inconsistent with the device number of the default device, and the matching device The device is an electronic device corresponding to the first device number that is consistent with the target device number, and the default device is the electronic device currently paired with the accessory device;
第四配对子模块,用于当所述配件设备接收到配对确认信息时,将发送所述配对确认信息的匹配设备确定为目标设备,其中,所述配对确认信息为所述目标设备在接收到所述第一咨询信息后反馈的信息。a fourth pairing sub-module, configured to determine the matching device that sent the pairing confirmation information as the target device when the accessory device receives the pairing confirmation information, wherein the pairing confirmation information is that the target device receives the pairing confirmation information Information fed back after the first consultation information.
在第二方面的一种可能的实现方式中,所述咨询信息子模块,包括:In a possible implementation manner of the second aspect, the consultation information submodule includes:
同步发送子模块,用于通过所述无线连接将第一咨询信息同步发送至各个所述匹配设备。A synchronous sending sub-module is configured to synchronously send the first consultation information to each of the matching devices through the wireless connection.
在第二方面的一种可能的实现方式中,所述咨询信息子模块,包括:In a possible implementation manner of the second aspect, the consultation information submodule includes:
轮询顺序子模块,用于根据第一预设规则确定各个匹配设备的轮询顺序;a polling sequence submodule, configured to determine the polling sequence of each matching device according to the first preset rule;
轮询发送子模块,用于根据所述轮询顺序,通过所述无线连接将第一咨询信息依次发送至各个所述匹配设备。The polling sending sub-module is configured to send the first consultation information to each of the matching devices in sequence through the wireless connection according to the polling sequence.
在第二方面的一种可能的实现方式中,所述配件设备还包括:In a possible implementation manner of the second aspect, the accessory device further includes:
信息提示模块,用于若配对失败,则执行预设提示操作。The information prompt module is used to perform a preset prompt operation if the pairing fails.
在第二方面的一种可能的实现方式中,所述配件设备还包括:In a possible implementation manner of the second aspect, the accessory device further includes:
编号存储模块,用于通过所述无线连接接收各个电子设备发送的设备编号并存储。The number storage module is used to receive and store the device number sent by each electronic device through the wireless connection.
在第二方面的一种可能的实现方式中,所述无线连接为蓝牙连接;In a possible implementation manner of the second aspect, the wireless connection is a Bluetooth connection;
所述设备配对模块,具体用于与所述目标设备根据基于通用属性的人机接口设备交互协议HoGP建立HoGP连接通道。The device pairing module is specifically configured to establish a HoGP connection channel with the target device according to the universal attribute-based human-machine interface device interaction protocol HoGP.
第三方面,本申请实施例提供了一种设备配对系统,所述系统包括至少一个配件设备以及至少一个电子设备;In a third aspect, an embodiment of the present application provides a device pairing system, where the system includes at least one accessory device and at least one electronic device;
当所述配件设备与所述电子设备接触时,所述配件设备用于执行上述第一方面所述方法的步骤。When the accessory device is in contact with the electronic device, the accessory device is configured to perform the steps of the method described in the first aspect above.
需要说明的是,设备配对系统中可能包括一个或多个配件设备,以及一个或多个电子设备。It should be noted that the device pairing system may include one or more accessory devices and one or more electronic devices.
当配件设备响应于用户的操作,与电子设备接触时,配件设备可以执行上述第一方面所提及的方法的步骤。When the accessory device is in contact with the electronic device in response to the user's operation, the accessory device may perform the steps of the method mentioned in the first aspect above.
第四方面,提供了一种配件设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,配件设备实现如上述方法的步骤。In a fourth aspect, an accessory device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the accessory device realizes the steps of the above method.
第五方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时,使得配件设备实现如上述方法的步骤。In a fifth aspect, a computer-readable storage medium is provided, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the accessory device implements the steps of the above method.
第六方面,提供了一种芯片系统,所述芯片系统可以为单个芯片,或者多个芯片组成的芯片模组,所述芯片系统包括存储器和处理器,所述处理器执行所述存储器中存储的计算机程序,以实现如上述方法的步骤。A sixth aspect provides a chip system, the chip system may be a single chip or a chip module composed of multiple chips, the chip system includes a memory and a processor, and the processor executes the storage in the memory. A computer program to implement the steps of the above method.
本申请实施例与现有技术相比存在的有益效果是:The beneficial effects that the embodiments of the present application have compared with the prior art are:
在本申请提供的设备配对方法中,配件设备通过第一通信连接获取第一信号,第一信号包括目标设备编号。然后,配件设备将目标设备编号与各个第一设备编号进行匹配,从而确定目标设备编号对应的目标设备。在确定了目标设备之后,配件设备与目标设备配对。In the device pairing method provided by the present application, the accessory device obtains the first signal through the first communication connection, and the first signal includes the target device number. Then, the accessory device matches the target device number with each first device number, so as to determine the target device corresponding to the target device number. After the target device is determined, the accessory device is paired with the target device.
通过上述设备配对方法,配件设备可以自动识别目标设备并进行配对,无需用户主动执行特定的配对操作,提高了配件设备切换使用对象的流畅性,具有较强的易用性和实用性,提高了用户的使用体验。Through the above device pairing method, the accessory device can automatically identify the target device and pair it, without the need for the user to actively perform a specific pairing operation. User experience.
附图说明Description of drawings
图1为本申请实施例提供的一种设备配对系统的结构示意图;FIG. 1 is a schematic structural diagram of a device pairing system according to an embodiment of the present application;
图2为本申请实施例提供的一种配件设备的结构示意图;FIG. 2 is a schematic structural diagram of an accessory device provided by an embodiment of the present application;
图3为本申请实施例提供的一种电子设备的结构示意图;3 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
图4为本申请实施例提供的一种电子设备的软件结构框图;4 is a block diagram of a software structure of an electronic device provided by an embodiment of the present application;
图5为本申请实施例提供的一种信息通道的示意图;FIG. 5 is a schematic diagram of an information channel provided by an embodiment of the present application;
图6为本申请实施例提供的一种触摸传感器结构图;FIG. 6 is a structural diagram of a touch sensor provided by an embodiment of the present application;
图7为本申请实施例提供的一种设备配对系统的系统架构图;FIG. 7 is a system architecture diagram of a device pairing system provided by an embodiment of the present application;
图8为本申请实施例提供的一种磁吸配对的示意图;8 is a schematic diagram of a magnetic attraction pairing provided by an embodiment of the present application;
图9为本申请实施例提供的一种连接验证操作的示意图;9 is a schematic diagram of a connection verification operation provided by an embodiment of the present application;
图10为本申请实施例提供的一种连接配对的示意图;10 is a schematic diagram of a connection pairing provided by an embodiment of the present application;
图11为本申请实施例提供的另一种连接配对的示意图;11 is a schematic diagram of another connection pairing provided by an embodiment of the present application;
图12为本申请实施例提供的一种低功耗蓝牙连接操作的示意图;12 is a schematic diagram of a low-power Bluetooth connection operation provided by an embodiment of the present application;
图13为本申请实施例提供的一种场景示意图;FIG. 13 is a schematic diagram of a scenario provided by an embodiment of the present application;
图14为本申请实施例提供的一种场景示意图;FIG. 14 is a schematic diagram of a scenario provided by an embodiment of the present application;
图15为本申请实施例提供的一种场景示意图;FIG. 15 is a schematic diagram of a scenario provided by an embodiment of the present application;
图16为本申请实施例提供的一种场景示意图;FIG. 16 is a schematic diagram of a scenario provided by an embodiment of the present application;
图17为本申请实施例提供的一种场景示意图;FIG. 17 is a schematic diagram of a scenario provided by an embodiment of the present application;
图18为本申请实施例提供的一种场景示意图;FIG. 18 is a schematic diagram of a scenario provided by an embodiment of the present application;
图19为本申请实施例提供的一种场景示意图;FIG. 19 is a schematic diagram of a scenario provided by an embodiment of the present application;
图20为本申请实施例提供的一种场景示意图;FIG. 20 is a schematic diagram of a scenario provided by an embodiment of the present application;
图21为本申请实施例提供的一种场景示意图;FIG. 21 is a schematic diagram of a scenario provided by an embodiment of the present application;
图22为本申请实施例提供的一种场景示意图;FIG. 22 is a schematic diagram of a scenario provided by an embodiment of the present application;
图23为本申请实施例提供的一种场景示意图;FIG. 23 is a schematic diagram of a scenario provided by an embodiment of the present application;
图24为本申请实施例提供的一种场景示意图;FIG. 24 is a schematic diagram of a scenario provided by an embodiment of the present application;
图25为本申请实施例提供的一种场景示意图;FIG. 25 is a schematic diagram of a scenario provided by an embodiment of the present application;
图26为本申请实施例提供的一种场景示意图;FIG. 26 is a schematic diagram of a scenario provided by an embodiment of the present application;
图27为本申请实施例提供的一种场景示意图;FIG. 27 is a schematic diagram of a scenario provided by an embodiment of the present application;
图28为本申请实施例提供的一种设备配对方法的流程示意图;FIG. 28 is a schematic flowchart of a device pairing method provided by an embodiment of the present application;
图29为本申请实施例提供的另一种设备配对方法的流程示意图;FIG. 29 is a schematic flowchart of another device pairing method provided by an embodiment of the present application;
图30为本申请实施例提供的另一种设备配对方法的流程示意图。FIG. 30 is a schematic flowchart of another device pairing method provided by an embodiment of the present application.
具体实施方式detailed description
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It is to be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described feature, integer, step, operation, element and/or component, but does not exclude one or more other The presence or addition of features, integers, steps, operations, elements, components and/or sets thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It will also be understood that, as used in this specification and the appended claims, the term "and/or" refers to and including any and all possible combinations of one or more of the associated listed items.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意 指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the specification of this application and the appended claims, the term "if" may be contextually interpreted as "when" or "once" or "in response to determining" or "in response to detecting ". Similarly, the phrases "if it is determined" or "if the [described condition or event] is detected" may be interpreted, depending on the context, to mean "once it is determined" or "in response to the determination" or "once the [described condition or event] is detected. ]" or "in response to detection of the [described condition or event]".
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and should not be construed as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References in this specification to "one embodiment" or "some embodiments" and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "including", "including", "having" and their variants mean "including but not limited to" unless specifically emphasized otherwise.
此外,本申请实施例中提到的“多个”应当被解释为两个或两个以上。In addition, the "plurality" mentioned in the embodiments of the present application should be interpreted as two or more.
本申请实施例中提供的设备配对方法中所涉及到的步骤仅仅作为示例,并非所有的步骤均是必须执行的步骤,或者并非各个信息或消息中的内容均是必选的,在使用过程中可以根据需要酌情增加或减少。The steps involved in the device pairing method provided in the embodiments of the present application are only examples, and not all steps are required to be performed, or not all information or contents of messages are required to be selected. It can be increased or decreased as needed.
本申请实施例中同一个步骤或者具有相同功能的步骤或者消息在不同实施例之间可以互相参考借鉴。The same step or steps or messages with the same function in the embodiments of the present application may refer to each other for reference between different embodiments.
本申请实施例描述的系统架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The system architecture and service scenarios described in the embodiments of the present application are for the purpose of illustrating the technical solutions of the embodiments of the present application more clearly, and do not constitute limitations on the technical solutions provided by the embodiments of the present application. The evolution of the architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
当前许多带显示屏的电子设备(例如平板电脑、笔记本电脑、手机等)配备了辅助性的配件设备(例如手写笔等)。Many current electronic devices with displays (eg, tablets, laptops, cell phones, etc.) are equipped with auxiliary accessory devices (eg, stylus, etc.).
通过此类配件设备,用户可以方便地在电子设备的显示屏上执行点击、书写等操作,提供比手指操作更精细的使用体验。Through such accessory devices, users can conveniently perform operations such as clicking and writing on the display screen of the electronic device, providing a more refined user experience than finger operations.
当前的配件设备在与电子设备配对时,用户需要主动执行特定的配对操作。比如,用户需要将配件设备吸附于电子设备的特定磁吸位置,或者,用户需要将配件设备的连接头与配件设备的接口接触连接。When a current accessory device is paired with an electronic device, a user needs to actively perform a specific pairing operation. For example, the user needs to attach the accessory device to a specific magnetic attraction position of the electronic device, or the user needs to contact and connect the connector of the accessory device with the interface of the accessory device.
在一些情况下,用户可能拥有多个电子设备,例如,用户可能拥有多个平板电脑。当用户需要在不同的电子设备上使用同一配件设备时,用户在每次切换配件设备的使用对象的过程中,均需要主动执行配对操作,使得配件设备和电子设备重新配对。例如,用户在某一平板电脑上使用了手写笔之后,如果想在另一平板电脑上使用该手写笔,则用户需要将手写笔放置在另一平板电脑的特定磁吸位置,使得手写笔与另一平板电脑配对。配对完成后,用户才可以使用手写笔在另一平板电脑上执行点击、书写等操作。In some cases, a user may own multiple electronic devices, eg, a user may own multiple tablet computers. When the user needs to use the same accessory device on different electronic devices, the user needs to actively perform a pairing operation every time the user switches the use object of the accessory device, so that the accessory device and the electronic device are re-paired. For example, after a user uses a stylus on a tablet, if he wants to use the stylus on another tablet, the user needs to place the stylus in a specific magnetic location on the other tablet, so that the stylus is connected to the other tablet. Pair with another tablet. After the pairing is complete, the user can use the stylus to perform operations such as clicking, writing, etc. on the other tablet.
因此,在当前的设备配对方案中,配件设备与电子设备的配对过程复杂,切换配件设备的使用对象时,流畅性低,极度影响用户的使用体验。Therefore, in the current device pairing scheme, the pairing process of the accessory device and the electronic device is complicated, and when switching the use object of the accessory device, the fluency is low, which greatly affects the user experience.
有鉴于此,本申请实施例提供的一种设备配对方法、电子设备及计算机可读存储介质,可以简化配件设备与电子设备的配对切换过程,使得配件设备可以流畅得切换 不同的使用对象,解决了当前的设备配对方案中,配件设备与电子设备的配对过程复杂,配件设备切换使用对象的过程流畅性低,影响用户的使用体验的问题,具有较强的易用性和实用性。In view of this, a device pairing method, an electronic device, and a computer-readable storage medium provided by the embodiments of the present application can simplify the pairing switching process between an accessory device and an electronic device, so that the accessory device can smoothly switch between different objects of use, solving the problem of In the current device pairing scheme, the pairing process of the accessory device and the electronic device is complicated, and the process of switching the use object of the accessory device is low in fluency, which affects the user's use experience, and has strong ease of use and practicability.
首先,以图1所示的设备配对系统为例,该设备配对系统是本申请实施例提供的设备配对方法适用的一种系统。First, taking the device pairing system shown in FIG. 1 as an example, the device pairing system is a system to which the device pairing method provided by the embodiment of the present application is applicable.
如图1所示,该设备配对系统包括至少一个配件设备101(图1中仅示出一个)和至少一个具有显示屏的电子设备102(图1中仅示出一个)。当所述配件设备101与所述电子设备102配对成功后,用户可以使用所述配件设备101在所述电子设备102的显示屏上进行点击、书写等操作。As shown in FIG. 1 , the device pairing system includes at least one accessory device 101 (only one is shown in FIG. 1 ) and at least one electronic device 102 (only one is shown in FIG. 1 ) having a display screen. After the accessory device 101 is successfully paired with the electronic device 102 , the user can use the accessory device 101 to perform operations such as clicking, writing, etc. on the display screen of the electronic device 102 .
其中,所述配件设备101可以为主动式手写笔,例如可以为主动式电容手写笔。可理解的,手写笔仅仅是本申请实施例中所使用的一个词语,其代表的含义是一种信息输入设备,其执行的功能在本实施例中已经记载,其名称并不能对本实施例构成任何限制。另外,在本申请其他一些实施例中,手写笔也可以被称为例如触控笔、主动式手写笔、信号笔或其他名词。The accessory device 101 may be an active stylus, for example, an active capacitive stylus. It is understandable that the stylus is only a word used in the embodiment of this application, and the meaning it represents is an information input device, and the functions performed by it have been recorded in this embodiment, and its name does not constitute a structure for this embodiment. any restrictions. In addition, in some other embodiments of the present application, the stylus may also be referred to as, for example, a stylus pen, an active stylus pen, a signal pen, or other nouns.
所述电子设备102可以为具有触敏表面(例如触控面板)的手机、平板电脑、个人数字助理(personal digital assistant,PDA)、可穿戴设备、膝上型计算机(laptop)、智慧屏、台式电脑、智能电视机、智慧屏、电子广告牌等电子设备。电子设备的示例性实施例包括但不限于搭载iOS、android、microsoft或者其他操作系统的电子设备。The electronic device 102 may be a cell phone, tablet, personal digital assistant (PDA), wearable device, laptop, smart screen, desktop with a touch-sensitive surface (eg, a touch panel) Computers, smart TVs, smart screens, electronic billboards and other electronic equipment. Exemplary embodiments of electronic devices include, but are not limited to, electronic devices powered by iOS, android, microsoft, or other operating systems.
本申请实施例对配件设备101和电子设备102的具体类型不作任何限制。The embodiments of the present application do not impose any restrictions on the specific types of the accessory device 101 and the electronic device 102 .
参考图2,图2为本申请实施例提供的配件设备101的结构示意图。Referring to FIG. 2 , FIG. 2 is a schematic structural diagram of an accessory device 101 provided by an embodiment of the present application.
图2所示的配件设备101可以为主动式电容手写笔。如图2所示,该主动式电容手写笔可以包括:处理器201、电源202、微控制单元(microcontroller unit,MCU)203、直流转直流电源转换器(direct current-direct current converter,DC/DC)204、信号发射电路205、信号检测电路206、压力传感器207以及无线通信模块208。The accessory device 101 shown in FIG. 2 may be an active capacitive stylus. As shown in FIG. 2, the active capacitive stylus may include: a processor 201, a power supply 202, a microcontroller unit (MCU) 203, a direct current-direct current converter (DC/DC) ) 204 , a signal transmission circuit 205 , a signal detection circuit 206 , a pressure sensor 207 and a wireless communication module 208 .
处理器201可以包括一个或多个处理单元,例如:处理器201可以包括应用处理器(application processor,AP),控制器,存储器等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 201 may include one or more processing units, for example, the processor 201 may include an application processor (application processor, AP), a controller, a memory, and the like. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
电源202可以是可充电锂电池或者可更换标准电池等。工作时,电源202通过DC/DC电源转换器204向MCU 203、信号发射电路205、信号检测电路206、压力传感器207以及无线通信模块208供电。The power source 202 may be a rechargeable lithium battery or a replaceable standard battery or the like. During operation, the power supply 202 supplies power to the MCU 203, the signal transmission circuit 205, the signal detection circuit 206, the pressure sensor 207 and the wireless communication module 208 through the DC/DC power converter 204.
信号检测电路206可设置于配件设备101的笔尖位置。信号检测电路206可以包括一个或多个电极。信号检测电路206可用于检测电子设备102的屏幕发射的信号,例如直接序列扩频(Direct Sequence Spread Spectrum,DSSS)信号。The signal detection circuit 206 can be disposed at the position of the pen tip of the accessory device 101 . Signal detection circuit 206 may include one or more electrodes. The signal detection circuit 206 may be used to detect a signal emitted by the screen of the electronic device 102, such as a Direct Sequence Spread Spectrum (DSSS) signal.
压力传感器207可设置于配件设备101的笔尖位置。压力传感器207可用于检测配件设备101的笔尖所承受的压力值,即压感信息。具体地,压力传感器207可以为压阻式压力传感器、陶瓷压力传感器、扩散硅压力传感器、蓝宝石压力传感器、压电式压力传感器等类型的压力传感器中的任意一种或多种的组合。The pressure sensor 207 can be disposed at the position of the pen tip of the accessory device 101 . The pressure sensor 207 can be used to detect the pressure value that the pen tip of the accessory device 101 bears, that is, pressure sensitive information. Specifically, the pressure sensor 207 may be any one or a combination of pressure sensors of a piezoresistive pressure sensor, a ceramic pressure sensor, a diffused silicon pressure sensor, a sapphire pressure sensor, a piezoelectric pressure sensor, and the like.
无线通信模块208可以提供应用在配件设备101上的近距离无线通信技术解决方案,例如可包括蓝牙(bluetooth,BT)、低功耗蓝牙(Bluetooth Low Energy,BLE)、 近场通信(near field communication,NFC)、无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,WiFi))、射频识别(radio frequency identification,RFID)或紫蜂(ZigBee)等无线通信的解决方案。无线通信模块208可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块208可以配合配件设备101的天线(图2未示出)一起使用,经由天线接收电磁波,对电磁波信号进行解调以及滤波处理,将处理后的信号发送到处理器201。无线通信模块208还可以从处理器201接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。The wireless communication module 208 can provide a near field communication technology solution applied on the accessory device 101, for example, it can include Bluetooth (Bluetooth, BT), Bluetooth Low Energy (BLE), near field communication (near field communication) , NFC), wireless local area networks (WLAN) (such as wireless fidelity (WiFi)), radio frequency identification (radio frequency identification, RFID) or ZigBee (ZigBee) and other wireless communication solutions. The wireless communication module 208 may be one or more devices integrating at least one communication processing module. The wireless communication module 208 can be used together with an antenna (not shown in FIG. 2 ) of the accessory device 101 to receive electromagnetic waves through the antenna, demodulate and filter the electromagnetic wave signals, and send the processed signals to the processor 201 . The wireless communication module 208 can also receive the signal to be sent from the processor 201, perform frequency modulation on it, amplify the signal, and convert it into electromagnetic waves for radiation through the antenna.
MCU 203在内部晶振所产生的时钟的控制下生成脉冲宽度调制(Pulse Width Modulation,PWM)信号,并驱动信号发射电路205将PWM信号发射出去。The MCU 203 generates a pulse width modulation (Pulse Width Modulation, PWM) signal under the control of the clock generated by the internal crystal oscillator, and drives the signal transmitting circuit 205 to transmit the PWM signal.
信号发射电路205可以包括一个或多个电极。信号发射电路205可设置于配件设备101的笔尖位置。信号发射电路205发射的PWM信号以高压方波信号的形式通过配件设备101的笔尖发射至电子设备102的屏幕。 Signal transmission circuit 205 may include one or more electrodes. The signal transmitting circuit 205 can be disposed at the position of the pen tip of the accessory device 101 . The PWM signal transmitted by the signal transmitting circuit 205 is transmitted to the screen of the electronic device 102 through the pen tip of the accessory device 101 in the form of a high-voltage square wave signal.
在一些实施例中,信号发射电路205可用于发射1路PWM信号,该PWM信号用于电子设备102确定配件设备101的报点信息。在另一些实施例中,信号发射电路205可用于发射2路PWM信号,其中1路信号用于电子设备102确定配件设备101的报点信息,2路信号联合用于电子设备102确定配件设备101的倾斜度。In some embodiments, the signal transmitting circuit 205 can be used to transmit a PWM signal, and the PWM signal is used for the electronic device 102 to determine the reporting point information of the accessory device 101 . In other embodiments, the signal transmitting circuit 205 can be used to transmit two PWM signals, wherein one signal is used by the electronic device 102 to determine the reporting point information of the accessory device 101 , and the two signals are combined for the electronic device 102 to determine the accessory device 101 of inclination.
可以理解的是,本申请实施例示意的结构并不构成对配件设备101的具体限定。在本申请另一些实施例中,配件设备101可以包括比图示更多或更少的部件,例如按键、LED指示灯,或者配件设备101还可以组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the accessory device 101 . In other embodiments of the present application, the accessory device 101 may include more or less components than shown, such as buttons, LED indicators, or the accessory device 101 may also combine some components, or separate some components, Or a different component arrangement. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
参考图3,图3示例性示出了本申请实施例提供的电子设备102的结构示意图。Referring to FIG. 3 , FIG. 3 exemplarily shows a schematic structural diagram of an electronic device 102 provided by an embodiment of the present application.
如图3所示,电子设备102可以包括:处理器310,外部存储器接口320,内部存储器321,通用串行总线(universal serial bus,USB)接口330,充电管理模块340,电源管理模块341,电池342,天线1,天线2,移动通信模块350,无线通信模块360,音频模块370,扬声器370A,受话器370B,麦克风370C,耳机接口370D,传感器模块380,按键390,马达391,指示器392,摄像头393,显示屏394,以及用户标识模块(subscriber identification module,SIM)卡接口395等。其中传感器模块380可以包括压力传感器380A,陀螺仪传感器380B,气压传感器380C,磁传感器380D,加速度传感器380E,距离传感器380F,接近光传感器380G,指纹传感器380H,温度传感器380J,触摸传感器380K,环境光传感器380L,骨传导传感器380M等。As shown in FIG. 3, the electronic device 102 may include: a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charge management module 340, a power management module 341, a battery 342, Antenna 1, Antenna 2, Mobile Communication Module 350, Wireless Communication Module 360, Audio Module 370, Speaker 370A, Receiver 370B, Microphone 370C, Headphone Interface 370D, Sensor Module 380, Key 390, Motor 391, Indicator 392, Camera 393, a display screen 394, and a subscriber identification module (subscriber identification module, SIM) card interface 395 and the like. The sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, an air pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, and ambient light. Sensor 380L, Bone Conduction Sensor 380M, etc.
处理器310可以包括一个或多个处理单元,例如:处理器310可以包括应用处理器(application processor,AP),触控芯片如触控面板集成电路(touch panel integrated circuit,TPIC),图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,数字信号处理器(digital signal processor,DSP)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (application processor, AP), a touch chip such as a touch panel integrated circuit (TPIC), a graphics processor (graphics processing unit, GPU), image signal processor (image signal processor, ISP), controller, memory, digital signal processor (digital signal processor, DSP), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
其中,控制器可以是电子设备102的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 102 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器310中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器310中的存储器为高速缓冲存储器。该存储器可以保存处理器310刚用过或循环使 用的指令或数据。如果处理器310需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器310的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 310 for storing instructions and data. In some embodiments, the memory in processor 310 is cache memory. This memory may hold instructions or data that have just been used or cycled by processor 310. If the processor 310 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 310 is reduced, thereby increasing the efficiency of the system.
内部存储器321可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器310通过运行存储在内部存储器321的指令,从而执行电子设备102的各种功能应用以及数据处理。内部存储器321可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备102使用过程中所创建的数据(比如音频数据,电话本等)等。Internal memory 321 may be used to store computer executable program code, which includes instructions. The processor 310 executes various functional applications and data processing of the electronic device 102 by executing the instructions stored in the internal memory 321 . The internal memory 321 may include a storage program area and a storage data area. The storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like. The storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 102 and the like.
电子设备102的无线通信功能可以通过天线1,天线2,无线通信模块360,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 102 may be implemented by the antenna 1, the antenna 2, the wireless communication module 360, the modem processor, the baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。电子设备102中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。 Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 102 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
无线通信模块360可以提供应用在电子设备102上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),NFC,红外技术(infrared,IR)、RFID或ZigBee等无线通信的解决方案。无线通信模块360可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块360经由天线2接收电磁波,对电磁波信号进行解调以及滤波处理,将处理后的信号发送到处理器310。无线通信模块360还可以从处理器310接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 360 can provide applications on the electronic device 102 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), NFC, infrared technology (infrared, IR), RFID or ZigBee and other wireless communication solutions. The wireless communication module 360 may be one or more devices integrating at least one communication processing module. The wireless communication module 360 receives electromagnetic waves via the antenna 2 , demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310 . The wireless communication module 360 can also receive the signal to be sent from the processor 310 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
无线通信模块360还可以接收到配件设备101在书写过程中发送的无线通信信息(例如BLE消息),该无线通信信息携带有配件设备101检测到的压感信息。该无线通信信息被传递给AP,由AP根据该无线通信信息确定该配件设备101的压感信息。之后,AP可以将该配件设备101的压感信息传递给GPU,用于后续针对该配件设备101的图形渲染。The wireless communication module 360 may also receive wireless communication information (eg, a BLE message) sent by the accessory device 101 during the writing process, where the wireless communication information carries the pressure-sensing information detected by the accessory device 101 . The wireless communication information is transmitted to the AP, and the AP determines the pressure-sensing information of the accessory device 101 according to the wireless communication information. After that, the AP can transfer the pressure-sensing information of the accessory device 101 to the GPU for subsequent graphics rendering for the accessory device 101 .
电子设备102通过GPU,显示屏394,以及AP等实现显示功能。GPU为图像处理的微处理器,连接显示屏394和AP。GPU用于执行数学和几何计算,用于图形渲染。处理器310可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 102 realizes the display function through the GPU, the display screen 394, and the AP. The GPU is a microprocessor for image processing, and connects the display screen 394 and the AP. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 310 may include one or more GPUs that execute program instructions to generate or alter display information.
在本申请实施例中,GPU可以根据配件设备101的压力信息、报点信息以及倾斜度进行图形渲染,并将渲染后的结果传递给显示屏394,由显示屏394显示对应的书写内容。In this embodiment of the present application, the GPU may perform graphics rendering according to the pressure information, point reporting information, and inclination of the accessory device 101 , and transmit the rendered result to the display screen 394 , which displays the corresponding written content.
显示屏394用于显示图像,视频等。在本申请实施例中,显示屏394可用于显示配件设备101的书写内容。显示屏394包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED) 等。在一些实施例中,电子设备102可以包括1个或N个显示屏394,N为大于1的正整数。Display screen 394 is used to display images, videos, and the like. In this embodiment of the present application, the display screen 394 may be used to display the writing content of the accessory device 101 . Display screen 394 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light). emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 102 may include 1 or N display screens 394 , where N is a positive integer greater than 1.
压力传感器380A用于感受压力信号,可以将压力信号转换成信号。在一些实施例中,压力传感器380A可以设置于显示屏394。压力传感器380A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器380A,电极之间的电容改变。电子设备102根据电容的变化确定压力的强度。当有触摸操作作用于显示屏394,电子设备102根据压力传感器380A检测所述触摸操作强度。电子设备102也可以根据压力传感器380A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 380A is used to sense the pressure signal, and can convert the pressure signal into a signal. In some embodiments, the pressure sensor 380A may be provided on the display screen 394 . There are many types of pressure sensors 380A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, and the like. The capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to pressure sensor 380A, the capacitance between the electrodes changes. The electronic device 102 determines the intensity of the pressure from the change in capacitance. When a touch operation acts on the display screen 394, the electronic device 102 detects the intensity of the touch operation according to the pressure sensor 380A. The electronic device 102 can also calculate the touched position according to the detection signal of the pressure sensor 380A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
触摸传感器380K,也称“触控面板”。触摸传感器380K可以设置于显示屏394,由触摸传感器380K与显示屏394组成触摸屏,也称“触控屏”。触摸传感器380K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给AP,以确定触摸事件类型。可以通过显示屏394提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器380K也可以设置于电子设备102的表面,与显示屏394所处的位置不同。 Touch sensor 380K, also known as "touch panel". The touch sensor 380K may be disposed on the display screen 394, and the touch sensor 380K and the display screen 394 form a touch screen, also called a "touch screen". The touch sensor 380K is used to detect a touch operation on or near it. The touch sensor can communicate the detected touch operation to the AP to determine the touch event type. Visual output related to touch operations may be provided through display screen 394 . In other embodiments, the touch sensor 380K may also be disposed on the surface of the electronic device 102 at a different location than the display screen 394 .
在本申请实施例中,触摸传感器380K可用于向配件设备101发射信号(例如DSSS信号),该信号可用于配件设备101获知电子设备102的屏幕在附近,即获知用户有书写意图。In this embodiment of the present application, the touch sensor 380K can be used to transmit a signal (eg, a DSSS signal) to the accessory device 101, and the signal can be used by the accessory device 101 to know that the screen of the electronic device 102 is nearby, that is, to know that the user has a writing intention.
在本申请实施例中,触摸传感器380K还可以用于接收配件设备101发射的信号,处理器310可根据该信号确定报点信息和倾斜度。后续将详细描述触摸传感器380K的工作原理,在此暂不赘述。In this embodiment of the present application, the touch sensor 380K may also be used to receive a signal transmitted by the accessory device 101 , and the processor 310 may determine the reporting point information and the inclination according to the signal. The working principle of the touch sensor 380K will be described in detail later, which will not be repeated here.
在本申请实施例中,电子设备102的屏幕可以是指由保护玻璃(图中未示出)、触摸传感器380K、显示屏394、底板(图中未示出)以及一些外围电路组成的装置。其中,屏幕由上至下依次为保护玻璃、触摸传感器380K、显示屏394、底板。In this embodiment of the present application, the screen of the electronic device 102 may refer to a device composed of a protective glass (not shown in the figure), a touch sensor 380K, a display screen 394, a bottom plate (not shown in the figure) and some peripheral circuits. Among them, the screen is, from top to bottom, the protective glass, the touch sensor 380K, the display screen 394, and the bottom plate.
可以理解的是,本申请实施例示意的结构并不构成对电子设备102的具体限定。在本申请另一些实施例中,电子设备102可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 102 . In other embodiments of the present application, the electronic device 102 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
电子设备102的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备102的软件结构。The software system of the electronic device 102 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 102 as an example.
图4是本申请实施例的电子设备102的软件结构框图。FIG. 4 is a block diagram of the software structure of the electronic device 102 according to the embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图4所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 4, the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and so on.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图4所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 4, the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备102的通信功能,例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions of the electronic device 102, such as management of call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
如图5所示,配件设备101和电子设备102之间可以形成第一信息通道、第二信息通道以及第三信息通道。As shown in FIG. 5 , a first information channel, a second information channel and a third information channel may be formed between the accessory device 101 and the electronic device 102 .
第一信息通道(即上述无线连接):The first information channel (ie the above wireless connection):
配件设备101的无线通信模块208和电子设备102的无线通信模块360中至少具有一种相同类型的通信处理模块,无线通信模块208和无线通信模块360通过上述相同类型的通信处理模块建立第一信息通道。The wireless communication module 208 of the accessory device 101 and the wireless communication module 360 of the electronic device 102 have at least one communication processing module of the same type, and the wireless communication module 208 and the wireless communication module 360 establish the first information through the same type of communication processing module described above. aisle.
例如,假设无线通信模块208中包括BLE模块,无线通信模块360中也包括BLE模块,则无线通信模块208和无线通信模块360可以建立BLE连接通道。For example, assuming that the wireless communication module 208 includes a BLE module and the wireless communication module 360 also includes a BLE module, the wireless communication module 208 and the wireless communication module 360 can establish a BLE connection channel.
配件设备101和电子设备102可以通过第一信息通道交互无线通信信息。例如,配件设备101可以通过第一信息通道发送压感信息至电子设备102,使得电子设备102根据压感信息渲染笔迹效果;电子设备102可以通过第一信息通道发送配置信息至配件设备101。The accessory device 101 and the electronic device 102 may exchange wireless communication information through the first information channel. For example, the accessory device 101 can send pressure-sensitive information to the electronic device 102 through the first information channel, so that the electronic device 102 renders a handwriting effect according to the pressure-sensitive information; the electronic device 102 can send configuration information to the accessory device 101 through the first information channel.
第二信息通道(即上述第二通信连接):The second information channel (ie the above-mentioned second communication connection):
第二信息通道是配件设备101的信号发射电路205向电子设备102的屏幕发射信号(PWM信号)的通路。The second information channel is a channel through which the signal transmitting circuit 205 of the accessory device 101 transmits a signal (PWM signal) to the screen of the electronic device 102 .
第二信息通道可以包含第一子通道,该第一子通道由配件设备101的笔尖的信号发射电路205包含的1个电极,和,电子设备102的屏幕组成。该第一子通道用于配件设备101的笔尖电极使信号发射电路205的电极向电子设备102的屏幕发射信号(例如PWM信号),该信号用于电子设备102获知配件设备101的报点信息。下面详细解释原理。The second information channel may include a first sub-channel, and the first sub-channel is composed of one electrode included in the signal transmitting circuit 205 of the pen tip of the accessory device 101 and the screen of the electronic device 102 . The first sub-channel is used for the pen tip electrode of the accessory device 101 to cause the electrode of the signal transmitting circuit 205 to transmit a signal (eg, a PWM signal) to the screen of the electronic device 102 , and the signal is used for the electronic device 102 to obtain the report point information of the accessory device 101 . The principle is explained in detail below.
参考图6,电子设备102的屏幕中触摸传感器380K可以包括X轴电极层和Y轴电极层。其中,X轴电极层可以包括多个成矩阵式分布的发射(transmit,Tx)电极,Y轴电极层可以包括多个成矩阵式分布的接收(receive,Rx)电极。Tx电极和Rx电极形成纵横交错的网络,Tx电极和Rx电极的交叉点(即坐标点)形成互电容(即Tx电极与相邻Rx电极构成的电容)。Referring to FIG. 6 , the in-screen touch sensor 380K of the electronic device 102 may include an X-axis electrode layer and a Y-axis electrode layer. The X-axis electrode layer may include a plurality of transmit (transmit, Tx) electrodes distributed in a matrix, and the Y-axis electrode layer may include a plurality of receive (receive, Rx) electrodes distributed in a matrix. The Tx electrodes and the Rx electrodes form a crisscross network, and the intersections (ie coordinate points) of the Tx electrodes and the Rx electrodes form a mutual capacitance (ie the capacitance formed by the Tx electrodes and the adjacent Rx electrodes).
电子设备102检测触摸传感器380K上各个坐标点的互电容大小时,和触摸传感器380K相连的触控芯片可以在每根Tx电极依次发出激励信号,然后触控芯片扫描每根接收Rx电极接收到的信号,将测量到的电压值模数转换为数字信号并计算电容值。When the electronic device 102 detects the mutual capacitance of each coordinate point on the touch sensor 380K, the touch chip connected to the touch sensor 380K can send an excitation signal to each Tx electrode in turn, and then the touch chip scans each receiving Rx electrode to receive an excitation signal. signal, convert the measured voltage value to digital signal and calculate the capacitance value.
电子设备102检测手指的触摸操作,和,检测配件设备101的输入内容的原理不同。The electronic device 102 detects the touch operation of the finger, and the principle of detecting the input content of the accessory device 101 is different.
在手指触摸屏幕时,手指、触控传感器380K以及二者之间的绝缘物质(如屏幕的保护玻璃)可以形成一个耦合电容,引起电流的微弱变动,引起互电容改变。电子设备102通过扫描X轴电极矩阵和Y轴电极矩阵,检测触摸点电容量的变化,计算出手指所在位置。When a finger touches the screen, the finger, the touch sensor 380K and the insulating material between them (such as the protective glass of the screen) can form a coupling capacitance, causing a slight change in current and a change in mutual capacitance. The electronic device 102 detects the change of the capacitance of the touch point by scanning the X-axis electrode matrix and the Y-axis electrode matrix, and calculates the position of the finger.
当电子设备102进入配件设备检测模式后,即电子设备102在工作周期的信号检测时间段内,触摸传感器380K上的Tx电极转化为Rx电极,与原有的Rx电极轮流在X、Y轴向感测配件设备101(例如主动式电容笔)的发射信号。Tx电极(已转化 为Rx电极)和原有的Rx电极上接收到的信号可以经过触控芯片的放大电路进行放大。在X轴电极和Y轴电极上分别可以获取接收到的信号的幅度值(或X轴Y轴的电容值)组成的数值包络,通过计算即可获得信号接收点的坐标(x,y),即配件设备101的笔尖在屏幕上的位置点,也就是报点信息。一种计算方式如可以将数值包络代入先验的配件设备101包络模型进行计算。本领域的技术人员可以理解,其计算方式可以为本领域的常规方案,在此不再赘述。触控芯片将信号由时频变换到频域,如将信号进行快速傅里叶变换,即可获得配件设备101发送信号的频率。When the electronic device 102 enters the accessory device detection mode, that is, during the signal detection period of the working cycle of the electronic device 102, the Tx electrodes on the touch sensor 380K are converted into Rx electrodes, which alternate with the original Rx electrodes in the X and Y axes. The transmit signal of the accessory device 101 (eg, an active capacitive pen) is sensed. The signal received on the Tx electrode (which has been converted into Rx electrode) and the original Rx electrode can be amplified by the amplifying circuit of the touch chip. The numerical envelope composed of the amplitude value of the received signal (or the capacitance value of the X-axis and Y-axis) can be obtained on the X-axis electrode and the Y-axis electrode respectively, and the coordinates (x, y) of the signal receiving point can be obtained by calculation. , that is, the position point of the pen tip of the accessory device 101 on the screen, that is, reporting point information. For example, a calculation method can be performed by substituting the numerical envelope into the prior envelope model of the accessory device 101 . Those skilled in the art can understand that the calculation method can be a conventional solution in the field, and details are not repeated here. The touch chip transforms the signal from time-frequency to frequency domain, such as performing fast Fourier transform on the signal, to obtain the frequency of the signal sent by the accessory device 101 .
在一些实施例中,第二信息通道还可包含第二子通道,该第二子通道由配件设备101的笔尖的信号发射电路205包含的1个电极,和,电子设备102的屏幕组成。第二子通道中的电极和第一子通道中的电极不同。该第二子通道用于配件设备101的笔尖电极向电子设备102的屏幕发射信号(例如PWM信号)。该第二子通道传输的信号,和,第一子通道传输的信号,联合用于电子设备102获知配件设备101的倾斜度。In some embodiments, the second information channel may further include a second sub-channel, which consists of one electrode included in the signal transmitting circuit 205 of the pen tip of the accessory device 101 and the screen of the electronic device 102 . The electrodes in the second subchannel are different from the electrodes in the first subchannel. The second sub-channel is used for the pen tip electrode of the accessory device 101 to transmit a signal (eg, a PWM signal) to the screen of the electronic device 102 . The signal transmitted by the second sub-channel, and the signal transmitted by the first sub-channel, are combined for the electronic device 102 to know the inclination of the accessory device 101 .
在本申请以下实施例中,可以将第一子通道传输的信号称为第一信号(或者,第一信号也可称为报点信号),将第二子通道传输的信号称为第二信号。In the following embodiments of the present application, the signal transmitted by the first subchannel may be referred to as the first signal (or, the first signal may also be referred to as an alarm signal), and the signal transmitted by the second subchannel may be referred to as the second signal .
第三信息通道(即上述第一通信连接):The third information channel (ie the above-mentioned first communication connection):
第三信息通道是电子设备102的屏幕向配件设备101的信号检测电路206发射信号(例如DSSS信号)的通路。The third information channel is the channel through which the screen of the electronic device 102 transmits a signal (eg, a DSSS signal) to the signal detection circuit 206 of the accessory device 101 .
第三信息通道由电子设备102的屏幕和配件设备101的信号检测电路206的一个或多个接收电极组成。The third information channel consists of the screen of the electronic device 102 and one or more receive electrodes of the signal detection circuit 206 of the accessory device 101 .
具体地,由电子设备102的屏幕中的触摸传感器380K的一个或多个Tx电极和/或由Rx电极转换而来的Tx电极发送信号,如通过DSSS调制的信号,该信号由配件设备101的笔尖的一个或多个接收电极接收。该信号可称为上行信号,上行信号用于配件设备101获知电子设备102的设备编号。其中,设备编号的形式可以根据实际需求进行设置。例如,设备编号可以是一个2bit或3bit的二进制编号。当设备编号为二进制编号时,可选的编号可以包括00、01、10、11这4个编号。电子设备102的设备编号可以为电子设备102首次连接配件设备101时,从各个可选的编号中任意选择的编号;或者,电子设备102的设备编号可以是电子设备102的内部软件系统中预先设置的一个编号;或者,电子设备102的设备编号可以是用户在电子设备102的用户界面中指定的编号。电子设备102可以通过软件升级或用户设置等方式更改电子设备102的设备编号。在电子设备102更改编号前,电子设备102与各个配件设备101连接时,均使用同一设备编号。从上述内容可知,配件设备101在电子设备102上书写时,电子设备102向配件设备101发送的上行信号(例如DSSS信号)、配件设备101向电子设备102发送的信号(例如第一信号、第二信号)均是在电子设备102的屏幕和配件设备101的笔尖之间传输的信号,需要电子设备102的屏幕或配件设备101的笔尖来检测或者发送。Specifically, a signal, such as a signal modulated by DSSS, is sent by one or more Tx electrodes of the touch sensor 380K in the screen of the electronic device 102 and/or Tx electrodes converted from the Rx electrodes, and the signal is sent by the accessory device 101 One or more receiving electrodes of the pen tip receive. This signal may be referred to as an uplink signal, and the uplink signal is used for the accessory device 101 to obtain the device number of the electronic device 102 . Among them, the form of the device number can be set according to actual needs. For example, the device number can be a 2-bit or 3-bit binary number. When the device number is a binary number, the optional numbers can include four numbers: 00, 01, 10, and 11. The device number of the electronic device 102 may be a number arbitrarily selected from each optional number when the electronic device 102 is connected to the accessory device 101 for the first time; or, the device number of the electronic device 102 may be preset in the internal software system of the electronic device 102 Alternatively, the device number of the electronic device 102 may be a number designated by the user in the user interface of the electronic device 102 . The electronic device 102 can change the device number of the electronic device 102 through software upgrade or user setting. Before the number of the electronic device 102 is changed, the same device number is used when the electronic device 102 is connected to each accessory device 101 . It can be seen from the above that when the accessory device 101 writes on the electronic device 102, the uplink signal (eg DSSS signal) sent by the electronic device 102 to the accessory device 101, the signal sent by the accessory device 101 to the electronic device 102 (eg the first signal, the The two signals) are signals transmitted between the screen of the electronic device 102 and the pen tip of the accessory device 101 , and need to be detected or sent by the screen of the electronic device 102 or the pen tip of the accessory device 101 .
下面介绍配件设备101的笔尖以及电子设备102的屏幕检测、发送信号的机制。The following describes the mechanism of the pen tip of the accessory device 101 and the screen detection and signal transmission mechanism of the electronic device 102 .
在一些实施例中,配件设备101可以持续性发射信号(例如PWM信号),还可以持续性地检测电子设备102发射的信号(例如DSSS信号)。In some embodiments, accessory device 101 may continuously transmit signals (eg, PWM signals), and may also continuously detect signals (eg, DSSS signals) transmitted by electronic device 102 .
在另一些实施例中,配件设备101可以周期性检测和发射信号,并且可以在时序 上分开进行发射和检测。即,配件设备101在同一周期的不同时间段分别进行信号发射和信号检测。这样可以避免信号间的干扰,节省配件设备101的电能。In other embodiments, accessory device 101 may detect and transmit signals periodically, and transmit and detect may be separated in timing. That is, the accessory device 101 performs signal transmission and signal detection respectively in different time periods of the same cycle. In this way, interference between signals can be avoided, and the power of the accessory device 101 can be saved.
在一些实施例中,电子设备102可以持续性地发射信号(例如DSSS信号),还可以持续性地检测配件设备101发射的信号(例如PWM信号)。In some embodiments, the electronic device 102 may continuously transmit a signal (eg, a DSSS signal), and may also continuously detect a signal (eg, a PWM signal) transmitted by the accessory device 101 .
在另一些实施例中,电子设备102可以周期性检测和发射信号,并且可以在时序上分开进行发射和检测。这样可以避免信号间的干扰,节省电子设备102的电能。配件设备101在一个周期内发射2路信号(即第一信号和第二信号)时,这2路信号在时序上可以有重合的部分,也可以在时序上不重合,本申请实施例对此不作限制。In other embodiments, the electronic device 102 may detect and transmit signals periodically, and may separate transmission and detection in timing. In this way, interference between signals can be avoided and the power of the electronic device 102 can be saved. When the accessory device 101 transmits two signals (ie, the first signal and the second signal) in one cycle, the two signals may have overlapping parts in timing, or may not overlap in timing. No restrictions apply.
以下,将根据图1至图6所示的设备配对系统并结合具体的应用场景,对本申请实施例提供的设备配对方法进行详细说明。Hereinafter, the device pairing method provided by the embodiments of the present application will be described in detail according to the device pairing systems shown in FIG. 1 to FIG. 6 and in combination with specific application scenarios.
1、配件设备101与电子设备102的首次配对。1. The first pairing of the accessory device 101 and the electronic device 102 .
配件设备101与电子设备102的配对是指配件设备101与电子设备102互相将对方设置为默认的数据传输对象。例如,假设配件设备101为手写笔,电子设备102包括平板电脑1和平板电脑2,手写笔与平板电脑1和平板电脑2均建立了第一信息通道,手写笔与平板电脑1配对,则后续手写笔检测到压感信息时,手写笔会将压感信息默认传输至平板电脑1,而不会将压感信息默认传输至平板电脑2。The pairing of the accessory device 101 and the electronic device 102 means that the accessory device 101 and the electronic device 102 mutually set each other as the default data transmission object. For example, assuming that the accessory device 101 is a stylus, the electronic device 102 includes a tablet computer 1 and a tablet computer 2, the stylus pen and the tablet computer 1 and the tablet computer 2 have established a first information channel, and the stylus pen is paired with the tablet computer 1, then the subsequent When the stylus detects the pressure-sensitive information, the stylus will transmit the pressure-sensitive information to the tablet computer 1 by default, and will not transmit the pressure-sensitive information to the tablet computer 2 by default.
在配件设备101和电子设备102均开启了无线通信功能的情况下,配件设备101和电子设备102可以相互发现,并通过无线通信模块208和无线通信模块360建立第一信息通道。之后,配件设备101和电子设备102可以通过上述第一信息通道进行数据交互。When both the accessory device 101 and the electronic device 102 have the wireless communication function enabled, the accessory device 101 and the electronic device 102 can discover each other and establish a first information channel through the wireless communication module 208 and the wireless communication module 360 . After that, the accessory device 101 and the electronic device 102 can perform data interaction through the above-mentioned first information channel.
例如,可以参阅图7,假设配件设备101为手写笔,电子设备102为平板电脑,无线通信模块208和无线通信模块360均包括蓝牙模块。手写笔的处理器201中可以设置有手写笔驱动705,手写笔驱动705可以与手写笔的蓝牙模块706进行数据交互;平板电脑的处理器310中可以包括应用程序702、手写笔服务701以及输入系统703,平板电脑的蓝牙模块中可以包括蓝牙协议栈704;在手写笔的蓝牙模块706与平板电脑的蓝牙模块建立了蓝牙连接通道之后,手写笔驱动705可以通过手写笔的蓝牙模块706发送数据至平板电脑的蓝牙协议栈704,蓝牙协议栈704将数据传输至手写笔服务701,手写笔服务701将蓝牙协议栈704传输的数据以及应用程序702传输的数据传递至输入系统703中进行处理;或者,手写笔服务701也可以通过蓝牙协议栈704发送数据至手写笔的蓝牙模块706,手写笔的蓝牙模块706将蓝牙协议栈704传输的数据传递至手写笔驱动705进行处理。For example, referring to FIG. 7 , it is assumed that the accessory device 101 is a stylus, the electronic device 102 is a tablet computer, and both the wireless communication module 208 and the wireless communication module 360 include a Bluetooth module. The processor 201 of the stylus can be provided with a stylus driver 705, and the stylus driver 705 can perform data interaction with the Bluetooth module 706 of the stylus; the processor 310 of the tablet computer can include an application program 702, a stylus service 701 and an input In the system 703, the Bluetooth module of the tablet computer may include a Bluetooth protocol stack 704; after the Bluetooth module 706 of the stylus and the Bluetooth module of the tablet computer establish a Bluetooth connection channel, the stylus driver 705 can send data through the Bluetooth module 706 of the stylus To the Bluetooth protocol stack 704 of the tablet computer, the Bluetooth protocol stack 704 transmits the data to the stylus service 701, and the stylus service 701 transmits the data transmitted by the Bluetooth protocol stack 704 and the data transmitted by the application 702 to the input system 703 for processing; Alternatively, the stylus service 701 can also send data to the stylus Bluetooth module 706 through the Bluetooth protocol stack 704, and the stylus Bluetooth module 706 transmits the data transmitted by the Bluetooth protocol stack 704 to the stylus driver 705 for processing.
配件设备101和电子设备102首次建立第一信息通道的过程可以是配件设备101和电子设备102首次配对的过程,或者,配件设备101和电子设备102首次建立第一信息通道的过程也可以不是配件设备101和电子设备102首次配对的过程。The process of establishing the first information channel between the accessory device 101 and the electronic device 102 for the first time may be the process of pairing the accessory device 101 and the electronic device 102 for the first time, or the process of establishing the first information channel between the accessory device 101 and the electronic device 102 for the first time may not be an accessory. The process of pairing the device 101 and the electronic device 102 for the first time.
例如,假设配件设备A和电子设备B未曾建立过第一信息通道,也未曾配对。For example, it is assumed that the accessory device A and the electronic device B have never established a first information channel and have never been paired.
此时,如果配件设备A和电子设备B均开启了无线通信功能,则配件设备A和电子设备B可以首次建立第一信息通道,但是配件设备A和电子设备B并未将对方设置为默认的信息传输对象,配件设备A和电子设备B并未配对。在这种情况下,配件设备A和电子设备B首次建立第一信息通道的过程不是配件设备A和电子设备B首次 配对的过程。At this time, if both the accessory device A and the electronic device B have enabled the wireless communication function, the accessory device A and the electronic device B can establish the first information channel for the first time, but the accessory device A and the electronic device B do not set each other as the default The information transmission object, accessory device A and electronic device B are not paired. In this case, the process of establishing the first information channel between the accessory device A and the electronic device B for the first time is not the process of pairing the accessory device A and the electronic device B for the first time.
或者,配件设备A和电子设备B可以响应于用户的操作,首次执行配对操作。在执行配对操作时,配件设备A和电子设备需要开启无线通信功能以建立第一信息通道,并将对方设置为默认的信息传输对象。在这种情况下,配件设备A和电子设备B的首次配对过程为配件设备A与电子设备B的首次建立第一信息通道的过程。Alternatively, the accessory device A and the electronic device B may perform the pairing operation for the first time in response to the user's operation. When performing the pairing operation, the accessory device A and the electronic device need to enable the wireless communication function to establish the first information channel, and set the other party as the default information transmission object. In this case, the first pairing process of the accessory device A and the electronic device B is the process of establishing the first information channel between the accessory device A and the electronic device B for the first time.
在配件设备101和电子设备102首次配对时,配件设备101可以根据预设的配对方式与电子设备102进行配对。When the accessory device 101 and the electronic device 102 are paired for the first time, the accessory device 101 may be paired with the electronic device 102 according to a preset pairing manner.
在一些可能的实现方式中,配件设备101和电子设备102可以通过磁吸配对的方式进行配对。In some possible implementations, the accessory device 101 and the electronic device 102 may be paired by magnetic pairing.
如图8所示,配件设备101和电子设备102可以在特定区域设置磁吸结构(例如霍尔器件),当配件设备101的磁吸结构靠近电子设备102的磁吸结构时,配件设备101的磁吸结构会吸附至电子设备102的磁吸结构。As shown in FIG. 8 , the accessory device 101 and the electronic device 102 may be provided with a magnetic attraction structure (for example, a Hall device) in a specific area. When the magnetic attraction structure of the accessory device 101 is close to the magnetic attraction structure of the electronic device 102 , the The magnetic attraction structure is attracted to the magnetic attraction structure of the electronic device 102 .
当配件设备101的磁吸结构与电子设备102的磁吸结构吸附连接时,触发配件设备101和电子设备102的配对操作。When the magnetic attraction structure of the accessory device 101 is adsorbed and connected to the magnetic attraction structure of the electronic device 102 , the pairing operation of the accessory device 101 and the electronic device 102 is triggered.
在触发配对操作时,电子设备102可以在显示界面显示提示框。例如,如图8所示,电子设备102可以在显示界面上显示提示框,提示用户是否与配件设备101(即“我的手写笔”)连接,并提供“连接”和“取消”两个选项。When the pairing operation is triggered, the electronic device 102 may display a prompt box on the display interface. For example, as shown in FIG. 8 , the electronic device 102 may display a prompt box on the display interface to prompt the user whether to connect with the accessory device 101 (ie, “My Stylus Pen”), and provide two options of “Connect” and “Cancel” .
然后,如图9所示,电子设备102可以响应于用户对“连接”选项的点击操作,通过第一信息通道发送第一连接请求至配件设备101。Then, as shown in FIG. 9 , the electronic device 102 may send a first connection request to the accessory device 101 through the first information channel in response to the user's clicking operation on the “connection” option.
配件设备101接收到第一连接请求后,返回第一确认信息至电子设备102,完成连接操作,与电子设备102建立第一信息通道。之后,电子设备102和配件设备101可以通过第一信息通道进行数据交互。After receiving the first connection request, the accessory device 101 returns the first confirmation information to the electronic device 102 , completes the connection operation, and establishes a first information channel with the electronic device 102 . After that, the electronic device 102 and the accessory device 101 can perform data interaction through the first information channel.
其中,第一连接请求中可以包括电子设备102的设备编号;或者,电子设备102也可以在建立第一信息通道后,将电子设备102的设备编号发送至配件设备101。配件设备接收到电子设备102的设备编号后,保存电子设备102的设备编号和无线通信地址,完成配件设备101和电子设备102的首次配对。The first connection request may include the device number of the electronic device 102 ; alternatively, the electronic device 102 may also send the device number of the electronic device 102 to the accessory device 101 after establishing the first information channel. After receiving the device number of the electronic device 102 , the accessory device saves the device number and wireless communication address of the electronic device 102 , and completes the first pairing of the accessory device 101 and the electronic device 102 .
在另一些可能的实现方式中,配件设备101和电子设备102可以通过连接配对的方式进行配对。In some other possible implementation manners, the accessory device 101 and the electronic device 102 may be paired by connection and pairing.
例如,可以参阅图10和图11,配件设备101的一端可以设置有笔帽,笔帽和配件设备101的主体为可拆卸连接结构。当配件设备101的笔帽被拆卸时,可以查看到配件设备101上设置的连接头。电子设备102可以设置有一接口。当配件设备101的连接头与电子设备102的接口接触连接时,触发配件设备101和电子设备102的配对操作。For example, referring to FIG. 10 and FIG. 11 , one end of the accessory device 101 may be provided with a pen cap, and the pen cap and the main body of the accessory device 101 are detachable connection structures. When the cap of the accessory device 101 is disassembled, the connecting head provided on the accessory device 101 can be viewed. The electronic device 102 may be provided with an interface. When the connector of the accessory device 101 is in contact with the interface of the electronic device 102, the pairing operation of the accessory device 101 and the electronic device 102 is triggered.
在触发配对操作时,电子设备102可以在显示界面显示提示框。例如,如图11所示,电子设备102可以在显示界面上显示提示框,提示用户是否与配件设备101(即“我的手写笔”)连接,提供“连接”和“取消”两个选项。When the pairing operation is triggered, the electronic device 102 may display a prompt box on the display interface. For example, as shown in FIG. 11 , the electronic device 102 may display a prompt box on the display interface to prompt the user whether to connect with the accessory device 101 (ie, “My Stylus Pen”), and provide two options of “connect” and “cancel”.
然后,如图9所示,电子设备102可以响应于用户对“连接”选项的点击操作,通过第一信息通道发送第一连接请求至配件设备101。Then, as shown in FIG. 9 , the electronic device 102 may send a first connection request to the accessory device 101 through the first information channel in response to the user's clicking operation on the “connection” option.
配件设备101接收到第一连接请求后,返回第一确认信息至电子设备102,完成 连接操作,与电子设备102建立第一信息通道。之后,电子设备102和配件设备101可以通过第一信息通道进行数据交互。After receiving the first connection request, the accessory device 101 returns the first confirmation information to the electronic device 102, completes the connection operation, and establishes a first information channel with the electronic device 102. After that, the electronic device 102 and the accessory device 101 can perform data interaction through the first information channel.
其中,第一连接请求中可以包括电子设备102的设备编号;或者,电子设备102也可以在建立第一信息通道后,将电子设备102的设备编号发送至配件设备101。配件设备接收到电子设备102的设备编号后,保存电子设备102的设备编号和无线通信地址,完成配件设备101和电子设备102的首次配对。The first connection request may include the device number of the electronic device 102 ; alternatively, the electronic device 102 may also send the device number of the electronic device 102 to the accessory device 101 after establishing the first information channel. After receiving the device number of the electronic device 102 , the accessory device saves the device number and wireless communication address of the electronic device 102 , and completes the first pairing of the accessory device 101 and the electronic device 102 .
上述连接头的类型可以根据实际需求进行设置。例如,上述连接头可以为Micro-B连接头、通用串行总线(Universal Serial Bus,USB)Type-C连接头、闪电(Lightning)连接头等连接头中的任意一种。The types of the above connectors can be set according to actual needs. For example, the above connector may be any one of a Micro-B connector, a Universal Serial Bus (Universal Serial Bus, USB) Type-C connector, a Lightning connector and the like.
相应的,上述接口为与连接头匹配的接口。例如,上述接口可以为Micro-B接口、USB Type-C接口、Lightning接口等接口中的任意一种。Correspondingly, the above-mentioned interface is an interface matched with the connector. For example, the above-mentioned interface can be any one of Micro-B interface, USB Type-C interface, Lightning interface and other interfaces.
此外,每个电子设备102可以设置有相应的设备编号。电子设备102的设备编号可以为出厂时预先设置的,或者,电子设备102的设备编号也可以为用户自定义的。In addition, each electronic device 102 may be provided with a corresponding device number. The device number of the electronic device 102 may be preset at the factory, or the device number of the electronic device 102 may also be user-defined.
各个电子设备102的设备编号可以相同,或者,各个电子设备102的设备编号也可以不相同。The device numbers of the electronic devices 102 may be the same, or the device numbers of the electronic devices 102 may also be different.
可以理解的是,虽然在以上的示例中,电子设备102在配件设备101与电子设备102首次配对的过程中将电子设备102的设备编号传递至配件设备101。但是,在实际的应用过程中,电子设备102也可以不在首次配对的过程中传递设备编号。It can be understood that although in the above example, the electronic device 102 transmits the device number of the electronic device 102 to the accessory device 101 during the first pairing process of the accessory device 101 and the electronic device 102 . However, in an actual application process, the electronic device 102 may not transmit the device number during the first pairing process.
例如,电子设备102可以在配件设备101与电子设备102首次建立第一信息通道之后,通过第一信息通道将电子设备102的设备编号传递至配件设备101。For example, after the accessory device 101 and the electronic device 102 establish the first information channel for the first time, the electronic device 102 may transmit the device number of the electronic device 102 to the accessory device 101 through the first information channel.
也即是说,配件设备101和电子设备102可以未曾配对过,但是配件设备101和电子设备102应当至少一次建立过第一信息通道,以便电子设备102通过第一信息通道将其设备编号传递至配件设备101。That is to say, the accessory device 101 and the electronic device 102 may have never been paired, but the accessory device 101 and the electronic device 102 should have established the first information channel at least once, so that the electronic device 102 can pass its device number to the device through the first information channel. Accessory device 101 .
本申请实施例对电子设备102将其设备编号传递至配件设备101的时机不作任何限制。This embodiment of the present application does not impose any restrictions on the timing when the electronic device 102 transmits its device number to the accessory device 101 .
为了便于理解,以下将结合具体的应用场景对上述配件设备101与电子设备102的首次配对的过程进行描述。For ease of understanding, the above-mentioned process of first pairing the accessory device 101 with the electronic device 102 will be described below with reference to specific application scenarios.
应用场景一:Application Scenario 1:
在本实施例中,假设配件设备101为手写笔,电子设备102为平板电脑,手写笔和平板电脑上均设置有磁吸结构,手写笔和平板电脑均设置有BLE模块。In this embodiment, it is assumed that the accessory device 101 is a stylus and the electronic device 102 is a tablet computer. The stylus and the tablet are both provided with a magnetic attraction structure, and both the stylus and the tablet are provided with a BLE module.
当配件设备101和电子设备102设置有BLE模块时,上述第一信息通道为BLE连接通道。BLE连接通道包括通用属性协议(Generic Attribute Profile,GATT)连接通道以及基于通用属性的人机接口设备交互协议(HID Over Gatt Profile,HoGP)连接通道。When the accessory device 101 and the electronic device 102 are provided with a BLE module, the above-mentioned first information channel is a BLE connection channel. The BLE connection channel includes a Generic Attribute Profile (GATT) connection channel and a generic attribute-based Human Interface Device Interaction Protocol (HID Over Gatt Profile, HoGP) connection channel.
此时,配件设备101与多个电子设备102连接是指配件设备101与多个电子设备102建立了GATT连接通道。配件设备101和某一个电子设备102的配对是指配件设备101与该电子设备102建立了HoGP连接通道。At this time, the fact that the accessory device 101 is connected to multiple electronic devices 102 means that the accessory device 101 establishes a GATT connection channel with the multiple electronic devices 102 . The pairing of the accessory device 101 and a certain electronic device 102 means that the accessory device 101 establishes a HoGP connection channel with the electronic device 102 .
平板电脑中预先设置有多个初始设备编号,平板电脑从初始设备编号中选择一初始设备编号作为该平板电脑的设备编号。A plurality of initial device numbers are preset in the tablet computer, and the tablet computer selects an initial device number from the initial device numbers as the device number of the tablet computer.
当手写笔和平板电脑均开启了蓝牙BLE功能时,手写笔和平板电脑可以相互发现,并建立GATT连接通道。When both the stylus and the tablet have the Bluetooth BLE function turned on, the stylus and the tablet can discover each other and establish a GATT connection channel.
如图12所示,手写笔和平板电脑在建立GATT连接通道时,可以基于GATT进行交互直至建立GATT连接通道。As shown in Figure 12, when a stylus and a tablet computer establish a GATT connection channel, they can interact based on GATT until the GATT connection channel is established.
例如,手写笔可以通过到BLE模块发送广播物理信道(advertising physical channel)PDU至平板电脑的BLE模块。PDU为协议数据单元。广播物理信道PDU的类型可以为ADV_IND PDU、AVD_EXT_IND PDU、AUX_ADV_IND PDU、AUX_SYNC_IND等PDU消息。For example, a stylus can send an advertising physical channel PDU to a tablet's BLE module by sending it to the BLE module. PDUs are protocol data units. The type of broadcast physical channel PDU can be ADV_IND PDU, AVD_EXT_IND PDU, AUX_ADV_IND PDU, AUX_SYNC_IND and other PDU messages.
平板电脑接收到广播物理信道PDU之后,可以向手写笔发送扫描请求PDU(例如SCAN_REQ PDU)。After receiving the broadcast physical channel PDU, the tablet can send a scan request PDU (eg SCAN_REQ PDU) to the stylus.
手写笔接收到扫描请求PDU之后,返回扫描响应PDU(例如SCAN_RSP PDU)至平板电脑。After the stylus receives the scan request PDU, it returns the scan response PDU (eg SCAN_RSP PDU) to the tablet.
平板电脑发送连接请求(CONNECT_IND)至手写笔,从而建立GATT连接通道。The tablet sends a connection request (CONNECT_IND) to the stylus to establish a GATT connection channel.
之后,手写笔和平板电脑可以通过GATT连接通道传递数据物理信道PDU(Data Physical Channel PDU)进行数据交互。After that, the stylus and the tablet can communicate with each other by passing the Data Physical Channel PDU (Data Physical Channel PDU) through the GATT connection channel.
建立了GATT连接通道之后,手写笔可以基于GATT连接通道读取平板电脑的屏幕类型、设备参数等信息。平板电脑可以基于GATT连接通道将设备编号传递至手写笔。After the GATT connection channel is established, the stylus can read the screen type, device parameters and other information of the tablet computer based on the GATT connection channel. The tablet can pass the device number to the stylus based on the GATT connection channel.
如图8所示,当手写笔的磁吸结构和平板电脑的磁吸结构吸附连接时,触发手写笔和平板电脑的配对操作。As shown in FIG. 8 , when the magnetic attraction structure of the stylus is adsorbed and connected with the magnetic attraction structure of the tablet computer, the pairing operation of the stylus pen and the tablet computer is triggered.
此时,如果是手写笔和平板电脑的首次配对,则平板电脑的显示界面弹出系统提示框,询问用户是否与手写笔(即“我的手写笔”)连接。At this point, if the stylus and the tablet are paired for the first time, a system prompt box will pop up on the display interface of the tablet, asking the user whether to connect with the stylus (ie, "My Stylus").
然后,平板电脑可以响应于用户对“连接”选项的点击操作,控制BLE模块发送第一连接请求至手写笔,手写笔返回第一确认信息,平板电脑与手写笔建立GATT连接。随后,基于该GATT连接,平板电脑将设备编号发送至手写笔,手写笔从而获知并存储平板电脑的设备编号。Then, the tablet computer can control the BLE module to send a first connection request to the stylus in response to the user's click operation on the "connect" option, the stylus pen returns the first confirmation information, and the tablet computer and the stylus establish a GATT connection. Then, based on the GATT connection, the tablet sends the device number to the stylus, and the stylus learns and stores the device number of the tablet.
随后,手写笔和平板电脑建立HoGP连接通道,完成手写笔和平板电脑的首次配对。Then, the stylus and the tablet establish a HoGP connection channel to complete the first pairing of the stylus and the tablet.
手写笔和平板电脑建立了HoGP连接通道之后,可以基于HoGP传输在协议中规定的业务相关的内容。比如,手写笔可以基于HoGP中规定的手写笔传输信息的格式和流程,通过HoGP连接通道发送压感信息至平板电脑。After the stylus and the tablet computer establish the HoGP connection channel, the service-related content specified in the protocol can be transmitted based on the HoGP. For example, the stylus can send pressure-sensitive information to the tablet computer through the HoGP connection channel based on the format and process of stylus transmission information specified in HoGP.
2、配件设备101的使用与切换。2. Use and switching of accessory equipment 101 .
如图5所示,当配件设备101与电子设备102接触时,配件设备101的信号发射电路205可以与电子设备102的屏幕建立第二信息通道,配件设备101的信号检测电路206可以与电子设备102的屏幕建立第三信息通道。As shown in FIG. 5 , when the accessory device 101 is in contact with the electronic device 102, the signal transmitting circuit 205 of the accessory device 101 can establish a second information channel with the screen of the electronic device 102, and the signal detecting circuit 206 of the accessory device 101 can communicate with the electronic device 102. The screen of 102 establishes a third information channel.
并且,配件设备101上设置有压力传感器207,当配件设备101与电子设备102接触时,配件设备101的压力传感器207可以检测到压感信息(以下将配件设备101当前检测到的压感信息简称为第一压感信息)。In addition, the accessory device 101 is provided with a pressure sensor 207. When the accessory device 101 is in contact with the electronic device 102, the pressure sensor 207 of the accessory device 101 can detect pressure-sensing information (hereinafter referred to as the pressure-sensing information currently detected by the accessory device 101 for short). is the first pressure-sensitive information).
如图13所示,配件设备101可以通过第二信息通道发送报点信号至电子设备102 的触摸传感器380K,配件设备101发送报点信号的动作称为“报点”。As shown in FIG. 13 , the accessory device 101 can send an announcement signal to the touch sensor 380K of the electronic device 102 through the second information channel. The action of the accessory device 101 sending the announcement signal is called “announcement”.
配件设备101可以通过预设的报点信号生成方式生成报点信号。例如,配件设备101可以通过脉冲宽度调制(Pulse Width Modulation,PWM)技术生成报点信号。The accessory device 101 may generate an announcement signal through a preset announcement signal generation method. For example, the accessory device 101 may generate an alarm signal through a pulse width modulation (Pulse Width Modulation, PWM) technology.
电子设备102的触摸传感器380K接收到报点信号后,可以将报点信号传递至处理器310,由处理器310对报点信号进行频域转换,得到报点信号的频率,根据报点信号的频率确定报点信号的类型,并根据报点信号确定配件设备101的笔尖位置,进而在笔尖位置显示相应的笔迹效果或响应该笔尖位置对应的触控指令。After the touch sensor 380K of the electronic device 102 receives the report signal, it can transmit the report signal to the processor 310, and the processor 310 performs frequency domain conversion on the report signal to obtain the frequency of the report signal. The frequency determines the type of announcing signal, and determines the pen tip position of the accessory device 101 according to the announcing signal, and then displays a corresponding handwriting effect at the pen tip position or responds to a touch command corresponding to the pen tip position.
其中,如果配件设备101在检测到第一压感信息之前的第一预设时长内,未检测到其他压感信息(以下简称为第二压感信息),则配件设备101本次发送的报点信号确定为首点报点信号,配件设备101记录发送首点报点信号的第一时间。Wherein, if the accessory device 101 does not detect other pressure-sensing information (hereinafter referred to as the second pressure-sensing information) within the first preset time period before detecting the first pressure-sensing information, the report sent by the accessory device 101 this time The point signal is determined to be the first point announcement signal, and the accessory device 101 records the first time when the first point announcement signal is sent.
电子设备102在接收到报点信号时,如果在接收到当前的报点信号(以下简称为第一报点信号)之前的第二预设时长内,未接收到其他报点信号(以下简称为第二报点信号),则电子设备102将接收第一报点信号的行为确定为首次接收报点,电子设备102记录首次接收报点的第二时间。When the electronic device 102 receives an announcement signal, if within the second preset time period before receiving the current announcement signal (hereinafter referred to as the first announcement signal), other announcement signals (hereinafter referred to as the first announcement signal) are not received. The second report signal), the electronic device 102 determines that the behavior of receiving the first report signal is the first time the report is received, and the electronic device 102 records the second time when the report is received for the first time.
其中,上述第一预设时长和第二预设时长的具体取值可以根据实际需求进行设置。例如,根据研究表明,当用户在不同的电子设备102上使用配件设备101时,用户每次切换配件设备101的使用对象所耗费的切换时长通常会大于500ms,因此,可以将第一预设时长和第二预设时长设置为500ms。The specific values of the first preset duration and the second preset duration may be set according to actual requirements. For example, according to research, when the user uses the accessory device 101 on different electronic devices 102, the switching time spent by the user each time switching the object of use of the accessory device 101 is usually greater than 500 ms. Therefore, the first preset time duration can be and the second preset duration is set to 500ms.
并且,第一预设时长可以与第二预设时长一致,或者,第一预设时长也可以与第二预设时长不一致。例如,第一预设时长和第二预设时长可以均设置为500ms;或者,第一预设时长可以设置为500ms,第二预设时长设置为510ms。Moreover, the first preset duration may be consistent with the second preset duration, or, the first preset duration may also be inconsistent with the second preset duration. For example, both the first preset duration and the second preset duration may be set to 500ms; or, the first preset duration may be set to 500ms, and the second preset duration may be set to 510ms.
此外,电子设备102可以周期性地生成上行信号,并通过上述第三信息通道发送上行信号至配件设备101的信号检测电路206。In addition, the electronic device 102 may periodically generate an uplink signal, and send the uplink signal to the signal detection circuit 206 of the accessory device 101 through the above-mentioned third information channel.
上行信号用于传递电子设备102的设备编号,并且,配件设备101可以通过检测上行信号以确定配件101是否已经靠近电子设备102。电子设备102可以根据预设的上行信号生成方式生成上行信号。例如,电子设备102可以通过基于直接序列扩频(Direct Sequence Spread Spectrum,DSSS)技术生成上述上行信号。The uplink signal is used to transmit the device number of the electronic device 102 , and the accessory device 101 can determine whether the accessory 101 has approached the electronic device 102 by detecting the uplink signal. The electronic device 102 may generate an uplink signal according to a preset uplink signal generation manner. For example, the electronic device 102 may generate the above-mentioned uplink signal by using a direct sequence spread spectrum (Direct Sequence Spread Spectrum, DSSS) technology.
配件设备101的信号检测电路206接收到上行信号后,将上行信号传递至处理器201,由处理器201对上行信号进行频域转换,得到上行信号的频率,根据上行信号的频率确定上行信号的类型。并且,处理器201可以对上行信号进行解析,得到电子设备102的设备编号。After receiving the uplink signal, the signal detection circuit 206 of the accessory device 101 transmits the uplink signal to the processor 201, and the processor 201 performs frequency domain conversion on the uplink signal to obtain the frequency of the uplink signal, and determines the frequency of the uplink signal according to the frequency of the uplink signal. type. In addition, the processor 201 can analyze the uplink signal to obtain the device number of the electronic device 102 .
需要说明的是,上述第二信息通道和第三信息通道可以为两条不同的信息通道,此时,第二信息通道和第三信息通道由不同的电极组成。或者,上述第二信息通道和上述第三信息通道可以为同一条信息通道,此时,第二信息通道和第三信息通道由相同的电极组成。It should be noted that the above-mentioned second information channel and third information channel may be two different information channels, and in this case, the second information channel and the third information channel are composed of different electrodes. Alternatively, the second information channel and the third information channel may be the same information channel, and in this case, the second information channel and the third information channel are composed of the same electrodes.
当上述第二信息通道和上述第三信息通道为同一条信息通道时,配件设备101和电子设备102通过同一条信息通道传输报点信号和上行信号。When the second information channel and the third information channel are the same information channel, the accessory device 101 and the electronic device 102 transmit the point announcement signal and the uplink signal through the same information channel.
电子设备102在接收到报点信号后,需要根据报点信号确定配件设备101的笔尖位置,并在笔尖位置渲染笔迹效果。因此,配件设备101需要将压感信息传递至电子 设备102,以使得电子设备102根据压感信息渲染笔迹效果。After receiving the point report signal, the electronic device 102 needs to determine the position of the pen tip of the accessory device 101 according to the point report signal, and render the handwriting effect at the position of the pen point. Therefore, the accessory device 101 needs to transmit the pressure-sensitive information to the electronic device 102, so that the electronic device 102 renders the handwriting effect according to the pressure-sensitive information.
例如,如图14所示,假设配件设备101为手写笔1401,电子设备102为平板电脑1402,当手写笔1011被用户施以不同的力度在平板电脑1402上书写时,手写笔1401的压力传感器207可以检测到不同的压感信息,手写笔1011将压感信息传递至平板电脑1402,平板电脑1402根据压感信息渲染笔迹的粗细,压感信息越大,则笔迹越粗。For example, as shown in FIG. 14 , assuming that the accessory device 101 is a stylus 1401 and the electronic device 102 is a tablet computer 1402, when the stylus 1011 is written on the tablet 1402 by the user with different strengths, the pressure sensor of the stylus 1401 207 can detect different pressure-sensitive information, the stylus 1011 transmits the pressure-sensitive information to the tablet computer 1402, and the tablet computer 1402 renders the thickness of the handwriting according to the pressure-sensitive information. The greater the pressure-sensitive information, the thicker the handwriting.
当用户在多个电子设备102上使用配件设备101时,每次切换配件设备101的使用对象均需耗费一定的切换时长。When the user uses the accessory device 101 on a plurality of electronic devices 102 , it takes a certain period of time to switch each time the object of use of the accessory device 101 is switched.
例如,如图15和图16所示,初始时刻,手写笔1501与平板电脑1502和平板电脑1503建立了GATT连接通道,平板电脑1502和平板电脑1503向手写笔1501发送了各自的设备编号。用户在平板电脑1502上使用手写笔1501时,平板电脑1502与手写笔1501建立了HoGP连接通道。之后,用户想在平板电脑1503上使用手写笔1501,则用户可以将手写笔1501从平板电脑1502移动至平板电脑1503,则手写笔1501断开与平板电脑1502的HoGP连接通道,保持GATT连接通道(基础的数据连接通道),手写笔与平板电脑1503建立了HoGP连接通道。而用户将手写笔1501从平板电脑1502移动至平板电脑1503的过程需要耗费一定的时间,即切换时长。For example, as shown in FIG. 15 and FIG. 16 , at the initial moment, the stylus 1501 establishes a GATT connection channel with the tablet computer 1502 and the tablet computer 1503, and the tablet computer 1502 and the tablet computer 1503 send their respective device numbers to the stylus 1501. When the user uses the stylus 1501 on the tablet computer 1502, the tablet computer 1502 and the stylus 1501 establish a HoGP connection channel. After that, if the user wants to use the stylus 1501 on the tablet computer 1503, the user can move the stylus 1501 from the tablet computer 1502 to the tablet computer 1503, then the stylus 1501 disconnects the HoGP connection channel with the tablet computer 1502 and keeps the GATT connection channel (basic data connection channel), the stylus and the tablet computer 1503 establish a HoGP connection channel. The process of the user moving the stylus 1501 from the tablet computer 1502 to the tablet computer 1503 takes a certain amount of time, that is, the switching time.
因此,配件设备101可以根据上述第一预设时长确定是否需要重新确定默认设备。默认设备为当前与配件设备101配对的电子设备102。例如,当上述第一信息通道为BLE连接通道时,默认设备为与配件设备101建立了HoGP连接通道的电子设备102。Therefore, the accessory device 101 can determine whether the default device needs to be re-determined according to the above-mentioned first preset duration. The default device is the electronic device 102 currently paired with the accessory device 101 . For example, when the above-mentioned first information channel is a BLE connection channel, the default device is the electronic device 102 that has established a HoGP connection channel with the accessory device 101 .
如果配件设备101在检测到第一压感信息之前的第一预设时长内,曾经检测到第二压感信息,则表示配件设备101相邻两次检测到压感信息的时间间隔不足以让用户切换配件设备101的使用对象,配件设备101不切换默认设备,并通过第一信息通道将压感信号发送至默认设备。压感信号中包括第一压感信息,默认设备可以根据第一压感信息渲染笔迹效果。If the accessory device 101 has detected the second pressure-sensing information within the first preset period of time before detecting the first pressure-sensing information, it means that the time interval between the accessory device 101 detecting the pressure-sensing information twice is not long enough for the accessory device 101 to detect the pressure-sensing information twice. When the user switches the use object of the accessory device 101, the accessory device 101 does not switch the default device, and sends the pressure-sensitive signal to the default device through the first information channel. The pressure-sensitive signal includes first pressure-sensitive information, and the default device can render a handwriting effect according to the first pressure-sensitive information.
如果配件设备101在检测到第一压感信息之前的第一预设时长内,未曾检测到第二压感信息,则表示目标设备可能并非是默认设备。目标设备为配件设备101当前实际接触的电子设备102。If the accessory device 101 has not detected the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, it means that the target device may not be the default device. The target device is the electronic device 102 that the accessory device 101 actually contacts.
此时,配件设备101需要根据目标设备编号识别目标设备,与目标设备配对,将目标设备设置为新的默认设备。目标设备编号为目标设备的设备编号,目标设备编号可以由配件设备101对上述上行信号解析得到。At this time, the accessory device 101 needs to identify the target device according to the target device number, pair with the target device, and set the target device as a new default device. The target device number is the device number of the target device, and the target device number can be obtained by parsing the above-mentioned uplink signal by the accessory device 101 .
配件设备101在解析目标设备编号时,存在以下几种情况:When the accessory device 101 parses the target device number, the following situations exist:
2.1、目标设备编号为默认设备的设备编号,并且验证设备中,只有默认设备与目标设备编号匹配。2.1. The target device number is the device number of the default device, and among the verification devices, only the default device matches the target device number.
验证设备为当前与配件设备101建立了第一信息通道的电子设备102。The verification device is the electronic device 102 that currently establishes the first information channel with the accessory device 101 .
由于各个电子设备102的设备编号可能为相同的设备编号,因此,当目标设备编号为默认设备的设备编号时,目标设备可能是默认设备,或者,目标设备也可能不是默认设备。Since the device numbers of each electronic device 102 may be the same device number, when the target device number is the device number of the default device, the target device may be the default device, or the target device may not be the default device.
此时,配件设备101可以获取各个验证设备的设备编号(即上述第一设备编号),判断是否存在多个验证设备的设备编号与目标设备编号匹配。其中,验证设备包括默认设备。At this time, the accessory device 101 may acquire the device numbers of each verification device (ie, the first device number), and determine whether there are multiple verification devices whose device numbers match the target device numbers. Wherein, the verification device includes a default device.
如果验证设备中,只有默认设备的设备编号与目标设备编号匹配,则表示目标设备为默认设备。此时,配件设备101不切换默认设备,发送压感信号至默认设备。If only the device number of the default device matches the target device number among the verification devices, it means that the target device is the default device. At this time, the accessory device 101 does not switch the default device, and sends a pressure-sensitive signal to the default device.
压感信号中包括上述第一压感信息。默认设备在接收到第一压感信息后,可以根据第一压感信息渲染笔尖位置的笔迹效果。The pressure-sensitive signal includes the above-mentioned first pressure-sensitive information. After receiving the first pressure-sensitivity information, the default device may render a handwriting effect at the position of the pen tip according to the first pressure-sensitivity information.
2.2、目标设备编号为默认设备的设备编号,且验证设备中存在多个匹配设备,或者,目标设备编号并非是默认设备的设备编号,但是存在匹配设备。2.2. The target device number is the device number of the default device, and there are multiple matching devices in the verification device, or the target device number is not the device number of the default device, but there is a matching device.
匹配设备为与目标设备编号匹配的验证设备。The matching device is the authentication device that matches the target device number.
如果目标设备编号为默认设备编号,且验证设备中存在多个匹配设备,或者,目标设备编号为并非是默认设备的设备编号,但是存在匹配设备,则配件设备101无法直接从匹配设备中识别目标设备。If the target device number is the default device number and there are multiple matching devices in the verification device, or if the target device number is a device number that is not the default device, but there is a matching device, the accessory device 101 cannot directly identify the target from the matching device equipment.
此时,配件设备101可以发送第一咨询信息至各个匹配设备。At this time, the accessory device 101 may send the first consultation information to each matching device.
第一咨询信息的内容可以根据实际情况进行设置。例如,第一咨询信息可以包括首点标识以及第一时间。The content of the first consultation information may be set according to the actual situation. For example, the first consultation information may include the first point identification and the first time.
在一些可能的实现方式中,配件设备101可以通过第一信息通道将上述第一咨询信息同步发送至各个匹配设备。In some possible implementations, the accessory device 101 may synchronously send the above-mentioned first consultation information to each matching device through the first information channel.
在匹配设备在接收到第一咨询信息之后,匹配设备可以判断最近一次接收报点信号是否为首次接收报点,以及,计算设备本地记录的第二时间与第一时间的偏差值。After the matching device receives the first consultation information, the matching device can determine whether the last time announcing signal is received for the first time, and calculate the deviation between the second time locally recorded by the device and the first time.
如果匹配设备最近一次接收报点信号不是首次接收报点、匹配设备未记录第二时间或上述偏差值大于或等于预设偏差阈值,则匹配设备返回配对失败信息至配件设备101。If the last time the matching device receives an announcement signal is not the first time, the matching device does not record the second time, or the above deviation value is greater than or equal to the preset deviation threshold, the matching device returns pairing failure information to the accessory device 101 .
如果上述匹配设备最近一次接收报点信号为首次接收报点,且上述偏差值小于预设偏差阈值,则匹配设备返回配对确认信息至配件设备101。If the last time the matching device receives the report signal is the first time the report is received, and the deviation value is less than the preset deviation threshold, the matching device returns pairing confirmation information to the accessory device 101 .
上述预设偏差阈值可以根据实际需求进行设置。例如,在一些实施例中,经过统计发现配件设备101传输报点信号所消耗的时间以及电子设备102处理报点信号所消耗的时间的和小于2ms,则用户可以将预设偏差阈值设置为2ms;或者,在另一些实施例中,用户也可以根据其他影响因素,将预设偏差阈值设置为1ms、3ms、5ms等数值。The above-mentioned preset deviation threshold can be set according to actual needs. For example, in some embodiments, it is found through statistics that the sum of the time consumed by the accessory device 101 to transmit the alarm signal and the time consumed by the electronic device 102 to process the alarm signal is less than 2ms, then the user can set the preset deviation threshold to 2ms Alternatively, in other embodiments, the user may also set the preset deviation threshold to values such as 1ms, 3ms, and 5ms according to other influencing factors.
在配件设备101可以发送第一咨询信息至各个匹配设备之后,如果配件设备101接收到任一匹配设备返回配对确认信息,则配件设备101将发送配对确认信息的匹配设备确认为目标设备,与目标设备配对,将目标设备设置为新的默认设备。例如,当上述第一信息通道为BLE连接通道时,配件设备101将发送配对确认信息的匹配设备确认为目标设备之后,配件设备101与目标设备配对,即配件设备101与目标设备建立HoGP连接通道,将目标设备设置为新的默认设备。After the accessory device 101 can send the first consultation information to each matching device, if the accessory device 101 receives the pairing confirmation information returned by any matching device, the accessory device 101 confirms the matching device that sent the pairing confirmation information as the target device, and matches the target device with the target device. Device pairing sets the target device as the new default device. For example, when the above-mentioned first information channel is a BLE connection channel, after the accessory device 101 confirms the matching device that sent the pairing confirmation information as the target device, the accessory device 101 pairs with the target device, that is, the accessory device 101 establishes a HoGP connection channel with the target device , set the target device as the new default device.
需要说明的是,在工程实践的过程中,电子设备难以精确地在同一时刻开始执行多个任务,如果电子设备开始执行多个任务的时间在一定的误差范围内,则可视为电子设备同步开始执行多个任务。因此,上述配件设备101将上述第一咨询信息同步发送至各个匹配设备,可以理解为配件设备101分别向各个匹配设备发送第一咨询信息的时间在预设的误差范围内。误差范围可以根据实际情况进行设置。It should be noted that in the process of engineering practice, it is difficult for electronic equipment to start executing multiple tasks at the same time. If the time when electronic equipment starts to execute multiple tasks is within a certain error range, it can be regarded as electronic equipment synchronization. Start multiple tasks. Therefore, when the accessory device 101 sends the first consultation information to each matching device synchronously, it can be understood that the time when the accessory device 101 sends the first consultation information to each matching device is within a preset error range. The error range can be set according to the actual situation.
应用场景二:Application Scenario Two:
请参阅图17,在图17所示的场景中,配件设备101包括手写笔1701,电子设备102包括平板电脑1702、平板电脑1703以及平板电脑1704。Referring to FIG. 17 , in the scenario shown in FIG. 17 , the accessory device 101 includes a stylus 1701 , and the electronic device 102 includes a tablet computer 1702 , a tablet computer 1703 , and a tablet computer 1704 .
在手写笔1701上,设置有蓝牙模块17011;在平板电脑1702上,设置有蓝牙模块17021;在平板电脑1703上,设置有蓝牙模块17031;在平板电脑1704上,设置有蓝牙模块17041。On the stylus 1701, a Bluetooth module 17011 is provided; on the tablet computer 1702, a Bluetooth module 17021 is provided; on the tablet computer 1703, a Bluetooth module 17031 is provided; on the tablet computer 1704, a Bluetooth module 17041 is provided.
在第一时刻,手写笔1701与平板电脑1703配对,手写笔1701在平板电脑1703上书写,手写笔1701的蓝牙模块17011与平板电脑1703的蓝牙模块17031建立了HoGP连接通道。At the first moment, the stylus 1701 is paired with the tablet computer 1703, the stylus 1701 writes on the tablet computer 1703, and the Bluetooth module 17011 of the stylus 1701 establishes a HoGP connection channel with the Bluetooth module 17031 of the tablet computer 1703.
手写笔1701的蓝牙模块17011分别与平板电脑1702的蓝牙模块17021以及平板电脑1704的蓝牙模块17041建立了GATT连接通道。The Bluetooth module 17011 of the stylus 1701 establishes a GATT connection channel with the Bluetooth module 17021 of the tablet computer 1702 and the Bluetooth module 17041 of the tablet computer 1704 respectively.
如图18所示,在第二时刻,手写笔1701被移动至平板电脑1702,并响应于用户的操作,在平板电脑1702上书写,与平板电脑1702接触。As shown in FIG. 18 , at the second moment, the stylus 1701 is moved to the tablet computer 1702 , and in response to the user's operation, writes on the tablet computer 1702 and contacts the tablet computer 1702 .
当手写笔1701与平板电脑1702接触时,手写笔1701通过第二信息通道发送第一报点信号至平板电脑1702,平板电脑1702通过第三信息通道发送上行信号至手写笔1701。When the stylus 1701 is in contact with the tablet computer 1702, the stylus 1701 sends the first point signal to the tablet computer 1702 through the second information channel, and the tablet computer 1702 sends the uplink signal to the stylus 1701 through the third information channel.
手写笔1701的压力传感器207检测到第一压感信息,且手写笔1701在检测到第一压感信息之前的第一预设时长内未检测到第二压感信息,所以,手写笔1701记录发送第一报点信号的第一时间。The pressure sensor 207 of the stylus 1701 detects the first pressure-sensing information, and the stylus 1701 does not detect the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, so the stylus 1701 records The first time at which the first point signal is sent.
平板电脑1702接收到第一报点信号,且平板电脑1702在接收到第一报点信号之前的第二预设时长内未检测到第二报点信号,所以,平板电脑1702将接收第一报点信号确定为首次接收报点,并记录首次接收报点的第二时间。The tablet computer 1702 receives the first point notification signal, and the tablet computer 1702 does not detect the second point notification signal within the second preset time period before receiving the first point notification signal, so the tablet computer 1702 will receive the first point notification signal. The point signal is determined to be the first time announcing point is received, and the second time of first receiving announcing point is recorded.
由于手写笔1701在检测到第一压感信息之前的第一预设时长内未检测到第二压感信息,所以,手写笔1701对上行信号进行解析,得到目标设备编号。Since the stylus 1701 does not detect the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, the stylus 1701 parses the uplink signal to obtain the target device number.
此时,手写笔1701根据目标设备编号,确定平板电脑1702、平板电脑1703以及平板电脑1704均与目标设备编号匹配。At this time, according to the target device number, the stylus 1701 determines that the tablet computer 1702 , the tablet computer 1703 , and the tablet computer 1704 all match the target device number.
因此,手写笔1701同步发送第一咨询信息至平板电脑1702、平板电脑1703以及平板电脑1704。第一咨询信息包括首点标识以及第一时间。Therefore, the stylus 1701 sends the first consultation information to the tablet computer 1702 , the tablet computer 1703 and the tablet computer 1704 synchronously. The first consultation information includes the first point identifier and the first time.
平板电脑1702接收到第一咨询信息后,检测到最近一次接收报点信号为首次接收报点,则获取第二时间,用第二时间减去第一时间,得到第二时间和第一时间的偏差值。After receiving the first consultation information, the tablet computer 1702 detects that the last time announcing signal is received for the first time, and then obtains the second time, subtracts the first time from the second time, and obtains the difference between the second time and the first time. Deviation.
平板电脑1702检测到偏差值小于预设偏差阈值,则返回配对确认信息至手写笔1701。When the tablet computer 1702 detects that the deviation value is smaller than the preset deviation threshold, it returns a pairing confirmation message to the stylus 1701 .
平板电脑1703和平板电脑1704接收到第一咨询信息后,由于平板电脑1703和平板电脑1704的最近一次接收报点信号都不是首次接收报点,所以,平板电脑1703返回配对失败信息至手写笔1701,平板电脑1704返回配对失败信息至手写笔1701。After the tablet computer 1703 and the tablet computer 1704 receive the first consultation information, since the last time the tablet computer 1703 and the tablet computer 1704 received the report point signal is not the first time to receive the report point, the tablet computer 1703 returns a pairing failure message to the stylus 1701 , the tablet computer 1704 returns a pairing failure message to the stylus 1701 .
手写笔1701接收到平板电脑1702发送的配对确认信息后,将平板电脑1702确定为目标设备,与平板电脑1702建立HoGP连接通道,将平板电脑1702设置为新的默认设备,发送配对指示信息至平板电脑1702。平板电脑1702接收到配对指示信息后,完成与手写笔1701的配对操作。After receiving the pairing confirmation message sent by the tablet computer 1702, the stylus 1701 determines the tablet computer 1702 as the target device, establishes a HoGP connection channel with the tablet computer 1702, sets the tablet computer 1702 as the new default device, and sends the pairing instruction information to the tablet computer Computer 1702. After receiving the pairing instruction information, the tablet computer 1702 completes the pairing operation with the stylus 1701 .
手写笔1701与平板电脑1702建立了HoGP连接通道之后,手写笔1701发送第一压感信息至平板电脑1702,平板电脑1702根据第一压感信息渲染笔迹效果。After the stylus 1701 and the tablet computer 1702 establish a HoGP connection channel, the stylus 1701 sends the first pressure-sensitive information to the tablet computer 1702, and the tablet computer 1702 renders a handwriting effect according to the first pressure-sensitive information.
在另一些可能的实现方式中,配件设备101可以根据第一预设规则确定各个匹配设备的轮询顺序,根据轮询顺序依次轮询各个匹配设备。In some other possible implementation manners, the accessory device 101 may determine the polling sequence of each matching device according to the first preset rule, and poll each matching device in turn according to the polling sequence.
第一预设规则可以根据实际需求进行设置。例如,在一些实施例中,第一预设规则可以设置为根据各个匹配设备与配件设备101建立第一信息通道的时间,按照由近及远的顺序进行排序,确定各个匹配设备的轮询顺序。在另一些实施例中,第一预设规则可以设置为根据各个匹配设备曾经被设置为默认设备的时间,按照由近及远的顺序进行排序,未被设置过默认设备的匹配设备,则按照各个匹配设备与配件设备101建立第一信息通道的时间,按照由近及远的顺序进行排序,从而确定各个匹配设备的轮询顺序。The first preset rule can be set according to actual needs. For example, in some embodiments, the first preset rule may be set to determine the polling order of each matching device according to the time when each matching device and the accessory device 101 establish the first information channel, and sorting in order from near to far. . In other embodiments, the first preset rule may be set to be sorted according to the time when each matching device has been set as the default device, in order from near to far, and the matching device that has not been set as the default device is sorted according to The time for establishing the first information channel between each matching device and the accessory device 101 is sorted in order from near to far, so as to determine the polling sequence of each matching device.
在确定了各个匹配设备的轮询顺序后,配件设备101根据轮询顺序依次发送第一咨询信息至各个匹配设备。After determining the polling sequence of each matching device, the accessory device 101 sequentially sends the first consultation information to each matching device according to the polling sequence.
在匹配设备在接收到第一咨询信息之后,匹配设备可以判断最近一次接收报点信号是否为首次接收报点,以及,计算设备本地记录的第二时间与第一时间的偏差值。After the matching device receives the first consultation information, the matching device can determine whether the last time announcing signal is received for the first time, and calculate the deviation between the second time locally recorded by the device and the first time.
如果匹配设备最近一次接收报点信号不是首次接收报点、匹配设备未记录第二时间或上述偏差值大于或等于预设偏差阈值,则匹配设备返回配对失败信息至配件设备101。If the last time the matching device receives an announcement signal is not the first time, the matching device does not record the second time, or the above deviation value is greater than or equal to the preset deviation threshold, the matching device returns pairing failure information to the accessory device 101 .
如果上述匹配设备最近一次接收报点信号为首次接收报点,且上述偏差值小于预设偏差阈值,则匹配设备返回配对确认信息至配件设备101。If the last time the matching device receives the report signal is the first time the report is received, and the deviation value is less than the preset deviation threshold, the matching device returns pairing confirmation information to the accessory device 101 .
配件设备101如果接收到匹配设备发送的配对失败信息,则根据轮询顺序,发送第一咨询信息至下一个匹配设备。If the accessory device 101 receives the pairing failure information sent by the matching device, it sends the first consultation information to the next matching device according to the polling sequence.
配件设备101如果接收到匹配设备发送配对确认信息,则停止轮询,将发送配对确认信息的匹配设备确定为目标设备,与目标设备配对,将目标设备设置为新的默认设备。If the accessory device 101 receives pairing confirmation information sent by the matching device, it stops polling, determines the matching device that sent the pairing confirmation information as the target device, pairs with the target device, and sets the target device as a new default device.
应用场景三:Application scenario three:
请参阅图19,在图19所示的场景中,配件设备101包括手写笔1901,电子设备102包括平板电脑1902以及平板电脑1903。Referring to FIG. 19 , in the scenario shown in FIG. 19 , the accessory device 101 includes a stylus 1901 , and the electronic device 102 includes a tablet computer 1902 and a tablet computer 1903 .
在手写笔1901上,设置有蓝牙模块19011;在平板电脑1902上,设置有蓝牙模块19021;在平板电脑1903上,设置有蓝牙模块19031。On the stylus 1901, a Bluetooth module 19011 is provided; on the tablet computer 1902, a Bluetooth module 19021 is provided; on the tablet computer 1903, a Bluetooth module 19031 is provided.
在第三时刻,手写笔1901与平板电脑1903配对,手写笔1901在平板电脑1903上书写,手写笔1901的蓝牙模块19011与平板电脑1903的蓝牙模块19031建立了HoGP连接通道。At the third moment, the stylus 1901 is paired with the tablet computer 1903, the stylus 1901 writes on the tablet computer 1903, and the Bluetooth module 19011 of the stylus 1901 establishes a HoGP connection channel with the Bluetooth module 19031 of the tablet computer 1903.
手写笔1901的蓝牙模块19011与平板电脑1902的蓝牙模块19021建立了GATT连接通道。The Bluetooth module 19011 of the stylus 1901 and the Bluetooth module 19021 of the tablet computer 1902 establish a GATT connection channel.
在第四时刻,手写笔1901被移动至平板电脑1902,并响应于用户的操作,在平板电脑1902上书写,与平板电脑1902接触。At the fourth moment, the stylus 1901 is moved to the tablet computer 1902, and in response to the user's operation, writes on the tablet computer 1902 and contacts the tablet computer 1902.
当手写笔1901与平板电脑1902接触时,手写笔1901通过第二信息通道发送第一报点信号至平板电脑1902,平板电脑1902通过第三信息通道发送上行信号至手写笔 1901。When the stylus 1901 is in contact with the tablet computer 1902, the stylus 1901 sends the first point signal to the tablet computer 1902 through the second information channel, and the tablet computer 1902 sends the uplink signal to the stylus 1901 through the third information channel.
手写笔1901的压力传感器207检测到第一压感信息,且手写笔1901在检测到第一压感信息之前的第一预设时长内未检测到第二压感信息,所以,手写笔1901记录发送第一报点信号的第一时间。The pressure sensor 207 of the stylus 1901 detects the first pressure-sensitive information, and the stylus 1901 does not detect the second pressure-sensitive information within the first preset time period before detecting the first pressure-sensitive information, so the stylus 1901 records The first time at which the first point signal is sent.
平板电脑1902接收到第一报点信号,且平板电脑1902在接收到第一报点信号之前的第二预设时长内未检测到第二报点信号,所以,平板电脑1902将接收第一报点信号确定为首次接收报点,并记录首次接收报点的第二时间。The tablet computer 1902 receives the first report signal, and the tablet computer 1902 does not detect the second report signal within the second preset time period before receiving the first report signal, so the tablet computer 1902 will receive the first report. The point signal is determined to be the first time announcing point is received, and the second time of first receiving announcing point is recorded.
由于手写笔1901在检测到第一压感信息之前的第一预设时长内未检测到第二压感信息,所以,手写笔1901对上行信号进行解析,得到目标设备编号。Since the stylus 1901 does not detect the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, the stylus 1901 parses the uplink signal to obtain the target device number.
此时,手写笔1901根据目标设备编号,确定平板电脑1902和平板电脑1903均与目标设备编号匹配。At this time, the stylus 1901 determines that both the tablet computer 1902 and the tablet computer 1903 match the target device number according to the target device number.
由于存在多个匹配设备,因此,手写笔1901根据第一预设规则确定平板电脑1902和平板电脑1903的轮询顺序。Since there are multiple matching devices, the stylus 1901 determines the polling order of the tablet computer 1902 and the tablet computer 1903 according to the first preset rule.
第一预设规则为手写笔1901根据各个匹配设备曾经被设置为默认设备的时间,按照由近及远的顺序进行排序,未被手写笔1901设置过默认设备的匹配设备,则按照各个匹配设备与手写笔1901建立第一信息通道的时间,按照由近及远的顺序进行排序,从而确定各个匹配设备的轮询顺序。The first preset rule is that the stylus 1901 sorts according to the time when each matching device has been set as the default device, according to the order from near to far. The time of establishing the first information channel with the stylus 1901 is sorted in order from near to far, so as to determine the polling order of each matching device.
由于平板电脑1903为当前与手写笔1901配对的默认设备,因此,平板电脑1902和平板电脑1903的轮询顺序为先询问平板电脑1903,再询问平板电脑1902。Since the tablet computer 1903 is the default device currently paired with the stylus 1901 , the polling sequence of the tablet computer 1902 and the tablet computer 1903 is to query the tablet computer 1903 first, and then query the tablet computer 1902 .
因此,手写笔1901先发送第一咨询信息至平板电脑1903。第一咨询信息包括首点标识以及第一时间。Therefore, the stylus 1901 sends the first consultation information to the tablet computer 1903 first. The first consultation information includes the first point identifier and the first time.
如图20所示,平板电脑1903接收到第一咨询信息后,检测到平板电脑1903最近一次接收报点信号不是首次接收报点,所以,平板电脑1903返回配对失败信息至手写笔1901。As shown in FIG. 20 , after the tablet computer 1903 receives the first consultation information, it detects that the last time the tablet computer 1903 received an announcement signal is not the first time to receive an announcement. Therefore, the tablet computer 1903 returns a pairing failure message to the stylus 1901 .
手写笔1901接收到平板电脑1903返回的配对失败信息之后,根据上述轮询顺序,发送第一咨询信息至平板电脑1902。After receiving the pairing failure information returned by the tablet computer 1903, the stylus pen 1901 sends the first consultation information to the tablet computer 1902 according to the above polling sequence.
平板电脑1902接收到第一咨询信息后,检测到最近一次接收报点信号为首次接收报点,则获取第二时间,用第二时间减去第一时间,得到第二时间和第一时间的偏差值。After receiving the first consultation information, the tablet computer 1902 detects that the last time announcing signal is received for the first time, and then obtains the second time, subtracts the first time from the second time, and obtains the difference between the second time and the first time. Deviation.
如图21所示,平板电脑1902检测到偏差值小于预设偏差阈值,则返回配对确认信息至手写笔1901,并且根据第一压感信息渲染笔迹效果。As shown in FIG. 21 , when the tablet computer 1902 detects that the deviation value is smaller than the preset deviation threshold, it returns a pairing confirmation message to the stylus 1901, and renders the handwriting effect according to the first pressure-sensitive information.
手写笔1901接收到平板电脑1902发送的配对确认信息后,将平板电脑1902确定为目标设备,与平板电脑1902建立HoGP连接通道,将平板电脑1902设置为新的默认设备,发送配对指示信息至平板电脑1902。平板电脑1902接收到配对指示信息后,完成与手写笔1901的配对操作。After receiving the pairing confirmation message sent by the tablet computer 1902, the stylus 1901 determines the tablet computer 1902 as the target device, establishes a HoGP connection channel with the tablet computer 1902, sets the tablet computer 1902 as the new default device, and sends the pairing instruction information to the tablet computer Computer 1902. After receiving the pairing instruction information, the tablet computer 1902 completes the pairing operation with the stylus 1901 .
手写笔1901与平板电脑1902建立了HoGP连接通道之后,手写笔1901发送第一压感信息至平板电脑1902,平板电脑1902根据第一压感信息渲染笔迹效果。After the stylus 1901 and the tablet computer 1902 establish a HoGP connection channel, the stylus 1901 sends the first pressure-sensitive information to the tablet computer 1902, and the tablet computer 1902 renders the handwriting effect according to the first pressure-sensitive information.
如果配件设备101询问了所有匹配设备,且仍未接收到配对确认信息,则表示目标设备可能未开启无线通信功能,导致配件设备101无法与目标设备建立第一信息通 道。If the accessory device 101 has inquired about all matching devices and still does not receive the pairing confirmation message, it means that the target device may not have the wireless communication function enabled, so that the accessory device 101 cannot establish the first information channel with the target device.
此时,配件设备101可以执行预设提示操作,通过预设提示操作提醒用户开启目标设备的无线通信功能。At this time, the accessory device 101 may perform a preset prompt operation, and remind the user to enable the wireless communication function of the target device through the preset prompt operation.
预设提示操作的内容可以根据实际情况进行设置。具体地,预设提示操作可以为振动、蜂鸣器发声、扬声器语音播报等提示方式中的任意一种或多种的组合。The content of the preset prompt operation can be set according to the actual situation. Specifically, the preset prompting operation may be any one or a combination of any one or a combination of prompting methods such as vibration, buzzer sounding, and speaker voice broadcast.
例如,如图22所示,假设手写笔2201在平板电脑2202上书写,且平板电脑2202未开启蓝牙功能,导致手写笔2201无法查找到目标设备。此时,手写笔2201可以通过振动的方式提醒用户开启平板电脑2202的蓝牙功能;或者,如图23所示,当手写笔2201设置有蜂鸣器时,手写笔2201也可以控制蜂鸣器发出“嘀”的声音,以此提醒用户开启平板电脑2202的蓝牙功能;或者,如图24所示,当手写笔2201设置有扬声器时,手写笔2201也可以控制扬声器播报“请开启蓝牙功能”,以此提醒用户开启平板电脑2202的蓝牙功能。For example, as shown in FIG. 22 , it is assumed that the stylus 2201 is writing on the tablet computer 2202, and the tablet computer 2202 does not have the Bluetooth function enabled, so that the stylus 2201 cannot find the target device. At this time, the stylus 2201 can remind the user to turn on the Bluetooth function of the tablet computer 2202 by means of vibration; or, as shown in FIG. 23 , when the stylus 2201 is provided with a buzzer, the stylus 2201 can also control the buzzer to emit The sound of "di" reminds the user to turn on the Bluetooth function of the tablet computer 2202; or, as shown in Figure 24, when the stylus 2201 is provided with a speaker, the stylus 2201 can also control the speaker to broadcast "Please turn on the Bluetooth function", In this way, the user is reminded to turn on the Bluetooth function of the tablet computer 2202 .
应用场景四:Application scenario four:
请参阅图25,在图25所示的场景中,配件设备101包括手写笔2501以及手写笔2502,电子设备102包括手机2503以及平板电脑2504。Referring to FIG. 25 , in the scenario shown in FIG. 25 , the accessory device 101 includes a stylus 2501 and a stylus 2502 , and the electronic device 102 includes a mobile phone 2503 and a tablet computer 2504 .
在手写笔2501上,设置有蓝牙模块25011;在手写笔2502上,设置有蓝牙模块25021;在手机2503上,设置有蓝牙模块25031;在平板电脑2504上,设置有蓝牙模块25041。The stylus 2501 is provided with a Bluetooth module 25011; the stylus 2502 is provided with a Bluetooth module 25021; the mobile phone 2503 is provided with a Bluetooth module 25031; and the tablet computer 2504 is provided with a Bluetooth module 25041.
在第五时刻,手写笔2501与手机2503配对,手写笔2501在手机2503上书写,手写笔2501的蓝牙模块25011与手机2503的蓝牙模块25031建立了HoGP连接通道。At the fifth moment, the stylus 2501 is paired with the mobile phone 2503, the stylus 2501 writes on the mobile phone 2503, and the Bluetooth module 25011 of the stylus 2501 establishes a HoGP connection channel with the Bluetooth module 25031 of the mobile phone 2503.
手写笔2501的蓝牙模块25011与平板电脑2504的蓝牙模块25041建立了GATT连接通道。The Bluetooth module 25011 of the stylus 2501 and the Bluetooth module 25041 of the tablet computer 2504 establish a GATT connection channel.
手写笔2502与平板电脑2504配对,手写笔2502在平板电脑2504上书写,手写笔2502的蓝牙模块25021与平板电脑2504的蓝牙模块25041建立了HoGP连接通道。The stylus 2502 is paired with the tablet computer 2504, the stylus 2502 writes on the tablet computer 2504, and the Bluetooth module 25021 of the stylus 2502 establishes a HoGP connection channel with the Bluetooth module 25041 of the tablet computer 2504.
手写笔2502的蓝牙模块25021与手机2503的蓝牙模块25031建立了GATT连接通道。The Bluetooth module 25021 of the stylus 2502 and the Bluetooth module 25031 of the mobile phone 2503 establish a GATT connection channel.
之后,手写笔2501离开了手机2503,手写笔2502离开了平板电脑2504。After that, the stylus 2501 leaves the mobile phone 2503, and the stylus 2502 leaves the tablet 2504.
如图26所示,在第六时刻,手写笔2502被移动至手机2503,并响应于用户的操作,在手机2503上书写,与手机2503接触。As shown in FIG. 26, at the sixth moment, the stylus 2502 is moved to the mobile phone 2503, and in response to the user's operation, writes on the mobile phone 2503 and contacts the mobile phone 2503.
当手写笔2502与手机2503接触时,手写笔2502通过第二信息通道发送报点信号1至手机2503,手机2503通过第三信息通道发送上行信号1至手写笔2502。When the stylus 2502 is in contact with the mobile phone 2503, the stylus 2502 sends the report signal 1 to the mobile phone 2503 through the second information channel, and the mobile phone 2503 sends the uplink signal 1 to the stylus 2502 through the third information channel.
手写笔2502的压力传感器检测到压感信息1,且手写笔2502在检测到压感信息1之前的第一预设时长内未检测到其他压感信息,所以,手写笔2502记录发送报点信号1的时间T1。The pressure sensor of the stylus 2502 detects the pressure-sensitive information 1, and the stylus 2502 does not detect other pressure-sensitive information within the first preset time period before detecting the pressure-sensitive information 1, so the stylus 2502 records and sends the report point signal 1 at time T1.
手机2503接收到报点信号1,且手机2503在接收到报点信号1之前的第二预设时长内未检测到其他报点信号,所以,手机2503将接收报点信号1确定为首次接收报点,并记录首次接收报点的时间T2。The mobile phone 2503 receives the report signal 1, and the mobile phone 2503 does not detect other report signals within the second preset time period before receiving the report signal 1, so the mobile phone 2503 determines that the report signal 1 is received for the first time. point, and record the time T2 when the point is first received.
由于手写笔2502在检测到压感信息1之前的第一预设时长内未检测到其他压感信息,所以,手写笔2502对上行信号1进行解析,得到目标设备编号1。Since the stylus 2502 does not detect other pressure-sensitive information within the first preset time period before detecting the pressure-sensitive information 1, the stylus 2502 parses the uplink signal 1 to obtain the target device number 1.
此时,手写笔2502根据目标设备编号1,确定手机2503和平板电脑2504均与目标设备编号1匹配。At this time, according to the target device number 1, the stylus 2502 determines that both the mobile phone 2503 and the tablet computer 2504 match the target device number 1.
因此,手写笔2502发送咨询信息1至手机2503和平板电脑2504。咨询信息1包括首点标识以及时间T1。Therefore, the stylus 2502 sends consultation information 1 to the mobile phone 2503 and the tablet computer 2504. The consultation information 1 includes the first point identifier and the time T1.
手机2503接收到咨询信息1后,检测到最近一次接收报点信号是接收报点信号1,接收报点信号1为首次接收报点,所以,手机2503获取时间T2,用时间T2减去时间T1,得到时间T2和时间T1的第一偏差值。After the mobile phone 2503 receives the consultation information 1, it detects that the last received report signal is the received report signal 1, and the received report signal 1 is the first time to receive the report. Therefore, the mobile phone 2503 obtains the time T2 and subtracts the time T1 from the time T2. , the first deviation value between time T2 and time T1 is obtained.
手机2503检测到第一偏差值小于预设偏差阈值,则返回配对确认信息至手写笔2503。When the mobile phone 2503 detects that the first deviation value is smaller than the preset deviation threshold, it returns a pairing confirmation message to the stylus 2503 .
平板电脑2504接收到咨询信息1后,检测到平板电脑2504的最近一次接收报点信号不是首次接收报点,所以,平板电脑2504返回配对失败信息至手写笔2502。After the tablet computer 2504 receives the consultation information 1, it detects that the last time the tablet computer 2504 receives an announcement signal is not the first time to receive an announcement. Therefore, the tablet computer 2504 returns a pairing failure message to the stylus 2502.
手写笔2502接收到手机2503发送的配对确认信息后,将手机2503确定为目标设备,与手机2503配对,将手机2503设置为新的默认设备,与手机2503建立HoGP连接通道,发送配对指示信息至手机2503。手机2503接收到配对指示信息后,完成与手写笔2502的配对操作。After the stylus 2502 receives the pairing confirmation message sent by the mobile phone 2503, it determines the mobile phone 2503 as the target device, pairs with the mobile phone 2503, sets the mobile phone 2503 as the new default device, establishes a HoGP connection channel with the mobile phone 2503, and sends the pairing instruction information to Phone 2503. After receiving the pairing instruction information, the mobile phone 2503 completes the pairing operation with the stylus 2502 .
手写笔2502与手机2503建立了HoGP连接通道之后,手写笔2502发送压感信息1至手机2503,手机2503根据压感信息1渲染笔迹效果。After the stylus 2502 and the mobile phone 2503 establish a HoGP connection channel, the stylus 2502 sends the pressure sensitive information 1 to the mobile phone 2503 , and the mobile phone 2503 renders the handwriting effect according to the pressure sensitive information 1 .
如图27所示,在第七时刻,手写笔2501被移动至平板电脑2504,并响应于用户的操作,在平板电脑2504上书写,与平板电脑2504接触。As shown in FIG. 27 , at the seventh moment, the stylus 2501 is moved to the tablet computer 2504 , and in response to the user's operation, writes on the tablet computer 2504 and contacts the tablet computer 2504 .
当手写笔2501与平板电脑2504接触时,手写笔2501通过交流连接通道发送报点信号2至平板电脑2504,平板电脑2504通过交流连接通道发送上行信号2至手写笔2501。When the stylus 2501 is in contact with the tablet computer 2504, the stylus 2501 sends an announcement signal 2 to the tablet computer 2504 through the AC connection channel, and the tablet computer 2504 sends the uplink signal 2 to the stylus pen 2501 through the AC connection channel.
手写笔2501的压力传感器检测到压感信息2,且手写笔2501在检测到压感信息2之前的第一预设时长内未检测到其他压感信息,所以,手写笔2501记录发送报点信号2的时间T3。The pressure sensor of the stylus 2501 detects the pressure-sensitive information 2, and the stylus 2501 does not detect other pressure-sensitive information within the first preset period of time before detecting the pressure-sensitive information 2, so the stylus 2501 records and sends the reporting point signal 2 at time T3.
平板电脑2504接收到报点信号2,且平板电脑2504在接收到报点信号2之前的第二预设时长内未检测到其他报点信号,所以,平板电脑2504将接收报点信号2确定为首次接收报点,并记录首次接收报点的时间T4。The tablet computer 2504 receives the reporting point signal 2, and the tablet computer 2504 does not detect other reporting point signals within the second preset time period before receiving the reporting point signal 2, so the tablet computer 2504 determines that the received reporting point signal 2 is the first. Receive the report point for the second time, and record the time T4 when the report point is received for the first time.
由于手写笔2501在检测到压感信息2之前的第一预设时长内未检测到其他压感信息,所以,手写笔2501对上行信号2进行解析,得到目标设备编号1。Since the stylus 2501 does not detect other pressure-sensitive information within the first preset time period before detecting the pressure-sensitive information 2 , the stylus 2501 parses the uplink signal 2 to obtain the target device number 1 .
此时,手写笔2501根据目标设备编号1,确定手机2503和平板电脑2504均与目标设备编号1匹配。At this time, according to the target device number 1, the stylus 2501 determines that both the mobile phone 2503 and the tablet computer 2504 match the target device number 1.
因此,手写笔2501通过上述发送咨询信息2至手机2503和平板电脑2504。咨询信息2包括首点标识以及时间T3。Therefore, the stylus 2501 sends the consultation information 2 to the mobile phone 2503 and the tablet computer 2504 through the above. The consultation information 2 includes the first point identifier and the time T3.
由于手写笔2502在手机2503上书写,因此,手机2503接收到咨询信息2后,检测到手机2503的最近一次接收报点信号不是首次接收报点,所以,手机2503返回配对失败信息至手写笔2501。Since the stylus pen 2502 writes on the mobile phone 2503, after the mobile phone 2503 receives the consultation information 2, it detects that the last time the mobile phone 2503 receives the report signal is not the first time to receive the report, so the mobile phone 2503 returns a pairing failure message to the stylus 2501 .
平板电脑2504接收到咨询信息2后,检测到最近一次接收报点信号是接收报点信号2,接收报点信号2为首次接收报点,所以,平板电脑2504获取时间T4,用时间 T4减去时间T3,得到时间T4和时间T3的第二偏差值。After the tablet computer 2504 receives the consultation information 2, it detects that the last received report signal is the received report signal 2, and the received report signal 2 is the first time to receive the report. Therefore, the tablet computer 2504 obtains the time T4 and subtracts the time T4 from the time T4. At time T3, a second deviation value between time T4 and time T3 is obtained.
平板电脑2504检测到第二偏差值小于预设偏差阈值,则返回配对确认信息至手写笔2504。When the tablet computer 2504 detects that the second deviation value is smaller than the preset deviation threshold, it returns a pairing confirmation message to the stylus 2504 .
手写笔2501接收到平板电脑2504发送的配对确认信息后,将平板电脑2504确定为目标设备,与平板电脑2504配对,将平板电脑2504设置为新的默认设备,与平板电脑2504建立HoGP连接通道,发送配对指示信息至平板电脑2504。平板电脑2504接收到配对指示信息后,完成与手写笔2501的配对操作。After receiving the pairing confirmation message sent by the tablet computer 2504, the stylus 2501 determines the tablet computer 2504 as the target device, pairs with the tablet computer 2504, sets the tablet computer 2504 as the new default device, and establishes a HoGP connection channel with the tablet computer 2504. Send pairing instructions to tablet 2504. After receiving the pairing instruction information, the tablet computer 2504 completes the pairing operation with the stylus 2501 .
手写笔2502与平板电脑2504建立了HoGP连接通道之后,手写笔2502发送压感信息2至平板电脑2504,平板电脑2504根据压感信息2渲染笔迹效果。After the stylus 2502 and the tablet computer 2504 establish a HoGP connection channel, the stylus 2502 sends the pressure-sensitive information 2 to the tablet computer 2504 , and the tablet computer 2504 renders the handwriting effect according to the pressure-sensitive information 2 .
2.3、目标设备编号不是默认设备的设备编号,并且验证设备中不存在匹配设备。2.3. The target device number is not the device number of the default device, and there is no matching device in the verification device.
如果目标设备编号不是默认设备的设备编号,并且验证设备中不存在匹配设备,则表示目标设备编号与各个验证设备均不匹配。If the target device number is not the device number of the default device, and there is no matching device in the verification device, it means that the target device number does not match each verification device.
例如,假设配件设备A中存储有设备编号1和设备编号2。For example, it is assumed that device number 1 and device number 2 are stored in accessory device A.
假设配件设备A在默认设备上书写。默认设备将设备编号从设备编号1更改为设备编号3,且未通知配件设备A。此时,配件设备A获取到的目标设备编号为设备编号3,但是配件设备A未记录设备编号3,因此,配件设备A判定目标设备编号不是默认设备的设备编号,并且验证设备中不存在匹配设备。Suppose accessory device A is writing on the default device. The default device changed the device number from device number 1 to device number 3 and did not notify accessory device A. At this time, the target device number obtained by accessory device A is device number 3, but accessory device A does not record device number 3. Therefore, accessory device A determines that the target device number is not the device number of the default device, and there is no match in the verification device. equipment.
或者,电子设备B的设备编号为设备编号3,且电子设备B未开启无线通信功能。此时,配件设备A在电子设备B上书写,获取到目标设备编号为设备编号3。但是,电子设备B未曾与配件设备A连接,且当前未开启无线通信功能,因此,配件设备A未曾记录过设备编号3,所以配件设备判定目标设备编号不是默认设备的设备编号,并且验证设备中不存在匹配设备。Alternatively, the device number of the electronic device B is device number 3, and the wireless communication function is not enabled for the electronic device B. At this time, the accessory device A writes on the electronic device B, and the obtained target device number is device number 3. However, the electronic device B has never been connected to the accessory device A, and the wireless communication function is not currently enabled. Therefore, the accessory device A has never recorded the device number 3, so the accessory device determines that the target device number is not the device number of the default device, and verifies the device number in the device. No matching device exists.
在一些可能的实现方式中,当目标设备编号与各个验证设备均不匹配时,配件设备101可以不切换默认设备,直接将当前默认设备确定为目标设备,发送压感信号至默认设备。In some possible implementations, when the target device number does not match each verification device, the accessory device 101 may directly determine the current default device as the target device without switching the default device, and send a pressure-sensitive signal to the default device.
默认设备接收到压感信号后,根据压感信号中的第一压感信息渲染笔迹效果。After receiving the pressure-sensitive signal, the default device renders a handwriting effect according to the first pressure-sensitive information in the pressure-sensitive signal.
在另一些可能的实现方式中,当目标设备编号与各个验证设备均不匹配时,配件设备101也可以执行预设提示操作,通过预设提示操作提醒用户开启目标设备的无线通信功能。In other possible implementation manners, when the target device number does not match each verification device, the accessory device 101 may also perform a preset prompt operation to remind the user to enable the wireless communication function of the target device through the preset prompt operation.
预设提示操作的内容可以根据实际情况进行设置。例如,预设提示操作可以为振动、蜂鸣器发声、扬声器语音播报等提示方式中的任意一种或多种的组合。The content of the preset prompt operation can be set according to the actual situation. For example, the preset prompt operation may be any one or a combination of any one or a combination of prompt methods such as vibration, buzzer sounding, and speaker voice broadcast.
综上所述,在本实施例提供的设备配对方法中,当配件设备101和电子设备102接触时,电子设备102可以通过第三信息通道传递上行信号至配件设备101。上行信号中包括电子设备102的目标设备编号。配件设备101可以根据目标设备编号确定是否需要切换默认设备。当配件设备101需要切换默认设备时,可以根据目标设备编号,发送第一咨询信息至相应的电子设备102,从而识别目标设备,与目标设备配对,将目标设备设置为新的默认设备。在配件设备101切换配对的默认设备的过程中,配件设备101可以自行确定是否切换配对的电子设备102以及识别目标设备,该过程无需用户主动执行特定的配对操作,提高了配件设备101切换使用对象的流畅性,且具有 较强的易用性和实用性,提高了用户的使用体验。To sum up, in the device pairing method provided in this embodiment, when the accessory device 101 and the electronic device 102 are in contact, the electronic device 102 can transmit an uplink signal to the accessory device 101 through the third information channel. The target device number of the electronic device 102 is included in the uplink signal. The accessory device 101 can determine whether the default device needs to be switched according to the target device number. When the accessory device 101 needs to switch the default device, it can send the first consultation information to the corresponding electronic device 102 according to the target device number, thereby identifying the target device, pairing with the target device, and setting the target device as a new default device. During the process of the accessory device 101 switching the paired default device, the accessory device 101 can determine whether to switch the paired electronic device 102 and identify the target device by itself. This process does not require the user to actively perform a specific pairing operation, which improves the ability of the accessory device 101 to switch the use object. The fluency, and strong ease of use and practicability, improve the user experience.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
以下,将从配件设备的角度,对本申请实施例提供的另一设备配对方法进行详细说明。请参阅图28,本实施例提供的设备配对方法包括:Hereinafter, another device pairing method provided by an embodiment of the present application will be described in detail from the perspective of an accessory device. Referring to FIG. 28, the device pairing method provided by this embodiment includes:
S2801、配件设备与电子设备接触。S2801, the accessory device is in contact with the electronic device.
当配件设备与电子设备接触时,配件设备的压感传感器检测到第一压感信息,并且,配件设备的信号发射电路可以与电子设备的屏幕建立第二信息通道,配件设备的信号检测电路可以与电子设备的屏幕建立第三信息通道。When the accessory device is in contact with the electronic device, the pressure sensor of the accessory device detects the first pressure-sensitive information, and the signal transmitting circuit of the accessory device can establish a second information channel with the screen of the electronic device, and the signal detection circuit of the accessory device can A third information channel is established with the screen of the electronic device.
此时,配件设备可以通过第二信息通道发送第一报点信号至电子设备,电子设备通过第三信息通道发送上行信号至配件设备。At this time, the accessory device can send the first point announcement signal to the electronic device through the second information channel, and the electronic device sends the uplink signal to the accessory device through the third information channel.
电子设备接收到第一报点信号之后,可以根据第一报点信号确定笔尖位置,进而渲染笔尖位置的笔迹效果或响应该笔尖位置对应的触控指令。After receiving the first report signal, the electronic device can determine the position of the pen tip according to the first report signal, and then render the handwriting effect at the position of the pen tip or respond to the touch command corresponding to the position of the pen tip.
配件设备接收到上行信号之后,可以对上行信号进行解析,得到目标设备(即当前与配件设备接触的电子设备)的目标设备编号。After the accessory device receives the uplink signal, it can parse the uplink signal to obtain the target device number of the target device (ie, the electronic device currently in contact with the accessory device).
S2802、配件设备判断在检测到第一压感信息之前的第一预设时长内是否未检测到第二压感信息,若是,则执行S2803,若否,则执行S2805。S2802. The accessory device determines whether the second pressure-sensing information is not detected within the first preset time period before the first pressure-sensing information is detected, and if so, executes S2803, and if not, executes S2805.
当配件设备在检测到第一压感信息时,可以检测在之前的第一预设时长内是否曾经检测到其他压感信息,即第二压感信息。When the accessory device detects the first pressure-sensing information, it may detect whether other pressure-sensing information, that is, the second pressure-sensing information, has been detected in the previous first preset time period.
如果配件设备在检测到第一压感信息之前的第一预设时长内曾经检测到第二压感信息,则表示配件设备相邻两次检测到压感信息的时间间隔不足以让用户切换配件设备的使用对象,目标设备为当前与配件设备配对的电子设备(即默认设备)。此时,配件设备执行S2805。If the accessory device has detected the second pressure-sensing information within the first preset period of time before the first pressure-sensing information is detected, it means that the time interval between the accessory device detecting the pressure-sensing information twice adjacently is not enough for the user to switch the accessory The use object of the device, the target device is the electronic device currently paired with the accessory device (ie the default device). At this time, the accessory device executes S2805.
例如,假设配件设备在检测到第一压感信息之前的第一预设时长内曾检测到第二压感信息,且配件设备检测到第一压感信息的时间与检测到第二压感信息的时间的间隔为87ms,87ms不足以让用户更换配件设备的使用对象。此时,配件设备可以判定用户并未更换配件设备的使用对象,目标对象依然为默认设备。For example, it is assumed that the accessory device has detected the second pressure-sensitivity information within a first preset time period before detecting the first pressure-sensitivity information, and the time when the accessory device detected the first pressure-sensitivity information is the same as when the second pressure-sensitivity information was detected. The time interval is 87ms, and 87ms is not enough for the user to change the use object of the accessory device. At this time, the accessory device can determine that the user has not changed the use object of the accessory device, and the target object is still the default device.
如果配件设备在检测到第一压感信息之前的第一预设时长内未曾检测到第二压感信息,则表示目标设备可能并非是默认设备。If the accessory device does not detect the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, it indicates that the target device may not be the default device.
例如,假设第一预设时长被设置为500ms。如果配件设备在检测到第一压感信息之前的500ms内未检测到第二压感信息,则表示用户当前使用配件设备的时间与用户上一次使用配件设备的时间的间隔足以让用户更换配件设备的使用对象。此时,目标设备可能依然是默认设备,即用户仍在同一电子设备上使用配件设备;或者,目标设备也可能不是默认设备,即用户已经将配件设备移动至另一电子设备上使用。For example, it is assumed that the first preset duration is set to 500ms. If the accessory device does not detect the second pressure-sensing information within 500ms before detecting the first pressure-sensing information, it means that the interval between the user's current use of the accessory device and the last time the user used the accessory device is sufficient for the user to replace the accessory device object of use. At this time, the target device may still be the default device, that is, the user is still using the accessory device on the same electronic device; or, the target device may not be the default device, that is, the user has moved the accessory device to another electronic device for use.
此时,配件设备记录检测到第一压感信息的第一时间,并执行S2803。At this time, the accessory device records the first time when the first pressure-sensing information is detected, and executes S2803.
S2803、配件设备判断是否能够解析得到目标设备编号,若是,则执行S2804,若否,则执行S2814。S2803, the accessory device determines whether the target device number can be obtained by analysis, if so, execute S2804, and if not, execute S2814.
如果配件设备在检测到第一压感信息之前的第一预设时长内未曾检测到第二压感 信息,则配件设备对上行信号进行解析,判断是否能够解析得到目标设备编号。If the accessory device does not detect the second pressure-sensing information within the first preset time period before detecting the first pressure-sensing information, the accessory device parses the uplink signal to determine whether the target device number can be obtained by parsing.
如果配件设备无法解析得到目标设备编号,则可能是目标设备未开启配件支持功能(例如手写笔功能),因此,目标设备并未传输上行信号至配件设备,配件设备接收不到上行信号,无法对上行信号进行解析,得不到目标设备编号。因此,配件设备执行S2814。If the accessory device cannot parse the target device number, it may be that the accessory support function (such as the stylus function) is not enabled on the target device. Therefore, the target device does not transmit the uplink signal to the accessory device, and the accessory device cannot receive the uplink signal and cannot connect to the accessory device. The upstream signal is parsed, and the target device number cannot be obtained. Therefore, the accessory device executes S2814.
如果配件设备可以解析得到目标设备编号,则执行S2804。If the accessory device can obtain the target device number by parsing, S2804 is executed.
S2804、配件设备判断是否存在与目标设备编号匹配的验证设备,若是,则执行S2806,若否,则执行S2805。S2804, the accessory device determines whether there is a verification device matching the target device number, if yes, execute S2806, and if not, execute S2805.
验证设备为当前与配件设备建立了第一信息通道的电子设备。验证设备包括默认设备。The verification device is the electronic device that currently establishes the first information channel with the accessory device. Validation devices include default devices.
配件设备在获取到目标设备编号之后,可以获取各个验证设备的设备编号,确定是否存在与目标设备编号匹配的验证设备。其中,验证设备与目标设备匹配是指验证设备的设备编号与目标设备编号一致。After acquiring the target device number, the accessory device can acquire the device number of each verification device to determine whether there is a verification device matching the target device number. The matching between the verification device and the target device means that the device number of the verification device is consistent with the target device number.
如果存在与目标设备编号匹配的验证设备,则配对设备执行S2806。If there is an authentication device matching the target device number, the paired device executes S2806.
如果不存在与目标设备编号匹配的验证设备,则配件设备执行S2805,不切换默认设备。If there is no verification device matching the target device number, the accessory device executes S2805 without switching the default device.
S2805、配件设备不切换默认设备。S2805, the accessory device does not switch the default device.
在步骤S2805中,配件设备将当前的默认设备确定为目标设备,不切换默认设备。In step S2805, the accessory device determines the current default device as the target device, and does not switch the default device.
此时,配件设备可以通过第一信息通道将压感信号发送至默认设备。At this time, the accessory device can send the pressure-sensitive signal to the default device through the first information channel.
压感信号中包括第一压感信息,默认设备接收到压感信号后,可以根据压感信号中的第一压感信息渲染笔尖位置的笔迹效果。The pressure-sensitive signal includes first pressure-sensitive information, and after receiving the pressure-sensitive signal, the default device can render the handwriting effect at the position of the pen tip according to the first pressure-sensitive information in the pressure-sensitive signal.
S2806、配件设备判断目标设备编号是否为默认设备的设备编号,若是,则执行S2807,若否,则执行S2808。S2806 , the accessory device determines whether the target device number is the device number of the default device, and if so, executes S2807 , and if not, executes S2808 .
配件设备检测到存在与目标设备编号匹配的验证设备后,配件设备可以判断目标设备编号是否为默认设备的设备编号。After the accessory device detects that there is a verification device matching the target device number, the accessory device can determine whether the target device number is the device number of the default device.
如果目标设备编号是默认设备的设备编号,则表示目标设备有可能是默认设备,此时,配件设备执行S2807。If the target device number is the device number of the default device, it means that the target device may be the default device, and at this time, the accessory device executes S2807.
如果目标设备编号不是默认设备的设备编号,则表示目标设备并未是默认设备,此时,配件设备执行S2808。If the target device number is not the device number of the default device, it means that the target device is not the default device, and at this time, the accessory device executes S2808.
S2807、配件设备判断验证设备中是否只存在一个匹配设备,若是,则执行S2805,若否,则执行S2809。S2807, the accessory device determines whether there is only one matching device in the verification device, if so, execute S2805, and if not, execute S2809.
配件设备在确定目标设备编号为默认设备的设备编号之后,可以判断验证设备中是否只存在一个匹配设备。匹配设备为与目标设备编号匹配的验证设备。After the accessory device determines that the target device number is the device number of the default device, it can determine whether there is only one matching device in the verification device. The matching device is the authentication device that matches the target device number.
由于默认设备也是验证设备,因此,如果验证设备中只有一个匹配设备,则表示验证设备中只有默认设备的设备编号为目标设备编号。Since the default device is also the verification device, if there is only one matching device in the verification device, it means that only the device number of the default device in the verification device is the target device number.
此时,配件设备可以确定目标设备为默认设备,所以,配件设备不需要切换默认设备,执行S2805。At this time, the accessory device can determine that the target device is the default device, so the accessory device does not need to switch the default device, and S2805 is executed.
如果验证设备中存在多个匹配设备,则表示目标设备可能为默认设备,或者,目标设备也可能不是默认设备,配件设备无法直接从匹配设备识别目标设备。If there are multiple matching devices in the verification device, it means that the target device may be the default device, or the target device may not be the default device, and the accessory device cannot directly identify the target device from the matching device.
此时,配件设备可以执行S2809,优先询问默认设备。At this time, the accessory device may execute S2809 to query the default device first.
S2808、配件设备根据第一预设规则确定各个匹配设备的轮询顺序,根据轮询顺序依次发送第一咨询信息至各个匹配设备,之后执行S2811。S2808. The accessory device determines the polling sequence of each matching device according to the first preset rule, sends the first consultation information to each matching device in turn according to the polling sequence, and then executes S2811.
当目标设备编号不是默认设备的设备编号,或者,目标设备编号是默认设备的设备编号且存在多个匹配时,配件设备无法直接从匹配设备中识别目标设备。When the target device number is not the device number of the default device, or, when the target device number is the device number of the default device and there are multiple matches, the accessory device cannot directly identify the target device from the matching devices.
因此,配件设备可以根据第一预设规则确定各个匹配设备的轮询顺序,根据轮询顺序依次发送第一咨询信息至各个匹配设备,根据匹配设备返回的信息识别目标设备。Therefore, the accessory device can determine the polling sequence of each matching device according to the first preset rule, send the first consultation information to each matching device in turn according to the polling sequence, and identify the target device according to the information returned by the matching device.
其中,第一咨询信息的内容可以根据实际情况进行设置。例如,第一咨询信息可以包括首点标识以及第一时间。The content of the first consultation information may be set according to the actual situation. For example, the first consultation information may include the first point identification and the first time.
第一预设规则可以根据实际需求进行设置。例如,在一些实施例中,第一预设规则可以设置为根据各个匹配设备与配件设备建立第一信息通道的时间,按照由近及远的顺序进行排序,确定各个匹配设备的轮询顺序。在另一些实施例中,第一预设规则可以设置为根据各个匹配设备曾经被设置为默认设备的时间,按照由近及远的顺序进行排序,未被设置过默认设备的匹配设备,则按照各个匹配设备与配件设备建立第一信息通道的时间,按照由近及远的顺序进行排序,从而确定各个匹配设备的轮询顺序。The first preset rule can be set according to actual needs. For example, in some embodiments, the first preset rule may be set to determine the polling order of each matching device according to the time when each matching device and the accessory device establish the first information channel, and sorting in order from near to far. In other embodiments, the first preset rule may be set to be sorted according to the time when each matching device has been set as the default device, in order from near to far, and the matching device that has not been set as the default device is sorted according to The time for establishing the first information channel between each matching device and the accessory device is sorted in order from near to far, so as to determine the polling sequence of each matching device.
S2809、配件设备发送第一咨询信息至默认设备,之后执行S2810。S2809. The accessory device sends the first consultation information to the default device, and then executes S2810.
当目标设备编号为默认设备的设备编号,且存在多个匹配设备时,配件设备可以发送第一咨询信息至默认设备,优先咨询默认设备。When the target device number is the device number of the default device, and there are multiple matching devices, the accessory device can send the first consultation information to the default device, and the default device is preferentially consulted.
然后,执行S2810,根据默认设备返回的信息确定默认设备是否为目标设备。Then, execute S2810, and determine whether the default device is the target device according to the information returned by the default device.
S2810、配件设备判断是否接收到默认设备返回的配对失败信息,若是,则执行S2808,若否,则执行S2805。S2810. The accessory device determines whether the pairing failure information returned by the default device is received, and if yes, executes S2808, and if not, executes S2805.
当电子设备在接收到第一报点信号时,如果在接收到第一报点信号之前的第二预设时长内未接收过其他报点信号,即第二报点信号,则电子设备可以将接收第一报点信号确定为首次接收报点,并记录接收到首次接收报点的第二时间。When the electronic equipment receives the first point notification signal, if it has not received other point notification signals, that is, the second point notification signal, within the second preset time period before receiving the first point notification signal, the electronic device can The reception of the first point-reporting signal is determined as the first-time point-receiving point, and the second time when the point-receiving point is received for the first time is recorded.
默认设备在接收到第一咨询信息后,可以查询最近一次接收报点信号是否为首次接收报点。After receiving the first consultation information, the default device can inquire whether the last received signal is the first to receive the report.
如果默认设备最近一次接收报点信号为首次接收报点,则默认设备可以计算第二时间和第一咨询信息中第一时间的偏差值。If the last time the default device receives an announcement signal is the first time an announcement is received, the default device may calculate a deviation value between the second time and the first time in the first consultation information.
如果上述偏差值小于预设偏差阈值,则默认设备可以返回配对确认信息至配件设备。If the above deviation value is less than the preset deviation threshold, the default device may return pairing confirmation information to the accessory device.
如果默认设备最近一次接收报点信号不是首次接收报点、默认设备未记录第二时间或上述偏差值大于或等于预设偏差阈值,则默认设备可以返回配对失败信息至配件设备。If the last time the default device receives an announcement signal is not the first time to receive an announcement, the default device does not record the second time, or the above deviation value is greater than or equal to the preset deviation threshold, the default device can return pairing failure information to the accessory device.
因此,配件设备在发送了第一咨询信息后,可以判断是否接收到默认设备发送的配对失败信息。Therefore, after sending the first consultation information, the accessory device can determine whether to receive the pairing failure information sent by the default device.
如果配件设备接收到默认设备发送的配对失败信息,则表示目标设备不是默认设备,此时,配件设备执行S2808,轮询各个匹配设备以识别目标设备。If the accessory device receives the pairing failure information sent by the default device, it means that the target device is not the default device. At this time, the accessory device executes S2808 to poll each matching device to identify the target device.
如果配件设备接收到默认设备发送配对确认信息,则表示目标设备为默认设备,此时,配件设备不需要切换默认设备,执行S2805。If the accessory device receives the pairing confirmation information sent by the default device, it means that the target device is the default device. At this time, the accessory device does not need to switch the default device, and S2805 is executed.
S2811、配件设备判断是否接收到匹配设备返回的配对确认信息,若是,则执行S2813,若否,则执行S2812。S2811. The accessory device determines whether the pairing confirmation information returned by the matching device is received, and if so, executes S2813, and if not, executes S2812.
配件设备在确定了各个匹配设备的轮询顺序后,可以根据轮询顺序依次发送第一咨询信息至各个匹配设备。After determining the polling sequence of each matching device, the accessory device may send the first consultation information to each matching device in sequence according to the polling sequence.
配件设备在每一次发送了第一咨询信息至匹配设备后,可以判断是否接收到该匹配设备返回的配对确认信息。配对确认信息中携带确认指示。After each time the accessory device sends the first consultation information to the matching device, it may determine whether to receive the pairing confirmation information returned by the matching device. The pairing confirmation message carries a confirmation indication.
如果配件设备接收到该匹配设备返回的配对确认信息,则配件设备执行S2813。If the accessory device receives the pairing confirmation information returned by the matching device, the accessory device executes S2813.
如果配件设备接收到该匹配设备返回的配对失败信息,则配件设备执行S2812。If the accessory device receives the pairing failure information returned by the matching device, the accessory device executes S2812.
S2812、配件设备判断是否已轮询完所有匹配设备,若是,则执行S2814,若否,则执行S2808。S2812, the accessory device determines whether all matching devices have been polled, if so, execute S2814, and if not, execute S2808.
配件设备接收到匹配设备返回的配对失败信息后,可以查询是否已经轮询完所有匹配设备。After receiving the pairing failure information returned by the matching device, the accessory device can query whether all matching devices have been polled.
如果配件设备未轮询完所有匹配设备,则配件设备可以返回S2808,根据轮询顺序切换下一个匹配设备,发送第一咨询信息至下一个匹配设备,继续执行询问操作。If the accessory device has not polled all matching devices, the accessory device may return to S2808, switch to the next matching device according to the polling sequence, send the first consultation information to the next matching device, and continue to perform the query operation.
如果配件设备已轮询完所有匹配设备,则表示目标设备不在验证设备中,此时,配件设备可以执行S2814,执行预设提示操作。If the accessory device has polled all matching devices, it means that the target device is not in the verification device, and at this time, the accessory device may execute S2814 to perform a preset prompt operation.
S2813、配件设备将发送配对确认信息的电子设备设置为新的默认设备。S2813, the accessory device sets the electronic device that sends the pairing confirmation information as a new default device.
如果配件设备接收到配对确认信息,则表示该配对确认信息的发送方为目标设备,配件设备可以与发送配对确认信息的电子设备配对,将发送配对确认信息的电子设备配对设置为新的默认设备。If the accessory device receives the pairing confirmation message, it means that the sender of the pairing confirmation message is the target device, the accessory device can be paired with the electronic device that sent the pairing confirmation message, and the pairing of the electronic device that sends the pairing confirmation message is set as the new default device .
S2814、配件设备执行预设提示操作。S2814, the accessory device performs a preset prompt operation.
配件设备可以执行预设提示操作,以此提醒用户开启目标设备的无线通信功能。The accessory device can perform a preset prompt operation to remind the user to turn on the wireless communication function of the target device.
预设提示操作的内容可以根据实际情况进行设置。例如,预设提示操作可以为振动、蜂鸣器发声、扬声器语音播报等提示方式中的任意一种或多种的组合。The content of the preset prompt operation can be set according to the actual situation. For example, the preset prompt operation may be any one or a combination of any one or a combination of prompt methods such as vibration, buzzer sounding, and speaker voice broadcast.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
以下,将从电子设备的角度,对本申请实施例提供的另一设备配对方法进行详细说明。请参阅图29,本实施例提供的设备配对方法包括:Hereinafter, another device pairing method provided by an embodiment of the present application will be described in detail from the perspective of an electronic device. Referring to FIG. 29, the device pairing method provided by this embodiment includes:
S2901、电子设备接收第一报点信号;S2901, the electronic device receives the first reporting signal;
当配件设备与电子设备接触时,配件设备的压感传感器检测到第一压感信息,并且,配件设备的信号发射电路可以与电子设备的屏幕建立第二信息通道,配件设备的信号检测电路可以与电子设备的屏幕建立第三信息通道。When the accessory device is in contact with the electronic device, the pressure sensor of the accessory device detects the first pressure-sensitive information, and the signal transmitting circuit of the accessory device can establish a second information channel with the screen of the electronic device, and the signal detection circuit of the accessory device can A third information channel is established with the screen of the electronic device.
此时,配件设备可以通过第二信息通道发送第一报点信号至电子设备,电子设备通过第三信息通道发送上行信号至配件设备。At this time, the accessory device can send the first point announcement signal to the electronic device through the second information channel, and the electronic device sends the uplink signal to the accessory device through the third information channel.
电子设备接收到第一报点信号之后,可以根据第一报点信号确定笔尖位置,进而渲染笔尖位置的笔迹效果或响应该笔尖位置对应的触控指令。After receiving the first report signal, the electronic device can determine the position of the pen tip according to the first report signal, and then render the handwriting effect at the position of the pen tip or respond to the touch command corresponding to the position of the pen tip.
配件设备接收到上行信号之后,可以对上行信号进行解析,得到电子设备的设备编号。After the accessory device receives the uplink signal, it can parse the uplink signal to obtain the device number of the electronic device.
S2902、电子设备判断在接收第一报点信号之前的第二预设时长内是否未接收过第二报点信号,若是,则执行S2905,若否,则执行S2903。S2902. The electronic device determines whether the second point notification signal has not been received within the second preset time period before receiving the first point notification signal, and if so, executes S2905, and if not, executes S2903.
电子设备在接收到第一报点信号之后,可以判断在接收到第一报点信号之前的第二预设时长内是否接收过其他报点信号,即第二报点信号。After receiving the first point notification signal, the electronic device may determine whether other point notification signals, that is, the second point notification signal, have been received within the second preset time period before receiving the first point notification signal.
如果电子设备在检测到第一报点信号之前的第二预设时长内曾经检测到第二报点信号,则电子设备将本次接收第一报点信号确定为非首次接收报点。此时,电子设备执行S2903。If the electronic device has detected the second point notification signal within the second preset time period before detecting the first point notification signal, the electronic device determines that the current reception of the first point notification signal is not the first notification point received. At this time, the electronic device executes S2903.
如果电子设备在检测到第一报点信号之前的第二预设时长内未曾检测到第二报点信号,则电子设备将本次接收第一报点信号确定为首次接收报点,并执行S2905。If the electronic equipment has not detected the second point notification signal within the second preset time period before detecting the first point notification signal, the electronic device determines that the first point notification signal received this time is the first notification point received, and executes S2905 .
S2903、电子设备接收携带有第一时间的第一咨询信息,之后执行S2904。S2903. The electronic device receives the first consultation information carrying the first time, and then executes S2904.
当电子设备在最近一次接收报点信号为非首次接收报点的情况下,如果被配件设备询问到,接收到了携带有第一时间的第一咨询信息,则表示发送第一咨询信息的配件设备并非是当前与电子设备接触的配件设备(以下简称接触设备),此时,电子设备执行S2904。When the electronic device receives the report signal for the first time and it is not the first time to receive the report, if it is queried by the accessory device and receives the first consultation information carrying the first time, it means that the accessory device that sent the first consultation information It is not the accessory device currently in contact with the electronic device (hereinafter referred to as the contact device), and at this time, the electronic device executes S2904.
S2904、电子设备发送配对失败信息至第一咨询信息的发送方。S2904, the electronic device sends the pairing failure information to the sender of the first consultation information.
当电子设备被接触设备以外的配件设备询问时,电子设备可以发送配对失败信息至第一咨询信息的发送方,以此告知该配件设备询问对象错误。When the electronic device is inquired by an accessory device other than the contact device, the electronic device may send pairing failure information to the sender of the first inquiry message, so as to inform the accessory device that the inquiring object is wrong.
S2905、电子设备记录第二时间,之后执行S2906。S2905, the electronic device records the second time, and then executes S2906.
当电子设备将接收第一报点信号确定为首次接收报点时,电子设备可以记录接收到第一报点信号的第二时间,以便后续执行校验操作。When the electronic device determines that the reception of the first alarm signal is the first time to receive the alarm, the electronic device may record the second time when the first alarm signal is received, so as to perform the verification operation subsequently.
S2906、电子设备接收携带有第一时间的第一咨询信息,之后执行S2907。S2906, the electronic device receives the first consultation information carrying the first time, and then executes S2907.
当电子设备在最近一次接收报点信号为首次接收报点的情况下,如果被配件设备询问到,则电子设备执行S2907。When the last time the electronic device receives an announcement signal is the first time an announcement is received, if it is queried by the accessory device, the electronic device executes S2907.
S2907、电子设备计算第二时间和第一时间的偏差值,判断偏差值是否小于预设偏差阈值,若是,则执行S2908,若否,则执行S2904。S2907 , the electronic device calculates the deviation value between the second time and the first time, and determines whether the deviation value is smaller than the preset deviation threshold value, and if so, executes S2908 , and if not, executes S2904 .
电子设备在最近一次接收报点信号为首次接收报点的情况下,如果接收到第一咨询信息,则可以对第一咨询信息执行校验操作,计算第二时间和第一时间的偏差值,判断偏差值是否小于预设偏差阈值。When the electronic device receives the report signal for the first time for the first time, if it receives the first consultation information, it can perform a verification operation on the first consultation information, and calculate the deviation value between the second time and the first time, Determine whether the deviation value is less than the preset deviation threshold.
如果偏差值小于预设偏差阈值,则表示发送该第一咨询信息的配件设备为接触设备,此时,电子设备执行S2908。If the deviation value is smaller than the preset deviation threshold value, it means that the accessory device sending the first consultation information is a contact device, and at this time, the electronic device executes S2908.
如果偏差值大于或等于预设偏差阈值,则表示发送该第一咨询信息的配件设备并非是接触设备,此时,电子设备执行S2904,发送配对失败信息至第一咨询信息的发送方。If the deviation value is greater than or equal to the preset deviation threshold, it means that the accessory device sending the first consultation information is not a contact device, and at this time, the electronic device executes S2904 and sends pairing failure information to the sender of the first consultation information.
S2908、电子设备发送配对确认信息至第一咨询信息的发送方。S2908, the electronic device sends the pairing confirmation information to the sender of the first consultation information.
如果偏差值小于预设偏差阈值,则电子设备可以发送配对确认信息至上述第一咨询信息的发送方。If the deviation value is less than the preset deviation threshold value, the electronic device may send pairing confirmation information to the sender of the first consultation information.
上述第一咨询信息的发送方接收到配对确认信息后,将电子设备确认为配对设备,此时,上述第一咨询信息的发送方可能会回复配对指示信息至电子设备。After receiving the pairing confirmation information, the sender of the first consultation information confirms the electronic device as a paired device. At this time, the sender of the first consultation information may reply pairing instruction information to the electronic device.
电子设备接收配对指示信息,完成与该第一咨询信息的发送方的配对。The electronic device receives the pairing instruction information, and completes the pairing with the sender of the first consultation information.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
以下,将从配件设备的角度,对本申请实施例提供的另一设备配对方法进行详细说明。请参阅图30,本实施例提供的设备配对方法包括:Hereinafter, another device pairing method provided by an embodiment of the present application will be described in detail from the perspective of an accessory device. Referring to FIG. 30 , the device pairing method provided by this embodiment includes:
S3001、配件设备通过第一通信连接接收第一信号,第一信号包括目标设备编号,第一通信连接为当前与配件设备接触的电子设备和配件设备之间建立的通信连接;S3001, the accessory device receives a first signal through a first communication connection, the first signal includes a target device number, and the first communication connection is a communication connection established between the electronic device currently in contact with the accessory device and the accessory device;
S3002、配件设备将目标设备编号与第一设备编号进行匹配,将与目标设备编号一致的第一设备编号对应的电子设备确定为目标设备,第一设备编号为与配件设备建立了无线连接的电子设备的设备编号;S3002. The accessory device matches the target device number with the first device number, and determines the electronic device corresponding to the first device number that is consistent with the target device number as the target device, and the first device number is the electronic device that has established a wireless connection with the accessory device. the device number of the device;
S3003、配件设备对目标设备配对。S3003, the accessory device is paired with the target device.
在本实施例提供的设备配对方法中,配件设备通过第一通信连接获取第一信号,第一信号包括目标设备编号。然后,配件设备将目标设备编号与各个第一设备编号进行匹配,从而确定目标设备编号对应的目标设备。在确定了目标设备之后,配件设备与目标设备配对。In the device pairing method provided in this embodiment, the accessory device acquires the first signal through the first communication connection, and the first signal includes the target device number. Then, the accessory device matches the target device number with each first device number, so as to determine the target device corresponding to the target device number. After the target device is determined, the accessory device is paired with the target device.
通过上述设备配对方法,配件设备可以自动识别目标设备并进行配对,无需用户主动执行特定的配对操作,提高了配件设备切换使用对象的流畅性,具有较强的易用性和实用性,提高了用户的使用体验。Through the above device pairing method, the accessory device can automatically identify the target device and pair it, without the need for the user to actively perform a specific pairing operation. User experience.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/电子设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/电子设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/electronic device and method may be implemented in other manners. For example, the above-described embodiments of the apparatus/electronic device are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读存储介质不包括电载波信号和电信信号。The integrated modules/units, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the present application can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer When the program is executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) ), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer-readable Storage media exclude electrical carrier signals and telecommunications signals.
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。Finally, it should be noted that: the above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this, and any changes or replacements within the technical scope disclosed in the present application should be covered by the present application. within the scope of protection of the application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (13)

  1. 一种设备配对方法,其特征在于,应用于配件设备,所述方法包括:A device pairing method, characterized in that, applied to accessory devices, the method comprising:
    所述配件设备通过第一通信连接接收第一信号,所述第一信号包括目标设备编号,所述第一通信连接为当前与所述配件设备接触的电子设备和所述配件设备之间建立的通信连接;The accessory device receives a first signal through a first communication connection, the first signal includes a target device number, and the first communication connection is established between the electronic device currently in contact with the accessory device and the accessory device. communication connection;
    所述配件设备将所述目标设备编号与第一设备编号进行匹配,将与所述目标设备编号一致的第一设备编号对应的电子设备确定为目标设备,所述第一设备编号为与所述配件设备建立了无线连接的电子设备的设备编号;The accessory device matches the target device number with the first device number, and determines the electronic device corresponding to the first device number that is consistent with the target device number as the target device, and the first device number is the same as the target device number. The device number of the electronic device to which the accessory device has established a wireless connection;
    所述配件设备对所述目标设备配对。The accessory device is paired with the target device.
  2. 如权利要求1所述的设备配对方法,其特征在于,所述配件设备将所述目标设备编号与第一设备编号进行匹配,包括:The device pairing method according to claim 1, wherein the accessory device matches the target device number with the first device number, comprising:
    若所述配件设备检测到压力传感器采集到第一压感信息,且所述配件设备在检测到所述第一压感信息之前的预设时长内未检测到第二压感信息,则所述配件设备将所述目标设备编号与第一设备编号进行匹配。If the accessory device detects that the pressure sensor has collected the first pressure-sensing information, and the accessory device does not detect the second pressure-sensing information within a preset period of time before detecting the first pressure-sensing information, the accessory device will The accessory device matches the target device number with the first device number.
  3. 如权利要求2所述的设备配对方法,其特征在于,还包括:The device pairing method according to claim 2, further comprising:
    若所述配件设备检测到压力传感器采集到第一压感信息,且所述配件设备在检测到所述第一压感信息之前的预设时长内检测到第二压感信息,则所述配件设备将默认设备确定为所述目标设备,所述默认设备为当前与所述配件设备配对的电子设备。If the accessory device detects that the pressure sensor has collected the first pressure-sensing information, and the accessory device detects the second pressure-sensing information within a preset time period before detecting the first pressure-sensing information, the accessory device The device determines a default device as the target device, where the default device is an electronic device currently paired with the accessory device.
  4. 如权利要求1所述的设备配对方法,其特征在于,所述将与所述目标设备编号一致的第一设备编号对应的电子设备确定为目标设备,包括:The device pairing method according to claim 1, wherein determining the electronic device corresponding to the first device number that is consistent with the target device number as the target device comprises:
    若匹配设备的数量为1且所述匹配设备为默认设备,则所述配件设备将所述默认设备确定为目标设备,所述匹配设备为与所述目标设备编号一致的第一设备编号对应的电子设备,所述默认设备为当前与所述配件设备配对的电子设备。If the number of matching devices is 1 and the matching device is the default device, the accessory device determines the default device as the target device, and the matching device is the first device number corresponding to the target device number. An electronic device, where the default device is the electronic device currently paired with the accessory device.
  5. 如权利要求1所述的设备配对方法,其特征在于,所述将与所述目标设备编号一致的第一设备编号对应的电子设备确定为目标设备,还包括:The device pairing method according to claim 1, wherein determining the electronic device corresponding to the first device number that is consistent with the target device number as the target device further comprises:
    若匹配设备的数量大于1或所述目标设备编号与默认设备的设备编号不一致,则所述配件设备通过所述无线连接将第一咨询信息发送至各个所述匹配设备,所述匹配设备为与所述目标设备编号一致的第一设备编号对应的电子设备,所述默认设备为当前与所述配件设备配对的电子设备;If the number of matching devices is greater than 1 or the target device number is inconsistent with the device number of the default device, the accessory device sends the first consultation information to each of the matching devices through the wireless connection, and the matching device is the same as the default device. the electronic device corresponding to the first device number with the same target device number, and the default device is the electronic device currently paired with the accessory device;
    当所述配件设备接收到配对确认信息时,所述配件设备将发送所述配对确认信息的匹配设备确定为目标设备,其中,所述配对确认信息为所述目标设备在接收到所述第一咨询信息后反馈的信息。When the accessory device receives the pairing confirmation information, the accessory device determines the matching device that sent the pairing confirmation information as the target device, wherein the pairing confirmation information is that the target device receives the first Feedback information after consultation.
  6. 如权利要求5所述的设备配对方法,其特征在于,所述配件设备通过所述无线连接将第一咨询信息发送至各个所述匹配设备,包括:The device pairing method according to claim 5, wherein the accessory device sends the first consultation information to each of the matching devices through the wireless connection, comprising:
    所述配件设备根据第一预设规则确定各个匹配设备的轮询顺序;The accessory device determines the polling sequence of each matching device according to the first preset rule;
    所述配件设备根据所述轮询顺序,通过所述无线连接将第一咨询信息依次发送至各个所述匹配设备。The accessory device sequentially sends the first consultation information to each of the matching devices through the wireless connection according to the polling sequence.
  7. 如权利要求1所述的设备配对方法,其特征在于,在所述配件设备将所述目标设备编号与第一设备编号进行匹配之后,还包括:The device pairing method according to claim 1, wherein after the accessory device matches the target device number with the first device number, the method further comprises:
    若配对失败,则所述配件设备执行预设提示操作。If the pairing fails, the accessory device performs a preset prompt operation.
  8. 如权利要求1所述的设备配对方法,其特征在于,在所述配件设备通过第一通信连接接收第一信号之前,还包括:The device pairing method according to claim 1, wherein before the accessory device receives the first signal through the first communication connection, the method further comprises:
    所述配件设备通过所述无线连接接收各个电子设备发送的设备编号并存储。The accessory device receives and stores the device number sent by each electronic device through the wireless connection.
  9. 如权利要求1所述的设备配对方法,其特征在于,所述无线连接为蓝牙连接;The device pairing method according to claim 1, wherein the wireless connection is a Bluetooth connection;
    所述配件设备对所述目标设备配对,包括:The accessory device is paired with the target device, including:
    所述配件设备与所述目标设备根据基于通用属性的人机接口设备交互协议HoGP建立HoGP连接通道。The accessory device and the target device establish a HoGP connection channel according to the universal attribute-based human-machine interface device interaction protocol HoGP.
  10. 一种设备配对系统,其特征在于,所述系统包括至少一个配件设备以及至少一个电子设备;A device pairing system, characterized in that the system includes at least one accessory device and at least one electronic device;
    当所述配件设备与所述电子设备接触时,所述配件设备用于执行如权利要求1至9中任一项所述方法的步骤。The accessory device is adapted to perform the steps of the method of any one of claims 1 to 9 when the accessory device is in contact with the electronic device.
  11. 一种配件设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至9任一项所述的方法。An accessory device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, the processor according to claim 1 to 9 The method of any one.
  12. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9任一项所述的方法。A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
  13. 一种芯片系统,其特征在于,所述芯片系统包括存储器和处理器,所述处理器执行所述存储器中存储的计算机程序,以实现如权利要求1至9任一项所述的方法。A chip system, characterized in that the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the method according to any one of claims 1 to 9.
PCT/CN2021/107443 2020-07-27 2021-07-20 Device pairing method and system, and accessory device and computer-readable storage medium WO2022022342A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010731578.XA CN113993109B (en) 2020-07-27 Device pairing method, system, accessory device and computer readable storage medium
CN202010731578.X 2020-07-27

Publications (1)

Publication Number Publication Date
WO2022022342A1 true WO2022022342A1 (en) 2022-02-03

Family

ID=79731438

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/107443 WO2022022342A1 (en) 2020-07-27 2021-07-20 Device pairing method and system, and accessory device and computer-readable storage medium

Country Status (1)

Country Link
WO (1) WO2022022342A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114217701A (en) * 2022-02-22 2022-03-22 荣耀终端有限公司 Electronic equipment connection method and electronic equipment
CN116931746A (en) * 2022-04-06 2023-10-24 荣耀终端有限公司 Fitting detection system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150363012A1 (en) * 2014-06-12 2015-12-17 Amazon Technologies, Inc. Configurable active stylus devices
WO2016137693A1 (en) * 2015-02-27 2016-09-01 Microsoft Technology Licensing, Llc Control apparatus
US20180089470A1 (en) * 2016-09-27 2018-03-29 International Business Machines Corporation Authentication of a smart pen and computing device
US20190121453A1 (en) * 2017-10-19 2019-04-25 Microsoft Technology Licensing, Llc Active stylus pairing with a digitizer
US20200019255A1 (en) * 2018-07-10 2020-01-16 Microsoft Technology Licensing, Llc Coupling a pen device to a companion device based on pen proximity

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150363012A1 (en) * 2014-06-12 2015-12-17 Amazon Technologies, Inc. Configurable active stylus devices
WO2016137693A1 (en) * 2015-02-27 2016-09-01 Microsoft Technology Licensing, Llc Control apparatus
US20180089470A1 (en) * 2016-09-27 2018-03-29 International Business Machines Corporation Authentication of a smart pen and computing device
US20190121453A1 (en) * 2017-10-19 2019-04-25 Microsoft Technology Licensing, Llc Active stylus pairing with a digitizer
US20200019255A1 (en) * 2018-07-10 2020-01-16 Microsoft Technology Licensing, Llc Coupling a pen device to a companion device based on pen proximity

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114217701A (en) * 2022-02-22 2022-03-22 荣耀终端有限公司 Electronic equipment connection method and electronic equipment
CN116931746A (en) * 2022-04-06 2023-10-24 荣耀终端有限公司 Fitting detection system

Also Published As

Publication number Publication date
CN113993109A (en) 2022-01-28

Similar Documents

Publication Publication Date Title
EP4024193A1 (en) Data transmission method and related devices
WO2022022342A1 (en) Device pairing method and system, and accessory device and computer-readable storage medium
US10956280B2 (en) Data backup method, electronic device, and storage medium
US20160147293A1 (en) Device and method for controlling a plurality of input/output devices
KR102488374B1 (en) Electronic device and accessory apparatus and information display method using the same
CN108039963B (en) Container configuration method and device and storage medium
AU2018456082B2 (en) Stylus detection method, system, and related device
JP2015536009A (en) Virtual keyboard display method, apparatus, terminal, program, and recording medium
US11042186B2 (en) Electronic device and control method thereof for changing user interface when device is under water
WO2021057571A1 (en) Biometric recognition method and electronic device
CN114827972B (en) Method for establishing connection with stylus pen and electronic equipment
CN115033313A (en) Terminal application control method, terminal equipment and chip system
KR102499131B1 (en) Electronic device and method for receiving radio signal in electronic device
US11009910B2 (en) Display method and electronic device
CN113993109B (en) Device pairing method, system, accessory device and computer readable storage medium
CN115113747B (en) Touch pen using method and system and touch pen
KR20210050398A (en) Electronic device for trnasmitting data to external electronic device not connected to the electronic device and method for the same
WO2022161024A1 (en) Upgrade prompt method, terminal device, and computer readable storage medium
CN114143906B (en) Electronic equipment connection method and electronic equipment
CN114339591B (en) Method and related device for positioning based on ultra-wideband chip
WO2021197242A1 (en) Copying and pasting method, electronic device and system
WO2022022387A1 (en) Method, apparatus, and system for controlling information input devices on terminal
WO2023020022A1 (en) Stylus connection method and electronic device
EP4310672A1 (en) Application keep-alive method, electronic device and a storage medium
CN116708647B (en) Notification message reply method and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21849026

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21849026

Country of ref document: EP

Kind code of ref document: A1