Audio stream control method and device of display system, electronic equipment and storage medium

By obtaining the audio stream identifier in a multi-screen display system and using a mapping table to determine the target screen identifier and strategy, the problem of audio stream differentiation and routing in a multi-screen system is solved, realizing intelligent management and control of audio streams and improving user experience.

CN122173049APending Publication Date: 2026-06-09ANYSMART TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANYSMART TECH CO LTD
Filing Date
2026-03-05
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, multi-screen display systems lack the ability to effectively distinguish and route audio streams from different screen sources, resulting in inflexible audio control.

Method used

When an audio playback request is detected, the identifier of the audio stream is obtained, and the mapping table between the audio stream identifier and the screen identifier is dynamically updated and queried to determine the target screen identifier, thereby determining the target audio strategy and achieving accurate identification and routing of audio streams for different screens.

Benefits of technology

It enables intelligent management and control of audio streams in multi-screen systems, improving the flexibility of audio control and the consistency of user experience, and adapting to dynamic screen switching and multi-process scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173049A_ABST
    Figure CN122173049A_ABST
Patent Text Reader

Abstract

This application discloses an audio stream control method, apparatus, electronic device, and storage medium for a display system, relating to the field of display control technology. The audio stream control method for the display system includes: upon detecting an audio playback request, obtaining a first identifier of a target audio stream; the target audio stream being the audio stream corresponding to the audio playback request; the first identifier being an audio stream identifier corresponding to the target audio stream; querying a current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier; the current mapping table being a mapping table of the current correspondence between audio stream identifiers and screen identifiers; determining a target audio strategy based on the target screen identifier; and executing the target audio strategy. This application can achieve accurate identification and routing of audio streams from different screens, realizing intelligent control of audio streams.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of display control technology, specifically to audio stream control methods, devices, electronic devices, and storage media for display systems. Background Technology

[0002] With the increasing trend of multi-screen smart terminal devices, multiple displays can run different applications simultaneously, and each application may output an independent audio stream. However, related audio systems typically process all audio streams uniformly, lacking the ability to effectively differentiate and route audio streams from different screen sources. Summary of the Invention

[0003] This application provides an audio stream control method, device, electronic device, and storage medium for a display system, which can effectively identify and route audio streams from different screens, and achieve intelligent management and control of audio streams.

[0004] On one hand, embodiments of this application provide an audio stream control method for a display system, the display system including multiple screens; the method includes: upon detecting an audio playback request, obtaining a first identifier of a target audio stream; wherein the target audio stream is the audio stream corresponding to the audio playback request; the first identifier is an audio stream identifier corresponding to the target audio stream; querying a current mapping table based on the first identifier to determine a target screen identifier corresponding to the first identifier; wherein the current mapping table is a mapping table of the current correspondence between audio stream identifiers and screen identifiers; determining a target audio strategy based on the target screen identifier; and executing the target audio strategy.

[0005] Optionally, the step of querying the current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier includes: if there is a mapping relationship between the first identifier and the current mapping table, determining the target screen identifier based on the screen identifier corresponding to the first identifier in the current mapping table; if there is no mapping relationship between the first identifier and the current mapping table, obtaining the second identifier corresponding to the first identifier, and determining the target screen identifier based on the case where the current mapping table contains the second identifier; the second identifier is a user identifier.

[0006] Optionally, determining the target screen identifier based on the case that the current mapping table contains the second identifier includes: if it is determined that the current mapping table contains an audio stream identifier that contains the second identifier, determining the screen identifier corresponding to the audio stream identifier that contains the second identifier in the current mapping table as the target screen identifier.

[0007] Optionally, the display system includes multiple applications; each application includes a first process, and the first process includes multiple second processes; the method further includes: if there is a mapping relationship between the first identifier and the current mapping table, determining that the process type corresponding to the audio playback request is the first process; if it is determined that there is an audio stream identifier containing the second identifier in the current mapping table, determining that the process type corresponding to the audio playback request is the second process.

[0008] Optionally, the display system includes multiple applications; each application includes a first process, and the first process includes multiple second processes; determining the target audio strategy based on the target screen identifier includes: if there is a mapping relationship between the first identifier and the current mapping table, determining the type of the application corresponding to the first identifier based on the target screen identifier; determining the target audio strategy based on the type of the application; if it is determined that there is an audio stream identifier containing the second identifier in the current mapping table, determining the target audio strategy based on the current audio playback status of the first process corresponding to the second identifier or the audio playback demand status of the second process.

[0009] Optionally, the type of application includes at least one of video playback applications, music playback applications, game applications, voice call applications, and system notification applications.

[0010] Optionally, determining the target audio strategy based on the current audio playback status of the first process corresponding to the second identifier includes: determining the target audio strategy as the first preset audio strategy when the first process plays audio on the screen corresponding to the target screen identifier according to the first preset audio strategy; and determining the target audio strategy based on the updated audio strategy of the first process on the switched screen when the first process switches screens.

