WO2022160967A1 - Communication method, mobile device, electronic device, and computer-readable storage medium - Google Patents

Communication method, mobile device, electronic device, and computer-readable storage medium Download PDF

Info

Publication number
WO2022160967A1
WO2022160967A1 PCT/CN2021/137058 CN2021137058W WO2022160967A1 WO 2022160967 A1 WO2022160967 A1 WO 2022160967A1 CN 2021137058 W CN2021137058 W CN 2021137058W WO 2022160967 A1 WO2022160967 A1 WO 2022160967A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
message
point
mobile device
audio data
Prior art date
Application number
PCT/CN2021/137058
Other languages
French (fr)
Chinese (zh)
Inventor
赵朋
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022160967A1 publication Critical patent/WO2022160967A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • H04N21/4122Peripherals receiving signals from specially adapted client devices additional display device, e.g. video projector
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/04Scanning arrangements, i.e. arrangements for the displacement of active reading or reproducing elements relative to the original or reproducing medium, or vice versa
    • H04N1/10Scanning arrangements, i.e. arrangements for the displacement of active reading or reproducing elements relative to the original or reproducing medium, or vice versa using flat picture-bearing surfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/4363Adapting the video stream to a specific local network, e.g. a Bluetooth® network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/4363Adapting the video stream to a specific local network, e.g. a Bluetooth® network
    • H04N21/43637Adapting the video stream to a specific local network, e.g. a Bluetooth® network involving a wireless protocol, e.g. Bluetooth, RF or wireless LAN [IEEE 802.11]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams

Definitions

  • the present application relates to the field of communication, and in particular, to a communication method, a mobile device, an electronic device, and a computer-readable storage medium.
  • Bluetooth blue, BT
  • wireless fidelity wireless fidelity, Wi-Fi
  • peer-to-peer peer-to- -peer, P2P
  • wireless bluetooth headsets can establish connections with other communication devices based on bluetooth technology, get rid of the trouble of connecting wires, and are widely praised.
  • a point-to-point direct connection is established between a Bluetooth headset and a smartphone via Bluetooth, when the user moves with the headset to a location far away from the smartphone, or there is a wall blocking between the smartphone and the Bluetooth headset (such as , the smartphone is placed on the second floor, and the user himself wears a Bluetooth headset to move to the first floor), which will cause the Bluetooth connection between the wireless Bluetooth headset and the smartphone to be disconnected, resulting in interruption of services (such as audio data transmission). Therefore, when the two electronic devices based on the point-to-point direct connection technology are disconnected, how to realize service connection becomes an urgent problem to be solved.
  • the present application provides a communication method, a mobile device, an electronic device and a computer-readable storage medium.
  • an indirect connection can be established through a third electronic device, and when the transmission between the two electronic devices is ongoing During the service, the connection of the service can also be realized through the newly established connection.
  • a communication method is provided.
  • the communication method is applied to the first electronic device.
  • the first electronic device includes a processor and a memory.
  • the first electronic device establishes a point-to-point direct connection with a mobile device, and the first electronic device plays audio data through the mobile device.
  • the first electronic device pauses playing the audio data, and records a first pause mark; or, After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio data through the speaker of the first electronic device.
  • the first electronic device After detecting that the first electronic device disconnects the point-to-point direct connection with the mobile device, the first electronic device receives a first message, where the first message is used to instruct the mobile device and the second electronic device The device establishes a direct point-to-point connection. In response to the first message, the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device; or, the first electronic device responds to the first electronic device. A message, the first electronic device does not continue to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
  • the first electronic device can send audio data to the second electronic device, so that the second electronic device can send audio data to the second electronic device.
  • the device sends audio data to the mobile device, so that after the first electronic device is disconnected from the mobile device, the first electronic device can establish an indirect connection with the mobile device through the second electronic device.
  • the first electronic device before the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device, the first electronic device communicates with the second electronic device.
  • the second electronic device establishes a network connection. In this way, the first electronic device can transmit audio data through the connection established with the second electronic device.
  • the first electronic device no longer continues to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device Before, the first electronic device establishes a network connection with the second electronic device. In this way, the first electronic device can transmit audio data through the connection established with the second electronic device.
  • establishing a network connection between the first electronic device and the second electronic device includes: establishing a local area network connection between the first electronic device and the second electronic device.
  • the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
  • the receiving the first message includes: receiving a message from the second electronic device or the third electronic device. In response to the message, after the identification of the mobile device is acquired from the message, it is determined that the message is the first message. According to the first aspect, in another possible implementation manner, after the identification of the mobile device is acquired from the message, determining that the message is the first message; including: after obtaining the identifier of the mobile device from the message After the identification of the mobile device and the identification of the second electronic device are obtained in the device, it is determined that the message is the first message. According to the first aspect, in another possible implementation manner, the identification of the mobile device, the identification of the second electronic device, and the identification of the mobile device and the second electronic device are obtained from the message. After the indication information of the point-to-point direct connection is established, it is determined that the message is the first message. In this way, the ways of determining the first message can be increased, so that the flexibility of the scheme can be improved.
  • the first electronic device after detecting that the first electronic device is disconnected from the second electronic device, the first electronic device pauses playing the audio data, and A second pause mark is recorded. In this way, it is possible to wait for the connection between the mobile device and the first electronic device to be established again, and then realize the service connection.
  • the first electronic device in another possible implementation manner, after it is detected that the first electronic device and the second electronic device are disconnected from the network.
  • the first electronic device continues to play the audio data through the speaker. In this way, the flexibility of the scheme can be increased.
  • the first electronic device after the first electronic device establishes a point-to-point direct connection with the mobile device, the first electronic device sends a first notification message to the third electronic device;
  • the first notification message includes an identification of the mobile device, an identification of the first electronic device, and first notification information that the mobile device has established a point-to-point direct connection with the first electronic device.
  • the third electronic device can be used as the central device to know the connection situation between the devices in time.
  • the first electronic device after the first electronic device disconnects the point-to-point direct connection with the mobile device, the first electronic device sends a second notification message to the third electronic device ; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the second notification information that the mobile device and the first electronic device have disconnected the point-to-point direct connection .
  • the third electronic device can be used as the central device to know the connection situation between the devices in time.
  • the first electronic device and the second electronic device are connected to the same local area network.
  • the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
  • the point-to-point direct connection includes one of a Bluetooth connection, a Wi-Fi P2P connection, and a ZigBee connection. In this way, the flexibility of the scheme can be increased.
  • the first electronic device is a smart phone.
  • a communication method is provided.
  • the communication method is applied to a mobile device.
  • a mobile device includes a processor and memory.
  • the mobile device After detecting that the mobile device is disconnected from the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the mobile device , and point-to-point direct connection requests.
  • the mobile device After receiving the first response message from the second electronic device, the mobile device establishes a point-to-point direct connection with the second electronic device; the first response message is associated with the first request message.
  • the mobile device After receiving all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data comes from the second electronic device. Since the mobile device broadcasts the first request message after disconnecting from the first electronic device, the second electronic device can be connected to it, thereby establishing an indirect connection between the second electronic device and the first electronic device. foundation.
  • the mobile device after detecting that the mobile device and the second electronic device are disconnected from the point-to-point direct connection, the mobile device broadcasts a second request message; the The second request message includes the identification of the mobile device and a point-to-point direct connection request. In this way, a foundation can be laid for establishing connections with other devices after disconnecting from the second electronic device.
  • the mobile device is a Bluetooth headset.
  • a communication method is provided.
  • the communication method is applied to the second electronic device.
  • the second electronic device includes a processor and a memory.
  • the second electronic device, the first electronic device and the third electronic device are connected to the same local area network.
  • the second electronic device receives a first request message from a mobile device; the first request message includes an identifier of the mobile device and a point-to-point direct connection request.
  • the second electronic device establishes a point-to-point direct connection with the mobile device.
  • the second electronic device sends a first notification message to the third electronic device or the first electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the and the first notification information for establishing a point-to-point direct connection between the second electronic device and the mobile device.
  • All or part of the unplayed content of audio data is received from the first electronic device.
  • the second electronic device transmits all or part of the unplayed content of the audio data to the mobile device. Since the second electronic device informs other devices after establishing the connection with the mobile device, it lays a foundation for the first electronic device to establish an indirect connection with the mobile device through the second electronic device. Further, since the second electronic device will receive the The audio data from the first electronic device is sent to the mobile device, so that the first electronic device can establish an indirect connection with the mobile device through the second electronic device.
  • the second electronic device after detecting that the second electronic device is disconnected from the point-to-point direct connection with the mobile device, the second electronic device sends the third electronic device to the third electronic device.
  • the device or the first electronic device sends a second notification message; the second notification message includes the identification of the second electronic device, the identification of the mobile device, and the disconnection of the second electronic device from the mobile device A second notification message for a point-to-point direct connection.
  • the second electronic device and the first electronic device before receiving all or part of the unplayed content of the audio data from the first electronic device, the second electronic device and the first electronic device Establish a LAN connection.
  • the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
  • the second electronic device and the first electronic device After receiving the second reply message from the third electronic device or the first electronic device, the second electronic device and the first electronic device The device disconnects the local area network; the second reply message is associated with the second notification message. In this way, the connection with the first electronic device may be disconnected based on the second reply message.
  • the second electronic device is a smart speaker.
  • a communication method is provided.
  • the communication method is applied to a third electronic device.
  • the third electronic device includes a processor and a memory.
  • the third electronic device, the first electronic device and the second electronic device are connected to the same local area network.
  • the third electronic device receives a first notification message from the first electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device.
  • the first notification information of the point-to-point direct connection is established by the first electronic device.
  • the third electronic device receives a second notification message from the first electronic device; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device.
  • the third electronic device receives a first notification message from the second electronic device, and the first notification message includes an identification of the second electronic device, an identification of the mobile device, and the second electronic device and the The first notification information that the mobile device establishes a point-to-point direct connection.
  • the third electronic device sends a first message to the first electronic device; the first message is used to instruct the second electronic device to establish a point-to-point direct connection with the mobile device.
  • the device having a pairing relationship with the identifier of the mobile device can be made to establish an indirect connection with the mobile device through the second electronic device connection relationship.
  • a second notification message is received from the second electronic device and sent; the second notification message includes the identifier of the second electronic device and the identifier of the mobile device and second notification information that the second electronic device disconnects the point-to-point direct connection from the mobile device.
  • the third electronic device can be made aware of the connection situation between the second electronic device and the mobile device.
  • the third electronic device sends the second notification message to the second electronic device.
  • a second reply message from the first electronic device is received; the second reply message is associated with the second notification message.
  • the second reply message is sent to the second electronic device.
  • the first electronic device can be made aware of the connection between the second electronic device and the mobile device, so that the audio data can be stopped when the second electronic device is disconnected from the mobile device.
  • the second electronic device is a smart TV.
  • a communication method is provided.
  • the communication method is applied to the first electronic device.
  • the first electronic device includes a processor and a memory.
  • the first electronic device pauses to play the audio data, and records the first pause or, after the first electronic device detects that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device continues to play the the audio data.
  • the first electronic device receives a first message, where the first message is used to indicate that the second electronic device has discovered the Mobile devices.
  • the first electronic device In response to the first message, the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device; or, the first electronic device responds to the first electronic device. A message, the first electronic device does not continue to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
  • the first electronic device can send audio data to the second electronic device, so that The second electronic device sends the audio data to the mobile device, so that after the first electronic device is disconnected from the mobile device, the first electronic device can establish an indirect connection between the second electronic device and the mobile device.
  • the first electronic device before the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device, the first electronic device communicates with the second electronic device.
  • the second electronic device establishes a network connection. In this way, the first electronic device can transmit audio data through the connection established with the second electronic device.
  • the first electronic device no longer continues to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device Before, the first electronic device establishes a network connection with the second electronic device. In this way, the first electronic device can transmit audio data through the connection established with the second electronic device.
  • establishing a network connection between the first electronic device and the second electronic device includes: establishing a local area network connection between the first electronic device and the second electronic device.
  • the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
  • the receiving the first message includes: receiving a message from the second electronic device or the third electronic device. In response to the message, after the identification of the mobile device is acquired from the message, it is determined that the message is the first message. According to the fifth aspect, in another possible implementation manner, after the identification of the mobile device is acquired from the message, the determining that the message is the first message includes: after the message is obtained from the message After the identification of the mobile device and the identification of the second electronic device are obtained in the device, it is determined that the message is the first message.
  • the identifier of the mobile device, the identifier of the second electronic device are obtained from the message, and the second electronic device discovers the mobile device After receiving the indication information of the device, it is determined that the message is the first message. In this way, the ways of determining the first message can be increased, so that the flexibility of the scheme can be improved.
  • the first electronic device after detecting that the first electronic device is disconnected from the network connection with the second electronic device, the first electronic device pauses playing the audio data, and A second pause mark is recorded. In this way, it is possible to wait for the connection between the mobile device and the first electronic device to be established again, and then realize the service connection.
  • the fifth aspect in another possible implementation manner, after it is detected that the first electronic device and the second electronic device are disconnected from the network.
  • the first electronic device continues to play the audio data through the speaker. In this way, the flexibility of the scheme can be increased.
  • the first electronic device after the first electronic device establishes a point-to-point direct connection with the mobile device, the first electronic device sends a first notification message to the third electronic device;
  • the first notification message includes an identification of the mobile device, an identification of the first electronic device, and first notification information that the mobile device has established a point-to-point direct connection with the first electronic device.
  • the third electronic device can be used as the central device to know the connection situation between the devices in time.
  • the first electronic device after the first electronic device and the mobile device are disconnected from the point-to-point direct connection, the first electronic device sends a second notification message to the third electronic device ; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the second notification information that the mobile device and the first electronic device have disconnected the point-to-point direct connection .
  • the third electronic device can be used as the central device to know the connection situation between the devices in time.
  • the first electronic device and the second electronic device are connected to the same local area network.
  • the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
  • the point-to-point direct connection includes one of a Bluetooth connection, a Wi-Fi P2P connection, and a ZigBee connection. In this way, the flexibility of the scheme can be increased.
  • the first electronic device is a smart phone.
  • a communication method is provided.
  • the communication method is applied to the second electronic device.
  • the second electronic device includes a processor and a memory.
  • the second electronic device, the first electronic device and the third electronic device are connected to the same local area network.
  • a first request message from a mobile device is received; the first request message includes an identifier of the mobile device and a point-to-point direct connection request.
  • the second electronic device sends a first notification message to the third electronic device or the first electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the user information indicating that the mobile device has been discovered by the second electronic device.
  • the second electronic device establishes a point-to-point direct connection with the mobile device.
  • All or part of the unplayed content of audio data is received from the first electronic device.
  • the second electronic device transmits all or part of the unplayed content of the audio data to the mobile device. Since the second electronic device informs other devices after discovering the mobile device, it lays a foundation for the first electronic device to establish an indirect connection with the mobile device through the second electronic device.
  • the audio data of an electronic device is sent to the mobile device, so that the first electronic device can establish an indirect connection with the mobile device through the second electronic device.
  • the second electronic device after detecting that the second electronic device is disconnected from the point-to-point direct connection with the mobile device, the second electronic device sends the third electronic device to the third electronic device.
  • the device or the first electronic device sends a second notification message; the second notification message includes the identification of the second electronic device, the identification of the mobile device, and the disconnection of the second electronic device from the mobile device A second notification message for a point-to-point direct connection.
  • the second electronic device and the first electronic device before receiving all or part of the unplayed content of the audio data from the first electronic device, the second electronic device and the first electronic device Establish a LAN connection.
  • the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
  • the second electronic device and the first electronic device After receiving the second reply message from the third electronic device or the first electronic device, the second electronic device and the first electronic device The device disconnects the local area network; the second reply message is associated with the second notification message. In this way, the connection with the first electronic device may be disconnected based on the second reply message.
  • the second electronic device is a smart speaker.
  • a communication method is provided.
  • the communication method is applied to a third electronic device.
  • the third electronic device includes a processor and a memory.
  • the third electronic device, the first electronic device and the second electronic device are connected to the same local area network.
  • the third electronic device receives a first notification message from the first electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device.
  • the first notification information of the point-to-point direct connection is established by the first electronic device.
  • the third electronic device receives a second notification message from the first electronic device; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device.
  • the second notification information that the first electronic device disconnects the point-to-point direct connection The third electronic device receives a first notification message from the second electronic device, and the first notification message includes an identification of the second electronic device, an identification of the mobile device, and the second electronic device and the Indication information for indicating that the second electronic device has discovered the mobile device.
  • the third electronic device sends a first message to the first electronic device; the first message is used for indicating that the second electronic device has discovered the mobile device. Since the first message is sent to the device having a pairing relationship with the identifier of the mobile device through the third electronic device, the device having a pairing relationship with the identifier of the mobile device can be made to establish an indirect connection with the mobile device through the second electronic device connection relationship.
  • a second notification message sent from the second electronic device is received; the second notification message includes an identifier of the second electronic device and an identifier of the mobile device and second notification information that the second electronic device disconnects the point-to-point direct connection from the mobile device.
  • the third electronic device can be made aware of the connection situation between the second electronic device and the mobile device.
  • the third electronic device sends the second notification message to the second electronic device.
  • a second reply message from the first electronic device is received; the second reply message is associated with the second notification message.
  • the second reply message is sent to the second electronic device.
  • the first electronic device can be made aware of the connection between the second electronic device and the mobile device, so that the audio data can be stopped when the second electronic device is disconnected from the mobile device.
  • the second electronic device is a smart TV.
  • a communication method is provided.
  • the communication method is applied to the first electronic device, the second electronic device, the third electronic device and the mobile device.
  • the first electronic device, the second electronic device and the third electronic device are connected to the same local area network.
  • the first electronic device establishes a point-to-point direct connection with the mobile device.
  • the first electronic device plays audio data through the mobile device.
  • the first electronic device sends a first notification message to the third electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the first electronic device.
  • the third electronic device receives the first notification message from the first electronic device.
  • the first electronic device After detecting that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device sends a second notification message to the third electronic device; the second notification message includes the The identification of the mobile device, the identification of the first electronic device, and the second notification information that the mobile device has disconnected the point-to-point direct connection with the first electronic device.
  • the third electronic device receives the second notification message from the first electronic device.
  • the first electronic device After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses playing the audio data, and records a first pause mark. Alternatively, after the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio through the speaker of the first electronic device data.
  • the mobile device After detecting that the mobile device disconnects the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer.
  • the second electronic device receives the first request message from the mobile device.
  • the second electronic device sends a first response message to the mobile device, the first response message being associated with the first request message.
  • the mobile device is receiving the first response message from the second electronic device.
  • the second electronic device establishes a point-to-point direct connection with the mobile device.
  • the second electronic device sends a first notification message to the third electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the connection between the second electronic device and the third electronic device.
  • the first notification information that the mobile device establishes a point-to-point direct connection.
  • the third electronic device receives the first notification message from the second electronic device.
  • the third electronic device sends a first message to the first electronic device; the first message is used to instruct the second electronic device to establish a point-to-point direct connection with the mobile device.
  • the first electronic device receives the first message. In response to the first message, the first electronic device transmits to the second electronic device all or part of the audio data following a first pause mark. Alternatively, in response to the first message, the first electronic device does not continue playing through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
  • the second electronic device receives all or part of the unplayed content of the audio data from the first electronic device.
  • the second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
  • the mobile device After the mobile device receives all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data in part from the second electronic device.
  • a communication method is provided.
  • the communication method is applied to the first electronic device, the second electronic device, the third electronic device and the mobile device.
  • the first electronic device, the second electronic device and the third electronic device are connected to the same local area network.
  • the first electronic device establishes a point-to-point direct connection with the mobile device.
  • the first electronic device plays audio data through the mobile device.
  • the first electronic device sends a first notification message to the third electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the first electronic device.
  • the third electronic device receives the first notification message from the first electronic device.
  • the first electronic device After detecting that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device sends a second notification message to the third electronic device; the second notification message includes the The identification of the mobile device, the identification of the first electronic device, and the second notification information that the mobile device has disconnected the point-to-point direct connection with the first electronic device.
  • the third electronic device receives the second notification message from the first electronic device.
  • the first electronic device After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses playing the audio data, and records a first pause mark. Alternatively, after the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio through the speaker of the first electronic device data.
  • the mobile device After detecting that the mobile device disconnects the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer. The second electronic device receives the first request message from the mobile device.
  • the second electronic device sends a first notification message to the third electronic device, where the first notification message includes an identifier of the second electronic device, an identifier of the mobile device, and a message for indicating the second electronic device
  • the device discovered the information of the mobile device.
  • the third electronic device receives the first notification message from the second electronic device.
  • the third electronic device sends a first message to the first electronic device; the first message is used to indicate that the second electronic device has discovered the mobile device.
  • the first electronic device receives the first message.
  • a connection is established between the first electronic device and the second electronic device.
  • the second electronic device sends a first response message to the mobile device, the first response message being associated with the first request message.
  • the mobile device is receiving the first response message from the second electronic device.
  • the second electronic device establishes a point-to-point direct connection with the mobile device.
  • the first electronic device receives the first message. In response to the first message, the first electronic device transmits to the second electronic device all or part of the audio data following a first pause mark. Alternatively, in response to the first message, the first electronic device does not continue playing through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
  • the second electronic device receives all or part of the unplayed content of the audio data from the first electronic device.
  • the second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
  • the mobile device After the mobile device receives all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data in part from the second electronic device.
  • a tenth aspect provides a communication method.
  • the communication method is applied to the first electronic device, the second electronic device and the mobile device.
  • the second electronic device and the first electronic device are connected to the same local area network.
  • the first electronic device establishes a point-to-point direct connection with the mobile device.
  • the first electronic device plays audio data through the mobile device.
  • the first electronic device After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses to play the audio data, and records a first pause mark. Alternatively, after the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio through the speaker of the first electronic device data.
  • the mobile device After detecting that the mobile device disconnects the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer.
  • the second electronic device receives the first request message from the mobile device.
  • the second electronic device sends a first response message to the mobile device, the first response message being associated with the first request message.
  • the mobile device is receiving the first response message from the second electronic device.
  • the second electronic device establishes a point-to-point direct connection with the mobile device.
  • the second electronic device sends a first message to the first electronic device; the first message is used to instruct the second electronic device to establish a point-to-point direct connection with the mobile device.
  • the first electronic device receives a first message, where the first message is used to instruct the mobile device to establish a point-to-point direct connection with the second electronic device.
  • the first electronic device transmits to the second electronic device all or part of the audio data following a first pause mark. Or, in response to the first message, the first electronic device does not continue to play through the speaker, but sends all the unplayed content of the audio data to the second electronic device or part.
  • the second electronic device receives all or part of the unplayed content of the audio data from the first electronic device.
  • the second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
  • the mobile device After the mobile device receives all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data in part from the second electronic device.
  • a communication method is provided.
  • the communication method is applied to the first electronic device, the second electronic device and the mobile device.
  • the second electronic device and the first electronic device are connected to the same local area network.
  • the first electronic device establishes a point-to-point direct connection with the mobile device.
  • the first electronic device plays audio data through the mobile device.
  • the first electronic device After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses to play the audio data, and records a first pause mark. Alternatively, after the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio through the speaker of the first electronic device data.
  • the mobile device After detecting that the mobile device disconnects the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer.
  • the second electronic device receives the first request message from the mobile device.
  • the second electronic device sends a first message to the first electronic device; the first message is used to indicate that the second electronic device has discovered the mobile device.
  • the first electronic device receives the first message.
  • a connection is established between the first electronic device and the second electronic device.
  • the second electronic device sends a first response message to the mobile device, the first response message being associated with the first request message.
  • the mobile device is receiving the first response message from the second electronic device.
  • the second electronic device establishes a point-to-point direct connection with the mobile device.
  • the first electronic device transmits to the second electronic device all or part of the audio data following a first pause mark. Or, in response to the first message, the first electronic device does not continue to play through the speaker, but sends all the unplayed content of the audio data to the second electronic device or part.
  • the second electronic device receives all or part of the unplayed content of the audio data from the first electronic device.
  • the second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
  • the mobile device After the mobile device receives all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data in part from the second electronic device.
  • the present application further provides a communication device.
  • the communication apparatus may be any device on the sending end or device on the receiving end that performs data transmission in a wireless manner. During the communication process, the device on the sending end and the device on the receiving end are relative.
  • the communication device can be used as the above-mentioned mobile device or a communication chip that can be used in the mobile device; in some communication processes, the communication device can be used as the above-mentioned first electronic device or a communication chip that can be used for the first electronic device; In some communication processes, the communication device can be used as the above-mentioned second electronic device or a communication chip that can be used in the second electronic device; in some communication processes, the communication device can be used as the above-mentioned third electronic device or can be used in the third electronic device. communication chip.
  • a communication apparatus including a communication unit and a processing unit, so as to execute any one of the above-mentioned embodiments of the communication methods of the first to eleventh aspects.
  • the communication unit is used to perform functions related to transmission and reception.
  • the communication unit includes a receiving unit and a sending unit.
  • the communication device is a communication chip, and the communication unit may be an input/output circuit or port of the communication chip.
  • the communication unit may be a transmitter and receiver, or the communication unit may be a transmitter and receiver.
  • the communication apparatus further includes various modules that can be used to execute any one of the implementation manners of any one of the communication methods of the first aspect to the seventh aspect.
  • a thirteenth aspect provides a communication apparatus, where the communication apparatus is the above-mentioned mobile device, the first electronic device, the second electronic device or the third electronic device.
  • the communication device includes a processor and a memory.
  • the memory is used to store computer programs or instructions
  • the processor is used to call and run the computer programs or instructions from the memory, and when the processor executes the computer programs or instructions in the memory,
  • the communication apparatus is caused to perform any one of the implementations of any one of the communication methods of the first aspect to the seventh aspect.
  • processors there are one or more processors and one or more memories.
  • the memory may be integrated with the processor, or the memory may be provided separately from the processor.
  • the transceiver may include a transmitter (transmitter) and a receiver (receiver).
  • a fourteenth aspect provides a communication apparatus, where the communication apparatus is the above-mentioned mobile device, the first electronic device, the second electronic device or the third electronic device.
  • the communication device includes a processor.
  • the processor coupled to the memory, is operable to perform the method of any one of the first to seventh aspects, and any one of the possible implementations of the first to seventh aspects.
  • the communication device further includes a communication interface, and the processor is coupled to the communication interface.
  • the communication apparatus is a mobile device.
  • the communication interface may be a transceiver, or an input/output interface.
  • the transceiver may be a transceiver circuit.
  • the input/output interface may be an input/output circuit.
  • the communication apparatus is a first electronic device.
  • the communication interface may be a transceiver, or an input/output interface.
  • the transceiver may be a transceiver circuit.
  • the input/output interface may be an input/output circuit.
  • the communication apparatus is a second electronic device.
  • the communication interface may be a transceiver, or an input/output interface.
  • the transceiver may be a transceiver circuit.
  • the input/output interface may be an input/output circuit.
  • the communication apparatus is a third electronic device.
  • the communication interface may be a transceiver, or an input/output interface.
  • the transceiver may be a transceiver circuit.
  • the input/output interface may be an input/output circuit.
  • the communication device is a chip or a system of chips.
  • the communication interface may be an input/output interface, an interface circuit, an output circuit, an input circuit, a pin or a related circuit on the chip or a chip system.
  • the processor may also be embodied as a processing circuit or a logic circuit.
  • a system including the above-mentioned mobile device, a first electronic device, a second electronic device, and a third electronic device.
  • the first electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the first electronic device to perform the following: Step: The first electronic device establishes a point-to-point direct connection with the mobile device, and the first electronic device plays audio data through the mobile device. After detecting that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device pauses to play the audio data, and records a first pause mark; or, the first electronic device After detecting that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device continues to play the audio data through the speaker of the first electronic device.
  • the first electronic device After detecting that the first electronic device disconnects the point-to-point direct connection with the mobile device, the first electronic device receives a first message, where the first message is used to instruct the mobile device and the second electronic device The device establishes a direct point-to-point connection. In response to the first message, the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device; or, the first electronic device responds to the first electronic device. A message, the first electronic device does not continue to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
  • the mobile device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the mobile device to perform the following steps: After the mobile device and the first electronic device are disconnected from the point-to-point direct connection, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point direct connection request. After receiving the first response message from the second electronic device, the mobile device establishes a point-to-point direct connection with the second electronic device; the first response message is associated with the first request message. After receiving all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data comes from the second electronic device.
  • the second electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the second electronic device to perform the following: Step: The second electronic device receives a first request message from a mobile device; the first request message includes an identifier of the mobile device and a point-to-point direct connection request. The second electronic device establishes a point-to-point direct connection with the mobile device. The second electronic device sends a first notification message to the third electronic device or the first electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the and the first notification information for establishing a point-to-point direct connection between the second electronic device and the mobile device. All or part of the unplayed content of audio data is received from the first electronic device. The second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
  • the third electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the third electronic device to perform the following: Step: the third electronic device receives a first notification message from the first electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The first notification information that the first electronic device has established a point-to-point direct connection. The third electronic device receives a second notification message from the first electronic device; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The second notification information that the first electronic device disconnects the point-to-point direct connection.
  • the third electronic device receives a first notification message from the second electronic device, and the first notification message includes an identification of the second electronic device, an identification of the mobile device, and the second electronic device and the The first notification information that the mobile device establishes a point-to-point direct connection.
  • the third electronic device sends a first message to the first electronic device; the first message is used to instruct the second electronic device to establish a point-to-point direct connection with the mobile device.
  • a sixteenth aspect provides a system including the above mobile device, a first electronic device, a second electronic device and a third electronic device.
  • the first electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the first electronic device to perform the following: Step: The first electronic device establishes a point-to-point direct connection with the mobile device, and the first electronic device plays audio data through the mobile device. After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses playing the audio data, and records a first pause mark; or, After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio data through the speaker of the first electronic device.
  • the first electronic device After detecting that the first electronic device disconnects the point-to-point direct connection with the mobile device, the first electronic device receives a first message, where the first message is used to indicate that the second electronic device has discovered the Mobile devices. In response to the first message, the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device; or, the first electronic device responds to the first electronic device. A message, the first electronic device does not continue to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
  • the mobile device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the mobile device to perform the following steps: After the mobile device and the first electronic device are disconnected from the point-to-point direct connection, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point direct connection request. After receiving the first response message from the second electronic device, the mobile device establishes a point-to-point direct connection with the second electronic device; the first response message is associated with the first request message. After receiving all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data comes from the second electronic device.
  • the second electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the second electronic device to perform the following: Step: Receive a first request message from a mobile device; the first request message includes an identifier of the mobile device and a point-to-point direct connection request.
  • the second electronic device sends a first notification message to the third electronic device or the first electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the user information indicating that the mobile device has been discovered by the second electronic device.
  • the second electronic device establishes a point-to-point direct connection with the mobile device. All or part of the unplayed content of the audio data is received from the first electronic device.
  • the second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
  • the third electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the third electronic device to perform the following: Step: the third electronic device receives a first notification message from the first electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The first notification information that the first electronic device has established a point-to-point direct connection. The third electronic device receives a second notification message from the first electronic device; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The second notification information that the first electronic device disconnects the point-to-point direct connection.
  • the third electronic device receives a first notification message from the second electronic device, and the first notification message includes an identification of the second electronic device, an identification of the mobile device, and the second electronic device and the Indication information for indicating that the second electronic device has discovered the mobile device.
  • the third electronic device sends a first message to the first electronic device; the first message is used to indicate that the second electronic device has discovered the indication information of the mobile device.
  • a seventeenth aspect provides a computer-readable storage medium, where the computer-readable medium stores a computer program (also referred to as code, or instruction), when it is run on a computer, to cause the computer to execute the above-mentioned first to third aspects
  • a computer program also referred to as code, or instruction
  • An eighteenth aspect provides a computer program product, the computer program product comprising: a computer program (also referred to as code, or instructions), which, when the computer program is executed, causes the computer to execute any one of the first to seventh aspects above.
  • a computer program also referred to as code, or instructions
  • FIG. 1a is a schematic diagram of an application scenario to which an embodiment of the present application is applicable;
  • FIG. 1b is a schematic diagram of an application scenario to which an embodiment of the present application is applicable;
  • FIG. 2a is a schematic structural diagram of a mobile device 100 according to an embodiment of the present application.
  • FIG. 2b is a schematic structural diagram of an electronic device 200 according to an embodiment of the present application.
  • 3a is a schematic flowchart of a communication method provided by an embodiment of the present application.
  • 3b is a schematic flowchart of another communication method provided by an embodiment of the present application.
  • FIG. 4a is a schematic flowchart of another communication method provided by an embodiment of the present application.
  • FIG. 4b is a schematic flowchart of another communication method provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a method for establishing a point-to-point direct connection between a mobile phone and an earphone in the communication method provided by the embodiment of the present application;
  • FIG. 6 is a schematic flowchart of disconnecting a Bluetooth connection between a mobile phone and an earphone in a communication method provided by an embodiment of the present application;
  • FIG. 7 is a schematic flowchart of establishing a connection between a mobile phone and a smart speaker in a communication method provided by an embodiment of the present application
  • FIG. 8 is a schematic flowchart of disconnection between a mobile phone and a smart speaker in a communication method provided by an embodiment of the present application
  • FIG. 9 is a schematic diagram of the architecture of a cross-physical network end-to-end communication model provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a mobile device according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the term “connected” includes both direct and indirect connections unless otherwise specified. "First” and “second” are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implying the number of indicated technical features.
  • words such as “exemplarily” or “for example” are used to represent examples, illustrations or illustrations. Any embodiment or design described in the embodiments of the present application as “exemplarily” or “such as” should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplarily” or “such as” is intended to present the related concepts in a specific manner.
  • FIG. 1a and FIG. 1b are schematic diagrams of an application scenario to which the embodiments of the present application are applied.
  • both the mobile device 100 and the electronic device 200 are located in the bedroom 01.
  • the mobile device 100 (in the figure, the mobile device 100 is shown as a Bluetooth headset as an example) is connected to the electronic device 200 (in the figure, the electronic device is shown as an example) via Bluetooth 200 is a mobile phone as an example), and play the audio data of the electronic device 200, so that the user can hear the sound from the electronic device 200 through the mobile device 100; for example, it can be music or voice call content.
  • the mobile device 100 may move with the user. As shown in FIG. 1b, the mobile device 100 may move to the living room 02 with the user.
  • the Bluetooth connection between the mobile device 100 and the electronic device 200 may be caused by the wall blocking or the increase of the distance. disconnect.
  • the mobile device 100 moves to a position closer to the electronic device 300, and the mobile device 100 is connected to the electronic device 300 via Bluetooth (in the figure, the electronic device 300 is an example of a smart speaker for illustration).
  • the electronic device 300 and the electronic device 200 may be connected through a local area network.
  • the Bluetooth connection may be disconnected from the electronic device 200 , so that the user can no longer hear the information from the electronic device 200 through the mobile device 100 . sound.
  • the solution A also involves an electronic device 400 (in the figure, the electronic device 400 is a smart TV as an example for illustration).
  • the electronic device 400 can be understood as a central device, and both the electronic device 200 and the electronic device 300 report their respective information (such as identification, connection with other devices, and running services) to the electronic device 400 .
  • the electronic device 200 can report the identification of the mobile device 100 connected to the electronic device 200 to the electronic device 400, and the electronic device 400 can determine that the electronic device 200 and the mobile device 100 are in a connected state after receiving the information .
  • the electronic device 200 when the electronic device 200 is disconnected from the mobile device 100 , the electronic device 200 will report the identification of the mobile device 100 disconnected from the electronic device 200 to the electronic device 400 , and the electronic device 400 will receive After obtaining the information, it can be determined that the electronic device 200 and the mobile device 100 are in a disconnected state.
  • the electronic device 300 after the electronic device 300 establishes a connection with the mobile device 200, it will report the identity of the mobile device 100 connected to the electronic device 300 to the electronic device 400. After the electronic device 400 receives the information It may be determined that the electronic device 300 and the mobile device 100 are in a connected state. Further, the electronic device 400 will send the identification of the mobile device 100 and the identification of the electronic device 300 connected with the mobile device 100 via Bluetooth to the electronic device 200 . Further, the electronic device 200 sends the audio data to the electronic device 300, and the electronic device 300 forwards the audio data to the mobile device 100, so that after the mobile device 100 disconnects the Bluetooth connection from the electronic device 200, the mobile device can continue to be connected to the mobile device through this solution. 100 plays the audio data from the electronic device 200 , so that the user continues to listen to the sound from the electronic device 200 through the mobile device 100 .
  • Scheme B does not involve the electronic device 400, that is, does not involve the central device.
  • the electronic device 300 can notify the electronic device 200 through broadcast or multicast. Further, the electronic device 200 sends the audio data to the electronic device 300 , and the electronic device 300 forwards the audio data to the mobile device 100 . In this way, after the mobile device 100 is disconnected from the electronic device 200 via Bluetooth, the mobile device 100 can continue to play audio data from the electronic device 200 through this solution, so that the user can continue to listen to the sound from the electronic device 200 through the mobile device 100 .
  • the service performed by the electronic device 200 is music playback.
  • the mobile device 100 and the electronic device 200 are connected via Bluetooth, the user can listen to music from the electronic device 200 through the mobile device 100 .
  • the mobile device 100 stops the current music playing service.
  • the Bluetooth connection between the mobile device 100 and the electronic device 300 is established, and the connection between the electronic device 300 and the electronic device 200 is established, the electronic device 200 can continue to perform the music playback service and send the audio data of the music to the electronic device 300.
  • the electronic device 300 forwards the audio data to the mobile device 100 so that the user continues to listen to music from the electronic device 200 through the mobile device 100 .
  • the solution provided by the embodiment of the present application can realize the indirect connection between the mobile device 100 and the electronic device 200 through the electronic device 300 when the mobile device 100 and the electronic device 200 are disconnected from the Bluetooth connection, so that the mobile device 100 and the electronic device 200 can be indirectly connected. To achieve business continuity.
  • FIG. 2a exemplarily shows a hardware structure of a mobile device 100 provided by an embodiment of the present application.
  • the mobile device 100 may include a processor 110, an internal memory 121, buttons 122, a motor 123, an indicator 124, an audio module 125, a speaker 125A, a microphone 125B, a USB interface 130, a charge management module 140, a power management module Module 141, battery 142, wireless communication module 150, antenna 160, etc.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or Neural-network Processing Unit (NPU) Wait.
  • application processor application processor, AP
  • modem processor graphics processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • NPU Neural-network Processing Unit
  • different processing units can be independent devices, or can be integrated in one or more processors.
  • the controller may be the nerve center and command center of the mobile device 100 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes various functional applications and data processing of the mobile device 100 by executing the instructions stored in the internal memory 121 .
  • the mobile device 100 may implement audio functions through an audio module 125, a speaker 125A, a microphone 125B, an application processor, and the like. Such as music playback, recording, etc.
  • the keys 122 include a power-on key, a volume key, and the like.
  • the keys may be mechanical keys. It can also be a touch key.
  • the mobile device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the mobile device 100 .
  • the indicator 124 can be an indicator light, which can be used to indicate the charging state, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the mobile device 100 also includes a charging management module 140 for receiving charging input from the charger. While the charging management module 140 charges the battery 142 , the mobile device 100 can also be powered by the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the wireless communication module 150, and the like.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the mobile device 100 may be implemented by the antenna module 2, the wireless communication module 150, a modem processor, a baseband processor, and the like.
  • the antenna 160 is used to transmit and receive electromagnetic wave signals.
  • Each antenna in mobile device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the cellular network antenna can be multiplexed into a wireless local area network diversity antenna.
  • the antenna may be used in conjunction with a tuning switch.
  • the wireless communication module 150 can provide wireless communication including Bluetooth (bluetooth, BT), near field communication (NFC), infrared technology (infrared, IR), Wi-Fi, ZigBee, etc. applied on the mobile device 100 s solution.
  • the wireless communication module 150 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 150 receives electromagnetic waves via the antenna 160 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 150 can also receive the signal to be sent from the processor 110 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 160 .
  • the wireless communication module 150 is configured to send the voice of the first user and the translated machine voice of the target language, or the voice of the target language sent by the opposite user, and the translated machine voice of the first language.
  • the antenna 160 and the wireless communication module 150 are coupled such that the mobile device 100 can communicate with the network and other devices through wireless communication techniques.
  • the wireless communication technology may include BT, NFC, ZigBee, Wi-Fi, and/or IR technology, and the like.
  • the structure shown in FIG. 2 a does not constitute a specific limitation on the mobile device 100 .
  • the mobile device 100 may include more or less components than shown, or some components may be combined, or some components may be split, or different component arrangements.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • FIG. 2b exemplarily shows a hardware structure of an electronic device 200 provided by an embodiment of the present application.
  • the electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a USB interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, and a mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293, display screen 294, and SIM card interface 295 Wait.
  • the sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, and ambient light.
  • Sensor 280L Bone Conduction Sensor 280M, etc.
  • the processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or Neural-network Processing Unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • GPU graphics processor
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • NPU Neural-network Processing Unit
  • the controller may be the nerve center and command center of the electronic device 200 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 210 for storing instructions and data.
  • the memory in processor 210 is cache memory.
  • the memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
  • the processor 210 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • a charge management module 240 for receiving charging input from the charger. While the charging management module 240 charges the battery 242 , the electronic device 200 can also be powered by the power management module 241 .
  • the power management module 241 is used to connect the battery 242 , the charging management module 240 and the processor 210 .
  • the power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260.
  • the power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the power management module 241 may also be provided in the processor 210 .
  • the power management module 241 and the charging management module 240 may also be provided in the same device.
  • the wireless communication function of the electronic device 200 may be implemented by the antenna module 1, the antenna module 2, the mobile communication module 250, the wireless communication module 160, a modem processor, a baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the cellular network antenna can be multiplexed into a wireless local area network diversity antenna.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 250 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the electronic device 200 .
  • the mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like.
  • the mobile communication module 250 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and then convert it into electromagnetic waves for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 250 may be provided in the processor 210 .
  • at least part of the functional modules of the mobile communication module 250 may be provided in the same device as at least part of the modules of the processor 210 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 270A, the receiver 270B, etc.), or displays images or videos through the display screen 294 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 210, and may be provided in the same device as the mobile communication module 250 or other functional modules.
  • the wireless communication module 260 can provide applications on the electronic device 200 including wireless local area networks (WLAN), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (frequency modulation, FM), near field communication technology (NFC), infrared technology (infrared, IR), Wi-Fi P2P, ZigBee and other wireless communication solutions.
  • the wireless communication module 260 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 260 receives electromagnetic waves via the antenna 2 , modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 .
  • the wireless communication module 260 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 .
  • the wireless communication module 260 is configured to send the voice of the first user and the translated machine voice of the target language, or the voice of the target language sent by the opposite user, and the translated machine voice of the first language.
  • the antenna 1 of the electronic device 200 is coupled with the mobile communication module 250, and the antenna 2 is coupled with the wireless communication module 260, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS)) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system, GLONASS
  • Beidou navigation satellite system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system, QZSS)
  • SBAS satellite based augmentation systems
  • the electronic device 200 implements a display function through a GPU, a display screen 294, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 294 is used to display images, videos, and the like.
  • Display screen 294 includes a display panel.
  • the display panel can be LCD (liquid crystal display, liquid crystal display), OLED (organic light-emitting diode, organic light emitting diode), active matrix organic light emitting diode or active matrix organic light emitting diode (active-matrix organic light) emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the electronic device 200 may include 1 or N display screens, where N is a positive integer greater than 1.
  • the display screen 294 may be used to display a call interface, a translation interface, a language setting interface, and the like.
  • the electronic device 200 can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294 and the application processor.
  • the external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 221 may be used to store computer executable program code, which includes instructions.
  • the processor 210 executes various functional applications and data processing of the electronic device 200 by executing the instructions stored in the internal memory 221 .
  • the memory 221 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 200 and the like.
  • the memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, and an application processor. Such as music playback, recording, etc.
  • the electronic device 200 also includes sensors such as a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, an ambient light sensor 280L, a fingerprint sensor 280H, a temperature sensor 280J, touch sensor 280K, bone conduction sensor 280M, etc.
  • sensors such as a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, an ambient light sensor 280L, a fingerprint sensor 280H, a temperature sensor 280J, touch sensor 280K, bone conduction sensor 280M, etc.
  • the pressure sensor 280A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
  • the pressure sensor 280A may be provided on the display screen 294 .
  • the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to pressure sensor 280A, the capacitance between the electrodes changes.
  • the electronic device 200 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 294, the electronic device 200 detects the intensity of the touch operation according to the pressure sensor 280A.
  • the electronic device 200 may also calculate the touched position according to the detection signal of the pressure sensor 280A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
  • Touch sensor 280K also called “touch panel”. It can be set on the display screen 294 . Used to detect touches on or near it. Detected touch operations can be passed to an application processor to determine the type of touch event and provide corresponding visual output via display screen 294 . In other embodiments, the touch sensor 280K may also be disposed on the surface of the electronic device 200 , which is different from the location where the display screen 294 is located. In the embodiment of the present application, the touch panel is used to receive touch operations such as a first operation, a confirmation operation of the language setting control, a closing operation, and an exit operation.
  • touch operations such as a first operation, a confirmation operation of the language setting control, a closing operation, and an exit operation.
  • the keys 290 include a power-on key, a volume key, and the like.
  • the keys may be mechanical keys. It can also be a touch key.
  • the electronic device 200 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 200 .
  • the indicator 292 can be an indicator light, which can be used to indicate the charging status, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 295 is used to connect a subscriber identity module (SIM).
  • the electronic device 200 may further include a positioning device, a flash, a micro-projection device, etc., which will not be repeated here.
  • the hardware structure of the electronic device 300 may include more or less components than the electronic device 200 shown in FIG. 2b, or some components may be combined, or some components may be split, or different component arrangements.
  • the mobile device 100 includes, but is not limited to, a Bluetooth headset, a wearable electronic device with a wireless communication function (such as a smart watch, a smart bracelet, a smart ring, and smart glasses).
  • the electronic device 200 may include, but is not limited to, a smart phone, a smart TV (smart large screen), a tablet computer, and the like.
  • Any one of the electronic device 300 or the electronic device 400 may include, but is not limited to, a smart phone, a smart TV (smart TV), a router, a smart speaker, a smart air conditioner, a tablet computer, and the like.
  • the software operating system of any one of mobile device 100, electronic device 200, electronic device 300, and electronic device 400 may include, but is not limited to: Windows, Linux or other operating systems.
  • the structure shown in FIG. 2 b does not constitute a specific limitation on the electronic device 200 .
  • the electronic device 200 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • FIG. 3a exemplarily shows a flow of a communication method provided by an embodiment of the present application.
  • the mobile device 100 is an earphone
  • the electronic device 200 is a mobile phone
  • the electronic device 300 is a smart speaker
  • the electronic device 400 is a smart TV.
  • the electronic device 200 in this embodiment of the present application may be the first electronic device in the foregoing content
  • the electronic device 300 may be the second electronic device in the foregoing content
  • the electronic device 400 may be the third electronic device in the foregoing content.
  • the mobile device 100 may be a mobile device in the foregoing.
  • the method includes:
  • connection between the earphone and the mobile phone is a point-to-point direct connection.
  • a point-to-point connection can be established between the headset and the mobile phone based on technologies such as Bluetooth (bluetooth, BT), wireless fidelity (wireless fidelity, Wi-Fi) P2P, ZigBee, and the like.
  • the mobile phone may send a first notification message to the smart TV, where the first notification message may include a mobile phone identification (ID), an earphone ID, and first notification information for establishing a point-to-point direct connection between the mobile phone and the earphone.
  • ID mobile phone identification
  • earphone ID an earphone ID
  • first notification information for establishing a point-to-point direct connection between the mobile phone and the earphone.
  • the ID of the headset may include, for example, at least one of a media access control (Medium access control, MAC) address, a device name, a combination of an IP address and a port number, and the like.
  • the ID of the mobile phone may include, for example, at least one of a media access control (medium access control, MAC) address, a device name, a combination of an IP address and a port number, and the like.
  • the first notification message may further include a protocol used to indicate that a point-to-point direct connection is established between the mobile phone and the headset. For example, if the mobile phone and the headset are connected via Bluetooth, the first notification The message may also include indication information for indicating that the point-to-point direct connection between the mobile phone and the headset is based on the Bluetooth protocol. The first notification message may further include indication information for indicating that there is a Bluetooth pairing relationship between the mobile phone and the headset.
  • the first notification message may further include information about the ongoing service of the mobile phone, such as a service identifier (such as playing music), service status (such as currently in progress), and the like.
  • a service identifier such as playing music
  • service status such as currently in progress
  • the smart TV can be used as a central device.
  • all devices in the same local area network as the central device can register on the central device, and report some information about themselves to the central device (such as ID, the ID of the device that has a pairing relationship with the device itself, The current connection relationship with other devices, the business performed by the device itself, etc.).
  • ID the ID of the device that has a pairing relationship with the device itself
  • the current connection relationship with other devices the business performed by the device itself, etc.
  • a mobile phone, a smart TV and a smart speaker are in the same local area network.
  • the mobile phone and the smart speaker report their own information to the smart TV respectively.
  • the smart speaker can also report to the smart TV the identity of the device that has a pairing relationship with the smart speaker.
  • the mobile phone sends audio data to the headset.
  • Users can operate on the mobile phone to start a business (such as playing music) on the mobile phone.
  • a business such as playing music
  • the mobile phone receives an input from the user, in response to the input, the service of playing music can be started, and the audio data corresponding to the music can be sent to the mobile phone, so that the user can listen to the music played on the mobile phone through the earphone.
  • the user may have performed operations before S301, such as touching the touch screen or button of the mobile phone to start the service of playing music.
  • S301 headset when the connection is established between the S301 headset and the mobile phone, there are two possible implementations: one is to play music through the headset by default; the other is to pop up a prompt, such as "whether to play audio through the headset or not. ?", the user operates on the mobile phone, the user clicks "Yes", and the mobile phone confirms that the audio data of the music is played through the headset based on the input.
  • S302 and the above S303 do not have an absolute sequence, for example, S303 may be executed first, and then S302 may be executed.
  • the headset plays according to the received audio data.
  • the user can listen to the music played on the mobile phone through the earphone.
  • the distance between the earphone and the mobile phone gradually increases, so the situation in which the earphone and the mobile phone port are connected in S305 may occur.
  • the mobile phone sends a second notification message to the smart TV, where the second notification message includes the mobile phone ID, the headset ID, and indication information used to instruct the mobile phone to disconnect from the headset.
  • the mobile phone after detecting that the mobile phone and the headset are disconnected from the point-to-point direct connection, the mobile phone pauses to play the audio data, and records a first pause mark. In another possible implementation manner, the mobile phone continues to play the audio data through a speaker of the mobile phone.
  • the headset broadcasts the first request message.
  • the first request message may include the ID of the headset.
  • the headset may move near the smart speaker, causing the smart speaker to perform S308.
  • the smart speaker receives the first request message from the headset.
  • the smart speaker in S308 can receive the signal from the earphone, it can reflect that the earphone is within the range of the location where the connection can be established with the smart speaker, and the smart speaker has the ability to establish a connection with the earphone.
  • the headset may periodically broadcast the first request message.
  • the first request message may include the ID of the earphone, and when the smart speaker receives the information, it determines that the earphone has moved within the range of a location area where a connection can be established with the smart speaker.
  • the smart speaker can discover the headset through a Bluetooth discovery process.
  • the headset periodically sends a Bluetooth identification packet of the headset (the Bluetooth identification packet of the headset may include the ID of the headset).
  • the smart speaker can periodically send the Bluetooth identification message of the smart speaker (the Bluetooth identification message of the smart speaker can include the ID of the smart speaker, and the ID of the smart speaker can be, for example, the MAC address of the smart speaker, device name, etc.).
  • the headset When the headset receives the Bluetooth identification message of the smart speaker, it sends a response message to the smart speaker (the response message can be an FHS message, and the response message can be the first request message above), and when the smart speaker receives the response message , it is determined that the headset is discovered by Bluetooth.
  • the response message can be an FHS message, and the response message can be the first request message above
  • connection between the earphone and the smart speaker is a point-to-point direct connection.
  • a point-to-point connection can be established between the headset and the smart speaker based on BT, Wi-Fi P2P, ZigBee and other technologies.
  • the headset may establish a point-to-point direct connection with the smart speaker; the first response message and the first response message associated with a request message.
  • the smart speaker may send a first notification message to the smart TV, where the first notification message may include the smart speaker identification (ID), the earphone ID, and the first notification information for establishing a point-to-point direct connection between the smart speaker and the earphone.
  • the first notification message may include the smart speaker identification (ID), the earphone ID, and the first notification information for establishing a point-to-point direct connection between the smart speaker and the earphone.
  • the ID of the smart speaker may include, for example, at least one of a media access control (medium access control, MAC) address, a device name, a combination of an IP address and a port number, and the like.
  • media access control medium access control, MAC
  • the first notification message may also include a protocol used to indicate that a point-to-point direct connection is established between the smart speaker and the headset. For example, if the smart speaker and the headset are connected via Bluetooth, the first A notification message may also include indication information for indicating that the point-to-point direct connection between the smart speaker and the headset is based on the Bluetooth protocol. The first notification message may also include indication information for indicating that the smart speaker and the headset have a Bluetooth pairing relationship.
  • the first notification message may also include the value of the received signal strength indicator (RSSI) of the signal (such as the FHS message) of the earphone received by the smart speaker.
  • RSSI received signal strength indicator
  • the value of the RSSI reflects the proximity between the smart speaker and the headset, or can be described as reflecting the distance between the smart speaker and the headset through the RSSI value. When the value of RSSI is small, it means that the distance between the smart speaker and the headset is farther, and when the value of RSSI is large, it means that the distance between the smart speaker and the headset is short.
  • the smart TV after receiving the first notification message, the smart TV can determine the ID of the device recently disconnected from the headset in the first notification message, thereby obtaining the ID of the mobile phone.
  • the smart TV may determine the IDs of one or more devices that have a pairing relationship with the ID of the headset in the first notification message (which will include the ID of the phone).
  • the smart TV can only send the first message to the device (mobile phone) that has recently been disconnected from the headset, or can send the first message to at least one of the determined one or more devices that have a pairing relationship with the headset ID in the first notification message.
  • a first message is sent so that one or more of these devices can share the headset through the smart speaker.
  • the smart TV sends the first message to a plurality of devices, the subsequent process performed by each device is similar to the subsequent process performed by the mobile phone, and reference may be made to the subsequent related content of S312 to S320.
  • the smart TV sends a first message to the mobile phone according to the determined ID of the mobile phone, and the first message may include the identification (ID) of the smart speaker, the ID of the headset, and the direct connection between the smart speaker and the headset to establish a point-to-point connection. Connection instructions.
  • the first message may also include a protocol used to indicate that a point-to-point direct connection is established between the smart speaker and the headset. For example, if the smart speaker and the headset are connected via Bluetooth, the first message The message may also include indication information for indicating that the point-to-point direct connection between the smart speaker and the headset is based on the Bluetooth protocol. The first message may also include indication information for indicating that there is a Bluetooth pairing relationship between the smart speaker and the headset.
  • the mobile phone receives the first message from the smart TV.
  • the mobile phone determines whether the ID of the headset in the first message is one of the IDs of one or more headsets that have a pairing relationship with the mobile phone.
  • S315 is performed; if the mobile phone and the smart speaker are connected to the local area network and the UDP protocol is used, then the S316 is performed.
  • the mobile phone stores an ID of a device that has a pairing relationship with the mobile phone. Your phone may be paired with one or more devices.
  • the pairing relationship between the two devices in the embodiments of the present application may mean that the two devices have an authentication relationship. It can be understood that the two devices have a successful mutual authentication relationship.
  • the pairing relationship can be It is a Bluetooth pairing relationship based on Bluetooth technology.
  • the mobile phone can determine whether an audio playback service (such as a music playback service) is currently suspended (for example, in the aforementioned S303, the music on the mobile phone is played through the headset, and when the headset is disconnected from the mobile phone) After, this music playing service is suspended); And need to judge whether the ID of the equipment used to play the audio data of this audio playing service before is the same as the ID of the headset in the first message, if judged, there is currently audio playing The service (such as the music playing service) is suspended, and the ID of the device used to play the audio data of the audio playing service is the same as the ID of the earphone in the first message, then execute S315 or S316. Otherwise, end the process.
  • an audio playback service such as a music playback service
  • the mobile phone can determine whether the audio playback service is currently being performed (for example, the music on the mobile phone is played through the earphone in the aforementioned S303, and when the earphone is disconnected from the mobile phone, the music playback service is not performed. be suspended, but play music through the loudspeaker of the mobile phone itself); and need to judge whether the ID of the device used to play the audio data of this audio playback service before is the same as the ID of the headset in the first message, if it is judged, There is an audio playing service currently being performed, and the ID of the device used to play the audio data of the audio playing service before is the same as the ID of the headset in the first message, then execute S315 or S316. Otherwise, end the process.
  • the audio playback service for example, the music on the mobile phone is played through the earphone in the aforementioned S303, and when the earphone is disconnected from the mobile phone, the music playback service is not performed. be suspended, but play music through the loudspeaker of the mobile phone itself
  • S314 there may be a step in S314 and the aforementioned S311.
  • S311 may be omitted.
  • the smart TV may broadcast or multicast the first message in the local area network, so that the mobile phone receives the first message.
  • S314 may also be replaced with the following implementation manner, in which the mobile phone receives a message from a smart speaker or a smart TV. Whether the message is the first message (that is, whether it meets the preset requirements of the first message) is determined in the following manner, and if it is the first message, the mobile phone sends audio data to the smart speaker. In one possible implementation manner, the mobile phone may determine that the message is the first message after acquiring the identifier of the headset from the message. In another possible implementation manner, the mobile phone may determine that the message is the first message after acquiring the identifier of the earphone and the identifier of the smart speaker from the message.
  • the mobile phone can obtain the identifier of the earphone, the identifier of the smart speaker, and the point-to-point direct connection between the earphone and the smart speaker from the message. After indicating the information, it is determined that the message is the first message.
  • the connection between the mobile phone and the smart speaker may be established based on any one of the following technologies: wireless local area networks (WLAN), wireless fidelity (Wi-Fi), global mobile communication System (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access) , WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), global satellite navigation system and global navigation satellite system (global navigation satellite system, GNSS), long term evolution (long term evolution, LTE) , the fourth generation mobile network (the 4th generation, 4G), the fifth generation mobile network (the 5th generation, 5G), and the future sixth generation mobile network (the 6th generation, 6G) and so on.
  • WLAN wireless local area networks
  • Wi-Fi wireless fidelity
  • GSM global system for mobile communications
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS)) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system, GLONASS
  • Beidou navigation satellite system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system, QZSS)
  • SBAS satellite based augmentation systems
  • mobile phones and smart speakers can be connected to the same local area network by connecting to the same router.
  • the mobile phone may send a request message to the smart speaker.
  • the request message is used to request to share the headset.
  • the smart speaker may directly send an acceptance message to the mobile phone, where the acceptance message is used to indicate that the mobile phone and the smart speaker are allowed to share the headset.
  • the smart speaker may display prompt information on the interface of the smart speaker, for example, displaying on the interface of the smart speaker: "Do you want to share the headset with your mobile phone?". The user can operate on the interface of the smart speaker to input information. If the input information is used to indicate that the mobile phone and the smart speaker are allowed to share the headset, the smart speaker sends an acceptance message to the mobile phone, which is used for Instructs the smart speaker to allow sharing of the headset with the headset.
  • the mobile phone may send a notification message to the smart speaker, and the notification message may be used to notify the smart speaker to forward the data received from the mobile phone to the headset.
  • the notification message is used to notify the smart speaker to establish a correspondence between two connections (that is, the connection between the smart speaker and the headset, and the connection between the smart speaker and the mobile phone) (it can also be understood that In order to bind the two channels), after the subsequent smart speaker receives the data from the mobile phone, it will forward the data to the headset.
  • the mobile phone may also send a notification message to the smart TV to notify the smart TV that a connection is currently established between the mobile phone and the smart speaker.
  • the notification message may include the ID of the smart speaker connected to the phone.
  • the notification message may further include: at least one of indication information used to instruct the mobile phone to establish a connection with the smart speaker or an ID of the mobile phone.
  • the notification message may further include a manner for instructing to establish a connection between the mobile phone and the smart speaker, such as a connection established based on Wi-Fi.
  • the notification message may also include relevant information about the ongoing service of the mobile phone, such as a service identifier (such as playing music), service status (such as currently in progress), and the like.
  • the mobile phone sends audio data to the smart speaker.
  • the mobile phone pauses to play the audio data, and The first pause mark is recorded.
  • the mobile phone sends all or part of the audio data following the first pause mark to the smart speaker.
  • the mobile phone after the mobile phone is disconnected from the headset in S305, the mobile phone continues to play the audio data through the speaker of the mobile phone.
  • the mobile phone in response to the first message, the mobile phone no longer continues to play through the speaker, but sends all or part of the unplayed content of the audio data to the smart speaker.
  • the audio data sent by the mobile phone to the smart speaker may include a destination address.
  • the destination address is the address of the smart speaker.
  • the smart speaker receives the audio data, it forwards it to the headset.
  • the audio data sent by the mobile phone to the smart speaker may include two destination addresses, one of which is the address of the smart speaker, and the other destination address is the address of the headset.
  • the location of the address of the headset in the data needs to be negotiated between the mobile phone and the smart speaker, so that the smart speaker can resolve the address of the headset at the preset location.
  • the application layer of the mobile phone shows that the connection is established between the mobile phone and the headset, that is, for the application layer, the mobile phone knows that it has established a connection with the headset. In this case, audio can be output through headphones by default.
  • the application layer does not care.
  • the smart speaker forwards the audio data from the mobile phone to the headset.
  • the received audio data can be played through the earphone by default.
  • a correspondence between two connections that is, the connection between the smart speaker and the headset, and the connection between the smart speaker and the mobile phone
  • a correspondence between two connections can be established based on the notification message of the mobile phone, and further according to the correspondence relationship, and forward the audio data received from the mobile phone to the headset.
  • the headset plays according to the received audio data.
  • the earphone plays all or part of the unplayed content of the audio data.
  • FIG. 3a exemplarily shows an example of disconnection between the mobile phone and the smart speaker through S319 to S321.
  • connection between the smart speaker and the headset may be disconnected.
  • the headset may continue to broadcast the second request message to connect other devices with the headset.
  • the second request message includes the identification of the headset and a point-to-point direct connection request.
  • the smart speaker may also send a notification message to the smart TV to notify the smart TV that the smart speaker is currently disconnected from the headset.
  • the notification message may include the ID of the headset disconnected from the smart speaker.
  • the notification message may further include: at least one of indication information for indicating disconnection between the smart speaker and the headset and an ID of the smart speaker.
  • the notification message may further include a method for indicating the disconnection between the smart speaker and the headset; for example, the connection may be disconnected based on Bluetooth.
  • the smart speaker sends a second notification message to the mobile phone, where the second notification message includes instruction information for indicating disconnection between the smart speaker and the earphone.
  • the smart TV after receiving the instruction information reported by the smart speaker for indicating that the smart speaker is disconnected from the earphone, the smart TV notifies the mobile phone of the disconnection between the smart speaker and the earphone.
  • the mobile phone may also send a notification message to the smart TV to notify the smart TV that the mobile phone is currently disconnected from the smart speaker.
  • the notification message may include the ID of the smart speaker disconnected from the phone.
  • the notification message may further include: at least one of indication information for indicating disconnection between the mobile phone and the smart speaker and an ID of the mobile phone.
  • the notification message may further include a method for instructing the disconnection between the mobile phone and the smart speaker, for example, the disconnection may be based on Wi-Fi.
  • the notification message may also include relevant information about the ongoing service of the mobile phone, such as a service identifier (such as playing music), service status (such as currently in progress), and the like.
  • the mobile phone and the smart speaker are in the same local area network, and the mobile phone and the smart speaker are connected through a router.
  • the above S315 and S321 are not necessary, and S315 and S321 are shown as dotted lines in the figure.
  • TCP transmission control protocol
  • IP Internet protocol
  • S315 and S321 are shown as dotted lines in the figure.
  • TCP transmission control protocol
  • IP Internet protocol
  • S315 and S321 are shown as dotted lines in the figure.
  • TCP transmission control protocol
  • IP Internet protocol
  • connection between the mobile phone and the smart speaker needs to be disconnected through S321.
  • connection between for another example, when based on the user datagram protocol (UDP) protocol, there is no need to establish a connection through S315.
  • UDP user datagram protocol
  • the mobile phone can send audio data to the smart speaker through the router;
  • the mobile phone does not need to send audio data to the smart speaker, it does not need to be disconnected through the above S321.
  • a cell phone receives an input that instructs to stop playing audio data through the headset. Users can operate on the phone to disconnect the connection between the phone and the smart speaker. For example, in a possible implementation, the user inputs an operation on the mobile phone: selecting the audio output mode of the mobile phone to play audio data through the mobile phone, based on the input, the mobile phone can determine that the audio data does not need to be played through the headset, and the mobile phone and the smart The speakers are disconnected.
  • the mobile phone when the connection between the mobile phone and the smart speaker is disconnected, the mobile phone may pause to play the audio data, and record a second pause mark. Alternatively, the mobile phone may continue to play the audio data through the speaker.
  • a connection when a connection is established between the smart speaker and the headset, it can also be reported to the smart TV.
  • the smart speaker and the mobile phone can also report to the smart TV.
  • the connection between the smart speaker and the headset is disconnected, it can also be reported to the smart TV.
  • the smart speaker is disconnected from the mobile phone, it can also report to the smart TV.
  • the mobile phone that has recently been disconnected from the headset can be found, and the ID of the headset can be sent to the mobile phone. and the ID of the smart speaker, so that the mobile phone can establish an indirect connection between the smart speaker and the headset, and can continue to play audio data through the headset.
  • Fig. 3b exemplarily shows the flow of another possible communication method on the basis of Fig. 3a.
  • S301 to S308 can refer to the content shown in Fig. 3a.
  • S309 is executed to realize the point-to-point direct connection between the smart speaker and the headset, while in Fig. 3b Then S309 is not executed after S308, but S3101 is executed.
  • the smart speaker sends a first notification message to the smart TV, where the first notification message may include a smart speaker identification (ID), an earphone ID, and indication information for indicating that the smart speaker has found the earphone.
  • ID smart speaker identification
  • earphone ID an earphone ID
  • indication information for indicating that the smart speaker has found the earphone.
  • S3101 the difference between S3101 and S310 is that the first notification message in S3101 carries the instruction information used to indicate that the smart speaker has discovered the headset.
  • the first notification message may further include indication information for indicating that there is a Bluetooth pairing relationship between the smart speaker and the headset.
  • the first notification message may further include indication information for indicating that the smart speaker Bluetooth has discovered the headset.
  • the first notification message may also include the value of the received signal strength indicator (RSSI) of the signal (such as the FHS message) of the earphone received by the smart speaker.
  • RSSI received signal strength indicator
  • the value of the RSSI reflects the proximity between the smart speaker and the headset, or can be described as reflecting the distance between the smart speaker and the headset through the RSSI value. When the value of RSSI is small, it means that the distance between the smart speaker and the headset is farther, and when the value of RSSI is large, it means that the distance between the smart speaker and the headset is short.
  • the smart TV determines the ID of the mobile phone recently disconnected from the headset in the first notification message.
  • the smart TV sends a first message to the mobile phone according to the determined ID of the mobile phone.
  • the first message may include a smart speaker identification (ID), an earphone ID, and indication information for indicating that the smart speaker has found the earphone.
  • ID smart speaker identification
  • earphone ID an earphone ID
  • indication information for indicating that the smart speaker has found the earphone.
  • S3121 the difference between S3121 and S312 is that the first message in S3121 carries the indication information used to indicate that the smart speaker has discovered the headset.
  • the mobile phone receives the first message from the smart TV.
  • the mobile phone determines whether the ID of the headset in the first message is one of the IDs of one or more headsets that have a pairing relationship with the mobile phone.
  • the smart speaker executes S309 after S315 or S316 to establish a point-to-point direct connection with the headset.
  • S309 after S315 is taken as an example for illustration.
  • the smart speaker after discovering the earphone, the smart speaker does not establish a connection with the earphone first, and establishes a connection with the earphone after establishing a connection with the mobile phone through S315, that is, the smart speaker determines that it exists
  • the connection with the headset is established only when there is a demand for establishing a headset (that is, the mobile phone needs to send audio data to the headset through the smart speaker), and a connection with the headset can not be established when there is no need to establish a headset.
  • the number of times a connection is established between the speaker and the headset reducing power consumption.
  • each step in FIG. 3b is the same as that of each step in FIG. 3a, and details are not repeated here.
  • Figures 4a and 4b exemplarily show flow charts of two other communication methods, respectively, and Figures 4a and 4b are no longer set as the central device (electronic device 400).
  • the method includes:
  • P2P peer-to-peer
  • FIG. 3a The difference from FIG. 3a is that since the central node is not set, after S401, the mobile phone is not required to report the information, that is, S302 in the above-mentioned FIG. 3a does not need to be performed.
  • the mobile phone sends audio data to the headset.
  • the headset plays the audio data according to the received audio data.
  • the headset broadcasts a first request message, where the first request message includes the headset ID.
  • the smart speaker receives the first request message from the headset.
  • the difference from Figure 3a is that since the central node is not set, after S407, the smart speaker does not need to report information, that is, it is not necessary to perform S410, S411, and S412 in the above Figure 3a.
  • the smart TV determines the ID of the mobile phone, Send a first message to the mobile phone, where the first message includes the ID of the headset connected to the smart speaker and the ID of the smart speaker.
  • the smart speaker may send a first message by broadcasting or multicasting, where the first message includes the ID of the earphone connected to the smart speaker.
  • the first message may include the ID of the earphone, the ID of the smart speaker, and indication information for instructing the connection between the smart speaker and the earphone.
  • the smart speaker can broadcast or multicast the first message in the local area network.
  • the first message may include a smart speaker identification (ID), an earphone ID, and instruction information for instructing the smart speaker to establish a point-to-point direct connection with the earphone.
  • ID smart speaker identification
  • earphone ID an earphone ID
  • instruction information for instructing the smart speaker to establish a point-to-point direct connection with the earphone.
  • the first message may also include a protocol used to indicate that a point-to-point direct connection is established between the smart speaker and the headset. For example, if the smart speaker and the headset are connected via Bluetooth, the first message The message may also include indication information for indicating that the point-to-point direct connection between the smart speaker and the headset is based on the Bluetooth protocol. The first message may also include indication information for indicating that there is a Bluetooth pairing relationship between the smart speaker and the headset.
  • the first message may also include a received signal strength indicator (received signal strength indicator, RSSI) value of the earphone signal (such as an FHS message) received by the smart speaker.
  • RSSI received signal strength indicator
  • the value of RSSI reflects the proximity between the smart speaker and the headset, or it can be described as reflecting the distance between the smart speaker and the headset through the value of RSSI. When the value of RSSI is small, it means that the distance between the smart speaker and the headset is farther, and when the value of RSSI is large, it means that the distance between the smart speaker and the headset is short.
  • the mobile phone when the mobile phone and the smart speaker are in the same local area network, the mobile phone can receive the first message.
  • the smart speaker can find out the identifiers of the devices that have an authentication relationship with the headset, and send the first message to one or more devices (including mobile phones) that have an authentication relationship with the headset.
  • the smart speaker may be preconfigured with an identifier of an electronic device that has an authentication relationship with the headset, or the smart speaker may query the identifier of an electronic device that has an authentication relationship with the headset from a central device (such as the electronic device 400 ).
  • the mobile phone receives the first message from the smart TV.
  • the mobile phone determines whether the ID of the headset in the first message is one of the IDs of one or more headsets that have a pairing relationship with the mobile phone.
  • the mobile phone sends audio data to the smart speaker.
  • the smart speaker forwards the audio data from the mobile phone to the earphone.
  • the headset plays the audio data according to the received audio data.
  • connection between the smart speaker and the headset may be disconnected.
  • the smart speaker sends a second notification message to the mobile phone, where the second notification message includes instruction information for indicating disconnection between the smart speaker and the earphone.
  • a cell phone receives an input that instructs to stop playing audio data through the headset. Users can operate on the phone to disconnect the connection between the phone and the smart speaker. For example, in a possible implementation, the user inputs an operation on the mobile phone: selecting the audio output mode of the mobile phone to play audio data through the mobile phone, based on the input, the mobile phone can determine that the audio data does not need to be played through the headset, and then the mobile phone and the Disconnect between smart speakers.
  • the mobile phone and the smart speaker are in the same local area network, and the mobile phone and the smart speaker are connected through a router.
  • the above S411 and S417 are not necessary, and S411 and S417 are shown as dotted lines in the figure. For the reason, reference may be made to the relevant contents of the aforementioned S315 and S321, which will not be repeated here.
  • the ID is the ID of a headset that has a pairing relationship with the mobile phone, and the mobile phone establishes an indirect connection between the smart speaker and the headset, and can continue to play audio data through the headset.
  • Fig. 4b exemplarily shows the flow of another possible communication method on the basis of Fig. 4a.
  • S401 to S406 can refer to the content shown in Fig. 4a.
  • S407 is executed to realize the point-to-point direct connection between the smart speaker and the headset.
  • the S407 is not executed after S406, but S4081 is executed.
  • the smart speaker broadcasts or multicasts a first message, where the first message includes the ID of the earphone, the ID of the smart speaker, and indication information for indicating that the smart speaker has discovered the earphone.
  • S4081 the difference between S4081 and S408 is that the first message in S4081 carries the instruction information for indicating that the smart speaker has discovered the headset.
  • the first message may carry indication information used to instruct the smart speaker to receive the first request message of the headset, the ID of the headset, the ID of the smart speaker, and the like. to notify other devices that the headset is in a location area where a connection to the smart speaker can be established.
  • the mobile phone receives the first message from the smart speaker.
  • the first message may include a smart speaker identification (ID), an earphone ID, and indication information for indicating that the smart speaker has discovered the earphone.
  • ID smart speaker identification
  • earphone ID an earphone ID
  • indication information for indicating that the smart speaker has discovered the earphone.
  • the first message may further include indication information for indicating that there is a Bluetooth pairing relationship between the smart speaker and the headset.
  • the first message may also include a received signal strength indicator (received signal strength indicator, RSSI) value of the earphone signal (such as an FHS message) received by the smart speaker.
  • RSSI received signal strength indicator
  • the value of RSSI reflects the proximity between the smart speaker and the headset, or it can be described as reflecting the distance between the smart speaker and the headset through the value of RSSI. When the value of RSSI is small, it means that the distance between the smart speaker and the headset is farther, and when the value of RSSI is large, it means that the distance between the smart speaker and the headset is short.
  • the mobile phone determines whether the ID of the headset in the first message is one of the IDs of one or more headsets that have a pairing relationship with the mobile phone.
  • the smart speaker executes S407 to establish a point-to-point direct connection with the headset.
  • the smart speaker after discovering the earphone, the smart speaker does not establish a connection with the earphone first, and establishes a connection with the earphone after establishing a connection with the mobile phone through S415, that is, the smart speaker determines that it exists
  • the connection with the headset can be established only when there is a demand for establishing a headset (that is, the mobile phone needs to send audio data to the headset through the smart speaker), and a connection with the headset can not be established when there is no demand for establishing a headset, thereby reducing smart The number of times a connection is established between the speaker and the headset, reducing power consumption.
  • FIG. 5 exemplarily shows the establishment of a point-to-point connection between the mobile phone and the headset in the communication method provided by the embodiment of the present application.
  • the method flow of the direct connection As shown in Figure 5, the method includes:
  • the earphone sends a Bluetooth identification packet of the earphone.
  • the mobile phone receives the Bluetooth identification packet of the headset, and sends the Bluetooth identification packet of the mobile phone as a response.
  • the mobile phone sends a Bluetooth frequency hop synchronization (frequency hop synchronization, FHS) message.
  • FHS frequency hop synchronization
  • the mobile phone and the headset can perform clock synchronization and baseband connection based on each other's Bluetooth identification message and FHS message, so as to change the Bluetooth communication state from the connectable state to the connected state.
  • a Bluetooth device (a device with a Bluetooth module, such as a mobile phone and a headset) establishes a connection, it quickly exchanges handshakes by selecting a frequency hopping frequency in a fixed frequency band or determined by the address of the device being queried. Information time and address, quickly obtain the time and frequency synchronization of the device. After the connection is established, both devices change the frequency according to the channel hopping sequence, so that the frequency hopping frequency presents random characteristics.
  • the connection between two Bluetooth devices may be initiated by a query message sent by a certain query device (which may be, for example, a headset) to search for other devices in the vicinity. Any other Bluetooth device (such as a mobile phone) that listens by performing an inquiry scan will recognize this inquiry message and respond.
  • the response to the query message may be a frequency hopping synchronization (FHS) packet, which contains all the information required by the query device to address the response device. This information includes the sender's (ie, responding device's) clock value, the sender's correct device access code, and a Class of Device (CoD) field.
  • FHS packets contain more information than mentioned here.
  • the access code contains the lower address part (LAP) and upper address part (UAP) of the sender's Bluetooth device address (BD_ADDR), wherein the Bluetooth device address is an electronically engraved on each Bluetooth device The unique 48-bit IEEE address.
  • a Bluetooth link manager protocol (link manager protocol, LMP) process interaction is performed between the mobile phone and the headset.
  • LMP Bluetooth link manager protocol
  • the link manager in each Bluetooth device can negotiate the available capabilities with the Bluetooth air interface through the link manager protocol. These capabilities may include bandwidth allocated to support the required class of service for data services, and periodic reserved bandwidth to support audio services.
  • the LMP is responsible for the establishment of connections between Bluetooth devices. When a Bluetooth device transmits data, LMP will negotiate and control the size of the data packet. The LMP also manages power consumption and controls the state of the Bluetooth device. LMP also has the function of generating keys required for authentication and encryption.
  • the mobile phone queries the services that the headset can support based on the Bluetooth service discovery protocol (Service Discovery Protocol, SDP).
  • SDP Service Discovery Protocol
  • Services play a vital role in the Bluetooth technology framework and are the basis for all user modes.
  • any two or more devices may suddenly start communicating on the Bluetooth link. If these devices are to be used to provide services to each other, a more flexible method of finding the location of these services is required. If a communication channel is established, the next step in a device's communication should be to find out the services that the device can use.
  • SDP can define a standard method so that certain Bluetooth devices can discover and learn the services provided by other devices.
  • the Bluetooth Service Discovery Protocol is specifically designed to be used in the context of Bluetooth wireless communication to achieve its functionality in an efficient and optimal manner.
  • the mobile phone sends service data through a Bluetooth connection according to the services supported by the headset.
  • the headset may support listening to music services, such as advanced audio distribution profile (A2DP) services. Users can listen to the music played on the phone through the headset.
  • A2DP advanced audio distribution profile
  • the headset connects to the Bluetooth service according to the services supported by the headset, for example, the A2DP service can be connected, or the Bluetooth connection is performed based on the Bluetooth A2DP service, so as to provide the user with a music service.
  • the process of establishing a Bluetooth connection between the smart speaker and the earphone can be referred to as shown in FIG.
  • FIG. 6 exemplarily shows the process of disconnecting the Bluetooth connection between the mobile phone and the headset in the communication method provided by the embodiment of the present application. As shown in Figure 6, the method includes:
  • the mobile phone after a Bluetooth connection is established between the mobile phone and the headset, the mobile phone periodically sends a Bluetooth PULL message through the Bluetooth connection.
  • the headset For each PULL message received, the headset responds with a NULL message through the Bluetooth connection.
  • the mobile phone periodically sends a Bluetooth PULL message, and the headset sends a Bluetooth NULL message as a response after receiving the Bluetooth PULL message. If the Bluetooth connection between the mobile phone and the headset fails, the Bluetooth PULL message sent by the mobile phone will be lost, the headset cannot receive the Bluetooth PULL message, and the headset will not respond to the Bluetooth NULL message.
  • the mobile phone can judge whether the Bluetooth connection is disconnected through S3052.
  • the headset can judge whether the Bluetooth connection is disconnected through S3054.
  • the mobile phone determines whether "the NULL message has not been received within the first preset time period". If satisfied, execute S3053. If not, it means that the Bluetooth connection is not disconnected.
  • the mobile phone determines that the Bluetooth connection is disconnected.
  • the earphone determines whether "the PULL message has not been received within the second preset time period". If satisfied, execute S3055. If not, it means that the Bluetooth connection is not disconnected.
  • the second preset duration may be equal to or unequal to the first preset duration.
  • the headset determines that the Bluetooth connection is disconnected.
  • the process of disconnecting the Bluetooth connection between the smart speaker and the headset can be referred to as shown in FIG. 6, and will not be repeated.
  • FIG. 7 exemplarily shows a process of establishing a connection between a mobile phone and a smart speaker in the communication method provided by the embodiment of the present application. As shown in Figure 7, the process includes:
  • the mobile phone sends a connection establishment request to the smart speaker.
  • the smart speaker sends a connection establishment acceptance to the mobile phone.
  • the mobile phone sends the connection establishment to the smart speaker.
  • the mobile phone may establish a socket connection according to the IP address, port number, etc. of the smart speaker.
  • the smart speaker can listen for connection establishment requests from other devices through the socket server.
  • the above-mentioned S3151 to S3153 can be implemented by the three-way handshake of the transfer control protocol (transfer control protocol, TCP).
  • TCP transfer control protocol
  • FIG. 8 exemplarily shows a process of disconnection between a mobile phone and a smart speaker in the communication method provided by the embodiment of the present application. As shown in Figure 8, the method includes:
  • the mobile phone sends a first connection disconnection request to the smart speaker.
  • the smart speaker sends a first connection disconnection response to the mobile phone.
  • the smart speaker sends a second connection disconnection request to the mobile phone.
  • the mobile phone sends a second connection disconnection response to the smart speaker.
  • the mobile phone after the mobile phone is determined to be disconnected from the smart speaker, it can be disconnected from the smart speaker through the TCP four-time wave process.
  • the above S3211 is the first packet of the TCP four-time wave sent by the mobile phone (
  • FIG. 9 exemplarily shows the architecture of an end-to-end communication model across physical networks.
  • the audio data of the mobile phone can be sent to the router after passing through the application layer, network layer, link layer and physical layer in sequence.
  • the router After the router receives the audio data, it is transmitted from the physical layer to the link layer, and forwarded at the link layer according to the IP address and port of the smart speaker. Specifically, the router transmits the audio data to the IP address and port of the smart speaker. The physical layer is then sent to the smart speaker.
  • the smart speaker After the smart speaker receives the audio data, there are two implementation methods.
  • the smart speaker transmits the audio data from the physical layer to the link layer, and forwards the audio data at the link layer according to the IP address and port of the headset. Specifically, The smart speaker transmits audio data to the physical layer based on the IP address and port of the headset, and then sends it to the headset.
  • the smart speaker transmits audio data from the physical layer to the link layer, from the link layer to the network layer, and then parses it at the network layer and then transmits it to the link layer, and then transmits it from the link layer to the physical layer. and then sent to the headset. That is to say, after the smart speaker receives the audio data, it can complete the data transmission at the link layer or at the network layer.
  • the dotted lines in the figure illustrate some of the steps in the two methods.
  • the headset After the headset receives the audio data, it goes through the physical layer, the link layer, and the network layer in turn to reach the application layer, and then plays the audio data.
  • the data transmission between the mobile phone and the smart speaker in the embodiment of the present application may be transmitted within the WiFi subnet.
  • the transmission between the smart speaker and the headset can be transmitted within the BT subnet.
  • the communication methods provided in the embodiments of the present application are applicable to the following mobile devices and electronic devices.
  • FIG. 10 shows a mobile device 1000 provided by the present application.
  • mobile device 1000 includes at least one processor 1010 , memory 1020 and communication interface 1030 .
  • the processor 1010 is coupled to the memory 1020 and the communication interface 1030, and the coupling in this embodiment of the present application may be a communication connection, an electrical connection, or other forms.
  • the memory 1020 is used to store program instructions.
  • the processor 1010 is configured to invoke the program instructions stored in the memory 1020, so that the mobile device 1000 executes the steps performed by the mobile device in the communication method provided in the embodiment of the present application. It should be understood that the mobile device 1000 can be used to implement the communication method provided by the embodiment of the present application, and the relevant features can be referred to above, and details are not repeated here.
  • the present application provides a computer program product containing instructions, when the computer program product runs on a mobile device, the mobile device causes the mobile device to perform the steps performed by the mobile device in the communication method provided by the embodiments of the present application.
  • the present application provides a computer-readable storage medium, including instructions that, when the instructions are executed on a mobile device, cause the mobile device to perform the steps performed by the mobile device in the communication method provided by the embodiments of the present application.
  • the embodiments of the present application may be implemented in hardware, or in a manner of hardware and software.
  • the above-described functions can be stored in a computer-readable medium.
  • the medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
  • FIG. 11 shows an electronic device 1100 provided by the present application.
  • electronic device 1100 includes at least one processor 1110 , memory 1120 and communication interface 1130 .
  • the processor 1110 is coupled with the memory 1120 and the communication interface 1130, and the coupling in this embodiment of the present application may be a communication connection, an electrical connection, or other forms.
  • the memory 1120 is used to store program instructions.
  • the processor 1110 is configured to invoke the program instructions stored in the memory 1120, so that the electronic device 1100 executes the steps performed by the electronic device in the communication method provided in the embodiment of the present application. It should be understood that the electronic device 1100 can be used to implement the communication method provided by the embodiments of the present application, and the relevant features can be referred to above, and details are not repeated here.
  • the present application provides a computer program product containing instructions, when the computer program product runs on an electronic device, the electronic device is made to execute the communication method provided by the embodiment of the present application by the electronic device 200, the electronic device 300 or the electronic device. Steps performed by device 400 .
  • the present application provides a computer-readable storage medium, including instructions, which, when the instructions are executed on an electronic device, cause the electronic device to execute the electronic device 200 , the electronic device 300 or the electronic device in the communication method provided by the embodiments of the present application. Steps performed by device 400 .
  • the embodiments of the present application may be implemented in hardware, or in a manner of hardware and software.
  • the above-described functions can be stored in a computer-readable medium.
  • the medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application relates to a communication method, a mobile device, an electronic device, and a computer-readable storage medium. In the present application, a first electronic device establishes a point-to-point direct connection with a mobile device, and the first electronic device plays back audio data by means of the mobile device. After detecting that the point-to-point direct connection between the first electronic device and the mobile device has disconnected, the first electronic device receives a first message, the first message being used to indicate that the mobile device has established a point-to-point direct connection with a second electronic device. In response to the first message, the first electronic device sends to the second electronic device all or part of the content that has not been played back in the audio data. In the present application, after a connection between two electronic devices based on point-to-point direct connection technology is disconnected, an indirect connection is established by means of a third electronic device, thereby achieving service continuity.

Description

通信方法、移动设备、电子设备和计算机可读存储介质Communication method, mobile device, electronic device, and computer-readable storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求在2021年01月29日提交中国专利局、申请号为202110124316.1、申请名称为“通信方法、移动设备、电子设备和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on January 29, 2021 with the application number 202110124316.1 and the application name "communication method, mobile device, electronic device and computer-readable storage medium", the entire content of which is Incorporated herein by reference.
技术领域technical field
本申请涉及通信领域,尤其涉及一种通信方法、移动设备、电子设备和计算机可读存储介质。The present application relates to the field of communication, and in particular, to a communication method, a mobile device, an electronic device, and a computer-readable storage medium.
背景技术Background technique
随着移动互联应用的不断发展,点到点的直接连接技术得到极大的应用推广,比如蓝牙(bluetooth,BT)、无线高保真(wireless fidelity,Wi-Fi)对等式网络(peer-to-peer,P2P)等等,给用户带来极大的便利。比如无线蓝牙耳机,可以基于蓝牙技术与其他通信设备建立连接,摆脱了连接线的烦恼,广受好评。With the continuous development of mobile Internet applications, point-to-point direct connection technology has been greatly promoted, such as Bluetooth (bluetooth, BT), wireless fidelity (wireless fidelity, Wi-Fi) peer-to-peer network (peer-to- -peer, P2P), etc., bringing great convenience to users. For example, wireless bluetooth headsets can establish connections with other communication devices based on bluetooth technology, get rid of the trouble of connecting wires, and are widely praised.
但是在实际应用中,点到点的直接连接技术受到距离、具体环境中遮挡物的限制,从而会导致连接中断的问题发生。举个例子,蓝牙耳机与智能手机之间通过蓝牙建立点到点的直接连接,当用户戴着耳机移动至离智能手机较远的位置,或者智能手机与蓝牙耳机之间存在墙壁阻挡等(比如,智能手机放置在二楼,而用户本人戴着蓝牙耳机移动至一楼),会导致无线蓝牙耳机与智能手机之间的蓝牙连接断开,从而导致业务(比如音频数据传输)的中断。因此,当基于点到点的直接连接技术的两个电子设备断开连接后,如何实现业务的接续成为了亟需解决的问题。However, in practical applications, the point-to-point direct connection technology is limited by distance and obstacles in the specific environment, which will lead to the problem of connection interruption. For example, a point-to-point direct connection is established between a Bluetooth headset and a smartphone via Bluetooth, when the user moves with the headset to a location far away from the smartphone, or there is a wall blocking between the smartphone and the Bluetooth headset (such as , the smartphone is placed on the second floor, and the user himself wears a Bluetooth headset to move to the first floor), which will cause the Bluetooth connection between the wireless Bluetooth headset and the smartphone to be disconnected, resulting in interruption of services (such as audio data transmission). Therefore, when the two electronic devices based on the point-to-point direct connection technology are disconnected, how to realize service connection becomes an urgent problem to be solved.
发明内容SUMMARY OF THE INVENTION
为了解决上述的技术问题,本申请提供一种通信方法、移动设备、电子设备和计算机可读存储介质。本申请提供的技术方案,在基于点到点的直接连接技术的两个电子设备之间断开连接后,可以通过第三个电子设备建立间接的连接,且当该两个电子设备之间正在传输业务时,也可以通过新建立的连接实现业务的接续。In order to solve the above technical problems, the present application provides a communication method, a mobile device, an electronic device and a computer-readable storage medium. In the technical solution provided in this application, after the connection between two electronic devices based on the point-to-point direct connection technology is disconnected, an indirect connection can be established through a third electronic device, and when the transmission between the two electronic devices is ongoing During the service, the connection of the service can also be realized through the newly established connection.
第一方面,提供一种通信方法。该通信方法应用于第一电子设备。第一电子设备包括处理器和存储器。该方法中,所述第一电子设备与移动设备建立点到点的直接连接,所述第一电子设备通过所述移动设备播放音频数据。第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备暂停播放所述音频数据,并记录第一暂停标记;或者,第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据。第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,接收到第一消息,所述第一消息用于指示所述移动设备与第二电子设备建立了点到点的直接连接。第一电子设备响应于所述第一消息,所述第一电子设备向所述第二电子设备 发送第一暂停标记后续的音频数据的全部或部分;或者,第一电子设备响应于所述第一消息,所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。由于可以基于第一消息确定第二电子设备与移动设备建立连接,且该移动设备为与自身具有配对关系的设备,因此第一电子设备可以向第二电子设备发送音频数据,以使第二电子设备将音频数据发送给移动设备,从而可以当第一电子设备与移动设备之间断开连接后,第一电子设备可以通过第二电子设备与移动设备之间建立间接的连接。In a first aspect, a communication method is provided. The communication method is applied to the first electronic device. The first electronic device includes a processor and a memory. In this method, the first electronic device establishes a point-to-point direct connection with a mobile device, and the first electronic device plays audio data through the mobile device. After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses playing the audio data, and records a first pause mark; or, After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio data through the speaker of the first electronic device. After detecting that the first electronic device disconnects the point-to-point direct connection with the mobile device, the first electronic device receives a first message, where the first message is used to instruct the mobile device and the second electronic device The device establishes a direct point-to-point connection. In response to the first message, the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device; or, the first electronic device responds to the first electronic device. A message, the first electronic device does not continue to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device. Since it can be determined based on the first message that the second electronic device establishes a connection with the mobile device, and the mobile device is a device that has a pairing relationship with itself, the first electronic device can send audio data to the second electronic device, so that the second electronic device can send audio data to the second electronic device. The device sends audio data to the mobile device, so that after the first electronic device is disconnected from the mobile device, the first electronic device can establish an indirect connection with the mobile device through the second electronic device.
根据第一方面,又一种可能的实现方式中,在所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分之前,所述第一电子设备与所述第二电子设备建立网络连接。如此,第一电子设备可以通过与第二电子设备之间建立的连接发送音频数据。According to the first aspect, in another possible implementation manner, before the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device, the first electronic device communicates with the second electronic device. The second electronic device establishes a network connection. In this way, the first electronic device can transmit audio data through the connection established with the second electronic device.
根据第一方面,又一种可能的实现方式中,所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分之前,所述第一电子设备与所述第二电子设备建立网络连接。如此,第一电子设备可以通过与第二电子设备之间建立的连接发送音频数据。According to the first aspect, in another possible implementation manner, the first electronic device no longer continues to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device Before, the first electronic device establishes a network connection with the second electronic device. In this way, the first electronic device can transmit audio data through the connection established with the second electronic device.
根据第一方面,又一种可能的实现方式中,所述第一电子设备与所述第二电子设备建立网络连接;包括:所述第一电子设备与所述第二电子设备建立局域网连接。如此,第一电子设备和第二电子设备同处于同一个局域网内,可以使第二电子设备通过广播或组播的方式向第一电子设备发送消息,从而可以增加方案的灵活性。According to the first aspect, in another possible implementation manner, establishing a network connection between the first electronic device and the second electronic device includes: establishing a local area network connection between the first electronic device and the second electronic device. In this way, the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
根据第一方面,又一种可能的实现方式中,所述接收到第一消息包括:接收到来自第二电子设备或第三电子设备的一个消息。响应于所述消息,在从所述消息中获取到所述移动设备的标识后,确定所述消息为所述第一消息。根据第一方面,又一种可能的实现方式中,所述在从所述消息中获取到所述移动设备的标识后,确定所述消息为所述第一消息;包括:在从所述消息中获取到所述移动设备的标识和所述第二电子设备的标识后,确定所述消息为所述第一消息。根据第一方面,又一种可能的实现方式中,在从所述消息中获取到所述移动设备的标识,所述第二电子设备的标识,以及所述移动设备与所述第二电子设备建立了点到点的直接连接的指示信息后,确定所述消息为所述第一消息。如此,可以增多确定第一消息的方式,从而可以提高方案的灵活性。According to the first aspect, in another possible implementation manner, the receiving the first message includes: receiving a message from the second electronic device or the third electronic device. In response to the message, after the identification of the mobile device is acquired from the message, it is determined that the message is the first message. According to the first aspect, in another possible implementation manner, after the identification of the mobile device is acquired from the message, determining that the message is the first message; including: after obtaining the identifier of the mobile device from the message After the identification of the mobile device and the identification of the second electronic device are obtained in the device, it is determined that the message is the first message. According to the first aspect, in another possible implementation manner, the identification of the mobile device, the identification of the second electronic device, and the identification of the mobile device and the second electronic device are obtained from the message. After the indication information of the point-to-point direct connection is established, it is determined that the message is the first message. In this way, the ways of determining the first message can be increased, so that the flexibility of the scheme can be improved.
根据第一方面,又一种可能的实现方式中,在检测到所述第一电子设备与所述第二电子设备断开网络连接后,所述第一电子设备暂停播放所述音频数据,并记录第二暂停标记。如此,可以等待移动设备再次与第一电子设备之间建立连接后,实现业务的接续。According to the first aspect, in another possible implementation manner, after detecting that the first electronic device is disconnected from the second electronic device, the first electronic device pauses playing the audio data, and A second pause mark is recorded. In this way, it is possible to wait for the connection between the mobile device and the first electronic device to be established again, and then realize the service connection.
根据第一方面,又一种可能的实现方式中,在检测到所述第一电子设备与所述第二电子设备断开网络连接后。所述第一电子设备通过所述扬声器继续播放所述音频数据。如此,可以增加方案的灵活性。According to the first aspect, in another possible implementation manner, after it is detected that the first electronic device and the second electronic device are disconnected from the network. The first electronic device continues to play the audio data through the speaker. In this way, the flexibility of the scheme can be increased.
根据第一方面,又一种可能的实现方式中,在所述第一电子设备与移动设备建立点到点的直接连接后,所述第一电子设备向第三电子设备发送第一告知消息;所述第一告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备建立了点到点的直接连接的第一告知信息。如此,可以使第三电子设备作为中心设备及时的知道设备之间的连接情况。According to the first aspect, in another possible implementation manner, after the first electronic device establishes a point-to-point direct connection with the mobile device, the first electronic device sends a first notification message to the third electronic device; The first notification message includes an identification of the mobile device, an identification of the first electronic device, and first notification information that the mobile device has established a point-to-point direct connection with the first electronic device. In this way, the third electronic device can be used as the central device to know the connection situation between the devices in time.
根据第一方面,又一种可能的实现方式中,在所述第一电子设备与移动设备断开点到 点的直接连接后,所述第一电子设备向第三电子设备发送第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。如此,可以使第三电子设备作为中心设备及时的知道设备之间的连接情况。According to the first aspect, in another possible implementation manner, after the first electronic device disconnects the point-to-point direct connection with the mobile device, the first electronic device sends a second notification message to the third electronic device ; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the second notification information that the mobile device and the first electronic device have disconnected the point-to-point direct connection . In this way, the third electronic device can be used as the central device to know the connection situation between the devices in time.
根据第一方面,又一种可能的实现方式中,所述第一电子设备与所述第二电子设备接入同一局域网。如此,第一电子设备和第二电子设备同处于同一个局域网内,可以使第二电子设备通过广播或组播的方式向第一电子设备发送消息,从而可以增加方案的灵活性。According to the first aspect, in another possible implementation manner, the first electronic device and the second electronic device are connected to the same local area network. In this way, the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
根据第一方面,又一种可能的实现方式中,所述点到点的直接连接包括蓝牙连接、Wi-Fi P2P连接和ZigBee连接中的一种。如此,可以增加方案的灵活性。According to the first aspect, in another possible implementation manner, the point-to-point direct connection includes one of a Bluetooth connection, a Wi-Fi P2P connection, and a ZigBee connection. In this way, the flexibility of the scheme can be increased.
根据第一方面,又一种可能的实现方式中,所述第一电子设备为智能手机。According to the first aspect, in another possible implementation manner, the first electronic device is a smart phone.
第二方面,提供一种通信方法。该通信方法应用于移动设备。移动设备包括处理器和存储器。在该方法中,在检测到所述移动设备与所述第一电子设备断开点到点的直接连接后,所述移动设备广播第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。在接收到来自第二电子设备的第一响应消息后,所述移动设备与所述第二电子设备建立点到点的直接连接;所述第一响应消息与所述第一请求消息相关联。在接收到所述音频数据的未播放内容的全部或部分后,所述移动设备播放所述音频数据的未播放内容的全部或部分;所述音频数据的未播放内容的全部或部分来自所述第二电子设备。由于移动设备在与第一电子设备断开连接后广播第一请求消息,因此可以使第二电子设备与之建立连接,进而为通过第二电子设备与第一电子设备之间建立间接的连接奠定了基础。In a second aspect, a communication method is provided. The communication method is applied to a mobile device. A mobile device includes a processor and memory. In this method, after detecting that the mobile device is disconnected from the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the mobile device , and point-to-point direct connection requests. After receiving the first response message from the second electronic device, the mobile device establishes a point-to-point direct connection with the second electronic device; the first response message is associated with the first request message. After receiving all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data comes from the second electronic device. Since the mobile device broadcasts the first request message after disconnecting from the first electronic device, the second electronic device can be connected to it, thereby establishing an indirect connection between the second electronic device and the first electronic device. foundation.
根据第二方面,又一种可能的实现方式中,在检测到所述移动设备与所述第二电子设备断开点到点的直接连接后,所述移动设备广播第二请求消息;所述第二请求消息包括所述移动设备的标识,以及点到点的直接连接请求。如此,可以为与第二电子设备断开连接后与其他设备建立连接奠定基础。According to the second aspect, in another possible implementation manner, after detecting that the mobile device and the second electronic device are disconnected from the point-to-point direct connection, the mobile device broadcasts a second request message; the The second request message includes the identification of the mobile device and a point-to-point direct connection request. In this way, a foundation can be laid for establishing connections with other devices after disconnecting from the second electronic device.
根据第二方面,又一种可能的实现方式中,所述移动设备为蓝牙耳机。According to the second aspect, in another possible implementation manner, the mobile device is a Bluetooth headset.
第三方面,提供一种通信方法。该通信方法应用于第二电子设备。第二电子设备包括处理器和存储器。所述第二电子设备、第一电子设备与第三电子设备接入同一局域网。该方法中,第二电子设备接收到来自移动设备的第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。所述第二电子设备与所述移动设备建立点到点的直接连接。所述第二电子设备向所述第三电子设备或所述第一电子设备发送第一通知消息,所述第一通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与所述移动设备建立点到点的直接连接的第一通知信息。接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分。所述第二电子设备向所述移动设备发送所述音频数据的未播放内容的全部或部分。由于第二电子设备在与移动设备建立连接后告知了其他设备,因此为第一电子设备通过第二电子设备建立与移动设备的间接的连接奠定基础,进一步,由于第二电子设备将接收到的来自第一电子设备的音频数据发送给移动设备,因此可以实现第一电子设备通过第二电子设备建立与移动设备的间接的连接。In a third aspect, a communication method is provided. The communication method is applied to the second electronic device. The second electronic device includes a processor and a memory. The second electronic device, the first electronic device and the third electronic device are connected to the same local area network. In this method, the second electronic device receives a first request message from a mobile device; the first request message includes an identifier of the mobile device and a point-to-point direct connection request. The second electronic device establishes a point-to-point direct connection with the mobile device. The second electronic device sends a first notification message to the third electronic device or the first electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the and the first notification information for establishing a point-to-point direct connection between the second electronic device and the mobile device. All or part of the unplayed content of audio data is received from the first electronic device. The second electronic device transmits all or part of the unplayed content of the audio data to the mobile device. Since the second electronic device informs other devices after establishing the connection with the mobile device, it lays a foundation for the first electronic device to establish an indirect connection with the mobile device through the second electronic device. Further, since the second electronic device will receive the The audio data from the first electronic device is sent to the mobile device, so that the first electronic device can establish an indirect connection with the mobile device through the second electronic device.
根据第三方面,又一种可能的实现方式中,在检测到所述第二电子设备与所述移动设备断开点到点的直接连接后,所述第二电子设备向所述第三电子设备或所述第一电子设备发送第二通知消息;所述第二通知消息包括所述第二电子设备的标识、所述移动设备的标 识以及所述第二电子设备与所述移动设备断开点到点的直接连接的第二通知信息。如此,可以告知其他设备自身与移动设备之间的连接状态,从而可以使第一电子设备不再给自身发送音频数据。According to the third aspect, in another possible implementation manner, after detecting that the second electronic device is disconnected from the point-to-point direct connection with the mobile device, the second electronic device sends the third electronic device to the third electronic device. The device or the first electronic device sends a second notification message; the second notification message includes the identification of the second electronic device, the identification of the mobile device, and the disconnection of the second electronic device from the mobile device A second notification message for a point-to-point direct connection. In this way, the connection state between the other device itself and the mobile device can be informed, so that the first electronic device can no longer send audio data to itself.
根据第三方面,又一种可能的实现方式中,在接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分之前,所述第二电子设备与所述第一电子设备建立局域网连接。如此,第一电子设备和第二电子设备同处于同一个局域网内,可以使第二电子设备通过广播或组播的方式向第一电子设备发送消息,从而可以增加方案的灵活性。According to the third aspect, in another possible implementation manner, before receiving all or part of the unplayed content of the audio data from the first electronic device, the second electronic device and the first electronic device Establish a LAN connection. In this way, the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
根据第三方面,又一种可能的实现方式中,在接收到来自所述第三电子设备或所述第一电子设备的第二回复消息之后,所述第二电子设备与所述第一电子设备断开局域网连接;所述第二回复消息与所述第二通知消息相关联。如此,可以基于第二回复消息与第一电子设备之间断开连接。According to the third aspect, in another possible implementation manner, after receiving the second reply message from the third electronic device or the first electronic device, the second electronic device and the first electronic device The device disconnects the local area network; the second reply message is associated with the second notification message. In this way, the connection with the first electronic device may be disconnected based on the second reply message.
根据第三方面,又一种可能的实现方式中,所述第二电子设备为智能音箱。According to the third aspect, in yet another possible implementation manner, the second electronic device is a smart speaker.
第四方面,提供一种通信方法。该通信方法应用于第三电子设备。第三电子设备包括处理器和存储器。所述第三电子设备、第一电子设备与第二电子设备接入同一局域网。该方法中所述第三电子设备接收来自所述第一电子设备的第一告知消息;所述第一告知消息包括移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备建立了点到点的直接连接的第一告知信息。所述第三电子设备接收来自所述第一电子设备的第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。所述第三电子设备接收来自所述第二电子设备的第一通知消息,所述第一通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与所述移动设备建立点到点的直接连接的第一通知信息。所述第三电子设备向所述第一电子设备发送第一消息;所述第一消息用于指示所述第二电子设备与所述移动设备建立点到点的直接连接。由于通过第三电子设备向与所述移动设备的标识具有配对关系的设备发送第一消息,因此可以使与所述移动设备的标识具有配对关系的设备通过第二电子设备与移动设备建立间接的连接关系。In a fourth aspect, a communication method is provided. The communication method is applied to a third electronic device. The third electronic device includes a processor and a memory. The third electronic device, the first electronic device and the second electronic device are connected to the same local area network. In this method, the third electronic device receives a first notification message from the first electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The first notification information of the point-to-point direct connection is established by the first electronic device. The third electronic device receives a second notification message from the first electronic device; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The second notification information that the first electronic device disconnects the point-to-point direct connection. The third electronic device receives a first notification message from the second electronic device, and the first notification message includes an identification of the second electronic device, an identification of the mobile device, and the second electronic device and the The first notification information that the mobile device establishes a point-to-point direct connection. The third electronic device sends a first message to the first electronic device; the first message is used to instruct the second electronic device to establish a point-to-point direct connection with the mobile device. Since the first message is sent to the device having a pairing relationship with the identifier of the mobile device through the third electronic device, the device having a pairing relationship with the identifier of the mobile device can be made to establish an indirect connection with the mobile device through the second electronic device connection relationship.
根据第四方面,又一种可能的实现方式中,接收来自所述第二电子设备发送第二通知消息;所述第二通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与所述移动设备断开点到点的直接连接的第二通知信息。如此,可以使第三电子设备了解第二电子设备与移动设备之间的连接情况。According to the fourth aspect, in another possible implementation manner, a second notification message is received from the second electronic device and sent; the second notification message includes the identifier of the second electronic device and the identifier of the mobile device and second notification information that the second electronic device disconnects the point-to-point direct connection from the mobile device. In this way, the third electronic device can be made aware of the connection situation between the second electronic device and the mobile device.
根据第四方面,又一种可能的实现方式中,所述第三电子设备向所述第二电子设备发送所述第二通知消息。接收来自所述第一电子设备的第二回复消息;所述第二回复消息与所述第二通知消息相关联。向所述第二电子设备发送所述第二回复消息。如此,可以使第一电子设备了解第二电子设备与移动设备之间的连接情况,从而可以在第二电子设备与移动设备断开连接的情况下停止发送音频数据。According to the fourth aspect, in another possible implementation manner, the third electronic device sends the second notification message to the second electronic device. A second reply message from the first electronic device is received; the second reply message is associated with the second notification message. The second reply message is sent to the second electronic device. In this way, the first electronic device can be made aware of the connection between the second electronic device and the mobile device, so that the audio data can be stopped when the second electronic device is disconnected from the mobile device.
根据第四方面,又一种可能的实现方式中,所述第二电子设备为智能电视。According to the fourth aspect, in yet another possible implementation manner, the second electronic device is a smart TV.
第五方面,提供一种通信方法。该通信方法应用于第一电子设备。第一电子设备包括处理器和存储器。该方法中,第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备暂停播放所述音频数据,并记录第一暂停标记;或者,第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后, 所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据。第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,接收到第一消息,所述第一消息用于指示第二电子设备发现了所述移动设备。第一电子设备响应于所述第一消息,所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分;或者,第一电子设备响应于所述第一消息,所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。由于可以基于第一消息确定第二电子设备具有与移动设备建立连接的能力,且该移动设备为与自身具有配对关系的设备,因此第一电子设备可以向第二电子设备发送音频数据,以使第二电子设备将音频数据发送给移动设备,从而可以当第一电子设备与移动设备之间断开连接后,第一电子设备可以通过第二电子设备与移动设备之间建立间接的连接。In a fifth aspect, a communication method is provided. The communication method is applied to the first electronic device. The first electronic device includes a processor and a memory. In this method, after the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses to play the audio data, and records the first pause or, after the first electronic device detects that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device continues to play the the audio data. After detecting that the first electronic device disconnects the point-to-point direct connection with the mobile device, the first electronic device receives a first message, where the first message is used to indicate that the second electronic device has discovered the Mobile devices. In response to the first message, the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device; or, the first electronic device responds to the first electronic device. A message, the first electronic device does not continue to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device. Since it can be determined based on the first message that the second electronic device has the ability to establish a connection with the mobile device, and the mobile device is a device that has a pairing relationship with itself, the first electronic device can send audio data to the second electronic device, so that The second electronic device sends the audio data to the mobile device, so that after the first electronic device is disconnected from the mobile device, the first electronic device can establish an indirect connection between the second electronic device and the mobile device.
根据第五方面,又一种可能的实现方式中,在所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分之前,所述第一电子设备与所述第二电子设备建立网络连接。如此,第一电子设备可以通过与第二电子设备之间建立的连接发送音频数据。According to the fifth aspect, in another possible implementation manner, before the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device, the first electronic device communicates with the second electronic device. The second electronic device establishes a network connection. In this way, the first electronic device can transmit audio data through the connection established with the second electronic device.
根据第五方面,又一种可能的实现方式中,所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分之前,所述第一电子设备与所述第二电子设备建立网络连接。如此,第一电子设备可以通过与第二电子设备之间建立的连接发送音频数据。According to the fifth aspect, in another possible implementation manner, the first electronic device no longer continues to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device Before, the first electronic device establishes a network connection with the second electronic device. In this way, the first electronic device can transmit audio data through the connection established with the second electronic device.
根据第五方面,又一种可能的实现方式中,所述第一电子设备与所述第二电子设备建立网络连接;包括:所述第一电子设备与所述第二电子设备建立局域网连接。如此,第一电子设备和第二电子设备同处于同一个局域网内,可以使第二电子设备通过广播或组播的方式向第一电子设备发送消息,从而可以增加方案的灵活性。According to the fifth aspect, in another possible implementation manner, establishing a network connection between the first electronic device and the second electronic device includes: establishing a local area network connection between the first electronic device and the second electronic device. In this way, the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
根据第五方面,又一种可能的实现方式中,所述接收到第一消息包括:接收到来自第二电子设备或第三电子设备的一个消息。响应于所述消息,在从所述消息中获取到所述移动设备的标识后,确定所述消息为所述第一消息。根据第五方面,又一种可能的实现方式中,所述在从所述消息中获取到所述移动设备的标识后,确定所述消息为所述第一消息;包括:在从所述消息中获取到所述移动设备的标识和所述第二电子设备的标识后,确定所述消息为所述第一消息。根据第五方面,又一种可能的实现方式中,在从所述消息中获取到所述移动设备的标识,所述第二电子设备的标识,以及所述第二电子设备发现了所述移动设备的指示信息后,确定所述消息为所述第一消息。如此,可以增多确定第一消息的方式,从而可以提高方案的灵活性。According to the fifth aspect, in another possible implementation manner, the receiving the first message includes: receiving a message from the second electronic device or the third electronic device. In response to the message, after the identification of the mobile device is acquired from the message, it is determined that the message is the first message. According to the fifth aspect, in another possible implementation manner, after the identification of the mobile device is acquired from the message, the determining that the message is the first message includes: after the message is obtained from the message After the identification of the mobile device and the identification of the second electronic device are obtained in the device, it is determined that the message is the first message. According to the fifth aspect, in yet another possible implementation manner, the identifier of the mobile device, the identifier of the second electronic device are obtained from the message, and the second electronic device discovers the mobile device After receiving the indication information of the device, it is determined that the message is the first message. In this way, the ways of determining the first message can be increased, so that the flexibility of the scheme can be improved.
根据第五方面,又一种可能的实现方式中,在检测到所述第一电子设备与所述第二电子设备断开网络连接后,所述第一电子设备暂停播放所述音频数据,并记录第二暂停标记。如此,可以等待移动设备再次与第一电子设备之间建立连接后,实现业务的接续。According to the fifth aspect, in another possible implementation manner, after detecting that the first electronic device is disconnected from the network connection with the second electronic device, the first electronic device pauses playing the audio data, and A second pause mark is recorded. In this way, it is possible to wait for the connection between the mobile device and the first electronic device to be established again, and then realize the service connection.
根据第五方面,又一种可能的实现方式中,在检测到所述第一电子设备与所述第二电子设备断开网络连接后。所述第一电子设备通过所述扬声器继续播放所述音频数据。如此,可以增加方案的灵活性。According to the fifth aspect, in another possible implementation manner, after it is detected that the first electronic device and the second electronic device are disconnected from the network. The first electronic device continues to play the audio data through the speaker. In this way, the flexibility of the scheme can be increased.
根据第五方面,又一种可能的实现方式中,在所述第一电子设备与移动设备建立点到点的直接连接后,所述第一电子设备向第三电子设备发送第一告知消息;所述第一告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电 子设备建立了点到点的直接连接的第一告知信息。如此,可以使第三电子设备作为中心设备及时的知道设备之间的连接情况。According to the fifth aspect, in another possible implementation manner, after the first electronic device establishes a point-to-point direct connection with the mobile device, the first electronic device sends a first notification message to the third electronic device; The first notification message includes an identification of the mobile device, an identification of the first electronic device, and first notification information that the mobile device has established a point-to-point direct connection with the first electronic device. In this way, the third electronic device can be used as the central device to know the connection situation between the devices in time.
根据第五方面,又一种可能的实现方式中,在所述第一电子设备与移动设备断开点到点的直接连接后,所述第一电子设备向第三电子设备发送第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。如此,可以使第三电子设备作为中心设备及时的知道设备之间的连接情况。According to the fifth aspect, in another possible implementation manner, after the first electronic device and the mobile device are disconnected from the point-to-point direct connection, the first electronic device sends a second notification message to the third electronic device ; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the second notification information that the mobile device and the first electronic device have disconnected the point-to-point direct connection . In this way, the third electronic device can be used as the central device to know the connection situation between the devices in time.
根据第五方面,又一种可能的实现方式中,所述第一电子设备与所述第二电子设备接入同一局域网。如此,第一电子设备和第二电子设备同处于同一个局域网内,可以使第二电子设备通过广播或组播的方式向第一电子设备发送消息,从而可以增加方案的灵活性。According to the fifth aspect, in another possible implementation manner, the first electronic device and the second electronic device are connected to the same local area network. In this way, the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
根据第五方面,又一种可能的实现方式中,所述点到点的直接连接包括蓝牙连接、Wi-Fi P2P连接和ZigBee连接中的一种。如此,可以增加方案的灵活性。According to the fifth aspect, in another possible implementation manner, the point-to-point direct connection includes one of a Bluetooth connection, a Wi-Fi P2P connection, and a ZigBee connection. In this way, the flexibility of the scheme can be increased.
根据第五方面,又一种可能的实现方式中,所述第一电子设备为智能手机。According to the fifth aspect, in another possible implementation manner, the first electronic device is a smart phone.
第六方面,提供一种通信方法。该通信方法应用于第二电子设备。第二电子设备包括处理器和存储器。所述第二电子设备、第一电子设备与第三电子设备接入同一局域网。该方法中,接收到来自移动设备的第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。所述第二电子设备向所述第三电子设备或所述第一电子设备发送第一通知消息,所述第一通知消息包括所述第二电子设备的标识、所述移动设备的标识以及用于指示所述第二电子设备发现了所述移动设备的信息。所述第二电子设备与所述移动设备建立点到点的直接连接。接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分。所述第二电子设备向所述移动设备发送所述音频数据的未播放内容的全部或部分。由于第二电子设备在发现移动设备后告知了其他设备,因此为第一电子设备通过第二电子设备建立与移动设备的间接的连接奠定基础,进一步,由于第二电子设备将接收到的来自第一电子设备的音频数据发送给移动设备,因此可以实现第一电子设备通过第二电子设备建立与移动设备的间接的连接。In a sixth aspect, a communication method is provided. The communication method is applied to the second electronic device. The second electronic device includes a processor and a memory. The second electronic device, the first electronic device and the third electronic device are connected to the same local area network. In this method, a first request message from a mobile device is received; the first request message includes an identifier of the mobile device and a point-to-point direct connection request. The second electronic device sends a first notification message to the third electronic device or the first electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the user information indicating that the mobile device has been discovered by the second electronic device. The second electronic device establishes a point-to-point direct connection with the mobile device. All or part of the unplayed content of audio data is received from the first electronic device. The second electronic device transmits all or part of the unplayed content of the audio data to the mobile device. Since the second electronic device informs other devices after discovering the mobile device, it lays a foundation for the first electronic device to establish an indirect connection with the mobile device through the second electronic device. The audio data of an electronic device is sent to the mobile device, so that the first electronic device can establish an indirect connection with the mobile device through the second electronic device.
根据第六方面,又一种可能的实现方式中,在检测到所述第二电子设备与所述移动设备断开点到点的直接连接后,所述第二电子设备向所述第三电子设备或所述第一电子设备发送第二通知消息;所述第二通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与所述移动设备断开点到点的直接连接的第二通知信息。如此,可以告知其他设备自身与移动设备之间的连接状态,从而可以使第一电子设备不再给自身发送音频数据。According to the sixth aspect, in another possible implementation manner, after detecting that the second electronic device is disconnected from the point-to-point direct connection with the mobile device, the second electronic device sends the third electronic device to the third electronic device. The device or the first electronic device sends a second notification message; the second notification message includes the identification of the second electronic device, the identification of the mobile device, and the disconnection of the second electronic device from the mobile device A second notification message for a point-to-point direct connection. In this way, the connection state between the other device itself and the mobile device can be informed, so that the first electronic device can no longer send audio data to itself.
根据第六方面,又一种可能的实现方式中,在接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分之前,所述第二电子设备与所述第一电子设备建立局域网连接。如此,第一电子设备和第二电子设备同处于同一个局域网内,可以使第二电子设备通过广播或组播的方式向第一电子设备发送消息,从而可以增加方案的灵活性。According to the sixth aspect, in another possible implementation manner, before receiving all or part of the unplayed content of the audio data from the first electronic device, the second electronic device and the first electronic device Establish a LAN connection. In this way, the first electronic device and the second electronic device are both in the same local area network, and the second electronic device can send a message to the first electronic device through broadcast or multicast, thereby increasing the flexibility of the solution.
根据第六方面,又一种可能的实现方式中,在接收到来自所述第三电子设备或所述第一电子设备的第二回复消息之后,所述第二电子设备与所述第一电子设备断开局域网连接;所述第二回复消息与所述第二通知消息相关联。如此,可以基于第二回复消息与第一电子设备之间断开连接。According to the sixth aspect, in another possible implementation manner, after receiving the second reply message from the third electronic device or the first electronic device, the second electronic device and the first electronic device The device disconnects the local area network; the second reply message is associated with the second notification message. In this way, the connection with the first electronic device may be disconnected based on the second reply message.
根据第六方面,又一种可能的实现方式中,所述第二电子设备为智能音箱。According to the sixth aspect, in another possible implementation manner, the second electronic device is a smart speaker.
第七方面,提供一种通信方法。该通信方法应用于第三电子设备。第三电子设备包括处理器和存储器。所述第三电子设备、第一电子设备与第二电子设备接入同一局域网。该方法中所述第三电子设备接收来自所述第一电子设备的第一告知消息;所述第一告知消息包括移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备建立了点到点的直接连接的第一告知信息。所述第三电子设备接收来自所述第一电子设备的第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。所述第三电子设备接收来自所述第二电子设备的第一通知消息,所述第一通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与用于指示所述第二电子设备发现了所述移动设备的指示信息。所述第三电子设备向所述第一电子设备发送第一消息;所述第一消息用于指示所述第二电子设备发现了所述移动设备的指示信息。由于通过第三电子设备向与所述移动设备的标识具有配对关系的设备发送第一消息,因此可以使与所述移动设备的标识具有配对关系的设备通过第二电子设备与移动设备建立间接的连接关系。In a seventh aspect, a communication method is provided. The communication method is applied to a third electronic device. The third electronic device includes a processor and a memory. The third electronic device, the first electronic device and the second electronic device are connected to the same local area network. In this method, the third electronic device receives a first notification message from the first electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The first notification information of the point-to-point direct connection is established by the first electronic device. The third electronic device receives a second notification message from the first electronic device; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The second notification information that the first electronic device disconnects the point-to-point direct connection. The third electronic device receives a first notification message from the second electronic device, and the first notification message includes an identification of the second electronic device, an identification of the mobile device, and the second electronic device and the Indication information for indicating that the second electronic device has discovered the mobile device. The third electronic device sends a first message to the first electronic device; the first message is used for indicating that the second electronic device has discovered the mobile device. Since the first message is sent to the device having a pairing relationship with the identifier of the mobile device through the third electronic device, the device having a pairing relationship with the identifier of the mobile device can be made to establish an indirect connection with the mobile device through the second electronic device connection relationship.
根据第七方面,又一种可能的实现方式中,接收来自所述第二电子设备发送第二通知消息;所述第二通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与所述移动设备断开点到点的直接连接的第二通知信息。如此,可以使第三电子设备了解第二电子设备与移动设备之间的连接情况。According to the seventh aspect, in another possible implementation manner, a second notification message sent from the second electronic device is received; the second notification message includes an identifier of the second electronic device and an identifier of the mobile device and second notification information that the second electronic device disconnects the point-to-point direct connection from the mobile device. In this way, the third electronic device can be made aware of the connection situation between the second electronic device and the mobile device.
根据第七方面,又一种可能的实现方式中,所述第三电子设备向所述第二电子设备发送所述第二通知消息。接收来自所述第一电子设备的第二回复消息;所述第二回复消息与所述第二通知消息相关联。向所述第二电子设备发送所述第二回复消息。如此,可以使第一电子设备了解第二电子设备与移动设备之间的连接情况,从而可以在第二电子设备与移动设备断开连接的情况下停止发送音频数据。According to the seventh aspect, in another possible implementation manner, the third electronic device sends the second notification message to the second electronic device. A second reply message from the first electronic device is received; the second reply message is associated with the second notification message. The second reply message is sent to the second electronic device. In this way, the first electronic device can be made aware of the connection between the second electronic device and the mobile device, so that the audio data can be stopped when the second electronic device is disconnected from the mobile device.
根据第七方面,又一种可能的实现方式中,所述第二电子设备为智能电视。According to the seventh aspect, in yet another possible implementation manner, the second electronic device is a smart TV.
第八方面,提供一种通信方法。该通信方法应用于第一电子设备、第二电子设备、第三电子设备和移动设备。第一电子设备、所述第二电子设备与第三电子设备接入同一局域网。该方法中,第一电子设备与移动设备建立点到点的直接连接。所述第一电子设备通过所述移动设备播放音频数据。所述第一电子设备向所述第三电子设备发送第一告知消息;所述第一告知消息包括移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备建立了点到点的直接连接的第一告知信息。所述第三电子设备接收来自所述第一电子设备的所述第一告知消息。In an eighth aspect, a communication method is provided. The communication method is applied to the first electronic device, the second electronic device, the third electronic device and the mobile device. The first electronic device, the second electronic device and the third electronic device are connected to the same local area network. In this method, the first electronic device establishes a point-to-point direct connection with the mobile device. The first electronic device plays audio data through the mobile device. The first electronic device sends a first notification message to the third electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the first electronic device. The first notification information that the electronic device has established a point-to-point direct connection. The third electronic device receives the first notification message from the first electronic device.
第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,向所述第三电子设备发送第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。所述第三电子设备接收来自所述第一电子设备的第二告知消息。After detecting that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device sends a second notification message to the third electronic device; the second notification message includes the The identification of the mobile device, the identification of the first electronic device, and the second notification information that the mobile device has disconnected the point-to-point direct connection with the first electronic device. The third electronic device receives the second notification message from the first electronic device.
第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备暂停播放所述音频数据,并记录第一暂停标记。或者,第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据。After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses playing the audio data, and records a first pause mark. Alternatively, after the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio through the speaker of the first electronic device data.
所述移动设备在检测到所述移动设备与所述第一电子设备断开点到点的直接连接后,广播第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接 请求。所述第二电子设备接收到来自移动设备的第一请求消息。所述第二电子设备向所述移动设备发送第一响应消息,所述第一响应消息与所述第一请求消息相关联。所述移动设备在接收到来自第二电子设备的第一响应消息。所述第二电子设备与所述移动设备建立点到点的直接连接。After detecting that the mobile device disconnects the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer. The second electronic device receives the first request message from the mobile device. The second electronic device sends a first response message to the mobile device, the first response message being associated with the first request message. The mobile device is receiving the first response message from the second electronic device. The second electronic device establishes a point-to-point direct connection with the mobile device.
所述第二电子设备向所述第三电子设备发送第一通知消息,所述第一通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与所述移动设备建立点到点的直接连接的第一通知信息。所述第三电子设备接收来自所述第二电子设备的第一通知消息。所述第三电子设备向所述第一电子设备发送第一消息;所述第一消息用于指示所述第二电子设备与所述移动设备建立点到点的直接连接。The second electronic device sends a first notification message to the third electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the connection between the second electronic device and the third electronic device. The first notification information that the mobile device establishes a point-to-point direct connection. The third electronic device receives the first notification message from the second electronic device. The third electronic device sends a first message to the first electronic device; the first message is used to instruct the second electronic device to establish a point-to-point direct connection with the mobile device.
所述第一电子设备接收到第一消息。所述第一电子设备响应于所述第一消息,所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分。或者,所述第一电子设备响应于所述第一消息,不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。The first electronic device receives the first message. In response to the first message, the first electronic device transmits to the second electronic device all or part of the audio data following a first pause mark. Alternatively, in response to the first message, the first electronic device does not continue playing through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
所述第二电子设备接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分。所述第二电子设备向所述移动设备发送所述音频数据的未播放内容的全部或部分。The second electronic device receives all or part of the unplayed content of the audio data from the first electronic device. The second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
所述移动设备在接收到所述音频数据的未播放内容的全部或部分后,所述移动设备播放所述音频数据的未播放内容的全部或部分;所述音频数据的未播放内容的全部或部分来自所述第二电子设备。After the mobile device receives all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data in part from the second electronic device.
第八方面所对应的技术效果以及相关介绍,可参见第一方面、第二方面、第三方面和第四方面中的任意一个方面或任一个方面中的任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects and related introductions corresponding to the eighth aspect, reference may be made to the technical effects corresponding to any one of the first aspect, the second aspect, the third aspect, and the fourth aspect or any one of the implementation modes of any one aspect , and will not be repeated here.
第九方面,提供一种通信方法。该通信方法应用于第一电子设备、第二电子设备、第三电子设备和移动设备。第一电子设备、所述第二电子设备与第三电子设备接入同一局域网。该方法中,第一电子设备与移动设备建立点到点的直接连接。所述第一电子设备通过所述移动设备播放音频数据。所述第一电子设备向所述第三电子设备发送第一告知消息;所述第一告知消息包括移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备建立了点到点的直接连接的第一告知信息。所述第三电子设备接收来自所述第一电子设备的所述第一告知消息。In a ninth aspect, a communication method is provided. The communication method is applied to the first electronic device, the second electronic device, the third electronic device and the mobile device. The first electronic device, the second electronic device and the third electronic device are connected to the same local area network. In this method, the first electronic device establishes a point-to-point direct connection with the mobile device. The first electronic device plays audio data through the mobile device. The first electronic device sends a first notification message to the third electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the first electronic device. The first notification information that the electronic device has established a point-to-point direct connection. The third electronic device receives the first notification message from the first electronic device.
第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,向所述第三电子设备发送第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。所述第三电子设备接收来自所述第一电子设备的第二告知消息。After detecting that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device sends a second notification message to the third electronic device; the second notification message includes the The identification of the mobile device, the identification of the first electronic device, and the second notification information that the mobile device has disconnected the point-to-point direct connection with the first electronic device. The third electronic device receives the second notification message from the first electronic device.
第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备暂停播放所述音频数据,并记录第一暂停标记。或者,第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据。After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses playing the audio data, and records a first pause mark. Alternatively, after the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio through the speaker of the first electronic device data.
所述移动设备在检测到所述移动设备与所述第一电子设备断开点到点的直接连接后,广播第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。所述第二电子设备接收到来自移动设备的第一请求消息。After detecting that the mobile device disconnects the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer. The second electronic device receives the first request message from the mobile device.
所述第二电子设备向所述第三电子设备发送第一通知消息,所述第一通知消息包括所 述第二电子设备的标识、所述移动设备的标识以及用于指示所述第二电子设备发现了所述移动设备的信息。所述第三电子设备接收来自所述第二电子设备的第一通知消息。The second electronic device sends a first notification message to the third electronic device, where the first notification message includes an identifier of the second electronic device, an identifier of the mobile device, and a message for indicating the second electronic device The device discovered the information of the mobile device. The third electronic device receives the first notification message from the second electronic device.
所述第三电子设备向所述第一电子设备发送第一消息;所述第一消息用于指示所述第二电子设备发现了所述移动设备。所述第一电子设备接收到第一消息。The third electronic device sends a first message to the first electronic device; the first message is used to indicate that the second electronic device has discovered the mobile device. The first electronic device receives the first message.
所述第一电子设备与所述第二电子设备之间建立连接。A connection is established between the first electronic device and the second electronic device.
所述第二电子设备向所述移动设备发送第一响应消息,所述第一响应消息与所述第一请求消息相关联。所述移动设备在接收到来自第二电子设备的第一响应消息。所述第二电子设备与所述移动设备建立点到点的直接连接。The second electronic device sends a first response message to the mobile device, the first response message being associated with the first request message. The mobile device is receiving the first response message from the second electronic device. The second electronic device establishes a point-to-point direct connection with the mobile device.
所述第一电子设备接收到第一消息。所述第一电子设备响应于所述第一消息,所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分。或者,所述第一电子设备响应于所述第一消息,不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。The first electronic device receives the first message. In response to the first message, the first electronic device transmits to the second electronic device all or part of the audio data following a first pause mark. Alternatively, in response to the first message, the first electronic device does not continue playing through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
所述第二电子设备接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分。所述第二电子设备向所述移动设备发送所述音频数据的未播放内容的全部或部分。The second electronic device receives all or part of the unplayed content of the audio data from the first electronic device. The second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
所述移动设备在接收到所述音频数据的未播放内容的全部或部分后,所述移动设备播放所述音频数据的未播放内容的全部或部分;所述音频数据的未播放内容的全部或部分来自所述第二电子设备。After the mobile device receives all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data in part from the second electronic device.
第九方面所对应的技术效果以及相关介绍,可参见第二方面、第五方面、第六方面和第七方面中的任意一个方面或任一个方面中的任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects and related introductions corresponding to the ninth aspect, refer to the technical effects corresponding to any one of the second aspect, the fifth aspect, the sixth aspect, and the seventh aspect or any one of the implementation modes of any one aspect , and will not be repeated here.
第十方面,提供一种通信方法。该通信方法应用于第一电子设备、第二电子设备和移动设备。所述第二电子设备与第一电子设备接入同一局域网。该方法中,第一电子设备与移动设备建立点到点的直接连接。所述第一电子设备通过所述移动设备播放音频数据。A tenth aspect provides a communication method. The communication method is applied to the first electronic device, the second electronic device and the mobile device. The second electronic device and the first electronic device are connected to the same local area network. In this method, the first electronic device establishes a point-to-point direct connection with the mobile device. The first electronic device plays audio data through the mobile device.
第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,第一电子设备暂停播放所述音频数据,并记录第一暂停标记。或者,第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据。After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses to play the audio data, and records a first pause mark. Alternatively, after the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio through the speaker of the first electronic device data.
所述移动设备在检测到所述移动设备与所述第一电子设备断开点到点的直接连接后,广播第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。所述第二电子设备接收到来自移动设备的第一请求消息。所述第二电子设备向所述移动设备发送第一响应消息,所述第一响应消息与所述第一请求消息相关联。所述移动设备在接收到来自第二电子设备的第一响应消息。所述第二电子设备与所述移动设备建立点到点的直接连接。After detecting that the mobile device disconnects the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer. The second electronic device receives the first request message from the mobile device. The second electronic device sends a first response message to the mobile device, the first response message being associated with the first request message. The mobile device is receiving the first response message from the second electronic device. The second electronic device establishes a point-to-point direct connection with the mobile device.
所述第二电子设备向所述第一电子设备发送第一消息;所述第一消息用于指示所述第二电子设备与所述移动设备建立点到点的直接连接。所述第一电子设备接收到第一消息,所述第一消息用于指示所述移动设备与第二电子设备建立了点到点的直接连接。The second electronic device sends a first message to the first electronic device; the first message is used to instruct the second electronic device to establish a point-to-point direct connection with the mobile device. The first electronic device receives a first message, where the first message is used to instruct the mobile device to establish a point-to-point direct connection with the second electronic device.
所述第一电子设备响应于所述第一消息,所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分。或者,所述第一电子设备响应于所述第一消息,所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。In response to the first message, the first electronic device transmits to the second electronic device all or part of the audio data following a first pause mark. Or, in response to the first message, the first electronic device does not continue to play through the speaker, but sends all the unplayed content of the audio data to the second electronic device or part.
所述第二电子设备接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分。所述第二电子设备向所述移动设备发送所述音频数据的未播放内容的全部或部分。The second electronic device receives all or part of the unplayed content of the audio data from the first electronic device. The second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
所述移动设备在接收到所述音频数据的未播放内容的全部或部分后,所述移动设备播放所述音频数据的未播放内容的全部或部分;所述音频数据的未播放内容的全部或部分来自所述第二电子设备。After the mobile device receives all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data in part from the second electronic device.
第十方面所对应的技术效果以及相关介绍,可参见第一方面、第二方面、第三方面和第四方面中的任意一个方面或任一个方面中的任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects and related introductions corresponding to the tenth aspect, reference may be made to the technical effects corresponding to any one of the first aspect, the second aspect, the third aspect, and the fourth aspect or any one of the implementation modes of any one aspect , and will not be repeated here.
第十一方面,提供一种通信方法。该通信方法应用于第一电子设备、第二电子设备和移动设备。所述第二电子设备与第一电子设备接入同一局域网。该方法中,第一电子设备与移动设备建立点到点的直接连接。所述第一电子设备通过所述移动设备播放音频数据。In an eleventh aspect, a communication method is provided. The communication method is applied to the first electronic device, the second electronic device and the mobile device. The second electronic device and the first electronic device are connected to the same local area network. In this method, the first electronic device establishes a point-to-point direct connection with the mobile device. The first electronic device plays audio data through the mobile device.
第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,第一电子设备暂停播放所述音频数据,并记录第一暂停标记。或者,第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据。After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses to play the audio data, and records a first pause mark. Alternatively, after the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio through the speaker of the first electronic device data.
所述移动设备在检测到所述移动设备与所述第一电子设备断开点到点的直接连接后,广播第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。所述第二电子设备接收到来自移动设备的第一请求消息。所述第二电子设备向所述第一电子设备发送第一消息;所述第一消息用于指示所述第二电子设备发现了所述移动设备。After detecting that the mobile device disconnects the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer. The second electronic device receives the first request message from the mobile device. The second electronic device sends a first message to the first electronic device; the first message is used to indicate that the second electronic device has discovered the mobile device.
所述第一电子设备接收到第一消息。所述第一电子设备与所述第二电子设备之间建立连接。所述第二电子设备向所述移动设备发送第一响应消息,所述第一响应消息与所述第一请求消息相关联。所述移动设备在接收到来自第二电子设备的第一响应消息。所述第二电子设备与所述移动设备建立点到点的直接连接。The first electronic device receives the first message. A connection is established between the first electronic device and the second electronic device. The second electronic device sends a first response message to the mobile device, the first response message being associated with the first request message. The mobile device is receiving the first response message from the second electronic device. The second electronic device establishes a point-to-point direct connection with the mobile device.
所述第一电子设备响应于所述第一消息,所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分。或者,所述第一电子设备响应于所述第一消息,所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。In response to the first message, the first electronic device transmits to the second electronic device all or part of the audio data following a first pause mark. Or, in response to the first message, the first electronic device does not continue to play through the speaker, but sends all the unplayed content of the audio data to the second electronic device or part.
所述第二电子设备接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分。所述第二电子设备向所述移动设备发送所述音频数据的未播放内容的全部或部分。The second electronic device receives all or part of the unplayed content of the audio data from the first electronic device. The second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
所述移动设备在接收到所述音频数据的未播放内容的全部或部分后,所述移动设备播放所述音频数据的未播放内容的全部或部分;所述音频数据的未播放内容的全部或部分来自所述第二电子设备。After the mobile device receives all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data in part from the second electronic device.
第十一方面所对应的技术效果以及相关介绍,可参见第二方面、第五方面、第六方面和第七方面中的任意一个方面或任一个方面中的任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects and related introductions corresponding to the eleventh aspect, reference may be made to the technology corresponding to any one of the second aspect, the fifth aspect, the sixth aspect, and the seventh aspect, or any one of the implementation modes of any one aspect The effect will not be repeated here.
相应于第一方面至第七方面任一种通信方法,本申请还提供了一种通信装置。通信装置可以是以无线方式进行数据传输的任意一种发送端的设备或接收端的设备。在通信过程中,发送端的设备和接收端的设备是相对的。在某些通信过程中,通信装置可以作为上述移动设备或可用于移动设备的通信芯片;在某些通信过程中,通信装置可以作为上述第一 电子设备或可用于第一电子设备的通信芯片;在某些通信过程中,通信装置可以作为上述第二电子设备或可用于第二电子设备的通信芯片;在某些通信过程中,通信装置可以作为上述第三电子设备或可用于第三电子设备的通信芯片。Corresponding to any one of the communication methods from the first aspect to the seventh aspect, the present application further provides a communication device. The communication apparatus may be any device on the sending end or device on the receiving end that performs data transmission in a wireless manner. During the communication process, the device on the sending end and the device on the receiving end are relative. In some communication processes, the communication device can be used as the above-mentioned mobile device or a communication chip that can be used in the mobile device; in some communication processes, the communication device can be used as the above-mentioned first electronic device or a communication chip that can be used for the first electronic device; In some communication processes, the communication device can be used as the above-mentioned second electronic device or a communication chip that can be used in the second electronic device; in some communication processes, the communication device can be used as the above-mentioned third electronic device or can be used in the third electronic device. communication chip.
第十二方面,提供了一种通信装置,包括通信单元和处理单元,以执行上述第一方面至第十一方面任一种通信方法中的任一种实施方式。通信单元用于执行与发送和接收相关的功能。可选地,通信单元包括接收单元和发送单元。在一种设计中,通信装置为通信芯片,通信单元可以为通信芯片的输入输出电路或者端口。According to a twelfth aspect, a communication apparatus is provided, including a communication unit and a processing unit, so as to execute any one of the above-mentioned embodiments of the communication methods of the first to eleventh aspects. The communication unit is used to perform functions related to transmission and reception. Optionally, the communication unit includes a receiving unit and a sending unit. In one design, the communication device is a communication chip, and the communication unit may be an input/output circuit or port of the communication chip.
在另一种设计中,通信单元可以为发射器和接收器,或者通信单元为发射机和接收机。In another design, the communication unit may be a transmitter and receiver, or the communication unit may be a transmitter and receiver.
可选的,通信装置还包括可用于执行上述第一方面至第七方面任一种通信方法中的任一种实施方式的各个模块。Optionally, the communication apparatus further includes various modules that can be used to execute any one of the implementation manners of any one of the communication methods of the first aspect to the seventh aspect.
第十三面,提供了一种通信装置,该通信装置为上述移动设备、第一电子设备、第二电子设备或第三电子设备。该通信装置包括处理器和存储器。可选的,还包括收发器,该存储器用于存储计算机程序或指令,该处理器用于从存储器中调用并运行该计算机程序或指令,当所述处理器执行存储器中的计算机程序或指令时,使得该通信装置执行上述第一方面至第七方面任一种通信方法中的任一种实施方式。A thirteenth aspect provides a communication apparatus, where the communication apparatus is the above-mentioned mobile device, the first electronic device, the second electronic device or the third electronic device. The communication device includes a processor and a memory. Optionally, also include a transceiver, the memory is used to store computer programs or instructions, the processor is used to call and run the computer programs or instructions from the memory, and when the processor executes the computer programs or instructions in the memory, The communication apparatus is caused to perform any one of the implementations of any one of the communication methods of the first aspect to the seventh aspect.
可选的,处理器为一个或多个,存储器为一个或多个。Optionally, there are one or more processors and one or more memories.
可选的,存储器可以与处理器集成在一起,或者存储器与处理器分离设置。Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
可选的,收发器中可以包括,发射机(发射器)和接收机(接收器)。Optionally, the transceiver may include a transmitter (transmitter) and a receiver (receiver).
第十四方面,提供了一种通信装置,该通信装置为上述移动设备、第一电子设备、第二电子设备或第三电子设备。该通信装置包括处理器。该处理器与存储器耦合,可用于执行第一方面至第七方面任一方面,以及第一方面至第七方面中任一种可能实现方式中的方法。可选地,该通信装置还包括通信接口,处理器与通信接口耦合。A fourteenth aspect provides a communication apparatus, where the communication apparatus is the above-mentioned mobile device, the first electronic device, the second electronic device or the third electronic device. The communication device includes a processor. The processor, coupled to the memory, is operable to perform the method of any one of the first to seventh aspects, and any one of the possible implementations of the first to seventh aspects. Optionally, the communication device further includes a communication interface, and the processor is coupled to the communication interface.
在一种实现方式中,该通信装置为移动设备。当该通信装置为移动设备时,所述通信接口可以是收发器,或,输入/输出接口。可选地,所述收发器可以为收发电路。可选地,所述输入/输出接口可以为输入/输出电路。In one implementation, the communication apparatus is a mobile device. When the communication device is a mobile device, the communication interface may be a transceiver, or an input/output interface. Optionally, the transceiver may be a transceiver circuit. Optionally, the input/output interface may be an input/output circuit.
在另一种实现方式中,该通信装置为第一电子设备。当该通信装置为第一电子设备时,所述通信接口可以是收发器,或,输入/输出接口。可选地,所述收发器可以为收发电路。可选地,所述输入/输出接口可以为输入/输出电路。In another implementation manner, the communication apparatus is a first electronic device. When the communication device is the first electronic device, the communication interface may be a transceiver, or an input/output interface. Optionally, the transceiver may be a transceiver circuit. Optionally, the input/output interface may be an input/output circuit.
在另一种实现方式中,该通信装置为第二电子设备。当该通信装置为第二电子设备时,所述通信接口可以是收发器,或,输入/输出接口。可选地,所述收发器可以为收发电路。可选地,所述输入/输出接口可以为输入/输出电路。In another implementation manner, the communication apparatus is a second electronic device. When the communication device is the second electronic device, the communication interface may be a transceiver, or an input/output interface. Optionally, the transceiver may be a transceiver circuit. Optionally, the input/output interface may be an input/output circuit.
在另一种实现方式中,该通信装置为第三电子设备。当该通信装置为第三电子设备时,所述通信接口可以是收发器,或,输入/输出接口。可选地,所述收发器可以为收发电路。可选地,所述输入/输出接口可以为输入/输出电路。In another implementation manner, the communication apparatus is a third electronic device. When the communication device is a third electronic device, the communication interface may be a transceiver, or an input/output interface. Optionally, the transceiver may be a transceiver circuit. Optionally, the input/output interface may be an input/output circuit.
在又一种实现方式中,该通信装置为芯片或芯片系统。当该通信装置为芯片或芯片系统时,所述通信接口可以是该芯片或芯片系统上的输入/输出接口、接口电路、输出电路、输入电路、管脚或相关电路等。所述处理器也可以体现为处理电路或逻辑电路。In yet another implementation, the communication device is a chip or a system of chips. When the communication device is a chip or a chip system, the communication interface may be an input/output interface, an interface circuit, an output circuit, an input circuit, a pin or a related circuit on the chip or a chip system. The processor may also be embodied as a processing circuit or a logic circuit.
第十五方面,提供了一种系统,系统包括上述移动设备、第一电子设备、第二电子设备和第三电子设备。In a fifteenth aspect, a system is provided, including the above-mentioned mobile device, a first electronic device, a second electronic device, and a third electronic device.
所述第一电子设备包括处理器、存储器,以及计算机程序,其中所述计算机程序存储 在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述第一电子设备执行以下步骤:所述第一电子设备与移动设备建立点到点的直接连接,所述第一电子设备通过所述移动设备播放音频数据。在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备暂停播放所述音频数据,并记录第一暂停标记;或者,第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据。第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,接收到第一消息,所述第一消息用于指示所述移动设备与第二电子设备建立了点到点的直接连接。第一电子设备响应于所述第一消息,所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分;或者,第一电子设备响应于所述第一消息,所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。The first electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the first electronic device to perform the following: Step: The first electronic device establishes a point-to-point direct connection with the mobile device, and the first electronic device plays audio data through the mobile device. After detecting that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device pauses to play the audio data, and records a first pause mark; or, the first electronic device After detecting that the first electronic device is disconnected from the point-to-point direct connection with the mobile device, the first electronic device continues to play the audio data through the speaker of the first electronic device. After detecting that the first electronic device disconnects the point-to-point direct connection with the mobile device, the first electronic device receives a first message, where the first message is used to instruct the mobile device and the second electronic device The device establishes a direct point-to-point connection. In response to the first message, the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device; or, the first electronic device responds to the first electronic device. A message, the first electronic device does not continue to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
所述移动设备包括处理器、存储器,以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述移动设备执行以下步骤:在检测到所述移动设备与所述第一电子设备断开点到点的直接连接后,所述移动设备广播第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。在接收到来自第二电子设备的第一响应消息后,所述移动设备与所述第二电子设备建立点到点的直接连接;所述第一响应消息与所述第一请求消息相关联。在接收到所述音频数据的未播放内容的全部或部分后,所述移动设备播放所述音频数据的未播放内容的全部或部分;所述音频数据的未播放内容的全部或部分来自所述第二电子设备。The mobile device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the mobile device to perform the following steps: After the mobile device and the first electronic device are disconnected from the point-to-point direct connection, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point direct connection request. After receiving the first response message from the second electronic device, the mobile device establishes a point-to-point direct connection with the second electronic device; the first response message is associated with the first request message. After receiving all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data comes from the second electronic device.
所述第二电子设备包括处理器、存储器,以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述第二电子设备执行以下步骤:第二电子设备接收到来自移动设备的第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。所述第二电子设备与所述移动设备建立点到点的直接连接。所述第二电子设备向所述第三电子设备或所述第一电子设备发送第一通知消息,所述第一通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与所述移动设备建立点到点的直接连接的第一通知信息。接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分。所述第二电子设备向所述移动设备发送所述音频数据的未播放内容的全部或部分。The second electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the second electronic device to perform the following: Step: The second electronic device receives a first request message from a mobile device; the first request message includes an identifier of the mobile device and a point-to-point direct connection request. The second electronic device establishes a point-to-point direct connection with the mobile device. The second electronic device sends a first notification message to the third electronic device or the first electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the and the first notification information for establishing a point-to-point direct connection between the second electronic device and the mobile device. All or part of the unplayed content of audio data is received from the first electronic device. The second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
所述第三电子设备包括处理器、存储器,以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述第三电子设备执行以下步骤:所述第三电子设备接收来自所述第一电子设备的第一告知消息;所述第一告知消息包括移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备建立了点到点的直接连接的第一告知信息。所述第三电子设备接收来自所述第一电子设备的第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。所述第三电子设备接收来自所述第二电子设备的第一通知消息,所述第一通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与所述移动设备建立点到点的直接连接的第一通知信息。所述第三电子设备向所述第一电子设备发送第一消息;所述第一消息用于指示所述第二电子设备与所述移动设备建立点到点的直接连接。The third electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the third electronic device to perform the following: Step: the third electronic device receives a first notification message from the first electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The first notification information that the first electronic device has established a point-to-point direct connection. The third electronic device receives a second notification message from the first electronic device; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The second notification information that the first electronic device disconnects the point-to-point direct connection. The third electronic device receives a first notification message from the second electronic device, and the first notification message includes an identification of the second electronic device, an identification of the mobile device, and the second electronic device and the The first notification information that the mobile device establishes a point-to-point direct connection. The third electronic device sends a first message to the first electronic device; the first message is used to instruct the second electronic device to establish a point-to-point direct connection with the mobile device.
第十六方面,提供了一种系统,系统包括上述移动设备、第一电子设备、第二电子设 备和第三电子设备。A sixteenth aspect provides a system including the above mobile device, a first electronic device, a second electronic device and a third electronic device.
所述第一电子设备包括处理器、存储器,以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述第一电子设备执行以下步骤:所述第一电子设备与移动设备建立点到点的直接连接,所述第一电子设备通过所述移动设备播放音频数据。第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备暂停播放所述音频数据,并记录第一暂停标记;或者,第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据。第一电子设备在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,接收到第一消息,所述第一消息用于指示第二电子设备发现了所述移动设备。第一电子设备响应于所述第一消息,所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分;或者,第一电子设备响应于所述第一消息,所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。The first electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the first electronic device to perform the following: Step: The first electronic device establishes a point-to-point direct connection with the mobile device, and the first electronic device plays audio data through the mobile device. After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device pauses playing the audio data, and records a first pause mark; or, After the first electronic device detects that the point-to-point direct connection between the first electronic device and the mobile device is disconnected, the first electronic device continues to play the audio data through the speaker of the first electronic device. After detecting that the first electronic device disconnects the point-to-point direct connection with the mobile device, the first electronic device receives a first message, where the first message is used to indicate that the second electronic device has discovered the Mobile devices. In response to the first message, the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device; or, the first electronic device responds to the first electronic device. A message, the first electronic device does not continue to play through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
所述移动设备包括处理器、存储器,以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述移动设备执行以下步骤:在检测到所述移动设备与所述第一电子设备断开点到点的直接连接后,所述移动设备广播第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。在接收到来自第二电子设备的第一响应消息后,所述移动设备与所述第二电子设备建立点到点的直接连接;所述第一响应消息与所述第一请求消息相关联。在接收到所述音频数据的未播放内容的全部或部分后,所述移动设备播放所述音频数据的未播放内容的全部或部分;所述音频数据的未播放内容的全部或部分来自所述第二电子设备。The mobile device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the mobile device to perform the following steps: After the mobile device and the first electronic device are disconnected from the point-to-point direct connection, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point direct connection request. After receiving the first response message from the second electronic device, the mobile device establishes a point-to-point direct connection with the second electronic device; the first response message is associated with the first request message. After receiving all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data comes from the second electronic device.
所述第二电子设备包括处理器、存储器,以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述第二电子设备执行以下步骤:接收到来自移动设备的第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求。所述第二电子设备向所述第三电子设备或所述第一电子设备发送第一通知消息,所述第一通知消息包括所述第二电子设备的标识、所述移动设备的标识以及用于指示所述第二电子设备发现了所述移动设备的信息。所述第二电子设备与所述移动设备建立点到点的直接连接。接收到来自所述第一电子设备的音频数据的未播放内容的全部或部分。所述第二电子设备向所述移动设备发送所述音频数据的未播放内容的全部或部分。The second electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the second electronic device to perform the following: Step: Receive a first request message from a mobile device; the first request message includes an identifier of the mobile device and a point-to-point direct connection request. The second electronic device sends a first notification message to the third electronic device or the first electronic device, where the first notification message includes the identifier of the second electronic device, the identifier of the mobile device, and the user information indicating that the mobile device has been discovered by the second electronic device. The second electronic device establishes a point-to-point direct connection with the mobile device. All or part of the unplayed content of the audio data is received from the first electronic device. The second electronic device transmits all or part of the unplayed content of the audio data to the mobile device.
所述第三电子设备包括处理器、存储器,以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述第三电子设备执行以下步骤:所述第三电子设备接收来自所述第一电子设备的第一告知消息;所述第一告知消息包括移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备建立了点到点的直接连接的第一告知信息。所述第三电子设备接收来自所述第一电子设备的第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。所述第三电子设备接收来自所述第二电子设备的第一通知消息,所述第一通知消息包括所述第二电子设备的标识、所述移动设备的标识以及所述第二电子设备与用于指示所述第二电子设备发现了所述移动设备的指示信息。所述第三电子设备向所述第一电子设备发送第一 消息;所述第一消息用于指示所述第二电子设备发现了所述移动设备的指示信息。The third electronic device includes a processor, a memory, and a computer program, wherein the computer program is stored on the memory, and when executed by the processor, causes the third electronic device to perform the following: Step: the third electronic device receives a first notification message from the first electronic device; the first notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The first notification information that the first electronic device has established a point-to-point direct connection. The third electronic device receives a second notification message from the first electronic device; the second notification message includes the identification of the mobile device, the identification of the first electronic device, and the relationship between the mobile device and the mobile device. The second notification information that the first electronic device disconnects the point-to-point direct connection. The third electronic device receives a first notification message from the second electronic device, and the first notification message includes an identification of the second electronic device, an identification of the mobile device, and the second electronic device and the Indication information for indicating that the second electronic device has discovered the mobile device. The third electronic device sends a first message to the first electronic device; the first message is used to indicate that the second electronic device has discovered the indication information of the mobile device.
第十七方面,提供一种计算机可读存储介质,计算机可读介质存储有计算机程序(也可以称为代码,或指令)当其在计算机上运行时,使得计算机执行上述第一方面至第三方面中任一方面的方法,或者使得计算机执行上述第一方面至第七方面中任一种实现方式中的方法。A seventeenth aspect provides a computer-readable storage medium, where the computer-readable medium stores a computer program (also referred to as code, or instruction), when it is run on a computer, to cause the computer to execute the above-mentioned first to third aspects The method of any one of the aspects, or causing a computer to execute the method of any one of the implementation manners of the above-mentioned first aspect to the seventh aspect.
第十七方面以及第十七方面中任意一种实现方式所对应的技术效果,可参见第一方面至第七方面、以及第一方面至第七方面中任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects corresponding to the seventeenth aspect and any one of the implementations of the seventeenth aspect, please refer to the first to seventh aspects and the technical effects corresponding to any one of the first to seventh aspects of the implementation , and will not be repeated here.
第十八方面,提供一种计算机程序产品,计算机程序产品包括:计算机程序(也可以称为代码,或指令),当计算机程序被运行时,使得计算机执行上述第一方面至第七方面中任一方面的方法,或者使得计算机执行上述第一方面至第七方面中任一种实现方式中的方法。An eighteenth aspect provides a computer program product, the computer program product comprising: a computer program (also referred to as code, or instructions), which, when the computer program is executed, causes the computer to execute any one of the first to seventh aspects above. The method of one aspect, or causing a computer to execute the method in any one of the implementation manners of the first aspect to the seventh aspect.
第十八方面以及第十八方面中任意一种实现方式所对应的技术效果,可参见第一方面至第七方面、以及第一方面至第七方面中任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects corresponding to the eighteenth aspect and any one of the implementations of the eighteenth aspect, please refer to the first to seventh aspects and the technical effects corresponding to any one of the first to seventh aspects. , and will not be repeated here.
附图说明Description of drawings
图1a为本申请实施例适用的一种应用场景示意图;FIG. 1a is a schematic diagram of an application scenario to which an embodiment of the present application is applicable;
图1b为本申请实施例适用的一种应用场景示意图;FIG. 1b is a schematic diagram of an application scenario to which an embodiment of the present application is applicable;
图2a为本申请实施例提供的一种移动设备100的结构示意图;FIG. 2a is a schematic structural diagram of a mobile device 100 according to an embodiment of the present application;
图2b为本申请实施例提供的一种电子设备200的结构示意图;FIG. 2b is a schematic structural diagram of an electronic device 200 according to an embodiment of the present application;
图3a为本申请实施例提供的一种通信方法的流程示意图;3a is a schematic flowchart of a communication method provided by an embodiment of the present application;
图3b为本申请实施例提供的另一种通信方法的流程示意图;3b is a schematic flowchart of another communication method provided by an embodiment of the present application;
图4a为本申请实施例提供的另一种通信方法的流程示意图;FIG. 4a is a schematic flowchart of another communication method provided by an embodiment of the present application;
图4b为本申请实施例提供的另一种通信方法的流程示意图;FIG. 4b is a schematic flowchart of another communication method provided by an embodiment of the present application;
图5为本申请实施例提供的通信方法中手机与耳机之间建立点到点的直接连接的方法一种流程示意图;5 is a schematic flowchart of a method for establishing a point-to-point direct connection between a mobile phone and an earphone in the communication method provided by the embodiment of the present application;
图6为本申请实施例提供的通信方法中手机与耳机之间断开蓝牙连接的一种流程示意图;6 is a schematic flowchart of disconnecting a Bluetooth connection between a mobile phone and an earphone in a communication method provided by an embodiment of the present application;
图7为本申请实施例提供的通信方法中手机与智能音箱之间建立连接的一种流程示意图;7 is a schematic flowchart of establishing a connection between a mobile phone and a smart speaker in a communication method provided by an embodiment of the present application;
图8为本申请实施例提供的通信方法中手机与智能音箱之间断开连接的一种流程示意图;8 is a schematic flowchart of disconnection between a mobile phone and a smart speaker in a communication method provided by an embodiment of the present application;
图9为本申请实施例提供的跨物理网端到端通信模型的架构示意图;9 is a schematic diagram of the architecture of a cross-physical network end-to-end communication model provided by an embodiment of the present application;
图10为本申请实施例提供的一种移动设备的结构示意图;FIG. 10 is a schematic structural diagram of a mobile device according to an embodiment of the present application;
图11为本申请实施例提供的一种电子设备的结构示意图。FIG. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在 本申请实施例的描述中,以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个或两个以上(包含两个)。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations of the present application. As used in the specification of this application and the appended claims, the singular expressions "a," "the," "above," "the," and "the" are intended to also include, for example, "a" or more" this expression unless the context clearly dictates otherwise. It should also be understood that, in the following embodiments of the present application, "at least one" and "one or more" refer to one or more than two (including two). The term "and/or", used to describe the association relationship of related objects, indicates that there can be three kinds of relationships; for example, A and/or B, can indicate: A alone exists, A and B exist at the same time, and B exists alone, A and B can be singular or plural. The character "/" generally indicates that the associated objects are an "or" relationship.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连接”包括直接连接和间接连接,除非另外说明。“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。References in this specification to "one embodiment" or "some embodiments" and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "including", "including", "having" and their variants mean "including but not limited to" unless specifically emphasized otherwise. The term "connected" includes both direct and indirect connections unless otherwise specified. "First" and "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implying the number of indicated technical features.
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or illustrations. Any embodiment or design described in the embodiments of the present application as "exemplarily" or "such as" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "such as" is intended to present the related concepts in a specific manner.
图1a和图1b为本申请实施例适用的一种应用场景示意图。FIG. 1a and FIG. 1b are schematic diagrams of an application scenario to which the embodiments of the present application are applied.
如图1a所示,移动设备100和电子设备200均处于卧室01中,图1a中移动设备100(图中以移动设备100为蓝牙耳机为例进行展示)蓝牙连接电子设备200(图中以电子设备200为手机为例进行展示),并播放电子设备200的音频数据,从而可以使用户通过移动设备100听到来自电子设备200的声音;比如,可以是音乐或语音通话内容等等。As shown in FIG. 1a, both the mobile device 100 and the electronic device 200 are located in the bedroom 01. In FIG. 1a, the mobile device 100 (in the figure, the mobile device 100 is shown as a Bluetooth headset as an example) is connected to the electronic device 200 (in the figure, the electronic device is shown as an example) via Bluetooth 200 is a mobile phone as an example), and play the audio data of the electronic device 200, so that the user can hear the sound from the electronic device 200 through the mobile device 100; for example, it can be music or voice call content.
移动设备100可能随着用户的移动,如图1b所示,移动设备100随着用户移动至客厅02,可能由于墙壁阻挡或距离增大等原因导致移动设备100与电子设备200之间的蓝牙连接断开。另一方面,移动设备100移动至距电子设备300较近的位置,移动设备100蓝牙连接电子设备300(图中以电子设备300为智能音箱为例进行展示)。电子设备300与电子设备200可以通过局域网连接。The mobile device 100 may move with the user. As shown in FIG. 1b, the mobile device 100 may move to the living room 02 with the user. The Bluetooth connection between the mobile device 100 and the electronic device 200 may be caused by the wall blocking or the increase of the distance. disconnect. On the other hand, the mobile device 100 moves to a position closer to the electronic device 300, and the mobile device 100 is connected to the electronic device 300 via Bluetooth (in the figure, the electronic device 300 is an example of a smart speaker for illustration). The electronic device 300 and the electronic device 200 may be connected through a local area network.
从上述图1a和图1b中可以看出,由于移动设备100随着用户移动,因此可能与电子设备200之间断开蓝牙连接,从而导致用户无法再继续通过移动设备100听到来自电子设备200的声音。It can be seen from the above-mentioned FIGS. 1 a and 1 b that since the mobile device 100 moves with the user, the Bluetooth connection may be disconnected from the electronic device 200 , so that the user can no longer hear the information from the electronic device 200 through the mobile device 100 . sound.
为了解决上述的技术问题,本申请实施例提出了两种方案,分别为方案A和方案B。下面分别对其进行介绍。In order to solve the above technical problems, two solutions are proposed in the embodiments of the present application, which are solution A and solution B, respectively. They are introduced separately below.
(1)方案A(1) Scheme A
如图1a所示,方案A还涉及电子设备400(图中以电子设备400为智能电视为例进行展示)。电子设备400可以理解为一个中心设备,电子设备200和电子设备300均向电子设备400上报各自的信息(比如标识、与其他设备之间的连接情况,以及运行的业务的相关情况)。As shown in FIG. 1a, the solution A also involves an electronic device 400 (in the figure, the electronic device 400 is a smart TV as an example for illustration). The electronic device 400 can be understood as a central device, and both the electronic device 200 and the electronic device 300 report their respective information (such as identification, connection with other devices, and running services) to the electronic device 400 .
在图1a所示的场景中,电子设备200可以向电子设备400上报与电子设备200连接的移动设备100的标识,电子设备400收到该信息后可以确定电子设备200与移动设备100处于连接状态。在图1b所示的场景中,当电子设备200与移动设备100之间断开连接,则电子设备200会向电子设备400上报与电子设备200断开连接的移动设备100的标识,电子设备400收到该信息后可以确定电子设备200与移动设备100处于连接断开状态。In the scenario shown in FIG. 1a, the electronic device 200 can report the identification of the mobile device 100 connected to the electronic device 200 to the electronic device 400, and the electronic device 400 can determine that the electronic device 200 and the mobile device 100 are in a connected state after receiving the information . In the scenario shown in FIG. 1 b , when the electronic device 200 is disconnected from the mobile device 100 , the electronic device 200 will report the identification of the mobile device 100 disconnected from the electronic device 200 to the electronic device 400 , and the electronic device 400 will receive After obtaining the information, it can be determined that the electronic device 200 and the mobile device 100 are in a disconnected state.
另一方面,在图1b所示的场景中,电子设备300与移动设备200建立连接后,会向电子设备400上报与电子设备300连接的移动设备100的标识,电子设备400收到该信息后可以确定电子设备300与移动设备100处于连接状态。进一步,电子设备400会向电子设备200发送移动设备100的标识,以及与移动设备100之间蓝牙连接的电子设备300的标识。进而,电子设备200将音频数据发送给电子设备300,电子设备300将该音频数据转发给移动设备100,从而可以在移动设备100与电子设备200断开蓝牙连接之后,通过该方案继续使移动设备100播放来自电子设备200的音频数据,从而使用户继续通过移动设备100收听来自电子设备200的声音。On the other hand, in the scenario shown in FIG. 1b, after the electronic device 300 establishes a connection with the mobile device 200, it will report the identity of the mobile device 100 connected to the electronic device 300 to the electronic device 400. After the electronic device 400 receives the information It may be determined that the electronic device 300 and the mobile device 100 are in a connected state. Further, the electronic device 400 will send the identification of the mobile device 100 and the identification of the electronic device 300 connected with the mobile device 100 via Bluetooth to the electronic device 200 . Further, the electronic device 200 sends the audio data to the electronic device 300, and the electronic device 300 forwards the audio data to the mobile device 100, so that after the mobile device 100 disconnects the Bluetooth connection from the electronic device 200, the mobile device can continue to be connected to the mobile device through this solution. 100 plays the audio data from the electronic device 200 , so that the user continues to listen to the sound from the electronic device 200 through the mobile device 100 .
(2)方案B(2) Scheme B
方案B不涉及电子设备400,即不涉及中心设备。这种情况下,当移动设备100与电子设备300建立蓝牙连接后,电子设备300可以通过广播或组播的方式通知电子设备200。进而电子设备200将音频数据发送给电子设备300,电子设备300将该音频数据转发给移动设备100。这样,可以在移动设备100与电子设备200断开蓝牙连接之后,通过该方案继续使移动设备100播放来自电子设备200的音频数据,从而使用户继续通过移动设备100收听来自电子设备200的声音。Scheme B does not involve the electronic device 400, that is, does not involve the central device. In this case, after the mobile device 100 establishes a Bluetooth connection with the electronic device 300, the electronic device 300 can notify the electronic device 200 through broadcast or multicast. Further, the electronic device 200 sends the audio data to the electronic device 300 , and the electronic device 300 forwards the audio data to the mobile device 100 . In this way, after the mobile device 100 is disconnected from the electronic device 200 via Bluetooth, the mobile device 100 can continue to play audio data from the electronic device 200 through this solution, so that the user can continue to listen to the sound from the electronic device 200 through the mobile device 100 .
基于上述本申请实施例提供的方案A和方案B举个例子:An example is given based on the scheme A and scheme B provided in the above-mentioned embodiments of the present application:
电子设备200进行的业务为音乐播放,当移动设备100与电子设备200之间蓝牙连接时,用户可以通过移动设备100收听来自电子设备200的音乐。当移动设备100与电子设备200之间断开连接后,移动设备100停止当前的音乐播放业务。当移动设备100与电子设备300之间蓝牙连接,电子设备300与电子设备200之间建立连接后,电子设备200可以继续执行音乐播放业务,并将音乐的音频数据发送给电子设备300,电子设备300将音频数据转发给移动设备100,从而使用户通过移动设备100继续收听来自电子设备200的音乐。The service performed by the electronic device 200 is music playback. When the mobile device 100 and the electronic device 200 are connected via Bluetooth, the user can listen to music from the electronic device 200 through the mobile device 100 . After the mobile device 100 is disconnected from the electronic device 200, the mobile device 100 stops the current music playing service. When the Bluetooth connection between the mobile device 100 and the electronic device 300 is established, and the connection between the electronic device 300 and the electronic device 200 is established, the electronic device 200 can continue to perform the music playback service and send the audio data of the music to the electronic device 300. The electronic device 300 forwards the audio data to the mobile device 100 so that the user continues to listen to music from the electronic device 200 through the mobile device 100 .
通过该示例可以看出,本申请实施例提供的方案可以在移动设备100与电子设备200断开蓝牙连接的情况下,通过电子设备300实现移动设备100与电子设备200的间接的连接,从而可以实现业务的接续。It can be seen from this example that the solution provided by the embodiment of the present application can realize the indirect connection between the mobile device 100 and the electronic device 200 through the electronic device 300 when the mobile device 100 and the electronic device 200 are disconnected from the Bluetooth connection, so that the mobile device 100 and the electronic device 200 can be indirectly connected. To achieve business continuity.
图2a示例性地示出了本申请实施例提供的一种移动设备100的硬件结构。如图2a所示,移动设备100可以包括处理器110,内部存储器121,按键122,马达123,指示器124,音频模块125,扬声器125A,麦克风125B,USB接口130,充电管理模块140,电源管理模块141,电池142,无线通信模块150,天线160等。FIG. 2a exemplarily shows a hardware structure of a mobile device 100 provided by an embodiment of the present application. As shown in FIG. 2a, the mobile device 100 may include a processor 110, an internal memory 121, buttons 122, a motor 123, an indicator 124, an audio module 125, a speaker 125A, a microphone 125B, a USB interface 130, a charge management module 140, a power management module Module 141, battery 142, wireless communication module 150, antenna 160, etc.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个 或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or Neural-network Processing Unit (NPU) Wait. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
其中,控制器可以是移动设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the mobile device 100 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行移动设备100的各种功能应用以及数据处理。Internal memory 121 may be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the mobile device 100 by executing the instructions stored in the internal memory 121 .
移动设备100可以通过音频模块125,扬声器125A,麦克风125B,以及应用处理器等实现音频功能。例如音乐播放,录音等。The mobile device 100 may implement audio functions through an audio module 125, a speaker 125A, a microphone 125B, an application processor, and the like. Such as music playback, recording, etc.
按键122包括开机键,音量键等。按键可以是机械按键。也可以是触摸式按键。移动设备100可以接收按键输入,产生与移动设备100的用户设置以及功能控制有关的键信号输入。The keys 122 include a power-on key, a volume key, and the like. The keys may be mechanical keys. It can also be a touch key. The mobile device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the mobile device 100 .
指示器124可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 124 can be an indicator light, which can be used to indicate the charging state, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like.
移动设备100还包括用于从充电器接收充电输入的充电管理模块140。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为移动设备100供电。The mobile device 100 also includes a charging management module 140 for receiving charging input from the charger. While the charging management module 140 charges the battery 142 , the mobile device 100 can also be powered by the power management module 141 .
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,和无线通信模块150等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 . The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the wireless communication module 150, and the like. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110 . In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
移动设备100的无线通信功能可以通过天线模块2,无线通信模块150,调制解调处理器以及基带处理器等实现。The wireless communication function of the mobile device 100 may be implemented by the antenna module 2, the wireless communication module 150, a modem processor, a baseband processor, and the like.
天线160用于发射和接收电磁波信号。移动设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将蜂窝网天线复用为无线局域网分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。The antenna 160 is used to transmit and receive electromagnetic wave signals. Each antenna in mobile device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the cellular network antenna can be multiplexed into a wireless local area network diversity antenna. In other embodiments, the antenna may be used in conjunction with a tuning switch.
无线通信模块150可以提供应用在移动设备100上的包括蓝牙(bluetooth,BT)、近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR),Wi-Fi,ZigBee等无线通信的解决方案。无线通信模块150可以是集成至少一个通信处理模块的一 个或多个器件。无线通信模块150经由天线160接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块150还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线160转为电磁波辐射出去。本申请实施例中,无线通信模块150用于发送第一用户的语音,以及翻译之后的目标语言的机器语音,或者对方用户发送的目标语言的语音,以及翻译之后的第一语言的机器语音。The wireless communication module 150 can provide wireless communication including Bluetooth (bluetooth, BT), near field communication (NFC), infrared technology (infrared, IR), Wi-Fi, ZigBee, etc. applied on the mobile device 100 s solution. The wireless communication module 150 may be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via the antenna 160 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 150 can also receive the signal to be sent from the processor 110 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 160 . In this embodiment of the present application, the wireless communication module 150 is configured to send the voice of the first user and the translated machine voice of the target language, or the voice of the target language sent by the opposite user, and the translated machine voice of the first language.
在一些实施例中,天线160和无线通信模块150耦合,使得移动设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括BT,NFC,ZigBee,Wi-Fi,和/或IR技术等。In some embodiments, the antenna 160 and the wireless communication module 150 are coupled such that the mobile device 100 can communicate with the network and other devices through wireless communication techniques. The wireless communication technology may include BT, NFC, ZigBee, Wi-Fi, and/or IR technology, and the like.
可以理解的是,图2a示意的结构并不构成对移动设备100的具体限定。在本申请另一些实施例中,移动设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure shown in FIG. 2 a does not constitute a specific limitation on the mobile device 100 . In other embodiments of the present application, the mobile device 100 may include more or less components than shown, or some components may be combined, or some components may be split, or different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
图2b示例性地示出了本申请实施例提供的一种电子设备200的硬件结构。如图2b所示,电子设备200可以包括处理器210,外部存储器接口220,内部存储器221,USB接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及SIM卡接口295等。其中传感器模块280可以包括压力传感器280A,陀螺仪传感器280B,气压传感器280C,磁传感器280D,加速度传感器280E,距离传感器280F,接近光传感器280G,指纹传感器280H,温度传感器280J,触摸传感器280K,环境光传感器280L,骨传导传感器280M等。FIG. 2b exemplarily shows a hardware structure of an electronic device 200 provided by an embodiment of the present application. As shown in FIG. 2b, the electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a USB interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, and a mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293, display screen 294, and SIM card interface 295 Wait. The sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, and ambient light. Sensor 280L, Bone Conduction Sensor 280M, etc.
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or Neural-network Processing Unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
其中,控制器可以是电子设备200的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 200 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in processor 210 is cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 210 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
还包括用于从充电器接收充电输入的充电管理模块240。充电管理模块240为电池242充电的同时,还可以通过电源管理模块241为电子设备200供电。Also included is a charge management module 240 for receiving charging input from the charger. While the charging management module 240 charges the battery 242 , the electronic device 200 can also be powered by the power management module 241 .
电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,外部存储器,显示屏294,摄像头293,和无线通信模块260等供电。电源管理模块241还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块241也可以设置于处理器210中。在另一些实施例中,电源管理模块241和充电管理模块240也可以设置于同一个器件中。The power management module 241 is used to connect the battery 242 , the charging management module 240 and the processor 210 . The power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260. The power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance). In some other embodiments, the power management module 241 may also be provided in the processor 210 . In other embodiments, the power management module 241 and the charging management module 240 may also be provided in the same device.
电子设备200的无线通信功能可以通过天线模块1,天线模块2移动通信模块250,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 200 may be implemented by the antenna module 1, the antenna module 2, the mobile communication module 250, the wireless communication module 160, a modem processor, a baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。电子设备200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将蜂窝网天线复用为无线局域网分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the cellular network antenna can be multiplexed into a wireless local area network diversity antenna. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块250可以提供应用在电子设备200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块250可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块250可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块250还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块250的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块250的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。The mobile communication module 250 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the electronic device 200 . The mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and then convert it into electromagnetic waves for radiation through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 250 may be provided in the processor 210 . In some embodiments, at least part of the functional modules of the mobile communication module 250 may be provided in the same device as at least part of the modules of the processor 210 .
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器270A,受话器270B等)输出声音信号,或通过显示屏294显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器210,与移动通信模块250或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs sound signals through audio devices (not limited to the speaker 270A, the receiver 270B, etc.), or displays images or videos through the display screen 294 . In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be independent of the processor 210, and may be provided in the same device as the mobile communication module 250 or other functional modules.
无线通信模块260可以提供应用在电子设备200上的包括无线局域网(wireless local area networks,WLAN),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)、Wi-Fi P2P、ZigBee等无线通信的解决方案。无线通信模块260可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块260经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块260还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。本申请实施例中,无线通信模块260用于发送第一用户的语音,以及翻译之后的目标语言的机器语音,或者对方用户发送的目标语言的语音,以及翻译之后的第一语言的机器语音。The wireless communication module 260 can provide applications on the electronic device 200 including wireless local area networks (WLAN), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (frequency modulation, FM), near field communication technology (NFC), infrared technology (infrared, IR), Wi-Fi P2P, ZigBee and other wireless communication solutions. The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2 , modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 . The wireless communication module 260 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 . In this embodiment of the present application, the wireless communication module 260 is configured to send the voice of the first user and the translated machine voice of the target language, or the voice of the target language sent by the opposite user, and the translated machine voice of the first language.
在一些实施例中,电子设备200的天线1和移动通信模块250耦合,天线2和无线通信模块260耦合,使得电子设备200可以通过无线通信技术与网络以及其他设备通信。所 述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS))和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 200 is coupled with the mobile communication module 250, and the antenna 2 is coupled with the wireless communication module 260, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc. The GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS)) and/or satellite based augmentation systems (SBAS).
电子设备200通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 200 implements a display function through a GPU, a display screen 294, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏294用于显示图像,视频等。显示屏294包括显示面板。显示面板可以采用LCD(liquid crystal display,液晶显示屏),OLED(organic light-emitting diode,有机发光二极管),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备200可以包括1个或N个显示屏,N为大于1的正整数。本申请实施例中,显示屏294可以用于显示通话界面和翻译界面,以及语言设置界面等。Display screen 294 is used to display images, videos, and the like. Display screen 294 includes a display panel. The display panel can be LCD (liquid crystal display, liquid crystal display), OLED (organic light-emitting diode, organic light emitting diode), active matrix organic light emitting diode or active matrix organic light emitting diode (active-matrix organic light) emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 200 may include 1 or N display screens, where N is a positive integer greater than 1. In this embodiment of the present application, the display screen 294 may be used to display a call interface, a translation interface, a language setting interface, and the like.
电子设备200可以通过ISP,摄像头293,视频编解码器,GPU,显示屏294以及应用处理器等实现拍摄功能。The electronic device 200 can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294 and the application processor.
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备200的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example to save files like music, video etc in external memory card.
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行电子设备200的各种功能应用以及数据处理。存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备200使用过程中所创建的数据(比如音频数据,电话本等)等。此外,存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。Internal memory 221 may be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by executing the instructions stored in the internal memory 221 . The memory 221 may include a storage program area and a storage data area. The storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like. The storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 200 and the like. In addition, the memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
电子设备200可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, and an application processor. Such as music playback, recording, etc.
电子设备200还包括一些传感器,例如压力传感器280A、陀螺仪传感器280B、气压传感器280C、磁传感器280D、加速度传感器280E、距离传感器280F、接近光传感器280G、环境光传感器280L、指纹传感器280H、温度传感器280J、触摸传感器280K、骨传导传感器280M等。The electronic device 200 also includes sensors such as a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, an ambient light sensor 280L, a fingerprint sensor 280H, a temperature sensor 280J, touch sensor 280K, bone conduction sensor 280M, etc.
压力传感器280A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器280A可以设置于显示屏294。压力传感器280A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少 两个具有导电材料的平行板。当有力作用于压力传感器280A,电极之间的电容改变。电子设备200根据电容的变化确定压力的强度。当有触摸操作作用于显示屏294,电子设备200根据压力传感器280A检测所述触摸操作强度。电子设备200也可以根据压力传感器280A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 280A is used to sense pressure signals, and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 280A may be provided on the display screen 294 . There are many types of pressure sensors 280A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, and the like. The capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to pressure sensor 280A, the capacitance between the electrodes changes. The electronic device 200 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 294, the electronic device 200 detects the intensity of the touch operation according to the pressure sensor 280A. The electronic device 200 may also calculate the touched position according to the detection signal of the pressure sensor 280A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
触摸传感器280K,也称“触控面板”。可设置于显示屏294。用于检测作用于其上或附近的触摸操作。可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型,并通过显示屏294提供相应的视觉输出。在另一些实施例中,触摸传感器280K也可以设置于电子设备200的表面,与显示屏294所处的位置不同。本申请实施例中,触控面板用于接收第一操作、语言设置控件的确认操作、关闭操作、退出操作等触摸操作。Touch sensor 280K, also called "touch panel". It can be set on the display screen 294 . Used to detect touches on or near it. Detected touch operations can be passed to an application processor to determine the type of touch event and provide corresponding visual output via display screen 294 . In other embodiments, the touch sensor 280K may also be disposed on the surface of the electronic device 200 , which is different from the location where the display screen 294 is located. In the embodiment of the present application, the touch panel is used to receive touch operations such as a first operation, a confirmation operation of the language setting control, a closing operation, and an exit operation.
按键290包括开机键,音量键等。按键可以是机械按键。也可以是触摸式按键。电子设备200可以接收按键输入,产生与电子设备200的用户设置以及功能控制有关的键信号输入。The keys 290 include a power-on key, a volume key, and the like. The keys may be mechanical keys. It can also be a touch key. The electronic device 200 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 200 .
马达291可以产生振动提示。指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口295用于连接用户标识模块(subscriber identity module,SIM)。Motor 291 can generate vibrating cues. The indicator 292 can be an indicator light, which can be used to indicate the charging status, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like. The SIM card interface 295 is used to connect a subscriber identity module (SIM).
尽管图2b中未示出,电子设备200还可以包括定位装置、闪光灯、微型投影装置等,在此不予赘述。Although not shown in FIG. 2b, the electronic device 200 may further include a positioning device, a flash, a micro-projection device, etc., which will not be repeated here.
电子设备300以及电子设备400中的任一项的结构形式可以参见前述电子设备200的结构形式,不再赘述。电子设备300的硬件结构可以包括比图2b所示的电子设备200更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。For the structural form of any one of the electronic device 300 and the electronic device 400, reference may be made to the structural form of the electronic device 200, which will not be repeated. The hardware structure of the electronic device 300 may include more or less components than the electronic device 200 shown in FIG. 2b, or some components may be combined, or some components may be split, or different component arrangements.
本申请实施例中,移动设备100包括但不限于蓝牙耳机、具备无线通讯功能的可穿戴电子设备(如智能手表、智能手环、智能戒指、智能眼镜)等。电子设备200可以包括但不限于智能手机、智能电视(智能大屏)、平板电脑等。电子设备300或电子设备400中的任意一项可以包括但不限于:智能手机、智能电视(智能电视)、路由器、智能音箱、智能空调、平板电脑等。In this embodiment of the present application, the mobile device 100 includes, but is not limited to, a Bluetooth headset, a wearable electronic device with a wireless communication function (such as a smart watch, a smart bracelet, a smart ring, and smart glasses). The electronic device 200 may include, but is not limited to, a smart phone, a smart TV (smart large screen), a tablet computer, and the like. Any one of the electronic device 300 or the electronic device 400 may include, but is not limited to, a smart phone, a smart TV (smart TV), a router, a smart speaker, a smart air conditioner, a tablet computer, and the like.
移动设备100、电子设备200、电子设备300和电子设备400中的任一项的软件操作系统可以包括但不限于:
Figure PCTCN2021137058-appb-000001
Windows、Linux或者其它操作系统。
The software operating system of any one of mobile device 100, electronic device 200, electronic device 300, and electronic device 400 may include, but is not limited to:
Figure PCTCN2021137058-appb-000001
Windows, Linux or other operating systems.
可以理解的是,图2b示意的结构并不构成对电子设备200的具体限定。在本申请另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure shown in FIG. 2 b does not constitute a specific limitation on the electronic device 200 . In other embodiments of the present application, the electronic device 200 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
基于上述图1a至图2b所示的内容,图3a示例性地示出了本申请实施例提供的一种通信方法的流程。为了更清楚的介绍本申请实施例提供的方案,下面以移动设备100为耳机,电子设备200为手机,电子设备300为智能音箱,电子设备400为智能电视进行介绍。需要说明的是,本申请实施例中的电子设备200可以前述内容中的第一电子设备,电子设备300可以前述内容中的第二电子设备,电子设备400可以前述内容中的第三电子设备,移 动设备100可以前述内容中的移动设备。Based on the contents shown in the foregoing FIG. 1a to FIG. 2b, FIG. 3a exemplarily shows a flow of a communication method provided by an embodiment of the present application. In order to introduce the solutions provided by the embodiments of the present application more clearly, the mobile device 100 is an earphone, the electronic device 200 is a mobile phone, the electronic device 300 is a smart speaker, and the electronic device 400 is a smart TV. It should be noted that the electronic device 200 in this embodiment of the present application may be the first electronic device in the foregoing content, the electronic device 300 may be the second electronic device in the foregoing content, and the electronic device 400 may be the third electronic device in the foregoing content. The mobile device 100 may be a mobile device in the foregoing.
如图3a所示,该方法包括:As shown in Figure 3a, the method includes:
S301,手机与耳机之间建立点到点的直接连接。S301, a point-to-point direct connection is established between the mobile phone and the headset.
本申请实施例中,耳机与手机之间的连接,是点到点的直接连接。耳机与手机之间可以基于蓝牙(bluetooth,BT)、无线保真(wireless fidelity,Wi-Fi)P2P、ZigBee等技术建立点到点的连接。In the embodiment of the present application, the connection between the earphone and the mobile phone is a point-to-point direct connection. A point-to-point connection can be established between the headset and the mobile phone based on technologies such as Bluetooth (bluetooth, BT), wireless fidelity (wireless fidelity, Wi-Fi) P2P, ZigBee, and the like.
S302,手机可以向智能电视发送第一告知消息,第一告知消息可以包括手机标识(identification,ID),耳机ID,以及手机与耳机建立点到点的直接连接的第一告知信息。S302, the mobile phone may send a first notification message to the smart TV, where the first notification message may include a mobile phone identification (ID), an earphone ID, and first notification information for establishing a point-to-point direct connection between the mobile phone and the earphone.
耳机的ID例如可以包括媒体访问控制(medium access control,MAC)地址、设备名称、IP地址和端口号的组合等中的至少一种。手机的ID例如可以包括媒体访问控制(medium access control,MAC)地址、设备名称、IP地址和端口号的组合等中的至少一种。The ID of the headset may include, for example, at least one of a media access control (Medium access control, MAC) address, a device name, a combination of an IP address and a port number, and the like. The ID of the mobile phone may include, for example, at least one of a media access control (medium access control, MAC) address, a device name, a combination of an IP address and a port number, and the like.
又一种可能的实施方式中,第一告知消息还可以包括用于指示手机与耳机之间建立点到点的直接连接所采用的协议,比如手机与耳机之间是蓝牙连接,则第一告知消息中还可以包括有用于指示手机与耳机之间的点到点的直接连接是基于蓝牙协议的指示信息。第一告知消息中还可以包括有用于指示手机和耳机之间具有蓝牙配对关系的指示信息。In another possible implementation manner, the first notification message may further include a protocol used to indicate that a point-to-point direct connection is established between the mobile phone and the headset. For example, if the mobile phone and the headset are connected via Bluetooth, the first notification The message may also include indication information for indicating that the point-to-point direct connection between the mobile phone and the headset is based on the Bluetooth protocol. The first notification message may further include indication information for indicating that there is a Bluetooth pairing relationship between the mobile phone and the headset.
可选地,第一告知消息还可以包括有手机正在进行的业务的相关信息,比如业务标识(比如播放音乐)、业务状态(比如当前正在进行中)等等。Optionally, the first notification message may further include information about the ongoing service of the mobile phone, such as a service identifier (such as playing music), service status (such as currently in progress), and the like.
本申请实施例中,智能电视可以作为一个中心设备。一种可能的实施方式中,与该中心设备处于同一个局域网的设备都可以在中心设备上注册,并向中心设备上报自身的一些信息(比如ID,与设备自身具有配对关系的设备的ID,当前与其他设备的连接关系,设备自身所执行的业务等)。比如,手机、智能电视和智能音箱同处于同一个局域网中,手机和智能音箱分别向智能电视上报自身的信息,手机还可以向智能电视上报与手机具有配对关系的设备的标识(比如耳机的标识)。智能音箱也可以向智能电视上报与智能音箱具有配对关系的设备的标识。In this embodiment of the present application, the smart TV can be used as a central device. In a possible implementation, all devices in the same local area network as the central device can register on the central device, and report some information about themselves to the central device (such as ID, the ID of the device that has a pairing relationship with the device itself, The current connection relationship with other devices, the business performed by the device itself, etc.). For example, a mobile phone, a smart TV and a smart speaker are in the same local area network. The mobile phone and the smart speaker report their own information to the smart TV respectively. ). The smart speaker can also report to the smart TV the identity of the device that has a pairing relationship with the smart speaker.
S303,手机向耳机发送音频数据。S303, the mobile phone sends audio data to the headset.
用户可以在手机上进行操作,以便在手机上开启业务(比如播放音乐)。手机接收到来自用户的一个输入,则可以响应于该输入,开启播放音乐的业务,并向所述手机发送音乐对应的音频数据,以使用户通过耳机听到手机上播放的音乐。Users can operate on the mobile phone to start a business (such as playing music) on the mobile phone. When the mobile phone receives an input from the user, in response to the input, the service of playing music can be started, and the audio data corresponding to the music can be sent to the mobile phone, so that the user can listen to the music played on the mobile phone through the earphone.
需要说明的是,用户也可能在S301之前已经进行了操作,比如触摸手机的触摸屏或按钮以开启播放音乐的业务。这种情况下,当通过S301耳机与手机之间建立连接之后,可以有两种可能的实施方式:一种是默认通过与耳机播放音乐;另外一种是弹出提示,比如“是否通过耳机播放音频?”,由用户在手机进行操作,用户点击“是”,则手机基于该输入确认音乐的音频数据通过耳机播放。It should be noted that the user may have performed operations before S301, such as touching the touch screen or button of the mobile phone to start the service of playing music. In this case, when the connection is established between the S301 headset and the mobile phone, there are two possible implementations: one is to play music through the headset by default; the other is to pop up a prompt, such as "whether to play audio through the headset or not. ?", the user operates on the mobile phone, the user clicks "Yes", and the mobile phone confirms that the audio data of the music is played through the headset based on the input.
需要说明的是,上述S302与上述S303并没有绝对的先后顺序,比如也可以先执行S303,再执行S302。It should be noted that the above S302 and the above S303 do not have an absolute sequence, for example, S303 may be executed first, and then S302 may be executed.
S304,耳机根据接收到的音频数据进行播放。S304, the headset plays according to the received audio data.
通过S304,用户可以通过耳机收听手机上播放的音乐。Through S304, the user can listen to the music played on the mobile phone through the earphone.
一种可能的实施方式中,随着耳机的移动,耳机与手机之间的距离逐渐加大,因此可能会发生S305中耳机与手机端口连接的情况。In a possible implementation manner, as the earphone moves, the distance between the earphone and the mobile phone gradually increases, so the situation in which the earphone and the mobile phone port are connected in S305 may occur.
S305,所述耳机与所述手机之间断开连接。S305, the headset is disconnected from the mobile phone.
S306,手机向智能电视发送第二告知消息,第二告知消息包括手机ID,耳机ID,以及用于指示手机与耳机断开连接的指示信息。S306, the mobile phone sends a second notification message to the smart TV, where the second notification message includes the mobile phone ID, the headset ID, and indication information used to instruct the mobile phone to disconnect from the headset.
一种可能地实施方式中,在检测到所述手机与所述耳机断开点到点的直接连接后,所述手机暂停播放所述音频数据,并记录第一暂停标记。又一种可能地实施方式中,所述手机通过所述手机的扬声器继续播放所述音频数据。In a possible implementation manner, after detecting that the mobile phone and the headset are disconnected from the point-to-point direct connection, the mobile phone pauses to play the audio data, and records a first pause mark. In another possible implementation manner, the mobile phone continues to play the audio data through a speaker of the mobile phone.
S307,耳机广播第一请求消息。第一请求消息中可以包括有耳机的ID。S307, the headset broadcasts the first request message. The first request message may include the ID of the headset.
随着耳机的移动,耳机可能会移动到智能音箱附近,从而使智能音箱执行S308。As the headset moves, the headset may move near the smart speaker, causing the smart speaker to perform S308.
S308,智能音箱接收到来自耳机的第一请求消息。S308, the smart speaker receives the first request message from the headset.
由于S308中智能音箱可以接收到耳机的信号,因此可以反映出耳机处于可以与智能音箱建立连接的位置区域范围内,智能音箱具有与耳机之间建立连接的能力。Since the smart speaker in S308 can receive the signal from the earphone, it can reflect that the earphone is within the range of the location where the connection can be established with the smart speaker, and the smart speaker has the ability to establish a connection with the earphone.
针对上述S307和S308,在一种可能的实施方式中,耳机可以周期性的广播第一请求消息。第一请求消息可以包括耳机的ID,智能音箱收到该信息时即确定耳机已经移动至可以与智能音箱建立连接的位置区域范围内。For the above S307 and S308, in a possible implementation manner, the headset may periodically broadcast the first request message. The first request message may include the ID of the earphone, and when the smart speaker receives the information, it determines that the earphone has moved within the range of a location area where a connection can be established with the smart speaker.
针对上述S307和S308,在又一种可能的实施方式中,智能音箱可以通过蓝牙发现过程发现耳机。比如,耳机周期性发送耳机的蓝牙身份标识报文(耳机的蓝牙身份标识报文可以包括耳机的ID)。智能音箱可以周期性发送智能音箱的蓝牙身份标识报文(智能音箱的蓝牙身份标识报文可以包括智能音箱的ID,智能音箱的ID比如可以为智能音箱的MAC地址、设备名称等)。当耳机收到该智能音箱的蓝牙身份标识报文时向智能音箱发送回应信息(该回应信息可以为FHS报文,该回应消息可以为上述第一请求消息),当智能音箱收到该回应信息,则确定蓝牙发现该耳机。For the above S307 and S308, in yet another possible implementation, the smart speaker can discover the headset through a Bluetooth discovery process. For example, the headset periodically sends a Bluetooth identification packet of the headset (the Bluetooth identification packet of the headset may include the ID of the headset). The smart speaker can periodically send the Bluetooth identification message of the smart speaker (the Bluetooth identification message of the smart speaker can include the ID of the smart speaker, and the ID of the smart speaker can be, for example, the MAC address of the smart speaker, device name, etc.). When the headset receives the Bluetooth identification message of the smart speaker, it sends a response message to the smart speaker (the response message can be an FHS message, and the response message can be the first request message above), and when the smart speaker receives the response message , it is determined that the headset is discovered by Bluetooth.
S309,智能音箱与耳机之间建立点到点的直接连接。S309, establishes a point-to-point direct connection between the smart speaker and the headset.
本申请实施例中,耳机与智能音箱之间的连接,是点到点的直接连接。耳机与智能音箱之间可以基于BT、Wi-Fi P2P、ZigBee等技术建立点到点的连接。In the embodiment of the present application, the connection between the earphone and the smart speaker is a point-to-point direct connection. A point-to-point connection can be established between the headset and the smart speaker based on BT, Wi-Fi P2P, ZigBee and other technologies.
在一种可能地实施方式中,耳机可以在接收到来自智能音箱的第一响应消息后,所述耳机与所述智能音箱建立点到点的直接连接;所述第一响应消息与所述第一请求消息相关联。In a possible implementation manner, after receiving the first response message from the smart speaker, the headset may establish a point-to-point direct connection with the smart speaker; the first response message and the first response message associated with a request message.
S310,智能音箱可以向智能电视发送第一通知消息,第一通知消息可以包括智能音箱标识(identification,ID),耳机ID,以及智能音箱与耳机建立点到点的直接连接的第一通知信息。S310, the smart speaker may send a first notification message to the smart TV, where the first notification message may include the smart speaker identification (ID), the earphone ID, and the first notification information for establishing a point-to-point direct connection between the smart speaker and the earphone.
智能音箱的ID例如可以包括媒体访问控制(medium access control,MAC)地址、设备名称、IP地址和端口号的组合等中的至少一种。The ID of the smart speaker may include, for example, at least one of a media access control (medium access control, MAC) address, a device name, a combination of an IP address and a port number, and the like.
又一种可能的实施方式中,第一通知消息还可以包括用于指示智能音箱与耳机之间建立点到点的直接连接所采用的协议,比如智能音箱与耳机之间是蓝牙连接,则第一通知消息中还可以包括有用于指示智能音箱与耳机之间的点到点的直接连接是基于蓝牙协议的指示信息。第一通知消息中还可以包括有用于指示智能音箱和耳机之间具有蓝牙配对关系的指示信息。In another possible implementation manner, the first notification message may also include a protocol used to indicate that a point-to-point direct connection is established between the smart speaker and the headset. For example, if the smart speaker and the headset are connected via Bluetooth, the first A notification message may also include indication information for indicating that the point-to-point direct connection between the smart speaker and the headset is based on the Bluetooth protocol. The first notification message may also include indication information for indicating that the smart speaker and the headset have a Bluetooth pairing relationship.
又一种可能地实施方式中,第一通知消息中还可以包括有智能音箱接收到的耳机的信号(比如FHS报文)的接收信号强度指示(received signal strength indicator,RSSI)的值,可以通过该RSSI的值反映出智能音箱与耳机之间靠近的程度,或者可以描述为通过RSSI 的值反映智能音箱和耳机之间距离的远近。当RSSI的值较小,则说明智能音箱和耳机之间的距离较远,当RSSI的值较大,则说明智能音箱和耳机之间的距离较近。In another possible implementation, the first notification message may also include the value of the received signal strength indicator (RSSI) of the signal (such as the FHS message) of the earphone received by the smart speaker. The value of the RSSI reflects the proximity between the smart speaker and the headset, or can be described as reflecting the distance between the smart speaker and the headset through the RSSI value. When the value of RSSI is small, it means that the distance between the smart speaker and the headset is farther, and when the value of RSSI is large, it means that the distance between the smart speaker and the headset is short.
S311,智能电视接收到第一通知消息之后,可以确定出最近与第一通知消息中的耳机断开连接的设备的ID,从而得到该手机的ID。S311 , after receiving the first notification message, the smart TV can determine the ID of the device recently disconnected from the headset in the first notification message, thereby obtaining the ID of the mobile phone.
上述S311中,可以有另外一种可能的实施方式,智能电视收到该第一通知消息之后,可以确定出与第一通知消息中的耳机的ID具有配对关系的一个或多个设备的ID(其中会包括有手机的ID)。智能电视可以仅向最近与耳机断开的设备(手机)发送第一消息,也可以向确定出的与第一通知消息中的耳机的ID具有配对关系的一个或多个设备中的至少一个设备发送第一消息,以使这些设备中的一个或多个均可以通过智能音箱共享该耳机。当智能电视向多个设备发送第一消息后,其中每个设备所执行的后续流程与手机后续执行的流程类似,可以参见后续S312至S320的相关内容。In the above S311, there may be another possible implementation. After receiving the first notification message, the smart TV may determine the IDs of one or more devices that have a pairing relationship with the ID of the headset in the first notification message ( which will include the ID of the phone). The smart TV can only send the first message to the device (mobile phone) that has recently been disconnected from the headset, or can send the first message to at least one of the determined one or more devices that have a pairing relationship with the headset ID in the first notification message. A first message is sent so that one or more of these devices can share the headset through the smart speaker. After the smart TV sends the first message to a plurality of devices, the subsequent process performed by each device is similar to the subsequent process performed by the mobile phone, and reference may be made to the subsequent related content of S312 to S320.
S312,智能电视根据确定出的手机的ID,向手机发送第一消息,第一消息可以包括智能音箱标识(identification,ID),耳机ID,以及用于指示智能音箱与耳机建立点到点的直接连接的指示信息。S312, the smart TV sends a first message to the mobile phone according to the determined ID of the mobile phone, and the first message may include the identification (ID) of the smart speaker, the ID of the headset, and the direct connection between the smart speaker and the headset to establish a point-to-point connection. Connection instructions.
又一种可能的实施方式中,第一消息还可以包括用于指示智能音箱与耳机之间建立点到点的直接连接所采用的协议,比如智能音箱与耳机之间是蓝牙连接,则第一消息中还可以包括有用于指示智能音箱与耳机之间的点到点的直接连接是基于蓝牙协议的指示信息。第一消息中还可以包括有用于指示智能音箱和耳机之间具有蓝牙配对关系的指示信息。In another possible implementation manner, the first message may also include a protocol used to indicate that a point-to-point direct connection is established between the smart speaker and the headset. For example, if the smart speaker and the headset are connected via Bluetooth, the first message The message may also include indication information for indicating that the point-to-point direct connection between the smart speaker and the headset is based on the Bluetooth protocol. The first message may also include indication information for indicating that there is a Bluetooth pairing relationship between the smart speaker and the headset.
S313,手机接收到来自智能电视的第一消息。S313, the mobile phone receives the first message from the smart TV.
S314,手机判断第一消息中的耳机的ID是否为:与手机具有配对关系的一个或多个耳机的ID中的一个。S314, the mobile phone determines whether the ID of the headset in the first message is one of the IDs of one or more headsets that have a pairing relationship with the mobile phone.
若是,则执行S315或S316。若否,则可以结束该流程。If yes, execute S315 or S316. If not, the process can end.
具体地,若手机与智能音箱连接局域网,使用的是TCP/IP协议,则执行S315;若手机与智能音箱连接局域网,使用的是UDP协议,则执行S316。Specifically, if the mobile phone and the smart speaker are connected to the local area network and the TCP/IP protocol is used, then S315 is performed; if the mobile phone and the smart speaker are connected to the local area network and the UDP protocol is used, then the S316 is performed.
在一种可能的实施方式中,手机上存储有与手机具有配对关系的设备的ID。手机可能与一个或多个设备具有配对关系。In a possible implementation manner, the mobile phone stores an ID of a device that has a pairing relationship with the mobile phone. Your phone may be paired with one or more devices.
需要说明的是,本申请实施例中的两个设备之间具有配对关系,可以是指该两个设备具有认证关系,可以理解为该两个设备具有互相认证成功的关系,该配对关系比如可以为基于蓝牙技术的蓝牙配对关系。It should be noted that the pairing relationship between the two devices in the embodiments of the present application may mean that the two devices have an authentication relationship. It can be understood that the two devices have a successful mutual authentication relationship. For example, the pairing relationship can be It is a Bluetooth pairing relationship based on Bluetooth technology.
在又一种可能的实施方式中,S314中手机可以判断当前是否有音频播放业务(比如音乐播放业务)被暂停(比如前述S303中通过耳机播放手机上的音乐,而当耳机与手机断开连接后,该音乐播放业务被暂停);且需判断此前用于播放该音频播放业务的音频数据的设备的ID是否与第一消息中的耳机的ID为同一个,若经判断,当前有音频播放业务(比如音乐播放业务)被暂停,且此前用于播放该音频播放业务的音频数据的设备的ID与第一消息中的耳机的ID为同一个,则执行S315或S316。否则,结束该流程。In another possible implementation, in S314, the mobile phone can determine whether an audio playback service (such as a music playback service) is currently suspended (for example, in the aforementioned S303, the music on the mobile phone is played through the headset, and when the headset is disconnected from the mobile phone) After, this music playing service is suspended); And need to judge whether the ID of the equipment used to play the audio data of this audio playing service before is the same as the ID of the headset in the first message, if judged, there is currently audio playing The service (such as the music playing service) is suspended, and the ID of the device used to play the audio data of the audio playing service is the same as the ID of the earphone in the first message, then execute S315 or S316. Otherwise, end the process.
在又一种可能的实施方式中,S314中手机可以判断当前是否正在执行音频播放业务(比如前述S303中通过耳机播放手机上的音乐,而当耳机与手机断开连接后,该音乐播放业务未被暂停,而是通过手机本身的扬声器播放音乐);且需判断此前用于播放该音频播放业务的音频数据的设备的ID是否与第一消息中的耳机的ID为同一个,若经判断,当前有正在执行音频播放业务,且此前用于播放该音频播放业务的音频数据的设备的ID与 第一消息中的耳机的ID为同一个,则执行S315或S316。否则,则结束该流程。In another possible implementation, in S314, the mobile phone can determine whether the audio playback service is currently being performed (for example, the music on the mobile phone is played through the earphone in the aforementioned S303, and when the earphone is disconnected from the mobile phone, the music playback service is not performed. be suspended, but play music through the loudspeaker of the mobile phone itself); and need to judge whether the ID of the device used to play the audio data of this audio playback service before is the same as the ID of the headset in the first message, if it is judged, There is an audio playing service currently being performed, and the ID of the device used to play the audio data of the audio playing service before is the same as the ID of the headset in the first message, then execute S315 or S316. Otherwise, end the process.
又一种可能地实施方式中,S314和前述S311中可以存在一个步骤,比如,当存在上述S311时,由于智能电视仅向与耳机具有配对关系的设备发送第一消息,因此可以不需要执行S314。又一种可能地实施方式中,可以没有S311,这种情况下,智能电视收到第一通知消息后可以在局域网中广播或组播第一消息,从而使手机收到第一消息。In another possible implementation, there may be a step in S314 and the aforementioned S311. For example, when the aforementioned S311 exists, since the smart TV only sends the first message to the device with the pairing relationship with the headset, it is unnecessary to perform S314. . In another possible implementation, S311 may be omitted. In this case, after receiving the first notification message, the smart TV may broadcast or multicast the first message in the local area network, so that the mobile phone receives the first message.
在又一种可能地实施方式中,S314也可以替换为以下实施方式,在该实施方式中,手机接收到来自智能音箱或智能电视的一个消息。通过以下方式确定该消息是否为第一消息(即是否满足第一消息的预设的要求),若是第一消息,则手机向智能音箱发送音频数据。其中一种可能地实施方式中,手机可以在从所述消息中获取到所述耳机的标识后,确定所述消息为所述第一消息。又一种可能地实施方式中,手机可以在从所述消息中获取到所述耳机的标识和所述智能音箱的标识后,确定所述消息为所述第一消息。又一种可能地实施方式中,手机可以在从所述消息中获取到所述耳机的标识,所述智能音箱的标识,以及所述耳机与所述智能音箱建立了点到点的直接连接的指示信息后,确定所述消息为所述第一消息。In another possible implementation manner, S314 may also be replaced with the following implementation manner, in which the mobile phone receives a message from a smart speaker or a smart TV. Whether the message is the first message (that is, whether it meets the preset requirements of the first message) is determined in the following manner, and if it is the first message, the mobile phone sends audio data to the smart speaker. In one possible implementation manner, the mobile phone may determine that the message is the first message after acquiring the identifier of the headset from the message. In another possible implementation manner, the mobile phone may determine that the message is the first message after acquiring the identifier of the earphone and the identifier of the smart speaker from the message. In another possible implementation manner, the mobile phone can obtain the identifier of the earphone, the identifier of the smart speaker, and the point-to-point direct connection between the earphone and the smart speaker from the message. After indicating the information, it is determined that the message is the first message.
S315,手机和智能音箱之间建立连接。S315, establish a connection between the mobile phone and the smart speaker.
本申请实施例中,手机和智能音箱之间的连接可以基于以下任意一项技术建立连接:无线局域网(wireless local area networks,WLAN),无线保真(wireless fidelity,Wi-Fi)、全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),全球卫星导航系统和全球导航卫星系统(global navigation satellite system,GNSS),长期演进(long term evolution,LTE),第四代移动网络(the 4th generation,4G),第五代移动网络(the 5th generation,5G),以及未来的第六代移动网络(the 6th generation,6G)等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS))和/或星基增强系统(satellite based augmentation systems,SBAS)。In this embodiment of the present application, the connection between the mobile phone and the smart speaker may be established based on any one of the following technologies: wireless local area networks (WLAN), wireless fidelity (Wi-Fi), global mobile communication System (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access) , WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), global satellite navigation system and global navigation satellite system (global navigation satellite system, GNSS), long term evolution (long term evolution, LTE) , the fourth generation mobile network (the 4th generation, 4G), the fifth generation mobile network (the 5th generation, 5G), and the future sixth generation mobile network (the 6th generation, 6G) and so on. The GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS)) and/or satellite based augmentation systems (SBAS).
比如,手机与智能音箱可以通过连接同一路由器,接入同一局域网。For example, mobile phones and smart speakers can be connected to the same local area network by connecting to the same router.
在S315之后,在一种可能的实施方式中,手机可以向智能音箱发送请求消息。该请求消息用于请求共享该耳机。在一种可能的实施方式中,所述智能音箱可以直接向手机发送接受消息,该接受消息用于指示允许所述手机和所述智能音箱共享所述耳机。在又一种可能的实施方式中,智能音箱可以在智能音箱的界面上展示提示信息,例如在智能音箱的界面上展示:“是否希望与手机共享耳机?”。用户可以在智能音箱的界面上进行操作,以便输入信息,若该输入信息用于指示允许所述手机和所述智能音箱共享所述耳机,则智能音箱向手机发送接受消息,该接受消息用于指示智能音箱允许和所述耳机共享所述耳机。After S315, in a possible implementation manner, the mobile phone may send a request message to the smart speaker. The request message is used to request to share the headset. In a possible implementation manner, the smart speaker may directly send an acceptance message to the mobile phone, where the acceptance message is used to indicate that the mobile phone and the smart speaker are allowed to share the headset. In yet another possible implementation, the smart speaker may display prompt information on the interface of the smart speaker, for example, displaying on the interface of the smart speaker: "Do you want to share the headset with your mobile phone?". The user can operate on the interface of the smart speaker to input information. If the input information is used to indicate that the mobile phone and the smart speaker are allowed to share the headset, the smart speaker sends an acceptance message to the mobile phone, which is used for Instructs the smart speaker to allow sharing of the headset with the headset.
在S315之后,在又一种可能的实施方式中,手机可以向智能音箱发送通知消息,该通知消息可以用于通知智能音箱将接收到的来自手机的数据转发给耳机。在又一种可能的实施方式中,该通知消息用于通知智能音箱建立两个连接(即智能音箱与耳机之间的连接,以及智能音箱与手机之间的连接)的对应关系(也可以理解为对两个通道进行绑定),从 而在后续智能音箱接收到来自手机的数据后,会向耳机转发该数据。After S315, in another possible implementation manner, the mobile phone may send a notification message to the smart speaker, and the notification message may be used to notify the smart speaker to forward the data received from the mobile phone to the headset. In yet another possible implementation, the notification message is used to notify the smart speaker to establish a correspondence between two connections (that is, the connection between the smart speaker and the headset, and the connection between the smart speaker and the mobile phone) (it can also be understood that In order to bind the two channels), after the subsequent smart speaker receives the data from the mobile phone, it will forward the data to the headset.
在一种可能的实施方式中,在S315之后,手机还可以向智能电视发送通知消息,以通知智能电视手机当前与智能音箱之间建立了连接。该通知消息可以包括与手机连接的智能音箱的ID。In a possible implementation manner, after S315, the mobile phone may also send a notification message to the smart TV to notify the smart TV that a connection is currently established between the mobile phone and the smart speaker. The notification message may include the ID of the smart speaker connected to the phone.
在又一种可能的实施方式中,该通知消息还可以包括:用于指示手机与智能音箱之间建立连接的指示信息或手机的ID中的至少一项。In another possible implementation manner, the notification message may further include: at least one of indication information used to instruct the mobile phone to establish a connection with the smart speaker or an ID of the mobile phone.
在又一种可能的实施方式中,该通知消息还可以包括用于指示手机与智能音箱之间建立连接的方式,比如可以是基于Wi-Fi建立的连接。可选地,该通知消息还可以包括有手机正在进行的业务的相关信息,比如业务标识(比如播放音乐)、业务状态(比如当前正在进行中)等等。In another possible implementation manner, the notification message may further include a manner for instructing to establish a connection between the mobile phone and the smart speaker, such as a connection established based on Wi-Fi. Optionally, the notification message may also include relevant information about the ongoing service of the mobile phone, such as a service identifier (such as playing music), service status (such as currently in progress), and the like.
S316,手机向智能音箱发送音频数据。S316, the mobile phone sends audio data to the smart speaker.
一种可能地实施方式中,前述S305中手机与耳机断开连接后,在检测到所述手机与所述耳机断开点到点的直接连接后,所述手机暂停播放所述音频数据,并记录第一暂停标记。相对应地,响应于所述第一消息,所述手机向所述智能音箱发送第一暂停标记后续的音频数据的全部或部分。In a possible implementation manner, after the mobile phone is disconnected from the headset in the aforementioned S305, after detecting that the mobile phone and the headset are disconnected from the point-to-point direct connection, the mobile phone pauses to play the audio data, and The first pause mark is recorded. Correspondingly, in response to the first message, the mobile phone sends all or part of the audio data following the first pause mark to the smart speaker.
又一种可能地实施方式中,前述S305中手机与耳机断开连接后,所述手机通过所述手机的扬声器继续播放所述音频数据。相对应地,响应于所述第一消息,所述手机不再通过所述扬声器继续播放,而向所述智能音箱发送所述音频数据的未播放内容的全部或部分。In another possible implementation manner, after the mobile phone is disconnected from the headset in S305, the mobile phone continues to play the audio data through the speaker of the mobile phone. Correspondingly, in response to the first message, the mobile phone no longer continues to play through the speaker, but sends all or part of the unplayed content of the audio data to the smart speaker.
在一种可能的实施方式中,手机向智能音箱发送的音频数据可以包括一个目的地址。该目的地址为智能音箱的地址,当智能音箱接收到该音频数据后转发给耳机。In a possible implementation, the audio data sent by the mobile phone to the smart speaker may include a destination address. The destination address is the address of the smart speaker. When the smart speaker receives the audio data, it forwards it to the headset.
在又一种可能的实施方式中,手机向智能音箱发送的音频数据中可以包括两个目的地址,其中一个目的地址为智能音箱的地址,另一个目的地址为耳机的地址。该耳机的地址在数据中的位置需要手机和智能音箱协商,以便智能音箱可以在预设位置解析出该耳机的地址。In yet another possible implementation, the audio data sent by the mobile phone to the smart speaker may include two destination addresses, one of which is the address of the smart speaker, and the other destination address is the address of the headset. The location of the address of the headset in the data needs to be negotiated between the mobile phone and the smart speaker, so that the smart speaker can resolve the address of the headset at the preset location.
当手机与智能音箱连接之后,智能音箱与耳机连接之后,手机的应用层显示的是手机与耳机之间建立连接,即对于应用层而言,手机知道自己与耳机之间建立了连接。这种情况下,可以默认通过耳机输出音频。而至于在底层是耳机直接与手机之间建立的连接,还是耳机通过智能音箱与手机建立的间接的连接,应用层不关心。After the mobile phone is connected to the smart speaker, and the smart speaker is connected to the headset, the application layer of the mobile phone shows that the connection is established between the mobile phone and the headset, that is, for the application layer, the mobile phone knows that it has established a connection with the headset. In this case, audio can be output through headphones by default. As for whether the connection between the headset and the mobile phone is directly established at the bottom layer, or the indirect connection between the headset and the mobile phone through the smart speaker, the application layer does not care.
S317,智能音箱向耳机转发来自手机的音频数据。S317, the smart speaker forwards the audio data from the mobile phone to the headset.
在一种可能的实施方式中,当智能音箱连接耳机时,可以默认将接收到的音频数据通过耳机播放。在又一种可能的实施方式中,可以基于手机的通知消息,建立两个连接(即智能音箱与耳机之间的连接,以及智能音箱与手机之间的连接)的对应关系,进一步根据该对应关系,将从手机处接收到的音频数据转发给耳机。In a possible implementation, when the smart speaker is connected to an earphone, the received audio data can be played through the earphone by default. In yet another possible implementation, a correspondence between two connections (that is, the connection between the smart speaker and the headset, and the connection between the smart speaker and the mobile phone) can be established based on the notification message of the mobile phone, and further according to the correspondence relationship, and forward the audio data received from the mobile phone to the headset.
S318,耳机根据接收到的音频数据进行播放。S318, the headset plays according to the received audio data.
一种可能地实施方式中,耳机在接收到来自智能音箱的所述音频数据的未播放内容的全部或部分后,所述耳机播放所述音频数据的未播放内容的全部或部分。In a possible implementation manner, after the earphone receives all or part of the unplayed content of the audio data from the smart speaker, the earphone plays all or part of the unplayed content of the audio data.
在S318之后,手机可能会与智能音箱之间断开连接,图3a中通过S319至S321示例性地示出了一种手机与智能音箱断开连接的示例。After S318, the mobile phone may be disconnected from the smart speaker, and FIG. 3a exemplarily shows an example of disconnection between the mobile phone and the smart speaker through S319 to S321.
随着耳机的移动,智能音箱与耳机之间的距离加大,可能发生S319中示出的情况。As the headset moves, the distance between the smart speaker and the headset increases, and the situation shown in S319 may occur.
S319,智能音箱与耳机之间可能断开连接。S319, the connection between the smart speaker and the headset may be disconnected.
S319之后,耳机可以继续广播第二请求消息,以使其他设备与耳机连接。所述第二请求消息包括所述耳机的标识,以及点到点的直接连接请求。After S319, the headset may continue to broadcast the second request message to connect other devices with the headset. The second request message includes the identification of the headset and a point-to-point direct connection request.
在一种可能的实施方式中,在S319之后,智能音箱还可以向智能电视发送通知消息,以通知智能电视:该智能音箱当前与耳机之间断开了连接。该通知消息中可以包括与智能音箱断开连接的耳机的ID。In a possible implementation manner, after S319, the smart speaker may also send a notification message to the smart TV to notify the smart TV that the smart speaker is currently disconnected from the headset. The notification message may include the ID of the headset disconnected from the smart speaker.
在又一种可能的实施方式中,该通知消息中还可以包括:用于指示智能音箱与耳机之间断开连接的指示信息和智能音箱的ID中的至少一项。In yet another possible implementation manner, the notification message may further include: at least one of indication information for indicating disconnection between the smart speaker and the headset and an ID of the smart speaker.
在又一种可能的实施方式中,该通知消息还可以包括用于指示智能音箱与耳机之间断开连接的方式;比如可以是基于蓝牙断开的连接。In yet another possible implementation manner, the notification message may further include a method for indicating the disconnection between the smart speaker and the headset; for example, the connection may be disconnected based on Bluetooth.
S320,智能音箱向手机发送第二通知消息,第二通知消息包括用于指示所述智能音箱与所述耳机之间断开连接的指示信息。S320, the smart speaker sends a second notification message to the mobile phone, where the second notification message includes instruction information for indicating disconnection between the smart speaker and the earphone.
在又一种可能的实施方式中,智能电视在收到智能音箱上报的用于指示智能音箱与耳机断开连接的指示信息后,智能电视通知手机智能音箱与所述耳机之间断开连接。In another possible implementation, after receiving the instruction information reported by the smart speaker for indicating that the smart speaker is disconnected from the earphone, the smart TV notifies the mobile phone of the disconnection between the smart speaker and the earphone.
S321,手机与智能音箱之间断开连接。S321, the connection between the mobile phone and the smart speaker is disconnected.
在一种可能的实施方式中,在S321之后,手机还可以向智能电视发送通知消息,以通知智能电视手机当前与智能音箱之间断开了连接。该通知消息可以包括与手机断开连接的智能音箱的ID。In a possible implementation manner, after S321, the mobile phone may also send a notification message to the smart TV to notify the smart TV that the mobile phone is currently disconnected from the smart speaker. The notification message may include the ID of the smart speaker disconnected from the phone.
在又一种可能的实施方式中,该通知消息还可以包括:用于指示手机与智能音箱之间断开连接的指示信息和手机的ID中的至少一项。In another possible implementation manner, the notification message may further include: at least one of indication information for indicating disconnection between the mobile phone and the smart speaker and an ID of the mobile phone.
在又一种可能的实施方式中,该通知消息还可以包括用于指示手机与智能音箱之间断开连接的方式,比如可以是基于Wi-Fi断开的连接。可选地,该通知消息还可以包括有手机正在进行的业务的相关信息,比如业务标识(比如播放音乐)、业务状态(比如当前正在进行中)等等。In yet another possible implementation manner, the notification message may further include a method for instructing the disconnection between the mobile phone and the smart speaker, for example, the disconnection may be based on Wi-Fi. Optionally, the notification message may also include relevant information about the ongoing service of the mobile phone, such as a service identifier (such as playing music), service status (such as currently in progress), and the like.
需要说明的是,本申请实施例中,一种可能地实施方式中,手机和智能音箱处于同一局域网内,手机和智能音箱之间通过路由器连接。上述S315和S321不是必须的,图中将S315和S321示为虚线。比如当基于传输控制协议(transmission control protocol,TCP)/网络协议(internet protocol,IP)时,需要通过上述S315使手机和智能音箱之间建立连接,后续也需要通过S321断开手机和智能音箱之间的连接。再比如,当基于用户数据包协议(user datagram protocol,UDP)协议时,不需要通过S315建立连接,当手机需要向智能音箱发送音频数据时,手机即可通过路由器向智能音箱发送音频数据;相对应地,当手机不需要向智能音箱发送音频数据时,也不需要通过上述S321断开连接。It should be noted that, in the embodiment of the present application, in a possible implementation manner, the mobile phone and the smart speaker are in the same local area network, and the mobile phone and the smart speaker are connected through a router. The above S315 and S321 are not necessary, and S315 and S321 are shown as dotted lines in the figure. For example, when the transmission control protocol (TCP)/Internet protocol (IP) is used, the connection between the mobile phone and the smart speaker needs to be established through the above S315, and then the connection between the mobile phone and the smart speaker needs to be disconnected through S321. connection between. For another example, when based on the user datagram protocol (UDP) protocol, there is no need to establish a connection through S315. When the mobile phone needs to send audio data to the smart speaker, the mobile phone can send audio data to the smart speaker through the router; Correspondingly, when the mobile phone does not need to send audio data to the smart speaker, it does not need to be disconnected through the above S321.
除了S319至S321所示的方式外,还可以有其他方式使手机与智能音箱之间断开连接。比如,手机接收到一个输入,该输入用于指示停止通过耳机播放音频数据。用户可以在手机上进行操作,以便断开手机和智能音箱之间的连接。比如,一种可能的实施方式中,用户在手机上输入一个操作:选择手机的音频输出模式为通过手机的播放音频数据,基于该输入手机可以确定不需要通过耳机播放音频数据,进而手机与智能音箱之间断开连接。In addition to the ways shown in S319 to S321, there are other ways to disconnect the mobile phone from the smart speaker. For example, a cell phone receives an input that instructs to stop playing audio data through the headset. Users can operate on the phone to disconnect the connection between the phone and the smart speaker. For example, in a possible implementation, the user inputs an operation on the mobile phone: selecting the audio output mode of the mobile phone to play audio data through the mobile phone, based on the input, the mobile phone can determine that the audio data does not need to be played through the headset, and the mobile phone and the smart The speakers are disconnected.
又一种可能地实施方式中,当手机与智能音箱之间断开连接,则手机可以暂停播放所述音频数据,并记录第二暂停标记。或者,手机可以通过所述扬声器继续播放所述音频数据。In another possible implementation manner, when the connection between the mobile phone and the smart speaker is disconnected, the mobile phone may pause to play the audio data, and record a second pause mark. Alternatively, the mobile phone may continue to play the audio data through the speaker.
在上述图3a所示的方案中,一种可能的实施方式中,当智能音箱与耳机之间建立了连 接,也可以向智能电视进行上报。当智能音箱与手机之间建立了连接,则智能音箱和手机也可以向智能电视上报。当智能音箱与耳机之间断开连接,也可以向智能电视进行上报。当智能音箱与手机之间断开连接,也可以向智能电视进行上报。具体上报方式可以参见前述内容,在此不再赘述。In the solution shown in Fig. 3a above, in a possible implementation, when a connection is established between the smart speaker and the headset, it can also be reported to the smart TV. When a connection is established between the smart speaker and the mobile phone, the smart speaker and the mobile phone can also report to the smart TV. When the connection between the smart speaker and the headset is disconnected, it can also be reported to the smart TV. When the smart speaker is disconnected from the mobile phone, it can also report to the smart TV. For the specific reporting method, please refer to the foregoing content, which will not be repeated here.
通过上述方案可以看出,由于设置了智能电视这一中心节点,因此当接收到智能音箱上报的耳机ID之后,可以找到最近与该耳机断开连接的手机,从而向该手机发送该耳机的ID和智能音箱的ID,以使手机通过智能音箱与耳机之间建立间接的连接,并可以继续通过耳机播放音频数据。It can be seen from the above solution that since the central node of the smart TV is set, after receiving the headset ID reported by the smart speaker, the mobile phone that has recently been disconnected from the headset can be found, and the ID of the headset can be sent to the mobile phone. and the ID of the smart speaker, so that the mobile phone can establish an indirect connection between the smart speaker and the headset, and can continue to play audio data through the headset.
图3b是在图3a的基础上,示例性地示出了另外一种可能的通信方法的流程。如图3b所示,该方法中S301至S308可以参见图3a所示的内容,图3a中在S308之后则执行S309以实现智能音箱与耳机之间的点到点的直接连接,而图3b中则在S308之后不执行S309,而是执行S3101。Fig. 3b exemplarily shows the flow of another possible communication method on the basis of Fig. 3a. As shown in Fig. 3b, in this method, S301 to S308 can refer to the content shown in Fig. 3a. In Fig. 3a, after S308, S309 is executed to realize the point-to-point direct connection between the smart speaker and the headset, while in Fig. 3b Then S309 is not executed after S308, but S3101 is executed.
S3101,智能音箱向智能电视发送第一通知消息,第一通知消息可以包括智能音箱标识(identification,ID),耳机ID,以及用于指示智能音箱发现了耳机的指示信息。S3101 , the smart speaker sends a first notification message to the smart TV, where the first notification message may include a smart speaker identification (ID), an earphone ID, and indication information for indicating that the smart speaker has found the earphone.
需要注意的是,S3101与S310中不同的是,在S3101中第一通知消息中携带的是用于指示智能音箱发现了耳机的指示信息。It should be noted that the difference between S3101 and S310 is that the first notification message in S3101 carries the instruction information used to indicate that the smart speaker has discovered the headset.
又一种可能的实施方式中,第一通知消息中还可以包括有用于指示智能音箱和耳机之间具有蓝牙配对关系的指示信息。In another possible implementation manner, the first notification message may further include indication information for indicating that there is a Bluetooth pairing relationship between the smart speaker and the headset.
又一种可能的实施方式中,第一通知消息中还可以包括有用于指示智能音箱蓝牙发现了耳机的指示信息。In another possible implementation manner, the first notification message may further include indication information for indicating that the smart speaker Bluetooth has discovered the headset.
又一种可能地实施方式中,第一通知消息中还可以包括有智能音箱接收到的耳机的信号(比如FHS报文)的接收信号强度指示(received signal strength indicator,RSSI)的值,可以通过该RSSI的值反映出智能音箱与耳机之间靠近的程度,或者可以描述为通过RSSI的值反映智能音箱和耳机之间距离的远近。当RSSI的值较小,则说明智能音箱和耳机之间的距离较远,当RSSI的值较大,则说明智能音箱和耳机之间的距离较近。In another possible implementation, the first notification message may also include the value of the received signal strength indicator (RSSI) of the signal (such as the FHS message) of the earphone received by the smart speaker. The value of the RSSI reflects the proximity between the smart speaker and the headset, or can be described as reflecting the distance between the smart speaker and the headset through the RSSI value. When the value of RSSI is small, it means that the distance between the smart speaker and the headset is farther, and when the value of RSSI is large, it means that the distance between the smart speaker and the headset is short.
S311,智能电视确定出最近与第一通知消息中的耳机断开连接的手机的ID。S311, the smart TV determines the ID of the mobile phone recently disconnected from the headset in the first notification message.
S3121,智能电视根据确定出的手机的ID,向手机发送第一消息,第一消息可以包括智能音箱标识(identification,ID),耳机ID,以及用于指示智能音箱发现了耳机的指示信息。S3121 , the smart TV sends a first message to the mobile phone according to the determined ID of the mobile phone. The first message may include a smart speaker identification (ID), an earphone ID, and indication information for indicating that the smart speaker has found the earphone.
需要注意的是,S3121与S312中不同的是,在S3121中第一消息中携带的是用于指示智能音箱发现了耳机的指示信息。It should be noted that the difference between S3121 and S312 is that the first message in S3121 carries the indication information used to indicate that the smart speaker has discovered the headset.
S3121可以参见前述S312的内容,在此不再赘述。For S3121, reference may be made to the content of the foregoing S312, and details are not repeated here.
S313,手机接收到来自智能电视的第一消息。S313, the mobile phone receives the first message from the smart TV.
S314,手机判断第一消息中的耳机的ID是否为:与手机具有配对关系的一个或多个耳机的ID中的一个。S314, the mobile phone determines whether the ID of the headset in the first message is one of the IDs of one or more headsets that have a pairing relationship with the mobile phone.
若是,则执行S315。If yes, execute S315.
若否,则可以结束该流程。If not, the process can end.
在S315或S316之后智能音箱执行S309,以便与耳机之间建立点到点的直接连接。图中以在S315之后执行S309为例进行展示。The smart speaker executes S309 after S315 or S316 to establish a point-to-point direct connection with the headset. In the figure, the execution of S309 after S315 is taken as an example for illustration.
通过图3b所示的方案可以看出,本申请实施例中智能音箱在发现耳机之后,先不与耳机建立连接,在通过S315与手机建立连接之后才与耳机建立连接,即智能音箱在确定存在与耳机建立的需求(即手机需要通过智能音箱向耳机发送音频数据)的情况下才与耳机建立连接,而在不存在与耳机建立的需求的情况下可以不与耳机建立连接,从而可以减少智能音箱与耳机之间建立连接的次数,降低功耗。It can be seen from the solution shown in FIG. 3b that in the embodiment of the present application, after discovering the earphone, the smart speaker does not establish a connection with the earphone first, and establishes a connection with the earphone after establishing a connection with the mobile phone through S315, that is, the smart speaker determines that it exists The connection with the headset is established only when there is a demand for establishing a headset (that is, the mobile phone needs to send audio data to the headset through the smart speaker), and a connection with the headset can not be established when there is no need to establish a headset. The number of times a connection is established between the speaker and the headset, reducing power consumption.
在没有特别说明的情况下,图3b中的各步骤分别与图3a中的各步骤的内容相同,此处不再赘述。Unless otherwise specified, the content of each step in FIG. 3b is the same as that of each step in FIG. 3a, and details are not repeated here.
基于上述内容,图4a和图4b分别示例性示出了另外两种通信方法的流程示意图,在图4a和图4b中不再设置作为中心设备(电子设备400)。如图4a所示,该方法包括:Based on the above content, Figures 4a and 4b exemplarily show flow charts of two other communication methods, respectively, and Figures 4a and 4b are no longer set as the central device (electronic device 400). As shown in Figure 4a, the method includes:
S401,手机与耳机之间建立对等式网络(peer-to-peer,P2P)连接。S401, a peer-to-peer (P2P) connection is established between the mobile phone and the headset.
该步骤可以参见前述S301,在此不再赘述。For this step, reference may be made to the aforementioned S301, which will not be repeated here.
与图3a不同的是,由于未设置中心节点,因此在S401之后,也不要手机去上报信息,即不需要执行上述图3a中的S302。The difference from FIG. 3a is that since the central node is not set, after S401, the mobile phone is not required to report the information, that is, S302 in the above-mentioned FIG. 3a does not need to be performed.
S402,手机向耳机发送音频数据。S402, the mobile phone sends audio data to the headset.
该步骤可以参见前述S303,在此不再赘述。For this step, reference may be made to the aforementioned S303, which will not be repeated here.
S403,耳机根据接收到的音频数据进行播放。S403, the headset plays the audio data according to the received audio data.
该步骤可以参见前述S304,在此不再赘述。For this step, reference may be made to the aforementioned S304, which will not be repeated here.
S404,所述耳机与所述手机之间断开连接。S404, the connection between the earphone and the mobile phone is disconnected.
该步骤可以参见前述S305,在此不再赘述。For this step, reference may be made to the aforementioned S305, which will not be repeated here.
S405,耳机广播第一请求消息,第一请求消息包括耳机ID。S405, the headset broadcasts a first request message, where the first request message includes the headset ID.
该步骤可以参见前述S307,在此不再赘述。For this step, reference may be made to the aforementioned S307, and details are not repeated here.
S406,智能音箱接收到来自耳机的第一请求消息。S406, the smart speaker receives the first request message from the headset.
该步骤可以参见前述S308,在此不再赘述。For this step, reference may be made to the aforementioned S308, which will not be repeated here.
S407,智能音箱与耳机之间建立点到点的直接连接。S407, establishes a point-to-point direct connection between the smart speaker and the headset.
该步骤可以参见前述S309,在此不再赘述。For this step, reference may be made to the aforementioned S309, which will not be repeated here.
与图3a不同的是,由于未设置中心节点,因此在S407之后,也不要智能音箱上报信息,即不需要执行上述图3a中的S410,S411,S412,智能电视根据确定出的手机的ID,向手机发送第一消息,第一消息包括与所述智能音箱连接的耳机的ID,以及所述智能音箱的ID。The difference from Figure 3a is that since the central node is not set, after S407, the smart speaker does not need to report information, that is, it is not necessary to perform S410, S411, and S412 in the above Figure 3a. The smart TV determines the ID of the mobile phone, Send a first message to the mobile phone, where the first message includes the ID of the headset connected to the smart speaker and the ID of the smart speaker.
S408,智能音箱可以通过广播或者组播的方式发送第一消息,第一消息包括与所述智能音箱连接的耳机的ID。S408 , the smart speaker may send a first message by broadcasting or multicasting, where the first message includes the ID of the earphone connected to the smart speaker.
在一种可能的实施方式中,第一消息中可以包括有耳机的ID、智能音箱的ID,以及用于指示智能音箱与耳机之间建立连接的指示信息。In a possible implementation manner, the first message may include the ID of the earphone, the ID of the smart speaker, and indication information for instructing the connection between the smart speaker and the earphone.
在S408中,智能音箱可以在局域网内广播或组播第一消息。第一消息可以包括智能音箱标识(identification,ID),耳机ID,以及用于指示智能音箱与耳机建立点到点的直接连接的指示信息。In S408, the smart speaker can broadcast or multicast the first message in the local area network. The first message may include a smart speaker identification (ID), an earphone ID, and instruction information for instructing the smart speaker to establish a point-to-point direct connection with the earphone.
又一种可能的实施方式中,第一消息还可以包括用于指示智能音箱与耳机之间建立点到点的直接连接所采用的协议,比如智能音箱与耳机之间是蓝牙连接,则第一消息中还可以包括有用于指示智能音箱与耳机之间的点到点的直接连接是基于蓝牙协议的指示信息。 第一消息中还可以包括有用于指示智能音箱和耳机之间具有蓝牙配对关系的指示信息。In another possible implementation manner, the first message may also include a protocol used to indicate that a point-to-point direct connection is established between the smart speaker and the headset. For example, if the smart speaker and the headset are connected via Bluetooth, the first message The message may also include indication information for indicating that the point-to-point direct connection between the smart speaker and the headset is based on the Bluetooth protocol. The first message may also include indication information for indicating that there is a Bluetooth pairing relationship between the smart speaker and the headset.
又一种可能地实施方式中,第一消息中还可以包括有智能音箱接收到的耳机的信号(比如FHS报文)的接收信号强度指示(received signal strength indicator,RSSI)的值,可以通过该RSSI的值反映出智能音箱与耳机之间靠近的程度,或者可以描述为通过RSSI的值反映智能音箱和耳机之间距离的远近。当RSSI的值较小,则说明智能音箱和耳机之间的距离较远,当RSSI的值较大,则说明智能音箱和耳机之间的距离较近。In another possible implementation manner, the first message may also include a received signal strength indicator (received signal strength indicator, RSSI) value of the earphone signal (such as an FHS message) received by the smart speaker. The value of RSSI reflects the proximity between the smart speaker and the headset, or it can be described as reflecting the distance between the smart speaker and the headset through the value of RSSI. When the value of RSSI is small, it means that the distance between the smart speaker and the headset is farther, and when the value of RSSI is large, it means that the distance between the smart speaker and the headset is short.
在这种情况下,当手机与智能音箱同处于一个局域网内,则手机可以接收到第一消息。In this case, when the mobile phone and the smart speaker are in the same local area network, the mobile phone can receive the first message.
在另一种可能的实施方式中,智能音箱可以查找出与耳机具有认证关系的设备的标识,并向这些与耳机具有认证关系的一个或多个设备(包括手机)发送第一消息。其中,智能音箱上可以预先配置有与耳机具有认证关系的电子设备的标识,或者智能音箱可以从中心设备(比如电子设备400)上去查询与耳机具有认证关系的电子设备的标识。In another possible implementation, the smart speaker can find out the identifiers of the devices that have an authentication relationship with the headset, and send the first message to one or more devices (including mobile phones) that have an authentication relationship with the headset. The smart speaker may be preconfigured with an identifier of an electronic device that has an authentication relationship with the headset, or the smart speaker may query the identifier of an electronic device that has an authentication relationship with the headset from a central device (such as the electronic device 400 ).
S409,手机接收到来自智能电视的第一消息。S409, the mobile phone receives the first message from the smart TV.
S410,手机判断第一消息中的耳机的ID是否为:与手机具有配对关系的一个或多个耳机的ID中的一个。S410, the mobile phone determines whether the ID of the headset in the first message is one of the IDs of one or more headsets that have a pairing relationship with the mobile phone.
若是,则执行S411。If yes, execute S411.
若否,则可以结束该流程。If not, the process can end.
该步骤可以参见前述S314,在此不再赘述。For this step, reference may be made to the aforementioned S314, which will not be repeated here.
S411,手机和智能音箱之间建立连接。S411, establish a connection between the mobile phone and the smart speaker.
该步骤可以参见前述S315,在此不再赘述。For this step, reference may be made to the aforementioned S315, and details are not repeated here.
S412,手机向智能音箱发送音频数据。S412, the mobile phone sends audio data to the smart speaker.
该步骤可以参见前述S316,在此不再赘述。For this step, reference may be made to the aforementioned S316, which will not be repeated here.
S413,智能音箱向耳机转发来自手机的音频数据。S413, the smart speaker forwards the audio data from the mobile phone to the earphone.
该步骤可以参见前述S317,在此不再赘述。For this step, reference may be made to the aforementioned S317, which will not be repeated here.
S414,耳机根据接收到的音频数据进行播放。S414, the headset plays the audio data according to the received audio data.
该步骤可以参见前述S318,在此不再赘述。For this step, reference may be made to the aforementioned S318, which will not be repeated here.
S415,智能音箱与耳机之间可能断开连接。S415, the connection between the smart speaker and the headset may be disconnected.
该步骤可以参见前述S319,在此不再赘述。For this step, reference may be made to the aforementioned S319, which will not be repeated here.
S416,智能音箱向手机发送第二通知消息,第二通知消息包括用于指示所述智能音箱与所述耳机之间断开连接的指示信息。S416, the smart speaker sends a second notification message to the mobile phone, where the second notification message includes instruction information for indicating disconnection between the smart speaker and the earphone.
该步骤可以参见前述S320,在此不再赘述。For this step, reference may be made to the aforementioned S320, and details are not repeated here.
S417,手机与智能音箱之间断开连接。S417, the connection between the mobile phone and the smart speaker is disconnected.
该步骤可以参见前述S321,在此不再赘述。For this step, reference may be made to the aforementioned S321, which will not be repeated here.
除了S415至S417所示的方式外,还可以有其他方式使手机与智能音箱之间断开连接。比如,手机接收到一个输入,该输入用于指示停止通过耳机播放音频数据。用户可以在手机上进行操作,以便断开手机和智能音箱之间的连接。比如,在一种可能的实施方式中,用户在手机上输入一个操作:选择手机的音频输出模式为通过手机的播放音频数据,基于该输入手机可以确定不需要通过耳机播放音频数据,进而手机与智能音箱之间断开连接。In addition to the ways shown in S415 to S417, there may be other ways to disconnect the mobile phone from the smart speaker. For example, a cell phone receives an input that instructs to stop playing audio data through the headset. Users can operate on the phone to disconnect the connection between the phone and the smart speaker. For example, in a possible implementation, the user inputs an operation on the mobile phone: selecting the audio output mode of the mobile phone to play audio data through the mobile phone, based on the input, the mobile phone can determine that the audio data does not need to be played through the headset, and then the mobile phone and the Disconnect between smart speakers.
需要说明的是,本申请实施例中,一种可能地实施方式中,手机和智能音箱处于同一局域网内,手机和智能音箱之间通过路由器连接。上述S411和S417不是必须的,图中将S411和S417示为虚线。理由可以参见前述S315和S321的相关内容,在此不再赘述。It should be noted that, in the embodiment of the present application, in a possible implementation manner, the mobile phone and the smart speaker are in the same local area network, and the mobile phone and the smart speaker are connected through a router. The above S411 and S417 are not necessary, and S411 and S417 are shown as dotted lines in the figure. For the reason, reference may be made to the relevant contents of the aforementioned S315 and S321, which will not be repeated here.
通过上述方案可以看出,当智能音箱接收到耳机的第一请求消息之后,可以通过广播或组播方式发出第一消息,当手机接收到该第一消息后,确定第一消息中的耳机的ID即为与手机具有配对关系的一个耳机的ID,则手机通过智能音箱与耳机之间建立间接的连接,并可以继续通过耳机播放音频数据。It can be seen from the above solution that when the smart speaker receives the first request message of the headset, it can send the first message through broadcast or multicast. The ID is the ID of a headset that has a pairing relationship with the mobile phone, and the mobile phone establishes an indirect connection between the smart speaker and the headset, and can continue to play audio data through the headset.
图4b是在图4a的基础上,示例性地示出了另外一种可能的通信方法的流程。如图4b所示,该方法中S401至S406可以参见图4a所示的内容,图4a中在S406之后则执行S407以实现智能音箱与耳机之间的点到点的直接连接,图4b中则在S406之后不执行S407,而是执行S4081。Fig. 4b exemplarily shows the flow of another possible communication method on the basis of Fig. 4a. As shown in Fig. 4b, in this method, S401 to S406 can refer to the content shown in Fig. 4a. In Fig. 4a, after S406, S407 is executed to realize the point-to-point direct connection between the smart speaker and the headset. In Fig. 4b, the S407 is not executed after S406, but S4081 is executed.
S4081,智能音箱广播或组播第一消息,第一消息包括耳机的ID,智能音箱的ID,以及用于指示智能音箱发现了耳机的指示信息。S4081 , the smart speaker broadcasts or multicasts a first message, where the first message includes the ID of the earphone, the ID of the smart speaker, and indication information for indicating that the smart speaker has discovered the earphone.
需要注意的是,S4081与S408中不同的是,在S4081中第一消息中携带的是用于指示智能音箱发现了耳机的指示信息。It should be noted that the difference between S4081 and S408 is that the first message in S4081 carries the instruction information for indicating that the smart speaker has discovered the headset.
一种可能的实施方式中,第一消息可以携带用于指示智能音箱接收到耳机的第一请求消息的指示信息,以及耳机的ID,智能音箱的ID等。以通知其他设备耳机处于可以与智能音箱建立连接的位置区域内。In a possible implementation manner, the first message may carry indication information used to instruct the smart speaker to receive the first request message of the headset, the ID of the headset, the ID of the smart speaker, and the like. to notify other devices that the headset is in a location area where a connection to the smart speaker can be established.
S409,手机接收到来自智能音箱的第一消息。第一消息可以包括智能音箱标识(identification,ID),耳机ID,以及用于指示智能音箱发现了耳机的指示信息。S409, the mobile phone receives the first message from the smart speaker. The first message may include a smart speaker identification (ID), an earphone ID, and indication information for indicating that the smart speaker has discovered the earphone.
又一种可能的实施方式中,第一消息中还可以包括有用于指示智能音箱和耳机之间具有蓝牙配对关系的指示信息。In another possible implementation manner, the first message may further include indication information for indicating that there is a Bluetooth pairing relationship between the smart speaker and the headset.
又一种可能地实施方式中,第一消息中还可以包括有智能音箱接收到的耳机的信号(比如FHS报文)的接收信号强度指示(received signal strength indicator,RSSI)的值,可以通过该RSSI的值反映出智能音箱与耳机之间靠近的程度,或者可以描述为通过RSSI的值反映智能音箱和耳机之间距离的远近。当RSSI的值较小,则说明智能音箱和耳机之间的距离较远,当RSSI的值较大,则说明智能音箱和耳机之间的距离较近。In another possible implementation manner, the first message may also include a received signal strength indicator (received signal strength indicator, RSSI) value of the earphone signal (such as an FHS message) received by the smart speaker. The value of RSSI reflects the proximity between the smart speaker and the headset, or it can be described as reflecting the distance between the smart speaker and the headset through the value of RSSI. When the value of RSSI is small, it means that the distance between the smart speaker and the headset is farther, and when the value of RSSI is large, it means that the distance between the smart speaker and the headset is short.
S410,手机判断第一消息中的耳机的ID是否为:与手机具有配对关系的一个或多个耳机的ID中的一个。S410, the mobile phone determines whether the ID of the headset in the first message is one of the IDs of one or more headsets that have a pairing relationship with the mobile phone.
若是,则执行S411。If yes, execute S411.
若否,则可以结束该流程。If not, the process can end.
在S411之后智能音箱执行S407,以便与耳机之间建立点到点的直接连接。After S411, the smart speaker executes S407 to establish a point-to-point direct connection with the headset.
通过图4b所示的方案可以看出,本申请实施例中智能音箱在发现耳机之后,先不与耳机建立连接,在通过S415与手机建立连接之后才与耳机建立连接,即智能音箱在确定存在与耳机建立的需求(即手机需要通过智能音箱向耳机发送音频数据)的情况下才与耳机建立连接,而在不存在与耳机建立的需求的情况下可以不与耳机建立连接,从而可以减少智能音箱与耳机之间建立连接的次数,降低功耗。It can be seen from the solution shown in FIG. 4b that in the embodiment of the present application, after discovering the earphone, the smart speaker does not establish a connection with the earphone first, and establishes a connection with the earphone after establishing a connection with the mobile phone through S415, that is, the smart speaker determines that it exists The connection with the headset can be established only when there is a demand for establishing a headset (that is, the mobile phone needs to send audio data to the headset through the smart speaker), and a connection with the headset can not be established when there is no demand for establishing a headset, thereby reducing smart The number of times a connection is established between the speaker and the headset, reducing power consumption.
在没有特别说明的情况下,图4b中的各步骤的相关内容分别与图4a中的各步骤的相关内容相同,此处不再赘述。Unless otherwise specified, the relevant content of each step in FIG. 4b is the same as the relevant content of each step in FIG. 4a, which will not be repeated here.
基于前述内容,以手机与和耳机之间基于蓝牙技术建立点到点的直接连接为例,图5示例性地示出了本申请实施例提供的通信方法中手机与耳机之间建立点到点的直接连接 的方法流程。如图5所示,该方法包括:Based on the foregoing, taking the establishment of a point-to-point direct connection between the mobile phone and the headset based on Bluetooth technology as an example, FIG. 5 exemplarily shows the establishment of a point-to-point connection between the mobile phone and the headset in the communication method provided by the embodiment of the present application. The method flow of the direct connection. As shown in Figure 5, the method includes:
S3011,耳机发送耳机的蓝牙身份标识报文。S3011, the earphone sends a Bluetooth identification packet of the earphone.
S3012,手机收到耳机的蓝牙身份标识报文至,发送手机的蓝牙身份标识报文作为回应。S3012 , the mobile phone receives the Bluetooth identification packet of the headset, and sends the Bluetooth identification packet of the mobile phone as a response.
S3013,手机发送蓝牙跳频同步(frequency hop synchronization,FHS)报文。S3013, the mobile phone sends a Bluetooth frequency hop synchronization (frequency hop synchronization, FHS) message.
通过S3011至S3013,手机和耳机基于彼此的蓝牙身份标识报文和FHS报文可以进行时钟同步与基带连接,以将蓝牙通信状态从可连接状态转为已连接状态。Through S3011 to S3013, the mobile phone and the headset can perform clock synchronization and baseband connection based on each other's Bluetooth identification message and FHS message, so as to change the Bluetooth communication state from the connectable state to the connected state.
一种可能的实施方式中,蓝牙设备(具有蓝牙模块的设备,比如手机和耳机)在建立连接以前,通过在固定的一个频段内选择跳频频率或由被查询的设备地址决定,迅速交换握手信息时间和地址,快速取得设备的时间和频率同步。建立连接后,设备双方根据信道跳变序列改变频率,使跳频频率呈现随机特性。In a possible implementation, before a Bluetooth device (a device with a Bluetooth module, such as a mobile phone and a headset) establishes a connection, it quickly exchanges handshakes by selecting a frequency hopping frequency in a fixed frequency band or determined by the address of the device being queried. Information time and address, quickly obtain the time and frequency synchronization of the device. After the connection is established, both devices change the frequency according to the channel hopping sequence, so that the frequency hopping frequency presents random characteristics.
两个蓝牙设备之间的连接可以是通过由某个查询设备(例如可以是耳机)发送用于搜索附近其他设备的查询消息来启动的。其他任何通过实施查询扫描来进行侦听的蓝牙设备(例如手机)都会识别这个查询消息并且做出响应。该查询消息的响应可以是一个跳频同步(FHS)分组,其中包含了查询设备定址响应设备所需要的全部信息。该信息包括发送方(即响应设备)的时钟值、发送方的正确设备访问码以及设备分类(CoD)字段。FHS分组包含的信息要多于这里提到的信息。此外,所述访问码包含了发送方的蓝牙设备地址(BD_ADDR)的低位地址部分(LAP)和高位地址部分(UAP),其中所述蓝牙设备地址是一个以电子方式镌刻在每个蓝牙设备上的唯一的48比特的IEEE地址。The connection between two Bluetooth devices may be initiated by a query message sent by a certain query device (which may be, for example, a headset) to search for other devices in the vicinity. Any other Bluetooth device (such as a mobile phone) that listens by performing an inquiry scan will recognize this inquiry message and respond. The response to the query message may be a frequency hopping synchronization (FHS) packet, which contains all the information required by the query device to address the response device. This information includes the sender's (ie, responding device's) clock value, the sender's correct device access code, and a Class of Device (CoD) field. FHS packets contain more information than mentioned here. In addition, the access code contains the lower address part (LAP) and upper address part (UAP) of the sender's Bluetooth device address (BD_ADDR), wherein the Bluetooth device address is an electronically engraved on each Bluetooth device The unique 48-bit IEEE address.
S3014,手机和耳机之间进行蓝牙链路管理器协议(link manager protocol,LMP)流程交互。S3014, a Bluetooth link manager protocol (link manager protocol, LMP) process interaction is performed between the mobile phone and the headset.
每个蓝牙设备中的链路管理器可以通过链路管理器协议与蓝牙空中接口协商能够得到的性能。这些性能可以包括为支持数据业务所需要的服务等级而分配的带宽,以及为支持音频业务而获得的周期性预留带宽。LMP负责蓝牙设备之间连接的建立。蓝牙设备在传输数据时,LMP将对数据包的大小进行协商和控制。LMP还管理功率的消耗并且控制蓝牙设备的状态。LMP还具有产生认证和加密所需的密钥的功能。The link manager in each Bluetooth device can negotiate the available capabilities with the Bluetooth air interface through the link manager protocol. These capabilities may include bandwidth allocated to support the required class of service for data services, and periodic reserved bandwidth to support audio services. The LMP is responsible for the establishment of connections between Bluetooth devices. When a Bluetooth device transmits data, LMP will negotiate and control the size of the data packet. The LMP also manages power consumption and controls the state of the Bluetooth device. LMP also has the function of generating keys required for authentication and encryption.
S3015,手机基于蓝牙服务发现协议(service discovery protocol,SDP)查询耳机可以支持的服务。S3015, the mobile phone queries the services that the headset can support based on the Bluetooth service discovery protocol (Service Discovery Protocol, SDP).
服务在蓝牙技术框架中起到至关重要的作用,它是所有用户模式的基础。在变化频繁的蓝牙无线通信网络中,任何两个或是多个设备可能会突然开始在蓝牙的链路上通信。如果要利用这些设备彼此提供服务,需要一个更灵活的方法来查找这些服务的位置。若建立起一个通信信道,某个设备通信的下一步应该是找出该设备可以使用的服务。SDP可以定义一种标准的方法,以使某些蓝牙设备可以发现和学习其它设备提供的服务。蓝牙服务发现协议专门设计用于蓝牙无线通信的环境中,能以高效和最优的方式实现其功能。Services play a vital role in the Bluetooth technology framework and are the basis for all user modes. In a frequently changing Bluetooth wireless communication network, any two or more devices may suddenly start communicating on the Bluetooth link. If these devices are to be used to provide services to each other, a more flexible method of finding the location of these services is required. If a communication channel is established, the next step in a device's communication should be to find out the services that the device can use. SDP can define a standard method so that certain Bluetooth devices can discover and learn the services provided by other devices. The Bluetooth Service Discovery Protocol is specifically designed to be used in the context of Bluetooth wireless communication to achieve its functionality in an efficient and optimal manner.
一种可能的实施方式中,手机根据耳机支持的服务,通过蓝牙连接发送业务数据。例如,耳机可以支持听音乐服务,比如高级音频分配模式(advanced audio distribution profile,A2DP)服务。用户可以通过耳机收听手机上播放的音乐。或者,也可以描述为:耳机根据耳机支持的服务,连接蓝牙服务,例如可以连接A2DP服务,或者说基于蓝牙A2DP服务进行蓝牙连接,从而为用户提供音乐服务。In a possible implementation manner, the mobile phone sends service data through a Bluetooth connection according to the services supported by the headset. For example, the headset may support listening to music services, such as advanced audio distribution profile (A2DP) services. Users can listen to the music played on the phone through the headset. Alternatively, it can also be described as: the headset connects to the Bluetooth service according to the services supported by the headset, for example, the A2DP service can be connected, or the Bluetooth connection is performed based on the Bluetooth A2DP service, so as to provide the user with a music service.
智能音箱与耳机之间建立蓝牙连接的过程可以参见图5所示内容,不再赘述。The process of establishing a Bluetooth connection between the smart speaker and the earphone can be referred to as shown in FIG.
基于前述内容,以手机与和耳机之间断开蓝牙连接为例。图6示例性地示出了本申请实施例提供的通信方法中手机与耳机之间断开蓝牙连接的流程。如图6所示,该方法包括:Based on the foregoing, take the disconnection of the Bluetooth connection between the mobile phone and the headset as an example. FIG. 6 exemplarily shows the process of disconnecting the Bluetooth connection between the mobile phone and the headset in the communication method provided by the embodiment of the present application. As shown in Figure 6, the method includes:
S3051,手机与耳机之间建立蓝牙连接之后,手机通过蓝牙连接周期性发送蓝牙PULL报文。S3051, after a Bluetooth connection is established between the mobile phone and the headset, the mobile phone periodically sends a Bluetooth PULL message through the Bluetooth connection.
耳机针对接收到的每个PULL报文,均通过蓝牙连接回应一个NULL报文。手机周期性发送蓝牙PULL报文,耳机在收到蓝牙PULL报文后,发送蓝牙NULL报文作为回应。若手机和耳机之间的蓝牙连接出现故障,则手机发送的蓝牙PULL报文则会丢失,耳机无法接受到蓝牙PULL报文,且耳机也不会回应蓝牙NULL报文。手机可以通过S3052判断蓝牙连接是否断开。耳机可以通过S3054判断蓝牙连接是否断开。For each PULL message received, the headset responds with a NULL message through the Bluetooth connection. The mobile phone periodically sends a Bluetooth PULL message, and the headset sends a Bluetooth NULL message as a response after receiving the Bluetooth PULL message. If the Bluetooth connection between the mobile phone and the headset fails, the Bluetooth PULL message sent by the mobile phone will be lost, the headset cannot receive the Bluetooth PULL message, and the headset will not respond to the Bluetooth NULL message. The mobile phone can judge whether the Bluetooth connection is disconnected through S3052. The headset can judge whether the Bluetooth connection is disconnected through S3054.
S3052,手机判断是否满足“在第一预设时长内未收到NULL报文”。若满足,则执行S3053。若不满足,则说明蓝牙连接未断开。S3052, the mobile phone determines whether "the NULL message has not been received within the first preset time period". If satisfied, execute S3053. If not, it means that the Bluetooth connection is not disconnected.
S3053,手机确定蓝牙连接断开。S3053, the mobile phone determines that the Bluetooth connection is disconnected.
S3054,耳机判断是否满足“在第二预设时长内未收到PULL报文”。若满足,则执行S3055。若不满足,则说明蓝牙连接未断开。第二预设时长可以与第一预设时长相等,也可以不等。S3054, the earphone determines whether "the PULL message has not been received within the second preset time period". If satisfied, execute S3055. If not, it means that the Bluetooth connection is not disconnected. The second preset duration may be equal to or unequal to the first preset duration.
S3055,耳机确定蓝牙连接断开。S3055, the headset determines that the Bluetooth connection is disconnected.
智能音箱与耳机之间断开蓝牙连接的过程可以参见图6所示内容,不再赘述。The process of disconnecting the Bluetooth connection between the smart speaker and the headset can be referred to as shown in FIG. 6, and will not be repeated.
基于前述内容,图7示例性地示出了本申请实施例提供的通信方法中手机与智能音箱之间建立连接的一种流程。如图7所示,该流程包括:Based on the foregoing content, FIG. 7 exemplarily shows a process of establishing a connection between a mobile phone and a smart speaker in the communication method provided by the embodiment of the present application. As shown in Figure 7, the process includes:
S3151,手机向智能音箱发送连接建立请求。S3151, the mobile phone sends a connection establishment request to the smart speaker.
S3152,智能音箱向手机发送连接建立接受。S3152, the smart speaker sends a connection establishment acceptance to the mobile phone.
S3153,手机向智能音箱发送连接建立完成。S3153, the mobile phone sends the connection establishment to the smart speaker.
一种可能的实施方式中,手机可以根据智能音箱的IP地址、端口号等等建立套接字(socket)连接。而智能音箱可以通过套接字(socket)的服务端监听来自其他设备的连接建立请求。上述S3151至S3153可以通过传输控制协议(transfer control protocol,TCP)的三次握手来实现,比如上述S3151为TCP三次握手的第一包(例如发送序号可以为200,标志位可以为SYN=1)。S3152可以为智能音箱回应的TCP三次握手的第二包(例如发送序号可以为201,标志位可以为SYN=1,ACK=1)。S3153可以为手机回应的TCP三次握手的第三包(例如发送序号可以为501,标志位可以为ACK=1)。In a possible implementation, the mobile phone may establish a socket connection according to the IP address, port number, etc. of the smart speaker. The smart speaker can listen for connection establishment requests from other devices through the socket server. The above-mentioned S3151 to S3153 can be implemented by the three-way handshake of the transfer control protocol (transfer control protocol, TCP). For example, the above-mentioned S3151 is the first packet of the TCP three-way handshake (for example, the sending sequence number can be 200, and the flag bit can be SYN=1). S3152 can be the second packet of the TCP three-way handshake responded by the smart speaker (for example, the sending sequence number can be 201, the flag bit can be SYN=1, ACK=1). S3153 may be the third packet of the TCP three-way handshake responded by the mobile phone (for example, the sending sequence number may be 501, and the flag bit may be ACK=1).
图8示例性地示出了本申请实施例提供的通信方法中手机与智能音箱之间断开连接的一种流程。如图8所示,该方法包括:FIG. 8 exemplarily shows a process of disconnection between a mobile phone and a smart speaker in the communication method provided by the embodiment of the present application. As shown in Figure 8, the method includes:
S3211,手机向智能音箱发送第一连接断开请求。S3211, the mobile phone sends a first connection disconnection request to the smart speaker.
S3212,智能音箱向手机发送第一连接断开响应。S3212, the smart speaker sends a first connection disconnection response to the mobile phone.
S3213,智能音箱向手机发送第二连接断开请求。S3213, the smart speaker sends a second connection disconnection request to the mobile phone.
S3214,手机向智能音箱发送第二连接断开响应。S3214, the mobile phone sends a second connection disconnection response to the smart speaker.
在一种可能的实施方式中,手机在确定与智能音箱断开连接之后,可以通过TCP四次挥手流程与智能音箱断开连接,比如上述S3211为手机发送的TCP四次挥手的第一包(例 如:发送序号可以为200;确认序号:500;标志位可以为ACK=1,FIN=1)。S3212可以为智能音箱回应的TCP四次挥手的第二包(例如:发送序号可以为500;确认序号:201;标志位可以为ACK=1)。S3213可以为智能音箱发送的TCP四次挥手的第三包(例如:发送序号可以为501;标志位可以为ACK=1,FTN=1)。S3214可以为手机回应的TCP四次挥手的第四包(例如:发送序号可以为201;确认序号:502;标志位可以为ACK=1)。In a possible implementation, after the mobile phone is determined to be disconnected from the smart speaker, it can be disconnected from the smart speaker through the TCP four-time wave process. For example, the above S3211 is the first packet of the TCP four-time wave sent by the mobile phone ( For example: the sending sequence number can be 200; the confirmation sequence number: 500; the flag bit can be ACK=1, FIN=1). S3212 can be the second packet of the TCP four waved hands responded by the smart speaker (for example: the sending sequence number can be 500; the confirmation sequence number: 201; the flag bit can be ACK=1). S3213 can be the third packet sent by the smart speaker for the four-time TCP wave (for example, the sending sequence number can be 501; the flag bit can be ACK=1, FTN=1). S3214 may be the fourth packet of the TCP four waved hands responded by the mobile phone (for example, the sending sequence number may be 201; the confirmation sequence number: 502; the flag bit may be ACK=1).
图9示例性地示出了一种跨物理网端到端通信模型的架构。如图9所示,在手机侧,手机的音频数据可以依次经过应用层、网络层、链路层和物理层后,发送至路由器。FIG. 9 exemplarily shows the architecture of an end-to-end communication model across physical networks. As shown in Figure 9, on the mobile phone side, the audio data of the mobile phone can be sent to the router after passing through the application layer, network layer, link layer and physical layer in sequence.
路由器接收到该音频数据后,从物理层传输至链路层,在链路层根据智能音箱的IP地址和端口进行转发,具体来说,路由器根据智能音箱的IP地址和端口将音频数据传输至物理层,进而发送至智能音箱。After the router receives the audio data, it is transmitted from the physical layer to the link layer, and forwarded at the link layer according to the IP address and port of the smart speaker. Specifically, the router transmits the audio data to the IP address and port of the smart speaker. The physical layer is then sent to the smart speaker.
智能音箱接收到该音频数据后有两种实现方式,方式一中,智能音箱将音频数据从物理层传输至链路层,在链路层根据耳机的IP地址和端口进行转发,具体来说,智能音箱根据耳机的IP地址和端口将音频数据传输至物理层,进而发送至耳机。方式二中,智能音箱将音频数据从物理层传输至链路层,从链路层传输至网络层,在网络层进行解析后再传输至链路层,从链路层再传输至物理层,进而发送至耳机。也就是说智能音箱收到音频数据后,可以在链路层完成数据的传输,也可以在网络层完成数据的传输,图中以虚线对该两种方式中的部分步骤进行示意。After the smart speaker receives the audio data, there are two implementation methods. In the first method, the smart speaker transmits the audio data from the physical layer to the link layer, and forwards the audio data at the link layer according to the IP address and port of the headset. Specifically, The smart speaker transmits audio data to the physical layer based on the IP address and port of the headset, and then sends it to the headset. In the second method, the smart speaker transmits audio data from the physical layer to the link layer, from the link layer to the network layer, and then parses it at the network layer and then transmits it to the link layer, and then transmits it from the link layer to the physical layer. and then sent to the headset. That is to say, after the smart speaker receives the audio data, it can complete the data transmission at the link layer or at the network layer. The dotted lines in the figure illustrate some of the steps in the two methods.
耳机收到该音频数据后,依次经过物理层、链路层、网络层后到达应用层,继而播放该音频数据。After the headset receives the audio data, it goes through the physical layer, the link layer, and the network layer in turn to reach the application layer, and then plays the audio data.
本申请实施例中手机和智能音箱之间的数据的传输可以在WiFi子网内传输。智能音箱和耳机之间的传输可以在BT子网内传输。The data transmission between the mobile phone and the smart speaker in the embodiment of the present application may be transmitted within the WiFi subnet. The transmission between the smart speaker and the headset can be transmitted within the BT subnet.
需要说明的是,本申请提供的上述各个实施例的全部或部分,均可以自由地、任意地相互组合。It should be noted that, all or part of the above-mentioned embodiments provided in this application can be freely and arbitrarily combined with each other.
本申请实施例提供的通信方法适用于以下的移动设备和电子设备。The communication methods provided in the embodiments of the present application are applicable to the following mobile devices and electronic devices.
图10所示为本申请提供的一种移动设备1000。示例地,移动设备1000包括至少一个处理器1010、存储器1020和通信接口1030。其中,处理器1010与存储器1020和通信接口1030耦合,本申请实施例中的耦合可以是通信连接,可以是电性,或其它的形式。具体的,存储器1020用于存储程序指令。处理器1010用于调用存储器1020中存储的程序指令,使得移动设备1000执行本申请实施例提供的通信方法中由移动设备所执行的步骤。应理解,该移动设备1000可以用于实现本申请实施例提供的通信方法,相关特征可以参照上文,此处不再赘述。FIG. 10 shows a mobile device 1000 provided by the present application. Illustratively, mobile device 1000 includes at least one processor 1010 , memory 1020 and communication interface 1030 . The processor 1010 is coupled to the memory 1020 and the communication interface 1030, and the coupling in this embodiment of the present application may be a communication connection, an electrical connection, or other forms. Specifically, the memory 1020 is used to store program instructions. The processor 1010 is configured to invoke the program instructions stored in the memory 1020, so that the mobile device 1000 executes the steps performed by the mobile device in the communication method provided in the embodiment of the present application. It should be understood that the mobile device 1000 can be used to implement the communication method provided by the embodiment of the present application, and the relevant features can be referred to above, and details are not repeated here.
本申请提供一种包含指令的计算机程序产品,当所述计算机程序产品在移动设备上运行时,使得所述移动设备执行本申请实施例提供的通信方法中由移动设备所执行的步骤。The present application provides a computer program product containing instructions, when the computer program product runs on a mobile device, the mobile device causes the mobile device to perform the steps performed by the mobile device in the communication method provided by the embodiments of the present application.
本申请提供一种计算机可读存储介质,包括指令,当所述指令在移动设备上运行时,使得所述移动设备执行本申请实施例提供的通信方法中由移动设备所执行的步骤。The present application provides a computer-readable storage medium, including instructions that, when the instructions are executed on a mobile device, cause the mobile device to perform the steps performed by the mobile device in the communication method provided by the embodiments of the present application.
所属领域的技术人员可以清楚地了解到本申请实施例可以用硬件实现,或硬件与软件的方式实现。当使用硬件与软件实现,可以将上述功能存储在计算机可读介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术 方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。Those skilled in the art can clearly understand that the embodiments of the present application may be implemented in hardware, or in a manner of hardware and software. When implemented using hardware and software, the above-described functions can be stored in a computer-readable medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage The medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
图11所示为本申请提供的一种电子设备1100。示例地,电子设备1100包括至少一个处理器1110、存储器1120和通信接口1130。其中,处理器1110与存储器1120和通信接口1130耦合,本申请实施例中的耦合可以是通信连接,可以是电性,或其它的形式。具体的,存储器1120用于存储程序指令。处理器1110用于调用存储器1120中存储的程序指令,使得电子设备1100执行本申请实施例提供的通信方法中由电子设备所执行的步骤。应理解,该电子设备1100可以用于实现本申请实施例提供的通信方法,相关特征可以参照上文,此处不再赘述。FIG. 11 shows an electronic device 1100 provided by the present application. Illustratively, electronic device 1100 includes at least one processor 1110 , memory 1120 and communication interface 1130 . The processor 1110 is coupled with the memory 1120 and the communication interface 1130, and the coupling in this embodiment of the present application may be a communication connection, an electrical connection, or other forms. Specifically, the memory 1120 is used to store program instructions. The processor 1110 is configured to invoke the program instructions stored in the memory 1120, so that the electronic device 1100 executes the steps performed by the electronic device in the communication method provided in the embodiment of the present application. It should be understood that the electronic device 1100 can be used to implement the communication method provided by the embodiments of the present application, and the relevant features can be referred to above, and details are not repeated here.
本申请提供一种包含指令的计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行本申请实施例提供的通信方法中由电子设备200、电子设备300或电子设备400所执行的步骤。The present application provides a computer program product containing instructions, when the computer program product runs on an electronic device, the electronic device is made to execute the communication method provided by the embodiment of the present application by the electronic device 200, the electronic device 300 or the electronic device. Steps performed by device 400 .
本申请提供一种计算机可读存储介质,包括指令,当所述指令在电子设备上运行时,使得所述电子设备执行本申请实施例提供的通信方法中由电子设备200、电子设备300或电子设备400所执行的步骤。The present application provides a computer-readable storage medium, including instructions, which, when the instructions are executed on an electronic device, cause the electronic device to execute the electronic device 200 , the electronic device 300 or the electronic device in the communication method provided by the embodiments of the present application. Steps performed by device 400 .
所属领域的技术人员可以清楚地了解到本申请实施例可以用硬件实现,或硬件与软件的方式实现。当使用硬件与软件实现,可以将上述功能存储在计算机可读介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。Those skilled in the art can clearly understand that the embodiments of the present application may be implemented in hardware, or in a manner of hardware and software. When implemented using hardware and software, the above-described functions can be stored in a computer-readable medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage The medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application shall be covered by this within the protection scope of the application examples. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims (23)

  1. 一种第一电子设备,所述第一电子设备与移动设备建立点到点的直接连接,所述第一电子设备通过所述移动设备播放音频数据;其特征在于,所述第一电子设备包括:A first electronic device, the first electronic device establishes a point-to-point direct connection with a mobile device, and the first electronic device plays audio data through the mobile device; characterized in that the first electronic device includes :
    处理器;processor;
    存储器;memory;
    以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述第一电子设备执行以下步骤:and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the first electronic device to perform the following steps:
    在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,after detecting that the first electronic device and the mobile device are disconnected from the point-to-point direct connection,
    所述第一电子设备暂停播放所述音频数据,并记录第一暂停标记;或者,The first electronic device pauses to play the audio data, and records a first pause mark; or,
    所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据;The first electronic device continues to play the audio data through the speaker of the first electronic device;
    接收到第一消息,所述第一消息用于指示所述移动设备与第二电子设备建立了点到点的直接连接;receiving a first message, where the first message is used to instruct the mobile device to establish a point-to-point direct connection with the second electronic device;
    响应于所述第一消息,In response to the first message,
    所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分;或者,The first electronic device sends all or part of the audio data subsequent to the first pause mark to the second electronic device; or,
    所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。The first electronic device does not continue playing through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
  2. 根据权利要求1所述的第一电子设备,其特征在于,在所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分;或者,所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分之前,所述第一电子设备还执行:The first electronic device according to claim 1, wherein, after the first electronic device sends all or part of the audio data following the first pause mark to the second electronic device; or, the first Before the electronic device no longer continues to play through the speaker, and before sending all or part of the unplayed content of the audio data to the second electronic device, the first electronic device further executes:
    所述第一电子设备与所述第二电子设备建立网络连接。The first electronic device establishes a network connection with the second electronic device.
  3. 根据权利要求2所述的第一电子设备,其特征在于,所述第一电子设备与所述第二电子设备建立网络连接;包括:所述第一电子设备与所述第二电子设备建立局域网连接。The first electronic device according to claim 2, wherein establishing a network connection between the first electronic device and the second electronic device comprises: establishing a local area network between the first electronic device and the second electronic device connect.
  4. 根据权利要求1-3中任意一项所述的第一电子设备,其特征在于,所述接收到第一消息;包括:The first electronic device according to any one of claims 1-3, wherein the receiving the first message comprises:
    接收到来自第二电子设备或第三电子设备的一个消息;receiving a message from the second electronic device or the third electronic device;
    响应于所述消息,在从所述消息中获取到所述移动设备的标识后,确定所述消息为所述第一消息。In response to the message, after the identification of the mobile device is acquired from the message, it is determined that the message is the first message.
  5. 根据权利要求4所述的第一电子设备,其特征在于,所述在从所述消息中获取到所述移动设备的标识后,确定所述消息为所述第一消息;包括:The first electronic device according to claim 4, wherein the determining that the message is the first message after the identification of the mobile device is acquired from the message; comprising:
    在从所述消息中仅获取到所述移动设备的标识后,确定所述消息为所述第一消息;或者,After obtaining only the identifier of the mobile device from the message, determine that the message is the first message; or,
    在从所述消息中获取到所述移动设备的标识和所述第二电子设备的标识后,确定所述消息为所述第一消息;或者,After acquiring the identity of the mobile device and the identity of the second electronic device from the message, determine that the message is the first message; or,
    在从所述消息中获取到所述移动设备的标识,所述第二电子设备的标识,以及所述移动设备与所述第二电子设备建立了点到点的直接连接的指示信息后,确定所述消息为所述第一消息。After acquiring the identity of the mobile device, the identity of the second electronic device, and the indication information that the mobile device has established a point-to-point direct connection with the second electronic device from the message, determine The message is the first message.
  6. 根据权利要求2-5中任意一项所述的第一电子设备,其特征在于,所述第一电子设 备还执行:The first electronic device according to any one of claims 2-5, wherein the first electronic device also executes:
    在检测到所述第一电子设备与所述第二电子设备断开网络连接后,After detecting that the first electronic device is disconnected from the network from the second electronic device,
    所述第一电子设备暂停播放所述音频数据,并记录第二暂停标记;或者,The first electronic device pauses playing the audio data, and records a second pause mark; or,
    所述第一电子设备通过所述扬声器继续播放所述音频数据。The first electronic device continues to play the audio data through the speaker.
  7. 根据权利要求1-6中任意一项所述的第一电子设备,其特征在于,所述第一电子设备还执行:The first electronic device according to any one of claims 1-6, wherein the first electronic device further executes:
    在所述第一电子设备与移动设备建立点到点的直接连接后,所述第一电子设备向第三电子设备发送第一告知消息;所述第一告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备建立了点到点的直接连接的第一告知信息;After the first electronic device establishes a point-to-point direct connection with the mobile device, the first electronic device sends a first notification message to the third electronic device; the first notification message includes the identification of the mobile device, The identifier of the first electronic device, and the first notification information that the mobile device has established a point-to-point direct connection with the first electronic device;
    在所述第一电子设备与移动设备断开点到点的直接连接后,所述第一电子设备向第三电子设备发送第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。After the first electronic device and the mobile device are disconnected from the point-to-point direct connection, the first electronic device sends a second notification message to the third electronic device; the second notification message includes the identification of the mobile device , the identifier of the first electronic device, and the second notification information that the mobile device has disconnected the point-to-point direct connection with the first electronic device.
  8. 根据权利要求1-7中任意一项所述的第一电子设备,其特征在于,所述第一电子设备与所述第二电子设备接入同一局域网。The first electronic device according to any one of claims 1-7, wherein the first electronic device and the second electronic device are connected to the same local area network.
  9. 根据权利要求1-7中任意一项所述的第一电子设备,其特征在于,所述点到点的直接连接包括蓝牙连接、无线高保真对等式网络Wi-Fi P2P连接和ZigBee连接中的一种。The first electronic device according to any one of claims 1-7, wherein the point-to-point direct connection includes a Bluetooth connection, a wireless high-fidelity peer-to-peer network Wi-Fi P2P connection, and a ZigBee connection. a kind of.
  10. 根据权利要求1-9中任意一项所述的第一电子设备,其特征在于,所述第一电子设备为智能手机。The first electronic device according to any one of claims 1-9, wherein the first electronic device is a smart phone.
  11. 一种移动设备,所述移动设备与第一电子设备建立点到点的直接连接,所述第一电子设备通过所述移动设备播放音频数据;其特征在于,所述移动设备包括:A mobile device, the mobile device establishes a point-to-point direct connection with a first electronic device, and the first electronic device plays audio data through the mobile device; characterized in that, the mobile device comprises:
    处理器;processor;
    存储器;memory;
    以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述移动设备执行以下步骤:and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the mobile device to perform the following steps:
    在检测到所述移动设备与所述第一电子设备断开点到点的直接连接后,所述移动设备广播第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求;After detecting that the mobile device is disconnected from the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. A direct connection request to a point;
    在接收到来自第二电子设备的第一响应消息后,所述移动设备与所述第二电子设备建立点到点的直接连接;所述第一响应消息与所述第一请求消息相关联;After receiving the first response message from the second electronic device, the mobile device establishes a point-to-point direct connection with the second electronic device; the first response message is associated with the first request message;
    在接收到所述音频数据的未播放内容的全部或部分后,所述移动设备播放所述音频数据的未播放内容的全部或部分;所述音频数据的未播放内容的全部或部分来自所述第二电子设备。After receiving all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data comes from the second electronic device.
  12. 根据权利要求11所述的移动设备,其特征在于,所述移动设备还执行:The mobile device according to claim 11, wherein the mobile device further executes:
    在检测到所述移动设备与所述第二电子设备断开点到点的直接连接后,所述移动设备广播第二请求消息;所述第二请求消息包括所述移动设备的标识,以及点到点的直接连接请求。After detecting that the mobile device is disconnected from the point-to-point direct connection with the second electronic device, the mobile device broadcasts a second request message; the second request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer.
  13. 根据权利要求11或12所述的移动设备,其特征在于,所述移动设备为蓝牙耳机。The mobile device according to claim 11 or 12, wherein the mobile device is a Bluetooth headset.
  14. 一种通信方法,应用于第一电子设备,所述第一电子设备与移动设备建立点到点的 直接连接,所述第一电子设备通过所述移动设备播放音频数据;其特征在于,所述方法包括:A communication method, applied to a first electronic device, the first electronic device establishes a point-to-point direct connection with a mobile device, and the first electronic device plays audio data through the mobile device; Methods include:
    在检测到所述第一电子设备与所述移动设备断开点到点的直接连接后,after detecting that the first electronic device and the mobile device are disconnected from the point-to-point direct connection,
    所述第一电子设备暂停播放所述音频数据,并记录第一暂停标记;或者,The first electronic device pauses to play the audio data, and records a first pause mark; or,
    所述第一电子设备通过所述第一电子设备的扬声器继续播放所述音频数据;The first electronic device continues to play the audio data through the speaker of the first electronic device;
    接收到第一消息,所述第一消息用于指示所述移动设备与第二电子设备建立了点到点的直接连接;receiving a first message, where the first message is used to instruct the mobile device to establish a point-to-point direct connection with the second electronic device;
    响应于所述第一消息,In response to the first message,
    所述第一电子设备向所述第二电子设备发送第一暂停标记后续的音频数据的全部或部分;或者,The first electronic device sends all or part of the audio data subsequent to the first pause mark to the second electronic device; or,
    所述第一电子设备不再通过所述扬声器继续播放,而向所述第二电子设备发送所述音频数据的未播放内容的全部或部分。The first electronic device does not continue playing through the speaker, but sends all or part of the unplayed content of the audio data to the second electronic device.
  15. 根据权利要求14所述的方法,其特征在于,所述接收到第一消息;包括:The method of claim 14, wherein the receiving the first message; comprising:
    接收到来自第二电子设备或第三电子设备的一个消息;receiving a message from the second electronic device or the third electronic device;
    响应于所述消息,在从所述消息中获取到所述移动设备的标识后,确定所述消息为所述第一消息。In response to the message, after the identification of the mobile device is acquired from the message, it is determined that the message is the first message.
  16. 根据权利要求15所述的方法,其特征在于,所述在从所述消息中获取到所述移动设备的标识后,确定所述消息为所述第一消息;包括:The method according to claim 15, wherein the determining that the message is the first message after the identifier of the mobile device is acquired from the message; comprising:
    在从所述消息中仅获取到所述移动设备的标识后,确定所述消息为所述第一消息;或者,After obtaining only the identifier of the mobile device from the message, determine that the message is the first message; or,
    在从所述消息中获取到所述移动设备的标识和所述第二电子设备的标识后,确定所述消息为所述第一消息;或者,After acquiring the identity of the mobile device and the identity of the second electronic device from the message, determine that the message is the first message; or,
    在从所述消息中获取到所述移动设备的标识,所述第二电子设备的标识,以及所述移动设备与所述第二电子设备建立了点到点的直接连接的指示信息后,确定所述消息为所述第一消息。After acquiring the identity of the mobile device, the identity of the second electronic device, and the indication information that the mobile device has established a point-to-point direct connection with the second electronic device from the message, determine The message is the first message.
  17. 根据权利要求15或16所述的方法,其特征在于,所述方法还包括:The method according to claim 15 or 16, wherein the method further comprises:
    在检测到所述第一电子设备与所述第二电子设备断开网络连接后,After detecting that the first electronic device is disconnected from the network from the second electronic device,
    所述第一电子设备暂停播放所述音频数据,并记录第二暂停标记;或者,The first electronic device pauses playing the audio data, and records a second pause mark; or,
    所述第一电子设备通过所述扬声器继续播放所述音频数据。The first electronic device continues to play the audio data through the speaker.
  18. 根据权利要求14-17中任意一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 14-17, wherein the method further comprises:
    在所述第一电子设备与移动设备建立点到点的直接连接后,所述第一电子设备向第三电子设备发送第一告知消息;所述第一告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备建立了点到点的直接连接的第一告知信息;After the first electronic device establishes a point-to-point direct connection with the mobile device, the first electronic device sends a first notification message to the third electronic device; the first notification message includes the identification of the mobile device, The identifier of the first electronic device, and the first notification information that the mobile device has established a point-to-point direct connection with the first electronic device;
    在所述第一电子设备与移动设备断开点到点的直接连接后,所述第一电子设备向第三电子设备发送第二告知消息;所述第二告知消息包括所述移动设备的标识,所述第一电子设备的标识,以及所述移动设备与所述第一电子设备断开了点到点的直接连接的第二告知信息。After the first electronic device and the mobile device are disconnected from the point-to-point direct connection, the first electronic device sends a second notification message to the third electronic device; the second notification message includes the identification of the mobile device , the identifier of the first electronic device, and the second notification information that the mobile device has disconnected the point-to-point direct connection with the first electronic device.
  19. 一种通信方法,应用于移动设备,所述移动设备与第一电子设备建立点到点的直接连接,所述第一电子设备通过所述移动设备播放音频数据;其特征在于,所述方法包括:A communication method, applied to a mobile device, the mobile device establishes a point-to-point direct connection with a first electronic device, and the first electronic device plays audio data through the mobile device; characterized in that the method comprises: :
    在检测到所述移动设备与所述第一电子设备断开点到点的直接连接后,所述移动设备广播第一请求消息;所述第一请求消息包括所述移动设备的标识,以及点到点的直接连接请求;After detecting that the mobile device is disconnected from the point-to-point direct connection with the first electronic device, the mobile device broadcasts a first request message; the first request message includes the identification of the mobile device and the point-to-point connection. A direct connection request to a point;
    在接收到来自第二电子设备的第一响应消息后,所述移动设备与所述第二电子设备建立点到点的直接连接;所述第一响应消息与所述第一请求消息相关联;After receiving the first response message from the second electronic device, the mobile device establishes a point-to-point direct connection with the second electronic device; the first response message is associated with the first request message;
    在接收到所述音频数据的未播放内容的全部或部分后,所述移动设备播放所述音频数据的未播放内容的全部或部分;所述音频数据的未播放内容的全部或部分来自所述第二电子设备。After receiving all or part of the unplayed content of the audio data, the mobile device plays all or part of the unplayed content of the audio data; all or part of the unplayed content of the audio data comes from the second electronic device.
  20. 根据权利要求19所述的方法,其特征在于,所述方法还包括:The method of claim 19, wherein the method further comprises:
    在检测到所述移动设备与所述第二电子设备断开点到点的直接连接后,所述移动设备广播第二请求消息;所述第二请求消息包括所述移动设备的标识,以及点到点的直接连接请求。After detecting that the mobile device is disconnected from the point-to-point direct connection with the second electronic device, the mobile device broadcasts a second request message; the second request message includes the identification of the mobile device and the point-to-point connection. Direct connection request to peer.
  21. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当所述计算机程序在第一电子设备上运行时,使得所述第一电子设备执行如权利要求14-18中任意一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a computer program, when the computer program is run on a first electronic device, the first electronic device is made to execute the method according to claim 14- The method of any one of 18.
  22. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当所述计算机程序在移动设备上运行时,使得所述移动设备执行如权利要求19或20所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a computer program, which, when the computer program is run on a mobile device, causes the mobile device to execute the method according to claim 19 or 20. method.
  23. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求14-20中任意一项所述的方法。A computer program product, characterized in that, when the computer program product runs on a computer, the computer is caused to execute the method according to any one of claims 14-20.
