Window display method and related device

By freezing the process and limited redrawing of visible windows during the window repainting of the folding screen device, the problem of slow window switching speed when the device changes when the opening and closing state is changed, and the window display speed and user experience on the display area are improved.

CN119440678APending Publication Date: 2025-02-14HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310958470.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When the folding screen device changes in its opening and closing state, the window switching causes the display to be repainted, which is slower and affects the user experience.

Method used

Increase the speed at which the electronic device displays visible windows on the display area after the resolution is changed by freezing one or more processes and/or finitely redrawing the visible window.

Benefits of technology

It reduces the waiting time for users to display windows on the display area after the resolution changes in the scene, and improves the speed and user experience of window redrawing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440678A_ABST
    Figure CN119440678A_ABST
Patent Text Reader

Abstract

The invention provides a window display method and a related device. When the size of the display area for display is changed, the electronic equipment can freeze one or more processes according to the preset process freezing rule and preferentially redraw the visible window. The electronic equipment can display the redrawn visible window in the switched display area after the visible window is redrawn. Afterwards, the electronic device may redraw the invisible window. Wherein the frozen process can be unfrozen after being frozen for a preset time length. According to the method, when the size of the display area changes, the speed of displaying the window in the switched display area can be increased, and the waiting time of a user for waiting for the display window in the switched display area under the scene of switching the display area is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a window display method and related devices. Background Art

[0002] With the development of foldable screen technology, foldable and multi-screen foldable screen devices are becoming more and more common. When using a foldable screen device, users can control the foldable screen device to use different display screens or display areas for display by adjusting the opening and closing state of the foldable screen. That is, the foldable screen device can switch the window displayed on one display screen to another display screen for display according to the opening and closing state of the foldable screen, so as to ensure that the current task can continue to be executed seamlessly after the opening and closing state of the foldable screen changes.

[0003] However, in the process of switching the display screen used for display, the folding screen device needs to redraw the window adapted to the switched display screen and then display it. The switched display screen lights up and displays the relevant content at a relatively slow speed. For example, when the user adjusts the folding screen device from the folded state to the unfolded state, the user will obviously feel that it takes a while to see the display screen used for display in the unfolded state light up and display the relevant content. This will result in a poor user experience when the folding screen device changes from the open and closed state. Summary of the invention

[0004] The present application provides a window display method and a related device. When an electronic device changes its resolution, the electronic device can redraw the window according to the changed resolution. The electronic device can increase the speed at which the electronic device displays visible windows on a display area after the resolution is changed by freezing one or more processes and / or redrawing visible windows in a limited manner before redrawing the window. This can reduce the waiting time for a user to wait for a window to be displayed on a display area after the resolution is changed in a scenario where the resolution is changed.

[0005] In a first aspect, the present application provides a window display method. The method is applied to an electronic device, and the electronic device includes a first display area and a second display area. The electronic device displays a first window in the first display area; when the electronic device meets a first condition, the electronic device freezes one or more processes, and the first condition is a condition indicating that the electronic device switches the display area from the first display area to the second display area; the electronic device redraws the first window according to the size of the second display area; the electronic device displays the redrawn first window in the second display area; and the electronic device unfreezes one or more processes.

[0006] Process freezing may mean that the process temporarily stops running. In some embodiments, the electronic device may change one or more of the above states to a blocked state to freeze the process. During the frozen time period, the process will not be assigned to the CPU for running. In other words, the frozen process does not temporarily occupy resources such as the CPU. In this way, other unfrozen processes can have more time and opportunities to be run by the CPU.

[0007] Unfreezing a process may mean changing the state of a process to an executable state. In some embodiments, the electronic device may change the state of a process from a blocked state to a ready state to unfreeze the process. After the process is unfrozen, the process may be assigned to a CPU to run.

[0008] It can be seen from the above method that when the electronic device needs to switch the display area to redraw the window, it can reduce the competition for resources required for the operation of processes such as the CPU by freezing some processes. This can reduce the situation where resources such as the CPU are preempted by other processes when the process used for window redrawing is running, thereby reducing the time that the process used for window redrawing needs to wait for using resources such as the CPU. The process used for window redrawing can make full use of CPU resources. It can be seen that the above method can increase the speed of window redrawing completion by freezing some processes when the window needs to be redrawn. In this way, the application window can complete the adaptation with the switched display area more quickly and be displayed on the switched display area. The user can view the window that needs to be displayed in the switched display area more quickly.

[0009] In combination with the first aspect, in some embodiments, the electronic device unfreezes one or more processes after the one or more processes are frozen for a first period of time; or, the electronic device unfreezes one or more processes after redrawing one or more windows in the electronic device, where the one or more windows include the first window.

[0010] The first duration may be longer than the time required for the electronic device to complete window redrawing, so as to avoid the CPU and other resources being occupied by other processes during the process of window redrawing by the electronic device, resulting in the process for window redrawing having to wait for a long time before being allocated to the CPU to complete window redrawing.

[0011] In combination with the first aspect, in some embodiments, one or more processes are screened out according to a first rule, the types of the one or more processes include background processes, and the one or more processes do not include processes associated with the first window.

[0012] The above-mentioned first rule may also be referred to as a process freezing rule. The first rule may be preset. In some embodiments, the first rule may include a program implemented for the judgment logic of the process. For example, the judgment logic for the process may include one or more of the following: judging whether the process is a background process, judging whether the process is a process that plays music in the background, judging whether the process is a process that projects the screen in the background, and so on. If a process is judged to be a background process, the electronic device may freeze this process. If a process is a process that plays music or projects the screen in the background, this process may not be frozen. In some embodiments, the first rule may include a process filter table. The process filter table may contain information on multiple processes that can be frozen. The electronic device may filter out one or more processes from the currently created processes according to the process filter table, and then freeze the filtered processes.

[0013] Optionally, the types of the one or more processes that are frozen may also include service processes.

[0014] The above-mentioned screening out of the processes to be frozen according to the first rule can prevent the electronic device from freezing the foreground processes and visible processes such as the process associated with the first window.

[0015] In combination with the first aspect, in some embodiments, there are K windows in the electronic device, where K is a positive integer; the electronic device redraws one or more windows of the K windows according to the size of the second display area, and the one or more windows include the first window.

[0016] That is to say, in addition to redrawing the first window, the electronic device can also redraw other windows.

[0017] When the size of the second display area is smaller than that of the first display area, the electronic device may only display part of the window displayed in the first display area in the second display area after switching the display area to the second display area. Figure 4B The display area shown switches to Figure 4A That is, when the size of the display area after switching is reduced, the electronic device can remove a portion of the windows displayed on the display area before switching, and no longer need to display them on the display area after switching. The electronic device does not need to redraw the removed windows. Therefore, when there are K windows in the electronic device, after the electronic device switches the display area, only some of the K windows can be redrawn.

[0018] In some embodiments, when the display area is switched, in addition to redrawing some or all of the existing windows in the electronic device, the electronic device can also create a new window and display it on the switched display area. Figure 4A The display area shown switches to Figure 4BThe scene of the display area shown. Exemplarily, when the size of the second display area is larger than the size of the first display area, the electronic device can display a newly added window in the second display area. The newly added window can be newly created by the electronic device and is not included in the above K windows. Among them, the electronic device can create an activity corresponding to the newly added window to display the newly added window in the second display area. Optionally, the newly added window can be the upper-level window of the first window. The electronic device can determine the display positions of the first window and the newly added window and the size and layout of the elements in the windows according to the size of the second display area.

[0019] It should be noted that the electronic device may redraw all windows (except the window that needs to be removed) and then display the redrawn first window and other visible windows on the second display area. Since the user may call out an invisible window after switching the display area and change the invisible window into a visible window, the electronic device may redraw all windows before displaying the redrawn window, so that after switching the display area, the invisible window adapted to the switched display area can be quickly called out.

[0020] In combination with the first aspect, in some embodiments, before the electronic device redraws one or more windows among the K windows according to the size of the second display area, the electronic device determines that one or more frozen processes include a process associated with the second window in the one or more windows; and the electronic device unfreezes the process associated with the second window.

[0021] As can be seen from the above embodiments, since the electronic device will redraw the visible window and the invisible window before sending the redrawn window for display, and the process associated with the invisible window may be frozen, the electronic device can determine whether there are any processes associated with the window frozen among the K windows, and unfreeze the processes associated with the window when the processes associated with the window are frozen, so as to redraw the windows. Among them, other frozen processes can continue to remain frozen to prevent these processes from occupying CPU resources and affecting the speed of window redrawing.

[0022] In combination with the first aspect, in some embodiments, there are K windows in the electronic device, where K is a positive integer; before the electronic device displays the redrawn first window in the second display area, the electronic device distinguishes between visible windows and invisible windows among the K windows, the K windows are composed of K1 visible windows and K2 invisible windows, both K1 and K2 are positive integers, and K1 visible windows are displayed on the first display area; the electronic device redraws one or more visible windows among the K1 visible windows according to the size of the second display area, and the one or more visible windows include the first window; the electronic device displays the redrawn one or more visible windows in the second display area.

[0023] It can be seen from the above embodiments that the electronic device can improve the speed of displaying the redrawn visible window in the switched display area by combining the method of freezing the process with the method of redrawing the visible window first. The above method can not only reduce the competition for resources required for the operation of processes such as the CPU, so that the process used for window redrawing can have more time and opportunities to be run by the CPU, but also reduce the CPU load during the window redrawing process, so that the electronic device 100 can unfreeze the window as soon as possible and send the redrawn visible window to the switched display area. In this way, after detecting the display area switching condition, the electronic device 100 can light up the display screen corresponding to the switched display area more quickly and display the redrawn window on the switched display area. The user can view the window to be displayed in the switched display area more quickly.

[0024] In combination with the first aspect, in some embodiments, after one or more visible windows are redrawn, or after the second display area displays the redrawn one or more visible windows, the electronic device redraws one or more invisible windows among the K2 invisible windows.

[0025] As can be seen from the above embodiments, the electronic device can give priority to redrawing the visible window. Once the visible window is drawn, the electronic device can display the redrawn visible window on the second display area after switching. The redrawing time of the invisible window is slightly later than the redrawing time of the visible window, which can not only reduce the CPU load during the window redrawing process, but also can display the called-out window in time in the switched display area when the invisible window needs to be called out after the display area switching is completed.

[0026] In combination with the first aspect, in some embodiments, the first display area and the second display area are two display areas with completely different positions, or, the first display area and the second display area are two display areas that have an inclusion relationship, or, the first display area and the second display area are two display areas that are in a horizontal or vertical screen relationship with each other.

[0027] In combination with the first aspect, in some embodiments, the electronic device powers off the display screen corresponding to the first display area, and powers on the display area corresponding to the second display area, which can save power consumption of the electronic device.

[0028] In conjunction with the first aspect, in some embodiments, the first condition includes: a condition that triggers the electronic device to change the resolution. The size of the first display area is different from the size of the second display area. The size of the display area used by the electronic device for display may represent the resolution of the electronic device. When the electronic device changes the resolution, the electronic device needs to redraw the window, adjust the display position of the window and the size, part, and other contents of the elements in the window, so that the redrawn window is adapted to the changed resolution.

[0029] In combination with the first aspect, in some embodiments, the first condition includes: the electronic device changes from a folded state to an unfolded state; or, the electronic device changes from an unfolded state to a folded state; or, the electronic device changes from a horizontal screen state to a vertical screen state; or, the electronic device changes from a vertical screen state to a horizontal screen state; or, the electronic device switches from a non-one-handed use mode to a one-handed use mode; or, the electronic device switches from a one-handed use mode to a non-one-handed use mode.

[0030] Optionally, the first condition may include: the electronic device changes from a folded state to an unfolded state, and the first angle between the two screens formed by folding the folding screen of the electronic device is within a first angle range, or the electronic device changes from an unfolded state to a folded state, and the first angle is within a second angle range. Exemplarily, the first angle range may be [10°, 180°]. The second angle range may be [0°, 80°].

[0031] In some embodiments, the electronic device receives a user operation for changing the resolution while the opening and closing state of the folding screen remains unchanged, and the resolution can be changed. For example, the electronic device may provide a control for switching the display area and / or a control for setting the resolution. In response to the operation of the control for switching the display area or the control for setting the resolution, the electronic device can change the resolution, that is, the user can switch the display area and change the resolution of the electronic device without changing the opening and closing state of the folding screen by operating the above-mentioned control for switching the display area or the control for setting the resolution.

[0032] In combination with the first aspect, in some embodiments, when the electronic device meets the first condition, the electronic device freezes the window; after the first window is redrawn, the electronic device unfreezes the window.

[0033] Window freezing can be an operation for all windows in an electronic device. When window freezing is performed, all windows in the electronic device can stop responding to any operation (such as click operation, touch operation, long press operation, etc.) on the display screen, and the electronic device can pause drawing all windows. Among them, the above-mentioned stop responding to any operation on the display screen can prevent the user from accidentally touching the screen when the electronic device switches the display area.

[0034] In a second aspect, the present application provides a window display method. The method is applied to an electronic device, the electronic device includes a first display area and a second display area, there are K windows in the electronic device, the K windows are composed of K1 visible windows and K2 invisible windows, and K, K1 and K2 are all positive integers. The electronic device displays K1 visible windows in the first display area; when the electronic device meets the first condition, the electronic device redraws one or more visible windows of the K1 visible windows according to the size of the second display area; the electronic device displays the redrawn one or more visible windows in the second display area.

[0035] As can be seen from the above method, the electronic device can give priority to redrawing the visible window, and unfreeze the window after the visible window is redrawn, and then display it in the switched display area. In this way, the electronic device can display the redrawn visible window in the switched display area without waiting for all windows to be redrawn. It can be understood that the above visible window needs to be immediately presented in the switched display area after the display area is switched for the user to view. However, the invisible window is often not immediately displayed in the switched display area after the display area is switched. The above method can reduce the window redrawing tasks that need to be performed before the switched display area is displayed, reduce the CPU load during the window redrawing process, and reduce the possibility of conflicts between processes. In this way, the electronic device 100 can light up the display screen corresponding to the switched display area more quickly after detecting the display area switching condition, and display the redrawn window on the switched display area. The user can view the window that needs to be displayed in the switched display area more quickly.

