WO2022061874A1 - 流端点控制方法、电子设备以及存储介质 - Google Patents

流端点控制方法、电子设备以及存储介质 Download PDF

Info

Publication number
WO2022061874A1
WO2022061874A1 PCT/CN2020/118359 CN2020118359W WO2022061874A1 WO 2022061874 A1 WO2022061874 A1 WO 2022061874A1 CN 2020118359 W CN2020118359 W CN 2020118359W WO 2022061874 A1 WO2022061874 A1 WO 2022061874A1
Authority
WO
WIPO (PCT)
Prior art keywords
stream
endpoint
endpoints
state
unoccupied
Prior art date
Application number
PCT/CN2020/118359
Other languages
English (en)
French (fr)
Inventor
曾鑫澄
张婷
Original Assignee
深圳市汇顶科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to PCT/CN2020/118359 priority Critical patent/WO2022061874A1/zh
Publication of WO2022061874A1 publication Critical patent/WO2022061874A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Definitions

  • the present application relates to the field of Bluetooth technology, and in particular, to a flow endpoint control method, an electronic device, and a storage medium.
  • each device In the classic Bluetooth data transmission process, an initiator device and a receiver device are required. There are one or more stream endpoints (Stream End Point, SEP for short) in each device. Each stream endpoint has the data stream transmission capability, but a stream endpoint only supports the configuration of one data stream codec capability.
  • SEP Stream End Point
  • each TWS headset has N streaming endpoints with different codec capabilities.
  • the N stream endpoints with different codec capabilities only support connection with one device.
  • N ⁇ M stream endpoints need to be configured on the TWS headset, where M refers to the number of devices that the TWS headset can connect to, and N represents the number of codecs supported by the TWS headset.
  • the existing TWS headset needs to configure N ⁇ M streaming endpoints to support connection with M devices, and the N ⁇ M streaming endpoints need to consume a lot of resources of the TWS headset.
  • the present application provides a flow endpoint control method, an electronic device, and a storage medium, aiming at reducing the consumption of device resources by flow endpoints and reducing the time for establishing a data flow connection.
  • the present application provides a flow endpoint control method, including:
  • N is the total number of codec function types, and N is a positive integer.
  • the method further includes:
  • the identification information of N stream endpoints is included in the discoverable list, and the stream endpoints corresponding to the identification information in the discoverable list are all in an unoccupied state;
  • the discoverable list is used to store data responding to the discovery command, and the discovery command is used to discover the stream endpoints in an unoccupied state.
  • obtain the working status of each stream endpoint including:
  • a configuration success message is received, wherein the configuration success message indicates that the service parameters of the stream endpoint in the unoccupied state are successfully configured.
  • the number of stream endpoints in an unoccupied state in the memory is N, and the encoding and decoding functions of each unoccupied stream endpoint are different, specifically including:
  • the function initialization configuration is used to perform function initialization configuration on the application service and the transmission service of the stream endpoint.
  • the encoding/decoding function of the stream endpoint configured with service parameters is the same as the encoding/decoding function of the stream endpoint configured with function initialization.
  • the identification information of N stream endpoints is included in the discoverable list, and the stream endpoints corresponding to the identification information in the discoverable list are in an unoccupied state, specifically including:
  • the number of stream endpoints in an unoccupied state in the memory is N, and the encoding and decoding functions of each unoccupied stream endpoint are different, specifically including:
  • the function reset is used to reset the function of the application service and the transmission service for the stream endpoint.
  • the method further includes:
  • M represents the maximum number of devices that can be connected, and M is a positive integer.
  • the method further includes:
  • the streaming endpoint is used to receive a stream of audio data.
  • the present application provides an electronic device, comprising:
  • the processor is configured to execute the program stored in the memory.
  • the processor is configured to execute the stream endpoint control method involved in the first aspect and the optional solution.
  • the memory is provided with storage spaces for (N+M-1) stream endpoints.
  • the electronic device is a playback device.
  • the playback device includes a Bluetooth headset or a Bluetooth speaker.
  • the present application provides a computer storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when a processor executes the computer-executable instructions, the stream endpoint control method involved in the first aspect and the optional solution is implemented.
  • the present application provides a flow endpoint control method, an electronic device and a storage medium for obtaining the working status of each flow endpoint, so that the number of unoccupied flow endpoints is N, and each flow endpoint has different encoding and decoding functions.
  • the device can support connection with other devices with any codec capability on the basis of other devices already connected, compared with the existing technology, and the total number of all stream endpoints in the device is the smallest, reducing the number of stream endpoint pairs Device resource consumption.
  • the stream endpoint when the stream endpoint is switched from the unoccupied state to the occupied state, the number of the stream endpoints in the unoccupied state is reduced by one, and the function initialization configuration of the stream endpoint in the uninitialized state is performed to obtain the stream endpoint in the unoccupied state.
  • the stream endpoint When the stream endpoint is switched from the occupied state to the unoccupied state, one more stream endpoint in the unoccupied state will be added, and the function of the released stream endpoint will be reset to switch the stream endpoint from the unoccupied state to the occupied state to maintain the
  • the number of stream endpoints in an unoccupied state is N.
  • the device When the device supports N kinds of codec functions and is connected with M other devices, it only needs to reserve the space of (M+N-1) stream endpoints, which greatly reduces the resource consumption of the device by the stream endpoints.
  • the identification information of N stream endpoints is included in the discoverable list, and the stream endpoints corresponding to the identification information in the discoverable list are in an unoccupied state, and the occupied stream endpoints will not be discovered by the new device.
  • the new device When a device establishes a connection with its own device, the new device does not need to acquire the occupied stream endpoint capabilities, which can reduce the connection time between the new device and the current device to a certain extent.
  • FIG. 1 is an architecture diagram of a stream endpoint provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of the configuration of a stream endpoint in the prior art
  • FIG. 3 is a schematic structural diagram of a data transmission system provided by another embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a flow endpoint control method provided by another embodiment of the present application.
  • FIG. 5 is a schematic diagram of a state transition of a stream endpoint provided by another embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a flow endpoint control method provided by another embodiment of the present application.
  • FIG. 7 is a schematic flowchart of establishing a connection between stream endpoints according to another embodiment of the present application.
  • 8A is a schematic configuration diagram of a device provided by another embodiment of the present application with four stream endpoints;
  • FIG. 8B-8D are schematic diagrams of flow endpoint states based on the flow endpoint configuration shown in FIG. 8A;
  • FIG. 9 is a schematic flowchart of a flow endpoint control method provided by another embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an electronic device provided by another embodiment of the present application.
  • FIG. 11 is a schematic configuration diagram of a stream endpoint when the headset is in forwarding mode according to another embodiment of the present application.
  • FIG. 12 is a schematic configuration diagram of a streaming endpoint when a headset is in a monitoring mode according to another embodiment of the present application.
  • FIG. 13 is a schematic configuration diagram of a streaming endpoint when the headset is in a dual connection mode according to another embodiment of the present application.
  • a stream endpoint is an application that exposes available transmission services and audio/video (Audio/Video, A/V) functions in order to negotiate a stream.
  • the streaming endpoint is registered in the Audio/Video Distribution Transport Protocol Specification (AVDTP) so that other devices can discover it and connect to it.
  • the AVDTP protocol specifies the transmission protocol for audio or video distribution, and the streaming audio or video is transmitted over the air via Bluetooth.
  • the Logical Link Control and Adaptation Protocol (Logical Link Control and Adaptation Protocol, L2CAP for short) is the core protocol in Bluetooth and is responsible for adapting the upper-layer protocol in Baseband (BB for short).
  • both device A and device B are A/V devices, which can be used as source devices of data streams or sink devices of data streams.
  • A/V equipment can provide one or more data streams, that is, configured with multiple stream endpoints.
  • a stream endpoint connection in a source or sink device resides at the application layer of the device.
  • stream endpoints are represented in the AVDTP layer for negotiating and manipulating data streams.
  • the L2CAP/BB layer is used to provide an end-to-end channel between the source device and the sink device.
  • Device A has 2 SEPs labeled u and v, where SEP u represents the video sink and SEP v represents the audio sink.
  • Device B has three SEPs, labeled x, y, and z, that represent audio sources.
  • Device A should establish an audio streaming connection to one of the audio sources in Device B.
  • Device A and Device B maintain local Stream End Point Identifiers (SEIDs for short) for their SEPs, respectively.
  • Device A occupies the AVDTP service in the AVDTP layer to discover the resources of other devices. That is, device A acquires the remote SEIDs and media types of the three SEPs in device B.
  • Device A uses one of the AVDTP services to collect the application and transport service capabilities of one of the remote SEPs, such as SEP z. After learning about all the capabilities exposed by Device B and comparing it with its own native capabilities, Device A can take another AVDTP service to configure the streaming connection.
  • the evaluation and decision of how to choose a service occurs at the application layer of device A, and the SEP v stored locally has the matching ability with the SEP z of device B, so it can be connected with the SEP z of device B.
  • Device A maps the local SEP v to the remote SEP z so that both devices know their respective remote SEIDs for future mutual reference.
  • both SEP v in device A and SEP z resources in device B shall be locked, and neither SEP v in device A nor SEP z in device B can be configured as another connection.
  • Each stream endpoint is configured with Application and Transport Service Capabilities (ATSC for short).
  • the application service function specifically includes functions such as negotiation, configuration of the codec capability of the audio source device, content protection system, frequency setting, and so on.
  • the transmission service capability specifically includes segmentation and reassembly of data packets, anti-loss detection of data packets, and so on.
  • a stream endpoint only supports the configuration of one data stream codec capability. That is, the A/V device needs to set up multiple stream endpoints configured with multiple codec capabilities to adapt to the connection with other devices with different codec capabilities.
  • each TWS headset is provided with M ⁇ N stream endpoints.
  • the TWS headset supports N types of codec capabilities, which are marked as codec1 to codec N in turn. That is, for each type of codec capability, there are correspondingly M stream endpoints in the TWS headset. For example, for codec capability 1, there are M stream endpoints in the TWS headset.
  • the TWS headset can be connected with M other devices.
  • M ⁇ 8 that is, the Bluetooth headset can connect up to 7 other devices.
  • the existing TWS headset needs to configure N ⁇ M streaming endpoints to support connection with M devices, and the N ⁇ M streaming endpoints need to consume a lot of resources of the TWS headset.
  • the present application provides a flow endpoint control method, an electronic device, and a storage medium, which aim to reduce the consumption of device resources by flow endpoints.
  • the present application provides a technical solution for dynamically configuring stream endpoints, that is, monitoring the working status of each stream endpoint in real time, so as to control the number of stream endpoints in an unoccupied state to be N, and control each stream in an unoccupied state.
  • Endpoints have different codec capabilities. In order to ensure that the device can support connection with other devices with any codec capability on the basis of other devices already connected, and compared with the existing technology, the total number of all stream endpoints in the device is significantly reduced, and then Reduce the consumption of device resources by streaming endpoints.
  • an embodiment of the present application provides a data transmission system 100 , wherein the data transmission system 100 includes a first device 101 and a second device 102 .
  • Both the first device 101 and the second device 102 are provided with multiple stream endpoints and support N types of codec capabilities.
  • the second device 102 adds the identification information of the stream endpoints to the discoverable list.
  • the first device 101 searches for each stream endpoint in the discoverable list of the second device 102, and associates the stream endpoints not occupied by the second device 102 with their locally stored streams.
  • the endpoints are matched with each other to establish a data stream connection channel between the first device 101 and the second device 102 .
  • the first device 101 and the second device 102 perform data stream transmission based on the created data stream connection channel. Any one of the first device and the second device supports connection with multiple other devices. It may also be that both the first device and the second device support connection with multiple other devices.
  • the first device and the second device may be any one of a Bluetooth headset, a Bluetooth speaker, a smart phone, a computer, a tablet computer, and the like.
  • another embodiment of the present application provides a method for controlling a stream endpoint.
  • the method is applied to a device that supports connection with multiple other devices in a data transmission system.
  • the method includes the following steps:
  • each stream endpoint has an encoding and decoding function
  • the device supports N types of encoding and decoding functions.
  • the working state includes the unoccupied state, the occupied state and the uninitialized state.
  • the uninitialized state means that the stream endpoint has not been initialized and configured by the functions of application services and transmission services.
  • the unoccupied state means that the stream endpoint is not occupied to establish a data stream connection channel.
  • the occupied state means that the stream endpoint has been occupied to establish a data stream connection channel. .
  • the switching mode of the working state of the stream endpoint is as follows: performing ATSC initialization configuration on the stream endpoint in the uninitialized state A can make the stream endpoint switch from the uninitialized state A to the unoccupied state B.
  • the stream endpoint can switch from the unoccupied state B to the occupied state C.
  • the service parameter is also the service parameter of the ATSC.
  • the ASTC reset of the stream endpoint in the occupied state C can make the stream endpoint switch from the occupied state C to the uninitialized state A.
  • the purpose of reset is to restore the stream endpoint to the uninitialized state A.
  • the stream endpoint can be switched from the occupied state C to the occupied state B.
  • the stream endpoint can be switched from the unoccupied state B to the occupied state A.
  • S202 Make the number of stream endpoints in an unoccupied state in the memory to be N, and each unoccupied stream endpoint has a different encoding and decoding function.
  • the number of flow endpoints in an unoccupied state is not N
  • the number of flow endpoints controlling the unoccupied state is N. That is, when the number of flow endpoints in the unoccupied state is greater than N, the flow endpoints in the unoccupied state are switched to the uninitialized state so that the number of flow endpoints in the unoccupied state is equal to N.
  • the flow endpoint is switched from the occupied state to the unoccupied state, that is, the number of flow endpoints in the unoccupied state increases by 1.
  • a stream endpoint in an unoccupied state performs an ATSC reset to switch the stream endpoint from an unoccupied state to an uninitialized state.
  • the stream endpoints in the uninitialized state are switched to the unoccupied state so that the number of stream endpoints in the unoccupied state is equal to N.
  • N For example: when a signaling channel is established between a stream endpoint and other stream endpoints, and service parameters are successfully configured for the stream endpoint, the stream endpoint switches from the unoccupied state to the occupied state, that is, the stream endpoint in the unoccupied state.
  • the number of s is reduced by 1, then an ATSC configuration is performed on a stream endpoint in an uninitialized state, so that the stream endpoint is switched from an uninitialized state to an unoccupied state.
  • the configured encoding and decoding functions are the same as the encoding and decoding functions of the stream endpoints after parameter configuration above, so that the number of stream endpoints in an unoccupied state is N, and N are in an unoccupied state.
  • Streaming endpoints support different codec capabilities.
  • the number of flow endpoints in an unoccupied state is dynamically controlled to be N, so as to ensure that the device can also support communication with any one of the encoders even when the device is connected to other devices.
  • Other devices with decoding capabilities are connected, compared with the state of the unoccupied state stream endpoints greater than or equal to (M-1) ⁇ N in the prior art, this solution can significantly reduce the total number of all stream endpoints in the device, thereby reducing the number of stream endpoints consumption of equipment resources.
  • another embodiment of the present application provides a method for controlling a stream endpoint.
  • the method is applied to a device that supports connection with multiple other devices in a data transmission system.
  • the method includes the following steps:
  • the stream endpoint is used to receive audio data streams, that is, when the stream endpoint establishes a data stream connection channel with the stream endpoints of other devices, it is used to receive audio stream data from the stream endpoints of other devices.
  • the function initialization configuration refers to the configuration of the ATSC so that the stream endpoint is switched from an uninitialized state to an unoccupied state. And the encoding and decoding functions of the N stream endpoints in the unoccupied state are different. So that the device supports N types of codec capabilities.
  • the discoverable list is used to store data responding to the discovery command, and the discovery command is used to discover the stream endpoints in an unoccupied state.
  • the identification information of the stream endpoint includes the stream endpoint identification SEID.
  • the data structure of the discoverable list may specifically be a linked list structure, an array structure, or the like. After the N flow endpoints are switched from the uninitialized state to the unoccupied state, the N flow endpoints are added to the discoverable list to be discovered by other devices.
  • the stream endpoint when a connection is successfully established between the stream endpoint and the stream endpoints of other devices, the stream endpoint is also switched to the occupied state.
  • the working status of a streaming endpoint can be determined by determining whether there are newly established connections.
  • a signaling channel is established between the first device and the second device. It mainly includes the ACL (asynchronous connection-oriented logical transport) link and the signaling channel of the AVDTP protocol.
  • the first device sends a discovery instruction to the second device based on the established signaling channel to discover the stream endpoints in the unoccupied state in the second device, and the second device reads the identifiers of the unoccupied stream endpoints in the discoverable list information, and generate a response message according to the read identification information and send it back to the first device.
  • ACL asynchronous connection-oriented logical transport
  • the first device After receiving the identification information of the stream endpoint in an unoccupied state, the first device generates an instruction for acquiring the function of the stream endpoint according to the identification information of the stream endpoint, and sends the instruction to the second device.
  • the ASTC of the corresponding stream endpoint generates a response message, and sends the response message to the first device.
  • the first device matches the stream endpoint in the unoccupied state of the second device with its locally stored stream endpoint to determine the stream used this time.
  • the endpoint configures the service parameters for the locally stored stream endpoints, and sends a service parameter configuration instruction to the second device. After configuring the service parameters, the second device returns a successful configuration message.
  • a stream endpoint switches from the unoccupied state to the occupied state. That is, if the number of the stream endpoints in the unoccupied state is reduced by one, the ATSC configuration is performed on a stream endpoint in the uninitialized state, so that the stream endpoint is switched from the uninitialized state to the unoccupied state.
  • the codec function of the stream endpoint configured with service parameters is the same as the codec function of the stream endpoint configured with function initialization. That is, when the stream endpoint switches from the unoccupied state to the occupied state, the ASTC configuration is performed on the stream endpoint in the uninitialized state, wherein the configured codec function and the codec of the stream endpoint that switches from the unoccupied state to the occupied state. function the same.
  • the device supports two encoding and decoding capabilities, namely AAC and SBC.
  • the memory has only storage space for 4 stream endpoints. Create four new stream endpoints in an uninitialized state in the memory, marked as SEP1 to SEP4, and perform function initialization configuration on SEP1 and SEP2, so that SEP1 supports AAC and SEP2 supports SBC. That is, SEP1 and SEP2 are in an unoccupied state (represented by a solid line box), and SEP3 and SEP4 are in an uninitialized state (represented by a double-dot-dash line box).
  • Fig. 8B when receiving a successful configuration message indicating that the service parameters of SEP1 are successfully configured, other device 1 establishes a connection with this device, and SEP1 switches from the unoccupied state to the occupied state (represented by a dotted box), then the SEP3 performs function initialization configuration, so that SEP3 switches from an uninitialized state to an initialized state. SEP4 is still in an uninitialized state.
  • a storage space for (N+M-1) stream endpoints is provided in the memory for storing (N+M-1) stream endpoints.
  • the state distribution of (N+M-1) stream endpoints conforms to the following conditions: there can be three state stream endpoints at the same time, or there can only exist stream endpoints in the uninitialized state and stream endpoints in the unoccupied state, It is also possible to only have stream endpoints in an unoccupied state and stream endpoints in an occupied state.
  • the identification information of the stream endpoints that perform service parameter configuration is deleted from the discoverable list; and/or, the identification information of the stream endpoints that perform function initialization configuration is added to the discoverable list.
  • the identification information of the flow endpoint is deleted from the discoverable table.
  • the stream endpoint is successfully initialized and configured, the stream endpoint is switched from the uninitialized state to the occupied state, and the identification information of the stream endpoint is added to the discoverable table.
  • the identification information of N stream endpoints is included in the discoverable list, and the stream endpoint corresponding to the identification information in the discoverable list is in an unoccupied state.
  • the occupied stream endpoints will not be discovered by the new device, and the stream endpoints that can be discovered externally are in the unoccupied state. To a certain extent, the connection time between devices is reduced.
  • the flow endpoint control method by monitoring whether a successful configuration message is received, it is determined whether there is a flow endpoint that switches from the unoccupied state to the occupied state, and then it is determined whether the function initialization of the uninitialized flow endpoint is required. It is configured to keep the number of stream endpoints in an unoccupied state as N, so as to ensure that the device can support connection with other devices with any codec capability on the basis of other devices already connected. Compared with the existing technology , the total number of all stream endpoints in the device is reduced, and the resource consumption of the device by the stream endpoints is reduced. In addition, making the discoverable list include the identification information of N pieces of stream endpoints in an unoccupied state can reduce the connection time between devices to a certain extent.
  • FIG. 9 another embodiment of the present application provides a flow endpoint control method, the method includes the following steps:
  • S402 Perform functional initialization configuration on N stream endpoints in an uninitialized state in the memory to obtain N stream endpoints in an unoccupied state.
  • a release success message will be received, and the release success message indicates the signaling established between the two stream endpoints. channel release.
  • the release success message indicates that the stream endpoint is switched from the occupied state to the unoccupied state.
  • the flow endpoint corresponding to the released signaling channel is reset, so as to switch the working state of the flow endpoint to the uninitialized state, so as to maintain the number of flow endpoints in the unoccupied state. is N.
  • the reset process refers to the reset process of ASTC to switch the stream endpoint to an uninitialized state.
  • the flow endpoint control method by monitoring whether a release success message is received, it is then determined whether a flow endpoint is switched to an unoccupied state, and then it is determined whether the flow endpoint needs to be reset, so that the flow endpoint needs to be reset.
  • the endpoint is switched to the uninitialized state, so that the number of stream endpoints in the unoccupied state remains N, so as to ensure that the device can support the connection with other devices with any codec capability on the basis of other devices already connected.
  • the total number of all stream endpoints in the device is reduced, and the resource consumption of the device by the stream endpoints is reduced.
  • making the discoverable list include the identification information of N pieces of stream endpoints in an unoccupied state can reduce the connection time between devices to a certain extent.
  • the playback device 500 includes:
  • a transmitter 501 used for sending data
  • the processor 504 is configured to execute the program stored in the memory, and when the program is executed, the processor is configured to execute the stream endpoint control method described in the above embodiments. For details, reference may be made to the relevant descriptions in the foregoing embodiments of the flow endpoint control method.
  • the above-mentioned memory 503 may be independent or integrated with the processor 504 .
  • the client device further includes a bus for connecting the memory 503 and the processor 504 .
  • the memory is provided with storage spaces for (M+N-1) stream endpoints.
  • the playback device includes a Bluetooth headset or a Bluetooth speaker.
  • the stream endpoint control method provided by the embodiment of the present application is described below in conjunction with a data transmission system formed by a TWS headset and a smart phone.
  • the TWS headset supports connection with multiple other devices.
  • TWS earphones include primary and secondary ears.
  • the TWS headset has three working modes: Relay Mode, Snoop Mode, and Dual Mode. The following describes the control methods of the primary ear and secondary ear stream endpoints in the three modes.
  • the main ear in the forwarding mode, is provided with a stream endpoint (hereinafter referred to as a terminal stream endpoint) as the data stream end point and a stream endpoint as a data stream source (hereinafter referred to as a source stream endpoint). Mark the end stream endpoint as sink SEP and the source stream endpoint as source SEP.
  • the terminal stream endpoint is used to receive the audio data stream
  • the source stream endpoint is used to send the audio data stream
  • the secondary ear also has a terminal stream endpoint and a source stream endpoint.
  • the main ear uses the terminal stream endpoint sink SEP to construct the audio stream connection channel C11 with the smartphone.
  • the secondary ear uses the termination stream endpoint sink SEP and the main ear source stream endpoint source SEP to construct an audio stream connection channel C12.
  • the main ear Based on the audio stream connection channel C11 between the main ear and the smartphone, data transmission is performed between the main ear and the smartphone.
  • the main ear After receiving the audio stream transmitted by the smartphone, the main ear connects the channel C12 based on the audio stream between the main ear and the auxiliary ear, and performs data transmission between the main ear and the auxiliary ear.
  • the main ear and the smartphone build an audio stream connection channel, in order to support multiple codec capabilities and support connection with multiple smartphones.
  • the terminal stream endpoint in the main ear is controlled by using the stream endpoint control method provided in the above embodiment.
  • the specific control process is as follows: when the main ear and the auxiliary ear are initially powered on, the status of the flow endpoints in the main ear is: there are (M+N-1) terminal flow endpoints in the main ear, among which N are in the unoccupied state and are marked respectively.
  • N are in the unoccupied state and are marked respectively.
  • the encoding and decoding capabilities of the N stream endpoints are marked as codec 1 to codec N in turn, and the remaining (M-1) are in the uninitialized state, marked as sink SEP N+1 to sink SEP N+ M-1.
  • the main ear uses the terminal end point sink SEP1 with codec 1 to connect with the smartphone A, that is, the sink SEP1 switches to the occupied state (indicated by the dotted box).
  • the main ear then performs the function initialization configuration of the terminal stream endpoint sink SEP N+1, so that the encoding and decoding capability of the stream endpoint is codec1, so as to maintain the number of stream endpoints (indicated by solid line boxes) in an unoccupied state as N, and each The encoding and decoding capabilities of the streaming endpoints are different.
  • the smartphone B can also select a stream endpoint to connect to from the termination stream endpoint sink SEP 2 to the termination stream endpoint sink SEP N+1.
  • the main ear uses the source stream endpoint source SEP1 with codec 1 to connect with the codec 1 termination stream endpoint sink SEP1 in the secondary ear to establish a channel C12 for data transmission between the main ear and the secondary ear.
  • Smartphone B continues to select the terminal stream endpoint sink SEP N+1 of codec 1 to construct the audio stream connection channel C21, and the main ear then performs function initialization configuration on the terminal stream endpoint sink SEP N+2, so that the encoding and decoding capability of the stream endpoint is codec1,
  • the main ear can continue to use the data transmission channel C12 for transmission.
  • the remaining (M-3) stream endpoints are in an uninitialized state (represented by a double-dot-dash box).
  • the functions of the main ear and the auxiliary ear are usually switched. That is, the primary ear becomes the primary ear, and the primary primary ear becomes the secondary ear.
  • the terminal sink SEP1 with codec 1 of the main ear (that is, the original auxiliary ear) after the function switching has been occupied. It is connected to the secondary ear (that is, the original main ear) after the function switching and other smart phones, and the terminal stream endpoint in the main ear after the function switching is also controlled by the stream endpoint control method provided in the above embodiment.
  • the control process of the terminal end point in the main ear after the function switching is the same as the control process of the terminal end point in the main ear before the function switch, and will not be repeated here.
  • both the main ear and the auxiliary ear have only terminal end points.
  • the main ear uses the terminal stream endpoint to build an audio stream connection channel with the stream endpoint of smartphone A.
  • the secondary ear monitors the primary ear's terminating endpoint using the terminating endpoint of the same codec capability. In order to support a variety of codec capabilities, as well as support to connect with multiple smartphones.
  • the terminal stream endpoints in the primary ear and the secondary ear are controlled by using the stream endpoint control method provided in the above embodiment.
  • the specific control process is as follows: when the primary ear and the secondary ear are initially powered on, the status of the stream endpoints in the primary ear is the same as that in the forwarding mode, which will not be described again this time.
  • the main ear uses the terminal stream endpoint sink SEP 1 with codec 1 and the stream endpoint of smartphone A to build a data stream connection channel.
  • the secondary ear also monitors the data sent by smartphone A using the termination endpoint sink SEP 1 with codec 1.
  • Both the primary ear and the secondary ear perform the function initialization configuration of the termination stream endpoint sink SEP N+1, so that the encoding and decoding capability of the stream endpoint is codec1, so as to maintain the number of stream endpoints in an unoccupied state as N, and the number of stream endpoints of each stream endpoint is Codec capabilities are different.
  • Smartphone B continues to select sink SEP N+1, the terminal endpoint with codec 1 in the main ear, to build a data connection channel, and the secondary ear also continues to use the terminal endpoint sink SEP 1 with codec 1 to monitor the data sent by smartphone A.
  • the main ear and the auxiliary ear also perform the function initialization configuration of the terminal stream endpoint sink SEP N+2, so that the encoding and decoding capability of the stream endpoint is codec1.
  • both the main ear and the auxiliary ear are connected to the smartphone A, and both the main ear and the auxiliary ear have only terminal end points.
  • the terminal stream endpoints in the primary ear and the secondary ear are controlled by using the stream endpoint control method provided in the above embodiment.
  • the specific control process is as follows: when the primary ear and the secondary ear are initially powered on, the status of the stream endpoints in the primary ear is the same as that in the forwarding mode, which will not be described again this time.
  • the main ear uses the terminal stream endpoint sink SEP 1 with codec 1 and the stream endpoint of smartphone A to construct a data stream connection channel C11.
  • the master ear will initialize the function of the terminal stream endpoint sink SEP N+1, so that the encoding and decoding capability of the stream endpoint is codec1, so as to maintain the number of stream endpoints in an unoccupied state as N, and the encoding and decoding capabilities of each stream endpoint. different.
  • Smartphone B continues to select the terminal stream endpoint sink SEP N+1 with codec 1 in the main ear to build a data connection channel, and the main ear then performs function initialization configuration on the terminal stream endpoint sink SEP N+2, so that the encoding and decoding capabilities of the stream endpoint are codec1.
  • the control method of the secondary ear mid-stream endpoint is the same as that of the main ear, and will not be repeated this time.
  • Another embodiment of the present application further provides a computer storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, the stream endpoint control methods described in the foregoing embodiments are executed.
  • the processor executes the computer-executable instructions
  • the stream endpoint control methods described in the foregoing embodiments are executed.

