Display method and device based on desktop application, computer equipment and storage medium

Through the integrated callback function in the desktop application, the display control object is obtained, and the display position and size of the application window is adjusted to solve the problem of complex and difficult maintenance of the existing multi -window and the same method. cost.

CN119356780APending Publication Date: 2025-01-24NEW H3C INTELLIGENCE TERMINAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411392632.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The existing multi-window synchronous display method is complex and difficult to maintain. Especially when the operating system source code is not deeply modified, it is difficult to achieve low-coupling multi-window management.

Method used

By integrating the callback function that is called when the task is displayed in the desktop application, the display control object is obtained, and the display position and size of the application are adjusted according to the configuration information to realize display control of the application window.

Benefits of technology

Multi -window management with low coupling is implemented to avoid deep modification of the system source code, reduce maintenance costs, and simplify the iterative and upgrade of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356780A_ABST
    Figure CN119356780A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of display control, and discloses a desktop application-based display method and device, computer equipment and a storage medium, the method comprises the following steps: in response to a display instruction of a first application, obtaining a display control object of the first application according to a callback function which is integrated in the desktop application and is called during task display; obtaining first configuration information used for displaying the first application, adjusting a display control object of the first application according to the first configuration information, and setting the first application in a first display area used for displaying the latest application; the first display area is a partial area of the equipment screen, and other display areas except the first display area in the equipment screen are used for displaying other applications. The callback function called during task display is integrated in the desktop application, the display control object returned by the callback function is used for controlling the application, deep modification of system source codes is avoided, and low-coupling-degree multi-window management is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of display control technology, and in particular to a display method, device, computer equipment and storage medium based on desktop applications. Background Art

[0002] With the popularity of operating systems for mobile terminals and other devices, operating systems are widely used in various devices. As the size of device screens gradually increases, the demand for multi-window simultaneous display is increasing. Existing multi-window simultaneous display methods usually rely on deep modification of the operating system source code and processing for window management, window callback, etc. This display method is complex to implement and difficult to maintain. Summary of the invention

[0003] In view of this, the present invention provides a display method, apparatus, computer equipment and storage medium based on desktop applications to solve the problem of complex implementation of multi-window simultaneous display.

[0004] In a first aspect, the present invention provides a display method based on a desktop application, comprising:

[0005] In response to a display instruction of the first application, obtaining a display control object of the first application according to a callback function integrated in the desktop application and called when a task is displayed;

[0006] Obtain first configuration information for displaying the first application, adjust the display control object of the first application according to the first configuration information, and set the first application in a first display area for displaying the latest application; the first display area is a partial area of ​​the device screen, and other display areas of the device screen except the first display area are used to display other applications.

[0007] In some optional embodiments, the method further comprises:

[0008] In response to a display instruction of the first application, if a second application is already displayed in the first display area, obtaining second configuration information for displaying the second application, adjusting a display control object of the second application according to the second configuration information, and setting the second application in a second display area for displaying a second-new application;

[0009] In the case where a third application is displayed in the third display area for displaying the oldest application, third configuration information for displaying the third application is obtained, a display control object of the third application is adjusted according to the third configuration information, and the third application is hidden.

[0010] In some optional embodiments, the method further comprises:

[0011] In response to a sliding instruction for switching displayed applications, determining a plurality of valid applications that currently need to be displayed;

[0012] According to a preset configuration strategy, adjusting the display area of ​​each of the valid applications;

[0013] According to a preset configuration policy, other invalid applications except the valid application are hidden.

[0014] In some optional implementations, the display instruction includes a creation instruction or a first switching instruction for switching from the background to the foreground;

[0015] The acquiring the display control object of the first application according to the callback function integrated in the desktop application and called when the task is displayed includes:

[0016] In the case where the display instruction is a creation instruction, according to a first callback function in the task organization class that is called when the task is created, obtaining the running task information and the display control object of the first application, and recording the corresponding relationship between the running task information and the display control object;

[0017] When the display instruction is a first switching instruction, the running task information of the first application is obtained according to the second callback function called when the task is transferred to the foreground in the task stack change monitoring interface, and the display control object of the first application is determined according to the corresponding relationship.

[0018] In some optional implementations, after setting the first application in the first display area for displaying the latest application, the method further includes:

[0019] Obtaining a hidden instruction of the first application, where the hidden instruction includes a destroy instruction or a second switching instruction from the foreground to the background;

[0020] In the case where the hiding instruction is the second switching instruction, obtaining the running task information of the first application according to the third callback function called when the task is transferred to the background in the task stack change monitoring interface, and hiding the first application by adjusting the display control object corresponding to the running task information of the first application;

[0021] In the case where the hiding instruction is a destroy instruction, according to the fourth callback function in the task organization class that is called when the task is destroyed, the running task information of the first application is obtained, and the display control object corresponding to the running task information of the first application is cleared.

[0022] In some optional embodiments, the method further comprises:

[0023] The task stack change monitoring interface is registered by utilizing the registration task stack monitoring method in the component management encapsulation class.

[0024] In some optional implementations, before responding to the display instruction of the first application, the method further includes:

[0025] A compiled package is obtained from the system source code, and the compiled package is introduced into the desktop application; the compiled package includes at least one of a task organization class, a display control class, a task stack change monitoring interface, a component management encapsulation class and a window container transaction class.