[0011] Optionally, the method further includes: if it is determined that the current mapping table does not contain an audio stream identifier that includes the second identifier, then the target audio strategy is determined to be a second preset audio strategy.

[0012] Optionally, the method further includes: updating a preset mapping table to determine the current mapping table in the event of a triggering event; wherein the triggering event includes at least one of application startup, window creation, and screen switching.

[0013] On the other hand, embodiments of this application also provide an audio stream control device for a display system, the display system including multiple screens; the device includes: an identifier acquisition module, configured to: acquire a first identifier of a target audio stream when an audio playback request is detected; wherein the target audio stream is the audio stream corresponding to the audio playback request; the first identifier is an audio stream identifier corresponding to the target audio stream; a screen identifier determination module, configured to: query a current mapping table based on the first identifier to determine a target screen identifier corresponding to the first identifier; wherein the current mapping table is a current correspondence mapping table between audio stream identifiers and screen identifiers; a strategy determination module, configured to: determine a target audio strategy based on the target screen identifier; and a strategy execution module, configured to: execute the target audio strategy.

[0014] On the other hand, embodiments of this application also provide an electronic device, including a memory and a processor. The memory stores a computer program or instructions. When the computer program or instructions are executed by the processor, the processor performs the following steps: upon detecting an audio playback request, obtaining a first identifier of a target audio stream; wherein the target audio stream is the audio stream corresponding to the audio playback request; the first identifier is an audio stream identifier corresponding to the target audio stream; querying a current mapping table based on the first identifier to determine a target screen identifier corresponding to the first identifier; wherein the current mapping table is a mapping table of the current correspondence between audio stream identifiers and screen identifiers; determining a target audio strategy based on the target screen identifier; and executing the target audio strategy.

[0015] On the other hand, embodiments of this application also provide a computer-readable storage medium having a computer program or instructions stored thereon, wherein the computer program or instructions, when executed by a processor, implement the steps in the audio flow control method of the display system as described above.

[0016] On the other hand, embodiments of this application also provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the audio flow control method of the display system as described above.

[0017] In summary, the technical solution provided in this application obtains the first identifier of the audio stream when an audio playback request is detected, obtains the current mapping table between the audio stream identifier and the screen identifier, queries the current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier, and determines the corresponding target audio strategy based on the target screen identifier. This enables accurate identification and routing of audio streams from different screens and achieves intelligent control of audio streams. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart of an audio flow control method for a display system provided in an embodiment of this application; Figure 2 This is a timing diagram of the dynamic mapping table update process for window cross-screen drag events provided in an embodiment of this application; Figure 3 This is a schematic flowchart of the audio flow control method for the display system provided in the embodiments of this application; Figure 4 This is a schematic diagram of an audio flow control device for a display system provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] In the following description, specific embodiments of this application will be illustrated with reference to steps and symbols performed by one or more computers, unless otherwise stated. Therefore, these steps and operations will be referred to several times as being performed by a computer. Computer performance as referred to in this application includes operations performed by a computer processing unit on electronic signals represented by data in a structured format. This operation transforms the data or maintains it at a location in the computer's memory system, which can be reconfigured or otherwise alter the operation of the computer in a manner well known to those skilled in the art. The data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format. However, the principles of this application are illustrated with specific embodiments and are not intended to be limiting. Those skilled in the art will understand that many of the steps and operations described below can also be implemented in hardware.

[0022] The terms "module" or "unit" as used in this application can be considered as software objects executing on the computing system. The different components, modules, engines, and services described in this application can be considered as implementation objects on the computing system. While the apparatus and methods described in this application are preferably implemented in software, they can also be implemented in hardware, both of which are within the scope of protection of this invention.

[0023] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used in the embodiments of this application may also include the plural forms. It should be further understood that the term “comprising” as used in the specification of this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or combinations thereof. It should be understood that when an element is “connected” or “coupled” to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein may include wireless connection or wireless coupling. The term “and / or” as used herein includes all or any unit and all combinations of one or more associated listed items.

[0024] Please see Figure 1 , Figure 1 This is a flowchart of an audio stream control method for a display system provided in an embodiment of this application. Figure 1 As shown, the audio stream control method of the display system may include the following steps S100 to S400.

[0025] Step S100: Upon detecting an audio playback request, obtain the first identifier of the target audio stream; wherein, the target audio stream is the audio stream corresponding to the audio playback request; and the first identifier is the audio stream identifier corresponding to the target audio stream. Step S200: Query the current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier; wherein, the current mapping table is a mapping table of the current correspondence between audio stream identifiers and screen identifiers; Step S300: Determine the target audio strategy based on the target screen identifier; Step S400: Execute the target audio strategy.

