Bluetooth connection processing method and device, equipment and storage medium

By creating a virtual microphone module in the Linux operating system and switching to a Bluetooth connection mode where microphones can be used, the problem of not being able to use a Bluetooth device microphone in the prior art is solved, and the user experience is improved.

CN119946907APending Publication Date: 2025-05-06BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311443813.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-01
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The existing Linux operating system cannot use the microphone in the Bluetooth device when connecting to the Bluetooth device, resulting in a poor user experience.

Method used

Provides a Bluetooth connection processing method to obtain the current Bluetooth connection mode of the terminal device by responding to the connection request of the Bluetooth device. If the microphone cannot be used in the mode, create a virtual microphone module and switch to a mode where the microphone can be used when the preset condition for using the microphone is detected.

Benefits of technology

By displaying the virtual microphone module to the user and switching to a mode where the microphone can be used under appropriate conditions, the user's voice calls and high sound quality needs are met, and the user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946907A_ABST
    Figure CN119946907A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a Bluetooth connection processing method and device, equipment and a storage medium, and the method comprises the steps: obtaining a current Bluetooth connection mode of terminal equipment in response to a Bluetooth connection request of Bluetooth equipment which is provided with a microphone; if the Bluetooth connection mode is a first connection mode in which the microphone cannot be used, a virtual microphone module is created, and the virtual microphone module is used for displaying that the terminal equipment can use the microphone of the Bluetooth equipment to a user; and if it is detected that the preset condition of using the microphone is satisfied, switching the first connection mode to a second connection mode in which the microphone can be used. In the first connection mode in which the microphone cannot be used, the virtual microphone is displayed to the user so that the user can use the microphone, and when the microphone is used, the virtual microphone is switched to the second connection mode in which the microphone can be used so that the user can use the microphone function in the first connection mode, so that the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of system development technology, and in particular to a Bluetooth connection processing method, apparatus, device, and storage medium. Background Art

[0002] Currently, more and more users choose to install the Linux operating system on terminal devices or smart devices.

[0003] In the prior art, a terminal device or smart device installed with a Linux operating system connects to a Bluetooth device by default through the A2DP mode (Advanced Audio Distribution Profile). However, in the A2DP mode, the terminal device or smart device can only connect to the speaker in the Bluetooth device, but not to the microphone in the Bluetooth device, resulting in the user being unable to speak or record via the Bluetooth device.

[0004] It can be seen that the current Linux operating system cannot use the microphone in the Bluetooth device when connecting to the Bluetooth device, so the user experience is poor. Summary of the invention

[0005] The embodiments of the present disclosure provide a Bluetooth connection processing method, apparatus, device and storage medium, which can improve the user experience of an operating system.

[0006] In a first aspect, an embodiment of the present disclosure provides a Bluetooth connection processing method, which is applied to a terminal device installed with an application program; the method comprises:

[0007] In response to a Bluetooth connection request from a Bluetooth device, obtaining a current Bluetooth connection mode of the terminal device, wherein the Bluetooth device has a microphone;

[0008] If the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, creating a virtual microphone module, wherein the virtual microphone module is used to display to the user that the terminal device can use the microphone of the Bluetooth device;

[0009] If it is detected that the preset condition for using the microphone is met, the first connection mode is switched to a second connection mode in which the microphone can be used.

[0010] In a second aspect, an embodiment of the present disclosure provides a Bluetooth connection processing device, which is applied to a terminal device installed with an application program, and the device includes:

[0011] An acquisition module, configured to acquire a current Bluetooth connection mode of a terminal device in response to a Bluetooth connection request of a Bluetooth device, wherein the Bluetooth device has a microphone;

[0012] a creation module, configured to create a virtual microphone module if the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, wherein the virtual microphone module is configured to display to the user that the terminal device can use the microphone of the Bluetooth device;

[0013] The switching module is used to switch the first connection mode to a second connection mode in which the microphone can be used if it is detected that a preset condition for using the microphone is met.

[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0015] A processor, and a memory communicatively connected to the processor;

[0016] The memory stores computer-executable instructions;

[0017] The processor executes the computer-executable instructions stored in the memory to implement the Bluetooth connection processing method as described in the first aspect above.

[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the Bluetooth connection processing method described in the first aspect above is implemented.

[0019] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the Bluetooth connection processing method as described in the first aspect above.

[0020] The present embodiment provides a Bluetooth connection processing method, apparatus, device and storage medium, the method comprising: in response to a Bluetooth connection request of a Bluetooth device, obtaining the current Bluetooth connection mode of a terminal device, wherein the Bluetooth device has a microphone; if the Bluetooth connection mode is a first connection mode in which the microphone cannot be used, creating a virtual microphone module, wherein the virtual microphone module is used to display to the user that the terminal device can use the microphone of the Bluetooth device; if it is detected that the preset conditions for using the microphone are met, switching the first connection mode to a second connection mode in which the microphone can be used. Since the virtual microphone module is displayed to the user when the microphone is in the first connection mode in which the microphone cannot be used, the user is led to believe that the microphone can be used in the current first connection mode, and when the microphone is used, the switch is made to the second connection mode in which the microphone can be used, the user is led to believe that the microphone function in the first connection mode is used, that is, the user's demand for high sound quality is met, and the user's demand for making voice calls through a Bluetooth device is met, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0022] Figure 1 A schematic diagram of an application scenario of a Bluetooth connection processing method provided by an embodiment of the present disclosure;

[0023] Figure 2 A flowchart of a Bluetooth connection processing method provided by an embodiment of the present disclosure;

[0024] Figure 3 A schematic diagram of a Bluetooth connection processing method provided by an embodiment of the present disclosure;

[0025] Figure 4 A schematic diagram of an interface of a virtual microphone module provided in an embodiment of the present disclosure;

[0026] Figure 5 A flowchart of another Bluetooth connection processing method provided by an embodiment of the present disclosure;

