WO2023221880A1 - 通信方法、系统及相关设备 - Google Patents

通信方法、系统及相关设备 Download PDF

Info

Publication number
WO2023221880A1
WO2023221880A1 PCT/CN2023/093746 CN2023093746W WO2023221880A1 WO 2023221880 A1 WO2023221880 A1 WO 2023221880A1 CN 2023093746 W CN2023093746 W CN 2023093746W WO 2023221880 A1 WO2023221880 A1 WO 2023221880A1
Authority
WO
WIPO (PCT)
Prior art keywords
accessory device
bluetooth
event
accessory
host device
Prior art date
Application number
PCT/CN2023/093746
Other languages
English (en)
French (fr)
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
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023221880A1 publication Critical patent/WO2023221880A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections

Definitions

  • the present application relates to the field of communication technology, and in particular, to a communication method, system and related equipment.
  • accessory devices such as Bluetooth mice, Bluetooth keyboards, stylus pens, Bluetooth speakers and other Bluetooth accessory devices
  • host devices such as tablets, personal computers, etc.
  • communication connections such as Bluetooth communication connections
  • Embodiments of the present application provide a communication method, system and related equipment, which can enable multiple accessory devices to collaborate to implement differentiated functions in corresponding scenarios, simplify user operations, and improve user experience.
  • inventions of the present application provide a communication method applied to a communication system.
  • the communication system includes a first host device, a first accessory device, and a second accessory device.
  • the method includes: the first accessory device and the first accessory device.
  • the host device establishes a first communication connection;
  • the second accessory device establishes a second communication connection with the first host device;
  • the first accessory device detects that the user triggers a first event, and in response to the first event, the first accessory device establishes a second communication connection based on the first communication connection
  • the first host device sends the information about the first event to the second accessory device based on the second communication connection;
  • the second accessory device receives the first host The device sends the information of the first event and performs a response operation based on the information of the first event.
  • the first data also includes device information of one or more accessory devices, the device information of one or more accessory devices includes device information of a second accessory device, and the device information of the second accessory device The information is used by the first host device to determine to send the information of the first event to the second accessory device.
  • the first host device can determine to send the information of the first event to the second accessory device according to the device information of the second accessory device.
  • the communication system further includes a second host device
  • the first event is an event that switches the focus host device from the first host device to the second host device
  • the information of the first event includes the second host device.
  • the second accessory device Based on the device information of the device, the second accessory device performs a response operation based on the information of the first event, which specifically includes: the second accessory device sends a first connection broadcast message based on the device information of the second host device; when the second host device receives the first In the case of a continuous broadcast message, the second accessory device switches the focus host device from the first host device to the second host device, and the second accessory device communicates with the second host device.
  • the two host devices establish a third communication connection.
  • the user can switch the focus host device of all accessory devices from the first host device to the second host device with one click, which is convenient and fast.
  • the first accessory device is a keyboard
  • the second accessory device is a mouse
  • the first event is an event of pressing a button for adjusting dots per inch DPI
  • the information of the first event includes the button for adjusting DPI.
  • the second accessory device performs a response operation based on the information of the first event, which specifically includes: the second accessory device adjusts the DPI of the second accessory device based on the key value of the DPI adjustment button.
  • the keys for adjusting DPI include DPI keys, or combination keys for increasing DPI, or combination keys for decreasing DPI
  • the second accessory device adjusts the second accessory based on the key value of the key for adjusting DPI.
  • the DPI of the device specifically includes: when the button to adjust DPI is a DPI button, the second accessory device increases or decreases the DPI of the second accessory device based on the key value of the DPI button; or, when the button to adjust DPI is to increase DPI
  • the second accessory device increases the DPI of the second accessory device based on the key value of the combination key to increase DPI; or, in the case where the key to adjust the DPI is a combination key to decrease DPI, the second accessory device The DPI of the second accessory device is reduced based on the key value of the reduced DPI key combination.
  • the user can increase or decrease the DPI of the mouse through the DPI keys on the keyboard, or a combination of DPI keys.
  • the first accessory device is a keyboard
  • the second accessory device is a mouse
  • the first event is an event of pressing a button that adjusts the lighting effect
  • the information of the first event includes the information of the button that adjusts the lighting effect.
  • the second accessory device performs a response operation based on the information of the first event, specifically including: the second accessory device adjusts the lighting effect of the second accessory device based on the key value of the key for adjusting the lighting effect.
  • the user can adjust the lighting effect of the mouse (such as the brightness and mode of the lighting effect, etc.) through the keyboard.
  • the lighting effect of the mouse such as the brightness and mode of the lighting effect, etc.
  • the buttons for adjusting the light effect include a LightUp button to increase the brightness, a LightDown button to decrease the brightness, or a combination button to increase the brightness, or a combination button to decrease the brightness.
  • the second accessory device is based on adjusting the light.
  • the second accessory device adjusts the lighting effect of the second accessory device based on the key value of the effective button, which specifically includes: when the button for adjusting the lighting effect is a LightUp button or a combination button that increases brightness, the second accessory device adjusts the lighting effect based on the key value of the LightUp button or increases the brightness.
  • the key value of the combined button increases the brightness of the light effect of the second accessory device; or, when the button for adjusting the light effect is a LightDown button or a combination button that reduces the brightness, the second accessory device based on the key value of the LightDown button or decreases The key value of the brightness key combination reduces the brightness of the lighting effect of the second accessory device.
  • the user can adjust the brightness of the mouse's lighting effect through the lighting effect adjustment buttons on the keyboard.
  • the button for adjusting the lighting effect includes a single button or a combination of buttons for switching the mode of the lighting effect
  • the second accessory device adjusts the lighting effect of the second accessory device based on the key value of the button for adjusting the lighting effect. Specifically, It includes: the second accessory device switches the mode of the lighting effect of the second accessory device based on the key value of a single key or a combination of keys in the mode of switching the lighting effect.
  • the user can adjust the lighting effect mode of the mouse through the lighting effect adjustment buttons on the keyboard.
  • the first accessory device is a mouse
  • the second accessory device is a keyboard
  • the first event is an event when the user presses the first button
  • the second accessory device performs a response operation based on the information of the first event
  • the second accessory device converts the event that the user presses the first button and the event that the user presses the second button into the event that the user presses the third button, wherein the event that the user presses the second button is the second accessory
  • the device detects the first event after receiving the information of the first event sent by the first host device; the second accessory device sends the key value of the third button to the first host device; the first host device responds to the function corresponding to the key value of the third button .
  • the method further includes: the first accessory device detects a second event, and the second event is when the user releases the third button.
  • a key event in response to the second event, the first accessory device sends second data to the first host device based on the first communication connection, and the second data includes information about the second event; the first host device uses the second communication connection Send the information of the second event to the second accessory device; the second accessory device receives the information of the second event sent by the first host device, and determines that the user releases the first button based on the information of the second event.
  • the device information of the second accessory device includes the device type of the second accessory device.
  • the method further includes: the second accessory device sends a request to the first accessory device.
  • a host device sends a first message, the first message includes the device type of the second accessory device; the first host device saves the mapping relationship between the second communication connection and the device type of the second accessory device; in the first host device based on Before the second communication connection sends the information of the first event to the second accessory device, the method further includes: the first host device based on the device type of the second accessory device, the second communication connection and the device type of the second accessory device.
  • the mapping relationship determines sending the information of the first event to the second accessory device through the second communication connection.
  • the accessory device can perform device registration with the host device, so that the host device saves the mapping relationship between the communication connection and the device type of the accessory device.
  • the method further includes: the second accessory device sends a second message to the first accessory device through the first host device, and the second accessory device sends a second message to the first accessory device through the first host device.
  • the second message is used to notify the first accessory device of the result of the response operation performed by the second accessory device.
  • the second accessory device can notify the first accessory device of the result of the response operation performed by the second accessory device through the first host device.
  • both the first communication connection and the second communication connection are Bluetooth communication connections.
  • the first host device may be the host device 100
  • the second host device may be the host device 200
  • the first accessory device and the second accessory device may respectively establish a first communication connection (such as Bluetooth) with the first host device. communication connection)
  • the second communication connection such as Bluetooth communication connection
  • the first event can be a user-triggered event (such as a switching event, an event to adjust DPI, an event to adjust lighting effects, an event to press a certain button)
  • the second One data may be data including information of the first event and device information of one or more accessory devices (for example, data 1 in FIG. 9 , data 2 in FIG. 11 , data 3 in FIG. 12 , data in FIG.
  • the first connection broadcast message can be the Bluetooth broadcast message 2 sent by the Bluetooth accessory device 400 in Figure 9
  • the third communication connection can be the Bluetooth communication connection 2 established between the Bluetooth accessory device 400 and the host device 200
  • the first button can be
  • the second button can be button 2 in Figure 13
  • the third button can be combination key 1 in Figure 13
  • the second data can be data 5 in Figure 13
  • the first message can be the The second accessory device sends a registration request to the first host device, and the second message may be the event processing completion message in Figure 8 .
  • embodiments of the present application provide a communication method, applied to a first accessory device.
  • the method includes: the first accessory device detects that a user triggers a first event; in response to the first event, the first accessory device passes a A host device sends first data to a second accessory device, where the first data includes information about the first event; where the information about the first event is used for the second accessory device to perform a response operation based on the information about the first event, and the first accessory The device establishes a first communication connection with the first host device, and the second accessory device establishes a second communication connection with the first host device.
  • the first data also includes device information of one or more accessory devices
  • the device information of one or more accessory devices includes device information of a second accessory device
  • the device information of the second accessory device Information is used for the A host device determines to send the information of the first event to the second accessory device.
  • the first event is an event that switches the focus host device from the first host device to the second host device, and the information of the first event is used by the second accessory device based on the information of the first event.
  • the focus host device switches from the first host device to the second host device, and the second accessory device establishes a third communication connection with the second host device.
  • the first accessory device is a keyboard
  • the second accessory device is a mouse
  • the first event is an event of pressing a button that adjusts dots per inch DPI
  • the information of the first event is used for the second accessory device Adjusting the DPI of the second accessory device based on information from the first event.
  • the keys for adjusting the DPI include a DPI key, or a combination key for increasing the DPI, or a combination key for decreasing the DPI.
  • the key for adjusting the DPI is a DPI key
  • the first event The information is used by the second accessory device to increase or decrease the DPI of the second accessory device based on the information of the first event; or, in the case where the key to adjust the DPI is a combination key to increase the DPI, the information of the first event is used for the second accessory device.
  • the accessory device increases the DPI of the second accessory device based on the information of the first event; or, in the case where the key to adjust the DPI is a combination key to decrease the DPI, the information of the first event is used for the second accessory device to increase the DPI of the second accessory device based on the first event. Message to reduce the DPI of the second accessory device.
  • the first accessory device is a keyboard
  • the second accessory device is a mouse
  • the first event is an event of pressing a button for adjusting the lighting effect
  • the information of the first event is used by the second accessory device based on the first The information of one event adjusts the lighting effect of the second accessory device.
  • the keys for adjusting the light effect include a LightUp key for increasing the brightness, a LightDown key for decreasing the brightness, or a combination key for increasing the brightness, or a combination key for reducing the brightness.
  • the key for adjusting the light effect is In the case of the LightUp button or a combination button that increases brightness, the information of the first event is used by the second accessory device to increase the brightness of the lighting effect of the second accessory device based on the information of the first event; or, when the button to adjust the lighting effect is LightDown In the case of pressing a button or a combination button that reduces the brightness, the information of the first event is used by the second accessory device to reduce the brightness of the lighting effect of the second accessory device based on the information of the first event.
  • the first accessory device is a mouse
  • the second accessory device is a keyboard
  • the first event is an event when the user presses the first button
  • the information of the first event is used by the second accessory device to press the user's button.
  • the event of pressing the first button and the event of the user pressing the second button are converted into the event of the user pressing the third button, wherein the event of the user pressing the second button is when the second accessory device receives the third message sent by the first host device. Information about an event is detected later.
  • the method further includes: the first accessory device detects the second event, and the second event It is an event that the user releases the first button.
  • the first accessory device sends information of the second event to the second accessory device through the first host device.
  • the information of the second event is included in the second data.
  • the information of the second event is used by the second accessory device to determine that the user releases the first button based on the information of the second event.
  • the device information of the second accessory device includes the device type of the second accessory device.
  • the method further includes: the first accessory device sends a request to the first accessory device.
  • a host device sends a first message, the first message includes the device type of the first accessory device, and the first message is used for the first host device to save the relationship between the first communication connection and the device type of the first accessory device based on the first message. Mapping relations.
  • the first host device may be the host device 100
  • the second host device may be the host device 200
  • the first accessory device and the second accessory device may respectively establish a first communication connection (such as Bluetooth) with the first host device. communication connection)
  • the second communication connection such as Bluetooth communication connection
  • the first event can be a user-triggered event (such as a switching event, an event to adjust DPI, an event to adjust lighting effects, an event to press a certain button)
  • the second One data may be data including information of the first event and device information of one or more accessory devices (for example, data 1 in FIG. 9, data 2 in FIG. 11, data 2 in FIG.
  • the third communication connection can be the Bluetooth communication connection 2 established between the Bluetooth accessory device 400 and the host device 200
  • the first button can be button 1 in Figure 13
  • the second button It can be button 2 in Figure 13
  • the third button can be combination key 1 in Figure 13
  • the second data can be data 5 in Figure 13
  • the first message can be sent by the first accessory device to the first host device. Registration request.
  • embodiments of the present application provide a communication method applied to a second accessory device.
  • the method includes: the second accessory device establishes a first communication connection with the first host device; the second accessory device establishes a first communication connection based on the first communication connection.
  • the information about the first event may be included in the first data.
  • the information about the first event is based on the second communication connection after the first accessory device detects that the user triggers the first event.
  • the second communication connection may be established between the first accessory device and the first host device; the second accessory device performs a response operation based on the information of the first event.
  • the first data also includes device information of one or more accessory devices, the device information of one or more accessory devices includes device information of a second accessory device, and the device information of the second accessory device The information is used by the first host device to determine to send the information of the first event to the second accessory device.
  • the first event is an event that switches the focus host device from the first host device to the second host device.
  • the information of the first event includes device information of the second host device, and the second accessory device Performing a response operation based on the information of the first event specifically includes: the second accessory device sends a first connection broadcast message based on the device information of the second host device; when the second host device receives the first connection broadcast message, The second accessory device switches the focus host device from the first host device to the second host device, and the second accessory device establishes a third communication connection with the second host device.
  • the first accessory device is a keyboard
  • the second accessory device is a mouse
  • the first event is an event of pressing a button for adjusting dots per inch DPI
  • the information of the first event includes the button for adjusting DPI.
  • the second accessory device performs a response operation based on the information of the first event, which specifically includes: the second accessory device adjusts the DPI of the second accessory device based on the key value of the DPI adjustment button.
  • the keys for adjusting DPI include DPI keys, or combination keys for increasing DPI, or combination keys for decreasing DPI
  • the second accessory device adjusts the second accessory based on the key value of the key for adjusting DPI.
  • the DPI of the device specifically includes: when the button to adjust DPI is a DPI button, the second accessory device increases or decreases the DPI of the second accessory device based on the key value of the DPI button; or, when the button to adjust DPI is to increase DPI
  • the second accessory device increases the DPI of the second accessory device based on the key value of the combination key to increase DPI; or, in the case where the key to adjust the DPI is a combination key to decrease DPI, the second accessory device The DPI of the second accessory device is reduced based on the key value of the reduced DPI key combination.
  • the first accessory device is a keyboard
  • the second accessory device is a mouse
  • the first event is an event of pressing a button that adjusts the lighting effect
  • the information of the first event includes the information of the button that adjusts the lighting effect.
  • the second accessory device performs a response operation based on the information of the first event, specifically including: the second accessory device adjusts the lighting effect of the second accessory device based on the key value of the key for adjusting the lighting effect.
  • the buttons for adjusting the light effect include a LightUp button to increase the brightness, a LightDown button to decrease the brightness, or a combination button to increase the brightness, or a combination button to decrease the brightness.
  • the second accessory device is based on adjusting the light.
  • the second accessory device adjusts the lighting effect of the second accessory device based on the key value of the effective button, which specifically includes: when the button for adjusting the lighting effect is a LightUp button or a combination button that increases brightness, the second accessory device adjusts the lighting effect based on the key value of the LightUp button or increases the brightness.
  • the key value of the combined button increases the brightness of the light effect of the second accessory device; or, when the button for adjusting the light effect is a LightDown button or a combination button that reduces the brightness, the second accessory device based on the key value of the LightDown button or decreases The key value of the brightness key combination reduces the brightness of the lighting effect of the second accessory device.
  • the first accessory device is a mouse
  • the second accessory device is a keyboard
  • the first event is an event when the user presses the first button
  • the second accessory device performs a response operation based on the information of the first event
  • the second accessory device converts the event that the user presses the first button and the event that the user presses the second button into the event that the user presses the third button, wherein the event that the user presses the second button is the second accessory
  • the device detects the information after receiving the information of the first event sent by the first host device; the second accessory device sends the key value of the third button to the first host device, and the key value of the third button is used by the first host device based on the first
  • the key values of the three keys respond to the function corresponding to the key value of the third key.
  • the method further includes: the second accessory device receives the third key value sent by the first host device based on the first communication connection.
  • the information of the second event is included in the second data.
  • the second event is the event when the user releases the first button.
  • the second data is the first accessory device sending a message to the first host device after detecting the second event. Sent; the second accessory device determines that the user releases the first button based on the information of the second event.
  • the device information of the second accessory device includes a device type of the second accessory device
  • the method further The method includes: the second accessory device sends a first message to the first host device, the first message includes the device type of the second accessory device, and the first message is used by the first host device to save the first communication connection and the second connection based on the first message. Mapping relationship between device types of accessory devices.
  • the method further includes: the second accessory device sends a second message to the first accessory device through the first host device, and the second accessory device sends a second message to the first accessory device through the first host device.
  • the second message is used to notify the first accessory device of the result of the response operation performed by the second accessory device.
  • the first host device may be the host device 100
  • the second host device may be the host device 200
  • the first accessory device and the second accessory device may respectively establish a second communication connection (such as Bluetooth) with the first host device.
  • communication connection such as a Bluetooth communication connection
  • the first event can be a user-triggered event (such as a switching event, an event to adjust DPI, an event to adjust lighting effects, an event to press a certain button)
  • the first One data may be data including information of the first event and device information of one or more accessory devices (for example, data 1 in FIG. 9 , data 2 in FIG. 11 , data 3 in FIG. 12 , data in FIG.
  • the first connection broadcast message can be the Bluetooth broadcast message 2 sent by the Bluetooth accessory device 400 in Figure 9
  • the third communication connection can be the Bluetooth communication connection 2 established between the Bluetooth accessory device 400 and the host device 200
  • the first button can be
  • the second button can be button 2 in Figure 13
  • the third button can be combination key 1 in Figure 13
  • the second data can be data 5 in Figure 13
  • the first message can be the The second accessory device sends a registration request to the first host device, and the second message may be the event processing completion message in Figure 8 .
  • embodiments of the present application provide a communication method, applied to a first host device.
  • the method includes: the first host device establishes a first communication connection with a first accessory device; the first host device establishes a first communication connection with a second accessory device; Establish a second communication connection; the first host device receives first data sent by the first accessory device based on the first communication connection, the first data includes information about the first event, and the first data is when the first accessory device detects a user trigger Sent after the first event; the first host device sends the information of the first event to the second accessory device based on the second communication connection, and the information of the first event is used by the second accessory device to perform a response operation based on the information of the first event.
  • the first data also includes device information of one or more accessory devices, the device information of one or more accessory devices includes device information of a second accessory device, and the device information of the second accessory device The information is used by the first host device to determine to send the information of the first event to the second accessory device.
  • the device information of the second accessory device includes the device type of the second accessory device.
  • the method further includes: the first host device receives a first message sent by the second accessory device, and the first message includes the second accessory device.
  • the method further includes: the first host device determining, based on a mapping relationship between the device type of the second accessory device, the second communication connection and the device type of the second accessory device, to send the first event to the second accessory device through the second communication connection. Information.
  • the first host device may be the host device 100
  • the second host device may be the host device 200
  • the first accessory device and the second accessory device may respectively establish a first communication connection (such as Bluetooth) with the first host device.
  • communication connection such as Bluetooth
  • the second communication connection such as Bluetooth communication connection
  • the first event can be a user-triggered event (such as a switching event, an event to adjust DPI, an event to adjust lighting effects, an event to press a certain button)
  • the second One data may be data including information of the first event and device information of one or more accessory devices (for example, data 1 in FIG. 9 , data 2 in FIG. 11 , data 3 in FIG. 12 , data in FIG. 13 4), the first message may be a registration request sent by the second accessory device to the first host device.
  • inventions of the present application provide a communication method applied to a communication system.
  • the communication system includes a first host device, a second host device, a first accessory device, a second accessory device, and the second accessory device and the third accessory device. Both a host device and a second host device have established a Bluetooth communication connection.
  • the method includes: the first accessory device establishes a first Bluetooth communication connection with the first host device; the first host device establishes a first Bluetooth communication connection with the first accessory device based on the first Bluetooth communication connection.
  • Send a first message the first message is used to instruct the first accessory device to send a pairing broadcast message; the first accessory device sends a pairing broadcast message after receiving the first message; the first host device sends a second message to the second accessory device,
  • the second message includes the Bluetooth media access control MAC address of the first accessory device.
  • the second message is used to instruct the second accessory device to send the Bluetooth MAC address of the first accessory device to one or more host devices.
  • One or more host devices including a second host device; the second accessory device sends the Bluetooth MAC address of the first accessory device to the second host device; the second host device receives the pairing broadcast message and the Bluetooth MAC address of the first accessory device, and based on the pairing broadcast message and the first accessory device
  • the Bluetooth MAC address of an accessory device performs Bluetooth pairing with the first accessory device and establishes a second Bluetooth communication connection.
  • the first host device may be the host device 100
  • the second host device may be the host device 200
  • the first accessory device may be the Bluetooth accessory device 300 in Figure 16
  • the second accessory device may be the Bluetooth accessory device 300 in Figure 16
  • the first Bluetooth communication connection can be Bluetooth communication connection 2 in Figure 16
  • the first message can be message 1 in Figure 16
  • the second message can be message 2 in Figure 16
  • the second Bluetooth communication The connection may be Bluetooth communication connection 2' in Figure 16.
  • embodiments of the present application provide a communication method applied to a first accessory device.
  • the method includes: the first accessory device establishes a first Bluetooth communication connection with the first host device; the first accessory device establishes a first Bluetooth communication connection based on the first accessory device.
  • the Bluetooth communication connection sends a pairing broadcast message after receiving the first message sent by the first host device; the second host device determines Bluetooth pairing with the first accessory device based on the pairing broadcast message and the Bluetooth media access control MAC address of the first accessory device and
  • the first accessory device establishes a second Bluetooth communication connection with the second host device; wherein, the Bluetooth MAC address of the first accessory device is sent by the first host device to the second accessory device through the second accessory device.
  • the second accessory device establishes Bluetooth communication connections with both the first host device and the second host device.
  • the first host device may be the host device 100, and the second host device may be the host device 200,
  • the first accessory device may be the Bluetooth accessory device 300 in FIG. 16
  • the second accessory device may be the Bluetooth accessory device 400 in FIG. 16
  • the first Bluetooth communication connection may be the Bluetooth communication connection 2 in FIG. 16
  • the first message may be For message 1 in Figure 16
  • the second Bluetooth communication connection may be Bluetooth communication connection 2' in Figure 16.
  • embodiments of the present application provide a communication method applied to a second accessory device.
  • the second accessory device establishes Bluetooth communication connections with both the first host device and the second host device.
  • the method includes: the second accessory device
  • the device receives a first message sent by the first host device.
  • the first message includes the Bluetooth media access control MAC address of the first accessory device.
  • the first message is used by the second accessory device to send to one or more host devices based on the first message.
  • the Bluetooth MAC address of the first accessory device, and one or more host devices include a second host device; the second accessory device sends the Bluetooth MAC address of the first accessory device to the second host device based on the first message, and the Bluetooth MAC address of the first accessory device
  • the MAC address is used to establish a Bluetooth communication connection between the second host device and the first accessory device.
  • the first host device may be the host device 100
  • the second host device may be the host device 200
  • the first accessory device may be the Bluetooth accessory device 300 in Figure 16
  • the second accessory device may be the Bluetooth accessory device 300 in Figure 16
  • the first message may be message 2 in Figure 16.
  • embodiments of the present application provide a communication method, applied to a first host device.
  • the method includes: the first host device establishes a first Bluetooth communication connection with a first accessory device; the first host device establishes a first Bluetooth communication connection based on the first Bluetooth device.
  • the communication connection sends a first message to the first accessory device, the first message is used to instruct the first accessory device to send a pairing broadcast message; the first host device sends a second message to the second accessory device, the second message includes the first Bluetooth accessory.
  • the Bluetooth media access control MAC address of the device the second message is used to instruct the second accessory device to send the Bluetooth MAC address of the first accessory device to one or more host devices, and the one or more host devices include the second host device; wherein, The second accessory device has established Bluetooth communication connections with both the first host device and the second host device.
  • the pairing broadcast message and the Bluetooth MAC address of the first accessory device are used to establish a second Bluetooth communication connection between the second host device and the first accessory device. .
  • the first host device may be the host device 100
  • the second host device may be the host device 200
  • the first accessory device may be the Bluetooth accessory device 300 in Figure 16
  • the second accessory device may be the Bluetooth accessory device 300 in Figure 16
  • the first Bluetooth communication connection can be Bluetooth communication connection 2 in Figure 16
  • the first message can be message 1 in Figure 16
  • the second message can be message 2 in Figure 16
  • the second Bluetooth communication The connection may be Bluetooth communication connection 2' in Figure 16.
  • embodiments of the present application provide a communication system, which includes a first host device, a first accessory device, and a second accessory device; the first accessory device is used to establish a first communication connection with the first host device. ; The second accessory device is used to establish a second communication connection with the first host device; the first accessory device is also used to detect that the user triggers a first event, and in response to the first event, sends a third communication connection to the first host device based on the first communication connection.
  • a data includes the information of the first event; the first host device is used to send the information of the first event to the second accessory device based on the second communication connection; the second accessory device is also used to receive the information sent by the first host device information of the first event, and perform response operations based on the information of the first event.
  • inventions of the present application provide a communication system.
  • the communication system includes a first host device, a second host device, a first accessory device, and a second accessory device.
  • the second accessory device is connected to the first host device and the second accessory device.
  • the host devices all establish Bluetooth communication connections; the first accessory device is used to establish a first Bluetooth communication connection with the first host device; the first host device
  • the first accessory device is configured to send a first message to the first Bluetooth accessory device based on the first Bluetooth communication connection.
  • the first message is used to instruct the first accessory device to send a pairing broadcast message; the first accessory device is also configured to send a pairing message after receiving the first message.
  • the first host device is also used to send a second message to the second accessory device, the second message includes the Bluetooth media access control MAC address of the first accessory device, and the second message is used to instruct the second accessory device to one or Multiple host devices send the Bluetooth MAC address of the first accessory device, and one or more host devices include a second host device; the second accessory device is used to send the Bluetooth MAC address of the first accessory device to the second host device; the second host The device is configured to receive the pairing broadcast message and the Bluetooth MAC address of the first accessory device, and perform Bluetooth pairing with the first accessory device based on the pairing broadcast message and the Bluetooth MAC address of the first accessory device and establish a second Bluetooth communication connection.
  • embodiments of the present application provide an electronic device, which includes one or more processors and one or more memories; wherein one or more memories are coupled to one or more processors, and one Or a plurality of memories are used to store computer program codes.
  • the computer program codes include computer instructions.
  • the electronic device When one or more processors execute the computer instructions, the electronic device performs the above-mentioned second aspect, third aspect, fourth aspect or sixth aspect. Or the method described in the seventh or eighth aspect.
  • embodiments of the present application provide a computer storage medium.
  • the computer storage medium stores a computer program.
  • the computer program includes program instructions. When the program instructions are run on an electronic device, the electronic device causes the electronic device to execute the above-mentioned second aspect. Or the method described in the third aspect, the fourth aspect, the sixth aspect, the seventh aspect or the eighth aspect.
  • embodiments of the present application provide a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to execute the above-mentioned second aspect, third aspect, fourth aspect, sixth aspect or seventh aspect. Or the method described in the eighth aspect.
  • Figure 1 is a schematic architectural diagram of a communication system provided by an embodiment of the present application.
  • Figure 2 is a schematic flowchart of switching the Bluetooth communication connection between the Bluetooth accessory device 300 and the Bluetooth accessory device 400 from the host device 200 to the host device 100 according to an embodiment of the present application;
  • Figure 3 is a schematic flowchart of switching the Bluetooth communication connection between the Bluetooth accessory device 300 and the Bluetooth accessory device 400 from the host device 200 to the host device 201 according to the embodiment of the present application;
  • Figure 4A is a schematic diagram of a user interface for mouse settings on a host device provided by an embodiment of the present application
  • Figure 4B is a schematic diagram of a user interface for adjusting the lighting effect of a mouse on a host device provided by an embodiment of the present application;
  • Figure 5 is a schematic diagram of multiple Bluetooth accessory devices establishing Bluetooth communication connections with multiple host devices respectively according to an embodiment of the present application
  • Figure 6A is a schematic diagram of the software architecture of a host device provided by an embodiment of the present application.
  • Figure 6B is a schematic diagram of the software architecture of another host device provided by an embodiment of the present application.
  • Figure 6C is an architectural schematic diagram of a Bluetooth routing management service module provided by an embodiment of the present application.
  • Figure 6D is a schematic structural diagram of a Bluetooth routing protocol message provided by an embodiment of the present application.
  • Figure 7 is a schematic diagram of the software architecture of a Bluetooth accessory device provided by an embodiment of the present application.
  • Figure 8 is a schematic flow chart of a Bluetooth routing method provided by an embodiment of the present application.
  • Figure 9 is an application of the communication method provided by the embodiment of the present application in switching Bluetooth communication connections of multiple Bluetooth accessory devices. Schematic diagram of the process under the scenario;
  • Figure 10 is a schematic structural diagram of a keyboard provided by an embodiment of the present application.
  • FIG 11 is a schematic flowchart of the communication method provided by the embodiment of the present application in the application scenario of controlling another Bluetooth accessory device (such as a mouse) to perform DPI adjustment through a Bluetooth accessory device (such as a keyboard);
  • another Bluetooth accessory device such as a mouse
  • FIG 12 is a schematic flowchart of the communication method provided by the embodiment of the present application in the application scenario of controlling another Bluetooth accessory device (such as a mouse) to adjust the lighting effect through a Bluetooth accessory device (such as a keyboard);
  • another Bluetooth accessory device such as a mouse
  • a Bluetooth accessory device such as a keyboard
  • FIG. 13 is a schematic flowchart of the communication method provided by the embodiment of the present application in an application scenario in which a Bluetooth accessory device (such as a keyboard) and another Bluetooth accessory device (such as a mouse) collaborate to implement a combination key function;
  • a Bluetooth accessory device such as a keyboard
  • another Bluetooth accessory device such as a mouse
  • Figure 14 is a schematic diagram of an embodiment of the present application providing a schematic diagram of communicating through an intermediate host device (such as a mobile phone) when a Bluetooth accessory device (such as a Bluetooth bracelet) and a host device (such as a tablet) do not directly establish a Bluetooth communication connection;
  • a Bluetooth accessory device such as a Bluetooth bracelet
  • a host device such as a tablet
  • Figure 15 is a schematic diagram of an embodiment of the present application providing a schematic diagram of communicating through an intermediate host device (such as a personal computer) when a host device (such as a mobile phone) and another host device (such as a tablet) do not directly establish a Bluetooth communication connection;
  • an intermediate host device such as a personal computer
  • a host device such as a mobile phone
  • another host device such as a tablet
  • Figure 16 is a schematic flowchart of the communication method provided by the embodiment of the present application in an application scenario in which multiple Bluetooth accessory devices establish Bluetooth communication connections with multiple host devices respectively.
  • an embodiment means that a particular feature, structure or characteristic described in connection with the embodiment may be included in at least one embodiment of the application.
  • the appearances of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
  • GUI graphical user interface
  • Figure 1 schematically shows a communication system provided by an embodiment of the present application.
  • the communication system may include: multiple Bluetooth accessory devices (which may also be called Bluetooth accessories or accessories or accessory devices or slave devices) and multiple host devices.
  • multiple Bluetooth accessory devices which may also be called Bluetooth accessories or accessories or accessory devices or slave devices
  • multiple host devices which may be called Bluetooth accessories or accessories or accessory devices or slave devices.
  • the Bluetooth accessory device and the host device are both intelligent terminal devices and can be of various types, which are not limited in the embodiments of the present application.
  • Bluetooth accessory devices may include speakers, mice, keyboards, stylus pens, headphones, etc.
  • the host device may include a tablet, a personal computer (PC), a large screen, a desktop computer, a laptop computer, a handheld computer, a car, a mobile phone, etc.
  • PC personal computer
  • a large screen a desktop computer
  • laptop computer laptop computer
  • handheld computer a handheld computer
  • car a mobile phone
  • both the host device and the Bluetooth accessory device may be devices that support Bluetooth multi-connection.
  • Bluetooth accessory devices in the communication system can establish a Bluetooth (BT) communication connection (or Bluetooth connection) with the host device, so that they can communicate with each other based on the established Bluetooth communication connection.
  • BT Bluetooth
  • multiple Bluetooth accessory devices in the communication system can also establish wired connections with the host device, or other wireless connections, such as wireless local area networks (WLAN) such as wireless fidelity point-to-point (wireless) Fidelity point to point, Wi-Fi P2P) connection, near field communication (NFC) connection, infrared technology (infrared, IR) connection, etc.
  • WLAN wireless local area networks
  • Wi-Fi P2P wireless fidelity point-to-point (wireless) Fidelity point to point
  • Wi-Fi P2P wireless fidelity point-to-point (wireless) Fidelity point to point
  • NFC near field communication
  • infrared technology infrared, IR
  • Multiple host devices in the communication system can be configured with different software operating systems (OperatingSystem, OS), including but not limited to etc. in, For Huawei’s Hongmeng system. Multiple host devices can also be configured with the same software operating system, for example
  • the accessory device may not be a Bluetooth accessory device.
  • Bluetooth accessory devices such as Bluetooth mice, Bluetooth keyboards, stylus pens, Bluetooth speakers, etc.
  • host devices such as tablets, personal computers, large computers, etc.
  • Bluetooth accessory devices are still independent of each other and cannot interact with each other. They cannot collaborate to complete a task or implement a certain function, which brings great challenges to product design. Comes with greater limitations and poor user experience.
  • Application scenario 1 Switch the Bluetooth communication connections of multiple Bluetooth accessory devices
  • Bluetooth accessory devices can perform Bluetooth pairing and establish Bluetooth communication connections with one or more host devices (such as tablets, PCs, large screens, etc.). Assume that multiple Bluetooth accessory devices have been paired with the host device 100 and the host device 200. Currently, these multiple Bluetooth accessory devices have established Bluetooth communication connections with the host device 100. If the user wants to pair these multiple Bluetooth accessory devices with the host device 100, To switch the Bluetooth communication connection of the accessory device from the host device 100 to the host device 200 (that is, all of the multiple Bluetooth accessory devices establish Bluetooth communication connections with the host device 200 so that they can interact with the host device 200 for data), there are two possible implementations: Way:
  • each of these multiple Bluetooth accessory devices can support the user to switch the Bluetooth communication connection from the host device 100 to the host device 200 by switching buttons. That is to say, the user needs to switch between these multiple Bluetooth accessory devices. Only by operating the switching buttons on the accessory device once can the multiple Bluetooth accessory devices switch the Bluetooth communication connection from the host device 100 to the host device 200. The operation is cumbersome and the user experience is poor.
  • Another possible implementation is to develop an independent application on the host device to manage all Bluetooth accessory devices separately.
  • the keyboard and mouse traversal scheme the host device detects the switching conditions of the Bluetooth communication connection, and determines that the switching conditions are met. Under certain conditions, the mouse and keyboard are controlled separately.
  • the execution process of this solution is introduced below in conjunction with Figures 2 and 3:
  • the host device 100 is a tablet
  • the host device 200 is a PC
  • the host device 201 is a large screen.
  • the positions of these three host devices can be shown in Figure 1.
  • the host device 200 is located in the middle, and the host device 100 is located on the left side of the host device 200.
  • the host device 201 is located on the right side of the host device 200.
  • the location information of these three host devices has been configured in advance.
  • the Bluetooth accessory device 300 is a keyboard, and the Bluetooth accessory device 400 is a mouse. Among them, Both the Bluetooth accessory device 300 and the Bluetooth accessory device 400 have established Bluetooth communication connections with the host device 200. In this way, the host device 200 can establish control service channels with the Bluetooth accessory device 300 and the Bluetooth accessory device 400 for data interaction.
  • FIG. 2 exemplarily shows a specific process of switching the Bluetooth communication connection between the Bluetooth accessory device 300 and the Bluetooth accessory device 400 from the host device 200 to the host device 100 .
  • Specific steps are as follows:
  • the host device 200 detects the user's operation of moving the cursor to the left border of the screen.
  • the host device 200 can monitor the cursor position and the movement direction of the cursor of the Bluetooth accessory device 400 in real time. When it is detected that the cursor is at the border of the screen and moves toward the border of the screen, the host device 200 has already configured other host devices in advance. Position information, therefore, the host device 200 can determine that when the cursor is at the left border of the screen and moves toward the left border of the screen, the user's intention is to switch the Bluetooth communication connection of the Bluetooth accessory device to the host device 100 . For example, after the host device 200 detects the user's operation of moving the cursor to the left border of the screen, in response to the operation, the host device 200 may send a message to the Bluetooth accessory device 300 and the Bluetooth accessory device 400 to switch the Bluetooth communication connection to the host. instructions of the device 100 (ie, execute the following steps S202 and S205).
  • the host device 200 sends an instruction to the Bluetooth accessory device 400 to switch the Bluetooth communication connection to the host device 100. After receiving the instruction, the Bluetooth accessory device 400 can switch the Bluetooth channel. After the switching is completed, the Bluetooth accessory device 400 can Host device 100 sends message 1.
  • the Bluetooth accessory device 400 can switch the Bluetooth channel to the host device 100. After the switching is completed, the Bluetooth accessory device 400 communicates with the host device 100. 100 A Bluetooth communication connection is established. Afterwards, the Bluetooth accessory device 400 can send message 1 to the host device 100 to interact with the host device 100 in data.
  • Message 1 may include cursor movement messages and key press messages of the Bluetooth accessory device 400. In this way, the host device 100 can perform related tasks based on message 1 (such as displaying the position of the cursor, responding to key press operations, etc.).
  • the host device 200 sends an instruction to the Bluetooth accessory device 300 to switch the Bluetooth communication connection to the host device 100. After receiving the instruction, the Bluetooth accessory device 300 can switch the Bluetooth channel. After the switching is completed, the Bluetooth accessory device 300 can Host device 100 sends message 2.
  • the Bluetooth accessory device 300 can switch the Bluetooth channel to the host device 100. After the switching is completed, the Bluetooth accessory device 300 communicates with the host device 100. 100 A Bluetooth communication connection is established. Afterwards, the Bluetooth accessory device 300 can send message 2 to the host device 100 to interact with the host device 100 in data.
  • Message 2 may include a key press message of the Bluetooth accessory device 300, so that the host device 100 can perform related tasks based on message 2 (for example, respond to a key press operation).
  • FIG. 3 exemplarily shows a specific process of switching the Bluetooth communication connection between the Bluetooth accessory device 300 and the Bluetooth accessory device 400 from the host device 200 to the host device 201 .
  • Specific steps are as follows:
  • the host device 200 detects the user's operation of moving the cursor to the right border of the screen.
  • the host device 200 can monitor the cursor position and the movement direction of the cursor of the Bluetooth accessory device 400 in real time. When it is detected that the cursor is at the border of the screen and moves toward the border of the screen, the host device 200 has already configured other host devices in advance. Therefore, the host device 200 can determine that when the cursor is at the right edge of the screen and moves toward the right edge of the screen, the user's intention is to switch the Bluetooth communication connection of the Bluetooth accessory device to the host device 201 . For example, after the host device 200 detects the user's operation of moving the cursor to the right edge of the screen, in response to the operation, the host device 200 may send a message to the Bluetooth accessory device 300 and the Bluetooth accessory device 400 to switch the Bluetooth communication connection to the host.
  • the instructions of the device 201 ie, execute the following steps S302 and S305).
  • the host device 200 sends an instruction to the Bluetooth accessory device 400 to switch the Bluetooth communication connection to the host device 201. After receiving the instruction, the Bluetooth accessory device 400 can switch the Bluetooth channel. After the switching is completed, the Bluetooth accessory device 400 can switch to the host device 201. Host device 201 sends message 1'.
  • the Bluetooth accessory device 400 can switch the Bluetooth channel to the host device 201. After the switching is completed, the Bluetooth accessory device 400 communicates with the host device 201. 201 establishes a Bluetooth communication connection. Afterwards, the Bluetooth accessory device 400 can send message 1' to the host device 201 to interact with the host device 201 in data.
  • Message 1' may include cursor movement messages and key press messages of the Bluetooth accessory device 400.
  • the host device 201 can perform related tasks (such as displaying the position of the cursor, responding to key press operations, etc.) based on message 1'.
  • the host device 200 sends an instruction to the Bluetooth accessory device 300 to switch the Bluetooth communication connection to the host device 201. After receiving the instruction, the Bluetooth accessory device 300 can switch the Bluetooth channel. After the switching is completed, the Bluetooth accessory device 300 can switch to the host device 201. Host device 201 sends message 2'.
  • the Bluetooth accessory device 300 can switch the Bluetooth channel to the host device 201. After the switching is completed, the Bluetooth accessory device 300 communicates with the host device 201. 201 establishes a Bluetooth communication connection. Afterwards, the Bluetooth accessory device 300 can send message 2' to the host device 201 to interact with the host device 201 in data.
  • the message 2' may include a key press message of the Bluetooth accessory device 300, so that the host device 201 can perform related tasks (such as responding to a key press operation) based on the message 2'.
  • the above implementation requires the development of complex applications on the host device, which is highly customizable and cannot cover multiple scenarios.
  • Multiple Bluetooth accessory devices cannot interact with each other and can only passively receive control instructions from the host device.
  • Function evolution requires a strong reliance on applications on the host device.
  • Multiple Bluetooth accessory devices cannot collaborate to implement some scenario-based functions.
  • users are also required to configure the location information between each host device in advance.
  • the solution is complex, requires heavy user participation, and results in a poor experience.
  • Application scenario 2 Control Bluetooth accessory devices to adjust related configurations
  • Bluetooth accessory devices have some configuration functions, such as mouse dots per inch (DPI) adjustment, lighting effect adjustment, etc. You can add buttons to the mouse or develop related applications on the host device to support users. Configure manually.
  • DPI mouse dots per inch
  • Figure 4A exemplarily shows a user interface for mouse settings on the host device.
  • the user interface may include a DPI adjustment drag bar 411.
  • the user can adjust the mouse by dragging the DPI adjustment drag bar 411. Make DPI adjustments.
  • buttons for DPI increase and DPI decrease on the mouse there are buttons for DPI increase and DPI decrease on the mouse.
  • the user can also adjust the DPI of the mouse by operating these two buttons on the mouse.
  • the user interface can also support the user to configure the keys on the mouse into specific functions of the key combinations on the keyboard.
  • Figure 4B exemplarily shows a user interface for adjusting the lighting effect of the mouse on the host device.
  • the user interface can support the user to turn on/off the lighting effect, turn on/off the contour light, light color, and speed of the mouse. , brightness, etc. to set.
  • keyboards users have a need to reduce the size of the keyboard from the perspective of carrying it and taking up space during use.
  • the one-handed keyboards currently on the market not only reduce the size of the keyboard, but also reduce the size of the keyboard. Many key functions of the keyboard cannot meet user needs.
  • Application scenario five Multiple Bluetooth accessory devices establish Bluetooth communication connections with multiple host devices respectively.
  • Bluetooth accessory devices such as keyboards, mice, etc.
  • They can trigger each Bluetooth channel of the Bluetooth accessory device to send Bluetooth broadcast messages.
  • the host device can discover the corresponding Bluetooth device through Bluetooth broadcast messages.
  • the accessory device can further perform Bluetooth pairing with the Bluetooth accessory device one by one and establish a Bluetooth communication connection.
  • FIG. 5 exemplarily shows a schematic diagram of multiple Bluetooth accessory devices establishing Bluetooth connections with multiple host devices respectively.
  • Bluetooth accessory device 300 taking two Bluetooth accessory devices (such as Bluetooth accessory device 300 and Bluetooth accessory device 400) respectively establishing Bluetooth communication connections with three host devices (such as host device 100, host device 200, and host device 201) as an example, if The user wants to establish a Bluetooth communication connection between the Bluetooth accessory device 300 and the above three host devices. Then, the user needs to trigger the Bluetooth accessory device 300 to perform Bluetooth pairing with the above three host devices in sequence. In other words, the user needs to perform 3 times. Only through the Bluetooth pairing operation can the Bluetooth accessory device 300 establish a Bluetooth communication connection with the above three host devices. In the same way, if the user wants to establish a Bluetooth communication connection between the Bluetooth accessory device 400 and the above three host devices, it also needs to be performed three times. Only through the Bluetooth pairing operation can the Bluetooth accessory device 300 establish a Bluetooth communication connection with the above three host devices.
  • three host devices such as host device 100, host device 200, and host device 201
  • the embodiment of the present application provides a communication method.
  • data communication channels can be provided for the multiple Bluetooth accessory devices based on the Bluetooth routing function of the host device.
  • Data communication can be carried out between these multiple Bluetooth accessory devices, so that these multiple Bluetooth accessory devices can collaboratively implement differentiated functions in corresponding scenarios, simplify user operations, and improve user experience.
  • Solution one i.e., the following embodiment one, used to solve the problems existing in the above application scenario one:
  • the information synchronization function between multiple Bluetooth accessory devices is realized (such as synchronizing the information of the Bluetooth switching event of the Bluetooth accessory device).
  • you can operate a Bluetooth accessory device such as pressing a Bluetooth accessory Bluetooth switching button of the device to automatically switch the Bluetooth communication connections of multiple Bluetooth accessory devices from one host device to another.
  • multiple devices can automatically collaborate.
  • Solution two i.e., the following embodiment two and embodiment three, used to solve the problems existing in the above application scenario two:
  • the information synchronization function between multiple Bluetooth accessory devices is realized (such as synchronizing the key status information of the Bluetooth accessory device).
  • DPI button, light effect adjustment button) to configure another Bluetooth accessory device for example, by borrowing the DPI button and light effect adjustment button on the keyboard to realize DPI adjustment and light effect adjustment on the mouse), share hardware resources, and reduce cost and optimize product appearance.
  • Solution three i.e., the following embodiment four, used to solve the problems existing in the above application scenarios three and four:
  • the information synchronization function between multiple Bluetooth accessory devices is realized (such as synchronizing the key status information of the Bluetooth accessory device).
  • the key status information of one Bluetooth accessory device can be synchronized to another Bluetooth accessory device.
  • Accessory devices, on the one hand, the buttons on one Bluetooth accessory device and the buttons on another Bluetooth accessory device can form a key combination (for example, the side buttons on the mouse and the Fx button on the keyboard can form the same function as Fn+Fx on the keyboard) key combination), eliminating the need for users to frequently switch between two Bluetooth accessory devices (such as mouse and keyboard), reducing user fatigue; on the other hand, the buttons on one Bluetooth accessory device can be adjusted according to the button status of another Bluetooth accessory device.
  • the function of the keys on the keyboard can be changed (for example, QWERT on the keyboard is converted to YUIOP respectively), one-click multi-function, reduce the number of keyboard keys, and shrink the keyboard size, it can also meet the needs of users.
  • the host device can send device information (such as Bluetooth MAC address, etc.) of other Bluetooth accessory devices to other host devices with which the Bluetooth accessory device has established a Bluetooth communication connection through the Bluetooth accessory device with which it has established a Bluetooth communication connection, so that one or more hosts
  • the device obtains the device information of the Bluetooth accessory device that has not established a Bluetooth communication connection with it.
  • This one or more host devices can actively perform Bluetooth pairing with the Bluetooth accessory device based on the device information of the Bluetooth accessory device and establish a Bluetooth communication connection, simplifying the user operations to improve user experience.
  • the operating system configured by the host device provided by the embodiment of this application may include but is not limited to wait.
  • the operating system configured on the host device is (ie Hongmeng operating system), the software architecture of the host device may be the architecture shown exemplarily in Figure 6A.
  • the host device may include an application layer, a framework layer and a driver layer.
  • the application layer can include a series of applications.
  • the framework layer can provide application programming interface (application programming interface, API) and programming framework for applications in the application layer.
  • the framework layer includes some predefined functions.
  • the framework layer may include an input subsystem and a Bluetooth management service module.
  • the input subsystem can be used to receive input events such as key presses and touches, process these raw input events, and dispatch these events.
  • the input subsystem can also provide an interface for injecting events. Applications can generate input events by calling this interface, and then inject the input events into the input subsystem for processing.
  • the Bluetooth management service module may include a Bluetooth device management service module and a Bluetooth routing management service module.
  • the Bluetooth device management service module can be used to query whether there is a Bluetooth device nearby, establish a Bluetooth communication connection with a Bluetooth accessory device, and be responsible for whether the local device can be discovered or connected by other devices, etc.
  • the Bluetooth routing management service module is the core module of the embodiment of the present application, and can be used to be responsible for routing registration management, data forwarding, etc. of Bluetooth accessory devices.
  • the driver layer can be used to detect and enable hardware.
  • the driver layer can include one or more drivers, such as display driver, camera driver, audio driver, sensor driver, Bluetooth driver, etc.
  • the operating system configured on the host device is other than In the case of operating systems other than
  • the software architecture of the host device may be the architecture shown exemplarily in FIG. 6B .
  • the host device may include an application layer, a Windows Software Development Kit (SDK), and a driver layer.
  • SDK Windows Software Development Kit
  • the application layer may include a series of applications, for example, Application 1 (eg Computer Manager).
  • Application 1 eg Computer Manager
  • the application 1 may include a Bluetooth routing management service module.
  • the Bluetooth routing management service module shown in Figure 6B is integrated in the application layer, and its function can be similar to the Bluetooth routing management service module shown in Figure 6A. of.
  • Windows SDK can include Bluetooth SDK.
  • the Bluetooth SDK can provide relevant interfaces for the Bluetooth routing management service module in the upper-layer application to implement the methods provided in the embodiments of this application.
  • the driver layer can be used to detect and enable hardware.
  • the driver layer can include one or more drivers, such as display driver, camera driver, audio driver, sensor driver, Bluetooth driver, etc.
  • FIG. 6A and FIG. 6B are only exemplary and should not impose any limitations on the software architecture of the host device in the embodiment of the present application.
  • the software architecture of the host device may also adopt a different hierarchical structure than the examples shown in Figure 6A and Figure 6B, or each layer may also include more or fewer modules. Or a combination of multiple different module modes, etc., which are not limited in the embodiments of the present application.
  • FIG. 6C illustrates an architectural schematic diagram of the above-mentioned Bluetooth routing management service module provided by an embodiment of the present application.
  • the Bluetooth routing management service module may include a Bluetooth routing service connection management module, a Bluetooth routing protocol module, a routing device registration management module, a data forwarding module, and a routing mapping table.
  • the Bluetooth routing service connection management module can be used to establish a service connection and device authentication of a specific Universal Unique Identifier (UUID) based on the Bluetooth protocol; send received messages to the Bluetooth routing protocol module; provide a data sending and receiving interface; based on data forwarding The routing message and communication handle sent by the module will send the routing message to the corresponding Bluetooth accessory device; and so on.
  • UUID Universal Unique Identifier
  • the above-mentioned received messages may be messages from the Bluetooth accessory device (for example, registration messages, routing messages).
  • the Bluetooth routing protocol module can be used to parse the messages sent by the Bluetooth routing service connection management; send registration messages to the routing device registration management module; send routing messages to the data forwarding module; and so on.
  • the routing device registration management module can be used to receive registration messages sent by the Bluetooth routing protocol module; update the routing mapping table; and so on.
  • the routing device registration management module can write the communication handle into the corresponding routing map based on the registered device type in the registration message.
  • the communication handle may include information about the Bluetooth communication connection corresponding to the registered device type (such as Bluetooth channel information, etc.).
  • the routing mapping table can be used to record and save the mapping relationship between registered device types and communication handles, that is, the mapping relationship between registered device types and Bluetooth communication connections.
  • the data forwarding module can be used to receive routing messages sent by the Bluetooth routing protocol module; it can also read the routing mapping table based on the destination device type carried in the routing message to obtain the communication handle corresponding to the destination device type; it can also Send routing messages and communication handles to the Bluetooth routing service connection management module; and so on.
  • FIG. 6C is only exemplary and should not impose any limitations on the architecture of the Bluetooth routing management service module in the embodiment of the present application.
  • the architecture of the Bluetooth routing management service module may also include more or fewer modules, or a combination of multiple different module modes, etc., which are not limited in the embodiments of the present application.
  • Figure 6D exemplarily shows a schematic structural diagram of a Bluetooth routing protocol message provided by an embodiment of the present application.
  • Bluetooth routing protocol messages can be composed of the following fields: version information (Version), data type (DataType), source device type (SourceDeviceType, SrcDevType), destination device type (DestinationDeviceType, DestDevType), reserved Fields (Reserved, Rev), payload (Payload). in:
  • Version information (Version), the field length can be 1 Byte, can include the version of the routing protocol and other information, and can be used to verify protocol matching between devices.
  • DataType the field length can be 1Byte, and can be used to indicate the data type of the message.
  • 0x01 can indicate that the data type of the message is registration type, that is, the message is a registration type message (also called a device registration message), and 0x02 can indicate that the data type of the message is routing type, that is, the message They are routing packets (that is, packets that need to be routed to other devices).
  • registration type that is, the message is a registration type message (also called a device registration message)
  • routing type that is, the message They are routing packets (that is, packets that need to be routed to other devices).
  • Source device type (SourceDeviceType, SrcDevType), the field length can be 1Byte, and can be used to represent The device type of the message sender.
  • 0x00 can represent the host device
  • 0x01 can represent the mouse device
  • 0x02 can represent the keyboard device
  • 0x03 can represent the stylus device
  • 0x04 can represent the speaker device, and so on.
  • Destination device type (DestinationDeviceType, DestDevType), the field length can be 2Byte, and can be used to indicate the device type of the message receiver.
  • Each bit can represent a device type. For example, bit0 can represent a host device, bit1 can represent a mouse device, bit2 can represent a keyboard device, bit3 can represent a stylus device, bit4 can represent a speaker device, and so on.
  • the destination device type can be the device type represented by this/some bits. For example, if bit1 is set to 1, the destination device type is a mouse device; for example, bit1 and bit2 If set to 1, the destination device type is mouse device and keyboard device.
  • Reserved fields (Reserved, Rev), the field length can be 2Byte, can represent undefined data, and can be used for subsequent expansion.
  • the field length can be nByte (n is a positive integer), and can represent self-defined data based on the business requirements between devices.
  • the above-mentioned self-defined data may include information about events monitored by the Bluetooth accessory device (for example, information about the event that the user presses a certain button on the keyboard, information about the event that the user presses a certain button on the mouse). wait).
  • the structure of the Bluetooth routing protocol message shown in Figure 6D is only exemplary. In some embodiments, the structure of the Bluetooth routing protocol message can be other, which is not limited in the embodiments of this application.
  • the following is a schematic diagram of the software architecture of the Bluetooth accessory device provided by the embodiment of the present application.
  • the operating system configured for the Bluetooth accessory device may include but is not limited to Lightweight IoT system kernel wait.
  • the operating system configured by the Bluetooth accessory device may be an embedded operating system, or the Bluetooth accessory device may not be configured with an operating system.
  • Figure 7 exemplarily shows a schematic diagram of the software architecture of a Bluetooth accessory device.
  • a Bluetooth accessory device may include an application layer, a service layer, and a driver layer.
  • the application layer is the implementation module of specific business functions of the Bluetooth accessory device, and may include an event processing module.
  • the event processing module can be used to receive event information sent by the Bluetooth data communication service module; it can also be used to perform corresponding actions based on the event information. For example, in response to the event that the user presses a key on the keyboard, the key value corresponding to the key is sent to the host device based on the Human Interface Device (HID) Bluetooth protocol, or the action of switching Bluetooth channels is performed, etc. .
  • HID Human Interface Device
  • the service layer is a module that provides general capabilities of Bluetooth accessory devices, and may include an event monitoring module and a Bluetooth data communication service module.
  • the event monitoring module can be used to monitor all events of the Bluetooth accessory device (such as events when the user presses the button, event when the user releases the button, event when the Bluetooth communication connection is established, event when the Bluetooth communication connection is disconnected, etc.), and can also Gather information about the above events, etc.
  • the Bluetooth data communication service module can be used to encapsulate and parse routing data, provide routing data sending and receiving interfaces, and so on.
  • the driver layer is a module that detects and enables hardware for Bluetooth accessory devices, and can include key collection modules and Bluetooth SDK.
  • the key collection module can be used to obtain the user's key behavior.
  • Bluetooth SDK can provide the basic SDK of Bluetooth chips.
  • FIG. 7 is only exemplary and should not impose any limitations on the software architecture of the Bluetooth accessory device in the embodiment of the present application.
  • the software architecture of the Bluetooth accessory device may also adopt a different hierarchical structure than the example shown in Figure 7, or each layer may include more or less modules, or multiple The embodiments of this application do not limit the combination of different module modes.
  • Figure 8 schematically shows the specific process of a Bluetooth routing method provided by an embodiment of the present application.
  • this method can be applied to a communication system including a host device, a Bluetooth accessory device A, and a Bluetooth accessory device B.
  • the host device may include a Bluetooth routing management service module
  • the Bluetooth accessory device A may include an event monitoring module and a Bluetooth data communication service module
  • the Bluetooth accessory device B may include an event processing module and a Bluetooth data communication service module.
  • a Bluetooth routing service connection needs to be established between the host device and Bluetooth accessory device A and Bluetooth accessory device B, and Bluetooth accessory device A and Bluetooth accessory device B need to register the device type with the host device. After establishing Only after the Bluetooth routing service connection is completed and the device type is registered, can you continue to perform the steps in Phase 2 below to communicate Bluetooth routing data between devices.
  • a possible implementation method of establishing a Bluetooth routing service connection and registering a device type may be the implementation method described in the following phase one (step S801-step S806), which is described in detail below:
  • Bluetooth accessory device A establishes Bluetooth routing service connection one with the host device. After that, Bluetooth accessory device A can send registration request one to the host device, and the request includes the device type of Bluetooth accessory device A.
  • the host device saves the mapping relationship between the Bluetooth communication connection one and the device type of the Bluetooth accessory device A, where the Bluetooth communication connection one is the Bluetooth communication connection established between the Bluetooth accessory device A and the host device.
  • the above-mentioned Bluetooth routing service connection one can be a service connection with a specific UUID established based on the Bluetooth protocol.
  • the Bluetooth accessory device A can perform device registration with the host device (for example, Bluetooth routing device type registration), and Data communication between host devices.
  • the Bluetooth data communication service module of the Bluetooth accessory device A can actively send a registration request to the Bluetooth routing management service module of the host device.
  • the request can be for the Bluetooth accessory device.
  • A makes a request for Bluetooth routing device type registration to the host device, and the request may include the device type of the Bluetooth accessory device A.
  • the above-mentioned registration request is a registration message, and its structure can refer to the structure of the message shown in FIG. 6D.
  • the Bluetooth routing management service module of the host device After the Bluetooth routing management service module of the host device receives the registration request sent by the Bluetooth accessory device A, the Bluetooth routing management service module of the host device can obtain the device type of the Bluetooth accessory device A by parsing the above registration request, and then record it. And save the mapping relationship between the Bluetooth communication connection one and the device type of the Bluetooth accessory device A.
  • the Bluetooth communication connection may be a Bluetooth device through the host device. Created by the management module. That is to say, after the Bluetooth accessory device A establishes a Bluetooth communication connection with the host device, On the basis of Bluetooth accessory device A and the host device, the above-mentioned Bluetooth routing service connection can be established.
  • the Bluetooth accessory device B establishes a Bluetooth routing service connection two with the host device. After that, the Bluetooth accessory device B can send a registration request two to the host device. The request includes the device type of the Bluetooth accessory device B.
  • the host device saves the mapping relationship between the Bluetooth communication connection two and the device type of the Bluetooth accessory device B, where the Bluetooth communication connection two is the Bluetooth communication connection established by the Bluetooth accessory device B and the host device.
  • the above-mentioned Bluetooth routing service connection 2 can be a service connection with a specific UUID established based on the Bluetooth protocol.
  • the Bluetooth accessory device B can perform device registration with the host device (for example, Bluetooth routing device type registration), and Data communication between host devices.
  • Bluetooth data communication service module of Bluetooth accessory device B can actively send a registration request 2 to the Bluetooth routing management service module of the host device.
  • This request can be for the Bluetooth accessory device B makes a request for Bluetooth routing device type registration to the host device, and the request may include the device type of the Bluetooth accessory device B.
  • the above-mentioned registration request 2 is a registration message, and its structure can refer to the structure of the message shown in FIG. 6D.
  • the Bluetooth routing management service module of the host device After the Bluetooth routing management service module of the host device receives the registration request 2 sent by the Bluetooth accessory device B, the Bluetooth routing management service module of the host device can obtain the device type of the Bluetooth accessory device B by parsing the above registration request 2, and then record it. And save the mapping relationship between the device type of Bluetooth communication connection 2 and Bluetooth accessory device B.
  • the Bluetooth communication connection 2 may be a Bluetooth device through the host device. Created by the management module. That is to say, only after the Bluetooth accessory device B and the host device have established Bluetooth communication connection 2, the Bluetooth accessory device B and the host device can establish the above-mentioned Bluetooth routing service connection 2.
  • steps S801-step S803 may be executed before steps S804-step S806; for another example, steps S801-step S803 may be executed after steps S804-step S806; for another example, steps S801-step S803 may be executed together with steps S804-step S806. executed simultaneously.
  • Bluetooth routing data communication between devices can be performed based on the established Bluetooth routing service connection.
  • Bluetooth routed data communication between devices may be the implementation described in the following phase 2 (step S807-step S821), which is described in detail below:
  • the event monitoring module of Bluetooth accessory device A detects the occurrence of event a. After that, the event monitoring module of Bluetooth accessory device A can send data one to the Bluetooth data communication service module of Bluetooth accessory device A.
  • the data can include events. a information, destination device type 1.
  • the Bluetooth data communication service module of the Bluetooth accessory device A can encapsulate the data one, and then send the encapsulated data one to the Bluetooth routing management service module of the host device.
  • the event monitoring module of Bluetooth accessory device A can perform event monitoring in real time. After detecting the occurrence of event a (for example, an event in which the user presses a button on Bluetooth accessory device A, etc.), the event monitoring module can call Bluetooth data.
  • the data sending interface provided by the communication service module is used to send data to the Bluetooth data communication service module.
  • the data can be To include the information of event a (for example, the key value corresponding to a certain button of Bluetooth accessory device A pressed by the user, etc.) and the destination device type 1.
  • the above-mentioned data one may include one or more destination device types (for example, destination device type 1).
  • the one or more destination device types may be preset and do not require manual setting by the user.
  • the one or more destination device types are device types corresponding to the device that needs to receive the above-mentioned data one (ie, the receiver of the above-mentioned data one).
  • the Bluetooth data communication service module of the Bluetooth accessory device A can encapsulate the above data one to obtain data that meets the Bluetooth protocol format, that is, the encapsulated data one.
  • the Bluetooth data communication service module of the Bluetooth accessory device A can send the above-mentioned encapsulated data to the Bluetooth routing management service module of the host device.
  • the Bluetooth routing management service module of the host device determines that the destination device type 1 is the device type of the Bluetooth accessory device B based on the encapsulated data 1, and determines the destination based on the mapping relationship between the saved device type and the Bluetooth communication connection.
  • the Bluetooth communication connection corresponding to device type 1 is Bluetooth communication connection two. After that, the Bluetooth routing management service module of the host device can send encapsulated data one to the Bluetooth data communication service module of Bluetooth accessory device B.
  • the Bluetooth routing management service module of the host device after receiving the encapsulated data one sent by Bluetooth accessory device A, the Bluetooth routing management service module of the host device, because the encapsulated data one includes the destination Device type 1, then the Bluetooth routing management service module of the host device can parse the encapsulated data to obtain the destination device type 1, and determine that the destination device type 1 is the device type of the Bluetooth accessory device B. Further, due to the The Bluetooth routing management service module of the host device records and saves the mapping relationship between the device type of the Bluetooth accessory device B and the Bluetooth communication connection 2. Therefore, the Bluetooth routing management service module of the host device can communicate with Bluetooth based on the saved device type.
  • the mapping relationship between the connections determines that the Bluetooth communication connection corresponding to the destination device type 1 is Bluetooth communication connection 2. Further, the Bluetooth routing management service module of the host device can determine that the above-mentioned encapsulated data needs to be sent through the above-mentioned Bluetooth communication connection 2. To Bluetooth accessory device B. Afterwards, the Bluetooth routing management service module of the host device can send the above-mentioned encapsulated data one to the Bluetooth data communication service module of the Bluetooth accessory device B through the above-mentioned Bluetooth communication connection two.
  • the data one in the above step S808 may also only include the information of event a, but not the destination device type 1.
  • the host device may also only send the information of event a included in data one to Bluetooth accessory device B.
  • the Bluetooth data communication service module of Bluetooth accessory device B parses the encapsulated data A and identifies the information of event a. After that, the Bluetooth data communication service module of Bluetooth accessory device B can send a request to the event processing module of Bluetooth accessory device B. Send an event processing message, which includes information about event a.
  • the Bluetooth data communication service module of the Bluetooth accessory device B can parse the encapsulated data one, thereby identifying the encapsulated data one.
  • the data a includes the information of event a.
  • the Bluetooth data communication service module of Bluetooth accessory device B can send The event processing module of Bluetooth accessory device B sends an event processing message, which may include information about event a, to notify the event processing module of Bluetooth accessory device B to process event a.
  • the event processing module of Bluetooth accessory device B executes the action corresponding to event a. After the execution is completed, an event processing completion message can be sent to the Bluetooth data communication service module of Bluetooth accessory device B.
  • the event processing module of Bluetooth accessory device B can process event a, that is, perform the action corresponding to event a.
  • an event processing completion message can be sent to the Bluetooth data communication service module of Bluetooth accessory device B to notify the Bluetooth data communication service module of Bluetooth accessory device B that the event processing module of Bluetooth accessory device B has completed processing event a.
  • the above event processing completion message may include the processing result of event a by Bluetooth accessory device B.
  • the Bluetooth data communication service module of the Bluetooth accessory device B sends response data to the Bluetooth routing management service module of the host device.
  • the data includes the event processing completion message and destination device type 2.
  • the Bluetooth data communication service module of Bluetooth accessory device B can generate response data, which may include the above event processing completion message and the destination device. Type 2. Afterwards, the Bluetooth data communication service module of Bluetooth accessory device B can send the above response data to the Bluetooth routing management service module of the host device, so that the host device can feedback the processing result of the above event a by Bluetooth accessory device B to Bluetooth accessory device A.
  • the destination device type 2 may be the device type corresponding to the sender of the data one (ie, the device type of the Bluetooth accessory device A).
  • the Bluetooth routing management service module of the host device determines that the destination device type 2 is the device type of the Bluetooth accessory device A based on the response data, and determines the destination device type 2 based on the mapping relationship between the saved device type and the Bluetooth communication connection.
  • the corresponding Bluetooth communication connection is Bluetooth communication connection one. After that, the Bluetooth routing management service module of the host device can send response data to the Bluetooth data communication service module of the Bluetooth accessory device A.
  • the destination device type 2 is the device type of the Bluetooth accessory device A.
  • the Bluetooth routing management service module of the host device receives the response data sent by the Bluetooth accessory device B, since the response data includes the destination device type 2, Then, the Bluetooth routing management service module of the host device can parse the response data to obtain the destination device type 2, and determine that the destination device type 2 is the device type of the Bluetooth accessory device A. Furthermore, due to the Bluetooth routing management service of the host device in stage one, The module records and saves the mapping relationship between the device type of the Bluetooth accessory device A and the Bluetooth communication connection. Therefore, the Bluetooth routing management service module of the host device can be determined based on the saved mapping relationship between the device type and the Bluetooth communication connection.
  • the Bluetooth communication connection corresponding to the destination device type 2 is Bluetooth communication connection one. Further, the Bluetooth routing management service module of the host device can determine that the above response data needs to be sent to the Bluetooth accessory device A through the above-mentioned Bluetooth communication connection one. Afterwards, the Bluetooth routing management service module of the host device can send the above response data to the Bluetooth data communication service module of the Bluetooth accessory device A through the above Bluetooth communication connection.
  • the Bluetooth data communication service module of Bluetooth accessory device A parses the response data to obtain an event processing completion message. After that, the Bluetooth data communication service module of Bluetooth accessory device A can send an event processing completion message to the event monitoring module of Bluetooth accessory device A. .
  • the Bluetooth data communication service module of the Bluetooth accessory device A can parse the response data to obtain the event processing completion message. Afterwards, the Bluetooth data communication service module of the Bluetooth accessory device A can send an event processing completion message to the event monitoring module of the Bluetooth accessory device A, so as to notify the event monitoring module of the Bluetooth accessory device A of the processing results of the above-mentioned event a by the Bluetooth accessory device B. .
  • the Bluetooth accessory device B can send an event processing completion message to the Bluetooth accessory device A through the host device when the event processing is completed (that is, the event processing is successful). In some embodiments, the Bluetooth accessory device B If the processing fails, the host device can also send a corresponding message to the Bluetooth accessory device A to notify the Bluetooth accessory device A that the event processing failed. In this way, the Bluetooth accessory device A can perform the corresponding operation based on the message, for example, send the Bluetooth accessory device A through the host device again. Accessory device B sends the above data one.
  • data communication channels can be provided for the multiple Bluetooth accessory devices based on the Bluetooth routing function of the host device. In this way, data communication can be carried out between the multiple Bluetooth accessory devices, so that the multiple Bluetooth accessory devices can cooperate to complete a certain task or implement a certain function.
  • Embodiment 1 By operating a Bluetooth accessory device (for example, pressing the Bluetooth switching button of a Bluetooth accessory device), the Bluetooth communication connections of multiple Bluetooth accessory devices are automatically switched from one host device to another host device.
  • a Bluetooth accessory device for example, pressing the Bluetooth switching button of a Bluetooth accessory device
  • Figure 9 exemplarily shows the specific process of the communication method provided by the embodiment of the present application in the application scenario of switching Bluetooth communication connections of multiple Bluetooth accessory devices.
  • this method can be applied to a communication system including a host device 100, a host device 200, a Bluetooth accessory device 300 (such as a keyboard), a Bluetooth accessory device 400 (such as a mouse), and a Bluetooth accessory device 500 (such as a speaker).
  • a Bluetooth accessory device 300 such as a keyboard
  • a Bluetooth accessory device 400 such as a mouse
  • a Bluetooth accessory device 500 such as a speaker
  • a Bluetooth routing service connection needs to be established between the host device 100 and the Bluetooth accessory device 300, the Bluetooth accessory device 400, and the Bluetooth accessory device 500, and the Bluetooth accessory device 300, the Bluetooth accessory device 400, and the Bluetooth accessory device 500 needs to register the device type with the host device 100.
  • the steps in the following phase 2 can be continued to switch the Bluetooth communication connections of multiple Bluetooth accessory devices. .
  • a possible implementation method of establishing a Bluetooth routing service connection and registering a device type may be the implementation method described in the following phase one (step S901-step S909), which is described in detail below:
  • the Bluetooth accessory device 300 establishes a Bluetooth routing service connection 1 with the host device 100. After that, the Bluetooth accessory device 300 can send a registration request 1 to the host device 100. The request includes the device type of the Bluetooth accessory device 300. The host device 100 saves the mapping relationship between the Bluetooth communication connection 1 and the device type of the Bluetooth accessory device 300 , where the Bluetooth communication connection 1 is the Bluetooth communication connection established between the Bluetooth accessory device 300 and the host device 100 .
  • the Bluetooth accessory device 400 establishes a Bluetooth routing service connection 2 with the host device 100. After that, the Bluetooth accessory device 400 can send a registration request 2 to the host device 100. The request includes the device type of the Bluetooth accessory device 400. The host device 100 saves the mapping relationship between the Bluetooth communication connection 2 and the device type of the Bluetooth accessory device 400 , where the Bluetooth communication connection 2 is the Bluetooth communication connection established between the Bluetooth accessory device 400 and the host device 100 .
  • the Bluetooth accessory device 500 establishes a Bluetooth routing service connection 3 with the host device 100. After that, the Bluetooth accessory device 500 can send a registration request 3 to the host device 100. The request includes the device type of the Bluetooth accessory device 500. The host device 100 saves the mapping relationship between the Bluetooth communication connection 3 and the device type of the Bluetooth accessory device 500 , where the Bluetooth communication connection 3 is the Bluetooth communication connection established between the Bluetooth accessory device 500 and the host device 100 .
  • step S901-step S903, step S904-step S906, step S907-step S909 are similar to the aforementioned steps S801-step S803 (or step S804-step S806) in the first stage shown in Figure 8, and the specific execution process can be Refer to the related text descriptions in steps S801 to S803 (or step S804 to S806) in the first phase shown in FIG. 8 , which will not be described again here.
  • the Bluetooth communication connections of multiple Bluetooth accessory devices can be switched based on the established Bluetooth routing service connection.
  • a possible implementation method of switching the Bluetooth communication connections of multiple Bluetooth accessory devices may be the implementation method described in the following stage 2 (step S910-step S920), which is described in detail below:
  • the Bluetooth accessory device 300 detects that the user triggers an event (ie, a switching event) to switch the Bluetooth communication connection from the host device 100 to the host device 200. After that, the Bluetooth accessory device 300 can send data 1 to the host device 100.
  • the data may include information about the switching event, the device type of the Bluetooth accessory device 400 , and the device type of the Bluetooth accessory device 500 .
  • the Bluetooth accessory device 300 is the keyboard illustrated in Figure 10. Referring to Figure 10, it can be seen that the Bluetooth accessory device 300 has an F8 button, an F9 button, and an F10 button. These three buttons (can also be called Bluetooth switching buttons) ) can be used to support Bluetooth pairing between the Bluetooth accessory device 300 and other devices and establish Bluetooth communication connections. That is to say, the Bluetooth accessory device 300 can have three Bluetooth channels, and the above three buttons can respectively correspond to one Bluetooth channel, and the Bluetooth accessory Device 300 can perform Bluetooth pairing with three other devices through these three Bluetooth channels and establish Bluetooth communication connections. After that, the user only needs to click the F8 button, F9 button, and F10 button to switch Bluetooth communication connections between devices without re-establishing the Bluetooth communication connection. Bluetooth pairing is quick and easy.
  • the accessory device when the accessory device (such as the Bluetooth accessory device 300) is in a working state, the accessory device can only perform data communication (such as Bluetooth data communication) with one of the host devices that has established a communication connection (such as a Bluetooth communication connection).
  • a certain host device that can perform data communication with the accessory device through an established communication connection can be called the focus host device of the accessory device.
  • the accessory device when the accessory device is a keyboard or a mouse, the accessory device is currently A certain host device that is operated or controlled can be called the focus host device of the accessory device; for another example, when the accessory device is a speaker, a certain host device that is currently controlling the accessory device can be called the focus host device of the accessory device. Focus host device.
  • the focus host device of the Bluetooth accessory device 300, the Bluetooth accessory device 400, and the Bluetooth accessory device 500 is the host device 100.
  • the Bluetooth accessory device 300, the Bluetooth accessory device 400, and the Bluetooth accessory device 500 are all host devices.
  • the focus host device of the accessory device 500 can be switched from the host device 100 to another host device (for example, the host device 200).
  • Bluetooth channel may refer to switching the focus host device of the Bluetooth accessory device from one host device to another host device. That is, before switching, the Bluetooth accessory device can communicate with one host device (e.g., the host device The Bluetooth communication connection established in 100) performs Bluetooth data communication with the host device (such as the host device 100); after switching, the Bluetooth accessory device can communicate with the host device through the Bluetooth communication connection established with another host device (such as the host device 200). A device (eg, host device 200) communicates Bluetooth data.
  • host device e.g., host device 200
  • the Bluetooth accessory device 300 has performed Bluetooth pairing with the host device 200 through the F9 button, and the current Bluetooth accessory The device 300 maintains a Bluetooth communication connection with the host device 100. Then, when the user wants to switch the current Bluetooth communication connection from the host device 100 to the host device 200 (that is, the Bluetooth accessory device 300 establishes a Bluetooth communication connection with the host device 200 for Bluetooth communication).
  • the Bluetooth accessory device 300 can detect the event that the user triggers the switching of the Bluetooth communication connection from the host device 100 to the host device 200 (for example, the event that the user presses the F9 button as shown in Figure 10). After that, the Bluetooth The accessory device 300 may send data 1 to the host device 100 through the Bluetooth routing service connection 1 established with the host device 100.
  • the data may include information about the switching event, the device type of the Bluetooth accessory device 400, and the device type of the Bluetooth accessory device 500.
  • the information about the switching event may include device information of the host device 200, for example, the Bluetooth Media Access Control (MAC) address of the host device 200, etc.
  • the Bluetooth MAC address of the host device 200 may be a complete Bluetooth MAC address; it may also be a partial Bluetooth MAC address, such as the last three digits of the Bluetooth MAC address, in order to improve security.
  • the device type of the Bluetooth accessory device 400 and the device type of the Bluetooth accessory device 500 can be the destination device type, which are preset and do not require manual setting by the user.
  • destination device types there may be one or more destination device types.
  • two destination device types are only used as an example, which shall not constitute any limitation.
  • the host device 100 determines that the destination device type is the device type of the Bluetooth accessory device 400 and the device type of the Bluetooth accessory device 500 based on the data 1, and determines the Bluetooth accessory based on the mapping relationship between the saved device type and the Bluetooth communication connection.
  • the Bluetooth communication connection corresponding to the device type of the device 400 is Bluetooth communication connection 2
  • the Bluetooth communication connection corresponding to the device type of the Bluetooth accessory device 500 is Bluetooth communication connection 3.
  • the host device 100 can send messages to the Bluetooth accessory device 400 and the Bluetooth accessory device respectively. 500 sends data 1.
  • the host device 100 can parse the data 1 and determine that the destination device type is the device type of the Bluetooth accessory device 400 or the device type of the Bluetooth accessory device 500. Further, in stage one, the host device 100 records and saves the mapping relationship between the device type of the Bluetooth accessory device 400 and the Bluetooth communication connection 2, and the mapping relationship between the device type of the Bluetooth accessory device 500 and the Bluetooth communication connection 3. , therefore, the host device 100 can determine that the Bluetooth communication connection corresponding to the device type of the Bluetooth accessory device 400 is Bluetooth communication connection 2 based on the saved mapping relationship between the device type and the Bluetooth communication connection, and the device type corresponding to the Bluetooth accessory device 500 The Bluetooth communication connection is Bluetooth communication connection 3.
  • the host device 100 may determine that the above data 1 needs to be sent to the Bluetooth accessory device 400 through the above Bluetooth communication connection 2, and the above data 1 needs to be sent to the Bluetooth accessory device 500 through the above Bluetooth communication connection 3. After that, the host device 100 can send the above data 1 to the Bluetooth accessory device 400 through the above Bluetooth communication connection 2, and send the above data 1 to the Bluetooth accessory device 500 through the above Bluetooth communication connection 3.
  • Step S913 may be executed before step S914; for another example, step S913 may be executed after step S914; for another example, step S913 may be executed simultaneously with step S914.
  • the Bluetooth accessory device 300 sends a Bluetooth broadcast message 1 to the host device 200. After that, the Bluetooth accessory device 300 establishes a Bluetooth communication connection 1 with the host device 200.
  • the Bluetooth accessory device 300 can parse the data 1 and determine based on the data 1 that a Bluetooth communication connection needs to be established with the host device 200. Further, the Bluetooth accessory device 300 can send a Bluetooth communication connection to the host device 200. Broadcast message 1, after receiving the Bluetooth broadcast message 1 sent by the Bluetooth accessory device 300, the host device 200 can establish a Bluetooth communication connection 1 with the Bluetooth accessory device 300, that is, the Bluetooth accessory device 300 successfully switches the Bluetooth channel to the host device 200, so , the Bluetooth accessory device 300 and the host device 200 can perform Bluetooth data communication based on the established Bluetooth communication connection 1.
  • steps S915 to S916 may be executed immediately after step S911, or may be executed at a certain time between execution of steps S911 to step S914. This is not limited in the embodiment of the present application.
  • the Bluetooth accessory device 400 sends a Bluetooth broadcast message 2 to the host device 200. After that, the Bluetooth accessory device 400 establishes a Bluetooth communication connection 2 with the host device 200.
  • the Bluetooth accessory device 400 can parse the data 1 and determine based on the data 1 that a Bluetooth communication connection needs to be established with the host device 200. Further, the Bluetooth accessory device 400 can send a request to the host device 200. After sending the Bluetooth broadcast message 2, the host device 200 can establish a Bluetooth communication connection 2 with the Bluetooth accessory device 400 after receiving the Bluetooth broadcast message 2 sent by the Bluetooth accessory device 400. That is, the Bluetooth accessory device 400 successfully switches the Bluetooth channel to the host device 200. , in this way, the Bluetooth accessory device 400 and the host device 200 can perform Bluetooth data communication based on the established Bluetooth communication connection 2.
  • steps S917 to S918 may be executed at a certain time after step S913, which is not limited in the embodiment of the present application.
  • the Bluetooth accessory device 500 sends a Bluetooth broadcast message 3 to the host device 200. After that, the Bluetooth accessory device 500 establishes a Bluetooth communication connection 3 with the host device 200.
  • the Bluetooth accessory device 500 can parse the data 1 and determine based on the data 1 that it is necessary to establish a Bluetooth communication connection with the host device 200. Further, the Bluetooth accessory device 500 can send a request to the host device 200. After sending the Bluetooth broadcast message 3, the host device 200 can establish a Bluetooth communication connection 3 with the Bluetooth accessory device 400 after receiving the Bluetooth broadcast message 3 sent by the Bluetooth accessory device 500. That is, the Bluetooth accessory device 500 successfully switches the Bluetooth channel to the host device 200. , in this way, the Bluetooth accessory device 500 and the host device 200 can perform Bluetooth data communication based on the established Bluetooth communication connection 3.
  • steps S919 to S920 may be executed at a certain time after step S914, which is not limited in the embodiment of the present application.
  • the Bluetooth accessory device 300, the Bluetooth accessory device 400, and the Bluetooth accessory device 500 may have performed Bluetooth pairing with the host device 200 and have not maintained a Bluetooth communication connection with the host device 200.
  • the above-mentioned Bluetooth broadcast message 1, Bluetooth broadcast message 2, and Bluetooth broadcast message 3 can be respectively called Bluetooth reconnection broadcast message 1, Bluetooth reconnection broadcast message 2, and Bluetooth reconnection broadcast message 3.
  • the Bluetooth accessory device 300, Bluetooth Both the Bluetooth accessory device 400 and the Bluetooth accessory device 500 can maintain Bluetooth communication connections with multiple host devices. For example, they maintain Bluetooth communication connections with the host device 100 and the host device 200 at the same time. In this case, the Bluetooth accessory device does not need to send The Bluetooth broadcast message can switch the Bluetooth communication connection from the host device 100 to the host device 200 .
  • Bluetooth pairing needs to be performed before establishing a Bluetooth communication connection.
  • the pairing can only be established after the pairing is successful. Bluetooth communication connection.
  • step S901 to step S909 in phase one shown in Figure 9. Reference can be made to the related text descriptions of step S901 to step S909, which will not be described again here.
  • the Bluetooth accessory device 500 500 can also send a message that the switching event processing is completed to the Bluetooth accessory device 300 through the host device 200.
  • the Bluetooth accessory device 300 can learn the processing results of the switching event by the Bluetooth accessory device 400 and the Bluetooth accessory device 500.
  • the specific execution process of the Bluetooth accessory device 400 and the Bluetooth accessory device 500 sending the switching event processing completion message to the Bluetooth accessory device 300 through the host device 200 is similar to the specific execution process of steps S816 to S821 shown in Figure 8. It can be Refer to the foregoing relevant text descriptions of steps S816 to S821, which will not be described again here.
  • the Bluetooth accessory device can maintain Bluetooth communication connections with multiple host devices at the same time (but can only conduct Bluetooth data communication with one of the host devices).
  • the Bluetooth accessory device can only switch Bluetooth channels without re-establishing a Bluetooth communication connection; the Bluetooth accessory device can also maintain a Bluetooth communication connection with only one host device (i.e., with one host device).
  • the Bluetooth communication connection established with another host device can be disconnected).
  • the Bluetooth accessory device needs to re-establish the Bluetooth communication connection.
  • the Bluetooth communication connections of multiple Bluetooth accessory devices can be automatically switched from one host device by operating a Bluetooth accessory device (for example, pressing the Bluetooth switching button of a Bluetooth accessory device). to another host device, the solution is simple, the registration and routing mechanisms can be made user-free, and automatic collaboration of multiple devices can be realized in one step, which is convenient and fast, simplifying user operations and improving user experience.
  • the above-mentioned embodiment shown in FIG. 9 only operates the Bluetooth accessory device 300 to automatically switch the Bluetooth communication connections of the two Bluetooth accessory devices 300 and 400 from one host device to the other.
  • the Bluetooth accessory device 300 can also enable the Bluetooth communication connections of a larger number of Bluetooth accessory devices to automatically switch from one host device to another host device.
  • the embodiments of this application apply to Bluetooth The number of accessories is not limited.
  • the Bluetooth accessory device 400 or the Bluetooth accessory device 500 can also implement automatic switching of the Bluetooth communication connection of other Bluetooth accessory devices from one host device to another host device in a similar manner, which will not be described again here.
  • the Bluetooth accessory device After the Bluetooth accessory device establishes a Bluetooth communication connection with the host device 200, you can also operate one Bluetooth accessory device to switch the Bluetooth communication connections of multiple Bluetooth accessory devices from the host device 200 to the host device 100.
  • the specific process is as follows. The aforementioned specific process of switching the Bluetooth communication connection from the host device 100 to the host device 200 is similar and will not be described again.
  • Embodiment 2 Use a Bluetooth accessory device (such as a keyboard) to control another Bluetooth accessory device (such as a mouse) to perform DPI adjustment.
  • a Bluetooth accessory device such as a keyboard
  • another Bluetooth accessory device such as a mouse
  • Figure 11 exemplarily shows the specific process of the communication method provided by the embodiment of the present application in the application scenario of controlling another Bluetooth accessory device (such as a mouse) to perform DPI adjustment through a Bluetooth accessory device (such as a keyboard).
  • another Bluetooth accessory device such as a mouse
  • this method can be applied to a communication system including a host device 100, a Bluetooth accessory device 300 (such as a keyboard), and a Bluetooth accessory device 400 (such as a mouse).
  • a host device 100 such as a keyboard
  • a Bluetooth accessory device 300 such as a keyboard
  • a Bluetooth accessory device 400 such as a mouse
  • a Bluetooth routing service connection needs to be established between the host device 100 and the Bluetooth accessory device 300 and the Bluetooth accessory device 400, and the Bluetooth accessory device 300 and the Bluetooth accessory device 400 need to register the device type with the host device 100.
  • each step in the following phase two can be continued to control the Bluetooth accessory device 400 to adjust the DPI through the Bluetooth accessory device 300 .
  • a possible implementation method of establishing a Bluetooth routing service connection and registering a device type may be the implementation method described in the following phase one (step S1101-step S1106), which is described in detail below:
  • the Bluetooth accessory device 300 establishes a Bluetooth routing service connection 1 with the host device 100. After that, the Bluetooth accessory device 300 can send a registration request 1 to the host device 100. The request includes the device type of the Bluetooth accessory device 300. The host device 100 saves the mapping relationship between the Bluetooth communication connection 1 and the device type of the Bluetooth accessory device 300 , where the Bluetooth communication connection 1 is the Bluetooth communication connection established between the Bluetooth accessory device 300 and the host device 100 .
  • the Bluetooth accessory device 400 establishes a Bluetooth routing service connection 2 with the host device 100. After that, the Bluetooth accessory device 400 can send a registration request 2 to the host device 100. The request includes the device type of the Bluetooth accessory device 400.
  • the host device 100 saves the mapping relationship between the Bluetooth communication connection 2 and the device type of the Bluetooth accessory device 400 , where the Bluetooth communication connection 2 is the Bluetooth communication connection established between the Bluetooth accessory device 400 and the host device 100 .
  • steps S1101-step S1103, step S1104-step S1106 are similar to the steps S801-step S803 (or step S804-step S806) in the first stage shown in Figure 8.
  • the specific execution process can be referred to the aforementioned Figure 8. Relevant text descriptions in steps S801 to S803 (or steps S804 to S806) in phase one are shown and will not be repeated here.
  • the Bluetooth accessory device 400 can be controlled by the Bluetooth accessory device 300 to adjust the DPI based on the established Bluetooth routing service connection.
  • a possible implementation method of controlling the Bluetooth accessory device 400 to adjust the DPI through the Bluetooth accessory device 300 may be the implementation method described in the following stage two (step S1107-step S1111), which will be introduced in detail below:
  • Stage 2 Control the Bluetooth accessory device 400 through the Bluetooth accessory device 300 to adjust the DPI
  • the Bluetooth accessory device 300 detects that the user triggers an event to adjust DPI. After that, the Bluetooth accessory device 300 can send data 2 to the host device 100.
  • the data may include information on adjusting the DPI event and the device type of the Bluetooth accessory device 400. .
  • the Bluetooth accessory device 300 is the keyboard as exemplarily shown in FIG. 10 and the Bluetooth accessory device 400 is a mouse.
  • Dpi button also called a DPI button
  • This button can be used to support the user to control the Bluetooth accessory device 400 to adjust the DPI through the Bluetooth accessory device 300.
  • the Bluetooth accessory device 300 can detect the event that the user triggers the DPI adjustment (for example, the event that the user presses the Dpi button shown in Figure 10), Afterwards, the Bluetooth accessory device 300 may send data 2 to the host device 100 through the Bluetooth routing service connection 1 established with the host device 100.
  • the data may include information on adjusting DPI events and the device type of the Bluetooth accessory device 400.
  • the above-mentioned information for adjusting the DPI event may include the key value of the Dpi button.
  • the DPI can be adjusted using a polling method, that is to say, the Bluetooth accessory device 300 is used to control the Bluetooth accessory device 400 to adjust the DPI, and the adjustable DPI value can be a preset value.
  • the set of values is ⁇ 100, 200, 300, 400,...,16000 ⁇
  • the DPI value corresponding to the event when the user presses the Dpi button for the first time is 100
  • the event corresponding to the second press of the Dpi button corresponds to
  • the DPI value is 200, and so on.
  • the DPI value corresponding to the event when the user presses the Dpi button is 16000
  • the DPI value of the Bluetooth accessory device 400 can be adjusted once, that is, the DPI value of the Bluetooth accessory device 400 is adjusted to the event corresponding to each time the Dpi button is pressed.
  • the DPI value wherein the DPI value corresponding to each event of the user pressing the Dpi button (ie, each value in the above value set) may be preset by the Bluetooth accessory device 400 and stored on the Bluetooth accessory device 400 .
  • the event of the user pressing the Dpi button is used as an example to trigger the adjustment of the DPI. That is, the pressing event triggers the adjustment of the DPI, and the release event no longer triggers the adjustment of the DPI.
  • the user may also release the button.
  • the event of the Dpi button triggers the DPI adjustment, that is, the pressing event does not trigger the DPI adjustment, but the releasing event triggers the DPI adjustment.
  • a single Dpi button is used as an example to trigger adjustment of DPI.
  • the Dpi button can be a pair of buttons, one for increasing DPI. For example, every time the user presses the button, the Bluetooth accessory The DPI value of the device 400 can be increased once; the other one is used to decrease the DPI. For example, every time the user presses the button, the DPI value of the Bluetooth accessory device 400 can be decreased once.
  • a combination of keys may also be defined to control the Bluetooth accessory device 400 to adjust the DPI through the Bluetooth accessory device 300 .
  • the above-mentioned information for adjusting the DPI event may include the key value of the key combination pressed by the user.
  • the Fn+Home key combination For example, you can define the Fn+Home key combination to increase the DPI, and you can define the Fn+End key combination to decrease the DPI. It is easy to understand that every time the user presses the Fn+Home button combination of the Bluetooth accessory device 300, the DPI value of the Bluetooth accessory device 400 can be increased once, and each time the user presses the Fn+End button combination of the Bluetooth accessory device 300 By pressing the button, the DPI value of the Bluetooth accessory device 400 can be decreased once, and the DPI value increased/decreased each time can be preset.
  • the host device 100 determines that the destination device type is the device type of the Bluetooth accessory device 400 based on data 2, and determines the Bluetooth device type corresponding to the device type of the Bluetooth accessory device 400 based on the saved mapping relationship between the device type and the Bluetooth communication connection.
  • the communication connection is Bluetooth communication connection 2. After that, the host device 100 can send data 2 to the Bluetooth accessory device 400.
  • the host device 100 may parse the data 2 and determine that the destination device type is the device type of the Bluetooth accessory device 400 . Further, since the host device 100 records and saves the mapping relationship between the device type of the Bluetooth accessory device 400 and the Bluetooth communication connection 2 in phase one, the host device 100 can based on the saved device type and the Bluetooth communication connection 2. The mapping relationship between the two determines that the Bluetooth communication connection corresponding to the device type of the Bluetooth accessory device 400 is Bluetooth communication connection 2. Further, the host device 100 may determine that it is necessary The above data 2 is to be sent to the Bluetooth accessory device 400 through the above Bluetooth communication connection 2. Afterwards, the host device 100 can send the above data 2 to the Bluetooth accessory device 400 through the above Bluetooth communication connection 2.
  • the Bluetooth accessory device 400 performs actions corresponding to the adjustment DPI event.
  • the Bluetooth accessory device 400 can parse the data 2 and perform an action corresponding to the adjustment DPI event based on the information included in the data 2 to adjust the DPI event, that is, respond to the DPI. setting.
  • the Bluetooth accessory device 400 can perform the adjustment.
  • the Bluetooth accessory device 400 can perform the action of increasing the DPI, thereby completing the increasing setting of the DPI.
  • the Bluetooth accessory device 400 when the user presses the DPI reduction key combination of the Bluetooth accessory device 300 (such as the Fn+End key combination), the above-mentioned adjustment DPI event information indicates to reduce the DPI of the Bluetooth accessory device 400. Then, the Bluetooth accessory device 400 can perform the action of reducing the DPI, thereby completing the DPI reduction setting.
  • the Bluetooth accessory device 400 after the Bluetooth accessory device 400 completes the action corresponding to the adjustment DPI event, it can also send a message that the adjustment DPI event processing is completed to the Bluetooth accessory device 300 through the host device 100. In this way, the Bluetooth accessory device 300 can learn about the Bluetooth accessory device 300.
  • the processing result of the event of adjusting DPI by the accessory device 400 the specific execution process of the Bluetooth accessory device 400 sending the message that the adjustment DPI event processing is completed to the Bluetooth accessory device 300 through the host device 100 is similar to the specific execution process of steps S816 to S821 shown in Figure 8. You can refer to the above steps. S816 - The relevant text description of step S821 will not be described again here.
  • another Bluetooth accessory device such as a mouse
  • a Bluetooth accessory device such as a keyboard
  • Embodiment 3 Control another Bluetooth accessory device (such as a mouse) through one Bluetooth accessory device (such as a keyboard) to adjust the lighting effect.
  • a Bluetooth accessory device such as a mouse
  • Figure 12 exemplarily shows the specific process of the communication method provided by the embodiment of the present application in the application scenario of controlling another Bluetooth accessory device (such as a mouse) to adjust the lighting effect through a Bluetooth accessory device (such as a keyboard).
  • another Bluetooth accessory device such as a mouse
  • a Bluetooth accessory device such as a keyboard
  • this method can be applied to a communication system including a host device 100 , a Bluetooth accessory device 300 (such as a keyboard), and a Bluetooth accessory device 400 (such as a mouse).
  • a host device 100 such as a keyboard
  • a Bluetooth accessory device 300 such as a keyboard
  • a Bluetooth accessory device 400 such as a mouse
  • a Bluetooth routing service connection needs to be established between the host device 100 and the Bluetooth accessory device 300 and the Bluetooth accessory device 400, and the Bluetooth accessory device 300 and the Bluetooth accessory device 400 need to register the device type with the host device 100.
  • each step in the following phase two can be continued to control the Bluetooth accessory device 400 to adjust the lighting effect through the Bluetooth accessory device 300 .
  • a possible implementation method of establishing a Bluetooth routing service connection and registering a device type may be the implementation method described in the following phase one (step S1201-step S1206), which is described in detail below:
  • the Bluetooth accessory device 300 establishes a Bluetooth routing service connection 1 with the host device 100. After that, the Bluetooth accessory device 300 can send a registration request 1 to the host device 100. The request includes the device type of the Bluetooth accessory device 300. The host device 100 saves the mapping relationship between the Bluetooth communication connection 1 and the device type of the Bluetooth accessory device 300 , where the Bluetooth communication connection 1 is the Bluetooth communication connection established between the Bluetooth accessory device 300 and the host device 100 .
  • the Bluetooth accessory device 400 establishes a Bluetooth routing service connection 2 with the host device 100. After that, the Bluetooth accessory device 400 can send a registration request 2 to the host device 100. The request includes the device type of the Bluetooth accessory device 400.
  • the host device 100 saves the mapping relationship between the Bluetooth communication connection 2 and the device type of the Bluetooth accessory device 400 , where the Bluetooth communication connection 2 is the Bluetooth communication connection established between the Bluetooth accessory device 400 and the host device 100 .
  • steps S1201-step S1203, step S1204-step S1206 are similar to the steps S801-step S803 (or step S804-step S806) in the first stage shown in Figure 8.
  • the specific execution process can be referred to the aforementioned Figure 8. Relevant text descriptions in steps S801 to S803 (or steps S804 to S806) in phase one are shown and will not be repeated here.
  • the Bluetooth accessory device 300 can be used to control the Bluetooth accessory device 400 to adjust the lighting effect based on the established Bluetooth routing service connection.
  • a possible implementation method of controlling the Bluetooth accessory device 400 to adjust the light effect through the Bluetooth accessory device 300 may be the implementation method described in the following stage two (step S1207-step S1211), which is described in detail below:
  • Phase 2 Control the Bluetooth accessory device 400 to adjust the lighting effect through the Bluetooth accessory device 300
  • the Bluetooth accessory device 300 detects that the user triggers an event to adjust the lighting effect. After that, the Bluetooth accessory device 300 can send data 3 to the host device 100.
  • the data may include information about the lighting effect adjustment event and the information of the Bluetooth accessory device 400. Equipment type.
  • the Bluetooth accessory device 300 is the keyboard as exemplarily shown in FIG. 10 and the Bluetooth accessory device 400 is a mouse.
  • the Bluetooth accessory device 300 has a LightUp button and a LightDown button. These two buttons can support the user to control the Bluetooth accessory device 400 to adjust the light effect through the Bluetooth accessory device 300.
  • the LightUp button can support the user to adjust the lighting effect through the Bluetooth accessory device 300.
  • the Bluetooth accessory device 300 is used to control the Bluetooth accessory device 400 to increase the brightness of the light effect.
  • the LightDown button can support the user to control the Bluetooth accessory device 400 to reduce the brightness of the light effect through the Bluetooth accessory device 300 .
  • the Bluetooth accessory device 300 can detect the event that the user triggers the adjustment of the lighting effect (for example, the event that the user presses the LightUp button shown in Figure 10 , or the user presses the LightDown button event shown in Figure 10). After that, the Bluetooth accessory device 300 can send data 3 to the host device 100 through the Bluetooth routing service connection 1 established with the host device 100.
  • the data may include adjustment Information about the lighting effect event and the device type of the Bluetooth accessory device 400.
  • the above information of the event for adjusting the light effect may include the key value of the LightUp button; when the event triggered by the user to adjust the light effect When the event is that the user presses the LightDown button as shown in Figure 10, the above-mentioned information for adjusting the light effect event may include the key value of the LightDown button.
  • a combination of keys can also be defined to control the Bluetooth accessory device 400 to adjust the lighting effect through the Bluetooth accessory device 300 .
  • the information of the lighting effect event may include the key value of the key combination pressed by the user.
  • the key combination Fn+PageUp can be defined to increase the brightness of the lighting effect
  • the key combination Fn+PageDown can be defined to decrease the brightness of the lighting effect
  • the brightness value of the light effect of the Bluetooth accessory device 400 can be increased once. Every time the user presses the Fn of the Bluetooth accessory device 300 With the +PageDown key combination or the LightDown key, the brightness value of the light effect of the Bluetooth accessory device 400 can be reduced once, and the brightness value of the light effect each time it is increased/decreased can be preset.
  • the host device 100 determines that the destination device type is the device type of the Bluetooth accessory device 400 based on data 3, and determines the Bluetooth device type corresponding to the device type of the Bluetooth accessory device 400 based on the saved mapping relationship between the device type and the Bluetooth communication connection.
  • the communication connection is Bluetooth communication connection 2. After that, the host device 100 can send data 3 to the Bluetooth accessory device 400.
  • the host device 100 may parse the data 3 and determine that the destination device type is the device type of the Bluetooth accessory device 400 . Further, since the host device 100 records and saves the mapping relationship between the device type of the Bluetooth accessory device 400 and the Bluetooth communication connection 2 in phase one, the host device 100 can based on the saved device type and the Bluetooth communication connection 2. The mapping relationship between the two determines that the Bluetooth communication connection corresponding to the device type of the Bluetooth accessory device 400 is Bluetooth communication connection 2. Further, the host device 100 may determine that the above data 3 needs to be sent to the Bluetooth accessory device 400 through the above Bluetooth communication connection 2 . Afterwards, the host device 100 can send the above data 3 to the Bluetooth accessory device 400 through the above Bluetooth communication connection 2.
  • the Bluetooth accessory device 400 performs actions corresponding to the lighting effect adjustment event.
  • the Bluetooth accessory device 400 can parse the data 3, and perform the action corresponding to the lighting effect adjustment event based on the information of the lighting effect adjustment event included in the data 3, that is, adjust the light effect. Make the appropriate settings accordingly.
  • the Bluetooth accessory The device 400 can perform an action of increasing the brightness of the lighting effect, thereby completing the setting of increasing the brightness of the lighting effect.
  • the Bluetooth The accessory device 400 can perform an action of reducing the brightness of the lighting effect, thereby completing the setting of reducing the brightness of the lighting effect.
  • the Bluetooth accessory device 300 may also be provided with a button for switching light effect modes (such as always on, breathing, colorful, wave, colorful cycle, trigger, etc. modes shown in FIG. 4B ), such as a single button. button or combination of buttons.
  • the Bluetooth accessory device 300 can also adjust the mode of the lighting effect of the Bluetooth accessory device 400 in a manner similar to the above-mentioned adjustment of the brightness of the lighting effect. That is to say, the Bluetooth accessory device 300 can adjust the mode of the lighting effect by
  • the host device 100 sends the key value of a single key or a combination of keys for switching the mode of lighting effects to the Bluetooth accessory device 400.
  • the Bluetooth accessory device 400 can switch the key value of the Bluetooth accessory device 400 based on the key value of a single key or combination of keys for switching the mode of lighting effects. Lighting mode.
  • the Bluetooth accessory device 400 after the Bluetooth accessory device 400 completes the action corresponding to the adjustment of the lighting effect event, it can also send a message that the adjustment of the lighting effect event is completed to the Bluetooth accessory device 300 through the host device 100. In this way, the Bluetooth accessory device 300 can Learn the processing result of the event of adjusting the lighting effect by the Bluetooth accessory device 400.
  • 400 Bluetooth accessory devices The specific execution process of sending the message that the lighting effect event processing is completed through the host device 100 to the Bluetooth accessory device 300 is similar to the specific execution process of step S816 to step S821 shown in FIG. 8 , and you can refer to the aforementioned step S816 to step S821. The relevant text descriptions will not be repeated here.
  • one Bluetooth accessory device such as a keyboard
  • another Bluetooth accessory device such as a mouse
  • Programs are used to adjust the lighting effect of Bluetooth accessory devices, and there is no need to add buttons on the Bluetooth accessory device to adjust the lighting effects, which can not only reduce costs, but also allow for a simpler appearance design.
  • Embodiment 4 A Bluetooth accessory device (such as a keyboard) and another Bluetooth accessory device (such as a mouse) cooperate to implement a combination key function.
  • a Bluetooth accessory device such as a keyboard
  • another Bluetooth accessory device such as a mouse
  • Figure 13 exemplarily shows the specific process of the communication method provided by the embodiment of the present application in an application scenario in which a Bluetooth accessory device (such as a keyboard) and another Bluetooth accessory device (such as a mouse) cooperate to implement a combination key function.
  • a Bluetooth accessory device such as a keyboard
  • another Bluetooth accessory device such as a mouse
  • this method can be applied to a communication system including a host device 100, a Bluetooth accessory device 300 (eg, keyboard), and a Bluetooth accessory device 400 (eg, mouse).
  • a host device 100 e.g., a personal computer
  • a Bluetooth accessory device 300 e.g, keyboard
  • a Bluetooth accessory device 400 e.g, mouse
  • a Bluetooth routing service connection needs to be established between the host device 100 and the Bluetooth accessory device 300 and the Bluetooth accessory device 400, and the Bluetooth accessory device 300 and the Bluetooth accessory device 400 need to register the device type with the host device 100.
  • the Bluetooth routing service connection is established and the device type is registered, each step in the following phase two can be continued to implement the combined button function through the Bluetooth accessory device 300 and the Bluetooth accessory device 400 .
  • a possible implementation method of establishing a Bluetooth routing service connection and registering a device type may be the implementation method described in the following phase one (step S1301-step S1306), which is described in detail below:
  • the Bluetooth accessory device 300 establishes a Bluetooth routing service connection 1 with the host device 100. After that, the Bluetooth accessory device 300 can send a registration request 1 to the host device 100. The request includes the device type of the Bluetooth accessory device 300. The host device 100 saves the mapping relationship between the Bluetooth communication connection 1 and the device type of the Bluetooth accessory device 300 , where the Bluetooth communication connection 1 is the Bluetooth communication connection established between the Bluetooth accessory device 300 and the host device 100 .
  • the Bluetooth accessory device 400 establishes a Bluetooth routing service connection 2 with the host device 100. After that, the Bluetooth accessory device 400 can send a registration request 2 to the host device 100. The request includes the device type of the Bluetooth accessory device 400.
  • the host device 100 saves the mapping relationship between the Bluetooth communication connection 2 and the device type of the Bluetooth accessory device 400 , where the Bluetooth communication connection 2 is the Bluetooth communication connection established between the Bluetooth accessory device 400 and the host device 100 .
  • steps S1301-step S1303, step S1304-step S1306 are similar to the steps S801-step S803 (or step S804-step S806) in the first stage shown in Figure 8.
  • the specific execution process can be referred to the aforementioned Figure 8. Relevant text descriptions in steps S801 to S803 (or steps S804 to S806) in phase one are shown and will not be repeated here.
  • the combined button function can be collaboratively implemented through the Bluetooth accessory device 300 and the Bluetooth accessory device 400 based on the established Bluetooth routing service connection.
  • the Bluetooth accessory device 300 and the Bluetooth accessory device 400 cooperate to realize a combination key function.
  • Possible implementation methods may be the implementation methods described in the following phase two (step S1307-step S1320), which are introduced in detail below:
  • Phase 2 Implement the combined button function through collaboration between the Bluetooth accessory device 300 and the Bluetooth accessory device 400
  • the Bluetooth accessory device 400 detects the event that the user presses button 1. After that, the Bluetooth accessory device 300 can send data 4 to the host device 100.
  • the data may include information about the event of pressing button 1, the Bluetooth accessory device 300 device type.
  • the Bluetooth accessory device 400 can detect the event that the user presses button 1, where button 1 can be a certain button of the Bluetooth accessory device 400, for example, Side buttons of the Bluetooth accessory device 400 . Afterwards, the Bluetooth accessory device 400 may send data 4 to the host device 100, which data may include information about the button 1 press event and the device type of the Bluetooth accessory device 300.
  • the information about the above-mentioned event of pressing button 1 may include the key value of button 1 and indication information of the pressed state.
  • the host device 100 determines that the destination device type is the device type of the Bluetooth accessory device 300 based on the data 4, and determines the Bluetooth device type corresponding to the device type of the Bluetooth accessory device 300 based on the saved mapping relationship between the device type and the Bluetooth communication connection.
  • the communication connection is Bluetooth communication connection 1. After that, the host device 100 can send data 4 to the Bluetooth accessory device 300.
  • the host device 100 may parse the data 4 and determine that the destination device type is the device type of the Bluetooth accessory device 300 . Furthermore, since the host device 100 records and saves the mapping relationship between the device type of the Bluetooth accessory device 300 and the Bluetooth communication connection 1 in stage one, the host device 100 can based on the saved device type and the Bluetooth communication connection 1. The mapping relationship between the two determines that the Bluetooth communication connection corresponding to the device type of the Bluetooth accessory device 300 is Bluetooth communication connection 1. Further, the host device 100 may determine that the above data 4 needs to be sent to the Bluetooth accessory device 300 through the above Bluetooth communication connection 1 . Afterwards, the host device 100 can send the above data 4 to the Bluetooth accessory device 300 through the above Bluetooth communication connection 1.
  • the Bluetooth accessory device 300 saves the pressed state of button 1.
  • the Bluetooth accessory device 300 can parse the data 4 and determine that the button 1 is in a pressed state based on the information of the button 1 pressed event included in the data 4. Further, The Bluetooth accessory device 300 can save the state of pressing button 1 (which can also be called saving the event of pressing button 1).
  • the Bluetooth accessory device 300 detects the event that the user presses button 2. After that, the Bluetooth accessory device 300 can convert the state of pressing button 1 and the event of pressing button 2 into an event of pressing combination key 1. After that, , the Bluetooth accessory device 300 can send the key value of the combination key 1 to the host device 100, and the host device 100 responds with the function corresponding to the key value of the combination key 1.
  • the Bluetooth accessory device 300 may detect the event that the user presses button 2, where button 2 may be a certain button of the Bluetooth accessory device 300. Afterwards, the Bluetooth accessory device 300 may convert the state of pressing button 1 (which may also be called an event of pressing button 1) and the event of pressing button 2 into an event of pressing combination key 1.
  • the key combination 1 may be a certain key combination of the Bluetooth accessory device 300, for example, the key combination Fn+Fx. For example, assuming that key combination 1 is Fn+F1, then the above event of pressing key 1 can be converted into an event of pressing Fn key, and the above event of pressing key 2 is an event of pressing F1 key.
  • the Bluetooth accessory device 300 can send the key value of the above-mentioned combination key 1 to the host device 100. After the host device receives the key value of the above-mentioned combination key 1 sent by the Bluetooth accessory device 300, the host device 100 can respond to the above-mentioned group.
  • the Bluetooth accessory device 300 and the Bluetooth accessory device 400 can be used to collaboratively realize the combined button function.
  • the existing technology is to define the function of the above-mentioned button 1 on the Bluetooth accessory device 400.
  • the Bluetooth accessory device 400 can send the key value of the above-mentioned button 1 to the host device 100.
  • the host device 100 can respond to the function corresponding to the key value of the above-mentioned button 1, so that one button of the Bluetooth accessory device 400 can only realize one function. It can be seen that by implementing this solution, after the user presses the above-mentioned button 1, he can then By pressing the buttons of the Bluetooth accessory device 300, one or more key combinations are formed, thereby realizing multiple functions.
  • the Bluetooth accessory device 300 can change the function of a single button on the Bluetooth accessory device 300. For example, after button 1 is pressed, QWERT can be converted to YUIOP, A S D F G can be converted to H JKL, ZXCV B can be converted to NM,./, Caps can be converted to Enter, etc. It is easy to understand that in this case, assuming that the above-mentioned key 2 is the Q key, then the above-mentioned combined key 1 is the Y key.
  • buttons of the Bluetooth accessory device 300 can cover the functions of all buttons, and one-button multi-function can reduce the number of buttons of the Bluetooth accessory device 300 and reduce the size of the Bluetooth accessory device 300 without modifying the button size or cropping the Bluetooth accessory device. 300 key functions can also meet the needs of users.
  • the Bluetooth accessory device 400 detects the event that the user releases button 1. After that, the Bluetooth accessory device 400 can send data 5 to the host device 100.
  • the data may include information about the event of releasing button 1, the Bluetooth accessory device 300 device type.
  • the Bluetooth accessory device 400 can also detect the event that the user releases button 1. After that, the Bluetooth accessory device 400 can send data 5 to the host device 100, and the data can It includes information about the release button 1 event and the device type of the Bluetooth accessory device 300 .
  • the information of the above-mentioned release button 1 event may include the key value of button 1 and indication information of the release state.
  • the host device 100 determines that the destination device type is the device type of the Bluetooth accessory device 300 based on the data 5, and determines the Bluetooth corresponding to the device type of the Bluetooth accessory device 300 based on the saved mapping relationship between the device type and the Bluetooth communication connection.
  • the communication connection is Bluetooth communication connection 1. After that, the host device 100 can send data 5 to the Bluetooth accessory device 300.
  • the host device 100 may parse the data 5 and determine that the destination device type is the device type of the Bluetooth accessory device 300 . Furthermore, since the host device 100 records and saves the mapping relationship between the device type of the Bluetooth accessory device 300 and the Bluetooth communication connection 1 in stage one, the host device 100 can based on the saved device type and the Bluetooth communication connection 1. The mapping relationship between the two determines that the Bluetooth communication connection corresponding to the device type of the Bluetooth accessory device 300 is Bluetooth communication connection 1. Further, the host device 100 may determine that the above data 5 needs to be sent to the Bluetooth accessory device 300 through the above Bluetooth communication connection 1 . Afterwards, the host device 100 can send the above data 5 to the Bluetooth accessory device 300 through the above Bluetooth communication connection 1.
  • the Bluetooth accessory device 300 clears the pressed state of button 1.
  • the Bluetooth accessory device 300 can parse the data 5, And based on the information of the button 1 release event included in the data 5, it is determined that button 1 is in a released state. Further, the Bluetooth accessory device 300 can clear the pressed state of button 1.
  • the Bluetooth accessory device 300 clears the pressed state of button 1, it cannot cooperate with the Bluetooth accessory device 400 to realize the function of the aforementioned combination button. For example, if the user wants to realize the function corresponding to Fn+Fx at this time, the user needs to Press the Fn button and Fx button of the Bluetooth accessory device 300.
  • the Bluetooth accessory device 300 can restore the function of a single button that was changed when button 1 was in the pressed state, for example, QWERT that was converted to YUIOP Restore the function of A S D F G converted to H JKL; Restore the function of ZXCV B converted to NM,./ Restore the function of Caps converted to Enter ,etc. That is to say, whichever button of the Bluetooth accessory device 300 is pressed by the user, the host device 100 will respond to the function corresponding to the key value of that button.
  • the Bluetooth accessory device 300 clears the pressed state of button 1 by deleting the recorded pressed state of button 1. In some embodiments, the Bluetooth accessory device 300 clears the pressed state of button 1.
  • the pressed state of 1 can also be another possible implementation.
  • the Bluetooth accessory device 300 can mark differently when button 1 is pressed or released. For example, the pressed state is marked with the number 1. , the released state is marked with a number 0. In this case, the Bluetooth accessory device 300 sets the originally marked number 1 to a number 0 to indicate that button 1 is in a released state, that is, the user has released button 1.
  • the information about the button status of the Bluetooth accessory device 400 can be synchronized to the Bluetooth accessory device 300 (such as a keyboard).
  • the buttons on the Bluetooth accessory device 400 and Bluetooth The buttons on the accessory device 300 can form a combination key (for example, the side buttons on the Bluetooth accessory device 400 and the Fx button on the Bluetooth accessory device 300 can form a combination key with the same function as Fn+Fx on the Bluetooth accessory device 400), without the need for the user Frequent switching between the mouse and keyboard reduces user fatigue; on the other hand, the buttons on the Bluetooth accessory device 300 can implement different functions according to the different button states of the Bluetooth accessory device 400.
  • a certain button on the Bluetooth accessory device 400 When the button is pressed, the function of the button on the Bluetooth accessory device 300 can be changed (for example, QWERT on the Bluetooth accessory device 300 is converted into YUIOP respectively), one-button multi-function, reducing the number of buttons on the Bluetooth accessory device 300 and reducing the size of the Bluetooth accessory device 300 size, it can also meet the needs of users.
  • one Bluetooth accessory device communicates with another Bluetooth accessory device through the host device. That is to say, the Bluetooth accessory device serves as a slave device, and the two slave devices communicate through a host device.
  • the host device can also serve as a slave device to establish a Bluetooth routing service connection with another host device (ie, an intermediate host device) and register the device type with the host device, so that the host device can communicate with the host device and the host device.
  • a Bluetooth communication connection is not directly established with a Bluetooth accessory device, communication can be carried out through an intermediate host device, which is more convenient and improves user experience.
  • FIG. 14 is a schematic diagram of communication through an intermediate host device (such as a mobile phone) when a Bluetooth accessory device (such as a Bluetooth bracelet) and a host device (such as a tablet) do not directly establish a Bluetooth communication connection.
  • a Bluetooth accessory device such as a Bluetooth bracelet
  • a host device such as a tablet
  • the Bluetooth bracelet and tablet can be used as slave devices, and the mobile phone can be used as an intermediate host device.
  • the Bluetooth bracelet and tablet have respectively established Bluetooth routing service connections with the mobile phone, and registered the device type with the mobile phone. , through the Bluetooth routing function on the mobile phone, the tablet can communicate with the bracelet, for example, to obtain relevant information about the bracelet, or to make relevant settings for the bracelet, etc.
  • FIG. 15 is a schematic diagram of communication through an intermediate host device (such as a personal computer) when a host device (such as a mobile phone) and another host device (such as a tablet) do not directly establish a Bluetooth communication connection.
  • a host device such as a mobile phone
  • another host device such as a tablet
  • a Bluetooth communication connection Take mobile phones, tablets, and personal computers as examples. Mobile phones and tablets can be used as slave devices, and personal computers can be used as intermediate host devices. Mobile phones and tablets have established Bluetooth routing service connections with the personal computer respectively, and registered device types with the personal computer. With the Bluetooth routing function on the personal computer, the mobile phone can communicate with the tablet.
  • the communication connection established between the host device and the Bluetooth accessory device is a Bluetooth communication connection as an example. It is not limited to this and may also be a wired communication connection. Connection, or other wireless connection (such as WiFi connection, etc.), or a combination of wired connection and wireless connection, etc., are not limited in the embodiments of the present application.
  • Embodiment 5 The host device sends device information of other Bluetooth accessory devices to other host devices through the Bluetooth accessory device, so that the other host devices automatically establish Bluetooth communication connections with other Bluetooth accessory devices.
  • Figure 16 exemplarily shows the specific process of the communication method provided by the embodiment of the present application in the application scenario in which multiple Bluetooth accessory devices respectively establish Bluetooth communication connections with multiple host devices.
  • this method can be applied to a communication system including a host device 100, a host device 200, a Bluetooth accessory device 300 (such as a keyboard), and a Bluetooth accessory device 400 (such as a mouse).
  • a host device 100 a host device 100
  • a host device 200 a Bluetooth accessory device 300
  • a Bluetooth accessory device 400 such as a mouse
  • the Bluetooth accessory device 400 establishes a Bluetooth communication connection 1 with the host device 100 through the Bluetooth channel 1 of the Bluetooth accessory device 400.
  • the Bluetooth accessory device 400 establishes a Bluetooth communication connection 1 with the host device 200 through the Bluetooth channel 2 of the Bluetooth accessory device 400. .
  • the Bluetooth accessory device 400 can be a device with a Bluetooth multi-connection function. In this way, the Bluetooth accessory device 400 can sequentially establish Bluetooth communication connections with multiple host devices through multiple Bluetooth channels.
  • the Bluetooth accessory device 400 can establish a Bluetooth communication connection 1 with the host device 100 through the Bluetooth channel 1 of the Bluetooth accessory device 400 .
  • the Bluetooth accessory device 400 can establish a Bluetooth communication connection 1' with the host device 200 through the Bluetooth channel 2 of the Bluetooth accessory device 400.
  • step S1601 may also be executed after step S1602.
  • the Bluetooth accessory device 300 establishes a Bluetooth communication connection 2 with the host device 100 through the Bluetooth channel 1 of the Bluetooth accessory device 300.
  • the Bluetooth accessory device 300 can be a device with a Bluetooth multi-connection function. In this way, the Bluetooth accessory device 300 can sequentially establish Bluetooth communication connections with multiple host devices through multiple Bluetooth channels.
  • the Bluetooth accessory device 300 may first communicate with the multiple host devices.
  • One of the host devices establishes a Bluetooth communication connection.
  • the host device 100 can discover the Bluetooth accessory device 300 through the Bluetooth broadcast message, and further The host device 100 can perform Bluetooth pairing with the Bluetooth accessory device and establish a Bluetooth communication connection 2. In this way, the Bluetooth accessory device 300 can establish a Bluetooth communication connection 2 with the host device 100 through the Bluetooth channel 1 of the Bluetooth accessory device 300.
  • the host device 100 can establish a Bluetooth communication connection with other host devices (such as The host device 200) sends the device information of the Bluetooth accessory device 300 (such as the Bluetooth MAC address of the Bluetooth accessory device 300, etc.), so that other host devices that establish a Bluetooth communication connection with the Bluetooth accessory device 400 can obtain the device information of the Bluetooth accessory device 300, Further, based on the device information of the Bluetooth accessory device 300, Bluetooth pairing can be automatically performed with the Bluetooth accessory device 300 and a Bluetooth communication connection can be established.
  • the Bluetooth accessory device can establish Bluetooth communication connections with multiple host devices without the user having to perform multiple connection operations. Improve user experience.
  • the host device 100 sends message 1 to the Bluetooth accessory device 300.
  • the message is used to instruct the Bluetooth accessory device 300 to open other channels except Bluetooth channel 1 to send Bluetooth broadcast messages.
  • the host device 100 can send the above message 1 to the Bluetooth accessory device 300.
  • This message can be used to instruct the Bluetooth accessory device 300 to open a channel other than Bluetooth channel 1.
  • Send Bluetooth broadcast messages through other channels (such as Bluetooth channel 2, etc.).
  • the Bluetooth accessory device 300 can use channels other than Bluetooth channel 1 to send Bluetooth broadcast messages to allow other devices to discover the Bluetooth accessory device 300. After other devices discover the Bluetooth accessory device 300, the Bluetooth accessory device 300 can use channels other than Bluetooth channel 1 to send Bluetooth broadcast messages. Channels other than 1 perform Bluetooth pairing with other devices and establish Bluetooth communication connections.
  • the host device 100 obtains the Bluetooth MAC address of the Bluetooth accessory device 300.
  • Step S1605 may be executed simultaneously with the above step S1604, or may be executed before or after the above step S1604, which is not limited in the embodiment of the present application.
  • each Bluetooth channel of the Bluetooth accessory device 300 can correspond to a Bluetooth MAC address.
  • the Bluetooth MAC address of the Bluetooth accessory device 300 can include the Bluetooth MAC addresses corresponding to other channels of the Bluetooth accessory device 300 except Bluetooth channel 1. .
  • the host device 100 sends message 2 to the Bluetooth accessory device 400.
  • the message includes the Bluetooth MAC address of the Bluetooth accessory device 300.
  • the message is used to instruct the Bluetooth accessory device 400 to send the Bluetooth MAC address of the Bluetooth accessory device 300 to other than the host device.
  • Other devices other than 100 that establish Bluetooth communication connections with the Bluetooth accessory device 400 are other than 100 that establish Bluetooth communication connections with the Bluetooth accessory device 400 .
  • the host device 100 may send the above message 2 to the Bluetooth accessory device 400.
  • the message may include the Bluetooth MAC address of the Bluetooth accessory device 300.
  • the message may Used to instruct the Bluetooth accessory device 400 to send the Bluetooth MAC address of the Bluetooth accessory device 300 to other devices other than the host device 100 that establish Bluetooth communication connections with the Bluetooth accessory device 400 (such as the host device 200), so that in addition to the host device 100 Other devices that establish a Bluetooth communication connection with the Bluetooth accessory device 400 can automatically perform Bluetooth pairing with the Bluetooth accessory device 300 and establish a Bluetooth communication connection based on the Bluetooth MAC address of the Bluetooth accessory device 300 .
  • the Bluetooth accessory device 400 determines that the Bluetooth MAC address of the Bluetooth accessory device 300 needs to be sent to the host device 200. After that, the Bluetooth accessory device 400 can send the Bluetooth MAC address of the Bluetooth accessory device 300 to the host device 200.
  • the Bluetooth accessory device 400 can obtain the Bluetooth MAC address of the Bluetooth accessory device 300 included in the message 2. Further, due to establishing a Bluetooth connection with the Bluetooth accessory device 400 The devices connected by Bluetooth communication are the host device 100 and the host device 200 . Therefore, the Bluetooth accessory device 400 can determine that it needs to send the Bluetooth MAC address of the Bluetooth accessory device 300 to the host device 200 . Further, the Bluetooth accessory device 400 can send the Bluetooth MAC address of the Bluetooth accessory device 300 to the host device 200, so that the host device 200 can automatically perform Bluetooth pairing with the Bluetooth accessory device 300 based on the Bluetooth MAC address of the Bluetooth accessory device 300 and establish a Bluetooth communication connection. .
  • the Bluetooth accessory device 300 sends a Bluetooth broadcast message to the host device 200.
  • the Bluetooth accessory device 300 can open other channels except Bluetooth channel 1, and send a Bluetooth broadcast message to one or more host devices to use Bluetooth. Taking the Bluetooth channel 2 of the accessory device 300 and the host device 200 as an example, the Bluetooth accessory device 300 can send a Bluetooth broadcast message to the host device 200 through the Bluetooth channel 2 of the Bluetooth accessory device 300 .
  • the Bluetooth broadcast message may be a Bluetooth pairing broadcast message, and the Bluetooth broadcast message may include the Bluetooth MAC address of the Bluetooth accessory device 300 .
  • the host device 200 determines Bluetooth pairing with the Bluetooth accessory device 300 based on the Bluetooth broadcast message and the Bluetooth MAC address of the Bluetooth accessory device 300 and establishes a Bluetooth communication connection.
  • the host device 200 can based on the Bluetooth broadcast message sent by the Bluetooth accessory device 300 and The Bluetooth MAC address of the Bluetooth accessory device 300 sent by the Bluetooth accessory device 400 determines that it needs to perform Bluetooth pairing with the Bluetooth accessory device 300 and establish a Bluetooth communication connection. Further, the host device 200 can automatically perform Bluetooth pairing with the Bluetooth accessory device 300 to complete the Bluetooth pairing. Afterwards, the host device 200 can establish a Bluetooth communication connection with the Bluetooth accessory device 300 .
  • the Bluetooth accessory device 300 establishes a Bluetooth communication connection 2' with the host device 200 through other channels except Bluetooth channel 1.
  • the Bluetooth accessory device 300 can communicate with the host device through other channels except Bluetooth channel 1 (for example, Bluetooth channel 2 of the Bluetooth accessory device 300). 200 Establish Bluetooth communication connection 2'.
  • Bluetooth channel 1 for example, Bluetooth channel 2 of the Bluetooth accessory device 300.
  • the embodiment of the present application only takes two Bluetooth accessory devices and two host devices to establish Bluetooth communication connections as an example.
  • the specific process of establishing Bluetooth communication connections between a larger number of Bluetooth accessory devices and a larger number of host devices is the same as are similar and will not be repeated here.
  • the host device can establish a Bluetooth communication connection with the Bluetooth accessory device (for example, the Bluetooth accessory device 400) through the Bluetooth accessory device (for example, the Bluetooth accessory device 400) with which the Bluetooth communication connection is established.
  • Other host devices such as host device 200
  • device information such as Bluetooth MAC address, etc.
  • other Bluetooth accessory devices such as Bluetooth accessory device 300
  • the device information of the Bluetooth accessory device in this way, one or more host devices can actively perform Bluetooth pairing with the Bluetooth accessory device and establish a Bluetooth communication connection based on the device information of the Bluetooth accessory device, simplifying user operations and improving user experience.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (SSD)), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