[0026] In this embodiment, the display system is a multi-screen system, including a Window Manager Service (WMS), a Native Audio Manager module, multiple screens, and multiple applications. Each application sends an audio playback request when it needs to play audio. When the Native Audio Manager module detects an audio playback request, it first obtains a first identifier corresponding to the audio stream that issued the request, such as a process identifier (PID), to accurately identify and isolate audio streams from different sources. Then, it obtains the current mapping table and queries the current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier, thereby determining the target routing screen corresponding to the audio stream that issued the audio playback request, ensuring the correct association between the audio stream and the screen. Furthermore, based on the target screen identifier, the corresponding target audio policy can be determined, so that the audio stream that issued the audio playback request plays audio on the target routing screen according to the target audio policy. This achieves screen-level differentiation and routing control of audio streams from different sources, realizing intelligent management and control of audio streams in the multi-screen system, improving the flexibility of audio control and the consistency of user experience in the multi-screen system.

[0027] In some embodiments, the method further includes: updating a preset mapping table to determine the current mapping table in the event of a triggering event; wherein the triggering event includes at least one of application startup, window creation, and screen switching.

[0028] The default mapping table maps audio stream identifiers to screen identifiers. When an application starts, the Activity Manager Service (AMS) of the multi-screen system assigns a process ID (PID) to the application, while the window manager assigns a display ID (DisplayID) based on the screen the application is displaying. The Activity Manager strongly binds the PID and DisplayID, establishing a mapping relationship, and passes this crucial information to the underlying layer (Native layer) to prepare for subsequent audio routing.

[0029] For example, taking a multi-screen system including video playback applications (such as system video player, video LAN client, music playback application, and system notification service application), a PID-DisplayID dynamic mapping table is established and maintained at the framework layer, as shown in Table 1.

[0030] Table 1: PID-DisplayID Dynamic Mapping Table

[0031] The mapping table employs a dynamic mapping mechanism, enabling dynamic association between audio streams and screens to handle complex scenarios in multi-screen systems, such as dynamic screen switching and cross-screen application dragging. This dynamic mapping mechanism includes two features: real-time updates and process status monitoring. Real-time updates mean that when an application window is dragged to another screen by the user, the window manager updates the application's screen identifier (e.g., DisplayID) in real time and notifies the mapping table to update the corresponding entry's DisplayID and last update time. Process status monitoring means the system continuously monitors the lifecycle status of each process. When a process exits abnormally or is reclaimed by the system, the mapping table automatically cleans up or marks the corresponding entry as "invalid," avoiding invalid queries.

[0032] Taking window drag-and-drop events across screens as an example, the triggering condition and implementation process for dynamic updates via the dynamic mapping mechanism are as follows: The triggering condition is that the user drags the application window from one screen to another. (See also...) Figure 2 , Figure 2 This is a timing diagram of the dynamic mapping table update process for window cross-screen drag events provided in an embodiment of this application. For example... Figure 2 As shown, the user drags the application window from screen A (DisplayID=0) to screen B (DisplayID=1) using a drag-and-drop operation. Upon detecting a change in the window's DisplayID (e.g., the DisplayID of PID=1001 changes from 0 to 1), the window manager sends a cross-screen drag event (e.g., an ON_WINDOW_MOVED event) to the Native layer audio management module, carrying the new PID and DisplayID. Upon receiving this cross-screen drag event, the Native layer audio management module immediately updates the DisplayID of the corresponding PID in the PID-DisplayID mapping table (e.g., the DisplayID of PID=1001, which was 0, is updated to DisplayID=1) and synchronizes it to all relevant child process entries to execute the audio routing strategy based on the new DisplayID.

[0033] Taking the dynamic creation and destruction of processes as an example, the triggering condition and implementation process for the dynamic mapping mechanism to dynamically update are as follows: The triggering condition is that the application is destroyed after startup. The specific implementation process is as follows: The system listens for process creation and exit events through the process manager. When a process is created, the process's DisplayID is inserted into the mapping table; when a process exits, it is automatically removed or marked as "released".

[0034] For example, triggering events include application launch, window creation, and screen switching. The PID-DisplayID dynamic mapping table is updated in real time when events such as application launch, window creation, and screen switching are triggered, ensuring that each process can maintain dynamic synchronization with the correct screen ID. This dynamic mapping mechanism not only provides accurate screen source information for subsequent audio stream routing control but also significantly improves the system's adaptability and user experience consistency in dynamic multi-screen environments.

[0035] In some embodiments, step S200 may include steps S211 and S212.

[0036] Step S211: If there is a mapping relationship between the first identifier and the current mapping table, determine the target screen identifier based on the screen identifier corresponding to the first identifier in the current mapping table; Step S212: If there is no mapping relationship between the first identifier and the current mapping table, obtain the second identifier corresponding to the first identifier, and determine the target screen identifier based on the case that the current mapping table contains the second identifier; the second identifier is the user identifier.

