Screen refresh rate setting method and electronic equipment

CN120029434APending Publication Date: 2025-05-23HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410390973.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In the video playback scenario of electronic devices, a fixed high refresh rate leads to waste of resources and power, especially when the barrage is turned on, it cannot effectively respond to changes in refresh rate requirements.

Method used

By monitoring the video frame rate and the Desktop Window Manager (DWM) frame rate, determine whether the barrage is turned on, and dynamically adjust the screen refresh rate according to different scenes to meet the changes in refresh rate requirements.

Benefits of technology

It effectively reduces the power consumption of electronic devices when playing videos, extends battery life, and avoids waste of power and screen lag caused by fixed refresh rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029434A_ABST
    Figure CN120029434A_ABST
Patent Text Reader

Abstract

The invention provides a screen refresh rate setting method and electronic equipment, and relates to the technical field of display. According to the method, whether the equipment starts the bullet screen or not can be identified, and different screen refresh rates are set when the bullet screen is started / not started, so that the power consumption is reduced. The method comprises the steps of setting a screen refresh rate as a refresh rate 1 in a video display process of the electronic equipment; judging whether a bullet screen exists in the video picture or not according to the frame rate and the refresh rate 1 of the desktop window manager DWM; wherein the DWM frame rate is used for reflecting frame rates generated by other pictures except the video picture; if the bullet screen exists in the video picture, setting the screen refresh rate as a refresh rate 2; wherein the refresh rate 2 is smaller than the refresh rate 1; if the bullet screen does not exist in the video picture, the screen refresh rate is set to be a refresh rate 3, and the refresh rate 3 is smaller than the refresh rate 2.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is 202311506265.4, and the original application date is November 13, 2023. The entire contents of the original application are incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of display technology, and in particular to a method for setting a screen refresh rate and an electronic device. Background Art

[0003] The refresh rate is the number of times the screen is refreshed per second. With the development of display technology, electronic devices such as mobile phones, tablets, and personal computers (PCs) can switch refresh rates to meet the needs of different scenarios. For example, at present, most video applications support the barrage function. During the video playback process of the electronic device, the user can control the barrage function to be turned on or off, and the refresh rate requirement is higher when the barrage is turned on.

[0004] However, in the video playback scenario of an electronic device, regardless of whether the barrage is turned on or not, the electronic device will always display the picture at a fixed, high refresh rate. This causes the actual refresh rate of the electronic device to be higher than the required refresh rate during video playback, resulting in a waste of resources and power. Summary of the invention

[0005] The embodiments of the present application provide a method for setting a screen refresh rate and an electronic device, which are used to reduce power consumption when the electronic device plays a video and turns on barrage, thereby reducing power consumption.

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

[0007] In the first aspect, an embodiment of the present application provides a method for setting a screen refresh rate, which is applied to an electronic device, and the method includes: at a first time point, the electronic device plays a video, wherein the video is played in a video playback interface, at the first time point, the screen refresh rate of the electronic device is a first refresh rate, and the frame rate of the video is a first frame rate. At a second time point, a first operation of opening a bullet screen is received. Wherein, the first operation of opening the bullet screen is, for example, an operation of a user clicking a bullet screen switch in the video playback interface. After the second time point, the bullet screen is displayed on the video playback interface, the screen refresh rate is set to a second refresh rate, the frame rate of the desktop window manager DWM is a second frame rate, the second refresh rate is greater than or equal to the first refresh rate, the value of the second refresh rate is greater than the value of the first frame rate, and the second time point is later than the first time point. Then at a third time point, the electronic device sets the screen refresh rate to a third refresh rate, the value of the third refresh rate is greater than the value of the first frame rate, and the third time point is later than the second time point. At the fourth time point, after the barrage is turned off, the electronic device plays a video. At the fourth time point, the screen refresh rate is the first refresh rate, and the fourth time point is later than the third time point; at the fifth time point, the second operation is received, and the second operation is not an operation to turn on the barrage. After the fifth time point, the screen refresh rate is set to the second refresh rate, the DWM frame rate is the third frame rate, and the third frame rate is less than the second frame rate. The fifth time point is later than the fourth time point; at the sixth time point, the screen refresh rate is set to the fourth refresh rate, and the fourth refresh rate is less than the third refresh rate. The sixth time point is later than the fifth time point.

[0008] It can be seen that for the same video, the operation of turning on the barrage or not turning on the barrage (i.e., the second operation) will result in a different DWM frame rate (for example, the operation of turning on the barrage changes the DWM frame rate to the second frame rate, and the operation of not turning on the barrage changes the DWM frame rate to the third frame rate), thereby allowing the electronic device to set different screen refresh rates. This can meet the refresh rate requirements in different scenarios, and while displaying the screen in the process, it can avoid the problem of power waste caused by setting a fixed, higher refresh rate, thereby extending the battery life of the electronic device.

[0009] In an implementation provided in the first aspect, based on the difference between the second refresh rate and the second frame rate being smaller than the difference between the second refresh rate and the third frame rate, the fourth refresh rate is smaller than the third refresh rate.

[0010] In an implementation manner provided in the first aspect, at a third time point, setting the screen refresh rate to a third refresh rate includes: at the third time point, based on the difference between the second refresh rate and the second frame rate being less than or equal to the first threshold, setting the screen refresh rate to the third refresh rate. At the sixth time point, setting the screen refresh rate to a fourth refresh rate includes: at the sixth time point, based on the difference between the second refresh rate and the third frame rate being greater than the first threshold, setting the screen refresh rate to the fourth refresh rate. That is, the electronic device can determine whether to turn on the bullet screen by judging whether the DWM frame rate (for example, the second frame rate or the third frame rate) follows the screen refresh rate (for example, the second refresh rate). When the difference between the second refresh rate and the second frame rate is less than or equal to the first threshold, it indicates that the DWM frame rate follows the screen refresh rate, and then determines that the bullet screen is turned on, and then sets the screen refresh rate to the third refresh rate. When the difference between the second refresh rate and the third frame rate is greater than the first threshold, it indicates that the bullet screen is not turned on, and then the screen refresh rate is set to a smaller third refresh rate.

[0011] In an implementation manner provided in the first aspect, at a third time point, setting the screen refresh rate to a third refresh rate includes: at the third time point, based on the difference between the second refresh rate and the second frame rate being less than or equal to the first threshold and the duration being greater than or equal to the first duration, setting the screen refresh rate to the third refresh rate. At a sixth time point, setting the screen refresh rate to a fourth refresh rate includes: at the sixth time point, based on the difference between the second refresh rate and the second frame rate being less than or equal to the first threshold and the duration being less than the first duration, setting the screen refresh rate to the fourth refresh rate.

[0012] Based on the above scheme, the electronic device can also determine whether the duration during which the difference between the second refresh rate and the second frame rate is less than or equal to the first threshold is greater than or equal to the first duration. This can reduce misjudgment and improve the accuracy of the judgment result on whether there is barrage in the video screen.

[0013] In an implementation provided in the first aspect, at a second time point, the DWM frame rate is a fourth frame rate, and the screen refresh rate is set to a second refresh rate, including: based on the difference between the first refresh rate and the fourth frame rate being less than or equal to the second threshold, the screen refresh rate is set to the second refresh rate. Wherein, when the difference between the first refresh rate and the fourth frame rate is less than or equal to the first threshold, it can be considered that the electronic device is more likely to turn on the barrage (or there is a barrage in the video screen), and then the screen refresh rate is further set to the second refresh rate, and whether the DWM frame rate follows the screen refresh rate is determined to determine whether there is a barrage in the video screen. In this way, multiple judgments can not only improve the accuracy of the judgment result, but also avoid the waste of resources caused by the electronic device adjusting the screen refresh rate when it is unnecessary.

[0014] In one implementation provided by the first aspect, the second refresh rate is greater than or equal to 100 Hz.

[0015] Understandably, when the user turns on the bullet screen when playing a video on the electronic device or the user changes the screen displayed on the desktop, the DWM frame rate can increase. However, due to the physiological limitations of the human body, it is difficult for the user to change the screen displayed on the desktop to increase the DWM frame rate to more than 100Hz. Therefore, by setting the first refresh rate to a value greater than or equal to 100Hz, it can be distinguished whether the DWM frame rate is caused by turning on the bullet screen or by the user changing the screen displayed on the desktop.

[0016] In an implementation manner provided in the first aspect, the third refresh rate is the maximum value of the first frame rate and the minimum frame rate of the bullet screen, and the minimum frame rate of the bullet screen is the minimum frame rate required to prevent the bullet screen from being stuck. In this way, the electronic device can set the screen refresh rate to the minimum value required to display the picture smoothly when the bullet screen is turned on / off, thereby saving power.

[0017] In an implementation manner provided in the first aspect, the value of the fourth refresh rate is equal to the value of the first frame rate.

