Resource scheduling method, readable storage medium, program product and electronic equipment
By scheduling resources for image processing tasks when the foldable electronic device changes its open or closed state, the problem of interface lag is solved, ensuring that the image processing thread obtains resources in a timely manner, thereby improving the smoothness of the interface display and the user experience.
Patent Information
- Application Number
- CN202410954034.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2026-01-16
Smart Images

Figure CN121353050A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a resource scheduling method, a readable storage medium, a program product, and an electronic device. Background Technology
[0002] Electronic devices typically interact with users by displaying a graphical user interface (GUI) on a screen. To ensure a smooth GUI display, when a user's action on the screen is detected, the electronic device can prioritize scheduling the image processing-related threads in the application (hereinafter referred to as "application") corresponding to the user's action on the GUI, or provide more hardware resources to those threads.
[0003] However, in some scenarios, such as during the opening and closing of foldable electronic devices with flexible screens, users typically do not interact with the screen. Consequently, the foldable electronic device cannot determine which threads require priority scheduling or more hardware resources. This can result in insufficient resources for image processing threads in the foldable electronic device to draw, render, and composite the GUI in a timely manner, causing lag in the displayed GUI and impacting the user experience. Summary of the Invention
[0004] In view of this, this application provides a resource scheduling method, a readable storage medium, a program product, and an electronic device.
[0005] In a first aspect, a resource scheduling method is provided, applied to a foldable electronic device. The method includes: detecting a change in the opening / closing state of the foldable electronic device; performing resource scheduling on at least one image processing task of a first application through a first scheduling method, wherein the first application is an application displayed after the change in the opening / closing state of the foldable electronic device, the image processing task includes a thread and / or process performing image processing, and the first scheduling method includes at least one of the following: increasing the hardware resource configuration corresponding to at least one image processing task, increasing the priority of at least one image processing task, and stopping resource scheduling on at least one image processing task through the first scheduling method.
[0006] In this method, when the foldable electronic device changes its open / closed state, it can use a first scheduling method to schedule resources for at least one image processing task of the first application, thereby providing sufficient computing resources for the image processing thread or process of the first application in a timely manner. This can alleviate or prevent the interface of the first application from failing to be drawn and rendered in a timely manner due to its low priority or insufficient hardware resource configuration, thus avoiding interface lag on the foldable electronic device.
[0007] Optionally, the first application can be the visible application of the changed interface described below.
[0008] Optionally, the first scheduling method can be the performance-enhancing scheduling described below.
[0009] Optionally, there may be one or more first applications.
[0010] In one possible implementation of the first aspect above, the first application includes a first identifier, wherein the first identifier is used to indicate whether the first application is displayed in the foreground, and the first identifier is a first attribute when the first application is running in the foreground and a second attribute when the first application is running in the background.
[0011] In this implementation, the foldable electronic device can configure a first identifier with a first attribute as the first attribute for an application running in the foreground (indicating that the application has display content in the display interface of the foldable electronic device), and can also configure a first identifier with a first attribute as the first attribute for an application running in the foreground (indicating that the application does not have display content in the display interface of the foldable electronic device). Thus, the foldable electronic device can determine that it will display the first application after the opening / closing state changes, provided that the first identifier of the first application has the first attribute as the first attribute.
[0012] Optionally, the first identifier can be the visible identifier as described below, the first attribute can be visible, and the second attribute can be invisible.
[0013] In one possible implementation of the first aspect above, the resource scheduling of at least one image processing task of the first application through the first scheduling method includes: when the first identifier of the first application is a first attribute, the resource scheduling of at least one image processing task of the first application through the first scheduling method.
[0014] In this implementation, when the first identifier of the first application is the first attribute (indicating that the first application is running in the foreground and there is content displayed in the interface after the opening and closing state of the foldable electronic device changes), the foldable electronic device performs resource scheduling on at least one image processing task of the first application through the first scheduling method.
[0015] In one possible implementation of the first aspect described above, before scheduling resources for at least one image processing task of the first application using the first scheduling method, the method further includes: adjusting the first identifier to the first attribute after the first application starts.
[0016] In this implementation, the foldable electronic device can configure the first identifier attribute of the first application as the first attribute after detecting that the first application has started, and if the first application has displayed content in the display interface of the foldable electronic device (e.g., the first application is running in the foreground).
[0017] In one possible implementation of the first aspect described above, the method further includes: adjusting the first identifier of the first application to a second attribute when the application running in the foreground of the foldable electronic device does not include the first application, or when an operation by the user to switch the first application from foreground to background is detected; and / or, adjusting the first identifier of the first application to a first attribute when the application running in the foreground of the foldable electronic device includes the first application, or when an operation by the user to switch the first application from background to foreground is detected; and / or, deleting the first identifier of the first application or adjusting the first identifier of the first application to a second attribute when an operation by the user to close the first application is detected.
[0018] In this implementation, the foldable electronic device can maintain the attribute of the first identifier of the first application based on the currently running application, the application currently running in the foreground, the user's operation of switching the first application to the foreground, the user's operation of switching the first application to the background, etc., so as to ensure that the first identifier of the first application can correctly indicate whether the first application is running in the foreground or in the background.
[0019] In one possible implementation of the first aspect above, the first application satisfies at least one of the following conditions: the hardware resources occupied by the first application are greater than a preset first threshold; the first application is one of the top N applications of the M applications running the foldable electronic device, sorted from most to least occupied hardware resources, where M and N are positive integers and N is less than M; the first application is an application in the application whitelist.
[0020] In one alternative implementation, the foldable electronic device may schedule the image processing task of the first application using the first scheduling method only when the hardware resources occupied by the first application exceed a first threshold, or when the hardware resources occupied by the first application are among the top N applications running on the foldable electronic device. This avoids scheduling image processing tasks of applications with low hardware resource consumption using the first scheduling method, thus helping to reduce the power consumption of the foldable electronic device.
[0021] Optionally, the first threshold can be a threshold indicating whether the hardware resources consumed by the application running in the foldable electronic device are excessive, such as an empirical or experimental value. If the hardware resources consumed by the first application exceed the first threshold, it indicates that the drawing and rendering of the display content of the first application requires a large amount of computing resources. If the image processing thread of the first application is not scheduled for resources through the first scheduling method, it may cause the display interface of the first application to lag.
[0022] In one alternative implementation, the foldable electronic device schedules the image processing task of the first application only if the first application is on an application whitelist, using the first scheduling method. The applications on the application whitelist can be those that might cause lag in the display interface of the foldable electronic device during changes in its open / closed state.
[0023] In one possible implementation of the first aspect described above, a second application runs before the foldable electronic device changes its open / closed state, and the first application is an associated display application of the second application. The first application is not displayed before the foldable electronic device changes its open / closed state.
[0024] In this implementation, if the foldable electronic device does not display the first application but is running the second application before the opening / closing state of the foldable electronic device changes, the foldable electronic device can determine that the first application will be displayed after the opening / closing state of the foldable electronic device changes based on the associated display application of the second application.
[0025] In one possible implementation of the first aspect above, improving the hardware resource configuration for at least one image processing task includes at least one of the following: increasing the operating frequency of the core running at least one image processing task in the processor of the foldable electronic device from a first frequency to a second frequency; binding at least one image processing task to one or more cores of the processor for execution; scheduling at least one image processing task from the first core of the processor to the second core for execution, wherein the computational performance of the second core is higher than that of the first core.
[0026] In one possible implementation of the first aspect above, the resource scheduling of at least one image processing task of the first application through the first scheduling method includes: detecting that the folding angle of the foldable electronic device changes to a first angle, and performing resource scheduling of at least one image processing task through the first scheduling method; wherein: corresponding to the folding angle of the foldable electronic device increasing to the first angle, the first angle being less than or equal to a second angle, the second angle being the folding angle of the foldable electronic device when it begins to display the interface of the first application; corresponding to the folding angle of the foldable electronic device decreasing to the first angle, the first angle being greater than or equal to a third angle, the third angle being the folding angle of the foldable electronic device when it begins to display the interface of the first application.
[0027] In this implementation, the foldable electronic device can schedule resources for the image processing tasks of the first application using a first scheduling method when the folding angle changes to a first angle before the interface of the first application is displayed. This ensures that the image processing thread or process of the first application can acquire sufficient computing resources to draw and render the interface before it is displayed, thus helping to alleviate and avoid interface lag.
[0028] Optionally, the folding angle of the foldable electronic device increasing to the first angle can refer to the folding angle increasing to the first angle during the process of the foldable electronic device changing from the folded state to the unfolded state; the folding angle of the foldable electronic device decreasing to the first angle can refer to the folding angle decreasing to the first angle during the process of the foldable electronic device changing from the unfolded state to the folded state.
[0029] Optionally, the second angle can be the first animation display angle as described below, and the third angle can be the second animation display angle as described below.
[0030] In one possible implementation of the first aspect above, the foldable electronic device includes a first screen and a second screen, wherein the foldable electronic device displays an image on the first screen and the second screen is closed before the opening and closing state of the foldable electronic device changes; resource scheduling of at least one image processing task of the first application is performed through a first scheduling method, including: detecting that the second screen is open, and performing resource scheduling of at least one image processing task through the first scheduling method.
[0031] In this implementation, the foldable electronic device may not trigger resource scheduling for the image processing task of the first application through the first scheduling method by the folding angle, but rather by whether the second screen is turned on.
[0032] Optionally, when the opening / closing state changes from a folded state to an unfolded state, the first screen can be a non-flexible screen and the second screen can be a flexible screen; when the opening / closing state changes from an unfolded state to a folded state, the first screen can be a flexible screen and the second screen can be a non-flexible screen.
[0033] In one possible implementation of the first aspect above, stopping resource scheduling for at least one image processing task through the first scheduling method includes: stopping resource scheduling for at least one image processing task through the first scheduling method when the duration of the first scheduling method reaches a first duration; wherein: the first duration is a preset duration; or, the first duration is the duration from the first moment when resource scheduling for at least one image processing task through the first scheduling method begins to the second moment when the change in the opening / closing state of the foldable electronic device ends; or, corresponding to the display of a first animation including the display content of the first application after the change in the opening / closing state of the foldable electronic device, the first duration is the duration from the first moment to the third moment after the first animation is drawn and rendered; or, the first duration is the duration of the first animation.
[0034] In one implementation, the first duration can be a pre-set fixed duration, such as 100 milliseconds, 300 milliseconds, 500 milliseconds, 1 second, 2 seconds, 3 seconds, 5 seconds, or any other arbitrary duration. This avoids prolonged resource scheduling for at least one image processing task using the first scheduling method, which helps reduce the power consumption of foldable electronic devices.
[0035] In one implementation, the first duration can be the time between the start of resource scheduling for at least one image processing task using the first scheduling method and the cessation of the opening / closing state change of the foldable electronic device. In other words, the foldable electronic device can stop scheduling resources for at least one image processing task using the first scheduling method upon detecting the cessation of the opening / closing state change. This allows resources to be released promptly for use by other threads or processes.
[0036] In one implementation, when a first animation including the content of a first application is displayed after the foldable electronic device changes its open / closed state, the first duration is the duration from a first moment to a third moment after the first animation is drawn and rendered, or the duration of the first animation. That is, the foldable electronic device stops scheduling resources for at least one image processing task using the first scheduling method after the first animation is drawn and rendered, or after the first animation is displayed.
[0037] In one possible implementation of the first aspect above, stopping resource scheduling for at least one image processing task through the first scheduling method includes at least one of the following: reducing the hardware resource configuration corresponding to at least one image processing task, and reducing the priority of at least one image processing task.
[0038] In this implementation, if the first scheduling method is to increase the priority of at least one image processing task of the first application from the first priority to the second priority, then stopping resource scheduling of at least one image processing task through the first scheduling method can be to decrease the priority of at least one image processing task of the first application from the second priority to the third priority. The third priority can be the same as the first priority or different from the first priority.
[0039] In this implementation, if the first scheduling method is to increase the operating frequency of the kernel running at least one image processing thread in the processor of the foldable electronic device from a first frequency to a second frequency, then stopping resource scheduling of at least one image processing task through the first scheduling method can be to reduce the operating frequency of the kernel from the second frequency to a third frequency. The third frequency can be the same as or different from the first frequency.
[0040] In this implementation, if the first scheduling method binds the at least one image processing task to one or more kernels for execution, then stopping resource scheduling of the at least one image processing task through the first scheduling method can be done by unbinding the at least one image processing task from the one or more kernels.
[0041] In this implementation, if the first scheduling method is to schedule at least one image processing task from the first kernel to the second kernel, then stopping resource scheduling of at least one image processing task through the first scheduling method can be to schedule at least one image processing task from the second kernel to the first kernel.
[0042] In one possible implementation of the first aspect above, the reduction of the hardware resource configuration corresponding to at least one image processing task can be to restore the hardware resource configuration of the at least one image processing task to the state before the at least one image processing task was scheduled by the first scheduling method.
[0043] In one possible implementation of the first aspect above, the reduction of the priority of at least one image processing task can be to restore the priority of the at least one image processing task to the priority before the at least one image processing task was scheduled by the first scheduling method.
[0044] In a second aspect, this application provides a readable storage medium including one or more programs that, when executed on an electronic device, cause the electronic device to implement the resource scheduling method provided in the first aspect and any possible implementation of the first aspect.
[0045] Thirdly, this application provides a program product that, when run on an electronic device, enables the electronic device to implement the resource scheduling method provided in the first aspect and any possible implementation of the first aspect.
[0046] Fourthly, this application provides an electronic device including a memory and at least one processor. The memory stores one or more programs, and the at least one processor executes the one or more programs to enable the electronic device to implement the resource scheduling method provided in the first aspect and any possible implementation of the first aspect.
[0047] It should be noted that the beneficial effects of the second to fourth aspects mentioned above can be referred to the beneficial effects described in the first aspect, and will not be repeated here. Attached Figure Description
[0048] Figure 1A According to some embodiments of this application, a schematic diagram of the folded state change of a mobile phone is shown.
[0049] Figure 1B According to some embodiments of this application, a schematic diagram of the folded state change of a mobile phone is shown.
[0050] Figure 2A According to some embodiments of this application, an animated schematic diagram is shown of a mobile phone 10 during the process of switching from a folded state to an unfolded state.
[0051] Figure 2B According to some embodiments of this application, an animated schematic diagram is shown of a mobile phone 20 during the process of switching from a folded state to an unfolded state.
[0052] Figure 3 According to some embodiments of this application, a schematic diagram of a processor structure is shown.
[0053] Figure 4 According to some embodiments of this application, a schematic diagram showing the relationship between the folded state angle threshold, the unfolded state angle threshold, and the animation display angle is provided.
[0054] Figure 5A According to some embodiments of this application, a schematic diagram of the interface displayed before and after a mobile phone 10 switches from a folded state to an unfolded state is shown.
[0055] Figure 5B According to some embodiments of this application, a schematic diagram of the interface displayed before and after a mobile phone 20 switches from a folded state to an unfolded state is shown.
[0056] Figure 6 According to some embodiments of this application, a flowchart of a resource scheduling method is shown.
[0057] Figure 7 According to some embodiments of this application, a schematic diagram of the software architecture of a foldable electronic device is shown.
[0058] Figure 8 According to some embodiments of this application, a schematic diagram of the interaction flow of a resource scheduling method is shown.
[0059] Figure 9 According to some embodiments of this application, an interactive flow diagram of another resource scheduling method is shown.
[0060] Figure 10 According to some embodiments of this application, a flowchart illustrating a visible application identification module maintaining the visible identifier of an application is shown.
[0061] Figure 11 According to some embodiments of this application, a flowchart of a resource scheduling method is shown.
[0062] Figure 12 According to some embodiments of this application, a structural schematic diagram of a mobile phone 10 is shown. Detailed Implementation
[0063] The illustrative embodiments of this application include, but are not limited to, resource scheduling methods, readable storage media, program products, and electronic devices.
[0064] It should be noted that the resource scheduling method provided in this application can be applied to any electronic device with a foldable display, including but not limited to foldable mobile phones, foldable TVs, foldable computers, foldable displays, foldable tablets, etc. For ease of description, the foldable electronic device described below is a mobile phone, which is used as an example to introduce the technical solution of this application.
[0065] It should be noted that foldable electronic devices typically include one or more screens, among which at least one is a flexible screen. The foldable electronic device can adjust the screen or display area used to display the user interface according to its open / closed state. For example, when the foldable electronic device is in a folded state (e.g., the folding angle of the flexible screen is less than or equal to a folding angle threshold), the foldable electronic device can display the user interface through a portion of the flexible screen's display area (or a non-flexible screen); when the foldable electronic device is in an unfolded state (e.g., the folding angle of the flexible screen is greater than or equal to an unfolded angle threshold), the foldable electronic device can display the user interface through the entire display area of the flexible screen. As another example, when the foldable electronic device is in a folded state, it can display the user interface through a screen other than the flexible screen; when the foldable electronic device is in an unfolded state, it can display the user interface through the flexible screen.
[0066] For example, Figure 1A According to some embodiments of this application, a schematic diagram of the state changes of a folded mobile phone is shown; Figure 1B According to some embodiments of this application, a schematic diagram of the folded state change of a mobile phone is shown.
[0067] like Figure 1A As shown, the mobile phone 10 includes a flexible screen 11, which can be folded along a folding axis MM (the axis MM is parallel to the Y direction). When the mobile phone 10 is in the unfolded state, the mobile phone 10 displays the entire display area of the flexible screen 11 (e.g., Figure 1A The user interface is displayed in the display areas 11A and 11B shown. When the display area 11B of the flexible screen 11 is folded behind the display area 11A along the folding axis MM and the folding angle is less than or equal to the folding angle threshold, the mobile phone 10 is in a folded state and displays the user interface through the display area 11A of the flexible screen 11.
[0068] It should be noted that during the process of switching the phone 10 from a folded state to an unfolded state, or from an unfolded state to a folded state, the phone 10 can display the user interface through the entire display area of the flexible screen 11, or it can display the user interface through a part of the display area of the flexible screen 11.
[0069] like Figure 1BAs shown, the mobile phone 20 includes a flexible screen 21 and a non-flexible screen 22. The flexible screen 21 can be folded along the folding axis NN (the axis NN is parallel to the Y direction). When the mobile phone 20 is in the unfolded state, the mobile phone 20 displays the user interface through the flexible screen 21; when the mobile phone 20 is in the folded state, the mobile phone 20 displays the user interface through the non-flexible screen 22.
[0070] It should be noted that during the process of switching the phone 20 from a folded state to an unfolded state, or from an unfolded state to a folded state, the phone 10 can display the user interface through the non-flexible screen 22 and / or the flexible screen 21.
[0071] In some scenarios, such as during the opening and closing of foldable electronic devices with flexible screens, the foldable electronic device cannot determine which threads should be prioritized or run because users typically do not interact with the screen. This can cause the GUI displayed on the foldable electronic device to stutter in these scenarios, impacting the user experience.
[0072] For example, Figure 2A According to some embodiments of this application, an animated schematic diagram is shown of a mobile phone 10 during the process of switching from a folded state to an unfolded state.
[0073] like Figure 2A As shown, when the phone 10 is in a folded state, it can display a desktop interface U10 through the aforementioned display area 11A. The desktop interface U10 may include display elements such as clouds, the moon, and a boat. During the process of the phone 10 unfolding from a folded state to an unfolded state, as the folding angle of the flexible screen 11 gradually increases (for example, after the folding angle increases to a folding angle threshold), the phone 10 can display an animation of the desktop interface U10 moving from the display area 11A to the center of the flexible screen 11, followed by an animation of the moon gradually changing from a crescent to a full moon. Finally, after the flexible screen 11 is fully unfolded (or after the folding angle of the phone 10 is greater than or equal to the unfolded angle threshold), the phone 10 can display the desktop interface U20. During the above process, the user will not trigger any operations on the flexible screen 11, and the phone 10 will not prioritize the threads of applications (such as desktop applications) that draw and render the above animations, or allocate more hardware resources to these threads. Therefore, if the phone 10 is currently running many tasks, or if the processor of the phone 10 is not able to provide sufficient hardware resources, the thread in the phone 10 used to draw, render and synthesize the images of the aforementioned animation may not be able to generate the images of the aforementioned animation in a timely manner, resulting in stuttering during the display of the aforementioned animation.
[0074] For example, Figure 2B According to some embodiments of this application, an animated schematic diagram is shown of a mobile phone 20 during the process of switching from a folded state to an unfolded state.
[0075] like Figure 2B As shown, in its folded state, the phone 20 displays the video application interface U30 via the non-flexible screen 22; in its unfolded state, the phone 20 displays the video application interface U40 via the flexible screen 21. Interface U40 includes the playback and selection areas found in interface U30, as well as a comment area for the video. During the transition from folded to unfolded mode, the phone 20 can display an animation showing interface U40 moving from right to left on the flexible screen 21 as the folding angle increases, once the folding angle of the flexible screen 21 exceeds a threshold. If, during this transition, the phone 20 is running many tasks or its processor lacks sufficient hardware resources, the thread responsible for drawing, rendering, and compositing the animation of interface U40's movement may be unable to render the animation in a timely manner, resulting in stuttering on the screen and negatively impacting the user experience.
[0076] To address the issue of lag or delay in the user interface display of foldable electronic devices when their open / closed state changes, this application provides a resource scheduling method. In this method, when the foldable electronic device detects a change in its open / closed state, it can improve the image processing efficiency and speed of the interface to be displayed after the change, enabling the foldable electronic device to generate the user interface promptly and avoid lag.
[0077] For ease of description, the application that displays content on a certain interface will be referred to as the visible application of that interface.
[0078] Specifically, when a foldable electronic device detects a change in its open / closed state, it can determine the visible applications on the interface (hereinafter referred to as the changed interface) after the change in the open / closed state begins. Then, the foldable electronic device can perform performance-enhancing scheduling on the image processing threads (and / or processes) of at least a portion of the visible applications on the changed interface within a first time period. This improves the image processing efficiency and speed of the image processing threads (or processes) of the at least a portion of the visible applications, ensuring that these threads (or processes) obtain sufficient hardware resources in a timely manner to draw, render, and composite the user interface. This alleviates or avoids user interface stuttering or delays caused by the image processing threads (or processes) failing to obtain sufficient hardware resources in a timely manner.
[0079] Among them, image processing threads include threads related to image processing, such as threads used to draw, render, or synthesize image data, and image processing processes include processes related to image processing, such as processes used to draw, render, or synthesize image data; performance enhancement scheduling includes, but is not limited to, increasing the priority of image processing threads and providing more hardware resources for image processing threads.
[0080] In some embodiments, the processor of a foldable electronic device may include multiple cores, which may be divided into different clusters, with different clusters having different computing capabilities. For example, see reference... Figure 3 The processor 110 includes 8 cores: one large core in cluster 0, three medium cores in cluster 1, and four small cores in cluster 2. Furthermore, the computing performance of the large core, medium core, and small core is ranked from highest to lowest as follows: large core > medium core > small core.
[0081] In some embodiments, the operating frequency of the processor 110 core can typically be adjusted within a certain range; the higher the operating frequency of the core, the higher its computing performance.
[0082] It should be noted that, Figure 3 The architecture of the processor 110 shown is only an example. In other embodiments, the processor 110 may include more or fewer cores, and the cores of the processor 110 may be divided into more or fewer clusters, which is not limited here.
[0083] Based on this, in some embodiments, performance enhancement scheduling may include at least one of the following processes:
[0084] One possible approach is to increase the priority of the image processing thread. Operating systems for foldable electronic devices typically define multiple priority levels, with higher priority threads having a greater probability of being executed. Increasing the priority of the image processing thread would allow it to run more frequently.
[0085] Another possible approach is to bind the image processing thread to one or more cores of the processor in the foldable electronic device. Different threads can typically be scheduled to run on multiple cores of a processor; by binding the image processing thread to one or more cores of the processor in the foldable electronic device, delays caused by scheduling the image processing thread across multiple cores can be avoided. For example, for Figure 3 The processor 110 shown can bind the image processing thread to the large core (or one or more medium cores) to run if the image processing thread can be scheduled between the large core and the medium core before the opening and closing state changes.
[0086] Another possible approach is to increase the operating frequency of the kernel running the image processing thread. By increasing the operating frequency of the kernel running the image processing thread, the kernel's computing power can be increased, thereby increasing the running speed of the image processing thread and enabling foldable electronic devices to generate user interfaces more quickly.
[0087] Another possible approach is to schedule the image processing thread to run on a higher-performance kernel. This would increase the speed of the image processing thread, allowing foldable electronic devices to generate user interfaces more quickly. For example, for Figure 3 The processor 110 shown can schedule the image processing thread to run on the medium or large core if the image processing thread was running on the small core before the opening / closing state change; and can schedule the image processing thread to run on the large core if the image processing thread was running on the medium core before the opening / closing state change.
[0088] It should be noted that in other embodiments, performance enhancement scheduling may also include other processing methods that can speed up the operation of image processing threads, which are not limited here.
[0089] It should be noted that in some embodiments, the image processing task of the application can be implemented by a process or a thread. Therefore, when the image processing task of the changed interface is implemented by an image processing thread, the object of performance enhancement scheduling can be the image processing thread and / or the process in which the image processing thread resides; when the image processing task of the changed interface is implemented by an image processing process, the object of performance enhancement scheduling can be the image processing process. The following embodiments will use the image processing thread as an example to illustrate performance enhancement scheduling.
[0090] In some embodiments, the image processing thread may include a thread in the application for image processing, such as a thread for drawing, rendering, or compositing image data in the user interface.
[0091] In some embodiments, when the opening / closing state of the foldable electronic device changes from a folded state to an unfolded state, the foldable electronic device can detect the change in opening / closing state after the folding angle of the foldable electronic device increases from an angle less than a folding angle threshold to a folding angle threshold. Similarly, when the opening / closing state of the foldable electronic device changes from an unfolded state to a folded state, the foldable electronic device can detect the change in opening / closing state after the folding angle of the foldable electronic device decreases from an angle greater than an unfolded angle threshold to an unfolded angle threshold.
[0092] It should be noted that the folded state angle threshold and the unfolded state angle threshold are used to determine the opening and closing state of the foldable electronic device. When the folding angle of the foldable electronic device is less than the folding state angle threshold, the opening and closing state of the foldable electronic device is the folded state; when the folding angle of the foldable electronic device is greater than the unfolded state angle threshold, the opening and closing state of the foldable electronic device is the unfolded state.
[0093] It should be noted that the folded-state angle threshold and the unfolded-state angle threshold can be empirical or experimental values, typically preset by the developers of foldable electronic devices. This application does not limit the specific values of the folded-state angle threshold and the unfolded-state angle threshold.
[0094] In some embodiments, during the opening and closing process of the foldable electronic device, after the folding angle changes to a preset animation display angle, the foldable electronic device can display a switching animation on one or more screens. Therefore, in some embodiments, the foldable electronic device can perform performance enhancement scheduling on the image processing threads of at least a portion of the visible applications of the changed interface before or during the change to the preset animation display angle. This avoids wasting resources by prematurely performing performance enhancement scheduling on these image processing threads, while ensuring that these threads have sufficient hardware resources to generate the switching animation in a timely manner, thus preventing interface lag on the foldable electronic device.
[0095] For example, refer to Figure 4 During the transition from a folded to an unfolded state in the foldable electronic device, the device can generate and display a switching animation after the folding angle increases to a first animation display angle. During the transition from an unfolded to a folded state in the foldable electronic device, the device can generate and display a switching animation after the folding angle decreases to a second animation display angle. During the transition from a folded to an unfolded state in the foldable electronic device, if the device detects that the folding angle has increased to the first animation display angle (or decreased to an angle smaller than the first animation display angle), the device can perform performance optimization scheduling on the image processing threads of at least a portion of the visible applications on the changed interface. During the transition from an unfolded to a folded state in the foldable electronic device, if the device detects that the folding angle has decreased to the second animation display angle (or decreased to an angle greater than the second animation display angle), the device can perform performance optimization scheduling on the image processing threads of at least a portion of the visible applications on the changed interface.
[0096] In some embodiments, the first animation display angle can be any angle greater than or equal to the folded state angle threshold, and the second animation display angle can be any angle less than or equal to the unfolded state angle threshold. It should be noted that the first animation display angle and the second animation display angle can be the same or different.
[0097] In some embodiments, the foldable electronic device may use different screens to display the user interface before and after the change in the open / closed state. In this case, the foldable electronic device may begin performance-enhancing scheduling of image processing threads for at least a portion of the visible applications of the changed interface before the screen displaying the user interface begins to show the user interface after the change in the open / closed state (e.g., when or before the screen is opened).
[0098] In some embodiments, the changed interface may include multiple frames of the interface displayed on one or more displays of the foldable electronic device after a change in the open / closed state of the foldable electronic device is detected. For example, the changed interface may include multiple frames of images from the moment the change in the open / closed state of the foldable electronic device is detected to the moment the change in the open / closed state of the foldable electronic device is completed. As another example, the changed interface may include multiple frames of images from the moment the change in the open / closed state of the foldable electronic device is detected to a second duration from the moment the change in the open / closed state of the foldable electronic device is completed.
[0099] In some embodiments, the visible applications displayed on the interface of the foldable electronic device before and after the change in its open / closed state may differ. For example, since the display area of the foldable electronic device in its unfolded state is typically larger than that in its folded state, the content displayed on the interface in the unfolded state can be more than the content displayed in the folded state. Therefore, the number of visible applications on the interface displayed in the unfolded state can be greater than or equal to the number of visible applications on the interface displayed in the folded state.
[0100] In some embodiments, when the opening / closing state of the foldable electronic device changes from a folded state to an unfolded state, the number of visible applications in the changed interface can be greater than or equal to the number of visible applications in the interface displayed before the change of the opening / closing state of the foldable electronic device (hereinafter referred to as the "pre-change interface"). This avoids the user interface from lagging due to insufficient hardware resources for applications that do not have display content in the pre-change interface but do have display content in the changed interface.
[0101] For example, Figure 5A The diagram shows the interface displayed before and after a mobile phone 10 switches from a folded state to an unfolded state.
[0102] like Figure 5A As shown, when the phone 10 is in a folded state, a lock screen interface U50 is displayed. Interface U50 includes the lock screen interface displayed by the desktop application and a meeting reminder control U51 displaying "Reminder: Meeting is about to start" from the desktop application. Essentially, the visible applications in interface U50 include the desktop application. After the phone 10 switches from a folded state to an unfolded state, it can display interface U60, which includes the interface of the meeting application. Essentially, the visible applications include the meeting application. During the transition from a folded to an unfolded state, the phone 10 can display an animation of interface U60 moving from the right side to the left side of the flexible screen 11. After detecting the change in opening / closing state, the phone 10 can determine that the visible applications in the changed interface (e.g., interface U60, the frames corresponding to the animation from interface U50 to interface U60) include the meeting application, thereby optimizing the performance scheduling of the meeting application's image processing thread. This avoids stuttering during the animation of interface U60 moving from the right side to the left side of the flexible screen 11.
[0103] For example, Figure 5B This diagram illustrates the interface displayed on a mobile phone 20 before and after switching from a folded state to an unfolded state.
[0104] like Figure 5B As shown, when the phone 20 is in the folded state, it displays interface U30′, which includes the playback interface of a video application and a text message notification control U31 displayed on the desktop application indicating that a message has been received from AA. This means that the visible applications in interface U30′ include both the video application and the desktop application. After the phone 20 switches from the folded state to the unfolded state, it can display interface U40′, which includes the playback area, comment area, and episode selection area of the video application, as well as the text message window U41 of the text message application. This means that the visible applications in interface U30′ include both the video application and the text message application. During the process of the phone 20 changing from the folded state to the unfolded state, the phone 20 can display an animation from interface U30′ to interface U40′ (e.g., an animation of interface U30′ moving outward from the non-flexible screen 22 and interface U40′ moving inward from the flexible screen 21). After detecting a change in the opening / closing state, the mobile phone 20 can determine that the visible applications on the changed interface (e.g., interface U40′, the frames corresponding to the animation from interface U30′ to interface U40′) include video applications and SMS applications, thereby scheduling the image processing threads of video applications and SMS applications to improve performance.
[0105] In other embodiments, corresponding to the opening / closing state of the foldable electronic device switching from an unfolded state to a folded state, the number of visible applications in the changed interface can be less than or equal to the number of visible applications in the original interface. This avoids erroneously scheduling performance boosts for applications that had display content in the original interface but not in the changed interface, thus saving resources and reducing the power consumption of the foldable electronic device.
[0106] In some embodiments, after the performance enhancement scheduling of the image processing threads has reached a first duration, the foldable electronic device may stop the performance enhancement scheduling of those image processing threads to reduce the power consumption of the foldable electronic device. It should be noted that after stopping the performance enhancement scheduling of those image processing threads, the foldable electronic device may schedule those image processing threads based on the operating system or application's runtime logic.
[0107] In some embodiments, the first duration can be an empirical or experimental value. For example, the first duration can be any preset duration greater than 0, such as 100 milliseconds, 300 milliseconds, 500 milliseconds, 1 second, 2 seconds, 3 seconds, 5 seconds, etc., without limitation.
[0108] In some embodiments, if the opening / closing state change of the foldable electronic device is stopped—for example, when a user cancels / stops folding or unfolding the foldable electronic device, or when the opening / closing state change of the foldable electronic device is completed (e.g., it has switched from one opening / closing state to another)—the foldable electronic device can stop performance enhancement scheduling for image processing threads that have already been scheduled for performance enhancement after detecting the cessation of the opening / closing state change. This allows for the timely release of hardware resources occupied by these image processing threads, reducing the power consumption of the foldable electronic device and providing more hardware resources for other threads. In this case, the first duration can also be the duration from the start of performance enhancement scheduling to the cessation of the state change of the foldable electronic device.
[0109] In some embodiments, the first duration may also be the duration from the start of performance boost scheduling to the completion of drawing and rendering of the animation corresponding to the changed interface (e.g., the aforementioned switching animation), or the total duration of the switching animation. In this case, the foldable electronic device may record the duration of performance boost scheduling for the thread, and stop performance boost scheduling for the thread that has already been scheduled when the duration reaches the total duration of the switching animation.
[0110] The following is combined Figures 6 to 10 The technical solution of this application is described.
[0111] For example, Figure 6According to some embodiments of this application, a flowchart of a resource scheduling method is shown. The main body executing this process is a foldable electronic device, such as... Figure 6 As shown, the method includes the following steps:
[0112] S601, a change in the opening / closing state of the foldable electronic device was detected.
[0113] For example, the foldable electronic device can trigger the resource scheduling method provided in the embodiments of this application when it detects a change in the opening or closing state of the foldable electronic device.
[0114] In some embodiments, when the opening / closing state of the foldable electronic device changes from a folded state to an unfolded state, the foldable electronic device can detect the change in opening / closing state after the folding angle of the foldable electronic device increases from an angle less than a folding angle threshold to a folding angle threshold. Similarly, when the opening / closing state of the foldable electronic device changes from an unfolded state to a folded state, the foldable electronic device can detect the change in opening / closing state after the folding angle of the foldable electronic device decreases from an angle greater than an unfolded angle threshold to an unfolded angle threshold.
[0115] It should be noted that the detection logic for changes in the open / closed state of a foldable electronic device can vary depending on the form factor of the foldable electronic device, the manufacturer, and the folding angle of the flexible screen. Therefore, in other embodiments, the detection logic for changes in the open / closed state of the foldable electronic device can also be other logic, which is not limited here.
[0116] S602, Determine the visible applications on the changed interface.
[0117] For example, after detecting a change in the opening / closing state of a foldable electronic device, the foldable electronic device can determine the visible applications in the interface after the change based on the visible applications in the interface before the change, the logic of user interface interaction in the foldable electronic device, etc., such as the applications involved in the animation during the opening / closing state change process, the visible applications of the interface displayed within a second time period after the opening / closing state change of the foldable electronic device is completed, etc.
[0118] In some embodiments, the visible applications of the changed interface may include the visible applications of the original interface. A foldable electronic device may use the visible applications of the original interface as the visible applications of the changed interface.
[0119] In some embodiments, the foldable electronic device can configure a visibility identifier for applications during operation, indicating whether the applications are visible. The attributes of this visibility identifier can include visible and invisible. Thus, the foldable electronic device can determine which applications are visible based on the attributes of the visibility identifiers of currently running applications. Details will be described below and will not be elaborated upon here.
[0120] In some embodiments, the interaction logic of the foldable electronic device can be configured with associated display applications and associated non-display applications for different applications. An associated display application for an application can be an application that, when running in a certain open / closed state (e.g., folded or unfolded), requires content to be displayed during a change in open / closed state or after a change to another open / closed state (e.g., unfolded or folded). An associated non-display application for an application can be an application that, when running in a certain open / closed state (e.g., folded or unfolded), does not require content to be displayed during a change in open / closed state or after a change to another open / closed state (e.g., unfolded or folded). The foldable electronic device can determine the visible applications on the changed interface based on the associated display applications and associated non-display applications of the application running when the interface is displayed before the change (hereinafter referred to as the application running before the change), and the visible applications on the interface before the change.
[0121] For example, a foldable electronic device can make applications other than those associated with the previously running application that are not displayed, as well as the associated displayed applications of the previously running application, visible in the interface before the change, visible in the interface after the change.
[0122] For example, if the applications running before the change include application A, application B, and application C, where applications B and C are visible on the interface before expansion, application B is an associated but not displayed application of application A, and application D is an associated displayed application of application A, the foldable electronic device can identify applications C and D as visible applications on the interface after the change. In this case, before the foldable electronic device changes its open / closed state, it displays the content of applications B and C; after the change in the open / closed state is completed (e.g., after switching from folded to expanded state, or vice versa), it displays the content of applications C and D; during the change in the open / closed state, the foldable electronic device can display an animation including the content of applications C and D.
[0123] For example, if the applications running before the change include application B, and application B is visible on the interface before the change, and application E is an associated application of application B, the foldable electronic device can identify applications B and E as visible applications on the interface after the change. In this case, before the foldable electronic device changes its open / closed state, it displays the content of application B; after the change in the open / closed state is completed (e.g., after switching from folded to unfolded, or vice versa), it displays the content of applications B and E; during the change in the open / closed state, the foldable electronic device can display an animation including the content of applications B and E.
[0124] S603, optimizes the scheduling of image processing threads for at least a portion of the visible applications in the changed interface.
[0125] After identifying the visible applications in the changed interface, the foldable electronic device can schedule performance-enhanced image processing threads for at least a portion of the visible applications in the changed interface.
[0126] For example, foldable electronic devices can optimize the performance scheduling of image processing threads for all visible applications on the changed interface to ensure that the changed interface does not lag to the greatest extent possible.
[0127] For example, foldable electronic devices can perform performance boosting scheduling on image processing threads of applications whose hardware resource usage or expected hardware resource usage exceeds a preset resource threshold (as a first threshold) within the visible applications of the changed interface. This avoids performance boosting scheduling on image processing threads of visible applications with low hardware resource usage, ensuring the foldable electronic device has sufficient hardware resources to perform performance boosting scheduling on image processing threads of visible applications with high hardware resource usage. For instance, if the visible applications of the changed interface include applications A, B, C, and D, and application A has a processor utilization rate of 15%, application B has a processor utilization rate of 12%, application C has a processor utilization rate of 8%, and application D has a processor utilization rate of 5%, with a preset resource threshold of 10%, then the foldable electronic device can perform performance boosting scheduling on the image processing threads of applications A and B.
[0128] It should be noted that the preset resource threshold can be a preset value, such as an empirical value or an experimental value.
[0129] For example, foldable electronic devices can optimize the performance scheduling of image processing threads in visible applications within the changed interface, prioritizing those that currently occupy or are expected to occupy a certain number of hardware resources (e.g., 2, 3, 4, 5, etc. (or other values, not limited here)). For instance, if the changed interface includes applications A, B, C, and D, with application A having a processor utilization of 15%, application B 12%, application C 8%, and application D 5%, and a preset number of 3, then the foldable electronic device can optimize the performance scheduling of image processing threads for applications A, B, and C.
[0130] For example, foldable electronic devices can also have a pre-defined whitelist of applications that require performance enhancement scheduling (hereinafter referred to as the application whitelist). Foldable electronic devices can perform performance enhancement scheduling on the image processing threads of applications that are visible in the changed interface and are located in the application whitelist.
[0131] In some embodiments, the image processing thread may include image processing-related threads.
[0132] For example, the image processing process of a foldable electronic device can include three stages: drawing, rendering, and compositing. Each application can execute rendering stage instructions through a rendering thread (e.g., rendering threads corresponding to different rendering engines, such as the OpenGL ES (OpenGL for embedded systems, a 3D graphics application programming interface) thread, the Metal (an application programming interface for image rendering) thread, etc.) and drawing stage instructions through drawing threads (e.g., the main thread, the UI thread, etc.). The operating system of the foldable electronic device uses a thread for image compositing (hereinafter referred to as a compositing thread, such as the surfaceflinger thread, etc.) to execute compositing stage instructions. In the above scenario, the image processing thread can include the drawing thread and the rendering thread of each application.
[0133] In some embodiments, in addition to performance-enhancing scheduling of the application's image processing thread, the foldable electronic device can also perform performance-enhancing scheduling of the image processing thread within the foldable electronic device's operating system. For example, the aforementioned compositing thread.
[0134] In some embodiments, the foldable electronic device can, upon detecting a change in the folding angle to a corresponding animation display angle, perform performance boost scheduling on the image processing threads of at least a portion of the visible applications on the changed interface. This avoids premature performance boost scheduling of these image processing threads, which would otherwise waste resources, while ensuring that these threads have sufficient hardware resources to generate the switching animation in a timely manner, thus preventing interface stuttering on the foldable electronic device. For example, for Figure 4 As shown, when the foldable electronic device changes from a folded state to an unfolded state, it can perform performance-enhancing scheduling on the image processing threads of at least a portion of the visible applications on the changed interface, provided that the folding angle has reached a first animation display angle. During the change from an unfolded state to a folded state, the foldable electronic device can also perform performance-enhancing scheduling on the image processing threads of at least a portion of the visible applications on the changed interface, provided that the folding angle has reached a second animation display angle.
[0135] S604, Stop performance boost scheduling for threads that have already been scheduled for performance boost.
[0136] For example, after a first period of performance boost scheduling for at least a portion of the visible applications in the changed interface, the foldable electronic device can stop performance boost scheduling for the threads that have already been scheduled. This prevents those image processing threads from occupying the foldable electronic device's hardware resources for an extended period, thus preventing other threads from being scheduled in a timely manner.
[0137] In some embodiments, the first duration may be a preset duration.
[0138] In some embodiments, the first duration may also be the duration from the start of performance boost scheduling to the cessation of the change in state of the foldable electronic device. For example, during the performance boost scheduling of image processing threads in at least a portion of the visible applications of the changed interface (e.g., the duration of performance boost scheduling for image processing threads in at least a portion of the visible applications of the changed interface is less than the first duration), if the foldable electronic device detects that the opening / closing state of the foldable electronic device has ceased (e.g., the user stops folding or unfolding the foldable electronic device, the opening / closing state of the foldable electronic device has changed completely, etc.), it can directly stop the performance boost scheduling of the threads that have already undergone performance boost scheduling. In this way, the performance boost scheduling of that portion of the image processing threads can be stopped in a timely manner, providing sufficient hardware resources for other threads.
[0139] In some embodiments, the cessation of opening / closing state changes can be achieved by the user adjusting the folding angle of the foldable electronic device to a certain angle between the aforementioned folding angle threshold and unfolded angle threshold, and then stopping the adjustment of the folding angle of the foldable electronic device.
[0140] In some embodiments, the first duration may also be the duration from the start of performance boost scheduling to the completion of drawing and rendering of the animation corresponding to the changed interface (such as the aforementioned switching animation), or the total duration of the switching animation. Since the image processing thread may not require excessive computing resources after the animation drawing and rendering are completed, stopping the performance boost scheduling of the image processing thread after the animation drawing and rendering are completed can reduce the power consumption of foldable electronic devices and provide sufficient hardware resources for other threads in a timely manner.
[0141] In some embodiments, stopping performance boost scheduling for threads that have already undergone performance boost scheduling may involve restoring the priority of these threads to the state before performance boost scheduling, and / or restoring the hardware resource configuration of these threads to the state before performance boost scheduling.
[0142] Based on the above method, when the foldable electronic device changes its open / closed state, it can promptly schedule the performance of the image processing threads of at least a portion of the visible applications on the changed interface, and provide sufficient hardware resources for these threads in a timely manner, thus avoiding lag in the user interface displayed by the foldable electronic device.
[0143] The technical solution of this application will be introduced below, in conjunction with the software architecture of foldable electronic devices.
[0144] Figure 7 According to some embodiments of this application, a schematic diagram of the software architecture of a foldable electronic device is shown.
[0145] like Figure 7 As shown, the software architecture of foldable electronic devices can include an application layer and a framework layer.
[0146] The application layer includes applications in foldable electronic devices, such as video, desktop, messaging, and conferencing applications.
[0147] It should be noted that in other embodiments, the application layer may include more or fewer applications, which is not limited here.
[0148] The framework layer provides the application programming interface (API) and programming framework for the application. The framework layer includes predefined functions such as a visible application identification module, a scheduling module, and an open / closed state detection module.
[0149] The visible application identification module is used to determine the visible applications of foldable electronic devices, such as the visible applications of the interface before the change and the visible applications of the interface after the change.
[0150] For example, the visible application identification module can add a visibility identifier (attribute can be visible or invisible) to the application during application runtime at the application layer to indicate whether the application is visible. During application runtime, the visible application identification module can adjust the attribute of the application's visibility identifier based on the application's running state (foreground or background). For instance, when the application switches from foreground to background, the attribute of the application's visibility identifier can be configured to be invisible; when the application switches from background to foreground, the attribute of the application's visibility identifier can be configured to be visible. After the application finishes running, the visible application identification module can delete the application's visibility identifier. See [reference needed] for details. Figure 10 The embodiments shown are not described in detail here.
[0151] In some embodiments, the visible application identification module can also determine the visible application of the changed interface based on the visible applications of the current display interface (e.g., the interface before the change mentioned above). The specific determination method can be found in step S602 above, and will not be repeated here.
[0152] Furthermore, in some embodiments, the visible application identification module can also pass the visible application (e.g., the application identifier of the visible application, the thread identifier of the image processing thread of the visible application, etc.) to other modules so that other modules can perform further operations based on the application identifier of the visible application. For example, the visible application identification module can pass the application identifier of the visible application before the change or the visible application after the change (or the thread identifier of the image processing thread of the visible application before the change, or the thread identifier of the image processing thread of the visible application after the change) to the scheduling module based on the call of the scheduling module.
[0153] The scheduling module is used to either optimize the performance of image processing threads in visible applications of the changed interface or stop their performance optimization. For example, the scheduling module can optimize the performance of image processing threads in at least some visible applications of the changed interface based on opening / closing state change information received from the opening / closing state detection module. As another example, the scheduling module can stop optimizing the performance of threads if the performance optimization scheduling period reaches a first duration or if it receives an opening / closing state change termination message from the opening / closing state detection module.
[0154] The opening / closing state detection module is used to detect the opening / closing state of the foldable electronic device and transmit the detected opening / closing state to other modules, such as through broadcasting or other means.
[0155] For example, the opening / closing state detection module can send opening / closing state change information to the scheduling module when it detects a change in the opening / closing state of the foldable electronic device. This information indicates a change in the opening / closing state of the foldable electronic device, such as a change from a folded state to an unfolded state, or vice versa.
[0156] For example, the opening / closing state detection module can send an opening / closing state change abortion information to the scheduling module when it detects that the opening / closing state change of the foldable electronic device has stopped. The opening / closing state change abortion information indicates that the previously detected opening / closing state change has stopped.
[0157] For example, the opening / closing state detection module can detect when the folding angle of a foldable electronic device reaches the animation display angle (e.g., Figure 4 (The first animation display angle or the second animation display angle). The scheduling information is used to indicate that the foldable electronic device is about to begin displaying a switching animation.
[0158] It should be noted that the framework layer can include more or fewer modules, and the aforementioned modules of the framework layer can also be deployed to other layers; this is not limited here.
[0159] For example, the framework layer may also include an activity manager (AM), which can provide interfaces to applications in the application layer or services / modules in the framework layer to query the running status (foreground or background running) of applications in the foldable electronic device and to query the applications currently running on the foldable electronic device.
[0160] It should be noted that in other embodiments, the software architecture of the foldable electronic device may include more or fewer layers, which is not limited here. For example, the software architecture of the foldable electronic device may also include a local layer, a kernel layer, etc.
[0161] The following is combined Figure 7 The software architecture shown illustrates the technical solution of this application.
[0162] For example, Figure 8 According to some embodiments of this application, a schematic diagram of the interaction flow of a resource scheduling method is shown. For example... Figure 8 As shown, the interaction process includes the following steps:
[0163] S801, the visible application identification module maintains the visible identifier of the application.
[0164] The visible application identification module can update the visibility identifier of each application on the foldable electronic device based on the application's operating status (e.g., running, switched to the background, switched to the foreground, closed, etc.). See the following for details. Figure 10The process shown will not be elaborated upon here.
[0165] It should be noted that the attributes of the visibility identifier can include visible and invisible. The attribute of visible indicates that the application is running in the foreground and has content displayed in the currently displayed interface, while the attribute of invisible indicates that the application is running in the background (or not running) and has no content displayed in the currently displayed interface.
[0166] It should be noted that the visible application identification module can determine the visible applications in the display interface of the foldable electronic device based on the visibility identifiers of each application. For example, the visible application identification module can identify applications whose visibility identifiers are marked as "visible" as visible applications.
[0167] It should be noted that the process of the visible application identification module maintaining the visible identifier of the application can exist throughout the entire lifecycle of the application. In some embodiments, the visible application identification module can maintain the visible identifier of the application during the execution of steps S802 to S807.
[0168] S802, the scheduling module registers with the opening / closing state detection module to monitor the opening / closing state.
[0169] After the scheduling module is running, it can register with the opening and closing status detection module to listen for the opening and closing status.
[0170] It should be noted that after the scheduling module registers with the opening and closing state detection module to listen for the opening and closing state, the opening and closing state detection module can transmit the detected opening and closing state of the foldable electronic device (such as changes in the opening and closing state, cessation of the changes in the opening and closing state, and the folding angle reaching the animation display angle, etc.) to the scheduling module.
[0171] In some embodiments, the execution order of steps S801 and S802 can be interchanged or executed in parallel, and no limitation is made here.
[0172] S803, the opening / closing state detection module detects a change in the opening / closing state of the foldable electronic device and sends the opening / closing state change information to the scheduling module.
[0173] When the opening / closing state detection module detects a change in the opening / closing state of the foldable electronic device, it can send opening / closing state change information to the scheduling module. For example, the opening / closing state change information can indicate that the opening / closing state of the foldable electronic device has begun to change, such as indicating that the opening / closing state of the foldable electronic device changes from a folded state to an unfolded state, or from an unfolded state to a folded state.
[0174] It should be noted that the specific method for detecting changes in the opening and closing state of the foldable electronic device can be referred to the content of the aforementioned step S601, and will not be repeated here.
[0175] S804, the scheduling module obtains visible application information from the visible application identification module.
[0176] Upon receiving information about a change in the opening / closing state, the scheduling module can retrieve visible application information from the visible application identification module in response to this information. For example, the visible application information may include the application identifier of the visible application in the interface before the change, and / or the thread identifier of the image processing thread of the visible application in the interface before the change.
[0177] In some embodiments, the visible application information may also include the application identifier of the visible application in the changed interface, and / or the thread identifier of the image processing thread of the visible application in the changed interface.
[0178] In some embodiments, the visible application information may also include the application identifier of the application that was running before the change, and / or the application identifier of the application that was associated with the application that was running before the change or the application identifier of the application that was associated with the application that was not displayed.
[0179] S805, the opening / closing state detection module detects that the folding angle has reached the animation display angle and sends scheduling information to the scheduling module.
[0180] When the opening / closing state detection module detects that the folding angle has reached the animation display angle, it can send scheduling information to the scheduling module to notify the scheduling module that the foldable electronics are about to start generating and displaying the switching animation.
[0181] It should be noted that the method by which the opening / closing state detection module detects that the folding angle has reached the animation display angle can be referred to the aforementioned method. Figure 4 The details of step S603 will not be elaborated here.
[0182] In some embodiments, the opening / closing state detection module may also send scheduling information to the scheduling module when it detects that the folding angle has reached a certain angle before the animation display angle.
[0183] For example, the animation display angle can include a first animation display angle corresponding to the change of the opening / closing state from a folded state to an unfolded state, and a second animation display angle corresponding to the change of the opening / closing state from an unfolded state to a folded state. The opening / closing state detection module can send scheduling information to the scheduling module when it detects that the folding angle has increased to an angle smaller than the aforementioned first animation display angle; the opening / closing state detection module can send scheduling information to the scheduling module when it detects that the folding angle has increased to an angle greater than the aforementioned second animation display angle.
[0184] It should be noted that step S805 is optional. For example, if the scheduling module does not trigger performance-enhancing scheduling for the image processing thread of at least part of the visible application of the changed interface based on the scheduling information sent by the opening / closing state detection module, step S805 may not be executed.
[0185] In some embodiments, step S805 may be performed before step S804. For example, when the animation display angle is the same as the threshold for detecting the opening and closing state of the foldable electronic device (e.g., when the folded state angle threshold is the same as the aforementioned first animation display angle, or when the unfolded state angle threshold is the same as the aforementioned second animation display angle), step S805 may be performed before step S804.
[0186] S806, the scheduling module performs performance-enhancing scheduling for image processing threads of at least a portion of the applications visible in the changed interface.
[0187] After obtaining the visible application information, the scheduling module can first determine the visible applications of the changed interface based on the visible application information. For example, the scheduling module can determine the visible applications of the interface before the change based on the visible application information, and determine the applications of the interface before the change (excluding the applications associated with the applications running before the change that are not displayed) and the applications associated with the applications running before the change that are displayed as the visible applications of the changed interface.
[0188] For example, in the scenario shown in Figure 5, the visible application information may include application identifiers for the desktop application and the video application, and the SMS application is the associated display application when the SMS notification control U31 is displayed in the desktop application. The scheduling module can determine the video application and the SMS application as the visible applications in the changed interface.
[0189] In some embodiments, after identifying the visible applications of the changed interface, the scheduling module can identify the visible applications that require performance-enhanced scheduling and perform performance-enhanced scheduling on the image processing threads of the identified visible applications. For example, the scheduling module can identify all visible applications of the changed interface, or visible applications whose hardware resources (or expected hardware resources) are greater than a preset resource threshold, or a preset number of visible applications whose hardware resources (or expected hardware resources) are ranked from most to least, or visible applications in the application whitelist as visible applications requiring performance-enhanced scheduling, and perform performance-enhanced scheduling on the image processing threads of the visible applications requiring performance-enhanced scheduling.
[0190] It should be noted that when there are multiple visible applications that require performance enhancement scheduling, the performance enhancement scheduling for different visible applications can be the same or different, and there is no restriction here.
[0191] For example, assuming there are two visible applications, A and B, that require performance-enhancing scheduling, the scheduling module can perform performance-enhancing scheduling for applications A and B in different ways. For instance, the scheduling module can increase the priority of application A's image processing thread (e.g., from first priority to second priority) and bind application B's image processing thread to one or more kernels. Alternatively, the scheduling module can increase the operating frequency of the kernel running application A's image processing thread and bind application B's image processing thread to one or more kernels. Yet another example is that the scheduling module can increase the operating frequency of the kernel running application A's image processing thread from f0 to f1, and increase the operating frequency of the kernel running application B's image processing thread from f2 to f3, which is different from f1.
[0192] In some embodiments, after receiving scheduling information sent by the opening / closing state detection module, the scheduling module may, in response to the scheduling information, perform performance-enhancing scheduling on the image processing threads of at least a portion of the visible applications of the changed interface.
[0193] S807, the opening / closing state detection module detects that the opening / closing state change of the foldable electronic device has stopped and sends the opening / closing state change stop information to the scheduling module.
[0194] For example, after detecting a change in the opening / closing state of the foldable electronic device, if the change in opening / closing state is detected to have stopped, the opening / closing state detection module can send an information indicating that the change in opening / closing state has stopped to the scheduling module. This information indicates that the user should stop unfolding or folding the foldable electronic device, or that the previously detected change in opening / closing state was a false detection.
[0195] For example, after detecting a change in the opening / closing state of a foldable electronic device, if the opening / closing state detection module detects that the folding angle remains unchanged for a certain period of time or the change angle is less than a certain threshold, it can determine that the change in the opening / closing state has stopped.
[0196] For example, after detecting a change in the open / closed state of a foldable electronic device, the open / closed state detection module detects a change in the folding angle from its initial angle before the change, and can determine that the change in open / closed state has ceased. For instance, if the folding angle of the foldable electronic device increases to a value greater than the folding angle threshold and then decreases to a value less than the folding angle threshold, the open / closed state detection module can determine that the change in open / closed state has ceased; similarly, if the folding angle of the foldable electronic device decreases to a value less than the unfolded angle threshold and then increases to a value greater than the unfolded angle threshold, the open / closed state detection module can determine that the change in open / closed state has ceased.
[0197] It should be noted that foldable electronic devices can also detect changes in the opening and closing state and stop in other situations through other means, which is not limited here.
[0198] It should be noted that step S807 is optional.
[0199] S808, the scheduling module stops the performance enhancement scheduling of threads that have already undergone performance enhancement scheduling.
[0200] For example, after the scheduling module performs performance enhancement scheduling on the image processing threads of at least some of the applications visible in the changed interface, if the duration of performance enhancement scheduling on the image processing threads of at least some of the applications visible in the changed interface reaches a first duration, the scheduling module can stop the performance enhancement scheduling of the threads that have already been scheduled. In this way, it can prevent the image processing threads of at least some of the applications visible in the changed interface from occupying hardware resources for a long time and affecting the operation of other threads.
[0201] In some embodiments, the first duration may be a preset duration. In this case, the scheduling module may record the duration of performance-enhancing scheduling of threads, and stop performance-enhancing scheduling of threads that have already been scheduled when the preset first duration is reached.
[0202] In some embodiments, the first duration can also be the duration from the start of performance enhancement scheduling to the cessation of the state change of the foldable electronic device. In this case, the scheduling module can stop performance enhancement scheduling for threads that have already undergone performance enhancement scheduling upon receiving the cessation information of the opening / closing state change sent by the opening / closing state detection module.
[0203] In some embodiments, the first duration may also be the duration from the start of performance boost scheduling to the completion of drawing and rendering of the animation corresponding to the changed interface (such as the aforementioned switching animation), or the total duration of the switching animation. In this case, the scheduling module may record the duration of performance boost scheduling for the thread, and stop performance boost scheduling for the thread that has already been scheduled when the duration reaches the total duration of the switching animation.
[0204] In some embodiments, stopping the performance boost scheduling of threads that have already undergone performance boost scheduling may involve restoring the priority of these threads to their state before the performance boost scheduling, and / or restoring the hardware resource configuration of these threads to their state before the performance boost scheduling. For example, in the case where the performance boost scheduling in step S806 increases the priority of the image processing thread of application A from the first priority to the second priority, the scheduling module can restore the image processing thread of application A from the second priority to the first priority. As another example, in the case where the performance boost scheduling in step S806 increases the operating frequency of the kernel running the image processing thread of application A from f0 to f1, the scheduling module can restore the operating frequency of the kernel running the image processing thread of application A to f0.
[0205] In some implementations, stopping performance boost scheduling for threads that have already undergone performance boost scheduling can also involve lowering the priority of those threads (the lowered priority can be the same as or different from the original priority) and / or reducing the hardware resource configuration of those threads (the reduced hardware resource configuration can be the same as or different from the original hardware resource configuration). For example, in the case where the performance boost scheduling in step S806 raises the priority of the image processing thread of application A from the first priority to the second priority, the scheduling module can lower the priority of the image processing thread of application A from the second priority to the third priority, where the third priority can be the same as or different from the first priority. As another example, in the case where the performance boost scheduling in step S806 raises the operating frequency of the kernel running the image processing thread of application A from f0 to f1, the scheduling module can lower the operating frequency of the kernel running the image processing thread of application A to f4, where f4 can be the same as or different from f1.
[0206] Based on the above method, when the foldable electronic device changes its open / closed state, it can promptly schedule the performance of the image processing threads of at least a portion of the visible applications on the changed interface, and provide sufficient hardware resources for these threads in a timely manner, thus avoiding lag in the user interface displayed by the foldable electronic device.
[0207] It should be noted that, Figure 8 The main components executing each step (e.g., the visible application identification module, scheduling module, opening / closing state detection module, etc.) are merely functional examples. In other embodiments, each step can also be implemented by other modules, multiple steps executed by different modules can be merged into one module, and the steps executed by one module can also be split into multiple modules; this is not limited here.
[0208] This application also provides a resource scheduling method, compared to... Figure 8In the illustrated embodiment, the opening / closing state scheduling module may not send opening / closing state change information to the scheduling module when it detects a change in opening / closing state. When the opening / closing state scheduling module detects that the folding angle has reached the animation display angle, it sends scheduling information to the scheduling module, enabling the scheduling module to perform performance-optimized scheduling of image processing threads for at least a portion of the visible applications on the changed interface.
[0209] For example, Figure 9 According to some embodiments of this application, a schematic diagram of the interaction flow of a resource scheduling method is shown. For example... Figure 9 As shown, the interaction process includes the following steps:
[0210] S901, the visible application identification module maintains the visible identifier of the application.
[0211] The visible application identification module can update the visibility identifier of each application on the foldable electronic device based on the application's operating status (e.g., running, switched to the background, switched to the foreground, closed, etc.). See the following for details. Figure 10 The process shown and the aforementioned step S801 will not be described in detail here.
[0212] S902, the scheduling module registers with the opening / closing state detection module to monitor the opening / closing state.
[0213] After the scheduling module starts running, it can register with the opening / closing state detection module to listen for opening / closing states. For details, please refer to step S802 above; it will not be repeated here.
[0214] S903, the opening / closing state detection module detects that the folding angle has reached the animation display angle and sends scheduling information to the scheduling module.
[0215] When the opening / closing state detection module detects that the folding angle has reached the animation display angle, it can send scheduling information to the scheduling module to notify the scheduling module that the foldable electronics are about to start generating and displaying the switching animation.
[0216] In some embodiments, the opening / closing state detection module may also send scheduling information to the scheduling module when it detects that the folding angle has reached a certain angle before the animation display angle. For example, the opening / closing state detection module may send scheduling information to the scheduling module when it detects that the folding angle has increased to a certain angle less than the aforementioned first animation display angle; the opening / closing state detection module may send scheduling information to the scheduling module when it detects that the folding angle has increased to a certain angle greater than the aforementioned second animation display angle.
[0217] It should be noted that the method by which the opening / closing state detection module detects that the folding angle has reached the animation display angle can be referred to the aforementioned method. Figure 4 The details of step S603 will not be elaborated here.
[0218] S904, the scheduling module obtains visible application information from the visible application identification module.
[0219] After receiving the scheduling information, the scheduling module can respond by obtaining visible application information from the visible application identification module. The specific form of the visible application information can be referred to in the aforementioned step S804, and will not be elaborated here.
[0220] S905, the scheduling module performs performance-enhancing scheduling for image processing threads of at least a portion of the visible applications in the changed interface.
[0221] After obtaining the visible application information, the scheduling module can first determine the visible applications of the changed interface based on the visible application information. For details, please refer to the aforementioned step S806, which will not be repeated here.
[0222] S906, the opening / closing state detection module detects that the opening / closing state change of the foldable electronic device has stopped and sends the opening / closing state change stop information to the scheduling module.
[0223] For example, after detecting a change in the opening / closing state of the foldable electronic device, if the change in opening / closing state is detected to have stopped, the opening / closing state detection module can send an information indicating that the change in opening / closing state has stopped to the scheduling module. For details, please refer to the aforementioned step S807, which will not be elaborated upon here.
[0224] It should be noted that step S906 is optional.
[0225] S907, the scheduling module stops performance enhancement scheduling for threads that have already undergone performance enhancement scheduling.
[0226] For example, after the scheduling module performs performance enhancement scheduling on the image processing threads of at least some of the visible applications of the changed interface, if the duration of performance enhancement scheduling on the image processing threads of at least some of the visible applications of the changed interface reaches a first duration, the scheduling module can stop the performance enhancement scheduling of the threads that have already been scheduled. This avoids the image processing threads of at least some of the visible applications of the changed interface occupying hardware resources for an extended period, affecting the operation of other threads. For details, please refer to the aforementioned step S808, which will not be elaborated upon here.
[0227] Based on the above method, when the foldable electronic device changes its open / closed state, it can promptly schedule the performance of the image processing threads of at least a portion of the visible applications on the changed interface, and provide sufficient hardware resources for these threads in a timely manner, thus avoiding lag in the user interface displayed by the foldable electronic device.
[0228] It should be noted that, Figure 9The main components executing each step (e.g., the visible application identification module, scheduling module, opening / closing state detection module, etc.) are merely functional examples. In other embodiments, each step can also be implemented by other modules, multiple steps executed by different modules can be merged into one module, and the steps executed by one module can also be split into multiple modules; this is not limited here.
[0229] The following describes a process in which the visible application identification module maintains the visible identifier of an application in the aforementioned step S801.
[0230] In some embodiments, the visible application identification module can configure a visible identifier for an application in a running state, and configure the attribute of the visible identifier of the application to be visible when the application is running in the foreground; and configure the attribute of the visible identifier of the application to be invisible when the application is running in the background.
[0231] In some embodiments, the visible identifier can be an identifier added to the application when the application starts.
[0232] In some embodiments, the visible identifier can be an identifier that is pre-configured for all applications installed on the foldable electronic device.
[0233] For example, Figure 10 According to some embodiments of this application, a flowchart illustrating a visible application identification module maintaining the visible identifier of an application is shown. Figure 10 As shown, the process includes the following steps:
[0234] S801A detects that the application has started and configures the application's attribute to a visible identifier.
[0235] When the application recognition module detects that an application has been launched, such as when it detects a user launching an application, it can configure the application with a visible identifier, which is equivalent to marking the application as a visible application.
[0236] It should be noted that for some applications that do not have a display interface, the visible application identification module may not configure a visible identifier for these applications.
[0237] S801B determines whether an application has switched to running in the background.
[0238] During the operation of an already launched application, the application identification module can determine whether each application is running in the foreground or background. When the application identification module determines that an application has switched from the foreground to the background, it indicates that the application may no longer display its interface, and the process proceeds to step S801C; when it determines that an application has not switched from the foreground to the background, it indicates that the application may continue to display its interface, and the process proceeds to step S801D.
[0239] In some embodiments, the visible application identification module can periodically or periodically determine whether each application has switched to the background. For example, the visible application identification module can obtain the running status of running applications through an interface provided by the operating system of the foldable electronic device for querying the running status of applications (such as the interface provided by AM mentioned above). Then, if the visible application identification module finds that an application with a visible identifier attribute of visible is running in the background, it can determine that the application has switched to the background.
[0240] In some embodiments, the visible application identification module can also determine that an application has been switched to the background if it detects that the user has switched the application to the background.
[0241] In some embodiments, the aforementioned AM can also transmit the application's running state to the application when it detects a change in the application's running state. Thus, the application identification module can determine that the application has switched to the background when it receives a visible identifier indicating that the application is running in the background.
[0242] S801C configures the attribute of the visible identifier to be invisible.
[0243] It is evident that when the application identification module determines that an application has switched to running in the background, it configures the visibility identifier attribute of that application to be invisible.
[0244] S801D configures the attribute of the visible identifier to be visible.
[0245] When the application identification module determines that an application has not been switched to the background (which is equivalent to the application being kept in the foreground), it configures the visibility attribute of the application to be visible.
[0246] S801E determines whether the application is closed.
[0247] The application identification module is used to determine whether an application is closed. If an application is determined to be closed, it means that the application will no longer display the interface, and the process proceeds to step S801G; if an application is determined not to be closed, it means that the application will continue to display the interface, and the process proceeds to step S801F.
[0248] In some embodiments, the visible application identification module can periodically or periodically determine whether an application is closed. For example, the visible application identification module can obtain a list of currently running applications through an interface provided by the operating system of the foldable electronic device for querying currently running applications (such as the interface provided by AM mentioned above). If an application is not in the list of currently running applications, it can be determined that the application is closed; if an application is in the list of currently running applications, it can be determined that the application is not closed.
[0249] In some embodiments, the application identification module can determine that an application is closed if it detects that the user has closed the application; conversely, the application identification module can also determine that an application is not closed if it does not detect that the user has closed the application.
[0250] In some embodiments, the aforementioned AM can also transmit application closure information to the application upon detecting that the application has been closed. Therefore, the application identification module can determine that an application is closed upon receiving information indicating that an application has been closed; conversely, the application identification module can determine that an application is not closed even if it does not receive information indicating that an application has been closed.
[0251] S801F preserves the visible identifier of the application.
[0252] It is evident that if the application identification module determines that the application is not closed, it retains the application's visibility identifier and repeats steps S801B to S801F.
[0253] S801G, remove the visible identifier of the application.
[0254] When the application identification module determines that the application is closed, it deletes the application's visibility identifier, thus ending the maintenance of the application's visibility identifier.
[0255] In some embodiments, the visible application identification module may, when determining that the application is closed, not delete the application's visibility identifier, but instead adjust the attribute of the application's visibility identifier to invisible.
[0256] It should be noted that the execution order of steps S801A to S801G described above is only an example. In other embodiments, the execution order of some steps can be adjusted, which is not limited here. For example, steps S801 to S801F can be run before steps S801B to S801D, and after running step S801F, the execution proceeds to step S801B, and after running steps S801C and S801D, the execution proceeds to step S801F.
[0257] It should be noted that the process of the visible application identification module maintaining the visible identifier of an application as shown in steps S801A to S801G above is only an example. In other embodiments, the visible application identification module may also maintain the visible identifier of a visible application in other ways, which are not limited here. For example, when the application starts, the visible application identification module can determine a visible identifier with the attribute of "invisible" for the application, and switch the attribute of the application's visible identifier to "visible" when it detects that the application has switched from the background to the foreground.
[0258] This application also provides a resource scheduling method, which helps to alleviate or avoid interface lag during the opening and closing state changes of foldable electronic devices.
[0259] Figure 11 According to some embodiments of this application, a flowchart of a resource scheduling method is shown. The subject of this method is a foldable electronic device. Figure 11 As shown, the method includes the following steps.
[0260] S1101, A change in the opening / closing state of the foldable electronic device has been detected.
[0261] The foldable electronic device can trigger the resource scheduling method provided in this application embodiment when it detects a change in the opening or closing state of the foldable electronic device. The specific method by which the foldable electronic device detects the change in the opening or closing state of the foldable electronic device can be referred to the contents of the aforementioned steps S601, S802 and S803, and steps S902 and S903, and will not be repeated here.
[0262] S1102, resource scheduling is performed on at least one image processing task of the first application using a first scheduling method.
[0263] After detecting a change in the opening or closing state of the foldable electronic device, the foldable electronic device can perform resource scheduling for at least one image processing task of the first application through a first scheduling method.
[0264] In some embodiments, the first scheduling method may be the aforementioned performance-enhancing scheduling.
[0265] In some embodiments, the first application may be the visible application of the aforementioned modified interface.
[0266] In some embodiments, the image processing task of the first application may be the aforementioned image processing thread or image processing process.
[0267] In some embodiments, the foldable electronic device can schedule resources for at least one image processing task of a first application using a first scheduling method, provided that the first application meets scheduling conditions. For example, the scheduling conditions may include at least one of the following:
[0268] The hardware resources used or expected to be used by the first application (e.g., processor utilization) exceed a preset resource threshold (also known as the first threshold).
[0269] The first application is one of the top N applications among the M applications running on the foldable electronic device, ranked from most to least according to the amount of hardware resources they occupy (e.g., processor utilization) or the amount of hardware resources they are expected to occupy.
[0270] The first application is one of the applications listed in the aforementioned application whitelist.
[0271] In some embodiments, after detecting a change in the opening or closing state of the foldable electronic device, the first application can be determined based on the aforementioned steps S602, S804, or S904.
[0272] S1103, Stop resource scheduling for at least one image processing task using the first scheduling method.
[0273] In some embodiments, after the duration of resource scheduling for at least one image processing task using the first scheduling method reaches a first duration, the foldable electronic device may stop scheduling resources for at least one image processing task using the first scheduling method. The definition of the first duration can refer to the aforementioned steps S604, S808, and S907, and will not be repeated here.
[0274] Based on the above method, when a change in the opening or closing state is detected, the foldable electronic device can provide sufficient resources for at least one image processing task of the first application in a timely manner by scheduling resources for at least one image processing task of the first application through a first scheduling method. This can ensure that the first application can draw and render the content to be displayed in a timely manner, which helps to alleviate or avoid the interface lag displayed by the foldable electronic device.
[0275] This application provides a program product that, when executed on an electronic device, enables the electronic device to implement the resource scheduling methods provided in the foregoing embodiments.
[0276] This application also provides a readable storage medium storing one or more programs / instructions, which, when executed by an electronic device, enable the electronic device to implement the resource scheduling methods provided in the foregoing embodiments.
[0277] further, Figure 12 According to some embodiments of this application, a structural schematic diagram of a mobile phone 10 is shown.
[0278] like Figure 12As shown, the mobile phone 10 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, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, an angle sensor 180N, etc.
[0279] Processor 110 may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem scheduling processor, a graphics processing unit (GPU), an image signal processor (ISP), a microcontroller unit (MCU), a video codec, a digital signal processor (DSP), a baseband processor, a neural network processing unit (NPU), a field-programmable gate array (FPGA), etc. In some embodiments, different processing units may be independent devices or integrated into one or more processors.
[0280] The processor 110 may also include a memory for storing one or more programs and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store one or more programs or data that the processor 110 has just used or is reusing. When the processor 110 needs to use the one or more programs or data again, it can retrieve them directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0281] In some embodiments, the processor 110 may be used to execute one or more programs / instructions corresponding to the resource scheduling methods provided in the foregoing embodiments.
[0282] The charging management module 140 receives charging input from the charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.
[0283] 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, internal memory 121, display 194, camera 193, and wireless communication module 160, etc.
[0284] The wireless communication function of mobile phone 10 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem scheduling processor and baseband processor.
[0285] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0286] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G on the mobile phone 10. The mobile communication module 150 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem / demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem / demodulation processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0287] The wireless communication module 160 can provide solutions for wireless communication applications on the mobile phone 10, including wireless local area networks (WLAN) (such as Wi-Fi), Bluetooth (BT), global navigation satellite system (GNSS), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0288] The mobile phone 10 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0289] The display screen 194 is used to display images. In some embodiments, there may be one or more display screens 194, and at least one display screen 194 is a flexible screen (also known as a foldable screen).
[0290] Camera 193 is used to capture still images or videos.
[0291] The external memory interface 120 can be used to connect an external memory card. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, application data can be stored on the external memory card.
[0292] Internal memory 121 can be used to store one or more programs and corresponding data. Internal memory 121 may include a program storage area and a data storage area. In some embodiments, the program storage area may store the operating system, applications required for at least one function, such as programs / instructions corresponding to the resource scheduling methods provided in the foregoing embodiments. The data storage area may store data created during the use of mobile phone 10. In addition, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, general flash memory, etc. Processor 110 executes various functional applications of mobile phone 10 by running one or more programs stored in internal memory 121 and / or one or more programs stored in memory disposed in processor 110.
[0293] The phone 10 can achieve audio functions, such as music playback, through an audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0294] Audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 170 can also be used for audio signal encoding and decoding. Speaker 170A, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. Receiver 170B, also called a "handset," is used to convert audio electrical signals into sound signals. Microphone 170C, also called a "microphone" or "microphone unit," is used to convert sound signals into electrical signals. Headphone jack 170D is used to connect wired headphones.
[0295] An angle sensor 180N is used to detect the folding angle of the mobile phone 10. In some embodiments, the angle sensor 180N can transmit the detected folding angle data of the mobile phone 10 to the processor 110.
[0296] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Mobile phone 10 can receive button input and generate key signal inputs related to user settings and function control of mobile phone 10.
[0297] Motor 191 can generate vibration as a notification. Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, notifications, etc.
[0298] The SIM card interface 195 is used to connect a SIM card or eSIM.
[0299] It should be noted that the structure of the mobile phone 10 shown in the embodiments of this application does not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than shown, or combine some components, or split some components, or have different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0300] It should be noted that the mobile phone 20 or other foldable electronic devices may adopt the same or similar structure as the mobile phone 10, or may adopt other structures, which are not limited here.
[0301] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0302] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
Claims
1. A resource scheduling method applied to a foldable electronic device, characterized in that, The method comprises: detecting that the open-close state of the foldable electronic device changes; scheduling resources for at least one image processing task of a first application by a first scheduling mode, wherein the first application is an application displayed after the open-close state of the foldable electronic device changes, and the image processing task comprises a thread and / or a process for executing the image processing, the first scheduling mode comprises at least one of the following: increasing the hardware resource configuration corresponding to the at least one image processing task, and increasing the priority of the at least one image processing task; stopping scheduling resources for the at least one image processing task by the first scheduling mode.
2. The method of claim 1, the first application comprising a first identification, wherein, The first identifier is used to indicate whether the first application is displayed in the foreground, and the first identifier is a first attribute when the first application is running in the foreground and a second attribute when the first application is running in the background.
3. The method of claim 2, wherein, The scheduling resources for the at least one image processing task of the first application by the first scheduling mode comprises: scheduling resources for the at least one image processing task of the first application by the first scheduling mode when the first identifier of the first application is the first attribute.
4. The method according to claim 2 or 3, characterized in that, Before the scheduling resources for the at least one image processing task of the first application by the first scheduling mode, the method further comprises: adjusting the first identifier of the first application to the first attribute after the first application is started.
5. The method according to any one of claims 2 to 4, characterized in that, The method further comprises: adjusting the first identifier of the first application to the second attribute when the application program running in the foreground of the foldable electronic device does not include the first application, or detecting an operation of switching the first application from running in the foreground to running in the background by the user; and / or, adjusting the first identifier of the first application to the first attribute when the application program running in the foreground of the foldable electronic device includes the first application, or detecting an operation of switching the first application from running in the background to running in the foreground by the user; and / or, deleting the first identifier of the first application or adjusting the first identifier of the first application to the second attribute when an operation of closing the first application by the user.
6. The method according to any one of claims 1 to 5, characterized in that, The first application satisfies at least one of the following conditions: The hardware resources occupied by the first application are greater than a preset first threshold value; The first application is one of the first N applications in the order of the hardware resources occupied from more to less among M applications running on the foldable electronic device, wherein M and N are positive integers, and N is less than M; The first application is an application in an application white list.
7. The method according to any one of claims 1 to 6, characterized in that, The foldable electronic device runs a second application before the open-close state changes, the first application is an associated display application of the second application, and the first application is not displayed before the open-close state of the foldable electronic device changes.
8. The method according to any one of claims 1 to 7, characterized in that, The increasing the hardware resource configuration of the at least one image processing task comprises at least one of the following: increasing the working frequency of a core running the at least one image processing task in a processor of the foldable electronic device from a first frequency to a second frequency; binding the at least one image processing task to run on one or more cores of the processor; scheduling the at least one image processing task to run on a second core of the processor by a first core of the processor, wherein the second core has a higher computing performance than the first core.
9. The method according to any one of claims 1 to 8, characterized in that, The resource scheduling of the at least one image processing task of the first application by the first scheduling mode comprises: detecting that the folding angle of the foldable electronic device changes to a first angle, and scheduling resources of the at least one image processing task by the first scheduling mode; wherein: corresponding to the folding angle of the foldable electronic device increasing to the first angle, the first angle is less than or equal to a second angle, and the second angle is the folding angle of the foldable electronic device when the foldable electronic device starts to display the interface of the first application; corresponding to the folding angle of the foldable electronic device decreasing to the first angle, the first angle is greater than or equal to a third angle, and the third angle is the folding angle of the foldable electronic device when the foldable electronic device starts to display the interface of the first application.
10. The method according to any one of claims 1 to 9, characterized in that, The foldable electronic device comprises a first screen and a second screen, wherein before the opening and closing state of the foldable electronic device changes, the foldable electronic device displays a picture through the first screen and the second screen is closed; The resource scheduling of the at least one image processing task of the first application by the first scheduling mode comprises: detecting that the second screen is opened, and scheduling resources of the at least one image processing task by the first scheduling mode.
11. The method according to any one of claims 2 to 5, characterized in that, The stopping of the resource scheduling of the at least one image processing task by the first scheduling mode comprises: in a case where the duration of the first scheduling mode reaches a first duration, stopping the resource scheduling of the at least one image processing by the first scheduling mode; wherein: the first duration is a preset duration; or, the first duration is the duration between a first time point when the resource scheduling of the at least one image processing task by the first scheduling mode starts and a second time point when the change of the opening and closing state of the foldable electronic device stops; or, corresponding to the display of a first animation including the display content of the first application after the change of the opening and closing state of the foldable electronic device, the first duration is the duration between the first time point and a third time point when the first animation is drawn and rendered; or, the first duration is the duration of the first animation.
12. The method according to any one of claims 1 to 11, characterized in that, The stopping of the resource scheduling of the at least one image processing task by the first scheduling mode comprises at least one of the following: reducing the hardware resource configuration corresponding to the at least one image processing task, and reducing the priority of the at least one image processing task.
13. An electronic device, comprising: comprise: a memory for storing one or more programs; a processor for executing the one or more programs to enable the electronic device to implement the resource scheduling method of any one of claims 1 to 12.
14. A readable storage medium, characterized by, The readable storage medium comprises one or more programs, and the one or more programs enable the electronic device to implement the resource scheduling method in any one of claims 1 to 12 when the one or more programs are executed on the electronic device.
15. A program product, characterized by The program product enables the electronic device to implement the resource scheduling method in any one of claims 1 to 12 when the program product is run on the electronic device.