Refresh rate switching methods, software products, electronic devices and storage media

By adjusting the screen refresh rate when the electronic device is not in the process of disabling/enabling the discrete graphics card, the problems of stuttering and black screen during screen refresh rate setting are solved, resulting in a smoother user experience and reduced power consumption, as well as improved refresh rate switching speed and reliability.

CN120766634BActive Publication Date: 2026-05-26HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-06-28
Publication Date
2026-05-26

Smart Images

  • Figure CN120766634B_ABST
    Figure CN120766634B_ABST
Patent Text Reader

Abstract

This application relates to the field of display technology, providing a refresh rate switching method, software program product, electronic device, and storage medium. It is applied to an electronic device, including both discrete and integrated graphics cards, and the display mode of the electronic device includes discrete graphics only. The method includes: the electronic device receiving a user operation and displaying the corresponding application window; after the displayed application window becomes the focus window, if the electronic device is not in the process of disabling / enabling the discrete graphics card, the electronic device adjusts the screen refresh rate; if the electronic device is in the process of disabling / enabling the discrete graphics card, the electronic device does not adjust the screen refresh rate. Therefore, it avoids switching the screen refresh rate during the process of disabling / enabling the discrete graphics card, thereby avoiding integrated graphics driver malfunctions and ensuring a better user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of display technology, and more particularly to a refresh rate switching method, software program product, electronic device, and storage medium. Background Technology

[0002] In the use of electronic devices, to ensure a good user experience while reducing screen power consumption, existing technologies can adaptively adjust the screen refresh rate according to different application scenarios. For example, for gaming applications that require a higher refresh rate, electronic devices need to set the screen refresh rate to a higher level to ensure a smoother visual experience and smoother user operation. However, for applications involving documents or web pages, a lower screen refresh rate will not affect the user's browsing and operation experience; therefore, a lower refresh rate can be selected to reduce screen power consumption.

[0003] However, during the current screen refresh rate setting process, electronic devices are prone to display abnormalities such as stuttering and black screens, resulting in a poor user experience. Summary of the Invention

[0004] This application provides a refresh rate switching method, software program product, electronic device, and storage medium to avoid display abnormalities in electronic devices and ensure user experience during the screen refresh rate setting process.

[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0006] In a first aspect, a refresh rate switching method is provided. The electronic device includes a discrete graphics card and an integrated graphics card. The method includes: at a first moment, displaying a window of a first application, where the window of the first application is the focus window and the screen refresh rate is a first value; at a second moment, receiving a first operation to display a window of a second application, where, after the second moment, the window of the second application is the focus window and the screen refresh rate is a second value, which is different from the first value; at a third moment, receiving a second operation to display the window of the first application, where, after the third moment, the window of the first application is the focus window and the screen refresh rate is the first value, and between the first and third moments, the electronic device is not in the process of disabling / enabling the discrete graphics card; at a fourth moment, starting to disable / enable the discrete graphics card of the electronic device; at a fifth moment, receiving a third operation to display the window of the second application, where, after the fifth moment, the window of the second application is the focus window and the screen refresh rate is the first value; at a sixth moment, completing the disabling / enabling of the discrete graphics card of the electronic device, where, between the fourth and sixth moments, the electronic device is in the process of disabling / enabling the discrete graphics card; the fifth moment is between the fourth and sixth moments.

[0007] Because adjusting the screen refresh rate during the process of disabling / enabling the dedicated graphics card can cause integrated graphics driver errors, this implementation only adjusts the screen refresh rate when the electronic device is not in the process of disabling / enabling the dedicated graphics card. When the electronic device is in the process of disabling / enabling the dedicated graphics card, it does not adjust the screen refresh rate. This avoids display anomalies such as stuttering and black screens caused by integrated graphics driver errors, ensuring a better user experience.

[0008] In one possible implementation of the first aspect, the refresh rate switching method may further include: at a second moment, based on the fact that the electronic device is not in the process of disabling / enabling the dedicated graphics card, adjusting the screen refresh rate to a second value; and at a third moment, based on the fact that the electronic device is not in the process of disabling / enabling the dedicated graphics card, adjusting the screen refresh rate to a first value. When the electronic device is not in the process of disabling / enabling the dedicated graphics card, the electronic device adjusts the screen refresh rate normally.

[0009] In one possible implementation of the first aspect, the display mode of the electronic device includes a hybrid mode, in which a discrete graphics card and an integrated graphics card are switched on or mixed for output. Based on this, setting the screen refresh rate to a second value includes: waking up the discrete graphics card of the electronic device before setting the screen refresh rate to the second value when the display mode of the electronic device is in hybrid mode and the device is currently in a video playback scenario; and setting the screen refresh rate to a first value includes: waking up the discrete graphics card of the electronic device before setting the screen refresh rate to the first value when the display mode of the electronic device is in hybrid mode and the device is currently in a video playback scenario.

[0010] If adjusting the screen refresh rate triggers the dedicated graphics card to wake up, it can further cause video playback to freeze (stutter). Therefore, in mixed-mode video playback scenarios, the dedicated graphics card of the electronic device should be woken up in advance before adjusting the screen refresh rate. This can prevent video playback from freezing and ensure a better user experience.

[0011] In one possible implementation of the first aspect, the refresh rate switching method may further include: at the fifth moment, based on the electronic device being in the process of disabling / enabling the discrete graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is a first value. The electronic device does not adjust the screen refresh rate while it is in the process of disabling / enabling the discrete graphics card.

[0012] In one possible implementation of the first aspect, the refresh rate switching method may further include: at a second moment, based on the window of the second application becoming the focus window, setting the screen refresh rate to a second value; and at a third moment, based on the window of the first application becoming the focus window, setting the screen refresh rate to a first value.

[0013] When the focus window (application scenario) of an electronic device changes, the electronic device adjusts the screen refresh rate to match the focus window (application scenario), thereby ensuring smooth visuals while reducing screen power consumption.

[0014] In one possible implementation of the first aspect, the refresh rate switching method may further include: reading an adjustment flag; and determining whether the electronic device is in the process of disabling / enabling the discrete graphics card based on the adjustment flag.

[0015] By recording the corresponding adjustment flags, it is possible to directly determine whether an electronic device is in the process of disabling / enabling the discrete graphics card, thereby improving the processing speed. If the refresh rate needs to be adjusted, the adjustment speed can also be improved.

[0016] In one possible implementation of the first aspect, the refresh rate switching method may further include: when starting to disable / enable the discrete graphics card of the electronic device, setting an adjustment flag to a first state value, the first state value being used to indicate that the electronic device is in the process of disabling / enabling the discrete graphics card; and when the disabling / enabling of the discrete graphics card of the electronic device is completed, setting an adjustment flag to a second state value, the second state value being used to indicate that the electronic device is not in the process of disabling / enabling the discrete graphics card.

[0017] In one possible implementation of the first aspect, the display mode of the electronic device includes discrete graphics only; the electronic device also includes a user experience (UX) switch and / or a high dynamic range (HDR) switch; wherein the UX switch is used to control the on / off adjustment of the screen refresh rate; the HDR switch is used to control the on / off adjustment of the HDR function of the electronic device; the refresh rate switching method may further include: between a first moment and a third moment, the UX switch is in the UX switch-on state, the HDR switch is in the HDR switch-off state, and the display mode of the electronic device is not discrete graphics only. This can avoid the brief black screen phenomenon caused by the conflict between direct connection to the discrete graphics card and HDR activation and screen refresh adjustment.

[0018] In one possible implementation of the first aspect, at a second moment, based on the fact that the electronic device is not in the process of disabling / enabling the discrete graphics card, the screen refresh rate is adjusted and set to a second value, including: at the second moment, obtaining the screen refresh rate corresponding to the second application from a preset file to obtain the second value; adjusting the screen refresh rate based on the fact that the electronic device is not in the process of disabling / enabling the discrete graphics card and setting the screen refresh rate to the second value.

[0019] The screen refresh rate for different applications can be pre-configured in a preset file. When the focus window (application scenario) changes, the screen refresh rate of the application (e.g., a second application) can be determined directly from the preset file, thus obtaining the value that needs to be adjusted. For example, if the screen refresh rate for an application is 120Hz, then the corresponding value is 120.

[0020] In one possible implementation of the first aspect, at the fifth moment, based on the electronic device being in the process of disabling / enabling the dedicated graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is a first value. This includes: at the fifth moment, obtaining the screen refresh rate corresponding to the second application from a preset file to obtain the second value; based on the electronic device being in the process of disabling / enabling the dedicated graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is the first value. The screen refresh rate corresponding to the application (i.e., the focused window) can be directly obtained from the preset file, thereby obtaining the value that needs to be adjusted.

[0021] In one possible implementation of the first aspect, at a second moment, when the window of the second application becomes the focus window and the screen refresh rate is set to a second value, the process includes: acquiring a focus window change event; if the focus window change event is not a focus window change event of a preset application scenario, and if it is determined from the focus change event that the application scenario of the second application is different from that of the first application, then the window of the second application becomes the focus window and the screen refresh rate is set to the second value; if the focus window change event is a focus window change event of a preset application scenario, then the window of the second application becomes the focus window and the screen refresh rate is set to the second value; the second value corresponds to the screen refresh rate of the preset application scenario.

[0022] This can be achieved by subscribing to focus change events to monitor whether the focus window has changed. Furthermore, for applications like games that have high requirements for refresh rate switching speeds (i.e., default application scenarios), focus window change events can be subscribed to separately. For these types of focus window change events, the screen refresh rate can be set directly if it's certain that it can be adjusted, without scene filtering, thus saving processing time and allowing for faster screen refresh rate switching.

[0023] In one possible implementation of the first aspect, the refresh rate switching method may further include: at a second moment, when the second application is not a self-refreshing application and the application scenario of the second application is not a preset application scenario, adjusting the screen refresh rate and setting the screen refresh rate to a second value; at a third moment, when the first application is not a self-refreshing application and the application scenario of the first application is not a preset application scenario, adjusting the screen refresh rate and setting the screen refresh rate to a first value.

[0024] Because some applications automatically refresh when set, adjusting the screen refresh rate after one of these applications becomes the focus window will cause them to refresh again. The more frequently the screen refresh rate is adjusted, the more frequently applications will refresh, resulting in a poor user experience. Therefore, it's advisable to pre-select these self-refreshing applications using a whitelist before setting the refresh rate, preventing screen refresh rate adjustments and ensuring a better user experience.

[0025] Meanwhile, because preset application scenarios require rapid screen refresh rate adjustments, when the changed application scenario is a preset scenario (i.e., a high-priority application), checking whether the application is a self-refreshing application can be skipped, thus improving processing speed. For example, if the second application is a preset scenario, it will not be checked for self-refreshing applications (e.g., no whitelist check), which could lead to situations where the screen refresh rate is adjusted even if the second application is a self-refreshing application. In other words, if the second application is a preset scenario, the screen refresh rate is adjusted without checking whether it is a self-refreshing application (if other conditional checks are in place, the process of adjusting the screen refresh rate continues). If the second application is not a preset scenario, it is checked whether it is a self-refreshing application. If it is, the screen refresh rate is not adjusted to prevent it from affecting the user experience; if it is not, the screen refresh rate is adjusted (if other conditional checks are in place, the process of adjusting the screen refresh rate continues).

[0026] In one possible implementation of the first aspect, the refresh rate switching method may further include: loading a preset whitelist; when the whitelist includes a first application, the first application is not a self-refreshing application, and when the whitelist does not include the first application, the first application is a self-refreshing application; or, when the whitelist includes a second application, the second application is not a self-refreshing application, and when the whitelist does not include the second application, the second application is a self-refreshing application.

[0027] In one possible implementation of the first aspect, the refresh rate switching method may further include: at a second moment, when the input device based on the electronic device is idle and the application scenario of the second application is not a preset application scenario, adjusting the screen refresh rate and setting the screen refresh rate to a second value; at a third moment, when the input device based on the electronic device is idle and the application scenario of the first application is not a preset application scenario, adjusting the screen refresh rate and setting the screen refresh rate to a first value; the input device includes a keyboard and a mouse.

[0028] Current operating systems have a mouse centering mechanism. If the screen refresh rate is adjusted, it triggers mouse centering immediately after the adjustment, causing a change in mouse position before and after the refresh rate setting, resulting in a poor user experience. Therefore, adjusting the screen refresh rate after checking if the input device is idle avoids mouse centering, ensuring a seamless user experience. Furthermore, since preset application scenarios require rapid screen refresh rate adjustments, if the changed application scenario is a preset scenario (i.e., a high-priority application), the input device idle check can be skipped before adjusting the screen refresh rate, thus improving processing speed. In other words, if the second application is a preset scenario, the periodic input device idle check is skipped, and the screen refresh rate is adjusted immediately (if other conditions are met, the subsequent screen refresh rate adjustment process continues). However, if the second application is not a preset scenario, the periodic input device idle check is required, and the screen refresh rate is adjusted only after the input device is idle.

[0029] In one possible implementation of the first aspect, the refresh rate switching method may further include: increasing the power limit before setting the screen refresh rate. The power limit is the maximum power that the electronic device can use during operation, and the power limit includes a long-term power limit. Therefore, by increasing the power limit, the performance of the electronic device can be improved, ensuring the reliability of screen refresh rate adjustment.