Abstract

一种流端点控制方法、电子设备以及存储介质,所述方法包括:获取每个流端点的工作状态(S201),其中,流端点具有编解码功能,工作状态包括未占用状态;使存储器中处于未占用状态的流端点的数量为N个,且每个所述处于未占用状态的流端点的编解码功能不同(S202),以保证设备在已经连接其他设备基础之上,还能够支持与任意一种编解码能力的其他设备连接,相较于现有技术,使设备中所有流端点的总数量减少,减少流端点对设备资源损耗。

Description

流端点控制方法、电子设备以及存储介质 技术领域
本申请涉及蓝牙技术领域,尤其涉及一种流端点控制方法、电子设备以及存储介质。
背景技术
在经典蓝牙数据传输过程中,需要一个发起设备和一个接收设备。每个设备中都存在一个或多个流端点(Stream End Point,简称SEP)。每一个流端点都具备数据流传输能力,但一个流端点只支持配置一种数据流编解码能力。
目前的无线立体声(True Wireless Stereo,简称:TWS)耳机也占用经典蓝牙与其他设备进行数据传输。不同设备具有不同数据编解码方式。为了支持与不同的设备的数据传输,每个TWS耳机设有N个具有不同编解码能力的流端点。这N个具有不同编解码能力的流端点仅支持与一台设备连接。当TWS耳机需要与多个设备连接时,需要在TWS耳机配置N×M个流端点,其中,M是指TWS耳机能够连接设备的数量,N表示TWS耳机所支持编解码方式的数量。
然而,现有TWS耳机需要配置N×M个流端点,以支持与M个设备连接,N×M个流端点需要消耗TWS耳机大量资源。
发明内容
本申请提供一种流端点控制方法、电子设备以及存储介质,旨在降低流端点对设备资源的损耗,以及减少建立数据流连接的时间。
第一方面,本申请提供一种流端点控制方法,包括:
获取每个流端点的工作状态,其中,流端点具有编解码功能,工作状态包括未占用状态;
使存储器中处于未占用状态的流端点的数量为N个,且每个处于未占用状态的流端点的编解码功能不同;
其中,N为编解码功能的类型的总数,N为正整数。
可选地,在获取每个流端点的工作状态之后,方法还包括:
使可发现列表中包含N条流端点的标识信息,且可发现列表中标识信息对应的流端点均处于未占用状态;
其中,可发现列表用于存储响应发现指令的数据,发现指令用于发现处于未占用状态的流端点。
可选地,获取每个流端点的工作状态,具体包括:
接收配置成功消息,其中,配置成功消息表示成功配置处于未占用状态的流端点的服务参数。
可选地,使存储器中处于未占用状态的流端点的数量为N个,且每个处于未占用状态的流端点的编解码功能不同,具体包括:
当接收到一条配置成功消息时,对存储器中一个处于未初始化状态的流端点进行功能初始化配置,获得一个处于未占用状态的流端点;
其中,功能初始化配置用于对流端点的应用服务和传输服务进行功能初始化配置。
可选地,进行服务参数配置的流端点的编解码功能与进行功能初始化配置的流端点的编解码功能相同。
可选地,使可发现列表中包含N条流端点的标识信息,且可发现列表中标识信息对应的流端点处于未占用状态,具体包括:
将进行服务参数配置的流端点的标识信息从可发现列表中删除;和/或
将进行功能初始化配置的流端点的标识信息增加至可发现列表中。
可选地,使存储器中处于未占用状态的流端点的数量为N个,且每个处于未占用状态的流端点的编解码功能不同,具体包括:
接收表示成功释放信令通道的释放成功消息;
将存储器中所释放的信令通道对应的流端点进行功能重置处理,获得处于未初始化状态的流端点;
其中,功能重置用于对流端点进行应用服务和传输服务的功能重置。
可选地,在获取每个流端点的工作状态之前,方法还包括:
向存储器中写入(N+M-1)个处于未初始化状态的流端点;
其中,M表示可连接的设备的最大数量,M为正整数。
可选地,在向存储器中写入(N+M-1)个处于未初始化状态的流端点之后,方法还包括:
将存储器中N个处于未初始化状态的流端点进行功能初始化配置,获得N个处于未占用状态的流端点,且N个处于未占用状态的流端点的编解码功能不同。
可选地,流端点用于接收音频数据流。
第二方面,本申请提供一种电子设备,包括:
存储器,用于存储程序;
处理器,用于执行存储器存储的程序,当程序被执行时,处理器用于执行第一方面及可选方案所涉及的流端点控制方法。
可选地,存储器中设有(N+M-1)个流端点的存储空间。
可选地,电子设备为播放设备。
可选地,播放设备包括蓝牙耳机或者蓝牙音箱。
第三方面,本申请提供一种计算机存储介质,计算机可读存储介质中存储有计算机执行指令,当处理器执行计算机执行指令时,实现第一方面及可选方案所涉及的流端点控制方法。
本申请提供一种流端点控制方法、电子设备以及存储介质,获取每个流端点的工作状态,使处于未占用状态的流端点的数量为N个,且每个流端点的编解码功能不同。以保证设备在已经连接其他设备基础之上,还能够支持与任意一种编解码能力的其他设备连接,相较于现有技术,并且设备中所有的流端点的总数量最小,减少流端点对设备资源损耗。也就是当流端点从未占用状态切换至占用状态时,处于未占用状态的流端点减少一个,将处于未初始化状态的流端点进行功能初始化配置,获得处于未占用状态的流端点。流端点从占用状态切换至未占用状态时,处于未占用状态的流端点增加一个,则将被释放的流端点进行功能重置,以将流端点从未占用状态切换至占用状态,以维持处于未占用状态的流端点的数量为N个。当设备支持N种编解码功能以及与M个其他设备连接时,仅需预留(M+N-1)个流端点的空间,大大减少流端点对设备资源损耗。另外,使可发现列表中包含N条流端点的标识信息,且可发现列表中所述标识信息对应的所述流端点处于未占用状态,已被占用的流端点不会被新设备发现,新设备在于本设备建立连接时,新设备无需获取已被占用的流端点能力,能在一定程度上减少新设备和本设备之间的连接时间。
附图说明
图1为本申请一实施例提供的流端点架构图;
图2为现有技术中流端点的配置示意图;
图3为本申请另一实施例提供的数据传输系统的结构示意图;
图4为本申请另一实施例提供的流端点控制方法的流程示意图;
图5为本申请另一实施例提供的流端点的状态转换示意图;
图6为本申请另一实施例提供的流端点控制方法的流程示意图;
图7为本申请另一实施例提供的流端点之间建立连接的流程示意图;
图8A为本申请另一实施例提供的设备设有4个流端点的配置示意图;
图8B-图8D为基于图8A所示的流端点配置的流端点状态示意图;
图9为本申请另一实施例提供的流端点控制方法的流程示意图;
图10为本申请另一实施例提供的电子设备的结构示意图;
图11为本申请另一实施例提供的耳机处于转发模式时流端点的配置示意图;
图12为本申请另一实施例提供的耳机处于监听模式时流端点的配置示意图;
图13为本申请另一实施例提供的耳机处于双连接模式时流端点的配置示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
在经典蓝牙协议中,流端点是为了协商一个流而公开可用传输服务和音视频(Audio/Video,简称:A/V)功能的应用程序。流端点在音视频传输协议(Audio/Video Distribution Transport Protocol Specification,简称:AVDTP)中注册,以便其他设备可以发现它,并与它进行连接。其中,AVDTP协议指 定音频或视频分发的传输协议,通过蓝牙空中传输流媒体音频或视频。逻辑链路控制和适配协议(Logical Link Control and Adaptation Protocol,简称:L2CAP)是蓝牙中的核心协议,负责适配基带(Baseband简称:BB)中的上层协议。
下面描述流端点的架构,如图1所示,设备A和设备B均为A/V设备,可以作为数据流的源设备或数据流的接收设备。A/V设备可以提供一个或多个数据流,也就是配置有多个流端点。从概念上讲,源设备或者接收设备中流端点连接位于设备的应用层。但流端点是在AVDTP层中表示,用于协商和操作数据流。L2CAP/BB层用于为源设备和接收设备之间提供一个端到端的通道。
例如,假设设备A有2个SEP标记为u和v,其中,SEP u表示视频接收器,SEP v表示音频接收器。设备B有三个SEP,标记为x、y和z,代表音频源。设备A应该与设备B中的一个音频源建立音频流连接。
设备A和设备B分别为其SEP维护本地流端点标识(Stream End Point Identifier,简称:SEID)。设备A占用AVDTP层中AVDTP服务来发现其他设备的资源。也就是,设备A获取设备B中的三个SEP的远程SEID和媒体类型。设备A占用其中一个AVDTP服务来收集其中一个远程SEP的应用程序和传输服务能力,例如SEP z。在了解了设备B公开的所有功能并将其与自己的本地功能进行比较之后,设备A可以占用另一个AVDTP服务来配置流连接。
如何选择服务的评估和决策发生在设备A的应用层,存储在本地SEP v与设备B的SEP z具有匹配能力,因此可以与设备B的SEP z连接。通过启动配置过程,设备A将本地SEP v映射到远程SEP z,这样两个设备都知道各自的远程SEID,以备将来相互参考。当配置过程成功终止时,设备A中SEP v和设备B中的SEP z资源都应被锁定,并且设备A中的SEP v和设备B中的SEP z都不能被配置为另一个连接。
每个流端点配置有应用服务和传输服务的功能(Application and Transport Service Capabilities,简称:ATSC)。其中,应用服务功能具体包括协商、配置音源设备的编解码能力、内容保护系统、频率设置以及等功能。传输服务能力具体包括数据报文的分割和重组,数据包的防丢检测等等。但一个流 端点只支持配置一种数据流编解码能力。也就是A/V设备需要设置多个配置有多个编解码能力的流端点,以适应与不同编解码能力的其他设备连接。
目前的无线立体声耳机也占用经典蓝牙与其他设备进行数据传输。如图2所所示,在现有技术中,每个TWS耳机设有M×N个流端点。TWS耳机支持N种类型的编解码能力,依次标记为codec1至codec N。也就是针对每种类型的编解码能力,TWS耳机中均对应设有M个流端点。例如:针对编解码能力1而言,TWS耳机中设有M个流端点。TWS耳机能够与M个其他设备连接。现有经典蓝牙协议中,M<8,也就是蓝牙耳机最多连接7台其他设备。
然而,现有TWS耳机需要配置N×M个流端点,以支持与M个设备连接,N×M个流端点需要消耗TWS耳机大量资源。
本申请提供一种流端点控制方法、电子设备以及存储介质,旨在降低流端点对设备资源的损耗。本申请提供一种动态配置流端点的技术方案,也就是实时监控每个流端点的工作状态,以控制处于未占用状态的流端点的数量为N个,并控制每个处于未占用状态的流端点的编解码能力不同。以保证设备在已经连接其他设备基础之上,还能够支持与具备任意一种编解码能力的其他设备连接,并且相对于现有技术来说使设备中所有的流端点的总数量明显减少,进而减少流端点对设备资源损耗。
如图3所示,本申请一实施例提供一种数据传输系统100,其中,数据传输系统100包括第一设备101和第二设备102。第一设备101和第二设备102均设有多个流端点,并支持N种类型的编解码能力。第二设备102将流端点的标识信息增加至可发现列表,第一设备101查找第二设备102的可发现列表中各个流端点,并将第二设备102未占用的流端点与其本地存储的流端点相互匹配,以建立第一设备101和第二设备102之间的数据流连接通道。第一设备101和第二设备102基于已经创建的数据流连接通道进行数据流传输。第一设备和第二设备中任意一个设备支持与多个其他设备连接。也可以是第一设备和第二设备均支持与多个其他设备连接。第一设备和第二设备可以为蓝牙耳机、蓝牙音箱、智能手机、计算机、平板电脑等设备中任意一种。
如图4所示,本申请另一实施例提供一种流端点控制方法,该方法应用于数据传输系统中支持与多个其他设备连接的设备,该方法包括如下步骤:
S201、获取每个流端点的工作状态。
其中,每个流端点具有编解码功能,且设备支持N种类型的编解码功能。工作状态包括未占用状态、占用状态以及未初始化状态。未初始化状态是指流端点没有经过应用服务和传输服务的功能的初始化配置,未占用状态是指没有占用该流端点建立数据流连接通道,占用状态是指已经占用该流端点建立数据流连接通道。
如图5所示,流端点的工作状态的切换方式如下:将处于未初始化状态A的流端点进行ATSC初始化配置,可使流端点从未初始化状态A切换至未占用状态B。将处于未占用状态B的流端点进行服务参数配置,可以使流端点从未占用状态B切换至占用状态C。其中,服务参数也就是ATSC的服务参数。
将处于占用状态C的流端点进行ASTC重置,可以使流端点从占用状态C切换至未初始化A状态。其中,重置目的在于让流端点恢复至未初始化状态A。
另外,通过将处于占用状态C的流端点进行服务参数重置,可以使流端点从占用状态C切换至为占用状态B。通过将处于未占用状态B的流端点进行ATSC的重置,可以使流端点从未占用状态B切换至为占用状态A。
S202、使存储器中处于未占用状态的流端点的数量为N个,且每处于未占用状态的流端点的编解码功能不同。
其中,统计处于未占用状态的流端点的数量。当处于未占用状态的流端点的数量不为N时,控制未占用状态的流端点的数量为N。也就是,当处于未占用状态的流端点的数量大于N时,将处于未占用状态的流端点切换至未初始化状态,以使处于未占用状态的流端点的数量等于N。例如:当一个流端点与其他流端点之间的信令通道断开时,该流端点从占用状态切换至未占用状态,也就是处于未占用状态的流端点的数量增加1个,则对一个处于未占用状态的流端点进行ATSC重置,使该流端点从未占用状态切换至未初始化状态。
当处于未占用状态的流端点的数量小于N时,将处于未初始化状态的流端点切换至未占用状态,以使处于未占用状态的流端点的数量等于N。例如:当一个流端点与其他流端点之间建立信令通道,并成功对该流端点进行服务 参数配置后,该流端点从未占用状态切换至占用状态,也就是处于未占用状态的流端点的数量减少1个,则对一个处于未初始化状态的流端点进行ATSC配置,使该流端点从未初始化状态切换至未占用状态。且在进行ATSC配置时,所配置的编解码功能同上述进行参数配置后的流端点的编解码功能相同,以使得处于未占用状态的流端点的数量为N,并且N个处于未占用状态的流端点支持不同的编解码功能。
在本申请实施例提供的流端点控制方法中,通过动态控制处于未占用状态的流端点的数量为N个,以确保在设备与其他设备已经连接的情况下,也能支持与任意一种编解码能力的其他设备连接,相较于现有技术中未占用状态流端点大于或等于(M-1)×N,本方案可以使设备中所有的流端点的总数量明显减少,进而减少流端点对设备资源损耗。
如图6所示,本申请另一实施例提供一种流端点控制方法,该方法应用于数据传输系统中支持与多个其他设备连接的设备,该方法包括如下步骤:
S301、向存储器中写入(N+M-1)个处于未初始化状态的流端点。
其中,在设备初次上电时,确定存储器是否存在(N+M-1)个流端点的存储空间。M表示可连接的设备的最大数量,M为正整数。若是,在存储器中分配(N+M-1)个流端点的存储空间,并在存储器中创建(N+M-1)个处于未初始化状态的流端点,若否,则返回存储空间不够的提示信息。
优选地,该流端点用于接收音频数据流,也就是该流端点与其他设备的流端点建立数据流连接通道时,用于从其他设备的流端点处接收音频流数据。
S302、将存储器中N个处于未初始化状态的流端点进行功能初始化配置,获得N个处于未占用状态的流端点。
其中,功能初始化配置是指进行ATSC的配置,以使流端点从未初始化状态切换至未占用状态。且N个处于未占用状态的流端点的编解码功能不同。以使设备支持N种类型的编解码能力。
S303、将N个从未初始化状态切换至未占用状态的流端点的标识信息添加至可发现表。
其中,可发现列表用于存储响应发现指令的数据,发现指令用于发现处于未占用状态的流端点。流端点的标识信息包括流端点标识SEID。其中,可发现列表的数据结构具体可以为链表结构、数组结构等。在将N个流端点从 未初始化状态切换至未占用状态之后,将N个流端点新增至可发现列表,以被其他设备发现。
S304、接收到成功配置消息。
其中,当流端点与其他设备的流端点之间成功建立连接时,该流端点也就切换至占用状态。可以通过确定是否有新建立的连接确定流端点的工作状态。
下面描述两个设备建立连接过程,如图7所示,两个设备分别标记为第一设备和第二设备,首先在第一设备和第二设备之间建立信令通道。主要包括ACL(asynchronous connection-oriented logical transport)链路和AVDTP协议的信令通道。第一设备基于已经建立的信令通道向第二设备发送发现指令,以发现第二设备中处于未占用状态的流端点,第二设备读取可发现列表中处于未占用状态的流端点的标识信息,并根据读取的标识信息生成响应消息回传至第一设备。
第一设备在接收到处于未占用状态的流端点的标识信息后,根据流端点的标识信息生成用于获取流端点功能的指令,并向第二设备发送该指令,第二设备指令中对标识信息对应流端点的ASTC生成响应消息,并将响应消息发送至第一设备,第一设备将第二设备中处于未占用状态的流端点与其本地存储的流端点进行配,确定此次使用的流端点,对本地存储的流端点进行服务参数配置,并向第二设备发送服务参数配置指令,第二设备在进行服务参数配置后,返回成功配置消息。
也就是当接收到成功配置消息时,可以确定两个流端点之间已经建立连接。也就是,当接收到成功配置消息时,确定流端点从未占用状态切换至占用状态。
S305、当接收到一条配置成功消息时,对存储器中一个处于未初始化状态的流端点进行功能初始化配置,获得一个处于未占用状态的流端点。
其中,在接收到一条配置成功消息后,表示一个流端点从未占用状态切换至占用状态。也就是处于未占用状态的流端点的数量减少1个,则对一个处于未初始化状态的流端点进行ATSC的配置,使该流端点从未初始化状态切换至未占用状态。
进行服务参数配置的流端点的编解码功能与进行功能初始化配置的流端 点的编解码功能相同。也就是当流端点从未占用状态切换至占用状态时,对处于未初始化状态的流端点进行ASTC配置,其中,所配置的编解码功能与从未占用状态切换至占用状态的流端点的编解码功能相同。
下面举例说明:如图8A所示,设备支持2种编解码能力,分别为AAC和SBC。在设备上电时,存储器仅有4个流端点的存储空间。在存储器中新建四个处于未初始化状态的流端点,分别标记为SEP1至SEP4,并对SEP1和SEP2进行功能初始化配置,使SEP1支持AAC,SEP2支持SBC。也就是SEP1和SEP2处于未占用状态(用实线框表示),SEP3和SEP4处于未初始化状态(用双点划线框表示)。
如图8B所示,当接收到一条表示成功配置SEP1的服务参数的成功配置消息时,其他设备1与本设备建立连接,SEP1从未占用状态切换至占用状态(用虚线框表示),则将SEP3进行功能初始化配置,使SEP3从未初始化状态切换至初始化状态。SEP4仍处于未初始化状态。
如图8C所示,当再次接收到一条表示成功配置SEP3的服务参数的成功配置消息时,其他设备2与本设备建立连接,SEP3从未占用状态切换至占用状态,则将SEP4进行功能初始化配置,使SEP4从未初始化状态切换至初始化状态。
如图8D所示,当再次接收到一条表示成功配置SEP3的服务参数的成功配置消息时,其他设备3与本设备建立连接,SEP4从未占用状态切换至占用状态。没有处于未初始化状态的流端点,设备无法再连接其他设备。
可知,当存储器仅有4个流端点的存储空间,设备支持两种编解码功能时。也就是,M+N-1=4,且N=2时,本方案可以支持与M=4+1-2=3台设备连接。而现有技术中,当M×N=4,N=2时,仅支持2台设备连接。
存储器中设有(N+M-1)个流端点的存储空间,用于存储(N+M-1)个流端点。其中,在(N+M-1)个流端点的状态分布符合如下情况:可以同时存在三种状态的流端点,也可以仅存在处于未初始化状态的流端点和处于未占用状态的流端点,也可以仅存在处于未占用状态的流端点和占用状态的流端点。
S306、使可发现列表中包含N条流端点的标识信息。
其中,将进行服务参数配置的流端点的标识信息从可发现列表中删除; 和/或,将进行功能初始化配置的流端点的标识信息增加至可发现列表中。
当流端点成功进行服务参数配置时,流端点从未占用状态切换至占用状态,则将该流端点的标识信息从可发现表中删除。当流端点成功进行功能初始化配置,流端点从未初始化状态切换至为占用状态,将该流端点的标识信息添加至可发现表。使可发现列表中包含N条流端点的标识信息,且可发现列表中标识信息对应的流端点处于未占用状态。
已被占用的流端点不会被新设备发现,对外可被发现的流端点均是处于未占用状态,在其他设备与本设备建立连接时,无需获取已被占用的流端点的ASTC,能在一定程度上减少设备间的连接时间。
这样,避免了处于未占用状态的流端点的数量大于N,在节省资源的同时,也避免了查询可发现列表时由于遍历的处于未占用状态的流端点的数量过多而导致耗时过长。
在本申请实施例提供的流端点控制方法中,通过监控是否接收到成功配置消息,确定是否有流端点从未占用状态切换至占用状态,进而确定是否需要将未初始化状态的流端点进行功能初始化配置,以使处于未占用状态的流端点的数量保持为N,以保证设备在已经连接其他设备基础之上,还能够支持与任意一种编解码能力的其他设备连接,相较于现有技术,使设备中所有的流端点的总数量减少,减少流端点对设备资源损耗。另外,使可发现列表中包含N条处于未占用状态的流端点的标识信息,能在一定程度上减少设备间的连接时间。
如图9所示,本申请另一实施例提供一种流端点控制方法,该方法包括如下步骤:
S401、向存储器中写入(N+M-1)个处于未初始化状态的流端点。
S402、将存储器中N个处于未初始化状态的流端点进行功能初始化配置,获得N个处于未占用状态的流端点。
S403、将N个从未初始化状态切换至未占用状态的流端点的标识信息添加至可发现表。
其中,S401至S403已经在上述实施例中详细说明,此处不再赘述。
S404、接收表示成功释放信令通道的释放成功消息。
其中,由于距离过远、设备断电、蓝牙功能被关闭等原因,使两个设备 之间连接断开,则会接收到释放成功消息,释放成功消息表示两个流端点之间建立的信令通道释放。当接收释放成功消息,表示该流端点从被占用状态切换至未占用状态。
S405、将存储器中所释放的信令通道对应的流端点进行重置处理,获得处于未初始化状态的流端点。
其中,在接收到释放成功消息,将所释放的信令通道对应的流端点进行重置处理,以将该流端点的工作状态切换至未初始化状态,以维持处于未占用状态的流端点的数量为N。重置处理是指进行ASTC的重置处理,以使流端点切换至未初始化状态。
在本申请实施例提供的流端点控制方法中,通过监控是否接收到释放成功消息,进而确定是否有流端点切换至未占用状态,进而确定是否需要将该流端点进行重置处理,使该流端点切换至未初始化状态,以使处于未占用状态的流端点的数量保持为N,以保证设备在已经连接其他设备基础之上,还能够支持与任意一种编解码能力的其他设备连接,相较于现有技术,使设备中所有的流端点的总数量减少,减少流端点对设备资源损耗。另外,使可发现列表中包含N条处于未占用状态的流端点的标识信息,能在一定程度上减少设备间的连接时间。
如图10所示,本申请另一实施例提供一种播放设备500,播放设备500包括:
发送器501,用于发送数据;
接收器502,用于接收数据;
存储器503,用于存储程序;
处理器504,用于执行存储器存储的程序,当程序被执行时,处理器用于执行上述实施例所描述的流端点控制方法。具体可以参见前述流端点控制方法的实施例中的相关描述。
可选地,上述存储器503既可以是独立的,也可以跟处理器504集成在一起。当存储器503独立设置时,该客户端设备还包括总线,用于连接存储器503和处理器504。
可选的,存储器中设有(M+N-1)个流端点的存储空间。
可选地,播放设备包括蓝牙耳机或者蓝牙音箱。
下面结合TWS耳机与智能手机构成的数据传输系统描述本申请实施例提供的流端点控制方法。其中,TWS耳机支持与多个其他设备连接。
TWS耳机包括主耳和副耳。TWS耳机有三种工作模式,分别为转发模式(Relay Mode)、监听模式(Snoop Mode)、以及双连接模式(Dual mode)。下面分别介绍三种模式下主耳和副耳流端点控制方法。
如图11所示,在转发模式下,主耳设有作为数据流终点的流端点(以下简称终流端点)和作为数据流源的流端点(以下简称源流端点)。将终流端点标记为sink SEP,将源流端点标记为source SEP。其中,终流端点用于接收音频数据流,源流端点用于发送音频数据流,副耳也设有终流端点和源流端点。主耳使用终流端点sink SEP与智能手机构建音频流连接通道C11。副耳使用终流端点sink SEP与主耳中源流端点source SEP构建音频流连接通道C12。
基于主耳和智能手机之间音频流连接通道C11,主耳和智能手机之间进行数据传输。主耳在接收到智能手机传输的音频流后,基于主耳和副耳之间音频流连接通道C12,主耳和副耳之间进行数据传输。
主耳与智能手机构建音频流连接通道,为了支持多种编解码能力,以及支持与多个智能手机连接。主耳中的终流端点采用上述实施例提供的流端点控制方法进行控制。
具体控制过程为:主耳和副耳初上电时,主耳中流端点的状态为:主耳中有(M+N-1)个终流端点,其中,N个处于未占用状态,分别标记为sink SEP1至sink SEPN,该N个流端点的编解码能力依次标记为codec 1至codec N,剩余(M-1)个处于未初始化状态,分别标记为sink SEP N+1至sink SEP N+M-1。
主耳使用具备codec 1的终流端点sink SEP1与智能手机A连接,也就是sink SEP1切换至占用状态(虚线框表示)。主耳再将终流端点sink SEP N+1进行功能初始化配置,使该流端点编解码能力为codec1,以维持处于未占用状态的流端点(实线框表示)的数量为N,且每个流端点的编解码能力不同。进而智能手机B还可以从终流端点sink SEP 2至终流端点sink SEP N+1中选择进行连接的流端点。
相应地,主耳使用具备codec 1的源流端点source SEP 1与副耳的具备codec 1终流端点sink SEP1连接,以建立主耳和副耳之间进行数据传输的通 道C12。
智能手机B继续选择codec 1的终流端点sink SEP N+1构建音频流连接通道C21,主耳再将终流端点sink SEP N+2进行功能初始化配置,使该流端点编解码能力为codec1,主耳可以继续使用数据传输的通道C12进行传输。剩余(M-3)个处于未初始化状态的流端点(双点划线框表示)。
由于转发模式下主耳耗电量高于副耳,通常情况下,主耳和副耳的功能会进行切换。也就是原副耳变成主耳,而原主耳变成副耳。在未进行功能切换前,功能切换后的主耳(也就是原副耳)的具备codec 1的终流端点sink SEP1已经被占用,为了支持功能切换后的主耳(也就是原副耳)能够与功能切换后的副耳(也就是原主耳)以及其他智能手机连接,功能切换后的主耳中的终流端点也采用上述实施例提供的流端点控制方法进行控制。功能切换后的主耳中的终流端点控制过程与功能切换前的主耳中的终流端点控制过程相同,此处不再赘述。
如图12所示,在监听模式下,主耳和副耳均仅设有终流端点。主耳使用终流端点与智能手机A的流端点构建音频流连接通道。副耳使用相同编解码能力的终流端点监控主耳的终流端点。为了支持多种编解码能力,以及支持与多个智能手机连接。主耳和副耳中的终流端点采用上述实施例提供的流端点控制方法进行控制。
具体控制过程为:主耳和副耳初上电时主耳中流端点的状态与转发模式下的相同,此次不再赘述。主耳使用具备codec 1的终流端点sink SEP 1与智能手机A的流端点构建数据流连接通道。副耳也使用具备codec 1的终流端点sink SEP 1监控智能手机A发送的数据。主耳和副耳都将终流端点sink SEP N+1进行功能初始化配置,使该流端点编解码能力为codec1,以维持处于未占用状态的流端点的数量为N,且每个流端点的编解码能力不同。
智能手机B继续选择主耳中具备codec 1的终流端点sink SEP N+1构建数据连接通道,副耳也继续使用具备codec 1的终流端点sink SEP 1监控智能手机A发送的数据。主耳和副耳也再将终流端点sink SEP N+2进行功能初始化配置,使该流端点编解码能力为codec1。
如图13所示,在双连接模式下,主耳和副耳均与智能手机A连接,主耳和副耳均仅设有终流端点。主耳和副耳中的终流端点采用上述实施例提供 的流端点控制方法进行控制。
具体控制过程为:主耳和副耳初上电时主耳中流端点的状态与转发模式下的相同,此次不再赘述。主耳使用具备codec 1的终流端点sink SEP 1与智能手机A的流端点构建数据流连接通道C11。主耳都将终流端点sink SEP N+1进行功能初始化配置,使该流端点编解码能力为codec1,以维持处于未占用状态的流端点的数量为N,且每个流端点的编解码能力不同。智能手机B继续选择主耳中具备codec 1的终流端点sink SEP N+1构建数据连接通道,主耳再将终流端点sink SEP N+2进行功能初始化配置,使该流端点编解码能力为codec1。副耳中流端点控制方式同主耳相同,此次不再赘述。
本申请另一实施例还提供一种计算机存储介质,计算机可读存储介质中存储有计算机执行指令,当处理器执行计算机执行指令时,执行上述实施例所描述的流端点控制方法。具体可以参见前述流端点控制方法的实施例中的相关描述。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (15)

  1. 一种流端点控制方法,其特征在于,包括:
    获取每个流端点的工作状态,其中,所述流端点具有编解码功能,所述工作状态包括未占用状态;
    使存储器中处于所述未占用状态的流端点的数量为N个,且每个处于所述未占用状态的流端点的编解码功能不同;
    其中,N为编解码功能的类型的总数,N为正整数。
  2. 根据权利要求1所述的方法,其特征在于,在所述获取每个流端点的工作状态之后,方法还包括:
    使可发现列表中包含N条所述流端点的标识信息,且所述可发现列表中所述标识信息对应的所述流端点均处于未占用状态;
    其中,所述可发现列表用于存储响应发现指令的数据,所述发现指令用于发现所述处于未占用状态的流端点。
  3. 根据权利要求1或2所述的方法,其特征在于,所述获取每个流端点的工作状态,具体包括:
    接收配置成功消息,其中,所述配置成功消息表示成功配置所述处于未占用状态的流端点的服务参数。
  4. 根据权利要求3所述的方法,其特征在于,所述使存储器中处于所述未占用状态的流端点的数量为N个,且每个所述处于未占用状态的流端点的编解码功能不同,具体包括:
    当接收到一条所述配置成功消息时,对所述存储器中一个处于未初始化状态的流端点进行功能初始化配置,获得一个所述处于未占用状态的流端点;
    其中,所述功能初始化配置用于对所述流端点的应用服务和传输服务进行功能初始化配置。
  5. 根据权利要求4所述的方法,其特征在于,进行服务参数配置的流端点的编解码功能与进行功能初始化配置的流端点的编解码功能相同。
  6. 根据权利要求4或5所述的方法,其特征在于,使可发现列表中包含N条所述流端点的标识信息,且所述可发现列表中所述标识信息对应的所述流端点处于未占用状态,具体包括:
    将进行服务参数配置的流端点的标识信息从所述可发现列表中删除;和/ 或
    将进行所述功能初始化配置的流端点的标识信息增加至所述可发现列表中。
  7. 根据权利要求4至6中任意一项所述的方法,其特征在于,所述使存储器中处于所述未占用状态的流端点的数量为N个,且每个所述处于未占用状态的流端点的编解码功能不同,具体包括:
    接收表示成功释放信令通道的释放成功消息;
    将所述存储器中所释放的信令通道对应的所述流端点进行功能重置处理,获得处于未初始化状态的流端点;
    其中,所述功能重置用于对所述流端点进行所述应用服务和所述传输服务的功能重置。
  8. 根据权利要求1至7中任意一项所述的方法,其特征在于,在所述获取每个流端点的工作状态之前,方法还包括:
    向所述存储器中写入(N+M-1)个处于未初始化状态的流端点;
    其中,M表示可连接的设备的最大数量,M为正整数。
  9. 根据权利要求8所述的方法,其特征在于,在向所述存储器中写入(N+M-1)个处于未初始化状态的流端点之后,方法还包括:
    将所述存储器中N个处于未初始化状态的流端点进行功能初始化配置,获得N个处于未占用状态的流端点,且所述N个处于未占用状态的流端点的编解码功能不同。
  10. 根据权利要求1至9中任意一项所述的方法,其特征在于,所述流端点用于接收音频数据流。
  11. 一种电子设备,其特征在于,包括:
    存储器,用于存储程序;
    处理器,用于执行所述存储器存储的所述程序,当所述程序被执行时,所述处理器用于执行如权利要求1至10任一项所述的流端点控制方法。
  12. 根据权利要求11所述的电子设备,其特征在于,所述存储器中设有(M+N-1)个流端点的存储空间。
  13. 根据权利要求11或12所述的电子设备,其特征在于,所述电子设备为播放设备。
  14. 根据权利要求13所述的电子设备,其特征在于,所述播放设备包括蓝牙耳机或者蓝牙音箱。
  15. 一种计算机存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行计算机执行指令时,实现如权利要求1至10中任一项所述的流端点控制方法。