[0027] Figure 6 A structural block diagram of a Bluetooth connection processing device provided in an embodiment of the present disclosure;

[0028] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0030] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0031] Currently, more and more users choose to install the Linux operating system on terminal devices or smart devices.

[0032] In the prior art, a terminal device or smart device installed with a Linux operating system connects to a Bluetooth device by default through the A2DP mode (Advanced Audio Distribution Profile). However, in the A2DP mode, the terminal device or smart device can only connect to the speaker in the Bluetooth device, but not to the microphone in the Bluetooth device, resulting in the user being unable to speak or record via the Bluetooth device.

[0033] In this case, even if there is a microphone module in the Bluetooth device, the user can only listen to music through the Bluetooth device, but cannot make calls through the Bluetooth device. The current Linux operating system cannot use the microphone in the Bluetooth device when connecting to the Bluetooth device, so the user experience is poor.

[0034] It can be seen that, under the Linux operating system, how to implement the microphone function in the A2DP mode has become an urgent problem to be solved.

[0035] In order to solve the above problems, the present embodiment provides a Bluetooth connection processing method, which obtains the current Bluetooth connection mode of the terminal device when receiving a Bluetooth connection request from a Bluetooth device, and creates a virtual microphone module if the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, and displays to the user through the virtual microphone module that the terminal device can use the microphone of the Bluetooth device. Furthermore, if it is detected that the preset conditions for using the microphone are met, the first connection mode can be switched to the second connection mode in which the microphone can be used, and then the microphone can be used. Since a virtual microphone is displayed to the user when the microphone is in the first connection mode in which the microphone cannot be used, the user thinks that the microphone can be used, and when the microphone is used, the method switches to the second connection mode in which the microphone can be used, so that the user thinks that the microphone function in the first connection mode is used, the user experience is improved.

[0036] The application scenarios of the embodiments of the present disclosure are explained below:

[0037] The Bluetooth connection processing method provided in the embodiment of the present disclosure can be applied to the scenario of controlling various types of audio permissions. Optionally, the first connection mode is A2DP mode, and the second connection mode is HFP mode (Hands-Free Profile hands-free mode). Among them, the sound quality of the A2DP mode is higher, but in the A2DP mode, only the speaker of the Bluetooth device can be used, and the microphone of the Bluetooth device cannot be used. Among them, the sound quality of the HFP mode is lower, but in the HFP mode, both the speaker and the microphone of the Bluetooth device can be used.

[0038] For example, the Bluetooth device is a Bluetooth headset with a microphone. The improved method of the disclosed embodiment can be applied to the scenario of making a voice call through a Bluetooth headset. The user first listens to music using a Bluetooth headset in A2DP mode. Since the sound quality is higher in this mode, the user has a better effect of listening to music. In this scenario, a virtual microphone module is first created to show the user that the terminal device can use the microphone of the Bluetooth device. When the user makes a voice call through video application A, it automatically switches to the HFP mode where the microphone can be used, and the user can use the microphone normally. Since the virtual microphone module was created before, the user thinks that the call is made in A2DP mode.

[0039] In this way, it not only meets the user's demand for high sound quality when listening to music, but also meets the user's demand for making voice calls through Bluetooth devices, thereby improving the user experience.

[0040] Figure 1 A schematic diagram of an application scenario of a microphone Bluetooth connection processing method provided by an embodiment of the present disclosure. Figure 1 As shown, when the application starts recording or ends recording, the pulse audio interface (pulseaudio api) in the pulseaudio audio server is called; the pulse audio service program (pulseaudio service) in the pulseaudio audio server is started through the pulse audio interface, and a recording stream event is sent to the Bluetooth management module (module-bluetooth-policy); the switching between the first connection mode and the second connection mode is realized through the Bluetooth management module. Among them, the first connection mode is the A2DP mode, and the second connection mode is the HFP mode. In this application scenario, when using a microphone for recording, switch to the HFP mode in which the microphone can be used, so that the user thinks that the A2DP mode has a microphone function, thereby improving the user experience. The Bluetooth connection processing method provided in the embodiment of the present disclosure is described in detail using a detailed embodiment below.

[0041] Example 1

[0042] refer to Figure 2 , Figure 2 A flowchart of a Bluetooth connection processing method provided in an embodiment of the present disclosure. The execution subject of the method can be a terminal device or a server device. The present disclosure embodiment is described by taking the execution subject as a terminal device with an application installed as an example. The method includes:

[0043] S201. In response to a Bluetooth connection request from a Bluetooth device, obtain a current Bluetooth connection mode of a terminal device, wherein the Bluetooth device has a microphone.

[0044] In the disclosed embodiments, the Bluetooth device may be any device with a microphone. For example, a Bluetooth speaker, a Bluetooth headset, etc. A Bluetooth connection may be established between the Bluetooth device and the terminal device through different Bluetooth connection modes (i.e., Bluetooth protocols). Among them, the Bluetooth connection modes may include: HFP mode, A2DP mode, HSP (HeadSet Profile, headset mode), etc.

[0045] Optionally, the current Bluetooth connection mode of the terminal device is obtained through the Bluetooth protocol module (module bluez5 device). The specific steps are: through the Bluetooth protocol module (module bluez5 device), call the start_thread method to determine the current Bluetooth connection mode of the terminal device.

[0046] S202: If the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, create a virtual microphone module, wherein the virtual microphone module is used to display to the user that the terminal device can use the microphone of the Bluetooth device.

[0047] In the embodiment of the present disclosure, the first connection mode is any connection mode in which the microphone cannot be used. Optionally, the first connection mode is an A2DP mode.

[0048] Alternatively, if Figure 3 As shown, the virtual microphone module includes a virtual connection device unit, a virtual microphone volume unit and a virtual microphone audio unit. The virtual connection device unit is used to display the device identification of the Bluetooth device connected to the terminal device to the user; the virtual microphone volume unit is used to control and / or display the input volume parameters of the microphone to the user; the virtual microphone audio unit is used to display the input audio parameters of the microphone to the user.