[0030] Secondly, this application provides a refresh rate switching method applied to an electronic device, which includes a discrete graphics card and an integrated graphics card; the display mode of the electronic device includes a mixed mode, in which the discrete graphics card and the integrated graphics card switch between use or output in a mixed manner; the method includes:

[0031] At the first moment, the window of the first application is displayed, and at the first moment, the window of the first application is the focused window, and the screen refresh rate is a first value. At the second moment, the first operation is received, the window of the second application is displayed, and the dedicated graphics card is woken up. After the second moment, the window of the second application is the focused window, and the screen refresh rate is a second value, which is different from the first value. At the third moment, the second operation is received, the window of the first application is displayed, and the dedicated graphics card is woken up. After the third moment, the window of the first application is the focused window, and the screen refresh rate is the first value. At the second and third moments, the display mode of the electronic device is a mixed mode and it is in a video playback scene.

[0032] If adjusting the screen refresh rate triggers the dedicated graphics card to wake up, it can further cause video playback to freeze (stutter). Therefore, in mixed-mode video playback scenarios, the dedicated graphics card of the electronic device should be woken up in advance before adjusting the screen refresh rate. This can prevent video playback from freezing and ensure a better user experience.

[0033] In one possible implementation of the second aspect, the refresh rate switching method may further include: monitoring the video stream; and determining that the electronic device is in a video playback scenario when a video stream is detected.

[0034] In one possible implementation of the second aspect, the refresh rate switching method may further include: at a second moment, based on the display mode of the electronic device being a mixed mode and in a video playback scenario, and after waking up the discrete graphics card, adjusting the screen refresh rate and setting the screen refresh rate to a second value.

[0035] In the third moment, based on the electronic device's display mode being in mixed mode and in a video playback scenario, and after waking up the dedicated graphics card, the screen refresh rate is adjusted and set to the first value. This avoids screen freezing during video playback by waking up the dedicated graphics card before adjusting the refresh rate, ensuring a better user experience.

[0036] In one possible implementation of the second aspect, the refresh rate switching method may further include: at a second moment, based on the window of the second application becoming the focus window, setting the screen refresh rate to a second value; and at a third moment, based on the window of the first application becoming the focus window, setting the screen refresh rate to a first value.

[0037] In one possible implementation of the second aspect, the electronic device further includes a User Experience (UX) switch and / or a High Dynamic Range (HDR) switch; wherein the UX switch is used to control the on / off adjustment of the screen refresh rate; the HDR switch is used to control the on / off adjustment of the HDR function of the electronic device; the refresh rate switching method may further include: at a second moment and a third moment, the UX switch is in the UX switch-on state, and the HDR switch is in the HDR switch-off state. This can avoid a brief black screen phenomenon caused by the conflict between HDR being enabled and screen refresh rate adjustment.

[0038] In one possible implementation of the second aspect, the refresh rate switching method may further include: obtaining a second value by retrieving the screen refresh rate corresponding to the second application from a preset file; and obtaining a first value by retrieving the screen refresh rate corresponding to the first application from a preset file.

[0039] Thirdly, a software program product is provided, comprising a software program that, when executed by a processor in an electronic device, causes the electronic device to perform a refresh rate switching method, the method comprising the following steps:

[0040] At the first moment, when the window of the first application becomes the focus window, the screen refresh rate is set to the first value;

[0041] At the second moment, when the window of the second application becomes the focused window, the screen refresh rate is set to the second value; wherein, between the first and second moments, the electronic device is not in the process of disabling / enabling the dedicated graphics card; the first value and the second value are different;

[0042] In the third moment, notify the user to disable / enable the dedicated graphics card of the electronic device;

[0043] In the fourth moment, when the window of the first application becomes the focus window, the screen refresh rate is not adjusted;

[0044] At the fifth moment, it is determined that the disabling / enabling of the discrete graphics card of the electronic device has been completed; the fourth moment is between the third and fifth moments.

[0045] In one possible implementation of the third aspect, the display mode of the electronic device includes a hybrid mode, in which the discrete graphics card and the integrated graphics card are switched on or mixed for output; when the aforementioned software program is executed by the processor, the electronic device further performs the following steps:

[0046] When the electronic device's display mode is in mixed mode and it is currently playing a video, the device's dedicated graphics card is activated before the screen refresh rate is set from the first value to the second value.

[0047] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: at a second moment, based on the fact that the electronic device is not in the process of disabling / enabling the discrete graphics card, the screen refresh rate is adjusted and set to a second value.

[0048] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: at a fourth moment, based on the electronic device being in the process of disabling / enabling the discrete graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is a second value.

[0049] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: at a second moment, the window based on the second application is changed to the focus window, and the screen refresh rate is set to a second value.

[0050] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: reading the adjustment flag bit; and determining, based on the adjustment flag bit, whether the electronic device is in the process of disabling / enabling the discrete graphics card.

[0051] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: when starting to disable / enable the discrete graphics card of the electronic device, setting an adjustment flag to a first state value, the first state value being used to indicate that the electronic device is in the process of disabling / enabling the discrete graphics card; when the disabling / enabling of the discrete graphics card of the electronic device is completed, setting an adjustment flag to a second state value, the second state value being used to indicate that the electronic device is not in the process of disabling / enabling the discrete graphics card.

[0052] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: at a second moment, obtaining the screen refresh rate corresponding to the second application from a preset file to obtain a second value; and adjusting the screen refresh rate based on the fact that the electronic device is not in the process of disabling / enabling the discrete graphics card, setting the screen refresh rate to the second value.

[0053] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: at a fourth moment, the screen refresh rate corresponding to the first application is obtained from a preset file to obtain a first value; based on the electronic device being in the process of disabling / enabling the discrete graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is a second value.

[0054] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: acquiring a focus window change event; when the focus window change event is not a focus window change event of a preset application scenario, and if it is determined from the focus change event that the application scenario of the second application is different from that of the first application, the screen refresh rate is set to a second value based on the window of the second application becoming the focus window; when the focus window change event is a focus window change event of a preset application scenario, the screen refresh rate is set to a second value based on the window of the second application becoming the focus window; the second value corresponds to the screen refresh rate of the preset application scenario.

[0055] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: at a second moment, when the second application is not a self-refreshing application and the application scenario of the second application is not a preset application scenario, the screen refresh rate is adjusted and the screen refresh rate is set to a second value.

[0056] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: loading a preset whitelist; when the whitelist includes a first application, the first application is not a self-refreshing application, and when the whitelist does not include the first application, the first application is a self-refreshing application; or, when the whitelist includes a second application, the second application is not a self-refreshing application, and when the whitelist does not include the second application, the second application is a self-refreshing application.

[0057] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device further performs the following steps: at a second moment, when the input device of the electronic device is idle and the application scenario of the second application is not a preset application scenario, the screen refresh rate is adjusted and set to a second value; the input device includes a keyboard and a mouse.

[0058] In one possible implementation of the third aspect, when the aforementioned software program is executed by the processor, the electronic device also performs the following steps: before setting the screen refresh rate, increasing the power limit, which is the maximum power that the electronic device can use during operation, including a long-term power limit.

[0059] It should be noted that the beneficial effects that the third aspect can achieve can be referred to the first aspect mentioned above, and will not be repeated here.

[0060] Fourthly, this application provides an electronic device, comprising: one or more processors and a memory, the memory being coupled to the processor; the processor including a discrete graphics card and an integrated graphics card; the memory storing one or more computer program codes, the computer program codes including computer instructions; when the processor executes the computer instructions, the electronic device performs the following steps: at a first moment, displaying a window of a first application, wherein at the first moment the window of the first application is the focus window and the screen refresh rate is a first value; at a second moment, receiving a first operation and displaying a window of a second application, wherein after the second moment the window of the second application is the focus window and the screen refresh rate is a second value, the second value being different from the first value; at a third moment, receiving... The second operation is received, and the window of the first application is displayed. After the third moment, the window of the first application becomes the focused window, and the screen refresh rate is the first value. Between the first and third moments, the electronic device is not in the process of disabling / enabling the dedicated graphics card. At the fourth moment, the process of disabling / enabling the dedicated graphics card of the electronic device begins. At the fifth moment, the third operation is received, and the window of the second application is displayed. After the fifth moment, the window of the second application becomes the focused window, and the screen refresh rate is the first value. At the sixth moment, the disabling / enabling of the dedicated graphics card of the electronic device is completed. Between the fourth and sixth moments, the electronic device is in the process of disabling / enabling the dedicated graphics card. The fifth moment is between the fourth and sixth moments.

[0061] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: at a second moment, based on the fact that the electronic device is not in the process of disabling / enabling the discrete graphics card, the screen refresh rate is adjusted and set to a second value; at a third moment, based on the fact that the electronic device is not in the process of disabling / enabling the discrete graphics card, the screen refresh rate is adjusted and set to a first value.

[0062] In one possible implementation of the fourth aspect, the display mode of the electronic device includes a hybrid mode, in which the discrete graphics card and the integrated graphics card switch between use or output in a mixed manner. When the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: when the display mode of the electronic device is hybrid mode and it is currently in a video playback scenario, before setting the screen refresh rate to the second value, waking up the discrete graphics card of the electronic device; when the display mode of the electronic device is hybrid mode and it is currently in a video playback scenario, before setting the screen refresh rate to the first value, waking up the discrete graphics card of the electronic device.

[0063] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: at a fifth moment, based on the fact that the electronic device is in the process of disabling / enabling the discrete graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is a first value.

[0064] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: at a second moment, the window based on the second application becomes the focus window, and the screen refresh rate is set to a second value; at a third moment, the window based on the first application becomes the focus window, and the screen refresh rate is set to a first value.

[0065] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: reading the adjustment flag bit; determining, based on the adjustment flag bit, whether the electronic device is in the process of disabling / enabling the discrete graphics card.

[0066] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: when starting to disable / enable the discrete graphics card of the electronic device, setting an adjustment flag to a first state value, the first state value being used to indicate that the electronic device is in the process of disabling / enabling the discrete graphics card; and when the disabling / enabling of the discrete graphics card of the electronic device is completed, setting an adjustment flag to a second state value, the second state value being used to indicate that the electronic device is not in the process of disabling / enabling the discrete graphics card.

[0067] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: at a second moment, obtaining the screen refresh rate corresponding to the second application from a preset file to obtain a second value; and adjusting the screen refresh rate based on the fact that the electronic device is not in the process of disabling / enabling the discrete graphics card, setting the screen refresh rate to the second value.

[0068] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: at a fifth moment, obtaining the screen refresh rate corresponding to the second application from a preset file to obtain a second value; based on the electronic device being in the process of disabling / enabling the discrete graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is the first value.

[0069] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: acquiring a focus window change event; when the focus window change event is not a focus window change event of a preset application scenario, and if it is determined from the focus change event that the application scenario of the second application is different from that of the first application, the screen refresh rate is set to a second value based on the window of the second application becoming the focus window; when the focus window change event is a focus window change event of a preset application scenario, the screen refresh rate is set to a second value based on the window of the second application becoming the focus window; the second value corresponds to the screen refresh rate of the preset application scenario.

[0070] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: at a second moment, when the second application is not a self-refreshing application and the application scenario of the second application is not a preset application scenario, the screen refresh rate is adjusted and set to a second value; at a third moment, when the first application is not a self-refreshing application and the application scenario of the first application is not a preset application scenario, the screen refresh rate is adjusted and set to a first value.

[0071] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: loading a preset whitelist; when the whitelist includes a first application, the first application is not a self-refreshing application, and when the whitelist does not include the first application, the first application is a self-refreshing application; or, when the whitelist includes a second application, the second application is not a self-refreshing application, and when the whitelist does not include the second application, the second application is a self-refreshing application.

[0072] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: at a second moment, when the input device of the electronic device is idle and the application scenario of the second application is not a preset application scenario, the screen refresh rate is adjusted and set to a second value; at a third moment, when the input device of the electronic device is idle and the application scenario of the first application is not a preset application scenario, the screen refresh rate is adjusted and set to a first value; the input device includes a keyboard and a mouse.

[0073] In one possible implementation of the fourth aspect, when the aforementioned computer instructions are executed by the processor, the electronic device also performs the following steps: before setting the screen refresh rate, increasing the power limit, which is the maximum power that the electronic device can use during operation, including a long-term power limit.

[0074] Fifthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor in an electronic device, causes the electronic device to perform a refresh rate switching method as described in the first aspect and any possible implementation thereof.

[0075] Sixthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the method described in the first aspect and any possible implementation thereof. The computer may be the aforementioned electronic device.

[0076] Understandably, the beneficial effects that the electronic device of any possible implementation of the fourth aspect, the computer-readable storage medium of the fifth aspect, and the computer program product of the sixth aspect can achieve can be referred to as the beneficial effects of the first aspect and any possible implementation thereof, which will not be repeated here. Attached Figure Description

[0077] Figure 1 This application provides an example of an interface diagram for advanced display settings.

[0078] Figure 2 This is a schematic diagram of a display structure provided in an embodiment of this application;

[0079] Figure 3 A schematic diagram of a device manager interface provided in an embodiment of this application;

[0080] Figure 4A This application provides a schematic diagram of a video playback screen freezing interface.

[0081] Figure 4B A schematic diagram of a video playback interface without screen freezing provided in an embodiment of this application;

[0082] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0083] Figure 6 A hardware and software system structure block diagram of an electronic device provided in an embodiment of this application;

[0084] Figure 7 A flowchart illustrating a refresh rate switching method provided in this application embodiment. Figure 1 ;