[0026] In a second aspect, the present invention provides a display device based on a desktop application, comprising:

[0027] An object acquisition module, configured to respond to a display instruction of the first application and acquire a display control object of the first application according to a callback function integrated in the desktop application and called when a task is displayed;

[0028] A processing module is used to obtain first configuration information for displaying the first application, adjust the display control object of the first application according to the first configuration information, and set the first application in a first display area for displaying the latest application; the first display area is a partial area of ​​the device screen, and other display areas in the device screen except the first display area are used to display other applications.

[0029] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the desktop application-based display method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0030] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the desktop application-based display method of the above-mentioned first aspect or any corresponding embodiment thereof.

[0031] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the desktop application-based display method of the first aspect or any corresponding embodiment thereof.

[0032] The present invention integrates a callback function that is called when a task is displayed in a desktop application. The display control object returned by the callback function can be used to adjust the application's location, size and other properties, thereby setting the application window to the corresponding display area. The method can realize display control of the application window by adaptively setting the desktop application, avoids deep modification of the system source code, and realizes multi-window management with low coupling; and only the desktop application needs to be maintained, which significantly reduces the maintenance cost and is also easy for subsequent system iteration and upgrade. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 is a flowchart of a display method based on a desktop application according to an embodiment of the present invention;

[0035] Figure 2 is a flowchart of another display method based on desktop application according to an embodiment of the present invention;

[0036] Figure 3 is a schematic diagram of a calling class and an interface according to an embodiment of the present invention;

[0037] Figure 4 is a schematic diagram of a control effect of a display application according to an embodiment of the present invention;

[0038] Figure 5 is a schematic diagram of a control effect of a hidden application according to an embodiment of the present invention;

[0039] Figure 6 is a structural block diagram of a display device based on a desktop application according to an embodiment of the present invention;

[0040] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0042] To facilitate understanding of the technical solutions of the embodiments of the present invention, some related technical terms are first explained below.

[0043] 1. Window Simultaneous Display: In the operating system, applications exist in the form of windows, and N application windows are displayed simultaneously on the same screen display; N ≥ 2.

[0044] 2.ActivityManager: A component that manages application activities and is responsible for controlling the application life cycle and activity stack.

[0045] 3.RunningTaskInfo: An internal class of ActivityManager that represents the information of the currently running task, including the task ID, activity, etc.

[0046] 4.TaskStackChangeListener: A listener interface used to monitor changes in the task stack, including events such as task creation, destruction, moving from the background to the foreground, and moving from the foreground to the background.

[0047] 5.ActivityManagerWrapper: The wrapper class of ActivityManager, used to simplify the calling and operation of ActivityManager; this class also provides registration and deregistration methods for windows in the monitoring system.

[0048] 6.TaskOrganizer: used to organize and manage window tasks, and return life cycle information such as the start and end of window tasks, as well as other states of the application window.

[0049] 7.SurfaceControl: The class returned by the callback function in TaskOrganizer, used to control the position, scaling, window size, etc. of the application window.

[0050] 8.Transaction: An internal class in SurfaceControl used for atomic operations on windows, providing changes to window position, size, scaling, order, transparency and other properties.

[0051] Applications of operating systems such as the Android system can be used on some large screens, TVs, conference systems and other devices, and can be displayed on the large screen of the device; but if an application occupies the entire screen every time it is opened, it will not only make the user's operation difficult, but also cause a great waste of the "large screen" display resource. Opening applications back and forth to operate will also be a troublesome way.

[0052] Based on this, the demand for displaying multiple applications on a screen at the same time and interacting with each other arises. In operating systems such as the Android system, multiple applications are actually relatively independent individuals. Even if they are switched to the background, they will continue to run and will not be related to or affect each other. This provides a natural use environment for displaying multiple applications on a large screen.

[0053] Existing multi-window co-display methods usually rely on deeply modifying the framework source code of the operating system (for example, the Android system), directly performing window management and callback processing at the system level, and implementing application window management based on SurfaceControl. Typical solutions include multi-window control through customized Activities, Services, or WindowManagers, etc. These methods involve modifying core components such as ActivityManager and WindowManager in the system, resulting in at least the following problems:

[0054] (1) High system coupling: Existing solutions require deep modification of system code, resulting in high coupling between system modules, difficult maintenance, and easy impact on the system's own logic.

[0055] (2) Difficulty in upgrading: When upgrading the system, a large amount of modified code needs to be processed for compatibility, which is a lot of work and adds a lot of workload to the subsequent system upgrades and iterations.

[0056] (3) Maintenance is time-consuming and labor-intensive: Deep modification of system code leads to high subsequent maintenance costs, especially for systems that require frequent iterations and updates, which are time-consuming and labor-intensive to maintain.

[0057] The display method based on desktop applications provided by an embodiment of the present invention utilizes the callback function configured in the desktop application (Launcher) and configures the display control object (SurfaceControl) of the application without deeply modifying the system code, so that the display position and display size of each application in the screen can be adjusted to achieve window co-display, and more efficient multi-window co-display management can be achieved on large-screen devices.

[0058] According to an embodiment of the present invention, a display method embodiment based on a desktop application is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0059] In this embodiment, a display method based on a desktop application is provided, which can be used for a terminal device with a display screen, such as a smart phone, a tablet computer, a smart TV, etc. Figure 1 is a flowchart of a display method based on a desktop application according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps.

