WO2023160212A1 - 连接建立方法、装置、设备、存储介质及程序产品 - Google Patents

连接建立方法、装置、设备、存储介质及程序产品 Download PDF

Info

Publication number
WO2023160212A1
WO2023160212A1 PCT/CN2022/142346 CN2022142346W WO2023160212A1 WO 2023160212 A1 WO2023160212 A1 WO 2023160212A1 CN 2022142346 W CN2022142346 W CN 2022142346W WO 2023160212 A1 WO2023160212 A1 WO 2023160212A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio device
audio
connection
identification information
same
Prior art date
Application number
PCT/CN2022/142346
Other languages
English (en)
French (fr)
Inventor
侯锐填
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023160212A1 publication Critical patent/WO2023160212A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • H04W4/08User group management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/40Connection management for selective distribution or broadcast

Definitions

  • the embodiments of the present application relate to the technical field of Bluetooth, and in particular to a method, device, equipment, storage medium and program product for establishing a connection.
  • Bluetooth-based audio equipment such as wireless earphones
  • wireless earphones With the continuous development of short-distance wireless communication technologies such as Bluetooth, the application of Bluetooth-based audio equipment such as wireless earphones is also becoming more and more extensive.
  • the terminal device after receiving the Bluetooth broadcast message sent by the audio device, the terminal device can initiate a service query to the audio device to query the attributes supported by the audio device, and establish an audio connection with the audio device according to the result of the service query.
  • Embodiments of the present application provide a connection establishment method, device, equipment, storage medium, and program product.
  • the technical solutions include:
  • an embodiment of the present application provides a method for establishing a connection, the method is executed by a terminal device, and the method includes:
  • the second audio device is an audio device connected or determined to be connected to the terminal device; the attribute support information is used to indicate the service supported by the audio device.
  • an embodiment of the present application provides an apparatus for establishing a connection, and the apparatus includes:
  • a broadcast receiving module configured to receive a bluetooth broadcast message sent by the first audio device
  • a connection establishment module configured to establish an audio connection with the first audio device according to the attribute support information of the second audio device when the first audio device and the second audio device belong to the same device group;
  • the second audio device is an audio device connected or determined to be connected to the terminal device; the attribute support information is used to indicate the service supported by the audio device.
  • an embodiment of the present application provides a processing chip, where the processing chip is configured to execute the connection establishment method as described above.
  • an embodiment of the present application provides a processing chip, and the processing chip is provided with the above-mentioned connection establishment device.
  • an embodiment of the present application provides a computer device, the computer device includes a processor and a memory, the processor and the memory are connected through a bus; the processor executes the computer instructions, so that the computer device implements the connection establishment method as described above.
  • an embodiment of the present application further provides a computer-readable storage medium, where computer instructions are stored in the storage medium, and the computer instructions are configured to be executed by a processor, so as to implement the above method for establishing a connection.
  • the present application provides a computer program product comprising computer instructions stored in a computer readable storage medium.
  • the computer program product is used to implement the above connection establishment method.
  • the present application provides a computer program, which is executed by a processor of a computer device, so as to implement the above method for establishing a connection.
  • the terminal device When the terminal device receives the Bluetooth broadcast message sent by the first audio device and has established an audio connection with the second audio device, if the first audio device and the second audio device belong to the same device group, then according to the second The attribute support information of the audio device establishes an audio connection with the first audio device, which saves the process of inquiring about services to the first audio device, greatly shortens the establishment time of the audio connection, and improves the establishment efficiency of the audio connection.
  • Fig. 1 is a system architecture diagram of a wireless audio playback system provided by an exemplary embodiment of the present application
  • Fig. 2 is a message structure diagram of the RSI value involved in the present application.
  • FIG. 3 shows a schematic diagram of the audio connection involved in the present application
  • FIG. 4 shows a schematic diagram of the service query involved in this application
  • FIG. 5 shows a schematic diagram of the GATT structure involved in this application
  • FIG. 6 shows a flowchart of a connection establishment method provided by an exemplary embodiment of the present application
  • FIG. 7 shows a flowchart of a method for establishing a connection provided in an exemplary embodiment of the present application
  • FIG. 8 shows a flowchart of a connection establishment method provided by an exemplary embodiment of the present application
  • Fig. 9 is a flowchart of an audio connection involved in the embodiment shown in Fig. 8;
  • FIG. 10 shows a flowchart of a connection establishment method provided by an exemplary embodiment of the present application.
  • Fig. 11 is a schematic structural diagram of a device for establishing a connection provided in an exemplary embodiment of the present application.
  • Fig. 12 is a schematic structural diagram of a computer device provided by an exemplary embodiment of the present application.
  • the "plurality” mentioned herein means two or more.
  • “And/or” describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently.
  • the character “/” generally indicates that the contextual objects are an "or” relationship.
  • the "indication" mentioned in the embodiments of the present application may be a direct indication, may also be an indirect indication, and may also mean that there is an association relationship.
  • a indicates B which can mean that A directly indicates B, for example, B can be obtained through A; it can also indicate that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also indicate that there is an association between A and B relation.
  • the term "corresponding" may indicate that there is a direct or indirect correspondence between the two, or that there is an association between the two, or that it indicates and is indicated, configuration and is configuration etc.
  • predefinition can be realized by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in devices (for example, including terminal devices and network devices).
  • the implementation method is not limited.
  • pre-defined may refer to defined in the protocol.
  • Bluetooth Bluetooth
  • wireless headsets include True Wireless Stereo (TWS) Bluetooth headsets and so on.
  • TWS True Wireless Stereo
  • audio devices such as wireless earphones
  • it is necessary to establish a Bluetooth-based wireless audio connection with a terminal device ie, a sound source device
  • a terminal device ie, a sound source device
  • the audio device can also feed back user operations and user voice data to the terminal device.
  • FIG. 1 shows a system architecture diagram of a wireless audio playback system provided by an exemplary embodiment of the present application.
  • the system includes an audio device 110 and a terminal device 120 .
  • the audio device 110 may be a Bluetooth headset, or other audio playback devices supporting the Bluetooth protocol, such as a Bluetooth speaker or the like.
  • the audio device 110 may also be a computer device supporting the Bluetooth protocol, such as a smart phone, a tablet computer, a smart TV, a personal computer, and the like.
  • the audio device 110 has a function of playing audio, for example, a speaker component is provided in the audio device 110 .
  • the audio device 110 also has an audio collection function, an operation reception function, and the like.
  • the audio device 110 is also provided with a pickup/microphone, operation keys, and touch sensors, and the like.
  • the terminal device 120 may be a computer device supporting the Bluetooth protocol, for example, the terminal device 120 may be a smart phone, a tablet computer, a smart TV, a personal computer, and the like.
  • the terminal device 120 After the connection between the terminal device 120 and the audio device 110 is established through the Bluetooth protocol, the terminal device 120 can push audio data to the audio device 110, and the audio device plays the audio data.
  • the audio device 110 may collect the user's voice (for example, in a call scene or a voice control scene), obtain the user's voice data, and send the voice data back to the terminal device 120 .
  • the audio device 110 may also transmit an operation signal to the terminal device 120 when receiving an operation on an operation button or a touch sensor in the audio device 110, and the terminal device 120 performs a corresponding operation according to the operation signal.
  • the audio device 110 can send control information to the terminal device 120 according to the received user operation, so as to control the functions related to audio playback in the terminal device 120, such as switching to the previous song, switching to the next song, etc.
  • control information such as switching to the previous song, switching to the next song, etc.
  • Bluetooth Low Energy Audio (Bluetooth Low Energy Audio, BLE-Audio, also known as LE-Audio), is a new audio transmission technology of the Bluetooth protocol, which brings people lower power consumption, lower cost, higher Quality, and lower-latency wireless audio services, and TWS headsets are one of the hottest Bluetooth products in the market today.
  • BLE Audio provides the CSIP (Coordinated Set Identification Profile) protocol, which allows devices belonging to the same group to achieve coordination and synchronization when interacting with external devices.
  • This protocol mainly explains how an external device recognizes multiple independent devices in a combination as the same combination. For multiple devices belonging to the same combination, if they want to use them together with external devices at the same time, each device needs to establish an independent BLE Audio connection with the external device.
  • the combined identity resolving value (Set Identity Resolving Key, SIRK) is judged, and the devices with the same SIRK value are combined into a combination.
  • the TWS earphones that support BLE Audio will send LE Audio broadcast when the earphones are opened. Audio connects and obtains the SIRK of the earphone. At this time, the earphone 1 can normally interact with the mobile phone for voice data. When the mobile phone receives the LE Audio broadcast of the headset 2, it can analyze and judge whether the headset 2 and the currently connected headset 1 belong to the same coordination set (that is, whether they belong to the same device group).
  • the RSI value in the LE Audio broadcast message includes a hash value and a prand field, where the prand field includes a random part and a fixed part (that is, 1 and 0 at the end).
  • the hash value can be calculated from the SIRK and prand fields.
  • the mobile phone calculates a hash value based on the SIRK of headset 1 and the prand field in the RSI value carried in the broadcast message of headset 2, and then compares the calculated hash value with the hash field of the RSI value in the broadcast message of headset 2 , to determine whether the two are consistent. If the two are consistent, the mobile phone will automatically establish a LE Audio connection with another earphone 2.
  • FIG. 3 shows a schematic diagram of audio connections involved in this application.
  • the process of establishing LE-Audio between the mobile phone and the TWS headset can be as follows:
  • earphone 1 and earphone 2 will send LE-Audio broadcasts respectively.
  • the mobile phone acquires a SIRK from the headset 1 .
  • the mobile phone scans the LE-Audio broadcast (broadcast 2) sent by the earphone 2.
  • the mobile phone calculates a hash value according to the prand field of the SIRK of the earphone 1 and the RSI value in the broadcast 2.
  • the mobile phone judges whether the calculated hash value is consistent with the hash field in the broadcast 2; if so, enters S38, otherwise ends.
  • step S36 and steps S35 to S38 may be executed synchronously, or may be executed sequentially.
  • the mobile phone may also execute steps S35 to S38 while executing step S36.
  • FIG. 4 shows a schematic diagram of service query involved in this application.
  • the above service inquiry process refers to the process in which the client 41 (Client) inquires the server 42 (Server) about various attributes it supports.
  • the client 41 sends an ATT (Attribute, attribute) request/command to the server 42, and the server 42 returns an ATT response to the client 41, and the ATT response includes information about the attributes supported by the server 42. information.
  • GATT Generic Attribute Profile
  • the GATT structure information indicates multiple consistent services (services) supported by the server, and each service has its own characteristics (characteristic), description (descriptor) and other fields.
  • characteristics characteristics
  • description description
  • other fields During the service query process, each field A separate ATT query is required. Therefore, when there are many services and their contents are complex, the ATT query time will be much longer.
  • FIG. 6 shows a flowchart of a method for establishing a connection provided by an exemplary embodiment of the present application.
  • the method can be used in a terminal device; wherein, the terminal device can be the terminal device 120 in the above system shown in FIG. 1 .
  • the method may include the following steps.
  • Step 601 receiving a Bluetooth broadcast message sent by a first audio device.
  • the first audio device may be the audio device 110 in the system shown in FIG. 1 .
  • the first audio device may periodically send a Bluetooth broadcast message, so that surrounding terminal devices can discover the first audio device.
  • Step 602 when the first audio device and the second audio device belong to the same device group, establish an audio connection with the first audio device according to the attribute support information of the second audio device; the second audio device is connected or determined to be connected by the terminal device Audio device; attribute support information is used to indicate the services supported by the audio device.
  • the second audio device is an audio device to which the terminal device is connected, and may refer to an audio connection or a bottom layer connection that has been established between the terminal device and the second audio device.
  • the above-mentioned second audio device is an audio device to which the terminal device determines to connect, which may mean that the terminal device has received an instruction to establish an audio connection with the second audio device, and the terminal has not yet completed the audio connection with the second audio device or the underlying Connection establishment.
  • the terminal device can use the attribute support information of the second audio device to establish an audio connection with the first audio device For the audio connection, there is no need to inquire the supported attributes of the first audio device through a service query, thereby saving the step of performing service query on the first audio device.
  • the terminal device when the terminal device receives the Bluetooth broadcast message sent by the first audio device, and has established an audio connection with the second audio device, if the first audio If the device and the second audio device belong to the same device group, an audio connection is established with the first audio device according to the attribute support information of the second audio device, which saves the process of service inquiry to the first audio device and greatly shortens the audio connection Faster establishment time improves the efficiency of audio connection establishment.
  • the terminal device may obtain the combined identification information of the second audio device, and determine the combination of the first audio device and the second audio device according to the combined identification information of the second audio device. Whether the audio devices belong to the same device group. When it is determined according to the combination identification information of the second audio device that the first audio device and the second audio device belong to the same device group, an audio connection may be established with the first audio device according to the attribute support information of the second audio device.
  • FIG. 7 shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application.
  • the terminal device as a mobile phone
  • the first audio device and the second audio device as TWS Bluetooth headsets
  • the established connection as an LE-Audio connection as an example
  • the method may include the following steps.
  • step 701 the earphone is opened, the earphone 1 and the earphone 2 are paired and start to send Bluetooth low energy broadcast.
  • step 702 the mobile phone turns on Bluetooth, and turns on BLE scanning at the same time.
  • step 703 the mobile phone first scans the broadcast sent by the earphone 1, and completes the connection with the earphone 1 on the underlying LE link.
  • Step 704 the mobile phone obtains the SIRK of the headset 1 from the headset 1; at the same time, the mobile phone initiates a service query to the headset 1, and establishes a LE-Audio protocol connection with the headset 1 according to the attribute support information obtained from the service query.
  • Step 705 the mobile phone scans the broadcast of the earphone 2, and determines that the earphone 2 and the earphone 1 belong to the same device group.
  • step 706 the mobile phone establishes a LE-Audio protocol connection with the headset 1 according to the attribute support information obtained from querying the headset 1 .
  • the mobile phone does not need to initiate a service query to the headset 1 .
  • the terminal device may Obtain the combined identification information of the first audio device from the first audio device, and then determine whether the combined identification information of the first audio device is the same as the combined identification information of the second audio device, thereby determining whether the first audio device and the second audio device are belong to the same device group.
  • FIG. 8 shows a flowchart of a method for establishing a connection provided by an exemplary embodiment of the present application.
  • the method may be executed by a terminal device; wherein, the terminal device may be the terminal device 120 in the system shown in FIG. 1 .
  • the method may include the following steps.
  • Step 801 the terminal device receives a Bluetooth broadcast message sent by a second audio device.
  • the terminal device after the terminal device turns on the Bluetooth scanning function, it can receive the Bluetooth broadcast message sent by the surrounding audio devices.
  • step 802 the terminal device executes a process of establishing an audio connection with the second audio device.
  • the terminal device after the terminal device receives the Bluetooth broadcast message sent by the second audio device, it can display the information of the second audio device on the Bluetooth scanning interface. Clicking on the option of the device, the terminal device can receive an instruction to establish a connection with the second audio device, and the terminal device can execute the process of establishing an audio connection with the second audio device.
  • the process of establishing an audio connection between the above-mentioned terminal device and the second audio device may include the following sub-steps:
  • the terminal device establishes an underlying connection with the second audio device.
  • the terminal device can establish a low-level LE connection with the second audio device, and perform key negotiation with the second audio device through the low-level LE connection to implement link layer data encryption.
  • the terminal device initiates a service query to the second audio device to obtain attribute support information of the second audio device.
  • the service query process initiated by the terminal device to the second audio device may query which services are supported by the second audio device, and information such as capabilities/attributes corresponding to the services supported by the second audio device.
  • the terminal device may query the second audio device for at least one of the following information:
  • Which operation controls are supported by the second audio device (for example, whether to support the pause playback operation, whether to support the switching operation of the next song, whether to support the switching operation of the previous song, etc.);
  • the terminal device when the upper terminal device initiates a service query to the second audio device, the terminal device can send a service query command to the second audio device, and after receiving the service query command, the second audio device can return the service it supports to the terminal device. related information.
  • the above-mentioned service query process can be performed in the manner stipulated in the BLE standard (such as the relevant standard of the LE Audio protocol).
  • BLE standard such as the relevant standard of the LE Audio protocol.
  • the terminal device establishes an audio connection with the second audio device according to the attribute support information of the second audio device.
  • an audio connection establishment request may be sent according to information related to services supported by the second audio device found in step 802b.
  • the terminal device after the terminal device completes the service query of the second audio device, it can send an instruction for configuring an audio connection to the second audio device, such as an ATT protocol (Attribute Protocol, attribute protocol) write instruction, and the ATT write instruction is used for Write the relevant configuration information of the second audio connection in the audio device to complete the example of the audio connection.
  • the second audio device after receiving the ATT write command, configures the audio connection according to the relevant configuration information in the ATT write command.
  • the establishment process of the above-mentioned audio connection can be performed according to the audio connection establishment method stipulated in the BLE standard (such as the relevant standard of the LE Audio protocol).
  • process of establishing an audio connection between the terminal device and the second audio device may also include:
  • the terminal device initiates an identification query to the second audio device to obtain combined identification information of the second audio device.
  • the terminal device may also query the combination identification information of the second audio device.
  • the combination identification information may be SIRK.
  • Step 803 the terminal device receives the Bluetooth broadcast message sent by the first audio device.
  • the above-mentioned first audio device is another Bluetooth device other than the second audio device.
  • the terminal device receives the Bluetooth broadcast message sent by the first audio device and determines that the sender of the Bluetooth broadcast message is not the second audio device, subsequent steps may be performed.
  • Step 804 the terminal device acquires combination identification information of the second audio device.
  • step 804 may be performed after step 802, or may be performed during step 802.
  • the terminal device has established an underlying connection or an audio connection with the second audio device; or, at step 804, the terminal device has received an instruction to connect with the second audio device. That is to say, at this moment, the terminal device has been connected or is determined to be connected to the above-mentioned second audio device.
  • step In 804 when the terminal device has inquired about the combination identification information of the second audio device from the second audio device (for example, the combination identification information of the second audio device is inquired according to the process of S802d above), in step In 804, the combined identification information of the queried second audio device may be directly read locally.
  • step 804 when the terminal device has not yet inquired about the combination identification information of the second audio device from the second audio device, in step 804, the terminal device may follow the above-mentioned process of S802d to request the second audio device Query its combination identification information. At this time, step 804 is the same step as above-mentioned S802d.
  • Step 805 the terminal device acquires combination identification information of the first audio device.
  • the terminal device may query the first audio device for combined identification information of the first audio device.
  • the terminal device may establish an underlying connection with the first audio device, and query the combination identification information of the first audio device through the underlying connection with the first audio device.
  • the Bluetooth broadcast message sent by the first audio device includes a first hash field
  • the terminal device Before acquiring the combined identification information of the first audio device, the terminal device can generate a second hash field according to the combined identification information of the second audio device; when the first hash field is the same as the second hash field, establish the same Low-level connection between audio devices.
  • the RSI value of the Bluetooth broadcast message sent by the first audio device includes the first hash field and the prand field
  • the terminal device can extract the Bluetooth broadcast message sent by the first audio device.
  • the first hash field and the prand field of the first hash field and the prand field are calculated according to the extracted prand field and the SIRK of the second audio device to obtain the second hash field.
  • the terminal device may establish an underlying connection with the first audio device.
  • Step 806 When the combined identification information of the first audio device is the same as the combined identification information of the second audio device, the terminal device determines that the first audio device and the second audio device belong to the same device group.
  • the terminal device After the terminal device obtains the combination identification information of the first audio device through the underlying connection with the first audio device, it compares it with the combination identification information of the second audio device. If they are consistent, the combination identification information of the first audio device matches the combination identification information of the second audio device, that is, the first audio device and the second audio device are considered to belong to the same device group.
  • Step 807 when the first audio device and the second audio device belong to the same device group, the terminal device establishes an audio connection with the first audio device according to the attribute support information of the second audio device.
  • establishing an audio connection with the first audio device according to attribute support information of the second audio device includes:
  • An audio connection is established with the first audio device according to the attribute support information of the first audio device.
  • the terminal device when the terminal device determines that the first audio device and the second audio device belong to the same device group, it can be considered that the first audio device and the second audio device are the same set of audio devices, such as the same pair of TWS earphones. It is considered that the attribute support information (such as the above-mentioned GATT structure information) of the two is also the same.
  • the terminal device can directly use the combination identification information of the second audio device to establish an audio connection with the first audio device, and does not need to send an audio link to the first audio device.
  • Device query attribute support information when the terminal device determines that the first audio device and the second audio device belong to the same device group, it can be considered that the first audio device and the second audio device are the same set of audio devices, such as the same pair of TWS earphones. It is considered that the attribute support information (such as the above-mentioned GATT structure information) of the two is also the same.
  • the terminal device can directly use the combination identification information of the second audio device to establish an audio connection with
  • the terminal device before the terminal device establishes an audio connection with the first audio device according to the attribute support information of the second audio device, it may also multiplex the attribute support information of the second audio device into the Attribute support information.
  • the terminal device after the terminal device determines that the above-mentioned first hash field is the same as the second hash field, or after establishing an underlying connection with the first audio device, it can set the second
  • the attribute support information of the audio device is temporarily multiplexed into the attribute support information of the first audio device.
  • the terminal device after determining that the first audio device and the second audio device belong to the same device group, the terminal device multiplexes the attribute support information of the second audio device into the attribute of the first audio device support information.
  • the audio device when the attribute support information includes GATT structure information, after the terminal device multiplexes the attribute support information of the second audio device into the attribute support information of the first audio device, except according to the attribute support information and the first In addition to establishing an audio connection, the audio device can further read parameter values corresponding to each field in the GATT structure information.
  • the first audio device and the second audio device when both belong to the same device group, although the GATT structure information of the two is the same, the parameter values corresponding to the fields in the GATT structure information of the two may be different.
  • Step 808 When the combined identification information of the first audio device is different from that of the second audio device, the terminal device initiates a service query to the first audio device through the underlying connection to obtain attribute support information of the first audio device.
  • the terminal device may consider that the first audio device and the second audio device are not the same set of audio devices, and the two The attribute support information may be different. In this case, the terminal device may initiate a service query to the first audio device.
  • Step 809 the terminal device establishes an audio connection with the first audio device according to the attribute support information of the first audio device.
  • the Bluetooth broadcast message may be a Bluetooth Low Energy LE broadcast message
  • the audio connection may be a Bluetooth Low Energy LE audio connection.
  • the above-mentioned first audio device and the second audio device may be true wireless stereo TWS earphones.
  • FIG. 9 shows a flowchart of an audio connection involved in the embodiment of the present application.
  • the terminal device is a mobile phone
  • the first audio device and the second audio device are a pair of headphones as an example.
  • the audio connection process can be as follows:
  • the earphone cover is opened, earphone 1 and earphone 2 are paired and start to send Bluetooth low energy broadcast.
  • the mobile phone first scans the broadcast 1 sent by the earphone 1, and completes the connection with the earphone 1 on the underlying LE link.
  • the mobile phone obtains the SIRK1 of the headset 1 from the headset 1; at the same time, the mobile phone initiates a service query to the headset 1, and establishes a connection with the headset 1 using the LE-Audio protocol according to the GATT structure obtained from the service query.
  • the mobile phone scans the broadcast 2 of the earphone 2, and calculates the hash value according to the information in SIRK1 and broadcast 2.
  • the mobile phone judges whether the calculated hash value is the same as the hash field in the broadcast 2; if yes, enters S907, otherwise ends.
  • the mobile phone obtains the SIRK2 of the headset 2 from the headset 2 .
  • the mobile phone judges whether SIRK1 and SIRK2 are consistent; if yes, enters S911, otherwise, enters S912.
  • the mobile phone when the mobile phone analyzes that the hash field in the broadcast of the headset 2 is consistent with the hash value calculated from the broadcast content, the mobile phone initiates an LE connection to the headset 2 .
  • the codes of earphone 1 and earphone 2 are the same set of codes, but the roles of the two initializations are different, the GATT structure of the two is the same, and they can also be considered as the same device in disguise, but some attribute values may be different between the two.
  • the left earphone will be configured to receive left channel data during the protocol connection phase with the mobile phone, and the right earphone will be configured to receive left channel data. Therefore, it is not necessary for the mobile phone to perform the process of service discovery and query for the headset 2 again.
  • the mobile phone when the mobile phone actively initiates the LE connection to the earphone 2, the mobile phone first temporarily multiplexes the GATT structure of the earphone 1 to the earphone 2, and at the same time performs the SIRK reading step for the earphone 2.
  • the mobile phone queries the SIRK of the headset through the underlying LE connection, so the SIRK can be transmitted in an encrypted manner, that is, the queried SIRK is an encrypted SIRK based on the underlying LE connection, which is unique and safe.
  • the mobile phone obtains SIRK2
  • the mobile phone compares the SIRK of earphone 1 and earphone 2. If they are found to be consistent, it means that the two earphones are a pair, because usually, SIRK is cured at the factory, and only matched earphones have the same SIRK. So far, the mobile phone will directly multiplex the GATT structure of the headset 1 to the headset 2, omitting the service query process for the headset 2, and then initiate a LE-Audio protocol connection to the headset 2.
  • the mobile phone finds that SIRK1 and SIRK2 are inconsistent, it means that the earphone 2 is not a pair with the earphone 1. It may be that an external device steals the broadcast content of the earphone 1 to forge. At this time, the mobile phone will not regard the earphone 1 and the earphone 2 as a pair of devices. The mobile phone also needs to perform a complete service query and a connection with the LE-audio protocol for the headset 2 alone.
  • the mobile phone multiplexes the GATT structure of the earphone 1, thereby saving the service inquiry link of the mobile phone for the earphone 2, thereby saving 2-3 seconds of connection time.
  • the mobile phone multiplexes the GATT structure of the earphone 1, thereby saving the service inquiry link of the mobile phone for the earphone 2, thereby saving 2-3 seconds of connection time.
  • there are more peripheral devices that is, when multiple peripheral devices form a group and all support the CSIP protocol, more connection time can be saved through this solution.
  • the judgment link of SIRK is added, instead of simply judging that earphone 2 and earphone 1 are a pair of devices through the analysis of the broadcast field of earphone 2, because the broadcast content is easy to be forged by external devices, that is, third-party devices steal earphones 1’s broadcast content is broadcast by LE, which makes the mobile phone mistakenly think that the three-party device and earphone 1 are a set of devices and directly multiplex its GATT structure. The third-party device cannot work normally, and there are risks such as communication security.
  • SIRK it is possible to make an in-depth judgment on whether two devices will be a pair of devices to ensure its safety.
  • the terminal device when the terminal device receives the Bluetooth broadcast message sent by the first audio device, and has established an audio connection with the second audio device, if the first audio If the device and the second audio device belong to the same device group, an audio connection is established with the first audio device according to the attribute support information of the second audio device, which saves the process of service inquiry to the first audio device and greatly shortens the audio connection Faster establishment time improves the efficiency of audio connection establishment.
  • the terminal device when it is determined according to the combined identification information of the second audio device that the first audio device and the second audio device belong to the same device group, after obtaining the combined identification information of the second audio device, the terminal device passes the A Bluetooth broadcast message sent by an audio device can determine whether the first audio device and the second audio device belong to the same device group.
  • FIG. 10 shows a flowchart of a method for establishing a connection provided by an exemplary embodiment of the present application.
  • the method may be executed interactively by a terminal device and an audio device; wherein, the audio device may be the audio device 110 in the above system shown in FIG. 1 , and the terminal device may be the terminal device 120 in the system shown in FIG. 1 .
  • the method may include the following steps.
  • Step 1001 a terminal device receives a Bluetooth broadcast message sent by a second audio device.
  • step 1002 the terminal device executes a process of establishing an audio connection with the second audio device.
  • Step 1003 the terminal device receives the Bluetooth broadcast message sent by the first audio device.
  • Step 1004 the terminal device acquires combination identification information of the second audio device.
  • step 1001 to step 1004 is similar to the execution process of step 801 to step 804 in the embodiment shown in FIG. 8 , and will not be repeated here.
  • Step 1005 the terminal device generates a second hash field according to the combined identification information of the second audio device.
  • Step 1006 when the first hash field is the same as the second hash field in the Bluetooth broadcast message sent by the first audio device, determine that the first audio device and the second audio device belong to the same device group.
  • the calculation method of the above-mentioned second hash field can refer to the description in the above-mentioned embodiment shown in FIG. 8 , which will not be repeated here.
  • Step 1007 when the first audio device and the second audio device belong to the same device group, the terminal device establishes an audio connection with the first audio device according to the attribute support information of the second audio device.
  • the terminal device After the terminal device determines that the first audio device and the second audio device belong to the same device group according to the combined identification information of the first broadcast message and the second audio device, it can directly The attribute support information establishes an audio connection with the first audio device, and no direct comparison of combined identification information is required, thereby further shortening the duration of the audio connection.
  • the terminal device when the terminal device receives the Bluetooth broadcast message sent by the first audio device, and has established an audio connection with the second audio device, if the first audio If the device and the second audio device belong to the same device group, an audio connection is established with the first audio device according to the attribute support information of the second audio device, which saves the process of service inquiry to the first audio device and greatly shortens the audio connection Faster establishment time improves the efficiency of audio connection establishment.
  • FIG. 11 shows a schematic structural diagram of an apparatus for establishing a connection provided by an exemplary embodiment of the present application.
  • the connection establishment apparatus 1100 can be used to execute all or part of the steps performed by the terminal device in the embodiment shown in FIG. 6 or FIG. 8; the apparatus includes:
  • a connection establishment module 1102 configured to establish an audio connection with the first audio device according to the attribute support information of the second audio device when the first audio device and the second audio device belong to the same device group;
  • the second audio device is an audio device connected or determined to be connected to the terminal device; the attribute support information is used to indicate the service supported by the audio device.
  • the device further includes:
  • a first identification information acquisition module configured to acquire combined identification information of the second audio device before the connection establishment module establishes an audio connection with the first audio device according to the attribute support information of the second audio device;
  • the combination identifier is used to indicate the device group to which the audio device belongs;
  • the connection establishment module 1102 is configured to, when it is determined according to the combination identification information of the second audio device that the first audio device and the second audio device belong to the same device group, according to the attribute of the second audio device
  • the support information establishes an audio connection with the first audio device.
  • the Bluetooth broadcast message includes a first hash field
  • the device also includes:
  • the first field generation module is configured to generate the field according to the combination identification information of the second audio device before the connection establishment module 1102 establishes an audio connection with the first audio device according to the attribute support information of the second audio device.
  • the second hash field
  • a first determining module configured to determine that the first audio device and the second audio device belong to the same device group when the first hash field is the same as the second hash field.
  • the device further includes:
  • a first identification information acquisition module configured to acquire combined identification information of the first audio device before the connection establishment module 1102 establishes an audio connection with the first audio device according to the attribute support information of the second audio device ;
  • a second determination module configured to determine that the first audio device and the second audio device belong to the same device group when the combined identification information of the first audio device is the same as the combined identification information of the second audio device .
  • the Bluetooth broadcast message includes a first hash field
  • the device also includes:
  • a first field generating module configured to generate a second hash field according to the combined identification information of the second audio device before the first identification information obtaining module acquires the combined identification information of the first audio device;
  • connection establishment module 1102 is further configured to establish an underlying connection with the first audio device when the first hash field is the same as the second hash field.
  • the first identification information obtaining module is configured to obtain combined identification information of the first audio device from the first audio device through the underlying connection.
  • the device further includes:
  • a service query module configured to initiate a service query to the first audio device through the underlying connection when the combination identification information of the first audio device is different from that of the second audio device, and obtain the second audio device. Attribute support information of an audio device;
  • the connection establishment module 1102 is further configured to establish an audio connection with the first audio device according to the attribute support information of the first audio device.
  • the Bluetooth broadcast message is a Bluetooth Low Energy LE broadcast message
  • the audio connection is a Bluetooth Low Energy LE audio connection.
  • the combination identification information is a combination identification analysis value SIRK;
  • the attribute support information is general attribute coordination set protocol GATT structure information.
  • the first audio device and the second audio device are true wireless stereo TWS earphones.
  • the terminal device when the terminal device receives the Bluetooth broadcast message sent by the first audio device, and has established an audio connection with the second audio device, if the first audio If the device and the second audio device belong to the same device group, an audio connection is established with the first audio device according to the attribute support information of the second audio device, which saves the process of service inquiry to the first audio device and greatly shortens the audio connection Faster establishment time improves the efficiency of audio connection establishment.
  • the device provided by the above embodiment realizes its functions, it only uses the division of the above-mentioned functional modules as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to actual needs. That is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • FIG. 12 shows a schematic structural diagram of a computer device 1200 provided by an embodiment of the present application.
  • the computer device 1200 may include: a processor 1201 , a receiver 1202 , a transmitter 1203 , a memory 1204 and a bus 1205 .
  • the processor 1201 includes one or more processing cores, and the processor 1201 executes various functional applications and information processing by running software programs and modules.
  • the receiver 1202 and the transmitter 1203 can be implemented as a communication component, which can be a communication chip.
  • the communication chip can also be called a transceiver.
  • the memory 1204 is connected to the processor 1201 through the bus 1205 .
  • the memory 1204 may be used to store a computer program, and the processor 1201 is used to execute the computer program, so as to implement various steps in the foregoing method embodiments.
  • volatile or non-volatile storage device includes but not limited to: magnetic disk or optical disk, electrically erasable and programmable Read Only Memory, Erasable Programmable Read Only Memory, Static Anytime Access Memory, Read Only Memory, Magnetic Memory, Flash Memory, Programmable Read Only Memory.
  • the transceiver 1202 is configured to receive a Bluetooth broadcast message sent by the first audio device;
  • Processor 1201 when the first audio device and the second audio device belong to the same device group, establish an audio connection with the first audio device according to the attribute support information of the second audio device; wherein, the second audio device
  • the audio device is the audio device to which the terminal device is connected or determined to be connected; the attribute support information is used to indicate the services supported by the audio device.
  • the embodiment of the present application also provides a computer-readable storage medium, the storage medium stores computer instructions, and the computer instructions are loaded and executed by a processor to implement the above-mentioned various method embodiments, the terminal device or the audio device All or part of the steps performed.
  • the present application also provides a chip, which is used to run in a computer device, so that the computer device executes all or part of the steps performed by the terminal device in the above method embodiments.
  • the present application also provides a computer program product, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the foregoing computer program product may be used to implement all or part of the steps executed by the terminal device in each of the foregoing method embodiments.
  • the present application also provides a computer program product, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs all or part of the steps performed by the terminal device in the above method embodiments.
  • the present application also provides a computer program, which is executed by a processor of a computer device, so as to implement all or part of the steps performed by the terminal device in each of the foregoing method embodiments.
  • the functions described in the embodiments of the present application may be implemented by hardware, software, firmware or any combination thereof.
  • the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
  • Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • a storage media may be any available media that can be accessed by a general purpose or special purpose computer.