[0085] Figure 8 A user interface illustration of focus window changing provided in this application embodiment. Figure 1 ;

[0086] Figure 9 A user interface illustration of focus window changing provided in this application embodiment. Figure 2 ;

[0087] Figure 10 A user interface illustration of focus window changing provided in this application embodiment. Figure 3 ;

[0088] Figure 11 A user interface diagram four illustrating focus window changing is provided as an embodiment of this application;

[0089] Figure 12 A flowchart illustrating the process of obtaining a focus window change event, provided as an embodiment of this application;

[0090] Figure 13 A flowchart illustrating the process of obtaining a focus window change event, provided as an embodiment of this application;

[0091] Figure 14 A flowchart illustrating a refresh rate switching method provided in this application embodiment. Figure 2 ;

[0092] Figure 15 A flowchart illustrating a refresh rate switching method provided in this application embodiment. Figure 3 ;

[0093] Figure 16 This application provides a schematic diagram of an interface where the mouse is centered, as shown in the embodiments of this application.

[0094] Figure 17 A flowchart illustrating a refresh rate switching method provided in this application embodiment is shown in Figure 4.

[0095] Figure 18 A flowchart illustrating a refresh rate switching method provided in this application embodiment. Figure 5 ;

[0096] Figure 19 This is a structural block diagram of a chip system provided in an embodiment of this application. Detailed Implementation

[0097] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to limit the application. Furthermore, to facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first," "second," etc., are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., are not necessarily different. Also, in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0098] The following section introduces the relevant technical concepts that may be involved in the embodiments of this application:

[0099] 1. Dedicated Graphics Card (or Discrete Graphics Card): This type of graphics card has its display chip, video memory, and related components integrated onto a separate circuit board, functioning as a standalone card. It typically requires an expansion slot on the motherboard. Simply put, a dedicated graphics card is a device with its own dedicated video memory and graphics processing unit (GPU).

[0100] 2. Integrated Graphics Card (IPC): A graphics card device that does not have dedicated video memory and only has a GPU. For example, IPC usually refers to a GPU that is built into the same package as the Central Processing Unit (CPU). Therefore, IPC generally needs to use the system's main memory as video memory, so the performance of dedicated graphics cards is higher than that of integrated graphics cards.

[0101] 3. Dual Display, Triple Mode: Utilizes both a dedicated and integrated graphics card to provide three display modes: dedicated graphics mode, integrated graphics mode, and hybrid mode. For example, under high-performance requirements, the dedicated graphics card can be enabled to select dedicated graphics mode (where the dedicated graphics card handles all display tasks). Under low performance or battery life requirements, the dedicated graphics card can be disabled to select integrated graphics mode (where the integrated graphics card handles all display tasks). Enabling hybrid mode enables automatic switching between the two graphics cards (i.e., the dedicated and integrated graphics cards can handle different tasks separately).

[0102] 4. Graphics card refresh rate: The frequency of the signal output from the graphics card (such as the display driver) to the screen, measured in Hz.

[0103] 5. Screen refresh rate: The number of times the screen refreshes its image per second, measured in Hz. The higher the screen refresh rate, the smoother the image displayed on the monitor.

[0104] Understandably, screen refresh rate and the aforementioned graphics card refresh rate may have different names depending on different design and practical needs. For example, taking the Windows operating system as an example... Figure 1 A schematic diagram of an interface for advanced display settings is shown.

[0105] like Figure 1 As shown, in the Windows operating system, the screen refresh rate can be the refresh rate in desktop mode, while the graphics card refresh rate can be the refresh rate in active signal mode. In addition to refresh rate, desktop mode and active signal mode can also include resolution. That is, it can be understood that the refresh rate in desktop mode refers to the screen refresh rate, while the refresh rate in active signal mode refers to the graphics card refresh rate.

[0106] 6. Intelligent Refresh Rate Function: This function adaptively adjusts the screen refresh rate based on the application scenario, but does not adjust the graphics card refresh rate. For example, in gaming applications where high refresh rate is required, the screen refresh rate can be set to a high refresh rate, such as 120Hz or 90Hz, to ensure smooth and fluid gameplay. However, in applications such as file browsing or web browsing, a lower screen refresh rate will not affect user browsing and operation, so the screen refresh rate can be set to a low refresh rate, such as 60Hz. In other words, the intelligent refresh rate function can reduce screen power consumption while ensuring a good user experience. For example, in the Windows operating system, the intelligent refresh rate function adaptively adjusts the refresh rate in desktop mode based on the application scenario, but does not change the refresh rate in active signal mode.

[0107] It's important to note that because the Smart Refresh Rate function only adjusts the screen refresh rate and not the graphics card refresh rate—meaning it doesn't change the refresh rate in the graphics card's output signal—the refresh rate adjusted by Smart Refresh Rate can be considered a virtual refresh rate. Therefore, the implementation of Smart Refresh Rate currently relies primarily on the operating system's virtual refresh rate feature. This can be understood as the electronic device's operating system (such as Windows 11) possessing a virtual display characteristic, and Smart Refresh Rate relies on this virtual display feature to function.

[0108] However, discrete graphics cards currently do not support virtual refresh rates. Therefore, when an electronic device's display mode is set to discrete graphics mode (i.e., the graphics card is limited to the discrete graphics card only, also known as discrete graphics only or discrete graphics card directly connected), intelligent refresh rate functionality is currently unavailable. Thus, intelligent refresh rate functionality currently relies on integrated graphics drivers. In other words, if it's determined that the screen refresh rate needs to be adjusted adaptively based on the application scenario, the screen refresh rate is primarily set by instructing the integrated graphics driver. Therefore, it can be understood that currently, electronic devices capable of implementing intelligent refresh rate functionality require a discrete graphics card, which here refers to electronic devices that include both discrete and integrated graphics cards.

[0109] 7. High Dynamic Range Imaging (HDR): HDR technology is a processing technique that enhances image brightness and contrast. Compared to ordinary images, HDR can provide a wider dynamic range and more image detail, better reflecting the visual effects of the real environment. In other words, monitors using HDR technology can improve brightness and contrast to achieve richer, more realistic color reproduction and detail display.

[0110] 8. Alternating Current (AC) Mode: The operating mode where the electronic device is plugged into a power adapter and powered by the adapter. Direct Current (DC) Mode: The operating mode where the electronic device (such as a laptop) is unplugged from the power adapter and powered by the battery. It should be noted that currently, the operating systems of electronic devices (such as laptops) only support HDR technology in AC mode. In other words, the aforementioned HDR technology currently only works in AC mode. That is, HDR is disabled and unusable in DC mode.

[0111] 9. Focus window.

[0112] A focus window is the window that has the user's focus. A focus window is a window that can receive keyboard input. The determination of the focus window is related to the system's focus mode. The top-level window of the focus window is called the active window. Optionally, only one window can be the active window at a time; that is, at any given moment, the focus window is unique. The focus window is most likely the window that the user currently needs to use.

[0113] A process consists of multiple threads, and windows can be created through these threads. The focused process is the process to which the thread that created the focused window belongs; it can also be understood as the process corresponding to the focused window.

[0114] When the smart refresh rate function is enabled in an electronic device, if the dedicated graphics card is stopped manually or automatically (i.e., the dedicated graphics card driver is disabled manually or automatically), or if the dedicated graphics card is enabled manually or automatically, the electronic device will modify the display structure accordingly because the graphics card device has changed (hereinafter referred to as Modification 1).

[0115] For example, Figure 2 A schematic diagram of a display structure is shown.

[0116] like Figure 2 As shown, the display structure can include two arrays: a mode array and a path array. The mode array stores the currently supported display modes, such as... Figure 2 As shown, the pattern array can include "Index: 0 target mode 1 (idx: 0 target mode 1)", "Index: 1 source mode 1 (idx: 1 source mode 1)", "Index: 2 target mode 2 (idx: 2 target mode 2)", and "Index: 3 source mode 2 (idx: 3 source mode 2)".

[0117] The path array stores paths, such as Figure 2 As shown, the path array can include "index: 0 path1 (idx: 0 path1)" and "index: 1 path2 (idx: 1 path2)". Each path is equivalent to a display path, that is, each path points from a source to a target, thus forming... Figure 2 The topology shown.

[0118] Source mode: A source needs a mode to define its attributes, including length, width, color format, and bit depth.

[0119] Target: A series of physical interfaces through which the graphics card device outputs source (scr) content. It can be simply understood as multiple interfaces on the graphics card.

[0120] Target mode: A target also needs a mode to define its attributes. It is more complex than the source mode. In addition to length, width, color format and depth, it also includes refresh rate, buffer length and so on.

[0121] A path is a connection between a source and a destination. There may be multiple paths, but at least one. A structure composed of several paths is called a topology.

[0122] In simple terms, since each display setting corresponds to one output, it's equivalent to having a corresponding path. Therefore, modifying the display structure can be simply understood as modifying the path. For example, if the dedicated graphics card is automatically or manually disabled, the path corresponding to the dedicated graphics card will not be retained; that is, the path corresponding to the disabled dedicated graphics card will be deleted. In other words, because the dedicated graphics card is disabled, configuration parameters that depend on the dedicated graphics card driver are no longer supported or used.

[0123] It should be noted that, Figure 2 The display structure shown is merely an example for illustrating the display structure in this application. Figure 2 This application does not impose any limitations on the display structure of the electronic device; the specific display structure depends on the actual display settings of the electronic device. Furthermore, modifications to the display structure also depend on the actual display settings, and the embodiments herein do not constitute any limitation in this regard.

[0124] For example, taking the Windows operating system as an example, Figure 3 This diagram illustrates a device manager interface. Figure 3 The interface shown is used as an example to illustrate the scenario of manually disabling the dedicated graphics card.

[0125] like Figure 3 As shown, electronic devices can display the Device Manager window. Within the Device Manager window, a "Display adapters" option is displayed. Clicking the "Display adapters" option will display a list of the next level of options, such as... Figure 3 As shown, the next level list under the "Display Adapter" option displays "Dedicated Graphics Card" and "Integrated Graphics Card". It is understood that, depending on the actual display design of the electronic device, the "Dedicated Graphics Card" and "Integrated Graphics Card" displayed in the next level list can specifically refer to the graphics card name and model, etc., and this embodiment does not impose any limitations on this.

[0126] Next, select and right-click "Dedicated Graphics Card" in the next level list to further display the corresponding operation options for "Dedicated Graphics Card," such as... Figure 3 As shown, the options include "Update Driver," "Disable Device," "Uninstall Device," and "Properties." Then, clicking the "Disable Device" option will disable the dedicated graphics card.

[0127] However, besides disabling the dedicated graphics card causing changes to the display structure, the smart refresh rate function also requires modifications to the display structure during the screen refresh rate setting process (hereinafter referred to as Modification 2). For example, the display structure modification caused by adjusting the screen refresh rate changes the target corresponding to the currently displayed path.

[0128] Therefore, if the task of disabling the dedicated graphics card happens to be executed at the same time as the task of setting the screen refresh rate, then the above modifications 1 and 2 may be performed simultaneously. This can easily lead to conflicts and cause abnormalities in the integrated graphics driver, which in turn can cause display abnormalities, such as stuttering, screen tearing, black screen, screen flickering, etc. In more serious cases, it may cause the device to restart or shut down, thus affecting the user experience.

[0129] Therefore, to avoid conflicts between the implementation of the intelligent refresh rate function and the disabling of the discrete graphics card, which could cause abnormalities in the integrated graphics driver, this application provides a refresh rate switching method (hereinafter referred to as the first refresh rate switching method). The first refresh rate switching method provided in this application can be applied to electronic devices including discrete graphics cards and integrated graphics cards.

[0130] In the first refresh rate switching method, the smart refresh rate function is stopped when the electronic device disables / enables the dedicated graphics card. That is, if the electronic device needs to stop or enable the dedicated graphics card, because this process requires processing time, the device will not adjust the screen refresh rate even if the application scenario changes and requires an adaptive adjustment. Since the screen refresh rate is not adjusted during the dedicated graphics card shutdown / enablement process, the electronic device will not execute modification 2 mentioned above, thus avoiding conflict with modification 1. This prevents integrated graphics driver malfunctions and avoids display abnormalities that could affect the user experience.

[0131] Additionally, when an electronic device is in hybrid display mode, the integrated and discrete graphics cards can switch between each other to perform different tasks or output a mixed load. Therefore, when the integrated graphics card is working, if the discrete graphics card doesn't have a task to perform, it will enter sleep mode. However, in video playback scenarios where the integrated graphics card is working while the discrete graphics card is in sleep mode, if the screen refresh rate needs to be adjusted according to the application scenario, the video may briefly freeze during the refresh rate adjustment process. In other words, the video might stutter briefly while the refresh rate is being adjusted.

[0132] For example, Figure 4A A schematic diagram of a video playback screen freezing is shown.

[0133] like Figure 4A As shown, in a video playback scenario, switching the screen refresh rate modifies the display structure. Then, by notifying the sleeping dedicated graphics card of the change in display structure, the dedicated graphics card is awakened, causing a brief screen freeze during video playback. Figure 4A As shown in video playback interfaces 401 and 402, due to screen freezing and video playback stuttering, the displayed video frames are identical. After the screen freezing disappears, video playback returns to normal, as shown... Figure 4A As shown in the video playback interface 403, the video frame displayed in the video playback interface 403 is different from the previous video frame, that is, the video frame displayed in the video playback interface 402.