[0018] In an implementation manner provided in the first aspect, the electronic device has enabled a dynamic refresh rate function, and the extended display identification data of the electronic device includes a refresh rate, so that a black screen phenomenon can be avoided when the electronic device switches the screen refresh rate.

[0019] In an embodiment provided in the first aspect, the electronic device includes a video management service, an event tracking module and a display control module, and the method also includes: the event tracking module sends tracking data to the video management service; the video management service determines that the DWM frame rate is a second frame rate based on the tracking data; at a third time point, the screen refresh rate is set to a third refresh rate, including: at the third time point, the video management service determines whether the difference between the second refresh rate and the second frame rate is less than or equal to a first threshold; the video management service sends a first setting instruction to the display control module based on the difference between the second refresh rate and the second frame rate being less than or equal to the first threshold, the first setting instruction carrying the third refresh rate; the display control module sets the screen refresh rate to the third refresh rate based on the first setting instruction.

[0020] In an implementation manner provided by the first aspect, at a second time point, the DWM frame rate is a fourth frame rate, and before the screen refresh rate is set to the second refresh rate, the method also includes: the video management service determines whether the difference between the first refresh rate and the fourth frame rate is less than or equal to the second threshold; the video management service sends a second setting instruction to the display control module based on the difference between the first refresh rate and the fourth frame rate being less than or equal to the second threshold, the second setting instruction carrying the second refresh rate; the screen refresh rate is set to the second refresh rate, including: the display control module sets the screen refresh rate to the second refresh rate based on the second setting instruction.

[0021] In an embodiment provided in the first aspect, the method also includes: the video management service obtains multiple video frame rates based on tracking data; the video management service determines whether the difference between the first refresh rate and the fourth frame rate is less than or equal to the second threshold, including: based on the change rate of multiple video frame rates being less than or equal to the frame rate threshold, the video management service determines whether the difference between the first refresh rate and the fourth frame rate is less than or equal to the second threshold.

[0022] In a second aspect, the present application provides a method for setting a screen refresh rate, which is applied to an electronic device, and the method includes: receiving an operation of a user to play a video, wherein the frame rate of the video is a first frame rate; in the process of the electronic device displaying the video, setting the screen refresh rate to a preset refresh rate 1, and the refresh rate 1 is greater than the first frame rate; judging whether there is a barrage in the video screen according to the desktop window manager DWM frame rate and refresh rate 1; wherein the DWM frame rate is used to reflect the frame rate generated by other screens except the video screen; if there is a barrage in the video screen, setting the screen refresh rate to refresh rate 2; wherein refresh rate 2 is greater than the first frame rate and less than refresh rate 1; if there is no barrage in the video screen, setting the screen refresh rate to refresh rate 3, and refresh rate 3 is less than refresh rate 2 and greater than or equal to the first frame rate.

[0023] It can be understood that the present application can determine whether there is a barrage in the video screen based on the DWM frame rate and refresh rate 1, and then set different screen refresh rates when there is / is not a barrage in the video screen to meet the refresh rate requirements in different scenarios. In this way, while the process displays the screen, it can avoid the problem of power waste caused by setting a fixed and high refresh rate, thereby extending the battery life of electronic devices.

[0024] In a possible implementation method provided in the second aspect, it is determined whether there is a barrage in the video screen based on the desktop window manager DWM frame rate and refresh rate 1, including: if the difference between the refresh rate 1 and the DWM frame rate is less than or equal to the first threshold, it is determined that there is a barrage in the video screen; if the difference between the refresh rate 1 and the DWM frame rate is greater than the first threshold, it is determined that there is no barrage in the video screen.

[0025] It can be understood that if the difference between the refresh rate 1 and the DWM frame rate is less than or equal to the first threshold, it indicates that the DWM frame rate follows the screen refresh rate, thereby determining that there is barrage in the video screen.

[0026] In a possible implementation method provided in the second aspect, when the electronic device receives an operation from the user to turn on the barrage, the difference between the refresh rate 1 and the DWM frame rate is less than or equal to the first threshold; when the electronic device receives an operation from the user to change the screen displayed on the desktop, the difference between the refresh rate 1 and the DWM frame rate is greater than the first threshold.

[0027] In a possible implementation provided in the second aspect, judging whether there is a bullet screen in the video screen according to the desktop window manager DWM frame rate and refresh rate 1 includes: if the difference between the refresh rate 1 and the DWM frame rate is less than or equal to the first threshold and the duration is greater than or equal to the first duration, determining that there is a bullet screen in the video screen; if the difference between the refresh rate 1 and the DWM frame rate is less than or equal to the first threshold and the duration is less than the first duration, determining that there is no bullet screen in the video screen. This method can reduce misjudgment and improve the accuracy of the judgment result of whether there is a bullet screen in the video screen.

[0028] In a possible implementation method provided in the second aspect, when the electronic device receives an operation from the user to turn on the barrage, the duration for which the difference between the refresh rate 1 and the DWM frame rate is less than or equal to the first threshold is greater than or equal to the first duration; when the electronic device receives an operation from the user to change the screen displayed on the desktop, the duration for which the difference between the refresh rate 1 and the DWM frame rate is less than or equal to the first threshold is less than the first duration.

[0029] In a possible implementation manner provided in the second aspect, the method also includes: obtaining the DWM frame rate; setting the screen refresh rate to a preset refresh rate 1, including: when the difference between the fourth refresh rate and the DWM frame rate is less than or equal to the first threshold, setting the screen refresh rate to refresh rate 1; wherein the fourth refresh rate is the current screen refresh rate, and the fourth refresh rate is less than refresh rate 1.

[0030] That is to say, when the difference between the fourth refresh rate and the DWM frame rate is less than or equal to the first threshold, it can be considered that the electronic device is more likely to turn on the barrage (or the barrage exists in the video screen), and then the screen refresh rate is further set to refresh rate 1, and whether the DWM frame rate follows the screen refresh rate is determined to determine whether there is a barrage in the video screen. In this way, multiple judgments can not only improve the accuracy of the judgment results, but also avoid the waste of resources caused by the electronic device setting the screen refresh rate to refresh rate 1 when it is unnecessary (the difference between the fourth refresh rate and the DWM frame rate is greater than the first threshold).

[0031] In a possible implementation provided in the second aspect, the method further includes: obtaining multiple video frame rates; wherein each video frame rate is used to reflect the frame rate of the video within a preset time period; if the change rate of the multiple video frame rates is less than or equal to the frame rate threshold, it is determined that the electronic device is in the process of displaying the video. It can be understood that if the change rate of the multiple video frame rates is less than or equal to the frame rate threshold, it indicates that the video frame rate tends to be stable, and it can be considered that the video-related process is outputting a stable frame rate, thereby determining that the electronic device is in the process of displaying the video.

[0032] In a possible implementation manner provided by the second aspect, the refresh rate 1 is greater than or equal to 100 Hz.

[0033] Understandably, when a user turns on the bullet screen when playing a video on an electronic device or when the user changes the screen displayed on the desktop, the DWM frame rate can increase. However, due to the physiological limitations of the human body, it is difficult for the DWM frame rate to increase to more than 100Hz by the user changing the screen displayed on the desktop. Therefore, by setting the refresh rate 1 to a value greater than or equal to 100Hz, it is possible to distinguish whether the DWM frame rate is caused by turning on the bullet screen or by the user changing the screen displayed on the desktop.

[0034] In a possible implementation method provided in the second aspect, refresh rate 2 is the maximum value of the first frame rate and the minimum frame rate of the barrage, the minimum frame rate of the barrage is the minimum frame rate required to prevent the barrage from being stuck, and refresh rate 3 is the first frame rate.

[0035] In this way, electronic devices can set the screen refresh rate to the minimum value required for smooth display of the picture when the barrage is turned on / off, thereby saving power.

[0036] In a possible implementation of the second aspect, the electronic device has enabled the dynamic refresh rate function, and the extended display identification data of the electronic device includes a refresh rate. In this way, a black screen phenomenon can be avoided when the electronic device switches the screen refresh rate.

[0037] In a possible implementation manner provided in the second aspect, the electronic device includes a video management service and an event tracking module, and the method also includes: the event tracking module sends tracking data to the video management service; the video management service obtains the DWM frame rate based on the tracking data; and determines whether there is a barrage in the video screen according to the desktop window manager DWM frame rate and refresh rate 1, including: the video management service determines whether the difference between the refresh rate 1 and the DWM frame rate is less than or equal to a first threshold; if the difference between the refresh rate 1 and the DWM frame rate is less than or equal to the first threshold, the video management service determines that there is a barrage in the video screen; if the difference between the refresh rate 1 and the DWM frame rate is greater than the first threshold, the video management service determines that there is no barrage in the video screen.