Landscapes

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

Abstract

一种连接建立方法、装置、设备、存储介质及程序产品,属于蓝牙技术领域。该方法包括:接收第一音频设备发送的蓝牙广播消息(601);当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接(602)。上述方案节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。

Description

连接建立方法、装置、设备、存储介质及程序产品
本申请要求于2022年02月28日提交的、申请号为202210188399.5、发明名称为“连接建立方法、装置、设备、存储介质及程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及蓝牙技术领域,特别涉及一种连接建立方法、装置、设备、存储介质及程序产品。
背景技术
随着蓝牙等短距离无线通信技术的不断发展,无线耳机等基于蓝牙的音频设备的应用也越来越广泛。
在相关技术中,终端设备接收到音频设备发送的蓝牙广播消息后,可以向音频设备发起服务查询,以查询音频设备支持的属性,并根据服务查询的结果,与音频设备建立音频连接。
发明内容
本申请实施例提供了一种连接建立方法、装置、设备、存储介质及程序产品。所述技术方案包括:
一方面,本申请实施例提供了一种连接建立方法,所述方法由终端设备执行,所述方法包括:
接收第一音频设备发送的蓝牙广播消息;
当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;
其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。
一方面,本申请实施例提供了一种连接建立装置,所述装置包括:
广播接收模块,用于接收第一音频设备发送的蓝牙广播消息;
连接建立模块,用于当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;
其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。
另一方面,本申请实施例提供了一种处理芯片,所述处理芯片用于执行如上所述的连接建立方法。
另一方面,本申请实施例提供了一种处理芯片,所述处理芯片中设置有如上所述的连接建立装置。
另一方面,本申请实施例提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述处理器和所述存储器之间通过总线相连;所述处理器执行所述存储器中存储的计算机指令,以使得所述计算机设备实现如上所述的连接建立方法。
又一方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质中存储有计算机指令,所述计算机指令用于被处理器执行,以实现上述连接建立方法。
又一方面,本申请提供了一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。该计算机程序产品用于实现上述连接建立方法。
又一方面,本申请提供了一种计算机程序,该计算机程序由计算机设备的处理器执行, 以实现上述连接建立方法。
本申请实施例提供的技术方案至少包括如下有益效果:
终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。
附图说明
图1是本申请一个示例性实施例提供的无线音频播放系统的系统架构图;
图2是本申请涉及的RSI值的消息结构图;
图3示出了本申请涉及的音频连接示意图;
图4示出了本申请涉及的服务查询示意图;
图5示出了本申请涉及的GATT结构示意图;
图6示出了本申请一个示例性实施例提供的连接建立方法的流程图;
图7示出了本申请一个示例性实施例提供的连接建立方法的流程图;
图8示出了本申请一个示例性实施例提供的连接建立方法的流程图;
图9是图8所示实施例涉及的一种音频连接的流程图;
图10示出了本申请一个示例性实施例提供的连接建立方法的流程图;
图11是本申请一个示例性实施例提供的连接建立装置的结构示意图;
图12是本申请一个示例性实施例提供的计算机设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
应理解,在本申请的实施例中提到的“指示”可以是直接指示,也可以是间接指示,还可以是表示具有关联关系。举例说明,A指示B,可以表示A直接指示B,例如B可以通过A获取;也可以表示A间接指示B,例如A指示C,B可以通过C获取;还可以表示A和B之间具有关联关系。
在本申请实施例的描述中,术语“对应”可表示两者之间具有直接对应或间接对应的关系,也可以表示两者之间具有关联关系,也可以是指示与被指示、配置与被配置等关系。
本申请实施例中,“预定义”可以通过在设备(例如,包括终端设备和网络设备)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定。比如预定义可以是指协议中定义的。
得益于蓝牙(Bluetooth,BT)等短距离无线通信技术的发展,无线耳机等基于蓝牙的音频设备也越来越多的被用户所接受,其实现形式也越来越多样化。比如,目前的无线耳机有真无线立体声(True Wireless Stereo,TWS)蓝牙耳机等等。
无线耳机等音频设备在使用时,需要与终端设备(即音源设备)建立基于蓝牙的无线音频连接,并播放终端设备推送的音频数据。在某些业务场景下,音频设备还可以向终端设备反馈用户操作,以及用户的语音数据等等。
请参考图1,其示出了本申请一个示例性实施例提供的无线音频播放系统的系统架构图。如图1所示,该系统包括音频设备110以及终端设备120。
其中,音频设备110可以是蓝牙耳机、或者支持蓝牙协议的其它音频播放设备,比如蓝 牙音箱等等。音频设备110也可以是支持蓝牙协议的计算机设备,例如,可以是智能手机、平板电脑、智能电视、以及个人电脑等等。
音频设备110具有播放音频的功能,例如,音频设备110中设置有扬声器组件。
可选的,音频设备110还具有音频采集功能、操作接收功能等等。比如,音频设备110中还设置有拾音器/麦克风、操作按键、以及触摸传感器等等。
终端设备120可以是支持蓝牙协议的计算机设备,例如,终端设备120可以是智能手机、平板电脑、智能电视、以及个人电脑等等。
终端设备120与音频设备110之间通过蓝牙协议建立连接后,终端设备120可以向音频设备110推送音频数据,由音频设备对该音频数据进行播放。
可选的,音频设备110可以采集用户的语音(比如,在通话场景或者语音控制场景),获得用户的语音数据,并将语音数据回传给终端设备120。
可选的,音频设备110也可以在接收到对音频设备110中的操作按键或者触摸传感器的操作时,将操作信号传输给终端设备120,由终端设备120根据该操作信号执行相应的操作。
比如,在一些方案中,音频设备110可以根据接收到的用户操作,向终端设备120发送控制信息,以对终端设备120中与音频播放相关的功能进行控制,比如切换至上一首、切换至下一首、音量调节、接听/挂断电话等等。
蓝牙低功耗音频(Bluetooth Low Energy Audio,BLE-Audio,也称为LE-Audio),是蓝牙协议的一项新的音频传输技术,给人们带来更低功耗、更低成本、更高质量、以及更低延迟的无线音频服务,而TWS耳机是当下市场最火的蓝牙产品之一。
BLE Audio提供了CSIP(Coordinated Set Identification Profile,协调集识别配置文件)协议,可以让属于同一个组合中的设备在与外部设备交互时,达成协调同步的目的。该协议中主要说明了外部设备如何将一个组合中的多个独立的设备识别为同一个组合。针对属于同一个组合中的多个设备,要想同时与外部设备一起使用的话,每一个设备都需要跟外部设备建立独立的BLE Audio连接,同时可以根据获取到的每个设备的组合标识信息,比如,组合标识解析值(Set Identity Resolving Key,SIRK)进行判断,将具有相同SIRK值的设备组成一个组合。
针对首次连接,支持BLE Audio的TWS耳机,在耳机开盖时,两只耳机会发送LE Audio广播,用户选择连接一只耳机时,手机(终端设备)先与该耳机1进行连接,以建立LE Audio连接,并获取该耳机的SIRK,此时,耳机1可以正常与手机之间进行语音数据的交互。手机在收到耳机2的LE Audio广播时,可以解析判断此耳机2与当前连接的耳机1是否属于相同的协调集(即是否属于相同的设备分组)。
请参考图2,其示出了本申请涉及的RSI值的消息结构图。如图2所示,LE Audio广播消息中的RSI值包含hash值和prand字段,其中,prand字段包含随机部分和固定部分(即结尾的1和0)。hash值可以由SIRK和prand字段计算得到。
手机根据耳机1的SIRK,与耳机2的广播消息携带的RSI值中的prand字段,计算出一个hash值,然后将计算得到的hash值与耳机2的广播消息中的RSI值的hash字段比对,确定两者是否一致。若两者一致,则手机自动与另一只耳机2建立LE Audio连接。
请参考图3,其示出了本申请涉及的音频连接示意图。如图3所示,手机与TWS耳机建立LE-Audio的过程可以如下:
S31,TWS耳机中的耳机1和耳机2发送LE-Audio广播。
其中,TWS耳机的耳机盒打开之后,耳机1和耳机2将各自发送LE-Audio广播。
S32,手机打开蓝牙低功耗LE扫描后,扫描到耳机1发送的LE-Audio广播(广播1)。
S33,用户点击连接耳机1,手机与耳机1之间建立LE连接,向耳机1发起服务查询,根据服务查询结果与耳机1建立LE-Audio连接。
S34,手机向耳机1获取SIRK。
S35,手机扫描到耳机2发送的LE-Audio广播(广播2)。
S36,手机根据耳机1的SIRK以及广播2中的RSI值的prand字段计算hash值。
S37,手机判断计算出hash值与广播2中的hash字段是否一致;若是,进入S38,否则结束。
S38,手机与耳机2之间建立LE连接,向耳机2发起服务查询,根据服务查询结果与耳机2建立LE-Audio连接。
其中,上述步骤S36与后续的步骤S35至步骤S38之间的执行顺序并不限定,也就是说,步骤S36与步骤S35至步骤S38可以同步执行,也可以按照先后顺序执行。比如,手机在执行步骤S36的同时,还可以执行步骤S35至步骤S38。
请参考图4,其示出了本申请涉及的服务查询示意图。如图4所示,上述服务查询的过程,是指客户端41(Client)向服务端42(Server)查询其支持的各项属性的过程。其中,在服务查询过程中,客户端41向服务端42发送ATT(Attribute,属性)请求/命令,服务端42向客户端41返回ATT响应,该ATT响应中包含服务端42支持的属性的相关信息。
在LE-Audio协议中,服务查询的结果为通用属性协调集协议(Generic Attribute Profile,GATT)结构信息。请参考图5,其示出了本申请涉及的GATT结构示意图。
如图5所示,GATT结构信息指示服务端支持的一致多项服务(service),每项服务对应有自己的特征(characteristic)、描述(descriptor)等字段,在服务查询过程中,每一个字段都需要进行单独的ATT查询,因此,当service较多且其内容较复杂时,需要花费的ATT查询的时间将会很多。
由于LE-Audio底层采用的是GATT协议的连接架构,无论是手机端还是耳机端支持的service都较多,因此,两边的服务查询流程耗时都较长,以目前LE-audio需要用到的协议为例,手机针对单个耳机的服务查询时间需要2~3秒钟左右,两只耳机的时间需要5~6s,导致首次LE-Audio的连接速度非常慢,影响用户体验。
请参考图6,其示出了本申请一个示例性实施例提供的连接建立方法的流程图。该方法可以用于终端设备中;其中,该终端设备可以是上述图1所示系统中的终端设备120。该方法可以包括如下步骤。
步骤601,接收第一音频设备发送的蓝牙广播消息。
在本申请实施例中,第一音频设备可以是图1所示系统中的音频设备110。
其中,第一音频设备可以周期性的发送蓝牙广播消息,以便周围的终端设备可以发现该第一音频设备。
步骤602,当第一音频设备与第二音频设备属于同一设备分组时,根据第二音频设备的属性支持信息与第一音频设备建立音频连接;第二音频设备是终端设备已连接或确定连接的音频设备;属性支持信息用于指示音频设备支持的服务。
其中,第二音频设备是终端设备已连接的音频设备,可以是指终端设备已经与第二音频设备之间建立了音频连接或者底层连接。
上述第二音频设备是终端设备确定连接的音频设备,可以是指终端设备接收到与第二音频设备之间建立音频连接的指令,且终端尚未完成与第二音频设备之间的音频连接或者底层连接的建立。
当第一音频设备和第二音频设备属于同一个设备分组时,比如,第一音频设备和第二音频设备组成一对TWS耳机时,第一音频设备和第二音频设备支持的属性类型是相同的,因此,在建立音频连接时,如果第二音频设备是终端设备已连接或确定连接的音频设备,则终端设备可以使用第二音频设备的属性支持信息来建立与第一音频设备之间的音频连接,不需要再通过服务查询的方式向第一音频设备查询其支持的属性,从而节省了对第一音频设备进行服 务查询的步骤。
综上所述,通过本申请实施例所示的方案,终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。
在上述图6所示的方案的一种可能的实现方式中,终端设备可以获取第二音频设备的组合标识信息,并根据该第二音频设备的组合标识信息来确定第一音频设备和第二音频设备是否属于同一个设备分组。当根据该第二音频设备的组合标识信息确定第一音频设备和第二音频设备属于同一个设备分组时,即可以根据第二音频设备的属性支持信息与第一音频设备建立音频连接。
基于上述图6所示的方案,请参考图7,其示出了本申请一个示例性实施例提供的连接建立方法的流程图。以终端设备是手机,第一音频设备和第二音频设备是TWS蓝牙耳机,建立的连接为LE-Audio连接为例,该方法可以包括如下步骤。
步骤701,耳机开盖,耳机1和耳机2进配对后开始发送蓝牙低功耗广播。
步骤702,手机打开蓝牙,同时开启BLE扫描。
步骤703,手机首先扫描到耳机1发送的广播,与耳机1完成底层LE链路的连接。
步骤704,手机向耳机1获取耳机1的SIRK;同时,手机对耳机1发起服务查询,根据服务查询得到的属性支持信息建立与耳机1之间的LE-Audio协议的连接。
步骤705,手机扫描到耳机2的广播,判断耳机2与耳机1属于同一个设备分组。
步骤706,手机根据向耳机1查询得到的属性支持信息,建立与耳机1之间的LE-Audio协议的连接。
在上述步骤706中,手机不需要向耳机1发起服务查询。
在一些实施例中,在根据第二音频设备的组合标识信息确定第一音频设备与第二音频设备属于同一设备分组的过程中,终端设备在获取到第二音频设备的组合标识信息后,可以从第一音频设备获取该第一音频设备的组合标识信息,进而确定第一音频设备的组合标识信息与第二音频设备的组合标识信息是否相同,从而确定第一音频设备与第二音频设备是否属于同一设备分组。
请参考图8,其示出了本申请一个示例性实施例提供的连接建立方法的流程图。该方法可以由终端设备执行;其中,该终端设备可以是图1所示系统中的终端设备120。该方法可以包括如下步骤。
步骤801,终端设备接收第二音频设备发送的蓝牙广播消息。
在本申请实施例中,终端设备打开蓝牙扫描功能后,可以接收周围的音频设备发送的蓝牙广播消息。
步骤802,终端设备执行与第二音频设备之间建立音频连接的流程。
可选的,终端设备接收到第二音频设备发送的蓝牙广播消息后,可以在蓝牙扫描界面上显示第二音频设备的信息,此时,若接收到用户对蓝牙扫描界面上显示的第二音频设备的选项的点击操作,则终端设备可以接收到与第二音频设备建立连接的指令,则终端设备可以执行与第二音频设备之间建立音频连接的流程。
其中,上述终端设备与第二音频设备之间建立音频连接的流程可以包括如下子步骤:
S802a,终端设备建立与第二音频设备之间的底层连接。
以蓝牙低功耗场景为例,终端设备可以与第二音频设备之间建立底层LE连接,并通过底层LE连接与第二音频设备之间进行密钥协商,以实现链路层数据的加密。
其中,上述底层LE连接建立以及链路层数据加密等步骤可以按照BLE标准中规定的方式执行。
S802b,终端设备向第二音频设备发起服务查询,获得第二音频设备的属性支持信息。
其中,终端设备向第二音频设备发起的服务查询过程,可以查询第二音频设备支持哪些服务,以及第二音频设备支持的服务对应的能力/属性等信息。
比如,终端设备可以向第二音频设备查询以下信息中的至少一种:
1)第二音频设备是否支持媒体播放功能;
2)第二音频设备是否支持通话功能;
3)第二音频设备是否支持操作控制;
4)第二音频设备支持哪些操作控制(比如,是否支持暂停播放操作、是否支持下一曲的切换操作、是否支持上一曲的切换操作等等);
5)第二音频设备的编码能力/编码方式;
6)第二音频设备使用的编码参数。
其中,在上终端设备对第二音频设备发起服务查询时,终端设备可以向第二音频设备发送服务查询指令,第二音频设备接收到该服务查询指令后,可以向终端设备返回其支持的服务的相关信息。
其中,上述服务查询的过程可以按照BLE标准(例如LE Audio协议的相关标准)中规定的方式执行。查询到的属性支持信息的信息结构可以参考上述图5所示的结构。
S802c,终端设备根据第二音频设备的属性支持信息,与第二音频设备之间建立音频连接。
终端设备与第二音频设备之间建立音频连接时,可以根据步骤802b中查询到的,与第二音频设备支持的服务相关的信息发送音频连接建立请求。
比如,终端设备在完成对第二音频设备的服务查询之后,可以向第二音频设备发送用于配置音频连接的指令,比如ATT协议(Attribute Protocol,属性协议)写指令,该ATT写指令用于在音频设备中写入第二音频连接的相关配置信息,以完成音频连接的例。相应的,第二音频设备接收到该ATT写指令之后,根据ATT写指令中的相关配置信息来执行对音频连接的配置。
其中,上述音频连接的建立过程可以按照BLE标准(例如LE Audio协议的相关标准)中规定的音频连接建立方式来执行。
此外,终端设备与第二音频设备之间建立音频连接的流程还可以包括:
S802d,终端设备向第二音频设备发起标识查询,获得第二音频设备的组合标识信息。
在本申请实施例中,在建立与第二音频设备之间的底层连接后,终端设备还可以向第二音频设备查询其组合标识信息。
比如,以BLE协议为例,上述底层连接为底层LE连接时,上述组合标识信息可以是SIRK。
步骤803,终端设备接收第一音频设备发送的蓝牙广播消息。
其中,上述第一音频设备是第二音频设备之外的另一个蓝牙设备。在本申请实施例中,终端设备接收到第一音频设备发送的蓝牙广播消息,且确定该蓝牙广播消息的发送方不是第二音频设备时,可以执行后续步骤。
步骤804,终端设备获取第二音频设备的组合标识信息。
在本申请实施例中,步骤804可以在步骤802之后执行,也可以在步骤802执行的过程中执行。在步骤804执行时,终端设备已经与第二音频设备之间建立了底层连接或者音频连接;或者,在步骤804时,终端设备已经接收到了与第二音频设备进行连接的指令。也就是说,此时终端设备已连接或确定连接上述第二音频设备。
在一种可能的实现方式中,当终端设备已经向第二音频设备查询到第二音频设备的组合标识信息(比如按照上述S802d的流程查询到第二音频设备的组合标识信息)时,在步骤804中,可以直接从本地读取查询到第二音频设备的组合标识信息。
在另一种可能的实现方式中,当终端设备尚未向第二音频设备查询到第二音频设备的组合标识信息时,在步骤804中,终端设备可以按照上述S802d的流程,向第二音频设备查询其组合标识信息。此时,步骤804与上述S802d为同一个步骤。
步骤805,终端设备获取第一音频设备的组合标识信息。
在本申请实施例中,终端设备可以向第一音频设备查询该第一音频设备的组合标识信息。
比如,终端设备可以建立与第一音频设备之间的底层连接,并通过与第一音频设备之间的底层连接,向第一音频设备查询其组合标识信息。
在一种可能的实现方式中,第一音频设备发送的蓝牙广播消息中包含第一哈希字段;
在获取第一音频设备的组合标识信息之前,终端设备可以根据第二音频设备的组合标识信息生成第二哈希字段;当第一哈希字段与第二哈希字段相同时,建立与第一音频设备之间的底层连接。
以BLE协议为例,在本申请实施例中,第一音频设备发送的蓝牙广播消息的RSI值中包含第一哈希字段以及prand字段,终端设备可以提取第一音频设备发送的蓝牙广播消息中的第一哈希字段以及prand字段,根据提取到的prand字段和第二音频设备的SIRK做哈希计算,得到第二哈希字段,当比对确定第一哈希字段与第二哈希字段相同时,终端设备可以建立与第一音频设备之间的底层连接。
步骤806,当第一音频设备的组合标识信息与第二音频设备的组合标识信息相同时,终端设备确定第一音频设备与第二音频设备属于同一设备分组。
在本申请实施例中,终端设备通过与第一音频设备之间的底层连接获取到第一音频设备的组合标识信息之后,将其与第二音频设备的组合标识信息进行比对,若两者一致,则第一音频设备的组合标识信息与第二音频设备的组合标识信息匹配,即认为第一音频设备与第二音频设备属于同一设备分组。
步骤807,当第一音频设备与第二音频设备属于同一设备分组时,终端设备根据第二音频设备的属性支持信息与第一音频设备建立音频连接。
在一种可能的实现方式中,当第一音频设备与第二音频设备属于同一设备分组时,根据第二音频设备的属性支持信息与第一音频设备建立音频连接,包括:
当第一音频设备与第二音频设备属于同一设备分组时,将第二音频设备的属性支持信息获取为第一音频设备的属性支持信息;
根据第一音频设备的属性支持信息,与第一音频设备建立音频连接。
在本申请实施例中,当终端设备确定第一音频设备与第二音频设备属于同一设备分组时,可以认为第一音频设备与第二音频设备是同一套音频设备,比如同一副TWS耳机,可以认为两者的属性支持信息(比如上述GATT结构信息)也是相同的,此时,终端设备可以直接使用第二音频设备的组合标识信息与第一音频设备建立音频连接,不需要再向第一音频设备查询属性支持信息。
在一种可能的实现方式中,终端设备根据第二音频设备的属性支持信息与第一音频设备建立音频连接之前,还可以将第二音频设备的属性支持信息,复用为第一音频设备的属性支持信息。
比如,在一个示例性的方案中,终端设备在确定上述第一哈希字段与第二哈希字段相同之后,或者,在建立与第一音频设备之间的底层连接之后,即可以将第二音频设备的属性支持信息,暂时复用为第一音频设备的属性支持信息。
再比如,在另一个示例性的方案中,终端设备在确定第一音频设备与第二音频设备属于同一设备分组后,将第二音频设备的属性支持信息,复用为第一音频设备的属性支持信息。
在本申请实施例中,当属性支持信息包括GATT结构信息时,终端设备将第二音频设备的属性支持信息复用为第一音频设备的属性支持信息之后,除了根据该属性支持信息与第一音频设备建立音频连接之外,还可以进一步读取GATT结构信息中的各字段对应的参数值。 对于第一音频设备和第二音频设备来说,当两者属于同一设备分组时,两者的GATT结构信息虽然相同,但是两者的GATT结构信息中的字段对应的参数值可能是不同的。
步骤808,当第一音频设备的组合标识信息与第二音频设备的组合标识信息不同时,终端设备通过底层连接,向第一音频设备发起服务查询,获得第一音频设备的属性支持信息。
在本申请实施例中,若第一音频设备的组合标识信息与第二音频设备的组合标识信息不同,则终端设备可以认为第一音频设备与第二音频设备不是同一套音频设备,两者的属性支持信息可能不同,此时,终端设备可以向第一音频设备发起服务查询。
步骤809,终端设备根据第一音频设备的属性支持信息,与第一音频设备建立音频连接。
其中,在BLE协议场景下,上述蓝牙广播消息可以为蓝牙低功耗LE广播消息,上述音频连接可以为蓝牙低功耗LE音频连接。
其中,上述第一音频设备和第二音频设备可以为真无线立体声TWS耳机。
请参考图9,其示出了本申请实施例涉及的一种音频连接的流程图。如图9所示,以BLE协议场景下,终端设备是手机,第一音频设备和第二音频设备是一副耳机为例,该音频连接的流程可以如下:
S901,耳机开盖,耳机1和耳机2进配对后开始发送蓝牙低功耗广播。
S902,手机打开蓝牙,同时开启BLE扫描。
S903,手机首先扫描到耳机1发送的广播1,与耳机1完成底层LE链路的连接。
S904,手机向耳机1获取耳机1的SIRK1;同时,手机对耳机1发起服务查询,根据服务查询得到的GATT结构建立与耳机1之间的LE-Audio协议的连接。
S905,手机扫描到耳机2的广播2,根据SIRK1与广播2中的信息计算哈希值。
S906,手机判断计算得到的哈希值与广播2中的哈希字段是否相同;若是,进入S907,否则结束。
S907,手机与耳机2完成底层LE链路的连接。
S908,暂时复用耳机1的GATT结构,作为耳机2的GATT结构。
S909,手机向耳机2获取耳机2的SIRK2。
S910,手机判断SIRK1与SIRK2是否一致;若是,进入S911,否则,进入S912。
S911,使用复用的耳机1的GATT结构,与耳机2建立LE-Audio协议的连接。
S912,对耳机1发起服务查询;根据服务查询得到的GATT结构建立与耳机2之间的LE-Audio协议的连接。
在上述图9所示的方案中,当手机解析到耳机2的广播中的哈希字段与广播内容计算出来的hash值一致时,手机发起对耳机2的LE连接。
由于耳机1和耳机2代码是同一套代码,只是两种初始化的角色不同,因此两者的GATT结构是相同的,也可以变相认为是同一个设备,只是两者之间可能一些属性值不同,比如左耳耳机在与手机的协议连接阶段会配置接收左声道数据,右耳耳机会配置接收左声道数据。因此,对于手机来说没有必要针对耳机2再做一遍服务发现及查询的过程。在本申请实施例中,当手机主动发起对耳机2的LE连接时,手机先暂时复用耳机1的GATT结构给耳机2,同时进行对耳机2的SIRK读取步骤。
由于上述方案中,手机通过底层LE连接查询耳机的SIRK,因此,SIRK可以采取加密的方式进行传输,即查询到的SIRK是基于底层LE连接且经过加密得到的SIRK,其是唯一且安全的。当手机获取到SIRK2后,手机将耳机1与耳机2的SIRK进行对比,如果发现一致,说明这两耳机是一对,因为通常情况下,SIRK是产品出厂固化的,只有是匹配成对的耳机才拥有相同的SIRK。至此,手机将直接复用耳机1的GATT结构给耳机2,省去针对耳机2的服务查询过程,随后发起对耳机2的LE-Audio协议连接。
如果手机发现SIRK1与SIRK2不一致,则说明耳机2并非与耳机1一对,有可能是外部设备盗用耳机1的广播内容进行伪造,此时手机不会将耳机1与耳机2认为是一副设备。而 手机也需要单独针对耳机2进行完整的服务查询以及LE-audio协议的连接。
通过本申请上述方案,一方面,在保证安全的情况下,手机通过复用耳机1的GATT结构,从而省去手机针对耳机2的服务查询环节,进而节省出2~3s的连接时间。并且,如果外围设备数量更多,即多个外部设备组成一个Group并且都支持CSIP协议时,通过此方案可以节省出更多的连接时间。
另一方面,增加了SIRK的判断环节,而不是简单地通过耳机2广播字段的解析来判断耳机2和耳机1为一对设备,因为广播内容容易被外部设备所伪造,即第三方设备盗用耳机1的广播内容进行LE广播,使手机误认为该三方设备和耳机1为一组设备而直接复用其GATT结构,但其实该三方设备的GATT结构和耳机1并不相同,最终会导致手机与该三方设备无法正常进行工作,同时也存在通信安全等风险。通过对SIRK的判断,可以对两个设备是否会一副设备进行深层次的判断,保证其安全性。
综上所述,通过本申请实施例所示的方案,终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。
在另一些实施例中,在根据第二音频设备的组合标识信息确定第一音频设备与第二音频设备属于同一设备分组时,终端设备在获取到第二音频设备的组合标识信息后,通过第一音频设备发送的蓝牙广播消息,即可以确定第一音频设备与第二音频设备是否属于同一设备分组。
请参考图10,其示出了本申请一个示例性实施例提供的连接建立方法的流程图。该方法可以由终端设备和音频设备交互执行;其中,该音频设备可以是上述图1所示系统中的音频设备110,该终端设备可以是图1所示系统中的终端设备120。该方法可以包括如下步骤。
步骤1001,终端设备接收第二音频设备发送的蓝牙广播消息。
步骤1002,终端设备执行与第二音频设备之间建立音频连接的流程。
步骤1003,终端设备接收第一音频设备发送的蓝牙广播消息。
步骤1004,终端设备获取第二音频设备的组合标识信息。
其中,上述步骤1001至步骤1004的执行过程,与图8所示实施例中的步骤801至步骤804的执行过程类似,此处不再赘述。
步骤1005,终端设备根据第二音频设备的组合标识信息生成第二哈希字段。
步骤1006,当第一哈希字段与第一音频设备发送的蓝牙广播消息中的第二哈希字段相同时,确定第一音频设备与第二音频设备属于同一设备分组。
在本申请实施例中,上述第二哈希字段的计算方式可以参考上述图8所示实施例中的描述,此处不再赘述。
步骤1007,当第一音频设备与第二音频设备属于同一设备分组时,终端设备根据第二音频设备的属性支持信息与第一音频设备建立音频连接。
在本申请实施例中,终端设备在根据第一广播消息和第二音频设备的组合标识信息,确定出第一音频设备与第二音频设备属于同一设备分组后,可以直接根据第二音频设备的属性支持信息与第一音频设备建立音频连接,不需要再进行组合标识信息的直接比对,从而进一步缩短了音频连接的时长。
综上所述,通过本申请实施例所示的方案,终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音 频连接的建立效率。
请参考图11,其示出了本申请一个示例性实施例提供的在连接建立装置的结构示意图。该连接建立装置1100可以用于执行如上述图6或图8所示的实施例中,由终端设备执行的全部或者部分步骤;该装置包括:
广播接收模块1101,用于接收第一音频设备发送的蓝牙广播消息;
连接建立模块1102,用于当所述第一音频设备与所述第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;
其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。
在一种可能的实现方式中,所述装置还包括:
第一标识信息获取模块,用于在所述连接建立模块根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,获取所述第二音频设备的组合标识信息;所述组合标识用于指示音频设备所属的设备分组;
所述连接建立模块1102,用于当根据所述第二音频设备的组合标识信息确定所述第一音频设备与所述第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接。
在一种可能的实现方式中,所述蓝牙广播消息中包含第一哈希字段;
所述装置还包括:
第一字段生成模块,用于在所述连接建立模块1102根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,根据所述第二音频设备的组合标识信息生成第二哈希字段;
第一确定模块,用于当所述第一哈希字段与所述第二哈希字段相同时,确定所述第一音频设备与所述第二音频设备属于同一设备分组。
在一种可能的实现方式中,所述装置还包括:
第一标识信息获取模块,用于在所述连接建立模块1102根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,获取所述第一音频设备的组合标识信息;
第二确定模块,用于当所述第一音频设备的组合标识信息与所述第二音频设备的组合标识信息相同时,确定所述第一音频设备与所述第二音频设备属于同一设备分组。
在一种可能的实现方式中,所述蓝牙广播消息中包含第一哈希字段;
所述装置还包括:
第一字段生成模块,用于在所述第一标识信息获取模块获取所述第一音频设备的组合标识信息之前,根据所述第二音频设备的组合标识信息生成第二哈希字段;
连接建立模块1102,还用于当所述第一哈希字段与所述第二哈希字段相同时,建立与所述第一音频设备之间的底层连接。
在一种可能的实现方式中,所述第一标识信息获取模块,用于通过所述底层连接,向所述第一音频设备获取所述第一音频设备的组合标识信息。
在一种可能的实现方式中,所述装置还包括:
服务查询模块,用于当所述第一音频设备的组合标识信息与第二音频设备的组合标识信息不同时,通过所述底层连接,向所述第一音频设备发起服务查询,获得所述第一音频设备的属性支持信息;
所述连接建立模块1102,还用于根据所述第一音频设备的属性支持信息,与所述第一音频设备建立音频连接。
在一种可能的实现方式中,所述蓝牙广播消息为蓝牙低功耗LE广播消息;所述音频连接为蓝牙低功耗LE音频连接。
在一种可能的实现方式中,所述组合标识信息为组合标识解析值SIRK;所述属性支持信息为通用属性协调集协议GATT结构信息。
在一种可能的实现方式中,所述第一音频设备和所述第二音频设备为真无线立体声TWS耳机。
综上所述,通过本申请实施例所示的方案,终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。
需要说明的一点是,上述实施例提供的装置在实现其功能时,仅以上述各个功能模块的划分进行举例说明,实际应用中,可以根据实际需要而将上述功能分配由不同的功能模块完成,即将设备的内容结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
请参考图12,其示出了本申请一个实施例提供的计算机设备1200的结构示意图。该计算机设备1200可以包括:处理器1201、接收器1202、发射器1203、存储器1204和总线1205。
处理器1201包括一个或者一个以上处理核心,处理器1201通过运行软件程序以及模块,从而执行各种功能应用以及信息处理。
接收器1202和发射器1203可以实现为一个通信组件,该通信组件可以是一块通信芯片。该通信芯片也可以称为收发器。
存储器1204通过总线1205与处理器1201相连。
存储器1204可用于存储计算机程序,处理器1201用于执行该计算机程序,以实现上述方法实施例中的各个步骤。
此外,存储器1204可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,易失性或非易失性存储设备包括但不限于:磁盘或光盘,电可擦除可编程只读存储器,可擦除可编程只读存储器,静态随时存取存储器,只读存储器,磁存储器,快闪存储器,可编程只读存储器。
在一个示例性的方案中,当计算机设备1200实现为终端设备时,所述收发器1202,用于接收第一音频设备发送的蓝牙广播消息;
处理器1201,当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。
其中,上述计算机设备1200中的处理器1201和/或收发器1202执行的过程可以参考上述各个方法实施例中,由终端设备执行的各个步骤。
本申请实施例还提供了一种计算机可读存储介质,所述存储介质中存储有计算机指令,所述计算机指令由处理器加载并执行以实现上述各个方法实施例中,由终端设备或者音频设备执行的全部或者部分步骤。
本申请还提供了一种芯片,该芯片用于在计算机设备中运行,以使得计算机设备执行上述各个方法实施例中,由终端设备执行的全部或者部分步骤。
本申请还提供了一种计算机程序产品,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。上述计算机程序产品可以用于实现上述各个方法实施例中,由终端设备执行的全部或者部分步骤。
本申请还提供了一种计算机程序产品,该计算机程序产品或计算机程序包括计算机指令, 该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得计算机设备执行上述各个方法实施例中,由终端设备执行的全部或者部分步骤。
本申请还提供了一种计算机程序,该计算机程序由计算机设备的处理器执行,以实现上述各个方法实施例中,由终端设备执行的全部或者部分步骤。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
以上所述仅为本申请的示例性实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。