本申请公开了一种通信方法、系统及相关设备,在多个配件设备与主机设备建立通信连接(例如蓝牙通信连接)的情况下,可以基于主机设备的路由功能(例如蓝牙路由功能)为这多个配件设备提供数据通信通道,这样,这多个配件设备之间可以进行数据通信,从而使得这多个配件设备可以协同实现对应场景下的差异化功能,简化用户操作,提高用户体验。

Description

通信方法、系统及相关设备
本申请要求于2022年05月17日提交中国国家知识产权局、申请号为202210537177.X、申请名称为“通信方法、系统及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种通信方法、系统及相关设备。
背景技术
随着终端技术的发展,当前市场上的配件设备(例如蓝牙鼠标、蓝牙键盘、手写笔、蓝牙音箱等蓝牙配件设备)越来越多,这些配件设备可以与主机设备(例如平板、个人电脑、大屏等)建立通信连接(例如蓝牙通信连接)来实现数据交互,但是,目前配件设备的使用场景仍然有较大的局限性,用户体验差。
发明内容
本申请实施例提供了一种通信方法、系统及相关设备,可以使得多个配件设备协同实现对应场景下的差异化功能,简化用户操作,提高用户体验。
第一方面,本申请实施例提供了一种通信方法,应用于通信系统,该通信系统包括第一主机设备、第一配件设备、第二配件设备,该方法包括:第一配件设备与第一主机设备建立第一通信连接;第二配件设备与第一主机设备建立第二通信连接;第一配件设备检测到用户触发第一事件,响应于第一事件,第一配件设备基于第一通信连接向第一主机设备发送第一数据,第一数据中包括第一事件的信息;第一主机设备基于第二通信连接向第二配件设备发送第一事件的信息;第二配件设备接收第一主机设备发送的第一事件的信息,并基于第一事件的信息执行响应操作。
通过实施第一方面提供的方法,在多个配件设备与主机设备建立通信连接(例如蓝牙通信连接)的情况下,可以基于主机设备的路由功能(例如蓝牙路由功能)为这多个配件设备提供数据通信通道,这样,这多个配件设备之间可以进行数据通信,从而使得这多个配件设备可以协同实现对应场景下的差异化功能,简化用户操作,提高用户体验。
在一种可能的实现方式中,第一数据中还包括一个或多个配件设备的设备信息,一个或多个配件设备的设备信息中包括第二配件设备的设备信息,第二配件设备的设备信息用于第一主机设备确定将第一事件的信息发送给第二配件设备。
这样,第一主机设备可以根据第二配件设备的设备信息来确定将第一事件的信息发送给第二配件设备。
在一种可能的实现方式中,通信系统还包括第二主机设备,第一事件为将焦点主机设备由第一主机设备切换到第二主机设备的事件,第一事件的信息中包括第二主机设备的设备信息,第二配件设备基于第一事件的信息执行响应操作,具体包括:第二配件设备基于第二主机设备的设备信息发送第一回连广播消息;在第二主机设备接收到第一回连广播消息的情况下,第二配件设备将焦点主机设备由第一主机设备切换到第二主机设备,第二配件设备与第 二主机设备建立第三通信连接。
这样,用户可以一键将所有配件设备的焦点主机设备由第一主机设备切换到第二主机设备,方便快捷。
在一种可能的实现方式中,第一配件设备为键盘,第二配件设备为鼠标,第一事件为按下调节每英寸点数DPI的按键的事件,第一事件的信息中包括调节DPI的按键的键值,第二配件设备基于第一事件的信息执行响应操作,具体包括:第二配件设备基于调节DPI的按键的键值调节第二配件设备的DPI。
这样,用户可以通过键盘来调节鼠标的DPI。
在一种可能的实现方式中,调节DPI的按键包括DPI按键,或,增加DPI的组合按键,或,减小DPI的组合按键,第二配件设备基于调节DPI的按键的键值调节第二配件设备的DPI,具体包括:在调节DPI的按键为DPI按键的情况下,第二配件设备基于DPI按键的键值增加或减小第二配件设备的DPI;或,在调节DPI的按键为增加DPI的组合按键的情况下,第二配件设备基于增加DPI的组合按键的键值增加第二配件设备的DPI;或,在调节DPI的按键为减小DPI的组合按键的情况下,第二配件设备基于减小DPI的组合按键的键值减小第二配件设备的DPI。
这样,用户可以通过键盘上的DPI按键,或,DPI的组合按键来增加或减小鼠标的DPI。
在一种可能的实现方式中,第一配件设备为键盘,第二配件设备为鼠标,第一事件为按下调节灯效的按键的事件,第一事件的信息中包括调节灯效的按键的键值,第二配件设备基于第一事件的信息执行响应操作,具体包括:第二配件设备基于调节灯效的按键的键值调节第二配件设备的灯效。
这样,用户可以通过键盘来调节鼠标的灯效(例如灯效的亮度、模式等)。
在一种可能的实现方式中,调节灯效的按键包括增加亮度LightUp按键,或,降低亮度LightDown按键,或,增加亮度的组合按键,或,降低亮度的组合按键,第二配件设备基于调节灯效的按键的键值调节第二配件设备的灯效,具体包括:在调节灯效的按键为LightUp按键或增加亮度的组合按键的情况下,第二配件设备基于LightUp按键的键值或增加亮度的组合按键的键值增加第二配件设备的灯效的亮度;或,在调节灯效的按键为LightDown按键或降低亮度的组合按键的情况下,第二配件设备基于LightDown按键的键值或降低亮度的组合按键的键值降低第二配件设备的灯效的亮度。
这样,用户可以通过键盘上的调节灯效的按键来调节鼠标的灯效的亮度。
在一种可能的实现方式中,调节灯效的按键包括切换灯效的模式的单个按键或组合按键,第二配件设备基于调节灯效的按键的键值调节第二配件设备的灯效,具体包括:第二配件设备基于切换灯效的模式的单个按键或组合按键的键值切换第二配件设备的灯效的模式。
这样,用户可以通过键盘上的调节灯效的按键来调节鼠标的灯效的模式。
在一种可能的实现方式中,第一配件设备为鼠标,第二配件设备为键盘,第一事件为用户按下第一按键的事件,第二配件设备基于第一事件的信息执行响应操作,具体包括:第二配件设备将用户按下第一按键的事件和用户按下第二按键的事件转换为用户按下第三按键的事件,其中,用户按下第二按键的事件是第二配件设备在接收第一主机设备发送的第一事件的信息之后检测到的;第二配件设备向第一主机设备发送第三按键的键值;第一主机设备响应第三按键的键值对应的功能。
这样,用户可以通过鼠标和键盘协同形成组合按键,减少键盘按键数量,缩小键盘尺寸的同时,也可以满足用户的需求。
在一种可能的实现方式中,在第二配件设备向第一主机设备发送第三按键的键值之后,方法还包括:第一配件设备检测到第二事件,第二事件为用户松开第一按键的事件,响应于第二事件,第一配件设备基于第一通信连接向第一主机设备发送第二数据,第二数据中包括第二事件的信息;第一主机设备基于第二通信连接向第二配件设备发送第二事件的信息;第二配件设备接收第一主机设备发送的第二事件的信息,并基于第二事件的信息确定用户松开第一按键。
这样,可以取消通过鼠标和键盘协同形成组合按键的功能。
在一种可能的实现方式中,第二配件设备的设备信息包括第二配件设备的设备类型,在第一配件设备检测到用户触发第一事件之前,该方法还包括:第二配件设备向第一主机设备发送第一消息,第一消息中包括第二配件设备的设备类型;第一主机设备保存第二通信连接与第二配件设备的设备类型之间的映射关系;在第一主机设备基于第二通信连接向第二配件设备发送第一事件的信息之前,该方法还包括:第一主机设备基于第二配件设备的设备类型、第二通信连接与第二配件设备的设备类型之间的映射关系确定通过第二通信连接向第二配件设备发送第一事件的信息。
这样,配件设备可以向主机设备进行设备注册,以便主机设备保存通信连接与配件设备的设备类型之间的映射关系。
在一种可能的实现方式中,在第二配件设备基于第一事件的信息执行响应操作之后,该方法还包括:第二配件设备通过第一主机设备向第一配件设备发送第二消息,第二消息用于向第一配件设备通知第二配件设备执行响应操作的结果。
这样,第二配件设备可以通过第一主机设备向第一配件设备通知第二配件设备执行响应操作的结果。
在一种可能的实现方式中,第一通信连接和第二通信连接均为蓝牙通信连接。
在第一方面中,第一主机设备可以为主机设备100,第二主机设备可以为主机设备200,第一配件设备和第二配件设备可以分别与第一主机设备建立第一通信连接(例如蓝牙通信连接)、第二通信连接(例如蓝牙通信连接),第一事件可以是用户触发的事件(例如切换事件、调节DPI的事件、调节灯效的事件、按下某个按键的事件),第一数据可以是包括第一事件的信息、一个或多个配件设备的设备信息的数据(例如图9中的数据1、图11中的数据2、图12中的数据3、图13中的数据4),第一回连广播消息可以图9中蓝牙配件设备400发送的蓝牙广播消息2,第三通信连接可以为蓝牙配件设备400与主机设备200建立的蓝牙通信连接2,第一按键可以为图13中的按键1,第二按键可以为图13中的按键2,第三按键可以为图13中的组合键1,第二数据可以为图13中的数据5,第一消息可以为第二配件设备向第一主机设备发送的注册请求,第二消息可以为图8中的事件处理完成消息。
第二方面,本申请实施例提供了一种通信方法,应用于第一配件设备,该方法包括:第一配件设备检测到用户触发第一事件;响应于第一事件,第一配件设备通过第一主机设备向第二配件设备发送第一数据,第一数据中包括第一事件的信息;其中,第一事件的信息用于第二配件设备基于第一事件的信息执行响应操作,第一配件设备与第一主机设备建立有第一通信连接,第二配件设备与第一主机设备建立有第二通信连接。
在一种可能的实现方式中,第一数据中还包括一个或多个配件设备的设备信息,一个或多个配件设备的设备信息中包括第二配件设备的设备信息,第二配件设备的设备信息用于第 一主机设备确定将第一事件的信息发送给第二配件设备。
在一种可能的实现方式中,第一事件为将焦点主机设备由第一主机设备切换到到第二主机设备的事件,第一事件的信息用于第二配件设备基于第一事件的信息将焦点主机设备由第一主机设备切换到第二主机设备,第二配件设备与第二主机设备建立第三通信连接。
在一种可能的实现方式中,第一配件设备为键盘,第二配件设备为鼠标,第一事件为按下调节每英寸点数DPI的按键的事件,第一事件的信息用于第二配件设备基于第一事件的信息调节第二配件设备的DPI。
在一种可能的实现方式中,调节DPI的按键包括DPI按键,或,增加DPI的组合按键,或,减小DPI的组合按键,在调节DPI的按键为DPI按键的情况下,第一事件的信息用于第二配件设备基于第一事件的信息增加或减小第二配件设备的DPI;或,在调节DPI的按键为增加DPI的组合按键的情况下,第一事件的信息用于第二配件设备基于第一事件的信息增加第二配件设备的DPI;或,在调节DPI的按键为减小DPI的组合按键的情况下,第一事件的信息用于第二配件设备基于第一事件的信息减小第二配件设备的DPI。
在一种可能的实现方式中,第一配件设备为键盘,第二配件设备为鼠标,第一事件为按下调节灯效的按键的事件,第一事件的信息用于第二配件设备基于第一事件的信息调节第二配件设备的灯效。
在一种可能的实现方式中,调节灯效的按键包括增加亮度LightUp按键,或,降低亮度LightDown按键,或,增加亮度的组合按键,或,降低亮度的组合按键,在调节灯效的按键为LightUp按键或增加亮度的组合按键的情况下,第一事件的信息用于第二配件设备基于第一事件的信息增加第二配件设备的灯效的亮度;或,在调节灯效的按键为LightDown按键或降低亮度的组合按键的情况下,第一事件的信息用于第二配件设备基于第一事件的信息降低第二配件设备的灯效的亮度。
在一种可能的实现方式中,第一配件设备为鼠标,第二配件设备为键盘,第一事件为用户按下第一按键的事件,第一事件的信息用于第二配件设备将用户按下第一按键的事件和用户按下第二按键的事件转换为用户按下第三按键的事件,其中,用户按下第二按键的事件是第二配件设备在接收第一主机设备发送的第一事件的信息之后检测到的。
在一种可能的实现方式中,在第一配件设备通过第一主机设备向第二配件设备发送第一事件的信息之后,该方法还包括:第一配件设备检测到第二事件,第二事件为用户松开第一按键的事件,响应于第二事件,第一配件设备通过第一主机设备向第二配件设备发送第二事件的信息,第二事件的信息包含于第二数据中,第二事件的信息用于第二配件设备基于第二事件的信息确定用户松开第一按键。
在一种可能的实现方式中,第二配件设备的设备信息包括第二配件设备的设备类型,在第一配件设备检测到用户触发第一事件之前,该方法还包括:第一配件设备向第一主机设备发送第一消息,第一消息中包括第一配件设备的设备类型,第一消息用于第一主机设备基于第一消息保存第一通信连接与第一配件设备的设备类型之间的映射关系。
在第二方面中,第一主机设备可以为主机设备100,第二主机设备可以为主机设备200,第一配件设备和第二配件设备可以分别与第一主机设备建立第一通信连接(例如蓝牙通信连接)、第二通信连接(例如蓝牙通信连接),第一事件可以是用户触发的事件(例如切换事件、调节DPI的事件、调节灯效的事件、按下某个按键的事件),第一数据可以是包括第一事件的信息、一个或多个配件设备的设备信息的数据(例如图9中的数据1、图11中的数据2、图 12中的数据3、图13中的数据4),第三通信连接可以为蓝牙配件设备400与主机设备200建立的蓝牙通信连接2,第一按键可以为图13中的按键1,第二按键可以为图13中的按键2,第三按键可以为图13中的组合键1,第二数据可以为图13中的数据5,第一消息可以为第一配件设备向第一主机设备发送的注册请求。
第三方面,本申请实施例提供了一种通信方法,应用于第二配件设备,该方法包括:第二配件设备与第一主机设备建立第一通信连接;第二配件设备基于第一通信连接接收第一主机设备发送的第一事件的信息,第一事件的信息可以包含于第一数据中,第一事件的信息是第一配件设备在检测到用户触发第一事件之后基于第二通信连接向第一主机设备发送的,第二通信连接可以是第一配件设备与第一主机设备建立的;第二配件设备基于第一事件的信息执行响应操作。
在一种可能的实现方式中,第一数据中还包括一个或多个配件设备的设备信息,一个或多个配件设备的设备信息中包括第二配件设备的设备信息,第二配件设备的设备信息用于第一主机设备确定将第一事件的信息发送给第二配件设备。
在一种可能的实现方式中,第一事件为将焦点主机设备由第一主机设备切换到第二主机设备的事件,第一事件的信息中包括第二主机设备的设备信息,第二配件设备基于第一事件的信息执行响应操作,具体包括:第二配件设备基于第二主机设备的设备信息发送第一回连广播消息;在第二主机设备接收到第一回连广播消息的情况下,第二配件设备将焦点主机设备由第一主机设备切换到第二主机设备,第二配件设备与第二主机设备建立第三通信连接。
在一种可能的实现方式中,第一配件设备为键盘,第二配件设备为鼠标,第一事件为按下调节每英寸点数DPI的按键的事件,第一事件的信息中包括调节DPI的按键的键值,第二配件设备基于第一事件的信息执行响应操作,具体包括:第二配件设备基于调节DPI的按键的键值调节第二配件设备的DPI。
在一种可能的实现方式中,调节DPI的按键包括DPI按键,或,增加DPI的组合按键,或,减小DPI的组合按键,第二配件设备基于调节DPI的按键的键值调节第二配件设备的DPI,具体包括:在调节DPI的按键为DPI按键的情况下,第二配件设备基于DPI按键的键值增加或减小第二配件设备的DPI;或,在调节DPI的按键为增加DPI的组合按键的情况下,第二配件设备基于增加DPI的组合按键的键值增加第二配件设备的DPI;或,在调节DPI的按键为减小DPI的组合按键的情况下,第二配件设备基于减小DPI的组合按键的键值减小第二配件设备的DPI。
在一种可能的实现方式中,第一配件设备为键盘,第二配件设备为鼠标,第一事件为按下调节灯效的按键的事件,第一事件的信息中包括调节灯效的按键的键值,第二配件设备基于第一事件的信息执行响应操作,具体包括:第二配件设备基于调节灯效的按键的键值调节第二配件设备的灯效。
在一种可能的实现方式中,调节灯效的按键包括增加亮度LightUp按键,或,降低亮度LightDown按键,或,增加亮度的组合按键,或,降低亮度的组合按键,第二配件设备基于调节灯效的按键的键值调节第二配件设备的灯效,具体包括:在调节灯效的按键为LightUp按键或增加亮度的组合按键的情况下,第二配件设备基于LightUp按键的键值或增加亮度的组合按键的键值增加第二配件设备的灯效的亮度;或,在调节灯效的按键为LightDown按键或降低亮度的组合按键的情况下,第二配件设备基于LightDown按键的键值或降低亮度的组合按键的键值降低第二配件设备的灯效的亮度。
在一种可能的实现方式中,第一配件设备为鼠标,第二配件设备为键盘,第一事件为用户按下第一按键的事件,第二配件设备基于第一事件的信息执行响应操作,具体包括:第二配件设备将用户按下第一按键的事件和用户按下第二按键的事件转换为用户按下第三按键的事件,其中,用户按下第二按键的事件是第二配件设备在接收第一主机设备发送的第一事件的信息之后检测到的;第二配件设备向第一主机设备发送第三按键的键值,第三按键的键值用于第一主机设备基于第三按键的键值响应第三按键的键值对应的功能。
在一种可能的实现方式中,在第二配件设备向第一主机设备发送第三按键的键值之后,该方法还包括:第二配件设备基于第一通信连接接收第一主机设备发送的第二事件的信息,第二事件的信息包含于第二数据中,第二事件为用户松开第一按键的事件,第二数据是第一配件设备在检测到第二事件之后向第一主机设备发送的;第二配件设备基于第二事件的信息确定用户松开第一按键。
在一种可能的实现方式中,第二配件设备的设备信息包括第二配件设备的设备类型,在第二配件设备基于第一通信连接接收第一主机设备发送的第一数据之前,该方法还包括:第二配件设备向第一主机设备发送第一消息,第一消息中包括第二配件设备的设备类型,第一消息用于第一主机设备基于第一消息保存第一通信连接与第二配件设备的设备类型之间的映射关系。
在一种可能的实现方式中,在第二配件设备基于第一事件的信息执行响应操作之后,该方法还包括:第二配件设备通过第一主机设备向第一配件设备发送第二消息,第二消息用于向第一配件设备通知第二配件设备执行响应操作的结果。
在第三方面中,第一主机设备可以为主机设备100,第二主机设备可以为主机设备200,第一配件设备和第二配件设备可以分别与第一主机设备建立第二通信连接(例如蓝牙通信连接)、第一通信连接(例如蓝牙通信连接),第一事件可以是用户触发的事件(例如切换事件、调节DPI的事件、调节灯效的事件、按下某个按键的事件),第一数据可以是包括第一事件的信息、一个或多个配件设备的设备信息的数据(例如图9中的数据1、图11中的数据2、图12中的数据3、图13中的数据4),第一回连广播消息可以图9中蓝牙配件设备400发送的蓝牙广播消息2,第三通信连接可以为蓝牙配件设备400与主机设备200建立的蓝牙通信连接2,第一按键可以为图13中的按键1,第二按键可以为图13中的按键2,第三按键可以为图13中的组合键1,第二数据可以为图13中的数据5,第一消息可以为第二配件设备向第一主机设备发送的注册请求,第二消息可以为图8中的事件处理完成消息。
第四方面,本申请实施例提供了一种通信方法,应用于第一主机设备,该方法包括:第一主机设备与第一配件设备建立第一通信连接;第一主机设备与第二配件设备建立第二通信连接;第一主机设备基于第一通信连接接收第一配件设备发送的第一数据,第一数据中包括第一事件的信息,第一数据是第一配件设备在检测到用户触发第一事件之后发送的;第一主机设备基于第二通信连接向第二配件设备发送第一事件的信息,第一事件的信息用于第二配件设备基于第一事件的信息执行响应操作。
在一种可能的实现方式中,第一数据中还包括一个或多个配件设备的设备信息,一个或多个配件设备的设备信息中包括第二配件设备的设备信息,第二配件设备的设备信息用于第一主机设备确定将第一事件的信息发送给第二配件设备。
在一种可能的实现方式中,第二配件设备的设备信息包括第二配件设备的设备类型,在 第一主机设备基于第一通信连接接收第一配件设备发送的第一数据之前,该方法还包括:第一主机设备接收第二配件设备发送的第一消息,第一消息中包括第二配件设备的设备类型;第一主机设备保存第二通信连接与第二配件设备的设备类型之间的映射关系;在第一主机设备基于第二通信连接向第二配件设备发送第一事件的信息之前,该方法还包括:第一主机设备基于第二配件设备的设备类型、第二通信连接与第二配件设备的设备类型之间的映射关系确定通过第二通信连接向第二配件设备发送第一事件的信息。
在第四方面中,第一主机设备可以为主机设备100,第二主机设备可以为主机设备200,第一配件设备和第二配件设备可以分别与第一主机设备建立第一通信连接(例如蓝牙通信连接)、第二通信连接(例如蓝牙通信连接),第一事件可以是用户触发的事件(例如切换事件、调节DPI的事件、调节灯效的事件、按下某个按键的事件),第一数据可以是包括第一事件的信息、一个或多个配件设备的设备信息的数据(例如图9中的数据1、图11中的数据2、图12中的数据3、图13中的数据4),第一消息可以为第二配件设备向第一主机设备发送的注册请求。
第五方面,本申请实施例提供了一种通信方法,应用于通信系统,该通信系统包括第一主机设备、第二主机设备、第一配件设备、第二配件设备,第二配件设备与第一主机设备和第二主机设备均建立有蓝牙通信连接,该方法包括:第一配件设备与第一主机设备建立第一蓝牙通信连接;第一主机设备基于第一蓝牙通信连接向第一配件设备发送第一消息,第一消息用于指示第一配件设备发送配对广播消息;第一配件设备在接收到第一消息之后发送配对广播消息;第一主机设备向第二配件设备发送第二消息,第二消息中包括第一配件设备的蓝牙媒体访问控制MAC地址,第二消息用于指示第二配件设备向一个或多个主机设备发送第一配件设备的蓝牙MAC地址,一个或多个主机设备包括第二主机设备;第二配件设备向第二主机设备发送第一配件设备的蓝牙MAC地址;第二主机设备接收配对广播消息和第一配件设备的蓝牙MAC地址,并基于配对广播消息和第一配件设备的蓝牙MAC地址与第一配件设备进行蓝牙配对并建立第二蓝牙通信连接。
在第五方面中,第一主机设备可以为主机设备100,第二主机设备可以为主机设备200,第一配件设备可以为图16中的蓝牙配件设备300,第二配件设备可以为图16中的蓝牙配件设备400,第一蓝牙通信连接可以为图16中的蓝牙通信连接2,第一消息可以为图16中的消息1,第二消息可以为图16中的消息2,第二蓝牙通信连接可以为图16中的蓝牙通信连接2’。
第六方面,本申请实施例提供了一种通信方法,应用于第一配件设备,该方法包括:第一配件设备与第一主机设备建立第一蓝牙通信连接;第一配件设备在基于第一蓝牙通信连接接收第一主机设备发送的第一消息之后发送配对广播消息;在第二主机设备基于配对广播消息和第一配件设备的蓝牙媒体访问控制MAC地址确定与第一配件设备进行蓝牙配对并建立第二蓝牙通信连接的情况下,第一配件设备与第二主机设备建立第二蓝牙通信连接;其中,第一配件设备的蓝牙MAC地址是第一主机设备通过第二配件设备发送给第二主机设备的,第二配件设备与第一主机设备和第二主机设备均建立有蓝牙通信连接。
在第六方面中,第一主机设备可以为主机设备100,第二主机设备可以为主机设备200, 第一配件设备可以为图16中的蓝牙配件设备300,第二配件设备可以为图16中的蓝牙配件设备400,第一蓝牙通信连接可以为图16中的蓝牙通信连接2,第一消息可以为图16中的消息1,第二蓝牙通信连接可以为图16中的蓝牙通信连接2’。
第七方面,本申请实施例提供了一种通信方法,应用于第二配件设备,第二配件设备与第一主机设备和第二主机设备均建立有蓝牙通信连接,该方法包括:第二配件设备接收第一主机设备发送的第一消息,第一消息中包括第一配件设备的蓝牙媒体访问控制MAC地址,第一消息用于第二配件设备基于第一消息向一个或多个主机设备发送第一配件设备的蓝牙MAC地址,一个或多个主机设备包括第二主机设备;第二配件设备基于第一消息向第二主机设备发送第一配件设备的蓝牙MAC地址,第一配件设备的蓝牙MAC地址用于第二主机设备与第一配件设备建立蓝牙通信连接。
在第七方面中,第一主机设备可以为主机设备100,第二主机设备可以为主机设备200,第一配件设备可以为图16中的蓝牙配件设备300,第二配件设备可以为图16中的蓝牙配件设备400,第一消息可以为图16中的消息2。
第八方面,本申请实施例提供了一种通信方法,应用于第一主机设备,该方法包括:第一主机设备与第一配件设备建立第一蓝牙通信连接;第一主机设备基于第一蓝牙通信连接向第一配件设备发送第一消息,第一消息用于指示第一配件设备发送配对广播消息;第一主机设备向第二配件设备发送第二消息,第二消息中包括第一蓝牙配件设备的蓝牙媒体访问控制MAC地址,第二消息用于指示第二配件设备向一个或多个主机设备发送第一配件设备的蓝牙MAC地址,一个或多个主机设备包括第二主机设备;其中,第二配件设备与第一主机设备和第二主机设备均建立有蓝牙通信连接,配对广播消息和第一配件设备的蓝牙MAC地址用于第二主机设备与第一配件设备建立第二蓝牙通信连接。
在第八方面中,第一主机设备可以为主机设备100,第二主机设备可以为主机设备200,第一配件设备可以为图16中的蓝牙配件设备300,第二配件设备可以为图16中的蓝牙配件设备400,第一蓝牙通信连接可以为图16中的蓝牙通信连接2,第一消息可以为图16中的消息1,第二消息可以为图16中的消息2,第二蓝牙通信连接可以为图16中的蓝牙通信连接2’。
第九方面,本申请实施例提供了一种通信系统,该通信系统包括第一主机设备、第一配件设备、第二配件设备;第一配件设备用于与第一主机设备建立第一通信连接;第二配件设备用于与第一主机设备建立第二通信连接;第一配件设备还用于检测用户触发第一事件,响应于第一事件,基于第一通信连接向第一主机设备发送第一数据,第一数据中包括第一事件的信息;第一主机设备用于基于第二通信连接向第二配件设备发送第一事件的信息;第二配件设备还用于接收第一主机设备发送的第一事件的信息,并基于第一事件的信息执行响应操作。
第十方面,本申请实施例提供了一种通信系统,通信系统包括第一主机设备、第二主机设备、第一配件设备、第二配件设备,第二配件设备与第一主机设备和第二主机设备均建立有蓝牙通信连接;第一配件设备用于与第一主机设备建立第一蓝牙通信连接;第一主机设备 用于基于第一蓝牙通信连接向第一蓝牙配件设备发送第一消息,第一消息用于指示第一配件设备发送配对广播消息;第一配件设备还用于在接收到第一消息之后发送配对广播消息;第一主机设备还用于向第二配件设备发送第二消息,第二消息中包括第一配件设备的蓝牙媒体访问控制MAC地址,第二消息用于指示第二配件设备向一个或多个主机设备发送第一配件设备的蓝牙MAC地址,一个或多个主机设备包括第二主机设备;第二配件设备用于向第二主机设备发送第一配件设备的蓝牙MAC地址;第二主机设备用于接收配对广播消息和第一配件设备的蓝牙MAC地址,并基于配对广播消息和第一配件设备的蓝牙MAC地址与第一配件设备进行蓝牙配对并建立第二蓝牙通信连接。
第十一方面,本申请实施例提供了一种电子设备,该电子设备包括一个或多个处理器和一个或多个存储器;其中,一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行上述第二方面或第三方面或第四方面或第六方面或第七方面或第八方面所述的方法。
第十二方面,本申请实施例提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,计算机程序包括程序指令,当程序指令在电子设备上运行时,使得电子设备执行上述第二方面或第三方面或第四方面或第六方面或第七方面或第八方面所述的方法。
第十三方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述第二方面或第三方面或第四方面或第六方面或第七方面或第八方面所述的方法。
附图说明
图1是本申请实施例提供的一种通信系统的架构示意图;
图2是本申请实施例提供的一种将蓝牙配件设备300和蓝牙配件设备400的蓝牙通信连接由主机设备200切换到主机设备100的流程示意图;
图3是本申请实施例提供的一种将蓝牙配件设备300和蓝牙配件设备400的蓝牙通信连接由主机设备200切换到主机设备201的流程示意图;
图4A是本申请实施例提供的一种在主机设备上进行鼠标设置的用户界面示意图;
图4B是本申请实施例提供的一种在主机设备上对鼠标进行灯效调节的用户界面示意图;
图5是本申请实施例提供的一种多个蓝牙配件设备分别与多个主机设备建立蓝牙通信连接的示意图;
图6A是本申请实施例提供的一种主机设备的软件架构示意图;
图6B是本申请实施例提供的另一种主机设备的软件架构示意图;
图6C是本申请实施例提供的一种蓝牙路由管理服务模块的架构示意图;
图6D是本申请实施例提供的一种蓝牙路由协议报文的结构示意图;
图7是本申请实施例提供的一蓝牙配件设备的软件架构示意图;
图8是本申请实施例提供的一种蓝牙路由方法的流程示意图;
图9是本申请实施例提供的通信方法在切换多个蓝牙配件设备的蓝牙通信连接这一应用 场景下的流程示意图;
图10是本申请实施例提供的一种键盘的外形结构示意图;
图11是本申请实施例提供的通信方法在通过一个蓝牙配件设备(例如键盘)来控制另一个蓝牙配件设备(例如鼠标)进行DPI调节这一应用场景下的流程示意图;
图12是本申请实施例提供的通信方法在通过一个蓝牙配件设备(例如键盘)来控制另一个蓝牙配件设备(例如鼠标)进行灯效调节这一应用场景下的流程示意图;
图13是本申请实施例提供的通信方法在一个蓝牙配件设备(例如键盘)和另一个蓝牙配件设备(例如鼠标)协同实现组合按键功能这一应用场景下的流程示意图;
图14是本申请实施例提供一种在蓝牙配件设备(例如蓝牙手环)与主机设备(例如平板)未直接建立蓝牙通信连接的情况下通过中间主机设备(例如手机)来进行通信的示意图;
图15是本申请实施例提供一种在主机设备(例如手机)与另一个主机设备(例如平板)未直接建立蓝牙通信连接的情况下通过中间主机设备(例如个人电脑)来进行通信的示意图;
图16是本申请实施例提供的通信方法在多个蓝牙配件设备分别与多个主机设备建立蓝牙通信连接这一应用场景下的流程示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
应当理解,本申请的说明书和权利要求书及附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本申请所描述的实施例可以与其它实施例相结合。
本申请以下实施例中的术语“用户界面(user interface,UI)”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面是通过java、可扩展标记语言(extensible markup language,XML)等特定计算机语言编写的源代码,界面源代码在电子设备上经过解析,渲染,最终呈现为用户可以识别的内容。用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的文本、图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。
首先介绍本申请实施例提供的一种通信系统。
图1示例性示出了本申请实施例提供的一种通信系统。
如图1所示,该通信系统可以包括:多个蓝牙配件设备(也可以称为蓝牙配件或配件或配件设备或从设备)、多个主机设备。
其中,蓝牙配件设备和主机设备均为智能终端设备,可以为各种类型,本申请实施例对此不作限制。
例如,蓝牙配件设备可以包括音箱、鼠标、键盘,还可以包括手写笔、耳机等等。
例如,主机设备可以包括平板、个人电脑(Personal Computer,PC)、大屏,还可以包括桌面型计算机、膝上型计算机、手持计算机、车机、手机等等。
在本申请实施例中,主机设备和蓝牙配件设备均可以为支持蓝牙多连接的设备。
该通信系统中的多个蓝牙配件设备均可以与主机设备建立蓝牙(bluetooth,BT)通信连接(或称蓝牙连接),从而可以基于已建立的蓝牙通信连接互相进行通信。
不限于上述蓝牙通信连接,该通信系统中的多个蓝牙配件设备还可以与主机设备建立有线连接,或,其他无线连接,例如无线局域网(wireless local area networks,WLAN)例如无线保真点对点(wireless fidelity point to point,Wi-Fi P2P)连接、近距离无线通信(near field communication,NFC)连接,红外技术(infrared,IR)连接等等。
该通信系统中的多个主机设备可以配置不同的软件操作系统(OperatingSystem,OS),包括但不限于等等。其中,为华为的鸿蒙系统。多个主机设备也可以都配置相同的软件操作系统,例如可以均配置
可以理解的是,在主机设备与配件设备建立的通信连接不是蓝牙通信连接的情况下,上述配件设备也可以不是蓝牙配件设备。
随着终端技术的发展,当前市场上的蓝牙配件设备(例如蓝牙鼠标、蓝牙键盘、手写笔、蓝牙音箱等)越来越多,这些蓝牙配件设备可以与主机设备(例如平板、个人电脑、大屏等)建立蓝牙通信连接,但是,在建立蓝牙通信连接之后,这些蓝牙配件设备之间仍然是相互独立的,不能进行数据交互,无法协同完成某项任务或实现某种功能,给产品设计带来较大的局限性,用户体验差。
下面结合不同的应用场景进行介绍:
应用场景一:切换多个蓝牙配件设备的蓝牙通信连接
蓝牙配件设备(例如鼠标、键盘、音箱等)均可以与一台或多台主机设备(例如平板、PC、大屏等)进行蓝牙配对并建立蓝牙通信连接。假设多个蓝牙配件设备均与主机设备100、主机设备200进行过蓝牙配对,当前这多个蓝牙配件设备均与主机设备100保存着已建立的蓝牙通信连接,如果用户想要将这多个蓝牙配件设备的蓝牙通信连接从主机设备100切换到主机设备200(即将这多个蓝牙配件设备均与主机设备200建立蓝牙通信连接从而可以与主机设备200进行数据交互),有以下两种可能的实现方式:
一种可能的实现方式是,这多个蓝牙配件设备分别都可以支持用户通过切换按键来实现从主机设备100到主机设备200的蓝牙通信连接切换,也即是说,用户需要在这多个蓝牙配件设备上对切换按键都操作一遍,才能够将这多个蓝牙配件设备实现从主机设备100到主机设备200的蓝牙通信连接切换,操作较为繁琐,用户体验差。
另一种可能的实现方式是,在主机设备上开发一个独立的应用程序来对全部蓝牙配件设备进行分开管理,例如,键鼠穿越方案:主机设备检测蓝牙通信连接的切换条件,在确定满足切换条件的情况下,分别对鼠标和键盘进行控制。下面结合图2和图3分别介绍该方案的执行过程:
假设主机设备100为平板,主机设备200为PC,主机设备201为大屏,这三台主机设备的位置可以如图1所示,主机设备200位于中间位置,主机设备100位于主机设备200的左侧,主机设备201位于主机设备200的右侧,这三台主机设备的位置信息都在这三台主机设备上已经提前配置好,蓝牙配件设备300为键盘,蓝牙配件设备400为鼠标,其中,蓝牙配件设备300和蓝牙配件设备400均与主机设备200建立了蓝牙通信连接,这样,主机设备200就可以与蓝牙配件设备300和蓝牙配件设备400建立控制服务通道,以便进行数据交互。
参阅图2,图2示例性示出了将蓝牙配件设备300和蓝牙配件设备400的蓝牙通信连接由主机设备200切换到主机设备100的具体流程。具体步骤如下:
S201、主机设备200检测到用户将光标移动到屏幕的左侧边界的操作。
具体地,主机设备200可以实时监测蓝牙配件设备400的光标位置和光标的移动方向,当检测到光标处于屏幕的边界且向屏幕边界移动时,由于主机设备200上已经提前配置好其他主机设备的位置信息,因此,主机设备200可以确定光标处于屏幕的左侧边界且向屏幕左侧边界移动时,用户的意图是要将蓝牙配件设备的蓝牙通信连接切换到主机设备100。例如,主机设备200在检测到用户将光标移动到屏幕的左侧边界的操作之后,响应于该操作,主机设备200可以分别向蓝牙配件设备300和蓝牙配件设备400发送将蓝牙通信连接切换到主机设备100的指令(即执行下述步骤S202、S205)。
S202-S204、主机设备200向蓝牙配件设备400发送将蓝牙通信连接切换到主机设备100的指令,蓝牙配件设备400接收到该指令之后,可以切换蓝牙通道,切换完成之后,蓝牙配件设备400可以向主机设备100发送消息1。
具体地,蓝牙配件设备400在接收到主机设备200发送的将蓝牙通信连接切换到主机设备100的指令之后,可以将蓝牙通道切换到主机设备100,切换完成之后,蓝牙配件设备400则与主机设备100建立了蓝牙通信连接。之后,蓝牙配件设备400可以向主机设备100发送消息1,与主机设备100进行数据交互。
其中,消息1可以包括蓝牙配件设备400的光标移动消息、按键消息,这样,主机设备100可以基于消息1来执行相关任务(例如显示光标的位置、响应按键操作等)。
S205-S207、主机设备200向蓝牙配件设备300发送将蓝牙通信连接切换到主机设备100的指令,蓝牙配件设备300接收到该指令之后,可以切换蓝牙通道,切换完成之后,蓝牙配件设备300可以向主机设备100发送消息2。
具体地,蓝牙配件设备300在接收到主机设备200发送的将蓝牙通信连接切换到主机设备100的指令之后,可以将蓝牙通道切换到主机设备100,切换完成之后,蓝牙配件设备300则与主机设备100建立了蓝牙通信连接。之后,蓝牙配件设备300可以向主机设备100发送消息2,与主机设备100进行数据交互。
其中,消息2可以包括蓝牙配件设备300的按键消息,这样,主机设备100可以基于消息2来执行相关任务(例如响应按键操作)。
参阅图3,图3示例性示出了将蓝牙配件设备300和蓝牙配件设备400的蓝牙通信连接由主机设备200切换到主机设备201的具体流程。具体步骤如下:
S301、主机设备200检测到用户将光标移动到屏幕的右侧边界的操作。
具体地,主机设备200可以实时监测蓝牙配件设备400的光标位置和光标的移动方向,当检测到光标处于屏幕的边界且向屏幕边界移动时,由于主机设备200上已经提前配置好其他主机设备的位置信息,因此,主机设备200可以确定光标处于屏幕的右侧边界且向屏幕右侧边界移动时,用户的意图是要将蓝牙配件设备的蓝牙通信连接切换到主机设备201。例如,主机设备200在检测到用户将光标移动到屏幕的右侧边界的操作之后,响应于该操作,主机设备200可以分别向蓝牙配件设备300和蓝牙配件设备400发送将蓝牙通信连接切换到主机设备201的指令(即执行下述步骤S302、S305)。
S302-S304、主机设备200向蓝牙配件设备400发送将蓝牙通信连接切换到主机设备201的指令,蓝牙配件设备400接收到该指令之后,可以切换蓝牙通道,切换完成之后,蓝牙配件设备400可以向主机设备201发送消息1’。
具体地,蓝牙配件设备400在接收到主机设备200发送的将蓝牙通信连接切换到主机设备201的指令之后,可以将蓝牙通道切换到主机设备201,切换完成之后,蓝牙配件设备400则与主机设备201建立了蓝牙通信连接。之后,蓝牙配件设备400可以向主机设备201发送消息1’,与主机设备201进行数据交互。
其中,消息1’可以包括蓝牙配件设备400的光标移动消息、按键消息,这样,主机设备201可以基于消息1’来执行相关任务(例如显示光标的位置、响应按键操作等)。
S305-S307、主机设备200向蓝牙配件设备300发送将蓝牙通信连接切换到主机设备201的指令,蓝牙配件设备300接收到该指令之后,可以切换蓝牙通道,切换完成之后,蓝牙配件设备300可以向主机设备201发送消息2’。
具体地,蓝牙配件设备300在接收到主机设备200发送的将蓝牙通信连接切换到主机设备201的指令之后,可以将蓝牙通道切换到主机设备201,切换完成之后,蓝牙配件设备300则与主机设备201建立了蓝牙通信连接。之后,蓝牙配件设备300可以向主机设备201发送消息2’,与主机设备201进行数据交互。
其中,消息2’可以包括蓝牙配件设备300的按键消息,这样,主机设备201可以基于消息2’来执行相关任务(例如响应按键操作)。
从图2和图3可以看出,上述实现方式需要在主机设备上开发复杂的应用程序,具有很强的定制性,无法覆盖多种场景。多个蓝牙配件设备之间无法进行数据交互,只能被动接收主机设备的控制指令,功能演进需要强依赖主机设备上的应用程序,多个蓝牙配件设备之间无法协同实现一些场景化的功能。此外,还需要用户提前配置好各台主机设备之间的位置信息,方案复杂,用户需要重度参与,体验较差。
应用场景二:控制蓝牙配件设备调节相关配置
通常,蓝牙配件设备存在一些配置功能,例如,鼠标的每英寸点数(Dots Per Inch,DPI)调节、灯效调节等,可以在鼠标上增加按键或者在主机设备上开发相关的应用程序来支持用户手动进行配置。
参阅图4A,图4A示例性示出了在主机设备上进行鼠标设置的用户界面,该用户界面中可以包括DPI调节拖动条411,用户可以通过拖动该DPI调节拖动条411来对鼠标进行DPI调节。
继续参阅图4A,可以看出,鼠标上有DPI加和DPI减的按键,用户也可以通过在鼠标上操作这两个按键来对鼠标进行DPI调节。通常,为了追求鼠标更好的外观和缩小硬件成本,不希望在鼠标上增加太多控制按键,因此当前市面上常用的方案还是在主机设备上开发相关的应用程序来进行配置。
继续参阅图4A,该用户界面还可以支持用户将鼠标上的按键配置成键盘上的组合键的特定功能。
参阅图4B,图4B示例性示出了在主机设备上对鼠标进行灯效调节的用户界面,该用户界面可以支持用户对鼠标进行开启/关闭灯效、开启/关闭轮廓灯、灯光色彩、速度、亮度等进行设置。
从图4A和图4B可以看出,在主机设备上开发相关的应用程序来实现对鼠标进行DPI、灯效等配置的调节,每次调节都需要用户打开应用程序,操作复杂;在鼠标上增加按键来实现键盘上的组合键的特定功能,由于鼠标按键数量有限,无法覆盖常用组合键的需求。此外,增加了软硬件成本,约束了鼠标的外观设计和ID设计。
应用场景三:组合按键
用户在使用键盘和鼠标时,很多场景下都是左手操作键盘,右手操作鼠标,而键盘上的一些组合键,用户很难进行单手操作,例如Fn+Fx的组合键,在这种情况下,用户右手需要脱离鼠标,通过左手和右手分别按下Fn和Fx来实现组合键的功能。
这样,用户右手需要在键盘和鼠标之间频繁切换,容易增加用户的疲劳度。
应用场景四:单手操作键盘
对于键盘来说,从携带和使用时占用的空间这两个角度考虑,用户存在减小键盘尺寸的需求,但是,当前市面上的单手操作键盘,在减小键盘尺寸的同时,也减少了键盘的很多按键功能,无法满足用户需求。
应用场景五:多个蓝牙配件设备分别与多个主机设备建立蓝牙通信连接
用户在使用具有蓝牙多连接功能的蓝牙配件设备(例如键盘、鼠标等)时,可以分别触发蓝牙配件设备的每个蓝牙通道来发送蓝牙广播消息,主机设备可以通过蓝牙广播消息来发现对应的蓝牙配件设备,进一步地,可以逐一与蓝牙配件设备进行蓝牙配对并建立蓝牙通信连接。
图5示例性示出了多个蓝牙配件设备分别与多个主机设备建立蓝牙连接的示意图。
参阅图5,以两个蓝牙配件设备(例如蓝牙配件设备300、蓝牙配件设备400)分别与三个主机设备(例如主机设备100、主机设备200、主机设备201)建立蓝牙通信连接为例,如果用户想要将蓝牙配件设备300与上述三个主机设备建立蓝牙通信连接,那么,用户需要分别触发蓝牙配件设备300依次与上述三个主机设备进行蓝牙配对,也即是说,用户需要进行3次蓝牙配对操作才能实现蓝牙配件设备300与上述三个主机设备建立蓝牙通信连接。同理,如果用户想要将蓝牙配件设备400与上述三个主机设备建立蓝牙通信连接,也需要进行3次 蓝牙配对操作才能实现蓝牙配件设备300与上述三个主机设备建立蓝牙通信连接。
可以看出,要想实现两个蓝牙配件设备分别与三个主机设备建立蓝牙通信连接,需要用户进行6次操作,此外,建立蓝牙通信连接之后,还需要用户确认这两个蓝牙配件设备所连接的主机设备是否为同一个主机设备,操作极为繁琐,用户体验差。
本申请实施例提供了一种通信方法,在多个蓝牙配件设备与主机设备建立蓝牙通信连接的情况下,可以基于主机设备的蓝牙路由功能为这多个蓝牙配件设备提供数据通信通道,这样,这多个蓝牙配件设备之间可以进行数据通信,从而使得这多个蓝牙配件设备可以协同实现对应场景下的差异化功能,简化用户操作,提高用户体验。
本申请实施例提供的通信方法,主要包括以下四种方案:
方案一(即下述实施例一,用于解决上述应用场景一中存在的问题):
基于主机设备的蓝牙路由功能,实现多个蓝牙配件设备之间的信息同步功能(例如同步蓝牙配件设备进行蓝牙切换事件的信息),这样,可以通过操作一个蓝牙配件设备(例如按下一个蓝牙配件设备的蓝牙切换按键)来使得多个蓝牙配件设备的蓝牙通信连接从一台主机设备自动切换到另一台主机设备,一步操作,多设备自动协同。
方案二(即下述实施例二和实施例三,用于解决上述应用场景二中存在的问题):
基于主机设备的蓝牙路由功能,实现多个蓝牙配件设备之间的信息同步功能(例如同步蓝牙配件设备的按键状态的信息),这样,可以通过借用一个蓝牙配件设备上的按键(例如键盘上的DPI按键、灯效调节按键)来实现对另一个蓝牙配件设备进行配置(例如通过借用键盘上的DPI按键、灯效调节按键来实现对鼠标进行DPI调节、灯效调节),共享硬件资源,降低成本,优化产品外观效果。
方案三(即下述实施例四,用于解决上述应用场景三和应用场景四中存在的问题):
基于主机设备的蓝牙路由功能,实现多个蓝牙配件设备之间的信息同步功能(例如同步蓝牙配件设备的按键状态的信息),这样,一个蓝牙配件设备的按键状态的信息可以同步到另一个蓝牙配件设备,一方面,一个蓝牙配件设备上的按键和另一个蓝牙配件设备上的按键可以形成组合键(例如鼠标上的侧按键与键盘上的Fx按键可以形成与键盘上的Fn+Fx功能相同的组合键),无需用户在两个蓝牙配件设备(例如鼠标和键盘)之间频繁切换,减缓用户疲劳;另一方面,一个蓝牙配件设备上的按键可以根据另一个蓝牙配件设备的按键状态的不同来实现不同的功能,例如,鼠标上某个按键按下时,可以改变键盘上的按键的功能(例如键盘上的QWERT分别转换成YUIOP),一键多功能,减少键盘按键数量,缩小键盘尺寸的同时,也可以满足用户的需求。
方案四(即下述实施例五,用于解决上述应用场景五中存在的问题):
主机设备可以通过与之建立蓝牙通信连接的蓝牙配件设备向与该蓝牙配件设备建立蓝牙通信连接的其他主机设备发送其他蓝牙配件设备的设备信息(例如蓝牙MAC地址等),使得一个或多个主机设备获取到未与之建立蓝牙通信连接的蓝牙配件设备的设备信息,这一个或多个主机设备可以基于蓝牙配件设备的设备信息主动与该蓝牙配件设备进行蓝牙配对并建立蓝牙通信连接,简化用户操作,提高用户体验。
后续实施例中会详细介绍上述四种方案,在此先不展开。
下面介绍本申请实施例提供的主机设备的两种软件架构示意图。
本申请实施例提供的主机设备配置的操作系统可以包括但不限于 等。
在主机设备配置的操作系统为(即鸿蒙操作系统)的情况下,主机设备的软件架构可以为图6A示例性所示的架构。
如图6A所示,主机设备可以包括应用层、框架层和驱动层。
应用层可以包括一系列应用程序。
框架层可以为应用层的应用程序提供应用编程接口(application programming interface,API)和编程框架。框架层包括一些预先定义的函数。
如图6A所示,框架层可以包括输入子系统、蓝牙管理服务模块。
输入子系统可以用于接收按键、触摸等输入事件,并且可以对这些原始输入事件进行处理,还可以对这些事件进行派发。输入子系统还可以提供注入事件的接口,应用程序可以通过调用这个接口产生输入事件,然后将该输入事件注入到输入子系统中进行处理。
蓝牙管理服务模块可以包括蓝牙设备管理服务模块、蓝牙路由管理服务模块。
其中,蓝牙设备管理服务模块可以用于查询附近是否存在蓝牙设备、与蓝牙配件设备建立蓝牙通信连接、负责本地设备可被其他设备发现或连接等。
其中,蓝牙路由管理服务模块是本申请实施例的核心模块,可以用于负责对蓝牙配件设备的路由注册管理、数据转发等。
驱动层可以用于检测和使能硬件。驱动层可以包括一个或多个驱动,例如显示驱动,摄像头驱动,音频驱动,传感器驱动、蓝牙驱动等。
在主机设备配置的操作系统为除之外的其他操作系统的情况下,以操作系统为为例,主机设备的软件架构可以为图6B示例性所示的架构。
如图6B所示,主机设备可以包括应用层、Windows软件开发工具包(SoftwareDevelopmentKit,SDK)和驱动层。
应用层可以包括一系列应用程序,例如,应用程序1(例如电脑管家)。其中,应用程序1中可以包括蓝牙路由管理服务模块。
可以看出,与图6A所示实施例不同的是,图6B中所示的蓝牙路由管理服务模块是集成在了应用层,其功能与图6A中所示的蓝牙路由管理服务模块可以是类似的。
Windows SDK可以包括蓝牙SDK。其中,蓝牙SDK可以为上层应用中的蓝牙路由管理服务模块提供相关的接口来实现本申请实施例中提供的方法。
驱动层可以用于检测和使能硬件。驱动层可以包括一个或多个驱动,例如显示驱动,摄像头驱动,音频驱动,传感器驱动、蓝牙驱动等。
可以理解的是,图6A和图6B仅仅是示例性的,不应该对本申请实施例中主机设备的软件架构产生任何的限定。例如,在本申请另一些实施例中,主机设备的软件架构也可以采用与图6A和图6B所示的例子中不同的分层结构,或者每层还可以包括更多或者更少的模块、或者多种不同模块方式的组合等,本申请实施例对此不作限定。
参阅图6C,图6C示例性示出了本申请实施例提供的上述蓝牙路由管理服务模块的一种架构示意图。
如图6C所示,蓝牙路由管理服务模块可以包括蓝牙路由服务连接管理模块、蓝牙路由协议模块、路由设备注册管理模块、数据转发模块、路由映射表。
蓝牙路由服务连接管理模块可以用于基于蓝牙协议建立特定通用唯一识别码(UniversallyUniqueIdentifier,UUID)的服务连接和设备认证;将接收的报文发送给蓝牙路由协议模块;提供数据收发接口;基于数据转发模块发送的路由类报文和通信句柄将路由类报文发送给对应的蓝牙配件设备;等等。
其中,上述接收的报文可以为来自蓝牙配件设备的报文(例如注册类报文、路由类报文)。
蓝牙路由协议模块可以用于负责对蓝牙路由服务连接管理发送的报文进行解析;将注册类报文发送给路由设备注册管理模块;将路由类报文发送给数据转发模块;等等。
路由设备注册管理模块可以用于接收蓝牙路由协议模块发送的注册类报文;更新路由映射表;等等。
例如,路由设备注册管理模块在接收到蓝牙路由协议模块发送的注册类报文之后,可以基于注册类报文中的注册的设备类型将通信句柄写入到对应的路由映射表中。
其中,上述通信句柄可以包括注册的设备类型对应的蓝牙通信连接的信息(例如蓝牙通道的信息等等)。
路由映射表可以用于记录并保存注册的设备类型与通信句柄的映射关系,即注册的设备类型与蓝牙通信连接的映射关系。
数据转发模块可以用于接收蓝牙路由协议模块发送的路由类报文;还可以基于路由类报文中携带的目的设备类型,读取路由映射表,从而获取目的设备类型对应的通信句柄;还可以将路由类报文和通信句柄发送给蓝牙路由服务连接管理模块;等等。
可以理解的是,图6C仅仅是示例性的,不应该对本申请实施例中蓝牙路由管理服务模块的架构产生任何的限定。例如,在本申请另一些实施例中,蓝牙路由管理服务模块的架构还可以包括更多或者更少的模块、或者多种不同模块方式的组合等,本申请实施例对此不作限定。
参阅图6D,图6D示例性示出了本申请实施例提供的一种蓝牙路由协议报文的结构示意图。
如图6D所示,蓝牙路由协议报文可以由以下几个字段构成:版本信息(Version)、数据类型(DataType)、源设备类型(SourceDeviceType,SrcDevType)、目的设备类型(DestinationDeviceType,DestDevType)、保留字段(Reserved,Rev)、有效载荷(Payload)。其中:
版本信息(Version),字段长度可以为1Byte,可以包括路由协议的版本等信息,可以用于进行设备间的协议匹配校验。
数据类型(DataType),字段长度可以为1Byte,可以用于表示报文的数据类型。
例如,0x01可以表示报文的数据类型为注册类,即该报文为注册类报文(也可以称为设备注册报文),0x02可以表示报文的数据类型为路由类,即该报文为路由类报文(即需要路由给其他设备的报文)。
源设备类型(SourceDeviceType,SrcDevType),字段长度可以为1Byte,可以用于表示 报文发送方的设备类型。
例如,0x00可以表示主机设备,0x01可以表示鼠标设备,0x02可以表示键盘设备,0x03可以表示手写笔设备,0x04可以表示音箱设备,等等。
目的设备类型(DestinationDeviceType,DestDevType),字段长度可以为2Byte,可以用于表示报文接收方的设备类型。每个bit位可以表示一种设备类型,例如,bit0可以表示主机设备,bit1可以表示鼠标设备,bit2可以表示键盘设备,bit3可以表示手写笔设备,bit4可以表示音箱设备,等等。
其中,某个/些bit设置为1,则目的设备类型则可以为该个/些bit所表示的设备类型,例如,bit1设置为1,则目的设备类型为鼠标设备;又例如,bit1和bit2设置为1,则目的设备类型为鼠标设备和键盘设备。
保留字段(Reserved,Rev),字段长度可以为2Byte,可以表示未定义的数据,用于后续进行扩展。
有效载荷(Payload),字段长度可以为nByte(n为正整数),可以基于设备间的业务需求,表示自行定义的数据。
在本申请实施例中,上述自行定义的数据可以包括蓝牙配件设备监测到的事件的信息(例如用户按下键盘上某个按键的事件的信息、用户按下鼠标上某个按键的事件的信息等)。
可以理解的是,图6D所示的蓝牙路由协议报文的结构仅仅是示例性的,在一些实施例中,蓝牙路由协议报文的结构还可以是其他,本申请实施例对此不作限定。
下面介绍本申请实施例提供的蓝牙配件设备的一种软件架构示意图。
本申请实施例提供的蓝牙配件设备配置的操作系统可以包括但不限于 轻量级物联网系统内核等。
在一些实施例中,蓝牙配件设备配置的操作系统可以为嵌入式操作系统,或者,蓝牙配件设备不配置操作系统。
参阅图7,图7示例性示出了蓝牙配件设备的软件架构示意图。
如图7所示,蓝牙配件设备可以包括应用层、服务层、驱动层。
应用层为蓝牙配件设备的具体业务功能的实现模块,可以包括事件处理模块。
事件处理模块可以用于接收蓝牙数据通信服务模块发送的事件的信息;还可以用于基于事件的信息执行相应的动作。例如,响应用户按下键盘上某个按键的事件,基于人体接口设备(HumanInterfaceDevice,HID)这一蓝牙协议将该按键对应的键值发送给主机设备,或,执行蓝牙通道切换的动作,等等。
服务层为提供蓝牙配件设备的通用能力的模块,可以包括事件监测模块、蓝牙数据通信服务模块。
事件监测模块可以用于负责监测蓝牙配件设备的所有的事件(例如用户按下按键的事件、用户松开按键的事件、建立蓝牙通信连接的事件、断开蓝牙通信连接的事件等),还可以收集上述事件的信息,等等。
蓝牙数据通信服务模块可以用于负责路由数据的封装和解析,提供路由数据的收发接口,等等。
驱动层为蓝牙配件设备进行检测和使能硬件的模块,可以包括按键采集模块、蓝牙SDK。
按键采集模块可以用于获取用户的按键行为。
蓝牙SDK可以提供蓝牙芯片的基础SDK。
可以理解的是,图7仅仅是示例性的,不应该对本申请实施例中蓝牙配件设备的软件架构产生任何的限定。例如,在本申请另一些实施例中,蓝牙配件设备的软件架构也可以采用与图7所示的例子中不同的分层结构,或者每层还可以包括更多或者更少的模块、或者多种不同模块方式的组合等,本申请实施例对此不作限定。
基于上述主机设备和蓝牙配件设备的软件架构,下面介绍本申请实施例提供的蓝牙路由方法的具体流程。
图8示例性示出了本申请实施例提供的一种蓝牙路由方法的具体流程。
如图8所示,该方法可以应用于包括主机设备、蓝牙配件设备A、蓝牙配件设备B的通信系统。其中,主机设备可以包括蓝牙路由管理服务模块,蓝牙配件设备A可以包括事件监测模块、蓝牙数据通信服务模块,蓝牙配件设备B可以包括事件处理模块、蓝牙数据通信服务模块。下面详细介绍该方法的具体步骤:
首先,在本申请实施例中,主机设备与蓝牙配件设备A、蓝牙配件设备B之间需要建立蓝牙路由服务连接,并且蓝牙配件设备A与蓝牙配件设备B需要向主机设备注册设备类型,在建立完成蓝牙路由服务连接且注册完成设备类型的前提下,才可以继续执行下述阶段二中的各个步骤,以进行设备间的蓝牙路由数据通信。
示例性地,建立蓝牙路由服务连接与注册设备类型的一种可能的实现方式可以为下述阶段一(步骤S801-步骤S806)中描述的实现方式,下面详细介绍:
阶段一:建立蓝牙路由服务连接与注册设备类型
S801-S803、蓝牙配件设备A与主机设备建立蓝牙路由服务连接一,之后,蓝牙配件设备A可以向主机设备发送注册请求一,该请求中包括蓝牙配件设备A的设备类型。主机设备保存蓝牙通信连接一与蓝牙配件设备A的设备类型之间的映射关系,其中,蓝牙通信连接一为蓝牙配件设备A与主机设备建立的蓝牙通信连接。
其中,上述蓝牙路由服务连接一可以是基于蓝牙协议建立的特定UUID的服务连接,基于该蓝牙路由服务连接,蓝牙配件设备A可以向主机设备进行设备注册(例如进行蓝牙路由设备类型注册)、与主机设备之间进行数据通信。
蓝牙配件设备A在与主机设备建立了蓝牙路由服务连接一之后,蓝牙配件设备A的蓝牙数据通信服务模块可以主动向主机设备的蓝牙路由管理服务模块发送注册请求一,该请求可以为蓝牙配件设备A向主机设备进行蓝牙路由设备类型注册的请求,该请求中可以包括蓝牙配件设备A的设备类型。
容易理解,上述注册请求一为注册类报文,其结构可以参照前述图6D所示的报文的结构。
主机设备的蓝牙路由管理服务模块在接收到蓝牙配件设备A发送的注册请求一之后,主机设备的蓝牙路由管理服务模块可以通过解析上述注册请求一获取到蓝牙配件设备A的设备类型,之后可以记录并保存蓝牙通信连接一与蓝牙配件设备A的设备类型之间的映射关系。
可以理解的是,在蓝牙配件设备A与主机设备建立蓝牙路由服务连接一之前,蓝牙配件设备A与主机设备还需要先建立蓝牙通信连接一,该蓝牙通信连接一可以是通过主机设备的蓝牙设备管理模块建立的。也即是说,在蓝牙配件设备A与主机设备建立了蓝牙通信连接一 的基础上,蓝牙配件设备A与主机设备才可以建立上述蓝牙路由服务连接一。
S804-S806、蓝牙配件设备B与主机设备建立蓝牙路由服务连接二,之后,蓝牙配件设备B可以向主机设备发送注册请求二,该请求中包括蓝牙配件设备B的设备类型。主机设备保存蓝牙通信连接二与蓝牙配件设备B的设备类型之间的映射关系,其中,蓝牙通信连接二为蓝牙配件设备B与主机设备建立的蓝牙通信连接。
其中,上述蓝牙路由服务连接二可以是基于蓝牙协议建立的特定UUID的服务连接,基于该蓝牙路由服务连接,蓝牙配件设备B可以向主机设备进行设备注册(例如进行蓝牙路由设备类型注册)、与主机设备之间进行数据通信。
蓝牙配件设备B在与主机设备建立了蓝牙路由服务连接二之后,蓝牙配件设备B的蓝牙数据通信服务模块可以主动向主机设备的蓝牙路由管理服务模块发送注册请求二,该请求可以为蓝牙配件设备B向主机设备进行蓝牙路由设备类型注册的请求,该请求中可以包括蓝牙配件设备B的设备类型。
容易理解,上述注册请求二为注册类报文,其结构可以参照前述图6D所示的报文的结构。
主机设备的蓝牙路由管理服务模块在接收到蓝牙配件设备B发送的注册请求二之后,主机设备的蓝牙路由管理服务模块可以通过解析上述注册请求二获取到蓝牙配件设备B的设备类型,之后可以记录并保存蓝牙通信连接二与蓝牙配件设备B的设备类型之间的映射关系。
可以理解的是,在蓝牙配件设备B与主机设备建立蓝牙路由服务连接二之前,蓝牙配件设备B与主机设备还需要先建立蓝牙通信连接二,该蓝牙通信连接二可以是通过主机设备的蓝牙设备管理模块建立的。也即是说,在蓝牙配件设备B与主机设备建立了蓝牙通信连接二的基础上,蓝牙配件设备B与主机设备才可以建立上述蓝牙路由服务连接二。
需要说明的是,本申请实施例对执行步骤S801-步骤S803、步骤S804-步骤S806的时间顺序不作限定。例如,步骤S801-步骤S803可以先于步骤S804-步骤S806执行;又例如,步骤S801-步骤S803可以后于步骤S804-步骤S806执行;再例如,步骤S801-步骤S803可以与步骤S804-步骤S806同时执行。
在完成上述阶段一(即建立蓝牙路由服务连接与注册设备类型阶段)之后,可以基于已建立的蓝牙路由服务连接来进行设备间的蓝牙路由数据通信。
示例性地,进行设备间的蓝牙路由数据通信的一种可能的实现方式可以为下述阶段二(步骤S807-步骤S821)中描述的实现方式,下面详细介绍:
阶段二:进行设备间的蓝牙路由数据通信
S807-S810、蓝牙配件设备A的事件监测模块监测到发生事件a,之后,蓝牙配件设备A的事件监测模块可以向蓝牙配件设备A的蓝牙数据通信服务模块发送数据一,该数据中可以包括事件a的信息、目的设备类型1。蓝牙配件设备A的蓝牙数据通信服务模块可以封装数据一,之后,可以向主机设备的蓝牙路由管理服务模块发送封装好的数据一。
具体地,蓝牙配件设备A的事件监测模块可以实时地进行事件监测,在监测到事件a(例如用户按下蓝牙配件设备A的某个按键的事件等)发生之后,事件监测模块可以调用蓝牙数据通信服务模块提供的数据发送接口,来向蓝牙数据通信服务模块发送数据一,该数据中可 以包括事件a的信息(例如用户按下的蓝牙配件设备A的某个按键对应的键值等信息)、目的设备类型1。
其中,上述数据一中可以包括一个或多个目的设备类型(例如目的设备类型1),这一个或多个目的设备类型可以是预先设置好的,无需用户手动设置。这一个或多个目的设备类型为需要接收上述数据一的设备(即上述数据一的接收方)对应的设备类型。
蓝牙配件设备A的蓝牙数据通信服务模块在接收到上述数据一之后,可以将上述数据一进行封装,得到满足蓝牙协议格式的数据,即封装好的数据一。
容易理解,上述封装好的数据一为路由类报文,其结构可以参照前述图6D所示的报文的结构。
进一步地,蓝牙配件设备A的蓝牙数据通信服务模块可以向主机设备的蓝牙路由管理服务模块发送上述封装好的数据一。
S811-S812、主机设备的蓝牙路由管理服务模块基于封装好的数据一确定目的设备类型1为蓝牙配件设备B的设备类型,并基于已保存的设备类型与蓝牙通信连接之间的映射关系确定目的设备类型1对应的蓝牙通信连接为蓝牙通信连接二,之后,主机设备的蓝牙路由管理服务模块可以向蓝牙配件设备B的蓝牙数据通信服务模块发送封装好的数据一。
具体地,假设目的设备类型1为蓝牙配件设备B的设备类型,主机设备的蓝牙路由管理服务模块在接收到蓝牙配件设备A发送的封装好的数据一之后,由于封装好的数据一中包括目的设备类型1,那么,主机设备的蓝牙路由管理服务模块可以解析封装好的数据一得到目的设备类型1,并确定目的设备类型1为蓝牙配件设备B的设备类型,进一步地,由于在阶段一中主机设备的蓝牙路由管理服务模块记录并保存了蓝牙配件设备B的设备类型与蓝牙通信连接二之间的映射关系,因此,主机设备的蓝牙路由管理服务模块可以基于已保存的设备类型与蓝牙通信连接之间的映射关系确定目的设备类型1对应的蓝牙通信连接为蓝牙通信连接二,进一步地,主机设备的蓝牙路由管理服务模块可以确定需要通过上述蓝牙通信连接二将上述封装好的数据一发送给蓝牙配件设备B。之后,主机设备的蓝牙路由管理服务模块可以通过上述蓝牙通信连接二向蓝牙配件设备B的蓝牙数据通信服务模块发送上述封装好的数据一。
在一些实施例中,例如,在只包括蓝牙配件设备A和蓝牙配件设备B的场景下,或者,上述事件a为全部蓝牙配件设备的通用事件(例如切换蓝牙通信连接的事件)的场景下,上述步骤S808中的数据一也可以只包括事件a的信息,而不包括目的设备类型1。
在一些实施例中,在上述步骤S812中,主机设备也可以只把数据一中包括的事件a的信息发送给蓝牙配件设备B。
S813-S814、蓝牙配件设备B的蓝牙数据通信服务模块解析封装好的数据一,识别出事件a的信息,之后,蓝牙配件设备B的蓝牙数据通信服务模块可以向蓝牙配件设备B的事件处理模块发送事件处理消息,该消息中包括事件a的信息。
具体地,蓝牙配件设备B的蓝牙数据通信服务模块在接收到主机设备的蓝牙路由管理服务模块发送的封装好的数据一之后,可以对该封装好的数据一进行解析,从而识别出该封装好的数据一中包括的事件a的信息。之后,蓝牙配件设备B的蓝牙数据通信服务模块可以向 蓝牙配件设备B的事件处理模块发送事件处理消息,该消息中可以包括事件a的信息,以通知蓝牙配件设备B的事件处理模块对事件a进行处理。
S815-S816、蓝牙配件设备B的事件处理模块执行事件a对应的动作,执行完成之后,可以向蓝牙配件设备B的蓝牙数据通信服务模块发送事件处理完成消息。
具体地,蓝牙配件设备B的事件处理模块在接收到蓝牙配件设备B的蓝牙数据通信服务模块发送的事件处理消息之后,可以对事件a进行处理,即执行事件a对应的动作。执行完成之后,可以向蓝牙配件设备B的蓝牙数据通信服务模块发送事件处理完成消息以向蓝牙配件设备B的蓝牙数据通信服务模块通知蓝牙配件设备B的事件处理模块已完成对事件a的处理。
其中,上述事件处理完成消息中可以包括蓝牙配件设备B对事件a的处理结果。
S817、蓝牙配件设备B的蓝牙数据通信服务模块向主机设备的蓝牙路由管理服务模块发送响应数据,该数据中包括事件处理完成消息、目的设备类型2。
具体地,蓝牙配件设备B的蓝牙数据通信服务模块在接收到蓝牙配件设备B的事件处理模块发送的事件处理完成消息之后,可以生成响应数据,该数据中可以包括上述事件处理完成消息、目的设备类型2。之后,蓝牙配件设备B的蓝牙数据通信服务模块可以向主机设备的蓝牙路由管理服务模块发送上述响应数据,以便通过主机设备来向蓝牙配件设备A反馈蓝牙配件设备B对上述事件a的处理结果。
其中,上述目的设备类型2可以为上述数据一的发送方对应的设备类型(即蓝牙配件设备A的设备类型)。
容易理解,上述响应数据为路由类报文,其结构可以参照前述图6D所示的报文的结构。
S818-S819、主机设备的蓝牙路由管理服务模块基于响应数据确定目的设备类型2为蓝牙配件设备A的设备类型,并基于已保存的设备类型与蓝牙通信连接之间的映射关系确定目的设备类型2对应的蓝牙通信连接为蓝牙通信连接一,之后,主机设备的蓝牙路由管理服务模块可以向蓝牙配件设备A的蓝牙数据通信服务模块发送响应数据。
具体地,可以理解,目的设备类型2为蓝牙配件设备A的设备类型,主机设备的蓝牙路由管理服务模块在接收到蓝牙配件设备B发送的响应数据之后,由于响应数据中包括目的设备类型2,那么,主机设备的蓝牙路由管理服务模块可以解析响应数据得到目的设备类型2,并确定目的设备类型2为蓝牙配件设备A的设备类型,进一步地,由于在阶段一中主机设备的蓝牙路由管理服务模块记录并保存了蓝牙配件设备A的设备类型与蓝牙通信连接一之间的映射关系,因此,主机设备的蓝牙路由管理服务模块可以基于已保存的设备类型与蓝牙通信连接之间的映射关系确定目的设备类型2对应的蓝牙通信连接为蓝牙通信连接一,进一步地,主机设备的蓝牙路由管理服务模块可以确定需要通过上述蓝牙通信连接一将上述响应数据发送给蓝牙配件设备A。之后,主机设备的蓝牙路由管理服务模块可以通过上述蓝牙通信连接一向蓝牙配件设备A的蓝牙数据通信服务模块发送上述响应数据。
S820-S821、蓝牙配件设备A的蓝牙数据通信服务模块解析响应数据得到事件处理完成消息,之后,蓝牙配件设备A的蓝牙数据通信服务模块可以向蓝牙配件设备A的事件监测模块发送事件处理完成消息。
具体地,蓝牙配件设备A的蓝牙数据通信服务模块在接收到主机设备的蓝牙路由管理服务模块发送的响应数据之后,可以解析响应数据得到事件处理完成消息。之后,蓝牙配件设备A的蓝牙数据通信服务模块可以向蓝牙配件设备A的事件监测模块发送事件处理完成消息,以向蓝牙配件设备A的事件监测模块通知蓝牙配件设备B对上述事件a的处理结果。
在上述实施例中,蓝牙配件设备B在事件处理完成(即事件处理成功)的情况下可以通过主机设备向蓝牙配件设备A发送事件处理完成消息,在一些实施例中,蓝牙配件设备B在事件处理失败的情况下也可以通过主机设备向蓝牙配件设备A发送相应消息以通知蓝牙配件设备A事件处理失败,这样,蓝牙配件设备A可以基于该消息执行相应操作,例如,重新通过主机设备向蓝牙配件设备B发送上述数据一。
通过实施上述图8所示实施例提供的方法,在多个蓝牙配件设备与主机设备建立蓝牙通信连接的情况下,可以基于主机设备的蓝牙路由功能为这多个蓝牙配件设备提供数据通信通道,这样,这多个蓝牙配件设备之间可以进行数据通信,从而使得这多个蓝牙配件设备可以协同完成某项任务或实现某种功能。
下面结合不同的应用场景来介绍本申请实施例提供的通信方法。
实施例一:通过操作一个蓝牙配件设备(例如按下一个蓝牙配件设备的蓝牙切换按键)来使得多个蓝牙配件设备的蓝牙通信连接从一台主机设备自动切换到另一台主机设备。
图9示例性示出了本申请实施例提供的通信方法在切换多个蓝牙配件设备的蓝牙通信连接这一应用场景下的具体流程。
如图9所示,该方法可以应用于包括主机设备100、主机设备200、蓝牙配件设备300(例如键盘)、蓝牙配件设备400(例如鼠标)、蓝牙配件设备500(例如音箱)的通信系统。下面详细介绍该方法的具体步骤:
首先,在本申请实施例中,主机设备100与蓝牙配件设备300、蓝牙配件设备400、蓝牙配件设备500之间需要建立蓝牙路由服务连接,并且蓝牙配件设备300、蓝牙配件设备400、蓝牙配件设备500需要向主机设备100注册设备类型,在建立完成蓝牙路由服务连接且注册完成设备类型的前提下,才可以继续执行下述阶段二中的各个步骤,以切换多个蓝牙配件设备的蓝牙通信连接。
示例性地,建立蓝牙路由服务连接与注册设备类型的一种可能的实现方式可以为下述阶段一(步骤S901-步骤S909)中描述的实现方式,下面详细介绍:
阶段一:建立蓝牙路由服务连接与注册设备类型
S901-S903、蓝牙配件设备300与主机设备100建立蓝牙路由服务连接1,之后,蓝牙配件设备300可以向主机设备100发送注册请求1,该请求中包括蓝牙配件设备300的设备类型。主机设备100保存蓝牙通信连接1与蓝牙配件设备300的设备类型之间的映射关系,其中,蓝牙通信连接1为蓝牙配件设备300与主机设备100建立的蓝牙通信连接。
S904-S906、蓝牙配件设备400与主机设备100建立蓝牙路由服务连接2,之后,蓝牙配件设备400可以向主机设备100发送注册请求2,该请求中包括蓝牙配件设备400的设备类型。主机设备100保存蓝牙通信连接2与蓝牙配件设备400的设备类型之间的映射关系,其中,蓝牙通信连接2为蓝牙配件设备400与主机设备100建立的蓝牙通信连接。
S907-S909、蓝牙配件设备500与主机设备100建立蓝牙路由服务连接3,之后,蓝牙配件设备500可以向主机设备100发送注册请求3,该请求中包括蓝牙配件设备500的设备类型。主机设备100保存蓝牙通信连接3与蓝牙配件设备500的设备类型之间的映射关系,其中,蓝牙通信连接3为蓝牙配件设备500与主机设备100建立的蓝牙通信连接。
其中,上述步骤S901-步骤S903、步骤S904-步骤S906、步骤S907-步骤S909与前述图8所示阶段一中的步骤S801-步骤S803(或步骤S804-步骤S806)类似,其具体执行过程可以参照前述图8所示阶段一中的步骤S801-步骤S803(或步骤S804-步骤S806)中的相关文字描述,在此不再赘述。
在完成上述阶段一(即建立蓝牙路由服务连接与注册设备类型阶段)之后,可以基于已建立的蓝牙路由服务连接来切换多个蓝牙配件设备的蓝牙通信连接。
示例性地,切换多个蓝牙配件设备的蓝牙通信连接的一种可能的实现方式可以为下述阶段二(步骤S910-步骤S920)中描述的实现方式,下面详细介绍:
阶段二:切换多个蓝牙配件设备的蓝牙通信连接
S910-S911、蓝牙配件设备300检测到用户触发将蓝牙通信连接由主机设备100切换到主机设备200的事件(即切换事件),之后,蓝牙配件设备300可以向主机设备100发送数据1,该数据中可以包括切换事件的信息、蓝牙配件设备400的设备类型、蓝牙配件设备500的设备类型。
假设蓝牙配件设备300为图10示例性所示的键盘,参阅图10,可以看出,蓝牙配件设备300上有F8按键、F9按键、F10按键,这三个按键(也可以称为蓝牙切换按键)均可以用于支持蓝牙配件设备300与其他设备进行蓝牙配对并建立蓝牙通信连接,也即是说,蓝牙配件设备300可以有三个蓝牙通道,上述三个按键可以分别对应一个蓝牙通道,蓝牙配件设备300可以通过这三个蓝牙通道分别与另外三个设备进行蓝牙配对并建立蓝牙通信连接,之后,用户只需点击F8按键、F9按键、F10按键即可在设备间切换蓝牙通信连接,无需重新进行蓝牙配对,方便快捷。
可以理解,在配件设备(例如蓝牙配件设备300)处于工作状态下,配件设备只能与其中一个已建立通信连接(例如蓝牙通信连接)的主机设备进行数据通信(例如蓝牙数据通信),在这种情况下,能够通过已建立的通信连接与配件设备进行数据通信的某一个主机设备可以称为该配件设备的焦点主机设备,例如,在配件设备为键盘或鼠标的情况下,该配件设备当前所操作或控制的某一个主机设备可以称为该配件设备的焦点主机设备;又例如,在配件设备为音箱的情况下,当前所控制该配件设备的某一个主机设备可以称为该配件设备的焦点主机设备。
容易理解,在触发切换事件之前,蓝牙配件设备300、蓝牙配件设备400、蓝牙配件设备500的焦点主机设备均为主机设备100,在触发切换事件之后,蓝牙配件设备300、蓝牙配件设备400、蓝牙配件设备500的焦点主机设备均可以由主机设备100切换到另一台主机设备(例如主机设备200)。
需要说明的是,本申请实施例中所述的“切换蓝牙配件设备的蓝牙通信连接,或,将蓝牙配件设备的蓝牙通信连接从一台主机设备切换到另一台主机设备,或,切换蓝牙配件设备 的蓝牙通道”可以是指将蓝牙配件设备的焦点主机设备从一台主机设备切换到另一台主机设备。也即是说,切换之前,蓝牙配件设备可以通过与一台主机设备(例如主机设备100)建立的蓝牙通信连接与该主机设备(例如主机设备100)进行蓝牙数据通信;切换之后,蓝牙配件设备可以通过与另一台主机设备(例如主机设备200)建立的蓝牙通信连接与该主机设备(例如主机设备200)进行蓝牙数据通信。
以F8按键对应的蓝牙通信连接为上述阶段一中蓝牙配件设备300与主机设备100建立的蓝牙通信连接为例,假设蓝牙配件设备300通过F9按键与主机设备200进行过蓝牙配对,而当前蓝牙配件设备300与主机设备100保持着蓝牙通信连接,那么,在用户想要将当前的蓝牙通信连接由主机设备100切换到主机设备200(即蓝牙配件设备300与主机设备200建立蓝牙通信连接以进行蓝牙数据通信)的情况下,蓝牙配件设备300可以检测到用户触发将蓝牙通信连接由主机设备100切换到主机设备200的事件(例如用户按下图10所示的F9按键的事件),之后,蓝牙配件设备300可以通过与主机设备100建立的蓝牙路由服务连接1向主机设备100发送数据1,该数据中可以包括切换事件的信息、蓝牙配件设备400的设备类型、蓝牙配件设备500的设备类型。
其中,上述切换事件的信息可以包括主机设备200的设备信息,例如,主机设备200的蓝牙媒体访问控制(MediaAccessControl,MAC)地址等。其中,主机设备200的蓝牙MAC地址可以是完整的蓝牙MAC地址;也可以是部分的蓝牙MAC地址,例如蓝牙MAC地址的后三位,以便提高安全性。
其中,蓝牙配件设备400的设备类型、蓝牙配件设备500的设备类型可以为目的设备类型,是预先设置好的,无需用户手动设置。
可以理解,目的设备类型可以为一个或多个,在本申请实施例中仅仅以目的设备类型为两个来举例说明,不应构成任何限定。
S912-S914、主机设备100基于数据1确定目的设备类型为蓝牙配件设备400的设备类型、蓝牙配件设备500的设备类型,并基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备400的设备类型对应的蓝牙通信连接为蓝牙通信连接2,蓝牙配件设备500的设备类型对应的蓝牙通信连接为蓝牙通信连接3,之后,主机设备100可以分别向蓝牙配件设备400、蓝牙配件设备500发送数据1。
具体地,主机设备100在接收到蓝牙配件设备300发送的数据1之后,可以解析数据1并确定目的设备类型为蓝牙配件设备400的设备类型、蓝牙配件设备500的设备类型。进一步地,由于在阶段一中主机设备100记录并保存了蓝牙配件设备400的设备类型与蓝牙通信连接2之间的映射关系、蓝牙配件设备500的设备类型与蓝牙通信连接3之间的映射关系,因此,主机设备100可以基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备400的设备类型对应的蓝牙通信连接为蓝牙通信连接2,蓝牙配件设备500的设备类型对应的蓝牙通信连接为蓝牙通信连接3。进一步地,主机设备100可以确定需要通过上述蓝牙通信连接2将上述数据1发送给蓝牙配件设备400,需要通过上述蓝牙通信连接3将上述数据1发送给蓝牙配件设备500。之后,主机设备100可以分别通过上述蓝牙通信连接2向蓝牙配件设备400发送上述数据1,通过上述蓝牙通信连接3向蓝牙配件设备500发送上述数据1。
需要说明的是,本申请实施例对执行步骤S913和步骤S914的时间顺序不作限定。例如, 步骤S913可以先于步骤S914执行;又例如,步骤S913可以后于步骤S914执行;再例如,步骤S913可以与步骤S914同时执行。
S915-S916、蓝牙配件设备300向主机设备200发送蓝牙广播消息1,之后,蓝牙配件设备300与主机设备200建立蓝牙通信连接1。
具体地,蓝牙配件设备300在向主机设备100发送数据1之后,可以解析数据1并基于数据1确定需要与主机设备200建立蓝牙通信连接,进一步地,蓝牙配件设备300可以向主机设备200发送蓝牙广播消息1,主机设备200在接收到蓝牙配件设备300发送的蓝牙广播消息1之后,可以与蓝牙配件设备300建立蓝牙通信连接1,即蓝牙配件设备300成功将蓝牙通道切换到主机设备200,这样,蓝牙配件设备300与主机设备200可以基于已建立的蓝牙通信连接1进行蓝牙数据通信。
其中,步骤S915-步骤S916可以是在步骤S911之后就执行,也可以是在执行步骤S911-步骤S914之间的某个时间执行,本申请实施例对此不作限定。
S917-S918、蓝牙配件设备400向主机设备200发送蓝牙广播消息2,之后,蓝牙配件设备400与主机设备200建立蓝牙通信连接2。
具体地,蓝牙配件设备400在接收到主机设备100发送的数据1之后,可以解析数据1并基于数据1确定需要与主机设备200建立蓝牙通信连接,进一步地,蓝牙配件设备400可以向主机设备200发送蓝牙广播消息2,主机设备200在接收到蓝牙配件设备400发送的蓝牙广播消息2之后,可以与蓝牙配件设备400建立蓝牙通信连接2,即蓝牙配件设备400成功将蓝牙通道切换到主机设备200,这样,蓝牙配件设备400与主机设备200可以基于已建立的蓝牙通信连接2进行蓝牙数据通信。
其中,步骤S917-步骤S918可以是在步骤S913之后的某个时间执行,本申请实施例对此不作限定。
S919-S920、蓝牙配件设备500向主机设备200发送蓝牙广播消息3,之后,蓝牙配件设备500与主机设备200建立蓝牙通信连接3。
具体地,蓝牙配件设备500在接收到主机设备100发送的数据1之后,可以解析数据1并基于数据1确定需要与主机设备200建立蓝牙通信连接,进一步地,蓝牙配件设备500可以向主机设备200发送蓝牙广播消息3,主机设备200在接收到蓝牙配件设备500发送的蓝牙广播消息3之后,可以与蓝牙配件设备400建立蓝牙通信连接3,即蓝牙配件设备500成功将蓝牙通道切换到主机设备200,这样,蓝牙配件设备500与主机设备200可以基于已建立的蓝牙通信连接3进行蓝牙数据通信。
其中,步骤S919-步骤S920可以是在步骤S914之后的某个时间执行,本申请实施例对此不作限定。
在本申请实施例中,在执行上述步骤S910之前,蓝牙配件设备300、蓝牙配件设备400、蓝牙配件设备500均可以与主机设备200进行过蓝牙配对且并没有与主机设备200保持着蓝牙通信连接,在这种情况下,上述蓝牙广播消息1、蓝牙广播消息2、蓝牙广播消息3可以分别称为蓝牙回连广播消息1、蓝牙回连广播消息2、蓝牙回连广播消息3,在与主机设备200建立蓝牙通信连接之前无需再重新进行蓝牙配对。在一些实施例中,蓝牙配件设备300、蓝 牙配件设备400、蓝牙配件设备500均可以与多台主机设备保持着蓝牙通信连接,例如,同时和主机设备100、主机设备200保持着蓝牙通信连接,在这种情况下,蓝牙配件设备无需发送蓝牙广播消息即可将蓝牙通信连接由主机设备100切换到主机设备200。
在一些实施例中,在执行上述步骤S910之前,若蓝牙配件设备400、蓝牙配件设备500与主机设备200均未进行过蓝牙配对,在建立蓝牙通信连接之前需进行蓝牙配对,配对成功之后才能建立蓝牙通信连接。
容易理解,蓝牙配件设备300、蓝牙配件设备400、蓝牙配件设备500在与主机设备200建立了蓝牙通信连接之后,也可以与主机设备200建立蓝牙路由服务连接,并向主机设备200进行设备类型注册,具体执行过程与图9所示阶段一中的步骤S901-步骤S909类似,可以参照前述关于步骤S901-步骤S909的相关文字描述,在此不再赘述。在一些实施例中,蓝牙配件设备300、蓝牙配件设备400、蓝牙配件设备500在与主机设备200建立蓝牙路由服务连接,并向主机设备200进行设备类型注册之后,蓝牙配件设备400、蓝牙配件设备500还可以通过主机设备200向蓝牙配件设备300发送切换事件处理完成的消息,这样,蓝牙配件设备300可以获知蓝牙配件设备400、蓝牙配件设备500对切换事件的处理结果。其中,蓝牙配件设备400、蓝牙配件设备500通过主机设备200向蓝牙配件设备300发送切换事件处理完成的消息的具体执行过程与前述图8所示的步骤S816-步骤S821的具体执行过程类似,可以参照前述关于步骤S816-步骤S821的相关文字描述,在此不再赘述。
可以理解,蓝牙配件设备具备蓝牙多连接功能的情况下,该蓝牙配件设备可以同时保持着与多台主机设备的蓝牙通信连接(但是只能与其中的某一台主机设备进行蓝牙数据通信),在这种情况下,触发切换事件之后,蓝牙配件设备可以只需切换蓝牙通道,无需重新建立蓝牙通信连接;该蓝牙配件设备也可以只与一台主机设备保持着蓝牙通信连接(即与一台主机设备建立蓝牙通信连接的情况下,与另一台主机设备建立的蓝牙通信连接可以断开),在这种情况下,触发切换事件之后,蓝牙配件设备需要重新建立蓝牙通信连接。
通过实施图9所示实施例提供的方法,可以通过操作一个蓝牙配件设备(例如按下一个蓝牙配件设备的蓝牙切换按键)来使得多个蓝牙配件设备的蓝牙通信连接从一台主机设备自动切换到另一台主机设备,方案简洁,注册和路由机制均可以做到用户无感,一步操作,即可实现多设备自动协同,方便快捷,简化用户操作,提高用户体验。
需要说明的是,上述图9所示实施例仅仅是以通过操作蓝牙配件设备300来使得蓝牙配件设备300、蓝牙配件设备400这两个蓝牙配件设备的蓝牙通信连接从一台主机设备自动切换到另一台主机设备为例来进行说明的,蓝牙配件设备300也可以使得更多数量的蓝牙配件设备的蓝牙通信连接从一台主机设备自动切换到另一台主机设备,本申请实施例对蓝牙配件设备的数量不作限定。此外,蓝牙配件设备400或蓝牙配件设备500也可以通过类似的方式来实现将其他蓝牙配件设备的蓝牙通信连接从一台主机设备自动切换到另一台主机设备,在此不再赘述。此外,在蓝牙配件设备与主机设备200建立了蓝牙通信连接之后,也可以通过操作一个蓝牙配件设备来使得多个蓝牙配件设备的蓝牙通信连接从主机设备200切换到主机设备100,其具体过程与前述将蓝牙通信连接从主机设备100切换到主机设备200的具体过程类似,在此不再赘述。
实施例二:通过一个蓝牙配件设备(例如键盘)来控制另一个蓝牙配件设备(例如鼠标)进行DPI调节。
图11示例性示出了本申请实施例提供的通信方法在通过一个蓝牙配件设备(例如键盘)来控制另一个蓝牙配件设备(例如鼠标)进行DPI调节这一应用场景下的具体流程。
如图11所示,该方法可以应用于包括主机设备100、蓝牙配件设备300(例如键盘)、蓝牙配件设备400(例如鼠标)的通信系统。下面详细介绍该方法的具体步骤:
首先,在本申请实施例中,主机设备100与蓝牙配件设备300、蓝牙配件设备400之间需要建立蓝牙路由服务连接,并且蓝牙配件设备300、蓝牙配件设备400需要向主机设备100注册设备类型,在建立完成蓝牙路由服务连接且注册完成设备类型的前提下,才可以继续执行下述阶段二中的各个步骤,以通过蓝牙配件设备300来控制蓝牙配件设备400调节DPI。
示例性地,建立蓝牙路由服务连接与注册设备类型的一种可能的实现方式可以为下述阶段一(步骤S1101-步骤S1106)中描述的实现方式,下面详细介绍:
阶段一:建立蓝牙路由服务连接与注册设备类型
S1101-S1103、蓝牙配件设备300与主机设备100建立蓝牙路由服务连接1,之后,蓝牙配件设备300可以向主机设备100发送注册请求1,该请求中包括蓝牙配件设备300的设备类型。主机设备100保存蓝牙通信连接1与蓝牙配件设备300的设备类型之间的映射关系,其中,蓝牙通信连接1为蓝牙配件设备300与主机设备100建立的蓝牙通信连接。
S1104-S1106、蓝牙配件设备400与主机设备100建立蓝牙路由服务连接2,之后,蓝牙配件设备400可以向主机设备100发送注册请求2,该请求中包括蓝牙配件设备400的设备类型。主机设备100保存蓝牙通信连接2与蓝牙配件设备400的设备类型之间的映射关系,其中,蓝牙通信连接2为蓝牙配件设备400与主机设备100建立的蓝牙通信连接。
其中,上述步骤S1101-步骤S1103、步骤S1104-步骤S1106、与前述图8所示阶段一中的步骤S801-步骤S803(或步骤S804-步骤S806)类似,其具体执行过程可以参照前述图8所示阶段一中的步骤S801-步骤S803(或步骤S804-步骤S806)中的相关文字描述,在此不再赘述。
在完成上述阶段一(即建立蓝牙路由服务连接与注册设备类型阶段)之后,可以基于已建立的蓝牙路由服务连接来通过蓝牙配件设备300控制蓝牙配件设备400调节DPI。
示例性地,通过蓝牙配件设备300来控制蓝牙配件设备400调节DPI的一种可能的实现方式可以为下述阶段二(步骤S1107-步骤S1111)中描述的实现方式,下面详细介绍:
阶段二:通过蓝牙配件设备300来控制蓝牙配件设备400调节DPI
S1107-S1108、蓝牙配件设备300检测到用户触发调节DPI的事件,之后,蓝牙配件设备300可以向主机设备100发送数据2,该数据中可以包括调节DPI事件的信息、蓝牙配件设备400的设备类型。
假设蓝牙配件设备300为图10示例性所示的键盘,蓝牙配件设备400为鼠标。
参阅图10,可以看出,蓝牙配件设备300上有Dpi按键(也可以称为DPI按键),该按键可以用于支持用户通过蓝牙配件设备300来控制蓝牙配件设备400调节DPI。
在用户想要通过蓝牙配件设备300来控制蓝牙配件设备400调节DPI的情况下,蓝牙配件设备300可以检测到用户触发调节DPI的事件(例如用户按下图10所示的Dpi按键的事件), 之后,蓝牙配件设备300可以通过与主机设备100建立的蓝牙路由服务连接1向主机设备100发送数据2,该数据中可以包括调节DPI事件的信息、蓝牙配件设备400的设备类型。
其中,上述调节DPI事件的信息可以包括Dpi按键的键值。
在本申请实施例中,调节DPI可以是使用轮询的方式,也即是说,通过蓝牙配件设备300来控制蓝牙配件设备400调节DPI,可以调节的DPI的数值可以是预先设置好的一个数值集合,示例性地,假设该数值集合为{100,200,300,400,……,16000},那么,用户第一次按下Dpi按键的事件对应的DPI的数值为100,第二次按下Dpi按键的事件对应的DPI的数值为200,依次类推,在用户按下Dpi按键的事件对应的DPI的数值为16000之后,如果用户再次按下Dpi按键,那么,用户本次按下Dpi按键的事件对应的DPI的数值又回到了100。容易理解,用户每按下一次蓝牙配件设备300的Dpi按键,蓝牙配件设备400的DPI的数值就可以调节一次,即蓝牙配件设备400的DPI的数值调节为每一次按下Dpi按键的事件对应的DPI的数值,其中,用户每一次按下Dpi按键的事件对应的DPI的数值(即上述数值集合中的每一个数值)可以是蓝牙配件设备400预先设置好的且存储在蓝牙配件设备400上。
在上述实施例中,以用户按下Dpi按键的事件为例来触发调节DPI,即按下事件触发调节DPI,松开事件不再触发调节DPI,在一些实施例中,也可以是用户松开Dpi按键的事件来触发调节DPI,即按下事件不触发调节DPI,而是松开事件触发调节DPI。
在上述实施例中,以利用单个Dpi按键为例来触发调节DPI,在一些实施例中,Dpi按键可以是一对按键,一个用于增加DPI,例如,用户每按下一次该按键,蓝牙配件设备400的DPI的数值就可以增加一次;另一个用于减小DPI,例如,用户每按下一次该按键,蓝牙配件设备400的DPI的数值就可以减小一次。
在一些实施例中,为了减少蓝牙配件设备300上的按键数量,也可以通过定义组合按键来实现通过蓝牙配件设备300来控制蓝牙配件设备400调节DPI。在这种情况下,上述调节DPI事件的信息可以包括用户按下的组合按键的键值。
举例来说,可以定义Fn+Home这一组合按键来实现DPI的增加,可以定义Fn+End这一组合按键来实现DPI的减小。容易理解,用户每按下一次蓝牙配件设备300的Fn+Home这一组合按键,蓝牙配件设备400的DPI的数值就可以增加一次,用户每按下一次蓝牙配件设备300的Fn+End这一组合按键,蓝牙配件设备400的DPI的数值就可以减小一次,每次增加/减小的DPI的数值可以为预先设置好的。
S1109-S1110、主机设备100基于数据2确定目的设备类型为蓝牙配件设备400的设备类型,并基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备400的设备类型对应的蓝牙通信连接为蓝牙通信连接2,之后,主机设备100可以向蓝牙配件设备400发送数据2。
具体地,主机设备100在接收到蓝牙配件设备300发送的数据2之后,可以解析数据2并确定目的设备类型为蓝牙配件设备400的设备类型。进一步地,由于在阶段一中主机设备100记录并保存了蓝牙配件设备400的设备类型与蓝牙通信连接2之间的映射关系,因此,主机设备100可以基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备400的设备类型对应的蓝牙通信连接为蓝牙通信连接2。进一步地,主机设备100可以确定需 要通过上述蓝牙通信连接2将上述数据2发送给蓝牙配件设备400。之后,主机设备100可以通过上述蓝牙通信连接2向蓝牙配件设备400发送上述数据2。
S1111、蓝牙配件设备400执行调节DPI事件对应的动作。
具体地,蓝牙配件设备400在接收到主机设备100发送的数据2之后,可以解析数据2,并基于数据2中包括的调节DPI事件的信息来执行调节DPI事件对应的动作,即对DPI进行相应的设置。
例如,用户在按下蓝牙配件设备300的Dpi按键的情况下,上述调节DPI事件的信息指示的是将蓝牙配件设备400的DPI调节到某个指定数值,那么,蓝牙配件设备400则可以执行将当前DPI的数值调节到上述指定数值的动作,从而完成对DPI的调节设置。
又例如,用户在按下蓝牙配件设备300的增加DPI的组合按键(例如Fn+Home这一组合按键)的情况下,上述调节DPI事件的信息指示的是增加蓝牙配件设备400的DPI,那么,蓝牙配件设备400则可以执行增加DPI的动作,从而完成对DPI的增加设置。
再例如,用户在按下蓝牙配件设备300的减小DPI的组合按键(例如Fn+End这一组合按键)的情况下,上述调节DPI事件的信息指示的是减小蓝牙配件设备400的DPI,那么,蓝牙配件设备400则可以执行减小DPI的动作,从而完成对DPI的减小设置。
在一些实施例中,蓝牙配件设备400在执行完调节DPI事件对应的动作之后,还可以通过主机设备100向蓝牙配件设备300发送调节DPI事件处理完成的消息,这样,蓝牙配件设备300可以获知蓝牙配件设备400对调节DPI这一事件的处理结果。其中,蓝牙配件设备400通过主机设备100向蓝牙配件设备300发送调节DPI事件处理完成的消息的具体执行过程与前述图8所示的步骤S816-步骤S821的具体执行过程类似,可以参照前述关于步骤S816-步骤S821的相关文字描述,在此不再赘述。
通过实施上述图11所示实施例提供的方法,可以直接通过一个蓝牙配件设备(例如键盘)来控制另一个蓝牙配件设备(例如鼠标)进行DPI调节,无需用户在主机设备上安装相关的应用程序来对蓝牙配件设备进行DPI调节,也不需要在蓝牙配件设备上增加按键来进行DPI调节,既可以降低成本,又可以进行更加简洁的外观设计。
实施例三:通过一个蓝牙配件设备(例如键盘)来控制另一个蓝牙配件设备(例如鼠标)进行灯效调节。
图12示例性示出了本申请实施例提供的通信方法在通过一个蓝牙配件设备(例如键盘)来控制另一个蓝牙配件设备(例如鼠标)进行灯效调节这一应用场景下的具体流程。
如图12所示,该方法可以应用于包括主机设备100、蓝牙配件设备300(例如键盘)、蓝牙配件设备400(例如鼠标)的通信系统。下面详细介绍该方法的具体步骤:
首先,在本申请实施例中,主机设备100与蓝牙配件设备300、蓝牙配件设备400之间需要建立蓝牙路由服务连接,并且蓝牙配件设备300、蓝牙配件设备400需要向主机设备100注册设备类型,在建立完成蓝牙路由服务连接且注册完成设备类型的前提下,才可以继续执行下述阶段二中的各个步骤,以通过蓝牙配件设备300来控制蓝牙配件设备400调节灯效。
示例性地,建立蓝牙路由服务连接与注册设备类型的一种可能的实现方式可以为下述阶段一(步骤S1201-步骤S1206)中描述的实现方式,下面详细介绍:
阶段一:建立蓝牙路由服务连接与注册设备类型
S1201-S1203、蓝牙配件设备300与主机设备100建立蓝牙路由服务连接1,之后,蓝牙配件设备300可以向主机设备100发送注册请求1,该请求中包括蓝牙配件设备300的设备类型。主机设备100保存蓝牙通信连接1与蓝牙配件设备300的设备类型之间的映射关系,其中,蓝牙通信连接1为蓝牙配件设备300与主机设备100建立的蓝牙通信连接。
S1204-S1206、蓝牙配件设备400与主机设备100建立蓝牙路由服务连接2,之后,蓝牙配件设备400可以向主机设备100发送注册请求2,该请求中包括蓝牙配件设备400的设备类型。主机设备100保存蓝牙通信连接2与蓝牙配件设备400的设备类型之间的映射关系,其中,蓝牙通信连接2为蓝牙配件设备400与主机设备100建立的蓝牙通信连接。
其中,上述步骤S1201-步骤S1203、步骤S1204-步骤S1206、与前述图8所示阶段一中的步骤S801-步骤S803(或步骤S804-步骤S806)类似,其具体执行过程可以参照前述图8所示阶段一中的步骤S801-步骤S803(或步骤S804-步骤S806)中的相关文字描述,在此不再赘述。
在完成上述阶段一(即建立蓝牙路由服务连接与注册设备类型阶段)之后,可以基于已建立的蓝牙路由服务连接来通过蓝牙配件设备300控制蓝牙配件设备400调节灯效。
示例性地,通过蓝牙配件设备300来控制蓝牙配件设备400调节灯效的一种可能的实现方式可以为下述阶段二(步骤S1207-步骤S1211)中描述的实现方式,下面详细介绍:
阶段二:通过蓝牙配件设备300来控制蓝牙配件设备400调节灯效
S1207-S1208、蓝牙配件设备300检测到用户触发调节灯效的事件,之后,蓝牙配件设备300可以向主机设备100发送数据3,该数据中可以包括调节灯效事件的信息、蓝牙配件设备400的设备类型。
假设蓝牙配件设备300为图10示例性所示的键盘,蓝牙配件设备400为鼠标。
参阅图10,可以看出,蓝牙配件设备300上有LightUp按键、LightDown按键,这两个按键可以支持用户通过蓝牙配件设备300来控制蓝牙配件设备400调节灯效,其中,LightUp按键可以支持用户通过蓝牙配件设备300来控制蓝牙配件设备400增加灯效的亮度,LightDown按键可以支持用户通过蓝牙配件设备300来控制蓝牙配件设备400降低灯效的亮度。
在用户想要通过蓝牙配件设备300来控制蓝牙配件设备400调节灯效的情况下,蓝牙配件设备300可以检测到用户触发调节灯效的事件(例如用户按下图10所示的LightUp按键的事件,或,用户按下图10所示的LightDown按键的事件),之后,蓝牙配件设备300可以通过与主机设备100建立的蓝牙路由服务连接1向主机设备100发送数据3,该数据中可以包括调节灯效事件的信息、蓝牙配件设备400的设备类型。
其中,在用户触发调节灯效的事件为用户按下图10所示的LightUp按键的事件的情况下,上述调节灯效事件的信息可以包括LightUp按键的键值;在用户触发调节灯效的事件为用户按下图10所示的LightDown按键的事件的情况下,上述调节灯效事件的信息可以包括LightDown按键的键值。
在一些实施例中,为了减少蓝牙配件设备300上的按键数量,也可以通过定义组合按键来实现通过蓝牙配件设备300来控制蓝牙配件设备400调节灯效。在这种情况下,上述调节 灯效事件的信息可以包括用户按下的组合按键的键值。
举例来说,可以定义Fn+PageUp这一组合按键来实现灯效的亮度的增加,可以定义Fn+PageDown这一组合按键来实现灯效的亮度的降低。
容易理解,用户每按下一次蓝牙配件设备300的Fn+PageUp这一组合按键或LightUp按键,蓝牙配件设备400的灯效的亮度数值就可以增加一次,用户每按下一次蓝牙配件设备300的Fn+PageDown这一组合按键或LightDown按键,蓝牙配件设备400的灯效的亮度数值就可以降低一次,每次增加/减小的灯效的亮度数值可以为预先设置好的。
S1209-S1210、主机设备100基于数据3确定目的设备类型为蓝牙配件设备400的设备类型,并基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备400的设备类型对应的蓝牙通信连接为蓝牙通信连接2,之后,主机设备100可以向蓝牙配件设备400发送数据3。
具体地,主机设备100在接收到蓝牙配件设备300发送的数据3之后,可以解析数据3并确定目的设备类型为蓝牙配件设备400的设备类型。进一步地,由于在阶段一中主机设备100记录并保存了蓝牙配件设备400的设备类型与蓝牙通信连接2之间的映射关系,因此,主机设备100可以基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备400的设备类型对应的蓝牙通信连接为蓝牙通信连接2。进一步地,主机设备100可以确定需要通过上述蓝牙通信连接2将上述数据3发送给蓝牙配件设备400。之后,主机设备100可以通过上述蓝牙通信连接2向蓝牙配件设备400发送上述数据3。
S1211、蓝牙配件设备400执行调节灯效事件对应的动作。
具体地,蓝牙配件设备400在接收到主机设备100发送的数据3之后,可以解析数据3,并基于数据3中包括的调节灯效事件的信息来执行调节灯效事件对应的动作,即对灯效进行相应的设置。
例如,在用户按下蓝牙配件设备300的LightUp按键或Fn+PageUp这一组合按键的情况下,上述调节灯效事件的信息指示的是增加蓝牙配件设备400的灯效的亮度,那么,蓝牙配件设备400则可以执行增加灯效的亮度的动作,从而完成对灯效的亮度的增加设置。
又例如,在用户按下蓝牙配件设备300的LightDown按键或Fn+PageDown这一组合按键的情况下,上述调节灯效事件的信息指示的是降低蓝牙配件设备400的灯效的亮度,那么,蓝牙配件设备400则可以执行降低灯效的亮度的动作,从而完成对灯效的亮度的降低设置。
在一些实施例中,蓝牙配件设备300上也可以设置有切换灯效的模式(例如图4B中所示的常亮、呼吸、炫彩、波浪、多彩循环、触发等模式)的按键,例如单个按键或组合按键,这样,蓝牙配件设备300也可以通过与上述调节灯效的亮度类似的方式来对蓝牙配件设备400的灯效的模式来进行调节,也即是说,蓝牙配件设备300可以通过主机设备100向蓝牙配件设备400发送切换灯效的模式的单个按键或组合按键的键值,蓝牙配件设备400可以基于切换灯效的模式的单个按键或组合按键的键值切换蓝牙配件设备400的灯效的模式。
在一些实施例中,蓝牙配件设备400在执行完调节灯效事件对应的动作之后,还可以通过主机设备100向蓝牙配件设备300发送调节灯效事件处理完成的消息,这样,蓝牙配件设备300可以获知蓝牙配件设备400对调节灯效这一事件的处理结果。其中,蓝牙配件设备400 通过主机设备100向蓝牙配件设备300发送调节灯效事件处理完成的消息的具体执行过程与前述图8所示的步骤S816-步骤S821的具体执行过程类似,可以参照前述关于步骤S816-步骤S821的相关文字描述,在此不再赘述。
通过实施上述图12所示实施例提供的方法,可以直接通过一个蓝牙配件设备(例如键盘)来控制另一个蓝牙配件设备(例如鼠标)进行灯效调节,无需用户在主机设备上安装相关的应用程序来对蓝牙配件设备进行灯效调节,也不需要在蓝牙配件设备上增加按键来进行灯效调节,既可以降低成本,又可以进行更加简洁的外观设计。
实施例四:一个蓝牙配件设备(例如键盘)和另一个蓝牙配件设备(例如鼠标)协同实现组合按键功能。
图13示例性示出了本申请实施例提供的通信方法在一个蓝牙配件设备(例如键盘)和另一个蓝牙配件设备(例如鼠标)协同实现组合按键功能这一应用场景下的具体流程。
如图13所示,该方法可以应用于包括主机设备100、蓝牙配件设备300(例如键盘)、蓝牙配件设备400(例如鼠标)的通信系统。下面详细介绍该方法的具体步骤:
首先,在本申请实施例中,主机设备100与蓝牙配件设备300、蓝牙配件设备400之间需要建立蓝牙路由服务连接,并且蓝牙配件设备300、蓝牙配件设备400需要向主机设备100注册设备类型,在建立完成蓝牙路由服务连接且注册完成设备类型的前提下,才可以继续执行下述阶段二中的各个步骤,以通过蓝牙配件设备300和蓝牙配件设备400来协同实现组合按键功能。
示例性地,建立蓝牙路由服务连接与注册设备类型的一种可能的实现方式可以为下述阶段一(步骤S1301-步骤S1306)中描述的实现方式,下面详细介绍:
阶段一:建立蓝牙路由服务连接与注册设备类型
S1301-S1303、蓝牙配件设备300与主机设备100建立蓝牙路由服务连接1,之后,蓝牙配件设备300可以向主机设备100发送注册请求1,该请求中包括蓝牙配件设备300的设备类型。主机设备100保存蓝牙通信连接1与蓝牙配件设备300的设备类型之间的映射关系,其中,蓝牙通信连接1为蓝牙配件设备300与主机设备100建立的蓝牙通信连接。
S1304-S1306、蓝牙配件设备400与主机设备100建立蓝牙路由服务连接2,之后,蓝牙配件设备400可以向主机设备100发送注册请求2,该请求中包括蓝牙配件设备400的设备类型。主机设备100保存蓝牙通信连接2与蓝牙配件设备400的设备类型之间的映射关系,其中,蓝牙通信连接2为蓝牙配件设备400与主机设备100建立的蓝牙通信连接。
其中,上述步骤S1301-步骤S1303、步骤S1304-步骤S1306、与前述图8所示阶段一中的步骤S801-步骤S803(或步骤S804-步骤S806)类似,其具体执行过程可以参照前述图8所示阶段一中的步骤S801-步骤S803(或步骤S804-步骤S806)中的相关文字描述,在此不再赘述。
在完成上述阶段一(即建立蓝牙路由服务连接与注册设备类型阶段)之后,可以基于已建立的蓝牙路由服务连接来通过蓝牙配件设备300和蓝牙配件设备400协同实现组合按键功能。
示例性地,通过蓝牙配件设备300和蓝牙配件设备400来协同实现组合按键功能的一种 可能的实现方式可以为下述阶段二(步骤S1307-步骤S1320)中描述的实现方式,下面详细介绍:
阶段二:通过蓝牙配件设备300和蓝牙配件设备400协同实现组合按键功能
S1307-S1308、蓝牙配件设备400检测到用户按下按键1的事件,之后,蓝牙配件设备300可以向主机设备100发送数据4,该数据中可以包括按下按键1事件的信息、蓝牙配件设备300的设备类型。
具体地,假设蓝牙配件设备400为鼠标,蓝牙配件设备300为键盘,蓝牙配件设备400可以检测到用户按下按键1的事件,其中,按键1可以为蓝牙配件设备400的某一个按键,例如,蓝牙配件设备400的侧按键。之后,蓝牙配件设备400可以向主机设备100发送数据4,该数据中可以包括按下按键1事件的信息、蓝牙配件设备300的设备类型。
其中,上述按下按键1事件的信息可以包括按键1的键值、按下状态的指示信息。
S1309-S1310、主机设备100基于数据4确定目的设备类型为蓝牙配件设备300的设备类型,并基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备300的设备类型对应的蓝牙通信连接为蓝牙通信连接1,之后,主机设备100可以向蓝牙配件设备300发送数据4。
具体地,主机设备100在接收到蓝牙配件设备400发送的数据4之后,可以解析数据4并确定目的设备类型为蓝牙配件设备300的设备类型。进一步地,由于在阶段一中主机设备100记录并保存了蓝牙配件设备300的设备类型与蓝牙通信连接1之间的映射关系,因此,主机设备100可以基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备300的设备类型对应的蓝牙通信连接为蓝牙通信连接1。进一步地,主机设备100可以确定需要通过上述蓝牙通信连接1将上述数据4发送给蓝牙配件设备300。之后,主机设备100可以通过上述蓝牙通信连接1向蓝牙配件设备300发送上述数据4。
S1311、蓝牙配件设备300保存按键1按下的状态。
具体地,蓝牙配件设备300在接收到主机设备100发送的数据4之后,可以解析数据4,并基于数据4中包括的按下按键1事件的信息确定按键1处于按下的状态,进一步地,蓝牙配件设备300可以保存按键1按下的状态(也可以称为保存按下按键1的事件)。
S1312-S1315、蓝牙配件设备300检测到用户按下按键2的事件,之后,蓝牙配件设备300可以将按键1按下的状态和按下按键2的事件转换为按下组合键1的事件,之后,蓝牙配件设备300可以向主机设备100发送组合键1的键值,主机设备100响应组合键1的键值对应的功能。
具体地,在执行完上述步骤S1311之后,蓝牙配件设备300可以检测到用户按下按键2的事件,其中,按键2可以为蓝牙配件设备300的某一个按键。之后,蓝牙配件设备300可以将按键1按下的状态(也可以称为按下按键1的事件)和按下按键2的事件转换为按下组合键1的事件。其中,组合键1可以为蓝牙配件设备300的某一个组合键,例如,Fn+Fx组合键。举例来说,假设组合键1为Fn+F1,那么,上述按下按键1的事件就可以转换为按下Fn按键的事件,上述按下按键2的事件就是按下F1按键的事件。
进一步地,蓝牙配件设备300可以向主机设备100发送上述组合键1的键值,主机设备在接收到蓝牙配件设备300发送的上述组合键1的键值之后,主机设备100可以响应上述组 合键1的键值对应的功能,例如,主机设备100响应组合键Fn+Fx的键值来进行显示屏的背景光调节。
这样,可以通过蓝牙配件设备300与蓝牙配件设备400来协同实现组合按键功能,在用户难以进行单手操作的情况下,也无需用户在蓝牙配件设备300与蓝牙配件设备400之间频繁切换,减缓用户疲劳,此外,现有技术是在蓝牙配件设备400上定义上述按键1的功能,当检测到用户按下上述按键1之后,蓝牙配件设备400可以向主机设备100发送上述按键1的键值,主机设备100可以响应上述按键1的键值对应的功能,这样蓝牙配件设备400的一个按键只能实现一种功能,可以看出,通过实施本方案,在用户按下上述按键1之后,可以再通过按下蓝牙配件设备300的按键形成一个或多个组合键,从而实现多种功能。
在一些实施例中,蓝牙配件设备300在保存按键1按下的状态之后,可以改变蓝牙配件设备300上的单个按键的功能。例如,在按键1按下之后,QWERT可以分别转换成YUIOP,A S D F G可以分别转换为H JKL;,ZXCV B可以分别转换成NM,./,Caps可以转换成Enter,等等。容易理解,在这种情况下,假设上述按键2为Q按键,那么,上述组合键1即为Y按键。
这样,更少的按键数量也可以覆盖全部按键的功能,一键多功能,减少蓝牙配件设备300的按键数量,缩小蓝牙配件设备300的尺寸的同时,无需修改按键尺寸,也无需裁剪蓝牙配件设备300的按键功能,也可以满足用户的需求。
S1316-S1317、蓝牙配件设备400检测到用户松开按键1的事件,之后,蓝牙配件设备400可以向主机设备100发送数据5,该数据中可以包括松开按键1事件的信息、蓝牙配件设备300的设备类型。
具体地,蓝牙配件设备400在检测到用户按下按键1的事件之后,还可以检测到用户松开按键1的事件,之后,蓝牙配件设备400可以向主机设备100发送数据5,该数据中可以包括松开按键1事件的信息、蓝牙配件设备300的设备类型。
其中,上述松开按键1事件的信息可以包括按键1的键值、松开状态的指示信息。
S1318-S1319、主机设备100基于数据5确定目的设备类型为蓝牙配件设备300的设备类型,并基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备300的设备类型对应的蓝牙通信连接为蓝牙通信连接1,之后,主机设备100可以向蓝牙配件设备300发送数据5。
具体地,主机设备100在接收到蓝牙配件设备400发送的数据5之后,可以解析数据5并确定目的设备类型为蓝牙配件设备300的设备类型。进一步地,由于在阶段一中主机设备100记录并保存了蓝牙配件设备300的设备类型与蓝牙通信连接1之间的映射关系,因此,主机设备100可以基于已保存的设备类型与蓝牙通信连接之间的映射关系确定蓝牙配件设备300的设备类型对应的蓝牙通信连接为蓝牙通信连接1。进一步地,主机设备100可以确定需要通过上述蓝牙通信连接1将上述数据5发送给蓝牙配件设备300。之后,主机设备100可以通过上述蓝牙通信连接1向蓝牙配件设备300发送上述数据5。
S1320、蓝牙配件设备300清除按键1按下的状态。
具体地,蓝牙配件设备300在接收到主机设备100发送的数据5之后,可以解析数据5, 并基于数据5中包括的松开按键1事件的信息确定按键1处于松开的状态,进一步地,蓝牙配件设备300可以清除按键1按下的状态。
可以理解,蓝牙配件设备300在清除按键1按下的状态之后,则不能与蓝牙配件设备400协同实现前述组合按键的功能,例如,此时用户想要实现Fn+Fx对应的功能,则用户需要按下蓝牙配件设备300的Fn按键和Fx按键。
可以理解,蓝牙配件设备300在清除按键1按下的状态之后,蓝牙配件设备300可以把在按键1处于按下状态时改变的单个按键的功能再进行复原,例如,把被转换为YUIOP的QWERT的功能进行复原,把被转换为H JKL;的A S D F G的功能进行复原,把被转换为NM,./的ZXCV B的功能进行复原,把被转换为Enter的Caps的功能进行复原,等等。也即是说,用户按下蓝牙配件设备300的哪个按键,主机设备100就响应哪个按键的键值对应的功能。
在上述实施例中,在上述步骤S1320中,蓝牙配件设备300清除按键1按下的状态的实现方式是删除已记录的按键1按下的状态,在一些实施例中,蓝牙配件设备300清除按键1按下的状态还可以为另一种可能的实现方式,例如,蓝牙配件设备300在按键1按下或松开的状态下可以做不同的标记,例如,按下的状态用数字1来标记,松开的状态用数字0来标记,在这种情况下,蓝牙配件设备300将原来标记的数字1置为数字0,以表示按键1处于松开的状态,即用户松开了按键1。
通过实施上述图13所示实施例提供的方法,蓝牙配件设备400(例如鼠标)的按键状态的信息可以同步到蓝牙配件设备300(例如键盘),一方面,蓝牙配件设备400上的按键和蓝牙配件设备300上的按键可以形成组合键(例如蓝牙配件设备400上的侧按键与蓝牙配件设备300上的Fx按键可以形成与蓝牙配件设备400上的Fn+Fx功能相同的组合键),无需用户在鼠标和键盘之间频繁切换,减缓用户疲劳;另一方面,蓝牙配件设备300上的按键可以根据蓝牙配件设备400的按键状态的不同来实现不同的功能,例如,蓝牙配件设备400上某个按键按下时,可以改变蓝牙配件设备300上的按键的功能(例如蓝牙配件设备300上的QWERT分别转换成YUIOP),一键多功能,减少蓝牙配件设备300的按键数量,缩小蓝牙配件设备300尺寸的同时,也可以满足用户的需求。
在前述各个实施例中,都是一个蓝牙配件设备通过主机设备来与另一个蓝牙配件设备进行通信,也即是说,蓝牙配件设备作为从设备,两个从设备通过一个主机设备来进行通信。在一些实施例中,主机设备也可以作为从设备来与另一个主机设备(即中间主机设备)建立蓝牙路由服务连接并向该主机设备注册设备类型,从而可以实现主机设备与主机设备、主机设备与蓝牙配件设备在未直接建立蓝牙通信连接的情况下,可以通过中间主机设备来进行通信,较为便捷,提高用户体验。
示例性地,参阅图14,图14是在蓝牙配件设备(例如蓝牙手环)与主机设备(例如平板)未直接建立蓝牙通信连接的情况下通过中间主机设备(例如手机)来进行通信的示意图。以蓝牙手环、平板、手机为例,蓝牙手环和平板可以作为从设备,手机可以作为中间主机设备,蓝牙手环和平板分别与手机建立了蓝牙路由服务连接,并向手机注册了设备类型,通过手机上的蓝牙路由功能,平板可以与手环进行通信,例如,获取手环的相关信息,或,对手环进行相关设置,等等。
示例性地,参阅图15,图15是在主机设备(例如手机)与另一个主机设备(例如平板)未直接建立蓝牙通信连接的情况下通过中间主机设备(例如个人电脑)来进行通信的示意图。以手机、平板、个人电脑为例,手机和平板可以作为从设备,个人电脑可以作为中间主机设备,手机和平板分别与个人电脑建立了蓝牙路由服务连接,并向个人电脑注册了设备类型,通过个人电脑上的蓝牙路由功能,手机可以与平板进行通信。
上述图8、图9、图11、图12、图13所示的实施例中,均是以主机设备与蓝牙配件设备建立的通信连接为蓝牙通信连接为例,不限于此,还可以是有线连接、或、其他无线连接(例如WiFi连接等),或,有线连接与无线连接的结合等等,本申请实施例对此不作限定。
实施例五:主机设备通过蓝牙配件设备向其他主机设备发送其他蓝牙配件设备的设备信息来使得其他主机设备自动与其他蓝牙配件设备建立蓝牙通信连接。
图16示例性示出了本申请实施例提供的通信方法在多个蓝牙配件设备分别与多个主机设备建立蓝牙通信连接这一应用场景下的具体流程。
如图16所示,该方法可以应用于包括主机设备100、主机设备200、蓝牙配件设备300(例如键盘)、蓝牙配件设备400(例如鼠标)的通信系统。下面详细介绍该方法的具体步骤:
S1601-S1602、蓝牙配件设备400通过蓝牙配件设备400的蓝牙通道1与主机设备100建立蓝牙通信连接1,蓝牙配件设备400通过蓝牙配件设备400的蓝牙通道2与主机设备200建立蓝牙通信连接1’。
其中,蓝牙配件设备400可以为具备蓝牙多连接功能的设备,这样,蓝牙配件设备400可以通过多个蓝牙通道依次与多台主机设备建立蓝牙通信连接。
例如,蓝牙配件设备400可以通过蓝牙配件设备400的蓝牙通道1与主机设备100建立蓝牙通信连接1。
又例如,蓝牙配件设备400可以通过蓝牙配件设备400的蓝牙通道2与主机设备200建立蓝牙通信连接1’。
需要说明的是,本申请实施例对执行步骤S1601与步骤S1602的时间先后顺序不作限定。例如,步骤S1601也可以后于步骤S1602执行。
S1603、蓝牙配件设备300通过蓝牙配件设备300的蓝牙通道1与主机设备100建立蓝牙通信连接2。
其中,蓝牙配件设备300可以为具备蓝牙多连接功能的设备,这样,蓝牙配件设备300可以通过多个蓝牙通道依次与多台主机设备建立蓝牙通信连接。
具体地,在蓝牙配件设备400与多台主机设备(例如主机设备100和主机设备200)建立了蓝牙通信连接(例如执行完步骤S1601-步骤S1602)之后,蓝牙配件设备300可以先与上述多台主机设备中的一台主机设备建立蓝牙通信连接。
以蓝牙配件设备300与主机设备100建立蓝牙通信连接为例,在用户触发蓝牙配件设备300的蓝牙通道1发送蓝牙广播消息之后,主机设备100可以通过该蓝牙广播消息来发现蓝牙配件设备300,进一步地,主机设备100可以与蓝牙配件设备进行蓝牙配对并建立蓝牙通信连接2,这样,蓝牙配件设备300则可以通过蓝牙配件设备300的蓝牙通道1与主机设备100建立蓝牙通信连接2。
在蓝牙配件设备300通过蓝牙配件设备300的蓝牙通道1与主机设备100建立蓝牙通信连接2之后,主机设备100可以通过蓝牙配件设备400向与蓝牙配件设备400建立蓝牙通信连接的其他主机设备(例如主机设备200)发送蓝牙配件设备300的设备信息(例如蓝牙配件设备300的蓝牙MAC地址等),使得上述与蓝牙配件设备400建立蓝牙通信连接的其他主机设备获取到蓝牙配件设备300的设备信息,进一步地,可以基于蓝牙配件设备300的设备信息自动与蓝牙配件设备300进行蓝牙配对并建立蓝牙通信连接,无需用户进行多次连接操作即可将蓝牙配件设备与多台主机设备建立蓝牙通信连接,提高用户体验。
上述方案的一种可能的实现方式可以为下述步骤S1604-步骤S1611中描述的实现方式,下面详细介绍:
S1604、主机设备100向蓝牙配件设备300发送消息1,该消息用于指示蓝牙配件设备300打开除蓝牙通道1之外的其他通道来发送蓝牙广播消息。
具体地,在蓝牙配件设备300与主机设备100建立了蓝牙通信连接2之后,主机设备100可以向蓝牙配件设备300发送上述消息1,该消息可以用于指示蓝牙配件设备300打开除蓝牙通道1之外的其他通道(例如蓝牙通道2等)来发送蓝牙广播消息。
这样,蓝牙配件设备300可以利用除蓝牙通道1之外的其他通道发送蓝牙广播消息以使得其他设备发现蓝牙配件设备300,在其他设备发现蓝牙配件设备300之后,蓝牙配件设备300可以通过除蓝牙通道1之外的其他通道与其他设备进行蓝牙配对并建立蓝牙通信连接。
S1605、主机设备100获取蓝牙配件设备300的蓝牙MAC地址。
其中,步骤S1605可以与上述步骤S1604同时执行,也可以先于或后于上述步骤S1604执行,本申请实施例对此不作限定。
容易理解,蓝牙配件设备300的每一个蓝牙通道可以分别对应一个蓝牙MAC地址,上述蓝牙配件设备300的蓝牙MAC地址可以包括蓝牙配件设备300的除蓝牙通道1之外的其他通道对应的蓝牙MAC地址。
S1606、主机设备100向蓝牙配件设备400发送消息2,该消息中包括蓝牙配件设备300的蓝牙MAC地址,该消息用于指示蓝牙配件设备400将蓝牙配件设备300的蓝牙MAC地址发送给除主机设备100之外的与蓝牙配件设备400建立蓝牙通信连接的其他设备。
具体地,主机设备100在获取到蓝牙配件设备300的蓝牙MAC地址之后,主机设备100可以向蓝牙配件设备400发送上述消息2,该消息中可以包括蓝牙配件设备300的蓝牙MAC地址,该消息可以用于指示蓝牙配件设备400将蓝牙配件设备300的蓝牙MAC地址发送给除主机设备100之外的与蓝牙配件设备400建立蓝牙通信连接的其他设备(例如主机设备200),以便除主机设备100之外的与蓝牙配件设备400建立蓝牙通信连接的其他设备可以基于蓝牙配件设备300的蓝牙MAC地址自动与蓝牙配件设备300进行蓝牙配对并建立蓝牙通信连接。
S1607-S1608、蓝牙配件设备400基于消息2确定需要将蓝牙配件设备300的蓝牙MAC地址发送给主机设备200,之后,蓝牙配件设备400可以向主机设备200发送蓝牙配件设备300的蓝牙MAC地址。
具体地,蓝牙配件设备400在接收到主机设备100发送的消息2之后,可以获取到消息2中包括的蓝牙配件设备300的蓝牙MAC地址。进一步地,由于与蓝牙配件设备400建立蓝 牙通信连接的设备为主机设备100和主机设备200这两个设备,因此,蓝牙配件设备400可以确定需要将蓝牙配件设备300的蓝牙MAC地址发送给主机设备200。进一步地,蓝牙配件设备400可以向主机设备200发送蓝牙配件设备300的蓝牙MAC地址,以便主机设备200可以基于蓝牙配件设备300的蓝牙MAC地址自动与蓝牙配件设备300进行蓝牙配对并建立蓝牙通信连接。
S1609、蓝牙配件设备300向主机设备200发送蓝牙广播消息。
具体地,在蓝牙配件设备300接收到主机设备100发送的上述消息1之后,蓝牙配件设备300可以打开除蓝牙通道1之外的其他通道,向一个或多个主机设备发送蓝牙广播消息,以蓝牙配件设备300的蓝牙通道2和主机设备200为例,蓝牙配件设备300可以通过蓝牙配件设备300的蓝牙通道2向主机设备200发送蓝牙广播消息。
其中,上述蓝牙广播消息可以为蓝牙配对广播消息,上述蓝牙广播消息中可以包括蓝牙配件设备300的蓝牙MAC地址。
S1610、主机设备200基于蓝牙广播消息和蓝牙配件设备300的蓝牙MAC地址确定与蓝牙配件设备300进行蓝牙配对并建立蓝牙通信连接。
具体地,主机设备200在接收到蓝牙配件设备300发送的蓝牙广播消息和蓝牙配件设备400发送的蓝牙配件设备300的蓝牙MAC地址之后,主机设备200可以基于蓝牙配件设备300发送的蓝牙广播消息和蓝牙配件设备400发送的蓝牙配件设备300的蓝牙MAC地址确定需要与蓝牙配件设备300进行蓝牙配对并建立蓝牙通信连接,进一步地,主机设备200可以自动与蓝牙配件设备300进行蓝牙配对,完成蓝牙配对之后,主机设备200可以与蓝牙配件设备300建立蓝牙通信连接。
S1611、蓝牙配件设备300通过除蓝牙通道1之外的其他通道与主机设备200建立蓝牙通信连接2’。
具体地,在主机设备200与蓝牙配件设备300进行蓝牙配对并完成蓝牙配对之后,蓝牙配件设备300可以通过除蓝牙通道1之外的其他通道(例如蓝牙配件设备300的蓝牙通道2)与主机设备200建立蓝牙通信连接2’。
可以理解的是,本申请实施例仅仅以两个蓝牙配件设备与两个主机设备建立蓝牙通信连接为例,更多数量的蓝牙配件设备与更多数量的主机设备建立蓝牙通信连接的具体过程与之类似,在此不再赘述。
通过实施上述图16所示实施例提供的方法,主机设备(例如主机设备100)可以通过与之建立蓝牙通信连接的蓝牙配件设备(例如蓝牙配件设备400)向与该蓝牙配件设备建立蓝牙通信连接的其他主机设备(例如主机设备200)发送其他蓝牙配件设备(例如蓝牙配件设备300)的设备信息(例如蓝牙MAC地址等),从而使得一个或多个主机设备获取到未与之建立蓝牙通信连接的蓝牙配件设备的设备信息,这样,这一个或多个主机设备可以基于蓝牙配件设备的设备信息主动与该蓝牙配件设备进行蓝牙配对并建立蓝牙通信连接,简化用户操作,提高用户体验。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (32)

  1. 一种通信方法,应用于通信系统,所述通信系统包括第一主机设备、第一配件设备、第二配件设备,其特征在于,所述方法包括:
    所述第一配件设备与所述第一主机设备建立第一通信连接;
    所述第二配件设备与所述第一主机设备建立第二通信连接;
    所述第一配件设备检测到用户触发第一事件,响应于所述第一事件,所述第一配件设备基于所述第一通信连接向所述第一主机设备发送第一数据,所述第一数据中包括所述第一事件的信息;
    所述第一主机设备基于所述第二通信连接向所述第二配件设备发送所述第一事件的信息;
    所述第二配件设备接收所述第一主机设备发送的所述第一事件的信息,并基于所述第一事件的信息执行响应操作。
  2. 根据权利要求1所述的方法,其特征在于,所述第一数据中还包括一个或多个配件设备的设备信息,所述一个或多个配件设备的设备信息中包括所述第二配件设备的设备信息,所述第二配件设备的设备信息用于所述第一主机设备确定将所述第一事件的信息发送给所述第二配件设备。
  3. 根据权利要求1或2所述的方法,其特征在于,所述通信系统还包括第二主机设备,所述第一事件为将焦点主机设备由所述第一主机设备切换到所述第二主机设备的事件,所述第一事件的信息中包括所述第二主机设备的设备信息,所述第二配件设备基于所述第一事件的信息执行响应操作,具体包括:
    所述第二配件设备基于所述第二主机设备的设备信息将所述焦点主机设备由所述第一主机设备切换到所述第二主机设备。
  4. 根据权利要求1或2所述的方法,其特征在于,所述第一配件设备为键盘,所述第二配件设备为鼠标,所述第一事件为按下调节每英寸点数DPI的按键的事件,所述第一事件的信息中包括所述调节DPI的按键的键值,所述第二配件设备基于所述第一事件的信息执行响应操作,具体包括:
    所述第二配件设备基于所述调节DPI的按键的键值调节所述第二配件设备的DPI。
  5. 根据权利要求4所述的方法,其特征在于,所述调节DPI的按键包括DPI按键,或,增加DPI的组合按键,或,减小DPI的组合按键,所述第二配件设备基于所述调节DPI的按键的键值调节所述第二配件设备的DPI,具体包括:
    在所述调节DPI的按键为所述DPI按键的情况下,所述第二配件设备基于所述DPI按键的键值增加或减小所述第二配件设备的DPI;
    或,
    在所述调节DPI的按键为所述增加DPI的组合按键的情况下,所述第二配件设备基于所述增加DPI的组合按键的键值增加所述第二配件设备的DPI;
    或,
    在所述调节DPI的按键为所述减小DPI的组合按键的情况下,所述第二配件设备基于所述减小DPI的组合按键的键值减小所述第二配件设备的DPI。
  6. 根据权利要求1或2所述的方法,其特征在于,所述第一配件设备为键盘,所述第二配件设备为鼠标,所述第一事件为按下调节灯效的按键的事件,所述第一事件的信息中包括所述调节灯效的按键的键值,所述第二配件设备基于所述第一事件的信息执行响应操作,具体包括:
    所述第二配件设备基于所述调节灯效的按键的键值调节所述第二配件设备的灯效。
  7. 根据权利要求6所述的方法,其特征在于,所述调节灯效的按键包括增加亮度LightUp按键,或,降低亮度LightDown按键,或,增加亮度的组合按键,或,降低亮度的组合按键,所述第二配件设备基于所述调节灯效的按键的键值调节所述第二配件设备的灯效,具体包括:
    在所述调节灯效的按键为所述LightUp按键或所述增加亮度的组合按键的情况下,所述第二配件设备基于所述LightUp按键的键值或所述增加亮度的组合按键的键值增加所述第二配件设备的灯效的亮度;
    或,
    在所述调节灯效的按键为所述LightDown按键或所述降低亮度的组合按键的情况下,所述第二配件设备基于所述LightDown按键的键值或所述降低亮度的组合按键的键值降低所述第二配件设备的灯效的亮度。
  8. 根据权利要求1或2所述的方法,其特征在于,所述第一配件设备为鼠标,所述第二配件设备为键盘,所述第一事件为用户按下第一按键的事件,所述第二配件设备基于所述第一事件的信息执行响应操作,具体包括:
    所述第二配件设备将所述用户按下第一按键的事件和用户按下第二按键的事件转换为用户按下第三按键的事件,其中,所述用户按下第二按键的事件是所述第二配件设备在接收所述第一主机设备发送的所述第一事件的信息之后检测到的;
    所述第二配件设备向所述第一主机设备发送所述第三按键的键值;
    所述第一主机设备响应所述第三按键的键值对应的功能。
  9. 根据权利要求2-8任一项所述的方法,其特征在于,所述第二配件设备的设备信息包括所述第二配件设备的设备类型,在所述第一配件设备检测到用户触发第一事件之前,所述方法还包括:
    所述第二配件设备向所述第一主机设备发送第一消息,所述第一消息中包括所述第二配件设备的设备类型;
    所述第一主机设备保存所述第二通信连接与所述第二配件设备的设备类型之间的映射关系;
    在所述第一主机设备基于所述第二通信连接向所述第二配件设备发送所述第一事件的信息之前,所述方法还包括:
    所述第一主机设备基于所述第二配件设备的设备类型、所述第二通信连接与所述第二配件设备的设备类型之间的映射关系确定通过所述第二通信连接向所述第二配件设备发送所述 第一事件的信息。
  10. 根据权利要求1-9任一项所述的方法,其特征在于,在所述第二配件设备基于所述第一事件的信息执行响应操作之后,所述方法还包括:
    所述第二配件设备通过所述第一主机设备向所述第一配件设备发送第二消息,所述第二消息用于向所述第一配件设备通知所述第二配件设备执行所述响应操作的结果。
  11. 根据权利要求1-10一项所述的方法,其特征在于,所述第一通信连接和所述第二通信连接均为蓝牙通信连接。
  12. 一种通信方法,应用于第一配件设备,其特征在于,所述方法包括:
    所述第一配件设备检测到用户触发第一事件;
    响应于所述第一事件,所述第一配件设备通过第一主机设备向第二配件设备发送第一数据,所述第一数据中包括所述第一事件的信息;
    其中,所述第一事件的信息用于所述第二配件设备基于所述第一事件的信息执行响应操作,所述第一配件设备与所述第一主机设备建立有第一通信连接,所述第二配件设备与所述第一主机设备建立有第二通信连接。
  13. 根据权利要求12所述的方法,其特征在于,所述第一数据中还包括一个或多个配件设备的设备信息,所述一个或多个配件设备的设备信息中包括所述第二配件设备的设备信息,所述第二配件设备的设备信息用于所述第一主机设备确定将所述第一事件的信息发送给所述第二配件设备。
  14. 根据权利要求12或13所述的方法,其特征在于,所述第一事件为将焦点主机设备由所述第一主机设备切换到到第二主机设备的事件,所述第一事件的信息用于所述第二配件设备基于所述第一事件的信息将所述焦点主机设备由所述第一主机设备切换到所述第二主机设备。
  15. 根据权利要求12或13所述的方法,其特征在于,所述第一配件设备为键盘,所述第二配件设备为鼠标,所述第一事件为按下调节每英寸点数DPI的按键的事件,所述第一事件的信息用于所述第二配件设备基于所述第一事件的信息调节所述第二配件设备的DPI。
  16. 根据权利要求12或13所述的方法,其特征在于,所述第一配件设备为键盘,所述第二配件设备为鼠标,所述第一事件为按下调节灯效的按键的事件,所述第一事件的信息用于所述第二配件设备基于所述第一事件的信息调节所述第二配件设备的灯效。
  17. 根据权利要求12或13所述的方法,其特征在于,所述第一配件设备为鼠标,所述第二配件设备为键盘,所述第一事件为用户按下第一按键的事件,所述第一事件的信息用于所述第二配件设备将所述用户按下第一按键的事件和用户按下第二按键的事件转换为用户按下第三按键的事件,其中,所述用户按下第二按键的事件是所述第二配件设备在接收所述第一主机设备发送的所述第一事件的信息之后检测到的。
  18. 一种通信方法,应用于第二配件设备,其特征在于,所述方法包括:
    所述第二配件设备与第一主机设备建立第一通信连接;
    所述第二配件设备基于所述第一通信连接接收所述第一主机设备发送的第一事件的信息,所述第一事件的信息是所述第一配件设备在检测到用户触发所述第一事件之后向所述第一主机设备发送的;
    所述第二配件设备基于所述第一事件的信息执行响应操作。
  19. 根据权利要求18所述的方法,其特征在于,所述第一事件为将焦点主机设备由所述第一主机设备切换到第二主机设备的事件,所述第一事件的信息中包括所述第二主机设备的设备信息,所述第二配件设备基于所述第一事件的信息执行响应操作,具体包括:
    所述第二配件设备基于所述第二主机设备的设备信息将所述焦点主机设备由所述第一主机设备切换到所述第二主机设备。
  20. 根据权利要求18所述的方法,其特征在于,所述第一配件设备为键盘,所述第二配件设备为鼠标,所述第一事件为按下调节每英寸点数DPI的按键的事件,所述第一事件的信息中包括所述调节DPI的按键的键值,所述第二配件设备基于所述第一事件的信息执行响应操作,具体包括:
    所述第二配件设备基于所述调节DPI的按键的键值调节所述第二配件设备的DPI。
  21. 根据权利要求18所述的方法,其特征在于,所述第一配件设备为键盘,所述第二配件设备为鼠标,所述第一事件为按下调节灯效的按键的事件,所述第一事件的信息中包括所述调节灯效的按键的键值,所述第二配件设备基于所述第一事件的信息执行响应操作,具体包括:
    所述第二配件设备基于所述调节灯效的按键的键值调节所述第二配件设备的灯效。
  22. 根据权利要求18所述的方法,其特征在于,所述第一配件设备为鼠标,所述第二配件设备为键盘,所述第一事件为用户按下第一按键的事件,所述第二配件设备基于所述第一事件的信息执行响应操作,具体包括:
    所述第二配件设备将所述用户按下第一按键的事件和用户按下第二按键的事件转换为用户按下第三按键的事件,其中,所述用户按下第二按键的事件是所述第二配件设备在接收所述第一主机设备发送的所述第一事件的信息之后检测到的;
    所述第二配件设备向所述第一主机设备发送所述第三按键的键值,所述第三按键的键值用于所述第一主机设备基于所述第三按键的键值响应所述第三按键的键值对应的功能。
  23. 一种通信方法,应用于第一主机设备,其特征在于,所述方法包括:
    所述第一主机设备与第一配件设备建立第一通信连接;
    所述第一主机设备与第二配件设备建立第二通信连接;
    所述第一主机设备基于所述第一通信连接接收所述第一配件设备发送的第一数据,所述第一数据中包括第一事件的信息,所述第一数据是所述第一配件设备在检测到用户触发所述第一事件之后发送的;
    所述第一主机设备基于所述第二通信连接向所述第二配件设备发送所述第一事件的信息,所述第一事件的信息用于所述第二配件设备基于第一事件的信息执行响应操作。
  24. 根据权利要求23所述的方法,其特征在于,所述第一数据中还包括一个或多个配件设备的设备信息,所述一个或多个配件设备的设备信息中包括所述第二配件设备的设备信息,所述第二配件设备的设备信息用于所述第一主机设备确定将所述第一事件的信息发送给所述第二配件设备。
  25. 根据权利要求24所述的方法,其特征在于,所述第二配件设备的设备信息包括所述第二配件设备的设备类型,在所述第一主机设备基于所述第一通信连接接收所述第一配件设备发送的第一数据之前,所述方法还包括:
    所述第一主机设备接收所述第二配件设备发送的第一消息,所述第一消息中包括所述第二配件设备的设备类型;
    所述第一主机设备保存所述第二通信连接与所述第二配件设备的设备类型之间的映射关系;
    在所述第一主机设备基于所述第二通信连接向所述第二配件设备发送所述第一事件的信息之前,所述方法还包括:
    所述第一主机设备基于所述第二配件设备的设备类型、所述第二通信连接与所述第二配件设备的设备类型之间的映射关系确定通过所述第二通信连接向所述第二配件设备发送所述第一事件的信息。
  26. 一种通信方法,应用于通信系统,所述通信系统包括第一主机设备、第二主机设备、第一配件设备、第二配件设备,所述第二配件设备与所述第一主机设备和所述第二主机设备均建立有蓝牙通信连接,其特征在于,所述方法包括:
    所述第一配件设备与所述第一主机设备建立第一蓝牙通信连接;
    所述第一主机设备基于所述第一蓝牙通信连接向所述第一配件设备发送第一消息,所述第一消息用于指示所述第一配件设备发送配对广播消息;
    所述第一配件设备在接收到所述第一消息之后发送所述配对广播消息;
    所述第一主机设备向所述第二配件设备发送第二消息,所述第二消息中包括所述第一配件设备的蓝牙媒体访问控制MAC地址,所述第二消息用于指示所述第二配件设备向一个或多个主机设备发送所述第一配件设备的蓝牙MAC地址,所述一个或多个主机设备包括所述第二主机设备;
    所述第二配件设备向所述第二主机设备发送所述第一配件设备的蓝牙MAC地址;
    所述第二主机设备接收所述配对广播消息和所述第一配件设备的蓝牙MAC地址,并基于所述配对广播消息和所述第一配件设备的蓝牙MAC地址与所述第一配件设备进行蓝牙配对并建立第二蓝牙通信连接。
  27. 一种通信方法,应用于第二配件设备,所述第二配件设备与第一主机设备和第二主机设备均建立有蓝牙通信连接,其特征在于,所述方法包括:
    所述第二配件设备接收所述第一主机设备发送的第一消息,所述第一消息中包括第一配件设备的蓝牙媒体访问控制MAC地址,所述第一消息用于所述第二配件设备基于所述第一 消息向一个或多个主机设备发送所述第一配件设备的蓝牙MAC地址,所述一个或多个主机设备包括所述第二主机设备;
    所述第二配件设备基于所述第一消息向所述第二主机设备发送所述第一配件设备的蓝牙MAC地址,所述第一配件设备的蓝牙MAC地址用于所述第二主机设备与所述第一配件设备建立蓝牙通信连接。
  28. 一种通信方法,应用于第一主机设备,其特征在于,所述方法包括:
    所述第一主机设备与第一配件设备建立第一蓝牙通信连接;
    所述第一主机设备基于所述第一蓝牙通信连接向所述第一配件设备发送第一消息,所述第一消息用于指示所述第一配件设备发送配对广播消息;
    所述第一主机设备向所述第二配件设备发送第二消息,所述第二消息中包括所述第一蓝牙配件设备的蓝牙媒体访问控制MAC地址,所述第二消息用于指示所述第二配件设备向一个或多个主机设备发送所述第一配件设备的蓝牙MAC地址,所述一个或多个主机设备包括所述第二主机设备;
    其中,所述第二配件设备与所述第一主机设备和所述第二主机设备均建立有蓝牙通信连接,所述配对广播消息和所述第一配件设备的蓝牙MAC地址用于所述第二主机设备与所述第一配件设备建立第二蓝牙通信连接。
  29. 一种通信系统,其特征在于,所述通信系统包括第一主机设备、第一配件设备、第二配件设备;
    所述第一配件设备用于与所述第一主机设备建立第一通信连接;
    所述第二配件设备用于与所述第一主机设备建立第二通信连接;
    所述第一配件设备还用于检测用户触发第一事件,响应于所述第一事件,基于所述第一通信连接向所述第一主机设备发送第一数据,所述第一数据中包括所述第一事件的信息;
    所述第一主机设备用于基于所述第二通信连接向所述第二配件设备发送所述第一事件的信息;
    所述第二配件设备还用于接收所述第一主机设备发送的所述第一事件的信息,并基于所述第一事件的信息执行响应操作。
  30. 一种通信系统,其特征在于,所述通信系统包括第一主机设备、第二主机设备、第一配件设备、第二配件设备,所述第二配件设备与所述第一主机设备和所述第二主机设备均建立有蓝牙通信连接;
    所述第一配件设备用于与所述第一主机设备建立第一蓝牙通信连接;
    所述第一主机设备用于基于所述第一蓝牙通信连接向所述第一蓝牙配件设备发送第一消息,所述第一消息用于指示所述第一配件设备发送配对广播消息;
    所述第一配件设备还用于在接收到所述第一消息之后发送所述配对广播消息;
    所述第一主机设备还用于向所述第二配件设备发送第二消息,所述第二消息中包括所述第一配件设备的蓝牙媒体访问控制MAC地址,所述第二消息用于指示所述第二配件设备向一个或多个主机设备发送所述第一配件设备的蓝牙MAC地址,所述一个或多个主机设备包括所述第二主机设备;
    所述第二配件设备用于向所述第二主机设备发送所述第一配件设备的蓝牙MAC地址;
    所述第二主机设备用于接收所述配对广播消息和所述第一配件设备的蓝牙MAC地址,并基于所述配对广播消息和所述第一配件设备的蓝牙MAC地址与所述第一配件设备进行蓝牙配对并建立第二蓝牙通信连接。
  31. 一种电子设备,其特征在于,所述电子设备包括一个或多个处理器和一个或多个存储器;其中,所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述一个或多个处理器执行所述计算机指令时,使得所述电子设备执行如权利要求12-17或18-22或23-25或27或28中任一项所述的方法。
  32. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,当所述程序指令在电子设备上运行时,使得所述电子设备执行如权利要求12-17或18-22或23-25或27或28中任一项所述的方法。