[0038] In a possible implementation method provided in the second aspect, the electronic device also includes a display control module; setting the screen refresh rate to a preset refresh rate 1 includes: the video management service sends a first setting instruction to the display control module, the first setting instruction carries the refresh rate 1; the display control module sets the screen refresh rate to the refresh rate 1; setting the screen refresh rate to the refresh rate 2 includes: the video management service sends a second setting instruction to the display control module, the second setting instruction carries the refresh rate 2; the display control module sets the screen refresh rate to the refresh rate 2; setting the screen refresh rate to the refresh rate 3 includes: the video management service sends a third setting instruction to the display control module, the third setting instruction carries the refresh rate 3; the display control module sets the screen refresh rate to the refresh rate 3.

[0039] In a possible implementation method provided in the second aspect, before the video management service sends the first setting instruction to the display control module, the method also includes: the video management service determines whether the difference between the fourth refresh rate and the DWM frame rate is less than or equal to the first threshold, the fourth refresh rate is the current screen refresh rate, and the fourth refresh rate is less than the refresh rate 1; the video management service sends the first setting instruction to the display control module, including: when the difference between the fourth refresh rate and the DWM frame rate is less than or equal to the first threshold, the video management service sends the first setting instruction to the display control module.

[0040] In a possible implementation manner provided in the second aspect, the method also includes: the video management service obtains multiple video frame rates based on tracking data; before the video management service determines whether the difference between the fourth refresh rate and the DWM frame rate is less than or equal to the first threshold, the method also includes: if the change rate of the multiple video frame rates is less than or equal to the frame rate threshold, determine whether the difference between the fourth refresh rate and the DWM frame rate is less than or equal to the first threshold.

[0041] In a third aspect, the present application provides an electronic device, comprising: a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the electronic device executes a method as in the first aspect, the second aspect and any one of their implementations.

[0042] In a fourth aspect, the present application provides a computer-readable storage medium, comprising computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method of the first aspect, the second aspect and any one of their implementations.

[0043] It can be understood that the beneficial effects that can be achieved by the electronic device of the second aspect and the computer-readable storage medium of the third aspect provided above can be referred to the beneficial effects in the first aspect and any possible implementation thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram of a PC interface provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of another PC interface provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0047] Figure 4 An architecture diagram of an electronic device provided in an embodiment of the present application;

[0048] Figure 5 Schematic diagram of the workflow for setting the refresh rate for electronic devices;

[0049] Figure 6 A schematic diagram of the workflow of software and hardware for displaying video images on electronic devices;

[0050] Figure 7 A schematic diagram of a method for setting a screen refresh rate provided in an embodiment of the present application Figure 1 ;

[0051] Figure 8 A schematic diagram of a method for setting a screen refresh rate provided in an embodiment of the present application Figure 2 ;

[0052] Fig. 9 A schematic diagram of a method for setting a screen refresh rate provided in an embodiment of the present application Figure 3 ;

[0053] Fig.10 This is a graph showing the changing trends of screen refresh rate, video frame rate, and DWM frame rate when the electronic device is playing a video and bullet screen is turned on.

[0054] Fig.11 A schematic diagram of a method for setting a screen refresh rate provided in an embodiment of the present application Figure 4 ;

[0055] Fig.12 A graph showing the changing trends of the screen refresh rate, video frame rate, and DWM frame rate when the user scrolls the mouse wheel while the electronic device is playing a video.

[0056] Fig.13 A schematic diagram of another PC interface provided in an embodiment of the present application. DETAILED DESCRIPTION

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

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

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

[0060] At present, most video applications support the bullet screen function. When an electronic device plays a video, the user can control the bullet screen function to be turned on or off. However, in the video playback scenario of an electronic device, the electronic device cannot identify whether there is a bullet screen. Therefore, in order for the electronic device to smoothly play the video including the bullet screen, the electronic device usually refreshes the display at a fixed high refresh rate when playing the video, for example, at a fixed refresh rate of 60Hz, 90Hz or 120Hz.

[0061] Take the electronic device as PC as an example, Figure 1 (a) in FIG. 1 shows an interface 101 of a PC. The interface 101 is an interface of a video application, and the interface 101 includes a plurality of playable videos, such as video a, video b, video c, etc. In response to a user's operation on video a, Figure 1 As shown in (b) of FIG. 1 , the PC may display interface 102. Interface 102 is a playback interface of video a, and interface 102 includes a bullet screen switch 102a, and the bullet screen switch 102a is in an off state. At this time, the PC refreshes the screen at a fixed refresh rate, such as 60 Hz. If the user wants to watch the bullet screen, the user may click the bullet screen switch 102a. In response to the user clicking the bullet screen switch 102a, Figure 2 As shown, the PC can display interface 103. Interface 103 is similar to interface 102, except that the barrage switch 102a in interface 103 is turned on, and barrage 103a is scrolling on the video screen in interface 103, and barrage 103a is, for example, "Hahahaha", "Very funny", etc. At this time, the PC still refreshes the screen at 60Hz.

[0062] However, in the video playback scenario of electronic devices, a fixed refresh rate is difficult to meet the refresh rate requirements during video playback. Figure 2 In the scenario shown above, when playing a video without opening the bullet screen, only a lower refresh rate (such as 24Hz, 30Hz) is needed to meet the requirement of smooth display. Using a 60Hz refresh rate will cause excessive processor load and high power consumption, resulting in high power consumption of the electronic device. Figure 2 In the scenario shown above, the video is played with bullet screen turned on. Since bullet screen needs to be displayed dynamically on the screen, the refresh rate requirement in this scenario is higher than Figure 1 The refresh rate requirement in the scenario shown in (b) is as follows. In this case, if Figure 2 In the scenario shown, if the refresh rate requirement is higher than 60Hz, it will cause screen freezes and affect the user experience.

[0063] Based on the above content, we can know that, first, the fixed refresh rate is higher than the actual required refresh rate in the video playback scenario, which may easily cause high power consumption and fail to meet the low power consumption requirements of the PC; second, the demand for refresh rate in the video playback scenario will change dynamically, and the fixed refresh rate cannot be applied to the different requirements for refresh rate in the video playback scenario.

[0064] In view of this, an embodiment of the present application provides a method for setting the screen refresh rate. It can determine whether the electronic device is playing a video by monitoring the video frame rate, determine whether the barrage is turned on in the video playback scenario by monitoring whether the DWM frame rate follows the screen refresh rate, and set the refresh rate according to whether the barrage is turned on. Among them, if the barrage is not turned on, the picture is displayed at a first refresh rate; if the barrage is turned on, the picture is displayed at a second refresh rate, and the second refresh rate is greater than the first refresh rate. In this way, it can avoid excessive load and excessive power consumption caused by too high a refresh rate, and avoid screen freezes caused by too low a refresh rate.

[0065] It should be noted that the method for setting the screen refresh rate provided in the embodiment of the present application can be applied to video playback scenarios, online class scenarios, network live broadcast scenarios, video conferencing scenarios, real-time subtitle recognition scenarios, etc. The above-mentioned electronic device playing videos can be understood as the electronic device playing online / local videos, displaying recorded or live online classes, displaying ongoing video conferences, or displaying live broadcast images, etc. In these scenarios, users can communicate with other users through barrages. In particular, in the real-time subtitle recognition scenario, the electronic device can convert the voice in the video into text and display it. In this case, the text converted into the voice is "barrage".

[0066] It should also be noted that in the embodiments of the present application, turning on the barrage in the video playback scenario indicates that there is barrage scrolling in the video screen. Some situations where the barrage function is turned on but no user sends a barrage or the system clears the barrage, resulting in the absence of barrage in the video screen, are not considered in the present application.

[0067] The screen refresh rate setting method provided in the embodiment of the present application can be applied to electronic devices such as PCs, mobile phones, tablet computers, laptops, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, smart watches, etc., in which preset applications are installed. Among them, the preset applications mentioned in the embodiment of the present application refer to applications that can play video images and support bullet screen functions, such as video applications, conference applications, live broadcast applications, learning applications, etc.

[0068] Figure 3FIG. 1 shows a schematic diagram of the hardware structure of an electronic device. Figure 3 As shown, the electronic device 200 may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, a wireless communication module 250, a display screen 260, etc.

[0069] It is understandable that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments, the electronic device 200 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

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

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

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