Claims (24)

  1. 一种连接建立方法,其特征在于,所述方法由终端设备执行,所述方法包括:
    接收第一音频设备发送的蓝牙广播消息;
    当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;
    其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。
  2. 根据权利要求1所述的方法,其特征在于,所述当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,还包括:
    获取所述第二音频设备的组合标识信息;所述组合标识用于指示音频设备所属的设备分组;
    所述当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接,包括:
    当根据所述第二音频设备的组合标识信息确定所述第一音频设备与所述第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接。
  3. 根据权利要求2所述的方法,其特征在于,所述蓝牙广播消息中包含第一哈希字段;
    所述当根据所述第二音频设备的组合标识信息确定所述第一音频设备与所述第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,还包括:
    根据所述第二音频设备的组合标识信息生成第二哈希字段;
    当所述第一哈希字段与所述第二哈希字段相同时,确定所述第一音频设备与所述第二音频设备属于同一设备分组。
  4. 根据权利要求2所述的方法,其特征在于,所述当根据所述第二音频设备的组合标识信息确定所述第一音频设备与所述第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,还包括:
    获取所述第一音频设备的组合标识信息;
    当所述第一音频设备的组合标识信息与所述第二音频设备的组合标识信息相同时,确定所述第一音频设备与所述第二音频设备属于同一设备分组。
  5. 根据权利要求4所述的方法,其特征在于,所述蓝牙广播消息中包含第一哈希字段;
    所述获取所述第一音频设备的组合标识信息之前,还包括:
    根据所述第二音频设备的组合标识信息生成第二哈希字段;
    当所述第一哈希字段与所述第二哈希字段相同时,建立与所述第一音频设备之间的底层连接。
  6. 根据权利要求5所述的方法,其特征在于,所述获取所述第一音频设备的组合标识信息,包括:
    通过所述底层连接,向所述第一音频设备获取所述第一音频设备的组合标识信息。
  7. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    当所述第一音频设备的组合标识信息与第二音频设备的组合标识信息不同时,通过所述底层连接,向所述第一音频设备发起服务查询,获得所述第一音频设备的属性支持信息;
    根据所述第一音频设备的属性支持信息,与所述第一音频设备建立音频连接。
  8. 根据权利要求1至7任一所述的方法,其特征在于,所述蓝牙广播消息为蓝牙低功耗LE广播消息;所述音频连接为蓝牙低功耗LE音频连接。
  9. 根据权利要求1至7任一所述的方法,其特征在于,所述组合标识信息为组合标识解析值SIRK;所述属性支持信息为通用属性协调集协议GATT结构信息。
  10. 根据权利要求1至7任一所述的方法,其特征在于,所述第一音频设备和所述第二音频设备为真无线立体声TWS耳机。
  11. 一种连接建立装置,其特征在于,所述装置包括:
    广播接收模块,用于接收第一音频设备发送的蓝牙广播消息;
    连接建立模块,用于当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;
    其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:
    第一标识信息获取模块,用于在所述连接建立模块根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,获取所述第二音频设备的组合标识信息;所述组合标识用于指示音频设备所属的设备分组;
    所述连接建立模块,用于当根据所述第二音频设备的组合标识信息确定所述第一音频设备与所述第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接。
  13. 根据权利要求12所述的装置,其特征在于,所述蓝牙广播消息中包含第一哈希字段;
    所述装置还包括:
    第一字段生成模块,用于在所述连接建立模块根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,根据所述第二音频设备的组合标识信息生成第二哈希字段;
    第一确定模块,用于当所述第一哈希字段与所述第二哈希字段相同时,确定所述第一音频设备与所述第二音频设备属于同一设备分组。
  14. 根据权利要求12所述的装置,其特征在于,所述装置还包括:
    第一标识信息获取模块,用于在所述连接建立模块根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,获取所述第一音频设备的组合标识信息;
    第二确定模块,用于当所述第一音频设备的组合标识信息与所述第二音频设备的组合标识信息相同时,确定所述第一音频设备与所述第二音频设备属于同一设备分组。
  15. 根据权利要求14所述的装置,其特征在于,所述蓝牙广播消息中包含第一哈希字段;
    所述装置还包括:
    第一字段生成模块,用于在所述第一标识信息获取模块获取所述第一音频设备的组合标 识信息之前,根据所述第二音频设备的组合标识信息生成第二哈希字段;
    所述连接建立模块,还用于当所述第一哈希字段与所述第二哈希字段相同时,建立与所述第一音频设备之间的底层连接。
  16. 根据权利要求15所述的装置,其特征在于,
    所述第一标识信息获取模块,用于通过所述底层连接,向所述第一音频设备获取所述第一音频设备的组合标识信息。
  17. 根据权利要求15所述的装置,其特征在于,所述装置还包括:
    服务查询模块,用于当所述第一音频设备的组合标识信息与第二音频设备的组合标识信息不同时,通过所述底层连接,向所述第一音频设备发起服务查询,获得所述第一音频设备的属性支持信息;
    所述连接建立模块,还用于根据所述第一音频设备的属性支持信息,与所述第一音频设备建立音频连接。
  18. 根据权利要求11至17任一所述的装置,其特征在于,所述蓝牙广播消息为蓝牙低功耗LE广播消息;所述音频连接为蓝牙低功耗LE音频连接。
  19. 根据权利要求11至17任一所述的装置,其特征在于,所述组合标识信息为组合标识解析值SIRK;所述属性支持信息为通用属性协调集协议GATT结构信息。
  20. 根据权利要求11至17任一所述的装置,其特征在于,所述第一音频设备和所述第二音频设备为真无线立体声TWS耳机。
  21. 一种计算机设备,其特征在于,所述计算机设备包括处理器、存储器和收发器;
    所述存储器中存储有计算机程序,所述处理器执行所述计算机程序,以使得所述计算机设备实现如权利要求1至10任一所述的连接建立方法。
  22. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机指令,所述计算机指令用于被处理器执行,以实现如权利要求1至10任一所述的连接建立方法。
  23. 一种芯片,其特征在于,所述芯片用于在计算机设备中运行,以使得所述计算机设备执行如权利要求1至10任一所述的连接建立方法。
  24. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中;所述计算机程序产品用于实现如权利要求1至10任一所述的连接建立方法。