[0037] A mapping relationship exists between the first identifier and the current mapping table. This means that the screen identifier corresponding to the first identifier can be found in the current mapping table. Taking the PID-DisplayID dynamic mapping table shown in Table 1 above as an example, if the first identifier PID=1001, according to the PID-DisplayID dynamic mapping table shown in Table 1, we can find that PID=1001 corresponds to DisplayID=0, indicating that the first identifier has a mapping relationship with the current mapping table. Furthermore, the target screen identifier corresponding to the first identifier can be determined based on the screen identifier in the current mapping table. A mapping relationship does not exist between the first identifier and the current mapping table. For example, if the first identifier PID=2003, the screen identifier corresponding to PID=2003 cannot be found in the PID-DisplayID dynamic mapping table shown in Table 1, indicating that the first identifier has no mapping relationship with the current mapping table. In this case, the target screen identifier is further determined based on whether the first identifier contains a user identifier.

[0038] The second identifier is the user identifier. Each application includes a main process, which may contain multiple child processes. For example, a music player application includes a main process, which in turn includes an audio service child process. A game application includes a main process, which in turn includes a sound effects processing child process. The main process and child processes of the same application have the same user identifier, but different applications have different user identifiers. For example, the main process of a music player application has an identifier of 2001, and the audio service child process has an identifier of 2002; both have the same user identifier of 200. As another example, the main process of a game application has an identifier of 3001, and the sound effects processing child process has an identifier of 3002; both have the same user identifier of 300.

[0039] The second identifier included in the current mapping table includes two cases: the current mapping table contains an audio stream identifier containing the second identifier, and the current mapping table does not contain an audio stream identifier containing the second identifier. For example, taking the current mapping table as the PID-DisplayID dynamic mapping table shown in Table 1 above, assuming the first identifier PID=1002, then the user identifier of the first identifier is 100. According to the PID-DisplayID dynamic mapping table shown in Table 1 above, PID=1002 and PID=1001 have the same user identifier 100. Therefore, the current mapping table contains an audio stream identifier containing user identifier 100 (i.e., PID=1002). Assuming the first identifier PID=1011, and the user identifier of the first identifier is 101, then according to the PID-DisplayID dynamic mapping table above, the current mapping table does not contain an audio stream identifier containing user identifier 101.

[0040] In some embodiments, step S212 may include: if it is determined that there is an audio stream identifier containing the second identifier in the current mapping table, the screen identifier corresponding to the audio stream identifier containing the second identifier in the current mapping table is determined as the target screen identifier.

[0041] For example, taking the current mapping table as the PID-DisplayID dynamic mapping table shown in Table 1 above, assuming the first identifier PID=2002, the screen identifier corresponding to the first identifier PID=2002 cannot be found according to the PID-DisplayID dynamic mapping table shown in Table 1. This indicates that the first identifier has no mapping relationship with the current mapping table. Therefore, the second identifier corresponding to the first identifier is obtained, and it is further determined whether there is an audio stream identifier containing the second identifier in the current mapping table. If there is an audio stream identifier containing the second identifier in the current mapping table, the screen identifier corresponding to the audio stream identifier containing the second identifier in the current mapping table is taken as the target screen identifier. For example, if the second identifier corresponding to the first identifier PID=2002 is 200, then according to the PID-DisplayID dynamic mapping table shown in Table 1 above, there is an audio stream identifier PID=2001 that is the same as the second identifier 200.

[0042] In some embodiments, the display system includes multiple applications; each application includes a first process, and the first process includes multiple second processes; the above step S200 may also include the following steps S221 and S222.

[0043] Step S221: If there is a mapping relationship between the first identifier and the current mapping table, determine that the process type corresponding to the audio playback request is the first process; Step S222: If it is determined that there is an audio stream identifier containing the second identifier in the current mapping table, determine that the process type corresponding to the audio playback request is the second process.

[0044] In this process, the first process is the main process, and the second process is the child process. Taking the current mapping table as the PID-DisplayID dynamic mapping table shown in Table 1 above as an example, if a screen identifier that is directly mapped to the first identifier can be found in the current mapping table, it indicates that the process type of the audio playback request corresponding to the first identifier is the main process. For example, assuming the first identifier PID=2001, querying the current mapping table based on PID=2001 will find the corresponding screen identifier DisplayID=1, indicating that the process type of the application that issued the audio playback request for the first identifier is the main process. If a screen identifier that is directly mapped to the first identifier cannot be found in the current mapping table, the process type of the application that issued the audio playback request for the first identifier is the child process, based on the second identifier of the first identifier. For example, if the first identifier PID is 2002 and its second identifier is 200, then querying the current mapping table based on the user identifier 200 will find an audio stream identifier PID=2001 containing the user identifier 200. This indicates that the process of the application requesting the audio playback corresponding to the first identifier PID=2002 is a child process. Therefore, the type of application issuing the audio playback request and the source of the audio stream can be accurately identified to ensure compatibility with multi-process audio playback scenarios and to ensure the correct association between the audio stream and the screen. This facilitates subsequent implementation of screen-level partitioning and intelligent routing for different audio streams, improving the flexibility and user experience of the multi-screen audio system.