[0073] In some embodiments, the processor 210 may include one or more interfaces. The interface may include a two-wire serial bus (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver / transmitter (universal asynchronous receiver / transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input / output (general-purpose input / output, GPIO) interface, and / or a USB interface, etc.

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

[0075] The internal memory 221 may be used to store computer executable program codes, which include instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by running the instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area.

[0076] The program storage area may store an operating system, an application required for at least one function (such as a video playback function, an audio playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 200 (such as audio data, image frames, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0077] The charging management module 240 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 240 charges the battery 242, it can also power the electronic device through the power management module 241.

[0078] The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 260, the camera 293, and the wireless communication module 250. In some embodiments, the power management module 241 and the charging management module 240 can also be set in the same device.

[0079] The wireless communication module 250 can provide wireless communication solutions for application in the electronic device 200, including wireless local area network (WLAN), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.

[0080] The wireless communication module 250 may be one or more devices integrating at least one communication processing module. The wireless communication module 250 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 210. The wireless communication module 250 may also receive a signal to be sent from the processor 210, modulate the signal, amplify the signal, and convert it into an electromagnetic wave for radiation via the antenna 2.

[0081] The electronic device 200 implements the display function through a GPU, a display screen 260, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 260 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change display information.

[0082] The display screen 260 is used to display images, videos, etc. The display screen 260 includes a display panel.

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

[0084] Figure 4 An architectural diagram of an electronic device provided in accordance with an embodiment of the present application.

[0085] See also Figure 4 , electronic devices include physical hardware. Physical hardware may include any hardware device, such as one or more general-purpose processors, memory, or Figure 3 Any one or more of the hardware shown in . Figure 4 As shown, the physical hardware layer provided in the embodiment of the present application includes a GPU, a memory and a display screen. It should be noted that the GPU can be one or more. The GPU can perform operations such as image rendering and video acceleration.

[0086] The memory includes the front cache and the back cache. The back cache is used to store the latest rendered images by the graphics card, and the front cache is used to transmit the images to the display screen. When the graphics card completes the rendering of a frame and stores it in the back cache, the back cache is changed to the front cache. This process is called "frame transfer". Correspondingly, the front cache is changed to the new back cache.

[0087] The display screen includes an embedded display port (eDP) signal receiving module, a timing control module, a remote frame buffer (RFB) module, an RFB control module, and a liquid crystal display (LCD) module (not shown in the figure).

[0088] In addition, an operating system is running on the above hardware devices. For example, WINDOWS TM Operating system, Android TM Operating system, IOS TM Operating system, etc. Application programs can be installed and run on this operating system.

[0089] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, WINDOWS TM The operating system can be divided into user state and kernel state, where the user state includes the application layer and the service layer, and the kernel state includes the operating system (OS) layer.

[0090] like Figure 4 As shown, the application layer includes applications such as video, live broadcast, conference, and learning. It should be noted that only some applications are shown in the figure, and the application layer can also include more applications.

[0091] The service layer includes PC Manager video service (also known as video management service), application programming interface runtime (API runtime) in the graphics runtime, user mode driver (UMD), dynamic link library and desktop window manager (DWM), etc.

[0092] Among them, the PC Manager video service can register a monitor with the OS layer to monitor the frame rate of the video process (referred to as the video frame rate) and the frame rate of the DWM process (referred to as the DWM frame rate). In addition, the PC Manager video service is also used to determine whether the electronic device is in a video playback scene (i.e., whether the video is being played), whether the barrage is turned on in the video playback scene, etc.

[0093] The graphics runtime may provide an API that enables an application (eg, a video application) to request execution of GPU functions of a supported rendering framework. In an optional design, the graphics runtime may be implemented by DirectX.

[0094] Among them, in user mode, the graphics runtime can provide an API to the application layer application through the API runtime, so that the application can create resources, set states, draw calls, etc. In an optional design, the API runtime can be implemented by Direct3D (D3D) runtime of DirectX.

[0095] UMD can be used to receive graphics commands, construct hardware context and command buffer in response to graphics commands, and pass the command buffer to the user mode driver (kernel mode driver, KMD) of the OS layer for further processing. Specifically, UMD can convert graphics commands issued by API runtime into hardware-specific commands (i.e., GPU-specific commands). During the conversion process, UMD can reserve the appropriate hardware context for the GPU.

[0096] The dynamic link library can provide system call entry and internal function support for the application. In the application embodiment, the dynamic link library includes GDI32.dll, which is used to provide functions for implementing the graphics device interface (GDI), is responsible for information exchange between the system and the drawing program, and processes the graphics output of all Windows programs.

[0097] DWM can render images of different windows into one frame of image. In the embodiment of the present application, DWM can render the video screen and bullet screen into one frame of image to achieve the effect of scrolling the bullet screen on the video screen. Thus, the DWM frame rate can reflect the frame rate of the bullet screen to a certain extent.

[0098] like Figure 4 As shown, the OS layer includes an event tracing for windows (ETW) module, a graphics scheduler in a graphics runtime, a KMD, and a display control module.

[0099] Among them, the ETW module can monitor whether the process calls the rendering function, and feedback the time when the process calls the rendering function and the object that calls the rendering function to the PC Manager Video Service.

[0100] The graphics scheduler can manage the queue of rendering instructions. In an optional design, the graphics scheduler can be implemented by DirectX graphics kernel (Dxgkrnl).

[0101] KMD can check the instruction stream transmitted by the graphics scheduler to avoid illegal instructions. KMD can also be used to implement physical memory allocation and mapping, set the display mode of the display screen, transmit data and instructions to the GPU, etc. It should be noted that multiple UMDs can exist in an operating system at the same time, but only one KMD can exist.

[0102] The display control module can be used to set different screen refresh rates for the display screen depending on whether the barrage is turned on or not.

[0103] It should be noted that the above architecture is for illustration only. In other implementations, as long as the functions implemented by each functional module are similar to those in the embodiments of the present application, the solution of the present application can also be implemented.

[0104] Figure 5 Schematic diagram of the workflow for setting the refresh rate for electronic devices.

[0105] See also Figure 5 , the PC management video service of the service layer can register a listener with the ETW module of the OS layer to determine whether the video process or the DWM process calls the rendering function, and the ETW module can send the monitored data to the PC management video service. Then, the PC management video service can determine the video frame rate and the DWM frame rate based on the monitored data, and further determine whether to turn on the barrage based on the video frame rate, the DWM frame rate, and whether the DWM frame rate follows the screen refresh rate. The PC management video service can also interact with the display control module of the OS layer, and send the judgment result of whether to turn on the barrage to the display control module, and the display control module can set the refresh rate based on the judgment result.

[0106] Figure 6 Schematic diagram of the workflow of software and hardware for displaying video images on electronic devices.

[0107] See also Figure 6 , the video application or DWM in the application layer can interact with the API runtime in the service layer, and the API runtime can interact with the UMD which also belongs to the service layer, so that the video application can send rendering instructions to the UMD through the API runtime, and the UMD can convert the rendering instructions sent by the application into rendering commands that the hardware can recognize. The UMD can interact with the graphics scheduler in the OS layer to transmit the rendering commands to the graphics scheduler. The graphics scheduler can interact with the KMD which also belongs to the OS layer to send rendering commands to the KMD. The KMD can interact with the graphics card to send rendering commands to the graphics card. After receiving the rendering command, the graphics card can render the image to be processed and send the rendered image frame to the back cache. At this time, the back cache is changed to the front cache.

[0108] In an optional design, the graphics card can send a pixel stream and drawing instructions to the display screen at a preset refresh rate. After receiving the drawing instructions, the display screen draws and displays the rendered image frames. In this case, the actual refresh rate of the electronic device (i.e., the refresh rate of the display screen, referred to as the screen refresh rate) is equal to the preset refresh rate.

[0109] In another optional design, the front cache can send the rendered image frames to the display screen, which will be stored in the cache of the display screen (such as the RFB cache). Then, the graphics card can send a panel self refresh (PSR) signal to the display screen according to the rate of the current rendered image frames. After receiving the PSR signal, the display screen draws and displays the image frames stored in the RFB cache. In this case, the actual refresh rate of the electronic device may be inconsistent with the preset refresh rate.

[0110] The following will describe in detail the method for setting the screen refresh rate provided in the embodiments of the present application in conjunction with the accompanying drawings.

[0111] The present invention provides a method for setting a screen refresh rate, which can be applied to Figure 3 The electronic device 200 is shown. Figure 7 , which is a flow chart of a method for setting a screen refresh rate provided in an embodiment of the present application Figure 1 .like Figure 7 As shown, the method includes:

[0112] S701, the electronic device obtains the video frame rate and the DWM frame rate.

[0113] In a possible design, the electronic device can monitor the time and number of times the video process and the DWM process call the rendering function, and then obtain the video frame rate and the DWM frame rate based on the time and number. The video frame rate is the frame rate of the video process, which can be used to reflect whether the video application is playing the video.

[0114] The DWM frame rate is the frame rate of the DWM process, which can be used to reflect user behavior. Among them, the operation of the user turning on the bullet screen when the electronic device plays a video or the user changing the screen displayed on the desktop can cause the DWM frame rate to rise. Among them, the operation of the user changing the screen displayed on the desktop includes the user's operation on the window on the desktop, such as the operation of the user dragging the window, the user sliding the mouse wheel to change the window screen, etc. However, due to the physiological limitations of the human body, it is difficult for the user to operate the window at a very fast speed (for example, 120 times / second), so the user's operation on the window has limited impact on the DWM frame rate, and the DWM frame rate cannot exceed 100Hz. Therefore, based on the characteristic that the user's operation on the window cannot make the DWM frame rate exceed 100Hz, the electronic device can exclude the interference of the user's operation on the window on the DMW frame rate. In the case where the interference of the user's operation on the window on the DMW frame rate has been excluded, the DWM frame rate can be considered to be the frame rate of the bullet screen (referred to as the bullet screen frame rate).

[0115] It should be noted that the electronic device can continuously obtain the video frame rate and the DWM frame rate, and the video frame rate and the DWM frame rate can change in real time according to actual conditions.

[0116] S702: The electronic device determines whether to play the video according to the video frame rate.

[0117] If the electronic device is not playing the video, S702 is executed again; if the electronic device is playing the video, S703 is executed.

[0118] In an optional implementation, considering that the video frame rate is stable during the video playing process of the electronic device, if the fluctuation of the video frame rate is detected to be small, it indicates that the electronic device is playing the video; if the fluctuation of the video frame rate is large, it indicates that the electronic device is not playing the video.

[0119] Understandably, when the electronic device is not playing a video, even if the user turns on the bullet screen, the electronic device will not play the video or display the bullet screen. In this case, it is less meaningful to determine whether the electronic device turns on the bullet screen, so S702 can be re-executed or the process can be terminated. When the electronic device plays a video, it can be further determined whether the electronic device turns on the bullet screen.

[0120] S703, the electronic device sets the screen refresh rate to a preset refresh rate 1.

[0121] The refresh rate 1 is a value greater than or equal to 100 Hz, such as 101 Hz, 110 Hz, 115 Hz, 120 Hz, etc., and is not specifically limited here.

[0122] The inventors have found that the barrage frame rate follows the screen refresh rate, that is, as the screen refresh rate increases or decreases, the barrage frame rate will increase or decrease to a corresponding or close value. For example, if the screen refresh rate becomes 40Hz, the barrage frame rate will also become 40Hz, or 38Hz, 39Hz, etc., which are close to 40Hz.

[0123] In addition, as mentioned above, the DWM frame rate cannot exceed 100Hz based on the user's operation on the window, so the screen refresh rate is set to a value greater than or equal to 100Hz to eliminate the interference of the user's operation on the window on the DMW frame rate, and then determine whether the DWM frame rate follows the screen refresh rate (i.e. execute S704) to determine whether the electronic device has turned on the barrage.

[0124] S704: The electronic device determines whether the difference between the refresh rate 1 and the DWM frame rate is less than or equal to a threshold.

[0125] If the difference between the refresh rate 1 and the DWM frame rate is less than or equal to the threshold, execute S705; if the difference between the refresh rate 1 and the DWM frame rate is greater than the threshold, execute S706.

[0126] The difference between refresh rate 1 and DWM frame rate is refresh rate 1 minus DWM frame rate. If the difference between refresh rate 1 and DWM frame rate is less than or equal to the threshold, it indicates that the barrage frame rate is close to the screen refresh rate, so it is determined that the electronic device turns on the barrage, and further executes S705; if the difference between refresh rate 1 and DWM frame rate is greater than the threshold, it indicates that the barrage frame rate is significantly different from the screen refresh rate, so it is determined that the electronic device does not turn on the barrage, and further executes S706.

[0127] S705, the electronic device sets the screen refresh rate to refresh rate 2.

[0128] Among them, refresh rate 2 is the maximum value of the video frame rate and the preset minimum barrage frame rate.

[0129] Understandably, when an electronic device plays a video and bullet screen is turned on, the screen refresh rate can be set to the maximum value of the video frame rate and the preset minimum bullet screen frame rate (i.e., refresh rate 2). The refresh rate 2 is the minimum value required to enable both bullet screen and video to be displayed smoothly, which can reduce the power consumption of the chip and display.

[0130] It should be noted that the preset minimum barrage frame rate is the minimum frame rate required to ensure that the barrage display is not stuck, such as 30Hz, 35Hz, 48Hz, etc., and no specific limitation is made here.

[0131] Exemplarily, the video frame rate is 24 Hz and the minimum barrage frame rate is 48 Hz, then the electronic device sets the screen refresh rate to 48 Hz, so that the electronic device can display both the video and the barrage smoothly with minimal power consumption.

[0132] S706: The electronic device sets the refresh rate to refresh rate 3.

[0133] Among them, refresh rate 3 is the video frame rate.

[0134] That is to say, when the electronic device plays a video and does not open the bullet screen, the screen refresh rate can be set to the video frame rate. The refresh rate 2 is the minimum value that can ensure smooth display of the video screen, which can reduce the power consumption of the chip and the display.

[0135] Combine the following Figure 4 The architecture diagram shown further illustrates the method for setting the screen refresh rate provided in the embodiment of the present application. Figure 8 , which is a flow chart of a method for setting a screen refresh rate provided in an embodiment of the present application Figure 2 .like Figure 8 As shown, the method includes:

[0136] S801, the PC video management service sends a request for registering event tracking to the ETW module.

[0137] In an embodiment of the present application, a request for registering event trace carries events to be traced. The events to be traced may include events of all processes calling a submit function. The submit function refers to a function called when a process sends a frame of image rendered by a graphics card to a display screen for display, and the submit function is, for example, a present function.

[0138] It can be understood that when any process calls the submit function, it indicates that the process has a need to display a frame of image. Each time the process calls the submit function, it can display a frame of image. In other words, each time the process calls the submit function, it means a switching of image frames.

[0139] After the ETW module receives the request to register event tracking, it can start tracking to obtain tracking data. The tracking data includes the time when the event to be tracked occurred and the object that initiated the event to be tracked (hereinafter referred to as the initiating object). The initiating object can be understood as the process that calls the rendering function and can be identified by the name of the process.

[0140] In an optional design, the ETW module can use functions such as StartTrace, EnableTraceEx2, and ProcessTrace to implement event tracing.

[0141] S802: In response to a first operation of the user, the ETW module sends tracking data to the PC video management service.

[0142] The first operation includes any one of the following operations: playing a video, participating in a video conference, turning on or off the barrage, or sliding the mouse wheel on the window.

[0143] Understandably, when the first operation is the user playing a video, the video application will call the rendering function to render the video screen; when the first operation is to open the bullet screen, the DWM process will call the rendering function to render the bullet screen; when the first operation is to slide the mouse wheel on the window, the DWM process will call the rendering function to merge the user action and the window. In this way, the ETW module of the OS can detect the event to be tracked and send the tracking data to the PC video management service.

[0144] It should be noted that the ETW module of the OS sends tracking data to the PC video management service every time it detects an event that a process calls a rendering function. In addition, the ETW module can send tracking data to the PC video management service by using a function callback.

[0145] In addition, for the description of the tracking data, please refer to S801, which will not be repeated here.

[0146] S803: The PC video management service determines the video frame rate and the DWM frame rate according to the tracking data.

[0147] The PC video management service can parse the tracking data to determine the initiating object. The PC video management service can count the tracking data of all the initiating objects that are video processes in the first time to obtain a first number, and count the tracking data of all the initiating objects that are DWM processes in the first time to obtain a second number, and then determine the video frame rate based on the first number and the first time, and determine the DWM frame rate based on the second number and the second time.

[0148] Exemplarily, the first time is 100 ms, the first number is 2 times, and the second number is 3 times, then the video frame rate is 20 Hz, and the DWM frame rate is 30 Hz.

[0149] In an optional design, the PC video management service can respectively count the first and second times in multiple time periods, and obtain the video frame rate and DWM frame rate based on the first and second times in multiple time periods. The video frame rate and DWM frame rate obtained in this way are more accurate, which can reduce the risk of incorrectly setting the refresh rate of the device due to inaccurate video frame rate and DWM frame rate.

[0150] For example, the PC video management service can obtain the tracking data of all the initiating objects being the video process and the DWM process within the first 100ms, and obtain the first number as 1 and the second number as 3. The tracking data of all the initiating objects being the video process and the DWM process within the second 100ms can be obtained by counting the first number as 3 and the second number as 4. The tracking data of all the initiating objects being the video process and the DWM process within the third 100ms can be obtained by counting the first number as 2 and the second number as 3. Then, the PC video management service can take the average value of 1, 3, and 2 (i.e., 2) as the first number within 100ms, take the average value of 3, 4, and 4 (i.e., 3.7) as the second number within 100ms, and then calculate that the video frame rate is 20Hz and the DWM frame rate is 37Hz.

[0151] Considering that the PC video management service needs to filter out the tracking data whose initiating objects are the video process and the DWM process from all the tracking data when determining the video frame rate and the DWM frame rate, this will bring a large amount of calculation to the electronic device.

[0152] In a possible design, the event to be tracked may be an event in which a video process or a DWM process calls a rendering function. In this way, the ETW module of the OS can send tracking data to the PC video management service only when it detects that the video process or the DWM process calls a rendering function, thereby reducing the data that the PC video management service needs to filter when determining the video frame rate and the DWM frame rate, and improving the efficiency of the PC video management service in determining the video frame rate and the DWM frame rate.

[0153] It should be noted that the PC video management service can continuously determine the video frame rate and DWM frame rate based on the tracking data. That is, as long as the video process or DWM process continues to call the rendering function, the ETW module will continue to send tracking data to the PC video management service, and the PC video management service can continue to obtain the video frame rate and DWM frame rate to monitor the frame rate of the video process and DWM process.

[0154] S804: The PC video management service determines whether the video frame rate is stable.

[0155] If the video frame rate is stable, execute S805; if the video frame rate is unstable, execute S803 again.

[0156] In one possible design, the PC video management service can continuously determine multiple video frame rates, and then determine the change rate based on the multiple video frame rates. If the change rate is less than or equal to the frame rate threshold, it indicates that the video frame rate is stable; if the change rate is greater than the frame rate threshold, it indicates that the video frame rate is unstable.

[0157] In another possible design, the PC video management service can continuously determine multiple video frame rates and calculate the change between two adjacent video frame rates. If more than a preset number of changes are less than or equal to a threshold, it indicates that the video frame rate is stable; if no more than a preset number of changes are less than or equal to the threshold, it indicates that the video frame rate is unstable.

[0158] It should be noted that in other implementations, other methods may be used to determine whether the video frame rate is stable, based on the ability to determine the changing trend of the video frame rate, and no specific limitation is made here.

[0159] It can be understood that by judging whether the video frame rate is stable, it can be determined whether the electronic device is playing a video. If the video frame rate is stable, it indicates that the electronic device is likely to be playing a video, and it can be further determined whether the barrage is turned on, so S805 can be executed; if the video frame rate is unstable, it indicates that the electronic device is likely not playing a video, and there is no need to further determine whether the barrage is turned on. In this case, the PC video management service can continue to receive new tracking data and monitor the video frame rate and DWM frame rate in real time.

[0160] S805 , the PC video management service determines whether the DWM frame rate is greater than or equal to threshold 1.

[0161] If the DWM frame rate is greater than or equal to threshold 1, execute S806; if the DWM frame rate is less than threshold 1, execute S812.

[0162] Among them, threshold 1 is positively correlated with the screen refresh rate and is less than the current screen refresh rate. In an optional design, threshold 1 is the difference between the screen refresh rate and a preset value (also referred to as a first threshold). It should be noted that the screen refresh rate described here is the refresh rate actually used by the screen refresh picture.

[0163] As mentioned above, the barrage frame rate will follow the screen refresh rate, that is, as the screen refresh rate increases or decreases, the barrage frame rate will increase or decrease to the corresponding value. For example, if the screen refresh rate becomes 40Hz, the barrage frame rate will also become 40Hz. Combined with what has been explained above, the DWM frame rate can be used to reflect the barrage frame rate.

[0164] In addition, the user's operation on the window will also affect the DWM frame rate. For example, if the user opens window 1 and window 2 on the electronic device at the same time, where window 1 is playing a video and window 2 is a browser page, then sliding the mouse wheel on window 2 will also cause the DWM frame rate to increase.

[0165] Therefore, the significance of judging whether the DWM frame rate is greater than or equal to threshold 1 is to determine whether the barrage frame rate is close to the screen refresh rate. If the DWM frame rate is greater than or equal to threshold 1, it indicates that the barrage frame rate is close to the screen refresh rate, so the possibility that the electronic device has turned on the barrage is high, but it is not ruled out that it is caused by the user operating other windows, so S806 is executed to further determine whether the barrage is turned on; if the DWM frame rate is less than threshold 1, it indicates that the barrage frame rate is greatly different from the screen refresh rate, so the possibility that the electronic device has turned on the barrage is low, and the operation when the electronic device does not turn on the barrage can be directly executed, such as executing S812.

[0166] In one possible design, the PC video management service can determine whether the difference between the screen refresh rate and the DWM frame rate (screen refresh rate minus the DWM frame rate) is less than or equal to the preset value mentioned above. If the difference between the screen refresh rate and the DWM frame rate is less than or equal to the preset value, it indicates that the DWM frame rate is close to the screen refresh rate; if the difference between the screen refresh rate and the DWM frame rate is greater than the preset value, it indicates that the DWM frame rate is far different from the screen refresh rate.

[0167] S806: The PC video management service determines whether the screen refresh rate is lower than 120 Hz.

[0168] If the screen refresh rate is lower than 120 Hz, execute S807; if the screen refresh rate is not lower than 120 Hz, execute S810.

[0169] Due to the physiological limitations of the human body, it is difficult for users to operate windows at a very fast speed (for example, 120 times / second), so the user's operation on the window has limited impact on the DWM frame rate, and it is difficult to make the DWM frame rate exceed 100Hz. In other words, when the screen refresh rate is 120Hz, it is difficult for users to rely on their own operations to make the DWM frame rate reach or approach 120Hz.

[0170] Therefore, when the DWM frame rate is greater than or equal to threshold 1, if the screen refresh rate is not lower than 120Hz, it indicates that the DWM frame rate is close to the screen refresh rate and the screen refresh rate is close to 120Hz. It can be considered that the DWM frame rate is likely to be caused by turning on the barrage, that is, the electronic device is playing a video and the barrage is turned on, so the operation when the electronic device turns on the barrage can be executed, such as executing S810.

[0171] When the DWM frame rate is greater than or equal to threshold 1, and the screen refresh rate is lower than 120 Hz, it indicates that the DWM frame rate is close to the screen refresh rate but it is uncertain whether the electronic device has the barrage turned on. Therefore, S807 can be executed to further determine whether the electronic device has the barrage turned on.

[0172] S807, the PC video management service sends a setting instruction 1 to the display control module.

[0173] The setting instruction 1 (also referred to as the first setting instruction) is used to instruct the OS to set the screen refresh rate to 120 Hz.

[0174] S808, the display control module sets the screen refresh rate to 120 Hz.

[0175] S809: The PC video management service determines whether the DWM frame rate is greater than or equal to threshold 2.

[0176] If the DWM frame rate is greater than or equal to threshold 2, execute S810; if the DWM frame rate is less than threshold 2, execute S812.

[0177] In the embodiment of the present application, threshold 2 is the difference between the current screen refresh rate (ie, 120 Hz) and the preset value, wherein threshold 2 is greater than threshold 1.

[0178] Among them, S809 and S805 have the same function, both of which are used to determine whether the DWM frame rate follows the screen refresh rate. It can be understood that by determining whether the DWM frame rate is greater than or equal to threshold 2, it can be determined whether the difference between 120Hz and the DWM frame rate is less than the preset value, and then determine whether the DWM frame rate follows the screen refresh rate. If the DWM frame rate is greater than or equal to threshold 2, it is determined that the difference between 120Hz and the DWM frame rate is less than the preset value, and then it is determined that the DWM frame rate follows the screen refresh rate, which indicates that the electronic device has turned on the barrage, so S810 can be executed; if the DWM frame rate is less than threshold 2, it is determined that the difference between 120Hz and the DWM frame rate is greater than the preset value, and then it is determined that the DWM frame rate does not follow the screen refresh rate, which indicates that the electronic device has not turned on the barrage, so S812 can be executed.

[0179] In an optional design, in order to reduce misjudgment, the PC video management service may execute S810 if it is determined that the duration for which the DWM frame rate is maintained to be greater than or equal to the threshold 2 is greater than or equal to the first duration; otherwise, execute S812. This can avoid the interference with the DWM frame rate caused by the DWM process calling the rendering function when the user operates other applications.

[0180] S810, the PC video management service sends a setting instruction 2 to the display control module.

[0181] Among them, the setting instruction 2 (also referred to as the second setting instruction) carries a refresh rate 2, which is the maximum value of the video frame rate and the preset minimum barrage frame rate.

[0182] S811, the display control module sets the screen refresh rate to refresh rate 2.

[0183] Understandably, when an electronic device plays a video and bullet screen is turned on, the screen refresh rate can be set to the maximum value of the video frame rate and the preset minimum bullet screen frame rate (i.e., refresh rate 2). The refresh rate 2 is the minimum value required to enable both bullet screen and video to be displayed smoothly, which can reduce the power consumption of the chip and display.

[0184] In one possible design, the display control module can call the ChangeDisplaySettings or ChangeDisplaySettingsEx function to set the refresh rate.

[0185] S812, the PC video management service sends a setting instruction 3 to the display control module.

[0186] The setting instruction 3 (also referred to as the third setting instruction) carries a refresh rate 3, which is the video frame rate.

[0187] S813, the display control module sets the screen refresh rate to refresh rate 3.

[0188] That is to say, when the electronic device plays a video and does not open the bullet screen, the screen refresh rate can be set to the video frame rate. The refresh rate 2 is the minimum value that can ensure smooth display of the video screen, which can reduce the power consumption of the chip and the display.

[0189] It can be seen that the screen refresh rate setting method provided in the embodiment of the present application can accurately identify whether the barrage is turned on, and set the screen refresh rate to the minimum value required for smooth display of the picture when the barrage is turned on / not turned on, thereby achieving the effect of saving power.

[0190] In the related art, there are two main methods for switching screen refresh rate: the first is to change the pixel clock, and the second is to change the vertical blank (VBlank), where VBlank refers to the blank time between vertical synchronization signals.

[0191] For the first method, once the pixel clock changes, the graphics card will send a relink signal to the display. After receiving the relink signal, the display will restart the display, causing the display to go black.

[0192] For the second method, the extended display identification data (EDID) of the display screen records the multiple refresh rates and monitor range limits (MRL) supported by the display screen. Different refresh rates correspond to different display parameters, including VBlank, pixel clock, etc. Among them, the graphics card can switch between multiple refresh rates by switching display parameters. However, when switching the refresh rate, even if the pixel clocks corresponding to the two refresh rates are the same, due to the switching of display parameters, the graphics card will send a relink signal to the display screen, resulting in a black screen.

[0193] That is to say, when the refresh rate of the electronic device in the related art is switched, the display screen will always go black, resulting in a poor user experience.

[0194] In the embodiment of the present application, by pre-configuring the EDID of the display screen so that the EDID only includes one refresh rate, and pre-enabling the dynamic refresh rate (DRR) function of the electronic device, the electronic device can seamlessly switch the screen refresh rate without a black screen during the switching process, thereby improving the user experience. Among them, the DRR function can enable the electronic device to dynamically set the refresh rate.

[0195] In the VBlank mechanism, the refresh rate is divided into the desktop refresh rate and the active signal refresh rate. The desktop refresh rate corresponds to the refresh rate of the display, that is, the screen refresh rate; the active signal refresh rate corresponds to the reference refresh rate recorded by the EDID.

[0196] When the DRR function is not enabled, switching the refresh rate will change the desktop refresh rate and the active signal refresh rate together, and the desktop refresh rate and the active signal refresh rate will remain the same. This is actually switching between multiple refresh rates recorded in the EDID in the screen firmware, which will cause the display to go black.

[0197] When the DRR function is turned on, the desktop refresh rate and the active signal refresh rate do not necessarily change together when switching the refresh rate, and the desktop refresh rate is always consistent with the refresh rate set by the OS, but the active signal refresh rate is taken from the baseline refresh rate recorded in the EDID. The desktop refresh rate is formed by calculating the appropriate VBlank based on the baseline refresh rate.

[0198] In a possible design, the electronic device can enable the DRR function by setting the following in the registry:

[0199] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000]

[0200] "DisplayFeatureControl2"=dword:9

[0201] That is to say, for the OS, as long as the active signal refresh rate does not change, the graphics card will not change a whole set of display parameters, but will calculate the appropriate VBlank based on the baseline refresh rate and the refresh rate to be set, and switch the desktop refresh rate to the refresh rate to be set by only changing VBlank, thereby achieving seamless switching of the refresh rate. It should be noted that the refresh rate to be set here is the screen refresh rate described in the aforementioned embodiment, and can also be understood as the desktop refresh rate described above. However, it should be noted that due to the existence of the PSR mechanism, the screen refresh rate may not be the same as the actual refresh rate of the display, but in this case the barrage frame rate still follows the screen refresh rate.

[0202] In this way, on this basis, the steps for setting the screen refresh rate in the previous article can be used for the electronic device to calculate VBlank using the benchmark refresh rate and the screen refresh rate (for example, refresh rate 1, refresh rate 2, refresh rate 3), and then set the screen refresh rate to the corresponding value by changing VBlank.

[0203] Therefore, the present application can ensure that the active signal refresh rate does not change by configuring the EDID so that the EDID only includes a reference refresh rate, thereby avoiding the black screen phenomenon of the display screen. Optionally, the EDID can be pre-burned by the display screen manufacturer.

[0204] For example, take the electronic device as a laptop computer. The EDID of the laptop computer originally recorded two refresh rates of 120Hz and 60Hz, and the MRL was 48-120Hz. Turn on the DRR function of the laptop computer, delete the redundant 60Hz setting from the EDID, and only keep the 120Hz gear as the baseline refresh rate. Then the OS can calculate 5 refresh rate gears based on 120Hz: 24Hz, 30Hz, 48Hz, 75Hz, and 100Hz. Considering that the MRL is 48-120Hz, that is, the display does not support 24Hz and 30Hz. Therefore, the laptop computer can seamlessly switch between 5 refresh rates, namely: 48Hz, 60Hz, 75Hz, 100Hz, and 120Hz.

[0205] It can be seen that the present application enables the electronic device to support the function of dynamically setting the refresh rate based on the active signal refresh rate by pre-enabling the DRR function, so as to realize the switching of the refresh rate; at the same time, by pre-configuring the EDID of the display screen, the EDID of the display screen only includes one refresh rate to avoid changes in the active signal refresh rate, thereby avoiding the phenomenon of the display screen going black due to switching display parameters, thereby improving the user experience.

[0206] The following describes, in conjunction with the accompanying drawings, a method for setting the screen refresh rate provided by an embodiment of the present application in a scenario where the electronic device opens a bullet screen during video playback. Fig. 9 , which is a flow chart of a method for setting a screen refresh rate provided in an embodiment of the present application Figure 3 .like Fig. 9 As shown, the method includes:

[0207] S901, in response to a user's operation of playing a video, the electronic device determines that the video frame rate is frame rate F1, wherein the screen refresh rate is refresh rate Fa. Frame rate F1 may also be referred to as a first frame rate, and refresh rate Fa may also be referred to as a first refresh rate.

[0208] S902, in response to the user's operation of opening the bullet screen, the electronic device determines the DWM frame rate as frame rate F2, and the frame rate F2 follows the refresh rate Fa. The frame rate F2 can also be called a fourth frame rate.

[0209] S903, the electronic device sets the screen refresh rate to a refresh rate Fb, where the refresh rate Fb may also be referred to as a second refresh rate.

[0210] S904, the electronic device determines that the DWM frame rate is frame rate F3, and frame rate F3 follows refresh rate Fb. Frame rate F3 may also be referred to as a second frame rate.

[0211] S905, the electronic device determines whether the DWM frame rate follows the refresh rate Fb (the determination result is yes).

[0212] S906, the electronic device sets the screen refresh rate to a refresh rate Fc, where the refresh rate Fc is the maximum value between the frame rate F1 and the preset minimum barrage frame rate, wherein the refresh rate Fc may also be referred to as a third refresh rate.

[0213] See also Fig.10 ,This is a graph showing the changing trends of screen refresh rate, video frame rate and DWM frame rate when the electronic device turns on the bullet screen during video playback.

[0214] like Fig.10As shown, during the period from 0 to t1, the electronic device does not play the video and the user does not perform any operation, the video frame rate is 0, the screen refresh rate is Fa, and the DWM frame rate is 0; at t1, the electronic device plays the video in response to the user operation, so the video frame rate changes from 0 to F1, and remains at F1 in the subsequent process; during the period from t1 to t2, the user does not perform any operation, so the screen refresh rate continues to remain Fa, and the DWM frame rate continues to remain 0; at t2, the electronic device turns on the barrage in response to the user operation, the video frame rate and screen refresh rate remain unchanged, and the DWM frame rate follows The screen refresh rate changes to F2; during the period from t2 to t3, the DWM frame rate stably follows the screen refresh rate; at t3, the electronic device can determine that the DWM frame rate is stable and close to the refresh rate Fa, and sets the screen refresh rate to Fb; from t3 to t4, the video frame rate and the screen refresh rate remain unchanged, and the DWM frame rate follows the screen refresh rate to F3 (with a certain lag); at t4, the electronic device can determine that the DWM frame rate is stable and close to the refresh rate Fb, and sets the screen refresh rate to Fc; then, after t4, the DWM frame rate follows the screen refresh rate to F4.

[0215] The following describes, in conjunction with the accompanying drawings, a method for setting a screen refresh rate provided by an embodiment of the present application in a scenario where a user slides a mouse wheel while an electronic device is playing a video. Fig.11 , which is a flow chart of a method for setting a screen refresh rate provided in an embodiment of the present application Figure 4 .like Fig.11 As shown, the method includes:

[0216] S1101, in response to a user operation of playing a video, the electronic device determines that the video frame rate is frame rate F1, wherein the screen refresh rate is refresh rate Fa.

[0217] S1102: In response to the user's operation of sliding the mouse wheel, the electronic device determines that the DWM frame rate is frame rate F5, and the frame rate F5 does not follow the refresh rate Fa.

[0218] S1103, the electronic device sets the screen refresh rate to the refresh rate Fb.

[0219] S1104, the electronic device determines that the DWM frame rate is frame rate F5, and frame rate F5 does not follow refresh rate Fb. Frame rate F5 may also be referred to as a fourth frame rate.

[0220] S1105, the electronic device determines whether the DWM frame rate is close to the refresh rate Fb (the determination result is no).

[0221] S1106, the electronic device sets the screen refresh rate to a refresh rate Fd, where the refresh rate Fd is the same as the frame rate F1. The refresh rate Fd may also be referred to as a fourth refresh rate.

[0222] See also Fig.12 , which is a trend chart of the screen refresh rate, video frame rate and DWM frame rate when the user slides the mouse wheel while the electronic device is playing a video.

[0223] like Fig.12 As shown, during the time period from 0 to T1', the electronic device does not play the video and the user does not perform any operation, the video frame rate is 0, the screen refresh rate is Fa, and the DWM frame rate is 0; at T1', the electronic device plays the video in response to the user operation, so the video frame rate changes from 0 to F1, and remains at F1 in the subsequent process; during the time period from T1' to T2', the user does not perform any operation, so the screen refresh rate continues to remain Fa, and the DWM frame rate continues to remain 0; during the time period from T2' to T3', the electronic device receives the user's operation of sliding the mouse wheel, and the DWM frame rate changes due to the operation. It changes to F5, the video frame rate and screen refresh rate remain unchanged; at T3', the DWM frame rate returns to 0 because the user stops sliding the mouse wheel; during the period from T3' to T4', the video frame rate and screen refresh rate remain unchanged; at T4', the electronic device sets the screen refresh rate to Fb; during the period from T4' to T5', the video frame rate and screen refresh rate remain unchanged, and the DWM frame rate continues to remain at 0 and does not change with the screen refresh rate; at T5', the electronic device can determine that the DWM frame rate does not follow the screen refresh rate, and sets the screen refresh rate to Fd, which is the same as F1.

[0224] It should be noted that the above frame rate change trend can be observed in real time through the ETW module, and the refresh rate change trend can be observed from the WINDOWS TM Observe in the display setting interface of the operating system, or call the relevant API to obtain it.

[0225] For example, see Fig.13 , for WINDOWS TM The display settings interface of the operating system. Fig.13 As shown, the setting interface includes display information, etc. The display information includes desktop resolution, active signal resolution, refresh rate (actual refresh rate of the screen), bit depth, etc. For example, the display information indicates that the desktop resolution is 1920×1080, the active signal resolution is 1920×1080, and the refresh rate is 50.000 Hz. In addition, the setting interface also provides a channel for setting the refresh rate, such as a selection box 1301, through which the user can set the refresh rate of the display screen.

[0226] It should also be noted that due to the PSR mechanism, the refresh rate set by the system (i.e., the screen refresh rate mentioned above) may be different from the actual refresh rate of the display. In this case, an oscilloscope can be used to observe the STV signal or VSync signal on the display panel to obtain the accurate screen refresh rate.

[0227] To sum up, the embodiments of the present application can effectively reduce the power consumption of electronic devices and improve the battery life of electronic devices by accurately identifying whether the barrage is turned on and setting the screen refresh rate to the minimum frame rate that can ensure smooth operation of the picture in the corresponding scenario.

[0228] The embodiment of the present application also provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit can be used to send signals to other devices (such as a processor). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instructions are executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.

[0229] This embodiment also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes each function or step in the above method embodiment.

[0230] This embodiment also provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each function or step in the above method embodiment.

[0231] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip performs the various functions or steps performed by the electronic device in the above method embodiment.

[0232] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0233] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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.

[0234] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0235] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.