[0036] It should be noted that, when the size of the second display area is smaller than the size of the first display area, the electronic device can only display part of the windows displayed in the first display area (i.e., part of the visible windows among K1 visible windows) in the second display area after switching the display area to the second display area. Figure 4B The display area shown switches to Figure 4A The scene of the display area shown. That is to say, when the size of the display area after switching is reduced, the electronic device can remove part of the K1 visible windows and do not need to display them on the display area after switching. The electronic device does not need to redraw the part of the removed visible windows. Therefore, when there are K1 visible windows in the electronic device, after the electronic device switches the display area, only part of the K1 visible windows can be redrawn.

[0037] In some embodiments, when the display area is switched, in addition to redrawing some or all of the existing visible windows in the electronic device, the electronic device can also create a new window and display it on the switched display area. Figure 4A The display area shown switches to Figure 4B Scene of the display area shown. Exemplarily, when the size of the second display area is larger than the size of the first display area, the electronic device can display a newly added window in the second display area. The newly added window can be newly created by the electronic device and is not included in the above-mentioned K1 visible windows. Among them, the electronic device can create an activity corresponding to the newly added window to display the newly added window in the second display area. Optionally, the newly added window can be the upper-level window of the first window. The electronic device can determine the display positions of the first window and the newly added window and the size and layout of the elements in the windows according to the size of the second display area.

[0038] In combination with the second aspect, in some embodiments, after one or more visible windows are redrawn, or after the second display area displays the redrawn one or more visible windows, the electronic device redraws one or more invisible windows among the K2 invisible windows.

[0039] As can be seen from the above embodiments, the electronic device can give priority to redrawing the visible window. Once the visible window is drawn, the electronic device can display the redrawn visible window on the second display area after switching. The redrawing time of the invisible window is slightly later than the redrawing time of the visible window, which can not only reduce the CPU load during the window redrawing process, but also can display the called-out window in time in the switched display area when the invisible window needs to be called out after the display area switching is completed.

[0040] In combination with the second aspect, in some embodiments, the first display area and the second display area are two display areas with completely different positions, or, the first display area and the second display area are two display areas that have an inclusion relationship, or, the first display area and the second display area are two display areas that are in a horizontal or vertical screen relationship with each other.

[0041] In conjunction with the second aspect, in some embodiments, the electronic device powers off the display screen corresponding to the first display area, and powers on the display area corresponding to the second display area, which can save power consumption of the electronic device.

[0042] In combination with the second aspect, in some embodiments, the first condition includes: a condition that triggers the electronic device to change the resolution.

[0043] The electronic device satisfying the first condition may indicate that the electronic device changes the resolution. That is, when the electronic device changes the resolution, the electronic device may distinguish between visible windows and invisible windows, and after redrawing the visible window, display the redrawn visible window on the second display area after the resolution is changed.

[0044] In combination with the second aspect, in some embodiments, the first condition includes: the electronic device changes from a folded state to an unfolded state; or, the electronic device changes from an unfolded state to a folded state; or, the electronic device changes from a horizontal screen state to a vertical screen state; or, the electronic device changes from a vertical screen state to a horizontal screen state; or, the electronic device switches from a non-one-handed use mode to a one-handed use mode; or, the electronic device switches from a one-handed use mode to a non-one-handed use mode.

[0045] In some embodiments, the electronic device receives a user operation for changing the resolution while the opening and closing state of the folding screen remains unchanged, and the resolution can be changed. For example, the electronic device may provide a control for switching the display area and / or a control for setting the resolution. In response to the operation of the control for switching the display area or the control for setting the resolution, the electronic device can change the resolution, that is, the user can switch the display area and change the resolution of the electronic device without changing the opening and closing state of the folding screen by operating the above-mentioned control for switching the display area or the control for setting the resolution.

[0046] In combination with the second aspect, in some embodiments, when the electronic device meets the first condition, the electronic device freezes the window; after redrawing one or more visible windows among K1 visible windows according to the size of the second display area, the electronic device unfreezes the window.

[0047] In a third aspect, the present application provides an electronic device, which may include a display screen, a memory, and a processor. The display screen may be used to display a window. The memory may be used to store a computer program. The processor may be used to call the computer program so that the electronic device executes any possible implementation method in the first aspect or the second aspect.

[0048] In a fourth aspect, the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enables the electronic device to execute any possible implementation method in the first aspect or the second aspect.

[0049] In a fifth aspect, the present application provides a computer program product, which may include computer instructions. When the computer instructions are run on an electronic device, the electronic device executes any possible implementation method in the first aspect or the second aspect.

[0050] In a sixth aspect, the present application provides a chip, which is applied to an electronic device, and the chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute any possible implementation method as in the first aspect or the second aspect.

[0051] It is understandable that the electronic device provided in the third aspect, the computer-readable storage medium provided in the fourth aspect, the computer program product provided in the fifth aspect, and the chip provided in the sixth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1A to Figure 1C is a schematic diagram of some folding screen devices provided in embodiments of the present application;

[0053] Figure 2A to Figure 2C is a schematic diagram of other folding screen devices provided in embodiments of the present application;

[0054] Figure 3 is a flow chart of a window display method provided by an embodiment of the present application;

[0055] Figure 4A to Figure 4F It is a schematic diagram of some switching display area display windows provided in the embodiments of the present application;

[0056] Figure 5A is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application;

[0057] Figure 5B is a software structure block diagram of an electronic device 100 provided in an embodiment of the present application;

[0058] Figure 6 is a flow chart of a window display method provided by an embodiment of the present application;

[0059] Figure 7 is a flow chart of another window display method provided by an embodiment of the present application;

[0060] Figure 8 is a flow chart of another window display method provided by an embodiment of the present application;

[0061] Fig. 9 It is a flowchart of another window display method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in a "or" relationship.

[0063] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0064] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0065] The window display method provided in the present application can be applied to an electronic device with a folding screen. An electronic device with a folding screen can also be referred to as a folding screen device. The folding screen can be folded to form at least two screens. For example, the folding screen can form a first screen and a second screen along a folding edge or a folding axis.

[0066] Among them, the folding screen can have a variety of folding methods. For example, the folding screen can be folded outwards or inwards. The folding screen that folds outwards can be called an outward-folding folding screen or an outward-folding screen. The folding screen that folds inwards can be called an inward-folding folding screen or an inward-folding screen. In some embodiments, the folding screen of the folding screen device can be folded outwards or inwards. Take the example that the folding screen can be folded to form a first screen and a second screen. After the outward-folding folding screen is folded, the display direction of the first screen and the display direction of the second screen are opposite to each other. After the inward-folding folding screen is folded, the display direction of the first screen and the display direction of the second screen are opposite. The embodiment of the present application does not limit the folding method of the folding screen.

[0067] The following is an introduction to electronic devices with an inward folding screen.

[0068] Figure 1A to Figure 1C The schematic diagram exemplarily shows some opening and closing states of the electronic device 100 with an inward folding screen.

[0069] The folding screen of the electronic device 100 can be folded to form two display areas. The opening and closing states of the electronic device 100 can include a folded state, a stand state, and an unfolded state.

[0070] 1. Folded state.

[0071] like Figure 1A As shown, the electronic device 100 is in a folded state. The folded state may represent a state in which the folding screen of the electronic device 100 is completely folded. In the folded state, since the folding screen of the electronic device 100 is an inner folding screen, the two screens (or two display areas) formed by the folding of the inner folding screen are opposite. When the angle between the planes where the two display areas of the folding screen are located is 0° or approximately 0°, the two display areas may be fitted together, and at this time, the folding screen of the electronic device 100 is invisible to the user.

[0072] The back of a display area in the folding screen of the electronic device 100 may be provided with Figure 1A The display area A1 shown. The display area A1 can be a display screen independent of the folding screen. When the electronic device 100 is in the folded state, the electronic device 100 can display an interface on the display area A1. In this way, the user can interact with the electronic device 100 through the display area A1.

[0073] The display area A1 is optional. In some embodiments, the electronic device 100 may not include the display area A1.

[0074] In the folded state, the two display areas formed by the folding screen of the electronic device 100 can rotate along the folding edge in a direction away from each other. Figure 1A The folding state changes shown are Figure 1BThe bracket state shown in the figure finally changes to Figure 1C The expanded state is shown.

[0075] 2. Bracket state.

[0076] like Figure 1B As shown, the electronic device 100 is in a stand state. The stand state may be an intermediate state of the folding screen of the electronic device 100 between the folded state and the unfolded state. The stand state may also be referred to as a semi-folded state or the like. It can be seen that the folding screen of the electronic device 100 may be folded along the folding edge to form a display area A2 and a display area A3. The display area A2 may be the first screen of the folding screen. The display area A3 may be the second screen of the folding screen. Among them, the display area A2 may be located on the back of the display area A1. Optionally, the display area A3 may also be located on the back of the display area A1.

[0077] In the stand state, two display areas formed by folding the folding screen of the electronic device 100 are visible to the user.

[0078] 3. Expanded state.

[0079] like Figure 1C As shown, the electronic device 100 is in an unfolded state. The unfolded state may represent the fully unfolded state of the folding screen of the electronic device 100. Among them, in the unfolded state, when the angle between the planes where the two display areas of the folding screen are located is 180° or approximately 180°, the folding screen of the electronic device 100 can be unfolded into a plane, and the two display areas of the folding screen (i.e., display area A2 and display area A3) are distributed on both sides of the folding edge and are located on the same plane. The electronic device 100 can use a larger screen in the unfolded state to fully display the application content.

[0080] In the unfolded state, the display area A2 and the display area A3 can rotate along the folded edge toward each other. Figure 1C The unfolded state shown is Figure 1B The bracket state shown in the figure finally changes to Figure 1A The folded state is shown.

[0081] In some embodiments, the angle α between the plane where the display area A2 is located and the plane where the display area A3 is located may have a value range of [0°, 180°]. Wherein, if α∈[0°, P1], the electronic device 100 may determine that the folding screen is in a folded state. If α∈(P1, P2), the electronic device 100 may determine that the folding screen is in a support state. If α∈[P2, 180°], the electronic device 100 may determine that the folding screen is in an unfolded state. Wherein, 0°<P1<P2<180°. P1 and P2 may be preset angle thresholds. P1 and P2 may be determined based on the usage habits of a large number of users using folding screens; or, P1 and P2 may be set by the user in the electronic device 100.

[0082] In some embodiments, according to the usage habits of most users, when the angle α between the plane where display area A2 is located and the plane where display area A3 is located is greater than 100°, the user is more likely to use display area A2 and display area A3 as a whole (i.e., as a complete display screen), and the folding screen can be in an unfolded state. When the angle α between display area A2 and display area A3 is less than 80°, the user is more likely to use display area A1 alone, and the folding screen can be in a folded state.

[0083] Therefore, in the embodiment of the present application, the value range of the preset angle threshold P1 may be (0, 80°], and the value range of the preset angle threshold P2 may be [100°, 180°]. For example, the preset angle threshold P1 may be 75°, and the preset angle threshold P2 may be 105°. The above examples are only used to explain the present application and should not be construed as limiting.

[0084] In some embodiments, when the electronic device 100 is in Figure 1A In the folded state shown, the electronic device 100 can use the display area A1 to display the application window. Figure 1A The folded state shown Figure 1C The electronic device 100 can switch the display area used to display the application window when the unfolded state changes. The electronic device 100 can turn off the display area A1 and use the folding screen (i.e., display area A2 and display area A3) to display the application window. Figure 1C The unfolded state shown Figure 1A As shown in the folding state change, the electronic device 100 can switch the display area used to display the application window. Among them, the electronic device 100 can turn off the folding screen and use the display area A1 to display the application window.

[0085] Since the display screen and the folding screen corresponding to the display area A1 are independent screens, the electronic device 100 can independently control the display screen and the folding screen corresponding to the display area A1. Among them, when the electronic device 100 changes from the folded state to the unfolded state, the electronic device 100 can power off the display screen corresponding to the display area A1 and power on the folding screen. When the electronic device 100 changes from the unfolded state to the folded state, the electronic device 100 can power on the display screen corresponding to the display area A1 and power off the folding screen. In some embodiments, if the display screen and the folding screen corresponding to the display area A1 are both liquid crystal displays or other displays that require a backlight source, the electronic device 100 can also light up the backlight source of the target screen when controlling the target screen to power on; the electronic device 100 can also turn off the backlight source of the target screen when controlling the target screen to power off.

[0086] In some embodiments, the electronic device 100 can switch the display area when the opening and closing state of the folding screen changes. For example, the electronic device 100 can determine whether the opening and closing angle of the folding screen changes to a preset angle interval when the opening and closing state of the folding screen changes to determine whether to switch the display area. For example, when the electronic device 100 changes from the folding state to the unfolding state (that is, the angle α gradually increases), the electronic device 100 can switch the display area used to display the application window from the display area A1 to the display area A2 and the display area A3 when the angle α changes to the angle interval 1 [10°, 180°]. Among them, the electronic device 100 can power off the display screen corresponding to the display area A1, and power on the display screens corresponding to the display areas A2 and A3. When the electronic device 100 changes from the unfolding state to the folding state (that is, the angle α gradually decreases), the electronic device 100 can switch the display area used to display the application window from the display area A2 and the display area A3 to the display area A1 when the angle α changes to the angle interval 2 [0°, 80°]. Among them, the electronic device 100 can power off the display screens corresponding to the display area A2 and the display area A3, and power on the display screen corresponding to the display area A1. The above-mentioned angle interval 1 can be called the angle interval that triggers the display area A2 and the display area A3 to turn on the screen. The above-mentioned angle interval 2 can be called the angle interval that triggers the display area A1 to turn on the screen. The specific values ​​of the above-mentioned angle interval 1 and angle interval 2 are only exemplary descriptions of the present application and should not constitute a limitation on the present application.