[0060] Step S101, in response to a display instruction of a first application, obtaining a display control object of the first application according to a callback function integrated in the desktop application and called when a task is displayed.

[0061] In this embodiment, for a terminal device using an operating system such as the Android system, a desktop application (Launcher) is used to display the home screen, application list and application icons, and to process the interaction between the user and these applications. The desktop application is integrated with a callback function that is called when a task is displayed.

[0062] Among them, when the callback function called when the task is displayed is triggered, the display control object (SurfaceControl) of the application corresponding to the display task can be returned; specifically, when the first application is displayed based on the callback function monitoring, the callback function can return the display control object (SurfaceControl) of the first application.

[0063] Existing classes can be used to implement multi-window management. For example, the task organizer class (TaskOrganizer.java) of the Android system provides monitoring of the creation and destruction of application windows and the modification of window information. When a user opens a new application, a new task is created, which triggers the call of the onTaskAppeared method in the task organizer class. The onTaskAppeared method can return the SurfaceControl of the application, so the onTaskAppeared method can be used as the callback function mentioned above.

[0064] Step S102, obtain first configuration information for displaying a first application, adjust the display control object of the first application according to the first configuration information, and set the first application in a first display area for displaying the latest application; the first display area is a partial area of ​​the device screen, and other display areas in the device screen except the first display area are used to display other applications.

[0065] In this embodiment, since the display control object (SurfaceControl) can control the display position, scaling, and display and hiding of subsequent windows of the application window, the first application can be set at the corresponding position of the screen by configuring the display control object of the first application. Among them, the position, size, scaling, hiding, and other properties of the application window can be changed based on the internal class Transaction in the display control object.

[0066] Furthermore, the entire area of ​​the device screen is divided into a plurality of display areas, each of which can display a corresponding application. Each display area is used to display applications of different newness and oldness; specifically, the newness and oldness of each application to be displayed can be determined based on the life cycle of the application, for example, the applications can be sorted according to the time when the application enters the foreground state, the application that enters the foreground state the latest is the newest, and the application that enters the foreground state the earliest is the oldest, based on which it can be determined which application each display area is used to display.

[0067] In this embodiment, the display area used to display the latest application is called the first display area; when the display instruction to display the first application is triggered, it indicates that the first application is the latest application (for example, the first application is the application that entered the foreground state last), the first application is set in the first display area, that is, the application window of the first application is displayed in the first display area for the user to view or operate.

[0068] Accordingly, the device screen also has other display areas to display other applications. For example, other display areas can display previously created application windows, thereby achieving the effect of displaying different applications in each display area at the same time and realizing the simultaneous display of windows.

[0069] Specifically, when it is necessary to display the first application, configuration information for displaying the first application, that is, the first configuration information, can be obtained; wherein, since the first application needs to be displayed in the first display area, the first configuration information is configuration information for displaying the application in the first display area. For example, the first configuration information includes parameters such as the position and size of the application window, the window position parameters in the first configuration information are consistent with the position of the first display area, and the window size parameters in the first configuration information are also consistent with the size of the first display area. After obtaining the first configuration information, the display control object of the first application can be adjusted based on the first configuration information, thereby loading the first configuration information into the display control object of the first application, so that the first application can be displayed in the first display area.

[0070] The configuration information corresponding to the first display area, namely the first configuration information, may be preset; for example, the configuration information of each display area may be set based on window display rules, screen size, etc. When the first application needs to be displayed, the first configuration information may be directly obtained.

[0071] Optionally, the user may actively modify the configuration information of the first application, thereby actively adjusting the value in the display control object of the first application, thereby actively adjusting the display position and display size of the first application.

[0072] The display method based on desktop application provided in this embodiment integrates a callback function called when the task is displayed in the desktop application. The display control object returned by the callback function can be used to adjust the position, size and other properties of the application, so as to set the application window to the corresponding display area. This method can realize the display control of the application window by adaptively setting the desktop application, which can avoid deep modification of the system source code and realize multi-window management with low coupling; and only the desktop application needs to be maintained, which significantly reduces the maintenance cost and is also easy for subsequent system iteration and upgrade.

[0073] In this embodiment, a display method based on a desktop application is provided, which can be used for a terminal device with a display screen, such as a smart phone, a tablet computer, a smart TV, etc. Figure 2 is a flowchart of a display method based on a desktop application according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps.

[0074] Step S201, in response to a display instruction of the first application, obtaining a display control object of the first application according to a callback function integrated in the desktop application and called when a task is displayed.

[0075] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0076] In some optional implementations, the required functions are implemented by integrating classes and interfaces for implementing the window co-display function in the desktop application; since some classes come from the system source code, in this embodiment, these classes and interfaces are obtained from the system source code. Specifically, the configuration of the desktop application needs to be completed first, that is, before step S201, the method further includes: obtaining a compiled package from the system source code, and introducing the compiled package into the desktop application.

[0077] The compilation package includes classes and interfaces required for window synchronization. Specifically, the compilation package may include at least one of a task organization class (TaskOrganizer), a display control class (SurfaceControl), a task stack change listening interface (TaskStackChangeListener), a component management encapsulation class (ActivityManagerWrapper), and a window container transaction class (WindowContainerTransaction).

[0078] The compilation package is generally a jar package. By accessing the directory containing these compilation packages, the compilation package can be obtained and introduced into the desktop application. Then, the classes and interfaces in the compilation package can be used to realize multi-window simultaneous display.