[0045] In some embodiments, the display system includes multiple applications; each application includes a first process, and the first process includes multiple second processes; the above step S300 may include the following steps S311 and S312.

[0046] Step S311: If there is a mapping relationship between the first identifier and the current mapping table, determine the type of application corresponding to the first identifier based on the target screen identifier; determine the target audio strategy based on the type of application; Step S312: If it is determined that there is an audio stream identifier containing the second identifier in the current mapping table, determine the target audio strategy according to the current audio playback status of the first process corresponding to the second identifier or the audio playback requirements of the second process.

[0047] In some embodiments, the application type includes at least one of video playback applications, music playback applications, game applications, voice call applications, and system notification applications. The application type includes, but is not limited to, at least one of video playback applications, music playback applications, game applications, voice call applications, and system notification applications. If a mapping exists between the first identifier and the current mapping table, it indicates that this is an audio stream from a standard process. The system directly obtains its corresponding DisplayID and executes an advanced audio strategy customized for that screen (e.g., routing to a specific channel, applying independent volume control, etc.). For example, the specific implementation of the target audio strategy based on the application type is shown in Table 2.

[0048] Table 2: Target Audio Strategy Table for Application Type

[0049] After determining the target audio strategy based on the application type, the specific implementation process of executing the target audio strategy is as follows: First, query the audio strategy configuration file (such as XML or a database) based on the DisplayID. Then, parse the strategy parameters, such as output device, volume level, sound effect identifier, mixing rules, focus behavior, etc. Second, call the Android AudioManager / AudioPolicyManager interface to dynamically set audio routes, volume, and effects. Finally, listen for changes in screen or application state and adjust the strategy in real time (such as automatically switching strategies when a window is dragged to another screen).

[0050] If the current mapping table contains an audio stream identifier with a second identifier, it indicates that the application type sending the audio stream with the first identifier is a subprocess. If the subprocess is a specific type of subprocess, such as a sound effects processing subprocess, then a subprocess-specific audio routing strategy is executed. For example, a game sound effects subprocess can enable 3D sound effect rendering, while a background music subprocess maintains stereo output. This allows for setting corresponding audio routing strategies based on specific process requirements, meeting personalized user needs and improving the user experience.

[0051] In some embodiments, step S312 may include steps S3121 and S3122.

[0052] Step S3121: When the first process plays audio on the screen corresponding to the target screen identifier according to the first preset audio strategy, the target audio strategy is determined to be the first preset audio strategy. Step S3122: In the case of the first process switching screens, determine the target audio strategy based on the first process's updated audio strategy on the switched screen.

[0053] The first preset audio strategy is the same-application-same-screen strategy, which means that the audio stream of a child process inherits the audio strategy of its parent application's main process. For example, if the main process (video player) plays a video on screen 0, the audio stream of its child process (audio decoding process) will also be routed to the HDMI output of screen 0 and will apply the same volume and sound effect settings.

[0054] If the current mapping table contains an audio stream identifier with a second identifier, it indicates that the application type issuing the audio stream with the first identifier is a child process. If the main process corresponding to this child process plays the audio stream according to the first preset audio strategy, then the audio stream of this child process inherits the audio strategy of its parent application's main process. If the main process corresponding to this child process switches screens due to window dragging, the audio strategies of all its child processes should be synchronously updated to the new screen strategy to ensure audio consistency.

[0055] In some embodiments, step S200 may further include the following step: if it is determined that there is no audio stream identifier containing the second identifier in the current mapping table, the target audio strategy is determined to be the second preset audio strategy.

[0056] The second preset audio strategy is the system default audio strategy. If no audio stream identifier matching the second identifier exists in the current mapping table, it means that the DisplayID cannot be determined, and the system will fall back to the default audio strategy to ensure that basic functions are normal.

[0057] Please see Figure 3 , Figure 3 This is a schematic flowchart of the audio flow control method for the display system provided in this application embodiment. Figure 3As shown, the overall flow of this audio flow control method includes an application startup phase (i.e., information acquisition and binding) and an audio processing phase (i.e., routing decision). The application startup phase includes: application startup; AMS obtains the process PID of each application and the display screen ID. Then, the process PID and screen ID are bound and transmitted, i.e., a mapping relationship between PID and DisplayID is established and sent to the NTtive layer. The audio processing phase includes: the NTtive layer listens for audio playback requests. When an audio playback request is detected, it obtains the first identifier PID of the current audio stream corresponding to the audio playback request. Then, it queries the PID-DisplayID mapping table based on the first identifier to determine if a mapping relationship exists between the first identifier and the table. If a mapping relationship exists, the corresponding target screen identifier DisplayID is successfully obtained directly, and the corresponding screen's advanced audio strategy is executed to route the audio stream for output. If the mapping relationship does not exist, a multi-process scenario is handled. Since the main process and child processes of the same application have the same user identifier UID, the user identifier UID to which it belongs is queried based on the first identifier. Then, this user identifier (UID) is used to look up the DisplayID bound to other PIDs belonging to the same application in the mapping table. If found, the DisplayID is successfully obtained, and the correct audio strategy is executed to route the audio stream for output. If no DisplayID bound to other PIDs belonging to the same application is found, the default audio strategy is used. This enables accurate identification of audio streams from different sources, correct association between audio streams and the screen, and effective differentiation and routing of different audio streams. This allows the display screen where the application resides to dynamically allocate audio channels and implement differentiated audio strategies, improving audio management capabilities and user experience in multi-screen scenarios. Furthermore, it enables effective differentiation of the process types of different audio streams to ensure compatibility with multi-process audio playback scenarios and guarantee the correct association between audio streams and the screen.