[0236] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0237] If the integrated unit is implemented in the form of 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 solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

[0238] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.

Claims

1. A method for setting a screen refresh rate, It is characterized in that Applied to electronic equipment, the method comprises: At a first time point, the electronic device plays a video, wherein the video is played in a video playback interface, and at the first time point, a screen refresh rate of the electronic device is a first refresh rate, and a frame rate of the video is a first frame rate; At a second time point, a first operation of opening a bullet screen is received, after the second time point, the bullet screen is displayed on the video playback interface, the screen refresh rate is set to a second refresh rate, the desktop window manager DWM frame rate is a second frame rate, the second refresh rate is greater than or equal to the first refresh rate, the value of the second refresh rate is greater than the value of the first frame rate, and the second time point is later than the first time point; At a third time point, setting the screen refresh rate to a third refresh rate, the value of the third refresh rate is greater than the value of the first frame rate, and the third time point is later than the second time point; At a fourth time point, after the bullet screen is turned off, the electronic device plays the video, at the fourth time point, the screen refresh rate is the first refresh rate, and the fourth time point is later than the third time point; At a fifth time point, a second operation is received, where the second operation is not an operation to start a bullet screen, and after the fifth time point, the screen refresh rate is set to the second refresh rate, the DWM frame rate is set to a third frame rate, the third frame rate is less than the second frame rate, and the fifth time point is later than the fourth time point; At a sixth time point, the screen refresh rate is set to a fourth refresh rate, the fourth refresh rate is less than the third refresh rate, and the sixth time point is later than the fifth time point.