[0087] In some embodiments, the folding screen may be a complete screen of an integrated structure, which may be folded to form at least two display areas. For example, the folding screen may be a flexible folding screen. The flexible folding screen includes a folding edge made of a flexible material. Part or all of the flexible folding screen is made of a flexible material.

[0088] In some embodiments, the folding screen may be a multi-screen folding screen, which may be composed of multiple independent display screens. These multiple display screens may be connected in sequence through a folding axis. Each display screen may rotate around the folding axis connected thereto to achieve the folding of the multi-screen folding screen. For example, the folding screen may include a display screen corresponding to display area A2 and a display screen corresponding to display area A3. The electronic device 100 may independently control the display screen corresponding to display area A2 and the display screen corresponding to display area A3.

[0089] The following is an introduction to electronic devices with outward folding screens.

[0090] Figure 2A to Figure 2C The schematic diagram exemplarily shows some opening and closing states of the electronic device 101 with an external folding screen.

[0091] The folding screen of the electronic device 101 can be folded to form two display areas. The opening and closing states of the electronic device 101 can include a folded state, a stand state, and an unfolded state.

[0092] Figure 2A The folded state of the electronic device 101 is exemplarily shown. Figure 2B The electronic device 101 is shown in a stand state as an example. Figure 2C The unfolded state of the electronic device 101 is exemplarily shown. The process of the electronic device 101 changing from the folded state to the support state and then from the support state to the unfolded state can refer to the aforementioned Figure 1A to Figure 1C The electronic device 100 shown in the figure changes from a folded state to a stand state and then to an unfolded state.

[0093] The folding screen of the electronic device 101 can be folded along the folding edge to form a display area B1 and a display area B2. The electronic device 101 can determine the opening and closing state of the electronic device 101 by the angle β between the plane where the display area B1 is located and the plane where the display area B2 is located. For details, please refer to the introduction of the electronic device 100 determining the opening and closing state of the electronic device 100 by α. It will not be repeated here.

[0094] Unlike the above-mentioned electronic device 100 with an inner folding screen, the folding screen of the electronic device 101 is visible to the user whether the electronic device 101 is in a folded state, a stand state, or an unfolded state. Figure 2A In the folded state shown, the display area B1 and the display area B2 are opposite to each other. At this time, the electronic device 101 can use the display area B1 or the display area B2 to display the application window. Figure 2A The folded state shown Figure 2CThe electronic device 101 can adjust the display area used to display the application window. The electronic device 101 can use the display area B1 and the display area B2 to display the application window. That is, the electronic device 101 can use the folding screen as a whole to display the application window. Conversely, when the opening and closing state of the electronic device 101 is detected to be changed from Figure 2C The unfolded state shown is Figure 2A In the folded state shown, the electronic device 101 can adjust the display area used to display the application window. The electronic device 101 can turn off one of the display area B1 and the display area B2, and use the display area B1 or the display area B2 to display the application window.

[0095] In some embodiments, the electronic device 101 can switch the display area when the opening and closing state of the folding screen changes. For example, the electronic device 101 can determine whether the opening and closing angle of the folding screen changes to a preset angle interval when the opening and closing state of the folding screen changes to determine whether to switch the display area. For example, when the electronic device 101 changes from the folded state to the unfolded state (that is, the angle β gradually increases), the electronic device 101 can switch the display area used to display the application window from the display area B1 to the display area B1 and the display area B2 when the angle β changes to the angle interval 1 [10°, 180°]. When the electronic device 101 changes from the unfolded state to the folded state (that is, the angle β gradually decreases), the electronic device 101 can switch the display area used to display the application window from the display area B1 and the display area B2 to the display area B1 when the angle β changes to the angle interval 2 [0°, 80°].

[0096] In some embodiments, the folding screen of the electronic device 101 may be a complete screen with an integrated structure (such as a flexible folding screen). Then, whether in a folded state or an unfolded state, the folding screen corresponding to the display area B1 and the display area B2 may always be in a powered-on state. That is, when the electronic device 101 switches the display area for display as the opening and closing state changes, it is not necessary to perform power-on and / or power-off control operations on the display screen.

[0097] Among them, when the electronic device 101 is in a folded state, the electronic device 101 can use the display area B1 as the area for display, display the application window on the display area B1, and control the display area B2 to be black. No content may be displayed on the display area B2. The electronic device 101 can control the display area B2 to be black by displaying the pixels of the display area B2 as black. The embodiment of the present application does not limit the implementation method of the electronic device 101 controlling the display area B2 in the folding screen to be black. When the electronic device 101 is in an unfolded state, the electronic device 101 can display the display area B1 and the display area B2 as a whole, and display the application window on the display area B1 and the display area B2.

[0098] Optionally, when the folding screen of the electronic device 101 is a complete screen with an integrated structure, the electronic device 101 may also independently control the power on or off of the display screen corresponding to the display area B1, and may independently control the power on or off of the display screen corresponding to the display area B2. This embodiment of the application is not limited to this.

[0099] In some embodiments, the folding screen of the electronic device 101 may be a multi-screen folding screen. For example, the folding screen may include a display screen corresponding to the display area B1 and a display screen corresponding to the display area B2. The display screen corresponding to the display area B1 and the display screen corresponding to the display area B2 may be independent screens. Among them, when the electronic device 101 changes from the folded state to the unfolded state, the electronic device 101 may keep the display screen corresponding to the display area B1 powered on, and power on the display screen corresponding to the display area B2. When the electronic device 101 changes from the unfolded state to the folded state, the electronic device 101 may keep the display screen corresponding to the display area B1 powered on, and power off the display screen corresponding to the display area B2. In some embodiments, if the display screen corresponding to the display area B1 and the display screen corresponding to the display area B2 are both liquid crystal display screens or other display screens that require backlight sources, the electronic device 101 may also light up the backlight source of the target screen when controlling the target screen to power on; the electronic device 101 may also turn off the backlight source of the target screen when controlling the target screen to power off.

[0100] The folding screen devices such as the electronic device 100 and the electronic device 101 can switch the display area for display according to the change of the opening and closing state of the folding screen. This application does not limit the display area switched after the opening and closing state of the folding screen changes.

[0101] Among them, the folding screen device needs to display the application window displayed before the switching display area in the display area after switching. Since the size of the display area after switching is often different from the size of the display area used before the folding screen opens and closes, the folding screen device needs to redraw the application window to ensure that the application window is adapted to the display area after switching.

[0102] The following describes a method for displaying a window on a folding screen device when the folding screen opens and closes.

[0103] In the subsequent embodiments of this application, the above Figure 1A to Figure 1C The electronic device 100 shown is taken as an example to introduce the window display method of the present application.

[0104] Figure 3 A flowchart of a window display method is exemplarily shown.

[0105] like Figure 3 As shown, the method may include steps S311 to S315. Among them:

[0106] S311 . The electronic device 100 displays a window of APP1 on the display screen 1 . The display screen 1 includes a display area A1 .

[0107] The display screen 1 may be the aforementioned Figure 1A The screen corresponding to the display area A1 is shown. APP1 can be any application in the electronic device 100, such as a browser application, a video application, etc.

[0108] The electronic device 100 is in the aforementioned state when the folding screen is opened and closed. Figure 1A In the folded state shown, the window of APP1 can be displayed on the display screen 1. In the case where the window of APP1 is displayed on the display screen 1, the window of APP1 can be a visible window. That is, the user can view the window of APP1 on the display screen 1. Not limited to the window of APP1, the electronic device 100 can also display windows of more applications on the display screen 1.

[0109] In some embodiments, other APP windows may be displayed floating above the APP1 window. The windows of the other APPs may partially cover the APP1 window. The APP1 window and the windows of other APPs floating above it are both visible windows, that is, visible to the user.

[0110] In some embodiments, the window of APP1 may be displayed above the windows of other APPs, partially covering the windows of other APPs. At this time, the window of APP1 and the windows of other APPs displayed below the window of APP1 are both visible windows, that is, they are visible to the user.

[0111] In some embodiments, the electronic device 100 can display the display screen 1 in a split screen. For example, the display screen 1 may include two display areas, one of which may display a window of APP1, and the other display area may display windows of other APPs. The window of APP1 and the windows of other APPs displayed do not block each other. At this time, the window of the APP displayed in split screen on the display screen 1 and the windows of other APPs are both visible windows, that is, they are visible to the user.

[0112] The embodiment of the present application does not limit the method by which the electronic device 100 displays multiple visible windows on the display screen 1 .

[0113] In some embodiments, in addition to the above-mentioned windows visible on the display screen 1, the electronic device 100 also includes one or more invisible windows. An invisible window may refer to a window that is currently invisible on the display screen 1. An application associated with an invisible window may be running in the background of the electronic device 100. For example, before the electronic device 100 displays the window of APP1 on the display screen 1, the window displayed on the display screen 1 may be a window of APP2. Among them, the window of APP2 may be a visible window. In response to the operation of calling out the window of APP1, the electronic device 100 may switch the window displayed on the display screen 1 from the window of APP2 to the window of APP1. Among them, the electronic device 100 may call APP2 to run in the background without closing APP2 for the time being. The window of APP2 changes from a visible window to an invisible window. The electronic device 100 may save the display content on the window of APP2 when switching to the window of APP1. In this way, the window of APP2 can be quickly displayed on the display screen 1 when the user needs to call out the window of APP2 again.

[0114] S312, the electronic device 100 detects that the opening and closing state of the folding screen has changed and the display area switching condition has been met.

[0115] The electronic device 100 can detect whether the folding screen opening and closing state has changed, and whether the opening and closing state has reached the display area switching condition. When the opening and closing state reaches the display area switching condition, the electronic device 100 can switch the display area for displaying the window, and redraw the application window according to the switched display area.

[0116] The display area switching condition may include condition 1 for judging to switch the display area A1 to the display area A2 and the display area A3 , and condition 2 for judging to switch the display area A2 and the display area A3 to the display area A1 .

[0117] The above condition 1 may be that the opening and closing state of the folding screen is changing to the unfolded state, and the user is more likely to use the display area A2 and the display area A3 as a whole, then the electronic device 100 may switch the display area to the display area A2 and the display area A3. The above condition 2 may be that the opening and closing state of the folding screen is changing to the folded state, and the user is more likely to use the display area A1 alone, then the electronic device 100 may switch the display area to the display area A1.

[0118] In some embodiments, the electronic device 100 can detect the opening and closing state of the folding screen by means of a magnetic sensor such as a Hall sensor. Among them, of the two screens formed by the folding screen, a Hall sensor may be provided on one screen, and a magnet may be provided on the other screen. When the folding screen is gradually unfolded, the opening and closing state gradually changes from the folded state to the unfolded state, and the distance between the Hall sensor and the magnet gradually increases. The magnetic flux detected by the Hall sensor gradually decreases. When the folding screen is gradually folded, the opening and closing state changes from the unfolded state to the folded state, and the distance between the Hall sensor and the magnet gradually decreases. The magnetic flux detected by the Hall sensor gradually increases.

[0119] The above condition 1 may be that the magnetic flux detected by the Hall sensor decreases. That is to say, when the magnetic flux detected by the electronic device 100 decreases, the electronic device 100 can start switching the display area. This is conducive to completing the operations to be performed for switching the display area (such as redrawing the window, etc.) before the folding screen is fully unfolded, so that the user can quickly view the application interface through the switched display area after the folding screen is fully unfolded.

[0120] The above condition 2 may be that the magnetic flux detected by the Hall sensor increases. That is, when the magnetic flux detected by the electronic device 100 increases, the electronic device 100 may start to switch the display area. This is conducive to completing the operation to be performed for switching the display area before the folding screen is fully folded, so that the user can quickly view the application interface through the switched display area after the folding screen is fully folded.

[0121] Optionally, the above condition 1 may be that the magnetic flux detected by the Hall sensor decreases, and the magnetic flux is less than the magnetic flux threshold 1. The above condition 2 may be that the Hall sensor detects an increase in magnetic flux, and the magnetic flux is greater than the magnetic flux threshold 2. Magnetic flux threshold 1 and magnetic flux threshold 2 may be preset. The embodiment of the present application does not limit the values ​​of magnetic flux threshold 1 and magnetic flux threshold 2. It can be understood that the magnitude of the above magnetic flux can reflect the degree of folding (or unfolding degree, the higher the folding degree, the lower the unfolding degree) of the folding screen. Among them, the larger the magnetic flux, the higher the degree of folding of the folding screen, and the closer the folding screen is to a fully folded form (that is, the angle α between the plane where the display area A2 is located and the plane where the display area A3 is located is 0°). Conversely, the smaller the magnetic flux, the lower the degree of folding of the folding screen, and the closer the folding screen is to a fully unfolded form (that is, α is 180°). By judging whether the magnetic flux is less than the magnetic flux threshold 1, it can be more accurately judged whether the user wants to change the folding screen to an unfolded state. By judging whether the magnetic flux is greater than the magnetic flux threshold 2, it is possible to more accurately judge whether the user wants to change the folding screen to a folded state.

[0122] In some embodiments, the electronic device 100 may also detect the opening and closing state of the folding screen through an angle sensor. The angle sensor may be used to detect the opening and closing angle of the folding screen, that is, the angle α between the plane where the display area A2 is located and the plane where the display area A3 is located.

[0123] For example, the above condition 1 may be that the angle α is increasing and is greater than the angle threshold 1. The above condition 2 may be that the angle α is decreasing and is less than the angle threshold 2. The values ​​of the above angle threshold 1 and the angle threshold 2 may be greater than 0° and less than 180°. The above angle threshold 1 and the angle threshold 2 may be preset. The embodiment of the present application does not limit the specific values ​​of the angle threshold 1 and the angle threshold 2. That is to say, when the angle sensor determines that the angle α is greater than the angle threshold 1, the electronic device 100 may switch the display area to display area A2 and display area A3. When the angle sensor determines that the angle α is less than the angle threshold 2, the electronic device 100 may switch the display area to display A1.