[0058] It should be noted that in real-world multi-screen, multi-tasking scenarios, the audio system may simultaneously or within a short period receive multiple audio playback requests from different applications or sub-processes. These requests may originate from applications on different screens (e.g., video playing on the main screen, music playing on the secondary screen, notification sound effects, etc.), and even the same application may run multiple audio streams concurrently (e.g., game background music and sound effects). To ensure reliable routing for each application process, the following processing mechanism is adopted: First, request queuing and priority scheduling. By maintaining an audio request queue, multiple received audio playback requests are temporarily cached and scheduled. The scheduling strategy includes, but is not limited to, sorting based on process priority (e.g., foreground application priority is higher than background application priority), audio type (e.g., media stream > notification sound), or association with DisplayID (e.g., audio streams on the same screen are preferentially routed to the same output channel).

[0059] Secondly, concurrent querying and mapping resolution. The system employs a multi-threaded or asynchronous query mechanism to process multiple DisplayID query tasks corresponding to PIDs simultaneously, avoiding audio delays caused by serial processing. Furthermore, each query task is configured to independently access the PID-DisplayID dynamic mapping table to ensure data consistency and query efficiency.

[0060] Thirdly, routing decisions and audio policy execution. The system executes the corresponding audio policy in parallel based on the query screen identifier (DisplayID) and distributes the audio stream to preset audio output devices or channels. If multiple audio streams correspond to the same screen, the system can perform mixing or priority overriding (for example, automatically pausing media playback for call audio).

[0061] For example, as a specific implementation, the audio stream control method for a display system provided in this application involves the following process for handling audio streams from unknown sources: A low-level system service (e.g., accessibility prompts) initiates an audio playback request, but its PID is not registered in the dynamic mapping table. First, the first identifier (PID) of the audio playback request is obtained. Then, the current mapping table is queried based on the first identifier, and no corresponding DisplayID is found. Further, the user identifier (UID) corresponding to the first identifier is obtained, and the current mapping table is reverse-queried based on the user identifier to determine whether an audio stream identifier containing the user identifier (UID) exists. If no valid associated identifier is found, a fallback mechanism is triggered, i.e., a default audio strategy is adopted (e.g., routing to the default speaker on the main screen, volume 50%, no sound effects). Furthermore, the log output displays "Unknown audio stream, default route used".

[0062] For example, as another specific implementation, the audio stream control method for a display system provided in this application embodiment handles the momentary loss of mapping for audio streams during cross-screen dragging as follows: Assuming the current application window is being dragged to another screen, the mapping table update is slightly delayed. The process is as follows: When an audio playback request arrives, since the DisplayID in the current mapping table is still the old value or in an "updating" state, the system identifies it as "mapping unstable" and temporarily adopts a conservative audio strategy, i.e., routing to the original screen device while maintaining the current volume. After the mapping table update is complete, subsequent audio streams automatically switch to the new screen strategy.

[0063] In summary, the technical solution provided in this application obtains the first identifier of the audio stream when an audio playback request is detected, obtains the current mapping table between the audio stream identifier and the screen identifier, queries the current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier, and determines the corresponding target audio strategy based on the target screen identifier. This enables accurate identification and routing of audio streams from different screens and achieves intelligent control of audio streams.

[0064] To facilitate better implementation of the audio flow control method for the display system provided in this application, this application also provides an audio flow control device for the display system. The meanings of the terms used are the same as in the audio flow control method for the display system described above, and specific implementation details can be found in the descriptions within the method embodiments.

[0065] Please see Figure 4 , Figure 4 This is a schematic diagram of an audio stream control device for a display system provided in an embodiment of this application. Figure 4 As shown, the audio stream control device 300 of the display system may include an identifier acquisition module 310, a screen identifier determination module 320, a strategy determination module 330, and a strategy execution module 340. The identifier acquisition module 310 is used to: acquire a first identifier of the target audio stream when an audio playback request is detected; wherein the target audio stream is the audio stream corresponding to the audio playback request; and the first identifier is the audio stream identifier corresponding to the target audio stream. The screen identifier determination module 320 is used to: query the current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier; wherein, the current mapping table is a mapping table of the current correspondence between audio stream identifiers and screen identifiers; Strategy determination module 330 is used to: determine the target audio strategy based on the target screen identifier; The strategy execution module 340 is used to execute the target audio strategy.