[0134] The reason why adjusting the screen refresh rate causes video playback to freeze is still because adjusting the screen refresh rate requires modifying the display structure (modification 2 mentioned above). Specifically, to ensure normal display, once the display structure is modified, the change is notified to all display devices, including the dedicated graphics card which is currently in sleep mode. At this time, because the dedicated graphics card is notified of the change in display structure, it is awakened, causing the currently playing video to freeze, thus affecting the user experience.

[0135] Therefore, in mixed-mode and video playback scenarios, to avoid screen freezing caused by waking up the discrete graphics card due to adjusting the screen refresh rate, this application provides another refresh rate switching method (hereinafter referred to as the second refresh rate switching method). The second refresh rate switching method provided in this application embodiment can also be applied to electronic devices including discrete graphics cards and integrated graphics cards, and the display mode of the electronic device supports mixed mode.

[0136] In the second refresh rate switching method, when the electronic device's display mode is mixed mode and it is currently playing a video, if it is determined that the screen refresh rate needs to be adjusted adaptively according to the application scenario, the electronic device will wake up the dedicated graphics card in advance before setting the screen refresh rate. Then, the electronic device adjusts the screen refresh rate while the dedicated graphics card is awake. Because the dedicated graphics card is woken up in advance, it will not be suddenly woken up due to the need to notify the modified display structure for screen refresh rate adjustment. This avoids the temporary screen freeze caused by adjusting the screen refresh rate, ensuring a better user experience.

[0137] For example, Figure 4B This diagram illustrates an interface where video playback is not frozen.

[0138] like Figure 4B As shown, in video playback scenarios, if it's necessary to adjust the screen refresh rate, the electronic device's dedicated graphics card can be activated beforehand, and then the screen refresh rate can be adjusted. This prevents the screen from freezing briefly during video playback. That is, as... Figure 4B As shown, the video frames displayed on video playback interface 401 and video frames displayed on video playback interface 402 are different.

[0139] The aforementioned electronic devices may be laptops, desktop computers, tablets, desktop computers, handheld computers, ultra-mobile personal computers (UMPCs), netbooks, mobile phones, smart bracelets, personal phones, personal data assistants, augmented reality (AR) devices, virtual reality (VR) devices, etc. This application does not limit the specific form of the electronic devices (including the aforementioned first electronic device, second electronic device, and third electronic device).

[0140] For example, Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application.

[0141] like Figure 5 As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, a wireless communication module 150, a display screen 160, etc.

[0142] It is understood that the structures illustrated in the embodiments of this application do 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 illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. For example, in other embodiments, the electronic device may also include a mouse, keyboard, audio module, speaker, receiver, microphone, headphone jack, and camera module, etc.

[0143] The processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU).

[0144] The different processing units can be independent devices or integrated into one or more processors. For example, in this embodiment, processor 110 may include an independent GPU, i.e., the aforementioned discrete graphics card. Processor 110 may also include a GPU integrated with other processing units, i.e., the aforementioned integrated graphics card.

[0145] The processor 110 can generate operation control signals based on the instruction opcode and timing signals to control instruction fetching and execution. For example, in this embodiment, the processor 110 can implement an intelligent refresh rate function. That is, the processor 110 can adaptively adjust the screen refresh rate according to the application scenario. For another example, the processor 110 can also stop adjusting the screen refresh rate during the process of disabling / enabling the discrete graphics card. Furthermore, in mixed mode and video playback scenarios, the processor 110 can wake up the discrete graphics card of the electronic device in advance before determining that the screen refresh rate needs to be adjusted.

[0146] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 may be a cache memory. This memory can store instructions or data that the processor 110 has used or that are used frequently. If the processor 110 needs to use the instruction or data, it can directly retrieve it from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0147] In some embodiments, the processor 110 may include one or more interfaces. These interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and / or a universal serial bus (USB) interface, etc. The processor 110 can connect to modules such as wireless communication modules and displays through at least one of these interfaces.

[0148] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a limitation on the structure of the electronic device. In other embodiments of this application, the electronic device may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0149] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, it can save music, video, and other files to the external memory card, or transfer music, video, and other files from the electronic device to the external memory card.

[0150] Internal memory 121 can be used to store computer executable program code, including instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, video data, etc.). Furthermore, 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, universal flash storage (UFS), etc. Processor 110 executes various functional methods or data processing of the electronic device by running instructions stored in internal memory 121 and / or instructions stored in memory disposed in the processor.

[0151] USB connector 130 is a USB standard-compliant interface used to connect electronic device 100 to peripheral devices, specifically a Mini USB connector, Micro USB connector, USB Type-C connector, etc. Charging management module 140 receives charging input from the charger. Power management module 141 connects to battery 142, and charging management module 140 connects to processor 110. Wireless communication module 160 provides solutions for wireless communication applications in electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), and other wireless communication technologies.

[0152] Electronic devices can implement display functions through GPUs, displays 160, and application processors. A GPU is a microprocessor for image processing, connecting the display 160 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 120 may include one or more GPUs, which execute program instructions to generate or modify display information. For example, in embodiments of this application, processor 120 includes at least one discrete GPU (i.e., a discrete graphics card) and one integrated GPU (a GPU integrated with other processing units, i.e., an integrated graphics card).

[0153] Display screen 160 is used to display images, videos, etc. Display screen 160 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, or a quantum dot light-emitting diode (QLED), etc.

[0154] Figure 6 This is a hardware and software system structure block diagram of an electronic device as shown in an embodiment of this application.

[0155] The hardware and software systems of electronic devices can adopt layered architectures, event-driven architectures, microkernel architectures, microservice architectures, or cloud architectures. This application uses a layered Windows operating system as an example to exemplify the hardware and software structure of an electronic device. In some embodiments, the hardware and software system of an electronic device can be divided into four layers, from top to bottom: the application layer, subsystem dynamic link libraries, the operating system (OS) layer, and the hardware layer.

[0156] In other embodiments, the software and hardware system can be divided into user mode and kernel mode. User mode includes the application layer and subsystem dynamic link libraries, while kernel mode includes the OS layer and hardware layer.

[0157] like Figure 6 As shown, the application layer includes applications such as video, office software (e.g., conferencing, document applications, email, etc.), games, browsers, and PC management software. In this embodiment, the screen refresh rate adjustment process can be executed by the PC management software; that is, the intelligent refresh rate function is implemented by the PC management software. It should be noted that... Figure 6 The examples shown are only a portion of the applications; the application layer may include more applications, and this application embodiment does not impose any limitations on this.

[0158] like Figure 6 As shown, PC Manager can include a dual-display tri-mode function module, an intelligent refresh rate module, and a probe module, etc.

[0159] The dual-display, tri-mode function module monitors the graphics card status of electronic devices to determine whether the dedicated graphics card needs to be disabled or enabled. The intelligent refresh rate module implements intelligent refresh rate functionality, adaptively adjusting the screen refresh rate based on the application scenario. The probe module monitors changes in the focus window of the electronic device, allowing the intelligent refresh rate module to determine if the application scenario has changed based on the focus window change events identified by the probe module, and then decide whether to adjust the screen refresh rate according to the corresponding application scenario. Additionally, the probe module can monitor video streams to determine if the electronic device is in a video playback scenario.

[0160] The subsystem dynamic link library includes the application programming interface (API) module, which provides system call entry points and internal function support for applications.

[0161] The OS layer includes integrated graphics card drivers (IGPU drivers), discrete graphics card drivers (DGPU drivers), etc. The hardware layer includes discrete graphics cards (DGPUs), integrated graphics cards (IGPUs), and displays, etc. In some embodiments, the OS layer and hardware layer may include more or fewer components, which is not limited in this application embodiment. For example, the OS layer may also include sound card drivers, keyboard drivers, mouse drivers, etc. The hardware layer may also include hardware such as sound cards, keyboards, and mice.

[0162] The first refresh rate switching method proposed in this application will be described in detail below with reference to the accompanying drawings. It should be noted that the first refresh rate switching method in the following embodiments can be implemented in an electronic device equipped with the above-described hardware structure.

[0163] Figure 7 A flowchart illustrating a refresh rate switching method is shown.

[0164] Combination Figure 6 The intelligent refresh rate module includes a refresh rate matching module, a refresh rate adjustment thread (refresh rate scheduler), and a message monitor. The message monitor notifies the refresh rate adjustment thread of the adjustment flag. The adjustment flag includes a first state value and a second state value, representing whether adjustment is enabled or disabled, respectively. For example, the first state value indicates adjustment is enabled, and the second state value indicates adjustment is disabled. Alternatively, the first state value indicates adjustment is disabled, and the second state value indicates adjustment is enabled. For clarity, the following explanation will primarily use the example of the first state value indicating adjustment is disabled and the second state value indicating adjustment is enabled.

[0165] In some embodiments, 0 and 1 can be used as the first and second state values ​​of the adjustment flag, respectively, to represent adjustment on and adjustment off. Alternatively, true and false can be used as the first and second state values ​​of the adjustment flag, respectively, to represent adjustment on and adjustment off.

[0166] The refresh rate matching module is used to match a corresponding screen refresh rate based on the application scenario of the electronic device. Then, the refresh rate matching module sends the matched screen refresh rate to the refresh rate adjustment thread, which determines whether to switch the screen refresh rate based on the received screen refresh rate and the adjustment flag.

[0167] like Figure 7 As shown, the refresh rate switching method may include the following steps:

[0168] S701: When the application scenario of an electronic device changes, the refresh rate matching module matches the corresponding screen refresh rate according to the application scenario.

[0169] Application scenarios reflect the user's current usage needs, and different application scenarios correspond to different screen refresh rates. The refresh rate matching module can obtain the screen refresh rate corresponding to the application scenario from a preset file. For example, application scenarios can include game applications and office applications (which can include Word, PowerPoint, or Excel). Game applications generally have a higher screen refresh rate than office applications. For instance, in the preset file, the screen refresh rate for game applications could be 120Hz, 90Hz, etc., while the screen refresh rate for office applications could be 60Hz, 30Hz, etc.

[0170] It should be noted that the application scenarios, in addition to the aforementioned game and office applications, can include more or fewer scenarios, such as video applications. Furthermore, the screen refresh rates corresponding to different application scenarios in the preset file can be configured according to actual needs, and this application embodiment does not impose any limitations on this. For example, the screen refresh rate for game applications > the screen refresh rate for video applications > the screen refresh rate for office applications. Or, the screen refresh rate for game applications > the screen refresh rate for video applications = the screen refresh rate for office applications.

[0171] S702, the refresh rate matching module sends the screen refresh rate to the refresh rate adjustment thread.

[0172] The screen refresh rate received by the refresh rate adjustment thread from the refresh rate matching module is the refresh rate sent by the refresh rate matching module that corresponds to the current application scenario of the electronic device.

[0173] If the screen refresh rate sent by the refresh rate matching module is the same as the current screen refresh rate, it means that even if the application scenario changes, the screen refresh rate has not changed. In this case, there is no need to readjust the screen refresh rate. The refresh rate adjustment thread then executes S704. However, if the screen refresh rate sent by the refresh rate matching module is different from the current screen refresh rate, it means that both the application scenario and the screen refresh rate have changed. To match the application scenario, the refresh rate adjustment thread needs to adjust the screen refresh rate, and in this case, the refresh rate adjustment thread executes S705.

[0174] In some embodiments, the refresh rate adjustment thread can compare the screen refresh rate (i.e., the target screen refresh rate) sent by the refresh rate matching module with the current screen refresh rate recorded in the electronic device's configuration file to determine whether the screen refresh rate has changed.

[0175] For example, if the application scenario changes from a video application to an office application, where the screen refresh rate for both the video application and the office application is 60Hz, then since the screen refresh rate is the same for both application scenarios, the refresh rate adjustment thread does not need to adjust the screen refresh rate, thus ensuring that the screen refresh rate remains at 60Hz.

[0176] For example, if the application scenario changes from a game application to an office application, and the screen refresh rate for the game application is 120Hz, but the screen refresh rate for the office application is 60Hz, then the screen refresh rate needs to be adjusted because of the change in application scenario. Therefore, the refresh rate adjustment thread needs to reduce the screen refresh rate from 120Hz to 60Hz. That is, the screen refresh rate is set from the first value of 60 to the second value of 120.

[0177] S703, the message monitor notifies the refresh rate adjustment thread of the recorded adjustment flag.

[0178] The adjustment flag indicates whether the intelligent refresh rate module is currently allowed to adjust the screen refresh rate. If the adjustment flag indicates adjustment is enabled (e.g., the adjustment flag is at the second state value), the refresh rate adjustment thread can determine that the screen refresh rate can be adjusted. If the adjustment flag indicates adjustment is disabled (e.g., the adjustment flag is at the first state value), then the refresh rate adjustment thread can determine that the screen refresh rate cannot be adjusted.

[0179] In one specific embodiment, the adjustment flag in this application embodiment can be recorded and maintained by a message monitor. For example... Figure 7 As shown, when an electronic device is disabled or enabled with a dedicated graphics card, the dual-display tri-mode function module in the intelligent refresh rate module can receive a notification from the basic input output system (BIOS). After receiving the BIOS notification to disable or enable the dedicated graphics card, the dual-display tri-mode function module instructs the dedicated graphics card driver to stop or start the dedicated graphics card. Once the dedicated graphics card driver successfully receives the notification, it sends a feedback message to the dual-display tri-mode function module confirming receipt.

