Frame rate adjustment method and electronic device
By monitoring changes in operating current and temperature, the frame rate is dynamically adjusted, solving the problems of jitter and lag in frame rate adjustment of electronic devices. This achieves more precise and stable frame rate control, optimizing device performance and power consumption.
Patent Information
- Application Number
- CN202410236368.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-02-29
AI Technical Summary
Existing electronic devices are prone to jitter and fluctuation during frame rate adjustment, resulting in low stability. Furthermore, using the same frame rate adjustment method in different application scenarios can lead to performance degradation or excessive power consumption.
By monitoring changes in the operating current and temperature of electronic devices, the frame rate is dynamically adjusted. Temperature thresholds are determined using single-frame power consumption, target current values, and preset constraints, and the frame rate is adjusted in a timely manner to keep the device temperature within a safe range.
It improves the accuracy and stability of frame rate adjustment, reduces the lag in frame rate adjustment, and optimizes power consumption and performance in different application scenarios.
Smart Images

Figure CN119248080B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, and particularly relates to a frame rate adjusting method and an electronic device. BACKGROUND
[0002] In order to provide better user experience, the frame rate and the picture quality of the electronic device are constantly improved. Especially in some scenes with high demand for picture fluency, such as video playing, game playing and the like, the electronic device usually displays pictures at a high frame rate, so as to reduce the picture lag. However, with the increase of the frame rate of the electronic device, the power consumption of the electronic device is also greater, and the device temperature of the electronic device is also increased. In order to reduce the influence of the device temperature of the electronic device on the running state of the electronic device, when the device temperature of the electronic device reaches a certain temperature threshold, the electronic device reduces the frame rate of the electronic device.
[0003] However, the frame rate adjusting scheme used by the electronic device at present is prone to frame rate jitter, and the stability is low. SUMMARY
[0004] The present application provides a frame rate adjusting method and an electronic device, which are used for dynamically adjusting the frame rate through the working current change of the electronic device, so that the frame rate control is more accurate.
[0005] To achieve the above object, the embodiments of the present application adopt the following technical scheme:
[0006] In a first aspect, a frame rate adjusting method is provided, which comprises: in the process of running a first application at a first frame rate, if a first current value of the electronic device is greater than a target current value, determining a temperature threshold according to a single-frame power consumption of the electronic device, the target current value and a preset constraint relationship, the first current value being a current value of the working current of the electronic device in a first time period, the single-frame power consumption representing a current value corresponding to each frame of image generated by the electronic device, and the preset constraint relationship being used to represent the corresponding relationship between the frame rate change value and the temperature change value. In the case that the first device temperature of the electronic device reaches the temperature threshold, the frame rate of the electronic device is adjusted from the first frame rate to a second frame rate according to the change rate of the working current of the electronic device.
[0007] In this way, the electronic device reflects the current load condition through the current working current, and dynamically determines the temperature threshold for frame rate adjustment through the current single-frame power consumption when the load is large. The temperature threshold can be used as the starting temperature for the frame rate adjustment. The temperature threshold for frame rate adjustment can be different in different application scenarios, so that the electronic device can set the temperature threshold for frame rate adjustment according to different application scenarios. In addition, the electronic device adjusts the frame rate through the change rate of the working current, which can control the frame rate more timely and accurately, and reduce the hysteresis of the frame rate adjustment.
[0008] In a possible implementation manner of the first aspect, the method further includes: obtaining an initial device temperature of the electronic device, the initial device temperature being a device temperature when the electronic device starts the first application; and determining, based on a preset temperature rise parameter, a target current value corresponding to a change from the initial device temperature to the preset safe temperature, the preset temperature rise parameter being used to indicate a heat production capability of the working current of the electronic device.
[0009] In the implementation manner, the dynamic target current value can be determined by the device temperature when the electronic device starts the first application and the preset temperature rise parameter. The target current value can be used as a reference threshold of the load level of the electronic device. The target current value changes with the running scene of the first application, and can better reflect the reference threshold of the load in different application scenes.
[0010] In another possible implementation manner of the first aspect, a single-frame power consumption of the electronic device is determined according to the first current value and the first frame rate. For example, the single-frame power consumption can be equal to a ratio of the first current value to the first frame rate. In the implementation manner, the single-frame power consumption is determined by the current value (that is, the first current value) of the working current and the current frame rate (that is, the first frame rate), and can better reflect the relationship between the working current and the frame rate.
[0011] In another possible implementation manner of the first aspect, a target frame rate corresponding to the target current value is determined according to the single-frame power consumption, a frame rate interval between the target frame rate and the first frame rate is determined, and a temperature threshold is determined according to the frame rate interval and a preset constraint relationship. In the implementation manner, in order to make the device temperature less than or equal to the preset safe temperature, the working current needs to be less than or equal to the target current value corresponding to the preset safe temperature. The relationship between the working current and the frame rate can be represented by the single-frame power consumption. Accordingly, the frame rate of the electronic device needs to be less than or equal to the target frame rate. Based on this, the temperature threshold determined by the target frame rate and the preset constraint relationship can be more accurate.
[0012] In another possible implementation manner of the first aspect, a frame rate adjustment amplitude is determined according to a change rate of the working current of the electronic device, and the frame rate of the electronic device is adjusted from the first frame rate to the second frame rate according to the frame rate adjustment amplitude. In the implementation manner, the change rate of the working current can reflect the change rate of the device temperature. The frame rate adjustment amplitude determined by the electronic device through the change rate of the working current is more accurate, so that the frame rate adjustment is more timely.
[0013] In a possible implementation form of the first aspect, the frame rate adjustment amplitude is determined according to the first device temperature of the electronic device and the change rate of the working current. In this implementation form, the current device temperature (i.e., the first device temperature) can also be used as a reference factor for the frame rate adjustment amplitude. In this way, the electronic device can determine the frame rate adjustment amplitude by comprehensively considering the influence of the current device temperature and the change rate of the working current on the frame rate, thereby improving the accuracy of the frame rate adjustment amplitude.
[0014] In a possible implementation form of the first aspect, the first adjustment amplitude is determined according to the first device temperature of the electronic device; the second adjustment amplitude is determined according to the change rate of the working current of the electronic device; and the frame rate adjustment amplitude is determined according to the first adjustment amplitude and the second adjustment amplitude. In this implementation form, the first adjustment amplitude is the frame rate adjustment amplitude provided by the device temperature. The second adjustment amplitude is the frame rate adjustment amplitude provided by the change rate of the working current. The electronic device comprehensively determines the final frame rate adjustment amplitude from the two frame rate adjustment amplitudes, which can further improve the accuracy of the frame rate adjustment amplitude.
[0015] In a possible implementation form of the first aspect, the second device temperature of the electronic device is predicted according to the first device temperature of the electronic device and the change rate of the working current; and the first adjustment amplitude is further determined according to the second device temperature. In this implementation form, the first adjustment amplitude is determined by the predicted device temperature (i.e., the second device temperature), thereby reducing the influence of the hysteresis of the device temperature and making the determined first adjustment amplitude more accurate.
[0016] In a possible implementation form of the first aspect, the change rate of the device temperature of the electronic device is predicted according to the change rate of the working current of the electronic device; and the second adjustment amplitude is determined according to the change rate of the device temperature. In this implementation form, the change rate of the device temperature is predicted by the change rate of the working current, and the second adjustment amplitude is further determined by the predicted change rate of the device temperature, thereby reducing the influence of the hysteresis of the device temperature and making the determined second adjustment amplitude more accurate.
[0017] In a possible implementation form of the first aspect, the method further includes predicting a second current value of the electronic device according to the first current value, the second current value being a current value of the working current of the electronic device after the first time period; and determining the change rate of the working current of the electronic device according to the second current value of the electronic device and the first current value. In this implementation form, the electronic device can predict the future current value (i.e., the second current value) of the working current by the current current value (i.e., the first current value) of the working current, thereby further improving the accuracy of the frame rate adjustment.
[0018] In a second aspect, the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory. When the processor runs the computer program, the electronic device performs the method of the first aspect and any possible implementation manner thereof.
[0019] In a third aspect, the present application provides a computer readable storage medium, storing a computer program. When the computer program is run by an electronic device, the electronic device performs the method of the first aspect and any possible implementation manner thereof.
[0020] In a fourth aspect, the present application provides a computer program product containing program instructions, comprising a computer program. When the computer program is run by an electronic device, the computer can perform the method of the first aspect and any possible implementation manner thereof. For example, the computer can be the electronic device described above.
[0021] In a fifth aspect, the present application provides a chip system applied to an electronic device. The chip system comprises an interface circuit and a processor. The interface circuit and the processor are interconnected through a circuit. The interface circuit is configured to receive a signal from a memory and send a signal to the processor, the signal comprising computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device performs the method of the first aspect and any possible implementation manner thereof. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 A frame rate change diagram provided for an embodiment of the present application;
[0023] Figure 2 A frame rate and device temperature change diagram provided for an embodiment of the present application;
[0024] Figure 3 An interface diagram of different application scenarios provided for an embodiment of the present application;
[0025] Figure 4 A hardware structure block diagram of an electronic device, for example, a mobile phone 100, provided for an embodiment of the present application;
[0026] Figure 5 A software structure block diagram of an electronic device, for example, a mobile phone 100, provided for an embodiment of the present application;
[0027] Figure 6 A flowchart of a frame rate adjustment method provided for an embodiment of the present application;
[0028] Figure 7 A flowchart of another frame rate adjustment method provided for an embodiment of the present application;
[0029] Figure 8This is a schematic diagram illustrating the software module interaction of a frame rate adjustment method provided in an embodiment of this application. Detailed Implementation
[0030] The frame rate of an electronic device represents the frequency at which the device generates image frames, that is, the number of image frames generated per unit of time. The unit of frame rate is frames per second (FPS). The higher the frame rate, the more image frames the device generates per second, and the more image frames are refreshed and displayed on the screen per second. As the frame rate increases, the dynamic images displayed on the screen become smoother.
[0031] As mentioned above, the higher the frame rate of an electronic device, the greater its power consumption, and consequently, the higher its device temperature. To reduce the impact of device temperature on the operating status of the electronic device, frame rate control strategies are implemented.
[0032] In one example, such as Figure 1 As shown, if the electronic device detects that its temperature exceeds a preset safe temperature (e.g., 45°C), it adjusts the frame rate from the current first frame rate (e.g., 60 FPS) to a lower second frame rate (e.g., 45 FPS). After the frame rate decreases, the electronic device's load and power consumption decrease, and its temperature also drops. If the temperature drops below the preset safe temperature, the electronic device will adjust the frame rate back from the second frame rate (e.g., 45 FPS) to the first frame rate (e.g., 60 FPS), and this cycle repeats. However, this frame rate control strategy is prone to sudden increases and decreases in frame rate, such as the frame rate abruptly changing from the first frame rate to the second, or vice versa. Therefore, this frame rate control strategy results in low frame rate stability, and sudden changes in frame rate can degrade the user experience.
[0033] In another example, to improve frame rate stability, the electronic device can gradually adjust its frame rate. For instance, when the device temperature exceeds a preset safe temperature, the device gradually adjusts the frame rate from a first frame rate to a second frame rate. When the device temperature falls below the preset safe temperature, the device gradually adjusts the frame rate from the second frame rate back to the first frame rate. However, this slow frame rate adjustment strategy suffers from lag. Figure 2As shown, in the case that the device temperature of the electronic device reaches a preset safety temperature (such as 45℃), the electronic device gradually reduces the frame rate. When the device temperature of the electronic device no longer increases with the reduction of the frame rate, the frame rate of the electronic device is still slowly decreasing (at this time, even if the frame rate of the electronic device does not decrease, the device temperature of the electronic device will not continue to increase). Since the device temperature has hysteresis, the adjustment of the frame rate also has hysteresis. It can be seen that this frame rate control strategy is not accurate enough.
[0034] In addition, the electronic device has diversified application scenarios, such as a single game scenario of WIFI communication, a game and video playing scenario of WIFI communication, a single game scenario of mobile communication (such as 4G, 5G), and a game and video playing scenario of mobile communication. For example, Figure 3 As shown in (1) of FIG. 1, in the single game scenario of WIFI communication, the electronic device transmits the data of the game application through WIFI communication and displays the interface of the game application. As shown in (2) of FIG. 1, in the game and video playing scenario of WIFI communication, the electronic device transmits the data of the game application and the video application through WIFI communication, and the window of the video application is also displayed on the interface of the game application. Figure 3 As shown in (2) of FIG. 1, in the game and video playing scenario of WIFI communication, the electronic device transmits the data of the game application and the video application through WIFI communication, and the window of the video application is also displayed on the interface of the game application.
[0035] In an implementation provided by the embodiments of the present application, the electronic device periodically acquires the working current value of the electronic device in the process of running the first application at a certain frame rate. If the working current value of the electronic device reaches a target current value, it indicates that the working current of the electronic device at this time is large, and the electronic device is in a high load state. If the electronic device continues to run at the current frame rate, the device temperature of the electronic device will continue to rise, which may affect the performance of the electronic device. In this case, the electronic device determines a temperature threshold of frame rate adjustment according to the single frame power consumption of the electronic device, the target current value, and a preset constraint relationship. Further, in the case that the device temperature of the electronic device reaches the temperature threshold, the electronic device adjusts the frame rate of the electronic device according to the change rate of the working current of the electronic device, so that the device temperature of the electronic device is maintained within a certain temperature range.
[0036] In this way, the electronic device reflects the current load condition through the current working current, and when the load is large, the temperature threshold of frame rate adjustment is dynamically determined through the current single-frame power consumption, and the temperature threshold of frame rate adjustment can be different in different application scenarios, so that the electronic device can set the temperature threshold of frame rate adjustment for different application scenarios. In addition, the electronic device adjusts the frame rate through the change rate of the working current, can control the frame rate in time, makes the frame rate control more accurate, reduces the hysteresis of frame rate adjustment, realizes dynamic adjustment of the frame rate, and improves the accuracy of frame rate adjustment.
[0037] For example, the electronic device described in the embodiments of the present application can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) \ virtual reality (VR) device, a media player, a wearable device, and the like. The embodiments of the present application do not specially limit the specific form of the electronic device.
[0038] In the embodiments of the present application, the electronic device is taken as a mobile phone 100 as an example, and the hardware structure of the electronic device is introduced through the mobile phone 100. As shown in Figure 4 The mobile phone 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a loudspeaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like.
[0039] The processor 110 can include one or more processing units, such as: an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), a driving processor, etc. Different processing units can be independent devices or integrated in one or more processors. The processor 110 can be the nerve center and command center of the mobile phone 100. The processor 110 can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.
[0040] In some implementations, the processor 110 can be a multi-core processor. The multi-core processor is divided into multiple clusters, and each cluster includes one or more cores. For example, the multiple processors can include 3 clusters, namely cluster 0, cluster 1, and cluster 2. Cluster 0 includes one or more large cores, cluster 1 includes one or more medium cores, and cluster 2 includes one or more small cores.
[0041] The memory can also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.
[0042] The external memory interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external storage card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, files such as music and videos are saved in the external storage card.
[0043] The internal memory 121 can be used to store computer executable program codes including instructions. The processor 110 performs various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. For example, in the embodiments of the present application, the processor 110 can perform the instructions stored in the internal memory 121, and the internal memory 121 can include a program storage area and a data storage area. The internal memory 121 can include a high-speed random access memory, and can further include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
[0044] The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. The charging management module 140 can charge the battery 142 and supply power to the mobile phone 100 through the power management module 141.
[0045] The wireless communication function of the mobile phone 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, and the like. In some embodiments, the antenna 1 and the mobile communication module 150 of the mobile phone 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.
[0046] The mobile communication module 150 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the mobile phone 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and perform filtering, amplification, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation.
[0047] The wireless communication module 160 can provide a solution including wireless local area network (WLAN) (such as Wi-Fi network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), and the like, which are applied to the mobile phone 100.
[0048] The mobile phone 100 can transmit application data through the mobile communication module 150 or the wireless communication module 160. For example, the mobile phone 100 transmits data of a game application through Wi-Fi communication provided by the wireless communication module 160 over a Wi-Fi network.
[0049] The mobile phone 100 can implement an audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.
[0050] The sensor module 180 can include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a Hall sensor, a touch sensor, an ambient light sensor, and a temperature sensor, etc. The mobile phone 100 can collect various data through the sensor module 180.
[0051] The temperature sensor is used to detect the device temperature. In some embodiments, the mobile phone 100 performs a temperature processing strategy by using the device temperature detected by the temperature sensor. For example, when the device temperature reported by the temperature sensor exceeds a threshold value, the mobile phone 100 performs a performance reduction of a processor located near the temperature sensor, such as reducing the frame rate of interface image generation, so as to reduce the power consumption to implement thermal protection. In another embodiment, when the device temperature is lower than another threshold value, the mobile phone 100 heats the battery 142 to avoid abnormal shutdown of the mobile phone 100 caused by low temperature. In other embodiments, when the device temperature is lower than yet another threshold value, the mobile phone 100 performs a voltage boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0052] The Hall sensor can be used to detect the working current. The Hall sensor can measure the strength (also referred to as the current value or the current size) and direction of the working current based on the Hall effect. The Hall sensor can also be referred to as a current sensor. In some embodiments, due to the aftereffect of the device temperature of the mobile phone 100, the mobile phone 100 predicts the device temperature of the mobile phone 100 by using the working current detected by the Hall sensor. Alternatively, the mobile phone 100 characterizes the load condition of the mobile phone 100 by using the working current detected by the Hall sensor. For example, when the working current of the mobile phone 100 is greater than a target current value, it indicates that the load of the mobile phone 100 is large. When the working current of the mobile phone 100 is less than or equal to the target current value, it indicates that the load of the mobile phone 100 is small.
[0053] The mobile phone 100 implements a display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.
[0054] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light emitting diode (QLED), or the like.
[0055] In some implementations, the above-described touch sensor can be disposed in the display screen 194, and the touch sensor and the display panel form a touch screen, also referred to as a “touch panel”. The touch sensor, also referred to as a “touch panel”, is configured to detect touch operations, such as click operations, sliding operations, and the like, acting on or near the touch sensor. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. The mobile phone 100 can provide visual output related to the touch operation through the display screen 194.
[0056] It can be understood that the interface connection relationship between the modules in the above embodiment is only illustrative and does not limit the structure of the electronic device. In other embodiments, the electronic device can include more or fewer modules than those in the above embodiment, and the modules can be connected by different interfaces or a combination of different interfaces. The hardware structure of the electronic device provided in the embodiments of the present application can also refer to the hardware structure of the mobile phone 100 as shown in the figure. The methods in the following embodiments can be implemented in the electronic device with the above hardware structure.
[0057] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. Taking the layered architecture of the Android system as an example, the software structure of the electronic device is described.
[0058] The layered architecture divides the software into several layers, each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system can include an application layer, an application framework layer, a native service layer, a hardware abstraction layer (HAL), and a kernel layer.
[0059] The application layer can include a series of application packages. For example, the application packages can include applications (which can be referred to simply as applications) such as games, cameras, galleries, calendars, calls, maps, navigation, WLAN, Bluetooth, music, videos, short messages, etc. The embodiments of the present application do not make any limitation in this regard.
[0060] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions. For example, the application framework layer can include window managers, content providers, view systems, phone managers, resource managers, and notification managers, etc. The embodiments of the present application do not make any limitation in this regard. The application framework layer can also include a frame rate adjustment interface. The frame rate adjustment interface is used to invoke the frame rate smoothing module in the native service layer.
[0061] The native service layer mainly includes some native services and system libraries. The native service layer can provide feature support for the Android system through some C / C++ libraries. The system libraries can include a plurality of functional modules. For example, a surface manager, media libraries, a three-dimensional graphics processing library (e.g., OpenGL ES), a two-dimensional graphics engine (e.g., SGL), etc. In addition, the native service layer also includes an Android runtime. The Android runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system. The core libraries include two parts: one part is the functional functions required to be called by the java language, and the other part is the core library of the Android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection, etc.
[0062] In some implementations, the native service layer includes a temperature module, a current module, and a frame rate smoothing (FRS) module. The temperature module is used to obtain a temperature value of a device temperature of the mobile phone 100. The current module is used to obtain a current value of a working current of the mobile phone 100. The frame rate smoothing module can determine a frame rate adjustment amplitude value according to the current value of the working current, the temperature value of the device temperature, and a current frame rate, and further adjust the frame rate through the determined frame rate adjustment amplitude value to achieve frame rate control.
[0063] The HAL layer is encapsulation of the Linux kernel driver, provides an interface upward, and shields the implementation details of the underlying hardware. For example, the HAL layer can include a camera HAL, a Wi-Fi HAL, a Bluetooth HAL, a frame rate scheduling interface, a sensor HAL (or referred to as a sensor interface), and the like.
[0064] The kernel layer is a layer between hardware and software. The kernel layer includes a driver and a system service program. The driver at least contains a display driver, a camera driver, an audio driver, a sensor driver, and the like.
[0065] Embodiments of the present application take the electronic device as the above-mentioned mobile phone 100, and the software system of the mobile phone 100 adopts a layered architecture of an Android system as an example, and combine Figure 5 The working process of the software module of the mobile phone 100 is exemplarily described.
[0066] After the game application in the mobile phone 100 is started, the frame rate adjustment interface notifies the frame rate smoothing module to perform a frame rate adjustment task. The frame rate smoothing module obtains a current value of the working current through the current module. In a case where the current value of the working current is greater than a target current value, the frame rate smoothing module determines a temperature threshold value according to the current value of the working current and a current frame rate. The frame rate smoothing module can also obtain a temperature value of the device temperature through the temperature module. In a case where the temperature value of the device temperature reaches the temperature threshold value, the frame rate smoothing module determines a change rate of the working current, further determines a frame rate adjustment amplitude according to the change rate of the working current, and adjusts the frame rate according to the frame rate adjustment amplitude. Further, the frame rate smoothing module notifies the driver of the adjusted frame rate through the frame rate scheduling interface. The driver further instructs the GPU to draw an image frame at the adjusted frame rate. In this way, the mobile phone 100 can implement frame rate adjustment.
[0067] The frame rate adjustment strategy provided by the embodiments of the present application can be applicable to some running scenarios of applications with large loads. For example, running scenarios of applications such as game applications and video applications, which have high requirements for frame rate. Of course, the frame rate adjustment strategy provided by the embodiments of the present application can also be applicable to other application scenarios.
[0068] The following takes the electronic device as the mobile phone 100 as an example, and combines Figure 6 and Figure 7 introduces the method provided by the embodiments of the present application. As Figure 6 shown, the method provided by the embodiments of the present application includes the following steps:
[0069] S601, the mobile phone 100 starts a first application, and runs the first application at a first frame rate.
[0070] The first application is any application program of the mobile phone 100. For example, the first application is a game application, a video application, a chat application, or the like. The mobile phone 100 starts the first application to draw an interface of the first application at a first frame rate. The first frame rate is a frame rate level adopted by the mobile phone 100 in a current first time period. For example, the first frame rate is 60 FPS, 90 FPS, or the like.
[0071] In some implementations, the mobile phone 100 starts the first application in response to a user operation. For example, a desktop of the mobile phone 100 includes an application icon of the first application. The mobile phone 100 receives a user operation of tapping the application icon of the first application by a user. In response to the user operation, the mobile phone 100 starts the first application to run the first application at the first frame rate.
[0072] In some implementations, the mobile phone 100 starts the first application in response to a user operation. For example, a desktop of the mobile phone 100 includes an application icon of the first application. The mobile phone 100 receives a user operation of tapping the application icon of the first application by a user. In response to the user operation, the mobile phone 100 starts the first application to run the first application at the first frame rate.
[0073] In the embodiments of the present application, the mobile phone 100 represents the load condition of the mobile phone 100 by the intensity (or current value) of the working current. The target current value is a reference threshold of the load of the mobile phone 100. In some implementations, the target current value is pre-set.
[0074] In other implementations, the mobile phone 100 can determine the target current value according to an initial device temperature when the mobile phone 100 starts the first application and a preset temperature rise parameter. The preset temperature rise parameter is used to indicate the heat production capacity of the working current of the mobile phone 100. For example, the preset temperature rise parameter represents the current value (such as 1 mA, 2 mA, or the like) corresponding to the increase of 1 °C of the device temperature of the mobile phone 100. The unit of the preset temperature rise parameter can be milliamperes per degree Celsius (mA / °C).
[0075] For example, as shown in FIG. 6, the mobile phone 100 can determine the target current value according to the initial device temperature, the preset safe temperature, and the preset temperature rise parameter. Figure 7
[0076] The mobile phone 100 records the device temperature of the mobile phone 100 when starting the first application. The device temperature can be referred to as an initial device temperature. Further, the mobile phone 100 determines the target current value corresponding to the change of the initial device temperature to the preset safe temperature of the mobile phone 100 based on the preset temperature rise parameter. The preset safe temperature is pre-configured in the mobile phone 100. For example, the preset safe temperature can be set to a safety temperature (such as 48 °C). The target current value can be represented by the following formula 1:
[0077] Y = (A-B) × X Formula 1;
[0078] Wherein, Y represents the target current value, X represents the preset temperature rise parameter, B represents the initial device temperature, and A represents the preset safe temperature.
[0079] In the above implementation, the mobile phone 100 can determine the target current value by the initial device temperature when the first application is started and the preset temperature rise parameter, so as to take the target current value as the reference threshold of the load level. In different application scenarios, the initial device temperature when the mobile phone 100 starts the first application is different, and thus the target current value determined by the mobile phone 100 in different application scenarios is also different. It can be seen that the target current value provided by the embodiments of the present application changes with the running scenario of the first application, and the reference threshold of the load in different application scenarios can be better reflected.
[0080] In some implementations, the mobile phone 100 can perform frame rate control for an application with a higher load or a larger frame rate requirement. In this case, before determining the target current value, the mobile phone 100 can further determine whether the started first application is in the preset whitelist. If the first application is in the preset whitelist, it can be considered that the first application is an application that needs to perform frame rate control, and the mobile phone 100 performs the present step to determine the target current value. If the first application is not in the preset whitelist, it can be considered that the first application is an application that does not need to perform frame rate control, and the mobile phone 100 ends the current frame rate control process.
[0081] For example, the mobile phone 100 can determine whether the first application is in the preset whitelist by the following two ways:
[0082] The first way: the preset whitelist includes at least one application type identifier of an application type. For example, the preset whitelist includes at least one of the following application type identifiers: an application type identifier of a game application, an application type identifier of a video playing application, and an application type identifier of a call application. Of course, the preset whitelist can also include application type identifiers of other application types, and the application type identifiers in the preset whitelist can be configured as needed, which is not limited in the embodiments of the present application. The mobile phone 100 determines whether the first application belongs to any one of the application types indicated by the at least one application type identifier. If the first application belongs to any one of the application types indicated by the at least one application type identifier, it can be considered that the first application is in the preset whitelist. Otherwise, the first application is not in the preset whitelist.
[0083] The second mode: the preset white list includes application identifiers of at least one application. For example, the preset white list includes at least one of the following application identifiers: application identifiers of one or more game applications, application identifiers of one or more video playing applications, and application identifiers of one or more call applications. The application identifier can be an application name or an application number, and the embodiments of the present application do not limit this. Of course, the preset white list can also include other application identifiers, and the application identifiers in the preset white list can be configured as needed, and the embodiments of the present application do not limit this. The mobile phone 100 judges whether the application identifier of the first application is any one of the application identifiers in the preset white list. If the application identifier of the first application is an application identifier in the preset white list, it can be considered that the first application is in the preset white list. Otherwise, the first application is not in the preset white list.
[0084] The mobile phone 100 can periodically detect the working current. For example, the mobile phone 100 can detect the working current of the mobile phone 100 through the current sensor. The working current of the mobile phone 100 can reflect the load condition of the mobile phone 100. The working current of the mobile phone 100 is positively correlated with the load. For example, the greater the working current of the mobile phone 100, the greater the load of the mobile phone 100. The greater the working current of the mobile phone 100, the smaller the load of the mobile phone 100.
[0085] In some implementations, in order to improve the accuracy of the working current detection, the mobile phone 100 takes the average value of the working current detected within a certain time length as the current value of the working current. For example, as shown in FIG. 6, the mobile phone 100 calculates the average value of the collected working current within a certain time length by using a sliding window. The time length corresponding to the sliding window can be set according to actual application scenarios or requirements, for example, the time length corresponding to the sliding window can be set to 10 milliseconds or the like. Figure 7
[0086] After the mobile phone 100 determines the target current value, the intensity of the current working current (which can be denoted as a first current value) can be compared with the target current value to determine whether the first current value is greater than the target current value. The first current value is the current value of the working current of the mobile phone 100 in the first time period (the current time period), which is the latest detected current value of the working current of the mobile phone 100.
[0087] If the first current value of the mobile phone 100 is greater than the target current value, it indicates that the working current of the mobile phone 100 at this time is large, and at this time the mobile phone 100 is in a high load state. If the electronic device continues to run the first application at the current first frame rate, the device temperature of the mobile phone 100 will continue to rise, which may affect the performance of the mobile phone 100. In this case, the mobile phone 100 performs S603.
[0088] If the first current value of mobile phone 100 is less than or equal to the target current value, it indicates that the operating current of mobile phone 100 is low, and mobile phone 100 is in a low-load state. If the electronic device continues to run the first application at the current first frame rate, the device temperature of mobile phone 100 has little impact on the performance of mobile phone 100. In this case, mobile phone 100 repeats this step to monitor the load status of mobile phone 100 through its operating current.
[0089] S603, mobile phone 100 determines the power consumption per frame based on the first current value and the first frame rate.
[0090] If the initial current value of mobile phone 100 is greater than the target current value, then the load on mobile phone 100 is relatively large. Figure 7 As shown, mobile phone 100 determines the power consumption per frame based on the first current value and the first frame rate. Single-frame power consumption represents the current value corresponding to each frame of the image. For example, mobile phone 100 calculates the ratio of the first current value to the first frame rate to obtain the single-frame power consumption. The unit of single-frame power consumption is milliamperes per frame (mA / FPS).
[0091] It is understandable that since the operating current of the mobile phone 100 can reflect the load of the mobile phone 100, the mobile phone 100 can represent the load corresponding to each frame of the image, i.e., the power consumption of a single frame, by using the first current value and the current value corresponding to each frame of the image determined by the first frame rate.
[0092] S604, Mobile Phone 100 determines the temperature threshold based on single-frame power consumption, target current value, and preset constraint relationships.
[0093] Preset constraints are used to represent the correspondence between frame rate changes and temperature changes. For example, a preset constraint might be that for every 0.1°C change in device temperature, the frame rate is allowed to adjust by 1 FPS; that is, a 1 FPS change in frame rate corresponds to a 0.1°C change in temperature. Preset constraints can be set according to actual application scenarios or needs. Under the influence of preset constraints, the frame rate adjustment amplitude of the phone is limited, ensuring that each frame rate change is within a certain range, thereby reducing the impact of frame rate changes on the user experience.
[0094] In some implementations, such as Figure 7 As shown, mobile phone 100 can determine the target frame rate corresponding to the target current value based on the power consumption per frame. For example, the phone calculates the ratio of the target current value to the power consumption per frame to obtain the target frame rate corresponding to the target current value. Mobile phone 100 then determines the temperature threshold based on the frame rate interval between the target frame rate and the first frame rate, as well as preset constraints. For example, mobile phone 100 calculates the difference between the target frame rate and the first frame rate to determine the frame rate interval between the target frame rate and the first frame rate, and further calculates the temperature threshold based on the determined frame rate interval and preset constraints.
[0095] It can be understood that the heat generated by the working current needs to be accumulated for a certain period of time before it is reflected on the device temperature, and when the first current value of the mobile phone 100 is greater than the target current value, the device temperature of the mobile phone 100 has not reached the preset safety temperature corresponding to the target current value. In order to make the device temperature of the mobile phone 100 less than the preset safety temperature, it is necessary to adjust the frame rate in advance before the device temperature of the mobile phone 100 reaches the preset safety temperature, so as to control the device temperature of the mobile phone 100 below the preset safety temperature. Based on this, the mobile phone 100 calculates the temperature threshold when the first current value is greater than the target current value, so that the temperature threshold can be used as a judgment condition for starting to adjust the frame rate, so as to adjust the frame rate in advance before the device temperature reaches the preset safety temperature.
[0096] For example, the preset constraint relationship is that the frame rate change value 1FPS corresponds to the temperature change value 0.1℃. The mobile phone 100 can calculate the temperature threshold by the following formula 2:
[0097] Ts = A - 0.1 x Fr Formula 2;
[0098] Wherein, Ts represents the temperature threshold; A represents the preset safety temperature; Fr represents the frame rate interval between the target frame rate and the first frame rate. The frame rate interval Fr is equal to the difference between the first frame rate (such as F1) and the target frame rate (such as F2), that is, Fr = F1-F2. The target frame rate F2 is equal to the ratio of the target current (such as Y) to the single frame power consumption (such as W), that is, F2 = Y / W. The single frame power consumption W is equal to the ratio of the first current value (such as AI) to the first frame rate (such as F1), that is, W = AI / F1.
[0099] It can be understood that in order to make the device temperature of the mobile phone 100 less than or equal to the preset safety temperature, the working current of the mobile phone 100 needs to be less than or equal to the target current value Y corresponding to the preset safety temperature. Accordingly, the frame rate F of the mobile phone 100 needs to be less than or equal to Y / W. The target frame rate is the maximum value of the frame rate, and the target frame rate F2 is equal to Y / W.
[0100] The mobile phone 100 can calculate the temperature threshold by the above formula 2. The temperature threshold can be used as the starting temperature for the mobile phone 100 to adjust the frame rate, such as when the current first device temperature of the mobile phone 100 is greater than the temperature threshold, the mobile phone 100 starts to adjust the frame rate. In this way, the mobile phone 100 can determine the temperature threshold when the current working current is greater than the target current value, and use the temperature threshold as a judgment condition for starting to adjust the frame rate. In this way, the mobile phone 100 can adjust the frame rate in advance before the device temperature reaches the preset safety temperature, so that the frame rate adjustment is more timely and the possibility of excessive device temperature is reduced.
[0101] S605, the mobile phone 100 determines whether the first device temperature is greater than the temperature threshold.
[0102] As shown in Figure 7 The mobile phone 100 can periodically collect the temperature to detect the device temperature of the mobile phone 100. For example, the mobile phone 100 can detect the device temperature of the mobile phone 100 through a temperature sensor. The device temperature is used to represent the temperature of the mobile phone 100. The device temperature can be determined according to one or more of the shell temperature, the battery temperature, and the chip temperature. For example, the device temperature includes one or more of the shell temperature, the battery temperature, and the chip temperature. For another example, the device temperature is obtained by fusion calculation on the shell temperature and the battery temperature. For an example, the shell temperature can include one or more of the front shell temperature and the rear shell temperature.
[0103] The first device temperature is the device temperature detected by the mobile phone 100 at the current time, i.e., the latest device temperature obtained by the mobile phone 100. After determining the temperature threshold, the mobile phone 100 can compare the first device temperature of the mobile phone 100 at the current time with the temperature threshold to determine whether the first device temperature is greater than the temperature threshold.
[0104] If the first device temperature of the mobile phone 100 is greater than the temperature threshold, it indicates that the device temperature of the mobile phone 100 at the current time has reached the starting temperature of the frame rate adjustment. If the electronic device continues to run the first application at the current first frame rate, the device temperature of the mobile phone 100 will exceed the preset safety temperature, which will affect the performance of the mobile phone 100. In this case, the mobile phone 100 performs S606.
[0105] If the first device temperature of the mobile phone 100 is less than or equal to the temperature threshold, it indicates that the device temperature of the mobile phone 100 at the current time has not reached the starting temperature of the frame rate adjustment. If the electronic device continues to run the first application at the current first frame rate, the device temperature of the mobile phone 100 will not exceed the preset safety temperature, which has less impact on the performance of the mobile phone 100. In this case, the mobile phone 100 repeatedly performs the present step to monitor the device temperature of the mobile phone 100.
[0106] S606, the mobile phone 100 adjusts the frame rate from the first frame rate to the second frame rate according to the change rate of the working current.
[0107] Because the heat generated by the operating current of the mobile phone 100 accumulates to a certain level before being reflected in the device temperature, there is a lag between the device temperature and the operating current. The higher the operating current of the mobile phone 100, the more heat it generates, and the higher the device temperature. Therefore, the operating current and device temperature are positively correlated; the rate of change of the operating current reflects the rate of change of the device temperature. To improve the accuracy of frame rate adjustment, the mobile phone 100 can adjust the frame rate of the generated image frames by adjusting the rate of change of the operating current. For example, the greater the rate of change of the operating current, the greater the difference between the second frame rate and the first frame rate.
[0108] In some implementations, the rate of change of the operating current of the mobile phone 100 can be determined based on a first current value and a previous operating current value (which can be referred to as a third current value). For example, the mobile phone 100 periodically acquires the operating current value. The rate of change of the operating current is equal to the ratio of the difference between the first current value and the adjacent third current value to the current detection period. The current detection period is the time interval between acquiring two adjacent current values. For example, if the mobile phone 100 acquires a current value every 5 milliseconds, then the current detection period is 5 milliseconds.
[0109] To further improve the accuracy of frame rate adjustment of mobile phone 100, in some implementations, mobile phone 100 predicts a second current value of the operating current. This second current value is the current value corresponding to a second time period after the device temperature of mobile phone 100 in the first time period. The first current value is the most recently detected current value by mobile phone 100 (for the first time period), and the second current value is the predicted operating current value by mobile phone 100 in the future (corresponding to the second time period). For example, mobile phone 100 can predict the second current value of the operating current based on the trend of operating current changes. Furthermore, mobile phone 100 determines the rate of change of the operating current based on the second current value and the first current value. For example, the rate of change of the operating current is equal to the ratio of the difference between the second current value and the first current value to the current detection period.
[0110] For example, such as Figure 7 As shown, the mobile phone 100 can predict the second current value (i.e., predict the future device temperature) using a preset current prediction model. The mobile phone 100 acquires multiple third current values prior to the first time period in chronological order of time periods (i.e., multiple second time periods). Furthermore, the mobile phone 100 uses the preset current prediction model to predict the second current value based on the first current value and the multiple third current values.
[0111] A preset current prediction model can establish the trend of operating current changes based on a first current value and multiple third current values, thereby predicting the second current value. The preset current prediction model can be selected according to the actual application scenario or requirements. The preset current prediction model can be a machine learning model, such as an autoregressive model. The preset current prediction model can be based on the following formula...
[0112] Equation 3 is used to express this:
[0113]
[0114] Among them, I t+1 It is the predicted second current value; I t It is the first current value corresponding to the first time period; I t-1 I t-2 ... I t-p These are the third current values obtained sequentially according to time periods (i.e., multiple second time periods); These are all model parameters of the preset current prediction model; c is a preset common sense term; ε t It is a random error term.
[0115] When predicting the second current value using a preset current prediction model, the mobile phone 100 can input the first current value and multiple acquired third current values into the preset current prediction model to obtain the predicted second current value.
[0116] The aforementioned preset current prediction model is obtained by training an autoregressive model. For example, mobile phone 100 inputs sample current values collected continuously from multiple first historical time periods into the autoregressive model, and uses the autoregressive model to output the predicted current value for a second historical time period. The second historical time period is the time period following the first historical time period. Further, mobile phone 100 calculates the residual between the actual detected current value (which can be called the actual observed value) and the predicted current value in the second historical time period. Mobile phone 100 uses the least squares method to minimize the random error term in the autoregressive model, minimizing the sum of the residuals from multiple calculations, thereby determining the model parameters of the autoregressive model and obtaining the trained autoregressive model. The trained autoregressive model is the preset current prediction model.
[0117] By using a preset current prediction model, the mobile phone 100 can predict the current value at time t+1 based on multiple current values acquired over a period of time. Furthermore, as... Figure 7 As shown, the mobile phone 100 determines the rate of change of the operating current by predicting the current value. The rate of change of the operating current can be expressed by the following formula 4:
[0118] vi = (I t+1 -I t) / Δt Formula 4;
[0119] wherein, vi is the rate of change of the operating current; I t+1 is the predicted second current value; I t is the first current value corresponding to the first time period; and Δt is the unit time, i.e., the current detection period of the operating current.
[0120] In some implementations, as shown in FIG. 1, the mobile phone 100 determines the frame rate adjustment amplitude value according to the rate of change of the operating current, and adjusts the frame rate from the first frame rate to the second frame rate according to the frame rate adjustment amplitude value. Figure 8
[0121] For example, since the device temperature has a hysteresis, the device temperature can be reflected by the operating current. The mobile phone 100 determines the rate of change of the device temperature according to the corresponding relationship between the operating current and the device temperature, such as the preset temperature rise parameter. The rate of change of the device temperature can be represented by the following Formula 5:
[0122] ΔTemp = (I t+1 - I t ) / Δt / X Formula 5;
[0123] wherein, ΔTemp is the rate of change of the device temperature; I t+1 is the second current value; I t is the first current value; Δt is the unit time, i.e., the current detection period of the operating current; and X is the preset temperature rise parameter.
[0124] Further, the mobile phone 100 determines the frame rate adjustment amplitude value according to the rate of change of the device temperature. The frame rate adjustment amplitude value is the change value of the frame rate. The frame rate adjustment amplitude value can be determined by the following Formula 6:
[0125] V_FPSv = (ΔTemp - a) x |ΔTemp - 0.1| x scal1 Formula 6;
[0126] wherein, V_FPSv is the frame rate adjustment amplitude value determined based on the rate of change of the device temperature; ΔTemp is the rate of change of the device temperature; a is used to indicate the error value of the temperature change value, for example, a = 0.1. And scal1 is the first preset constant.
[0127] After determining the frame rate adjustment amplitude value, the mobile phone 100 adjusts the frame rate from the first frame rate to the second frame rate based on the first frame rate and the frame rate adjustment amplitude value. For example, the second frame rate is equal to the difference between the first frame rate and the frame rate adjustment amplitude value. For another example, the frame rate adjustment amplitude value has a positive or negative value, and the second frame rate is equal to the sum of the first frame rate and the frame rate adjustment amplitude value.
[0128] In some implementations, the current device temperature can also be used as a reference factor for the frame rate adjustment amplitude. The mobile phone 100 can determine a first adjustment amplitude according to a first device temperature of the mobile phone 100, and determine a second adjustment amplitude according to a change rate of the operating current of the mobile phone 100. The frame rate adjustment amplitude is further determined according to the first adjustment amplitude and the second adjustment amplitude. In this way, the mobile phone 100 can determine the frame rate adjustment amplitude by comprehensively considering the current device temperature and the change rate of the operating current on the frame rate, and improve the accuracy of the frame rate adjustment amplitude.
[0129] For example, the device temperature has a hysteresis, so the device temperature can be predicted by the operating current. The mobile phone 100 can predict a second device temperature of the mobile phone 100 according to a first device temperature of the mobile phone 100 and a change rate of the operating current. The first device temperature is the device temperature of the mobile phone 100 in a first time period (actual observation value). The second device temperature is the device temperature of the mobile phone 100 in a second time period (predicted observation value). The second device temperature can be represented by the following formula 7:
[0130] Temp t+1 = Temp t + ΔTemp Formula 7
[0131] wherein Temp t+1 is the second device temperature; Temp t is the first device temperature; and ΔTemp is the change rate of the device temperature.
[0132] Further, the mobile phone 100 determines a first adjustment amplitude according to the second device temperature, and determines a second adjustment amplitude according to the change rate of the operating current. The first adjustment amplitude can be determined by the following formula 8:
[0133] V_FPS T = (tan(Temp normal ) - Temp normal ) × scal2 Formula 8
[0134] wherein V_FPS T is the first adjustment amplitude determined based on the device temperature; Temp normal is a normalized temperature, which is determined according to the second device temperature and an intermediate temperature, such as the difference between the second device temperature and the intermediate temperature. The intermediate temperature is the value of the normalized temperature when V_FPS T is 0; and scal2 is a second preset constant.
[0135] The second adjustment amplitude can be determined by the above formula 6, which will not be repeated here. After determining the first adjustment amplitude and the second adjustment amplitude, the mobile phone 100 can weight the first adjustment amplitude and the second adjustment amplitude to obtain a final frame rate adjustment amplitude. For example, the frame rate adjustment amplitude can be determined by the following formula 9 according to the first adjustment amplitude and the second adjustment amplitude:
[0136]
[0137] Wherein, V_FPS is the frame rate adjustment amplitude; is the first adjustment amplitude; V_FPSv is the second adjustment amplitude; k is the first preset weight parameter, such as 0.5; l is the second preset weight parameter, such as 0.5; normalFps is the pre-set frame rate change minimum unit, such as 1 FPS.
[0138] Through the above various implementation manners, the device temperature and the change trend of the device temperature can be predicted through the working current, so that the timeliness of the frame rate adjustment can be improved, and the frame rate adjustment can be more accurate.
[0139] It can be understood that the mobile phone 100 can repeatedly execute the above S606 until the first device temperature of the mobile phone 100 is less than the temperature threshold, or until the frame rate of the mobile phone 100 becomes the target frame rate. The adjustment period of the frame rate can be consistent with the current detection period of the working current. For example, the mobile phone 100 adjusts the frame rate once every 10 milliseconds according to the change rate of the working current.
[0140] The working process of the software module of the mobile phone 100 will be described below in combination with the game scenario. The software structure of the mobile phone 100 can refer to the layered architecture of the Android system described above. Please refer to Figure 4 , the application program layer of the mobile phone 100 includes a game application, the application program framework layer includes a frame rate adjustment interface, the local service layer includes a frame rate balancing module, a current module and a temperature module, the hardware abstraction layer includes a sensor interface and a frame rate adjustment interface, and the kernel layer includes a driver. The above frame rate smoothing module of the mobile phone 100 includes a data detection submodule, a temperature calculation submodule, a frame rate calculation submodule and a frame rate adjustment submodule.
[0141] For example, after the game application in the mobile phone 100 is started, the frame rate adjustment interface of the mobile phone 100 notifies the frame rate smoothing module to perform the frame rate adjustment task, and the frame rate smoothing module starts to work. The data detection submodule in the frame rate smoothing module obtains the current value of the working current through the current module, and obtains the temperature value of the device temperature through the temperature module, and records the initial device temperature when the game application is started. Wherein, the current module and the temperature module can obtain the current value and the temperature value transmitted by the kernel layer through the sensor interface.
[0142] The data detection submodule transmits the current value of the working current and the temperature value of the device temperature to the temperature calculation submodule. When the current value of the working current is greater than the target current value, the temperature calculation submodule calculates a target frame rate corresponding to a preset safe temperature according to the single-frame power consumption. The temperature calculation submodule further determines a temperature threshold according to the target frame rate and a preset constraint relationship. The temperature calculation submodule transmits the temperature threshold to the frame rate calculation submodule. The frame rate calculation submodule predicts the change rate of the future device temperature by using a preset current prediction model and the current value of the working current. The frame rate calculation submodule calculates a frame rate adjustment amplitude according to the change rate of the device temperature, and transmits the frame rate adjustment amplitude to the frame rate adjustment submodule.
[0143] The frame rate adjustment submodule determines a second frame rate according to the frame rate adjustment amplitude and the current first frame rate, and notifies the frame rate adjustment interface of the determined second frame rate. The frame rate adjustment interface notifies the kernel layer to schedule resources according to the second frame rate, such as adjusting the frame rate of the GPU for generating images by the second frame rate, setting the refresh frequency of the screen by the second frame rate, and the like.
[0144] The method provided by the embodiments of the present application can set the temperature threshold of frame rate adjustment for different application scenarios, so that the frame rate control strategy is adapted to the application scenario. In addition, the frame rate can be adjusted through the change rate of the working current, so that the frame rate can be controlled in time, the frame rate control is more accurate, and the hysteresis of frame rate adjustment is reduced.
[0145] In some other embodiments of the present application, an electronic device is also provided, which includes a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, the electronic device can perform each function or step in the above method embodiments. Of course, the electronic device can also include other hardware structures. For example, the electronic device can also include a sensor, a communication module, and other hardware structures. The structure of the electronic device can refer to the structure of the mobile phone 100 shown in
[0146] The embodiments of the present application also provide a chip system applied to an electronic device. The chip system includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected through a line. For example, the interface circuit can be used to receive signals from other devices (such as a memory). For another example, the interface circuit can be used to send signals to other devices (such as a processor). Illustratively, the interface circuit can read the computer instructions (or computer programs) stored in the memory, and send the computer instructions to the processor. When the computer instructions are executed by the processor, the electronic device can perform each step in the above embodiments. Of course, the chip system can also include other discrete devices, which are not limited in the embodiments of the present application.
[0147] The embodiment of the present application further provides a computer readable storage medium, which comprises a computer program, and when the computer program is run on the electronic device, the electronic device is caused to execute each function or step in the method embodiment.
[0148] The embodiment of the present application further provides a computer program product, which comprises a computer program, and when the computer program is run on a computer, the computer is caused to execute each function or step in the method embodiment. For example, the computer can be the electronic device.
[0149] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0150] In several embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented by other ways. For example, the device embodiment described above is only illustrative, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division way, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0151] The units described as separate components can or can not be physically separated, and the components shown as units can be one physical unit or multiple physical units, that is, can be located in one place, or can be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0152] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0153] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The software product is stored in a storage medium, includes a plurality of instructions to make a device (which can be a single-chip microcomputer, a chip, etc.) or a processor execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0154] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any change or replacement within the technical scope disclosed in the present application should be covered within the protection scope of the present application.
Claims
1. A frame rate adjustment method, characterized by, The method is applied to an electronic device, and the method comprises: In a process of running a first application at a first frame rate, if a first current value of the electronic device is greater than a target current value, a single-frame power consumption of the electronic device is determined according to the first current value and the first frame rate, wherein the single-frame power consumption represents a current value corresponding to each frame of image generated by the electronic device, and the first current value is a current value of a working current of the electronic device in a first time period; A temperature threshold is determined according to the single-frame power consumption of the electronic device, the target current value, and a preset constraint relationship, wherein the preset constraint relationship is used to represent a corresponding relationship between a frame rate change value and a temperature change value; If a first device temperature of the electronic device reaches the temperature threshold, a frame rate of the electronic device is adjusted from the first frame rate to a second frame rate according to a change rate of the working current of the electronic device, wherein the second frame rate is less than a target frame rate, and the target frame rate is determined according to the single-frame power consumption and the target current value.
2. The method of claim 1, wherein, Before the temperature threshold is determined according to the single-frame power consumption of the electronic device, the target current value, and the preset constraint relationship, the method further comprises: An initial device temperature of the electronic device is obtained, wherein the initial device temperature is a device temperature when the first application is started by the electronic device; A target current value corresponding to a change from the initial device temperature to a preset safe temperature is determined based on a preset temperature rise parameter, wherein the preset temperature rise parameter is used to indicate a heat generation capability of the working current of the electronic device.
3. The method according to claim 1 or 2, characterized in that, The temperature threshold is determined according to the single-frame power consumption of the electronic device, the target current value, and the preset constraint relationship, comprising: A target frame rate corresponding to the target current value is determined according to the single-frame power consumption; A frame rate interval between the target frame rate and the first frame rate is determined; The temperature threshold is determined according to the frame rate interval and the preset constraint relationship.
4. The method according to claim 1 or 2, characterized in that, The frame rate of the electronic device is adjusted from the first frame rate to the second frame rate according to the change rate of the working current of the electronic device, comprising: A frame rate adjustment amplitude value is determined according to the change rate of the working current of the electronic device; The frame rate of the electronic device is adjusted from the first frame rate to the second frame rate according to the frame rate adjustment amplitude value.
5. The method of claim 4, wherein, The frame rate adjustment amplitude value is determined according to the change rate of the working current of the electronic device, comprising: The frame rate adjustment amplitude value is determined according to the first device temperature of the electronic device and the change rate of the working current.
6. The method of claim 5, wherein, The frame rate adjustment amplitude value is determined according to the first device temperature of the electronic device and the change rate of the working current, comprising: A first adjustment amplitude value is determined according to the first device temperature of the electronic device; A second adjustment amplitude value is determined according to the change rate of the working current of the electronic device; The frame rate adjustment amplitude value is determined according to the first adjustment amplitude value and the second adjustment amplitude value.
7. The method of claim 6, wherein, The first adjustment amplitude value is determined according to the first device temperature of the electronic device, comprising: A second device temperature of the electronic device is predicted according to the first device temperature of the electronic device and the change rate of the working current. determining a first adjustment amplitude according to the second device temperature.
8. The method according to claim 6 or 7, characterized in that, The determining the second adjustment amplitude according to the change rate of the working current of the electronic device comprises: predicting a change rate of a device temperature of the electronic device according to the change rate of the working current of the electronic device; determining the second adjustment amplitude according to the change rate of the device temperature.
9. The method of claim 1 or 2, wherein, The method further comprises: predicting a second current value of the electronic device according to the first current value, the second current value being a current value of the working current of the electronic device after the first time period; determining the change rate of the working current of the electronic device according to the second current value of the electronic device and the first current value.
10. An electronic device, comprising: An electronic device comprising a memory, a processor and a computer program stored in the memory, wherein the computer program, when executed by the processor, causes the electronic device to perform the method of any one of claims 1-9.
11. A computer readable storage medium, characterized in that, A computer program stored in a memory, wherein the computer program, when executed by an electronic device, causes the electronic device to perform the method of any one of claims 1-9.
12. A computer program product, characterised in that, A computer program, wherein the computer program, when executed by an electronic device, causes the electronic device to perform the method of any one of claims 1-9.
Citation Information
Patent Citations
Picture frame rate adjusting method, electronic device and computer readable storage medium
CN114510209A
Application frame rate smoothing method, electronic equipment and storage medium
CN116680153A