PCT/CN2022/142346 2022-02-28 2022-12-27 连接建立方法、装置、设备、存储介质及程序产品 WO2023160212A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210188399.5 2022-02-28
CN202210188399.5A CN114786139A (zh) 2022-02-28 2022-02-28 连接建立方法、装置、设备、存储介质及程序产品

Publications (1)

Publication Number Publication Date
WO2023160212A1 true WO2023160212A1 (zh) 2023-08-31

Family

ID=82423859

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/142346 WO2023160212A1 (zh) 2022-02-28 2022-12-27 连接建立方法、装置、设备、存储介质及程序产品

Country Status (2)

Country Link
CN (1) CN114786139A (zh)
WO (1) WO2023160212A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114786139A (zh) * 2022-02-28 2022-07-22 Oppo广东移动通信有限公司 连接建立方法、装置、设备、存储介质及程序产品
WO2024040406A1 (zh) * 2022-08-22 2024-02-29 华为技术有限公司 一种通信方法、装置和系统
CN115665671A (zh) * 2022-09-16 2023-01-31 Oppo广东移动通信有限公司 音频数据的共享方法、装置、电子设备以及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471481A (zh) * 2014-06-06 2016-04-06 环汇系统有限公司 与一组蓝牙设备进行蓝牙配对的系统和方法
CN109788441A (zh) * 2017-11-13 2019-05-21 北京小鸟听听科技有限公司 一种信息处理方法、终端和计算机存储介质
CN110809243A (zh) * 2019-10-30 2020-02-18 歌尔科技有限公司 无线耳机、无线耳机配对方法、终端及系统
CN114786139A (zh) * 2022-02-28 2022-07-22 Oppo广东移动通信有限公司 连接建立方法、装置、设备、存储介质及程序产品

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10299300B1 (en) * 2018-05-16 2019-05-21 Bose Corporation Secure systems and methods for establishing wireless audio sharing connection
EP3869817A4 (en) * 2018-11-30 2021-11-10 Huawei Technologies Co., Ltd. METHOD AND DEVICE FOR TRANSMISSION OF DATA FROM ONE POINT TO MULTIPLE POINTS
CN112042212B (zh) * 2018-12-21 2021-12-21 华为技术有限公司 一种音频数据传输方法及电子设备
US11856498B2 (en) * 2018-12-26 2023-12-26 Honor Device Co., Ltd. Bluetooth device connection method and device
CN111629369B (zh) * 2020-05-27 2022-11-04 歌尔科技有限公司 一种蓝牙耳机及其配对连接方法、装置和tws耳机
CN113810887B (zh) * 2020-05-29 2023-07-14 Oppo广东移动通信有限公司 蓝牙协议连接方法、装置、存储介质及相关设备
CN112367654B (zh) * 2020-11-06 2023-05-12 炬力(珠海)微电子有限公司 一种tws设备组队方法、装置、电子设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471481A (zh) * 2014-06-06 2016-04-06 环汇系统有限公司 与一组蓝牙设备进行蓝牙配对的系统和方法
CN109788441A (zh) * 2017-11-13 2019-05-21 北京小鸟听听科技有限公司 一种信息处理方法、终端和计算机存储介质
CN110809243A (zh) * 2019-10-30 2020-02-18 歌尔科技有限公司 无线耳机、无线耳机配对方法、终端及系统
CN114786139A (zh) * 2022-02-28 2022-07-22 Oppo广东移动通信有限公司 连接建立方法、装置、设备、存储介质及程序产品