PCT/CN2023/093746 2022-05-17 2023-05-12 通信方法、系统及相关设备 WO2023221880A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210537177.XA CN117119416A (zh) 2022-05-17 2022-05-17 通信方法、系统及相关设备
CN202210537177.X 2022-05-17

Publications (1)

Publication Number Publication Date
WO2023221880A1 true WO2023221880A1 (zh) 2023-11-23

Family

ID=88804378

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/093746 WO2023221880A1 (zh) 2022-05-17 2023-05-12 通信方法、系统及相关设备

Country Status (2)

Country Link
CN (1) CN117119416A (zh)
WO (1) WO2023221880A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105846864A (zh) * 2015-01-30 2016-08-10 桂花网科技有限公司 用于支持无线通信的方法、装置及系统
CN110198534A (zh) * 2019-04-30 2019-09-03 努比亚技术有限公司 通信透传控制方法、通信设备、系统及存储介质
US20220030403A1 (en) * 2018-08-01 2022-01-27 Huawei Technologies Co., Ltd. Bluetooth Communication Method and Dual-Mode Bluetooth Terminal
US20220039179A1 (en) * 2018-11-30 2022-02-03 Huawei Technologies Co., Ltd. Bluetooth Connection Method and Device
WO2022055415A1 (en) * 2020-09-14 2022-03-17 Razer (Asia-Pacific) Pte. Ltd. Seamless bluetooth switching system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105846864A (zh) * 2015-01-30 2016-08-10 桂花网科技有限公司 用于支持无线通信的方法、装置及系统
US20220030403A1 (en) * 2018-08-01 2022-01-27 Huawei Technologies Co., Ltd. Bluetooth Communication Method and Dual-Mode Bluetooth Terminal
US20220039179A1 (en) * 2018-11-30 2022-02-03 Huawei Technologies Co., Ltd. Bluetooth Connection Method and Device
CN110198534A (zh) * 2019-04-30 2019-09-03 努比亚技术有限公司 通信透传控制方法、通信设备、系统及存储介质
WO2022055415A1 (en) * 2020-09-14 2022-03-17 Razer (Asia-Pacific) Pte. Ltd. Seamless bluetooth switching system