[0049] The device identifier of the Bluetooth device is used to distinguish different devices. The device identifier may include any characters such as Chinese, English, letters, symbols, etc. For example, Figure 3 As shown in the figure, the device identification is: XXX W31. The input volume parameter is used to indicate the input volume. Figure 3 As shown, the input volume parameter may be an input volume percentage, wherein 0% represents the minimum input volume and 100% represents the maximum input volume.

[0050] Further, the virtual microphone volume unit includes an input volume control button. The user can also adjust the input volume parameter through the input volume control button. Optionally, the step of adjusting the input volume parameter includes: responding to the adjustment operation on the input volume control button, adjusting the input volume parameter of the microphone according to the adjustment operation.

[0051] The adjustment operation may be a click operation or a slide operation. The volume may be increased or decreased by the adjustment operation. Optionally, the adjustment operation includes a left slide operation and a right slide operation; accordingly, the step of adjusting the input volume parameter includes: in response to a left slide operation on the input volume control button, reducing the input volume parameter of the microphone according to the left slide operation; or, in response to a right slide operation on the input volume control button, increasing the input volume parameter of the microphone according to the right slide operation.

[0052] It should be noted that in order to prevent the virtual microphone module created this time from affecting other microphone modules, the virtual microphone module will be deleted when the Bluetooth device is disconnected. Accordingly, the specific steps are: in response to the disconnection request of the Bluetooth device, determine whether the terminal device has created a virtual microphone module; if the terminal device has created a virtual microphone module, delete the virtual microphone module.

[0053] Optionally, through the Bluetooth protocol module (module bluez5 device), it is determined whether a virtual microphone module has been created. The specific steps are: through the Bluetooth protocol module (module bluez5 device), the stop_thread method is called, and through the stop_thread method, it is determined whether a virtual microphone module has been created, and if the terminal device has created a virtual microphone module, the virtual microphone module is deleted.

[0054] S203: If it is detected that the preset condition for using the microphone is met, switch the first connection mode to a second connection mode in which the microphone can be used.

[0055] In the embodiment of the present disclosure, the second connection mode may be any connection mode in which a microphone may be used. Optionally, the second connection mode may be an HFP mode or an HSP mode.

[0056] The Bluetooth connection processing method provided in this embodiment displays a virtual microphone module to the user when the microphone is in the first connection mode in which the microphone cannot be used, allowing the user to believe that the microphone can be used in the current first connection mode. When the microphone is in use, the method switches to the second connection mode in which the microphone can be used, allowing the user to believe that the microphone function in the first connection mode is used. That is, the method satisfies both the user's demand for high sound quality and the user's demand for making voice calls through a Bluetooth device, thereby improving the user experience.

[0057] Example 2

[0058] This embodiment Figure 2Based on the illustrated embodiment, if it is detected that the preset condition for using the microphone is met in step S203, switching the first connection mode to the second connection mode in which the microphone can be used is further described in detail.

[0059] In the embodiment of the present disclosure, the preset condition for using the microphone can be determined by the number of recording streams. Accordingly, if it is detected that the preset condition for using the microphone is met, the first connection mode is switched to the second connection mode in which the microphone can be used, including: if it is detected that there is a recording stream, it is determined that the preset condition for using the microphone is met, and the first connection mode is switched to the second connection mode in which the microphone can be used.

[0060] Optionally, the number of recording streams is counted through the Bluetooth management module. Accordingly, if the existence of recording streams is detected, it is determined that the preset condition for using the microphone is met, including: obtaining the current number of recording streams through the Bluetooth management module; if the number of recording streams is greater than 0, it is detected that there is a recording stream, and it is determined that the preset condition for using the microphone is met.

[0061] In the disclosed embodiment, the number of applications installed in the terminal device is one or more. When the application is recording, a recording stream needs to be created to receive the voice signal. Accordingly, the current number of recording streams is obtained through the Bluetooth management module, including: in response to receiving a start recording request from any application, calling the audio server to create a recording stream, and notifying the Bluetooth management module through the audio server to create a recording stream event; in response to receiving an end recording request from any application, calling the audio server to destroy the recording stream, and notifying the Bluetooth management module through the audio server to destroy the recording stream event; counting the recording streams through the Bluetooth management module, if the Bluetooth management module receives a create recording stream event, the number of recording streams is increased by 1, if the Bluetooth management module receives a destroy recording stream event, the number of recording streams is reduced by 1, and the current number of recording streams is obtained.

[0062] For example, Figure 4 As shown, the Bluetooth management module receives a recording stream event corresponding to any application. If the recording stream event is a create recording stream event, the number of recording streams is increased by 1; at this time, the application starts recording. If the recording stream event is a destroy recording stream event, the number of recording streams is reduced by 1; at this time, the application ends recording. If the number of recording streams is greater than 0, there is currently a recording stream, and the first connection mode is switched ( Figure 4 Taking A2DP mode as an example) to the second connection mode where a microphone can be used ( Figure 4 Take HFP mode as an example).

[0063] It should be noted that each time a recording stream event is received, the Bluetooth management module updates the number of recording streams and obtains the current number of recording streams. In this case, each time a recording stream event is received, the number of recording streams is re-obtained. In this way, it can be ensured that the number of recording streams obtained is the latest number of recording streams.

[0064] In some embodiments, if no recording stream event is received within a preset duration, the number of current recording streams is obtained; if the number of recording streams obtained this time is the same as the number of recording streams obtained last time, the number of recording streams is not updated; if the number of recording streams obtained this time is different from the number of recording streams obtained last time, the number of recording streams is updated to the number of recording streams obtained this time. In the embodiments disclosed herein, the value of the preset duration is not specifically limited. For example, the preset duration may be 1 minute, 10 minutes, 30 minutes, etc.

