Equipment management method and electronic equipment
By obtaining audio playback device information through a unified interface, the problems of high application development difficulty and long user waiting time in existing technologies are solved, thereby improving device management efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2026-04-17
AI Technical Summary
When users switch between electronic devices to play audio, existing technologies require frequent interactions between multiple modules, which makes application development difficult and user waiting time long.
By obtaining audio playback device information with different connection states through a unified interface, the difficulty of application development is reduced and the efficiency of device management is improved.
This reduces the difficulty of application development and improves the efficiency of device management, thereby reducing user waiting time.
Smart Images

Figure CN121879704A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a device management method and an electronic device. Background Technology
[0002] With the development of terminal audio technology, electronic devices can establish communication connections with various other electronic devices and choose to play audio through these other devices, meeting users' audio playback needs in different scenarios. For example, while making a call through a mobile phone speakerphone, a user can choose to switch to using a Bluetooth headset or Bluetooth speaker connected to the phone to play the call audio.
[0003] Generally, when a user chooses to switch to a device that is not currently connected, multiple interactions are required between the application performing audio playback and various modules in the system service layer (such as the Bluetooth service module and the audio framework module) to re-establish the connection between the electronic device and the user's chosen device. This necessitates configuring the interfaces between the application and these multiple modules separately during application development, significantly increasing the complexity of the application. Furthermore, the interactions between these multiple modules during the reconnection process result in longer user wait times, negatively impacting the user experience. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a device management method and an electronic device. The technical solution provided by this application allows the application to obtain information about audio playback devices in different connection states through a unified first interface, thereby reducing application development difficulty and improving device management efficiency.
[0005] To achieve the above-mentioned technical objectives, this application provides the following technical solution:
[0006] A first aspect provides a device management method, comprising: a first application of a first electronic device receiving a user instruction to switch an audio playback device; in response to the first operation, the first electronic device displaying a device selection interface; wherein the device selection interface displays information about multiple audio playback devices, the information of which is obtained by the first application through a first interface, the first interface being used to obtain information about audio playback devices in a first connected state and audio playback devices in a second connected state; the audio playback devices in the first connected state establish a communication connection with the first electronic device, and the audio playback devices in the second connected state do not establish a communication connection with the first electronic device but are in a connectable state.
[0007] In this way, the first application can obtain information about audio playback devices with different connection states through a unified first interface, without having to configure multiple interfaces adapted to multiple modules in the first application, thus reducing the difficulty of application development.
[0008] In addition, the first application can obtain information about audio playback devices in different connection states through the first interface, display a device selection interface, and improve device management efficiency.
[0009] In some examples, the audio playback device in the first connection state is, for example, a physically connected device, and the audio playback device in the second connection state is, for example, a virtually connected device.
[0010] In some examples, the audio playback device is, for example, a Bluetooth device.
[0011] According to the first aspect, the method further includes: in response to a second operation by the user on a device selection interface, a first application obtains a first audio playback device from a plurality of audio playback devices selected by the user. The first application instructs the first audio playback device and the first electronic device to establish a communication connection and play audio from the first application via a second interface. Alternatively, in response to a third operation by the user on a device selection interface, the first application obtains a second audio playback device from a plurality of audio playback devices selected by the user. The first application instructs the second audio playback device to play audio from the first application via a second interface.
[0012] The second interface differs from the first interface. For example, the first interface is provided by the audio framework module in the application framework layer to the application in the application layer, and is used to provide information about the audio playback device. The second interface is the interface through which the application sends information to the audio playback module.
[0013] Thus, after the first application obtains the audio playback device that the user needs to use, it can instruct the audio playback device that the user needs to use to play audio through the second interface.
[0014] According to the first aspect, or any implementation of the first aspect above, before the first electronic device displays a device selection interface, the method further includes: in response to the first operation, the first application obtains information about multiple audio playback devices through a first interface. Alternatively, the first application obtains information about multiple audio playback devices that meet preset conditions reported through the first interface. The preset conditions include changes in the audio playback devices associated with the first electronic device.
[0015] For example, in response to the first operation, the first application actively obtains information about multiple audio playback devices through the first interface, in order to display the device selection interface.
[0016] For example, after the first application starts or triggers the start of a certain function, the first application can also actively obtain information about multiple audio playback devices through the first interface.
[0017] For example, when the multiple audio playback devices associated with the first electronic device change, the first application can passively obtain the updated information of the multiple audio playback devices through the first interface. Subsequently, in response to the first operation, the first application can display a device selection interface based on the updated information of the multiple audio playback devices. For instance, the audio framework module stores information about multiple audio playback devices. After the information of the audio playback devices is updated and preset conditions are met, the audio framework module can report the updated information of the multiple audio playback devices to the first application through the first interface.
[0018] Optionally, the associated multiple audio playback devices may change, for example, multiple audio playback devices may no longer be virtual or physical connection devices. Optionally, the first application may be unaware that multiple audio playback devices have changed from physical connection devices to virtual connection devices, or from virtual connection devices to physical connection devices.
[0019] In this way, the first application can flexibly obtain information about the audio device in multiple ways, thereby increasing the flexibility of device management.
[0020] For example, the first audio playback device is in a second connection state, and the second audio playback device is in a first connection state. The first audio playback device is a virtual connection device, and the second audio playback device is a real connection device.
[0021] According to the first aspect, or any implementation of the first aspect above, the information of the multiple audio playback devices includes the device identifiers and / or device types of the multiple audio playback devices.
[0022] In this way, the first application does not need to distinguish the connection status of multiple audio playback devices, and the user does not need to pay attention to the connection status of multiple audio playback devices. Instead, the connection status of multiple audio playback devices is managed through the audio framework module.
[0023] According to the first aspect, or any implementation of the first aspect above, the first electronic device further includes a Bluetooth service module, which stores pairing information of multiple audio playback devices.
[0024] The Bluetooth connection process includes a pairing process and a connection process. During the pairing process, the Bluetooth service module in the first electronic device can obtain the pairing information of the peer device. Therefore, regardless of whether the multiple audio playback devices are physically connected or virtually connected, the Bluetooth service module in the first electronic device stores the pairing information of these multiple audio playback devices.
[0025] Optionally, if the first audio playback device is a virtual connection device, the Bluetooth service module can trigger the re-establishment of a communication connection with the first audio playback device based on the pairing information of the first audio playback device.
[0026] According to the first aspect, or any implementation of the first aspect above, the first electronic device further includes an audio framework module. In response to the first operation, the first application obtains information about multiple audio playback devices through the first interface, including: in response to the first operation of the user instructing the user to switch audio playback devices in the first application, the first application calls the first interface provided by the audio framework module to obtain information about multiple audio playback devices.
[0027] According to the first aspect, or any implementation of the first aspect above, the first electronic device includes an application layer and a system service layer, with the first application located in the application layer and the audio framework module located in the system service layer.
[0028] In this way, through a unified interface between the system service layer and the application layer, different applications can call the audio framework module through this unified interface to obtain information about all available Bluetooth devices, thereby effectively reducing the difficulty of application development.
[0029] According to the first aspect, or any implementation of the first aspect above, the information of the multiple audio playback devices includes the connection status of the multiple audio playback devices, and the audio framework module stores the connection status of the multiple audio playback devices.
[0030] Thus, compared to existing technologies where the Bluetooth service module only reports information about the physically connected device to the audio framework module, the device management method provided in this application allows the Bluetooth service module to report information about both the virtual and physically connected devices to the audio framework module, thereby enabling unified management of Bluetooth devices by the audio framework module.
[0031] According to the first aspect, or any implementation of the first aspect above, the first application instructs a first audio playback device and a first electronic device to establish a communication connection and play audio from the first application via a second interface, including: the first application sending a device usage instruction to an audio framework module via the second interface, the device usage instruction indicating the use of the first audio playback device. In response to the device usage instruction, the audio framework module determines that the first audio playback device is in a second connection state based on the connection status of multiple audio playback devices. The audio framework module sends a device connection instruction to a Bluetooth service module, triggering the Bluetooth service module to establish a communication connection with the first audio playback device. In response to the establishment of the communication connection, the audio framework module triggers the first audio playback device to play audio from the first application via the communication connection.
[0032] In this way, the audio framework module manages all Bluetooth devices related to the first electronic device in a unified manner, integrates the Bluetooth device selection process, improves the processing efficiency of virtual connection device connection and disconnection, and reduces user waiting time.
[0033] Secondly, a first electronic device is provided. The first electronic device includes a processor and a memory. The memory is coupled to the processor and stores computer program code, including computer instructions. When the processor reads the computer instructions from the memory, the first electronic device performs the following operation: a first application of the first electronic device receives a user instruction to switch an audio playback device. In response to this first operation, the first electronic device displays a device selection interface. The device selection interface displays information about multiple audio playback devices, which is obtained by the first application through a first interface. The first interface is used to obtain information about audio playback devices in a first connected state and audio playback devices in a second connected state. The audio playback devices in the first connected state establish a communication connection with the first electronic device, while the audio playback devices in the second connected state do not establish a communication connection with the first electronic device but are in a connectable state.
[0034] According to the second aspect, when the processor reads computer instructions from memory, causing the first electronic device to execute: in response to a second operation by the user on a device selection interface, the first application acquires a first audio playback device from a plurality of audio playback devices selected by the user. The first application instructs the first audio playback device and the first electronic device to establish a communication connection and play audio from the first application via a second interface. Alternatively, in response to a third operation by the user on the device selection interface, the first application acquires a second audio playback device from a plurality of audio playback devices selected by the user. The first application instructs the second audio playback device to play audio from the first application via a second interface.
[0035] According to the second aspect, when the processor reads computer instructions from memory, causing the first electronic device to execute: in response to the first operation, the first application obtains information about multiple audio playback devices through the first interface. Alternatively, the first application obtains information about multiple audio playback devices that meet preset conditions reported through the first interface. The preset conditions include a change in the audio playback devices associated with the first electronic device.
[0036] According to the second aspect, or any implementation of the second aspect above, the information of the multiple audio playback devices includes the device identifiers and / or device types of the multiple audio playback devices.
[0037] According to the second aspect, or any implementation of the second aspect above, the first electronic device further includes a Bluetooth service module, which stores pairing information for multiple audio playback devices.
[0038] According to the second aspect, or any implementation of the second aspect above, the first electronic device further includes an audio framework module. In response to the first operation, the first application obtains information about multiple audio playback devices through the first interface, including: in response to the first operation of the user instructing the user to switch audio playback devices in the first application, the first application calls the first interface provided by the audio framework module to obtain information about multiple audio playback devices.
[0039] According to the second aspect, or any implementation of the second aspect above, the information of multiple audio playback devices includes the connection status of multiple audio playback devices, and the audio framework module stores the connection status of multiple audio playback devices.
[0040] According to the second aspect, or any implementation thereof, the first application instructs the first audio playback device and the first electronic device to establish a communication connection and play audio from the first application via the second interface, including: the first application sending a device usage instruction to the audio framework module via the second interface, the device usage instruction indicating the use of the first audio playback device. In response to the device usage instruction, the audio framework module determines that the first audio playback device is in a second connection state based on the connection status of multiple audio playback devices. The audio framework module sends a device connection instruction to the Bluetooth service module, triggering the Bluetooth service module to establish a communication connection with the first audio playback device. In response to the establishment of the communication connection, the audio framework module triggers the first audio playback device to play audio from the first application via the communication connection.
[0041] Thirdly, an electronic device is provided, comprising: an audio framework module. The audio framework module is configured to report information about multiple audio playback devices to a first application via a first interface, the first interface being used to report information about audio playback devices in a first connected state and audio playback devices in a second connected state; the audio playback devices in the first connected state establish a communication connection with the electronic device, while the audio playback devices in the second connected state do not establish a communication connection with the electronic device but are in a connectable state.
[0042] In this way, the audio framework module can report information about audio playback devices with different connection states to the first application, without having to configure multiple interfaces adapted to multiple modules in the first application, thus reducing the difficulty of application development.
[0043] In addition, the audio framework module manages information about audio playback devices in different connection states, improving device management efficiency.
[0044] According to the third aspect, the audio framework module is also used to store the connection status of multiple audio playback devices, and the information of the multiple audio playback devices includes the connection status of the multiple audio playback devices.
[0045] In this way, the connection status of multiple audio playback devices can be maintained through the audio framework module, thereby improving the efficiency of device management.
[0046] According to the third aspect, or any implementation of the third aspect above, the audio framework module is further configured to: receive a first device usage instruction sent by the first application through a second interface, the first device usage instruction indicating the use of a first audio playback device; in response to the first device usage instruction, determine that the first audio playback device is in a second connection state based on the connection status of multiple audio playback devices; send a device connection instruction to the Bluetooth service module, triggering the Bluetooth service module to establish a first connection with the first audio playback device; and in response to the establishment of the first connection, trigger the first audio playback device to play the audio of the first application through the first connection.
[0047] According to the third aspect, or any implementation of the third aspect above, the audio framework module is further configured to: receive a second device usage instruction sent by the first application through a second interface, the second device usage instruction indicating the use of a second audio playback device; in response to the second device usage instruction, determine that the second audio playback device is in a first connection state based on the connection status of multiple audio playback devices; and trigger the second audio playback device to play audio from the first application through a second connection between the electronic device and the second audio playback device.
[0048] In this way, the audio framework module can determine the connection status of the audio playback device currently used by the first application based on the connection status of multiple maintained audio playback devices. When the connection status is in the second connection state, the audio framework module can actively trigger the electronic device to establish a communication connection with the corresponding virtual connection device, effectively improving communication efficiency compared to the audio framework module passively waiting for device connections. When the connection status is in the first connection state, the audio framework module can directly achieve audio playback through the communication connection between the electronic device and the corresponding physical connection device.
[0049] According to the third aspect, or any implementation of the third aspect above, the audio framework module is used to respond to the request of the first application and report information of multiple audio playback devices to the first application through the first interface.
[0050] In this way, the audio framework module can report the latest information of multiple audio playback devices through the first interface according to the application's request.
[0051] According to the third aspect, or any of the above implementations of the third aspect, the audio framework module is also used to report the updated audio playback device information to the first application through the first interface when multiple audio playback devices change.
[0052] In this way, the audio framework module can respond to changes in multiple audio playback devices and proactively report the updated information of multiple audio playback devices to the first application through the first interface.
[0053] In this way, the first application can display a device selection interface based on the latest information of multiple audio playback devices, meeting the user's needs to switch between audio playback devices and avoiding errors.
[0054] According to the third aspect, or any implementation of the third aspect above, the information of the multiple audio playback devices includes the device identifiers and / or device types of the multiple audio playback devices.
[0055] Fourthly, an electronic device is provided that has the function of implementing the method described in the first aspect and any of its possible implementations. This function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the described function.
[0056] Fifthly, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as instructions or code) that, when executed by an electronic device, causes the electronic device to perform the method of the first aspect or any embodiment of the first aspect.
[0057] In a sixth aspect, a computer program product is provided that, when the computer program product is run on an electronic device, causes the electronic device to perform the method of the first aspect or any one of the embodiments of the first aspect.
[0058] In a seventh aspect, a circuit system is provided, the circuit system including processing circuitry configured to perform the method of the first aspect or any embodiment of the first aspect.
[0059] Eighthly, a chip system is provided, including at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor, and when the at least one processor executes the instructions, the at least one processor performs the method of the first aspect or any embodiment of the first aspect.
[0060] The technical effects of the aforementioned aspects can be referenced from each other, and will not be elaborated further here. Attached Figure Description
[0061] Figure 1 A schematic diagram of the software structure of an electronic device provided in an embodiment of this application;
[0062] Figure 2 This application provides a schematic diagram of a Bluetooth device selection scenario. Figure 1 ;
[0063] Figure 3 A schematic diagram of the communication system used in the device management method provided in the embodiments of this application;
[0064] Figure 4 A schematic diagram of the hardware structure of the first electronic device provided in an embodiment of this application;
[0065] Figure 5 A schematic diagram of the software structure of the first electronic device provided in the embodiments of this application;
[0066] Figure 6 This application provides a schematic diagram of a Bluetooth device selection scenario. Figure 2 ;
[0067] Figure 7 Flowchart of the device management method provided in the embodiments of this application Figure 1 ;
[0068] Figure 8 Interface illustration provided for embodiments of this application Figure 1 ;
[0069] Figure 9 Interface illustration provided for embodiments of this application Figure 2 ;
[0070] Figure 10 Interface illustration provided for embodiments of this application Figure 3 ;
[0071] Figure 11 Flowchart of the device management method provided in the embodiments of this application Figure 2 ;
[0072] Figure 12 A schematic diagram of the structure of the first electronic device provided in an embodiment of this application. Detailed Implementation
[0073] The technical solutions of the embodiments of this application are described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one or more (including two).
[0074] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0075] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0076] In some embodiments, applications in an electronic device invoke hardware resources through modules in the system service layer. For example, such as Figure 1 As shown, the application layer includes at least one application. The system service layer includes a Bluetooth service module, an audio framework module, etc. The Bluetooth service module connects to and manages Bluetooth devices connected to the electronic device and sends information about these Bluetooth devices to relevant applications or modules. Optionally, Bluetooth devices may include Bluetooth devices currently connected to the electronic device; for example, these Bluetooth devices can be described as physically connected devices. Alternatively, Bluetooth devices may also include Bluetooth devices that have previously connected to the electronic device and are currently in a connectable state; for example, these Bluetooth devices can be described as virtually connected devices. The audio framework module can be used to manage sound-generating devices in the hardware layer. For example, the audio framework module can also be used to coordinate audio data transmission between the application and the sound-generating devices.
[0077] In some examples, the Bluetooth service module sends information about physically connected devices to the audio framework module. In other examples, the Bluetooth service module sends information about virtually connected devices to the application. Accordingly, the application can configure relevant interfaces to query Bluetooth device information from the system service side. For example, the application can query the Bluetooth service module for information about virtually connected devices through interface 1, and the application can query the audio framework module for information about physically connected devices through interface 2.
[0078] For example, such as Figure 2 As shown, the application responds to user actions and triggers a switch of Bluetooth devices. The application can obtain information about the physically connected device by calling the interface provided by the audio framework module, and it can also obtain information about the virtually connected device by calling the interface provided by the Bluetooth service module. Based on this information, the application can then display a Bluetooth device selection interface for the user to choose a Bluetooth device.
[0079] If the user selects a physically connected Bluetooth device, the application can instruct the selected device through the interface provided by the audio framework module. Correspondingly, the audio framework module can trigger the corresponding Bluetooth device to act as the sound-producing device and set relevant audio playback parameters. If the user selects a virtual connected Bluetooth device, the application can trigger the electronic device to re-establish a connection with the selected virtual connected device through the interface provided by the Bluetooth service module. Correspondingly, after the Bluetooth service module completes the re-establishment of the connection between the electronic device and the selected virtual connected device, it can report the relevant information of the currently connected Bluetooth device to the audio framework module. The audio framework module can then report this information to the application, and the application, based on the user's selection, instructs the audio framework module to set the Bluetooth device as the sound-producing device.
[0080] It can be seen that the current application needs to adapt to the interfaces provided by multiple modules, resulting in significant application development difficulty. Furthermore, when the user selects a Bluetooth device as a virtual connection device, the application needs to trigger a re-establishment of the connection between the electronic device and the virtual connection device. The audio framework module must passively wait for the connection to be re-established before it can trigger the audio playback process, leading to long user wait times and low overall device management efficiency.
[0081] Therefore, this application provides a device management system that can maintain the connection status between electronic devices and other devices through an audio framework module, reducing application development difficulty and audio playback waiting time.
[0082] Figure 3 This is a schematic diagram of the communication system used in the device management method provided in the embodiments of this application. Figure 3 As shown, the communication system includes a first electronic device 100 and a second electronic device 200.
[0083] Optionally, the first electronic device 100 may be a mobile phone, computer, tablet computer, laptop computer, ultra-mobile personal computer (UMPC), vehicle terminal, netbook, personal digital assistant (PDA), wearable device, artificial intelligence (AI) device, or other terminal device. The operating system installed on the first electronic device 100 may include, but is not limited to, those that are not installed on the mobile phone, computer, tablet computer, laptop computer, ultra-mobile personal computer (UMPC), vehicle terminal, netbook, personal digital assistant (PDA), wearable device, artificial intelligence (AI) device, etc. Alternatively, other operating systems may be used. This application embodiment does not limit the specific type of the first electronic device 100 or the operating system installed thereon.
[0084] Optionally, the second electronic device 200 may include, for example, at least one audio playback device. Optionally, the second electronic device 200 may be, for example, a wired headset, a wireless Bluetooth headset, a Bluetooth speaker, a neckband wireless headset, a wireless over-ear headset, a calling wristband / watch AI device, or other terminal device. The operating system installed on the second electronic device 200 may include, but is not limited to, […]. Alternatively, other operating systems may be used. This application does not limit the specific type of the second electronic device 200 or the operating system installed thereon.
[0085] In some embodiments, a wireless communication connection is established between the first electronic device 100 and the second electronic device 200. The wireless communication technology used to establish this connection includes, but is not limited to, at least one of the following: Bluetooth (BT) (e.g., classic Bluetooth or Bluetooth Low Energy (BLE) Bluetooth), wireless local area networks (WLAN) (such as Wireless Fidelity (Wi-Fi) networks), near field communication (NFC), Zigbee, frequency modulation (FM), infrared (IR), ultra-wideband (UWB), and star-flash technology.
[0086] In some embodiments, the second electronic device 200 is a physical or virtual connection device capable of establishing a communication connection with the first electronic device 100. Optionally, the communication connection established between the first electronic device 100 and the second electronic device 200 can be a wired communication connection or a wireless communication connection established based on the wireless communication technology described above.
[0087] Optionally, the first electronic device 100 and the second electronic device 200 in the embodiments of this application can be implemented by different devices. Different devices can have the same, similar, or somewhat different hardware structures, for example... Figure 4 The hardware structure shown.
[0088] For example, the first electronic device 100 has such Figure 4 Taking the hardware structure shown as an example, for Figure 4 The hardware structure shown will be explained.
[0089] like Figure 4 As shown, the first electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0090] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the first electronic device 100. In other embodiments of this application, the first electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0091] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0092] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0093] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0094] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.
[0095] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the shooting function of the first electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to enable the display function of the first electronic device 100.
[0096] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the first electronic device 100. In other embodiments of this application, the first electronic device 100 may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.
[0097] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the first electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0098] The wireless communication module 160 can provide solutions for wireless communication applications on the first electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0099] The first electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0100] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be manufactured using a liquid crystal display (LCD), such as an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini-LED, a micro-LED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the first electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0101] The sensor module 180 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc.
[0102] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110. In some embodiments, the audio module 170 may include a speaker, a receiver, a microphone, a headphone jack, etc.
[0103] The software systems of the first electronic device 100 and the second electronic device 200 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses an operating system with a layered architecture in the first electronic device 100 as an example to exemplify the software structure of the first electronic device 100 and the second electronic device 200.
[0104] Figure 5This is a software structure block diagram of the first electronic device 100 according to an embodiment of this application.
[0105] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the operating system (such as HarmonyOS) is divided into three layers, from top to bottom: the application layer, the system service layer, and the kernel layer.
[0106] The application layer can include a series of application packages.
[0107] like Figure 5 As shown, the application package may include applications such as broadcast control center, hyperterminal, call, video, music, gallery, map, calendar, and contacts.
[0108] The system service layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The system service layer includes some predefined functions.
[0109] like Figure 5 As shown, the system service layer may include a Bluetooth service module, an audio framework module, a phone manager, a resource manager, a content provider, a window manager, etc.
[0110] The Bluetooth service module connects to and manages Bluetooth devices connected to the first electronic device, and sends information about these Bluetooth devices to relevant applications or modules. In some examples, the Bluetooth service module may send Bluetooth device status information to the audio framework module, including information indicating whether the Bluetooth device is physically connected or virtually connected.
[0111] The audio framework module is used to manage the status information of Bluetooth devices, report available Bluetooth devices to the application, select the sound-emitting device, and trigger the Bluetooth service module to re-establish the connection with the virtual connection device based on the status information of the Bluetooth device.
[0112] For example, such as Figure 6 As shown, the audio framework module integrates the device management functions of the Bluetooth service module and provides a unified interface to the application layer. The application layer can manage all Bluetooth devices through this unified interface. Optionally, this unified interface can be used to implement functions such as Bluetooth device querying, Bluetooth device status detection, and sound device selection. Thus, during application development, applications only need to adapt to this unified interface to switch sound devices, reducing application development complexity. Furthermore, applications can switch sound devices simply by interacting with the audio framework module, thereby improving device management efficiency.
[0113] In some examples, the Bluetooth service module can obtain the status information of the Bluetooth device, including information such as whether the Bluetooth device is connected, disconnected, or available for connection. Optionally, the Bluetooth service module sends the Bluetooth device status information to the audio framework module.
[0114] In some examples, the audio framework module can obtain available Bluetooth devices based on status information, which may include, for example, physically connected devices and virtually connected devices. Optionally, such as... Figure 6 As shown, applications in the application layer can obtain available Bluetooth devices reported by the audio framework module by calling a unified interface. In response to the user's selection of an available Bluetooth device, the audio framework module, based on whether the selected device is a physically connected device, can invoke the corresponding physically connected device through the connection driver; alternatively, if the selected device is a virtually connected device, the audio framework module can instruct the Bluetooth service module to re-establish a Bluetooth communication connection with that virtually connected device. Then, based on the Bluetooth communication connection establishment response sent by the Bluetooth service module, the audio module can again invoke the corresponding Bluetooth device (such as the original virtually connected device) through the connection driver.
[0115] The phone manager is used to provide communication functions for the first electronic device 100. For example, it manages call status (including connection, hang-up, etc.).
[0116] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0117] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0118] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0119] The kernel layer is the layer between hardware and software. The kernel layer includes at least audio drivers, connectivity drivers, camera drivers, display drivers, and sensor drivers. Optionally, connectivity drivers include at least a Bluetooth driver.
[0120] The hardware layer includes, for example, the hardware in the first electronic device 100, such as a speaker. The hardware layer also includes, for example, a second electronic device 200 that establishes a communication connection with the first electronic device 100. For example, the second electronic device 200 could be a Bluetooth device for audio playback.
[0121] The following section uses the communication connection established between the first electronic device 100 and the second electronic device 200 as a Bluetooth communication connection, with the first electronic device 100 being the first electronic device and the second electronic device 200 being a Bluetooth device, to provide a detailed description of the device management method provided in the embodiments of this application.
[0122] This application uses a Bluetooth audio communication scenario as an example to introduce the device management method. It should be understood that the device management method provided in this application can also be applied to other audio communication scenarios, such as WiFi audio communication scenarios. For example, some second electronic devices 200 support WiFi communication and can achieve audio data transmission with the first electronic device 100 through WiFi communication connection. Therefore, the audio devices selectable by the first electronic device 100 include Bluetooth devices and / or WiFi devices. The audio framework module in the first electronic device 100 can also integrate the device management function of the WiFi service module to achieve unified management of audio devices. This application will not provide examples of other audio communication scenarios.
[0123] Figure 7 This is a flowchart illustrating a device management method provided in an embodiment of this application. It should be noted that this method does not rely on... Figure 7 The specific order described below is a limitation. It should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:
[0124] S701, the Bluetooth service module sends the status information of the Bluetooth device to the audio frame module.
[0125] The status information includes, for example, information such as the Bluetooth device's connection status, disconnection status, device connectability status, name, and address.
[0126] In some embodiments, both the first electronic device and the second electronic device are equipped with a Bluetooth service module. A Bluetooth communication connection between the first electronic device and the second electronic device can be established through the pairing connection of the Bluetooth service modules between the devices.
[0127] In some examples, the Bluetooth communication connection establishment process includes at least a pairing process and a connection process. After the first and second electronic devices enable Bluetooth, they can discover each other via Bluetooth near-field communication. For example, the first electronic device can subsequently display a device list including at least one Bluetooth device discovered by the first electronic device, such as the second electronic device. Then, the first electronic device can determine the target Bluetooth device based on the user's selection in the device list. The first electronic device can then enter the pairing process with the target Bluetooth device. During the pairing process, the first electronic device can display a randomly generated pairing code, such as a personal identification number (PIN), through interaction with the target Bluetooth device. Then, based on the user's confirmation, the first electronic device (or the target Bluetooth device) can confirm that the pairing code displayed by both devices is the same, thus confirming the other device as a trusted device and triggering the connection process. Optionally, during the pairing process, after confirming the correct pairing code based on the user's action, the first electronic device can also exchange a security key with the target Bluetooth device through interaction. This security key can be used to encrypt data transmitted between the first electronic device and the target Bluetooth device via the Bluetooth communication connection. In this way, the pairing process ensures the security of Bluetooth communication between the first electronic device and the target Bluetooth device. Afterwards, once the first electronic device confirms that the pairing process with the target Bluetooth device is complete, it can enter the connection process to establish a Bluetooth communication connection with the target Bluetooth device.
[0128] Optionally, after establishing a Bluetooth communication connection with the target Bluetooth device, the first electronic device may save the pairing information of the target Bluetooth device. Optionally, this pairing information may include, for example, the device identifier, Bluetooth identifier, and address of the target Bluetooth device.
[0129] Optionally, the first electronic device may establish a Bluetooth communication connection with at least one Bluetooth device and save the pairing information of the at least one Bluetooth device. Optionally, the first electronic device may delete the pairing information of the Bluetooth device according to user operation.
[0130] Optionally, the first electronic device can disconnect the Bluetooth communication connection after establishing it with the Bluetooth device. For example, after data transmission is complete, the first electronic device or the Bluetooth device can turn off the Bluetooth function according to user operation, thus disconnecting the Bluetooth communication connection between the first electronic device and the Bluetooth device. Another example is that during data transmission, the first electronic device or the Bluetooth device moves, and the distance between the two devices exceeds the Bluetooth communication range, causing an unexpected disconnection of the Bluetooth communication connection.
[0131] Optionally, after the Bluetooth communication connection is disconnected, the first electronic device can still save the pairing information of the Bluetooth device corresponding to the Bluetooth communication connection.
[0132] Optionally, the first electronic device can trigger a Bluetooth reconnection process with the corresponding Bluetooth device based on the pairing information. For example, if the Bluetooth device is within the Bluetooth communication range of the first electronic device and the first electronic device has stored the pairing information of the Bluetooth device, the first electronic device can trigger a reconnection process with the Bluetooth device based on user operation, such as re-establishing a Bluetooth communication connection by re-performing the connection process with the Bluetooth device based on the pairing information. The Bluetooth device has its Bluetooth function enabled.
[0133] In some embodiments, the Bluetooth service module is used to connect to and manage Bluetooth devices connected to the first electronic device. After establishing a Bluetooth communication connection with the Bluetooth device, the Bluetooth service module can obtain relevant status information. Furthermore, the Bluetooth service module also sends this status information to the audio framework module.
[0134] In some examples, the Bluetooth service module can generate corresponding status information based on the connection status between the Bluetooth device and the first electronic device. Optionally, after the connection status changes, the Bluetooth service module can also send updated status information to the audio framework module. Optionally, the connection status includes at least one of the following: the Bluetooth device and the first electronic device maintain a Bluetooth communication connection; the Bluetooth device and the first electronic device have disconnected the Bluetooth communication connection, but the first electronic device retains the pairing information of the Bluetooth device; the Bluetooth device and the first electronic device have disconnected the Bluetooth communication connection, the first electronic device retains the pairing information of the Bluetooth device, and the Bluetooth device is in a connectable state; the Bluetooth device and the first electronic device have disconnected, and the first electronic device has deleted the pairing information of the Bluetooth device.
[0135] Optionally, if the first electronic device has saved the pairing information of the Bluetooth device, and the Bluetooth device is within the Bluetooth communication range of the first electronic device, the Bluetooth device is in a state where a Bluetooth communication connection can be established with the first electronic device. The Bluetooth device has its Bluetooth function enabled.
[0136] The Bluetooth communication range of the first electronic device is, for example, the range covered by the Bluetooth communication distance supported by the first electronic device. For example, the Bluetooth communication range of the first electronic device is within 10 meters (or 20 meters, 30 meters, etc.) of the first electronic device.
[0137] Optionally, after enabling Bluetooth, the Bluetooth device sends Bluetooth broadcasts at preset intervals. These broadcasts can also be described as heartbeat messages. Optionally, these Bluetooth broadcasts are used to inform other nearby devices that the Bluetooth device is currently in a connectable state. Other devices (such as the first electronic device) can then search for these Bluetooth messages to identify nearby connectable Bluetooth devices and determine whether those devices are in a state where a Bluetooth communication connection can be established with the first electronic device.
[0138] S702, the audio frame module reports available Bluetooth devices to the application.
[0139] In some embodiments, the audio framework module may receive status information sent by the Bluetooth service module. Optionally, the audio framework module obtains currently available Bluetooth devices based on the received status information. These available Bluetooth devices include virtual connected devices and physically connected devices. Optionally, virtual connected devices include Bluetooth devices that have previously established a Bluetooth communication connection with the first electronic device and are currently in a connectable state. Physically connected devices include Bluetooth devices that are currently maintaining a Bluetooth communication connection with the first electronic device. Optionally, as described in step S702 above, the Bluetooth device indicates that it is currently in a connectable state by broadcasting a message. Wherein, when a Bluetooth device is in a connectable state, it may not have established a Bluetooth connection with other devices, or it may have already established a connection with other devices. Optionally, the audio framework in the first electronic device obtains virtual connected devices that have not established a connection with the first electronic device. Subsequently, while the virtual connection device is already connected to other devices, the first electronic device can establish a connection with the virtual connection device through preemption. That is, the virtual connection device disconnects from other devices and establishes a connection with the first electronic device; or, the virtual connection device establishes a connection with the first electronic device while maintaining connections with other devices, that is, the virtual connection device establishes Bluetooth connections with multiple devices simultaneously. This will not be elaborated further below.
[0140] Optionally, the Bluetooth service module stores pairing information for virtual and physical connected devices.
[0141] In some examples, the Bluetooth service module determines whether the Bluetooth device is a virtual or physical connection device based on the connection status between the Bluetooth device and the first electronic device. Subsequently, the status information sent by the Bluetooth service module to the audio framework module can directly indicate whether the corresponding Bluetooth device is a virtual or physical connection device. That is, the audio framework module and / or the Bluetooth service module can be used to determine whether the Bluetooth device is a virtual or physical connection device.
[0142] Thus, compared to existing technologies where the Bluetooth service module only reports information about the physically connected device to the audio framework module, the device management method provided in this application allows the Bluetooth service module to report information about both the virtual and physically connected devices to the audio framework module, thereby enabling unified management of Bluetooth devices by the audio framework module.
[0143] In some embodiments, the audio framework module maintains a list of available Bluetooth devices. Optionally, the list of available Bluetooth devices includes available Bluetooth devices and their connection status. The connection status includes, for example, information indicating whether these available Bluetooth devices are virtually connected or physically connected.
[0144] In some examples, the audio framework module can update the list of available Bluetooth devices in real time based on the status information received from the Bluetooth service module.
[0145] For example, as shown in Table 1 below, the audio framework module obtains the currently available Bluetooth devices, including Bluetooth device 1, Bluetooth device 2, and Bluetooth device 3, based on the status information received from the Bluetooth service module. Bluetooth device 1 and Bluetooth device 3 are physically connected devices, while Bluetooth device 2 is a virtually connected device.
[0146] Table 1
[0147] Equipment Name Connection status Bluetooth device 1 Real connection device Bluetooth device 2 Virtual connection device Bluetooth device 3 Real connection device
[0148] It should be understood that the list of available Bluetooth devices may also include other information. For example, the list of available Bluetooth devices may also include information such as device identifier and device type. The device identifier may be, for example, the device name. The device type may be, for example, an audio playback device.
[0149] In some embodiments, the audio framework module reports available Bluetooth devices to the application. For example, the audio framework module sends a list of available Bluetooth devices it maintains to the application. Optionally, the audio framework module sends the list of available Bluetooth devices to the application when at least one of the following preset scenarios is met: the audio framework module sends the list of available Bluetooth devices to the application at a preset period; the audio framework module sends an updated list of available Bluetooth devices to the application after the list of available Bluetooth devices is updated; the audio framework module sends the list of available Bluetooth devices to the application according to an application request (such as the application calling a preset unified interface).
[0150] Optionally, the audio framework module may send a list of available Bluetooth devices to the application, including sending only a portion of the information from that list. For example, the audio framework module may send the application information such as the device identifier and device identification of the available Bluetooth devices, without needing to send the connection status of the available Bluetooth devices. In other words, the application does not need to be aware of the connection status between the available Bluetooth devices and the first electronic device.
[0151] It should be understood that the content of maintaining the list of available Bluetooth devices in steps S701 and S702 is not strongly tied to the content related to switching Bluetooth devices in steps S702-S707. For example, the application can switch Bluetooth devices through steps S702-S707 based on user operation, and the maintenance of Bluetooth device-related information has already been completed before this, without needing to report the status information of the Bluetooth device through the Bluetooth service module every time a Bluetooth device is switched.
[0152] In some embodiments, the application typically plays audio via a default Bluetooth device (such as the speaker of the first electronic device). However, the user can also instruct the application to switch to a Bluetooth device for playback as needed. Alternatively, before audio playback, the application can select the desired Bluetooth device based on user input.
[0153] The following examples illustrate several common audio playback scenarios and the process by which the audio framework module reports available Bluetooth devices to the application.
[0154] Scenario 1: Audio playback scenario in the broadcast control center.
[0155] For example, such as Figure 8 As shown in (a), the first electronic device displays a control center interface based on a user's swipe-down gesture on the desktop. The control center interface displays multiple shortcut cards for quick control of the first electronic device. For example, the control center interface displays a playback control center card 81 for quick audio playback. In response to a user's action on a blank area of the playback control center card 81, the first electronic device can display... Figure 8 The broadcast control center interface shown in (b) is then displayed in response to the user's operation of the audio control control 82. Figure 8 The audio projection control interface is shown in (c). Alternatively, in response to a user's operation of the audio projection control control 83 displayed on the broadcast control center card 81, the first electronic device can also display the audio projection control interface. As shown by reference numeral 84, in response to a user's operation of the audio projection control control, the broadcast control center application can obtain available Bluetooth devices reported by the audio framework module and display the available Bluetooth devices on the audio projection control interface. In this way, the user can select the Bluetooth device to switch to according to their own needs.
[0156] Scenario 2: Audio playback scenario on a super terminal.
[0157] For example, such as Figure 8As shown in (a), the control center interface displayed by the first electronic device may also include a HyperTerminal card 85. The HyperTerminal application can display available Bluetooth devices on the HyperTerminal card 85 based on the available Bluetooth devices reported by the audio framework module. This allows the user to select the Bluetooth device to switch to according to their needs, such as by clicking the icon of the displayed Bluetooth device. Alternatively, in response to the user's operation on the search control 86 displayed on the HyperTerminal card 85, the first electronic device may display, as shown in (a). Figure 9 The illustrated HyperTerminal interface shows a first electronic device displaying an identifier 91 indicating its own location and an identifier for at least one available Bluetooth device, as shown by reference numeral 92. The user can then drag the identifier of an available Bluetooth device toward the identifier 91 on their own device, allowing the HyperTerminal application to determine the Bluetooth device selected by the user based on this drag operation.
[0158] Scenario 3: Call audio playback scenario.
[0159] For example, such as Figure 10 As shown in (a), the calling application answers or makes calls based on user input, and displays the call interface during the call. In response to user input to the more Bluetooth device control 101, the calling application can determine if the user has instructed to switch Bluetooth devices. Therefore, as... Figure 10 As shown in (b), the call application displays a prompt box 102 based on the available Bluetooth devices reported by the audio framework module. This prompt box 102 displays the Bluetooth devices currently available to the first electronic device. This allows the user to select the Bluetooth device they wish to switch to based on their needs.
[0160] It should be understood that the three audio playback scenarios in the above examples are merely illustrative. The device management method provided in this application embodiment can also be applied to other audio playback scenarios, which will not be illustrated in this application embodiment.
[0161] In some embodiments, the application does not need to distinguish the connection status of the available Bluetooth devices. Therefore, when displaying available Bluetooth devices, the application does not need to identify the connection status of each available Bluetooth device. Subsequently, the user can select a Bluetooth device according to their needs without having to pay attention to the connection status of the Bluetooth device.
[0162] For example, such as Figure 8As shown in (a), the HyperTerminal Card 85 displayed by the first electronic device shows the identifiers of Bluetooth Headset A and Bluetooth Headset B. Either or both of Bluetooth Headset A and Bluetooth Headset B can be physically connected or virtually connected. It can be seen that the HyperTerminal Card 85 does not need to display the connection status of Bluetooth Headset A and Bluetooth Headset B; the user can select them according to their needs.
[0163] For example, such as Figure 8 As shown by reference numeral 84 in Figure (c), the audio playback device currently used by the first electronic device is the local device, and the corresponding identifier for the local device is selected. In one possible scenario, if the audio playback device currently used by the first electronic device is Bluetooth headset A, then the identifier for Bluetooth headset A should be selected. In this case, Bluetooth headset A is the actual connected device of the first electronic device, while whether Bluetooth headset B is the actual connected device is not required.
[0164] S703, In response to the user's selection of a Bluetooth device, the application sends a Bluetooth device usage instruction to the audio frame module.
[0165] In some embodiments, the first electronic device may receive a user's selection of a Bluetooth device and send the information of that selection to the corresponding application, so that the application can determine the Bluetooth device indicated by the user. Subsequently, the application may send a Bluetooth device usage instruction to the audio framework module to trigger audio playback using the Bluetooth device indicated by the user.
[0166] For example, in the audio playback scenario of the broadcast control center as described in Scenario 1 above, such as... Figure 8 As shown in (c), in response to the user's operation on the selection identifier corresponding to Bluetooth headset A, the broadcast control center application can determine that the Bluetooth device indicated by the user is Bluetooth headset A. Then, the broadcast control center application can send a Bluetooth device usage instruction to the audio framework module, instructing the audio framework module to set Bluetooth headset A as the sound-producing device.
[0167] For example, in the audio playback scenario of the super terminal as described in Scenario 2 above, such as... Figure 9 As shown, in response to the user dragging the identifier corresponding to Bluetooth headset A to identifier 91 on the local device, the HyperTerminal application can determine that the Bluetooth device indicated by the user is Bluetooth headset A. Then, the HyperTerminal application can send a Bluetooth device usage instruction to the audio frame module, instructing the audio frame module to set Bluetooth headset A as the sound-producing device.
[0168] For another example, consider the call audio playback scenario exemplified in Scenario 3 above, such as... Figure 10As shown in (b), in response to the user's operation on the selection identifier corresponding to the Bluetooth headset, the call application can determine that the Bluetooth device indicated by the user is the Bluetooth headset. Then, the call application can send a Bluetooth device usage instruction to the audio frame module, instructing the audio frame module to set the Bluetooth headset as the sound-producing device.
[0169] S704. The audio frame module determines whether the Bluetooth device selected by the user is a physically connected device. If the audio frame module determines that the Bluetooth device selected by the user is not a physically connected device, proceed to step S705; if the audio frame module determines that the Bluetooth device selected by the user is a physically connected device, proceed to step S707.
[0170] In some embodiments, the available Bluetooth devices reported by the audio framework module to the application include virtual connected devices and / or physically connected devices. That is, the application does not need to distinguish whether the Bluetooth device currently selected by the user is a virtual connected device or a physically connected device. Therefore, after receiving the Bluetooth device selection instruction sent by the application, the audio framework module can determine the Bluetooth device selected by the user based on the information carried in the Bluetooth device selection instruction. Then, the audio framework module determines whether the Bluetooth device currently selected by the user is a virtual connected device or a physically connected device based on the maintained list of available Bluetooth devices.
[0171] In the case where the user selects a virtual connection device, the audio framework module can trigger the Bluetooth service module to re-establish a connection with the virtual connection device through step S705 to enable subsequent audio playback. In the case where the user selects a physical connection device, the audio framework module can directly trigger audio playback using the user-selected physical connection device through step S707.
[0172] For example, the audio framework module determines that the Bluetooth device selected by the user is Bluetooth device 2 based on the Bluetooth device selection instruction received from the application. Then, according to the contents shown in Table 1 above, the audio framework module can determine that Bluetooth device 2 is a virtual connection device, and needs to execute the following step S705 to trigger the first electronic device to perform the reconnection process.
[0173] For example, the audio framework module determines that the Bluetooth device selected by the user is Bluetooth device 1 based on the Bluetooth device selection instruction received from the application. Then, according to the contents shown in Table 1 above, the audio framework module can determine that Bluetooth device 1 is a connected device and needs to execute the following step S707 to trigger the first electronic device to transmit audio data through the Bluetooth communication connection with Bluetooth device 1, so as to realize audio playback through Bluetooth device 1.
[0174] In this way, applications can select virtual or physical connected devices by calling the unified interface provided by the audio framework module, without having to configure interfaces adapted to multiple modules in the application, thus reducing the difficulty of application development.
[0175] S705, the audio frame module sends a Bluetooth device connection instruction to the Bluetooth service module.
[0176] In some embodiments, the audio frame module determines that the Bluetooth device selected by the user is a virtual connection device. Then, the audio frame module can send a Bluetooth device connection indication to the Bluetooth service module. Optionally, the Bluetooth device connection indication may carry information such as the Bluetooth device's identifier. Correspondingly, after receiving the Bluetooth device connection indication, the Bluetooth service module can determine the Bluetooth device indicated by the audio frame module for connection. Then, the Bluetooth service module can send a reconnection request to the Bluetooth device to trigger the re-establishment of the Bluetooth communication connection with the Bluetooth device.
[0177] Optionally, the Bluetooth service module of the first electronic device stores the pairing information of the Bluetooth device, and correspondingly, the Bluetooth service module of the Bluetooth device also stores the pairing information of the first electronic device. Then, the first electronic device and the Bluetooth device can determine that the other device is a trusted device, and thus re-establish the Bluetooth communication connection based on the pairing information.
[0178] S706, the Bluetooth service module sends a Bluetooth device connection response to the audio frame module.
[0179] In some embodiments, after determining that the first electronic device has successfully re-established a Bluetooth communication connection with the original virtual connection device, the Bluetooth service module may send a Bluetooth device connection response to the audio framework module. Optionally, the Bluetooth device connection response may carry information such as the identifier of the Bluetooth device (e.g., the original virtual connection device) that has re-established the Bluetooth communication connection.
[0180] Correspondingly, the audio framework module can receive the Bluetooth device connection response sent by the Bluetooth service module, and determine that the Bluetooth device currently selected by the user is a truly connected device based on the Bluetooth device connection response.
[0181] The S707 audio frame module plays audio using a user-selected Bluetooth device.
[0182] In some embodiments, after determining that the Bluetooth device selected by the user is currently a physically connected device, the audio framework module can use the physically connected device to play audio. For example, after step S704, the audio framework module determines that the Bluetooth device selected by the user is itself a physically connected device. As another example, after step S706, the audio framework module determines that the first electronic device has re-established a Bluetooth communication connection with the virtual device selected by the user, and that the virtual device has now become a physically connected device.
[0183] Optionally, the audio framework module sets the user-selected Bluetooth device as the sound-generating device and configures relevant audio playback parameters, thereby enabling the application to call the corresponding Bluetooth device for audio playback through the audio framework module. Optionally, audio playback parameters may include parameters such as loudness and number of channels.
[0184] Optionally, after setting up the sound-emitting device, the audio framework module sends the audio data to be played by the application to the sound-emitting device through a Bluetooth communication connection, thereby enabling audio playback through the sound-emitting device.
[0185] In this way, the audio framework module manages all Bluetooth devices related to the first electronic device in a unified manner, integrates the Bluetooth device selection process, improves the processing efficiency of virtual connection device connection and disconnection, and reduces user waiting time.
[0186] Furthermore, through a unified interface between the system service layer and the application layer, different applications can call the audio framework module through this unified interface to obtain information on all available Bluetooth devices, thereby effectively reducing the difficulty of application development.
[0187] Figure 11 This is a flowchart illustrating another device management method provided in an embodiment of this application. It should be noted that this method does not rely on... Figure 11 The specific order described below is a limitation. It should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:
[0188] S1101, The first application of the first electronic device receives a user instruction to switch the audio playback device.
[0189] The first electronic device includes an application layer and a system service layer, with the first application residing in the application layer. Optionally, the first application can be any application within the electronic device. Optionally, the first application can be used to manage application playback devices within the first electronic device. For example, the first application could be a broadcast control center application, a super terminal application, a call application, etc.
[0190] In some embodiments, the first application typically plays audio through a default audio playback device (such as the speaker of the first electronic device). Therefore, upon detecting the user's first action, the first application can trigger a switch to the audio playback device.
[0191] S1102. In response to the first operation, the first electronic device displays a device selection interface; wherein, the device selection interface displays information of multiple audio playback devices, the information of which is obtained by the first application through a first interface, the first interface being used to obtain information of audio playback devices in a first connected state and audio playback devices in a second connected state; the audio playback devices in the first connected state establish a communication connection with the first electronic device, and the audio playback devices in the second connected state do not establish a communication connection with the first electronic device but are in a connectable state.
[0192] The information for the multiple audio playback devices includes device identifiers and / or device types. Optionally, the first application obtains the information for the multiple audio playback devices through a first interface to distinguish between them. The first application does not need to obtain the connection status of the multiple audio playback devices; this connection status can be managed uniformly by the audio framework module.
[0193] In this way, the first application does not need to distinguish the connection status of multiple audio playback devices, and the user does not need to pay attention to the connection status of multiple audio playback devices. Instead, the connection status of multiple audio playback devices is managed through the audio framework module.
[0194] Optionally, the first audio playback device is in a second connection state, and the second audio playback device is in a first connection state.
[0195] Optionally, the audio playback device in the first connection state is, for example, a physically connected device, and the audio playback device in the second connection state is, for example, a virtually connected device.
[0196] Alternatively, the audio playback device may be, for example, a Bluetooth device.
[0197] In this way, the first application can obtain information about audio playback devices with different connection states by calling a unified first interface, without having to configure multiple interfaces adapted to multiple modules in the first application, thus reducing the difficulty of application development.
[0198] In some embodiments, the first electronic device further includes an audio framework module. In response to a first operation, the first application obtains information about multiple audio playback devices through a first interface, including: in response to a first operation in which a user instructs the user to switch audio playback devices, the first application calls the first interface provided by the audio framework module to obtain information about multiple audio playback devices.
[0199] The first electronic device includes an application layer and a system service layer, with the audio framework module located in the system service layer.
[0200] In this way, through a unified interface between the system service layer and the application layer, different applications can call the audio framework module through this unified interface to obtain information about all available Bluetooth devices, thereby effectively reducing the difficulty of application development.
[0201] In some embodiments, before the first electronic device displays a device selection interface, in response to a first operation, the first application obtains information about multiple audio playback devices through a first interface. Alternatively, the first application obtains information about multiple audio playback devices that meet preset conditions reported through the first interface. The preset conditions include a change in the audio playback device associated with the first electronic device.
[0202] For example, in response to the first operation, the first application actively obtains information about multiple audio playback devices through the first interface, in order to display the device selection interface.
[0203] For example, after the first application starts or triggers the start of a certain function, the first application can also actively obtain information about multiple audio playback devices through the first interface.
[0204] For example, when the multiple audio playback devices associated with the first electronic device change, the first application can passively obtain the updated information of the multiple audio playback devices through the first interface. Subsequently, in response to the first operation, the first application can display a device selection interface based on the updated information of the multiple audio playback devices. For instance, the audio framework module stores information about multiple audio playback devices. After the information of the audio playback devices is updated and preset conditions are met, the audio framework module can report the updated information of the multiple audio playback devices to the first application through the first interface.
[0205] Optionally, the associated multiple audio playback devices may change, for example, multiple audio playback devices may no longer be virtual or physical connection devices. Optionally, the first application may be unaware that multiple audio playback devices have changed from physical connection devices to virtual connection devices, or from virtual connection devices to physical connection devices.
[0206] In this way, the first application can flexibly obtain information about the audio device in multiple ways, thereby increasing the flexibility of device management.
[0207] In some embodiments, in response to a second operation by the user on the device selection interface, the first application obtains a first audio playback device from a plurality of audio playback devices selected by the user. The first application instructs the first audio playback device and the first electronic device to establish a communication connection and play audio from the first application via a second interface. Alternatively, in response to a third operation by the user on the device selection interface, the first application obtains a second audio playback device from a plurality of audio playback devices selected by the user. The first application instructs the second audio playback device to play audio from the first application via a second interface.
[0208] The second interface differs from the first interface. For example, the first interface is provided by the audio framework module in the application framework layer to the application in the application layer, and is used to provide information about the audio playback device. The second interface is the interface through which the application sends information to the audio playback module.
[0209] For example, such as Figure 6 As shown, the first application obtains information about available Bluetooth devices, such as audio playback device information, through the first interface provided by the audio framework module. Then, in response to user actions, the first application sends a device usage instruction to the audio framework module through a second interface to trigger the use of the desired Bluetooth device.
[0210] Thus, after the first application obtains the audio playback device that the user needs to use, it can instruct the audio playback device that the user needs to use to play audio through the second interface.
[0211] In some examples, the audio of the first application may include audio within the first application itself, or audio from a second application invoked by the first application. For example, if the first application is a broadcast control center application, the audio of the first application may be audio from the broadcast control center application, or audio from other audio applications installed on the first electronic device, such as audio from the Huawei Music application.
[0212] For example, in response to a first operation instructing a user to switch audio playback devices, the first application obtains information about multiple audio playback devices. For example, such as... Figure 8 As shown in (a), the broadcast control center application (such as the first application) in the first electronic device detects the user's first operation on the audio casting control 83 displayed on the broadcast control center card 81. The broadcast control center application acquires the operations of multiple audio playback devices and displays them as shown in (a). Figure 8 The device selection interface shown in (c) includes multiple audio playback devices, such as the device itself, Bluetooth headset A, and Bluetooth headset B. Subsequently, in response to the user's selection of Bluetooth headset A, the broadcast control center application can determine that the Bluetooth device indicated by the user is Bluetooth headset A. Then, the broadcast control center application can instruct Bluetooth headset A to play the audio corresponding to the broadcast control center application through the second interface.
[0213] In this setup, Bluetooth headset A can be either a physically connected device or a virtually connected device. If Bluetooth headset A is a physically connected device, the broadcast control center application can directly play audio through it. If Bluetooth headset A is a virtually connected device, the first electronic device needs to establish a communication connection with Bluetooth headset A before the broadcast control center application can play audio through it.
[0214] In some examples, the first application instructs a first audio playback device and a first electronic device to establish a communication connection and play audio from the first application via a second interface. This includes: the first application sending a device usage instruction to the audio framework module via the second interface, the device usage instruction indicating the use of the first audio playback device. In response to the device usage instruction, the audio framework module determines that the first audio playback device is in a second connection state based on the connection status of multiple audio playback devices. The audio framework module sends a device connection instruction to the Bluetooth service module, triggering the Bluetooth service module to establish a communication connection with the first audio playback device. In response to the establishment of the communication connection, the audio framework module triggers the first audio playback device to play audio from the first application via the communication connection.
[0215] For example, the audio framework module receives a first device usage instruction sent by the first application through a second interface. This first device usage instruction indicates the use of a first audio playback device. In response to the first device usage instruction, the audio framework module determines that the first audio playback device is in a second connection state based on the connection status of multiple audio playback devices. The audio framework module then sends a device connection instruction to the Bluetooth service module, triggering the Bluetooth service module to establish a first connection with the first audio playback device. In response to the establishment of the first connection, the audio framework module triggers the first audio playback device to play audio from the first application through the first connection.
[0216] For example, the audio framework module receives a second device usage instruction sent by the first application through a second interface. This second device usage instruction indicates the use of a second audio playback device. In response to the second device usage instruction, the audio framework module determines that the second audio playback device is in a first connection state based on the connection status of multiple audio playback devices. The audio framework module then triggers the second audio playback device to play the audio from the first application through a second connection between the electronic device and the second audio playback device.
[0217] In this way, the audio framework module can determine the connection status of the audio playback device currently used by the first application based on the connection status of multiple maintained audio playback devices. When the connection status is in the second connection state, the audio framework module can actively trigger the electronic device to establish a communication connection with the corresponding virtual connection device, effectively improving communication efficiency compared to the audio framework module passively waiting for device connections. When the connection status is in the first connection state, the audio framework module can directly achieve audio playback through the communication connection between the electronic device and the corresponding physical connection device.
[0218] In addition, the audio framework module manages all Bluetooth devices associated with the first electronic device in a unified manner, integrates the Bluetooth device selection process, improves the efficiency of virtual connection device connection and disconnection, and reduces user waiting time.
[0219] In some embodiments, the information of the multiple audio playback devices includes the connection status of the multiple audio playback devices, and the audio framework module stores the connection status of the multiple audio playback devices.
[0220] For example, the audio framework module maintains a list of available devices, which includes information on multiple audio playback devices. For instance, the audio framework module maintains a list of available Bluetooth devices as shown in Table 1 above.
[0221] Optionally, the audio framework module may report the connection status of multiple audio playback devices to the first application, or it may choose not to report the connection status of multiple audio playback devices to the first application.
[0222] Thus, compared to existing technologies where the Bluetooth service module only reports information about the physically connected device to the audio framework module, the device management method provided in this application allows the Bluetooth service module to report information about both the virtual and physically connected devices to the audio framework module, thereby enabling unified management of Bluetooth devices by the audio framework module.
[0223] In some embodiments, the first electronic device further includes a Bluetooth service module that stores pairing information for multiple audio playback devices.
[0224] The Bluetooth connection process includes a pairing process and a connection process. During the pairing process, the Bluetooth service module in the first electronic device can obtain the pairing information of the peer device. Therefore, regardless of whether the multiple audio playback devices are physically connected or virtually connected, the Bluetooth service module in the first electronic device stores the pairing information of these multiple audio playback devices.
[0225] Optionally, if the first audio playback device is a virtual connection device, the Bluetooth service module can trigger the re-establishment of a communication connection with the first audio playback device based on the pairing information of the first audio playback device.
[0226] In some solutions, multiple embodiments of this application can be combined, and the combined solution can be implemented. Optionally, some operations in the processes of each method embodiment may be combined, and / or the order of some operations may be changed. Furthermore, the execution order between the steps of each process is merely exemplary and does not constitute a limitation on the execution order between steps; other execution orders are also possible. It is not intended to indicate that the execution order is the only possible order in which these operations can be performed. Those skilled in the art will conceive of various ways to reorder the operations described herein. In addition, it should be noted that the process details involved in one embodiment of this document are similarly applicable to other embodiments, or different embodiments may be combined.
[0227] Furthermore, some steps in the method embodiments can be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiments may be optional and can be deleted in certain use cases. Or, other possible steps may be added to the method embodiments.
[0228] Furthermore, the various method embodiments can be implemented individually or in combination.
[0229] The above combination Figures 7-11 The device management method provided in the embodiments of this application is described in detail below. Figure 12 The first electronic device provided in the embodiments of this application is described in detail.
[0230] In one possible design, Figure 12 This is a schematic diagram of the structure of a first electronic device provided in an embodiment of this application. Figure 12 As shown, the first electronic device 1200 may include a transceiver unit 1201, a processing unit 1202, and a display unit 1203. The first electronic device 1200 can be used to implement the functions of the first electronic device involved in the above method embodiments.
[0231] Optionally, the transceiver unit 1201 is used to support the first electronic device 1200 in performing... Figure 11 S1101 in the middle.
[0232] Optionally, the processing unit 1202 is used to support the first electronic device 1200 in performing operations. Figure 11 S1102 in the middle.
[0233] Optionally, the display unit 1203 is used to support the first electronic device 1200 in performing operations. Figure 11 S1102 in the middle.
[0234] Optionally, the transceiver unit 1201 may include a receiving unit and a transmitting unit, which may be implemented by a transceiver or transceiver-related circuit components, and may be a transceiver or transceiver module. The operation and / or function of each unit in the first electronic device 1200 are respectively to implement the corresponding process of the device management method described in the above method embodiments. All relevant content of each step involved in the above method embodiments can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, it will not be repeated here.
[0235] Optionally, Figure 12 The first electronic device 1200 shown may also include a storage unit ( Figure 12 (not shown in the image), this storage unit stores a program or instruction. When the transceiver unit 1201, processing unit 1202, and display unit 1203 execute the program or instruction, it causes... Figure 12The first electronic device 1200 shown can execute the device management method described in the above method embodiments.
[0236] Figure 12 The technical effects of the first electronic device 1200 shown can be referred to the technical effects of the device management method described in the above method embodiments, and will not be repeated here.
[0237] In addition to being in the form of the first electronic device 1200, the technical solutions provided in this application may also be functional units or chips in the first electronic device, or devices used in conjunction with the first electronic device.
[0238] This application also provides a chip system, including: a processor coupled to a memory, the memory being used to store programs or instructions, which, when executed by the processor, cause the chip system to implement the methods in any of the above method embodiments.
[0239] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.
[0240] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.
[0241] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0242] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0243] This application also provides a computer-readable storage medium storing a computer program. When the computer program is run on a computer, it causes the computer to perform the aforementioned steps to implement the device management method described in the above embodiments.
[0244] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the device management method described in the above embodiments.
[0245] In addition, this application also provides an apparatus. Specifically, the apparatus may be a component or module, and may include one or more processors and a memory connected together. The memory stores a computer program. When the computer program is executed by one or more processors, the apparatus performs the device management methods described in the above-described method embodiments.
[0246] The apparatus, computer-readable storage medium, computer program product, or chip provided in the embodiments of this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0247] The steps of the methods or algorithms described in conjunction with the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an application-specific integrated circuit (ASIC).
[0248] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, the division of the above functional modules is only used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0249] In the several embodiments provided in this application, it should be understood that the disclosed methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of modules or units may be electrical, mechanical or other forms.
[0250] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0251] Computer-readable storage media include, but are not limited to, any of the following: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media capable of storing program code.
[0252] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A device management method characterized by, The method includes: A first application of a first electronic device receives a user instruction to switch an audio playback device; In response to the first operation, the first electronic device displays a device selection interface; wherein, the device selection interface displays information of the plurality of audio playback devices, the information of the plurality of audio playback devices being obtained by the first application through a first interface, the first interface being used to obtain information of audio playback devices in a first connection state and audio playback devices in a second connection state; the audio playback device in the first connection state establishes a communication connection with the first electronic device, and the audio playback device in the second connection state does not establish a communication connection with the first electronic device but is in a connectable state.
2. The method of claim 1, wherein, The method further includes: In response to a second operation by the user on the device selection interface, the first application obtains the first audio playback device among the plurality of audio playback devices selected by the user; The first application instructs the first audio playback device and the first electronic device to establish a communication connection and play the audio of the first application through the second interface; or, In response to a third operation by the user on the device selection interface, the first application obtains the second audio playback device among the plurality of audio playback devices selected by the user; The first application instructs the second audio playback device to play the audio of the first application through the second interface.
3. The method according to claim 1 or 2, characterized in that, Before the first electronic device displays the device selection interface, the method further includes: In response to the first operation, the first application obtains information about the plurality of audio playback devices through the first interface; or, The first application obtains information about the plurality of audio playback devices that meet preset conditions through the first interface. The preset conditions include changes in the audio playback devices associated with the first electronic device.
4. The method according to any one of claims 1 to 3, characterized in that, The information of the plurality of audio playback devices includes the device identifier and / or device type of the plurality of audio playback devices.
5. The method according to any one of claims 1 to 4, characterized in that, The first electronic device further includes a Bluetooth service module, which stores pairing information for the plurality of audio playback devices.
6. The method according to claim 2 or 3, characterized in that, The first electronic device further includes an audio framework module, wherein, in response to the first operation, the first application obtains information about multiple audio playback devices through a first interface, including: In response to a user's first operation in the first application instructing the user to switch audio playback devices, the first application calls the first interface provided by the audio framework module to obtain information about the plurality of audio playback devices.
7. The method of claim 6, wherein, The information of the multiple audio playback devices includes the connection status of the multiple audio playback devices, and the audio framework module stores the connection status of the multiple audio playback devices.
8. The method of claim 7, wherein, The first application instructs the first audio playback device and the first electronic device to establish a communication connection and play the audio of the first application through the second interface, including: The first application sends a device usage instruction to the audio framework module through the second interface, the device usage instruction being used to indicate the use of the first audio playback device; In response to the device usage instruction, the audio framework module determines that the first audio playback device is in the second connection state based on the connection status of the plurality of audio playback devices; The audio framework module sends a device connection instruction to the Bluetooth service module, triggering the Bluetooth service module to establish a communication connection with the first audio playback device. In response to the establishment of the communication connection, the audio framework module triggers the first audio playback device to play the audio of the first application through the communication connection.
9. An electronic device, characterized in that, The electronic device includes: an audio frame module; The audio framework module is used to report information of multiple audio playback devices to a first application through a first interface. The first interface is used to report information of audio playback devices in a first connection state and audio playback devices in a second connection state. The audio playback devices in the first connection state establish a communication connection with the electronic device, while the audio playback devices in the second connection state do not establish a communication connection with the electronic device but are in a connectable state.
10. The electronic device according to claim 9, characterized in that, The audio framework module is also used to store the connection status of the multiple audio playback devices, and the information of the multiple audio playback devices includes the connection status of the multiple audio playback devices.
11. The electronic device according to claim 9 or 10, characterized in that, The audio framework module is also used for: Receive a first device usage instruction sent by the first application through the second interface, the first device usage instruction being used to indicate the use of a first audio playback device; In response to the first device usage instruction, the first audio playback device is determined to be in the second connection state based on the connection status of the plurality of audio playback devices; Send a device connection instruction to the Bluetooth service module to trigger the Bluetooth service module to establish a first connection with the first audio playback device; In response to the establishment of the first connection, the first audio playback device is triggered to play the audio of the first application through the first connection.
12. The electronic device according to claim 9 or 10, characterized in that, The audio framework module is also used for: Receive a second device usage indication sent by the first application through a second interface, the second device usage indication being used to indicate the use of a second audio playback device; In response to the second device usage instruction, the second audio playback device is determined to be in the first connection state based on the connection status of the plurality of audio playback devices; The second connection between the electronic device and the second audio playback device triggers the second audio playback device to play the audio of the first application.
13. The electronic device according to any one of claims 9-12, characterized in that, The audio framework module is used to respond to a request from the first application by reporting information about multiple audio playback devices to the first application through the first interface.
14. The electronic device according to any one of claims 9-13, characterized in that, The audio framework module is also used to report updated audio playback device information to the first application through the first interface when the multiple audio playback devices change.
15. The electronic device according to any one of claims 9-14, characterized in that, The information of the plurality of audio playback devices includes the device identifier and / or device type of the plurality of audio playback devices.
16. An electronic device, comprising: include: The electronic device includes a processor, a memory, and a display screen, wherein the memory and the display screen are coupled to the processor, the memory being used to store computer program code, the computer program code including computer instructions, and the electronic device performing the method as described in any one of claims 1-8 when the processor reads the computer instructions from the memory.
17. A computer readable storage medium characterized by: The computer-readable storage medium includes a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-8.
18. A computer program product, characterised in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-8.