Frame rate adjusting method and electronic equipment
By dynamically adjusting frame rates based on working current changes, the method addresses instability and inaccuracy in existing frame rate control, enhancing stability and reducing power consumption for improved user experience.
Patent Information
- Application Number
- CN202410236368.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-02-29
AI Technical Summary
Existing frame rate adjustment schemes in electronic devices suffer from instability and low accuracy, leading to fluctuations and hysteresis, which degrade user experience and inefficient power consumption.
A method that dynamically adjusts the frame rate by changing the working current of the electronic device, using the current load condition to determine a temperature threshold and frame rate adjustments based on the rate of change of the working current, allowing for precise control and reduced lag.
This approach enhances frame rate stability and accuracy, reducing power consumption and temperature fluctuations, thereby improving user experience and performance in various application scenarios.
Smart Images

Figure CN119248080A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a frame rate adjustment method and an electronic device. Background Art
[0002] In order to provide users with a better user experience, the frame rate and image quality of electronic equipment are constantly improving. Especially in some scenarios that require greater picture smoothness, such as video playback, games, etc., electronic devices usually use a higher frame rate to display the picture to reduce the situation of picture freezes. However, as the frame rate of electronic devices increases, the power consumption of electronic devices also increases, and the device temperature of electronic devices also increases. In order to reduce the impact of the device temperature of electronic devices on the operating state of electronic devices, when the device temperature of electronic devices reaches a certain temperature threshold, the electronic devices reduce the frame rate of the electronic devices.
[0003] However, the frame rate adjustment scheme currently used in electronic devices is prone to frame rate fluctuations and has low stability. Summary of the invention
[0004] The present application provides a frame rate adjustment method and an electronic device, which are used to dynamically adjust the frame rate by changing the working current of the electronic device, so as to make the frame rate control more accurate.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a frame rate adjustment method is provided, the method comprising: in the process of running a first application at a first frame rate, if a first current value of an electronic device is greater than a target current value, determining a temperature threshold value according to a single-frame power consumption of the electronic device, a target current value, and a preset constraint relationship, the first current value being the current value of the working current of the electronic device in a first time period, the single-frame power consumption representing the current value corresponding to each frame of an image generated by the electronic device, and the preset constraint relationship being used to represent the correspondence between a frame rate change value and a temperature change value. When 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 the second frame rate according to the rate of change 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. When the load is large, the temperature threshold for frame rate adjustment is dynamically determined by the current single-frame power consumption. This temperature threshold can be used as the starting temperature for the frame rate to start adjusting. 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 for different application scenarios. In addition, the electronic device adjusts the frame rate through the rate of change of the working current, which can control the frame rate more timely, make the frame rate control more accurate, and reduce the lag of the frame rate adjustment.
[0008] In a possible implementation of the first aspect, the method further includes: obtaining an initial device temperature of the electronic device, the initial device temperature being the device temperature when the electronic device starts the first application. Based on a preset temperature rise parameter, determining a target current value corresponding to a preset safety temperature from the initial device temperature, the preset temperature rise parameter being used to indicate a heat generation capacity of an operating current of the electronic device.
[0009] In this implementation, the target current value can be dynamically 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 for the load of the electronic device. The target current value changes with the running scenario of the first application, which can better reflect the reference threshold of the load in different application scenarios.
[0010] In another possible implementation of the first aspect, the 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 may be equal to the ratio of the first current value to the first frame rate. In this implementation, the single-frame power consumption is determined by the current current value of the working current (i.e., the first current value) and the current frame rate (i.e., the first frame rate), which can better reflect the relationship between the working current and the frame rate.
[0011] In another possible implementation of the first aspect, based on the single-frame power consumption, the target frame rate corresponding to the target current value is determined, the frame rate interval between the target frame rate and the first frame rate is determined, and the temperature threshold is determined based on the frame rate interval and the preset constraint relationship. In this implementation, in order to make the device temperature less than or equal to the preset safety temperature, the operating current needs to be less than or equal to the target current value corresponding to the preset safety temperature. The relationship between the operating 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 of the first aspect, a frame rate adjustment amplitude is determined according to a rate of change of an operating current of the electronic device, and the frame rate of the electronic device is adjusted from a first frame rate to a second frame rate according to the frame rate adjustment amplitude. In this implementation, the rate of change of the operating current can reflect the rate of change of the device temperature. The frame rate adjustment amplitude determined by the electronic device through the rate of change of the operating current is more accurate, so that the frame rate adjustment is more timely.
[0013] In another possible implementation of the first aspect, the frame rate adjustment amplitude is determined according to the first device temperature of the electronic device and the rate of change of the operating current. In this implementation, 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 comprehensively consider the impact of the current device temperature and the rate of change of the operating current on the frame rate, determine the frame rate adjustment amplitude, and improve the accuracy of the frame rate adjustment amplitude.
[0014] In another possible implementation of the first aspect, a first adjustment amplitude is determined according to a first device temperature of the electronic device; a second adjustment amplitude is determined according to a rate of change of an operating current of the electronic device; and a frame rate adjustment amplitude is determined according to the first adjustment amplitude and the second adjustment amplitude. In this implementation, the first adjustment amplitude is a frame rate adjustment amplitude provided by the device temperature. The second adjustment amplitude is a frame rate change value provided by the rate of change of the operating current. The electronic device determines a final frame rate adjustment amplitude by combining these two frame rate adjustment amplitudes, which can further improve the accuracy of the frame rate adjustment amplitude.
[0015] In another possible implementation of the first aspect, a second device temperature of the electronic device is predicted based on the first device temperature of the electronic device and the rate of change of the operating current; and a first adjustment amplitude is further determined based on the second device temperature. In this implementation, 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 another possible implementation of the first aspect, the rate of change of the device temperature of the electronic device is predicted according to the rate of change of the working current of the electronic device; and the second adjustment amplitude is determined according to the rate of change of the device temperature. In this implementation, the rate of change of the device temperature is predicted by the rate of change of the working current, and the second adjustment amplitude is further determined by the predicted rate of change of the device temperature, which can reduce the influence of the hysteresis of the device temperature and make the determined second adjustment amplitude more accurate.
[0017] In another possible implementation of the first aspect, the method further includes: predicting a second current value of the electronic device based on the first current value, the second current value being the current value of the working current of the electronic device after the first time period; and determining a rate of change of the working current of the electronic device based on the second current value and the first current value of the electronic device. In this implementation, the electronic device can predict the future current value (i.e., the second current value) of the working current through the current current value (i.e., the first current value) of the working current, which can further improve the accuracy of the frame rate adjustment.
[0018] In a second aspect, the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory. When the processor runs the computer program, the electronic device executes the method described in the first aspect and any possible implementation thereof.
[0019] In a third aspect, the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by an electronic device, the electronic device executes the method described in the first aspect and any possible implementation thereof.
[0020] In a fourth aspect, the present application provides a computer program product including program instructions, including a computer program, which, when executed by an electronic device, enables the computer to execute the method described in the first aspect and any possible implementation thereof. For example, the computer may be the electronic device described above.
[0021] In a fifth aspect, the present application provides a chip system, which is applied to an electronic device. The chip system includes an interface circuit and a processor. The interface circuit and the processor are interconnected by a line. The interface circuit is used to receive a signal from a memory and send a signal to the processor, the signal including a computer instruction stored in the memory. When the processor executes the computer instruction, the electronic device executes the method described in the first aspect and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a frame rate change provided in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of frame rate and device temperature changes provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of an interface for different application scenarios provided in an embodiment of the present application;
[0025] Figure 4 A hardware structure block diagram of a mobile phone 100, an example of an electronic device provided in an embodiment of the present application;
[0026] Figure 5 A software structure block diagram of a mobile phone 100, an example of an electronic device provided in an embodiment of the present application;
[0027] Figure 6 A flowchart of a frame rate adjustment method provided in an embodiment of the present application;
[0028] Figure 7 A flowchart of another frame rate adjustment method provided in an embodiment of the present application;
[0029] Figure 8A schematic diagram of the software module interaction of a frame rate adjustment method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The frame rate of an electronic device indicates the frequency at which the electronic device generates image frames, that is, the number of image frames generated by the electronic device per unit time. The unit of frame rate is frames per second (FPS). The higher the frame rate of an electronic device, the more image frames the electronic device generates per second, and the more image frames the electronic device refreshes and displays on the screen per second. As the frame rate increases, the dynamic images displayed on the screen of the electronic device become more coherent.
[0031] As described above, the higher the frame rate of the electronic device, the greater the power consumption of the electronic device, and accordingly, the device temperature of the electronic device also increases. In order to reduce the impact of the device temperature of the electronic device on the operating state of the electronic device, the electronic device is configured with a frame rate control strategy.
[0032] In one example, if Figure 1 As shown, if the electronic device detects that the device temperature is greater than the preset safety temperature (such as 45°C), the frame rate of the electronic device is adjusted from the current first frame rate (such as 60FPS) to a lower second frame rate (such as 45FPS). After the frame rate of the electronic device decreases, the load and power consumption of the electronic device decrease, and the device temperature of the electronic device also decreases accordingly. If the device temperature drops to less than the preset safety temperature, the electronic device will adjust the application frame rate from the second frame rate (such as 45FPS) back to the first frame rate (such as 60FPS), and so on. However, this frame rate control strategy is prone to a sharp rise and fall in frame rate, such as the frame rate of the electronic device suddenly changes from the first frame rate to the second frame rate, or the frame rate of the electronic device suddenly changes from the second frame rate to the first frame rate. It can be seen that this frame rate control strategy results in low frame rate stability, and sudden changes in frame rate will cause the user experience to deteriorate.
[0033] In another example, in order to improve the stability of the frame rate, the electronic device can gradually adjust the frame rate of the electronic device. For example, when the device temperature of the electronic device is greater than the preset safety temperature, the electronic device gradually adjusts the frame rate from the first frame rate to the second frame rate. When the device temperature of the electronic device is less than the preset safety temperature, the electronic device gradually adjusts the frame rate from the second frame rate to the first frame rate. However, this frame rate adjustment strategy of slowly adjusting the frame rate has hysteresis. Figure 2As shown, when the device temperature of the electronic device reaches the preset safety temperature (such as 45°C), the electronic device gradually reduces the frame rate. When the device temperature of the electronic device no longer increases as the frame rate decreases, the frame rate of the electronic device is still slowly decreasing (even if the frame rate of the electronic device no longer decreases, the device temperature of the electronic device will not continue to increase). Since the device temperature has a lag, the adjustment of the frame rate also has a lag. It can be seen that this frame rate control strategy is not accurate enough.
[0034] In addition, electronic devices have a variety of application scenarios, such as single game scenarios of WIFI communication, game and video playback scenarios of WIFI communication, single game scenarios of mobile communication (such as 4G, 5G), and game and video playback scenarios of mobile communication. Figure 3 As shown in (1), in a 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. Figure 3 As shown in (2), in the game and video playback scenario of WIFI communication, the electronic device transmits the data of the game application and the video application through WIFI communication, and a window of the video application is also displayed on the interface of the displayed game application. In the above-mentioned multiple frame rate control strategies, the electronic device uses the same frame rate adjustment method in different application scenarios, which may lead to problems such as impaired performance or excessive power consumption in some application scenarios.
[0035] In an implementation method provided in an embodiment of the present application, the electronic device periodically obtains the working current value of the electronic device during the process of running the first application at a certain frame rate. If the working current value of the electronic device reaches the 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 at this time. 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 the temperature threshold for frame rate adjustment based on the single-frame power consumption of the electronic device, the target current value, and the preset constraint relationship. Furthermore, when 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 rate of change 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. When the load is large, the temperature threshold for frame rate adjustment is dynamically determined by the current single-frame power consumption. 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 for different application scenarios. In addition, the electronic device adjusts the frame rate through the rate of change of the working current, and can control the frame rate in time, making the frame rate control more accurate, reducing the lag of the frame rate adjustment, realizing dynamic adjustment of the frame rate, and improving the accuracy of the frame rate adjustment.
[0037] For example, the electronic device described in the embodiments of the present application may 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, etc. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.
[0038] In the embodiment of the present application, the electronic device is a mobile phone 100 as an example, and the hardware structure of the electronic device is introduced through the mobile phone 100. Figure 4 As shown, the mobile phone 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0039] Among them, the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), a driver processor, etc. Among them, 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 an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0040] In some implementations, the processor 110 may be a multi-core processor. The multi-core processor is divided into multiple clusters, each cluster including one or more cores. For example, the multiple processors may include three 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 processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0042] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0043] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 can execute instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area. The internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0044] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the mobile phone 100 through the power management module 141.
[0045] The wireless communication function of the mobile phone 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor. In some embodiments, the antenna 1 of the mobile phone 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, 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 solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0047] The wireless communication module 160 can provide wireless communication solutions for application in the mobile phone 100, including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0048] The mobile phone 100 can transmit application data through the mobile communication module 150 or the wireless communication model 160. For example, the mobile phone 100 performs Wi-Fi communication through the Wi-Fi network provided by the wireless communication model 160 to transmit the data of the game application.
[0049] The mobile phone 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0050] The sensor module 180 may include sensors such as a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a Hall sensor, a touch sensor, an ambient light sensor, and a temperature sensor. The mobile phone 100 may 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 uses the device temperature detected by the temperature sensor to execute a temperature processing strategy. For example, when the device temperature reported by the temperature sensor exceeds a threshold, the mobile phone 100 reduces the performance of the processor located near the temperature sensor, such as reducing the frame rate of interface image generation, so as to reduce power consumption and implement thermal protection. In other embodiments, when the device temperature is lower than another threshold, the mobile phone 100 heats the battery 142 to avoid abnormal shutdown of the mobile phone 100 due to low temperature. In some other embodiments, when the device temperature is lower than another threshold, the mobile phone 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
[0052] The Hall sensor can be used to detect the working current. Based on the Hall effect, the Hall sensor can measure the intensity (also called the current value or current magnitude) and direction of the working current. The Hall sensor can also be called a current sensor. In some embodiments, since the device temperature of the mobile phone 100 is volatile, the mobile phone 100 uses the working current that can be detected by the Hall sensor to predict the device temperature of the mobile phone 100. Alternatively, the mobile phone 100 uses the working current detected by the Hall sensor to characterize the load condition of the mobile phone 100. For example, when the working current of the mobile phone 100 is greater than the 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 the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0054] The display screen 194 is used to display images, videos, etc. 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), MiniLED, MicroLED, Micro-OLED, a quantum dot light-emitting diode (QLED), etc.
[0055] In some implementations, the touch sensor may be disposed in the display screen 194, and the touch sensor and the display panel may form a touch screen, also known as a "touch screen". The touch sensor, also known as a "touch panel", is used to detect touch operations on or near it, such as click operations, sliding operations, etc. The touch sensor may transmit the detected touch operations to the application processor to determine the type of touch event. The mobile phone 100 may provide visual output related to the touch operation through the display screen 194.
[0056] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments, the electronic device may also include more or fewer modules than those provided in the above embodiments, and different interface connection methods in the above embodiments may be used between the modules, or a combination of multiple interface connection methods. 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 all be implemented in an electronic device having the above hardware structure.
[0057] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture or a cloud architecture. Taking the layered architecture of the Android system as an example, the software structure of the electronic device is exemplified.
[0058] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system may 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 may include a series of application packages. For example, the application package may include games, cameras, gallery, calendar, calls, maps, navigation, WLAN, Bluetooth, music, video, short messages and other applications (hereinafter referred to as applications), and the present application embodiment does not impose any restrictions on this.
[0060] The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager, etc., and the embodiments of the present application do not impose any restrictions on this. The application framework layer may also include a frame rate adjustment interface. The frame rate adjustment interface is used to call the frame rate smoothing module in the local service layer.
[0061] The local service layer mainly includes some local services and system libraries. The local service layer can provide feature support for the Android system through some C / C++ libraries. The system library can include multiple functional modules. For example: surface manager, media library, 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc. In addition, the local service layer also includes Android Runtime. Android Runtime includes core library and virtual machine. Android Runtime is responsible for scheduling and management of Android system. The core library contains two parts: one part is the function function that needs to be called by Java language, and the other part is the core library of Android. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
[0062] In some implementations, the local service layer includes a temperature module, a current module, and a frame rate smoothing (FrameRateSmooth, FRS) module. The temperature module is used to obtain the temperature value of the device temperature of the mobile phone 100. The current module is used to obtain the current value of the working current of the mobile phone 100. The frame rate smoothing module can determine the frame rate adjustment amplitude according to the current value of the working current, the temperature value of the device temperature, and the current frame rate, and further adjust the frame rate by the determined frame rate adjustment amplitude to achieve frame rate control.
[0063] The HAL layer encapsulates the Linux kernel driver, provides an interface to the upper layer, and shields the implementation details of the underlying hardware. For example, the HAL layer may include the camera HAL, Wi-Fi HAL, Bluetooth HAL, frame rate scheduling interface, sensor HAL (or sensor interface), etc.
[0064] The kernel layer is the layer between hardware and software. The kernel layer includes drivers and system service programs. Drivers include at least display drivers, camera drivers, audio drivers, sensor drivers, etc.
[0065] In the embodiment of the present application, the electronic device is the mobile phone 100, and the software system of the mobile phone 100 adopts the layered architecture of the Android system. Figure 5 The workflow of the software module of the mobile phone 100 is illustrated by way of example.
[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 the frame rate adjustment task. The frame rate smoothing module obtains the current value of the working current through the current module. When the current value of the working current is greater than the target current value, the frame rate smoothing module determines the temperature threshold value based on the current value of the working current and the current frame rate. The frame rate smoothing module can also obtain the temperature value of the device temperature through the temperature module. When the temperature value of the device temperature reaches the temperature threshold, the frame rate smoothing module determines the rate of change of the working current, further determines the frame rate adjustment amplitude based on the rate of change of the working current, and adjusts the frame rate based on the frame rate adjustment amplitude. Furthermore, 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 image frames at the adjusted frame rate. In this way, the mobile phone 100 can achieve frame rate adjustment.
[0067] The frame rate adjustment strategy provided in the embodiment of the present application can be applied to the operation scenarios of some applications with heavy loads. For example, the operation scenarios of applications with high frame rate requirements such as game applications and video applications. Of course, the frame rate adjustment strategy provided in the embodiment of the present application can also be applied to other application scenarios.
[0068] The following takes the electronic device as a mobile phone 100 as an example. Figure 6 and Figure 7 The method provided in the embodiment of the present application is introduced. Figure 6 As shown, the method provided in the embodiment 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 of the mobile phone 100. For example, the first application is a game application, a video application, a chat application, and the like. The mobile phone 100 starts the first application and draws the interface of the first application at a first frame rate. The first frame rate is a frame rate gear adopted by the mobile phone 100 in the current first time period. For example, the first frame rate is 60FPS, 90FPS, and the like.
[0071] In some implementations, the mobile phone 100 starts the first application in response to a user operation. For example, the desktop of the mobile phone 100 includes an application icon of the first application. The mobile phone 100 receives a user operation of a user clicking the application icon of the first application. In response to the user operation, the mobile phone 100 starts the first application and runs the first application at a first frame rate.
[0072] S602: The mobile phone 100 determines whether the current first current value is greater than the target current value.
[0073] In the embodiment of the present application, the mobile phone 100 characterizes the load condition of the mobile phone 100 by the intensity (or current value) of the working current. The target current value serves as a reference threshold of the load of the mobile phone 100. In some implementations, the target current value is preset.
[0074] In other implementations, the mobile phone 100 may determine the target current value based on the initial device temperature when the mobile phone 100 starts the first application and the preset temperature rise parameter. The preset temperature rise parameter is used to indicate the heat generation capacity of the working current of the mobile phone 100. For example, the preset temperature rise parameter represents the current value corresponding to each 1°C increase in the device temperature of the mobile phone 100 (such as 1 mA, 2 mA, etc.). The unit of the preset temperature rise parameter may be milliamperes per degree Celsius (mA / °C).
[0075] For example, Figure 7 As shown, the mobile phone 100 can determine the target current value according to the initial device temperature, the preset safety temperature and the preset temperature rise parameter.
[0076] When the mobile phone 100 starts the first application, the device temperature of the mobile phone 100 is recorded. The device temperature may be referred to as the initial device temperature. Further, the mobile phone 100 determines the target current value corresponding to the change of the mobile phone 100 from the initial device temperature to the preset safety temperature based on the preset temperature rise parameter. The preset safety temperature is pre-configured in the mobile phone 100. For example, the preset safety temperature may be set to a safety temperature (such as 48°C). The target current value may be expressed by the following formula 1:
[0077] Y=(AB)×X Formula 1;
[0078] Among them, Y represents the target current value, X represents the preset temperature rise parameter, B represents the initial device temperature, and A represents the preset safety temperature.
[0079] In the above implementation, the mobile phone 100 can determine the target current value by the initial device temperature when starting the first application and the preset temperature rise parameter, so as to use the target current value as the reference threshold of the load. In different application scenarios, the initial device temperature when the mobile phone 100 starts the first application is different, so 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 embodiment of the present application varies with the operation scenario of the first application, which can better reflect the reference threshold of the load in different application scenarios.
[0080] In some implementations, the mobile phone 100 can perform frame rate control for applications with high load or high frame rate requirements. In this case, before determining the target current value, the mobile phone 100 can also determine whether the first application started 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 requires frame rate control, and the mobile phone 100 executes this 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 require frame rate control, and the mobile phone 100 ends the current frame rate control process.
[0081] Exemplarily, the mobile phone 100 may determine whether the first application is in the preset whitelist in the following two ways:
[0082] The first method: the preset whitelist includes an application type identifier of at least one application type. For example, the preset whitelist includes application type identifiers of one or more of the following application types: application type identifiers of game applications, application type identifiers of video playback applications, and application type identifiers of call applications. Of course, the preset whitelist may also include application type identifiers of other application types, and the application type identifiers in the preset whitelist may be configured as needed, which is not limited in the embodiments of the present application. Mobile phone 100 determines whether the first application belongs to any application type indicated by at least one application type identifier. If the first application belongs to any application type indicated by 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 way: the preset whitelist includes the application identifier of at least one application. For example, the preset whitelist includes the application identifier of at least one of the following applications: the application identifier of one or more game applications, the application identifier of one or more video playback applications, and the application identifier of one or more call applications. The application identifier can be an application name or an application number, etc., which is not limited in the embodiment of the present application. Of course, the preset whitelist may also include other application identifiers, and the application identifiers in the preset whitelist can be configured as needed, which is not limited in the embodiment of the present application. Mobile phone 100 determines whether the application identifier of the first application is any application identifier in the preset whitelist. If the application identifier of the first application is an application identifier in the preset whitelist, it can be considered that the first application is in the preset whitelist. Otherwise, the first application is not in the preset whitelist.
[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 a current sensor. The working current of the mobile phone 100 can reflect the load of the mobile phone 100. The working current of the mobile phone 100 is positively correlated with the load. For example, the larger the working current of the mobile phone 100, the larger the load of the mobile phone 100. The larger 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 working current detection, the mobile phone 100 uses the average value of the working current detected within a certain period of time as the current value of the working current. Figure 7 As shown, the mobile phone 100 uses a sliding window to calculate the average value of the collected working current within a certain time. The time length corresponding to the sliding window can be set according to the actual application scenario or demand, for example, the time length corresponding to the sliding window can be set to a time length of 10 milliseconds.
[0086] After the mobile phone 100 determines the target current value, the intensity of the current working current (which can be recorded as the 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 (current time period), and is the current value of the working current most recently detected by 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 is relatively large at this time, and the mobile phone 100 is in a high load state at this time. 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 executes S603.
[0088] If the first current value of the mobile phone 100 is less than or equal to the target current value, it indicates that the working current of the mobile phone 100 is relatively small at this time, and the mobile phone 100 is in a low load state at this time. If the electronic device continues to run the first application at the current first frame rate, the device temperature of the mobile phone 100 has little effect on the performance of the mobile phone 100. In this case, the mobile phone 100 repeats this step to monitor the load condition of the mobile phone 100 through the working current of the mobile phone 100.
[0089] S603: The mobile phone 100 determines the single-frame power consumption according to the first current value and the first frame rate.
[0090] When the first current value of the mobile phone 100 is greater than the target current value, the load of the mobile phone 100 is relatively large. Figure 7 As shown, the mobile phone 100 determines the single-frame power consumption according to the first current value and the first frame rate. The single-frame power consumption is used to represent the current value corresponding to each frame of the image. For example, the 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 the single-frame power consumption is milliampere per frame (mA / FPS).
[0091] It can be understood that since the working current of the mobile phone 100 can reflect the load condition of the mobile phone 100, the current value corresponding to each frame image determined by the mobile phone 100 through the first current value and the first frame rate can represent the load corresponding to each frame image, that is, the single frame power consumption.
[0092] S604: The mobile phone 100 determines a temperature threshold based on the single-frame power consumption, the target current value, and a preset constraint relationship.
[0093] The preset constraint relationship is used to express the correspondence between the frame rate change value and the temperature change value. For example, the preset constraint relationship is that for every 0.1°C change in device temperature, the frame rate is allowed to be adjusted by 1FPS, that is, a frame rate change value of 1FPS corresponds to a temperature change value of 0.1°C. The preset constraint relationship can be set according to actual application scenarios or requirements. Under the effect of the preset constraint relationship, the frame rate adjustment amplitude of the mobile phone 100 will be limited, so that the amplitude of each frame rate change is within a certain range, thereby reducing the impact of frame rate changes on user experience.
[0094] In some implementations, such as Figure 7 As shown, the mobile phone 100 can determine the target frame rate corresponding to the target current value based on the power consumption of a single frame. For example, the mobile phone calculates the ratio of the target current value to the power consumption of a single frame to obtain the target frame rate corresponding to the target current value. The mobile phone 100 then determines the temperature threshold based on the frame rate interval between the target frame rate and the first frame rate and the preset constraint relationship. For example, the mobile phone 100 calculates the difference between the target frame rate and the first frame rate, determines 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 the preset constraint relationship.
[0095] It is understandable that since the heat generated by the working current needs to accumulate for a certain period of time before it is reflected in the device temperature, 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 yet reached the preset safety temperature corresponding to the target current value. In order to make the device temperature of the mobile phone 100 lower than the preset safety temperature, it is necessary to pre-adjust the frame rate before the device temperature of the mobile phone 100 reaches the preset safety temperature to control the device temperature of the mobile phone 100 below the preset safety temperature. Based on this, when the first current value of the mobile phone 100 is greater than the target current value, the temperature threshold is calculated, so that the temperature threshold can be used as a judgment condition for starting to adjust the frame rate, so as to pre-adjust the frame rate before the device temperature reaches the preset safety temperature.
[0096] For example, taking the preset constraint relationship that the frame rate change value 1FPS corresponds to the temperature change value 0.1°C as an example, the mobile phone 100 can calculate the temperature threshold value by the following formula 2:
[0097] Ts = A- 0.1×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 (expressed as F1) and the target frame rate (expressed as F2), that is, Fr = F1-F2. The target frame rate F2 is equal to the ratio of the target current (expressed as Y) to the single frame power consumption (expressed as W), that is, F2 = Y / W. The single frame power consumption W is equal to the ratio of the first current value (expressed as AI) to the first frame rate (expressed as F1), that is, W = AI / F1.
[0099] It is understandable that in order to make the device temperature of the mobile phone 100 less than or equal to the preset safety temperature, the operating 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 through the above formula 2. The temperature threshold can be used as the starting temperature for the mobile phone 100 to adjust the frame rate. For example, 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 pre-adjust the frame rate 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 temperature of the first device is greater than a temperature threshold.
[0102] like Figure 7 As shown, the mobile phone 100 can periodically collect 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 based on one or more of the housing temperature, the battery temperature, and the chip temperature. For example, the device temperature includes one or more of the housing temperature, the battery temperature, and the chip temperature. For another example, the device temperature is obtained by fusion calculation of the housing temperature and the battery temperature. By way of example, the housing temperature can include one or more of the front housing temperature and the rear housing temperature.
[0103] The first device temperature is the device temperature currently detected by the mobile phone 100, that is, the device temperature most recently acquired by the mobile phone 100. After determining the temperature threshold, the mobile phone 100 can compare the current first device temperature of the mobile phone 100 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 has reached the starting temperature for adjusting the frame rate. 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 executes 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 has not yet reached the starting temperature for 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, and the performance of the mobile phone 100 will be less affected. In this case, the mobile phone 100 repeats this 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 rate of change of the operating current.
[0107] Since the heat generated by the working current of the mobile phone 100 will not be reflected in the device temperature until it accumulates to a certain extent, the device temperature has a lag compared to the working current. The larger the working current of the mobile phone 100, the greater the heat generated by the working current, and the higher the device temperature of the mobile phone 100. It can be seen that the working current is positively correlated with the device temperature, and the rate of change of the working current can reflect the rate of change of the device temperature. In order to improve the accuracy of frame rate adjustment, the mobile phone 100 can adjust the frame rate of the image frame generated by the mobile phone 100 by the rate of change of the working current. For example, the greater the rate of change of the working 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 working current of the mobile phone 100 can be determined based on the first current value and the current value of the working current collected before the first time period (which can be called the third current value). For example, the mobile phone 100 periodically obtains the current value of the working current. The rate of change of the working 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. Among them, the current detection period is the time interval for obtaining two adjacent current values. For example, the mobile phone 100 obtains a current value every 5 milliseconds, and the current detection period is 5 milliseconds.
[0109] In order to further improve the accuracy of the frame rate adjustment of the mobile phone 100, in other implementations, the mobile phone 100 predicts a second current value of the working current, which is the current value corresponding to the device temperature of the mobile phone 100 in the second time period after the first time period. The first current value is the current value most recently detected by the mobile phone 100 (for the first time period), and the second current value is the current value of the working current predicted by the mobile phone 100 in the future (corresponding to the second time period). For example, the mobile phone 100 can predict the second current value of the working current based on the changing trend of the working current. Furthermore, the mobile phone 100 determines the rate of change of the working current based on the second current value and the first current value. For example, the rate of change of the working 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, Figure 7 As shown, the mobile phone 100 can use the preset current prediction model to predict the second current value (i.e., predict the future device temperature). The mobile phone 100 sequentially obtains multiple third current values before the first time period according to the time period (i.e., multiple second time periods). Further, the mobile phone 100 uses the preset current prediction model to predict the second current value based on the first current value and multiple third current values.
[0111] The preset current prediction model can establish a change trend of the working current based on the first current value and the plurality of third current values, thereby predicting the second current value of the working current. 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 obtained by the following formula:
[0112] Formula 3 is used to express:
[0113]
[0114] Among them, I t+1 is the predicted second current value; I t is the first current value corresponding to the first time period; I t-1 ,I t-2 ,……,I t-p are third current values acquired in sequence according to time periods (i.e., multiple second time periods); are all model parameters of the preset current prediction model; c is a preset common sense item; ε t is a random error term.
[0115] When the mobile phone 100 predicts the second current value using the preset current prediction model, the first current value and the obtained plurality of third current values may be input into the preset current prediction model to obtain the predicted second current value.
[0116] The above-mentioned preset current prediction model is obtained by training the autoregressive model. For example, the mobile phone 100 inputs the sample current values of multiple first historical time periods collected continuously into the autoregressive model, and uses the autoregressive model to output the predicted current value of the second historical time period. The second historical time period is the time period after the first historical time period. Furthermore, the mobile phone 100 calculates the residual between the current value actually detected in the second historical time period (which can be called the actual observation value) and the predicted current value. The mobile phone 100 uses the least squares method to minimize the random error term in the autoregressive model so that the sum of the residuals calculated multiple times is minimized, 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 presetting the current prediction model, the mobile phone 100 can predict the current value at time t+1 based on multiple current values obtained over a period of time. Figure 7 As shown, the mobile phone 100 determines the rate of change of the operating current by the predicted 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] Where, 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; Δt is the unit time, that is, the current detection cycle of the working current.
[0120] In some implementations, such as Figure 7 As shown, the mobile phone 100 determines the frame rate adjustment amplitude according to the change rate of the working current, and adjusts the frame rate from the first frame rate to the second frame rate according to the frame rate adjustment amplitude.
[0121] For example, since the device temperature has a hysteresis, the device temperature can be reflected by the working current. The mobile phone 100 determines the rate of change of the device temperature through the corresponding relationship between the working current and the device temperature, such as through the above-mentioned preset temperature rise parameter. The rate of change of the device temperature can be expressed by the following formula 5:
[0122] ΔTemp=(I t+1 -I t ) / Δt / X Formula 5;
[0123] Where Δ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, that is, the current detection cycle of the working current; X is the preset temperature rise parameter.
[0124] Further, the mobile phone 100 determines the frame rate adjustment amplitude according to the rate of change of the device temperature. The frame rate adjustment amplitude is the change value of the frame rate. The frame rate adjustment amplitude can be determined by the following formula 6:
[0125] V_FPSv=(ΔTemp-a)×|ΔTemp-0.1|×scal1 Formula 6;
[0126] Wherein, V_FPSv is the frame rate adjustment amplitude 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. scal1 is a first preset constant.
[0127] After determining the frame rate adjustment amplitude, the mobile phone 100 adjusts the frame rate based on the first frame rate by the frame rate adjustment amplitude, and adjusts the frame rate from the first frame rate to the second frame rate. For example, the second frame rate is equal to the difference between the first frame rate and the frame rate adjustment amplitude. For another example, the frame rate adjustment amplitude has positive and negative values, and the second frame rate is equal to the sum of the first frame rate and the frame rate adjustment amplitude.
[0128] In some other 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 the first adjustment amplitude based on the first device temperature of the mobile phone 100, and determine the second adjustment amplitude based on the rate of change of the working current of the mobile phone 100. The frame rate adjustment amplitude is further determined based on the first adjustment amplitude and the second adjustment amplitude. In this way, the mobile phone 100 can comprehensively consider the impact of the current device temperature and the rate of change of the working current on the frame rate, determine the frame rate adjustment amplitude, and improve the accuracy of the frame rate adjustment amplitude.
[0129] Exemplarily, since the device temperature has a hysteresis, the device temperature can be predicted by the operating current. The mobile phone 100 can predict the second device temperature of the mobile phone 100 based on the first device temperature of the mobile phone 100 and the rate of change of the operating current. Among them, the first device temperature is the device temperature of the mobile phone 100 in the first time period (actual observation value). The second device temperature is the device temperature of the mobile phone 100 in the second time period (predicted observation value). The second device temperature can be expressed by the following formula 7:
[0130] Temp t+1 =Temp t +ΔTemp formula 7;
[0131] Among them, Temp t+1 is the second device temperature; Temp t is the first device temperature; ΔTemp is the rate of change of the device temperature.
[0132] Further, the mobile phone 100 determines the first adjustment amplitude according to the second device temperature, and determines the second adjustment amplitude according to the rate of change of the working 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] Among them, V_FPS T is the first adjustment amplitude determined based on the device temperature; Temp normal is the standardized temperature, which is determined based on the second device temperature and the intermediate temperature. For example, the standardized temperature is equal to the difference between the second device temperature and the intermediate temperature. The intermediate temperature is V_FPS T The value of the standardized temperature when it is 0; scal2 is the 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 the final frame rate adjustment amplitude. Exemplarily, the frame rate adjustment amplitude can be determined according to the first adjustment amplitude and the second adjustment amplitude by the following formula 9:
[0136]
[0137] Among them, 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 preset minimum unit of frame rate change, such as 1FPS.
[0138] Through the above-mentioned various implementation methods, the device temperature and the changing trend of the device temperature can be predicted by the working current, so that the timeliness of the frame rate adjustment can be improved and the frame rate adjustment can be made more accurate.
[0139] It is understandable that the mobile phone 100 may repeatedly perform 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 frame rate adjustment period may 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 rate of change of the working current.
[0140] The following is an example of the workflow of the software module of the mobile phone 100 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. Figure 8 The application layer of the mobile phone 100 includes game applications, the application 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 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] Exemplarily, 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 working. 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. Among them, the current module and the temperature module can obtain the current value and 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 the target frame rate corresponding to the preset safety temperature based on the single-frame power consumption. The temperature calculation submodule further determines the temperature threshold based on the target frame rate and the preset constraint relationship. The temperature calculation submodule transmits the temperature threshold to the frame rate calculation submodule. The frame rate calculation submodule uses the preset current prediction model and the current value of the working current to predict the rate of change of the device temperature in the future. The frame rate calculation submodule calculates the frame rate adjustment amplitude based on the rate of change of the device temperature, and transmits the frame rate adjustment amplitude to the frame rate adjustment submodule.
[0143] The frame rate adjustment submodule determines the 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 to generate an image through the second frame rate, setting the refresh rate of the screen through the second frame rate, etc.
[0144] The method provided in the embodiment of the present application can set the temperature threshold for frame rate adjustment according to different application scenarios, so that the frame rate control strategy can be adapted to the application scenario. In addition, the frame rate can be adjusted by the rate of change of the working current, so that the frame rate can be controlled in time, making the frame rate control more accurate and reducing the lag of the frame rate adjustment.
[0145] In some other embodiments of the present application, an electronic device is provided, including: 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 the various functions or steps in the above method embodiments. Of course, the electronic device can also include other hardware structures. For example, the electronic device also includes hardware structures such as sensors and communication modules. The structure of the electronic device can refer to Figure 4 The structure of the mobile phone 100 is shown.
[0146] The embodiment of the present application also provides a chip system, which is 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 by lines. For example, the interface circuit can be used to receive signals from other devices (such as memory). For another example, the interface circuit can be used to send signals to other devices (such as processors). Exemplarily, the interface circuit can read 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 the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
[0147] An embodiment of the present application also provides a computer-readable storage medium, which includes a computer program. When the computer program runs on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.
[0148] The embodiment of the present application also provides a computer program product, including a computer program, which, when executed on a computer, enables the computer to perform each function or step in the above method embodiment. For example, the computer may be the above electronic device.
[0149] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0150] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0151] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0152] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0153] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0154] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions 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 in that: Applied to electronic equipment, the method comprises: In the process of running the first application at the first frame rate, if the first current value of the electronic device is greater than the target current value, determining the temperature threshold value according to the single-frame power consumption of the electronic device, the target current value and a preset constraint relationship, wherein the first current value is the current value of the working current of the electronic device in the first time period, the single-frame power consumption represents the current value corresponding to each frame of image generated by the electronic device, and the preset constraint relationship is used to represent the corresponding relationship between the frame rate change value and the temperature change value; If 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 rate of change of the operating current of the electronic device.
2. The method according to claim 1, characterized in that Before determining the temperature threshold according to the single-frame power consumption of the electronic device, the target current value and the preset constraint relationship, the method further includes: Acquire an initial device temperature of the electronic device, where the initial device temperature is the device temperature when the electronic device starts the first application; Based on a preset temperature rise parameter, a target current value corresponding to a change from the initial device temperature to a preset safety temperature is determined, wherein the preset temperature rise parameter is used to indicate a heat generation capacity of an operating current of the electronic device.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: The single-frame power consumption of the electronic device is determined according to the first current value and the first frame rate.
4. The method according to any one of claims 1 to 3, characterized in that The determining of the temperature threshold according to the single-frame power consumption of the electronic device, the target current value and the preset constraint relationship includes: Determining a target frame rate corresponding to the target current value according to the single-frame power consumption; Determining a frame rate interval between the target frame rate and the first frame rate; The temperature threshold is determined according to the frame rate interval and the preset constraint relationship.
5. The method according to any one of claims 1 to 4, characterized in that According to the rate of change of the working current of the electronic device, adjusting the frame rate of the electronic device from the first frame rate to the second frame rate includes: Determining a frame rate adjustment amplitude according to a rate of change of an operating current of the electronic device; The frame rate of the electronic device is adjusted from the first frame rate to a second frame rate according to the frame rate adjustment amplitude.
6. The method according to claim 5, characterized in that Determining the frame rate adjustment amplitude according to the change rate of the working current of the electronic device includes: The frame rate adjustment amplitude is determined according to a first device temperature of the electronic device and a change rate of the operating current.
7. The method according to claim 6, characterized in that Determining the frame rate adjustment amplitude according to a first device temperature of the electronic device and a change rate of the operating current includes: Determining a first adjustment amplitude according to a first device temperature of the electronic device; Determining a second adjustment amplitude according to a rate of change of an operating current of the electronic device; The frame rate adjustment amplitude is determined according to the first adjustment amplitude and the second adjustment amplitude.
8. The method according to claim 7, characterized in that Determining a first adjustment amplitude according to a first device temperature of the electronic device includes: predicting a second device temperature of the electronic device according to the first device temperature of the electronic device and the rate of change of the operating current; A first adjustment amplitude is determined according to the second device temperature.
9. The method according to claim 7 or 8, characterized in that: The determining the second adjustment amplitude according to the rate of change of the operating current of the electronic device comprises: Predicting a rate of change of a device temperature of the electronic device according to a rate of change of an operating current of the electronic device; A second adjustment amplitude is determined according to a rate of change of the device temperature.
10. The method according to any one of claims 1 to 9, characterized in that The method further comprises: Predicting a second current value of the electronic device according to the first current value, where the second current value is a current value of the working current of the electronic device after the first time period; The change rate of the operating current of the electronic device is determined according to the second current value of the electronic device and the first current value.
11. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a computer program stored in the memory, and when the processor runs the computer program, the electronic device executes the method according to any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 10.
13. A computer program product, characterized in that The invention comprises a computer program, which, when executed by an electronic device, enables the electronic device to execute the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Frequency adjustment method and apparatus applied to terminal, and electronic device
CN112789651A
Picture frame rate adjusting method, electronic device and computer readable storage medium
CN114510209A
Rendering format selection method and related equipment thereof
CN115880127A
Electronic equipment operation method and device and electronic equipment
CN116048217A
Application frame rate smoothing method, electronic equipment and storage medium
CN116680153A