[0065] In the embodiment of the present disclosure, step S203 may be executed after step S202 or after step S201; step S203 may also be executed alone.

[0066] In the first case, step S203 is executed after step S202. At this time, the Bluetooth connection mode of the terminal device is the first connection mode in which the microphone cannot be used. If the number of recording streams is greater than 0, there is currently a recording stream, and the first connection mode is switched ( Figure 4 Taking A2DP mode as an example) to the second connection mode where a microphone can be used ( Figure 4 Take HFP mode as an example).

[0067] In the second case, step S203 is executed after step S201; if the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, when the number of recording streams is greater than 0, the first connection mode is switched ( Figure 4 Taking A2DP mode as an example) to the second connection mode where a microphone can be used ( Figure 4 Take HFP mode as an example). If the Bluetooth connection mode is the second connection mode that can use the microphone ( Figure 4 Taking HFP mode as an example), when the number of recording streams is greater than 0, the connection mode will not be switched.

[0068] In the third case, step S203 is performed alone. Figure 4 As shown, if it is detected that the preset condition for using the microphone is met, the first connection mode is switched to the second connection mode in which the microphone can be used. The specific steps are: the number of recording streams is greater than 0, there is a recording stream, and it is detected that the preset condition for using the microphone is met, then the current Bluetooth connection mode of the terminal device is obtained; if the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, the first connection mode is switched ( Figure 4Taking A2DP mode as an example) to the second connection mode where a microphone can be used ( Figure 4 Take HFP mode as an example). If the Bluetooth connection mode is the second connection mode that can use the microphone ( Figure 4 Taking HFP mode as an example), the connection mode will not be switched.

[0069] Example 3

[0070] Figure 5 Flow chart of another Bluetooth connection processing method provided by the embodiment of the present disclosure. The embodiment of the present disclosure can also realize flexible switching between the first connection mode and the second connection mode. Figure 2 Based on the embodiment shown, the method for switching between connection modes is further described in detail. Figure 5 As shown, after step S203, the following steps are also included:

[0071] S204: In response to not meeting the preset condition for using the microphone, switch the second connection mode to the first connection mode.

[0072] In the embodiment of the present disclosure, the number of recording streams can be used to determine whether the preset condition for using the microphone is not met. Accordingly, the specific steps are: if it is detected that there is no recording stream, it is determined that the preset condition for using the microphone is not met, and the second connection mode is switched to the first connection mode.

[0073] Optionally, the number of recording streams is counted through the Bluetooth management module. Accordingly, if it is detected that no recording stream exists, it is determined that the preset condition for using the microphone is not met, including: obtaining the number of current recording streams through the Bluetooth management module; if the number of recording streams is less than or equal to 0, it is detected that no recording stream exists, and it is determined that the preset condition for using the microphone is not met.

[0074] Among them, the method for obtaining the current number of recording streams through the Bluetooth management module has been described in detail in Example 2 and will not be repeated here.

[0075] It should be noted that, in the embodiment of the present disclosure, step S204 may be executed after step S203 or after step S201; step S204 may also be executed alone.

[0076] In the first case, step S204 is executed after step S203, and the Bluetooth connection mode of the terminal device is the second connection mode in which the microphone can be used. If the number of recording streams is less than or equal to 0, it is detected that no recording stream exists, and it is determined that the preset condition for using the microphone is not met. At this time, the second connection mode ( Figure 4 Taking HFP mode as an example) to the first connection mode ( Figure 4 Take A2DP mode as an example).