[0180] Afterwards, because both stopping and enabling the dedicated graphics card require a certain processing time, the dual-display tri-mode function module periodically sends messages to the dedicated graphics card driver to check the graphics card status in order to promptly ascertain whether the dedicated graphics card has been successfully stopped or enabled. If the dedicated graphics card is successfully stopped or enabled, it indicates that the disabling / enabling of the dedicated graphics card is complete, and the dedicated graphics card driver will then reply to the dual-display tri-mode function module that the dedicated graphics card has been stopped or enabled. Understandably, after the disabling / enabling of the dedicated graphics card has been completed, the electronic device is no longer in the process of disabling / enabling the dedicated graphics card.

[0181] Meanwhile, because the process of disabling or enabling the discrete graphics card can conflict with the intelligent refresh rate function due to changes in the display structure, causing integrated graphics driver malfunctions, the dual-display tri-mode function module, upon receiving the BIOS notification to disable or enable the discrete graphics card, notifies the message monitor to stop adjusting the screen refresh rate via inter-process communication (IPC) messages. Subsequently, upon receiving the IPC message notifying the monitor to stop adjusting the screen refresh rate, the monitor records the adjustment flag. Understandably, in this scenario, because it's a notification to disable adjustment, the adjustment flag recorded by the message monitor corresponds to adjustment disabled (e.g., the adjustment flag is the first state value), indicating that the electronic device is currently in the process of disabling / enabling the discrete graphics card, and the refresh rate adjustment thread cannot adjust the screen refresh rate.

[0182] Furthermore, after the discrete graphics card has been stopped or enabled, indicating that the display structure modification caused by the discrete graphics card being disabled or enabled has been completed, there will be no further conflict with the intelligent refresh rate function that could cause integrated graphics driver abnormalities. Therefore, to ensure the normal operation of the intelligent refresh rate function, the dual-display tri-mode function module, after determining that the discrete graphics card has been stopped or enabled, again notifies the message monitor to resume adjusting the screen refresh rate via an IPC message. Then, after receiving the IPC message notifying the resumption of screen refresh rate adjustment, the message monitor also responds to this IPC message by recording the adjustment flag. Understandably, in this scenario, because it is a notification to resume adjustment, the adjustment flag recorded by the message monitor corresponds to adjustment enabled (e.g., the adjustment flag is the second state value), indicating that the electronic device is not currently in the process of disabling / enabling the discrete graphics card, and the refresh rate adjustment thread can adjust the screen refresh rate.

[0183] In general, such as Figure 7As shown, if the refresh rate adjustment thread determines that the screen refresh rate has not changed, or if the adjustment flag indicates that adjustment is off, then the refresh rate adjustment thread can determine that although the application scenario has changed, the actual screen refresh rate has not changed with the application scenario (the screen refresh rate corresponding to the two scenarios before and after the application scenario change is the same), so the screen refresh rate does not need to be adjusted. Alternatively, the refresh rate adjustment thread can determine that because the discrete graphics card is currently in the process of stopping or starting, there may be a conflict that causes the integrated graphics to malfunction, so the screen refresh rate also does not need to be adjusted. Therefore, when the screen refresh rate has not changed, or the adjustment flag indicates that adjustment is off, the refresh rate adjustment thread executes S704 and does not send a screen refresh rate switching command to the IGPU driver.

[0184] If the refresh rate adjustment thread determines that the screen refresh rate has changed, and the adjustment flag indicates that adjustment is enabled, then this indicates that the change in the application scenario necessitates a corresponding adjustment of the screen refresh rate (the screen refresh rates corresponding to the two scenarios before and after the application scenario change are different). Furthermore, the refresh rate adjustment thread can determine that it is not currently in the process of stopping or enabling the discrete graphics card, thus avoiding any conflict. Therefore, when the screen refresh rate has changed and the adjustment flag indicates that adjustment is enabled, the refresh rate adjustment thread executes S705 to continue the process of adjusting the screen refresh rate, thereby completing the screen refresh rate switch.

[0185] In S705, the refresh rate adjustment thread sends screen refresh rate switching instructions to the IGPU driver.

[0186] The S706 IGPU driver switches the display's screen refresh rate by driving the IGPU.

[0187] After receiving the driver instructions from the IGPU driver, the IGPU controls the display to switch the screen refresh rate. It should be noted that, in this embodiment, the refresh rate adjustment thread only switches the display's screen refresh rate (i.e., the virtual refresh rate, such as the refresh rate in desktop mode in a Windows operating system) through the IGPU driver, and does not drive the switching of the graphics card refresh rate (such as the refresh rate in active signal mode in a Windows operating system).

[0188] In some embodiments, whether the application scenario of an electronic device has changed can be determined by the focus window change event of the electronic device. When the focus window of the electronic device changes, the scenario type of the changed focus window can be used to determine whether the application scenario has changed.

[0189] Specifically, if the focus window before and after the change belongs to the same scene type, meaning the scene type hasn't changed, then the application scenario of the electronic device hasn't changed. Therefore, even if the focus window changes, because they belong to the same scene type, and the screen refresh rate corresponding to the same scene type is generally the same, the monitor's screen refresh rate doesn't need to be adjusted.

[0190] If the focus window before and after the change does not belong to the same scene type, meaning the scene type has changed, it indicates a change in the application scenario of the electronic device. Furthermore, since different scene types correspond to different screen refresh rates, the monitor's screen refresh rate can be switched to adapt to the application scenario. Specifically, when the application scenario changes, the refresh rate matching module can match a corresponding screen refresh rate based on the current application scenario of the electronic device and then send it to the refresh rate adjustment thread, which decides whether to switch the screen refresh rate. For details on the screen refresh rate switching process, please refer to the above. Figure 7 The process shown in the embodiments of this application will not be described in detail here.

[0191] For example, the scenario type of the focus window can include game type and office type. When the scenario type of the focus window is game type, the application scenario of the electronic device is game application. When the scenario type of the focus window is office type, the application scenario of the electronic device is office application. Therefore, if the scenario type of the focus window before the change was game type and the scenario type of the focus window after the change is office type, or if the scenario type of the focus window before the change was office type and the scenario type of the focus window after the change is game type, it indicates that the application scenario of the electronic device has changed. However, if the scenario type of the focus window before the change was game type and the scenario type of the focus window after the change is still game type, or if the scenario type of the focus window before the change was office type and the scenario type of the focus window after the change is still office type, it indicates that the application scenario of the electronic device has not changed. It is understood that the above-mentioned game type and office type are merely examples of scenario types in this application embodiment. Depending on actual needs and settings, the scenario types may include more or fewer. For example, the scenario type may also include video type; correspondingly, if the scenario type of the focus window is video type, then the application scenario of the electronic device is video application.

[0192] In some embodiments, the scenario type of the focused window can be determined by the name of the focused process (the application process corresponding to the focused window). For example, if the name of the focused process contains the characters "game," such as game.exe, then the scenario type of the focused window can be determined to be a game application. This indicates that the application scenario of the electronic device is a game application. As another example, if the name of the focused process contains characters such as "word," "ppt," or "excel," such as word.exe, ppt.exe, or excel.exe, then the scenario type of the focused window can be determined to be an office application. This indicates that the application scenario of the electronic device is an office application.

[0193] Furthermore, for example, when the focus window changes from xx game.exe to yy game.exe, or when the focus window changes from word.exe to excel.exe, since the scene type is the same before and after the focus window changes, that is, the application scene of the electronic device has not changed, it can be determined that the application scene has not changed, so the screen refresh rate does not need to be adjusted accordingly.

[0194] For example, when the focus window changes from word.exe to yy game.exe, or from xxgame.exe to excel.exe, since the scene type before and after the focus window change is different, that is, the application scene of the electronic device has changed, the screen refresh rate can be matched and switched according to the current application scene.

[0195] For example, taking a laptop computer as an example, the embodiments of this application... Figures 8-11 This diagram illustrates a user interface with a set of focus window changes.

[0196] The focus window may change in three ways: opening a new window, setting a window, or exiting the current window. The following explanation uses these three scenarios as examples.

[0197] Scenario 1: Open a new window:

[0198] The user turns on the laptop, and the laptop screen displays the desktop. Figure 8 This is a screenshot of a laptop user's desktop. (Example:) Figure 8 As shown, the laptop can display icons for applications such as slideshows, videos, browsers, music, games, and email. Users can double-click the game application icon, and the laptop will respond by launching the game's window. For example... Figure 9As shown, the laptop can respond to the double-clicking of the XX game icon and display the XX game window. After opening the new window, the laptop's focus window changes to the XX game window. At this time, the focus window's scene type is game, and the electronic device's current application scene is a game application.

[0199] Scenario 2, Settings window:

[0200] like Figure 10 As shown, the laptop's user interface can include a browser application window 1001 and a taskbar 1002. The taskbar 1002 can display icons for all currently open windows, including those for Word, Excel, the browser, and certain games. At this time, the browser window is the focused window (displayed as selected in the taskbar 1002). Figure 10 As shown, the user can click the XX game window icon in taskbar 1002. The laptop will then respond to the click of the XX game window icon by switching the display of the XX game window (the switched interface is shown above). Figure 9 (As shown). At this point, the laptop's focused window changes from the browser window to the XX game window. That is, the scenario type of the focused window before the change was web browsing, and the scenario type of the focused window after the change is game. In other words, the application scenario of the electronic device changes from web browsing to game application, and the current application scenario of the electronic device is game application.

[0201] Case 3: Exit the current window:

[0202] If the laptop has Word, Excel, a browser, and a game window open, and the electronic device's user interface is currently displaying the game window, such as... Figure 9 As shown, the laptop's current focused window is the XX game window. The user can click the exit control 901, and the laptop will respond to this action by not displaying the XX game window and switching the display to another window. Figure 11 The browser window 1101 is shown. Simultaneously, because the user clicked to exit the XX game window, the XX game window icon is no longer displayed in the taskbar 1102. At this point, the laptop's focused window changes from the XX game window to the browser window 1101. That is, the application scenario of the electronic device changes from a game application to a web browsing scenario; the current application scenario of the electronic device is web browsing.

[0203] Understandably, after a user clicks on a control to exit an application (or minimizes a window), the electronic device can respond to this operation by selecting a new window as the focus window. This application embodiment does not limit the window selected by the electronic device, and the specific selection may depend on the actual execution logic of the electronic device.

[0204] In one specific embodiment, the intelligent refresh rate module may further include a scene filter. Focus window change events can be obtained by the probe module from various events subscribed to by the electronic device in kernel mode and sent to the scene filter. The scene filter then determines whether the application scenario of the electronic device has changed. If the application scenario has changed, the scene filter notifies the refresh rate matching module to match a corresponding screen refresh rate based on that application scenario. The refresh rate matching module then notifies the refresh rate adjustment thread of the matched screen refresh rate, which decides whether to switch the screen refresh rate.

[0205] Exemplary embodiments of this application Figure 12 This diagram illustrates a process for obtaining a focus window change event. Figure 12 As shown, the process of obtaining a focus window change event may include the following steps:

[0206] S1201, the probe module subscribes to focus change events from the API module.

[0207] S1202, In response to the user's action of opening the target application, the API creates the target application window.

[0208] Opening the target application (which may include the first and second applications) can be done by clicking the target application's icon, for example, clicking the icon on the screen. Figure 8 The double-clicking of the XX game icon shown can be considered as launching the target application. It is understood that launching the target application can also be done in other ways, and this application does not limit this. The target application can be a game application, office application, web browser, video application, music application, etc., and this application does not limit the specific application type.

[0209] Upon receiving a user's command to launch the target application, the process manager in the electronic device can create a process for the target application. The process creation process includes: the process manager can locate the target application's binary file through its storage address; by loading the target application's binary file, it can create the environment for the process to run and start the target application process. Additionally, the target application process can include thread 1 for creating the target application window. Therefore, after the target application process is created, the API module can respond to a call request from thread 1 and create the target application's window.

[0210] S1203, the API module sends a focus window change event to the probe module, and the probe module sends a focus window change event to the scene filter.

[0211] The focus window change event can carry the name of the target application process (i.e., the focus process), so that the scene filter can determine the scene type of the focus window based on the name of the target application process (i.e., the focus process), thereby determining whether the application scene of the electronic device has changed.

[0212] S1204, The scene filter determines whether the scene type of the focus window has changed based on the focus window change event.

[0213] Scene filters can determine the scene type of the currently focused window on an electronic device based on the name of the target application process (i.e., the focused process) corresponding to the focus window change event. For example, if the name of the target application process (i.e., the focused process) is game.exe, the current application scene on the electronic device can be determined to be a game application. As another example, if the name of the target application process (i.e., the focused process) is word.exe, the current application scene on the electronic device can be determined to be an office application.

[0214] Then, the scene filter compares the scene type with that of the previous focused window to determine if the scene type of the focused window has changed. If the scene type of the focused window has changed, it indicates that the application scenario of the electronic device has changed. Since the application scenario has changed, the screen refresh rate may need to be adjusted, so the scene filter executes step S1205. However, if the scene type of the focused window has not changed, it indicates that the application scenario of the electronic device has not changed, and the scene filter does not execute step S1205. Figure 12 As shown, if the scene type of the focus window does not change, the scene filter does not send the current application scene of the electronic device to the refresh rate matching module.

[0215] S1205, the scene filter sends the current application scene of the electronic device to the refresh rate matching module. The process after S1205 can be referenced above. Figure 7 The refresh rate switching process shown in this embodiment will not be described in detail here.