PCT/CN2021/137058 2021-01-29 2021-12-10 Communication method, mobile device, electronic device, and computer-readable storage medium WO2022160967A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110124316.1A CN114827687B (en) 2021-01-29 2021-01-29 Communication method, mobile device, electronic device, and computer-readable storage medium
CN202110124316.1 2021-01-29

Publications (1)

Publication Number Publication Date
WO2022160967A1 true WO2022160967A1 (en) 2022-08-04

Family

ID=82526547

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/137058 WO2022160967A1 (en) 2021-01-29 2021-12-10 Communication method, mobile device, electronic device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN114827687B (en)
WO (1) WO2022160967A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117062256B (en) * 2023-10-08 2023-12-26 荣耀终端有限公司 Cross-equipment service transfer method, electronic equipment and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104767550A (en) * 2014-01-06 2015-07-08 光宝科技股份有限公司 Mobile audio stream playing method and system
CN106488316A (en) * 2016-10-20 2017-03-08 北京小米移动软件有限公司 Media playing method and device, electronic equipment
CN108541080A (en) * 2018-04-23 2018-09-14 Oppo广东移动通信有限公司 First electronic equipment and the second electronic equipment carry out the method and Related product of Hui Lian
US20190089925A1 (en) * 2017-09-20 2019-03-21 Lg Electronics Inc. Display device
CN112205004A (en) * 2018-03-29 2021-01-08 搜诺思公司 Headset interaction with media playback system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108769431A (en) * 2018-07-03 2018-11-06 Oppo(重庆)智能科技有限公司 Audio play control method, device, storage medium and mobile terminal
CN111345010B (en) * 2018-08-17 2021-12-28 华为技术有限公司 Multimedia content synchronization method, electronic equipment and storage medium
CN113225693B (en) * 2019-04-18 2022-04-15 华为技术有限公司 Bluetooth connection method, equipment and system
CN110856152A (en) * 2019-10-28 2020-02-28 宇龙计算机通信科技(深圳)有限公司 Method, device, electronic equipment and medium for playing audio data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104767550A (en) * 2014-01-06 2015-07-08 光宝科技股份有限公司 Mobile audio stream playing method and system
CN106488316A (en) * 2016-10-20 2017-03-08 北京小米移动软件有限公司 Media playing method and device, electronic equipment
US20190089925A1 (en) * 2017-09-20 2019-03-21 Lg Electronics Inc. Display device
CN112205004A (en) * 2018-03-29 2021-01-08 搜诺思公司 Headset interaction with media playback system
CN108541080A (en) * 2018-04-23 2018-09-14 Oppo广东移动通信有限公司 First electronic equipment and the second electronic equipment carry out the method and Related product of Hui Lian