[0077] In the second case, step S204 is performed after step S201. If the number of recording streams is less than or equal to 0, it is detected that no recording stream exists, and it is determined that the preset condition for using the microphone is not met. At this time, if the Bluetooth connection mode is the first connection mode in which the microphone cannot be used ( Figure 4 If the Bluetooth connection mode is the second connection mode that can use the microphone, then switch to the second connection mode ( Figure 4 Taking HFP mode as an example) to the first connection mode ( Figure 4 Take A2DP mode as an example).

[0078] In the third case, step S204 is performed alone. Figure 4 As shown, if it is detected that the preset condition for using the microphone is not met, the second connection mode is switched to the first connection mode. The specific steps are: if the number of recording streams is less than or equal to 0, and it is detected that there is no recording stream, it is determined that the preset condition for using the microphone is not met. At this time, the current Bluetooth connection mode of the terminal device is obtained. If the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, it will not be switched; if the Bluetooth connection mode is the second connection mode in which the microphone can be used, the second connection mode is switched ( Figure 4 Taking HFP mode as an example) to the first connection mode ( Figure 4 Take A2DP mode as an example).

[0079] In the embodiment of the present disclosure, when it is detected that the preset conditions for using the microphone are not met, it switches to the first connection mode, thereby realizing free switching between the first connection mode and the second connection mode. In this application scenario, when using the microphone for recording, it switches to the HFP mode in which the microphone can be used, so that the user thinks that the A2DP mode has a microphone function. When the recording is finished, it can also switch to the A2DP mode, so that the user can experience better sound quality effects, thereby improving the user experience.

[0080] Example 4

[0081] Furthermore, in order to achieve seamless switching between connection modes, the embodiment of the present disclosure can also synchronize the input volume parameters between the two connection modes.

[0082] The first case: switching the first connection mode to the second connection mode where the microphone can be used. Accordingly, after switching the first connection mode to the second connection mode where the microphone can be used, the method further includes: deleting the virtual microphone module and creating a real microphone module, wherein the real microphone module is used to connect and / or control the microphone of the Bluetooth device; obtaining the input volume parameter of the microphone in the virtual microphone module;

[0083] Synchronize the real input volume parameter of the microphone in the created real microphone module with the input volume parameter of the microphone in the virtual microphone module.

[0084] In the disclosed embodiment, the real microphone module can connect to the microphone of the Bluetooth device, and can also control the microphone of the Bluetooth device. Optionally, the real microphone module includes: a connection device unit, a microphone volume unit, and a microphone audio unit; wherein the connection device unit is used to display to the user the device identification of the Bluetooth device to which the terminal device is actually connected; the microphone volume unit is used to control and / or display to the user the real input volume parameters of the microphone; and the microphone audio unit is used to display to the user the real input audio parameters of the microphone.

[0085] The second case: switching the second connection mode to the first connection mode. Accordingly, after switching the second connection mode to the first connection mode, the method further includes: deleting the real microphone module and creating a new virtual microphone module; obtaining the real input volume parameter of the microphone in the real microphone module; synchronizing the input volume parameter of the microphone in the created virtual microphone module with the real input volume parameter of the microphone in the real microphone module.

[0086] It should be noted that the input volume parameter of the microphone may include one or more. When the input volume parameter is one, the input volume parameter corresponds to the input volume of the terminal device. At this time, multiple applications installed in the terminal device use a unified input volume parameter. When there are multiple input volume parameters, each input volume parameter corresponds to an application. Accordingly, a volume database is provided in the terminal device, and the volume database stores: multiple input volume parameters and an application identifier corresponding to each input volume parameter.

[0087] In the disclosed embodiment, when the first connection mode is switched to the second connection mode in which the microphone can be used, the input volume parameters of the first connection mode are synchronized to the second connection mode; when the second connection mode is switched to the first connection mode, the input volume parameters of the second connection mode are also synchronized to the first connection mode, thereby achieving a seamless switch between the first connection mode and the second connection mode. In this case, if the user listens to music through the first connection mode and needs to make a voice call, the second connection mode is automatically switched to make the call, and the input volume parameters of the two connection modes can be synchronized with each other. In this way, when making a call through the second connection mode, the user can think that the microphone function in the first connection mode is used, thereby improving the user experience.

[0088] Figure 6 This is a structural block diagram of a Bluetooth connection processing device provided by an embodiment of the present disclosure, which is applied to a terminal device with an application installed. Figure 6, the Bluetooth connection processing device includes: an acquisition module 601, a creation module 602 and a switching module 603;

[0089] The acquisition module 601 is used to obtain the current Bluetooth connection mode of the terminal device in response to a Bluetooth connection request of the Bluetooth device, wherein the Bluetooth device has a microphone;

[0090] A creation module 602 is used to create a virtual microphone module if the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, wherein the virtual microphone module is used to display to the user that the terminal device can use the microphone of the Bluetooth device;

[0091] The switching module 603 is used to switch the first connection mode to a second connection mode in which the microphone can be used if it is detected that the preset condition for using the microphone is met.

[0092] In one embodiment of the present disclosure, the switching module 603 switches the first connection mode to the second connection mode in which the microphone can be used if it is detected that the preset conditions for using the microphone are met, specifically including: if it is detected that there is a recording stream, it is determined that the preset conditions for using the microphone are met, and the first connection mode is switched to the second connection mode in which the microphone can be used.

[0093] In one embodiment of the present disclosure, if the switching module 603 detects the existence of a recording stream, it determines that the preset conditions for using the microphone are met, specifically including: obtaining the current number of recording streams through the Bluetooth management module; if the number of recording streams is greater than 0, it is detected that there is a recording stream, and it is determined that the preset conditions for using the microphone are met.

[0094] In one embodiment of the present disclosure, the number of applications installed in the terminal device is one or more; accordingly, the switching module 603 obtains the current number of recording streams through the Bluetooth management module, specifically including: in response to receiving a start recording request from any application, calling the audio server to create a recording stream, and notifying the Bluetooth management module to create a recording stream event through the audio server; in response to receiving an end recording request from any application, calling the audio server to destroy the recording stream, and notifying the Bluetooth management module to destroy the recording stream event through the audio server; counting the recording streams through the Bluetooth management module, if the Bluetooth management module receives a create recording stream event, the number of recording streams is increased by 1, and if the Bluetooth management module receives a destroy recording stream event, the number of recording streams is reduced by 1 to obtain the current number of recording streams.

[0095] In one embodiment of the present disclosure, the virtual microphone module includes a virtual connection device unit, a virtual microphone volume unit and a virtual microphone audio unit; the virtual connection device unit is used to display the device identification of the Bluetooth device to which the terminal device is connected to the user; the virtual microphone volume unit is used to control and / or display the input volume parameters of the microphone to the user; the virtual microphone audio unit is used to display the input audio parameters of the microphone to the user.

[0096] In one embodiment of the present disclosure, the virtual microphone volume unit includes an input volume control button; the device also includes: an adjustment module; the adjustment module responds to an adjustment operation on the input volume control button and adjusts the input volume parameter of the microphone according to the adjustment operation.

[0097] In one embodiment of the present disclosure, the device also includes: a synchronization module; the synchronization module is used to delete the virtual microphone module and create a real microphone module, wherein the real microphone module is used to connect and / or control the microphone of the Bluetooth device; obtain the input volume parameters of the microphone in the virtual microphone module; synchronize the real input volume parameters of the microphone in the created real microphone module with the input volume parameters of the microphone in the virtual microphone module.

[0098] In one embodiment of the present disclosure, the real microphone module includes a connection device unit, a microphone volume unit and a microphone audio unit; the connection device unit is used to display to the user the device identification of the Bluetooth device to which the terminal device is actually connected; the microphone volume unit is used to control and / or display to the user the real input volume parameters of the microphone; the microphone audio unit is used to display to the user the real input audio parameters of the microphone.

[0099] In one embodiment of the present disclosure, the device also includes: a deletion module; the deletion module is used to determine whether the terminal device has created a virtual microphone module in response to a disconnection request to disconnect the Bluetooth device; if the terminal device has created a virtual microphone module, delete the virtual microphone module.

[0100] In one embodiment of the present disclosure, the switching module 603 is further configured to switch the second connection mode to the first connection mode in response to a preset condition for using the microphone not being met.

[0101] In one embodiment of the present disclosure, the switching module 603, in response to the preset condition for using the microphone not being met, switches the second connection mode to the first connection mode, specifically including: if it is detected that no recording stream exists, it is determined that the preset condition for using the microphone is not met, and then the second connection mode is switched to the first connection mode.

[0102] In one embodiment of the present disclosure, if the switching module 603 detects that there is no recording stream, it determines that the preset conditions for using the microphone are not met, specifically including: obtaining the current number of recording streams through the Bluetooth management module; if the number of recording streams is less than or equal to 0, it is detected that there is no recording stream, and it is determined that the preset conditions for using the microphone are not met.

[0103] In one embodiment of the present disclosure, the deletion module is also used to delete the real microphone module and create a new virtual microphone module; obtain the real input volume parameters of the microphone in the real microphone module; and synchronize the input volume parameters of the microphone in the created virtual microphone module with the real input volume parameters of the microphone in the real microphone module.

[0104] The acquisition module 601, the creation module 602 and the switching module 603 are connected in sequence. The Bluetooth connection processing device provided in this embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.

[0105] An embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the Bluetooth connection processing method provided in any of the above embodiments of the present application.

[0106] Figure 7 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present disclosure. Figure 7 The electronic device 700 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0107] like Figure 7As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 to a random access memory (RAM) 703. Various programs and data required for the operation of the electronic device 700 are also stored in the RAM 703. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0108] Typically, the following devices may be connected to the I / O interface 705: input devices 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 708 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 709. The communication devices 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0109] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0110] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0111] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0112] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0113] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0115] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0116] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0117] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0118] In a first aspect, according to one or more embodiments of the present disclosure, a Bluetooth connection processing method is provided, which is applied to a terminal device with an application installed, comprising:

[0119] In response to a Bluetooth connection request from a Bluetooth device, obtaining a current Bluetooth connection mode of the terminal device, wherein the Bluetooth device has a microphone;

[0120] If the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, creating a virtual microphone module, wherein the virtual microphone module is used to display to the user that the terminal device can use the microphone of the Bluetooth device;

[0121] If it is detected that the preset condition for using the microphone is met, the first connection mode is switched to a second connection mode in which the microphone can be used.

[0122] According to one or more embodiments of the present disclosure, if it is detected that the preset conditions for using the microphone are met, the first connection mode is switched to the second connection mode in which the microphone can be used, including: if it is detected that there is a recording stream, it is determined that the preset conditions for using the microphone are met, and the first connection mode is switched to the second connection mode in which the microphone can be used.

[0123] According to one or more embodiments of the present disclosure, if the existence of a recording stream is detected, it is determined that the preset conditions for using the microphone are met, including: obtaining the current number of recording streams through a Bluetooth management module; if the number of recording streams is greater than 0, it is detected that there is a recording stream, and it is determined that the preset conditions for using the microphone are met.

[0124] According to one or more embodiments of the present disclosure, the number of applications installed in the terminal device is one or more; accordingly, the obtaining of the current number of recording streams through the Bluetooth management module includes: in response to receiving a start recording request from any application, calling the audio server to create a recording stream, and notifying the Bluetooth management module of a creation recording stream event through the audio server; in response to receiving an end recording request from any application, calling the audio server to destroy the recording stream, and notifying the Bluetooth management module of the destruction recording stream event through the audio server; counting the recording streams through the Bluetooth management module, if the Bluetooth management module receives a creation recording stream event, the number of recording streams is increased by 1, and if the Bluetooth management module receives a destruction recording stream event, the number of recording streams is reduced by 1 to obtain the current number of recording streams.

[0125] According to one or more embodiments of the present disclosure, the virtual microphone module includes a virtual connection device unit, a virtual microphone volume unit and a virtual microphone audio unit; the virtual connection device unit is used to display the device identification of the Bluetooth device connected to the terminal device to the user; the virtual microphone volume unit is used to control and / or display the input volume parameters of the microphone to the user; the virtual microphone audio unit is used to display the input audio parameters of the microphone to the user.

[0126] According to one or more embodiments of the present disclosure, the virtual microphone volume unit includes an input volume control button; the method further includes: responding to an adjustment operation on the input volume control button, adjusting an input volume parameter of the microphone according to the adjustment operation.

[0127] According to one or more embodiments of the present disclosure, after switching the first connection mode to the second connection mode in which the microphone can be used, it also includes: deleting the virtual microphone module and creating a real microphone module, wherein the real microphone module is used to connect and / or control the microphone of the Bluetooth device; obtaining the input volume parameters of the microphone in the virtual microphone module; and synchronizing the real input volume parameters of the microphone in the created real microphone module with the input volume parameters of the microphone in the virtual microphone module.

[0128] According to one or more embodiments of the present disclosure, the real microphone module includes a connection device unit, a microphone volume unit and a microphone audio unit; the connection device unit is used to display to the user the device identification of the Bluetooth device to which the terminal device is actually connected; the microphone volume unit is used to control and / or display to the user the real input volume parameters of the microphone; the microphone audio unit is used to display to the user the real input audio parameters of the microphone.

[0129] According to one or more embodiments of the present disclosure, after switching the first connection mode to the second connection mode in which a microphone can be used, it also includes: in response to a disconnection request to disconnect the Bluetooth device, determining whether the terminal device has created a virtual microphone module; if the terminal device has created a virtual microphone module, deleting the virtual microphone module.

[0130] According to one or more embodiments of the present disclosure, after switching the first connection mode to the second connection mode in which the microphone can be used, it further includes: in response to not meeting a preset condition for using the microphone, switching the second connection mode to the first connection mode.

[0131] According to one or more embodiments of the present disclosure, in response to not meeting the preset conditions for using the microphone, switching the second connection mode to the first connection mode includes: if it is detected that no recording stream exists, it is determined that the preset conditions for using the microphone are not met, and then switching the second connection mode to the first connection mode.