[0066] In some embodiments, the screen identifier determination module 320 is further configured to: determine the target screen identifier based on the screen identifier corresponding to the first identifier in the current mapping table when there is a mapping relationship between the first identifier and the current mapping table; and obtain the second identifier corresponding to the first identifier when there is no mapping relationship between the first identifier and the current mapping table, and determine the target screen identifier based on the case that the current mapping table contains the second identifier; wherein the second identifier is a user identifier.

[0067] In some embodiments, the screen identifier determination module 320 is further configured to: if it is determined that there is an audio stream identifier containing the second identifier in the current mapping table, determine the screen identifier corresponding to the audio stream identifier containing the second identifier in the current mapping table as the target screen identifier.

[0068] In some embodiments, the display system includes multiple applications; each application includes a first process, and the first process includes multiple second processes; the audio stream control device 300 of the display system may further include a process type determination module, configured to: determine the process type corresponding to the audio playback request as a first process when there is a mapping relationship between the first identifier and the current mapping table; and determine the process type corresponding to the audio playback request as a second process when it is determined that there is an audio stream identifier containing a second identifier in the current mapping table.

[0069] In some embodiments, the display system includes multiple applications; each application includes a first process, and the policy determination module 330 is further configured to: determine the type of the application corresponding to the first identifier based on the target screen identifier when there is a mapping relationship between the first identifier and the current mapping table; determine the target audio policy based on the type of the application; and determine the target audio policy based on the current audio playback status of the first process corresponding to the second identifier or the audio playback demand status of the second process when it is determined that there is an audio stream identifier containing a second identifier in the current mapping table.

[0070] In some embodiments, the type of application includes at least one of video playback applications, music playback applications, game applications, voice call applications, and system notification applications.

[0071] In some embodiments, the strategy determination module 330 is further configured to: determine the target audio strategy as the first preset audio strategy when the first process plays audio on the screen corresponding to the target screen identifier in accordance with the first preset audio strategy; and determine the target audio strategy according to the updated audio strategy of the first process on the switched screen when the first process switches screens.

[0072] In some embodiments, the strategy determination module 330 is further configured to: determine the target audio strategy as the second preset audio strategy if it is determined that there is no audio stream identifier containing the second identifier in the current mapping table.

[0073] In some embodiments, the audio flow control device 300 of the display system may further include a mapping table determination module, configured to: update a preset mapping table to determine the current mapping table in the event of a triggering event; wherein the triggering event includes at least one of application startup, window creation, and screen switching.

[0074] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 The dashed line in the text indicates that the unit or module is optional. Figure 5 The electronic device 400 can be used to implement the methods described in the above method embodiments. The electronic device 400 can be a chip, terminal device, server, or computer device, etc.

[0075] Electronic device 400 may include one or more processors 410. The processor 410 may support the electronic device 400 in implementing the methods described in the preceding method embodiments. The processor 410 may be a general-purpose processor or a special-purpose processor. For example, the processor may be implemented as a Central Processing Unit (CPU). Alternatively, the processor may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0076] The electronic device 400 may also include one or more memories 420. The memories 420 store computer programs or instructions. The memories 420 may be independent of the processor 410 or integrated into the processor 410.

[0077] Electronic device 400 may also include transceiver 430. Processor 410 can communicate with other devices or chips via transceiver 430. For example, processor 410 can send and receive data with other devices or chips via transceiver 430.

[0078] The computer program or instructions in memory 420 can be executed by processor 410, causing processor 410 to perform the following steps: Upon detecting an audio playback request, obtain the first identifier of the target audio stream; wherein, the target audio stream is the audio stream corresponding to the audio playback request; and the first identifier is the audio stream identifier corresponding to the target audio stream. The target screen identifier corresponding to the first identifier is determined by querying the current mapping table based on the first identifier; wherein, the current mapping table is a mapping table of the current correspondence between audio stream identifiers and screen identifiers; Determine the target audio strategy based on the target screen identifier; Execute the target audio strategy.

[0079] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0080] Therefore, embodiments of this application also provide a computer-readable storage medium storing a computer program or instructions thereon, which is loaded by a processor to perform the steps described in the above-described method embodiments of this application. For example, the computer program or instructions loaded by the processor can perform the following steps: Upon detecting an audio playback request, obtain the first identifier of the target audio stream; wherein, the target audio stream is the audio stream corresponding to the audio playback request; and the first identifier is the audio stream identifier corresponding to the target audio stream. The target screen identifier corresponding to the first identifier is determined by querying the current mapping table based on the first identifier; wherein, the current mapping table is a mapping table of the current correspondence between audio stream identifiers and screen identifiers; Determine the target audio strategy based on the target screen identifier; Execute the target audio strategy.

[0081] For details on the implementation of each of the above operations / steps, please refer to the previous examples, which will not be repeated here.