PCT/CN2020/118359 2020-09-28 2020-09-28 流端点控制方法、电子设备以及存储介质 WO2022061874A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/118359 WO2022061874A1 (zh) 2020-09-28 2020-09-28 流端点控制方法、电子设备以及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/118359 WO2022061874A1 (zh) 2020-09-28 2020-09-28 流端点控制方法、电子设备以及存储介质

Publications (1)

Publication Number Publication Date
WO2022061874A1 true WO2022061874A1 (zh) 2022-03-31

Family

ID=80846127

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/118359 WO2022061874A1 (zh) 2020-09-28 2020-09-28 流端点控制方法、电子设备以及存储介质

Country Status (1)

Country Link
WO (1) WO2022061874A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120069246A1 (en) * 2010-09-17 2012-03-22 Eldon Technology Limited Method and device for operating a television located in a premises to simulate occupation of the premises
CN104936211A (zh) * 2015-04-27 2015-09-23 深圳市金立通信设备有限公司 一种无线资源分配方法
CN106332132A (zh) * 2015-07-03 2017-01-11 中兴通讯股份有限公司 一种自适应式蓝牙性能调节的通讯终端及方法
CN111683357A (zh) * 2020-05-25 2020-09-18 杭州寰星电子科技有限公司 低功耗蓝牙传输音频的方法、装置和设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120069246A1 (en) * 2010-09-17 2012-03-22 Eldon Technology Limited Method and device for operating a television located in a premises to simulate occupation of the premises
CN104936211A (zh) * 2015-04-27 2015-09-23 深圳市金立通信设备有限公司 一种无线资源分配方法
CN106332132A (zh) * 2015-07-03 2017-01-11 中兴通讯股份有限公司 一种自适应式蓝牙性能调节的通讯终端及方法
CN111683357A (zh) * 2020-05-25 2020-09-18 杭州寰星电子科技有限公司 低功耗蓝牙传输音频的方法、装置和设备

