Bluetooth device control method, apparatus, device, and storage medium
By controlling the Bluetooth device to automatically disconnect and reconnect between different terminal devices under server-side commands, the problem of Bluetooth devices being able to connect to only one terminal at a time is solved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2022-05-24
- Publication Date
- 2026-07-03
AI Technical Summary
Bluetooth devices can only connect to one terminal device at a time, which makes it cumbersome for users to switch connections and affects the user experience.
The Bluetooth device can automatically disconnect and reconnect via server-side control commands, and automatically switch between different terminal devices by using set conditions such as distance and account login status.
It improves the automation level of Bluetooth device connection switching, saves users time, and enhances the user experience.
Smart Images

Figure CN117652166B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of terminal technology, and in particular to a Bluetooth device control method, apparatus, device, and storage medium. Background Technology
[0002] With the development of terminal technology and Bluetooth technology, more and more Bluetooth devices, such as Bluetooth headsets, are appearing in people's lives. By establishing a Bluetooth connection with terminal devices such as smartphones, Bluetooth devices can serve as audio input and output devices during the use of these devices.
[0003] In related technologies, Bluetooth headsets can only connect to one device at a time. If a user's Bluetooth headset is already connected to a tablet, and the user receives a call on their phone and wants to answer it using the Bluetooth headset, they need to manually disconnect the headset from the tablet and then reconnect it to the phone. This process is cumbersome, time-consuming, and negatively impacts the user experience. Summary of the Invention
[0004] To overcome the problems existing in the related technologies, this disclosure provides a Bluetooth device control method, apparatus, device and storage medium to solve the defects in the related technologies.
[0005] According to a first aspect of the present disclosure, a Bluetooth device control method is provided, applied to a first terminal device, the method comprising:
[0006] In response to receiving a first control command sent by the server, the first connection pre-established with the Bluetooth device is disconnected. The first control command includes information sent by the server under the first set conditions. The first set conditions include receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining connection information of the Bluetooth device.
[0007] In response to detecting that the first connection has been disconnected, a first notification message indicating that the first connection has been disconnected is sent to the server, so that the server sends the connection information to the second terminal device.
[0008] In some embodiments, the first setting condition further includes detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0009] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are logged into the same account.
[0010] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are in the same local area network.
[0011] In some embodiments, the method further includes:
[0012] In response to receiving a control command for connecting to a Bluetooth device, a first connection is established with the Bluetooth device;
[0013] In response to the establishment of the first connection, the connection information of the Bluetooth device is sent to the server.
[0014] In some embodiments, the method further includes:
[0015] In response to receiving a second control command sent by the server, the first connection is re-established with the Bluetooth device. The second control command includes information sent by the server under second set conditions. The second set conditions include receiving a second notification message sent by the second terminal device to indicate that the second connection has been disconnected. The second connection is the connection established between the second terminal device and the Bluetooth device.
[0016] In some embodiments, re-establishing the first connection with the Bluetooth device in response to receiving a second control command sent by the server includes:
[0017] In response to receiving a second control command sent by the server, an inquiry message is generated to determine whether to establish a first connection with the Bluetooth device;
[0018] In response to receiving a confirmation command based on the query information, the first connection is re-established with the Bluetooth device.
[0019] According to a second aspect of the present disclosure, a Bluetooth device control method is provided, applied to a second terminal device, the method comprising:
[0020] In response to detecting that the second terminal device has second audio data to be played, a Bluetooth information acquisition request is sent to the server;
[0021] In response to receiving connection information of a Bluetooth device returned by the server based on the acquisition request, a second connection is established with the Bluetooth device based on the connection information. The connection information includes information sent by the server in response to receiving a first notification message from a first terminal device, wherein the first terminal device is a device logged into the same account as the second terminal device. The first notification message includes information sent by the first terminal device to the server in response to receiving a first control command and disconnecting the first connection established with the Bluetooth device. The first control command includes information sent by the server under a first set condition, wherein the first set condition includes receiving the Bluetooth information acquisition request.
[0022] Based on the second connection, the second audio data is sent to the Bluetooth device for playback.
[0023] In some embodiments, the first setting condition further includes detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0024] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are logged into the same account.
[0025] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are in the same local area network.
[0026] In some embodiments, the method further includes:
[0027] In response to the detection that the second audio data has finished playing, the second connection is disconnected;
[0028] In response to detecting that the second connection has been disconnected, a second notification message indicating that the second connection has been disconnected is sent to the server.
[0029] According to a third aspect of the present disclosure, a Bluetooth device control method is provided, applied to a server, the method comprising:
[0030] In response to detecting that a first set condition is currently met, a first control command is sent to the first terminal device. The first control command is used to control the first terminal device to disconnect from the first connection with the Bluetooth device. The first set condition includes receiving a Bluetooth information acquisition request sent by the second terminal device after having second audio data to be played, for obtaining connection information of the Bluetooth device.
[0031] In response to receiving a first notification message from the first terminal device, the second terminal device sends the pre-received connection information of the Bluetooth device to the second terminal device. The first notification message includes information sent by the first terminal device to the server in response to detecting that the first connection has been disconnected. The connection information includes information sent by the first terminal device to the server in response to establishing the first connection. The connection information is used for the second terminal device to establish a second connection with the Bluetooth device and to send the second audio data to the Bluetooth device for playback based on the second connection.
[0032] In some embodiments, the first setting condition further includes detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0033] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are logged into the same account.
[0034] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are in the same local area network.
[0035] In some embodiments, the method further includes:
[0036] In response to receiving a second notification message from the second terminal device indicating that the second connection has been disconnected, a second control command is sent to the first terminal device. The second control command is used to control the first terminal device to re-establish the first connection with the Bluetooth device.
[0037] According to a fourth aspect of the present disclosure, a Bluetooth device control apparatus is provided, applied to a first terminal device, the apparatus comprising:
[0038] The first connection disconnection module is used to disconnect the first connection pre-established with the Bluetooth device in response to receiving a first control command sent by the server. The first control command includes information sent by the server under the first set conditions. The first set conditions include receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining the connection information of the Bluetooth device.
[0039] The first notification sending module is configured to, in response to detecting that the first connection has been disconnected, send a first notification message to the server indicating that the first connection has been disconnected, so that the server can send the connection information to the second terminal device.
[0040] In some embodiments, the first setting condition further includes detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0041] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are logged into the same account.
[0042] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are in the same local area network.
[0043] In some embodiments, the apparatus further includes:
[0044] The first connection establishment module is configured to establish a first connection with the Bluetooth device in response to receiving a control command for connecting to the Bluetooth device.
[0045] A connection information sending module is used to send connection information of the Bluetooth device to the server in response to the establishment of the first connection.
[0046] In some embodiments, the apparatus further includes:
[0047] The first connection reconstruction module is used to re-establish the first connection with the Bluetooth device in response to receiving a second control command sent by the server. The second control command includes information sent by the server under second set conditions. The second set conditions include receiving a second notification message sent by the second terminal device to indicate that the second connection has been disconnected. The second connection is the connection established between the second terminal device and the Bluetooth device.
[0048] In some embodiments, the first connection reconstruction module includes:
[0049] The query information generation unit is configured to generate query information for determining whether to establish a first connection with the Bluetooth device in response to receiving a second control command sent by the server.
[0050] The first connection reconstruction unit is configured to re-establish the first connection with the Bluetooth device in response to receiving a confirmation instruction based on the query information.
[0051] According to a fifth aspect of the present disclosure, a Bluetooth device control apparatus is provided, applied to a second terminal device, the apparatus comprising:
[0052] The request sending module is used to send a Bluetooth information acquisition request to the server in response to detecting that the second terminal device has second audio data to be played;
[0053] The second connection establishment module is used to establish a second connection with the Bluetooth device based on the connection information of the Bluetooth device returned by the server based on the acquisition request, in response to receiving connection information of the Bluetooth device returned by the server based on the acquisition request. The connection information includes information sent by the server in response to receiving a first notification information sent by a first terminal device, wherein the first terminal device is a device logged into the same account as the second terminal device. The first notification information includes information sent by the first terminal device to the server in response to receiving a first control command and disconnecting the first connection established with the Bluetooth device. The first control command includes information sent by the server under a first set condition, wherein the first set condition includes receiving the Bluetooth information acquisition request.
[0054] The second audio transmission module is used to send the second audio data to the Bluetooth device for playback based on the second connection.
[0055] In some embodiments, the first setting condition further includes detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0056] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are logged into the same account.
[0057] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are in the same local area network.
[0058] In some embodiments, the apparatus further includes:
[0059] The second connection disconnection module is used to disconnect the second connection in response to detecting that the second audio data has finished playing.
[0060] The second notification sending module is used to send a second notification message to the server in response to detecting that the second connection has been disconnected, indicating that the second connection has been disconnected.
[0061] According to a sixth aspect of the present disclosure, a Bluetooth device control apparatus is provided, applied to a server, the apparatus comprising:
[0062] The first instruction sending module is used to send a first control instruction to the first terminal device in response to detecting that a first set condition is met. The first control instruction is used to control the first terminal device to disconnect from the first connection with the Bluetooth device. The first set condition includes receiving a Bluetooth information acquisition request sent by the second terminal device after having second audio data to be played, for obtaining connection information of the Bluetooth device.
[0063] A connection information sending module is configured to, in response to receiving a first notification message from the first terminal device, send the pre-received connection information of the Bluetooth device to the second terminal device. The first notification message includes information sent by the first terminal device to the server in response to detecting that the first connection has been disconnected. The connection information includes information sent by the first terminal device to the server in response to establishing the first connection. The connection information is used for the second terminal device to establish a second connection with the Bluetooth device and, based on the second connection, send the second audio data to the Bluetooth device for playback.
[0064] In some embodiments, the first setting condition further includes detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0065] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are logged into the same account.
[0066] In some embodiments, the first setting condition further includes detecting that the first terminal device and the second terminal device are in the same local area network.
[0067] In some embodiments, the apparatus further includes:
[0068] The second instruction sending module is configured to, in response to receiving a second notification message from the second terminal device indicating that the second connection has been disconnected, send a second control instruction to the first terminal device, wherein the second control instruction is configured to control the first terminal device to re-establish the first connection with the Bluetooth device.
[0069] According to a seventh aspect of the present disclosure, a terminal device is provided, the device comprising:
[0070] Processor and memory used to store computer programs;
[0071] The processor is configured to, when executing the computer program, implement:
[0072] In response to receiving a first control command sent by the server, the first connection pre-established with the Bluetooth device is disconnected. The first control command includes information sent by the server under the first set conditions. The first set conditions include receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining connection information of the Bluetooth device.
[0073] In response to detecting that the first connection has been disconnected, a first notification message indicating that the first connection has been disconnected is sent to the server, so that the server sends the connection information to the second terminal device.
[0074] According to an eighth aspect of the present disclosure, a terminal device is provided, the device comprising:
[0075] Processor and memory used to store computer programs;
[0076] The processor is configured to, when executing the computer program, implement:
[0077] In response to the detection that the current terminal device has second audio data to be played, a Bluetooth information acquisition request is sent to the server;
[0078] In response to receiving connection information of a Bluetooth device returned by the server based on the acquisition request, a second connection is established with the Bluetooth device based on the connection information. The connection information includes information sent by the server in response to receiving a first notification information sent by a first terminal device. The first notification information includes information sent by the first terminal device to the server in response to receiving a first control command and disconnecting the first connection established with the Bluetooth device. The first control command includes information sent by the server under a first set condition. The first set condition includes receiving the Bluetooth information acquisition request.
[0079] Based on the second connection, the second audio data is sent to the Bluetooth device for playback.
[0080] According to a ninth aspect of the present disclosure, a server is provided, the server comprising:
[0081] Processor and memory used to store computer programs;
[0082] The processor is configured to, when executing the computer program, implement:
[0083] In response to detecting that a first set condition is currently met, a first control command is sent to the first terminal device. The first control command is used to control the first terminal device to disconnect from the first connection with the Bluetooth device. The first set condition includes receiving a Bluetooth information acquisition request sent by the second terminal device after having second audio data to be played, for obtaining connection information of the Bluetooth device.
[0084] In response to receiving a first notification message from the first terminal device, the second terminal device sends the pre-received connection information of the Bluetooth device to the second terminal device. The first notification message includes information sent by the first terminal device to the server in response to detecting that the first connection has been disconnected. The connection information includes information sent by the first terminal device to the server in response to establishing the first connection. The connection information is used for the second terminal device to establish a second connection with the Bluetooth device and to send the second audio data to the Bluetooth device for playback based on the second connection.
[0085] According to a tenth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the Bluetooth device control method described in any of the preceding claims.
[0086] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0087] This disclosure avoids the need for users to manually switch Bluetooth devices from connecting to a first terminal device to connecting to a second terminal device, thereby improving the automation level of Bluetooth device connection switching, saving users time, and ultimately enhancing the user experience.
[0088] 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
[0089] 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.
[0090] Figure 1 This is a flowchart illustrating a Bluetooth device control method according to an exemplary embodiment of the present disclosure;
[0091] Figure 2 This is a flowchart illustrating how to send the connection information of the Bluetooth device to the server according to an exemplary embodiment of the present disclosure;
[0092] Figure 3 This is a flowchart illustrating a Bluetooth device control method according to yet another exemplary embodiment of the present disclosure;
[0093] Figure 4 This is a flowchart illustrating how to re-establish the first connection with the Bluetooth device according to an exemplary embodiment of this disclosure;
[0094] Figure 5 This is a flowchart illustrating a Bluetooth device control method according to an exemplary embodiment of the present disclosure;
[0095] Figure 6 This is a flowchart illustrating a Bluetooth device control method according to yet another exemplary embodiment of the present disclosure;
[0096] Figure 7 This is a flowchart illustrating a Bluetooth device control method according to an exemplary embodiment of the present disclosure;
[0097] Figure 8 This is a flowchart illustrating a Bluetooth device control method according to yet another exemplary embodiment of the present disclosure;
[0098] Figure 9 This is a block diagram illustrating a Bluetooth device control apparatus according to an exemplary embodiment of the present disclosure;
[0099] Figure 10 This is a block diagram illustrating yet another Bluetooth device control device according to an exemplary embodiment of the present disclosure;
[0100] Figure 11 This is a block diagram illustrating a Bluetooth device control apparatus according to an exemplary embodiment of the present disclosure;
[0101] Figure 12 This is a block diagram illustrating yet another Bluetooth device control device according to an exemplary embodiment of the present disclosure;
[0102] Figure 13 This is a block diagram illustrating a Bluetooth device control apparatus according to an exemplary embodiment of the present disclosure;
[0103] Figure 14 This is a block diagram illustrating yet another Bluetooth device control device according to an exemplary embodiment of the present disclosure;
[0104] Figure 15 This is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0105] 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.
[0106] Figure 1This is a flowchart illustrating a Bluetooth device control method according to an exemplary embodiment of the present disclosure; the method of this embodiment can be applied to a first terminal device with data processing capabilities (e.g., smartphone, tablet computer, smart speaker, and desktop computer). Figure 1 As shown, the method includes the following steps S101-S102:
[0107] In step S101, in response to receiving a first control command sent by the server, the first connection pre-established with the Bluetooth device is disconnected;
[0108] In step S102, in response to detecting that the first connection has been disconnected, a first notification message indicating that the first connection has been disconnected is sent to the server, so that the server sends the connection information to the second terminal device.
[0109] In this embodiment, the first terminal device can disconnect the first connection pre-established with the Bluetooth device in response to receiving a first control command sent by the server. The first control command includes information sent by the server under the first set conditions. The first set conditions include receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining connection information of the Bluetooth device. Furthermore, the first terminal device can send a first notification message to the server in response to detecting that the first connection has been disconnected, so that the server can send the connection information to the second terminal device.
[0110] For example, when a second terminal device detects that it has second audio data to be played, it can send a Bluetooth information acquisition request to the server.
[0111] Furthermore, when the server detects that the first set condition is met, it can send a first control command to the first terminal device to control the first terminal device to disconnect the first connection with the Bluetooth device. The first set condition includes receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining the connection information of the Bluetooth device.
[0112] When the first terminal device detects that it has disconnected the first connection, it can send a first notification message to the server to indicate that the first connection has been disconnected.
[0113] Subsequently, in response to receiving the first notification information, the server can send the pre-received connection information of the Bluetooth device to the second terminal device, so that the second terminal device can establish a second connection with the Bluetooth device based on the connection information, and send the second audio data to the Bluetooth device for playback based on the second connection.
[0114] For example, the connection information of the Bluetooth device may include the device information of the Bluetooth device, such as at least one of the device type, device name, Bluetooth address, and Bluetooth signal strength.
[0115] In some embodiments, the first setting condition may further include detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0116] In other embodiments, the first set condition may also include detecting that the first terminal device and the second terminal device are logged into the same account.
[0117] In other embodiments, the first setting condition may also include detecting that the first terminal device and the second terminal device are on the same local area network.
[0118] As described above, the method of this embodiment disconnects the first connection pre-established with the Bluetooth device in response to receiving a first control command sent by the server, and sends a first notification message to the server indicating that the first connection has been disconnected in response to detecting that the first connection has been disconnected. This enables the server to subsequently send the connection information of the Bluetooth device that was pre-received to the second terminal device based on the first notification message, thereby enabling the second terminal device to establish a second connection with the Bluetooth device and send the second audio data to the Bluetooth device for playback based on the second connection. This improves the automation level of Bluetooth device connection switching, saves user time, and enhances the user experience.
[0119] Figure 2 This is a flowchart illustrating how to send connection information of the Bluetooth device to the server according to an exemplary embodiment of this disclosure; this embodiment is based on the above... Figure 1 Based on the illustrated embodiment, the method further includes sending the connection information of the Bluetooth device to the server based on the following steps S201-S202:
[0120] In step S201, in response to receiving a control command for connecting to a Bluetooth device, a first connection is established with the Bluetooth device;
[0121] In step S202, in response to the establishment of the first connection, the connection information of the Bluetooth device is sent to the server.
[0122] In this embodiment, the first terminal device can establish a first connection with the Bluetooth device in response to receiving a control command for connecting to the Bluetooth device, and then send the connection information of the Bluetooth device to the server in response to the establishment of the first connection. For example, the connection information of the Bluetooth device may include device information of the Bluetooth device, such as at least one of the device type, device name, Bluetooth address, and Bluetooth signal strength. It is understood that after the first connection is established, the first terminal device can send its currently playing first audio data to the Bluetooth device for playback based on the first connection.
[0123] As described above, the method of this embodiment establishes a first connection with the Bluetooth device in response to receiving a control command for connecting to the Bluetooth device, and sends the connection information of the Bluetooth device to the server in response to the establishment of the first connection. This enables the server to send the connection information of the Bluetooth device to the second terminal device when it receives a first notification message from the first terminal device, so that the second terminal device can establish a second connection with the Bluetooth device and send the second audio data to the Bluetooth device for playback based on the second connection. This avoids the user having to manually switch the Bluetooth device from being connected to the first terminal device to being connected to the second terminal device, thus improving the automation level of Bluetooth device connection switching, saving user time, and improving the user experience.
[0124] Figure 3 This is a flowchart illustrating a Bluetooth device control method according to yet another exemplary embodiment of this disclosure; the method of this embodiment can be applied to a first terminal device with data processing capabilities (e.g., smartphone, tablet computer, smart speaker, and desktop computer). Figure 3 As shown, the method includes the following steps S301-S303:
[0125] In step S301, in response to receiving a first control command sent by the server, the first connection pre-established with the Bluetooth device is disconnected;
[0126] In step S302, in response to detecting that the first connection has been disconnected, a first notification message indicating that the first connection has been disconnected is sent to the server, so that the server sends the connection information to the second terminal device;
[0127] The explanations and descriptions of steps S301-S302 can be found above. Figure 1 Steps S101-S102 in the illustrated embodiment will not be described in detail here.
[0128] In step S303, in response to receiving the second control command sent by the server, the first connection is re-established with the Bluetooth device.
[0129] The second control command includes information sent by the server under second set conditions. The second set conditions include receiving a second notification message sent by the second terminal device to indicate that the second connection has been disconnected. The second connection is the connection established between the second terminal device and the Bluetooth device.
[0130] For example, when the server determines that the first set condition is met, it can send a first control command to the first terminal device to control the first terminal device to disconnect the first connection with the Bluetooth device.
[0131] When the first terminal device detects that it has disconnected the first connection, it can send a first notification message to the server to indicate that the first connection has been disconnected.
[0132] Furthermore, in response to receiving the first notification information, the server can send the pre-received connection information of the Bluetooth device to the second terminal device, so that the second terminal device can establish a second connection with the Bluetooth device based on the connection information, and send the second audio data to the Bluetooth device for playback based on the second connection;
[0133] Furthermore, when the second terminal device detects that the second audio data has finished playing, it can disconnect the second connection, and when it detects that it has disconnected the second connection, it can send a second notification message to the server to indicate that the second connection has been disconnected.
[0134] Based on this, when the server receives the second notification information, it can send a second control command to the first terminal device.
[0135] When the first terminal device receives the second control command, it can re-establish the first connection with the Bluetooth device. That is, when the second terminal device disconnects the second connection, the first connection between the first terminal device and the Bluetooth device can be automatically restored without the user having to manually switch the Bluetooth device from being connected to the second terminal device to being connected to the first terminal device.
[0136] Figure 4 This is a flowchart illustrating how to re-establish the first connection with the Bluetooth device according to an exemplary embodiment of this disclosure; this embodiment is an illustrative example of how to re-establish the first connection with the Bluetooth device, based on the above embodiment. Figure 4As shown, the step S303 above, which involves re-establishing the first connection with the Bluetooth device in response to receiving the second control command sent by the server, may include the following steps S401-S402:
[0137] In step S401, in response to receiving the second control command sent by the server, query information is generated to determine whether to establish a first connection with the Bluetooth device;
[0138] In step S402, in response to receiving a confirmation command based on the query information, the first connection is re-established with the Bluetooth device.
[0139] In this embodiment, after the first terminal device receives the second control command, it can generate an inquiry message to determine whether to establish a first connection with the Bluetooth device, and then, in response to receiving a confirmation command based on the inquiry message, it can re-establish the first connection with the Bluetooth device.
[0140] It is worth noting that the form of the above-mentioned inquiry information can be set according to actual business needs, such as setting it as an inquiry information in the form of a pop-up window. This embodiment does not limit this.
[0141] For example, after the first terminal device generates an inquiry message to determine whether to establish a first connection with the Bluetooth device, if it receives a confirmation command input by the user based on the inquiry message (i.e., a command to confirm the re-establishment of the first connection), it can re-establish the first connection with the Bluetooth device. In this way, the first connection between the first terminal device and the Bluetooth device can be automatically restored without the user needing to manually switch the Bluetooth device from being connected to the second terminal device to being connected to the first terminal device.
[0142] Figure 5 This is a flowchart illustrating a Bluetooth device control method according to an exemplary embodiment of the present disclosure; the method of this embodiment can be applied to a second terminal device with data processing capabilities (e.g., smartphone, tablet computer, smart speaker, and desktop computer). Figure 5 As shown, the method includes the following steps S501-S503:
[0143] In step S501, in response to detecting that the second terminal device has second audio data to be played, a Bluetooth information acquisition request is sent to the server;
[0144] In step S502, in response to receiving the connection information of the Bluetooth device returned by the server based on the acquisition request, a second connection is established with the Bluetooth device based on the connection information;
[0145] In step S503, based on the second connection, the second audio data is sent to the Bluetooth device for playback.
[0146] In this embodiment, the second terminal device can send a Bluetooth information acquisition request to the server in response to detecting that it has second audio data to be played. Then, when it receives connection information of the Bluetooth device returned by the server based on the acquisition request, it can establish a second connection with the Bluetooth device based on the connection information. The connection information includes information sent by the server in response to receiving a first notification from the first terminal device, where the first terminal device is a device logged into the same account as the second terminal device. The first notification includes information sent by the first terminal device to the server in response to receiving a first control command and disconnecting the first connection established with the Bluetooth device. The first control command includes information sent by the server under first set conditions, where the first set conditions include receiving the Bluetooth information acquisition request. Based on this, the second terminal device can send the second audio data to the Bluetooth device for playback based on the second connection.
[0147] For example, when the first terminal device receives a control command for connecting to a Bluetooth device, it can establish a first connection with the Bluetooth device, and then, in response to the establishment of the first connection, send the connection information of the Bluetooth device to the server.
[0148] Based on this, when the second terminal device detects that it has second audio data to be played, it can send a Bluetooth information acquisition request to the server.
[0149] Furthermore, when the server determines that the first set condition is met, it can send a first control command to the first terminal device to control the first terminal device to disconnect the first connection with the Bluetooth device.
[0150] When the first terminal device detects that it has disconnected the first connection, it can send a first notification message to the server to indicate that the first connection has been disconnected.
[0151] Furthermore, in response to receiving the first notification information, the server can send the previously received connection information of the Bluetooth device to the second terminal device;
[0152] After receiving the connection information, the second terminal device can establish a second connection with the Bluetooth device based on the connection information, and send the second audio data to the Bluetooth device for playback based on the second connection.
[0153] For example, the connection information of the Bluetooth device may include the device information of the Bluetooth device, such as at least one of the device type, device name, Bluetooth address, and Bluetooth signal strength.
[0154] In some embodiments, the first setting condition may further include detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0155] In other embodiments, the first set condition may also include detecting that the first terminal device and the second terminal device are logged into the same account.
[0156] In other embodiments, the first setting condition may also include detecting that the first terminal device and the second terminal device are on the same local area network.
[0157] In some embodiments, when the second terminal device sends a Bluetooth information acquisition request to the server, it may also send at least one of the following to the server: the current location information of the second terminal device, the current login account, and the current local area network information (e.g., IP address and subnet mask), so that the server can determine whether the first set condition is met based on the information and the device-related information of the first terminal device.
[0158] As described above, the method of this embodiment, in response to detecting that the second terminal device has second audio data to be played, sends a Bluetooth information acquisition request to the server, and in response to receiving the Bluetooth device connection information returned by the server based on the acquisition request, establishes a second connection with the Bluetooth device based on the connection information, and then sends the second audio data to the Bluetooth device for playback based on the second connection. This avoids the user manually switching the Bluetooth device from being connected to the first terminal device to being connected to the second terminal device, thereby improving the automation level of Bluetooth device connection switching, saving user time, and thus improving the user experience.
[0159] Figure 6 This is a flowchart illustrating a Bluetooth device control method according to yet another exemplary embodiment of this disclosure; the method of this embodiment can be applied to a second terminal device with data processing capabilities (e.g., smartphone, tablet, smart speaker, and desktop computer). Figure 6 As shown, the method includes the following steps S601-S605:
[0160] In step S601, in response to detecting that the second terminal device has second audio data to be played, a Bluetooth information acquisition request is sent to the server;
[0161] In step S602, in response to receiving the connection information of the Bluetooth device returned by the server based on the acquisition request, a second connection is established with the Bluetooth device based on the connection information;
[0162] In step S603, based on the second connection, the second audio data is sent to the Bluetooth device for playback.
[0163] The relevant explanations and descriptions of steps S601-S603 can be found above. Figure 5 Steps S501-S503 in the illustrated embodiment will not be described in detail here.
[0164] In step S604, in response to detecting that the second audio data has finished playing, the second connection is disconnected;
[0165] In step S605, in response to detecting that the second connection has been disconnected, a second notification message indicating that the second connection has been disconnected is sent to the server.
[0166] For example, when a second terminal device establishes a second connection with the Bluetooth device based on the connection information sent by the server, and sends the second audio data to the Bluetooth device for playback based on the second connection, it can disconnect the second connection if it detects that the second audio data has finished playing. Then, upon detecting that it has disconnected the second connection, it can send a second notification message to the server indicating that the second connection has been disconnected. Based on this, when the server receives the second notification message, it can send a second control command to the first terminal device to control the first terminal device to re-establish the first connection with the Bluetooth device. That is, when the second terminal device disconnects the second connection, the first connection between the first terminal device and the Bluetooth device can be automatically restored without the user manually switching the Bluetooth device from being connected to the second terminal device to being connected to the first terminal device.
[0167] Figure 7 This is a flowchart illustrating a Bluetooth device control method according to an exemplary embodiment. The method of this embodiment can be applied to servers such as local servers and cloud servers with data processing functions. The server can be deployed in a device cluster consisting of one electronic device or multiple electronic devices.
[0168] like Figure 7 As shown, the method includes the following steps S701-S702:
[0169] In step S701, in response to detecting that the first set condition is currently met, a first control command is sent to the first terminal device;
[0170] In step S702, in response to receiving the first notification information sent by the first terminal device, the connection information of the Bluetooth device that was received in advance is sent to the second terminal device.
[0171] In this embodiment, the server can send a first control command to the first terminal device in response to detecting that a first set condition is met. The first control command controls the first terminal device to disconnect from the first connection with the Bluetooth device. The first set condition includes receiving a Bluetooth information acquisition request from the second terminal device after it has second audio data to be played, requesting the acquisition of connection information for the Bluetooth device. Furthermore, the server can send the pre-received connection information of the Bluetooth device to the second terminal device in response to receiving a first notification from the first terminal device. The first notification includes information sent by the first terminal device to the server in response to detecting that the first connection has been disconnected. The connection information includes information sent by the first terminal device to the server in response to establishing the first connection. The connection information is used for the second terminal device to establish a second connection with the Bluetooth device and, based on the second connection, send the second audio data to the Bluetooth device for playback.
[0172] For example, when the first terminal device receives a control command for connecting to a Bluetooth device, it can establish a first connection with the Bluetooth device, and then, in response to the establishment of the first connection, send the connection information of the Bluetooth device to the server.
[0173] Based on this, when the second terminal device detects that it has second audio data to be played, it can send a Bluetooth information acquisition request to the server.
[0174] Furthermore, when the server detects that the first set condition is met, it can send a first control command to the first terminal device to control the first terminal device to disconnect the first connection with the Bluetooth device. The first set condition includes receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining the connection information of the Bluetooth device.
[0175] When the first terminal device detects that it has disconnected the first connection, it can send a first notification message to the server to indicate that the first connection has been disconnected.
[0176] Subsequently, in response to receiving the first notification information, the server can send the pre-received connection information of the Bluetooth device to the second terminal device, so that the second terminal device can establish a second connection with the Bluetooth device based on the connection information, and send the second audio data to the Bluetooth device for playback based on the second connection.
[0177] For example, the connection information of the Bluetooth device may include the device information of the Bluetooth device, such as at least one of the device type, device name, Bluetooth address, and Bluetooth signal strength.
[0178] In some embodiments, the first setting condition may further include detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0179] In other embodiments, the first set condition may also include detecting that the first terminal device and the second terminal device are logged into the same account.
[0180] In other embodiments, the first setting condition may also include detecting that the first terminal device and the second terminal device are on the same local area network.
[0181] For example, when the server receives a Bluetooth information acquisition request sent by the second terminal device, it can obtain the device-related information of the second terminal device (e.g., at least one of the current location information, current login account, and current local area network information of the second terminal device) from the acquisition request, and detect the device-related information of the first terminal device (e.g., at least one of the current location information, current login account, and current local area network information of the first terminal device), and then compare the device-related information of the first terminal device and the second terminal device. Therefore, when at least one of the following (1) to (3) is detected, it can be determined that the first set condition is met:
[0182] (1) The distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; (2) The first terminal device and the second terminal device are logged into the same account; (3) The first terminal device and the second terminal device are in the same local area network.
[0183] It is understood that the method for determining the distance between the second terminal device and the first terminal device described above can refer to any distance determination method in related technologies, such as obtaining the distance between the second terminal device and the first terminal device based on the Global Positioning System (GPS) or a local area network. The results obtained are all applicable to this embodiment.
[0184] As described above, the method of this embodiment, in response to detecting that a first set condition is met, sends a first control command to the first terminal device, and then, in response to receiving a first notification message from the first terminal device, sends the pre-received connection information of the Bluetooth device to the second terminal device, so that the second terminal device can establish a second connection with the Bluetooth device, and send the second audio data to the Bluetooth device for playback based on the second connection. This can achieve the following: when the second terminal device detects that there is second audio data to be played, it controls the first terminal device to disconnect from the first connection with the Bluetooth device, so that the second terminal device can establish a second connection with the Bluetooth device and send the second audio data to the Bluetooth device for playback based on the second connection. This can avoid the user manually switching the Bluetooth device from being connected to the first terminal device to being connected to the second terminal device, thereby improving the automation level of Bluetooth device connection switching, saving user time, and thus improving the user experience.
[0185] Figure 8 This is a flowchart illustrating a Bluetooth device control method according to another exemplary embodiment of the present disclosure; the method of this embodiment can be applied to servers such as local servers and cloud servers with data processing functions, and the server can be deployed in a device cluster consisting of one electronic device or multiple electronic devices.
[0186] like Figure 8 As shown, the method includes the following steps S801-S803:
[0187] In step S801, in response to detecting that the first set condition is currently met, a first control command is sent to the first terminal device;
[0188] In step S802, in response to receiving the first notification information sent by the first terminal device, the connection information of the Bluetooth device that was received in advance is sent to the second terminal device.
[0189] The explanations and descriptions of steps S801-S802 can be found above. Figure 7 Steps S701-S702 in the illustrated embodiment will not be described in detail here.
[0190] In step S803, in response to receiving a second notification message from the second terminal device indicating that the second connection has been disconnected, a second control command is sent to the first terminal device.
[0191] The second control command is used to control the first terminal device to re-establish the first connection with the Bluetooth device.
[0192] For example, when a second terminal device establishes a second connection with the Bluetooth device based on the connection information sent by the server, and sends the second audio data to the Bluetooth device for playback based on the second connection, it can disconnect the second connection if it detects that the second audio data has finished playing. Furthermore, upon detecting that it has disconnected the second connection, it can send a second notification message to the server indicating that the second connection has been disconnected. Based on this, when the server receives the second notification message, it can send a second control command to the first terminal device to control the first terminal device to re-establish the first connection with the Bluetooth device. That is, when the second terminal device disconnects the second connection, the first connection between the first terminal device and the Bluetooth device can be automatically restored without the user needing to manually switch the Bluetooth device from being connected to the second terminal device to being connected to the first terminal device.
[0193] Figure 9 This is a block diagram illustrating a Bluetooth device control apparatus according to an exemplary embodiment of the present disclosure; the apparatus of this embodiment can be applied to a first terminal device with data processing capabilities (e.g., smartphone, tablet computer, smart speaker, and desktop computer). Figure 9 As shown, the device includes: a first connection disconnection module 110 and a first notification sending module 120, wherein:
[0194] The first connection disconnection module 110 is used to disconnect the first connection pre-established with the Bluetooth device in response to receiving a first control command sent by the server. The first control command includes information sent by the server under the first set conditions. The first set conditions include receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining the connection information of the Bluetooth device.
[0195] The first notification sending module 120 is configured to send a first notification message indicating that the first connection has been disconnected to the server in response to detecting that the first connection has been disconnected, so that the server can send the connection information to the second terminal device.
[0196] In some embodiments, the first setting condition may further include detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0197] In other embodiments, the first set condition may also include detecting that the first terminal device and the second terminal device are logged into the same account.
[0198] In other embodiments, the first setting condition may also include detecting that the first terminal device and the second terminal device are on the same local area network.
[0199] As described above, the device in this embodiment, in response to receiving a first control command sent by the server, disconnects the first connection pre-established with the Bluetooth device, and in response to detecting that the first connection has been disconnected, sends a first notification message to the server indicating that the first connection has been disconnected. This enables the server to subsequently send the connection information of the Bluetooth device received in advance to the second terminal device based on the first notification message. Consequently, the second terminal device can establish a second connection with the Bluetooth device and send the second audio data to the Bluetooth device for playback based on the second connection. This improves the automation level of Bluetooth device connection switching, saves user time, and enhances the user experience.
[0200] Figure 10 This is a block diagram illustrating another Bluetooth device control device according to an exemplary embodiment of the present disclosure; the device of this embodiment can be applied to a first terminal device with data processing capabilities (e.g., smartphone, tablet computer, smart speaker, and desktop computer). The first connection disconnection module 210 and the first notification sending module 220 are as described above. Figure 9 The first connection disconnection module 110 and the first notification sending module 120 in the illustrated embodiment have the same function, which will not be described in detail here.
[0201] like Figure 10 As shown, the above-mentioned device may further include:
[0202] The first connection establishment module 230 is configured to establish a first connection with the Bluetooth device in response to receiving a control command for connecting to the Bluetooth device.
[0203] The connection information sending module 240 is used to send the connection information of the Bluetooth device to the server in response to the establishment of the first connection.
[0204] In some embodiments, the above-described apparatus may further include:
[0205] The first connection reconstruction module 250 is configured to re-establish the first connection with the Bluetooth device in response to receiving a second control command sent by the server. The second control command includes information sent by the server under second set conditions. The second set conditions include receiving a second notification message sent by the second terminal device indicating that the second connection has been disconnected. The second connection is the connection established between the second terminal device and the Bluetooth device.
[0206] In some embodiments, the first connection reconstruction module 250 may include:
[0207] The query information generation unit 251 is configured to generate query information for determining whether to establish a first connection with the Bluetooth device in response to receiving a second control command sent by the server.
[0208] The first connection reconstruction unit 252 is configured to re-establish the first connection with the Bluetooth device in response to receiving a confirmation instruction based on the query information.
[0209] Figure 11 This is a block diagram illustrating a Bluetooth device control apparatus according to an exemplary embodiment of the present disclosure; the apparatus of this embodiment can be applied to a second terminal device with data processing capabilities (e.g., a smartphone, tablet computer, smart speaker, and desktop computer). Figure 11 As shown, the device includes: an acquisition request sending module 310, a second connection establishment module 320, and a second audio sending module 330, wherein:
[0210] The request sending module 310 is used to send a Bluetooth information acquisition request to the server in response to detecting that the second terminal device has second audio data to be played.
[0211] The second connection establishment module 320 is configured to establish a second connection with the Bluetooth device based on the connection information returned by the server based on the acquisition request, in response to receiving connection information of the Bluetooth device returned by the server based on the acquisition request. The connection information includes information sent by the server in response to receiving a first notification message sent by a first terminal device, wherein the first terminal device is a device logged into the same account as the second terminal device. The first notification message includes information sent by the first terminal device to the server in response to receiving a first control command and disconnecting the first connection established with the Bluetooth device. The first control command includes information sent by the server under a first set condition, wherein the first set condition includes receiving the Bluetooth information acquisition request.
[0212] The second audio transmission module 330 is used to send the second audio data to the Bluetooth device for playback based on the second connection.
[0213] In some embodiments, the first setting condition may further include detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0214] In other embodiments, the first set condition may also include detecting that the first terminal device and the second terminal device are logged into the same account.
[0215] In other embodiments, the first setting condition may also include detecting that the first terminal device and the second terminal device are on the same local area network.
[0216] As described above, the device in this embodiment, in response to detecting that the second terminal device has second audio data to be played, sends a Bluetooth information acquisition request to the server, and in response to receiving the Bluetooth device connection information returned by the server based on the acquisition request, establishes a second connection with the Bluetooth device based on the connection information, and then sends the second audio data to the Bluetooth device for playback based on the second connection. This avoids the user manually switching the Bluetooth device from being connected to the first terminal device to being connected to the second terminal device, thereby improving the automation level of Bluetooth device connection switching, saving user time, and thus improving the user experience.
[0217] Figure 12 This is a block diagram illustrating another Bluetooth device control device according to an exemplary embodiment of the present disclosure; the device of this embodiment can be applied to a second terminal device with data processing capabilities (such as a smartphone, tablet computer, smart speaker, and desktop computer). The acquisition request sending module 410, the second connection establishment module 420, and the second audio sending module 430 are as described above. Figure 11 The functions of the acquisition request sending module 310, the second connection establishment module 320, and the second audio sending module 330 in the illustrated embodiment are the same, and will not be described in detail here.
[0218] like Figure 12 As shown, the above-mentioned device may further include:
[0219] The second connection disconnection module 440 is used to disconnect the second connection in response to detecting that the second audio data has finished playing.
[0220] The second notification sending module 450 is configured to send a second notification message to the server indicating that the second connection has been disconnected in response to detecting that the second connection has been disconnected.
[0221] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0222] Figure 13 This is a block diagram illustrating a Bluetooth device control apparatus according to an exemplary embodiment of the present disclosure; the apparatus of this embodiment can be applied to servers such as local servers and cloud servers with data processing capabilities, and the server can be deployed in a device cluster consisting of one electronic device or multiple electronic devices. Figure 10 As shown, the device includes: a first instruction sending module 510 and a connection information sending module 520, wherein:
[0223] The first instruction sending module 510 is used to send a first control instruction to the first terminal device in response to detecting that the first set condition is met. The first control instruction is used to control the first terminal device to disconnect the first connection with the Bluetooth device. The first set condition includes receiving a Bluetooth information acquisition request sent by the second terminal device after having second audio data to be played, for obtaining the connection information of the Bluetooth device.
[0224] The connection information sending module 520 is configured to, in response to receiving a first notification message sent by the first terminal device, send the connection information of the Bluetooth device that was previously received to the second terminal device. The first notification message includes information sent by the first terminal device to the server in response to detecting that the first connection has been disconnected. The connection information includes information sent by the first terminal device to the server in response to establishing the first connection. The connection information is used for the second terminal device to establish a second connection with the Bluetooth device and to send the second audio data to the Bluetooth device for playback based on the second connection.
[0225] In some embodiments, the first setting condition may further include detecting that the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold.
[0226] In other embodiments, the first set condition may also include detecting that the first terminal device and the second terminal device are logged into the same account.
[0227] In other embodiments, the first setting condition may also include detecting that the first terminal device and the second terminal device are on the same local area network.
[0228] As described above, the device in this embodiment, in response to detecting that a first set condition is met, sends a first control command to the first terminal device, and then, in response to receiving a first notification message from the first terminal device, sends the pre-received connection information of the Bluetooth device to the second terminal device. This allows the second terminal device to establish a second connection with the Bluetooth device and, based on the second connection, send the second audio data to the Bluetooth device for playback. This enables the second terminal device to disconnect from the first connection with the Bluetooth device when it detects second audio data to be played, allowing the second terminal device to establish a second connection and send the second audio data to the Bluetooth device for playback. This avoids the user manually switching the Bluetooth device from the first terminal device to the second terminal device, thereby improving the automation level of Bluetooth device connection switching, saving user time, and ultimately enhancing the user experience.
[0229] Figure 14 This is a block diagram illustrating another Bluetooth device control device according to an exemplary embodiment of the present disclosure. The device of this embodiment can be applied to servers such as local servers and cloud servers with data processing capabilities. These servers can be deployed in a single electronic device or a cluster of multiple electronic devices. The first instruction sending module 610 and the connection information sending module 620 are as described above. Figure 10 The first instruction sending module 510 and the connection information sending module 520 in the illustrated embodiment have the same function, and will not be described in detail here.
[0230] like Figure 14 As shown, the above-mentioned device may further include:
[0231] The second instruction sending module 630 is configured to send a second control instruction to the first terminal device in response to receiving a second notification message from the second terminal device indicating that the second connection has been disconnected. The second control instruction is configured to control the first terminal device to re-establish the first connection with the Bluetooth device.
[0232] Figure 15 This is a block diagram illustrating an electronic device according to an exemplary embodiment. The electronic device can be a terminal device, or a server such as a local server or a cloud server. The server can be deployed in a device cluster consisting of one or more electronic devices. For example, device 900 can be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc.
[0233] Reference Figure 15 The device 900 may include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, an input / output (I / O) interface 912, a sensor component 914, and a communication component 916.
[0234] Processing component 902 typically controls the overall operation of device 900, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 902 may include one or more processors 920 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 902 may include one or more modules to facilitate interaction between processing component 902 and other components. For example, processing component 902 may include a multimedia module to facilitate interaction between multimedia component 908 and processing component 902.
[0235] Memory 904 is configured to store various types of data to support the operation of device 900. Examples of this data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, etc. Memory 904 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.
[0236] Power supply component 906 provides power to various components of device 900. Power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 900.
[0237] Multimedia component 908 includes a screen that provides an output interface between the device 900 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 the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 908 includes a front-facing camera and / or a rear-facing camera. When the device 900 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.
[0238] Audio component 910 is configured to output and / or input audio signals. For example, audio component 910 includes a microphone (MIC) configured to receive external audio signals when device 900 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 904 or transmitted via communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
[0239] I / O interface 912 provides an interface between processing component 902 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.
[0240] Sensor assembly 914 includes one or more sensors for providing status assessments of various aspects of device 900. For example, sensor assembly 914 may detect the on / off state of device 900, the relative positioning of components such as the display and keypad of device 900, changes in the position of device 900 or a component of device 900, the presence or absence of user contact with device 900, the orientation or acceleration / deceleration of device 900, and temperature changes of device 900. Sensor assembly 914 may also include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 914 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0241] Communication component 916 is configured to facilitate wired or wireless communication between device 900 and other devices. Device 900 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G or 5G, or combinations thereof. In one exemplary embodiment, communication component 916 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 916 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.
[0242] In an exemplary embodiment, device 900 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.
[0243] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, which can be executed by a processor 920 of device 900 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0244] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure 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.
[0245] 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 device control method, characterized by, Applied to a first terminal device, the method includes: In response to receiving a first control command from the server, the server disconnects the pre-established first connection with the Bluetooth device. The first control command includes information sent by the server under first set conditions. The first set conditions include receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining the connection information of the Bluetooth device. Furthermore, the server compares the device-related information sent by the second terminal device with the device-related information of the first terminal device and determines that at least one of the following conditions is met: the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; the first terminal device and the second terminal device are logged into the same account; the first terminal device and the second terminal device are on the same local area network. In response to detecting that the first connection has been disconnected, a first notification message indicating that the first connection has been disconnected is sent to the server, so that the server sends the connection information to the second terminal device; The method further includes: In response to receiving a second control command sent by the server, the first connection is re-established with the Bluetooth device. The second control command includes information sent by the server under second set conditions. The second set conditions include receiving a second notification message sent by the second terminal device to indicate that the second connection has been disconnected. The second connection is the connection established between the second terminal device and the Bluetooth device.
2. The method according to claim 1, characterized in that, The method further includes: In response to receiving a control command for connecting to a Bluetooth device, a first connection is established with the Bluetooth device; In response to the establishment of the first connection, the connection information of the Bluetooth device is sent to the server.
3. The method according to claim 1, characterized in that, The step of re-establishing the first connection with the Bluetooth device in response to receiving the second control command sent by the server includes: In response to receiving a second control command sent by the server, an inquiry message is generated to determine whether to establish a first connection with the Bluetooth device; In response to receiving a confirmation command based on the query information, the first connection is re-established with the Bluetooth device.
4. A Bluetooth device control method, characterized in that, Applied to a second terminal device, the method includes: In response to detecting that the second terminal device has second audio data to be played, a Bluetooth information acquisition request is sent to the server; In response to receiving connection information of a Bluetooth device returned by the server based on the acquisition request, the server establishes a second connection with the Bluetooth device based on the connection information. The connection information includes information sent by the server in response to receiving a first notification from a first terminal device. The first notification includes information sent by the first terminal device to the server in response to receiving a first control command and disconnecting the first connection established with the Bluetooth device. The first control command includes information sent by the server under first set conditions. The first set conditions include receiving the Bluetooth information acquisition request, and the server comparing the device-related information sent by the second terminal device with the device-related information of the first terminal device, determining that at least one of the following conditions is met: the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; the first terminal device and the second terminal device are logged into the same account; the first terminal device and the second terminal device are on the same local area network. Based on the second connection, the second audio data is sent to the Bluetooth device for playback; The method further includes: In response to the detection that the second audio data has finished playing, the second connection is disconnected; In response to detecting that the second connection has been disconnected, a second notification message indicating that the second connection has been disconnected is sent to the server.
5. A Bluetooth device control method, characterized in that, Applied to the server side, the method includes: In response to detecting that a first preset condition is met, a first control command is sent to a first terminal device. The first control command is used to control the first terminal device to disconnect from the first connection with the Bluetooth device. The first preset condition includes receiving a Bluetooth information acquisition request sent by a second terminal device after having second audio data to be played, for obtaining connection information of the Bluetooth device. Based on a comparison of device-related information sent by the second terminal device with device-related information of the first terminal device, it is determined that at least one of the following conditions is met: the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; the first terminal device and the second terminal device are logged into the same account; the first terminal device and the second terminal device are on the same local area network. In response to receiving a first notification message from the first terminal device, the connection information of the Bluetooth device that was received in advance is sent to the second terminal device. The first notification message includes information sent by the first terminal device to the server in response to detecting that the first connection has been disconnected. The connection information includes information sent by the first terminal device to the server in response to establishing the first connection. The connection information is used for the second terminal device to establish a second connection with the Bluetooth device and to send the second audio data to the Bluetooth device for playback based on the second connection. The method further includes: In response to receiving a second notification message from the second terminal device indicating that the second connection has been disconnected, a second control command is sent to the first terminal device. The second control command is used to control the first terminal device to re-establish the first connection with the Bluetooth device.
6. A Bluetooth device control device, characterized in that, Applied to a first terminal device, the device includes: The first connection disconnection module is configured to disconnect a pre-established first connection with a Bluetooth device in response to receiving a first control command sent by the server. The first control command includes information sent by the server under first set conditions. The first set conditions include receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining connection information of the Bluetooth device. Furthermore, the server, after comparing the device-related information sent by the second terminal device with the device-related information of the first terminal device, determines that at least one of the following conditions is met: the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; the first terminal device and the second terminal device are logged into the same account; the first terminal device and the second terminal device are on the same local area network. The first notification sending module is configured to send a first notification message indicating that the first connection has been disconnected to the server in response to detecting that the first connection has been disconnected, so that the server can send the connection information to the second terminal device. The device further includes: The first connection reconstruction module is used to re-establish the first connection with the Bluetooth device in response to receiving a second control command sent by the server. The second control command includes information sent by the server under second set conditions. The second set conditions include receiving a second notification message sent by the second terminal device to indicate that the second connection has been disconnected. The second connection is the connection established between the second terminal device and the Bluetooth device.
7. A Bluetooth device control device, characterized in that, Applied to a second terminal device, the device includes: The request sending module is used to send a Bluetooth information acquisition request to the server in response to detecting that the second terminal device has second audio data to be played; The second connection establishment module is configured to, in response to receiving connection information of a Bluetooth device returned by the server based on the acquisition request, establish a second connection with the Bluetooth device based on the connection information. The connection information includes information sent by the server in response to receiving a first notification from a first terminal device, where the first terminal device is a device logged into the same account as the second terminal device. The first notification includes information sent by the first terminal device to the server in response to receiving a first control command and disconnecting the first connection established with the Bluetooth device. The first control command includes information sent by the server under first set conditions. The first set conditions include receiving the Bluetooth information acquisition request, and the server comparing the device-related information sent by the second terminal device with the device-related information of the first terminal device, and determining that at least one of the following conditions is met: the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; the first terminal device and the second terminal device are logged into the same account; the first terminal device and the second terminal device are on the same local area network. The second audio transmission module is used to send the second audio data to the Bluetooth device for playback based on the second connection; The device further includes: The second connection disconnection module is used to disconnect the second connection in response to detecting that the second audio data has finished playing. The second notification sending module is used to send a second notification message to the server in response to detecting that the second connection has been disconnected, indicating that the second connection has been disconnected.
8. A Bluetooth device control device, characterized in that, Applied to the server side, the device includes: A first instruction sending module is configured to send a first control instruction to a first terminal device in response to detecting that a first preset condition is met. The first control instruction is used to control the first terminal device to disconnect from the first connection with the Bluetooth device. The first preset condition includes receiving a Bluetooth information acquisition request sent by a second terminal device after having second audio data to be played, for obtaining connection information of the Bluetooth device. Furthermore, based on a comparison of device-related information sent by the second terminal device with device-related information of the first terminal device, it is determined that at least one of the following conditions is met: the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; the first terminal device and the second terminal device are logged into the same account; the first terminal device and the second terminal device are within the same local area network. A connection information sending module is configured to, in response to receiving a first notification message from the first terminal device, send the connection information of the Bluetooth device that has been received in advance to the second terminal device. The first notification message includes information sent by the first terminal device to the server in response to detecting that the first connection has been disconnected. The connection information includes information sent by the first terminal device to the server in response to establishing the first connection. The connection information is used for the second terminal device to establish a second connection with the Bluetooth device and to send the second audio data to the Bluetooth device for playback based on the second connection. The device further includes: The second instruction sending module is configured to, in response to receiving a second notification message from the second terminal device indicating that the second connection has been disconnected, send a second control instruction to the first terminal device, wherein the second control instruction is configured to control the first terminal device to re-establish the first connection with the Bluetooth device.
9. A terminal device, characterized in that, The device includes: Processor and memory used to store computer programs; The processor is configured to, when executing the computer program, implement: In response to receiving a first control command from the server, the server disconnects the pre-established first connection with the Bluetooth device. The first control command includes information sent by the server under first set conditions. The first set conditions include receiving a Bluetooth information acquisition request sent by the second terminal device after it has second audio data to be played, for obtaining the connection information of the Bluetooth device. Furthermore, the server compares the device-related information sent by the second terminal device with the device-related information of the first terminal device and determines that at least one of the following conditions is met: the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; the first terminal device and the second terminal device are logged into the same account; the first terminal device and the second terminal device are on the same local area network. In response to detecting that the first connection has been disconnected, a first notification message indicating that the first connection has been disconnected is sent to the server, so that the server sends the connection information to the second terminal device; Also includes: In response to receiving a second control command sent by the server, the first connection is re-established with the Bluetooth device. The second control command includes information sent by the server under second set conditions. The second set conditions include receiving a second notification message sent by the second terminal device to indicate that the second connection has been disconnected. The second connection is the connection established between the second terminal device and the Bluetooth device.
10. A terminal device, characterized in that, The device includes: Processor and memory used to store computer programs; The processor is configured to, when executing the computer program, implement: In response to the detection that the current terminal device has second audio data to be played, a Bluetooth information acquisition request is sent to the server; In response to receiving connection information of a Bluetooth device returned by the server based on the acquisition request, the server establishes a second connection with the Bluetooth device based on the connection information. The connection information includes information sent by the server in response to receiving a first notification from a first terminal device. The first notification includes information sent by the first terminal device to the server in response to receiving a first control command and disconnecting the first connection established with the Bluetooth device. The first control command includes information sent by the server under first set conditions. The first set conditions include receiving the Bluetooth information acquisition request, and the server comparing the device-related information sent by the second terminal device with the device-related information of the first terminal device, and determining that at least one of the following conditions is met: the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; the first terminal device and the second terminal device are logged into the same account; the first terminal device and the second terminal device are on the same local area network. Based on the second connection, the second audio data is sent to the Bluetooth device for playback; Also includes: In response to the detection that the second audio data has finished playing, the second connection is disconnected; In response to detecting that the second connection has been disconnected, a second notification message indicating that the second connection has been disconnected is sent to the server.
11. A server, characterized in that, The server includes: Processor and memory used to store computer programs; The processor is configured to, when executing the computer program, implement: In response to detecting that a first preset condition is met, a first control command is sent to a first terminal device. The first control command is used to control the first terminal device to disconnect from the first connection with the Bluetooth device. The first preset condition includes receiving a Bluetooth information acquisition request sent by a second terminal device after having second audio data to be played, for obtaining connection information of the Bluetooth device. Based on a comparison of device-related information sent by the second terminal device with device-related information of the first terminal device, it is determined that at least one of the following conditions is met: the distance between the first terminal device and the second terminal device is less than or equal to a preset distance threshold; the first terminal device and the second terminal device are logged into the same account; the first terminal device and the second terminal device are on the same local area network. In response to receiving a first notification message from the first terminal device, the connection information of the Bluetooth device that was received in advance is sent to the second terminal device. The first notification message includes information sent by the first terminal device to the server in response to detecting that the first connection has been disconnected. The connection information includes information sent by the first terminal device to the server in response to establishing the first connection. The connection information is used for the second terminal device to establish a second connection with the Bluetooth device and to send the second audio data to the Bluetooth device for playback based on the second connection. Also includes: In response to receiving a second notification message from the second terminal device indicating that the second connection has been disconnected, a second control command is sent to the first terminal device. The second control command is used to control the first terminal device to re-establish the first connection with the Bluetooth device.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the Bluetooth device control method according to any one of claims 1 to 6.