[0124] Optionally, the above condition 1 may also be that the angle α increases and changes to angle interval 1. The above condition 2 may also be that the angle α decreases and changes to angle interval 2. For example, angle interval 1 may be [10°, 180°]. Angle interval 2 may be [0°, 80°]. The embodiment of the present application does not limit the specific values ​​of angle interval 1 and angle interval 2.

[0125] Optionally, the electronic device 100 may also detect the opening and closing state of the folding screen through other sensors (such as an acceleration sensor, a gyroscope sensor, etc.). The present application does not limit the specific content of the above display area switching conditions.

[0126] In some embodiments, the electronic device 100 may detect whether the resolution of the electronic device 100 has changed. When the resolution of the electronic device 100 changes, the electronic device 100 may also perform the following steps S313 and S314. Among them, the change in the opening and closing state of the folding screen and the reaching of the display area switching condition can trigger the resolution change of the electronic device 100. In addition, if the electronic device 100 receives a user operation for changing the resolution while the opening and closing state of the folding screen remains unchanged, the electronic device 100 may also change the resolution. For example, the electronic device 100 may display a control for switching the display area or a control for setting the resolution on the screen. In this way, the user can switch the display area and change the resolution of the electronic device 100 without changing the opening and closing state of the folding screen by operating the control for switching the display area or the control for setting the resolution. In other words, the above step S312 can also detect the change in the resolution of the electronic device 100 for the electronic device 100.

[0127] Here, the electronic device 100 is described as follows: the folding screen of the electronic device 100 changes from the folded state to the unfolded state, and the electronic device 100 detects that the folding screen opening and closing state satisfies the above condition 1. The electronic device 100 may determine that the display area for display is the above Figure 1A The display area A1 shown is switched to Figure 1C Display area A2 and display area A3 are shown.

[0128] S313: The electronic device 100 freezes the windows, and after redrawing all the windows, unfreezes the windows.

[0129] Window freezing can be an operation for all windows in the electronic device 100. When the window is frozen, all windows in the electronic device 100 can stop responding to any operation (such as click operation, touch operation, long press operation, etc.) on the display screen, and the electronic device 100 can suspend drawing all windows. Among them, the above-mentioned stop responding to any operation on the display screen can prevent the user from accidentally touching the screen when the opening and closing state of the folding screen of the electronic device 100 changes. In addition, the window displayed on the display screen of the electronic device 100 can be displayed frame by frame. For example, the electronic device 100 refreshes the content displayed on the display screen at a rate of 30 frames per second or 60 frames per second. When the display area needs to be switched, the electronic device 100 can naturally no longer draw the window according to the display area before the switch. Therefore, the electronic device 100 can suspend drawing all windows. When the display area after the switch is determined, the electronic device 100 can redraw all windows according to the display area after the switch.

[0130] For example, when detecting that the folding screen is opened and closed and then expanded, the electronic device 100 can determine that the display area after the switch is display area A2 and display area A3. The electronic device 100 can redraw all windows according to display area A2 and display area A3, so that all redrawn windows are adapted to display area A2 and display area A3.

[0131] It should be noted that the condition for the electronic device 100 to unfreeze the window may be to redraw all windows. Among them, when the window is unfrozen, the electronic device 100 can respond to the operation on the display screen and provide corresponding services according to the location of the operation and the window currently displayed on the display screen. Since the user may call out an invisible window and change the invisible window into a visible window after adjusting the opening and closing state of the folding screen, the electronic device 100 can redraw all windows before unfreezing the window, so that all windows displayed after switching the display area can adapt to the switched display area.

[0132] S314 , the electronic device 100 powers off the display screen 1 and powers on the display screen 2 , where the display screen 2 includes a display area A2 and a display area A3 .

[0133] By the aforementioned Figure 1A to Figure 1C It can be seen that the display screen 1 corresponding to the display area A1 and the display screen 2 corresponding to the display area A1 and the display area A2 are independent of each other. That is, the display screens corresponding to the display areas before and after the switch are independent of each other. The above-mentioned display screen 2 is the folding screen of the electronic device 100. Before switching the display area, the electronic device 100 uses the display screen 1 to display the application window, the display screen 1 can be in a powered-on state, and the display screen 2 can be in a powered-off state. When it is necessary to switch the display area to the display area A2 and the display area A3, the electronic device 100 can power off the display screen 1 and power on the display screen 2, so that the application window can be displayed using the display screen 2.

[0134] Among them, the electronic device 100 can only power on the display screen that needs to be used. The screen that is not needed can be in a power-off state. This can save power consumption of the electronic device 100.

[0135] It should be noted that powering on a display screen (such as display screen 1, display screen 2, etc.) can mean that the display screen can be lit. However, after the display screen is powered on, the display screen may not be lit immediately, and the display screen may still be in a black screen state. For example, due to reasons such as the application window that needs to be displayed has not been drawn, the electronic device 100 cannot know how the pixels on the display screen should be displayed. Then, the electronic device 100 can continue to keep the display screen in a black screen state after the screen is powered on, and after the application window that needs to be displayed is drawn, control the display screen to emit light to display the corresponding application window. In other words, powering on the display screen is not equivalent to lighting up the display screen.

[0136] Step S314 and step S313 may be performed simultaneously by the electronic device 100. Optionally, the electronic device 100 may also perform step S313 first and then perform step S314, or perform step S314 first and then perform step S313.

[0137] S315 . The electronic device 100 displays the redrawn window of APP1 on the display screen 2 .

[0138] When the above steps S314 and S315 are completed, the electronic device 100 can display the redrawn window of APP1 on the display screen 2.

[0139] In some embodiments, the display screen 1 and the display screen 2 are display screens that require backlights, such as liquid crystal display screens. In addition to powering off the display screen 1 and powering on the display screen 2, the electronic device 100 can also turn off the backlight of the display screen 1 and light up the backlight of the display screen 2. Then, the electronic device 100 can display the redrawn APP1 window on the display screen 2 by controlling the display screen 2 and its backlight.

[0140] In some embodiments, the display screen 1 and the display screen 2 are display screens that do not require a backlight source, such as an organic light-emitting diode (OLED) display screen. The electronic device 100 can display the redrawn APP1 window on the display screen 2 by controlling the display screen 2 to emit light.

[0141] In some embodiments, if other visible windows are displayed on the display area A1 before switching, the electronic device 100 may also display the redrawn other visible windows on the display screen 2 .

[0142] It should be noted that the above step S314 is optional. In some embodiments, all display screens of the electronic device 100 (such as display screen 1 and display screen 2) can always be in a powered-on state. In this way, when switching the display area, the electronic device 100 does not need to power on or off the display screen. Since the display screen 2 is always in a powered-on state, the electronic device 100 can directly execute step S315 after executing the above step S313. Among them, the electronic device 100 can make the display screen 1 in the powered-on state black.

[0143] Above Figure 3 The method flow chart shown in the figure exemplifies a method for the electronic device 100 to switch the display area to display the application window when the folding screen of the electronic device 100 changes from the folded state to the unfolded state. The method for the electronic device 100 to switch the display area to display the application window when the folding screen of the electronic device 100 changes from the unfolded state to the folded state can be referred to Figure 3 The method shown. The electronic device 100 switches the display area for display to the display area A1. The electronic device 100 can redraw all windows according to the display area A1 so that the redrawn windows are adapted to the display area A1. Then, the electronic device 100 can control the display screen 1 to display the redrawn windows on the display area A1.

[0144] The method for switching the display area to display the application window when the folding screen opening and closing state of the electronic device 101 with an outer folding screen changes can refer to the method for displaying the application window of the electronic device 100 with an inner folding screen. Different from the electronic device 100, when the folding screen opening and closing state of the electronic device 101 changes from the folded state to the unfolded state, the display area can be switched from Figure 2A The display area B1 shown is switched to display area B1 and display area B2. When the folding screen opening and closing state of the electronic device 101 changes from the unfolded state to the folded state, the display area can be changed from display area B1 and display area B2 to display area B1.

[0145] That is to say, the folding screen device can switch the display area used for display when the folding screen is opened and closed. The size of the display area before the switch is different from the size of the display area after the switch. Among them, the display area before the switch and the display area after the switch can be two completely different display areas, or they can be two display areas that have an inclusion relationship.

[0146] By the above Figure 3 It can be seen from the method shown that in the process of switching the display area, regardless of whether the window is visible or not, the electronic device 100 needs to redraw all windows before lighting up the screen for display. When there are many windows (especially many invisible windows) in the electronic device 100, it takes a long time for the electronic device 100 to complete the redrawing of all windows. In addition, there may be many processes running in the electronic device 100. The resources required by the electronic device 100 in the process of redrawing the window, such as the central processing unit (CPU), etc., may be preempted by other processes. This will also increase the time required to redraw the window. Therefore, the speed at which the switched display screen lights up and displays related content is slow. After the user adjusts the opening and closing state of the folding screen, it takes a long time to see the switched display screen light up and display related content.

[0147] The present application provides a window display method, which can improve the speed of displaying windows in a switched display area when the size of the display area changes, and reduce the waiting time for users to wait for windows to be displayed in the switched display area in a display area switching scenario.

[0148] In some embodiments, when it is detected that the change in the opening and closing state of the folding screen reaches the area switching condition, the electronic device 100 can freeze one or more processes according to the preset process freezing rules. The frozen process can be temporarily stopped. The electronic device 100 can also freeze the window, and thaw the window after redrawing all windows, and finally display the redrawn window in the switched display area. Among them, the electronic device 100 can freeze the above one or more processes for a preset period of time and then thaw them. This application does not limit the value of the preset time length for freezing the above processes. For example, the value of the preset time length can be 1 second, 1.5 seconds, etc.

[0149] In the above embodiment, when the electronic device 100 needs to switch the display area to redraw the window, it can reduce the competition for resources required for the operation of processes such as the CPU by freezing some processes. This can reduce the situation where resources such as the CPU are preempted by other processes when the process for window redrawing is running, thereby reducing the time that the process for window redrawing needs to wait for using resources such as the CPU. The process for window redrawing can make full use of CPU resources. It can be seen that the above embodiment can improve the speed of window redrawing completion by freezing some processes when it is necessary to redraw the window. In this way, the application window can complete the adaptation with the display area after switching more quickly and be displayed on the display area after switching. The user can view the window that needs to be displayed in the display area after switching more quickly.

[0150] In some embodiments, the electronic device 100 can distinguish between visible windows and invisible windows. When it is detected that the folding screen opening and closing state changes to meet the area switching conditions, the electronic device 100 can freeze the window and redraw the visible window first. After the visible window is redrawn, the electronic device 100 can unfreeze the window and display the redrawn visible window in the switched display area. The electronic device 100 can redraw the invisible window after the window is unfrozen.

[0151] It can be understood that the above-mentioned visible window needs to be immediately presented in the switched display area after the display area is switched for the user to view. However, the invisible window is often not immediately displayed in the switched display area after the display area is switched. Therefore, the condition for unfreezing the window in the electronic device 100 can be set to redraw the visible window. The electronic device 100 can give priority to redrawing the visible window, and unfreeze the window after the visible window is redrawn, and then display it in the switched display area. In this way, the electronic device 100 does not need to wait for all windows to be redrawn before displaying the redrawn visible window in the switched display area. The above embodiment can reduce the window redrawing tasks that need to be performed before the switched display area is displayed. After detecting the display area switching condition, the electronic device 100 can display it in the switched display area more quickly. In this way, the user can view the window that needs to be displayed in the switched display area more quickly.

[0152] In some embodiments, the electronic device 100 can distinguish between visible windows and invisible windows. When it is detected that the change in the opening and closing state of the folding screen reaches the area switching condition, the electronic device 100 can freeze one or more processes according to the preset process freezing rules. The electronic device 100 can also freeze the window and give priority to redrawing the visible window. After the visible window is redrawn, the electronic device 100 can unfreeze the window and display the redrawn visible window in the switched display area. The electronic device 100 can redraw the invisible window after the window is unfrozen. In addition, the electronic device 100 can freeze the above one or more processes for a preset period of time and then unfreeze them.

[0153] The above embodiment can further improve the speed at which the electronic device 100 displays the redrawn visible window in the switched display area by combining the method of freezing the process with the method of redrawing the visible window first. The above embodiment can allow the electronic device 100 to display in the switched display area more quickly after detecting the display area switching condition.

[0154] In addition to electronic devices with folding screens, the window display method provided in the present application can also be applied to non-folding screen devices. Non-folding screen devices can also be called straight-panel machines and other names. In addition to the scene where the folding screen is opened and closed, the size of the display area used for display in the electronic device will change. In the scene where the electronic device switches between horizontal and vertical screens, and in the scene where the electronic device is set to a one-handed use mode (such as a left-handed use mode or a right-handed use mode), the size of the display area used for display by the electronic device will also change. It can be understood that in the scene where the electronic device switches between horizontal and vertical screens, although the display screen used by the electronic device is the same, the size of the display area used for display will change. For example, when the electronic device is in a vertical screen state, the size of the display area is a1*b1. After the electronic device switches from a vertical screen to a horizontal screen, the size of the display area can be changed to b1*a1. The electronic device can redraw the window according to the size of the display area after switching to a horizontal screen, so that the redrawn window is adapted to the display area of ​​the horizontal screen state of the electronic device. In the scene where the electronic device is set to a one-handed use mode, although the display screen used by the electronic device is the same, the size of the display area used for display will change. For example, in a non-one-handed use mode, the electronic device can use the entire display screen for display. At this time, the size of the display area can be a1*b1. After setting the electronic device to the one-handed use mode, the electronic device can use a portion of the entire display screen (such as a portion of the lower left corner or the lower right corner) for display. At this time, the size of the display area can be changed to (3 / 4)*a1*(3 / 4)*b1. The electronic device can redraw the window according to the size of the display area in the one-handed use mode, so that the redrawn window is adapted to the display area of ​​the electronic device in the one-handed use mode.