[0079] Through these classes and interfaces, desktop applications can monitor the life cycle of each window and perform corresponding operations on the window; for large-screen devices such as smart TVs, which provide a large enough visual area, the display control object (SurfaceControl) instantiated by the display control class is used to control the display position of each window and the relationship with other windows, thus completing the management of all application windows and the simultaneous display of multiple windows. The call diagram of the class and interface is shown in the figure below: Figure 3 As shown, the transaction class is the class for window atomic operations, and these classes and interfaces are explained later.

[0080] In this embodiment, in desktop applications, by extracting and using the classes and interfaces required for simultaneous display of windows in the system source code, simultaneous display of multiple windows on large-screen devices is achieved. This not only avoids deep modification of the system code, but also solves the problem of high coupling of the system code, and provides convenience for system version iteration.

[0081] Optionally, before step S201 "responding to the display instruction of the first application", the method may further include: setting the startup mode of the application to the free window mode by configuring the window container transaction object.

[0082] By instantiating the window container transaction class in the compilation package, a corresponding window container transaction object (WindowContainerTransaction) can be created; wherein, WindowContainerTransaction sets two startup modes for the application: free window mode (WindowConfiguration.WINDOWING_MODE_FREEFORM) and full screen mode (WindowConfiguration.WINDOWING_MODE_FULLSCREEN). In this embodiment, when multiple windows need to be displayed at the same time, by configuring WindowContainerTransaction, the startup mode of all applications can be set to free window mode, so that the size of the application window can be set later through the display control object (SurfaceControl) and the corresponding transaction object (Transaction), thereby realizing multiple windows being displayed at the same time.

[0083] In addition, optionally, before step S201 "responding to the display instruction of the first application", the method further includes steps a1 to a2.

[0084] Step a1, setting a plurality of display modes; the display modes include a division method of a plurality of display areas, and a display order corresponding to the plurality of display areas.

[0085] Step a2: divide the device screen into multiple display areas according to the division method of the currently selected target display mode, and configure the display order corresponding to each display area.

[0086] In this embodiment, multiple display modes can be formed by dividing the device screen in different ways and using each divided display area to display applications of different characteristics. When a user uses the multi-window simultaneous display function, he can select the display mode he needs, that is, the target display mode, and when the windows of each application are subsequently displayed, they are displayed according to the target display mode.

[0087] For example, display mode 1 divides the device screen into two display areas, that is, at most two applications can be displayed at the same time; display mode 2 divides the device screen into three display areas, that is, at most three applications can be displayed at the same time. If the user selects display mode 1, display mode 1 is used as the target display mode, and the device screen is divided into two display areas.

[0088] Different display areas are used to display applications of different degrees of newness, so the display order of each display area can be configured according to the degree of newness. For example, one of the display areas is configured to display the latest application, that is, the display area is used as the first display area.

[0089] It can be understood that for different display modes, the configuration information of each display area can be set respectively, so that the display position and size of each application can be adaptively adjusted based on the configuration information of the corresponding display mode.

[0090] In this embodiment, by setting a variety of display modes for users to choose from, diversified control can be achieved to meet the various needs of users.

[0091] Step S202, obtain first configuration information for displaying a first application, adjust the display control object of the first application according to the first configuration information, and set the first application in a first display area for displaying the latest application; the first display area is a partial area of ​​the device screen, and other display areas in the device screen except the first display area are used to display other applications.

[0092] For details, please see Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0093] Step S203, when there is a second application already displayed in the first display area, obtain second configuration information for displaying the second application, adjust the display control object of the second application according to the second configuration information, and set the second application in the second display area for displaying the next newest application.

[0094] In this embodiment, in order to display multiple windows at the same time, in addition to the first display area, the device screen also has a display area for displaying other applications. In this embodiment, the display area for displaying the second-newest application is called the second display area; as the name suggests, the second-newest application is the second newest application, that is, the latest application among the remaining applications except the latest application.

[0095] If the second application currently being displayed already exists in the first display area when the display instruction of the first application is triggered, it can be determined that the second application was the latest application before; and after the first application is added, the second application becomes the second latest application. In order to avoid the second application being overwritten, in addition to adjusting the display control object of the first application, the display control object of the second application is also adjusted. By modifying the display position and other properties of the second application, the second application can be set in the second display area.

[0096] Similar to adjusting the display control object of the first application, when adjusting the display position and other properties of the second application, the second configuration information for displaying the second application can be obtained; since the second application needs to be displayed in the second display area at this time, the second configuration information is the configuration information for displaying the application in the second display area. After obtaining the second configuration information, the second configuration information is loaded into the display control object of the second application, so that the second application can be moved from the first display area to the second display area.

[0097] Furthermore, the configuration information corresponding to the second display area may also be pre-set, that is, the second configuration information may be pre-set, which will not be described in detail here.

[0098] Step S204: if a third application is displayed in the third display area for displaying the oldest application, obtain third configuration information for displaying the third application, adjust the display control object of the third application according to the third configuration information, and hide the third application.

[0099] In this embodiment, the display area divided by the device screen is limited, so in addition to the first display area, there is also a third display area for displaying the oldest application; wherein the oldest application is the oldest application determined under the limitation of the number of display areas divided by the device screen; in other words, if the number of display areas is n (n is an integer greater than or equal to 2), the third display area is used to display the nth newest application.

