Audio playing method and related device
By automatically displaying and playing the song list when a preset event is detected, the problem of cumbersome operation of users playing songs is solved, and a more efficient song playback experience is achieved.
Patent Information
- Application Number
- CN202311871251.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-12-29
AI Technical Summary
In the prior art, users need to operate multiple steps when playing songs, resulting in poor user experience, especially when selecting playlists in different scenarios.
When a preset event is detected (such as headphone connection), the electronic device automatically displays the playlist and directly starts the audio application to play songs in response to user operations. The automatic playlist is realized through broadcast components and media conversation services, reducing user operation steps.
It simplifies user operation process and improves user experience, especially in different scenarios to quickly play suitable playlists.
Smart Images

Figure CN120276702A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technologies, and in particular, to an audio playback method and related devices. Background Art
[0002] When a user wants to play a song, usually the electronic device needs to be unlocked first, and then the icon of the audio application on the main interface of the electronic device is clicked to start the audio application. After the audio application is started, the user needs to select a playlist in the interface of the audio application to play the songs in the playlist.
[0003] The user needs to perform multiple steps to achieve audio playback, with cumbersome operations and poor user experience. Summary of the Invention
[0004] Embodiments of this application provide an audio playback method and related devices, which are applied to the field of terminal technologies. When the electronic device detects a connection event, it can display one or more playlists. When a playback operation on any playlist is detected, the electronic device can start the audio application corresponding to the playlist and play the songs in the playlist, reducing user operations and enhancing the user experience.
[0005] In a first aspect, an embodiment of this application proposes an audio playback method, which is applied to an electronic device. The electronic device includes: a first audio application, a second audio application, and a media session service. The method includes: after detecting a first event, the electronic device displays a first control and a first playlist of the first audio application; in response to an operation on the first control, the electronic device displays a second playlist of the second audio application, and the second audio application is in a non-running state; in response to a playback operation on the second playlist, the media session service sends a first broadcast component and an identifier of the second playlist to the second audio application, and the first broadcast component includes: the package name of the second audio application; in response to receiving the first broadcast component, the electronic device starts the second audio application and plays the songs in the second playlist.
[0006] In this way, when the electronic device detects a first event, it can display one or more playlists. When a playback operation on a playlist corresponding to a non-running audio application is detected, the electronic device can start the audio application corresponding to the playlist and play the songs in the playlist, reducing user operations and enhancing the user experience.
[0007] Optionally, in response to a playback operation on the second playlist, the media session service sending a first broadcast component and an identifier of the second playlist to the second audio application includes: in response to a playback operation on the second playlist, the media session service determines the first broadcast component according to the package name of the second audio application and the correspondence between the package names of audio applications and broadcast components; the media session service sends a first broadcast to the second audio application through the system broadcast service, and the first broadcast includes: the first broadcast component and the identifier of the second playlist.
[0008] In some embodiments, the corresponding relationship can be saved in the form of a string, which can reduce memory occupancy.
[0009] In this way, it is simple and easy to obtain the broadcast component through the corresponding relationship.
[0010] Optionally, in response to a play operation on the second playlist, the media session service determines a first broadcast component according to the package name of the second audio application and the corresponding relationship between the package name of the audio application and the broadcast component, including: in response to a play operation on the second playlist, the media session service receives a media key event, and the media key event includes: the identifier of the second audio application and the identifier of the second playlist; in response to the media key event, the media session service retrieves the corresponding relationship between the package name of the audio application stored in the memory and the broadcast component according to the package name of the second audio application, and determines the first broadcast component.
[0011] In this way, the media session service can query and obtain the broadcast component when receiving a media key play event.
[0012] Optionally, in response to a play operation on the second playlist, the media session service determines a first broadcast component according to the package name of the second audio application and the corresponding relationship between the package name of the audio application and the broadcast component, including: in response to a play operation on the second playlist, the media session service queries the running state of the second audio application; in the case where the second audio application is in an unrun state, the media session service determines the first broadcast component according to the package name of the second audio application and the corresponding relationship between the package name of the audio application and the broadcast component.
[0013] In this way, when the audio application is not running, the audio application is started through the broadcast component. If the audio application is not running, playlist playback can be achieved without passing through the broadcast component.
[0014] Optionally, in response to a play operation on the second playlist, the media session service queries the running state of the second audio application, including: the media session service queries the media session stack according to the identifier of the second audio application to confirm that the second audio application is in an unrun state, and the media session stack is used to store information about audio applications in a running state in the electronic device.
[0015] In this way, the state of the audio application can be confirmed through the media session stack, and the method is simple and easy to implement.
[0016] Optionally, in response to an operation on the first control, the electronic device displays a second playlist of a second audio application, including: in response to the operation on the first control, the electronic device queries information about the second playlist; the information about the second playlist includes one or more of the following: the identifier of the second playlist, the cover of the second playlist, and the title of the second playlist; in response to the information about the second playlist, the electronic device displays the second playlist.
[0017] In this way, the electronic device can obtain the information about the second playlist to display the second playlist on the interface.
[0018] Optionally, in response to the operation on the first control, the electronic device queries the information about the second playlist, including: in response to the operation on the first control, the system interface transmits a first message for instructing to obtain more playlists to the playlist database; in response to the first message, the playlist database transmits the information about multiple playlists to the system interface, and the information about the multiple playlists includes: the information about the second playlist.
[0019] In this way, the information about multiple playlists can be obtained from the database to display multiple playlists on the interface.
[0020] Optionally, before the first event is detected, the first audio application is in an unrun state.
[0021] In this way, it can also be applicable to the scenario where no audio application is running, improving the user experience.
[0022] Optionally, after the first event is detected, the electronic device displays the first control and the first playlist of the first audio application, including: in response to the first event, the electronic device determines that all the audio applications in the electronic device are in an unrun state; in the case where all the audio applications in the electronic device are in an unrun state, the electronic device queries the information about the first playlist, and the information about the first playlist includes one or more of the following: the identifier of the first playlist, the cover of the first playlist, and the title of the first playlist; in response to the information about the first playlist, the electronic device displays the first control and the first playlist.
[0023] In this way, after the first event, the information about the first playlist can be obtained for display.
[0024] Optionally, in response to the first event, the electronic device determines that all the audio applications in the electronic device are in an unrun state, including: in response to the first event, the electronic device determines that all the audio applications in the electronic device are in an unrun state by querying the information in the media session stack of the media session service; the media session stack is used to store the information of the audio applications in a running state.
[0025] In this way, the status of the audio applications is confirmed through the media session stack, and when no audio application is running, the playlist is pushed. The method is simple and easy to implement.
[0026] Optionally, in response to a first event, the electronic device queries the media session stack in the media session service and determines that all audio applications in the electronic device are in a non-running state, including: in response to the first event, the audio recommendation module transmits a second message to the media session service for instructing to query the media session stack; in response to the second message, the media session service transmits a third message to the audio recommendation module for indicating that the audio applications are not registered; in the case where all audio applications in the electronic device are in a non-running state, the electronic device queries the information of a first playlist, including: in response to the third message, the audio recommendation module queries the information of playlists in the playlist database to obtain the information of the first playlist.
[0027] The first message may correspond to S1001 in the following text, the second message may correspond to S1002 in the following text, and the third message may correspond to S1005 in the following text.
[0028] In this way, by confirming the status of the audio applications through the media session stack, when all audio applications are not running, a playlist is pushed. The method is simple and easy to implement.
[0029] Optionally, the method further includes: in response to a play operation on the first playlist, the media session service sends a second broadcast component and an identifier of the first playlist to a first audio application, where the second broadcast component includes: the package name of the first audio application; in response to receiving the second broadcast component, the first audio application is started and the songs in the first playlist are played.
[0030] The second broadcast component may correspond to broadcast component A in the following text.
[0031] In this way, the start of the first audio application and the playing of the songs in the first playlist can be achieved through the broadcast component.
[0032] Optionally, the first event is a headphone connection event, and the first playlist is related to the scenario where the electronic device is located, and the scenario includes but is not limited to: a sleep scenario, a driving scenario, a commuting scenario.
[0033] In this way, playlists can be pushed according to the scenario where the electronic device is located, improving the user experience.
[0034] Optionally, the first playlist and the second playlist are displayed from near to far according to the playlist play order, or are displayed from largest to smallest according to the cumulative play duration of the playlist within a preset period, or are displayed from largest to smallest according to the play frequency of the playlist within a preset period.
[0035] In this way, playlists with more plays and / or longer play durations by the user can be pushed, improving the user experience.
[0036] Optionally, after detecting the first event, the electronic device displays a first control and a first playlist of a first audio application, including: the electronic device queries the screen state of the display screen in the electronic device; in response to querying the screen state to confirm the interface for the electronic device to display the first control and the playlist.
[0037] In this way, according to the screen state of the electronic device, the interface for pushing the playlist can be confirmed, accurately pushed, and the user experience can be improved.
[0038] Optionally, the electronic device queries the screen state of the display screen in the electronic device, including: the audio recommendation module queries the screen state of the display screen through the screen management module.
[0039] In this way, by using the screen management module to confirm the screen state, the operation is simple and easy to implement.
[0040] Optionally, the electronic device displays a first control and a first playlist of a first audio application, including any one of the following: when the electronic device is in the lit screen and locked screen state, the electronic device displays the first control and the first playlist on the lock screen interface; or, when the electronic device is in the off screen and locked screen state, in response to a first operation on the electronic device, the electronic device displays the first control and the first playlist on the lock screen interface; or, when the electronic device is in the unlocked state, in response to a second operation on the display screen of the electronic device, a pull-down notification interface is displayed, and the electronic device displays the first control and the first playlist on the pull-down notification interface.
[0041] The first operation may correspond to the lit screen operation in the following text. The first operation may be an operation of the user picking up the electronic device, an operation of the user clicking on the display screen, an operation of the user double-clicking on the display screen, or any type of operation, which is not specifically limited here.
[0042] The second operation may be an operation of the user swiping down (pulling down) from the top of the display screen, or an operation of the user swiping up from the bottom of the display screen, or an operation of the user swiping right from the left side of the display screen, or an operation of the user swiping left from the right side of the display screen, or any type of operation, which is not specifically limited here.
[0043] Optionally, before detecting the first event, the method further includes: in response to a start operation of a second audio application, the second audio application sends the package name of the second audio application and a first broadcast component to the media session service; in response to receiving the package name of the second audio application and the first broadcast component, the media session service stores the corresponding relationship between the package name of the second audio application and the first broadcast component in the memory, and / or stores the corresponding relationship between the package name of the second audio application and the first broadcast component in the playlist database, and the data in the playlist database will not be cleared after the electronic device is powered off; in response to a close operation of the second audio application, the electronic device closes the second audio application.
[0044] In this way, the relationship between the package name of the audio application and the broadcast component can be stored, facilitating the playback of the playlist displayed on the subsequent interface. Storing in the memory can improve the query speed of the corresponding relationship subsequently. Storing in the playlist database enables the corresponding relationship to exist after the electronic device is powered on after being powered off, facilitating the subsequent use of the electronic device.
[0045] Optionally, the method further includes: in response to an uninstallation operation for a second audio application, the electronic device uninstalls the second audio application, and deletes the corresponding relationship between the identifier of the second audio application and the first broadcast component from the memory and / or the playlist database.
[0046] In this way, when the audio application is uninstalled, the corresponding information is deleted, reducing the memory occupancy of the electronic device.
[0047] In a second aspect, an embodiment of the present application provides an electronic device, which may also be referred to as a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The electronic device may be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, and so on.
[0048] The electronic device includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the electronic device to execute the method as in the first aspect.
[0049] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium includes instructions, when the instructions run on the electronic device, causing the electronic device to execute the method as in the first aspect.
[0050] Fourthly, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program runs, it causes a computer to execute the method according to the first aspect.
[0051] Fifthly, an embodiment of the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the processors are used to call computer instructions to cause the electronic device to execute the method according to the first aspect.
[0052] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding feasible implementation manners are similar and will not be elaborated herein. Description of the Drawings
[0053] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0054] Figure 2 It is a schematic diagram of the interface of an electronic device provided by an embodiment of the present application;
[0055] Figure 3 It is a schematic diagram of the interface of an electronic device provided by an embodiment of the present application;
[0056] Figure 4 It is a schematic diagram of the interface of an electronic device provided by an embodiment of the present application;
[0057] Figure 5 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0058] Figure 6 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0059] Figure 7 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application;
[0060] Figure 8 It is a schematic diagram of the software framework of an electronic device provided by an embodiment of the present application;
[0061] Figure 9 It is a schematic diagram of the process of module interaction involved in the information storage process provided by an embodiment of the present application;
[0062] Figure 10 It is a schematic diagram of the process of module interaction involved in the playlist playing process provided by an embodiment of the present application;
[0063] Figure 11 It is a schematic diagram of the process of module interaction involved in the more playlist pushing and playing process provided by an embodiment of the present application;
[0064] Figure 12 A schematic diagram of the interface of an electronic device provided by an embodiment of the present application;
[0065] Figure 13 A schematic flowchart of module interaction involved in the process of playing a playlist provided by an embodiment of the present application;
[0066] Figure 14 A schematic diagram of the interface of an electronic device provided by an embodiment of the present application;
[0067] Figure 15 A schematic flowchart of module interaction involved in the initialization process provided by an embodiment of the present application;
[0068] Figure 16 A schematic flowchart of module interaction involved in the application uninstallation process provided by an embodiment of the present application;
[0069] Figure 17 A schematic flowchart of an audio playing method provided by an embodiment of the present application. Detailed implementation manners
[0070] For the convenience of clearly describing the technical solutions of the embodiments of the present application, the following briefly introduces some terms and technologies involved in the embodiments of the present application:
[0071] 1. Screen on: The display screen of the electronic device is powered on. When the screen is on, the brightness of the display screen of the electronic device is higher than the preset brightness. Herein, power on can be understood as the current being greater than the preset current value.
[0072] 2. Screen off: The display screen of the electronic device is powered off. When the screen is off, the brightness of the display screen of the electronic device is lower than the preset brightness. Herein, power off can be understood as the current being less than the preset current value. Screen off can also be referred to as screen off, standby screen, etc.
[0073] Among them, always on display (AOD) refers to a function in which when the electronic device is in a locked state, a partial area of the screen remains on and displays some information. For example, information such as time, battery level, and date can be displayed on the always on display interface.
[0074] 3. Screen lock: The state in which the display screen of the electronic device is turned off or the electronic device is locked. In the screen lock state, the programs in the electronic device remain running. However, the user cannot directly operate the electronic device and needs to unlock the display screen to use it. The display of the lock screen interface can ensure the data security of the electronic device.
[0075] In the embodiments of the present application, the lock screen can be divided into a screen-on lock screen and a screen-off lock screen. When the electronic device is in the screen-off lock screen state, the electronic device enters the screen-on lock screen state after detecting a wake-up operation and displays the lock screen interface. The subsequent electronic device unlocks the display screen when an unlock operation is detected. The wake-up operation can be an operation in which the user presses the power button, the user single-clicks or double-clicks the display screen, and the like. The unlocking operation can be an operation in which the user enters a lock screen password, an operation in which the user unlocks with a fingerprint, or an operation in which the user recognizes the face of the user. The embodiments of the present application do not specifically limit the wake-up operation and the unlocking operation.
[0076] 4. Unlock: Unlock the display screen of the electronic device. After the display screen of the electronic device turns on, the user can directly operate the electronic device.
[0077] 5. Other terms
[0078] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0079] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0080] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0081] In the embodiments of the present application, "when...", it can be at the instant when a certain situation occurs, or within a period of time after a certain situation occurs. The embodiments of the present application do not make specific limitations on this. In addition, the interface of the electronic device provided by the embodiments of the present application is only an example, and the interface may also include more or less content.
[0082] 6. Electronic Device
[0083] The electronic device in the embodiments of the present application can also be in any form. For example, the electronic device can include a handheld device with audio playback function, a vehicle-mounted device, etc. For example, some electronic devices are: mobile phone, tablet computer, handheld computer, notebook computer, mobile internet device (MID), wearable device (such as smart watch, smart glasses, smart bracelet or smart jewelry), virtual reality (VR) device, augmented reality (AR) device, vehicle-mounted device, electronic device in a 5G network or an electronic device in a future evolved public land mobile network (PLMN), etc. The embodiments of the present application do not limit this.
[0084] The electronic device in the embodiments of the present application can also be referred to as: electronic device, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile terminal, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, etc.
[0085] Currently, when a user wants to play a song, usually the user needs to unlock the mobile phone first, and then click on the icon of the audio application on the main interface of the mobile phone to start the audio application. Then select a playlist from the audio application and select any song from the playlist to play. In the embodiments of the present application, the audio application refers to an application that can play audio. The playlist provided by the audio application may include at least one song.
[0086] Therefore, the existing audio playback process needs to be implemented through multiple steps, which is relatively cumbersome and the user experience is poor.
[0087] In addition, users have different habits of playing audio in different scenarios. For example, users often listen to pop music when taking the subway; users often listen to classical music, light music, etc. before going to bed; users often listen to jazz music, etc. when driving. Therefore, when a user wants to play a song in a specific scenario, the user needs to open the audio application and search for a playlist suitable for the current scenario in the audio application, and select a song in the playlist to play. The operation is cumbersome and the user experience is poor.
[0088] In view of this, embodiments of the present application provide an audio playing method and related device. When all audio applications in an electronic device are in an unrun state, if the electronic device recognizes a preset event, the electronic device can recommend one or more playlists to the user. In response to a trigger operation by the user for any one of the playlists, the electronic device can start the audio application corresponding to the playlist and play the songs in the playlist. The preset event is used to indicate that the user has the intention to listen to audio. The preset event can be an earphone connection event, a car machine connection event, etc.
[0089] It can be understood that the application being in an unrun state means that there is no process of the application in the electronic device. Correspondingly, the application being in a run state means that there is a process of the application in the electronic device, and the process can run in the foreground or in the background. In embodiments of the present application, one or more playlists recommended by the electronic device can correspond to one audio application or multiple audio applications. There is no limitation here.
[0090] Exemplarily, the electronic device pre-stores the relationship between the playlist and the audio application, as well as the information related to the startup of the audio application. When receiving a trigger operation for any one of the playlists, the electronic device can confirm the corresponding audio application according to the triggered playlist, and open the audio application according to the information related to the startup of the audio application to trigger the playback of the songs in the playlist. The information related to the startup of the audio application can be an interface or service that can start the process of the audio application pre-set.
[0091] For ease of understanding, the scenario applicable to the technical solution of the present application will be described first below. Taking the electronic device as a mobile phone as an example for illustration below, this example does not limit the electronic device in the embodiments of the present application.
[0092] Under normal circumstances, when a user wears a Bluetooth headset, or when the user inserts a wired headset into the mobile phone, it can be considered that the user has the intention to listen to audio. That is to say, if the mobile phone detects that the headset is connected to the mobile phone, it can be considered that the user has the intention to listen to audio. Among them, the connection between the headset and the mobile phone includes the connection between the headset and the mobile phone via Bluetooth, or the connection between the headset and the mobile phone via a connecting line.
[0093] Scenario 1: The mobile phone is connected to the headset
[0094] Figure 1A schematic diagram of an application scenario provided by an embodiment of the present application. As Figure 1 shown, in this scenario, the mobile phone 101 is communicatively connected to the earphone 102. The user controls audio playback by operating on the mobile phone 101, and the earphone 102 is used to play the audio data transmitted by the mobile phone 101. The mobile phone 101 and the earphone 102 can be connected wirelessly (e.g., Bluetooth) or wiredly, which is not limited herein.
[0095] In some embodiments, when some audio applications in the mobile phone are in a running state and the mobile phone is in an unlocked state, the mobile phone detects an earphone connection event, establishes a communication connection (e.g., a Bluetooth connection) with the earphone, and the mobile phone displays one or more playlists on the lock screen interface. The multiple playlists may include playlists in audio applications that are in a non-running state.
[0096] Exemplarily, taking the audio application A being in a running state and the audio applications B and C both being in a non-running state as an example, when the mobile phone is in an unlocked state, the mobile phone detects an earphone connection event, establishes a communication connection (e.g., a Bluetooth connection) with the earphone, and the mobile phone can display the playlist of the audio application B and / or the playlist of the audio application C on the lock screen interface.
[0097] In some embodiments, when all audio applications in the mobile phone are in a non-running state and the mobile phone detects an earphone connection event, after the mobile phone establishes a communication connection (e.g., a Bluetooth connection) with the earphone, the electronic device displays one or more playlists on the lock screen interface.
[0098] The earphone connection event refers to: the mobile phone receives a wireless connection request (e.g., a Bluetooth connection request) sent by the earphone, or the mobile phone detects that the earphone is connected to the mobile phone through a connecting line.
[0099] In a possible implementation manner, in response to receiving a connection request sent by the earphone, the mobile phone can display one or more playlists on the lock screen interface.
[0100] In some embodiments, when the audio application of the mobile phone is in a non-running state and the mobile phone is in a screen-off and locked state, the mobile phone detects an earphone connection event. After the mobile phone successfully connects to the earphone, the mobile phone does not turn on the screen. In response to the user picking up the mobile phone, the mobile phone turns on the screen and displays the lock screen interface, and one or more playlists are displayed on the lock screen interface.
[0101] In some embodiments, when the audio application of the mobile phone is in a non-running state and the mobile phone is in a screen-off and locked state, the mobile phone detects an earphone connection event. After the mobile phone successfully connects to the earphone, the mobile phone does not turn on the screen. In response to the user touching the mobile phone screen with a finger, the mobile phone turns on the screen and displays the lock screen interface, and one or more playlists are displayed on the lock screen interface.
[0102] In some embodiments, when the audio application of the mobile phone is in an unrun state and the mobile phone is in a screen-on and locked state, and the mobile phone detects a headphone connection event, after the mobile phone successfully connects to the headphone, the mobile phone can display one or more playlists on the lock screen interface.
[0103] In some embodiments, when the audio application of the mobile phone is in an unrun state and the mobile phone is in a screen-off and locked state, and the mobile phone detects a headphone connection event, after the mobile phone successfully connects to the headphone, the mobile phone does not turn on the screen. In response to the user picking up the mobile phone, the mobile phone displays a screen-off display. When the mobile phone displays a screen-off display, no playlist is displayed. In response to the user's operations on the screen-off display interface, such as double-clicking, clicking, etc., the mobile phone turns on the screen and displays the lock screen interface, and one or more playlists are displayed on the lock screen interface.
[0104] Exemplarily, Figure 2 FIG. is a schematic diagram of an interface of a mobile phone provided by an embodiment of the present application. As Figure 2 shown, in the case where the audio applications of the mobile phone are all in an unrun state and the mobile phone is in a screen-on and locked state, when the mobile phone detects a headphone connection event, the mobile phone can display the lock screen interface as shown in Figure 2 a. The lock screen interface includes: a card 211, time information, etc. The card 211 includes: information related to Playlist 1 and multiple control components. The time information is used to indicate the current time. The information related to Playlist 1 may include: the playlist cover of Playlist 1, the playlist title 1 of Playlist 1, and the playlist source of Playlist 1.
[0105] Among them, the playlist source includes a scene playlist recommended by the mobile phone (such as a scene playlist recommended by YoYo suggestion), or a historical playlist recommended by the audio application.
[0106] In the embodiments of the present application, the playlists displayed by the mobile phone include two types: one is a historical playlist, and the other can be a scene playlist. A historical playlist refers to a playlist that has been played on the mobile phone within a preset time period. The preset time period can be 1 week or 1 month, and is not limited here. A scene playlist refers to a playlist that has been played on the mobile phone in a preset scene.
[0107] The multiple control components include: a favorite control 212, a previous song control 213, a play control 214, a next song control 215, and a more control 216. Among them, the more control 216 is used to trigger viewing more playlists.
[0108] The card 211 can be a first-level card of a playlist. The first-level card can display only one playlist, and the playlist can be a historical playlist or a scene playlist.
[0109] In the embodiments of the present application, the playlist displayed by the first-level card can be a playlist provided by any audio application. For example, Figure 2 as shown in a, the playlist displayed by the card 211 comes from Audio Application A.
[0110] In some embodiments, if a user wants to view more playlists, they can click on the more control 216 on the card 211 to retrieve the secondary card of the playlist.
[0111] Exemplarily, the mobile phone detects an operation by the user on the more control 216 in the interface shown in a of Figure 2 , and the mobile phone displays the interface shown in b of Figure 2 . This interface includes: card 221 and card 222. Card 221 is the expanded card of card 211, and card 222 can display more playlists other than playlist 1 on the primary card. Card 221 is the primary card, and card 222 is the secondary card. The secondary card can display a preset number of playlists. For example, the preset number is 12. Limited by the spatial area of card 222, as shown in b of Figure 2 , card 222 only displays the relevant information corresponding to 3 playlists (for example, the relevant information of playlist 2, the relevant information of playlist 3, and the relevant information of playlist 4). The user can view the relevant information of more playlists through a swipe operation within the area of card 222.
[0112] Refer to the interface shown in c of Figure 2 . After the mobile phone detects the user's swipe operation, the mobile phone displays a slider 223 on the right edge of card 222 to indicate the position of the playlist currently displayed on card 222 in the recommended list. The playlists displayed on the secondary card can include playlists provided by multiple audio applications. For example, the playlists displayed on card 222 can be playlists from audio application A, playlists from audio application B, playlists from audio application C, etc.
[0113] In some embodiments, if a user wants to play a playlist on the secondary card, they can click on the cover of a certain playlist on the secondary card to trigger the mobile phone to play the songs in that playlist.
[0114] Exemplarily, the mobile phone detects an operation on the playlist cover 224 corresponding to playlist 4 on card 222 in the interface shown in b of Figure 2 , triggers the playback of the songs in playlist 4 corresponding to playlist cover 224, and the mobile phone displays the interface shown in d of Figure 2 . This interface includes: card 231; the information of the song currently playing in playlist 4 is displayed on this card 231. The song information includes: the name of the song, singer information, song cover, etc. This song can be the first song of playlist 4, or a certain song in playlist 4 is played randomly.
[0115] In some other embodiments, after the user clicks on a certain playlist on the secondary card, the primary card displays the information of the song currently playing in that playlist, and the secondary card no longer displays it.
[0116] Exemplarily, after the mobile phone detects an operation on the playlist 224 on the card 222, it displays the card 231 and does not display the card 222.
[0117] It can be understood that the above Figure 2 shown interface may include more or less content. For example, it may include more or fewer playlist covers; it may also display controls for volume adjustment, etc. The embodiments of the present application do not make specific limitations on the interface display.
[0118] The above Figure 2 In the shown interface, multiple playlists can be displayed in the card 222. The multiple playlists can be playlists of the same application (for example, playlist 3 and playlist title 4), or can be playlists of different applications (for example, playlist 2 and playlist 3). In this way, through this card, it is possible to switch playlists of different applications or playlists of the same application, without the user having to unlock and open the corresponding audio application to switch playlists, which is simple in operation and improves the user experience.
[0119] In some embodiments, the mobile phone can directly enter the interface showing the content of multiple playlists without going through the interface showing the content of a single playlist. Exemplarily, the mobile phone may not display Figure 2 the interface shown in a of Figure 2 and directly display the interface shown in b of
[0120] The above Figure 2 has described the interface of the mobile phone when it is in the locked screen state. Next, in combination with Figure 3 and Figure 4 the interface of the mobile phone when it is in the unlocked state will be described.
[0121] In the embodiments of the present application, when all the audio applications in the mobile phone are in the unrun state and the mobile phone is in the unlocked state, the mobile phone detects a headphone connection event, establishes a communication connection with the headphone (for example, a Bluetooth connection), and the mobile phone displays one or more playlists in the pull-down notification interface.
[0122] Exemplarily, Figure 3 is a schematic diagram of the interface of a mobile phone provided by an embodiment of the present application. As shown in a of Figure 3 , the mobile phone is in the state of being lit and unlocked, and the mobile phone can display the main interface. When the audio application in the mobile phone is in the unrun state, the mobile phone detects a headphone connection event, establishes a communication connection with the headphone (for example, a Bluetooth connection), and the mobile phone detects that the user slides downwards at the top of the main interface to pull up the pull-down notification interface. As shown in b of Figure 3 , the pull-down notification interface includes: the card 301 and the card 211. The card 301 includes controls such as whether to turn on WLAN, Bluetooth, mobile data, mute, auto-rotation, etc., and a brightness adjustment slider, etc. The card 211 displays the playlist information of the recommended playlists.
[0123] In some embodiments, if the user wants to view more playlists, they can click on the playlist list control 216 on the card 211 to display cards 221 and 222. For the display and changes of the cards in the pull-down notification interface, reference can be made to Figure 2 , which will not be elaborated here.
[0124] In a possible implementation, when the audio application on the mobile phone is in an unrun state and the mobile phone is in an unlocked state, the mobile phone detects a headphone connection event, and a notification bar pops up on the current display interface of the mobile phone, and the notification bar displays recommended playlists.
[0125] Exemplarily, referring to Figure 4 , when the mobile phone currently displays the main interface shown in a of Figure 3 and the audio application of the mobile phone is in an unrun state, when the mobile phone detects a headphone connection event, the mobile phone establishes a communication connection with the headphone (for example, a Bluetooth connection), and the mobile phone can pop up a notification bar 401 at the top of the main interface, as shown in Figure 4 . The notification bar 401 displays playlists, and the content of the notification bar 401 can be similar to the card 211 in Figure 2 . The user can click on the play control on the notification bar 401 to quickly start the audio application and play the songs in the recommended playlist.
[0126] In the above Figure 4 -shown interface, a notification bar pops up at the top of the interface. The mobile phone can also pop up a notification bar at the middle, bottom, etc. positions of the interface.
[0127] After the mobile phone detects an operation on the control in the notification bar, it implements the function corresponding to the control. For example, after the mobile phone detects an operation on the more control in the notification bar, it displays the information of multiple playlists.
[0128] In some embodiments, after the mobile phone pops up the notification bar 401, when the mobile phone detects the user's operation on the close control in the notification bar, the mobile phone can close the notification bar 401 and not display the notification bar 401. In this way, it can reduce the occlusion of the interface and reduce the disturbance to the user.
[0129] In the above embodiments, after the mobile phone displays the notification bar 401 for a certain period of time, it cancels the display of the notification bar 401. In this way, it can reduce the occlusion of the interface and reduce the disturbance to the user.
[0130] In some embodiments, when some audio applications in the mobile phone are in a running state and the mobile phone is in an unlocked state, the mobile phone detects a headphone connection event, the mobile phone establishes a communication connection with the headphone (for example, a Bluetooth connection), and the mobile phone displays one or more playlists in the pull-down notification interface. The multiple playlists can include the playlists in the audio applications in an unrun state.
[0131] Exemplarily, taking the case where audio application A is in a running state, and both audio application B and audio application C are in a non-running state as an example, when the mobile phone is in an unlocked state, the mobile phone detects a headphone connection event, and the mobile phone establishes a communication connection with the headphone (for example, a Bluetooth connection). The mobile phone can display the playlist of audio application B and / or the playlist of audio application C in the pull-down notification interface.
[0132] Scenario 2: A watch and a headphone are connected to a mobile phone
[0133] Figure 5 This is a schematic diagram of an application scenario provided by an embodiment of the present application. As Figure 5 shown, in this scenario, the mobile phone 101 is connected to the headphone 102 and the watch 103 respectively. The user controls the audio playback of the headphone 102 through operations on the mobile phone 101, or the user controls the audio playback of the headphone 102 through operations on the watch 103. The headphone 102 is used to play the audio data transmitted by the mobile phone 101. The mobile phone 101 is usually connected to the watch 103 via Bluetooth.
[0134] In a possible implementation manner, when the audio application of the mobile phone is in a non-running state and the mobile phone is communicatively connected to the watch, and the mobile phone detects a connection event of the headphone, the mobile phone can transmit the playlist to the watch, and the watch displays the playlist or a notification of the playlist.
[0135] In a possible implementation manner, when the audio application of the mobile phone is in a non-running state and the mobile phone is communicatively connected to the headphone, and a watch connection event is detected, the mobile phone can transmit the playlist to the watch, and the watch displays the playlist or a notification of the playlist.
[0136] The above two implementation manners are directed to the scenario where the mobile phone is connected to the headphone and the mobile phone is connected to the watch, which facilitates the user to select songs for playback through the watch, simplifies the user operation process, and improves the user experience.
[0137] It should be noted that the function of the mobile phone transmitting the recommended playlist to the watch is an optional function. If the user does not enable this function, the mobile phone will not transmit the recommended playlist to the watch.
[0138] Scenario 3: A mobile phone is connected to a car stereo
[0139] Figure 6 This is a schematic diagram of an application scenario provided by an embodiment of the present application. As Figure 6As shown, in this scenario, the mobile phone 101 is connected to the vehicle computer 104 via Bluetooth. The user controls the audio playback by operating on the mobile phone 101, or the user controls the audio playback by operating on the vehicle computer 104. The vehicle speaker is used to play audio data, and the audio data is transmitted from the mobile phone 101 to the vehicle computer 104, and then transmitted from the vehicle computer 104 to the vehicle speaker connected to the vehicle computer 104. Generally, when the mobile phone detects that it is connected to the vehicle computer, it can be considered that the user has the intention to listen to the audio.
[0140] This embodiment does not limit the connection method between the mobile phone and the vehicle computer, nor does it limit the connection method between the vehicle computer and the vehicle speaker. For example, the mobile phone and the vehicle computer can establish a connection through a wireless method such as vehicle Wi-Fi, connecting to the same cloud account, or a trust ring, or the mobile phone and the vehicle computer can establish a communication connection through a wired method such as a universal serial bus (USB). The vehicle computer and the vehicle speaker can establish a connection through a wireless method such as Bluetooth or Wi-Fi, or the vehicle computer and the vehicle speaker can establish a communication connection through a wired method such as an audio cable or USB.
[0141] Among them, the trust ring is a technical solution based on the identity authentication system to achieve cross-system multi-device trusted interconnection and enable services to flow and share between devices. In the scenario of establishing device connection based on the trust ring, the electronic device that logs in to the device account can perform device authentication between the devices and the vehicle through a personal identification number (PIN) (or PIN code). For example, the authentication of the trust ring based on the PIN code is illustrated as an example. The mobile phone can send the PIN code to the vehicle through broadcasting and other methods, and the mobile phone displays a prompt box for entering the PIN code for verification. When the vehicle receives the PIN code, the vehicle displays the PIN code and returns a response message to the mobile phone indicating that the PIN code has been received. In response to the user entering the PIN code in the prompt box, the mobile phone can complete the device authentication between the vehicle and the mobile phone. After the device authentication is successful, the vehicle and the mobile phone can be in the same trust ring. When the mobile phone that logs in to the device account approaches the vehicle again, the mobile phone and the vehicle can automatically establish a network connection based on the trust ring and realize communication under the trust ring.
[0142] In one possible implementation, when the audio application of the mobile phone is not running, the mobile phone detects a connection event with the vehicle computer, and after the mobile phone and the vehicle computer are successfully connected, one or more playlists are displayed on the lock screen interface of the mobile phone. The mobile phone detecting a connection event with the vehicle computer means that after the mobile phone sends a connection request to the vehicle computer, the mobile phone receives a connection success message sent by the vehicle computer, or the mobile phone detects that the mobile phone is connected to the vehicle computer through a connection line.
[0143] In a possible implementation, when the audio application of the mobile phone is in an unrun state and the mobile phone is in an unlocked state, if the mobile phone detects a connection event with the car stereo, after the connection between the mobile phone and the car stereo is successful, the mobile phone can display one or more playlists in the pull-down notification interface.
[0144] In a possible implementation, when the audio application of the mobile phone is in an unrun state and the mobile phone is in an unlocked state, if the mobile phone detects a connection event with the car stereo, after the connection between the mobile phone and the car stereo is successful, the mobile phone can pop up a notification bar on the current display interface, and the notification bar displays one or more playlists.
[0145] In a possible implementation, when the audio application of the mobile phone is in an unrun state, if the mobile phone detects a connection event with the car stereo, after the connection between the mobile phone and the car stereo is successful, the mobile phone transmits playlists to the car stereo, and the car stereo displays one or more playlists.
[0146] In some embodiments, when some audio applications in the mobile phone are in a running state and the mobile phone detects a connection event with the car stereo, after the connection between the mobile phone and the car stereo is successful, multiple playlists are displayed on the lock screen interface of the mobile phone. The multiple playlists may include playlists in audio applications in an unrun state.
[0147] Exemplarily, taking the audio application A being in a running state, and the audio applications B and C both being in an unrun state as an example, when the mobile phone detects a connection event with the car stereo, after the connection between the mobile phone and the car stereo is successful, the mobile phone can display the playlist of the audio application B, and / or the playlist of the audio application C on the lock screen interface.
[0148] In some embodiments, when some audio applications in the mobile phone are in a running state and the mobile phone detects a connection event with the car stereo, after the connection between the mobile phone and the car stereo is successful, the mobile phone transmits playlists to the car stereo, and the car stereo displays multiple playlists. The multiple playlists may include playlists in audio applications in an unrun state.
[0149] Exemplarily, taking the audio application A being in a running state, and the audio applications B and C both being in an unrun state as an example, when the mobile phone detects a connection event with the car stereo, the mobile phone transmits playlists to the car stereo, the car stereo displays multiple playlists, and the mobile phone can display the playlist of the audio application B, and / or the playlist of the audio application C on the lock screen interface.
[0150] The above several implementation manners are for the scenario of the mobile phone connecting to the car stereo. For the first three implementation manners, it is convenient for the user to select songs for playback on the lock screen interface and the pull-down notification interface of the mobile phone. For the last implementation manner, it is convenient for the user to select songs for playback through the car stereo. The above several implementation manners can all simplify the user operation process and improve the user experience.
[0151] The foregoing several embodiments describe playlist recommendations and interface operation processes in different scenarios. The mobile phone can push playlists on the mobile phone interface or push playlists to a watch or a car stereo connected to the mobile phone. The playlists include scenario playlists and / or historical playlists.
[0152] In some embodiments, after detecting a preset event, the electronic device displays one or more historical playlists on the lock screen interface, the control center, or the notification bar.
[0153] In some other embodiments, the electronic device can also confirm whether to push a playlist on the interface according to the user's habit of listening to audio in a preset scenario. In this way, it can adapt to the user's habit of listening to audio and improve the user experience.
[0154] Exemplarily, after detecting a preset event, the electronic device identifies the scenario. If the electronic device identifies that the user is in a preset scenario (such as, scenarios like subway, sleep, or car stereo, etc.), and the user has the habit of listening to audio in this preset scenario, one or more scenario playlists are displayed on the lock screen interface, the pull-down notification center, or the notification bar.
[0155] It can be understood that the electronic device can combine the current location information, time information, connection status with external devices, etc. of the mobile phone to identify the preset scenario. For example, a certain user is located along the subway line during the period from 8:00 to 9:00 in the morning and from 17:00 to 18:00 in the afternoon on weekdays. According to these two time periods and the location information, it can be determined whether it is a commuting scenario. Another example is that a certain user is in the bedroom and uses the mobile phone (such as, plays audio) from 22:00 to 23:00 at night. According to this time period and the location information, it can be determined whether the current scenario is a sleep scenario. Another example is to determine whether the current scenario is a car stereo scenario by detecting whether the mobile phone is connected to the car stereo. The electronic device can also identify the current scenario in other ways (such as, identifying the use of an electronic transportation card, pre-set sleep time, etc.), which is not limited herein.
[0156] It should be noted that in the case of identifying a specific scenario (such as, scenarios like subway, sleep, or car stereo, etc.), since different users have different habits of using the mobile phone in different scenarios, it is necessary to further determine whether the user has the habit of listening to audio in this specific scenario. Only when it is determined that the user has the habit of listening to audio in this specific scenario, can the scenario playlist be pushed to the user's mobile phone, watch, or car stereo. Whether the user has the habit of listening to audio in a specific scenario can be achieved through algorithm learning.
[0157] In some other embodiments, when the electronic device detects a preset scenario, it can also perform playlist recommendation and trigger playlist display. The preset scenarios include but are not limited to: commuting scenario, sleep scenario, car stereo scenario. Exemplarily, when the electronic device identifies a preset scenario, it triggers the interface display shown in Figure 2 a shown in the aboveFigure 3 the interface display shown in b in Figure 4 the interface display shown in a in
[0158] It can be understood that the electronic device can also confirm whether to push a playlist on the interface according to the user's habit of listening to audio in a preset scenario. In this way, it can adapt to the user's habit of listening to audio and improve the user experience. Exemplarily, when the audio application of the mobile phone is in an unoperated state, detect the preset scenario, and if the user has the habit of listening to audio in this preset scenario, the mobile phone displays the pushed scenario playlist on the lock screen interface, the pull-down notification interface or the notification bar, so that the user can conveniently select the scenario playlist in a specific scenario.
[0159] Based on the examples of the playlists displayed by the foregoing various electronic devices, the number of playlists can be multiple. According to the preset playlist recommendation rules, one playlist can be pushed and displayed first. When the user needs to view more playlists, multiple playlists other than the first-pushed playlist are pushed and displayed for the user to select.
[0160] Exemplarily, taking the display of the playlist on the mobile phone lock screen interface as an example, as Figure 2 shown in a in, the card 211 displays the first-pushed playlist. When the electronic device detects an operation on the more control 216 on the card 211, the electronic device can display Figure 2 the interface shown in b in, and this interface displays a card 222, and the card 222 displays multiple pushed playlists.
[0161] The above describes the situation of triggering the push of the playlist. Next, the rules for the playlists pushed by the electronic device will be described.
[0162] In the embodiments of the present application, the electronic device can confirm the playlists in the card according to the cumulative playlist play duration, play frequency or play time point of each playlist within a preset time period. The cumulative playlist play duration refers to the sum of the play durations of all songs in the playlist within a preset time period. The playlist play frequency refers to the total number of times the playlist is played within a preset time period.
[0163] Exemplarily, taking the confirmation of the playlists in the card according to the cumulative playlist play duration as an example, the electronic device can first push the playlist with the longest cumulative play duration; in response to the operation of the user triggering to view more playlists, the electronic device pushes multiple playlists in the order of the cumulative playlist play duration from large to small.
[0164] Exemplarily, taking the confirmation of the playlists in the card according to the playlist play frequency as an example, the playlist with the highest play frequency is pushed first; in response to the operation of the user triggering to view more playlists, the electronic device pushes multiple playlists in the order of the play frequency from high to low.
[0165] Exemplarily, taking the confirmation of the playlist in the card according to the playback time point of the playlist as an example, the electronic device may first push the playlist with the most recent playback time point; in response to the operation of the user triggering to view more playlists, the electronic device pushes multiple playlists in the order from the most recent to the furthest playback time point of the playlist.
[0166] In some embodiments, the electronic device identifies the scenario and records the playlist corresponding to the scenario. The scenario playlist can be regarded as the historical playlist under a specific scenario. If it is recognized that the scenario where the electronic device is located is a certain specific scenario (such as subway, bedtime, driving), when sorting multiple playlists, the multiple playlists are first divided into two categories, one category is the playlist with a specific scenario identifier, and the other category is the playlist without a specific scenario identifier; then, according to the cumulative playback duration, playback frequency, or playback time point of each playlist within a preset time period, the playlists with a specific scenario identifier and the playlists without a specific scenario identifier are sorted respectively; and the multiple playlists with a specific scenario identifier are recommended according to the sorting.
[0167] In some embodiments, the electronic device can further subdivide the scenario playlist. Exemplarily, the scenario playlist can be divided into commuting type, light music type, etc. Exemplarily, when the electronic device detects that the user uses the electronic subway card, the electronic device displays the content of one or more commuting type scenario playlists; when the electronic device detects that the preset sleep time arrives, the electronic device displays the content of one or more light music type scenario playlists. The embodiments of the present application do not limit the classification of the scenario playlist.
[0168] The embodiments of the present application do not make specific limitations on the selection method of the playlist in the card, the classification of the playlist, etc.
[0169] The above embodiments illustrate the content of the playlist in the system interface, the way to trigger the playlist push, and the selection of the playlist. Next, in combination with Figures 4 to 7 The playback implementation of the playlist in the system interface is described.
[0170] In order to better understand the embodiments of the present application, the software and hardware structures of the electronic device of the present application are introduced below.
[0171] The electronic device may include a processor 110, an internal memory 121, a universal serial bus (USB) interface 130, an antenna 2, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, and a display screen 194, etc.
[0172] The sensor module 180 may include sensors such as a touch sensor. The touch sensor may be disposed on the display screen 194, and the touch sensor and the display screen 194 form a touch screen. The touch sensor is used to receive a triggering operation of the user on the touch screen.
[0173] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0174] The processor 110 may include one or more processing units. Among them, different processing units may be independent devices or integrated in one or more processors. A memory may also be provided in the processor 110 for storing instructions and data. For example, the processor 110 is used to store the instructions and data related to an audio playback method provided in the embodiments of the present application.
[0175] The USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to implement data transmission between the electronic device and a peripheral device. For example, the USB interface 130 may implement a wired connection between the vehicle-mounted computer and the electronic device in the embodiments of the present application.
[0176] The wireless communication module 160 may provide functions such as wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks) or Bluetooth (BT) applied to the electronic device.
[0177] For example, the wireless communication module 160 may implement a wireless connection such as a WIFI connection or a Bluetooth connection between the earphone and the electronic device, and implement data transmission between the earphone and the electronic device based on the WIFI connection or the Bluetooth connection. The specific connection method between devices is not limited in the embodiments of the present application.
[0178] The electronic device realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
[0179] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. For example, the display screen 194 may implement for Figure 2 the interface shown in a of Figure 3 the interface shown in a ofFigure 4 The display of the interface shown in a of [reference document] is not limited in the embodiments of the present application.
[0180] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. Taking the Android system with a layered architecture as an example, the software structure of the electronic device is exemplarily described. Exemplarily, Figure 8 This is a schematic structural diagram of a software framework of an electronic device provided by an embodiment of the present application. As Figure 8 shown, the layered architecture divides the software system of the electronic device into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces.
[0181] Referring to Figure 8 , the electronic device includes: an application layer (applications), a system service layer, and a kernel layer (kernel).
[0182] The application layer includes: one or more audio applications, a system user interface (user interface, UI), a vehicle-mounted application, a screen management module, etc.
[0183] The audio application is used to play audio content such as music and audiobooks. The audio application can be an audio application provided by a third party (for example, an audio application downloaded and installed by the user himself), or an audio application built into the system.
[0184] In the embodiments of the present application, the audio application may include: an application for playing music, an application for playing audiobooks, etc. The application for playing music includes, but is not limited to: QQ Music Application, NetEase Cloud Music Application, etc. The application for playing audiobooks includes, but is not limited to: Application, etc. In some embodiments, the audio application may further include: a video application that can run in the background to play audio, such as
[0185] The system UI is responsible for displaying the recommended playlist and can control the audio application to play the songs in the recommended playlist selected by the user through the media session service.
[0186] The vehicle-mounted application is responsible for communicating with the vehicle-mounted device to control the vehicle-mounted device to display corresponding audio notifications.
[0187] The audio control module is responsible for storing the playlist information written by the audio application and providing the information of the recommended playlist when triggering the system UI, the vehicle-mounted device, or the watch to display the recommended playlist.
[0188] In the embodiments of the present application, the audio control module includes: a notification card management module, an audio recommendation module, an audio data management module, and a device access management module.
[0189] The notification card management is used to manage the content of the notification cards displayed on the interface. For example, manage the identifiers, play controls, etc. corresponding to the playlists displayed in the notification cards. The identifiers corresponding to the playlists include, but are not limited to: playlist titles, playlist covers, playlist names, etc.
[0190] The audio recommendation module is used to determine the playlists displayed in the notification cards.
[0191] The audio data management is used to manage the data of the relevant information of one or more playlists. The relevant information of the playlist includes, but is not limited to: the identifier of the playlist, the identifier of the audio application corresponding to the playlist (for example, the package name of the audio application), or the relevant information of the broadcast components corresponding to each audio application, etc. The relevant information of the broadcast component includes, but is not limited to: the identifier of the broadcast component (for example, the name of the broadcast component) or the identifier of the audio application, etc. It is responsible for storing the playlist information of the audio application and can write the playlist information into the playlist database of the audio data management module.
[0192] The audio data management includes: a playlist database, which stores the relevant information of the playlist and the relevant information of the broadcast component.
[0193] The device access management module is responsible for monitoring the connection status of the earphone or the car stereo with the electronic device; when the electronic device detects that a device is connected, the device access management module triggers the electronic device to perform audio recommendation.
[0194] The system UI is responsible for displaying the recommended playlists and can control the audio application to play the songs in the recommended playlist selected by the user through the media session service.
[0195] The screen management module is responsible for recording the screen status of the display screen of the electronic device. The screen status includes the locked screen state and the unlocked screen state. The locked screen state refers to a state that the electronic device automatically enters after a period of inactivity. In this state, the electronic device will display a locked screen interface, and the user can unlock it by entering a password, fingerprint, face recognition, etc. The unlocked screen state refers to the state after the electronic device enters the main interface or the operation interface from the locked screen interface. The screen management module can notify the audio control module when the screen status changes, such as when the screen status changes from the locked screen state to the unlocked screen state, so that the audio control module cancels the display of the recommended playlists on the locked screen interface.
[0196] As Figure 8 shown, the application framework layer may include a media session service, an audio engine service, a wisdom service, a system broadcast service, etc.
[0197] The media session service is responsible for transmitting the playback control instructions of the system UI, in-vehicle infotainment system or watch, and controlling the audio application to play the songs in the recommended playlist selected by the user. The media session service includes: the basic media session, the basic media session extension, and the media component (media button recriver holder).
[0198] The basic media session is used to manage the running audio application to call the corresponding audio application to play audio.
[0199] The media session extension is used to cache the relevant information of the played audio applications in the electronic device, and retrieve the relevant information of the audio applications in the memory list according to the identifier of the audio application corresponding to the playlist, so as to obtain the identifier of the broadcast component of the audio application. The relevant information of the audio application includes the relevant information of the above-mentioned broadcast component.
[0200] The media component is used to send a media button event broadcast to wake up the corresponding application to play audio. The media button event broadcast carries the identifier of the audio application and the identifier of the broadcast component of the audio application.
[0201] The audio engine service is mainly responsible for transmitting the playlist information of the audio application to the audio control module, and also provides an audio recommendation service to trigger playlist recommendations when detecting the connection of headphones or in-vehicle infotainment system.
[0202] The intelligent service is mainly responsible for identifying scenarios, monitoring the connection status of headphones or in-vehicle infotainment system, etc., to trigger playlist recommendations.
[0203] The system broadcast service is used to send broadcasts to applications to wake up the corresponding applications. Exemplarily, the system broadcast service can transmit a media button event broadcast to the audio application to start the corresponding audio application.
[0204] The kernel layer is the layer between the hardware and the software. The kernel layer is used to drive the hardware to make it work. The kernel layer at least includes a display driver, a camera driver, an audio driver, a sensor driver, etc., and the embodiments of the present application do not limit this. The audio driver is used to drive the speaker to play audio.
[0205] The following uses specific embodiments to detail the audio playback method provided by the embodiments of the present application. These specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0206] In the embodiments of the present application, the electronic device realizes the playback of the corresponding playlist through the pre-stored relevant information of the audio application. Playlist. The following combines Figure 9 To illustrate the storage process of the relevant information of the audio application involved in the embodiments of the present application.
[0207] Exemplarily,Figure 9 A schematic diagram of the internal interaction process for storing playback information provided by an embodiment of this application.
[0208] As Figure 9 shown, the method includes:
[0209] S901. In response to an operation to start an audio application, the audio application transmits the package name of the audio application, the media interface name corresponding to the audio application, etc. to the basic media session in the media session service.
[0210] The start operation can be an operation where the user clicks on the application icon.
[0211] It can be understood that the package name of the audio application is one type of the identifier of the audio application, and it can also be replaced by any type of identifier of the audio application (for example, the identifier number of the audio application, the user identification (uid) of the audio application, etc.), which is not specifically limited here. In the following embodiments, the package name of the audio application can also be replaced by any type of identifier of the audio application, and no further description will be made later.
[0212] S902. The basic media session stores the package name of the audio application in the media session stack.
[0213] It should be noted that the basic media session maintains a media session stack, and the media session stack can store information of audio applications in a running state.
[0214] The media session stack can also be referred to as a media session list. The media session stack stores the media sessions corresponding to the running audio applications. The media session is a service for an application to respond to playback events. The media session can maintain a player state (playing / paused) and store the audio information being played. The audio information can be information such as song name, lyrics, or album, which is not limited here.
[0215] In some embodiments, the basic media session can also store information such as the playback state and the handle for communicating with the audio application in the corresponding media session. The audio information can be: information such as song name, lyrics, album name, etc.
[0216] S903. The audio application sends relevant information of the broadcast component to the basic media session.
[0217] In some embodiments, the relevant information of the broadcast component includes: the name of the broadcast component and the package name of the audio application. Exemplarily, the name of the broadcast component (component name) can be the interface link name of the audio application. For example, com.hihonor.cloudmusic / com.netease.cloudmusic.receiver.MediaButtonEventReceiver.
[0218] In the embodiments of the present application, the broadcast component is used to start an unrun audio application. The name of the broadcast component is one of the identifiers of the broadcast component, and can also be replaced by any type of identifier of the broadcast component (for example, the identifier number of the broadcast component, etc.), which is not specifically limited here. In the following embodiments, the name of the broadcast component can also be replaced by any type of identifier of the broadcast component, and will not be described hereinafter.
[0219] In the embodiments of the present application, the identifier of the broadcast component can be understood as an interface or a service of the audio application; correspondingly, the electronic device can pull up the process corresponding to the audio application according to the interface or the service to start the audio application.
[0220] In some other embodiments, the audio application also sends the identifier of the playlist to the basic media session. The identifier of the playlist can be the playlist name, the identifier number of the playlist, etc., which is not limited here.
[0221] In some embodiments, the identifier of the broadcast component and the identifier of the audio application can be in the form of a string, or in any form, which is not specifically limited here. For example, the audio application package name + the name of the broadcast component (component name) defined by the application. Subsequently, the electronic device can wake up the corresponding audio application through this string. The form of the string can reduce the memory occupancy.
[0222] The above S901-S903 can be referred to as media session registration. Media session registration can also include: registering the listening of playback control events. The playback control events are used to implement the electronic device to control the application to perform media playback, pause and other states. Registering the listening of playback control events can be executed simultaneously with S901, or can be executed after S901, which is not specifically limited here.
[0223] Exemplarily, the user can control audio playback or pause through a Bluetooth headset. After the basic media session registers the listening of playback control events, when the media session receives an audio playback or pause instruction sent by the Bluetooth headset, the basic media session can transmit a message for indicating playback or pause to the audio application to control the audio application to play songs or stop playing songs.
[0224] S904. The basic media session sends the relevant information of the broadcast component to the media session extension.
[0225] S905. The media session extension stores the relevant information of the broadcast component in the memory list and records or updates time A. Time A is the time when the media session extension stores the relevant information of the broadcast component.
[0226] The memory list can store the relevant information of the broadcast component in the form of a string or any other form.
[0227] In this way, the electronic device can store the broadcast components corresponding to the audio applications that have been opened in the memory list to facilitate the subsequent playback of the playlists corresponding to the audio applications.
[0228] It can be understood that taking the audio application as Application A as an example, if the relevant information of Broadcast Component A corresponding to Application A is not included in the memory list, the relevant information of Broadcast Component A is newly added to the memory list, and time A is recorded: if the relevant information of Broadcast Component A is included in the memory list, the time corresponding to Broadcast Component A is updated to time A.
[0229] Exemplarily, taking the audio application as Application A as an example, if the relevant information of Broadcast Component A corresponding to Application A is not included in the memory list, the memory list can change from Table 1 to Table 2. Compared with Table 1, Table 2 adds a set of corresponding relationships, that is, the relationship among Application A, Broadcast Component A, and time A.
[0230] Table 1 Memory List
[0231] Application B Broadcast Component B Time B
[0232] Table 2 Memory List
[0233] Application A Broadcast Component A Time A Application B Broadcast Component B Time B
[0234] Exemplarily, taking the audio application as Application A as an example, if the relevant information of Broadcast Component A corresponding to Application A is already included in the memory list, the memory list can change from Table 3 to Table 4. Compared with Table 3, the time corresponding to Broadcast Component A in Table 4 updates time C to time A. Time A is later than time C.
[0235] Table 3 Memory List
[0236] Application B Broadcast Component B Time B Application A Broadcast Component A Time C
[0237] Table 4 Memory List
[0238] Application B Broadcast Component B Time B Application A Broadcast Component A Time A
[0239] In some embodiments, if the relevant information of a broadcast component is newly added to the memory list, the media session extension registers an uninstall broadcast listener with the audio application corresponding to the broadcast component. When the audio application is uninstalled, the audio application sends a broadcast indicating the application uninstallation to the media session extension. Adaptively, after receiving the broadcast, the media session extension deletes the relevant information of the broadcast component. Exemplarily, taking Application A as an example, if the relevant information of broadcast component A is newly added to the memory list, the media session extension registers an uninstall broadcast listener with Application A. When Application A is uninstalled, Application A sends a broadcast indicating the uninstallation of Application A to the media session extension. Adaptively, after receiving the broadcast, the media session extension deletes the relevant information of broadcast component A.
[0240] In some embodiments, the electronic device also executes S906 and S907 to facilitate obtaining the relevant information of the corresponding broadcast component after the electronic device is restarted.
[0241] S906: The media session extension sends the relevant information of the broadcast component, as well as Time A, to the playlist database in the audio control application.
[0242] Different from the memory list, the information stored in the playlist database will not be deleted when the electronic device is powered off. When the electronic device is powered on, the information stored in the playlist database still exists.
[0243] S907: The playlist database stores the relevant information of the broadcast component and Time A.
[0244] It can be understood that taking the audio application as Application A as an example, if the playlist database does not include the relevant information of broadcast component A corresponding to Application A, the relevant information of broadcast component A is newly added to the playlist database; if the playlist database includes the relevant information of broadcast component A, the usage time of broadcast component A is updated.
[0245] In this way, the electronic device can store the relevant information of the broadcast components corresponding to the audio applications that have been opened in the playlist database, so as to facilitate obtaining the relevant information of the corresponding broadcast components after the electronic device is restarted, and to realize the playback of the playlists corresponding to the audio applications.
[0246] S908: The audio application plays the songs in the playlist, and the audio application transmits the playlist information to the basic media session.
[0247] After the audio application is started, in response to the user's playback control operation on the audio application interface, the audio application transmits the playlist information to the audio engine service. The playback control operation can be an operation where the user clicks on the cover of a certain playlist on the audio application interface, or an operation to switch to the previous or next song.
[0248] The playlist information includes, but is not limited to, the playlist title, playlist cover, playlist identifier, the time point to start playing the playlist, etc. The time point to start playing the playlist is used for sorting the playlist playback order. For example, the user clicks to play the songs in Playlist 1 at 13:01, clicks to play the songs in Playlist 2 at 13:20, and clicks to play Playlist 3 at 14:00. The playlist playback order from near to far is: Playlist 3, Playlist 2, Playlist 1. When making subsequent playlist recommendations, the most recently played playlist can be recommended according to the playlist playback order, such as Playlist 3.
[0249] Optionally, the playlist information may further include a scene identifier, which is provided by the media server and is used to mark the scenes suitable for playing the playlist, such as subway, bedtime, driving, etc.
[0250] S909. The audio engine service writes the playlist information to the playlist database.
[0251] After receiving the playlist information transmitted by the audio application, the audio engine service writes the playlist information to the playlist database.
[0252] S910. In response to the operation of closing the audio application, the audio application transmits a message to the basic media session for instructing to destroy the media session.
[0253] S911. The basic media session deletes the relevant information of the package name of the audio application and the broadcast component.
[0254] In this way, the electronic device can store the playlist information and the audio playback related information to facilitate subsequent playlist pushing by the electronic device and realize playing the songs of the playlist.
[0255] The above Figure 9 The shown process describes the information storage process involved in the embodiments of the present application. Next, the playlist playback control process involved in the embodiments of the present application will be described in conjunction with Figure 10 to describe the playlist playback control process involved in the embodiments of the present application.
[0256] Exemplarily, Figure 10 is a schematic flowchart of a playlist playback control provided by an embodiment of the present application. As Figure 10 shown, the process includes: All audio applications in the electronic device are in an unrun state.
[0257] S1001. When the electronic device meets the preset conditions, it queries the registration status of the media session from the media session service.
[0258] Querying the registration status of the media session from the media session service can also be understood as querying whether there is information of the audio application stored in the media session stack, for example, the package name of the audio application, etc.
[0259] In the embodiments of the present application, the preset conditions include, but are not limited to: detecting a preset event and detecting a preset scenario. The preset event and the preset scenario may refer to the corresponding descriptions above, and will not be elaborated here.
[0260] S1002. The basic media session returns the registration status of the media session to the audio recommendation module, and the registration status is unregistered.
[0261] The unregistered registration status is used to indicate that no information about the audio application is stored in the media session stack. For example, the package name of the audio application is not stored in the media session stack.
[0262] Since the registration status of the media session returned by the basic media session to the audio recommendation module is unregistered, the audio recommendation module can learn that all audio applications on the electronic device are in an unrun state, and then execute S1003.
[0263] S1003. The audio recommendation module queries the screen status of the display screen from the screen management module.
[0264] If the registration status of the media session is queried as unregistered, the audio recommendation module queries the screen status of the display screen. The screen status of the display screen of the audio recommendation module includes a locked screen state and an unlocked screen state. In the embodiments of the present application, the locked screen state includes: a lit screen locked state and a turned-off screen locked state.
[0265] S1004. The screen management module returns the screen status to the audio recommendation module, and the screen status is the locked screen state.
[0266] S1005. The audio recommendation module queries playlists from the playlist database.
[0267] S1006. The playlist database returns historical playlist information to the audio recommendation module, and the historical playlist information includes information about Playlist 1. The information about Playlist 1 includes one or more of the following: Playlist Title 1, the identifier of Playlist 1, and Playlist Cover 1.
[0268] S1007. The audio recommendation module sends a notification to display the playlist to the system UI.
[0269] This notification carries the historical playlist information, including one or more of the title, identifier, and cover of the playlist.
[0270] S1008. The system UI displays the first-level card.
[0271] It can be understood that in S1003, if the electronic device is in the lit screen locked state, after the electronic device executes S1007, it executes S1008. In S1003, if the electronic device is in the turned-off screen locked state, after the electronic device executes S1007, it needs to execute S1008 after detecting a screen-on operation.
[0272] In some embodiments, when the electronic device is in the screen-off and locked state, after the electronic device executes S1007, the electronic device can automatically turn on the screen and display a first-level card on the lock screen interface. The embodiments of the present application do not make specific limitations on this.
[0273] Exemplarily, taking the lock screen interface as an example, the system UI can display Figure 12 the interface shown in a of. This interface includes card 1211. Card 1211 is a first-level card, and card 1211 includes: a favorite control, a previous control, a next control, a play control 1212, and a more control 1213. The first-level card 1211 is similar to the first-level card in the above Figure 2 and will not be elaborated here in detail.
[0274] It can be understood that when the electronic device detects that the electronic device meets a preset condition, it can obtain the relevant information of the playlist from the playlist database and control the system interface to display a notification card on the corresponding interface according to the relevant information of the playlist. The relevant information of the playlist includes but is not limited to: the title of the playlist, the cover corresponding to the playlist, the identifier of the playlist, etc.
[0275] Exemplarily, the audio control application in the electronic device detects that the electronic device meets a preset condition. The audio control management in the audio control application obtains the relevant information of the playlist from the playlist database and transmits the relevant information of the playlist to the system interface. The system interface displays a notification card.
[0276] S1009. In response to a trigger operation on the play control in the first-level card, the system interface transmits a media key event to the media session extension in the media session service.
[0277] The media key event includes but is not limited to: the identifier of the audio application corresponding to the triggered playlist, and the identifier of the triggered playlist.
[0278] Exemplarily, taking the Figure 12 interface shown in a of as an example, when the electronic device receives a click operation by the user on the play control 1212, the media key event includes: the identifier of application A, and the identifier of playlist 1 corresponding to playlist title 1.
[0279] In the embodiments of the present application, the media key event can also be referred to as a play event, and no limitation is made here.
[0280] S1010. The media session extension transmits the media key event to the basic media session.
[0281] S1011. The basic media session determines the state of the audio application.
[0282] In some embodiments, the electronic device may also not execute S1010 and S1011.
[0283] S1012. The media session extension queries the memory list, obtains a string containing the relevant information of the broadcast component corresponding to the audio application, and transmits the string corresponding to the audio application and the identifier of the triggered playlist to the media component.
[0284] The memory list can store the identifiers of multiple audio applications and the identifiers of multiple broadcast components. The identifier of the audio application corresponds one-to-one with the identifier of the broadcast component.
[0285] It should be noted that the media session list stores the relevant information of the running audio applications. When the audio application is not running (closed), the relevant information of the audio application is not included in the media session list. Different from the media session list, the storage of the relevant information of the broadcast component in the memory list is independent of the state of the audio application. When the audio application is not running (closed), it includes the relevant information of the broadcast component corresponding to the audio application.
[0286] Exemplarily, taking the interface shown in a of Figure 12 as an example, when the electronic device receives a click operation on the playback control 1212 by the user, the media session extension queries the memory list and obtains a string containing the relevant information of the broadcast component A corresponding to the audio application A. And it transmits the string corresponding to the audio application A and the identifier of playlist 1 to the media component.
[0287] S1013. The media component parses the string to obtain the name of the broadcast component, and transmits the name of the broadcast component and the identifier of the triggered playlist to the system broadcast service.
[0288] The code corresponding to the broadcast component can be ComponentName.java.
[0289] Exemplarily, taking the interface shown in a of Figure 12 as an example, when the electronic device receives a click operation on the playback control 1212 by the user, the media component parses the string to obtain the name of the broadcast component A; and transmits the name of the broadcast component A and the identifier of playlist 1 to the system broadcast service.
[0290] S1014. The system broadcast service transmits a media key event broadcast to the audio application. The media key event broadcast includes: the package name of the audio application, the name of the broadcast component, and the identifier of the playlist.
[0291] Exemplarily, taking the interface shown in a of Figure 12 as an example, when the electronic device receives a click operation on the playback control 1212 by the user, the media key event broadcast includes: the package name of application A, the name of the broadcast component A, and the identifier of playlist 1.
[0292] In some embodiments, the media key event broadcast includes: broadcasting the identifiers of component A and playlist 1. Component A includes: the package name of Application A. The system broadcast service calls the application entry function corresponding to the name of the broadcast component to start the audio application.
[0293] Exemplarily, the log corresponding to the above S1013 - S1014 when sending the media key event broadcast can be: 12-21 05:49:46.480 2480 4445 I MediaSessionService:dispatchMediaKeyEvent,pkg=com.hihonor.android.launcher pid=4588,uid=10101,asSystem=true,event=KeyEvent{action=ACTION_UP,keyCode=KEYCODE_MEDIA_PLAY,scanCode=0,metaState=0,flags=0x0,repeatCount=0,eventTime=36923549000000,downTime=36923549000000,deviceId=-1,source=0x0,displayId=-1}
[0294] 12-21 05:49:46.480 2480 4445 D PendingIntentHolder:Sending KeyEvent{action=ACTION_UP,keyCode=KEYCODE_MEDIA_PLAY,scanCode=0,metaState=0,flags=0x0,repeatCount=0,eventTime=36923549000000,downTime=36923549000000,deviceId=-1,source=0x0,displayId=-1} to the restored intent ComponentInfo{com.hihonor.cloudmusic / com.netease.cloudmusic.receiver.MediaButtonEventReceiver},type=1
[0295] 12-21 05:49:46.480 2480 4445I ActivityManager_broadcast:sendBroadcast,caller:ProcessRecord{33abf1f2480:system / 1000},act:android.intent.action.MEDIA_BUTTON
[0296] [modern],user:0,callingUid:1000,rep:false,ord:false,sti:false,flag:0x10000010,cmp:ComponentInfo{com.hihonor.cloudmusic / com.netease.cloudmusic.receiver.MediaButtonEventReceiver},dp:0,dgp:0,mftNum:1,rgtNum:null。
[0297] Among them, MediaSessionService is used to indicate the media session service. Sending KeyEvent: is used to indicate in response to a play event, ComponentInfo is used to indicate the information of the broadcast component, and this information includes: the package name of the audio application. media button is used to indicate the media key.
[0298] S1015. After receiving the media button event broadcast, the audio application starts and plays the songs in the playlist according to the identifier of the triggered playlist.
[0299] Exemplarily, as Figure 12 shown, after the electronic device receives the operation of the user clicking the play control 1212, it displays Figure 12 the interface shown in b of. This interface includes: card 1231. Card 1231 displays the song name, singer information, etc. of a certain song in playlist 1 corresponding to playlist title 1. Application A plays the songs in playlist 1.
[0300] The audio application can play the songs in the playlist in the order of the songs in the playlist from the first song in the playlist, or play from the song corresponding to the most recent play pause in the order of the songs in the playlist, or randomly select songs in the playlist to play, or select the song with the highest play frequency according to the play frequency of the songs in the playlist to play.
[0301] In this way, the electronic device can realize the wake-up of the audio application through the relevant information of the broadcast component stored in the memory list to play the playlist of the audio application.
[0302] It can be understood that the memory list can store relevant information corresponding to multiple audio applications; through the memory list, the wake-up of multiple audio applications and playlist playback can be achieved.
[0303] In some embodiments, the electronic device may also not distinguish the states of audio applications, and achieve the wake-up of audio applications and the playlist playback of the audio applications through the pre-stored relevant information. Specifically, after S603, the electronic device executes S608 - S611 to achieve playlist playback of the audio application, and does not execute S604, and S605 - S607.
[0304] Based on the above Figure 10 On the basis of the shown embodiments, the electronic device can also recommend more playlists. The following combines Figure 11 to illustrate the process of the electronic device recommending more playlists and the playlist playback process.
[0305] S1101. In response to the user's operation of triggering the more control, the system UI queries the playlist database for more playlists.
[0306] Exemplarily, as Figure 12 shown, when the electronic device displays the interface shown in a of Figure 12 , and receives the user's operation of clicking the more control 1213, the system UI queries the playlist database for more playlists.
[0307] S1102. The playlist database returns more playlist information to the system UI, and the more playlist information includes information of multiple playlists. The information of the playlist includes one or more of the following: playlist title, playlist identifier, and cover.
[0308] The information of multiple playlists may or may not include the information of Playlist 1.
[0309] Exemplarily, as Figure 12 shown, when the electronic device displays the interface shown in a of Figure 12 , and receives the user's operation of clicking the more control 1213, the more playlist information includes: the information of Playlist 2, the information of Playlist 3, and the information of Playlist 4.
[0310] S1103. Display multiple playlists.
[0311] The lock screen interface displays a secondary card.
[0312] Exemplarily, as Figure 12 shown, the electronic device displays Figure 12The interface shown in c. This interface includes: Card 1221 and Card 1222. Card 1221 is a first-level card, and Card 1222 is a second-level card. The content displayed on Card 1221 is similar to that on Card 1211, which will not be elaborated here. Card 1222 displays information about multiple playlists (for example, information about Playlist 2, Playlist 3, and Playlist 4). See Figure 12 The interface shown in c of, the information about multiple playlists includes: Playlist Title 2, Playlist Title 3, Playlist Title 4, and the playlist covers corresponding to Playlist Title 2, Playlist Title 3, and Playlist Title 4, which are 1223.
[0313] Subsequently, when the user clicks on the playlist cover, the songs in the corresponding playlist are triggered to play.
[0314] S1104. In response to the user's operation of clicking on Playlist 4, the system UI transmits a media key event to the media session extension.
[0315] Exemplarily, as Figure 12 shown, when the electronic device receives the user's operation of clicking on playlist cover 1223, it plays the songs in Playlist 4 corresponding to playlist cover 1223.
[0316] S1105. The media session extension transmits the media key event to the basic media session.
[0317] The media key event includes but is not limited to: the identifier of the audio application corresponding to the triggered playlist, and the identifier of the triggered playlist.
[0318] Exemplarily, taking the interface shown in b of Figure 12 as an example, when the electronic device receives the user's click operation on playlist cover 1223, the media key event includes: the identifier of Application B, and the identifier of Playlist 4 corresponding to playlist cover 1223.
[0319] In the embodiments of the present application, the media key event can also be referred to as a play event, which is not limited here.
[0320] S1106. The basic media session confirms the status of the audio application according to the identifier of the audio application.
[0321] In some embodiments, the basic media session can query the media session stack to confirm the status of the audio application.
[0322] Exemplarily, the media session stack stores the identifiers of the audio applications in the running state, and a flag bit. When the flag bit corresponding to the identifier of the audio application in the media session stack is true, the audio application is in the running state; when there is no identifier of the audio application in the media session stack, the audio application is in the non-running state.
[0323] Exemplarily, the media session stack stores the identifier of the audio application and a flag bit. When the flag bit corresponding to the identifier of the audio application in the media session stack is 1, the audio application is in a running state; when the flag bit corresponding to the identifier of the audio application in the media session stack is 0, the audio application is in a non-running state. The embodiments of the present application do not limit the stored content of the media session stack.
[0324] When the audio application is not in a running state, S1107-S1110 are executed. When the audio application is in a running state, S1111-S1108 are executed.
[0325] S1107. When the audio application is not in a running state, the media session extension retrieves the memory list, obtains a string containing the relevant information of the broadcast component corresponding to the audio application, and transmits the string to the media component.
[0326] Exemplarily, taking Figure 12 the interface shown in b in as an example, when the electronic device receives a click operation on the playlist cover 1223 by the user, the media session extension queries the memory list, obtains a string containing the relevant information of the broadcast component B corresponding to the audio application B, and transmits the string corresponding to the audio application B and the identifier of the playlist 4 to the media component.
[0327] S1108. The media component parses the string, obtains the name of the broadcast component, and transmits the name of the broadcast component and the identifier of the triggered playlist to the system broadcast service.
[0328] Exemplarily, taking Figure 12 the interface shown in b in as an example, when the electronic device receives a click operation on the playlist cover 1223 by the user, the media component parses the string, obtains the name of the broadcast component B, and transmits the name of the broadcast component B and the identifier of the playlist 4 to the system broadcast service.
[0329] S1109. The system broadcast service transmits a media key event broadcast to the audio application. The media key event broadcast includes: the package name of the audio application, the name of the broadcast component, and the identifier of the playlist.
[0330] Exemplarily, taking Figure 12 the interface shown in b in as an example, when the electronic device receives a click operation on the playlist cover 1223 by the user, the media key event broadcast includes: the package name of the application B, the name of the broadcast component B, and the identifier of the playlist 4.
[0331] In some embodiments, the media key event broadcast includes: the broadcast component B and the identifier of the playlist 4. The broadcast component B includes: the package name of the application B.
[0332] S1110. After receiving the media key event broadcast, the audio application plays the songs of the playlist.
[0333] Exemplarily, as Figure 12 shown, the electronic device displays Figure 12 the interface shown as d in
[0334] The processes of S1107 to S1110 can refer to the above S1012 to S1015, and will not be elaborated here.
[0335] S1111. When the audio application is in a running state, the basic media session retrieves the media session stack to obtain the media interface name corresponding to the audio application.
[0336] S1112. The basic media session calls the media interface to transmit the identifier of the playlist to the audio application.
[0337] S1113. The audio application plays the songs in the playlist.
[0338] Exemplarily, taking the interface shown as b in Figure 12 as an example, when the electronic device receives a click operation from the user on the playlist cover 1223, Application B plays the songs in Playlist 4.
[0339] The audio application can play the songs in the playlist in the order of the songs in the playlist starting from the first song, or play from the song corresponding to the most recent pause in the order of the songs in the playlist, or randomly select songs from the playlist to play. The embodiments of the present application do not make specific limitations on the playing method of the songs in the playlist.
[0340] In this way, the electronic device can play the songs in the playlist of the running audio application.
[0341] In some embodiments, the electronic device may also not distinguish the state of the audio application, and realize the wake-up of the audio application and the playlist playback of the audio application through pre-stored relevant information. Specifically, after S1105, the electronic device executes S1107 - S1110 to realize the playlist playback of the audio application, does not execute S1106, and S1110 - S1112.
[0342] Based on the above embodiments, when the audio application is in a running state, playlist recommendation can also be realized. The following will describe the recommendation and playback process of the playlist of the application in the running state in combination with Figure 13 and Figure 14 to illustrate.
[0343] After the above Application A is started, Application A is in a running state.
[0344] Exemplarily, Figure 13 is a schematic flow diagram of an internal module interaction provided by an embodiment of the present application. As Figure 13As shown, the process includes: when there is no user operation for a long time, the electronic device turns off the screen and locks the screen.
[0345] S1301. Detecting a user's screen-on operation, the system UI queries the status of the media session from the basic media session.
[0346] It can be understood that the electronic device can turn off the screen when there is no user operation for a long time, or can also turn off the screen after receiving a user's screen-off operation, which is not specifically limited here.
[0347] S1302. The basic media session transmits the package name of Application A to the system UI.
[0348] It can be understood that the basic media session transmits the package name of the running audio application to the system UI. Since Application A is in the running state, the basic media session transmits the package name of Application A to the system UI. If Application B is in the running state, the basic media session transmits the package names of Application A and Application B to the system UI.
[0349] S1303. The system UI queries the playlist from Application A.
[0350] S1304. Application A transmits the most recently played playlist to the system UI. Adaptively, the system UI displays a first-level card, and the playlist in the first-level card is the most recently played playlist of Application A.
[0351] Exemplarily, when the electronic device receives a screen-on operation, it displays Figure 14 the interface shown in a of. This interface includes Card 1411. Card 1411 displays Playlist Title 1, a favorite control, a play control, and More Control 1412. The playlist corresponding to Playlist Title 1 is the most recently played playlist of Application A.
[0352] S1305. In response to a trigger operation on the More Control in the first-level card, the system UI queries more historical playlists from the playlist database.
[0353] Exemplarily, referring to Figure 14 , in response to the user clicking on More Control 1412 on the first-level card 1411 of the lock screen interface, the system UI queries more historical playlists from the playlist database.
[0354] S1306. The playlist database returns information on more historical playlists to the system UI.
[0355] The information on more historical playlists includes information on multiple historical playlists and the playlist recommendation order.
[0356] Exemplarily, referring to Figure 14, in response to the user clicking on the more controls 1412 on the first-level card 1411 of the lock screen interface, the more playlist information includes: the information of playlist 2, the information of playlist 3, and the information of playlist 4.
[0357] S1307. The system UI displays a second-level card based on the information of more historical playlists. The earphone card includes multiple playlists displayed in the recommended order of the playlists.
[0358] Exemplarily, as Figure 14 shown, the electronic device displays Figure 14 the interface shown in b of. This interface includes: card 1421 and card 1422. Card 1421 is a first-level card, and card 1422 is a second-level card. The content displayed on card 1421 is similar to that on card 1411, which will not be elaborated here. Card 1422 displays playlist title 2, playlist title 3, playlist title 4, as well as the playlist covers corresponding to playlist title 2, the playlist cover corresponding to playlist title 3, and the playlist cover 1423 corresponding to playlist title 4.
[0359] Subsequently, the user triggers the playback of the songs in the corresponding playlist by clicking on the playlist cover.
[0360] S1308. In response to the user's operation of clicking on the playlist cover of playlist 4, the system interface transmits a media key event to the media session extension in the media session service.
[0361] The media key event includes but is not limited to: the identifier of the audio application corresponding to the triggered playlist, and the identifier of the triggered playlist.
[0362] Exemplarily, as Figure 14 shown, the electronic device receives the operation of the user clicking on the playlist cover 1423. The media key event includes: the identifier of application B, and the identifier of playlist 4 corresponding to the playlist cover 1423.
[0363] S1309. The media session extension transmits the media key event to the basic media session.
[0364] S1310. The basic media session confirms the status of the audio application according to the identifier of the audio application.
[0365] The basic media session queries the media session stack. In the case of no identifier of the audio application, it is confirmed that the audio application is in the non-running state.
[0366] When the audio application is in the running state, the electronic device executes S1315 - S1317 to realize the playlist playback in the running audio application; when the audio application is in the non-running state, the electronic device executes S1311 - S1314 to realize the playlist playback in the non-running audio application.
[0367] S1311. When the audio application is not in the running state, the media session extension queries the memory list to obtain a string containing the relevant information of the broadcast component corresponding to the audio application, and transmits the string to the media component.
[0368] Exemplarily, as Figure 14 shown, after the electronic device receives the operation of the user clicking on the playlist cover 1423, the media session extension queries the memory list to obtain a string containing the relevant information of the broadcast component B corresponding to the audio application B. And transmits the string corresponding to the audio application B and the identifier of the playlist 4 to the media component.
[0369] S1312. The media component parses the string to obtain the name of the broadcast component, and transmits the name of the broadcast component and the identifier of the triggered playlist to the system broadcast service.
[0370] Exemplarily, as Figure 14 shown, after the electronic device receives the operation of the user clicking on the playlist cover 1423, the media component parses the string corresponding to the audio application B to obtain the name of the broadcast component B; and transmits the name of the broadcast component B and the identifier of the playlist 4 to the system broadcast service.
[0371] S1313. The system broadcast service transmits a media key event broadcast to the audio application. The media key event broadcast includes: the package name of the audio application, the name of the broadcast component, and the identifier of the playlist.
[0372] Exemplarily, as Figure 14 shown, after the electronic device receives the operation of the user clicking on the playlist cover 1423, the media key event broadcast includes: the package name of the application B, the name of the broadcast component B, and the identifier of the playlist 4.
[0373] In some embodiments, the media key event broadcast includes: the broadcast component B and the identifier of the playlist 4. The broadcast component B includes: the package name of the application B.
[0374] S1314. After receiving the media key event broadcast, the audio application plays the playlist.
[0375] Exemplarily, as Figure 14 shown, after the electronic device receives the operation of the user clicking on the playlist cover 1423, the electronic device plays the songs of the playlist corresponding to the playlist title 4 and displays Figure 14 the interface shown in d of
[0376] S1315. When the audio application is in the running state, the basic media session queries the media session stack to obtain the media interface name corresponding to the audio application.
[0377] Exemplarily, taking the user clicking on the playlist cover 204 as an example, when application A is in the running state, the basic media session retrieves the media session stack and obtains the media interface name corresponding to application A.
[0378] S1316. The basic media session calls the media interface and transmits the identifier of the playlist to the audio application.
[0379] Exemplarily, taking the user clicking on the playlist cover 204 as an example, the basic media session transmits the identifier of the playlist corresponding to the playlist cover 204 to application A.
[0380] S1317. The audio application plays the playlist.
[0381] Exemplarily, as Figure 14 shown, after the electronic device receives the operation of the user clicking on the playlist cover 1423, application B plays the songs in playlist 4.
[0382] The audio application can play from the first song in the playlist in the order of the songs in the playlist, or play from the song corresponding to the most recent playback pause in the order of the songs in the playlist, or randomly select songs in the playlist to play. The embodiments of the present application do not make specific limitations on the playback method of the songs in the playlist.
[0383] In this way, the electronic device can play the playlist of the running audio application.
[0384] The above Figure 13 The embodiments shown are described taking the lock screen interface as an example. In some embodiments, the electronic device receives the operation of the user to start application C, and the electronic device runs application A in the background. When the electronic device receives the downward sliding operation of the user, a card is displayed in the drop-down notification interface, and the card displays the currently playing song, more controls, etc.
[0385] The above Figures 5 to 14 In the embodiments shown, the electronic device can wake up the audio application according to the information stored in the memory list. The information stored in the memory list can be stored when the electronic device is running the audio application, or can be obtained from the playlist database during the boot initialization process of the electronic device.
[0386] Next, the boot initialization process will be described in conjunction with Figure 15 the following.
[0387] Exemplarily, Figure 15 is a schematic flow diagram of the internal module interaction of an electronic device provided by an embodiment of the present application. As Figure 15 shown, the process includes:
[0388] S1501. The electronic device boots up, and the basic media session is initialized.
[0389] S1502. The basic media session extends the transmission of a message for indicating initialization to the media session.
[0390] S1503. The media session extension transmits a message for querying the broadcast component to the playlist database to obtain the relevant information of the broadcast component corresponding to one or more audio applications. The one or more audio applications are the audio applications installed and run on the electronic device.
[0391] S1504. The playlist database transmits the relevant information of the broadcast component corresponding to one or more audio applications to the media session extension.
[0392] It can be understood that if the electronic device has never run an audio application, the information transmitted by the playlist database to the media session extension is empty.
[0393] S1505. The media session extension stores the relevant information of the broadcast component corresponding to one or more audio applications in the memory list.
[0394] In this way, after the electronic device restarts or shuts down and then powers on again, the wake-up and audio playback of multiple audio applications can be realized through the memory list, improving the user experience.
[0395] S1506. The media session extension registers an application uninstallation broadcast listener to listen for the uninstallation of one or more audio applications.
[0396] In this way, when an audio application is uninstalled subsequently, the information of the playlist of the audio application and the relevant information of the broadcast component corresponding to the audio application can be deleted, reducing the situation of unable to play.
[0397] The following Figure 16 illustrates the uninstallation process of the audio application.
[0398] Exemplarily, Figure 16 is a schematic flow diagram of the internal module interaction corresponding to the uninstallation of an audio application provided by an embodiment of the present application. As Figure 16 shown, the process includes:
[0399] S1601. In response to the user's operation of uninstalling the audio application, the electronic device uninstalls the audio application.
[0400] S1602. The audio application transmits an application uninstallation broadcast to the media session extension.
[0401] The application uninstallation broadcast includes: the identifier of the audio application (for example, the package name, etc.).
[0402] S1603. The media session extension deletes the relevant information of the broadcast component corresponding to the audio application from the memory list.
[0403] In this way, after the application is uninstalled, the corresponding content is deleted, reducing the data stored in the memory and reducing the signaling consumption. During the subsequent use of the electronic device, the uninstalled audio application will not be awakened.
[0404] S1604. The media session extension transmits a message for instructing to delete the audio application to the playlist database.
[0405] S1605. The playlist database deletes the relevant information of the broadcast component corresponding to the audio application.
[0406] In some embodiments, the playlist database also deletes the relevant information of the playlist corresponding to the audio application.
[0407] In this way, after the application is uninstalled, the corresponding content is deleted, reducing the data stored in the playlist database and reducing the signaling consumption. When the electronic device is powered on and restarted again, the relevant information of the uninstalled audio application will not be stored in the memory list.
[0408] In the above embodiments, the interface of the electronic device may display the content of one or more playlists in the form of a notification card. In some embodiments, after the electronic device establishes a communication connection with a display device such as a vehicle or a watch, the electronic device may also control the display device to display the content of one or more playlists. Adaptively, the user may control the electronic device to play the audio of the one or more playlists through the display device, or control the display device to play the audio of the one or more playlists. In the embodiments of the present application, the interface display, playback control method, etc. of the display device are not limited.
[0409] It can be understood that the playlist in the above embodiments may also be replaced with a list of audio books, a list of videos that can be played in the background, etc. The specific form of the audio list is not specifically limited in the embodiments of the present application.
[0410] Exemplarily, Figure 17 is a schematic flowchart of an audio playback method provided by an embodiment of the present application. As Figure 17 shown, the method includes:
[0411] S1701. After detecting a first event, the electronic device displays a first control and a first playlist of a first audio application.
[0412] The electronic device is an electronic device with a display function, such as a mobile phone, a tablet, etc., which is not specifically limited here.
[0413] The first event may be a headphone connection event, a car radio connection event, an event of detecting a preset scenario, etc., which is not specifically limited here. The headphone connection event, the car radio connection event, and the preset scenario may refer to the corresponding descriptions above and will not be elaborated here.
[0414] The first audio application may correspond to the audio application in the foregoing text. For example, it may be Application A. The first playlist may correspond to Playlist 1 in the foregoing text.
[0415] The connection event may be that the electronic device receives a connection request sent by the second electronic device (such as a Bluetooth connection request), or that the electronic device detects that the second electronic device is connected to the electronic device through a connection line.
[0416] S1702. In response to an operation on the first control, the electronic device displays a second playlist of a second audio application, and the second audio application is in an unrun state.
[0417] The first control is used to implement the display of more playlists. The first control may be the more control in the foregoing text. The second playlist may correspond to Playlist 3 or Playlist 4 in the foregoing text.
[0418] The operation on the first control may be a click operation, a double-click operation, a voice operation, or any type of operation, and no specific limitation is made here.
[0419] S1703. In response to a play operation on the second playlist, the media session service sends a first broadcast component and an identifier of the second playlist to the second audio application. The first broadcast component includes: the package name of the second audio application.
[0420] The play operation on the second playlist may be an operation where the user clicks on the cover of the second playlist, or an operation where the user gives a voice instruction to play the second playlist, or any type of operation, and no specific limitation is made here.
[0421] The identifier of the second playlist may be the name of the second playlist, the index value of the second playlist, or any identifier, and no specific limitation is made here.
[0422] The second audio application may correspond to Application B in the foregoing Figure 11 illustrated embodiment, or may correspond to Application B in the foregoing Figure 13 illustrated embodiment, and no specific limitation is made here. The first broadcast component may correspond to Broadcast Component B in the foregoing text.
[0423] S1704. In response to receiving the first broadcast component, the electronic device starts the second audio application and plays the songs in the second playlist.
[0424] In this way, the electronic device can display one or more playlists after detecting the first event. When detecting a play operation on a playlist corresponding to an unrun audio application, the electronic device can start the audio application corresponding to the playlist and play the songs in the playlist, reducing user operations and enhancing the user experience.
[0425] Optionally, in response to a play operation on the second playlist, the media session service sends the first broadcast component and the identifier of the second playlist to the second audio application, including: in response to the play operation on the second playlist, the media session service determines the first broadcast component according to the package name of the second audio application and the correspondence between the package names of audio applications and broadcast components; the media session service sends a first broadcast to the second audio application through the system broadcast service, and the first broadcast includes: the first broadcast component and the identifier of the second playlist.
[0426] In some embodiments, the correspondence can be saved in the form of a string, so that the memory occupancy can be reduced.
[0427] In this way, obtaining the broadcast component through the correspondence is simple and easy to implement.
[0428] Optionally, in response to a play operation on the second playlist, the media session service determines the first broadcast component according to the package name of the second audio application and the correspondence between the package names of audio applications and broadcast components, including: in response to the play operation on the second playlist, the media session service receives a media key event, and the media key event includes: the identifier of the second audio application and the identifier of the second playlist; in response to the media key event, the media session service retrieves the correspondence between the package names of audio applications and broadcast components stored in the memory according to the package name of the second audio application, and determines the first broadcast component.
[0429] In this way, the media session service can query and obtain the broadcast component when receiving a media key play event.
[0430] Optionally, in response to a play operation on the second playlist, the media session service determines the first broadcast component according to the package name of the second audio application and the correspondence between the package names of audio applications and broadcast components, including: in response to the play operation on the second playlist, the media session service queries the running state of the second audio application; in the case where the second audio application is in an unrun state, the media session service determines the first broadcast component according to the package name of the second audio application and the correspondence between the package names of audio applications and broadcast components.
[0431] In this way, when the audio application is not running, the audio application is started through the broadcast component. If the audio application is not running, playlist playback can be implemented without the broadcast component.
[0432] Optionally, in response to a play operation on the second playlist, the media session service queries the running state of the second audio application, including: the media session service queries the media session stack according to the identifier of the second audio application to confirm that the second audio application is in an unrun state, and the media session stack is used to store information of audio applications in a running state in the electronic device.
[0433] In this way, the status of the audio application can be confirmed through the media session stack in a simple and easy-to-implement manner.
[0434] Optionally, in response to an operation on the first control, the electronic device displays a second playlist of a second audio application, including: in response to an operation on the first control, the electronic device queries information about the second playlist; the information about the second playlist includes one or more of the following: the identifier of the second playlist, the cover of the second playlist, and the title of the second playlist; in response to the information about the second playlist, the electronic device displays the second playlist.
[0435] In this way, the electronic device can obtain the information about the second playlist to display the second playlist on the interface.
[0436] Optionally, in response to an operation on the first control, the electronic device queries information about the second playlist, including: in response to an operation on the first control, the system interface transmits a first message for instructing to obtain more playlists to the playlist database; in response to the first message, the playlist database transmits information about multiple playlists to the system interface, and the information about the multiple playlists includes: the information about the second playlist.
[0437] In this way, the information about multiple playlists can be obtained from the database to display multiple playlists on the interface.
[0438] Optionally, before the first event is detected, the first audio application is in a non-running state.
[0439] In this way, it can also be applicable to the scenario where no audio application is running, improving the user experience.
[0440] Optionally, after the first event is detected, the electronic device displays the first control and the first playlist of the first audio application, including: in response to the first event, the electronic device determines that all audio applications in the electronic device are in a non-running state; in the case where all audio applications in the electronic device are in a non-running state, the electronic device queries information about the first playlist, and the information about the first playlist includes one or more of the following: the identifier of the first playlist, the cover of the first playlist, and the title of the first playlist; in response to the information about the first playlist, the electronic device displays the first control and the first playlist.
[0441] In this way, after the first event, the information about the first playlist can be obtained for display.
[0442] Optionally, in response to the first event, the electronic device determines that all audio applications in the electronic device are in a non-running state, including: in response to the first event, the electronic device determines that all audio applications in the electronic device are in a non-running state by querying the information in the media session stack of the media session service; the media session stack is used to store information about audio applications in a running state.
[0443] In this way, the status of the audio application is confirmed through the media session stack, and when none of the audio applications are running, a playlist is pushed. The method is simple and easy to implement.
[0444] Optionally, in response to the first event, the electronic device queries the media session stack in the media session service to determine that none of the audio applications in the electronic device are running, including: in response to the first event, the audio recommendation module transmits a second message for instructing to query the media session stack to the media session service; in response to the second message, the media session service transmits a third message for instructing that the audio application is not registered to the audio recommendation module; when none of the audio applications in the electronic device are running, the electronic device queries the information of the first playlist, including: in response to the third message, the audio recommendation module queries the information of the playlists in the playlist database to obtain the information of the first playlist.
[0445] The first message may correspond to S1001 in the foregoing text, the second message may correspond to S1002 in the foregoing text, and the third message may correspond to S1005 in the foregoing text.
[0446] In this way, the status of the audio application is confirmed through the media session stack, and when none of the audio applications are running, a playlist is pushed. The method is simple and easy to implement.
[0447] Optionally, the method further includes: in response to a play operation on the first playlist, the media session service sends a second broadcast component and the identifier of the first playlist to the first audio application, where the second broadcast component includes: the package name of the first audio application; in response to receiving the second broadcast component, the first audio application is started and the songs in the first playlist are played.
[0448] The second broadcast component may correspond to broadcast component A in the foregoing text.
[0449] In this way, the start of the first audio application and the playing of the songs in the first playlist can be implemented through the broadcast component.
[0450] Optionally, the first event is a headphone connection event; the first playlist is related to the scenario where the electronic device is located, and the scenario includes but is not limited to: a sleep scenario, a driving scenario, and a commuting scenario.
[0451] In this way, playlists can be pushed according to the scenario where the electronic device is located, improving the user experience.
[0452] Optionally, the first playlist and the second playlist are displayed from near to far according to the playlist play order, or are displayed from largest to smallest according to the cumulative play duration of the playlist within a preset period, or are displayed from largest to smallest according to the play frequency of the playlist within a preset period.
[0453] In this way, playlists that the user has played more and / or have a longer play duration can be pushed, improving the user experience.
[0454] Optionally, after detecting the first event, the electronic device displays a first control and a first playlist of a first audio application, including: the electronic device queries the screen state of the display screen in the electronic device; in response to querying the screen state, it is used to confirm the interface for the electronic device to display the first control and the playlist.
[0455] In this way, according to the screen state of the electronic device, the interface for pushing the playlist can be confirmed, and accurate pushing can improve the user experience.
[0456] Optionally, the electronic device queries the screen state of the display screen in the electronic device, including: the audio recommendation module queries the screen state of the display screen through the screen management module.
[0457] In this way, by using the screen management module to confirm the screen state, the operation is simple and easy to implement.
[0458] Optionally, the electronic device displays a first control and a first playlist of a first audio application, including any of the following: when the electronic device is in the screen-on and locked state, the electronic device displays the first control and the first playlist on the lock screen interface; or, when the electronic device is in the screen-off and locked state, in response to a first operation on the electronic device, the electronic device displays the first control and the first playlist on the lock screen interface; or, when the electronic device is in the unlocked state, in response to a second operation on the display screen of the electronic device, a drop-down notification interface is displayed, and the electronic device displays the first control and the first playlist on the drop-down notification interface.
[0459] The first operation may correspond to the screen-on operation described above. The first operation may be an operation of the user picking up the electronic device, an operation of the user clicking on the display screen, an operation of the user double-clicking on the display screen, or any type of operation, which is not specifically limited here.
[0460] The second operation may be an operation of the user swiping down (dragging down) from the top of the display screen, or an operation of the user swiping up from the bottom of the display screen, or an operation of the user swiping right from the left side of the display screen, or an operation of the user swiping left from the right side of the display screen, or any type of operation, which is not specifically limited here.
[0461] Optionally, before detecting the first event, the method further includes: in response to a start operation of a second audio application, the second audio application sends the package name of the second audio application and a first broadcast component to the media session service; in response to receiving the package name of the second audio application and the first broadcast component, the media session service stores the correspondence between the package name of the second audio application and the first broadcast component in the memory, and / or stores the correspondence between the package name of the second audio application and the first broadcast component in the playlist database, and the data in the playlist database will not be cleared after the electronic device is powered off; in response to a close operation of the second audio application, the electronic device closes the second audio application.
[0462] In this way, the relationship between the package name of the audio application and the broadcast component can be stored, facilitating the playback of the playlist displayed on the subsequent interface. Storing in the memory can improve the query speed of the corresponding relationship subsequently. Storing in the playlist database enables the corresponding relationship to exist after the electronic device is powered off and then powered on, facilitating the subsequent use of the electronic device.
[0463] Optionally, the method further includes: in response to an uninstall operation for a second audio application, the electronic device uninstalls the second audio application and deletes the corresponding relationship between the identifier of the second audio application and the first broadcast component from the memory and / or the playlist database.
[0464] In this way, when the audio application is uninstalled, the corresponding information is deleted, reducing the memory occupancy of the electronic device.
[0465] The method provided in the embodiments of the present application has been described above. Next, the device for executing the above method provided in the embodiments of the present application will be described. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the related device provided in the embodiments of the present application can execute the steps in the above method.
[0466] The audio playback method provided in the embodiments of the present application can be applied to an electronic device with an audio playback function. The specific device form of the electronic device and the like can refer to the above related description, which will not be elaborated here.
[0467] The embodiments of the present application provide an electronic device, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the above method.
[0468] The embodiments of the present application provide a chip. The chip includes a processor, and the processor is used to call the computer program in the memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those of the above related embodiments, which will not be elaborated here.
[0469] The embodiments of the present application provide a chip system, the chip system is applied to an electronic device, and the chip system includes one or more processors, and the processors are used to call computer instructions to enable the electronic device to execute the above method.
[0470] The embodiments of the present application provide a computer-readable storage medium, and the computer-readable storage medium includes instructions, which, when running on an electronic device, enable the electronic device to execute the above method.
[0471] The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored on a computer-readable medium or transmitted over a computer-readable medium as one or more instructions or codes. A computer-readable medium can include a computer storage medium and a communication medium, and can also include any medium that can transfer a computer program from one place to another. A storage medium can be any target medium accessible by a computer.
[0472] In one possible implementation, a computer-readable medium can include RAM, ROM, a compact disc read-only memory (CD-ROM), or other optical disc storage, a magnetic disk storage, or other magnetic storage device, or any other medium targeted to carry or store the required program code in the form of instructions or data structures and accessible by a computer. Moreover, any connection is properly termed a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of the medium. As used herein, disk and disc include optical disc, laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where disks typically reproduce data magnetically, while discs reproduce data optically using lasers. The above combinations should also be included within the scope of computer-readable media.
[0473] An embodiment of this application provides a computer program product. The computer program product includes a computer program that, when run, causes a computer to execute the above methods.
[0474] The embodiments of this application are described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of this application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable devices to generate a machine, such that the instructions executed by the processing unit of the computer or other programmable data processing device generate means for implementing the functions specified in one Figure 1 one or more flows and / or Figure 1 more blocks or multiple blocks.
[0475] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for users to choose to authorize or reject.
[0476] The above specific implementation manners further elaborate on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are only specific implementation manners of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention shall be included within the protection scope of the present invention.
Claims
1. An audio playback method, characterized in that, Applied to an electronic device, the electronic device includes: a first audio application, a second audio application, and a media session service; the method includes: After detecting a first event, the electronic device displays a first control and a first playlist of the first audio application; In response to an operation on the first control, the electronic device displays a second playlist of the second audio application, and the second audio application is in a non-running state; In response to a play operation on the second playlist, the media session service sends a first broadcast component and an identifier of the second playlist to the second audio application, and the first broadcast component includes: the package name of the second audio application; In response to receiving the first broadcast component, the electronic device starts the second audio application and plays the songs in the second playlist.
2. The method according to claim 1, characterized in that The step that in response to a play operation on the second playlist, the media session service sends a first broadcast component and an identifier of the second playlist to the second audio application includes: In response to a play operation on the second playlist, the media session service determines the first broadcast component according to the package name of the second audio application and the correspondence between the package names of audio applications and broadcast components; The media session service sends a first broadcast to the second audio application through the system broadcast service, and the first broadcast includes: the first broadcast component and the identifier of the second playlist.
3. The method according to claim 2, wherein The step that in response to a play operation on the second playlist, the media session service determines the first broadcast component according to the package name of the second audio application and the correspondence between the package names of audio applications and broadcast components includes: In response to a play operation on the second playlist, the media session service receives a media key event, and the media key event includes: an identifier of the second audio application and an identifier of the second playlist; In response to the media key event, the media session service retrieves the correspondence between the package names of audio applications and broadcast components stored in the memory according to the package name of the second audio application to determine the first broadcast component.
4. The method according to claim 2 or 3, characterized in that, The step that in response to a play operation on the second playlist, the media session service determines the first broadcast component according to the package name of the second audio application and the correspondence between the package names of audio applications and broadcast components includes: In response to a play operation on the second playlist, the media session service queries the running state of the second audio application; When the second audio application is in a non-running state, the media session service determines the first broadcast component according to the package name of the second audio application and the correspondence between the package names of audio applications and broadcast components.
5. The method according to claim 4, characterized in that The step that in response to a play operation on the second playlist, the media session service queries the running state of the second audio application includes: The media session service queries the media session stack according to the identifier of the second audio application to confirm that the second audio application is in a non-running state, and the media session stack is used to store information of audio applications in a running state in the electronic device.
6. The method according to any one of claims 1 to 5, characterized in that In response to an operation on the first control, the electronic device displays a second playlist of the second audio application, including: In response to an operation on the first control, the electronic device queries information of the second playlist; the information of the second playlist includes one or more of the following: an identifier of the second playlist, a cover of the second playlist, a title of the second playlist; In response to the information of the second playlist, the electronic device displays the second playlist.
7. The method according to claim 6, characterized in that, The electronic device includes a system interface and a playlist database. In response to an operation on the first control, the electronic device queries information of the second playlist, including: In response to an operation on the first control, the system interface transmits a first message for instructing to obtain more playlists to the playlist database; In response to the first message, the playlist database transmits information of multiple playlists to the system interface, and the information of the multiple playlists includes: information of the second playlist.
8. The method according to any one of claims 1-7, characterized in that Before the first event is detected, the first audio application is in a non-running state.
9. The method according to claim 8, wherein After the first event is detected, the electronic device displays a first control and a first playlist of the first audio application, including: In response to the first event, the electronic device determines that all audio applications in the electronic device are in a non-running state; When all audio applications in the electronic device are in a non-running state, the electronic device queries information of the first playlist, and the information of the first playlist includes one or more of the following: an identifier of the first playlist, a cover of the first playlist, a title of the first playlist; In response to the information of the first playlist, the electronic device displays the first control and the first playlist.
10. The method according to claim 9, characterized in that, In response to the first event, the electronic device determines that all audio applications in the electronic device are in a non-running state, including: In response to the first event, the electronic device determines that all audio applications in the electronic device are in a non-running state by querying information of a media session stack in the media session service; the media session stack is used to store information of audio applications in a running state.
11. The method according to claim 10, wherein The electronic device includes an audio recommendation module. In response to the first event, the electronic device queries the media session stack in the media session service and determines that all audio applications in the electronic device are in a non-running state, including: In response to the first event, the audio recommendation module transmits a second message for instructing to query the media session stack to the media session service; In response to the second message, the media session service transmits a third message for indicating that no audio application is registered to the audio recommendation module; When all audio applications in the electronic device are in a non-running state, the electronic device queries information of the first playlist, including: In response to the third message, the audio recommendation module queries information of playlists in the playlist database to obtain information of the first playlist.
12. The method according to any one of claims 8-11, characterized in that The method further includes: In response to a play operation for the first playlist, the media session service sends a second broadcast component and an identifier of the first playlist to the first audio application, where the second broadcast component includes: the package name of the first audio application; In response to receiving the second broadcast component, start the first audio application and play the songs in the first playlist.
13. The method according to any one of claims 8-12, wherein the first event is a headphone connection event; the first playlist is related to the scenario where the electronic device is located, and the scenario includes but is not limited to: a sleep scenario, a car audio scenario, a commuting scenario.
14. The method according to any one of claims 1-13, wherein the first playlist and the second playlist are displayed from near to far according to the playlist play order, or are displayed from largest to smallest according to the cumulative play duration of the playlist within a preset period, or are displayed from largest to smallest according to the play frequency of the playlist within the preset period.
15. The method according to any one of claims 1-14, characterized in that, After detecting the first event, the electronic device displays a first control and a first playlist of the first audio application, including: the electronic device queries the screen state of the display screen in the electronic device; In response to querying the screen state to confirm the interface for the electronic device to display the first control and the playlist.
16. The method according to claim 15, characterized in that, The querying the screen state of the display screen in the electronic device includes: the audio recommendation module queries the screen state of the display screen through the screen management module.
17. The method according to claim 15 or 16, characterized in that The electronic device displays a first control and a first playlist of the first audio application, including any one of the following: When the electronic device is in the screen-on and locked screen state, the electronic device displays the first control and the first playlist on the locked screen interface; Or, when the electronic device is in the screen-off and locked screen state, in response to a first operation on the electronic device, the electronic device displays the first control and the first playlist on the locked screen interface; Or, when the electronic device is in the unlocked state, in response to a second operation on the display screen of the electronic device, a drop-down notification interface is displayed, and the electronic device displays the first control and the first playlist on the drop-down notification interface.
18. The method according to any one of claims 1-17, characterized in that, Before detecting the first event, the method further includes: In response to a start operation of the second audio application, the second audio application sends the package name of the second audio application and the first broadcast component to the media session service; In response to receiving the package name of the second audio application and the first broadcast component, the media session service stores the correspondence between the package name of the second audio application and the first broadcast component in the memory, and / or stores the correspondence between the package name of the second audio application and the first broadcast component in the playlist database, and the data in the playlist database will not be cleared after the electronic device is powered off; In response to a close operation of the second audio application, the electronic device closes the second audio application.
19. The method according to claim 18, characterized in that, The method further includes: In response to an uninstall operation for the second audio application, the electronic device uninstalls the second audio application and deletes the correspondence between the identifier of the second audio application and the first broadcast component from the memory and / or the playlist database.
20. An electronic device, characterized in that, The electronic device includes: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code. The computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the electronic device to execute the method according to any one of claims 1-19.
21. A chip system, characterized in that, The chip system is applied to an electronic device. The chip system includes one or more processors, and the processors are used to call computer instructions to cause the electronic device to execute the method according to any one of claims 1-19.
22. A computer-readable storage medium, characterized in that, Includes instructions that, when running on an electronic device, cause the electronic device to execute the method according to any one of claims 1-19.
23. A computer program product, characterized in that, Includes a computer program that, when run, causes a computer to execute the method according to any one of claims 1-19.
Citation Information
Patent Citations
Control mode for realizing specific function under screen locking state of touch screen terminal
CN102750066A
Display method and device for control panel of player
CN102902453A
Music playback method and device, storage medium and terminal
CN107241511A
Method and system for generating audio playing list, and audio playing system
CN107562745A
Audio playing method and device, storage medium and terminal
CN113380279A