[0155] Therefore, the window display method provided by the present application can be applied to multiple scenarios of switching display areas. The size of the display area before switching is different from the size of the display area after switching. The display area before switching and the display area after switching can be two completely different display areas (for example, Figure 1A The display area A1 shown is switched to Figure 1C The display area A2 and the display area A3 shown in FIG. 1 ) may be two display areas that have a containing relationship (for example, Figure 2A The display area B1 shown is switched to display area B1 and display area B2, and the display area corresponding to the entire display screen in the non-one-handed use mode is switched to the display area corresponding to the part of the display screen in the one-handed use mode), or it can be two display areas that are in a horizontal and vertical screen relationship with each other (for example, the display area corresponding to the display screen in the vertical screen state is switched to the display area corresponding to the display screen in the horizontal screen state).

[0156] It should be noted that the size of the display area used for display in the electronic device can represent the resolution of the electronic device. The change in the size of the display area in the electronic device can represent the change in the resolution of the electronic device. In some embodiments, the electronic device can change the resolution according to the change in the device state of the electronic device. For example, the electronic device can change the resolution in a scene where the folding screen opens and closes, or in a scene where the horizontal screen and the vertical screen are switched, or in a scene where the one-handed mode is set. Optionally, the electronic device can also change the resolution in response to a user operation for changing the resolution. For example, in an electronic device 100 with a folding screen, the electronic device 100 can display a control for switching the display area on the screen. The user can operate the control for switching the display area to switch the display area and change the resolution of the electronic device 100 without changing the opening and closing state of the folding screen. For another example, the electronic device can also provide a control for setting the resolution. The user can change the resolution of the electronic device through the control for setting the resolution. The embodiment of the present application does not limit the method for triggering the electronic device to change the resolution. When the electronic device changes the resolution, the electronic device can redraw the window according to the resolution after the change, and display the redrawn window on the display area after the resolution change.

[0157] This application takes the case where the display area switches (i.e., the resolution changes) due to the change in the opening and closing state of the folding screen as an example to introduce the window display method provided by this application. It is understandable that when the display area switches due to operations such as switching between the horizontal and vertical screens of the electronic device and setting the electronic device to a one-handed use mode, the method for the electronic device to display a window on the switched display area can refer to the method for displaying a window when the display area switches due to the change in the opening and closing state of the folding screen. This application will not go into details one by one.

[0158] To facilitate understanding, some concepts involved in this application are first introduced here.

[0159] 1. Process.

[0160] A process can represent a program running in the system. It is an abstraction of a running program. Each running program can constitute a process. A process is the basic unit for resource allocation and scheduling in the operating system. Each process has its own independent address space and execution state.

[0161] For operating systems that support multiple processes, the CPU can run multiple processes alternately. Among them, the CPU can quickly switch from one process to another, during which each process runs for tens or hundreds of milliseconds. Although a single-core CPU only runs one process at a certain moment, the CPU can run multiple processes alternately within a period of time (such as within 1 second). Since the alternation speed between processes is relatively fast, the electronic device 100 can run multiple applications at the same time in the user's perception. For example, a user can use the electronic device 100 to listen to music while editing a document.

[0162] Since processes run alternately, a process is sometimes in the running state, and sometimes it is suspended for some reason and in the waiting state. When the reason that caused the process to be suspended disappears, the process can enter the ready-to-run state.

[0163] The states of a process during its activity may include: creation state, running state, ready state, blocked state, and end state.

[0164] The process creation state may indicate the state of the process being created.

[0165] The process is in the running state, which means that the process currently occupies the CPU and is running.

[0166] A process in the ready state can mean that the process is currently running, but it is temporarily stopped because other processes are running. That is, the process does not occupy the CPU when it is in the ready state.

[0167] The process is in a blocked state, which means that the process is waiting for the target event to occur (such as waiting for the input / output operation to complete, etc.) and temporarily stops running. At this time, even if the CPU control is given to the process, the process cannot run.

[0168] A process in the ending state may represent a state in which a process is disappearing from the system.

[0169] Among them, when the process is created and initialized, the state of the process can change from the creation state to the ready state. After the process in the ready state is selected by the process scheduler of the operating system, it can be assigned to the CPU to run. The process in the ready state changes from the ready state to the running state. When the process has been completed or an error occurs, it will be terminated by the operating system. The state of the process changes to the end state. During the running process of the running process, because the running time slice allocated to it has been used up, the operating system can change the state of the process to the ready state and select another process in the ready state to run. When the process in the running state requests an event and must wait, the state of the process can change to the blocked state. When the event that the process in the blocked state is waiting for is completed, the state of the process can change to the ready state.

[0170] In some embodiments, processes are divided according to priority, and the processes with the highest priority from the lowest can be: foreground process, visible process, service process, cache process, and empty process. Among them, the operating system can try to ensure that the high-priority process exists as long as possible. If resources (such as memory resources, etc.) are insufficient, in order to create new processes and ensure the operation of important processes, the operating system can end some low-priority processes and reclaim the memory occupied by the process.

[0171] The foreground process may include the process currently being displayed on the screen and some system processes. The foreground process may be a process that is interacting with the user. For example, window 1 is displayed on the display screen of the electronic device 100. Window 1 obtains the focus. The user can interact with the process corresponding to window 1 by operating window 1 (such as clicking on the controls in window 1, entering text in window 1, etc.). The process corresponding to window 1 is the foreground process. For another example, the display screen of the electronic device 100 also displays a status bar containing one or more elements such as a signal strength indicator, a battery level indicator, and time. The status bar may be displayed when the electronic device 100 runs a system process. The system process corresponding to the status bar is also a foreground process.

[0172] Visible processes may include processes whose program interfaces can be seen by the user but are not in the foreground and interacting with the user. For example, when window 1 is displayed on the display screen of the electronic device 100 and window 1 has focus, the electronic device 100 displays a new chat window on the display screen. The chat window is displayed above window 1 and partially covers window 1. At this time, the chat window has focus and window 1 loses focus. Although the user can still see window 1 on the display screen, the user will interact with the chat window but not with window 1. The process corresponding to window 1 is transformed from a foreground process to a visible process. The process corresponding to the above chat window is a foreground process. If the electronic device 100 receives an operation on window 1, the electronic device 100 can display window 1 above the above chat window. Window 1 regains focus. The process corresponding to window 1 is also transformed into a foreground process again.

[0173] A service process may include a process that has no user interface, does not interact directly with the user, but can run in the background. In some embodiments, a service process may refer to a process started by the startService() method. For example, a process that plays music in the background and a process that downloads in the background are service processes.

[0174] Background processes may include processes that are currently invisible to the user. In some embodiments, background processes may refer to processes corresponding to Activity components that have been stopped by calling the onStop() method but have not been destroyed by calling the onDestroy() method. For example, when window 1 is displayed on the display screen of the electronic device 100 and window 1 has focus, the electronic device 100 opens a new window 2. Window 1 is not closed. Window 2 is displayed on window 1 and completely blocks window 1. That is, after the electronic device 100 displays window 2, window 1 is invisible to the user. At this time, window 2 has focus and window 1 loses focus. The process corresponding to window 1 is transformed from a foreground process to a background process. The process corresponding to window 2 is a foreground process. For another example, when window 1 is displayed on the display screen of the electronic device 100 and window 1 has focus, the electronic device 100 receives an operation to return to the desktop main screen (such as the operation of clicking the Home button), and the electronic device 100 can display the desktop main screen. At this time, the process 1 corresponding to the above window is transformed from a foreground process to a background process.

[0175] An empty process may refer to a process in which no program is running. An empty process may generally be used to cache data to shorten the startup time required for the application to which the empty process belongs to run the program in the empty process next time.

[0176] From the above process types, it can be seen that the process corresponding to the visible window in the electronic device 100 may be a foreground process or a visible process. The difference between whether the process corresponding to the visible window is a foreground process or a visible process lies in whether the visible window is currently interacting with the user (that is, whether the visible window has the focus). The process corresponding to the invisible window in the electronic device 100 is usually a background process.

[0177] 2. Process freezing and process thawing.

[0178] Process freezing can mean that the process temporarily stops running. In some embodiments, the electronic device 100 can change the state of a process to a blocked state to freeze the process. During the frozen time period, the process will not be allocated to the CPU for running. In other words, the frozen process does not temporarily occupy resources such as the CPU. In this way, other unfrozen processes can have more time and opportunities to be run by the CPU.

[0179] Unfreezing a process may mean changing the state of a process to an executable state. In some embodiments, the electronic device 100 may change the state of a process from a blocked state to a ready state to unfreeze the process. After the process is unfrozen, the process may be assigned to a CPU to run.

[0180] 3. Redraw the window.

[0181] In the present application, since the size of the display area changes after the display area is switched, the electronic device needs to redraw the window so that the redrawn window can adapt to the display area after the switch.

[0182] Figure 4A to Figure 4F The following is a schematic diagram showing some window redrawing examples.

[0183] In some embodiments, when the display area after switching increases, in addition to the window displayed in the display area before switching, the electronic device 100 can also display a new window in the display area after switching. That is to say, after the electronic device 100 switches the display area, the newly added window is displayed on the display area after switching. Then, the window redrawing may include redrawing the window displayed before the display area is switched, and drawing the newly added window.

[0184] like Figure 4A As shown, the electronic device 100 can be used in the folded state Figure 1A The display area A1 shown displays a user interface 410. The user interface 410 may include a status bar 411 and a window 412. The status bar 411 may include elements such as a signal strength indicator, a battery level indicator, and a time. The status bar 411 may be a window provided by a system application. The window 412 may be a window of a browser application. The present application does not limit the application to which the window 412 belongs and the specific content in the window 412.

[0185] When the electronic device 100 changes from the folded state to the unfolded state, the electronic device 100 can use the aforementioned Figure 1C The display area A2 and the display area A3 shown in FIG. Figure 4B The user interface 420 shown. The user interface 420 may be a size comparison of the display area A2 and the display area A3 of the electronic device 100. Figure 4A The windows (such as status bar 411 and window 412) included in the user interface 410 are redrawn. For example, the user interface 420 may include a status bar 421, a window 422, and a window 423. Among them, the status bar 421 may be composed of Figure 4A The status bar 411 shown is redrawn. Window 423 can be Figure 4A Window 422 is a window newly added to user interface 420 compared to user interface 410. Window 422 may be the parent window of window 423 in the browser application. A window (i.e., the parent window) being the parent window of another window (i.e., the subordinate window) may indicate that the subordinate window can be called from the parent window and the parent window can be returned from the subordinate window. Figure 4BAs shown, window 422 may include news 1 control 422A. News 1 control 422A may be used to call out window 423. The folding screen of electronic device 100 may be divided into two display areas along the folding edge, which are used to display window 422 and window 423 respectively.

[0186] In some embodiments, In an application, a window can be implemented by an activity. FIG. 4A to FIG. 4B During the window redrawing process shown in FIG. 1 , the electronic device 100 can redraw the status bar 411 and the window 412 based on the activity corresponding to the status bar 411 and the activity corresponding to the window 412, respectively, to obtain Figure 4B In addition, the electronic device 100 can also create an activity corresponding to the window 422 to display the window 422 on the user interface 420. It should be noted that since the window 422 is the upper window of the window 423, the activity corresponding to the window 422 is displayed on the electronic device 100. Figure 4A The window 412 shown may have been created before and is not destroyed when the electronic device 100 displays the window 412. Therefore, the electronic device 100 can directly call the activity of the window 422 without recreating the activity.

[0187] It can be seen that when a new display window is needed after switching the display area, the new window can be the upper level window of the window displayed before switching the display area. The electronic device 100 can determine the display position of each window and the size and layout of the elements in each window according to the size of the display area after switching.

[0188] In some embodiments, when the display area after switching is reduced, the window displayed after the display area is switched may be a part of the window displayed before the display area is switched. Then, the window redrawing may include redrawing a part of the window displayed before the display area is switched, and removing another part of the window.

[0189] When the electronic device 100 switches the display area, a portion of the window can be removed by referring to Figure 4B The user interface 420 shown changes to Figure 4A The process of the user interface 410 shown. Figure 4BAs shown, the electronic device 100 can display the user interface 420 in the expanded state. When the electronic device 100 changes from the expanded state to the folded state, the electronic device 100 can redraw the status bar 421 and the window 423, and remove the window 422, and obtain and display the user interface 410. In some embodiments, when the window needs to be removed when switching the display area, the electronic device 100 can preferentially remove the window with the highest hierarchy among the windows displayed before the display area is switched.

[0190] In some embodiments, In an application, a window may be implemented by an activity. The electronic device 100 may destroy the activity corresponding to the window (such as window 422) that is removed from display, or may convert the activity state corresponding to the window that is removed from display to a stopped state.

[0191] In some embodiments, before and after the display area is switched, the window displayed by the electronic device 100 is the same, but the layout of elements in the window is changed. That is, there is neither an additional window nor a removed window in the display area after the switch. Then, the window redrawing may include redrawing the window displayed before the display area is switched according to the method of dynamic layout of display elements.

[0192] Among them, the dynamic layout of display elements may include but is not limited to: waterfall layout, relative stretch layout, relative zoom layout, etc. The waterfall layout may mean that according to the width of the display area, a single-column vertical layout is expanded into a two-column or multi-column vertical layout, or a two-column or multi-column vertical layout is changed into a single-column vertical layout. In the waterfall layout mode, the width of the elements in the window may change with the change of the width of the display area according to a preset width rule, and the electronic device 100 may automatically calculate the number of repeatable cards and arrange more elements horizontally when the conditions are met. The relative stretch layout may mean that the start and end positions of the elements in the window are determined according to a relative reference, the elements are stretched horizontally, and the display width of the elements is adjusted. In the relative stretch layout mode, the display width of the elements in the window may change with the change of the width of the display area. The relative zoom layout may mean that according to the relative reference, the width and / or height parameters of the elements in the window are determined, and the width and / or height of the elements are adjusted. In the relative zoom layout mode, the width and / or height of the elements in the window may be scaled according to a target ratio. The above-mentioned target ratio may be determined according to the size of the display area. The above-mentioned waterfall layout, relative stretch layout, and relative zoom layout may also be called other names. This application does not limit this.