[0132] According to one or more embodiments of the present disclosure, if it is detected that no recording stream exists, it is determined that the preset conditions for using the microphone are not met, including: obtaining the current number of recording streams through a Bluetooth management module; if the number of recording streams is less than or equal to 0, it is detected that no recording stream exists, and it is determined that the preset conditions for using the microphone are not met.

[0133] According to one or more embodiments of the present disclosure, after switching the second connection mode to the first connection mode, it also includes: deleting the real microphone module and creating a new virtual microphone module; obtaining the real input volume parameters of the microphone in the real microphone module; and synchronizing the input volume parameters of the microphone in the created virtual microphone module with the real input volume parameters of the microphone in the real microphone module.

[0134] In a second aspect, according to one or more embodiments of the present disclosure, a Bluetooth connection processing device is provided, which is applied to a terminal device with an application installed, including:

[0135] An acquisition module, configured to acquire a current Bluetooth connection mode of a terminal device in response to a Bluetooth connection request of a Bluetooth device, wherein the Bluetooth device has a microphone;

[0136] a creation module, configured to create a virtual microphone module if the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, wherein the virtual microphone module is configured to display to the user that the terminal device can use the microphone of the Bluetooth device;

[0137] The switching module is used to switch the first connection mode to a second connection mode in which the microphone can be used if it is detected that a preset condition for using the microphone is met.

[0138] According to one or more embodiments of the present disclosure, the switching module switches the first connection mode to the second connection mode in which the microphone can be used if it is detected that the preset conditions for using the microphone are met, specifically including: if it is detected that there is a recording stream, it is determined that the preset conditions for using the microphone are met, and then the first connection mode is switched to the second connection mode in which the microphone can be used.

[0139] According to one or more embodiments of the present disclosure, if the switching module detects the existence of a recording stream, it determines that the preset conditions for using the microphone are met, specifically including: obtaining the current number of recording streams through the Bluetooth management module; if the number of recording streams is greater than 0, it is detected that there is a recording stream, and it is determined that the preset conditions for using the microphone are met.

[0140] According to one or more embodiments of the present disclosure, the number of applications installed in the terminal device is one or more; accordingly, the switching module obtains the current number of recording streams through the Bluetooth management module, specifically including: in response to receiving a start recording request from any application, calling the audio server to create a recording stream, and notifying the Bluetooth management module of a creation recording stream event through the audio server; in response to receiving an end recording request from any application, calling the audio server to destroy the recording stream, and notifying the Bluetooth management module of a destruction recording stream event through the audio server; counting the recording streams through the Bluetooth management module, if the Bluetooth management module receives a creation recording stream event, the number of recording streams is increased by 1, and if the Bluetooth management module receives a destruction recording stream event, the number of recording streams is reduced by 1 to obtain the current number of recording streams.

[0141] According to one or more embodiments of the present disclosure, the virtual microphone module includes a virtual connection device unit, a virtual microphone volume unit and a virtual microphone audio unit; the virtual connection device unit is used to display the device identification of the Bluetooth device connected to the terminal device to the user; the virtual microphone volume unit is used to control and / or display the input volume parameters of the microphone to the user; the virtual microphone audio unit is used to display the input audio parameters of the microphone to the user.

[0142] According to one or more embodiments of the present disclosure, the virtual microphone volume unit includes an input volume control button; the device also includes: an adjustment module; the adjustment module responds to an adjustment operation on the input volume control button and adjusts the input volume parameter of the microphone according to the adjustment operation.

[0143] According to one or more embodiments of the present disclosure, the device also includes: a synchronization module; the synchronization module is used to delete the virtual microphone module and create a real microphone module, wherein the real microphone module is used to connect and / or control the microphone of the Bluetooth device; obtain the input volume parameters of the microphone in the virtual microphone module; synchronize the real input volume parameters of the microphone in the created real microphone module with the input volume parameters of the microphone in the virtual microphone module.

[0144] According to one or more embodiments of the present disclosure, the real microphone module includes a connection device unit, a microphone volume unit and a microphone audio unit; the connection device unit is used to display to the user the device identification of the Bluetooth device to which the terminal device is actually connected; the microphone volume unit is used to control and / or display to the user the real input volume parameters of the microphone; the microphone audio unit is used to display to the user the real input audio parameters of the microphone.

[0145] According to one or more embodiments of the present disclosure, the device also includes: a deletion module; the deletion module is used to determine whether the terminal device has created a virtual microphone module in response to a disconnection request to disconnect the Bluetooth device; if the terminal device has created a virtual microphone module, delete the virtual microphone module.

[0146] According to one or more embodiments of the present disclosure, the switching module is further configured to switch the second connection mode to the first connection mode in response to a preset condition for using the microphone not being met.

[0147] According to one or more embodiments of the present disclosure, the switching module switches the second connection mode to the first connection mode in response to the preset condition for using the microphone not being met, specifically including: if it is detected that no recording stream exists, it is determined that the preset condition for using the microphone is not met, and then the second connection mode is switched to the first connection mode.

[0148] According to one or more embodiments of the present disclosure, if the switching module detects that there is no recording stream, it determines that the preset conditions for using the microphone are not met, specifically including: obtaining the current number of recording streams through the Bluetooth management module; if the number of recording streams is less than or equal to 0, it is detected that there is no recording stream, and it is determined that the preset conditions for using the microphone are not met.

[0149] According to one or more embodiments of the present disclosure, the deletion module is also used to delete the real microphone module and create a new virtual microphone module; obtain the real input volume parameters of the microphone in the real microphone module; and synchronize the input volume parameters of the microphone in the created virtual microphone module with the real input volume parameters of the microphone in the real microphone module.

[0150] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0151] The memory stores computer-executable instructions;

[0152] The processor executes the computer-executable instructions stored in the memory to implement the Bluetooth connection processing method described in the first aspect and various possible designs of the first aspect.

