Bluetooth-based data transmission method and device, medium, equipment and product
By relaying data through a router, the problems of short transmission distance and signal attenuation of Bluetooth devices are solved, enabling stable data transmission over longer distances and reducing device power consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2026-03-31
AI Technical Summary
Bluetooth devices have a short transmission range and are prone to signal attenuation and stuttering when there are obstacles. Existing technologies increase power consumption by increasing transmission power.
By relaying data through a router, a Bluetooth connection is established between the router and the target device to transmit data, thereby extending the transmission distance between devices. The same account quick connection function enables fast pairing and connection.
It effectively extends the transmission distance of Bluetooth devices, reduces stuttering caused by signal fading, and lowers device power consumption.
Smart Images

Figure CN121771679A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and in particular to a Bluetooth-based data transmission method, apparatus, medium, device, and product. Background Technology
[0002] Bluetooth technology is a widely used short-range wireless communication technology, widely adopted due to its convenience in data transmission. However, its relatively short transmission distance limits its application range. Related technologies increase the transmission distance by enhancing the transmission power between Bluetooth devices, but this method increases the power consumption of the Bluetooth devices. Furthermore, if obstacles exist in the transmission path, signal fading can cause stuttering. Therefore, there is an urgent need to provide a method to improve the data transmission distance between Bluetooth devices. Summary of the Invention
[0003] In view of this, the present disclosure provides a Bluetooth-based data transmission method, apparatus, medium, device, and product.
[0004] According to a first aspect of the present disclosure, a Bluetooth-based data transmission method is provided. The method includes: when a source device and a target device are transmitting data via Bluetooth, if the source device receives signal strength information sent by a router, determining whether the signal strength information meets preset conditions, wherein the signal strength information is sent by the router to the source device upon receiving a broadcast signal sent by the target device, and the signal strength information is used to characterize the received signal strength for communication between the router and the target device; if the signal strength information meets the preset conditions, sending a connection command to the router to establish a Bluetooth connection between the router and the target device; and sending data to be transmitted to the router to forward the data to be transmitted to the target device.
[0005] In some embodiments, the broadcast signal sent by the target device includes an account key; the method further includes: when the source device and the target device establish a Bluetooth connection, the source device generates an account key associated with a user account, the account key being used to enable Bluetooth connections between devices under the user account; the source device sends the account key to the target device, so that the target device carries the account key when sending the broadcast signal; the source device synchronizes the account key to all routers within the same local area network, so that each router completes the registration of the account key.
[0006] In some embodiments, before sending the data to be transmitted to the router, the method further includes: sending encoding configuration information to the router, causing the router to forward the information to the target device, wherein the encoding configuration information is used to indicate the encoding format of the data to be transmitted sent to the target device through the router; and receiving a configuration success notification sent by the router, wherein the configuration success notification is sent by the target device to the router after completing the encoding configuration.
[0007] In some embodiments, the data to be transmitted includes an audio stream; sending the data to be transmitted to the router, causing the router to forward the data to be transmitted to the target device, includes: sending an audio stream to the router and the target device; and, upon receiving a disconnect command sent by the router, stopping sending the audio stream to the target device and disconnecting the Bluetooth connection with the target device, wherein the disconnect command is sent to the source device by the router when it forwards the audio stream to the target device.
[0008] In some embodiments, the data to be transmitted includes a text stream; sending the data to be transmitted to the router, causing the router to forward the data to be transmitted to the target device, includes: stopping sending the current frame in the text stream to the target device; and, upon receiving a data request sent by the router, sending the current frame and subsequent frames to the router, wherein the data request is generated by the router in response based on the number of the current frame sent by the target device.
[0009] In some embodiments, the method further includes: upon receiving a target device disconnection notification sent by the router, stopping the transmission of data to be transmitted, wherein the target device disconnection notification is forwarded by the router to the source device upon receiving disconnection information sent by the target device.
[0010] In some embodiments, the method further includes: upon receiving a control command sent by the router, performing a corresponding control operation according to the instruction of the control command, wherein the control command is obtained by the router encapsulating the key operation event according to a pre-set mapping rule upon receiving a key operation event sent by the target device.
[0011] According to a second aspect of the present disclosure, a Bluetooth-based data transmission method is provided, the method comprising: when a router receives a broadcast signal sent by a target device, sending signal strength information to a source device that has established a Bluetooth connection with the target device, the signal strength information being used to characterize the received signal strength for communication between the router and the target device; when the router receives a connection instruction, establishing a Bluetooth connection with the target device, the connection instruction being sent by the source device to the router after determining that the signal strength information meets preset conditions; receiving data to be transmitted sent by the source device, and forwarding the data to be transmitted to the target device.
[0012] In some embodiments, the broadcast signal sent by the target device includes an account key; receiving the broadcast signal sent by the target device includes: if the account key in the broadcast signal matches a pre-registered account key, then sending a connection request to the target device, wherein the account key is generated and sent to the router for registration when the source device establishes a Bluetooth connection with the target device; and obtaining signal strength information between the router and the target device.
[0013] In some embodiments, before receiving the data to be transmitted sent by the source device, the method further includes: receiving encoding configuration information sent by the source device and forwarding it to the target device, wherein the encoding configuration information is used to indicate the encoding format of the data to be transmitted sent to the target device through the router; and receiving a configuration success notification sent by the target device and forwarding it to the source device.
[0014] In some embodiments, the data to be transmitted includes an audio stream; receiving the data to be transmitted sent by the source device and forwarding the data to be transmitted to the target device includes: upon receiving the audio stream sent by the source device, sending an audio transmission start request to the target device; upon receiving an audio transmission start ready response sent by the target device, sending the audio stream to the target device, causing the target device to stop receiving the audio stream sent by the source device and start receiving the audio stream sent by the router upon receiving the audio stream sent by the router; and sending a disconnect command to the source device, causing the source device to disconnect the Bluetooth connection with the target device.
[0015] In some embodiments, the data to be transmitted includes a text stream; before receiving the data to be transmitted sent by the source device, the method further includes: sending a number request for the current frame in the text stream to the target device, and receiving a number response for the current frame sent by the target device; sending a data request to the source device based on the number response for the current frame, causing the source device to send the current frame indicated by the number and other frames thereafter.
[0016] In some embodiments, the method further includes: upon receiving disconnection information sent by the target device, sending a target device disconnection notification to the source device, causing the source device to stop sending data to be transmitted.
[0017] In some embodiments, the method further includes: upon receiving a key operation event sent by the target device, encapsulating the key operation event according to a pre-set mapping rule to obtain a control instruction, and sending the control instruction to the source device, so that the source device performs a corresponding control operation according to the instruction.
[0018] According to a third aspect of the present disclosure, a Bluetooth-based data transmission apparatus is provided. The apparatus includes: a judging unit, configured to, when a source device and a target device are transmitting data via Bluetooth, determine whether the signal strength information received by the source device from a router meets preset conditions, wherein the signal strength information is sent by the router to the source device upon receiving a broadcast signal from the target device, and the signal strength information is used to characterize the received signal strength for communication between the router and the target device; and a sending unit, configured to, if the signal strength information meets the preset conditions, send a connection command to the router to establish a Bluetooth connection between the router and the target device; and send data to be transmitted to the router to forward the data to be transmitted to the target device.
[0019] According to a fourth aspect of the present disclosure, a Bluetooth-based data transmission apparatus is provided, the apparatus comprising: a signal strength determination unit, configured to send signal strength information to a source device that has established a Bluetooth connection with the target device when a router receives a broadcast signal sent by a target device, the signal strength information being used to characterize the received signal strength for communication between the router and the target device; a connection unit, configured to establish a Bluetooth connection with the target device when the router receives a connection instruction, the connection instruction being sent by the source device to the router when it determines that the signal strength information meets preset conditions; and a forwarding unit, configured to receive data to be transmitted sent by the source device and forward the data to be transmitted to the target device.
[0020] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in either the first or second aspect.
[0021] According to a sixth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the method described in either the first or second aspect above.
[0022] According to a seventh aspect of the present disclosure, a computer program product is provided, including a computer program and instructions that, when executed by a processor, implement the method described in either the first or second aspect described above.
[0023] The technical solution provided in this disclosure can include the following beneficial effects: During data transmission between the source device and the target device via Bluetooth, if the source device receives signal strength information sent by the router, and the signal strength information meets preset conditions, it indicates that the target device is closer to the router. Therefore, a connection command can be sent to the router to establish a Bluetooth connection between the router and the target device, and the source device can send data to be transmitted to the router, causing the router to forward the data to be transmitted to the target device. That is, even when the communication quality between the target device and the source device is poor, this disclosure extends the transmission distance between the source device and the target device via Bluetooth by forwarding the data to be transmitted between them through the router.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0025] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0026] Figure 1a and Figure 1b This is a schematic diagram of a scenario illustrated in this disclosure according to an exemplary embodiment;
[0027] Figure 2 This disclosure is a flowchart illustrating the interaction between a source device, a target device, and a router according to an exemplary embodiment.
[0028] Figure 3 This disclosure is a flowchart illustrating a quick connection for the same account according to an exemplary embodiment;
[0029] Figure 4 This is a schematic diagram illustrating the transmission of an audio stream according to an exemplary embodiment of the present disclosure;
[0030] Figure 5 This is a schematic diagram illustrating the transmission of a text stream according to an exemplary embodiment of the present disclosure;
[0031] Figure 6 This is a schematic diagram illustrating data transmission between a mobile phone and an earphone according to an exemplary embodiment of the present disclosure;
[0032] Figure 7 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0034] Due to its low-power characteristics, Bluetooth wireless communication technology is increasingly being adopted by various devices. However, Bluetooth's transmission distance is relatively short. Related technologies aim to increase the transmission distance by enhancing the transmission power between Bluetooth devices. For example, Bluetooth Super achieves longer-distance transmission by increasing the Bluetooth transmission power between the phone and headphones. However, this approach increases the power consumption of the Bluetooth antenna, thus reducing the headphones' battery life.
[0035] Therefore, this disclosure provides a Bluetooth-based data transmission method, and in this disclosure, the two devices connected via Bluetooth are referred to as the "source device" and the "target device," respectively. Please refer to... Figure 1a and Figure 1b , Figure 1a and Figure 1b This is a schematic diagram of a scenario illustrated in this disclosure according to an exemplary embodiment, in which the target device... Figure 1a The location where it is located is moved to Figure 1bIn this context, the method of extending the Bluetooth transmission distance between the source and target devices involves using a router to forward the interactive data between them. Specifically, during Bluetooth data transmission between the source and target devices, if the source device receives signal strength information from the router that meets preset conditions, it indicates that the target device is closer to the router or that the communication quality between the target device and the router is better. Therefore, the source device can send a connection command to the router to establish a Bluetooth connection with the target device and send the data to be transmitted to the router, which then forwards the data to the target device. This method also extends the Bluetooth transmission distance between the source and target devices when the communication quality between them is poor, by using a router to forward the data to be transmitted.
[0036] The router disclosed herein supports Bluetooth functionality, enabling it to establish Bluetooth connections with both source and target devices. Furthermore, the router supports data relay services for forwarding data to be transmitted.
[0037] The following embodiments will first describe the data transmission method provided in this disclosure in general terms, with reference to the accompanying drawings. That is, the interaction process between the source device, the target device and the router will be introduced first, and then the data transmission method will be introduced from the perspectives of the source device and the router respectively.
[0038] Figure 2 This disclosure illustrates an interaction flowchart between a source device, a target device, and a router according to an exemplary embodiment, such as... Figure 2 As shown, the data transmission method provided in this disclosure may include the following steps 201 to 207.
[0039] In step 201, the source device and the target device transmit data via Bluetooth.
[0040] For example, a source device can send a high-quality stereo audio stream, namely an A2DP (Advanced Audio Distribution Profile) stream, to a target device. A2DP is the Bluetooth audio transmission protocol.
[0041] In step 202, the target device sends a broadcast signal.
[0042] In step 203, when the router receives a broadcast signal sent by the target device, it determines the signal strength information of the communication between the router and the target device and sends it to the source device.
[0043] When the router receives a broadcast signal from the target device, it measures the strength of the signal and sends the signal strength information to the source device.
[0044] In step 204, the source device receives the signal strength information sent by the router and determines whether the signal strength information meets the preset conditions. If the signal strength information meets the preset conditions, it sends a connection command to the router.
[0045] The signal strength information sent by the source device through the router can be used to assess the signal quality and communication stability between the router and the target device.
[0046] For example, in this embodiment, it can be determined whether the received signal strength of communication between the router and the target device is greater than the received signal strength of communication between the source device and the target device. If the received signal strength of communication between the router and the target device is greater than the received signal strength of communication between the source device and the target device, then the signal strength information is determined to meet the preset conditions. As another example, in this embodiment, it can be determined whether the received signal strength of communication between the router and the target device is within a preset range. If the received signal strength of communication between the router and the target device is within the preset range, then the signal strength information is determined to meet the preset conditions. The preset range can be set to -60dBm to -70dBm.
[0047] Those skilled in the art will understand that the signal strength information disclosed herein may include RSSI (Received Signal Strength Indicator), or other parameters besides RSSI used to measure signal quality between devices, and is not limited herein.
[0048] In step 205, the router receives the connection command and establishes a Bluetooth connection with the target device.
[0049] In step 206, the source device sends the data to be transmitted to the router.
[0050] In step 207, the router forwards the data to be transmitted to the target device.
[0051] This disclosure effectively extends the transmission distance between the source and target devices by using a router relay when the target device is far from the source device, thereby reducing stuttering issues caused by the increased distance.
[0052] In this embodiment, for the source device, the data transmission method provided in this disclosure may include: when the source device and the target device are transmitting data via Bluetooth, if the source device receives signal strength information sent by the router, it determines whether the signal strength information meets preset conditions. The signal strength information is sent to the source device by the router upon receiving a broadcast signal from the target device, and the signal strength information characterizes the received signal strength for communication between the router and the target device. If the signal strength information meets the preset conditions, a connection command is sent to the router to establish a Bluetooth connection between the router and the target device. Data to be transmitted is then sent to the router, causing the router to forward the data to be transmitted to the target device.
[0053] In this embodiment, for a router, the data transmission method provided in this disclosure may include: when the router receives a broadcast signal sent by a target device, sending signal strength information to a source device that has established a Bluetooth connection with the target device, the signal strength information being used to characterize the received signal strength for communication between the router and the target device; when the router receives a connection command, establishing a Bluetooth connection with the target device, the connection command being sent by the source device to the router after determining that the signal strength information meets preset conditions; receiving data to be transmitted sent by the source device, and forwarding the data to be transmitted to the target device.
[0054] This disclosure improves the limited range of Bluetooth devices (such as Bluetooth headsets) by relaying data to be transmitted through a router, so that the signal strength of the data to be transmitted received by the target device is maintained in a better state, thereby reducing the stuttering caused by signal fading.
[0055] In this embodiment of the disclosure, the target device supports the same account quick connection function, which allows devices under the same account to achieve fast Bluetooth pairing and connection through a simplified authentication process.
[0056] Figure 3 This disclosure illustrates a flowchart of a quick connection for the same account according to an exemplary embodiment, such as... Figure 3 As shown, the devices establish a connection through the following steps 301 to 305.
[0057] In step 301, after the source device and the target device establish a Bluetooth connection, the source device generates an account key associated with the user account.
[0058] In step 302, the source device sends the account key to the target device and all routers in the same local area network.
[0059] In step 303, the target device receives the account key and carries the account key when sending a broadcast signal.
[0060] In step 304, the router completes the registration of the account key.
[0061] In step 305, if the router detects a broadcast signal sent by the target device, it obtains the account key in the broadcast signal and matches it with the registered account key. If they match, the router obtains the signal strength information between itself and the target device.
[0062] This disclosure enables a quick connection between the router and the target device via Bluetooth's same-account quick connection function, preparing for the seamless transition of data from the source device to the target device through the router.
[0063] For the source device, when a Bluetooth connection is established between the source device and the target device, the source device generates an account key associated with the user account. The account key is used to enable Bluetooth connections between devices under the user account. The source device sends the account key to the target device, so that the target device carries the account key when sending broadcast signals. The source device synchronizes the account key to all routers in the same local area network, so that each router completes the registration of the account key.
[0064] After the source device and target device successfully pair for the first time, an account key associated with the user account will be generated and sent to the target device and all routers in the same local area network. This allows the target device to quickly establish connections with different routers as it moves, thereby enabling the data sent by the source device to be forwarded to the target device through the router, thus extending the Bluetooth transmission distance.
[0065] For the target device, if the account key in the received broadcast signal matches the pre-registered account key, a connection request is sent to the target device. The account key is generated and sent to the router for registration when the source device establishes a Bluetooth connection with the target device; the signal strength information between the router and the target device is obtained.
[0066] Since different target devices support different encoding capabilities, such as AptX, LHDC, and AAC, but routers cannot adapt to all encoding capabilities, this disclosure involves the source device sending encoding configuration information to the router. The router then forwards this information to the target device, allowing the target device to switch to the appropriate encoding based on the configuration information. Afterward, the source device sends the encoded data to the router, which then transmits the data to the target device via Bluetooth. This method eliminates the need for the router to support all encoding capabilities of the Bluetooth protocol, thus achieving the desired solution.
[0067] For the source device, before sending the data to be transmitted to the router, the method further includes: sending encoding configuration information to the router, causing the router to forward it to the target device, wherein the encoding configuration information is used to indicate the encoding format of the data to be transmitted sent to the target device through the router; and receiving a configuration success notification sent by the router, wherein the configuration success notification is sent by the target device to the router after completing the encoding configuration.
[0068] For the target device, before receiving the data to be transmitted sent by the source device, the method further includes: receiving encoding configuration information sent by the source device and forwarding it to the target device, wherein the encoding configuration information is used to indicate the encoding format of the data to be transmitted sent to the target device through the router; and receiving a configuration success notification sent by the target device and forwarding it to the source device.
[0069] Upon receiving the encoded configuration information from the source device, the router forwards the information to the target device. The target device then performs the encoding configuration according to the instructions in the information and, upon completion, sends a configuration success notification to the router. The router receives and forwards the configuration success notification to the source device, which, upon receiving it, sends the data to be transmitted to the router.
[0070] In some embodiments, where the data to be transmitted includes an audio stream, for the source device, sending the data to be transmitted to the router, causing the router to forward the data to be transmitted to the target device, may include: sending an audio stream to both the router and the target device; and, upon receiving a disconnect command from the router, stopping sending the audio stream to the target device and disconnecting the Bluetooth connection with the target device, wherein the disconnect command is sent to the source device by the router when it forwards the audio stream to the target device.
[0071] To ensure uninterrupted audio streaming to the target device, the source device simultaneously sends audio streams to both the router and the target device without receiving a disconnect command from the router. Upon receiving the disconnect command from the router, the source device stops sending audio streams to the target device and disconnects the Bluetooth connection with the target device. Since the disconnect command is sent from the router to the source device while forwarding the audio stream to the target device, and is triggered by the target device upon initiating audio transmission, the target device can stop receiving audio streams from the source device and begin receiving audio streams from the router upon receiving the audio stream sent by the router. This achieves seamless transition between the audio streams sent by the source device and those forwarded by the router.
[0072] It should be noted that in this embodiment, before sending the audio stream to the router, the source device continuously sends the audio stream to the target device based on the Bluetooth continuity between the source and target devices. In one implementation, the source device can send audio streams to both the router and the target device simultaneously after sending a connection command and before receiving a disconnect command from the router.
[0073] In some embodiments, where the data to be transmitted includes an audio stream, for the router, receiving the data to be transmitted sent by the source device and forwarding the data to be transmitted to the target device may include: upon receiving the audio stream sent by the source device, sending an audio transmission start request to the target device; upon receiving an audio transmission start ready response sent by the target device, sending the audio stream to the target device, causing the target device to stop receiving the audio stream sent by the source device and start receiving the audio stream sent by the router upon receiving the audio stream sent by the router; and sending a disconnect command to the source device, causing the source device to disconnect its Bluetooth connection with the target device.
[0074] In the Bluetooth protocol, before a router can send an audio stream to a target device, it must first send an Audio / Video Distribution Transport Protocol Start (AVDTP Start) request. Once ready, the target device sends an AVDTP Start complete response to the router. Upon receiving this response, the router begins sending the audio stream to the target device. This causes the target device to stop playing the audio stream from the source device and begin playing the router's audio stream.
[0075] Although the target device stops receiving the audio stream from the source device, the Bluetooth link between the target and source devices remains open. Therefore, when the router starts sending an audio stream to the target device, it sends a disconnect command to the source device, causing the source device to disconnect from the target device's Bluetooth connection. The Bluetooth link between the target and source devices can be a Bluetooth connection link based on ACL communication mode. ACL is a link type in Bluetooth technology used for transmitting asynchronous data, supporting point-to-point and point-to-multipoint connections.
[0076] For ease of understanding, the following embodiments use a mobile phone as the source device and a Bluetooth headset as the target device as an example. Figure 4 The process of transmitting audio streams as disclosed herein is explained.
[0077] Figure 4 This disclosure is a schematic diagram illustrating the transmission of an audio stream according to an exemplary embodiment, such as... Figure 4 As shown, audio streams are transmitted between the mobile phone and the headphones through steps 401 to 409.
[0078] In step 401, the router sends signal strength information to the mobile phone. This signal strength information characterizes the received signal strength during communication between the router and the headset.
[0079] In step 402, the mobile phone sends a connection command to the router after determining that the signal strength information meets the preset conditions.
[0080] In step 403, the router establishes a Bluetooth connection with the headset according to the connection command.
[0081] In step 404, the mobile phone sends configuration encoding information to the router, causing the router to forward the configuration encoding information to the headset.
[0082] In step 405, the router receives the configuration success notification sent by the headset and forwards it to the mobile phone.
[0083] In step 406, the mobile phone simultaneously sends audio streams to both the router and the headset.
[0084] In step 407, the router sends a request to the headphones to initiate audio transmission.
[0085] In step 408, upon receiving an audio transmission start-ready response from the headphones, the router sends an audio stream to the headphones and sends a disconnect command to the mobile phone.
[0086] In step 409, upon receiving a disconnect command, the mobile phone disconnects from the Bluetooth connection with the headset.
[0087] In Bluetooth communication, Bluetooth devices can transfer files via the OPP (Object Push Profile) protocol. This means that the data to be transferred can also include text streams.
[0088] When the data to be transmitted includes a text stream, for the source device, sending the data to be transmitted to the router so that the router forwards the data to the target device may include: stopping sending the current frame in the text stream to the target device; and, upon receiving a data request sent by the router, sending the current frame and subsequent frames to the router, wherein the data request is generated by the router in response based on the number of the current frame sent by the target device.
[0089] Because the text stream is divided into multiple frames for transmission, the source device can stop sending the current frame of the text stream to the target device after sending a connection command to the router, thus avoiding data loss due to poor communication quality between the source and target devices. Upon receiving a data request from the router, the source device begins sending the current frame and subsequent frames to the router, causing the router to forward the current frame and subsequent frames to the target device.
[0090] In some embodiments, where the data to be transmitted includes a text stream, for the router, before receiving the data to be transmitted sent by the source device, the method further includes: sending a request for the number of the current frame in the text stream to the target device, and receiving a response for the number of the current frame sent by the target device; sending a data request to the source device based on the response for the number of the current frame, causing the source device to send the current frame indicated by the number and other frames thereafter.
[0091] For a router, to ensure the target device receives all frames in the text stream, it sends a request to the target device for the number of the current frame in the text stream that the target device is currently preparing to receive, and receives a response from the target device with the number of the current frame. The target device can determine the number of the current frame according to a preset strategy; for example, if it has not received all the data of the current frame, it discards the already received data and sends the number of the current frame to the router.
[0092] For ease of understanding, the following embodiments are combined with Figure 5 The process of transmitting text streams is explained.
[0093] Figure 5 This disclosure illustrates a text stream transmission diagram according to an exemplary embodiment, such as... Figure 5 As shown, the text stream is transmitted through the following steps 501 to 506.
[0094] In step 501, the source device sends the total size of the file to be transmitted, the size of each frame, and the total number of frames to be transmitted to the target device, and transmits the data based on the Bluetooth connection.
[0095] In step 502, the router sends signal strength information to the source device. This signal strength information characterizes the received signal strength during communication between the router and the target device.
[0096] In step 503, if the source device determines that the signal strength information meets the preset conditions, it sends a connection command to the router and stops sending the current frame in the text stream to the target device.
[0097] In step 504, the router establishes a Bluetooth connection with the target device according to the connection command and sends a request for the number of the current frame in the text stream to the target device.
[0098] Align the current transmission frame number by sending a request for the current frame number in the text stream to the target device.
[0099] In step 505, the router receives the current frame number response sent by the target device and sends a data request to the source device based on the current frame number response.
[0100] In step 506, the source device sends the current frame and subsequent frames to the router, causing the router to forward them to the target device.
[0101] When a source device sends data to a target device via a router, if the target device disconnects, the router, upon receiving the disconnection information from the target device, sends a target device disconnection notification to the source device, causing the source device to stop sending data. For example, after the target device disconnects, it can send "HCI_remote_disconnect" to the router to indicate that the remote Bluetooth device, i.e., the target device, has been disconnected.
[0102] For the source device, upon receiving a target device disconnection notification from the router, it stops sending data to be transmitted. The target device disconnection notification is forwarded by the router to the source device upon receiving disconnection information from the target device.
[0103] When a router and target device establish a connection based on the Audio / Video Remote Control Profile (AVRCP), since the source device and target device have lost their Bluetooth connection, the button operation events of the target device will be forwarded to the source device through the router. In this embodiment, an AVRCP control command is mapped in the router via the network so that the target device can operate the functions of the source device. For example, if the source device is a terminal device and the target device is a headset, the user can control the playback or pause of music on the terminal device through button operation events on the headset side.
[0104] In other words, for the source device, upon receiving a control command from the router, it executes a corresponding control operation according to the instruction of the control command. The control command is obtained by the router encapsulating a button operation event sent by the target device according to a pre-set mapping rule. The button operation event includes at least one of a play event, a pause event, and a volume adjustment event.
[0105] For a router, upon receiving a key operation event sent by the target device, it encapsulates the key operation event into a control command according to a pre-set mapping rule, and sends the control command to the source device, so that the source device performs the corresponding control operation according to the instruction of the control command.
[0106] Figure 6 This disclosure is a schematic diagram illustrating data transmission between a mobile phone and an earphone according to an exemplary embodiment, as shown below. Figure 6 As shown, when the headphones are disconnected after being put back in the case, they send a disconnection message to the router. The router then sends a headphone disconnection notification to the phone, causing the phone to stop sending audio streams. Conversely, if the headphones reconnect after being opened from the case, i.e., after establishing a Bluetooth connection with the router, they can send button operation events to the router. The router will then generate corresponding control commands based on the mapping relationship and send them to the phone, thereby enabling media playback control via the headphone buttons.
[0107] like Figure 6 As shown, the data to be transmitted between the source device and the destination device can be relayed through at least one router. In a local area network (LAN), the process of relaying data through multiple routers is described in the TCP / IP protocol, and will not be repeated in this embodiment.
[0108] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should know that this disclosure is not limited to the described order of actions, because according to this disclosure, some steps may be performed in other orders or simultaneously.
[0109] Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by this disclosure.
[0110] Corresponding to the aforementioned application function implementation method embodiments, this disclosure also provides embodiments of application function implementation apparatus and corresponding terminals.
[0111] In some embodiments, a Bluetooth-based data transmission device provided in this disclosure includes:
[0112] The judgment unit is used to determine whether the signal strength information received by the source device from the router meets the preset conditions when the source device and the target device are transmitting data via Bluetooth. The signal strength information is sent by the router to the source device when it receives a broadcast signal sent by the target device. The signal strength information is used to characterize the received signal strength of the communication between the router and the target device.
[0113] The transmitting unit is configured to send a connection command to the router to establish a Bluetooth connection between the router and the target device when the signal strength information meets preset conditions; and to send data to be transmitted to the router so that the router forwards the data to be transmitted to the target device.
[0114] In some embodiments, the broadcast signal sent by the target device includes an account key; the apparatus further includes an account key generation unit, configured to, when the source device and the target device establish a Bluetooth connection, generate an account key associated with a user account, the account key being used to enable Bluetooth connections between devices under the user account; the source device sends the account key to the target device, so that the target device carries the account key when sending the broadcast signal; the source device synchronizes the account key to all routers within the same local area network, so that each router completes the registration of the account key.
[0115] In some embodiments, the apparatus further includes: an encoding configuration unit, configured to send encoding configuration information to the router before sending data to be transmitted to the router, so that the router forwards the information to the target device, wherein the encoding configuration information is used to indicate the encoding format of the data to be transmitted to the target device through the router; and to receive a configuration success notification sent by the router, wherein the configuration success notification is sent by the target device to the router after completing the encoding configuration.
[0116] In some embodiments, the data to be transmitted includes an audio stream; the sending unit is specifically configured to send the audio stream to the router and the target device; upon receiving a disconnection command sent by the router, it stops sending the audio stream to the target device and disconnects the Bluetooth connection with the target device, wherein the disconnection command is sent to the source device by the router when it forwards the audio stream to the target device.
[0117] In some embodiments, the data to be transmitted includes a text stream; the sending unit is specifically configured to stop sending the current frame in the text stream to the target device; and, upon receiving a data request sent by the router, to send the current frame and subsequent frames to the router, wherein the data request is generated by the router in response to the number of the current frame sent by the target device.
[0118] In some embodiments, the apparatus further includes: a disconnection unit, configured to stop sending data to be transmitted upon receiving a target device disconnection notification sent by the router, wherein the target device disconnection notification is forwarded by the router to the source device upon receiving disconnection information sent by the target device.
[0119] In some embodiments, the device further includes a control unit, configured to perform a corresponding control operation according to the control command sent by the router upon receiving the control command sent by the router, wherein the control command is obtained by the router encapsulating the key operation event according to a pre-set mapping rule upon receiving the key operation event sent by the target device.
[0120] In some embodiments, a Bluetooth-based data transmission device provided in this disclosure includes:
[0121] A signal strength determination unit is used to send signal strength information to the source device that has established a Bluetooth connection with the target device when the router receives a broadcast signal sent by the target device. The signal strength information is used to characterize the received signal strength of the communication between the router and the target device.
[0122] A connection unit is used to establish a Bluetooth connection with the target device when the router receives a connection command, wherein the connection command is sent by the source device to the router after determining that the signal strength information meets preset conditions;
[0123] The forwarding unit is used to receive the data to be transmitted sent by the source device and forward the data to be transmitted to the target device.
[0124] In some embodiments, the broadcast signal sent by the target device includes an account key; the signal strength determination unit is specifically used to send a connection request to the target device if the account key in the broadcast signal matches a pre-registered account key, wherein the account key is generated and sent to the router for registration when the source device establishes a Bluetooth connection with the target device; and to obtain signal strength information between the router and the target device.
[0125] In some embodiments, the apparatus further includes: an encoding configuration unit, configured to receive encoding configuration information sent by the source device and forward it to the target device before receiving the data to be transmitted sent by the source device, wherein the encoding configuration information is used to indicate the encoding format of the data to be transmitted sent to the target device through the router; and to receive a configuration success notification sent by the target device and forward it to the source device.
[0126] In some embodiments, the data to be transmitted includes an audio stream; the forwarding unit is specifically configured to, upon receiving an audio stream sent by the source device, send an audio transmission start request to the target device; upon receiving an audio transmission start ready response sent by the target device, send the audio stream to the target device, causing the target device to stop receiving the audio stream sent by the source device and start receiving the audio stream sent by the router upon receiving the audio stream sent by the router; and send a disconnect command to the source device, causing the source device to disconnect its Bluetooth connection with the target device.
[0127] In some embodiments, the data to be transmitted includes a text stream; the forwarding unit is further configured to send a request for the number of the current frame in the text stream to the target device before receiving the data to be transmitted sent by the source device, and receive a response for the number of the current frame sent by the target device; and send a data request to the source device based on the response for the number of the current frame, so that the source device sends the current frame indicated by the number and other frames thereafter.
[0128] In some embodiments, the apparatus further includes: a disconnection notification unit, configured to send a target device disconnection notification to the source device upon receiving disconnection information sent by the target device, thereby causing the source device to stop sending data to be transmitted.
[0129] In some embodiments, the apparatus further includes: a forwarding control instruction unit, configured to, upon receiving a key operation event sent by the target device, encapsulate the key operation event according to a pre-set mapping rule to obtain a control instruction, and send the control instruction to the source device, so that the source device performs a corresponding control operation according to the instruction.
[0130] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0131] Accordingly, this disclosure provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to:
[0132] When the source device and the target device transmit data via Bluetooth, if the source device receives signal strength information sent by the router, it determines whether the signal strength information meets preset conditions. The signal strength information is sent by the router to the source device after receiving a broadcast signal from the target device, and the signal strength information is used to characterize the received signal strength for communication between the router and the target device. If the signal strength information meets the preset conditions, the source device sends a connection command to the router to establish a Bluetooth connection with the target device. The source device then sends the data to be transmitted to the router, causing the router to forward the data to be transmitted to the target device.
[0133] or;
[0134] When the router receives a broadcast signal from the target device, it sends signal strength information to the source device that has established a Bluetooth connection with the target device. The signal strength information is used to characterize the received signal strength for communication between the router and the target device. When the router receives a connection command, it establishes a Bluetooth connection with the target device. The connection command is sent to the router by the source device after determining that the signal strength information meets preset conditions. The router receives the data to be transmitted from the source device and forwards the data to be transmitted to the target device.
[0135] Figure 7 This is a schematic diagram illustrating the structure of an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 can be a user device, specifically a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, wearable device such as smartwatch, smart glasses, smart bracelet, smart running shoes, etc.
[0136] Reference Figure 7 The electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power supply component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, and a communication component 716.
[0137] Processing component 702 typically controls the overall operation of electronic device 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 702 may include one or more modules to facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.
[0138] Memory 704 is configured to store various types of data to support the operation of device 700. Examples of this data include instructions for any application or method operating on electronic device 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0139] Power supply component 706 provides power to various components of electronic device 700. Power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 700.
[0140] Multimedia component 708 includes a screen that provides an output interface between the aforementioned electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0141] Audio component 710 is configured to output and / or input audio signals. For example, audio component 710 includes a microphone (MIC) configured to receive external audio signals when electronic device 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 704 or transmitted via communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
[0142] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0143] Sensor assembly 714 includes one or more sensors for providing state assessments of various aspects of electronic device 700. For example, sensor assembly 714 can detect the on / off state of electronic device 700, the relative positioning of components such as the display and keypad of electronic device 700, changes in position of electronic device 700 or one of its components, the presence or absence of user contact with electronic device 700, orientation or acceleration / deceleration of electronic device 700, and temperature changes of electronic device 700. Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 714 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0144] Communication component 716 is configured to facilitate wired or wireless communication between electronic device 700 and other devices. Electronic device 700 can access wireless networks based on communication standards, such as WiFi, 4G or 5G, 4G LTE, 5G NR, or combinations thereof. In one exemplary embodiment, communication component 716 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the aforementioned communication component 716 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0145] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0146] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as a memory 704 including instructions, which, when executed by a processor 720 of an electronic device 700, enables the electronic device 700 to perform a Bluetooth-based data transmission method.
[0147] The non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0148] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0149] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A Bluetooth-based data transmission method, characterized in that, The method includes: When the source device and the target device transmit data via Bluetooth, if the source device receives signal strength information sent by the router, it determines whether the signal strength information meets preset conditions. The signal strength information is sent by the router to the source device when it receives a broadcast signal sent by the target device. The signal strength information is used to characterize the received signal strength of the communication between the router and the target device. If the signal strength information meets the preset conditions, a connection command is sent to the router to establish a Bluetooth connection between the router and the target device. Send the data to be transmitted to the router, so that the router forwards the data to the target device.
2. The method according to claim 1, characterized in that, The broadcast signal sent by the target device includes an account key; the method further includes: When the source device establishes a Bluetooth connection with the target device, the source device generates an account key associated with the user account, which is used to enable Bluetooth connections between devices under the user account. The source device sends the account key to the target device, so that the target device carries the account key when sending broadcast signals; The source device synchronizes the account key to all routers within the same local area network, so that each router can complete the registration of the account key.
3. The method according to claim 1, characterized in that, Before sending the data to be transmitted to the router, the method further includes: The router is sent encoding configuration information to the target device, which in turn causes the router to forward the data to be transmitted to the target device. The encoding configuration information is used to indicate the encoding format of the data to be transmitted through the router to the target device. The device receives a configuration success notification sent by the router, which is sent by the target device to the router after completing the coded configuration.
4. The method according to claim 1, characterized in that, The data to be transmitted includes an audio stream; Sending data to be transmitted to the router, causing the router to forward the data to the target device, includes: Send an audio stream to the router and the target device; Upon receiving a disconnect command from the router, the router stops sending audio streams to the target device and disconnects the Bluetooth connection with the target device. The disconnect command is sent to the source device by the router when it forwards the audio stream to the target device.
5. The method according to claim 1, characterized in that, The data to be transmitted includes a text stream; Sending data to be transmitted to the router, causing the router to forward the data to the target device, includes: Stop sending the current frame in the text stream to the target device; Upon receiving a data request from the router, the router sends the current frame and subsequent frames to the router. The data request is generated by the router in response to the current frame number sent by the target device.
6. The method according to claim 1, characterized in that, The method further includes: Upon receiving a target device disconnection notification from the router, the router stops sending data to be transmitted. The target device disconnection notification is forwarded by the router to the source device upon receiving disconnection information from the target device.
7. The method according to claim 1, characterized in that, The method further includes: Upon receiving a control command from the router, the router executes a corresponding control operation according to the instructions of the control command. The control command is obtained by the router encapsulating the key operation event according to a pre-set mapping rule when it receives a key operation event from the target device.
8. A Bluetooth-based data transmission method, characterized in that, The method includes: When the router receives a broadcast signal sent by the target device, it sends signal strength information to the source device that has established a Bluetooth connection with the target device. The signal strength information is used to characterize the received signal strength for communication between the router and the target device. Upon receiving a connection command, the router establishes a Bluetooth connection with the target device. The connection command is sent by the source device to the router after determining that the signal strength information meets preset conditions. Receive the data to be transmitted sent by the source device and forward the data to be transmitted to the target device.
9. The method according to claim 1, characterized in that, The broadcast signal sent by the target device includes an account key; receiving the broadcast signal sent by the target device includes: If the account key in the broadcast signal matches a pre-registered account key, a connection request is sent to the target device. The account key is generated and sent to the router for registration when the source device establishes a Bluetooth connection with the target device. Obtain signal strength information between the router and the target device.
10. The method according to claim 1, characterized in that, Before receiving the data to be transmitted sent by the source device, the method further includes: The router receives encoding configuration information sent by the source device and forwards it to the target device. The encoding configuration information is used to indicate the encoding format of the data to be transmitted and sent to the target device through the router. Receive the configuration success notification sent by the target device and forward it to the source device.
11. The method according to claim 1, characterized in that, The data to be transmitted includes an audio stream; The step of receiving the data to be transmitted sent by the source device and forwarding the data to be transmitted to the target device includes: Upon receiving the audio stream from the source device, a request to initiate audio transmission is sent to the target device; Upon receiving an audio transmission start-ready response from the target device, the audio stream is sent to the target device, causing the target device to stop receiving the audio stream sent by the source device and start receiving the audio stream sent by the router upon receiving the audio stream sent by the router. Send a disconnect command to the source device to disconnect the Bluetooth connection between the source device and the target device.
12. The method according to claim 1, characterized in that, The data to be transmitted includes a text stream; Before receiving the data to be transmitted sent by the source device, the method further includes: Send a request for the number of the current frame in the text stream to the target device, and receive a response from the target device regarding the number of the current frame; Based on the number of the current frame, a data request is sent to the source device, causing the source device to send the current frame indicated by the number and other subsequent frames.
13. The method according to claim 1, characterized in that, The method further includes: Upon receiving a disconnection message from the target device, a target device disconnection notification is sent to the source device, causing the source device to stop sending data to be transmitted.
14. The method according to claim 1, characterized in that, The method further includes: Upon receiving a key operation event from the target device, the key operation event is encapsulated into a control command according to a pre-set mapping rule, and the control command is sent to the source device, so that the source device performs the corresponding control operation according to the instruction of the control command.
15. A Bluetooth-based data transmission device, characterized in that, The device includes: The judgment unit is used to determine whether the signal strength information received by the source device from the router meets the preset conditions when the source device and the target device are transmitting data via Bluetooth. The signal strength information is sent by the router to the source device when it receives a broadcast signal sent by the target device. The signal strength information is used to characterize the received signal strength of the communication between the router and the target device. The transmitting unit is configured to send a connection command to the router to establish a Bluetooth connection between the router and the target device when the signal strength information meets preset conditions; and to send data to be transmitted to the router so that the router forwards the data to be transmitted to the target device.
16. A Bluetooth-based data transmission device, characterized in that, The device includes: A signal strength determination unit is used to send signal strength information to the source device that has established a Bluetooth connection with the target device when the router receives a broadcast signal sent by the target device. The signal strength information is used to characterize the received signal strength of the communication between the router and the target device. A connection unit is used to establish a Bluetooth connection with the target device when the router receives a connection command, wherein the connection command is sent by the source device to the router after determining that the signal strength information meets preset conditions; The forwarding unit is used to receive the data to be transmitted sent by the source device and forward the data to be transmitted to the target device.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the method of any one of claims 1 to 7, or the method of any one of claims 8 to 14.
18. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to perform the method according to any one of claims 1 to 7, or the method according to any one of claims 8 to 14.
19. A computer program product, comprising a computer program and instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the method of any one of claims 1 to 7, or the method of any one of claims 8 to 14.