[0193] Figure 4C and Figure 4D The schematic diagram exemplarily shows the electronic device 100 redrawing windows according to the waterfall layout.

[0194] like Figure 4C As shown, the electronic device 100 can be used in the folded state Figure 1A The display area A1 shown in the figure displays a user interface 430. The user interface 430 may include a window 431. The window 431 may be a window of a video application. When the electronic device 100 changes from the folded state to the unfolded state, the electronic device 100 may use the aforementioned Figure 1C The display area A2 and the display area A3 shown in FIG. Figure 4D The user interface 440 shown in FIG. 440 may include a window 441. The window 441 may be a window displayed by the electronic device 100 according to the size of the display area A2 and the display area A3. Figure 4C The window 431 shown is redrawn.

[0195] contrast Figure 4C and Figure 4D It can be seen that when the size of the display area increases after switching, the electronic device 100 can expand the original single-column vertical layout to a two-column vertical layout, and display each element in the two-column vertical layout from left to right and from top to bottom according to the size of the elements in the window.

[0196] On the contrary, if the electronic device 100 changes from the unfolded state to the folded state, the interface displayed by the electronic device 100 may be changed from Figure 4D The user interface 440 shown changes to Figure 4C User interface 430 is shown. When the size of the display area after switching is reduced, the electronic device 100 can change the original two-column vertical layout to a single-column vertical layout, and display the elements in the single-column vertical layout from top to bottom in sequence according to the size of the elements in the window.

[0197] Optionally, the dynamic layout of display elements may also include a layout for separately adjusting the video window when the window includes the video window.

[0198] Figure 4E and Figure 4F The schematic diagram exemplarily shows window redrawing in the scenario of switching between horizontal and vertical screens.

[0199] like Figure 4E As shown, the electronic device 100 can display a user interface 450 in the vertical screen state. The user interface 450 can include a window 451. The window 451 can be a window of a video application. The window 451 can display a video window 451A in which a video is being played. The window 451 can also display elements such as the video name, controls for controlling video playback, and comment controls. Figure 4E The vertical screen state changes shown are Figure 4F In the horizontal screen state shown, the electronic device 100 can display Figure 4FThe user interface 460 shown in FIG. 4 may include a window 461. The window 461 may be a window that the electronic device 100 displays according to the size of the display area in the horizontal screen state. Figure 4E The video window 451 shown is redrawn. It can be seen that when the electronic device 100 is switched to the horizontal screen state, the electronic device 100 can only redraw the video window 451A in the window 451 on the screen. Among them, the electronic device 100 can enlarge the video window 451A and display it as a window 461.

[0200] On the contrary, if the electronic device 100 switches from the horizontal screen state to the vertical screen state, the interface displayed by the electronic device 100 can be changed from Figure 4F The user interface 460 shown changes to Figure 4E The user interface 450 shown in FIG. 4 shows that the electronic device 100 can shrink the window 461 to display the video window 451 in the window 451 , and display the video name, controls for controlling video playback, comment controls, and other elements in the window 451 .

[0201] The embodiment of the present application does not limit the method for adapting the page layout of the elements in the window. After redrawing, the elements in the window can also use other page layouts to adapt to the display area after switching.

[0202] The above window redrawing method is only an exemplary description of the present application and should not be construed as limiting the present application. The electronic device 100 may also use other methods to redraw the window according to the switched display area.

[0203] The structure of the electronic device involved in this application is introduced below.

[0204] Please refer to Figure 5A , Figure 5A The schematic diagram of the hardware structure of the electronic device 100 is exemplarily shown.

[0205] like Figure 5A As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0206] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0207] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0208] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0209] The processor 110 may also be provided with a memory for storing instructions and data. In some examples, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0210] The USB interface 130 is an interface that complies with USB standard specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, or may be used to transmit data between the electronic device 100 and a peripheral device. It may also be used to connect headphones to play audio through the headphones.

[0211] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the electronic device through the power management module 141.

[0212] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.

[0213] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0214] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0215] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.

[0216] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0217] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.

[0218] The display screen 194 is used to display images, videos, etc. The display screen 194 may be a liquid crystal display screen, an OLED display screen, etc. The present application embodiment does not limit the material of the display screen 194. In some embodiments, the display screen 194 may also include a flexible folding screen. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0219] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0220] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, and the light signal is converted into an electrical signal. The camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.

[0221] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0222] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0223] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0224] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0225] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0226] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0227] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some examples, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.

[0228] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a gravity sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, an angle sensor, and the like.

[0229] Among them, the gyroscope sensor can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by a gyroscope sensor. The electronic device 100 can determine the offset angle of the electronic device 100 through a gyroscope sensor. In some embodiments, the electronic device 100 can detect the angle between the planes where two adjacent display areas are located formed by folding the folding screen through a gyroscope sensor. Among them, the display screen 194 of the electronic device 100 can be folded to form multiple display areas. Gyroscope sensors can be provided on the screens corresponding to these multiple display areas, which can be used to measure the orientation of the corresponding display area (i.e., the direction vector of the orientation). The electronic device 100 can determine the angle of the planes where the adjacent display areas are located based on the change in the orientation angle of each display area measured by the gyroscope sensor.

[0230] The acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes) of the electronic device 100. In some embodiments, the acceleration sensor can be used to identify the posture of the electronic device 100, and can be applied to applications such as horizontal and vertical screen switching and pedometers.

[0231] The magnetic sensor may include a Hall sensor, a magnetometer, etc. In some embodiments, the electronic device 100 may detect the opening and closing state of the folding screen through the magnetic sensor.

[0232] The angle sensor can be used to detect the angle between the planes where two adjacent display areas are located when the folding screen of the electronic device 100 is folded. In some embodiments, the angle sensor can be set at the folding part of the folding screen.

[0233] The buttons 190 include a power button, a volume button, etc. The motor 191 can generate a vibration prompt. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, messages, missed calls, notifications, etc.

[0234] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some examples, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0235] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 100 is exemplified.

[0236] Figure 5B The software structure block diagram of the electronic device 100 is exemplarily shown.

[0237] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. The system is divided into four layers, from top to bottom: application layer, application framework layer, Android Runtime and system library, and kernel layer.

[0238] The application layer can include a series of application packages.

[0239] like Figure 5B As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, short message, and other applications.

[0240] The application framework layer provides API and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0241] like Figure 5B As shown, the application framework layer may include a window management module, an activity management module, a process management module, a display management module, a sensor management module, a device status identification module, and the like.

[0242] The window management module can be used to manage windows in the electronic device 100. When an application has a window to display, the application can first register the window with the window management module. In response to the application's request to register a window, the window management module can create a window. The window management module can determine the properties of the window (such as window size, window display position, etc.), determine whether the window is a visible window, and freeze and unfreeze the window. In addition, the window management module can also update the properties of the window, redraw the window, and notify the upper-level application to adjust the properties of the elements in the window (such as element size, element display position, etc.). In some embodiments, the window management module can obtain the size of the display screen, determine whether there is a status bar, capture the screen, etc. The window management module can also be called a window management service (windowmanagerservice, WMS).

[0243] The activity management module can be used to manage activities, and is responsible for the startup, switching, scheduling, and destruction of various components in the system, as well as the management and scheduling of applications. The activity management module can be called by the upper-layer application to open the corresponding activity. A window of an application can be implemented by an activity. When a window needs to be created, the electronic device 100 can create the activity corresponding to the window through the activity management module. The activity can exist in multiple states in its life cycle: creation state, startup state, recovery state, pause state, stop state, and destruction state. Among them, the operating system can call corresponding methods to realize the switching of the activity between different states. The operating system can create an activity through the onCreate() method, and the activity enters the creation state. The operating system can prepare for the activity to enter the foreground and support user interaction through the onStart() method, and the activity enters the startup state. The operating system can use the onResume() method to get the focus of the activity, enter the foreground, and the activity enters the resume state. The operating system can use the onPause() method to pause the activity, and the activity enters the paused state. The operating system can use the onStop() method to stop the activity, and the activity enters the stopped state. The operating system can use the onDestroy() method to destroy the activity, and the activity enters the destruction state and is about to end. The activity corresponding to the window is in the resumed state, which means that the window is interacting with the user and the window is a visible window. The activity corresponding to the window is in the paused state, which means that the window is visible but not currently interacting with the user and the window is also a visible window. When the activity corresponding to the window is in the stopped state, the window is an invisible window.

[0244] The process management module can be used to manage processes in the electronic device 100. The process management module can create processes, allocate resources such as CPU time slices to processes, manage the status of processes, freeze processes, and unfreeze processes.

[0245] The sensor management module can be used to manage the data collected by the sensor. For example, the sensor management module can distinguish the types of sensors, effectively verify the data collected by the sensor, and report the data collected by the sensor to the device status identification module. The above-mentioned effective verification can filter out invalid data, erroneous data, etc. in the data collected by the sensor. Among them, the sensor management module can obtain data collected by one or more of the following sensors: data collected by the acceleration sensor, data collected by the gyroscope sensor, data collected by the magnetic sensor, data collected by the angle sensor, etc.

[0246] The device state identification module can be used to determine the state of the electronic device 100 based on the sensor data reported by the sensor management module. For example, the device state device module can determine the opening and closing state of the folding screen of the electronic device 100, and can also determine whether the electronic device 100 is in a horizontal screen state or a vertical screen state. The device state device module can report the state of the electronic device 100 to the display management module.

[0247] The display management module can be used to set the display area in the electronic device 100 according to the device state reported by the device state recognition module, and determine the size of the display area used. That is, the display management module can determine the resolution of the electronic device 100. For example, when the electronic device 100 is in a folded state, the display management module can set the aforementioned Figure 1A When the electronic device 100 is in the unfolded state, the display management module can set the aforementioned Figure 1C The display area A2 and the display area A2 shown are displayed. For another example, when the electronic device 100 is in a portrait state, the display management module can determine that the size of the display area used for display is the size of the display screen in the portrait state. When the electronic device 100 is in a landscape state, the display management module can determine that the size of the display area used for display is the size of the display screen in the landscape state. The display management module can send the display area used for display and the size of the display area to the window management module. In this way, the window management module can perform tasks such as window freezing and window redrawing when the display area is switched, so as to transfer the display content to the switched display area.

[0248] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system.

[0249] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0250] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0251] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0252] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0253] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0254] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0255] A 2D graphics engine is a drawing engine for 2D drawings.

[0256] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0257] The electronic device 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR)\virtual reality (VR) device, etc., including the above-mentioned folding screen device, and the embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100. The structures of other electronic devices involved in the present application, such as the electronic device 101, etc., can all refer to the structure of the above-mentioned electronic device 100.

[0258] Please refer to Figure 6 , Figure 6 The flowchart of a window display method provided by the present application is exemplified.

[0259] like Figure 6 As shown, the method may include steps S611 to S620. Among them:

[0260] 1. (S611-S612) Triggering the electronic device 100 to switch the display area.

[0261] S611. The electronic device 100 displays a window of APP1 on the display screen 1. The display screen 1 includes a display area A1.

[0262] S612: The electronic device 100 detects that the opening and closing state of the folding screen has changed and that a display area switching condition has been met.

[0263] Steps S611-S612 may refer to the aforementioned Figure 3 The description of steps S311-S312 is omitted here.

[0264] 2. (S613) The process is frozen.

[0265] S613: The electronic device 100 freezes one or more processes according to a preset process freezing rule.

[0266] When the folding screen opening and closing state changes to reach the display area switching condition, the electronic device 100 can freeze one or more processes. The above-mentioned process freezing rules can be used to filter out processes that can be frozen. Among them, the process freezing rules may include a program implemented for the judgment logic of the process. For example, the judgment logic for the process may include one or more of the following: judging whether the process is a background process, judging whether the process is a process that plays music in the background, judging whether the process is a process that casts the screen in the background, and so on. If a process is judged to be a background process, the electronic device 100 can freeze this process. If a process is a process that plays music or casts the screen in the background, this process may not be frozen. It can be understood that some processes (such as processes that play music or cast the screen in the background, etc.) are running in the background and are not visible to the user, but once these processes are frozen, they will affect the user's experience (such as pausing music and pausing the screen). The above-mentioned process freezing rules can prevent the electronic device 100 from freezing these processes. Optionally, the process freezing rules may include a process filter table. The process filter table may contain information on multiple processes that can be frozen. The electronic device 100 can filter out one or more processes from the currently created processes according to the process filter table, and then freeze the filtered processes. The embodiment of the present application does not limit the implementation of the above process freezing rule.

[0267] In some embodiments, when the folding screen remains in the open and closed state, if the electronic device 100 detects a user operation for changing the resolution, the electronic device 100 may also execute step S613. The embodiment of the present application does not limit the user operation for changing the resolution.

[0268] In some embodiments, the processes frozen by the electronic device 100 may all be background processes. Optionally, in addition to background processes, the processes frozen by the electronic device 100 may include other types of processes such as service processes. Among them, since both the foreground process and the visible process are associated with windows visible to the user, the above windows need to be redrawn by the electronic device 100 during the process of switching the display area. Therefore, the electronic device 100 may not need to freeze the foreground process and the visible process.

[0269] 3. (S614-S619) Window redrawing and display.

[0270] S614: The electronic device 100 freezes the window.

[0271] When the folding screen opening and closing state changes to meet the display area switching condition, the electronic device 100 can also freeze the window. The window freezing method can refer to the introduction of the above embodiment.

[0272] S615: The electronic device 100 determines whether any process associated with the window is frozen.

[0273] After the electronic device 100 freezes the windows, it needs to redraw all windows (including visible windows and invisible windows) first, then unfreeze the windows and display the redrawn windows in the switched display area. The frozen processes in the above step S613 may include processes associated with one or more invisible windows. Therefore, the electronic device 100 can determine whether any processes associated with the windows are frozen.

[0274] S616. The electronic device 100 unfreezes the process associated with the window.