2. The method according to claim 1, It is characterized in that Based on the difference between the second refresh rate and the second frame rate being smaller than the difference between the second refresh rate and the third frame rate, the fourth refresh rate is smaller than the third refresh rate.

3. The method according to claim 1, It is characterized in that At a third time point, setting the screen refresh rate to a third refresh rate includes: At the third time point, based on the difference between the second refresh rate and the second frame rate being less than or equal to a first threshold, setting the screen refresh rate to the third refresh rate; At a sixth time point, setting the screen refresh rate to a fourth refresh rate includes: At the sixth time point, based on the difference between the second refresh rate and the third frame rate being greater than the first threshold, the screen refresh rate is set to the fourth refresh rate.

4. The method according to claim 1, It is characterized in that At a third time point, setting the screen refresh rate to a third refresh rate includes: At the third time point, based on the duration that the difference between the second refresh rate and the second frame rate is less than or equal to the first threshold being greater than or equal to the first duration, setting the screen refresh rate to the third refresh rate; At a sixth time point, setting the screen refresh rate to a fourth refresh rate includes: At the sixth time point, based on the duration that the difference between the second refresh rate and the second frame rate is less than or equal to the first threshold being less than the first duration, the screen refresh rate is set to the fourth refresh rate.

5. The method according to any one of claims 1 to 4, It is characterized in that At the second time point, the DWM frame rate is a fourth frame rate, and the screen refresh rate is set to the second refresh rate, including: Based on the difference between the first refresh rate and the fourth frame rate being less than or equal to a second threshold, the screen refresh rate is set to the second refresh rate.