[0216] It should be noted that the above Figure 12 The flowchart shown represents case 1 of the focus window change (i.e. Figures 8-9The specific execution flow for the scenario of opening a new window is shown below. For scenarios 2 and 3 involving changes in the focus window, corresponding window processing can also be performed based on the user's actions. The API module can also send a focus window change event to the probe module based on the specific circumstances of the window processing, thereby allowing the scene filter in the intelligent refresh rate module to further determine whether the scene type of the focus window has changed. The principle is the same, and this embodiment will not elaborate further.

[0217] In other embodiments, for certain preset application scenarios requiring rapid refresh rate switching, focus window change events can be subscribed to and processed separately. Taking gaming applications as an example, to improve the screen refresh rate switching speed and ensure a better user experience, focus window change events in gaming applications can be subscribed to and processed separately from focus window change events in non-gaming applications (such as office applications, video applications, and web browsing scenarios). It is understood that the first and second applications mentioned above can be either gaming applications or non-gaming applications.

[0218] It should be noted that the above-mentioned game applications are for illustrative purposes only. Depending on actual needs, the preset application scenarios may include more applications, and this application embodiment does not impose any limitations on this.

[0219] For example, Figure 13 This diagram illustrates another process for obtaining a focus window change event. (Example:) Figure 13 As shown, the probe module can include a scene probe module and a game probe module. The scene probe module is used to subscribe to and process focus window change events for non-game applications, while the game probe module is dedicated to subscribing to and processing focus window change events for game applications.

[0220] like Figure 13 As shown, the process of obtaining the focus window change event in this embodiment may include the following steps:

[0221] S1301, the scene probe module subscribes to the focus window change event of non-game applications from the API module.

[0222] S1302, the game probe module subscribes to the focus window change event of the game application from the API module.

[0223] Non-game applications can include office applications, web browsers, video applications, music applications, etc. Game applications can be of various types, such as shooting games, competitive games, puzzle games, music games, etc., and this application does not impose any limitations on them.

[0224] S1303: In response to the user's action of launching the game application, the API module creates the game application window. The specific implementation of S1303 can be found in the description of S1202 above; the principle is the same, and will not be repeated here.

[0225] S1304, the API module sends the focus window change event of the game application to the game probe module, and the game probe module sends the focus window change event of the game application to the refresh rate matching module.

[0226] S1305, the refresh rate matching module sends the screen refresh rate of the game application to the refresh rate adjustment thread.

[0227] When a user launches a game application, the game probe module receives the focus window change event from the API module and forwards it directly to the refresh rate matching module. After receiving the focus window change event from the game probe module, the refresh rate matching module can directly determine that the current application scenario of the electronic device has changed to a game application, and thus directly send the screen refresh rate corresponding to the game application to the refresh rate adjustment thread. The process after S1305 can be referenced above. Figure 7 The refresh rate switching process shown can be found in the following reference. Figure 7 The specific implementations of S703-S706 are not described in detail in this application embodiment.

[0228] In this way, the embodiments of this application can save a certain amount of processing time by directly interacting with the refresh rate matching module through an independent game probe module. For example, it can save the processing time required for scene filters, thereby improving the switching rate of screen refresh rate under game applications. This ensures that the screen refresh rate can be quickly adjusted to the high refresh rate required by the game application after it starts, ensuring smooth and fluid game graphics, and thus ensuring the user's gaming experience.

[0229] S1306: In response to the user's action of launching a non-game application, the API module creates a non-game application window. The specific implementation of S1306 can be found in the description of S1202 above; the principle is the same, and will not be repeated here.

[0230] S1307, the API module sends a non-game application focus window change event to the scene probe module, and the scene probe module sends a non-game application focus window change event to the scene filter.

[0231] S1308, the scene filter determines whether the scene type of the focus window has changed based on the focus window change event of a non-game application.

[0232] S1309, the scene filter sends the current application scene of the electronic device to the refresh rate matching module.

[0233] For the specific implementation details of S1306-S1309, please refer to the above. Figure 12 The description and principle are the same, and will not be repeated in the embodiments of this application. Similarly, the process after S1309 can be referred to the above. Figure 7 The refresh rate switching process shown is based on the same principle, and will not be described again in this embodiment.

[0234] In other embodiments, in addition to recording the adjustment flag, the message monitor can record more flags as needed and notify the refresh rate adjustment thread. The refresh rate adjustment thread then combines the information from all received flags to decide whether to adjust the refresh rate.

[0235] In one specific embodiment, a brief black screen may occur due to the conflict between the dedicated graphics card direct connection and HDR functionality and the intelligent refresh rate function. Therefore, the message monitor can also record the dedicated graphics card status flag and the HDR on / off flag. The message monitor uses the dedicated graphics card status flag to indicate to the refresh rate adjustment thread whether the electronic device's display mode is currently dedicated graphics only (i.e., whether the graphics card status is dedicated graphics card direct connection). The HDR on / off flag indicates to the refresh rate adjustment thread whether the electronic device's HDR function is enabled (i.e., whether the HDR switch is on or off).

[0236] Additionally, to meet user needs, electronic devices can also provide a user experience (UX) switch to control whether the intelligent refresh rate function is enabled. Therefore, to determine whether a user needs to enable the intelligent refresh rate function, the message monitor can also record an UX switch flag.

[0237] Then, the message monitor can send the discrete graphics status flag, HDR switch flag, and UX switch flag along with the adjustment flag to the refresh rate adjustment thread. Next, when the discrete graphics status flag indicates that the electronic device's display mode is discrete graphics only, or the HDR switch flag indicates that HDR is enabled, or the UX switch flag indicates that UX is on, or the adjustment flag indicates that adjustment is off, the refresh rate adjustment thread can determine that screen refresh rate adjustment is not currently allowed, and therefore will not adjust the screen refresh rate.

[0238] When the discrete graphics status flag indicates that the display mode of the electronic device is not discrete graphics only, the HDR switch flag indicates that the HDR function is off, the UX switch flag indicates that the UX switch is off, and the adjustment flag indicates that adjustment is on, then the refresh rate adjustment thread can determine that screen refresh rate adjustment is currently allowed.

[0239] In other words, the refresh rate adjustment thread can determine from the flags that adjusting the screen refresh rate will not cause a black screen due to conflicts, will not violate user needs, and will not conflict with disabling or enabling the dedicated graphics card, causing integrated graphics driver malfunctions. Therefore, the refresh rate adjustment thread can determine that screen refresh rate adjustment is currently permitted. If screen refresh rate adjustment is permitted, the refresh rate adjustment thread can continue executing the screen refresh rate adjustment process to complete the adjustment. For a detailed refresh rate adjustment process, please refer to the above. Figure 7 As shown, this will not be elaborated further.

[0240] The second refresh rate switching method proposed in this application will be described in detail below with reference to the accompanying drawings. It should be noted that the second refresh rate switching method in the following embodiments can all be implemented in electronic devices equipped with the above-described hardware structure.

[0241] Combination Figure 6 The probe module in the embodiment may further include a video stream probe. In this embodiment, the video stream probe is used to monitor whether a video stream is present. If a video stream is present, it can be determined that the current scenario is a video playback scenario; if no video stream is present, it can be determined that the current scenario is not a video playback scenario. For example, when the application scenario (focus window) changes to a video application, since the video application is mainly used for playing videos, the video stream probe will inevitably be able to detect the video stream in this application scenario. As another example, when the application scenario (focus window) changes to a social application, although the social application is not primarily used for playing videos, it may still involve video playback. Therefore, in the application scenario of a social application, the video stream probe may also detect the video stream.

[0242] It is understood that the video and social applications described above are merely illustrative examples of the embodiments in this application and do not constitute any limitation on application scenarios involving video playback. For example, music applications may also involve video playback scenarios, such as playing music videos (MVs).

[0243] Figure 14 A flowchart illustrating a refresh rate switching method is shown, including the following steps:

[0244] S1401, after the application scenario of the electronic device changes, the refresh rate matching module matches the corresponding screen refresh rate according to the application scenario.

[0245] S1402, the refresh rate matching module sends the screen refresh rate to the refresh rate adjustment thread.

[0246] S1403, the video stream probe notifies the refresh rate adjustment thread that the current scenario is video playback.

[0247] Once the video stream probe detects a video stream and determines that the electronic device is currently in a video playback scenario, it can notify the refresh rate adjustment thread to inform the electronic device that it is currently in a video playback scenario in order to avoid the temporary video freezing phenomenon caused by adjusting the screen refresh rate.

[0248] S1404, the refresh rate adjustment thread notifies the dedicated graphics card driver to wake up the dedicated graphics card.

[0249] Once the refresh rate adjustment thread determines that the screen refresh rate has changed, and that the current scenario involves video playback and allows for adjustment, it notifies the graphics card driver to wake up the dedicated graphics card. Then, after waking up the dedicated graphics card, there will be no brief screen freeze during video playback due to conflicts. Therefore, as... Figure 14 As shown, after S1404, the refresh rate adjustment thread can continue to execute S1405 to complete the screen refresh rate adjustment.

[0250] If the refresh rate adjustment thread determines that the screen refresh rate has changed and adjustment is allowed, but the current scenario is not video playback, then since not playing video will not cause a brief screen freeze, the refresh rate adjustment thread can skip S1404 and directly execute S1405 to complete the screen refresh rate adjustment. In other words, the dedicated graphics card does not need to be woken up before adjusting the screen refresh rate.

[0251] If the refresh rate adjustment thread determines that the screen refresh rate has not changed (the screen refresh rate is the same for the two scenarios before and after the application scenario change), or does not allow adjustment, then the refresh rate adjustment thread will not adjust the screen refresh rate, i.e., execute S1407.

[0252] In some embodiments, the refresh rate adjustment thread can also determine whether adjustment is allowed based on the adjustment flag bit in the first refresh rate switching method described in the above embodiments. That is, if the adjustment flag bit indicates that adjustment is enabled, it is determined that adjustment is allowed. If the adjustment flag bit indicates that adjustment is disabled, it is determined that adjustment is not allowed. Alternatively, in other embodiments, the refresh rate adjustment thread can simultaneously determine whether adjustment is allowed based on the discrete graphics status flag bit, HDR switch flag bit, UX switch flag bit, and adjustment flag bit recorded by the message monitor. The specific implementation can refer to the content of the first refresh rate switching method described in the above embodiments, as the principle is the same, and will not be repeated here.

[0253] In some embodiments, the refresh rate adjustment thread can wake up the discrete graphics card via a wake-up program. For example... Figure 14As shown, the dual-display tri-mode function module is used to detect the graphics card status of the electronic device. Therefore, upon startup, the refresh rate adjustment thread first queries the dual-display tri-mode function module to determine if the electronic device is a dedicated graphics card machine. If it is a dedicated graphics card machine, indicating that the electronic device includes both a dedicated graphics card and an integrated graphics card, then it can be determined that the display mode of the electronic device supports mixed mode.

[0254] Therefore, to facilitate waking up the dedicated graphics card when the display mode is mixed mode and video playback is involved, the refresh rate adjustment thread loads a wake-up program. Then, when the refresh rate adjustment thread determines that the dedicated graphics card needs to be woken up, it can do so by calling the wake-up program. It should be noted that the wake-up program can be a file of any format, as long as it can be loaded and wake up the dedicated graphics card; this application embodiment does not impose any limitations on this. In a specific embodiment, the wake-up program can be a dynamic link library (DLL) file.

[0255] Understandably, in hybrid mode, if the graphics card devices (integrated graphics and discrete graphics) have no tasks to execute for an extended period, they will generally automatically enter a sleep state. Therefore, in this embodiment, after the refresh rate adjustment thread wakes up the discrete graphics card, since the discrete graphics card can automatically enter a sleep state when no tasks are needed for a long time, the refresh rate adjustment thread does not need to instruct the discrete graphics card to enter a sleep state again.

[0256] S1405, the refresh rate adjustment thread sends a screen refresh rate switching command to the IGPU driver.

[0257] S1406, the IGPU driver switches the display's screen refresh rate by driving the IGPU.

[0258] S1407, the refresh rate adjustment thread does not send screen refresh rate switching instructions to the IGPU driver.

[0259] The specific implementation of steps S1401, S1402, S1405, and S1406 can be found in the description of steps S701, S702, S705, and S706 of the first refresh rate switching method in the above embodiments, as the principle is the same and will not be repeated here. Similarly, the specific implementation of step S1407 can be found in the description of step S704 of the first refresh rate switching method in the above embodiments, as the principle is the same and will not be repeated here.

[0260] Furthermore, in the second refresh rate switching method, whether the application scenario of the electronic device has changed can also be determined by the focus window change event of the electronic device. For details, please refer to the content of the first refresh rate switching method described in the above embodiments. For example, please refer to the relevant... Figures 8-13 The content recorded follows the same principle, so I will not repeat it here.

[0261] Combining the first refresh rate switching method and the second refresh rate switching method described in the above embodiments, Figure 15 This application embodiment illustrates a flowchart of another refresh rate switching method. The following, in conjunction with... Figure 15 The refresh rate switching method provided in the embodiments of this application will be described. In a specific embodiment, Figure 15 The process shown can be specifically executed by the refresh rate adjustment thread in the intelligent refresh rate module.

[0262] like Figure 15 As shown, the refresh rate switching method may include the following steps:

[0263] S1501, power-on initialization, including determining whether it is a machine with a dedicated graphics card, and loading the whitelist and wake-up program.

[0264] After the electronic device is powered on, it first checks if the device has a dedicated graphics card. If it does, it loads a whitelist and a wake-up program. The whitelist filters application scenarios where the screen refresh rate cannot be adjusted. The wake-up program wakes up the dedicated graphics card.

[0265] S1502, awaiting changes in application scenarios.

[0266] Whether the application scenario has changed can be found in the relevant content described in the above embodiments. For details, please refer to... Figure 13 The relevant content follows the same principle and will not be repeated here. If there is a change in the application scenario and it is a high-priority application, that is, the changed application scenario is the default application scenario (such as a game application), then execute steps S1503-S1511 and S1517-S1521. If the changed application scenario is a normal-priority application, that is, the changed application scenario is not the default application scenario (such as a non-game application), then execute steps S1512-S1521.

[0267] In this way, for high-priority applications such as preset application scenarios that have high requirements for refresh rate switching speed, the screen refresh rate can be set directly if it is determined that the screen refresh rate can be adjusted, without checking whether the input device is idle or performing whitelist checks, thereby saving some processing time to improve the screen refresh rate switching speed.

[0268] S1503 determines whether the screen refresh rate has changed.

[0269] After determining that the application scenario has changed, since some different application scenarios may have the same screen refresh rate, it is necessary to determine whether the screen refresh rate has changed. For example, the received screen refresh rate (target screen refresh rate) is compared with the current screen refresh rate recorded in the configuration file to determine if they are consistent. If the target screen refresh rate is consistent with the current screen refresh rate, it can be determined that the screen refresh rate has not changed. In this case, there is no need to adjust the screen refresh rate, and the process returns to S1502, waiting for the next application scenario change. However, if the target screen refresh rate is inconsistent with the current screen refresh rate, it can be determined that the screen refresh rate has changed. In this case, the screen refresh rate needs to be adjusted, and the process proceeds to S1504.

[0270] S1504, determine whether adjustment is allowed.

[0271] Whether adjustment is allowed can be determined by the received flag bits. For example, the adjustment flag bit can be used to determine whether adjustment is allowed. Alternatively, the discrete graphics status flag bit, UX switch flag bit, and HDR switch flag bit can also be used to determine whether adjustment is allowed. The specific determination process can be referred to the description in the above embodiments, and will not be repeated here. Next, if it is determined that adjustment is not allowed, there is no need to adjust the screen refresh rate, and the process returns to S1502 to wait for the next application scenario change. If it is determined that adjustment is allowed, the process executes S1505.

[0272] S1505 periodically checks whether the input device is idle and whether the application scenario priority has changed.

[0273] Input devices include a mouse and a keyboard. Current operating systems have a mouse centering mechanism; if the screen refresh rate is adjusted, it triggers a centering motion, causing the mouse position to change before and after the refresh rate setting. For example, Figure 16 This diagram illustrates an interface where the mouse cursor is centered.

[0274] like Figure 16As shown, the user interface 1610 includes a taskbar 1613 and windows A 1611 and B 1612. The taskbar 1613 includes icons for multiple windows, such as windows A 1611 and B 1612. Each window may include a title bar and a preview window. The icon for window B in the taskbar 1613 is selected, and the mouse cursor is located at the first position 1614 of the currently focused window (window B 1612). Assume that in window B 1612, the user is selecting text, scrolling down a page, or viewing content (the mouse cursor remains stationary). After the electronic device starts setting the refresh rate, it can display the user interface 1620. At this time, the cursor position changes from the first position 1614 of window B 1612 to the second position 1624. The second position 1624 is the center position of the entire user interface 1620. This cursor position change makes the page transition clearly perceptible to the user.

[0275] If an electronic device adjusts the cursor position uncontrollably while the user is focused on the window content, the user will clearly perceive the cursor position change, resulting in a poor user experience. Therefore, in order to adjust the screen refresh rate without the user noticing, it is necessary to wait until the input devices (including the mouse and keyboard) are idle. Thus, after determining that adjusting the screen refresh rate is permissible, it is necessary to periodically check whether the input devices are idle.

[0276] Meanwhile, because the input device is checked periodically to see if it is idle, the application scenario may change again and become a high-priority application during this process. High-priority applications do not need to wait for the input device to become idle or perform whitelist checks. Therefore, it is also necessary to monitor whether the application scenario priority has changed at this time.

[0277] In other words, during the periodic check of whether the input device is idle, once it is determined that the input device is idle, and the application scenario remains unchanged or the application scenario has changed but its priority remains unchanged during this check, the process of adjusting the screen refresh rate can continue, and S1507 is executed. However, if during the periodic check of whether the input device is idle, before it is determined that the input device is idle, the application scenario has changed to a high-priority application, then in order to ensure that the high-priority application can quickly switch the screen refresh rate, S1506 is executed.

[0278] S1506, interrupt check, execute S1513. That is, interrupt the current check on whether the input device is idle, and execute the adjustment process corresponding to the high-priority application, that is, start executing S1513.

[0279] S1507, check graphics card status.

[0280] Adjusting the screen refresh rate when using only the dedicated graphics card can cause brief black screens or flickering. Furthermore, as described in the first refresh rate switching method above, adjusting the screen refresh rate during the process of disabling / enabling the dedicated graphics card can cause integrated graphics driver malfunctions due to conflicts arising from changes in the display architecture. Therefore, checking the graphics card status can include checking whether it is currently using only the dedicated graphics card and whether it is in the process of disabling / enabling the dedicated graphics card. For example, the dedicated graphics card status flag can be used to determine whether it is currently using only the dedicated graphics card. Adjusting the flag can also determine whether it is in the process of disabling / enabling the dedicated graphics card.

[0281] Understandably, although the preceding step S1504 has already determined that adjustment is allowed through the relevant flag bits, the graphics card status may change at any time during the actual execution process, so a second check can be performed to prevent changes in the graphics card status.

[0282] Therefore, if the graphics card status is dedicated graphics only, or if the dedicated graphics card is being disabled / enabled (in the process of disabling / enabling the dedicated graphics card), then return to execute S1502 and wait for the next application scenario change. However, if the graphics card status is not dedicated graphics only, and the dedicated graphics card is not being disabled / enabled, then continue executing S1508.

[0283] S1508 determines whether the graphics card refresh rate and resolution can be adjusted.

[0284] The system determines whether the graphics card refresh rate (i.e., the refresh rate in active signal mode, also known as the active signal refresh rate) is the preset refresh rate. If the graphics card refresh rate is the preset refresh rate, it is determined that the graphics card refresh rate is supported. Otherwise, if the graphics card refresh rate is not the preset refresh rate, it is determined that the graphics card refresh rate is not supported. It is understood that the preset refresh rate is a baseline refresh rate preset by the electronic device, and different device types may have different preset refresh rates. This application embodiment does not impose any limitations on this. In a specific embodiment, the preset refresh rate = 165Hz.

[0285] If the graphics card refresh rate is the preset refresh rate, it confirms that the electronic device supports screen refresh rate settings, ensuring the reliability of subsequent adjustments. Specifically, when switching screen refresh rates, the electronic device needs to set parameters based on the graphics card refresh rate. If the graphics card refresh rate is not the preset refresh rate, the electronic device may need to reset the graphics card's screen refresh rate parameters based on the current refresh rate. During this reset process, the screen will go black, resulting in a poor user experience. Therefore, to avoid black screen issues before adjusting the screen refresh rate, it's beneficial to check if the graphics card supports the refresh rate to preemptively rule out such situations and improve the user experience.

[0286] Similarly, adjusting the screen refresh rate also requires the resolution as a base setting parameter. Therefore, if the resolution is inconsistent with the resolution set at startup—meaning the electronic device's resolution was adjusted after startup—adjusting the screen refresh rate will also result in a black screen. Thus, if the current resolution matches the resolution configured at startup, it can be confirmed that the resolution supports adjusting the screen refresh rate. Therefore, if the graphics card refresh rate or resolution is not supported, to avoid a black screen, the screen refresh rate will not be adjusted this time; instead, execution will return to step S1502, waiting for the next application scenario change. If both the graphics card refresh rate and resolution are supported, then step S1509 will be executed.

[0287] S1509, determines whether the screen refresh rate has changed.

[0288] This step serves as a safeguard to prevent changes in the screen refresh rate during execution, as user behavior is unpredictable. For instance, the application scenario might change during the initial check of input device availability, leading to a change in the required screen refresh rate. For example, if the initial plan was to switch from 60Hz to 90Hz, but the current application scenario's screen refresh rate is 120Hz, then the switch should be made from 60Hz to 120Hz. Conversely, if the initial plan was to switch from 60Hz to 90Hz, but the current application scenario's screen refresh rate is 60Hz, then the current setting can be maintained. Therefore, this secondary check ensures the accuracy of the adjustment.

[0289] S1510, whitelist check.

[0290] Because some applications automatically refresh upon setting, adjusting the screen refresh rate after one of these applications becomes the focus window will cause them to refresh again. The more frequently the screen refresh rate is adjusted, the more frequently applications will refresh, resulting in a poor user experience. Therefore, it's advisable to filter out these self-refreshing applications using a whitelist before setting the refresh rate to ensure a better user experience.

[0291] The whitelist is a list of applications. Electronic devices can use the whitelist to determine whether the target application (e.g., application one or application two) corresponding to the current application scenario is a self-refreshing application. For example, if the electronic device has a pre-installed whitelist and the target application is included in the whitelist, then the target application is not a self-refreshing application, and the whitelist check passes, continuing to execute S1511. However, if the target application is not included in the whitelist, it is determined that the target application is a self-refreshing application, and the whitelist check fails, so the process returns to execute S1502, waiting for the next application scenario change.

[0292] In some embodiments, the electronic device can also determine whether a target application is a self-refreshing application by using a blacklist filter. For example, the electronic device may have a pre-installed blacklist; if the target application is included in the blacklist, it is considered a self-refreshing application. If the target application is not included in the blacklist, it is not considered a self-refreshing application.

[0293] S1511, Check graphics card status. This step is a safeguard to prevent the graphics card status from changing during execution. For details, please refer to the description in S1507.

[0294] S1512 determines whether adjustment is allowed. Same as S1504 above, so it will not be repeated.

[0295] S1513, check graphics card status. Same as S1507 above, no further explanation needed.

[0296] S1514 determines whether the graphics card refresh rate and resolution can be adjusted. S1509...

[0297] S1515 checks if the screen refresh rate has changed. Same as S1503 and S1509 above, so further details are omitted.

[0298] S1516, Check graphics card status. Same as S1511 above, no further explanation needed.

[0299] S1517, improves long-term power limit PL1.

[0300] The long-term power limit (powerlimit1, PL1) defines the maximum power that the processor can use during prolonged operation. A higher PL1 indicates higher performance but also higher power consumption, while a lower PL1 indicates lower performance but also lower power consumption. Therefore, to improve switching speed and ensure the reliability of screen refresh rate settings, PL1 can be increased. It is understood that the specific value of PL1 can be set according to actual needs and device status, and this application embodiment does not impose any limitations on this. In one specific embodiment, PL1 can be 45. In other embodiments, the power limit also includes a short-term power limit (powerlimit2, PL2), which is the maximum power that the processor can use during short-term operation.

[0301] S1518, determine whether it is a mixed mode and a video playback scene.

[0302] S1519, wake up the dedicated graphics card.

[0303] As described in the second refresh rate switching method above, adjusting the screen refresh rate in mixed mode can cause a brief screen freeze during video playback due to waking up the dedicated graphics card. Therefore, to prevent this, before setting the screen refresh rate, if it is confirmed that the display mode is mixed mode and the video playback scenario is active, the dedicated graphics card should be woken up. Then, S1520 should be executed to set the screen refresh rate.

[0304] S1520, set the screen refresh rate.

[0305] S1521, report. The screen refresh rate has been switched.

[0306] Combined with the first refresh rate switching method described in any of the above embodiments and Figures 8-11 The focus window (application scenario) shown has changed. Figure 17 This is a flowchart illustrating another refresh rate switching method for embodiments of this application.

[0307] like Figure 17 As shown, at the first moment, the electronic device is currently displaying the window of game XX (i.e. the window of the first application). At this time, the window of game XX is the focus window, and the screen refresh rate corresponding to game XX is 120Hz (corresponding to the first value of 120). Therefore, the screen refresh rate at this time is 120Hz.

[0308] In the second moment, following the first moment, the system receives the first operation of the user opening a browser window (i.e., the window of the second application). The electronic device then responds to this first operation by displaying the browser window. After the second moment, the browser window (i.e., the window of the second application) becomes the focus window. Because the browser window becomes the focus window after the second moment (i.e., the application scenario changes), and the screen refresh rate corresponding to the browser window is 60Hz, meaning the screen refresh rate changes with the application scenario, it is necessary to adjust the screen refresh rate, such as... Figure 17 As shown, the screen refresh rate at this time is 60Hz (corresponding to the second value of 60). Furthermore, because the electronic device is not in the process of disabling / enabling the dedicated graphics card at the second moment, this situation will not cause integrated graphics driver malfunctions leading to display abnormalities. Therefore, between the first and second moments, as... Figure 17 As shown, there are no abnormalities.

[0309] In other words, at the second moment, based on the fact that the electronic device was not in the process of disabling / enabling the discrete graphics card, the screen refresh rate was adjusted to 60Hz.

[0310] In the third moment, following the second moment, a second operation is received: the user reopens the window of game XX (i.e., the window of the first application). The electronic device then responds to this second operation and redisplays the window of game XX. Similarly, after the third moment, the window of game XX (i.e., the window of the first application) becomes the focused window again. Because the window of game XX becomes the focused window after the third moment, and the screen refresh rate corresponding to the window of game XX is 120Hz, the screen refresh rate needs to be adjusted again, such as... Figure 17 As shown, the screen refresh rate is 120Hz at this time. Furthermore, similar to the second moment, in the third moment, the electronic device is still not in the process of disabling / enabling the dedicated graphics card. Therefore, between the second and third moments, as... Figure 17 As shown, even after switching the screen refresh rate, the display remained completely normal.

[0311] In other words, at the third moment, also based on the fact that the electronic device was not in the process of disabling / enabling the dedicated graphics card, the screen refresh rate was adjusted to 120Hz.

[0312] Then, in the fourth moment after the third moment, the dedicated graphics card is disabled / enabled. At this point, there is no change in the application scenario (focus window), so after the fourth moment, as... Figure 17 As shown, the XX game window is still displayed, and the screen refresh rate remains at 120Hz. However, because the dedicated graphics card was already being disabled / enabled at the fourth moment, the electronic device is in the process of disabling / enabling the dedicated graphics card after the fourth moment.

[0313] Then, in the fifth moment after the fourth moment, if a third operation is received indicating that the user has reopened the browser window (i.e., the window of the second application), the electronic device will respond to this third operation and redisplay the browser window. Therefore, after the fifth moment, the focused window changes back to the browser window, as... Figure 17 As shown.

[0314] However, the browser window's screen refresh rate is 60Hz. Normally, electronic devices would switch the screen refresh rate from 120Hz to 60Hz. But because the electronic device is already in the process of disabling / enabling the dedicated graphics card after the fourth moment, adjusting the screen refresh rate in the fifth moment as usual would cause an integrated graphics driver malfunction, resulting in display abnormalities, such as... Figure 18 As shown, screen tearing may occur due to an abnormal integrated graphics driver.

[0315] In this embodiment of the application, to avoid integrated graphics driver malfunctions leading to... Figure 18The display is abnormal; even if the browser window's screen refresh rate is 60Hz, this embodiment will not adjust the screen refresh rate. Thus, after the fifth moment, even if the focus window changes to the browser window, the screen refresh rate will still be 120Hz. Figure 17 As shown.

[0316] Therefore, through comparison Figure 17 and Figure 18 As can be seen, because this embodiment does not adjust the screen refresh rate during the process of disabling / enabling the dedicated graphics card in the electronic device, it can avoid display abnormalities after the fourth moment, thereby ensuring user experience. That is to say, in the fifth moment, since the screen refresh rate is not adjusted during the process of disabling / enabling the dedicated graphics card in the electronic device, the screen refresh rate remains at 120Hz.

[0317] It should be noted that, Figure 18 The screen tearing shown is merely an illustrative example of display anomalies in this application and does not limit the scope of display anomalies caused by integrated graphics driver malfunctions.

[0318] In some embodiments, whether the electronic device is in the process of disabling / enabling the discrete graphics card can be determined by reading the adjustment flag. The meaning and setting method of the adjustment flag can be found in the description of the first refresh rate switching method above, and will not be repeated here.

[0319] In some embodiments, whether the application scenario has changed, i.e., whether the application scenarios of the first application (e.g., game XX) and the second application (e.g., browser) are the same, can be determined through the focus window change event. For details, please refer to relevant... Figure 12 and Figure 13 The records are as described above, so I will not go into detail here.

[0320] In other embodiments, to avoid the video playback scene from freezing (stuttering) due to the dedicated graphics card being woken up, the dedicated graphics card is woken up before setting the refresh rate if it is determined that the screen refresh rate needs to be adjusted.

[0321] For example, with Figure 17 and Figure 18 Taking the process shown as an example, in Figure 17 and Figure 18In the second instance, because opening a second application requires adjusting the screen refresh rate, the dedicated graphics card is activated before setting the screen refresh rate to 60Hz (the second value of 60Hz) corresponding to the second application. Similarly, in the third instance, because opening a third application requires adjusting the screen refresh rate, the dedicated graphics card is activated before setting the screen refresh rate to 120Hz (the first value of 120Hz). This avoids activating the dedicated graphics card during screen refresh rate adjustments, which could cause screen freezing during video playback. For information on screen freezing, please refer to [link to relevant documentation]. Figure 4A As shown, this will not be elaborated further.

[0322] Another embodiment of this application provides an electronic device, including: one or more processors and a memory. The memory is coupled to the processor; the processor includes a discrete graphics card and an integrated graphics card; the memory stores one or more computer program codes, the computer program codes including computer instructions; when the processor executes the computer instructions, the electronic device implements the refresh rate switching method of any of the above embodiments.

[0323] Another embodiment of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor in an electronic device, causes the electronic device to implement the refresh rate switching method of any of the above embodiments.

[0324] This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps described in the method embodiments above. Specifically, the computer may be an electronic device.

[0325] This application also provides a chip system, such as... Figure 19 As shown, the chip system 190 includes at least one processor 1901 and at least one interface circuit 1902. The processor 1901 and the interface circuit 1902 are interconnected via lines. For example, the interface circuit 1902 can be used to receive signals from other devices (e.g., a computer's memory). As another example, the interface circuit 1902 can be used to send signals to other devices (e.g., the processor 1901).

[0326] For example, interface circuit 1902 can read instructions stored in memory and send those instructions to processor 1901. When the instructions are executed by processor 1901, the computer can perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, and this application embodiment does not specifically limit this.

[0327] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0328] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0329] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0330] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0331] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0332] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A refresh rate switching method, characterized by, Applied to electronic devices, including discrete graphics cards and integrated graphics cards; the method includes: At the first moment, the window of the first application is displayed. At the first moment, the window of the first application is the focus window, and the screen refresh rate is a first value. At the second moment, the first operation is received, and the window of the second application is displayed. After the second moment, the window of the second application becomes the focus window, and the screen refresh rate is a second value, which is different from the first value. At the third moment, a second operation is received, and the window of the first application is displayed. After the third moment, the window of the first application is the focused window, and the screen refresh rate is a first value. Between the first moment and the third moment, the electronic device is not in the process of disabling / enabling the discrete graphics card. At the fourth moment, begin disabling / enabling the dedicated graphics card of the aforementioned electronic device; At the fifth moment, a third operation is received to display the window of the second application. After the fifth moment, the window of the second application becomes the focus window, and the screen refresh rate is the first value. At the sixth moment, the independent graphics card of the electronic device is disabled / enabled. Between the fourth moment and the sixth moment, the electronic device is in the process of disabling / enabling the independent graphics card. The fifth moment is between the fourth moment and the sixth moment.