[0082] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0083] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the above method embodiments provided in the embodiments of this application, the beneficial effects that the methods described in any of the above method embodiments can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0084] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in the various optional implementations of the above embodiments.

[0085] The above provides a detailed description of an audio flow control method, apparatus, electronic device, and storage medium for a display system provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An audio stream control method for a display system, characterized in that, The display system includes multiple screens; the method includes: Upon detecting an audio playback request, a first identifier of the target audio stream is obtained; wherein, the target audio stream is the audio stream corresponding to the audio playback request; and the first identifier is the audio stream identifier corresponding to the target audio stream. The target screen identifier corresponding to the first identifier is determined by querying the current mapping table based on the first identifier; wherein, the current mapping table is a mapping table of the current correspondence between audio stream identifiers and screen identifiers; Determine the target audio strategy based on the target screen identifier; Execute the target audio strategy.

2. The method according to claim 1, characterized in that, The step of querying the current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier includes: If there is a mapping relationship between the first identifier and the current mapping table, the target screen identifier is determined according to the screen identifier corresponding to the first identifier in the current mapping table; If there is no mapping relationship between the first identifier and the current mapping table, obtain the second identifier corresponding to the first identifier, and determine the target screen identifier based on the case that the current mapping table contains the second identifier; the second identifier is the user identifier.

3. The method according to claim 2, characterized in that, Determining the target screen identifier based on the case where the current mapping table contains the second identifier includes: If it is determined that there is an audio stream identifier containing the second identifier in the current mapping table, the screen identifier corresponding to the audio stream identifier containing the second identifier in the current mapping table is determined as the target screen identifier.

4. The method according to claim 3, characterized in that, The display system includes multiple applications; each application includes a first process, and the first process includes multiple second processes; the method further includes: If there is a mapping relationship between the first identifier and the current mapping table, the process type corresponding to the audio playback request is determined to be the first process; If it is determined that the current mapping table contains an audio stream identifier that includes the second identifier, the process type corresponding to the audio playback request is determined to be the second process.

5. The method according to claim 2, characterized in that, The display system includes multiple applications; each application includes a first process, and the first process includes multiple second processes; determining the target audio strategy based on the target screen identifier includes: If there is a mapping relationship between the first identifier and the current mapping table, determine the type of the application corresponding to the first identifier based on the target screen identifier; determine the target audio strategy based on the type of the application; If it is determined that the current mapping table contains an audio stream identifier that includes the second identifier, the target audio strategy is determined based on the current audio playback status of the first process corresponding to the second identifier or the audio playback demand status of the second process.

6. The method according to claim 5, characterized in that, The types of applications include at least one of the following: video playback applications, music playback applications, game applications, voice call applications, and system notification applications.

7. The method according to claim 5, characterized in that, Determining the target audio strategy based on the current audio playback status of the first process corresponding to the second identifier includes: When the first process plays audio on the screen corresponding to the target screen identifier according to the first preset audio strategy, the target audio strategy is determined to be the first preset audio strategy; When the first process switches screens, the target audio strategy is determined based on the first process's updated audio strategy on the switched screen.

8. The method according to claim 2, characterized in that, The method further includes: if it is determined that the current mapping table does not contain an audio stream identifier containing the second identifier, then the target audio strategy is determined to be the second preset audio strategy.

9. The method according to claim 1, characterized in that, The method further includes: In the event of a triggering event, the preset mapping table is updated to determine the current mapping table; wherein the triggering event includes at least one of application launch, window creation, and screen switching.

10. An audio stream control device for a display system, characterized in that, The display system includes multiple screens; the device includes: The identifier acquisition module is used to: acquire a first identifier of the target audio stream when an audio playback request is detected; wherein the target audio stream is the audio stream corresponding to the audio playback request; and the first identifier is the audio stream identifier corresponding to the target audio stream. The screen identifier determination module is used to: query the current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier; wherein, the current mapping table is a mapping table of the current correspondence between audio stream identifiers and screen identifiers; The strategy determination module is used to: determine the target audio strategy based on the target screen identifier; The strategy execution module is used to execute the target audio strategy.

11. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores computer programs or instructions, and when the computer programs or instructions are executed by the processor, the processor causes the processor to perform the following steps: Upon detecting an audio playback request, a first identifier of the target audio stream is obtained; wherein, the target audio stream is the audio stream corresponding to the audio playback request; and the first identifier is the audio stream identifier corresponding to the target audio stream. Obtain the current mapping table and query the current mapping table based on the first identifier to determine the target screen identifier corresponding to the first identifier; wherein, the current mapping table is a current correspondence table between audio stream identifiers and screen identifiers; Determine the target audio strategy based on the target screen identifier; Execute the target audio strategy.

12. A computer-readable storage medium, characterized in that, It stores a computer program or instructions that, when executed by a processor, implement the steps in the audio flow control method of the display system as described in any one of claims 1 to 9.