Also Published As

Publication number Publication date
CN114786139A (zh) 2022-07-22

Similar Documents

Publication Publication Date Title
WO2023160212A1 (zh) 连接建立方法、装置、设备、存储介质及程序产品
US10178215B2 (en) Communication systems and methods
KR101700937B1 (ko) WiFi Direct 네트워크에서의 서비스 탐색 방법 및 장치
TWI512489B (zh) Multi-screen interactive method, center equipment, terminal equipment and systems
CN113360108B (zh) 一种投屏连接控制方法及电子设备
WO2017028396A1 (zh) 多媒体播放设备的连接方法、主设备、控制终端及系统
EP3166343A1 (en) Audio playing method and apparatus for multiple playing devices
WO2022247802A1 (zh) 连接建立方法、装置、电子设备及存储介质
EP2666256B1 (en) Method and apparatus for phone communication using home network
CN113766477A (zh) 设备连接方法、装置、电子设备及计算机可读介质
WO2016065977A1 (zh) 呼叫处理方法、装置、通信终端和服务器
CN105933469B (zh) 用于智能设备的入网方法及装置、智能设备
WO2023040517A1 (zh) 音频数据播放方法、装置、电子设备及存储介质
WO2024016948A1 (zh) 信息更新方法及装置、音频共享方法及系统、电子设备
WO2016107013A1 (zh) 传输处理、远程处理方法、装置及计算机存储介质
CN114844736B (zh) 一种设备及通话控制方法
CN116017379A (zh) 蓝牙设备的通信方法、蓝牙的提示方法和蓝牙系统
CN114363876A (zh) 连接建立方法、装置、设备、存储介质及程序产品
CN113810887B (zh) 蓝牙协议连接方法、装置、存储介质及相关设备
WO2023185147A1 (zh) 服务查询的处理方法、装置、设备、存储介质及程序产品
CN115665671A (zh) 音频数据的共享方法、装置、电子设备以及存储介质
CN112118610B (zh) 无线智能设备配网方法及系统
CN113727463A (zh) 设备连接方法、装置、电子设备以及存储介质
WO2022237353A1 (zh) 在耳机收纳盒中配置耳机的方法、装置、设备及程序产品
WO2023246055A1 (zh) 蓝牙设备配置方法、装置、电子设备及存储介质

Legal Events

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

Ref document number: 22928452

Country of ref document: EP

Kind code of ref document: A1