2. The method of claim 1, wherein, The method further includes: At the second moment, based on the fact that the electronic device is not in the process of disabling / enabling the discrete graphics card, the screen refresh rate is adjusted and set to the second value; At the third moment, based on the fact that the electronic device is not in the process of disabling / enabling the discrete graphics card, the screen refresh rate is adjusted and set to the first value.

3. The method of claim 2, wherein, The display mode of the electronic device includes a hybrid mode, in which the discrete graphics card and the integrated graphics card are switched or output in a mixed manner; Setting the screen refresh rate to the second value includes: when the display mode of the electronic device is the mixed mode and it is currently in a video playback scenario, waking up the dedicated graphics card of the electronic device before setting the screen refresh rate to the second value; Setting the screen refresh rate to the first value includes: when the display mode of the electronic device is the mixed mode and it is currently in a video playback scenario, waking up the dedicated graphics card of the electronic device before setting the screen refresh rate to the first value.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: At the fifth moment, since the electronic device is in the process of disabling / enabling the discrete graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is the first value.

5. The method according to any one of claims 1-3, characterized in that, The method further includes: At the second moment, based on the window of the second application becoming the focus window, the screen refresh rate is set to the second value; At the third moment, based on the window of the first application becoming the focus window, the screen refresh rate is set to the first value.