[0275] If a process associated with a window is frozen, the electronic device 100 can unfreeze the process associated with the window through the process management module. Among them, other frozen processes that are not associated with a window can continue to remain frozen.

[0276] S617: After the electronic device 100 redraws all windows, it unfreezes the windows.

[0277] If no process associated with the window is frozen, or after the process associated with the window is unfrozen, the electronic device 100 can redraw all windows. In some embodiments, when a process associated with a window is frozen, the electronic device 100 can first redraw the windows associated with the unfrozen process (such as visible windows), and redraw the windows associated with the unfrozen process after the electronic device 100 executes step S616.

[0278] When the electronic device 100 completes redrawing of all windows, the electronic device 100 can unfreeze the windows. The method for unfreezing the windows can also refer to the introduction of the above embodiments.

[0279] S618: The electronic device 100 powers off the display screen 1 and powers on the display screen 2, where the display screen 2 includes the display area A2 and the display area A3.

[0280] S619 : The electronic device 100 displays the redrawn window of APP1 on the display screen 2 .

[0281] Steps S618-S619 can refer to the above Figure 3 An introduction to steps S314-S315 is shown.

[0282] It should be noted that the above step S618 is optional. In some embodiments, all display screens (such as display screen 1 and display screen 2) of the electronic device 100 can always be powered on. In this way, when switching the display area, the electronic device 100 does not need to power on or off the display screen.

[0283] In addition, freezing the window in step S614 and unfreezing the window in step S617 are optional. In some embodiments, when the folding screen opening and closing state changes to meet the display area switching condition, the electronic device 100 can directly execute steps S615 and S616, and after redrawing the window, execute step S619.

[0284] The embodiment of the present application does not limit the execution order of step S618 and steps S614-S617.

[0285] In some embodiments, the electronic device 100 may first execute step S613 and then execute steps S614 to S617. Alternatively, step S613 and step S614 may be executed simultaneously.

[0286] In some embodiments, the conditions for triggering the electronic device 100 to freeze the process may be different from the conditions for triggering the electronic device 100 to freeze the window and redraw the window (i.e., the display area switching condition). Among them, the conditions for triggering the electronic device 100 to freeze the process may be referred to as the process freezing condition. The process freezing condition may occur before the display area switching condition. This ensures that the electronic device 100 freezes the process before freezing and redrawing the window, thereby better releasing resources such as the CPU to the process used for window redrawing, thereby increasing the speed of window redrawing.

[0287] For example, the process freezing condition may include: the magnetic flux detected by the Hall sensor changes (such as the magnetic flux decreases or the magnetic flux increases). The display area switching condition may include: the magnetic flux detected by the Hall sensor changes to meet the preset magnetic flux threshold (such as the magnetic flux decreases and is less than the magnetic flux threshold 1, or the magnetic flux increases and is greater than the magnetic flux threshold 2). It can be seen that once the magnetic flux detected by the Hall sensor changes, the electronic device 100 can start freezing the process. When the magnetic flux detected by the Hall sensor changes to meet the preset magnetic flux threshold, the electronic device 100 can freeze the window and redraw the window.

[0288] The specific content of the above process freezing condition is not limited in the embodiment of the present application. For example, the above process freezing condition may also include a condition for determining whether to start freezing the process by the angle between the planes where the two display areas are located formed by folding the folding screen.

[0289] In some embodiments, when the folding screen remains in the open or closed state, if the electronic device 100 detects a user operation for changing the resolution, the electronic device 100 may also execute steps S614-S619.

[0290] 4. (S620) Unfreeze the process.

[0291] S620: The electronic device 100 unfreezes the frozen process.

[0292] The unfrozen process may be a process that remains frozen after the steps S615-S616.

[0293] The electronic device 100 may unfreeze the frozen process after the process is frozen for a preset time. The preset time for freezing the process may be longer than the time required for the electronic device 100 to complete the window redrawing. This can prevent the CPU and other resources from being occupied by other processes during the process of redrawing the window of the electronic device 100, resulting in the process for window redrawing having to wait for a long time before being allocated to the CPU to run to complete the window redrawing.

[0294] In some embodiments, the preset duration of the freezing process may not be fixed. The electronic device 100 may unfreeze the frozen process after completing the step S619.

[0295] The method for the electronic device 100 to switch the display area for display from the display area A2 and the display area A3 to the display area A1 can refer to the above Figure 6 The method shown in the figure will not be described here.

[0296] By the above Figure 6 It can be seen from the method shown that when the electronic device 100 needs to switch the display area to redraw the window, it can reduce the competition for resources required for the operation of processes such as the CPU by freezing some processes. This can reduce the situation where resources such as the CPU are preempted by other processes when the process used for window redrawing is running, thereby reducing the time that the process used for window redrawing needs to wait for using resources such as the CPU. The process used for window redrawing can make full use of CPU resources. It can be seen that the above embodiment can increase the speed of window redrawing completion by freezing some processes when it is necessary to redraw the window. In this way, the electronic device 100 can light up the display screen corresponding to the switched display area more quickly, and display the redrawn window on the switched display area. The user can view the transferred displayed window in the switched display area more quickly.

[0297] Please refer to Figure 7 , Figure 7 The flowchart of another window display method provided by the present application is exemplified.

[0298] like Figure 7 As shown, the method may include steps S711 to S718. Among them:

[0299] 1. (S711-S712) Triggering the electronic device 100 to switch the display area.

[0300] S711. The electronic device 100 displays a window of APP1 on the display screen 1. The display screen 1 includes a display area A1.

[0301] S712. The electronic device 100 detects that the opening and closing state of the folding screen has changed and that a display area switching condition has been met.

[0302] Steps S711-S712 can refer to the aforementioned Figure 3 The description of steps S311-S312 is omitted here.

[0303] 2. (S713-S716) The visible window is redrawn and displayed.

[0304] S713: The electronic device 100 freezes the window.

[0305] When the folding screen opening and closing state changes to meet the display area switching condition, the electronic device 100 can also freeze the window. The window freezing method can refer to the introduction of the above embodiment.

[0306] S714. The electronic device 100 finds visible windows, and unfreezes the windows after redrawing the visible windows. The visible windows include the window of APP1.

[0307] In some embodiments, the window management module in the electronic device 100 can store the properties of the window created in the electronic device 100. The properties of the window can include the visible state of the window. The window management module can determine whether the window is a visible window or an invisible window according to the value of the visible state.

[0308] The condition for unfreezing the window in the electronic device 100 can be set to: redrawing the visible window. Therefore, the electronic device 100 unfreezes the window after redrawing the visible window.

[0309] S715 . The electronic device 100 powers off the display screen 1 and powers on the display screen 2 . The display screen 2 includes a display area A2 and a display area A3 .

[0310] S716 . The electronic device 100 displays the redrawn visible window on the display screen 2 .

[0311] Steps S715-S716 can refer to the above Figure 3 An introduction to steps S314-S315 is shown.

[0312] It should be noted that the above step S715 is optional. In some embodiments, all display screens (such as display screen 1 and display screen 2) of the electronic device 100 can always be powered on. In this way, when switching the display area, the electronic device 100 does not need to power on or off the display screen.

[0313] In addition, freezing the window in step S713 and unfreezing the window in step S714 are optional. In some embodiments, when the folding screen opening and closing state changes to meet the display area switching condition, the electronic device 100 can directly redraw the visible window and execute step S717 after the visible window is redrawn.

[0314] The embodiment of the present application does not limit the execution order of step S715 and steps S713 - S714 .

[0315] In some embodiments, when the folding screen remains in the open or closed state, if the electronic device 100 detects a user operation for changing the resolution, the electronic device 100 may also execute steps S713-S716.

[0316] 3. (S717) The invisible window is redrawn.

[0317] S717: The electronic device 100 redraws the invisible windows, where the invisible windows include the window of APP2.

[0318] The electronic device 100 may redraw the invisible window after the window is unfrozen. In some embodiments, step S717 may be performed after step S716 is completed.

[0319] It is understandable that after the electronic device 100 switches the display area, the user may call out the invisible window. Therefore, the electronic device 100 can redraw the invisible window as soon as possible after the window is unfrozen, so that when the invisible window needs to be called out, the called out window can be displayed in time in the switched display area.

[0320] 4. (S718) Change the invisible window to a visible window.

[0321] S718 . The electronic device 100 receives the operation of calling out the window of APP2 , and displays the redrawn window of APP2 on the display screen 2 .

[0322] In response to the operation of calling up the window of APP2, the window of APP2 can obtain the focus. The electronic device 100 can display the window of APP2 redrawn by the above step S717 on the switched display area (that is, display screen 2). At this time, the window of APP2 changes from an invisible window to a visible window. On display screen 2, the window of APP2 can partially cover the window of APP1 mentioned above, and the window of APP1 can still be a visible window. Alternatively, the window of APP2 can completely cover the window of APP1, and the window of APP1 changes to an invisible window.

[0323] The method for the electronic device 100 to switch the display area for display from the display area A2 and the display area A3 to the display area A1 can refer to the above Figure 7 The method shown in the figure will not be described here.

[0324] By the above Figure 7As can be seen from the method shown, the electronic device 100 can give priority to redrawing the visible window, and unfreeze the window after the visible window is redrawn, and then display it in the switched display area. In this way, the electronic device 100 can display the redrawn visible window in the switched display area without waiting for all windows to be redrawn. It can be understood that the above-mentioned visible window needs to be immediately presented in the switched display area after the display area is switched for the user to view. However, the invisible window is often not immediately displayed in the switched display area after the display area is switched. The above method can reduce the window redrawing tasks that need to be performed before the switched display area is displayed, reduce the CPU load during the window redrawing process, and reduce the possibility of conflicts between processes. In this way, the electronic device 100 can light up the display screen corresponding to the switched display area more quickly after detecting the display area switching condition, and display the redrawn window on the switched display area. The user can view the window that needs to be displayed in the switched display area more quickly.

[0325] Please refer to Figure 8 , Figure 8 The flowchart of another window display method provided by the present application is exemplified.

[0326] like Figure 8 As shown, the method may include steps S811 to S821. Among them:

[0327] 1. (S811-S812) Triggering the electronic device 100 to switch the display area.

[0328] S811. The electronic device 100 displays a window of APP1 on the display screen 1. The display screen 1 includes a display area A1.

[0329] S812. The electronic device 100 detects that the opening and closing state of the folding screen has changed and that a display area switching condition has been met.

[0330] Steps S811-S812 can refer to the aforementioned Figure 3 The description of steps S311-S312 is omitted here.

[0331] 2. (S813) The process is frozen.

[0332] S813: The electronic device 100 freezes one or more processes according to a preset process freezing rule.

[0333] Step S813 can refer to the above Figure 6 The introduction of step S613 is shown.

[0334] In some embodiments, when the folding screen remains in the open or closed state, if the electronic device 100 detects a user operation for changing the resolution, the electronic device 100 may also execute step S813.

[0335] 3. (S814-S819) The visible window is redrawn and displayed.

[0336] S814: The electronic device 100 freezes the window.

[0337] S815. The electronic device 100 determines whether any process associated with the visible window is frozen.

[0338] S816. The electronic device 100 unfreezes the process associated with the visible window.

[0339] S817: After the electronic device 100 redraws all visible windows, it unfreezes the windows.

[0340] Steps S814-S817 can refer to the above Figure 6 The introduction of steps S614-S617 is shown. Different from the aforementioned steps S614-S617, the condition for the electronic device 100 to unfreeze the window can be: the visible window is redrawn. Therefore, the electronic device 100 only needs to determine whether the process associated with the visible window is frozen, without determining whether the process associated with the invisible window is frozen. If a process associated with a visible window is frozen, the electronic device 100 can unfreeze the process associated with the visible window through the process management module.

[0341] It should be noted that freezing the window in step S814 and unfreezing the window in step S817 are optional. In some embodiments, when the folding screen opening and closing state changes to meet the display area switching condition, the electronic device 100 can directly execute steps S815 and S816, and after redrawing the visible window, execute steps S819 and S820.

[0342] S818: The electronic device 100 powers off the display screen 1 and powers on the display screen 2, where the display screen 2 includes the display area A2 and the display area A3.

[0343] S819: The electronic device 100 displays the redrawn visible window on the display screen 2.

[0344] Steps S818-S819 can refer to the above Figure 3 An introduction to steps S314-S315 is shown.

[0345] In some embodiments, when the folding screen remains in the open or closed state, if the electronic device 100 detects a user operation for changing the resolution, the electronic device 100 may also execute steps S813-S819.

[0346] 4. (S820) The invisible window is redrawn.

[0347] S820: The electronic device 100 redraws the invisible window.

[0348] Step S820 can refer to the above Figure 7 The introduction of step S717 is shown.

[0349] 5. (S821) The process is unfrozen.

[0350] S821. The electronic device 100 unfreezes the frozen process.

[0351] Step S821 can refer to the above Figure 6 The introduction of step S620 is shown.

[0352] In some embodiments, the preset duration of the freezing process may not be fixed. The electronic device 100 may unfreeze the frozen process after completing the step S819.

[0353] In some embodiments, the process freezing rule in the above step S812 may also include: identifying and freezing the process associated with the invisible window. It is understandable that since only the visible window needs to be redrawn before the window is unfrozen, the electronic device 100 may freeze the process associated with the invisible window to prevent the process associated with the invisible window from occupying resources such as the CPU, thereby affecting the speed at which the electronic device 100 lights up the screen to display the redrawn window after the folding screen opens and closes.

[0354] The method for the electronic device 100 to switch the display area for display from the display area A2 and the display area A3 to the display area A1 can refer to the above Figure 8 The method shown in the figure will not be described here.

[0355] By the above Figure 8 It can be seen from the method shown that the electronic device 100 can improve the speed of the electronic device 100 displaying the redrawn visible window in the switched display area by combining the method of freezing the process with the method of redrawing the visible window first. The above method can not only reduce the competition for resources required for the operation of processes such as the CPU, so that the process used for window redrawing can have more time and opportunities to be run by the CPU, but also reduce the CPU load during the window redrawing process, so that the electronic device 100 can unfreeze the window as soon as possible and send the redrawn visible window to the switched display area. In this way, after detecting the display area switching condition, the electronic device 100 can light up the display screen corresponding to the switched display area more quickly and display the redrawn window on the switched display area. The user can view the window to be displayed in the switched display area more quickly.