[0100] It can be understood that if the device screen is divided into only two display areas, the third display area for displaying the oldest application and the second display area for displaying the second newest application are the same display area.

[0101] If, when the display instruction of the first application is triggered, there is a third application displayed in the third display area, it can be determined that the third application was the oldest application before; and after the first application is added, the second oldest application becomes the oldest application, and there is no display area for displaying the third application on the device screen, so it is necessary to adjust the display control object of the third application to hide the third application. For example, the position of the third application can be modified to be located outside the device screen to achieve hiding of the third application.

[0102] Among them, similar to adjusting the display control objects of the first application and the second application, when adjusting the display position and other properties of the third application, the third configuration information used to display the third application can be obtained; since the third application needs to be hidden at this time, the third configuration information is the configuration information for hiding the application, such as setting the display position of the application outside the device screen. After obtaining the third configuration information, the third configuration information is loaded into the display control object of the third application to achieve the hiding of the third application. Similarly, the configuration information corresponding to the third display area can also be pre-set, that is, the third configuration information that can hide the application can be pre-set, which will not be repeated here.

[0103] In this embodiment, the applications displayed in each display area are configured according to the newness of the applications, which makes the implementation logic simple, and the latest displayed application is always set in the first display area for displaying the latest application, so that the user can quickly locate the application displayed based on the display instruction.

[0104] Optionally, the method may further include the following steps b1 to b3.

[0105] Step b1, in response to a sliding instruction for switching displayed applications, determining a plurality of valid applications that currently need to be displayed.

[0106] Step b2: adjusting the display area of ​​each of the valid applications according to a preset configuration strategy.

[0107] Step b3: hiding invalid applications other than the valid applications according to a preset configuration policy.

[0108] In this embodiment, the user can trigger a corresponding sliding instruction through a sliding operation to switch the hidden application to the foreground to run, thereby realizing application switching.

[0109] Specifically, the configuration strategy can adjust the change mode of the display area of ​​the valid application, for example, display the display position and display size of each valid application according to the importance of the valid application. Alternatively, the display order of each valid application can be adjusted. For example, the display area corresponding to each valid application can be determined according to the display order of multiple valid applications; the display control object of each valid application can be adjusted according to the configuration information of each valid application, and each valid application can be set in the corresponding display area.

[0110] Furthermore, according to the configuration information of other invalid applications except the valid application, the display control object of the invalid application can be adjusted to hide the invalid application.

[0111] Figure 4 A schematic diagram showing a control effect of a display application is shown; Figure 4 In the figure, the box with rounded corners represents the display range of the device screen, which is divided into two display areas. The left half of the display area is used to display the latest application, that is, the first display area, and the right half of the display area is used to display the second latest application (the oldest application), that is, the second display area (the third display area). Figure 4 As shown, initially no application window is displayed on the device screen; the user triggers a display instruction to display application A, and application A is the latest application, so it is set in the left half of the display area.

[0112] Afterwards, the user triggers a display command to display application B. At this time, application B is the newest application, so it is set in the left display area; application A becomes the second newest application, and it is adjusted to the right display area. At this time, application A is also the oldest application.

[0113] Afterwards, the user triggers a display instruction to display application C. At this time, application C is the newest application, so it is set in the left display area; application B becomes the second newest application, so it is adjusted to the right display area; application A is the oldest application previously displayed, so application A is hidden.

[0114] After that, the user triggers the sliding command by sliding the screen to the left. If it is determined that application B and application A need to be displayed based on the sliding distance, then both application B and application A are valid applications. It can be understood that the number of valid applications does not exceed the number of display areas. Since application B is earlier than application A, application B corresponds to the left half of the display area, and application A corresponds to the right half of the display area. Then, by configuring the display control objects of application B and application A, the display of application B and application A is realized.

[0115] In addition, the remaining applications C are applications that do not need to be displayed, that is, invalid applications. By configuring the display control object of application C, the application C is hidden. The display effect can be seen in Figure 4 shown.

[0116] It is understandable that the user can further display Application C and Application B on the device screen through a right swipe instruction.

[0117] In this embodiment, an application sequence may be set, and the application sequence includes various applications arranged in a sequential display order; Figure 4 As shown, the application sequence can be expressed as application C→application B→application A. When the user triggers a sliding instruction, a valid application to be displayed is determined based on the application sequence and displayed.

[0118] In this embodiment, when a user opens multiple applications, he can switch the application to be displayed through a sliding instruction, which is simple to operate and has high switching efficiency.

[0119] In some optional implementations, after the above step S202 "setting the first application in the first display area for displaying the latest application", the user may also hide the first application, that is, not display the first application, and the process of hiding the first application includes step c1.

[0120] Step c1, in response to the hiding instruction of the first application, hiding the first application by adjusting the display control object of the first application.

[0121] In this embodiment, when the first application is displayed, if the user does not need to display the first application, a hiding instruction for hiding the first application can be input. The desktop application can hide the first application by adjusting the display control object of the first application again. For example, the position of the first application can be set outside the device screen so that the first application is not displayed on the device screen, thereby hiding the first application.

[0122] Optionally, when hiding the first application, linkage processing of other applications may be required. Specifically, after the above step S202 of "setting the first application in the first display area for displaying the latest application", the method may further include the following steps c2 to c4.

