Resource scheduling method and device, electronic equipment and storage medium
By obtaining the average frame rate of the application and adjusting the frequency according to the preset frame rate interval, the problem that frequency adjustment in the prior art is difficult to balance equipment performance and power consumption, and the optimization of equipment performance and power consumption is achieved, and adapting to different operating scenarios. Improved user experience.
Patent Information
- Application Number
- CN202310761826.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2024-12-27
AI Technical Summary
When adjusting the frequency of electronic devices, it is difficult to balance equipment performance and power consumption, and it is impossible to accurately identify different operating scenarios, resulting in poor user experience.
By obtaining the average frame rate of the application and frequency adjustments based on the preset frame rate interval, the frequency of the central processing unit, the graphics processing unit and the memory is adjusted to ensure that the frequency is within the appropriate range and balanced equipment performance and power consumption.
It achieves a balance between device performance and power consumption, without the need to accurately configure the frequency in different situations, improves the user experience, and adapts to different operating scenarios.
Smart Images

Figure CN119212096A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a resource scheduling method, device, electronic device and storage medium. Background Art
[0002] As electronic devices become increasingly powerful, users use them more frequently, and various problems may arise in the process of using electronic devices. For example, when an electronic device is used for a long time or uses applications that consume a lot of energy, the temperature of the electronic device will be high and the power consumption will increase. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a resource scheduling method, device, electronic device and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a resource scheduling method is provided, the method comprising:
[0005] Obtaining an average frame rate of the first application in a first time period;
[0006] According to the relationship between the average frame rate and the preset frame rate range, the first frequency is adjusted to obtain the second frequency, the preset frame rate range is used to characterize the range of allowed frame drops, the first limit value of the preset frame rate range is the maximum frame rate of the allowed frame drop range, and the second limit value of the preset frame rate range is the minimum frame rate of the allowed frame drop range.
[0007] In some embodiments, adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency includes:
[0008] When the average frame rate is greater than the first limit value, reducing the first frequency to obtain the second frequency;
[0009] When the average frame rate is less than the second limit value, the first frequency is increased to obtain the second frequency.
[0010] In some embodiments, when the average frame rate is greater than the first limit value, reducing the first frequency to obtain the second frequency includes:
[0011] When the average frame rate is greater than the first limit value and the first frequency is not less than a first preset frequency, reducing the first frequency to obtain the second frequency, and the second frequency is not less than the first preset frequency;
[0012] When the average frame rate is less than the second limit value, increasing the first frequency to obtain the second frequency comprises:
[0013] When the average frame rate is less than the second limit value and the first frequency is not greater than a second preset frequency, the first frequency is increased to obtain the second frequency, the second frequency is not greater than the second preset frequency, and the second preset frequency is greater than the first preset frequency.
[0014] In some embodiments, the method further comprises:
[0015] Identifying a current running scenario of the first application, wherein the running scenario has a corresponding preset frame rate range;
[0016] The step of adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency includes:
[0017] When the operating scenario belongs to a preset scenario, the first frequency is adjusted according to the relationship between the average frame rate and the preset frame rate range corresponding to the operating scenario to obtain the second frequency.
[0018] In some embodiments, adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency includes:
[0019] When the frame stabilization function is not enabled, the first frequency is adjusted according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency.
[0020] In some embodiments, the method further comprises:
[0021] The first application is run based on the second frequency in a second time period, where the second time period is a next time period adjacent to the first time period.
[0022] In some embodiments, the first frequency and the second frequency are frequencies of a central processing unit, and the method further includes:
[0023] According to the relationship between the average frame rate and the preset frame rate interval, the third frequency is adjusted to obtain a fourth frequency, wherein the third frequency and the fourth frequency are frequencies of a graphics processing unit;
[0024] The running the first application based on the second frequency within the second time period includes:
[0025] The first application is run based on the second frequency and the fourth frequency during the second time period.
[0026] In some embodiments, the first frequency and the second frequency are frequencies of a central processing unit, and the method further includes:
[0027] According to the relationship between the average frame rate and the preset frame rate interval, the fifth frequency is adjusted to obtain a sixth frequency, wherein the fifth frequency and the sixth frequency are frequencies of the memory;
[0028] The running the first application based on the second frequency within the second time period includes:
[0029] The first application is run based on the second frequency and the sixth frequency during the second time period.
[0030] In some embodiments, adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency includes:
[0031] When the first frequency is not greater than the first preset frequency and not less than the second preset frequency, the first frequency is adjusted according to the relationship between the average frame rate and the preset frame rate range to obtain the second frequency, wherein the second frequency is not greater than the first preset frequency and not less than the second preset frequency, and the first preset frequency is greater than the second preset frequency.
[0032] According to a second aspect of an embodiment of the present disclosure, a resource scheduling device is provided, the device comprising:
[0033] An average frame rate acquisition module, configured to acquire an average frame rate of the first application in a first time period;
[0034] The frequency adjustment module is configured to adjust the first frequency according to the relationship between the average frame rate and the preset frame rate range to obtain a second frequency. The preset frame rate range is used to characterize the range of allowed frame drops, the first limit value of the preset frame rate range is the maximum frame rate of the allowed frame drop range, and the second limit value of the preset frame rate range is the minimum frame rate of the allowed frame drop range.
[0035] In some embodiments, the frequency adjustment module is configured to:
[0036] When the average frame rate is greater than the first limit value, reducing the first frequency to obtain the second frequency;
[0037] When the average frame rate is less than the second limit value, the first frequency is increased to obtain the second frequency.
[0038] In some embodiments, the frequency adjustment module is configured to:
[0039] When the average frame rate is greater than the first limit value and the first frequency is not less than a first preset frequency, reducing the first frequency to obtain the second frequency, and the second frequency is not less than the first preset frequency;
[0040] When the average frame rate is less than the second limit value and the first frequency is not greater than a second preset frequency, the first frequency is increased to obtain the second frequency, the second frequency is not greater than the second preset frequency, and the second preset frequency is greater than the first preset frequency.
[0041] In some embodiments, the apparatus further comprises:
[0042] A scene recognition module, configured to recognize a current running scene of the first application, wherein the running scene has a corresponding preset frame rate interval;
[0043] The frequency adjustment module is configured to adjust the first frequency to obtain the second frequency according to the relationship between the average frame rate and the preset frame rate range corresponding to the running scenario when the running scenario belongs to the preset scenario.
[0044] In some embodiments, the frequency adjustment module is configured to adjust the first frequency according to the relationship between the average frame rate and the preset frame rate range to obtain the second frequency when the frame stabilization function is not enabled.
[0045] In some embodiments, the apparatus further comprises:
[0046] The running module is configured to run the first application based on the second frequency in a second time period, and the second time period is a next time period adjacent to the first time period.
[0047] In some embodiments, the first frequency and the second frequency are frequencies of a central processing unit, and the frequency adjustment module is further configured to adjust the third frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain a fourth frequency, and the third frequency and the fourth frequency are frequencies of a graphics processing unit;
[0048] The running module is configured to run the first application based on the second frequency and the fourth frequency within the second time period.
[0049] In some embodiments, the first frequency and the second frequency are frequencies of a central processing unit, and the frequency adjustment module is further configured to adjust the fifth frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain a sixth frequency, and the fifth frequency and the sixth frequency are frequencies of a memory;
[0050] The running module is configured to run the first application based on the second frequency and the sixth frequency within the second time period.
[0051] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0052] processor;
[0053] a memory for storing processor-executable instructions;
[0054] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.
[0055] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect of the embodiment of the present disclosure.
[0056] The above method of the present disclosure has the following beneficial effects:
[0057] The method provided by the embodiment of the present disclosure obtains the average frame rate of a first application in a first time period, and adjusts the first frequency according to the relationship between the average frame rate and a preset frame rate interval to obtain a second frequency. The preset frame rate interval is used to characterize the range within which frame drops are allowed. The first limit value of the preset frame rate interval is the maximum frame rate within the range within which frame drops are allowed, and the second limit value is the minimum frame rate within the range within which frame drops are allowed. In this adjustment method, the preset frame rate interval is configured, and the frequency can be adjusted according to the relationship between the average frame rate and the preset frame rate interval. Through simple parameter configuration, the balance between device performance and device power consumption is ensured, and there is no need to accurately configure the frequency in different situations.
[0058] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0060] Figure 1 is a flow chart of a resource scheduling method according to an exemplary embodiment;
[0062] Figure 2 is a flow chart showing another resource scheduling method according to an exemplary embodiment;
[0063] Figure 3 is a flow chart showing another resource scheduling method according to an exemplary embodiment;
[0064] Figure 4 is a flow chart showing another resource scheduling method according to an exemplary embodiment;
[0065] Figure 5 is a flow chart showing another resource scheduling method according to an exemplary embodiment;
[0066] Figure 6 is a flow chart showing another resource scheduling method according to an exemplary embodiment;
[0067] Figure 7 is a flow chart showing another resource scheduling method according to an exemplary embodiment;
[0068] Figure 8 is a flow chart showing another resource scheduling method according to an exemplary embodiment;
[0069] Fig. 9 is a block diagram of a resource scheduling device according to an exemplary embodiment;
[0070] Fig.10 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0071] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0072] In the related art, when the temperature or power consumption of an electronic device reaches a certain threshold, the power consumption is reduced by limiting the frequency of the CPU (Central Processing Unit). For example, when running an application (for example, a game application), when the temperature of the electronic device is higher than a certain threshold, the frequency of the CPU will be reduced, but doing so will cause the application to drop frames and become less fluid. For another example, the frequency of the CPU is limited according to the application scenario, but this method cannot accurately determine the size of the current load, nor can it accurately identify each scenario, that is, some scenarios cannot be identified, and therefore cannot balance device performance and power consumption well. For another example, the current application process is directly terminated, reducing the user experience. Various methods in the related art will lead to various problems.
[0073] An embodiment of the present disclosure provides a resource scheduling method, which is executed by an electronic device, which may be a mobile phone, a tablet computer, a laptop computer, a wearable device, a smart home device, a vehicle-mounted terminal, or other device that can run applications.
[0074] Figure 1is a flowchart of a resource scheduling method according to an exemplary embodiment, which is executed by an electronic device, see Figure 1 , the method comprises the following steps:
[0075] Step S101, obtaining an average frame rate of a first application in a first time period.
[0076] The first application is a currently running foreground application or background application. For example, the first application is any application installed on the electronic device, such as a game application or a video application.
[0077] The first time period is a time period within a first time length before the current time point, for example, if the first time length is 5 seconds, then the first time period is a time period within 5 seconds before the current time point. The first time length is a preset time length.
[0078] Optionally, for different applications, the first time lengths corresponding to different applications may be the same, for example, the first time lengths corresponding to game applications and video applications may both be 5 seconds; or, the first time lengths corresponding to different applications may also be different, for example, the first time length corresponding to game applications may be 5 seconds, and the first time length corresponding to video applications may be 10 seconds.
[0079] Optionally, for the same application, the first durations corresponding to different running scenes of the same application may be the same, for example, the running scenes of a game application include a battle scene and a setting scene, and the first durations corresponding to the battle scene and the setting scene are both 5 seconds; or, the first durations corresponding to different running scenes of the same application may also be different, for example, the running scenes of a game application include a battle scene and a setting scene, the first duration corresponding to the battle scene may be 5 seconds, and the first duration corresponding to the setting scene may be 30 seconds.
[0080] The average frame rate in the first time period is the frame rate obtained by averaging the frame rates in the first time period, that is, the frame rates per second in the first time period are counted, and then the frame rates per second in the first time period are summed to obtain the total frame rate, and then the total frame rate is averaged to obtain the average frame rate in the first time period. The average frame rate represents the running status of the first application in the first time period. When the average frame rate is large, it means that the first application runs smoothly in the first time period, but the power consumption is large. When the average frame rate is small, it means that the first application runs poorly in the first time period, but the power consumption is small.
[0081] Step S102: adjusting the first frequency to obtain the second frequency according to the relationship between the average frame rate and the preset frame rate interval, wherein the preset frame rate interval is used to represent a range within which frame drops are allowed.
[0082] In the embodiment of the present disclosure, a preset frame rate interval is set, and the preset frame rate interval is used to characterize the range of allowed frame drops, the first limit value of the preset frame rate interval is the maximum frame rate of the allowed frame drop range, and the second limit value of the preset frame rate interval is the minimum frame rate of the allowed frame drop range. For example, if the preset frame rate interval is 40-50, the first limit value is 50, and the second limit value is 40.
[0083] When the average frame rate falls within the preset frame rate range, it indicates that the current frame rate is acceptable and no frequency adjustment is performed. That is, when the average frame rate falls within the preset frame rate range, the first application is run based on the first frequency in the next time period. When the average frame rate is greater than the first limit value or less than the second limit value, the first frequency is adjusted. The adjustment method is as follows: Figure 2 The embodiments shown will not be described in detail here.
[0084] Optionally, for different applications, the preset frame rate ranges corresponding to different applications may be the same, for example, the preset frame rate ranges corresponding to game applications and video applications are both 40-50, or, the preset frame rate ranges corresponding to different applications may also be different, for example, the preset frame rate range corresponding to game applications is 40-50, and the preset frame rate range corresponding to video applications is 30-40.
[0085] Optionally, for the same application, the preset frame rate intervals corresponding to different running scenes of the same application may be the same, for example, the running scenes of a game application include battle scenes and setting scenes, and the preset frame rate intervals corresponding to the battle scenes and the setting scenes are both 40-50; or, the preset frame rate intervals corresponding to different running scenes of the same application may also be different, for example, the running scenes of a game application include battle scenes and setting scenes, and the preset frame rate intervals corresponding to the battle scenes are 40-50, and the preset frame rate intervals corresponding to the setting scenes are both 40-45.
[0086] In some embodiments, when the frame stabilization function is not turned on, the first frequency is adjusted according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency. The frame stabilization function refers to a temperature-based frame rate adjustment function. When the temperature of the electronic device is greater than the preset temperature threshold, the frame stabilization function is turned on. When the temperature is not greater than the preset temperature threshold, the frame stabilization function is not turned on. When the frame stabilization function is turned on, it is necessary to reduce the power consumption of the device by lowering the frame rate to lower the temperature of the electronic device. In this case, there is no need to adjust the frame rate in other ways. Therefore, the embodiment of the present disclosure performs frequency adjustment to adjust the frame rate when the frame stabilization function is not turned on. The frequency adjustment method provided by the embodiment of the present disclosure is combined with the frame stabilization function so that the electronic device can adjust the frame rate in an appropriate manner at various temperatures to ensure a balance between device performance and device power consumption.
[0087] The method provided by the embodiment of the present disclosure obtains the average frame rate of the first application in the first time period, and adjusts the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency. The preset frame rate interval is used to characterize the range of allowed frame drops. The first limit value of the preset frame rate interval is the maximum frame rate of the allowed frame drop range, and the second limit value is the minimum frame rate of the allowed frame drop range. This adjustment method configures the preset frame rate interval, and can adjust the frequency according to the relationship between the average frame rate and the preset frame rate interval. Through simple parameter configuration, the balance between device performance and device power consumption is ensured. There is no need to accurately configure the frequency in different situations, and there is no need to accurately identify the current operating scenario. It only needs to be adjusted according to the configured parameters. In addition, the balance between device performance and device power consumption can be ensured to improve user experience.
[0088] In some embodiments, by comparing the average frame rate with the first limit value and the second limit value, the first frequency is adjusted accordingly. Figure 2 The illustrated embodiment illustrates this.
[0089] Figure 2 is a flowchart of another resource scheduling method according to an exemplary embodiment, which is executed by an electronic device, see Figure 2 , the method comprises the following steps:
[0090] Step S201: Obtain an average frame rate of a first application in a first time period.
[0091] The implementation of step S201 refers to the implementation of step S101 above, which will not be described in detail here.
[0092] Step S202: when the average frame rate is greater than a first limit value, lower the first frequency to obtain a second frequency.
[0093] When the average frame rate is greater than the first limit value, it means that the frame rate of the first application is high, the frame drop is too slight or there is no frame drop in the first time period. In this case, the first application has good fluency, but the device power consumption will also be large. Therefore, in order to balance the device performance and device function, the first frequency can be reduced to obtain the second frequency, thereby ensuring that the first application has high fluency while reducing the device power consumption.
[0094] In some embodiments, a first frequency value is set. Reducing the first frequency to obtain the second frequency includes: reducing the first frequency by the first frequency value to obtain the second frequency. For example, the first frequency value is 0.1 or other smaller values.
[0095] In some embodiments, a plurality of first frequency values are provided, each first frequency value corresponds to a first difference interval, and a larger first difference interval corresponds to a larger first frequency value, and a smaller first difference interval corresponds to a smaller first frequency value, and the first difference interval indicates the degree to which the frequency needs to be reduced. Reducing the first frequency to obtain the second frequency includes: determining the difference between the first frame rate and the first limit value, determining the first difference interval in which the difference lies, reducing the first frequency by the first frequency value corresponding to the first difference interval, and obtaining the second frequency. For example, the first frequency value corresponding to the first difference interval of 5-10 is 0.3, and the first frequency value corresponding to the first difference interval of 0.1-4.9 is 0.1.
[0096] In some embodiments, the adjustable frequency range includes multiple frequency points. When the first frequency is the first frequency point, lowering the first frequency to obtain the second frequency includes: using the second frequency point as the second frequency, the second frequency point is a frequency point that is smaller than the first frequency point and adjacent to the first frequency point.
[0097] Step S203: when the average frame rate is less than the second limit value, increase the first frequency to obtain a second frequency.
[0098] When the average frame rate is less than the second limit value, it means that the frame rate of the first application is low and the degree of frame drop is too serious in the first time period. In this case, the fluency of the first application is very poor, but the device power consumption is relatively small. Therefore, in order to balance the device performance and device function, the first frequency can be increased to obtain the second frequency, thereby improving the fluency of the first application while ensuring low device power consumption.
[0099] In some embodiments, a second frequency value is set. Increasing the first frequency to obtain the second frequency includes: increasing the first frequency by the second frequency value to obtain the second frequency. For example, the second frequency value is 0.1 or other smaller values.
[0100] In some embodiments, a plurality of second frequency values are provided, each second frequency value corresponds to a second difference interval, and a larger second difference interval corresponds to a larger second frequency value, and a smaller second difference interval corresponds to a smaller second frequency value, and the second difference interval indicates the degree to which the frequency needs to be increased. Increasing the first frequency to obtain the second frequency includes: determining the difference between the first frame rate and the second limit value, determining the second difference interval in which the difference lies, and increasing the first frequency by the second frequency value corresponding to the second difference interval to obtain the second frequency. For example, the second frequency value corresponding to the second difference interval 5-10 is 0.3, and the second frequency value corresponding to the second difference interval 0.1-4.9 is 0.1.
[0101] In some embodiments, the adjustable frequency range includes multiple frequency points. When the first frequency is the first frequency point, increasing the first frequency to obtain the second frequency includes: using the third frequency point as the second frequency, the third frequency point is a frequency point greater than the first frequency point and adjacent to the first frequency point.
[0102] In the disclosed embodiment, when the average frame rate is greater than the first limit value, the first frequency is lowered, and when the average frame rate is less than the second limit value, the first frequency is increased. By configuring the first limit value and the second limit value, the device power consumption is reduced while ensuring the smoothness of the first application, that is, a balance between device performance and device power consumption is ensured.
[0103] Moreover, when the load of the electronic device is heavy, increasing the frequency can ensure that the frame rate curve is smooth, that is, the frame rate changes slowly and the jitter rate is good.
[0104] In some embodiments, when adjusting the frequency, the upper and lower limits of the frequency need to be considered to keep the frequency within a suitable range. Figure 3 The illustrated embodiment illustrates this.
[0105] Figure 3 is a flowchart of another resource scheduling method according to an exemplary embodiment, which is executed by an electronic device, see Figure 3 , the method comprises the following steps:
[0106] Step S301: Obtain an average frame rate of a first application in a first time period.
[0107] The implementation of step S301 refers to the implementation of the above step S101 and will not be described in detail here.
[0108] Step S302, when the average frame rate is greater than the first limit value and the first frequency is not less than the first preset frequency, the first frequency is reduced to obtain a second frequency, and the second frequency is not less than the first preset frequency.
[0109] When the average frame rate is greater than the first limit value, if the first frequency is already very small, that is, if the first frequency is less than the first preset frequency, then by lowering the first frequency, although it is possible to reduce the power consumption of the device while ensuring that the first application has a high fluency, a frequency that is too low will also affect other processes running in the electronic device, thereby affecting the performance of the device. Therefore, when the average frame rate is greater than the first limit value and the first frequency is less than the first preset frequency, the frequency is not adjusted. When the average frame rate is greater than the first limit value and the first frequency is not less than the first preset frequency, the first frequency is lowered to obtain the second frequency, and the adjusted second frequency is not less than the first preset frequency, that is, the second frequency is greater than the first preset frequency.
[0110] The implementation method of reducing the first frequency to obtain the second frequency is referred to the implementation method in the above step S202, which will not be described in detail here. The difference from step S202 is that the adjusted second frequency needs to be greater than the first preset frequency.
[0111] Step S303, when the average frame rate is less than the second limit value and the first frequency is not greater than the second preset frequency, the first frequency is increased to obtain a second frequency, and the second frequency is not greater than the second preset frequency.
[0112] The second preset frequency is greater than the first preset frequency.
[0113] When the average frame rate is less than the second limit value, if the first frequency is already very large, that is, if the first frequency is greater than the second preset frequency, then by increasing the first frequency, although the fluency of the first application can be improved, the frequency is too large and will increase the power consumption of the device. Therefore, when the average frame rate is less than the second limit value and the first frequency is greater than the second preset frequency, the frequency is not adjusted. When the average frame rate is less than the second limit value and the first frequency is not greater than the second preset frequency, the first frequency is increased to obtain the second frequency, and the adjusted second frequency is not greater than the second preset frequency, that is, the second frequency is less than the second preset frequency.
[0114] The implementation method of increasing the first frequency to obtain the second frequency is similar to the implementation method in the above step S203, which will not be described in detail here. The difference from step S203 is that the adjusted second frequency needs to be less than the second preset frequency.
[0115] In the disclosed embodiment, when the average frame rate is greater than the first limit value and the first frequency is not less than the first preset frequency, the first frequency is lowered; when the average frame rate is less than the second limit value and the first frequency is not greater than the second preset frequency, the first frequency is increased; by configuring the first limit value, the second limit value, the first preset frequency and the second preset frequency, the device power consumption is reduced while ensuring the fluency of the first application, i.e., a balance between device performance and device power consumption is ensured.
[0116] In some embodiments, considering that different operating scenarios have different requirements for frequency, corresponding preset frequency intervals are set for different operating scenarios. In different operating scenarios, adjustment is performed according to the preset frequency intervals corresponding to the operating scenarios. Figure 4 The illustrated embodiment illustrates this.
[0117] Figure 4 is a flowchart of another resource scheduling method according to an exemplary embodiment, which is executed by an electronic device, see Figure 4 , the method comprises the following steps:
[0118] Step S401: Obtain an average frame rate of a first application in a first time period.
[0119] The implementation of step S401 refers to the implementation of step S101 above, which will not be described in detail here.
[0120] Step S402: identifying a current running scenario of the first application, where the running scenario has a corresponding preset frame rate range.
[0121] In some embodiments, the current running scene of the first application is identified based on a scene recognition model; alternatively, scene information is configured in the background program code corresponding to the first application, and when the first application is running, the current running scene of the first application is determined by reading the scene information in the background program code.
[0122] Optionally, each running scene has a corresponding scene identifier, and identifying the current running scene of the first application includes: determining the scene identifier corresponding to the current running scene of the first application.
[0123] Step S403: When the running scene belongs to a preset scene, the first frequency is adjusted according to the relationship between the average frame rate and the preset frame rate interval corresponding to the running scene to obtain the second frequency.
[0124] The preset scene is a scene in which the frequency can be adjusted according to the average frame rate and the preset frame rate range.
[0125] In some embodiments, determining whether the running scenario belongs to a preset scenario includes: providing a valid scenario list, and when the running scenario is a scene in the valid scenario list, determining that the running scenario belongs to the preset scenario; or providing an invalid scenario list, and when the running scenario is not a scene in the invalid scenario list, determining that the running scenario belongs to the preset scenario.
[0126] Optionally, each running scene has a corresponding scene identifier, the effective scene list includes scene identifiers corresponding to effective running scenes, and the ineffective scene list includes scene identifiers corresponding to ineffective running scenes. The scene identifier corresponding to the identified running scene is compared with the scene identifier in the effective scene list, or the scene identifier corresponding to the identified running scene is compared with the scene identifier in the ineffective scene list to determine whether the running scene belongs to a preset scene.
[0127] When adjusting the first frequency, the adjustment is made according to the preset frame rate interval corresponding to the running scene, and the preset frame rate interval corresponding to the running scene is more suitable for the running scene, so that the adjustment is more targeted. For example, the preset frame rate interval corresponding to the reading scene is set to 30-40, and the preset frame rate interval corresponding to the battle scene in the game is 40-50. In the reading scene, even if the frame rate is low, it will not have much impact on the user. In the battle scene in the game, if the frame rate is low, serious jamming will occur, affecting the user's gaming experience. Therefore, adjusting according to the preset frame rate interval corresponding to the running scene can be more targeted.
[0128] For an implementation method of adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval corresponding to the running scene, see the above Figure 1-Figure 3 The adjustment method in the embodiment shown will not be described in detail here. Figure 1-Figure 3 The difference is that in step S403, the preset frame rate range corresponding to the running scene is used during adjustment.
[0129] In the disclosed embodiment, the first frequency is adjusted according to the relationship between the average frame rate and the preset frame rate range corresponding to the operating scenario, so as to ensure a balance between device performance and device power consumption and make the adjustment more targeted.
[0130] Figure 5 is a flowchart of another resource scheduling method according to an exemplary embodiment, which is executed by an electronic device, see Figure 5 , the method comprises the following steps:
[0131] Step S501: Obtain an average frame rate of a first application in a first time period.
[0132] Step S502: adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain a second frequency.
[0133] The implementation of steps S501 and S502 is shown in the above Figure 1-Figure 4 The illustrated implementation will not be described in detail here.
[0134] Step S503: running the first application based on the second frequency in a second time period, where the second time period is a next time period adjacent to the first time period.
[0135] The second time period may be the same as or different from the first time period.
[0136] Optionally, when the first durations corresponding to different running scenarios of the same application are the same, or when the running scenario of the first application in the second time period is the same as the running scenario of the first application in the first time period, the first time period is the same as the second time period. When the first durations corresponding to different running scenarios of the same application are different, and the running scenario of the first application in the second time period is different from the running scenario of the first application in the first time period, the first time period is different from the second time period.
[0137] In the disclosed embodiment, the first frequency is adjusted according to the average frame rate and the preset frame rate range in the first time period. After the second frequency is obtained, operation is based on the second frequency in the next time period. This can ensure that the frequency is continuously adjusted during the operation of the first application, so that the frequency is always maintained at a more appropriate value, thereby better ensuring the balance between device performance and device power consumption.
[0138] In some embodiments, the first frequency and the second frequency are frequencies of a central processing unit. In some scenarios, in addition to adjusting the frequency of the central processing unit, the frequencies of other components in the electronic device may also be adjusted. Figure 6 and Figure 7 The illustrated embodiment illustrates this.
[0139] Figure 6 is a flowchart of another resource scheduling method according to an exemplary embodiment, which is executed by an electronic device, see Figure 6 , the method comprises the following steps:
[0140] Step S601: Obtain an average frame rate of a first application in a first time period.
[0141] Step S602: adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain a second frequency.
[0142] The implementation of steps S601 and S602 is shown in the above Figure 1-Figure 4 The illustrated implementation will not be described in detail here.
[0143] Step S603, adjusting the third frequency according to the relationship between the average frame rate and the preset frame rate range to obtain a fourth frequency, where the third frequency and the fourth frequency are frequencies of the graphics processing unit.
[0144] Among them, the graphics processing unit is GPU (Graphics Processing Unit).
[0145] In some embodiments, when the average frame rate is greater than the first limit value, the third frequency is reduced to obtain the fourth frequency; when the average frame rate is less than the second limit value, the third frequency is increased to obtain the fourth frequency. The implementation of this step is the same as the implementation of the above steps S202 and S203, and will not be repeated here.
[0146] In some embodiments, when the average frame rate is greater than the first limit value and the third frequency is not less than the third preset frequency, the third frequency is reduced to obtain a fourth frequency, which is not less than the third preset frequency; when the average frame rate is less than the second limit value and the third frequency is not greater than the fourth preset frequency, the third frequency is increased to obtain a fourth frequency, which is not greater than the fourth preset frequency and is greater than the third preset frequency. The implementation of this step is the same as the implementation of the above steps S302 and S303, and will not be repeated here.
[0147] In some embodiments, the current running scene of the first application is identified, and when the running scene belongs to a preset scene, the third frequency is adjusted according to the relationship between the average frame rate and the preset frame rate interval corresponding to the running scene to obtain the fourth frequency. The implementation method of this step is the same as the implementation method of the above steps S402 and S403, and will not be repeated here.
[0148] In some embodiments, when the frame stabilization function is not enabled, the third frequency is adjusted according to the relationship between the average frame rate and the preset frame rate interval to obtain the fourth frequency.
[0149] Step S604: running the first application based on the second frequency and the fourth frequency within the second time period.
[0150] In the disclosed embodiment, a preset frame rate interval is configured, and the frequencies of the central processing unit and the graphics processing unit can be adjusted according to the relationship between the average frame rate and the preset frame rate interval. Through simple parameter configuration, the balance between device performance and device power consumption is ensured, and there is no need to accurately configure the frequencies in different situations. By combining the adjustment of the frequency of the central processing unit and the adjustment of the frequency of the graphics processing unit, the device performance and device power consumption can be adjusted from more aspects, making the balance between device performance and device power consumption more stable.
[0151] Figure 7 is a flowchart of another resource scheduling method according to an exemplary embodiment, which is executed by an electronic device, see Figure 7 , the method comprises the following steps:
[0152] Step S701: Obtain an average frame rate of a first application in a first time period.
[0153] Step S702: adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain a second frequency.
[0154] The implementation of steps S701 and S702 is shown in the above Figure 1-Figure 4 The illustrated implementation will not be described in detail here.
[0155] Step S703, adjusting the fifth frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain a sixth frequency, where the fifth frequency and the sixth frequency are the frequencies of the memory.
[0156] The memory may be DDR SDRAM (Double Data Rate Synchronous Dynamic Random Access Memory) or other memories.
[0157] In some embodiments, when the average frame rate is greater than the first limit value, the fifth frequency is reduced to obtain the sixth frequency; when the average frame rate is less than the second limit value, the fifth frequency is increased to obtain the sixth frequency. The implementation of this step is similar to the implementation of the above steps S202 and S203, and will not be repeated here.
[0158] In some embodiments, when the average frame rate is greater than the first limit value and the fifth frequency is not less than the fifth preset frequency, the fifth frequency is reduced to obtain a sixth frequency, which is not less than the fifth preset frequency; when the average frame rate is less than the second limit value and the fifth frequency is not greater than the sixth preset frequency, the fifth frequency is increased to obtain a sixth frequency, which is not greater than the sixth preset frequency and is greater than the fifth preset frequency. The implementation of this step is the same as the implementation of the above steps S302 and S303, and will not be repeated here.
[0159] In some embodiments, the current running scene of the first application is identified, and when the running scene belongs to a preset scene, the fifth frequency is adjusted according to the relationship between the average frame rate and the preset frame rate interval corresponding to the running scene to obtain the sixth frequency. The implementation of this step is the same as the implementation of the above steps S402 and S403, and will not be repeated here.
[0160] In some embodiments, when the frame stabilization function is not enabled, the fifth frequency is adjusted according to the relationship between the average frame rate and the preset frame rate interval to obtain the sixth frequency.
[0161] Step S704: running the first application based on the second frequency and the sixth frequency in the second time period.
[0162] In the disclosed embodiment, a preset frame rate interval is configured, and the frequency of the central processing unit and the frequency of the memory can be adjusted according to the relationship between the average frame rate and the preset frame rate interval. Through simple parameter configuration, the balance between device performance and device power consumption is ensured, and there is no need to accurately configure the frequency in different situations. By combining the adjustment of the frequency of the central processing unit and the adjustment of the frequency of the memory, the device performance and the device power consumption can be adjusted from more aspects, making the balance between device performance and device power consumption more stable.
[0163] It should be noted that Figure 6 The process of adjusting the frequency of the central processing unit and the frequency of the graphics processing unit is explained. Figure 7 The process of adjusting the frequency of the central processing unit and the frequency of the memory is described. In another embodiment, the frequency of the central processing unit, the frequency of the graphics processing unit and the frequency of the processor can also be adjusted simultaneously. The adjustment method is shown in the above embodiment. In this case, the first application is run based on the second frequency, the fourth frequency and the sixth frequency in the second time period.
[0164] In addition, it should be noted that the above embodiment is only based on the operation of the first application in the first time period and the second time period. In another embodiment, when the first application is running in the second time period, the average frame rate of the first application in the second time period can be obtained, and then the second frequency can be adjusted according to the relationship between the average frame rate in the second time period and the preset frame rate range. That is, during the application operation, the above embodiment can be repeatedly executed, and the adjustment can be performed at regular intervals to keep the scheduling of the frequency resources of the electronic device within an appropriate range, thereby improving the performance of the device while ensuring the power consumption of the device.
[0165] In some embodiments, the above resource scheduling method can also be expressed as Figure 8 The flowchart shown is shown in Figure 8 , the method comprises the following steps:
[0166] 1. Analyze the cloud control parameters to obtain the preset frame rate range, frequency range and ineffective scene list.
[0167] Among them, the cloud control parameters are parameters stored in the electronic device. By parsing the cloud control parameters, the preset frame rate range, frequency range and ineffective scene list can be obtained. The first limit value of the preset frame rate range is Fmax and the second limit value is Fmin.
[0168] In some embodiments, the cloud stores the latest cloud control parameters. The electronic device obtains the cloud control parameters from the cloud every second duration, and replaces the originally saved cloud control parameters with the latest obtained cloud control parameters, so as to ensure the timeliness of the cloud control parameters stored in the electronic device. Optionally, the cloud control parameters have corresponding version numbers. When the cloud updates the cloud control parameters, the version numbers are updated. The electronic device compares the version number corresponding to the cloud control parameters stored in the cloud with the version number corresponding to the cloud control parameters stored locally. When the two version numbers are inconsistent, the electronic device obtains the latest cloud control parameters from the cloud. When the two version numbers are consistent, the electronic device does not update the version number.
[0169] For the frequency band interval, the first preset frequency of the frequency band interval is Freqmin, and the second preset frequency is Freqmax. The difference between the frequency band interval and the frequency in the above embodiments is that the frequencies included in the frequency band interval are certain fixed frequencies. That is to say, when adjusting the frequency, the current frequency point can only be adjusted to another frequency point.
[0170] 2. Calculate the average frame rate Favg of the first application within the first time period, determine the sceneid (scene identifier) of the current running scene, obtain the current frequency point Freqcur, and query the frame stabilization flag.
[0171] The implementation manners of calculating the average frame rate, determining the allowed scene, and obtaining the frequency point are the same as those in the above embodiments, and will not be elaborated here.
[0172] Among them, the frame stabilization flag indicates whether the frame stabilization function has been enabled. For example, the frame stabilization identifier is 0 or 1. When the frame stabilization identifier is 1, it means that the frame stabilization function has been enabled. When the frame stabilization identifier is 0, it means that the frame stabilization function has not been enabled.
[0173] 3. Judge whether the frame stabilization function is enabled. If the frame stabilization function is enabled, execute step 2. If the frame stabilization function is not enabled, execute step 4.
[0174] 4. Judge whether the current sceneid is in the ineffective scene list. If it is in the ineffective scene list, execute step 2. If it is not in the ineffective scene list, execute step 5.
[0175] 5. Judge whether the average frame rate Favg belongs to the preset frame rate interval, that is, judge whether Fmin < Favg < Fmax. If Fmin < Favg < Fmax is not satisfied, execute steps 6 and 9. If Fmin < Favg < Fmax, execute step 12.
[0176] 6. Judge whether Favg < Fmin. If Favg < Fmin is not satisfied, execute step 2. If Favg < Fmin, execute step 7.
[0177] 7. Determine whether Freqcur > Freqmax. If Freqcur > Freqmax, execute step 2. If Freqcur > Freqmax is not true, execute step 8.
[0178] 8. Increase the current frequency point and execute step 13.
[0179] 9. Determine whether Favg > Fmax. If Favg > Fmax is not true, execute step 2. If Favg > Fmax, execute step 10.
[0180] 10. Determine whether Freqcur < Freqmin. If Freqcur < Freqmin, execute step 2. If Freqcur < Freqmin is not true, execute step 11.
[0181] 11. Decrease the current frequency point and execute step 13.
[0182] 12. Maintain the current frequency point and execute step 13.
[0183] 13. Perform frequency limiting operation and execute step 2 again.
[0184] Among them, the frequency limiting operation means operating at the adjusted frequency point in the next time period. The adjusted frequency point is one of the increased frequency point, the decreased frequency point, and the current frequency point.
[0185] Figure 8 For the implementation manners of each step in the illustrated embodiment, refer to the above Figure 1-Figure 7 illustrated embodiment's implementation manner, which will not be elaborated here.
[0186] Fig. 9 is a block diagram of a resource scheduling device shown according to an exemplary embodiment. Refer to Fig. 9 , the device includes:
[0187] An average frame rate acquisition module 901, configured to acquire the average frame rate of the first application in the first time period;
[0188] A frequency adjustment module 902, configured to adjust the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain a second frequency. The preset frame rate interval is used to represent the range allowing frame drops. The first limit value of the preset frame rate interval is the maximum frame rate of the range allowing frame drops, and the second limit value of the preset frame rate interval is the minimum frame rate of the range allowing frame drops.
[0189] The device provided by the embodiment of the present disclosure obtains the average frame rate of a first application in a first time period, and adjusts the first frequency according to the relationship between the average frame rate and a preset frame rate interval to obtain a second frequency. The preset frame rate interval is used to characterize the range within which frame drops are allowed. The first limit value of the preset frame rate interval is the maximum frame rate within the range within which frame drops are allowed, and the second limit value is the minimum frame rate within the range within which frame drops are allowed. In this adjustment method, the preset frame rate interval is configured, and the frequency can be adjusted according to the relationship between the average frame rate and the preset frame rate interval. Through simple parameter configuration, a balance between device performance and device power consumption is ensured, and there is no need to accurately configure the frequency in different situations.
[0190] In some embodiments, the frequency adjustment module 902 is configured to:
[0191] When the average frame rate is greater than a first limit value, reducing the first frequency to obtain a second frequency;
[0192] When the average frame rate is less than the second limit value, the first frequency is increased to obtain the second frequency.
[0193] In some embodiments, the frequency adjustment module 902 is configured to:
[0194] When the average frame rate is greater than the first limit value and the first frequency is not less than the first preset frequency, the first frequency is reduced to obtain a second frequency, and the second frequency is not less than the first preset frequency;
[0195] When the average frame rate is less than the second limit value and the first frequency is not greater than the second preset frequency, the first frequency is increased to obtain a second frequency, the second frequency is not greater than the second preset frequency, and the second preset frequency is greater than the first preset frequency.
[0196] In some embodiments, the apparatus further comprises:
[0197] A scene recognition module is configured to recognize a current running scene of the first application, where the running scene has a corresponding preset frame rate interval;
[0198] The frequency adjustment module 902 is configured to adjust the first frequency to obtain the second frequency according to the relationship between the average frame rate and the preset frame rate range corresponding to the running scene when the running scene belongs to the preset scene.
[0199] In some embodiments, the frequency adjustment module 902 is configured to adjust the first frequency to obtain the second frequency according to the relationship between the average frame rate and the preset frame rate range when the frame stabilization function is not enabled.
[0200] In some embodiments, the apparatus further comprises:
[0201] The running module is configured to run the first application based on the second frequency in a second time period, and the second time period is a next time period adjacent to the first time period.
[0202] In some embodiments, the first frequency and the second frequency are frequencies of the central processing unit, and the frequency adjustment module 902 is further configured to adjust the third frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain a fourth frequency, and the third frequency and the fourth frequency are frequencies of the graphics processing unit;
[0203] The running module is configured to run the first application based on the second frequency and the fourth frequency within the second time period.
[0204] In some embodiments, the first frequency and the second frequency are frequencies of the central processing unit, and the frequency adjustment module 902 is further configured to adjust the fifth frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain a sixth frequency, and the fifth frequency and the sixth frequency are frequencies of the memory;
[0205] The running module is configured to run the first application based on the second frequency and the sixth frequency within the second time period.
[0206] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0207] An embodiment of the present disclosure further provides an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the resource scheduling method in the above embodiment.
[0208] Fig.10 is a block diagram of an electronic device 1000 according to an exemplary embodiment.
[0209] Reference Fig.10 , the electronic device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 1012 , a sensor component 1014 , and a communication component 1016 .
[0210] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.
[0211] The memory 1004 is configured to store various types of data to support operations on the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0212] The power supply component 1006 provides power to various components of the electronic device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1000.
[0213] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0214] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 1000 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.
[0215] I / O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0216] The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 can detect the open / closed state of the electronic device 1000, the relative positioning of components, such as the display and keypad of the electronic device 1000, and the sensor assembly 1014 can also detect the position change of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of user contact with the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0217] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0218] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0219] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the instructions can be executed by the processor 1020 of the electronic device 1000 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0220] The embodiments of the present disclosure also provide a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the resource scheduling method in the above embodiment.
[0221] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0222] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A resource scheduling method, characterized in that: The method comprises: Obtaining an average frame rate of the first application in a first time period; According to the relationship between the average frame rate and the preset frame rate range, the first frequency is adjusted to obtain the second frequency, the preset frame rate range is used to characterize the range of allowed frame drops, the first limit value of the preset frame rate range is the maximum frame rate of the allowed frame drop range, and the second limit value of the preset frame rate range is the minimum frame rate of the allowed frame drop range.
2. The method according to claim 1, characterized in that The step of adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency includes: When the average frame rate is greater than the first limit value, reducing the first frequency to obtain the second frequency; When the average frame rate is less than the second limit value, the first frequency is increased to obtain the second frequency.
3. The method according to claim 2, characterized in that When the average frame rate is greater than the first limit value, reducing the first frequency to obtain the second frequency includes: When the average frame rate is greater than the first limit value and the first frequency is not less than a first preset frequency, reducing the first frequency to obtain the second frequency, and the second frequency is not less than the first preset frequency; When the average frame rate is less than the second limit value, increasing the first frequency to obtain the second frequency comprises: When the average frame rate is less than the second limit value and the first frequency is not greater than a second preset frequency, the first frequency is increased to obtain the second frequency, the second frequency is not greater than the second preset frequency, and the second preset frequency is greater than the first preset frequency.
4. The method according to claim 1, characterized in that: The method further comprises: Identifying a current running scenario of the first application, wherein the running scenario has a corresponding preset frame rate range; The step of adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency includes: When the operating scenario belongs to a preset scenario, the first frequency is adjusted according to the relationship between the average frame rate and the preset frame rate range corresponding to the operating scenario to obtain the second frequency.
5. The method according to claim 1, characterized in that The step of adjusting the first frequency according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency includes: When the frame stabilization function is not enabled, the first frequency is adjusted according to the relationship between the average frame rate and the preset frame rate interval to obtain the second frequency.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The first application is run based on the second frequency in a second time period, where the second time period is a next time period adjacent to the first time period.
7. The method according to claim 6, characterized in that The first frequency and the second frequency are frequencies of a central processing unit, and the method further includes: According to the relationship between the average frame rate and the preset frame rate interval, the third frequency is adjusted to obtain a fourth frequency, wherein the third frequency and the fourth frequency are frequencies of a graphics processing unit; The running the first application based on the second frequency within the second time period includes: The first application is run based on the second frequency and the fourth frequency during the second time period.
8. The method according to claim 6, characterized in that The first frequency and the second frequency are frequencies of a central processing unit, and the method further includes: According to the relationship between the average frame rate and the preset frame rate interval, the fifth frequency is adjusted to obtain a sixth frequency, wherein the fifth frequency and the sixth frequency are frequencies of the memory; The running the first application based on the second frequency within the second time period includes: The first application is run based on the second frequency and the sixth frequency during the second time period.
9. A resource scheduling device, characterized in that: The device comprises: An average frame rate acquisition module, configured to acquire an average frame rate of the first application in a first time period; The frequency adjustment module is configured to adjust the first frequency according to the relationship between the average frame rate and the preset frame rate range to obtain a second frequency. The preset frame rate range is used to characterize the range of allowed frame drops. The first limit value of the preset frame rate range is the maximum frame rate of the allowed frame drop range, and the second limit value is the minimum frame rate of the allowed frame drop range.
10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method as claimed in any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 8.