6. The method according to any one of claims 1 to 4, It is characterized in that The second refresh rate is greater than or equal to 100 Hz.

7. The method according to any one of claims 1 to 4, It is characterized in that The third refresh rate is the maximum value of the first frame rate and the minimum frame rate of the barrage, and the minimum frame rate of the barrage is the minimum frame rate required to prevent the barrage from being stuck.

8. The method according to any one of claims 1 to 4, It is characterized in that The value of the fourth refresh rate is equal to the value of the first frame rate.

9. The method according to any one of claims 1 to 4, It is characterized in that The electronic device has enabled a dynamic refresh rate function, and the extended display identification data of the electronic device includes a refresh rate.

10. The method according to any one of claims 1 to 4, It is characterized in that The electronic device includes a video management service, an event tracking module, and a display control module, and the method further includes: The event tracking module sends tracking data to the video management service; The video management service determines, based on the tracking data, the DWM frame rate as the second frame rate; At a third time point, setting the screen refresh rate to a third refresh rate includes: At the third time point, the video management service determines whether a difference between the second refresh rate and the second frame rate is less than or equal to a first threshold; The video management service sends a first setting instruction to the display control module based on the difference between the second refresh rate and the second frame rate being less than or equal to a first threshold, wherein the first setting instruction carries the third refresh rate; The display control module sets the screen refresh rate to the third refresh rate based on the first setting instruction.