6. The method according to any one of claims 1-3, characterized in that, The method further includes: Read the adjustment flag; The adjustment flag is used to determine whether the electronic device is in the process of disabling / enabling the discrete graphics card.

7. The method of claim 6, wherein, The method further includes: When the electronic device begins to disable / enable its discrete graphics card, the adjustment flag is set to a first state value, which indicates that the electronic device is in the process of disabling / enabling the discrete graphics card. When the discrete graphics card of the electronic device is disabled / enabled, the adjustment flag is set to a second state value, which indicates that the electronic device is not in the process of disabling / enabling the discrete graphics card.

8. The method of claim 1, wherein, The display mode of the electronic device includes discrete graphics only; the electronic device also includes a user experience (UX) switch and / or a high dynamic range (HDR) switch; wherein, the UX switch is used to control the on / off adjustment of the screen refresh rate; the HDR switch is used to control the on / off adjustment of the HDR function of the electronic device; the method further includes: Between the first time point and the third time point, the UX switch is in the UX switch-on state, the HDR switch is in the HDR switch-off state, and the display mode of the electronic device is not discrete display only.

9. The method of claim 2 or 3, wherein, At the second moment, based on the fact that the electronic device is not in the process of disabling / enabling the dedicated graphics card, adjusting the screen refresh rate and setting the screen refresh rate to the second value includes: At the second moment, the screen refresh rate corresponding to the second application is obtained from the preset file to obtain the second value; Since the electronic device is not in the process of disabling / enabling the discrete graphics card, the screen refresh rate is adjusted and set to the second value.

10. The method of claim 4, wherein, At the fifth moment, based on the electronic device being in the process of disabling / enabling the dedicated graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is the first value, including: At the fifth moment, the screen refresh rate corresponding to the second application is obtained from the preset file to obtain the second value; Since the electronic device is in the process of disabling / enabling the discrete graphics card, the screen refresh rate is not adjusted, and the screen refresh rate is the first value.

11. The method according to claim 5, characterized in that, The step of setting the screen refresh rate to the second value based on the window of the second application becoming the focus window at the second moment includes: Get the focus window change event; When the focus window change event is not a focus window change event of a preset application scenario, if it is determined from the focus window change event that the application scenario of the second application is different from that of the first application, the screen refresh rate is set to a second value based on the window of the second application becoming the focus window. When the focus window change event is a focus window change event of a preset application scenario, the screen refresh rate is set to a second value based on the window of the second application becoming the focus window; the second value corresponds to the screen refresh rate of the preset application scenario.

12. The method according to any one of claims 1-3, characterized in that, The method further includes: At the second moment, when the second application is not a self-refreshing application and the application scenario of the second application is not a preset application scenario, the screen refresh rate is adjusted and the screen refresh rate is set to the second value. At the third moment, when the first application is not a self-refreshing application and the application scenario of the first application is not a preset application scenario, the screen refresh rate is adjusted and set to the first value.

13. The method according to claim 12, characterized in that, The method further includes: Load the pre-defined whitelist; When the whitelist includes the first application, the first application is not a self-refreshing application; when the whitelist does not include the first application, the first application is a self-refreshing application. Alternatively, if the whitelist includes the second application, the second application is not a self-refreshing application; if the whitelist does not include the second application, the second application is a self-refreshing application.

14. The method according to any one of claims 1-3, characterized in that, The method further includes: At the second moment, when the input device of the electronic device is idle and the application scenario of the second application is not a preset application scenario, the screen refresh rate is adjusted and set to the second value. At the third moment, when the input device of the electronic device is idle and the application scenario of the first application is not a preset application scenario, the screen refresh rate is adjusted and set to the first value; the input device includes a keyboard and a mouse.

15. The method according to claim 2 or 3, characterized in that, The method further includes: Before setting the screen refresh rate, increase the power limit, which is used to limit the maximum power of the electronic device during operation, including a long-term power limit.

16. A software program product, comprising a computer program, characterized in that, When the computer program is executed by a processor in an electronic device, the electronic device performs a refresh rate switching method, the method comprising: At the first moment, when the window of the first application becomes the focus window, the screen refresh rate is set to the first value; At the second moment, when the window of the second application becomes the focused window, the screen refresh rate is set to a second value; wherein, between the first moment and the second moment, the electronic device is not in the process of disabling / enabling the discrete graphics card; the first value and the second value are different; At the third moment, a notification is sent to disable / enable the dedicated graphics card of the electronic device; In the fourth moment, when the window of the first application becomes the focused window, the screen refresh rate is not adjusted; At the fifth moment, it is determined that the disabling / enabling of the independent graphics card of the electronic device has been completed; wherein the fourth moment is between the third moment and the fifth moment.

17. The software program product according to claim 16, characterized in that, The display mode of the electronic device includes a hybrid mode, in which the discrete graphics card and the integrated graphics card switch between use or output in a mixed manner; setting the screen refresh rate to a second value includes: When the display mode of the electronic device is in mixed mode and it is currently in a video playback scenario, the dedicated graphics card of the electronic device is woken up before the screen refresh rate is set to the second value.

18. An electronic device, characterized in that, include: One or more processors and a memory, the memory being coupled to the processor; the processor including a discrete graphics card and an integrated graphics card; the memory storing one or more computer program codes, the computer program codes including computer instructions; when the processor executes the computer instructions, the electronic device performs the refresh rate switching method as described in any one of claims 1-15.

19. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor of the electronic device, the electronic device performs the refresh rate switching method as described in any one of claims 1-15.