Similar Documents

Publication Publication Date Title
US8054987B2 (en) System for wireless audio signal distribution between a plurality of active loudspeakers
US7882238B2 (en) Using bluetooth to establish ad-hoc connections between non-bluetooth wireless communication modules
US11102690B2 (en) Data sending method, data receiving method, data transmit end, and data receive end
WO2021103739A1 (zh) 用于无线耳机的音频数据传输方法及装置、存储介质、终端
US20240114290A1 (en) Method for managing a plurality of multimedia communication links in a point-to-multipoint bluetooth network
US11800337B2 (en) Method and apparatus for establishing Bluetooth data channel
KR20190033525A (ko) 블루투스 멀티미디어 장치 제어
EP4104459A1 (en) Switching between multiple earbud architectures
CN115669008A (zh) 连通同步流交换
CN111885575B (zh) 流端点控制方法、电子设备以及存储介质
US20220417743A1 (en) Method, apparatus, and computer program for setting encryption key in wireless communication system, and recording medium for same
WO2022061874A1 (zh) 流端点控制方法、电子设备以及存储介质
US11818185B2 (en) Audio streaming from host Bluetooth device to multiple receiving Bluetooth devices
KR20220023978A (ko) 무선 통신 시스템에서 주변 디바이스의 상태를 제어 및 관리하는 방법, 장치, 컴퓨터 프로그램 및 그 기록 매체
KR20220004825A (ko) 무선 통신 시스템에서 오디오 데이터를 제어하는 방법, 장치, 컴퓨터 프로그램 및 그 기록 매체
WO2023011316A1 (zh) 数据传输方法、电子设备、芯片和存储介质
KR20080089312A (ko) 무선 통신을 위한 전력 소비의 최적화 및 mips조건의감소를 위한 방법 및 시스템
JP2005318579A5 (zh)
US11907613B2 (en) Method, device, and computer program for audio routing in wireless communication system, and recording medium therefor
US20220256314A1 (en) Method, apparatus and computer program for broadcast discovery service in wireless communication system, and recording medium therefor
WO2023071567A1 (zh) 传输通道的重配置方法、装置和电子设备
CN213818123U (zh) 可切换通信方式的蓝牙耳机
WO2024027614A1 (zh) 通信方法及通信装置
WO2024067360A1 (zh) 通信方法及通信装置
US11665217B2 (en) Automated detection of media port protocols

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

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

Country of ref document: EP

Kind code of ref document: A1