[0356] In some embodiments, when an event for triggering the electronic device 100 to switch the display area (i.e., an event for triggering the electronic device 100 to change the resolution) is detected, the electronic device 100 may Figure 6 Steps S613 to S620 shown in FIG. Figure 7 Steps S713 to S718 shown in FIG. Figure 8 The display area is switched by following steps S813 to S821 shown in the figure, and the redrawn window is displayed on the switched display area. The layout of the redrawn window is adapted to the switched display area. Among them, the size of the display area before the switch may be different from the size of the display area after the switch. The events used to trigger the electronic device 100 to switch the display area may include but are not limited to: the opening and closing state of the folding screen of the electronic device 100 changes and the display area switching condition is met (refer to the aforementioned Figure 3 In step S312 shown in the figure), the electronic device 100 switches from the landscape state to the portrait state, the electronic device 100 switches from the portrait state to the landscape state, the electronic device 100 switches from the non-one-handed use mode to the one-handed use mode, and the electronic device 100 switches from the one-handed use mode to the non-one-handed use mode.

[0357] Please refer to Fig. 9 , Fig. 9 The flowchart of another window display method provided by an embodiment of the present application is exemplified.

[0358] like Fig. 9 As shown, the method may include steps S911 to S915. Among them:

[0359] S911. Display a first window in a first display area.

[0360] The electronic device has a first display area. In the case where the electronic device is a folding screen device, the first display area may be, for example, the aforementioned Figure 1A The display area A1 shown in the figure, or the display area A2 shown in the figure, or the display area A1 ... Figure 1B The display area A2 and the display area A3 shown in the figure are composed of the display area A2 and the display area A3, or the ... Figure 2A The display area B1 shown, or the aforementioned Figure 2A The display area B2 shown in the figure, or the ... Figure 2B The display area B1 and the display area B2 shown in the figure are composed of a display area. The electronic device may also be a non-folding screen device.

[0361] The first window may be, for example, the aforementioned Figure 4A The window 412 shown, or the aforementioned Figure 4B The window 423 shown, or the aforementioned Figure 4CThe window 431 shown, or the aforementioned Figure 4D The window 441 shown, or the aforementioned Figure 4E The window 451 shown, or the aforementioned Figure 4F The window 461 is shown. The present application does not limit the content of the first window.

[0362] S912: When the electronic device meets a first condition, the electronic device freezes one or more processes, where the first condition is a condition instructing the electronic device to switch a display area from a first display area to a second display area.

[0363] The electronic device satisfying the first condition may be that the resolution of the electronic device is changed.

[0364] In some embodiments, when the electronic device is a folding screen, the first condition may include a change in the opening and closing state of the folding screen and a condition for switching the display area. For details, please refer to the aforementioned Figure 3 Step S312 shown, or the aforementioned Figure 6 Step S612 shown, or the aforementioned Figure 7 Step S712 shown, or the aforementioned Figure 8 Step S812 shown. That is, the first condition may include: the electronic device changes from the folded state to the unfolded state, exemplarily, during the process of the electronic device changing from the folded state to the unfolded state, the first angle between the two screens formed by the folding screen of the electronic device may be within a first angle interval, for example, the first angle interval may be [10°, 180°]; or, the electronic device changes from the unfolded state to the folded state, exemplarily, during the process of the electronic device changing from the unfolded state to the folded state, the first angle between the two screens formed by the folding screen of the electronic device may be within a second angle interval, for example, the second angle interval may be [0°, 80°].

[0365] In some embodiments, the first condition may also include: the electronic device changes from a landscape state to a portrait state, or the electronic device changes from a portrait state to a landscape state, or the electronic device switches from a non-one-handed use mode to a one-handed use mode, or the electronic device switches from a one-handed use mode to a non-one-handed use mode.

[0366] The first condition may also include more conditions for triggering the electronic device to change the resolution. The embodiment of the present application does not limit the specific content of the first condition. For example, the electronic device provides a control for switching the display area and / or a control for setting the resolution. In response to a user operation on the control for switching the display area or the control for setting the resolution, the electronic device may also change the resolution.

[0367] The electronic device may have a second display area. The size of the second display area is different from the size of the first display area. The size of the display area used for display in the electronic device may indicate the resolution of the electronic device. When the electronic device switches the display area used for display from the first display area to the second display area, it may indicate that the electronic device changes the resolution.

[0368] For example, if the first display area is the aforementioned Figure 1A The display area A1 shown in the figure, the second display area can be the aforementioned Figure 1B Alternatively, if the first display area is composed of the display area A2 and the display area A3, Figure 1B The display area A2 and the display area A3 shown in the figure are composed of the display area, and the first display area can be the aforementioned Figure 1A Alternatively, if the first display area is the display area A1 Figure 2A The display area B1 shown in the figure, the second display area can be the aforementioned Figure 2B Alternatively, if the first display area is composed of the display area B1 and the display area B2 as shown in FIG. Figure 2B The display area B1 and the display area B2 shown in the figure are composed of the display area, and the second display area can be the aforementioned Figure 2A Display area B2 is shown.

[0369] The first display area and the second display area are two display areas at completely different positions, or the first display area and the second display area are two display areas that are in a containing relationship, or the first display area and the second display area are two display areas that are in a horizontal and vertical screen relationship with each other.

[0370] It can be seen that when the electronic device changes the resolution, the electronic device may freeze one or more processes.

[0371] The method for freezing one or more processes in an electronic device can refer to the aforementioned Figure 6 Step S613 shown, or refer to the aforementioned Figure 8 Step S813 shown.

[0372] S913: Redraw the first window according to the size of the second display area.

[0373] The method for implementing the electronic device to redraw the first window can refer to the aforementioned Figure 3 Step S313 shown, or the aforementioned Figure 6 Step S617 shown, or the aforementioned Figure 7 Step S714 shown, or the aforementioned Figure 8 Step S817 shown.

[0374] In some embodiments, when the electronic device switches the display area for display from the first display area to the second display area, the electronic device can power off the display screen corresponding to the first display area and power on the display screen corresponding to the second display area. Figure 3 Step S314 shown, or the aforementioned Figure 6 Step S618 shown, or the aforementioned Figure 7 Step S715 shown, or the aforementioned Figure 8 Step S818 shown.

[0375] S914: Display the redrawn first window in the second display area.

[0376] The method for implementing the electronic device to display the redrawn first window in the switched display area (ie, the second display area) can refer to the aforementioned Figure 3 Step S315 shown, or the aforementioned Figure 6 Step S619 shown, or the aforementioned Figure 7 Step S716 shown, or the aforementioned Figure 8 Step S819 shown.

[0377] S915: Unfreeze the one or more processes.

[0378] The implementation method of the electronic device thawing process can refer to the aforementioned Figure 6 Step S620 shown, or the aforementioned Figure 8 Step S821 shown.

[0379] By the above Fig. 9 It can be seen from the method shown that when the electronic device changes the resolution, it can reduce the competition for resources required for the operation of processes such as the CPU by freezing some processes. This can reduce the situation where resources such as the CPU are preempted by other processes when the process used for window redrawing is running, thereby reducing the time that the process used for window redrawing needs to wait for using resources such as the CPU. The process used for window redrawing can make full use of CPU resources. It can be seen that the above embodiment can increase the speed of window redrawing completion by freezing some processes when it is necessary to redraw the window. In this way, the electronic device 100 can light up the display screen corresponding to the display area after the resolution is changed more quickly, and display the redrawn window on the display area after the resolution is changed. The user can view the transferred window in the display area after the resolution is changed more quickly.

[0380] It is understandable that the various user interfaces described in the embodiments of the present application are only example interfaces and do not limit the present application scheme. In other embodiments, the user interface may adopt a different interface layout, may include more or fewer controls, and may increase or decrease other functional options, as long as they are based on the same inventive concept provided by the present application, they are all within the scope of protection of the present application.

[0381] It should be noted that, without causing any contradiction or conflict, any feature in any embodiment of the present application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of the present application.

[0382] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A window display method, characterized in that: The method is applied to an electronic device, the electronic device includes a first display area and a second display area, and the method includes: The electronic device displays a first window in the first display area; When the electronic device meets a first condition, the electronic device freezes one or more processes, wherein the first condition is a condition instructing the electronic device to switch a display area from the first display area to the second display area; The electronic device redraws the first window according to the size of the second display area; The electronic device displays the redrawn first window in the second display area; The electronic device unfreezes the one or more processes.

2. The method according to claim 1, characterized in that The electronic device unfreezes the one or more processes, specifically comprising: The electronic device unfreezes the one or more processes after the one or more processes are frozen for a first period of time; or, The electronic device unfreezes the one or more processes after redrawing one or more windows in the electronic device, wherein the one or more windows include the first window.

3. The method according to claim 1 or 2, characterized in that: The one or more processes are screened out according to a first rule, the types of the one or more processes include background processes, and the one or more processes do not include a process associated with the first window.

4. The method according to any one of claims 1 to 3, characterized in that There are K windows in the electronic device, where K is a positive integer; and the electronic device redraws the first window according to the size of the second display area, specifically including: The electronic device redraws one or more windows among the K windows according to a size of the second display area, the one or more windows including the first window.

5. The method according to claim 4, characterized in that Before the electronic device redraws one or more windows of the K windows according to the size of the second display area, the method further includes: The electronic device determines that the one or more frozen processes include a process associated with a second window among the one or more windows; The electronic device unfreezes the process associated with the second window.

6. The method according to any one of claims 1 to 3, characterized in that There are K windows in the electronic device, where K is a positive integer; before the electronic device displays the redrawn first window in the second display area, the method further includes: The electronic device distinguishes between visible windows and invisible windows in the K windows, the K windows are composed of K1 visible windows and K2 invisible windows, K1 and K2 are both positive integers, and the K1 visible window is displayed on the first display area; The electronic device redraws the first window according to the size of the second display area, specifically including: The electronic device redraws one or more visible windows among the K1 visible windows according to a size of the second display area, the one or more visible windows including the first window; The electronic device displays the redrawn first window in the second display area, specifically comprising: The electronic device displays the redrawn one or more visible windows in the second display area.

7. The method according to claim 6, characterized in that The method further comprises: After the redrawing of the one or more visible windows is completed, or after the second display area displays the redrawn one or more visible windows, the electronic device redraws one or more invisible windows among the K2 invisible windows.

8. The method according to any one of claims 1 to 7, characterized in that The first display area and the second display area are two display areas with completely different positions, or the first display area and the second display area are two display areas with an inclusion relationship, or the first display area and the second display area are two display areas with a horizontal and vertical screen relationship.

9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: The electronic device powers off the display screen corresponding to the first display area, and powers on the display area corresponding to the second display area.

10. The method according to any one of claims 1 to 9, characterized in that The first condition includes: a condition that triggers the electronic device to change the resolution.

11. The method according to any one of claims 1 to 9, characterized in that The first condition includes: the electronic device changes from a folded state to an unfolded state; or, the electronic device changes from an unfolded state to a folded state; or, the electronic device changes from a horizontal screen state to a vertical screen state; or, the electronic device changes from a vertical screen state to a horizontal screen state; or, the electronic device switches from a non-single-handed use mode to a one-handed use mode; or, the electronic device switches from a one-handed use mode to a non-single-handed use mode.

12. The method according to any one of claims 1 to 11, characterized in that The method further comprises: When the electronic device meets the first condition, the electronic device freezes the window; After the first window is redrawn, the electronic device unfreezes the window.

13. A window display method, characterized in that: The method is applied to an electronic device, the electronic device includes a first display area and a second display area, there are K windows in the electronic device, the K windows are composed of K1 visible windows and K2 invisible windows, K, K1 and K2 are all positive integers, and the method includes: The electronic device displays the K1 visible windows in the first display area; When the electronic device meets the first condition, the electronic device redraws one or more visible windows among the K1 visible windows according to the size of the second display area; The electronic device displays the redrawn one or more visible windows in the second display area.

14. The method according to claim 13, characterized in that The method further comprises: After the redrawing of the one or more visible windows is completed, or after the second display area displays the redrawn one or more visible windows, the electronic device redraws one or more invisible windows among the K2 invisible windows.

15. The method according to claim 13 or 14, characterized in that The first display area and the second display area are two display areas with completely different positions, or the first display area and the second display area are two display areas with an inclusion relationship, or the first display area and the second display area are two display areas with a horizontal and vertical screen relationship.

16. The method according to any one of claims 13 to 15, characterized in that The method further comprises: The electronic device powers off the display screen corresponding to the first display area, and powers on the display area corresponding to the second display area.

17. The method according to any one of claims 13 to 16, characterized in that The first condition includes: a condition that triggers the electronic device to change the resolution.

18. The method according to any one of claims 13 to 16, characterized in that: The first condition includes: the electronic device changes from a folded state to an unfolded state; or, the electronic device changes from an unfolded state to a folded state; or, the electronic device changes from a horizontal screen state to a vertical screen state; or, the electronic device changes from a vertical screen state to a horizontal screen state; or, the electronic device switches from a non-single-handed use mode to a one-handed use mode; or, the electronic device switches from a one-handed use mode to a non-single-handed use mode.

19. The method according to any one of claims 13 to 18, characterized in that: The method further comprises: When the electronic device meets the first condition, the electronic device freezes the window; After redrawing one or more visible windows among the K1 visible windows according to the size of the second display area, the electronic device unfreezes the windows.

20. An electronic device, characterized in that: The electronic device includes a display screen, a memory and a processor, wherein the display screen is used to display a window; the memory is used to store a computer program; and the processor is used to call the computer program so that the electronic device executes the method described in any one of claims 1-12 or 13-19.

21. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1-12 or 13-19.

22. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are run on an electronic device, the electronic device executes the method according to any one of claims 1 to 12 or 13 to 19.