[0123] Step c2, in response to the hiding instruction of the first application, determining whether there is a fourth application that is currently in a display state and is older than the first application, and determining whether there is an application in a background state.

[0124] Step c3: if there is a fourth application, set the fourth application in the display area for displaying the first application by configuring the display control object of the fourth application.

[0125] Step c4, when there is an application in the background state, by configuring the display control object of the fifth application which is the newest one among the applications in the background state, the fifth application is set in the third display area for displaying the oldest application.

[0126] In this embodiment, each display area is used to display applications of different degrees of newness. When the first application is hidden, if the first application is the oldest application, that is, there is no application older than the first application among the displayed applications, that is, there is no fourth application, then step c3 does not need to be executed.

[0127] On the contrary, if the first application is not the oldest application, it means that a fourth application older than the first application is currently displayed. After the first application is hidden, the newness of the fourth application will change, so the display area of ​​the fourth application can be adjusted and the fourth application can be set in the display area just used to display the first application. It can be understood that there may be multiple applications that are currently displayed and older than the first application. At this time, only the latest application among them is used as the fourth application, and the display areas of the remaining applications are also adjusted to the display areas that are updated by one level.

[0128] In addition, it is also determined whether there is an application in the background state. If there is no application in the background state, only the fourth application that may exist is adjusted, that is, step c4 does not need to be performed. On the contrary, if there is an application in the background state, and the latest application is the fifth application, the fifth application needs to be displayed; and compared with other currently displayed applications, the fifth application is the oldest application, so the fifth application is set in the third display area for displaying the oldest application.

[0129] Figure 5 A schematic diagram of a control effect when hiding an application is shown; Figure 5 In the figure, the frame with rounded corners represents the display range of the device screen. The device screen is divided into three display areas: a left display area, a middle display area, and a right display area, which are respectively the first display area, the second display area, and the third display area. After displaying application A, application B, application C, and application D in sequence, the display effect of the device screen is as follows: Figure 5 shown.

[0130] If the hiding instruction of hiding application C is triggered currently, then based on step c1, application C is hidden; and at this time, there is application B that is currently in display state and is older than application C, and there is also application A in background state, that is, application B is the fourth application, and application A is the fifth application. While hiding application C, based on steps c3 and c4, application B is set in the display area originally used to display application C, that is, the middle display area, and application A is set in the third display area used to display the oldest application, that is, the right display area.

[0131] In some optional implementations, the application can be displayed by creating a new application or changing an application in the background state to the foreground state. Accordingly, the display instruction may include a creation instruction or a first switching instruction to switch from the background to the foreground.

[0132] The above step S201 "obtaining the display control object of the first application according to the callback function integrated in the desktop application and called when the task is displayed" may specifically include the following steps d1 and d2.

[0133] Step d1, when the display instruction is a creation instruction, according to the first callback function in the task organization class that is called when the task is created, obtain the running task information and the display control object of the first application, and record the corresponding relationship between the running task information and the display control object.

[0134] In this embodiment, the compilation package introduced for the desktop application includes a task organization class, and the task organization object (TaskOrganizer) instantiated based on it includes a callback function onTaskAppeared. The callback function onTaskAppeared is triggered when the task is created, that is, when a new application is created, the callback function onTaskAppeared will be triggered and used as the first callback function.

[0135] Among them, in the onTaskAppeared method callback, the running task information (RunningTaskInfo) of the created application is provided, and the display control object (SurfaceControl) is returned, so that the display position, scaling, etc. of the application window can be controlled based on the display control object.

[0136] Furthermore, the running task information may include the ID and name of the relevant application. By establishing a corresponding relationship between the running task information and the display control object, it is convenient to locate the corresponding display control object based on the corresponding relationship.

[0137] Step d2, when the display instruction is the first switching instruction, obtain the running task information (RunningTaskInfo) of the first application according to the second callback function (onTaskMovedToFront) called when the task is transferred to the foreground in the task stack change listening interface (TaskStackChangeListener), and determine the display control object of the first application according to the corresponding relationship.

[0138] In this embodiment, when the user opens the first application, the correspondence between the running task information of the first application and the display control object can be recorded according to step d1; then, the user switches the first application to background operation; if later, the user switches the first application running in the background to the foreground, the first switching instruction can be triggered.

[0139] Since the task organization class does not include a monitoring method for switching between the foreground and background of an application, this embodiment uses a task stack change monitoring interface (TaskStackChangeListener) to supplement the methods in the task organization class so as to be able to more comprehensively monitor user operations on the application.

[0140] Specifically, the task stack change listener interface (TaskStackChangeListener) is provided with a callback function onTaskMovedToFront that is called when the task is moved to the foreground, and the callback function can be used as the second callback function. Among them, the second callback function onTaskMovedToFront can return the running task information of the application moved to the foreground, and the running task information also includes the ID of the related application, so the display control object of the first application can be determined by using the previously recorded correspondence and the running task information returned by the second callback function, thereby realizing the display control of the first application.

[0141] In this embodiment, by combining the task organization class and the task stack change monitoring interface, events such as application creation and transfer to the foreground can be monitored, and callback and perception of each life cycle of the application window can be realized, allowing users to operate the application window more finely, which can improve the user experience.

[0142] Optionally, the user may trigger the corresponding hidden instruction by destroying the application or switching the application to the background, so the hidden instruction may include a destroy instruction or a second switching instruction to switch from the foreground to the background.