[0153] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the Bluetooth connection processing method described in the first aspect and various possible designs of the first aspect is implemented.

[0154] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the Bluetooth connection processing method described in the first aspect and various possible designs of the first aspect.

[0155] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0156] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0157] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A Bluetooth connection processing method, characterized in that: Applicable to terminal devices with applications installed, including: In response to a Bluetooth connection request from a Bluetooth device, obtaining a current Bluetooth connection mode of the terminal device, wherein the Bluetooth device has a microphone; If the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, creating a virtual microphone module, wherein the virtual microphone module is used to display to the user that the terminal device can use the microphone of the Bluetooth device; If it is detected that the preset condition for using the microphone is met, the first connection mode is switched to a second connection mode in which the microphone can be used.

2. The method according to claim 1, characterized in that If it is detected that the preset condition for using the microphone is met, switching the first connection mode to a second connection mode in which the microphone can be used includes: If it is detected that there is a recording stream, it is determined that the preset condition for using the microphone is met, and the first connection mode is switched to a second connection mode in which the microphone can be used.

3. The method according to claim 2, characterized in that If the recording stream is detected, determining that the preset condition for using the microphone is met includes: Get the current number of recording streams through the Bluetooth management module; If the number of the recording streams is greater than 0, it is detected that there are recording streams, and it is determined that the preset conditions for using the microphone are met.

4. The method according to claim 3, characterized in that The number of applications installed on the terminal device is one or more; Accordingly, obtaining the number of current recording streams through the Bluetooth management module includes: In response to receiving a start recording request from any application, calling an audio server to create a recording stream, and notifying a Bluetooth management module to create a recording stream event through the audio server; In response to receiving a request to end recording from any application, calling the audio server to destroy the recording stream, and notifying the Bluetooth management module of the event of destroying the recording stream through the audio server; The recording streams are counted through the Bluetooth management module. If the Bluetooth management module receives a create recording stream event, the number of recording streams is increased by 1. If the Bluetooth management module receives a destroy recording stream event, the number of recording streams is reduced by 1 to obtain the current number of recording streams.

5. The method according to claim 1, characterized in that: The virtual microphone module includes a virtual connection device unit, a virtual microphone volume unit and a virtual microphone audio unit; The virtual connection device unit is used to display the device identification of the Bluetooth device connected to the terminal device to the user; The virtual microphone volume unit is used to control and / or display the input volume parameters of the microphone to the user; The virtual microphone audio unit is used to display the input audio parameters of the microphone to the user.

6. The method according to claim 5, characterized in that The virtual microphone volume unit includes an input volume control button; the method further includes: In response to an adjustment operation on the input volume control button, an input volume parameter of the microphone is adjusted according to the adjustment operation.

7. The method according to claim 1, characterized in that After switching the first connection mode to the second connection mode in which a microphone can be used, the method further includes: Deleting the virtual microphone module and creating a real microphone module, wherein the real microphone module is used to connect to and / or control the microphone of the Bluetooth device; Obtaining the input volume parameter of the microphone in the virtual microphone module; The real input volume parameter of the microphone in the created real microphone module is synchronized with the input volume parameter of the microphone in the virtual microphone module.

8. The method according to claim 7, characterized in that The real microphone module includes a connection device unit, a microphone volume unit and a microphone audio unit; The connecting device unit is used to display to the user the device identification of the Bluetooth device to which the terminal device is actually connected; The microphone volume unit is used to control and / or display the real input volume parameter of the microphone to the user; The microphone audio unit is used to display the real input audio parameters of the microphone to the user.

9. The method according to any one of claims 1 to 8, characterized in that: After switching the first connection mode to the second connection mode in which a microphone can be used, the method further includes: In response to a disconnection request to disconnect the Bluetooth device, determining whether the terminal device has created a virtual microphone module; If the terminal device has created a virtual microphone module, the virtual microphone module is deleted.

10. The method according to any one of claims 1 to 8, characterized in that: After switching the first connection mode to the second connection mode in which a microphone can be used, the method further includes: In response to a preset condition for using the microphone not being met, switching the second connection mode to the first connection mode.

11. The method according to claim 10, characterized in that In response to not meeting the preset condition for using the microphone, switching the second connection mode to the first connection mode includes: If it is detected that no recording stream exists, it is determined that the preset condition for using the microphone is not met, and the second connection mode is switched to the first connection mode.

12. The method according to claim 11, characterized in that If it is detected that no recording stream exists, determining that a preset condition for using the microphone is not met includes: Get the current number of recording streams through the Bluetooth management module; If the number of the recording streams is less than or equal to 0, it is detected that no recording stream exists, and it is determined that the preset condition for using the microphone is not met.

13. The method according to claim 10, characterized in that After switching the second connection mode to the first connection mode, the method further includes: Delete the real microphone module and create a new virtual microphone module; Obtaining a real input volume parameter of a microphone in the real microphone module; The input volume parameter of the microphone in the created virtual microphone module is synchronized with the real input volume parameter of the microphone in the real microphone module.

14. A Bluetooth connection processing device, characterized in that: Applicable to terminal devices with applications installed, including: An acquisition module, configured to acquire a current Bluetooth connection mode of a terminal device in response to a Bluetooth connection request of a Bluetooth device, wherein the Bluetooth device has a microphone; a creation module, configured to create a virtual microphone module if the Bluetooth connection mode is the first connection mode in which the microphone cannot be used, wherein the virtual microphone module is configured to display to the user that the terminal device can use the microphone of the Bluetooth device; The switching module is used to switch the first connection mode to a second connection mode in which the microphone can be used if it is detected that a preset condition for using the microphone is met.

15. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the Bluetooth connection processing method according to any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the Bluetooth connection processing method according to any one of claims 1 to 13 is implemented.

17. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the Bluetooth connection processing method according to any one of claims 1 to 13.