11. The method according to claim 10, It is characterized in that At the second time point, the DWM frame rate is a fourth frame rate, and before the screen refresh rate is set to the second refresh rate, the method further includes: The video management service determines whether a difference between the first refresh rate and the fourth frame rate is less than or equal to a second threshold; The video management service sends a second setting instruction to the display control module based on the difference between the first refresh rate and the fourth frame rate being less than or equal to a second threshold, wherein the second setting instruction carries the second refresh rate; The screen refresh rate is set to the second refresh rate, including: The display control module sets the screen refresh rate to the second refresh rate based on the second setting instruction.

12. The method according to claim 11, It is characterized in that The method further comprises: The video management service obtains a plurality of video frame rates according to the tracking data; The video management service determines whether a difference between the first refresh rate and the fourth frame rate is less than or equal to a second threshold, including: Based on the change rate of the multiple video frame rates being less than or equal to a frame rate threshold, the video management service determines whether a difference between the first refresh rate and the fourth frame rate is less than or equal to a second threshold.

13. An electronic device, It is characterized in that The electronic device comprises: a memory and one or more processors; The memory is used to store computer program codes, and the computer program codes include computer instructions; when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1 to 12.

14. A computer-readable storage medium, It is characterized in that including computer instructions; When the computer instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 12.