[0143] Furthermore, the above step c1 “hiding the first application by adjusting the display control object of the first application” includes step c11 and step c12.

[0144] Step c11, when the hiding instruction is the second switching instruction, obtain the running task information of the first application according to the third callback function called when the task is transferred to the background in the task stack change monitoring interface, and hide the first application by adjusting the display control object corresponding to the running task information of the first application.

[0145] In this embodiment, as described above, the task organization class does not include a monitoring method for switching between the foreground and background of an application, so this embodiment still monitors whether there is an application that needs to be switched to the background based on the task stack change monitoring interface (TaskStackChangeListener).

[0146] Specifically, the task stack change listening interface (TaskStackChangeListener) also has a method onTaskMovedToBack that is called when the task is moved to the background. This method can be used as the third callback function. Similar to the second callback function mentioned above, the third callback function can only return the running task information of the first application; but the first application that needs to be moved to the background must have been created before. Therefore, based on the correspondence between the running task information and the display control object recorded when the first application was created, the running task information returned by the third callback function can be used to determine the display control object of the first task, and then the first application can be hidden by adjusting the display control object.

[0147] Step c12, when the hiding instruction is a destroy instruction, according to the fourth callback function in the task organization class that is called when the task is destroyed, the running task information of the first application is obtained, and the display control object corresponding to the running task information of the first application is cleared.

[0148] In this embodiment, the task organization class includes a method onTaskVanished that is called when the task is destroyed, and this method can be used as the fourth callback function. Among them, the fourth callback function can only return the running task information, so when the first application needs to be destroyed, the running task information and the corresponding relationship returned by the fourth callback function can be used to determine the display control object of the first application. At this time, the display control object of the first application can be cleared, so that the first application is no longer displayed until the user re-creates the first application.

[0149] Optionally, the method further includes: utilizing a register task stack listener method (registerTaskStackListener) in a component management encapsulation class (ActivityManagerWrapper) to register a task stack change listener interface (TaskStackChangeListener).

[0150] In this embodiment, when using the task stack change listening interface (TaskStackChangeListener), registration (Register) is required; wherein, the component management encapsulation class provides a corresponding registration task stack listening method registerTaskStackListener, so the component management encapsulation class in the compilation package can be used for instantiation, and the task stack change listening interface is registered based on the registration task stack listening method in the instantiated component management encapsulation object (ActivityManagerWrapper).

[0151] In addition, the component management encapsulation class also includes a deregistration method unregisterTaskStackListener, based on which deregistration can be implemented to complete the closed loop of each link.

[0152] The display method based on desktop applications provided in this embodiment can achieve low-coupling multi-window management by utilizing existing classes and interfaces introduced into desktop applications. If multiple applications are currently displayed, when adding a new application or hiding an already displayed application, the degree of newness corresponding to each display area can be utilized to simply and quickly complete the processing. The processing method for displaying or hiding applications is simple, and the simultaneous display of windows can be efficiently achieved.

[0153] In this embodiment, a display device based on desktop application is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0154] This embodiment provides a display device based on desktop applications, such as Figure 6 As shown, including:

[0155] The object acquisition module 601 is used to respond to the display instruction of the first application and acquire the display control object of the first application according to the callback function integrated in the desktop application and called when the task is displayed;

[0156] Processing module 602 is used to obtain first configuration information for displaying the first application, adjust the display control object of the first application according to the first configuration information, and set the first application in a first display area for displaying the latest application; the first display area is a partial area of ​​the device screen, and other display areas in the device screen except the first display area are used to display other applications.

[0157] In some optional implementations, the processing module 602 is further configured to:

[0158] In response to a display instruction of the first application, if a second application is already displayed in the first display area, obtaining second configuration information for displaying the second application, adjusting a display control object of the second application according to the second configuration information, and setting the second application in a second display area for displaying a second-new application;

[0159] In the case where a third application is displayed in the third display area for displaying the oldest application, third configuration information for displaying the third application is obtained, a display control object of the third application is adjusted according to the third configuration information, and the third application is hidden.

[0160] In some optional implementations, the processing module 602 is further configured to:

[0161] In response to a sliding instruction for switching displayed applications, determining a plurality of valid applications that currently need to be displayed;

[0162] According to a preset configuration strategy, adjusting the display area of ​​each of the valid applications;

[0163] According to a preset configuration policy, other invalid applications except the valid application are hidden.

[0164] In some optional implementations, the display instruction includes a creation instruction or a first switching instruction for switching from the background to the foreground;

[0165] The processing module 602 obtains the display control object of the first application according to the callback function integrated in the desktop application and called when the task is displayed, including:

[0166] In the case where the display instruction is a creation instruction, according to a first callback function in the task organization class that is called when the task is created, obtaining the running task information and the display control object of the first application, and recording the corresponding relationship between the running task information and the display control object;

[0167] When the display instruction is a first switching instruction, the running task information of the first application is obtained according to the second callback function called when the task is transferred to the foreground in the task stack change monitoring interface, and the display control object of the first application is determined according to the corresponding relationship.

[0168] In some optional implementations, the processing module 602 is further used to: after setting the first application in the first display area for displaying the latest application, obtain a hiding instruction of the first application, the hiding instruction including a destroy instruction or a second switching instruction from the foreground to the background;