Also Published As

Publication number Publication date
CN117119416A (zh) 2023-11-24

Similar Documents

Publication Publication Date Title
CN111459433B (zh) 一种传屏方法、设备及存储介质
EP3029650B1 (en) Electronic device, audio device, and methods of controlling electronic device and audio device power supply
JP6009524B2 (ja) モバイルデバイスのための外部タッチスクリーン
US9473233B2 (en) Method and apparatus for transmitting data using relay device
EP3138269B1 (en) Wireless communication system.
US20230039861A1 (en) Projection Connection Control Method And Electronic Device
JP5834568B2 (ja) 情報処理装置、情報処理方法およびコンピュータプログラム
WO2020181906A1 (zh) 与智能电视交互的方法及装置
US20150067536A1 (en) Gesture-based Content Sharing Between Devices
WO2021244429A1 (zh) 一种控制应用程序安装的方法及装置
TWM410273U (en) Control transfer apparatus and control transfer system
US20230138804A1 (en) Enhanced video call method and system, and electronic device
WO2023273639A1 (zh) 设备连接方法及装置、计算机可读介质和电子设备
WO2023070993A1 (zh) 显示控制方法、显示系统、电子设备和可读存储介质
CN108027725A (zh) 指导终端设备操作的方法、装置和设备
WO2021190353A1 (zh) 交互方法和显示设备
US11362854B2 (en) Information processing apparatus, information processing method, program, and information processing system
WO2023221880A1 (zh) 通信方法、系统及相关设备
WO2018096849A1 (ja) 情報処理装置、情報処理方法、及びプログラム
KR20120105318A (ko) 프레젠테이션 데이터 공유 방법 및 이를 이용하는 이동 단말기
JP2016028354A (ja) 情報処理装置、情報処理方法およびコンピュータプログラム
WO2024139400A1 (zh) 一种启用白板绘制的方法及相关装置
JP2015192320A (ja) ゲートウェイ装置におけるデバイス装置の設定方法、ゲートウェイ装置及びデバイス装置設定プログラム
WO2023051272A1 (zh) 一种设备组网及声道配置方法和电子设备
WO2024060750A1 (zh) 蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备

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: 23806832

Country of ref document: EP

Kind code of ref document: A1