Also Published As

Publication number Publication date
CN114827687A (en) 2022-07-29
CN114827687B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
US11653398B2 (en) Bluetooth connection method and device
WO2021036835A1 (en) Bluetooth search method and system, and related apparatus
US11778363B2 (en) Audio data transmission method applied to switching between single-earbud mode and double-earbud mode of TWS headset and device
EP3979571A1 (en) Method for controlling device and terminal
CN112868244B (en) Point-to-multipoint data transmission method and device
WO2021082829A1 (en) Bluetooth connection method and related apparatus
WO2020133183A1 (en) Audio data synchronization method and device
US20220039041A1 (en) Point-to-Multipoint Data Transmission Method and Electronic Device
WO2021175214A1 (en) Projection screen connection control method and electronic device
WO2021043219A1 (en) Bluetooth reconnection method and related apparatus
WO2022068513A1 (en) Wireless communication method and terminal device
WO2021043198A1 (en) Bluetooth pairing method, and related device
CN114499587B (en) Audio synchronization communication method, system, wireless earphone, terminal and storage medium
WO2022143071A1 (en) Connection establishment method and electronic device
KR102335903B1 (en) Method and apparatus for communication between electronic devices
WO2021027623A1 (en) Device capability discovery method and p2p device
CN113038627B (en) File sharing method, mobile device and computer storage medium
WO2022213689A1 (en) Method and device for voice communicaiton between audio devices
WO2022160967A1 (en) Communication method, mobile device, electronic device, and computer-readable storage medium
CN117062256B (en) Cross-equipment service transfer method, electronic equipment and system
CN115175159B (en) Bluetooth headset playing method and equipment
WO2023029938A1 (en) Tws earphone decoupling and sharing method and apparatus, and device and storage medium
WO2023207138A1 (en) Incoming call notification system and electronic device
WO2023051204A1 (en) Cross-device connection method, electronic device and storage medium
WO2022057521A1 (en) Method and devices for configuring device

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21922557

Country of ref document: EP

Kind code of ref document: A1