[0169] In the case where the hiding instruction is the second switching instruction, obtaining the running task information of the first application according to the third callback function called when the task is transferred to the background in the task stack change monitoring interface, and hiding the first application by adjusting the display control object corresponding to the running task information of the first application;

[0170] In the case where the hiding instruction is a destroy instruction, according to the fourth callback function in the task organization class that is called when the task is destroyed, the running task information of the first application is obtained, and the display control object corresponding to the running task information of the first application is cleared.

[0171] In some optional implementations, the device further comprises: a registration module, configured to register the task stack change monitoring interface by utilizing the registration task stack monitoring device in the component management encapsulation class.

[0172] In some optional embodiments, the device also includes: a selection module, used to: set multiple display modes before responding to the display instruction of the first application; the display mode includes a division method of multiple display areas, and a display order corresponding to the multiple display areas; divide the device screen into multiple display areas according to the division method of the currently selected target display mode, and configure the display order corresponding to each display area.

[0173] In some optional implementations, the device further comprises: a mode configuration module, configured to: before responding to the display instruction of the first application, set the startup mode of the application to the free window mode by configuring the window container transaction object.

[0174] In some optional embodiments, the device also includes: a compilation and introduction module, which is used to: obtain a compiled compilation package from the system source code and introduce the compilation package into the desktop application before responding to the display instruction of the first application; the compilation package includes: at least one of a task organization class, a display control class, a task stack change monitoring interface, a component management encapsulation class and a window container transaction class.

[0175] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0176] The desktop application-based display device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, including a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0177] The embodiment of the present invention also provides a computer device having the above Figure 6 A display device based on a desktop application is shown.

[0178] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0179] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0180] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0181] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0182] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0183] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0184] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0185] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0186] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0187] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations should all be included in the protection scope of the present invention.

Claims

1. A display method based on desktop application, characterized in that: The method comprises: In response to a display instruction of the first application, obtaining a display control object of the first application according to a callback function integrated in the desktop application and called when a task is displayed; Obtain first configuration information for displaying the first application, adjust the display control object of the first application according to the first configuration information, and set the first application in a first display area for displaying the latest application; the first display area is a partial area of ​​the device screen, and other display areas of the device screen except the first display area are used to display other applications.

2. The method according to claim 1, characterized in that Also includes: In response to a display instruction of the first application, if a second application is already displayed in the first display area, obtaining second configuration information for displaying the second application, adjusting a display control object of the second application according to the second configuration information, and setting the second application in a second display area for displaying a second-new application; In the case where a third application is displayed in the third display area for displaying the oldest application, third configuration information for displaying the third application is obtained, a display control object of the third application is adjusted according to the third configuration information, and the third application is hidden.

3. The method according to claim 2, characterized in that Also includes: In response to a sliding instruction for switching displayed applications, determining a plurality of valid applications that currently need to be displayed; According to a preset configuration strategy, adjusting the display area of ​​each of the valid applications; According to a preset configuration policy, other invalid applications except the valid application are hidden.

4. The method according to claim 1, characterized in that: The display instruction includes a creation instruction or a first switching instruction from the background to the foreground; The acquiring the display control object of the first application according to the callback function integrated in the desktop application and called when the task is displayed includes: In the case where the display instruction is a creation instruction, according to a first callback function in the task organization class that is called when the task is created, obtaining the running task information and the display control object of the first application, and recording the corresponding relationship between the running task information and the display control object; When the display instruction is a first switching instruction, the running task information of the first application is obtained according to the second callback function called when the task is transferred to the foreground in the task stack change monitoring interface, and the display control object of the first application is determined according to the corresponding relationship.

5. The method according to claim 1, characterized in that After setting the first application in the first display area for displaying the latest application, the method further includes: Obtaining a hidden instruction of the first application, where the hidden instruction includes a destroy instruction or a second switching instruction from the foreground to the background; In the case where the hiding instruction is the second switching instruction, obtaining the running task information of the first application according to the third callback function called when the task is transferred to the background in the task stack change monitoring interface, and hiding the first application by adjusting the display control object corresponding to the running task information of the first application; In the case where the hiding instruction is a destroy instruction, according to the fourth callback function in the task organization class that is called when the task is destroyed, the running task information of the first application is obtained, and the display control object corresponding to the running task information of the first application is cleared.

6. The method according to claim 4 or 5, characterized in that: Also includes: The task stack change monitoring interface is registered by utilizing the registration task stack monitoring method in the component management encapsulation class.

7. The method according to claim 1, characterized in that Before responding to the display instruction of the first application, the method further includes: A compiled package is obtained from the system source code, and the compiled package is introduced into the desktop application; the compiled package includes at least one of a task organization class, a display control class, a task stack change monitoring interface, a component management encapsulation class and a window container transaction class.

8. A display device based on desktop application, characterized in that: The device comprises: An object acquisition module, configured to respond to a display instruction of the first application and acquire a display control object of the first application according to a callback function integrated in the desktop application and called when a task is displayed; A processing module is used to obtain first configuration information for displaying the first application, adjust the display control object of the first application according to the first configuration information, and set the first application in a first display area for displaying the latest application; the first display area is a partial area of ​​the device screen, and other display areas in the device screen except the first display area are used to display other applications.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the display method based on desktop application described in any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the display method based on desktop application according to any one of claims 1 to 7.